]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] fork: fix race in setting child's pgrp and tty
authorOren Laadan <orenl@cs.columbia.edu>
Sun, 8 Jan 2006 09:03:51 +0000 (01:03 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 9 Jan 2006 04:14:00 +0000 (20:14 -0800)
commitcf47e8ac299a5aee64b318caf557517bc59731f6
tree41d1be6513fc3a5367414654eeaf11bbb12d4814
parent0eb52c30265432aaecf5443dca739dc1e094bb6f
[PATCH] fork: fix race in setting child's pgrp and tty

In fork, child should recopy parent's pgrp/tty after it has tasklist_lock.
Otherwise following a setpgid() on the parent, *after* copy_signal(), the
child will own a stale pgrp (which may be reused); (eg.  if copy_mm()
sleeps a long while due to memory pressure).  Similar issue for the tty.

Signed-off-by: Oren Laadan <orenl@cs.columbia.edu>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/fork.c