Lyude Paul
541ff7e96c
drm/i915: Fix NULL deref when re-enabling HPD IRQs on systems with MST
...
Turns out that if you trigger an HPD storm on a system that has an MST
topology connected to it, you'll end up causing the kernel to eventually
hit a NULL deref:
[ 332.339041] BUG: unable to handle kernel NULL pointer dereference at 00000000000000ec
[ 332.340906] PGD 0 P4D 0
[ 332.342750] Oops: 0000 [#1 ] SMP PTI
[ 332.344579] CPU: 2 PID: 25 Comm: kworker/2:0 Kdump: loaded Tainted: G O 4.18.0-rc3short-hpd-storm+ #2
[ 332.346453] Hardware name: LENOVO 20BWS1KY00/20BWS1KY00, BIOS JBET71WW (1.35 ) 09/14/2018
[ 332.348361] Workqueue: events intel_hpd_irq_storm_reenable_work [i915]
[ 332.350301] RIP: 0010:intel_hpd_irq_storm_reenable_work.cold.3+0x2f/0x86 [i915]
[ 332.352213] Code: 00 00 ba e8 00 00 00 48 c7 c6 c0 aa 5f a0 48 c7 c7 d0 73 62 a0 4c 89 c1 4c 89 04 24 e8 7f f5 af e0 4c 8b 04 24 44 89 f8 29 e8 <41> 39 80 ec 00 00 00 0f 85 43 13 fc ff 41 0f b6 86 b8 04 00 00 41
[ 332.354286] RSP: 0018:ffffc90000147e48 EFLAGS: 00010006
[ 332.356344] RAX: 0000000000000005 RBX: ffff8802c226c9d4 RCX: 0000000000000006
[ 332.358404] RDX: 0000000000000000 RSI: 0000000000000082 RDI: ffff88032dc95570
[ 332.360466] RBP: 0000000000000005 R08: 0000000000000000 R09: ffff88031b3dc840
[ 332.362528] R10: 0000000000000000 R11: 000000031a069602 R12: ffff8802c226ca20
[ 332.364575] R13: ffff8802c2268000 R14: ffff880310661000 R15: 000000000000000a
[ 332.366615] FS: 0000000000000000(0000) GS:ffff88032dc80000(0000) knlGS:0000000000000000
[ 332.368658] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 332.370690] CR2: 00000000000000ec CR3: 000000000200a003 CR4: 00000000003606e0
[ 332.372724] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 332.374773] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 332.376798] Call Trace:
[ 332.378809] process_one_work+0x1a1/0x350
[ 332.380806] worker_thread+0x30/0x380
[ 332.382777] ? wq_update_unbound_numa+0x10/0x10
[ 332.384772] kthread+0x112/0x130
[ 332.386740] ? kthread_create_worker_on_cpu+0x70/0x70
[ 332.388706] ret_from_fork+0x35/0x40
[ 332.390651] Modules linked in: i915(O) vfat fat joydev btusb btrtl btbcm btintel bluetooth ecdh_generic iTCO_wdt wmi_bmof i2c_algo_bit drm_kms_helper intel_rapl syscopyarea sysfillrect x86_pkg_temp_thermal sysimgblt coretemp fb_sys_fops crc32_pclmul drm psmouse pcspkr mei_me mei i2c_i801 lpc_ich mfd_core i2c_core tpm_tis tpm_tis_core thinkpad_acpi wmi tpm rfkill video crc32c_intel serio_raw ehci_pci xhci_pci ehci_hcd xhci_hcd [last unloaded: i915]
[ 332.394963] CR2: 00000000000000ec
This appears to be due to the fact that with an MST topology, not all
intel_connector structs will have ->encoder set. So, fix this by
skipping connectors without encoders in
intel_hpd_irq_storm_reenable_work().
For those wondering, this bug was found on accident while simulating HPD
storms using a Chamelium connected to a ThinkPad T450s (Broadwell).
Changes since v1:
- Check intel_connector->mst_port instead of intel_connector->encoder
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: stable@vger.kernel.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181106213017.14563-3-lyude@redhat.com
(cherry picked from commit fee61deecb1d850bf34f682a6a452e5ee51b7572)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-11-12 17:07:12 +02:00
..
2018-11-07 18:21:05 -05:00
2018-07-13 18:40:27 +02:00
2018-10-05 15:39:51 +01:00
2018-09-09 14:19:18 +02:00
2018-07-13 18:40:27 +02:00
2018-08-27 21:22:52 +02:00
2018-09-25 14:49:49 +02:00
2018-10-29 11:53:27 -04:00
2018-09-03 18:16:47 +02:00
2018-11-07 09:32:30 +10:00
2018-11-05 16:37:24 +09:00
2018-09-26 22:20:16 +02:00
2018-08-27 10:00:03 -04:00
2018-09-26 11:42:12 +08:00
2018-10-04 10:32:14 +10:00
2018-07-03 15:00:42 +02:00
2018-11-12 17:07:12 +02:00
2018-10-05 12:09:20 +02:00
2018-10-28 17:49:53 -07:00
2018-07-16 11:14:59 +02:00
2018-09-03 18:17:32 +02:00
2018-10-28 17:49:53 -07:00
2018-09-26 22:07:40 +02:00
2018-11-02 10:58:20 -07:00
2018-10-02 09:36:56 +03:00
2018-10-29 11:53:28 -04:00
2018-09-27 02:54:54 -04:00
2018-09-12 09:01:18 +02:00
2018-10-15 16:16:12 -05:00
2018-09-25 00:41:05 +03:00
2018-09-10 10:52:27 +02:00
2018-07-04 14:27:01 +02:00
2018-10-12 12:52:32 -05:00
2018-06-22 12:58:08 +10:00
2018-09-14 13:54:02 +03:00
2018-09-25 11:33:51 +02:00
2018-07-13 10:11:02 +02:00
2018-11-06 16:55:29 +01:00
2018-09-28 09:47:31 +10:00
2018-10-01 15:52:29 +03:00
2018-08-07 17:09:15 +02:00
2018-10-10 15:20:54 -05:00
2018-09-25 11:34:24 +02:00
2018-09-27 02:54:54 -04:00
2018-09-27 09:55:45 -05:00
2018-09-27 02:54:54 -04:00
2018-08-17 11:22:58 +02:00
2018-09-26 08:05:07 +02:00
2018-09-21 10:50:45 +02:00
2018-10-04 10:19:33 +10:00
2018-07-23 11:47:35 +03:00
2018-09-25 11:35:33 +02:00
2018-11-02 10:58:20 -07:00
2018-10-19 11:46:46 +03:00
2018-10-28 17:49:53 -07:00
2018-09-11 11:21:30 +01:00
2018-09-13 11:28:12 +02:00
2018-09-14 17:29:47 +01:00
2018-10-28 17:49:53 -07:00
2018-09-14 17:29:47 +01:00
2018-10-19 11:46:46 +03:00
2018-09-14 17:29:47 +01:00
2018-09-09 14:19:18 +02:00
2018-09-10 07:10:36 +02:00
2018-10-28 17:49:53 -07:00
2018-08-22 09:50:16 -07:00
2018-09-17 19:24:37 -04:00
2018-08-31 10:20:38 +02:00
2018-09-19 16:44:12 +03:00
2018-08-31 10:20:38 +02:00
2018-09-13 18:44:06 +03:00
2018-06-28 13:29:07 +10:00
2018-11-02 10:58:20 -07:00
2018-09-14 17:29:47 +01:00
2018-10-28 17:49:53 -07:00
2018-10-28 17:49:53 -07:00
2018-07-10 14:51:37 +02:00
2018-09-25 14:49:50 +02:00
2018-09-25 14:49:50 +02:00
2018-07-23 11:47:35 +03:00
2018-09-25 14:49:49 +02:00
2018-09-14 17:29:47 +01:00
2018-06-29 15:28:47 -05:00
2018-09-09 14:19:17 +02:00
2018-09-21 11:19:40 +02:00
2018-09-14 17:29:47 +01:00
2018-10-28 17:49:53 -07:00
2018-09-14 17:29:47 +01:00
2018-07-25 07:51:05 -04:00
2018-09-14 17:29:47 +01:00
2018-09-14 17:29:47 +01:00
2018-07-13 18:40:27 +02:00
2018-07-03 09:46:05 +02:00
2018-07-13 18:40:28 +02:00
2018-10-17 14:17:38 +02:00
2018-10-04 11:03:34 +10:00
2018-09-14 17:29:47 +01:00
2018-09-09 14:19:18 +02:00
2018-09-14 17:29:47 +01:00
2018-09-14 17:29:47 +01:00
2018-07-30 08:49:41 -04:00
2018-07-13 18:40:27 +02:00
2018-09-14 17:29:47 +01:00
2018-09-14 17:29:47 +01:00
2018-07-13 18:40:27 +02:00
2018-10-04 11:03:34 +10:00
2018-09-14 17:29:47 +01:00
2018-09-04 19:00:32 +01:00
2018-07-16 16:35:27 +01:00
2018-10-03 21:08:21 +02:00
2018-09-09 14:19:18 +02:00