kernel_optimize_test/drivers/watchdog
Guenter Roeck 60403f7a4d watchdog: Fix race condition in registration code
A race condition exists when registering the first watchdog device.
Sequence of events:

- watchdog_register_device calls watchdog_dev_register
- watchdog_dev_register creates the watchdog misc device by calling
  misc_register.
  At that time, the matching character device (/dev/watchdog0) does not yet
  exist, and old_wdd is not set either.
- Userspace gets an event and opens /dev/watchdog
- watchdog_open is called and sets wdd = old_wdd, which is still NULL,
  and tries to dereference it. This causes the kernel to panic.

Seen with systemd trying to open /dev/watchdog immediately after
it was created.

Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2013-05-09 08:13:41 +02:00
..
acquirewdt.c
advantechwdt.c
alim1535_wdt.c
alim7101_wdt.c
ar7_wdt.c
at32ap700x_wdt.c
at91rm9200_wdt.c watchdog: at91rm9200: add DT support 2013-03-01 12:55:27 +01:00
at91sam9_wdt.c watchdog: add timeout-sec property binding 2013-03-01 12:53:45 +01:00
at91sam9_wdt.h
ath79_wdt.c watchdog: Convert to devm_ioremap_resource() 2013-05-09 08:12:00 +02:00
bcm47xx_wdt.c watchdog: bcm47xx_wdt.c: add hard timer 2013-03-01 12:47:31 +01:00
bcm63xx_wdt.c
bfin_wdt.c
booke_wdt.c watchdog: Convert BookE watchdog driver to watchdog infrastructure 2013-03-01 12:46:28 +01:00
coh901327_wdt.c
cpu5wdt.c
cpwd.c
da9052_wdt.c
da9055_wdt.c
davinci_wdt.c watchdog: Convert to devm_ioremap_resource() 2013-05-09 08:12:00 +02:00
dw_wdt.c
ep93xx_wdt.c
eurotechwdt.c
f71808e_wdt.c
gef_wdt.c watchdog: gef_wdt.c: add missing remove callback 2013-03-01 12:18:33 +01:00
geodewdt.c
hpwdt.c
i6300esb.c
ib700wdt.c
ibmasr.c
ie6xx_wdt.c
imx2_wdt.c
indydog.c
intel_scu_watchdog.c
intel_scu_watchdog.h
iop_wdt.c
it87_wdt.c
it8712f_wdt.c
iTCO_vendor_support.c
iTCO_vendor.h
iTCO_wdt.c
ixp4xx_wdt.c
jz4740_wdt.c
Kconfig watchdog: Revert the AT91RM9200_WATCHDOG dependency 2013-04-14 09:09:10 +02:00
ks8695_wdt.c
lantiq_wdt.c
m54xx_wdt.c
machzwd.c
Makefile watchdog: remove old STMP3xxx driver 2013-03-01 12:44:40 +01:00
max63xx_wdt.c
mixcomwd.c
mpc8xxx_wdt.c
mpcore_wdt.c
mtx-1_wdt.c
mv64x60_wdt.c
nuc900_wdt.c
nv_tco.c
nv_tco.h
octeon-wdt-main.c
octeon-wdt-nmi.S
of_xilinx_wdt.c
omap_wdt.c watchdog: omap_wdt: Add option nowayout 2013-03-01 12:49:02 +01:00
omap_wdt.h
orion_wdt.c watchdog: add timeout-sec property binding 2013-03-01 12:53:45 +01:00
pc87413_wdt.c
pcwd_pci.c
pcwd_usb.c
pcwd.c
pika_wdt.c
pnx833x_wdt.c
pnx4008_wdt.c watchdog: add timeout-sec property binding 2013-03-01 12:53:45 +01:00
rc32434_wdt.c
rdc321x_wdt.c
retu_wdt.c watchdog: introduce retu_wdt driver 2013-03-01 12:31:14 +01:00
riowd.c
s3c2410_wdt.c watchdog: Convert to devm_ioremap_resource() 2013-05-09 08:12:00 +02:00
sa1100_wdt.c
sb_wdog.c
sbc_epx_c3.c
sbc_fitpc2_wdt.c
sbc60xxwdt.c
sbc7240_wdt.c
sbc8360.c
sc520_wdt.c
sc1200wdt.c
sch311x_wdt.c
scx200_wdt.c
shwdt.c watchdog: Convert to devm_ioremap_resource() 2013-05-09 08:12:00 +02:00
smsc37b787_wdt.c
softdog.c
sp805_wdt.c
sp5100_tco.c watchdog: sp5100_tco: Remove code that may cause a boot failure 2013-03-22 23:21:47 +01:00
sp5100_tco.h watchdog: sp5100_tco: Set the AcpiMmioSel bitmask value to 1 instead of 2 2013-03-22 23:21:55 +01:00
stmp3xxx_rtc_wdt.c watchdog: add new driver for STMP3xxx and i.MX23/28 2013-03-01 12:44:34 +01:00
ts72xx_wdt.c
twl4030_wdt.c
txx9wdt.c
ux500_wdt.c
via_wdt.c
w83627hf_wdt.c
w83697hf_wdt.c
w83697ug_wdt.c
w83877f_wdt.c
w83977f_wdt.c
wafer5823wdt.c
watchdog_core.c watchdog: core: dt: add support for the timeout-sec dt property 2013-03-01 12:48:36 +01:00
watchdog_core.h
watchdog_dev.c watchdog: Fix race condition in registration code 2013-05-09 08:13:41 +02:00
wd501p.h
wdrtas.c
wdt_pci.c
wdt.c
wdt285.c
wdt977.c
wm831x_wdt.c
wm8350_wdt.c
xen_wdt.c