Module Name: src Committed By: ryo Date: Fri Nov 26 08:06:12 UTC 2021
Modified Files: src/sys/compat/common: kern_sig_16.c src/sys/compat/netbsd32: netbsd32_compat_16.c src/sys/kern: kern_exec.c src/sys/sys: exec.h Log Message: Fix anonymous memory object leak for sigcode. - Repeating "modload compat_linux && /emul/linux/bin/ls && modunload compat_linux" will reproduce this problem. - It cause in exec_sigcode_map(), anon-object for sigcode was created at first exec, but it remained even after exec_remove. - Fixed that the anon-object for sigcode is created at exec_add(), and the anon-object reference is removed at exec_remove(). - sigobject_lock is no longer needed since it is locked by exec_lock. - The compat_16 module rewrites the e_sigcode entry in emul_netbsd directly and does not use exec_add()/exec_remove(), so it needs to call sigcode_alloc()/sigcode_free() on its own. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/common/kern_sig_16.c cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_compat_16.c cvs rdiff -u -r1.513 -r1.514 src/sys/kern/kern_exec.c cvs rdiff -u -r1.160 -r1.161 src/sys/sys/exec.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.