Chris Wilson
bee7fb158f
drm: Protect drm_connector_register_all() under DRIVER_MODESET
...
0-day kbuilder found
[ 1.360244] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 1.360972] IP: [<c14db9ad>] mutex_lock_nested+0x11f/0x2c3
[ 1.361512] *pde = 00000000
[ 1.361827] Oops: 0002 [#1 ]
[ 1.362123] Modules linked in:
[ 1.362451] CPU: 0 PID: 1 Comm: swapper Not tainted 4.7.0-rc2-00564-ge28cd4d #1
[ 1.363202] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[ 1.364105] task: c03d0000 ti: d28da000 task.ti: d28da000
[ 1.364636] EIP: 0060:[<c14db9ad>] EFLAGS: 00210096 CPU: 0
[ 1.365215] EIP is at mutex_lock_nested+0x11f/0x2c3
[ 1.365703] EAX: 00000000 EBX: d39e8ae8 ECX: d39e8b14 EDX: c1361cf9
[ 1.366351] ESI: c03d0000 EDI: d28dbed0 EBP: d28dbeec ESP: d28dbec0
[ 1.367010] DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
[ 1.367534] CR0: 80050033 CR2: 00000000 CR3: 019a9000 CR4: 00000690
[ 1.368152] Stack:
[ 1.368356] d39e8b14 d39e8b24 c1361cf9 00200246 d39e8b14 00000000 11111111 d28dbed0
[ 1.369235] d39e8800 d39e8ae8 00000000 d28dbf08 c1361cf9 d28dbf0c c10b25be d39e8800
[ 1.370087] 00000000 00000000 d28dbf1c c135e37d fffffff4 ffffffff 00000000 d28dbf28
[ 1.371012] Call Trace:
[ 1.371272] [<c1361cf9>] ? drm_connector_register_all+0x1a/0x92
[ 1.371847] [<c1361cf9>] drm_connector_register_all+0x1a/0x92
[ 1.372421] [<c10b25be>] ? kstrdup+0x25/0x3a
[ 1.372863] [<c135e37d>] drm_dev_register+0x59/0x99
[ 1.373358] [<c195ea3e>] vgem_init+0x34/0x49
[ 1.373770] [<c195ea0a>] ? mipi_dsi_bus_init+0xf/0xf
[ 1.374257] [<c100048f>] do_one_initcall+0x7c/0xfd
[ 1.374754] [<c104b409>] ? parse_args+0x1fd/0x314
[ 1.375259] [<c1939c10>] ? kernel_init_freeable+0xd0/0x179
[ 1.375837] [<c1939c2c>] kernel_init_freeable+0xec/0x179
[ 1.376371] [<c14d66ea>] kernel_init+0x8/0xcb
[ 1.376806] [<c14debce>] ret_from_kernel_thread+0xe/0x30
[ 1.377322] [<c14d66e2>] ? rest_init+0x10e/0x10e
[ 1.377754] Code: 89 fa e8 71 c5 b7 ff 8b 4e 04 89 fa 89 d8 e8 8e c6 b7 ff 8d 43 2c 89 45 d4 8b 43 30 8d 4b 2c 89 45 e8 89 7b 30 89 4d e4 8b 55 dc <89> 38 8d 43 3c 89 75 ec e8 c9 dd b7 ff eb 0c 31 c0 87 03 48
+75
[ 1.380442] EIP: [<c14db9ad>] mutex_lock_nested+0x11f/0x2c3 SS:ESP 0068:d28dbec0
[ 1.381174] CR2: 0000000000000000
when loading the non-modesetting vGEM module. To prevent use of the
uninitialised dev->mode_config from drm_dev_register() we move the
drm_connector_register_all() under a DRIVER_MODESET guard. Longer term,
we probably want to initialise the embedded dev->mode_config automatically
from drm_dev_init() for all DRIVER_MODESET drivers.
v2: Also protect drm_dev_unregister.
Fixes: e28cd4d0a223 ("drm: Automatically register/unregister all connectors")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Testcase: igt/vgem_reload_basic
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1466257601-5656-1-git-send-email-chris@chris-wilson.co.uk
2016-06-19 00:30:25 +02:00
..
2016-06-13 18:38:06 +02:00
2016-06-16 05:49:32 +10:00
2016-06-10 17:11:17 +02:00
2016-06-17 16:41:25 +02:00
2016-06-09 11:19:28 +10:00
2016-06-10 17:22:11 +02:00
2016-06-01 09:40:16 +02:00
2016-06-10 17:25:30 +02:00
2016-06-09 11:19:28 +10:00
2016-06-02 08:27:41 +02:00
2016-06-10 17:22:15 +02:00
2016-06-10 17:22:19 +02:00
2016-06-13 18:38:19 +02:00
2016-06-09 10:28:14 +02:00
2016-03-14 09:46:02 +10:00
2016-06-17 16:41:25 +02:00
2016-05-30 09:14:00 +02:00
2016-06-17 16:41:25 +02:00
2016-06-09 11:19:28 +10:00
2016-06-10 16:52:12 +02:00
2016-06-13 18:33:41 +02:00
2016-06-10 17:25:11 +02:00
2016-05-12 11:32:14 +02:00
2016-06-09 11:19:28 +10:00
2016-06-13 18:38:12 +02:00
2016-06-10 17:24:26 +02:00
2016-06-17 16:41:25 +02:00
2016-06-09 11:19:28 +10:00
2016-06-17 14:27:02 +02:00
2016-06-10 17:24:44 +02:00
2016-06-10 17:24:48 +02:00
2016-06-01 09:41:02 +02:00
2016-05-09 13:49:56 +10:00
2016-06-06 18:03:06 +02:00
2016-06-10 17:24:58 +02:00
2016-05-31 15:28:10 +02:00
2016-04-04 10:41:08 -07:00
2016-06-14 16:32:47 +02:00
2016-06-15 13:10:38 +02:00
2016-04-27 08:41:34 +02:00
2016-06-15 17:25:36 +02:00
2016-06-10 16:57:54 +02:00
2016-06-16 10:17:58 +02:00
2016-06-03 20:58:24 +02:00
2016-04-27 10:14:17 +02:00
2016-03-31 13:35:09 +02:00
2016-06-07 17:10:49 +03:00
2016-04-22 10:26:37 +10:00
2016-06-17 14:42:40 +02:00
2016-06-16 10:16:11 +02:00
2016-04-28 11:48:09 +02:00
2016-05-23 11:10:46 +03:00
2016-06-17 14:41:47 +02:00
2016-05-09 13:49:56 +10:00
2016-06-19 00:30:25 +02:00
2016-05-30 09:59:28 +02:00
2016-05-23 11:35:31 +10:00
2016-06-13 09:53:09 +02:00
2016-06-09 08:43:28 +02:00
2016-06-16 10:17:58 +02:00
2016-06-09 11:58:50 +02:00
2016-06-01 15:00:28 +10:00
2016-06-02 16:25:20 +02:00
2016-06-16 10:16:11 +02:00
2016-06-16 10:17:58 +02:00
2016-04-27 08:42:48 +02:00
2016-06-13 18:37:33 +02:00
2016-06-16 10:16:37 +02:00
2016-06-16 10:16:37 +02:00
2016-06-13 10:45:57 +02:00
2016-05-23 14:56:11 +02:00
2016-06-09 11:19:28 +10:00
2016-06-03 20:58:24 +02:00
2016-05-06 16:04:48 +02:00
2016-04-27 08:41:34 +02:00
2016-06-17 16:41:25 +02:00
2016-06-13 17:32:18 +02:00
2016-06-02 15:10:22 +02:00
2016-06-17 16:41:25 +02:00
2016-06-09 08:43:25 +02:00
2016-06-16 10:16:11 +02:00
2016-06-03 20:58:24 +02:00
2016-05-06 17:47:35 +02:00
2016-06-10 17:33:17 +02:00