]> Git Repo - linux.git/commit
[PATCH] tty: ->signal->tty locking
authorPeter Zijlstra <[email protected]>
Fri, 8 Dec 2006 10:36:04 +0000 (02:36 -0800)
committerLinus Torvalds <[email protected]>
Fri, 8 Dec 2006 16:28:38 +0000 (08:28 -0800)
commit24ec839c431eb79bb8f6abc00c4e1eb3b8c4d517
tree2ff478b1925159eeac007913c2a8f19d5f5e6010
parent562f9c574e0707f9159a729ea41faf53b221cd30
[PATCH] tty: ->signal->tty locking

Fix the locking of signal->tty.

Use ->sighand->siglock to protect ->signal->tty; this lock is already used
by most other members of ->signal/->sighand.  And unless we are 'current'
or the tasklist_lock is held we need ->siglock to access ->signal anyway.

(NOTE: sys_unshare() is broken wrt ->sighand locking rules)

Note that tty_mutex is held over tty destruction, so while holding
tty_mutex any tty pointer remains valid.  Otherwise the lifetime of ttys
are governed by their open file handles.  This leaves some holes for tty
access from signal->tty (or any other non file related tty access).

It solves the tty SLAB scribbles we were seeing.

(NOTE: the change from group_send_sig_info to __group_send_sig_info needs to
       be examined by someone familiar with the security framework, I think
       it is safe given the SEND_SIG_PRIV from other __group_send_sig_info
       invocations)

[[email protected]: 3270 fix]
[[email protected]: various post-viro fixes]
Signed-off-by: Peter Zijlstra <[email protected]>
Acked-by: Alan Cox <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Chris Wright <[email protected]>
Cc: Roland McGrath <[email protected]>
Cc: Stephen Smalley <[email protected]>
Cc: James Morris <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Jeff Dike <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Jan Kara <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
12 files changed:
arch/sparc64/solaris/misc.c
arch/um/kernel/exec.c
drivers/char/tty_io.c
drivers/s390/char/fs3270.c
fs/dquot.c
fs/open.c
include/linux/tty.h
kernel/acct.c
kernel/auditsc.c
kernel/exit.c
kernel/sys.c
security/selinux/hooks.c
This page took 0.056496 seconds and 4 git commands to generate.