linux/drivers/char
Alexey Dobriyan ca509f69de Protect tty drivers list with tty_mutex
Additions and removal from tty_drivers list were just done as well as
iterating on it for /proc/tty/drivers generation.

testing: modprobe/rmmod loop of simple module which does nothing but
tty_register_driver() vs cat /proc/tty/drivers loop

BUG: unable to handle kernel paging request at virtual address 6b6b6b6b
 printing eip:
c01cefa7
*pde = 00000000
Oops: 0000 [#1]
PREEMPT
last sysfs file: devices/pci0000:00/0000:00:1d.7/usb5/5-0:1.0/bInterfaceProtocol
Modules linked in: ohci_hcd af_packet e1000 ehci_hcd uhci_hcd usbcore xfs
CPU:    0
EIP:    0060:[<c01cefa7>]    Not tainted VLI
EFLAGS: 00010297   (2.6.21-rc4-mm1 #4)
EIP is at vsnprintf+0x3a4/0x5fc
eax: 6b6b6b6b   ebx: f6cb50f2   ecx: 6b6b6b6b   edx: fffffffe
esi: c0354700   edi: f6cb6000   ebp: 6b6b6b6b   esp: f31f5e68
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process cat (pid: 31864, ti=f31f4000 task=c1998030 task.ti=f31f4000)
Stack: 00000000 c0103f20 c013003a c0103f20 00000000 f6cb50da 0000000a 00000f0e
       f6cb50f2 00000010 00000014 ffffffff ffffffff 00000007 c0354753 f6cb50f2
       f73e39dc f73e39dc 00000001 c0175416 f31f5ed8 f31f5ed4 0ee00000 f32090bc
Call Trace:
 [<c0103f20>] restore_nocheck+0x12/0x15
 [<c013003a>] mark_held_locks+0x6d/0x86
 [<c0103f20>] restore_nocheck+0x12/0x15
 [<c0175416>] seq_printf+0x2e/0x52
 [<c0192895>] show_tty_range+0x35/0x1f3
 [<c0175416>] seq_printf+0x2e/0x52
 [<c0192add>] show_tty_driver+0x8a/0x1d9
 [<c01758f6>] seq_read+0x70/0x2ba
 [<c0175886>] seq_read+0x0/0x2ba
 [<c018d8e6>] proc_reg_read+0x63/0x9f
 [<c015e764>] vfs_read+0x7d/0xb5
 [<c018d883>] proc_reg_read+0x0/0x9f
 [<c015eab1>] sys_read+0x41/0x6a
 [<c0103e4e>] sysenter_past_esp+0x5f/0x99
 =======================
Code: 00 8b 4d 04 e9 44 ff ff ff 8d 4d 04 89 4c 24 50 8b 6d 00 81 fd ff 0f 00 00 b8 a4 c1 35 c0 0f 46 e8 8b 54 24 2c 89 e9 89 c8 eb 06 <80> 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 89 c6 8b 44 24 28 89
EIP: [<c01cefa7>] vsnprintf+0x3a4/0x5fc SS:ESP 0068:f31f5e68

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:05 -07:00
..
agp Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6 2007-05-05 14:55:20 -07:00
drm Merge branch 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6 2007-05-07 12:24:07 -07:00
hw_random Use stop_machine_run in the Intel RNG driver 2007-05-08 11:15:00 -07:00
ip2 Fix bogus 'inline' in drivers/char/ip2/i2lib.c 2007-02-21 11:18:26 -08:00
ipmi move die notifier handling to common code 2007-05-08 11:15:04 -07:00
mwave [PATCH] mwave: interesting flags savings 2007-02-20 17:10:14 -08:00
pcmcia PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
rio rio: typo in bitwise AND expression. 2007-02-17 18:57:09 +01:00
tpm tpm_infineon: add support for devices in mmio space 2007-05-08 11:15:02 -07:00
watchdog PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
.gitignore
ChangeLog
Kconfig rename TANBAC TB0219 config 2007-05-07 12:13:04 -07:00
Makefile rename TANBAC TB0219 config 2007-05-07 12:13:04 -07:00
amiserial.c [PATCH] CHAR-Amiserial: turn local_save_flags() + local_irq_disable() into local_irq_save() 2007-02-11 11:18:07 -08:00
apm-emulation.c [APM] Add shared version of APM emulation 2007-02-09 17:08:57 +00:00
applicom.c
applicom.h
briq_panel.c Revert "[POWERPC] Rename get_property to of_get_property: drivers" 2007-04-26 22:24:31 +10:00
cd1865.h
consolemap.c [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
cp437.uni
cs5535_gpio.c Char: cs5535_gpio, add MODULE_DEVICE_TABLE 2007-05-08 11:15:04 -07:00
cyclades.c cyclades: remove custom types 2007-05-08 11:15:03 -07: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
digiFep1.h
digiPCI.h
ds1286.c [CHAR] ds1286: Fix handling of seconds in RTC_ALM_SET ioctl. 2007-03-08 01:10:30 +00:00
ds1302.c [PATCH] DS1302: local_irq_disable() is redundant after local_irq_save() 2007-02-12 09:48:30 -08:00
ds1620.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
dsp56k.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
dtlk.c [PATCH] Char: timers cleanup 2007-02-12 09:48:30 -08:00
ec3104_keyb.c
efirtc.c
epca.c [PATCH] char/epca.c: remove unused function 2007-03-05 07:57:53 -08:00
epca.h
epcaconfig.h
esp.c [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
generic_nvram.c [PATCH] mark struct file_operations const 3 2007-02-12 09:48:45 -08:00
generic_serial.c [PATCH] generic_serial: fix decoding of baud rate 2007-03-27 09:05:15 -07:00
genrtc.c WorkStruct: make allyesconfig 2006-11-22 14:57:56 +00:00
hangcheck-timer.c [PATCH] time: x86_64: convert x86_64 to use GENERIC_TIME 2007-02-16 08:14:00 -08:00
hpet.c [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
hvc_beat.c [POWERPC] Celleb: hypervisor console driver 2007-02-07 14:03:21 +11:00
hvc_console.c drivers/char/hvc_console.c: cleanups 2007-05-08 11:14:59 -07:00
hvc_console.h
hvc_iseries.c [POWERPC] Rename get_property to of_get_property: partial drivers 2007-04-27 15:51:56 +10:00
hvc_rtas.c
hvc_vio.c [POWERPC] Rename get_property to of_get_property: partial drivers 2007-04-27 15:51:56 +10:00
hvcs.c [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
hvsi.c [POWERPC] Rename get_property to of_get_property: partial drivers 2007-04-27 15:51:56 +10:00
i8k.c
ip27-rtc.c
isicom.c [PATCH] Char: tty_wakeup cleanup 2007-02-11 10:51:26 -08:00
istallion.c [PATCH] Char: tty_wakeup cleanup 2007-02-11 10:51:26 -08:00
keyboard.c Input: keyboard handler - use printk_ratelimit() 2007-04-12 01:30:52 -04:00
lcd.c [CHAR] lcd: Fix two warnings. 2007-03-17 01:03:26 +00:00
lcd.h [MIPS] Add MTD device support for Cobalt 2007-02-20 17:11:55 +00:00
lp.c [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
mbcs.c [PATCH] mark struct file_operations const 3 2007-02-12 09:48:45 -08:00
mbcs.h
mem.c fix bogon in /dev/mem mmap'ing on nommu 2007-04-17 16:36:27 -07: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] Char: moxa, pci probing 2007-02-11 10:51:30 -08:00
mspec.c [PATCH] mark struct file_operations const 3 2007-02-12 09:48:45 -08:00
mxser.c Char: mxser, fix TIOCMIWAIT 2007-04-24 08:23:08 -07:00
mxser.h [PATCH] mxser: remove ambiguous redefinition of INIT_WORK 2007-02-11 10:51:25 -08:00
mxser_new.c Char: mxser_new, fix TIOCMIWAIT 2007-04-24 08:23:07 -07:00
mxser_new.h [PATCH] Char: mxser_new, upgrade to 1.9.15 2007-02-11 10:51:29 -08:00
n_hdlc.c
n_r3964.c [PATCH] Char: timers cleanup 2007-02-12 09:48:30 -08:00
n_tty.c [PATCH] tty: update the tty layer to work with struct pid 2007-02-12 09:48:32 -08:00
nsc_gpio.c [PATCH] struct path: convert char-drivers 2006-12-08 08:28:44 -08:00
nvram.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
nwbutton.c [PATCH] Char: timers cleanup 2007-02-12 09:48:30 -08:00
nwbutton.h
nwflash.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
pc8736x_gpio.c
ppdev.c [PATCH] struct path: convert char-drivers 2006-12-08 08:28:44 -08:00
pty.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
random.c [NET]: random functions can use nsec resolution instead of usec 2007-04-25 22:28:25 -07:00
raw.c [PATCH] raw: don't allow the creation of a raw device with minor number 0 2007-02-11 10:51:34 -08:00
riscom8.c [PATCH] Char: tty_wakeup cleanup 2007-02-11 10:51:26 -08:00
riscom8.h
riscom8_reg.h
rocket.c Char: rocket, add MODULE_DEVICE_TABLE 2007-05-08 11:15:04 -07:00
rocket.h
rocket_int.h
rtc.c [PATCH] sysctl: remove insert_at_head from register_sysctl 2007-02-14 08:09:59 -08:00
scc.h
scx200_gpio.c
selection.c
ser_a2232.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
ser_a2232.h
ser_a2232fw.ax
ser_a2232fw.h
serial167.c [PATCH] Char: serial167, cleanup 2007-02-11 10:51:28 -08:00
snsc.c
snsc.h
snsc_event.c
sonypi.c sonypi: use mutex instead of semaphore 2007-04-28 22:13:34 -04:00
specialix.c [PATCH] Char: timers cleanup 2007-02-12 09:48:30 -08:00
specialix_io8.h
stallion.c [PATCH] Char: stallion, use dynamic dev 2006-12-08 08:28:59 -08:00
sx.c [PATCH] sx: fix non-PCI build 2006-12-13 09:05:49 -08:00
sx.h [PATCH] Char: sx, request regions 2006-12-08 08:28:59 -08:00
sxboards.h
sxwindow.h
synclink.c drivers/char/synclink.c: check kmalloc() return value 2007-05-08 11:15:02 -07:00
synclink_gt.c [PATCH] Char: timers cleanup 2007-02-12 09:48:30 -08:00
synclinkmp.c [PATCH] Char: timers cleanup 2007-02-12 09:48:30 -08:00
sysrq.c [PATCH] Add SysRq-Q to print timer_list debug info 2007-02-16 08:13:59 -08:00
tb0219.c [PATCH] struct path: convert char-drivers 2006-12-08 08:28:44 -08:00
tipar.c [PATCH] struct path: convert char-drivers 2006-12-08 08:28:44 -08:00
tlclk.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
toshiba.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
tty_io.c Protect tty drivers list with tty_mutex 2007-05-08 11:15:05 -07:00
tty_ioctl.c [PATCH] tty: improve encode_baud_rate logic 2007-02-11 10:51:32 -08:00
vc_screen.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
viocons.c [POWERPC] iSeries: fix viocons init 2006-12-20 16:37:48 +11:00
viotape.c [PATCH] mark struct file_operations const 3 2007-02-12 09:48:45 -08:00
vme_scc.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
vr41xx_giu.c [MIPS] Vr41xx: Fix after GENERIC_HARDIRQS_NO__DO_IRQ change 2007-01-23 18:26:47 +00:00
vt.c [PATCH] Initialise SAK member for each virtual console to prevent oops 2007-03-16 19:25:06 -07:00
vt_ioctl.c [PATCH] vt: fix potential race in VT_WAITACTIVE handler 2007-04-02 10:06:09 -07:00