mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
[PATCH] copy_process: cleanup bad_fork_cleanup_sighand
The only caller of exit_sighand(tsk) is copy_process's error path. We can call __exit_sighand() directly and kill exit_sighand(). This 'tsk' was not yet registered in pid_hash[] or init_task.tasks, it has no external references, nobody can see it, and IF (clone_flags & CLONE_SIGHAND) At least 'current' has a reference to ->sighand, this means atomic_dec_and_test(sighand->count) can't be true. ELSE Nobody can see this ->sighand, this means we can free it without any locking. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: "Paul E. McKenney" <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
a9e88e84b5
commit
7001510d0c
3 changed files with 2 additions and 16 deletions
|
@ -1208,7 +1208,8 @@ bad_fork_cleanup_mm:
|
|||
bad_fork_cleanup_signal:
|
||||
exit_signal(p);
|
||||
bad_fork_cleanup_sighand:
|
||||
exit_sighand(p);
|
||||
if (p->sighand)
|
||||
__exit_sighand(p);
|
||||
bad_fork_cleanup_fs:
|
||||
exit_fs(p); /* blocking */
|
||||
bad_fork_cleanup_files:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue