mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix copy_sighand() vs do_sigaction() race
@ 2006-02-08 18:08 Oleg Nesterov
       [not found] ` <43EA3611.3F4BC29D@tv-sign.ru>
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2006-02-08 18:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

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(&current->sighand->siglock);
 	memcpy(sig->action, current->sighand->action, sizeof(sig->action));
+	spin_unlock_irq(&current->sighand->siglock);
 	return 0;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-09 18:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-08 18:08 [PATCH] fix copy_sighand() vs do_sigaction() race Oleg Nesterov
     [not found] ` <43EA3611.3F4BC29D@tv-sign.ru>
     [not found]   ` <Pine.LNX.4.64.0602080907460.2458@g5.osdl.org>
2006-02-09 19:41     ` [PATCH] sys_signal: initialize ->sa_mask Oleg Nesterov
2006-02-09 19:41     ` [PATCH] do_sigaction: cleanup ->sa_mask manipulation Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome