1
0
Fork 0
alistair23-linux/drivers
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
..
acorn IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
acpi Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-05 17:01:28 +00:00
amba [ARM] Fix __must_check warnings in drivers/bus/amba.c 2006-11-30 14:04:49 +00:00
ata [PATCH] libata: Incorrect timing computation for PIO5/6 2006-12-07 07:37:07 -05:00
atm Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2006-12-07 09:05:15 -08:00
base Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
block Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2006-12-07 09:05:15 -08:00
bluetooth [PATCH] lockdep: annotate bcsp driver 2006-12-07 08:39:34 -08:00
cdrom [PATCH] drivers/cdrom/*: trivial vsnprintf() conversion 2006-12-07 08:39:35 -08:00
char [PATCH] tty: ->signal->tty locking 2006-12-08 08:28:38 -08:00
clocksource [PATCH] time: re-add verify_pmtmr_rate 2006-12-08 08:28:37 -08:00
connector WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
cpufreq [PATCH] hotplug CPU: clean up hotcpu_notifier() use 2006-12-07 08:39:39 -08:00
crypto [CRYPTO] geode: Make needlessly global geode_aes_crypt() static 2006-12-06 18:38:53 -08:00
dio
dma [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
edac [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
eisa [PATCH] EISA: handle sysfs errors 2006-10-11 11:14:25 -07:00
fc4 [SCSI] fc4: Conversion to struct scsi_cmnd in fc4 2006-10-25 15:12:45 -07:00
firmware [PATCH] dell_rbu: fix error check 2006-11-16 11:43:38 -08:00
hwmon [PATCH] severing fs.h, radix-tree.h -> sched.h 2006-12-04 02:00:24 -05:00
i2c Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
ide [PATCH] winbond IDE depends on IDEDMA 2006-12-07 08:39:43 -08:00
ieee1394 ieee1394: sbp2: code formatting around work_struct stuff 2006-12-07 23:23:25 +01:00
infiniband [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
input Input: ucb1400 - fix compile error 2006-12-08 01:37:03 -05:00
isdn [PATCH] make 1-bit bitfields unsigned 2006-12-07 08:39:38 -08:00
leds [PATCH] PCEngines WRAP LED Support 2006-12-07 08:39:36 -08:00
macintosh Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-08 01:07:56 -05:00
mca [PATCH] drivers/mca: handle sysfs errors 2006-10-11 11:14:25 -07:00
md Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2006-12-07 09:05:15 -08:00
media [PATCH] make 1-bit bitfields unsigned 2006-12-07 08:39:38 -08:00
message [PATCH] kernel-doc: fix fusion and i2o docs 2006-12-07 08:39:40 -08:00
mfd [PATCH] Add include/linux/freezer.h and move definitions from sched.h 2006-12-07 08:39:27 -08:00
misc [PATCH] tifm: fix NULL ptr and style 2006-12-07 08:39:33 -08:00
mmc Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
mtd [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
net Add "run_scheduled_work()" workqueue function 2006-12-07 09:28:19 -08:00
nubus
oprofile WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
parisc Fix misc .c/.h comment typos 2006-11-30 05:24:39 +01:00
parport [PATCH] parport: section mismatches with HOTPLUG=n 2006-12-07 08:39:40 -08:00
pci Merge branch 'intx' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6 2006-12-07 15:04:20 -08:00
pcmcia Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
pnp Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2006-12-07 08:59:11 -08:00
ps3 [POWERPC] ps3: multiplatform build fixes 2006-12-04 20:41:16 +11:00
rapidio Fix several typos in drivers/ 2006-10-03 22:31:37 +02:00
rtc [PATCH] rtc: ds1743 support 2006-12-07 08:39:43 -08:00
s390 [PATCH] tty: ->signal->tty locking 2006-12-08 08:28:38 -08:00
sbus [SPARC]: Fix bus_id[] string overflow. 2006-10-27 01:03:31 -07:00
scsi [PATCH] ide_scsi: allow it to be used for non CD only 2006-12-07 08:39:43 -08:00
serial Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2006-12-07 15:40:39 -08:00
sh
sn [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
spi [PATCH] spi: check platform_device_register_simple() error 2006-12-07 08:39:42 -08:00
tc [MIPS] Fix DECserial build error by IRQ hander change 2006-10-08 02:38:28 +01:00
telephony [PATCH] pcmcia: conf.ConfigBase and conf.Present consolidation 2006-12-04 20:12:02 -05:00
usb Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-08 01:07:56 -05:00
video [PATCH] Trivial cleanup in the PCI IDs for the CS5535 2006-12-07 08:39:44 -08:00
w1 [PATCH] better CONFIG_W1_SLAVE_DS2433_CRC handling 2006-12-07 08:39:43 -08:00
zorro
Kconfig [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
Makefile [POWERPC] ps3: Missed renames of CONFIG_PS3 to CONFIG_PPC_PS3 2006-12-04 20:41:14 +11:00