[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) [schwidefsky@de.ibm.com: 3270 fix] [akpm@osdl.org: various post-viro fixes] Signed-off-by:Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by:
Alan Cox <alan@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Roland McGrath <roland@redhat.com> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: James Morris <jmorris@namei.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Jan Kara <jack@ucw.cz> Signed-off-by:
Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
Showing
- arch/sparc64/solaris/misc.c 1 addition, 3 deletionsarch/sparc64/solaris/misc.c
- arch/um/kernel/exec.c 4 additions, 3 deletionsarch/um/kernel/exec.c
- drivers/char/tty_io.c 141 additions, 96 deletionsdrivers/char/tty_io.c
- drivers/s390/char/fs3270.c 8 additions, 4 deletionsdrivers/s390/char/fs3270.c
- fs/dquot.c 8 additions, 6 deletionsfs/dquot.c
- fs/open.c 1 addition, 0 deletionsfs/open.c
- include/linux/tty.h 6 additions, 5 deletionsinclude/linux/tty.h
- kernel/acct.c 3 additions, 6 deletionskernel/acct.c
- kernel/auditsc.c 2 additions, 0 deletionskernel/auditsc.c
- kernel/exit.c 1 addition, 3 deletionskernel/exit.c
- kernel/sys.c 4 additions, 2 deletionskernel/sys.c
- security/selinux/hooks.c 7 additions, 4 deletionssecurity/selinux/hooks.c
Loading
Please register or sign in to comment