WSL2-Linux-Kernel/drivers/s390
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
..
block [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
char [PATCH] tty: ->signal->tty locking 2006-12-08 08:28:38 -08:00
cio [PATCH] More work_struct induced breakage (s390) 2006-12-06 14:51:14 -08:00
crypto [PATCH] More work_struct induced breakage (s390) 2006-12-06 14:51:14 -08:00
net [PATCH] More work_struct induced breakage (s390) 2006-12-06 14:51:14 -08:00
scsi [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
Kconfig [S390] Linux API for writing z/VM APPLDATA Monitor records. 2006-09-20 15:59:34 +02:00
Makefile [PATCH] s390: move s390_root_dev_* out of the cio layer 2006-01-06 08:33:49 -08:00
ebcdic.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
s390_rdev.c [PATCH] s390: kzalloc() conversion in drivers/s390 2006-03-24 07:33:18 -08:00
s390mach.c [PATCH] replace cad_pid by a struct pid 2006-10-02 07:57:25 -07:00
s390mach.h [PATCH] s390: Add missing memory constraint to stcrw() 2006-02-01 08:53:24 -08:00
sysinfo.c [S390] cleanup sysinfo and add system z9 specific extensions. 2006-09-20 15:59:10 +02:00