linux/drivers/char
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
..
agp [PATCH] agp-amd64: section mismatches with HOTPLUG=n 2006-12-07 08:39:40 -08:00
drm [PATCH] mm: incorrect VM_FAULT_OOM returns from drivers 2006-12-07 08:39:20 -08:00
hw_random [PATCH] allow hwrandom core to be a module 2006-12-07 08:39:39 -08:00
ip2 [PATCH] char: ip2 remove broken macro 2006-12-07 08:39:43 -08:00
ipmi [PATCH] IPMI: fix PROC_FS=n warnings 2006-12-07 08:39:48 -08:00
mwave IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
pcmcia [PATCH] generic HDLC synclink config mismatch fix 2006-12-07 08:39:45 -08:00
rio [PATCH] ioremap balanced with iounmap for drivers/char/rio/rio_linux.c 2006-12-07 08:39:30 -08:00
tpm [PATCH] Correct misc_register return code handling in several drivers 2006-12-07 08:39:35 -08:00
watchdog Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
.gitignore [MIPS] Remove IT8172-based platforms, ITE 8172G and Globespan IVR support. 2006-10-03 17:59:17 +01:00
amiserial.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
applicom.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
applicom.h
briq_panel.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
cd1865.h
ChangeLog
consolemap.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cp437.uni
cs5535_gpio.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
cyclades.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
decserial.c [PATCH] dz: Fixes to make it work 2006-12-07 08:39:41 -08:00
defkeymap.c_shipped
defkeymap.map
digi1.h [PATCH] Clean up the old digi support and rescue it 2005-09-07 16:57:20 -07:00
digi.h
digiFep1.h [PATCH] Clean up the old digi support and rescue it 2005-09-07 16:57:20 -07:00
digiPCI.h
ds1286.c [PATCH] proper flags type of spin_lock_irqsave() 2006-10-01 00:39:21 -07:00
ds1302.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
ds1620.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
dsp56k.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
dtlk.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
ec3104_keyb.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
efirtc.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
epca.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
epca.h [PATCH] char: kill unneeded memsets 2006-10-04 07:55:13 -07:00
epcaconfig.h
esp.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
generic_nvram.c [PATCH] powerpc: Kill _machine and hard-coded platform numbers 2006-03-28 23:15:54 +11:00
generic_serial.c [PATCH] char: kill unneeded memsets 2006-10-04 07:55:13 -07:00
genrtc.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
hangcheck-timer.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
hpet.c [PATCH] severing poll.h -> mm.h 2006-12-04 02:00:36 -05:00
hvc_console.c [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
hvc_console.h [POWERPC] Make the hvc_console output buffer size settable 2006-07-13 18:53:32 +10:00
hvc_iseries.c Merge branch 'master' of git://oak/home/sfr/kernels/iseries/work 2006-10-04 15:02:27 +10:00
hvc_rtas.c [POWERPC] Make the hvc_console output buffer size settable 2006-07-13 18:53:32 +10:00
hvc_vio.c [POWERPC] The two vio HVC backends clash 2006-09-25 13:30:51 +10:00
hvcs.c [PATCH] HVCS char driver janitoring: move block of code 2006-12-07 08:39:38 -08:00
hvsi.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
i8k.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
ip27-rtc.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
isicom.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
istallion.c [PATCH] ioremap balanced with iounmap for drivers/char/istallion.c 2006-12-07 08:39:30 -08:00
Kconfig Remove long-unmaintained ftape driver subsystem. 2006-12-03 22:22:41 -05:00
keyboard.c Input: drivers/char/keyboard.c - small cleanup in k_cur() 2006-11-04 22:09:08 -05:00
lcd.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
lcd.h Resurrect Cobalt support for 2.6. 2005-10-29 19:30:42 +01:00
lp.c [PATCH] There is no devfs, there has never been a devfs, we have always been at war with... 2006-09-29 09:18:10 -07:00
Makefile Remove long-unmaintained ftape driver subsystem. 2006-12-03 22:22:41 -05:00
mbcs.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
mbcs.h
mem.c Driver core: change mem class_devices to be real devices 2006-12-01 14:52:00 -08:00
misc.c [PATCH] Correct misc_register return code handling in several drivers 2006-12-07 08:39:35 -08:00
mmtimer.c [PATCH] Correct misc_register return code handling in several drivers 2006-12-07 08:39:35 -08:00
moxa.c [PATCH] ioremap balanced with iounmap for drivers/char/moxa.c 2006-12-07 08:39:30 -08:00
mspec.c [PATCH] mspec driver build fix 2006-11-13 07:40:42 -08:00
mxser.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
mxser.h [PATCH] Typo fixes 2006-03-28 09:16:08 -08:00
n_hdlc.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
n_r3964.c [PATCH] R3964: fix GFP_KERNEL allocations in timer function 2006-06-25 10:01:17 -07:00
n_tty.c [PATCH] remove TTY_DONT_FLIP 2006-06-28 14:59:05 -07:00
nsc_gpio.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
nvram.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
nwbutton.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
nwbutton.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
nwflash.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
pc8736x_gpio.c [PATCH] drivers/char/pc8736x_gpio.c: remove unused static functions 2006-09-29 09:18:05 -07:00
ppdev.c Driver core: convert ppdev code to use struct device 2006-12-01 14:52:00 -08:00
pty.c [PATCH] const struct tty_operations 2006-10-02 07:57:14 -07:00
random.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-05 14:37:56 +00:00
raw.c Driver core: convert raw device code to use struct device 2006-12-01 14:51:59 -08:00
riscom8_reg.h
riscom8.c [PATCH] remove drivers/char/riscom8.c:baud_table[] 2006-12-07 08:39:44 -08:00
riscom8.h
rocket_int.h [PATCH] drivers/char/rocket.c: cleanups 2005-06-25 16:25:04 -07:00
rocket.c [PATCH] const struct tty_operations 2006-10-02 07:57:14 -07:00
rocket.h
rtc.c [RTC] Consistently use of tabs for formatting. 2006-10-09 23:20:47 +01:00
scan_keyb.c
scan_keyb.h
scc.h [PATCH] m68k: static vs. extern in scc.h 2006-01-12 09:09:00 -08:00
scx200_gpio.c [PATCH] scx200_gpio export cleanups 2006-09-29 09:18:06 -07:00
selection.c [PATCH] tty locking on resize 2006-09-29 09:18:12 -07:00
ser_a2232.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
ser_a2232.h
ser_a2232fw.ax
ser_a2232fw.h
serial167.c [PATCH] drivers/{char|isdn}: work_struct-induced breakage 2006-12-06 11:09:08 -08:00
snsc_event.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
snsc.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
snsc.h [IA64-SGI] Handle SC env. powerdown events 2006-01-26 13:32:26 -08:00
sonypi.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
specialix_io8.h
specialix.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
stallion.c [PATCH] drivers/{char|isdn}: work_struct-induced breakage 2006-12-06 11:09:08 -08:00
sx.c [PATCH] sx: fix user-visible typo (devic) 2006-10-17 08:18:45 -07:00
sx.h
sxboards.h
sxwindow.h
synclink_gt.c [PATCH] generic HDLC synclink config mismatch fix 2006-12-07 08:39:45 -08:00
synclink.c [PATCH] generic HDLC synclink config mismatch fix 2006-12-07 08:39:45 -08:00
synclinkmp.c [PATCH] generic HDLC synclink config mismatch fix 2006-12-07 08:39:45 -08:00
sysrq.c [PATCH] SysRq-X: show blocked tasks 2006-12-07 08:39:32 -08:00
tb0219.c [PATCH] make more file_operation structs static 2006-07-03 15:26:59 -07:00
tipar.c [PATCH] pr_debug: tipar: repair nonexistant pr_debug argument use 2006-10-03 08:04:19 -07:00
tlclk.c [PATCH] tlclk: fix platform_device_register_simple() error check 2006-11-25 13:28:34 -08:00
toshiba.c [PATCH] export toshiba SMM support for neofb module 2006-12-07 08:39:40 -08:00
tty_io.c [PATCH] tty: ->signal->tty locking 2006-12-08 08:28:38 -08:00
tty_ioctl.c [PATCH] Fix locking for tty drivers when doing urgent characters 2006-09-29 09:18:24 -07:00
vc_screen.c Driver core: convert vc code to use struct device 2006-12-01 14:51:59 -08:00
viocons.c [POWERPC] Fix viocons for irq breakage 2006-10-07 10:10:27 +10:00
viotape.c [POWERPC] iseries: Small viotape cleanup allowed by devfs removal 2006-07-13 18:56:00 +10:00
vme_scc.c [PATCH] m68k pt_regs fixes 2006-10-07 10:51:14 -07:00
vr41xx_giu.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
vt_ioctl.c [PATCH] vt: Make vt_pid a struct pid (making it pid wrap around safe). 2006-10-02 07:57:14 -07:00
vt.c [PATCH] add return value checking of get_user() in set_vesa_blanking() 2006-12-07 08:39:40 -08:00