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
..
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-03-28 15:58:21 -07:00
2013-01-25 12:21:48 -08:00
2013-01-17 17:39:33 -08:00
2013-03-01 12:55:27 +01:00
2013-03-01 12:53:45 +01:00
2011-11-28 22:50:39 +08:00
2013-05-09 08:12:00 +02:00
2013-03-01 12:47:31 +01:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2013-03-01 12:46:28 +01:00
2013-01-17 17:39:33 -08:00
2012-12-19 22:24:41 +01:00
2013-02-22 23:31:31 -05:00
2012-12-19 22:25:07 +01:00
2013-01-02 12:06:49 +01:00
2013-05-09 08:12:00 +02:00
2013-01-25 12:21:48 -08:00
2012-11-28 12:00:24 -08:00
2012-03-28 15:58:21 -07:00
2012-07-23 12:46:38 +02:00
2013-03-01 12:18:33 +01:00
2012-11-28 12:00:24 -08:00
2012-12-19 22:24:40 +01:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-11-28 12:00:24 -08:00
2013-01-25 12:21:48 -08:00
2012-03-27 20:06:02 +02:00
2012-03-27 19:59:26 +02:00
2012-03-27 19:59:26 +02:00
2012-03-27 20:06:02 +02:00
2012-05-23 16:24:43 +02:00
2012-03-27 20:06:02 +02:00
2012-05-09 17:20:09 +02:00
2012-05-09 17:20:09 +02:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2013-01-25 12:21:48 -08:00
2013-04-14 09:09:10 +02:00
2012-11-28 12:00:24 -08:00
2013-01-25 12:21:48 -08:00
2012-09-27 23:34:03 +10:00
2012-03-28 15:58:21 -07:00
2013-03-01 12:44:40 +01:00
2013-01-25 12:21:48 -08:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-12-19 22:25:06 +01:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2011-01-12 13:51:23 +00:00
2012-03-27 20:06:02 +02:00
2010-08-05 13:26:22 +01:00
2012-11-28 12:00:24 -08:00
2013-03-01 12:49:02 +01:00
2011-03-15 16:02:27 +00:00
2013-03-01 12:53:45 +01:00
2012-03-28 15:58:21 -07:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2012-03-27 20:06:02 +02:00
2013-03-01 12:53:45 +01:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2013-03-01 12:31:14 +01:00
2012-11-28 12:00:24 -08:00
2013-05-09 08:12:00 +02:00
2012-07-09 17:37:35 +01:00
2012-03-27 19:59:26 +02:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-03-27 20:06:02 +02:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-03-27 20:06:02 +02:00
2012-11-28 12:00:24 -08:00
2012-03-27 20:06:02 +02:00
2013-05-09 08:12:00 +02:00
2012-03-28 15:58:21 -07:00
2012-03-27 20:07:21 +02:00
2012-12-19 22:24:38 +01:00
2013-03-22 23:21:47 +01:00
2013-03-22 23:21:55 +01:00
2013-03-01 12:44:34 +01:00
2012-11-28 12:00:24 -08:00
2013-01-02 12:07:05 +01:00
2013-01-25 12:21:48 -08:00
2013-02-14 00:22:53 +01:00
2012-11-28 12:00:24 -08:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-03-27 20:06:02 +02:00
2013-03-01 12:48:36 +01:00
2012-05-30 07:54:25 +02:00
2013-05-09 08:13:41 +02:00
2009-03-25 09:07:04 +00:00
2012-03-27 20:06:02 +02:00
2012-03-28 15:58:21 -07:00
2012-03-28 15:58:21 -07:00
2012-11-28 12:00:24 -08:00
2012-03-28 15:58:21 -07:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00
2012-11-28 12:00:24 -08:00