linux/arch/sparc64/solaris
Peter Zijlstra 24ec839c43 [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>
2006-12-08 08:28:38 -08:00
..
conv.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
entry64.S [SPARC64]: Mark __ex_table section correctly. 2006-03-04 23:23:56 -08:00
fs.c [PATCH] VFS: Make filldir_t and struct kstat deal in 64-bit inode numbers 2006-10-03 08:03:40 -07:00
ioctl.c [PATCH] files: lock-free fd look-up 2005-09-09 13:57:55 -07:00
ipc.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
misc.c [PATCH] tty: ->signal->tty locking 2006-12-08 08:28:38 -08:00
signal.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
socket.c [NET]: Fix memory leak in sys_{send,recv}msg() w/compat 2005-08-09 15:29:19 -07:00
socksys.c [SPARC64]: Fix section-mismatch errors in solaris emul module. 2006-09-25 16:39:55 -07:00
socksys.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
systbl.S [SPARC]: Wire up sys_unshare(). 2006-02-07 18:11:24 -08:00
timod.c [PATCH] gfp_t: remaining bits of arch/* 2005-10-28 08:16:51 -07:00