linux/arch/um/kernel
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
..
skas [PATCH] uml: correct removal of pte_mkexec 2006-10-11 11:14:20 -07:00
tt [PATCH] uml ubd driver: various little changes 2006-10-31 08:07:00 -08:00
Makefile
asm-offsets.c
config.c.in
dyn.lds.S [PATCH] uml: add _text definition to linker scripts 2006-10-31 08:07:00 -08:00
exec.c [PATCH] tty: ->signal->tty locking 2006-12-08 08:28:38 -08:00
exitcode.c
gmon_syms.c
gprof_syms.c
init_task.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
initrd.c
irq.c [PATCH] uml: split memory allocation prototypes out of user.h 2006-10-20 10:26:36 -07:00
ksyms.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
mem.c
physmem.c
process.c [PATCH] uml: split memory allocation prototypes out of user.h 2006-10-20 10:26:36 -07:00
ptrace.c
reboot.c
resource.c
sigio.c [PATCH] uml pt_regs fixes 2006-10-08 16:34:08 -07:00
signal.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
smp.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
syscall.c
sysrq.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
time.c [PATCH] uml pt_regs fixes 2006-10-08 16:34:08 -07:00
tlb.c
trap.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
uaccess.c
um_arch.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
umid.c
uml.lds.S [PATCH] uml: add _text definition to linker scripts 2006-10-31 08:07:00 -08:00
vmlinux.lds.S