]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] send_sigqueue: simplify and fix the race
authorOleg Nesterov <oleg@tv-sign.ru>
Wed, 29 Mar 2006 00:11:30 +0000 (16:11 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 29 Mar 2006 02:36:44 +0000 (18:36 -0800)
commitc829a17cdc750a107af4ad852f6c80990f251d9e
tree91759a5584b9d42302d4b54ecdde644bc47e781d
parent1321d1e333fc838b1e18cb999f77b169089f91f0
[PATCH] send_sigqueue: simplify and fix the race

send_sigqueue() checks PF_EXITING, then locks p->sighand->siglock.  This is
unsafe: 'p' can exit in between and set ->sighand = NULL.  The race is
theoretical, the window is tiny and irqs are disabled by the caller, so I
don't think we need the fix for -stable tree.

Convert send_sigqueue() to use lock_task_sighand() helper.

Also, delete 'p->flags & PF_EXITING' re-check, it is unneeded and the
comment is wrong.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/signal.c