Messages in this thread Patch in this message | | | Date | Wed, 08 Feb 2006 21:08:51 +0300 | From | Oleg Nesterov <> | Subject | [PATCH] fix copy_sighand() vs do_sigaction() race |
| |
copy_sighand() should hold ->sighand->siglock while copying ->sighand->action, another thread may be doing sigaction().
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- RC-1/kernel/fork.c~ 2006-02-07 01:41:14.000000000 +0300 +++ RC-1/kernel/fork.c 2006-02-08 23:38:56.000000000 +0300 @@ -766,7 +766,9 @@ static inline int copy_sighand(unsigned return -ENOMEM; spin_lock_init(&sig->siglock); atomic_set(&sig->count, 1); + spin_lock_irq(¤t->sighand->siglock); memcpy(sig->action, current->sighand->action, sizeof(sig->action)); + spin_unlock_irq(¤t->sighand->siglock); return 0; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |