Skip to contentSkip to conversation

drm/i915: Fix invalid access to ACPI _DSM objects

PATCH Applied Takashi Iwai 3 participants 11 messages Apr 2, 2021 – Apr 8, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915: Fix invalid access to ACPI _DSM objects

intel_dsm_platform_mux_info() tries to parse the ACPI package data from _DSM for the debug information, but it assumes the fixed format without checking what values are stored in the elements actually. When an unexpected value is returned from BIOS, it may lead to GPF or NULL dereference, as reported recently.

Add the checks of the contents in the returned values and skip the values for invalid cases.

v1->v2: Check the info contents before dereferencing, too

---
 drivers/gpu/drm/i915/display/intel_acpi.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_acpi.c +20 -2
index e21fb14d5e07..833d0c1be4f1 100644
@@ -84,13 +84,31 @@ static void intel_dsm_platform_mux_info(acpi_handle dhandle)
 		return;
 	}
 
+	if (!pkg->package.count) {
+		DRM_DEBUG_DRIVER("no connection in _DSM\n");
+		return;
+	}
+
 	connector_count = &pkg->package.elements[0];
 	DRM_DEBUG_DRIVER("MUX info connectors: %lld\n",
 		  (unsigned long long)connector_count->integer.value);
 	for (i = 1; i < pkg->package.count; i++) {
 		union acpi_object *obj = &pkg->package.elements[i];
-		union acpi_object *connector_id = &obj->package.elements[0];
-		union acpi_object *info = &obj->package.elements[1];
+		union acpi_object *connector_id;
+		union acpi_object *info;
+
+		if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < 2) {
+			DRM_DEBUG_DRIVER("Invalid object for MUX #%d\n", i);
+			continue;
+		}
+
+		connector_id = &obj->package.elements[0];
+		info = &obj->package.elements[1];
+		if (info->type != ACPI_TYPE_BUFFER || info->buffer.length < 4) {
+			DRM_DEBUG_DRIVER("Invalid info for MUX obj #%d\n", i);
+			continue;
+		}
+
 		DRM_DEBUG_DRIVER("Connector id: 0x%016llx\n",
 			  (unsigned long long)connector_id->integer.value);
 		DRM_DEBUG_DRIVER("  port id: %s\n",
Signature · 6 lines
2.26.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

[Intel-gfx] ✗ Fi.CI.DOCS: warning for drm/i915: Fix invalid access to ACPI _DSM objects (rev2)

== Series Details ==

== Series Details ==

Series: drm/i915: Fix invalid access to ACPI _DSM objects (rev2)
URL : https://patchwork.freedesktop.org/series/88685/
State : warning

== Summary ==

$ make htmldocs 2>&1 > /dev/null | grep i915
./drivers/gpu/drm/i915/gem/i915_gem_shrinker.c:102: warning: Function parameter or member 'ww' not described in 'i915_gem_shrink'
./drivers/gpu/drm/i915/i915_cmd_parser.c:1420: warning: Excess function parameter 'trampoline' description in 'intel_engine_cmd_parser'
./drivers/gpu/drm/i915/i915_cmd_parser.c:1420: warning: Function parameter or member 'jump_whitelist' not described in 'intel_engine_cmd_parser'
./drivers/gpu/drm/i915/i915_cmd_parser.c:1420: warning: Function parameter or member 'shadow_map' not described in 'intel_engine_cmd_parser'
./drivers/gpu/drm/i915/i915_cmd_parser.c:1420: warning: Function parameter or member 'batch_map' not described in 'intel_engine_cmd_parser'
./drivers/gpu/drm/i915/i915_cmd_parser.c:1420: warning: Excess function parameter 'trampoline' description in 'intel_engine_cmd_parser'

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Fix invalid access to ACPI _DSM objects (rev2)

In reply to Takashi Iwai
== Series Details ==

== Series Details ==

Series: drm/i915: Fix invalid access to ACPI _DSM objects (rev2)
URL : https://patchwork.freedesktop.org/series/88685/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9926 -> Patchwork_19892
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_19892:

### IGT changes ###

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@i915_selftest@live@gt_pm:
- {fi-tgl-dsi}: [DMESG-FAIL][1] ([i915#1759]) -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/fi-tgl-dsi/igt@i915_selftest@live@gt_pm.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/fi-tgl-dsi/igt@i915_selftest@live@gt_pm.html

Known issues
------------

Here are the changes found in Patchwork_19892 that come from known issues:

### IGT changes ###

#### Possible fixes ####

* igt@i915_pm_rpm@module-reload:
- fi-kbl-soraka: [DMESG-WARN][3] ([i915#1982]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/fi-kbl-soraka/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/fi-kbl-soraka/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1759]: https://gitlab.freedesktop.org/drm/intel/issues/1759
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2966]: https://gitlab.freedesktop.org/drm/intel/issues/2966
[i915#3277]: https://gitlab.freedesktop.org/drm/intel/issues/3277
[i915#3283]: https://gitlab.freedesktop.org/drm/intel/issues/3283
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303

Participating hosts (47 -> 41)
------------------------------

Missing (6): fi-ilk-m540 fi-hsw-4200u fi-tgl-u2 fi-bsw-cyan fi-ctg-p8600 fi-bdw-samus

Build changes
-------------

* Linux: CI_DRM_9926 -> Patchwork_19892

CI-20190529: 20190529
CI_DRM_9926: c73cd6993305be64f07fc110883a12025ce3d3d3 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6056: 84e6a7e19ccc7fafc46f372e756cad9d4aa093f7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_19892: 06fc7923b0b6c883249ceb469fb42134c40ddd55 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

06fc7923b0b6 drm/i915: Fix invalid access to ACPI _DSM objects

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/index.html

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

[Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Fix invalid access to ACPI _DSM objects (rev2)

In reply to Takashi Iwai
== Series Details ==

== Series Details ==

Series: drm/i915: Fix invalid access to ACPI _DSM objects (rev2)
URL : https://patchwork.freedesktop.org/series/88685/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9926_full -> Patchwork_19892_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_19892_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_19892_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_19892_full:

### IGT changes ###

#### Possible regressions ####

* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-glk: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk1/igt@[email protected]

* igt@sysfs_preempt_timeout@timeout@rcs0:
- shard-skl: [PASS][3] -> [FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl7/igt@sysfs_preempt_timeout@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl6/igt@sysfs_preempt_timeout@[email protected]

#### Warnings ####

* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [FAIL][5] ([i915#2842]) -> [INCOMPLETE][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk8/igt@gem_exec_fair@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk3/igt@gem_exec_fair@[email protected]

Known issues
------------

Here are the changes found in Patchwork_19892_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_create@create-massive:
- shard-skl: NOTRUN -> [DMESG-WARN][7] ([i915#3002])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl7/igt@[email protected]

* igt@gem_ctx_param@set-priority-not-supported:
- shard-iclb: NOTRUN -> [SKIP][8] ([fdo#109314])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@gem_ctx_persistence@many-contexts:
- shard-tglb: [PASS][9] -> [FAIL][10] ([i915#2410])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-tglb3/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-tglb7/igt@[email protected]

* igt@gem_ctx_persistence@process:
- shard-snb: NOTRUN -> [SKIP][11] ([fdo#109271] / [i915#1099]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-snb7/igt@[email protected]

* igt@gem_ctx_shared@q-in-order:
- shard-snb: NOTRUN -> [SKIP][12] ([fdo#109271]) +348 similar issues
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-snb7/igt@[email protected]

* igt@gem_eio@unwedge-stress:
- shard-tglb: [PASS][13] -> [TIMEOUT][14] ([i915#2369] / [i915#3063])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-tglb5/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-tglb1/igt@[email protected]
- shard-iclb: NOTRUN -> [TIMEOUT][15] ([i915#2369] / [i915#2481] / [i915#3070])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-tglb: [PASS][16] -> [FAIL][17] ([i915#2842]) +1 similar issue
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-tglb7/igt@gem_exec_fair@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-tglb1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-none@rcs0:
- shard-kbl: NOTRUN -> [FAIL][18] ([i915#2842])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl1/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vcs1:
- shard-iclb: NOTRUN -> [FAIL][19] ([i915#2842])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@gem_exec_fair@[email protected]

* igt@gem_exec_reloc@basic-many-active@vcs1:
- shard-iclb: NOTRUN -> [FAIL][20] ([i915#2389])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@gem_exec_reloc@[email protected]

* igt@gem_mmap_gtt@cpuset-big-copy-xy:
- shard-iclb: [PASS][21] -> [FAIL][22] ([i915#307])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb3/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb6/igt@[email protected]

* igt@gem_pwrite@basic-exhaustion:
- shard-skl: NOTRUN -> [WARN][23] ([i915#2658])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl1/igt@[email protected]

* igt@gem_userptr_blits@input-checking:
- shard-snb: NOTRUN -> [DMESG-WARN][24] ([i915#3002])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-snb7/igt@[email protected]

* igt@gem_userptr_blits@process-exit-mmap-busy@uc:
- shard-skl: NOTRUN -> [SKIP][25] ([fdo#109271] / [i915#1699]) +3 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl10/igt@gem_userptr_blits@[email protected]

* igt@gem_userptr_blits@process-exit-mmap@gtt:
- shard-kbl: NOTRUN -> [SKIP][26] ([fdo#109271] / [i915#1699]) +3 similar issues
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl3/igt@gem_userptr_blits@[email protected]

* igt@i915_pm_rpm@system-suspend-execbuf:
- shard-skl: [PASS][27] -> [INCOMPLETE][28] ([i915#151])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl10/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl1/igt@[email protected]

* igt@i915_suspend@fence-restore-untiled:
- shard-skl: NOTRUN -> [INCOMPLETE][29] ([i915#198])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl10/igt@[email protected]

* igt@kms_big_joiner@basic:
- shard-kbl: NOTRUN -> [SKIP][30] ([fdo#109271] / [i915#2705])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl2/igt@[email protected]

* igt@kms_ccs@pipe-c-crc-sprite-planes-basic:
- shard-skl: NOTRUN -> [SKIP][31] ([fdo#109271] / [fdo#111304])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl10/igt@[email protected]

* igt@kms_chamelium@dp-mode-timings:
- shard-apl: NOTRUN -> [SKIP][32] ([fdo#109271] / [fdo#111827]) +5 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl2/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-storm-disable:
- shard-skl: NOTRUN -> [SKIP][33] ([fdo#109271] / [fdo#111827]) +6 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl3/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-with-enabled-mode:
- shard-snb: NOTRUN -> [SKIP][34] ([fdo#109271] / [fdo#111827]) +21 similar issues
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-snb6/igt@[email protected]

* igt@kms_color@pipe-c-ctm-0-25:
- shard-skl: [PASS][35] -> [DMESG-WARN][36] ([i915#1982])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl6/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl10/igt@[email protected]

* igt@kms_color_chamelium@pipe-a-ctm-0-75:
- shard-kbl: NOTRUN -> [SKIP][37] ([fdo#109271] / [fdo#111827]) +9 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl2/igt@[email protected]

* igt@kms_color_chamelium@pipe-c-degamma:
- shard-iclb: NOTRUN -> [SKIP][38] ([fdo#109284] / [fdo#111827])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [PASS][39] -> [DMESG-WARN][40] ([i915#180]) +3 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl1/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl1/igt@[email protected]

* igt@kms_cursor_crc@pipe-d-cursor-suspend:
- shard-kbl: NOTRUN -> [SKIP][41] ([fdo#109271]) +114 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl6/igt@[email protected]

* igt@kms_cursor_legacy@2x-flip-vs-cursor-legacy:
- shard-iclb: NOTRUN -> [SKIP][42] ([fdo#109274] / [fdo#109278])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: [PASS][43] -> [FAIL][44] ([i915#2346] / [i915#533])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl7/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

* igt@kms_cursor_legacy@pipe-d-single-bo:
- shard-apl: NOTRUN -> [SKIP][45] ([fdo#109271] / [i915#533])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl6/igt@[email protected]

* igt@kms_flip@2x-flip-vs-suspend:
- shard-iclb: NOTRUN -> [SKIP][46] ([fdo#109274]) +2 similar issues
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@kms_flip@2x-plain-flip-fb-recreate-interruptible@ab-hdmi-a1-hdmi-a2:
- shard-glk: [PASS][47] -> [FAIL][48] ([i915#2122])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk9/igt@kms_flip@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk3/igt@kms_flip@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-edp1:
- shard-skl: [PASS][49] -> [FAIL][50] ([i915#79])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl6/igt@kms_flip@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl6/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-ts-check-interruptible@a-edp1:
- shard-skl: [PASS][51] -> [FAIL][52] ([i915#2122]) +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl10/igt@kms_flip@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl9/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- shard-skl: [PASS][53] -> [FAIL][54] ([i915#49])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl7/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl4/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-rgb565-draw-render:
- shard-glk: [PASS][55] -> [FAIL][56] ([i915#49])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk6/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk2/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-apl: [PASS][57] -> [DMESG-WARN][58] ([i915#180])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-apl8/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl6/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-1p-shrfb-fliptrack-mmap-gtt:
- shard-skl: NOTRUN -> [SKIP][59] ([fdo#109271]) +75 similar issues
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl7/igt@[email protected]

* igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-cur-indfb-move:
- shard-iclb: NOTRUN -> [SKIP][60] ([fdo#109280]) +1 similar issue
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@kms_hdr@bpc-switch:
- shard-skl: [PASS][61] -> [FAIL][62] ([i915#1188])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl6/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl10/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc-pipe-d-frame-sequence:
- shard-iclb: NOTRUN -> [SKIP][63] ([fdo#109278]) +2 similar issues
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-alpha-7efc:
- shard-apl: NOTRUN -> [FAIL][64] ([fdo#108145] / [i915#265])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl6/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
- shard-skl: NOTRUN -> [FAIL][65] ([fdo#108145] / [i915#265])
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl1/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-alpha-transparent-fb:
- shard-kbl: NOTRUN -> [FAIL][66] ([i915#265])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl6/igt@[email protected]

* igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
- shard-kbl: NOTRUN -> [SKIP][67] ([fdo#109271] / [i915#2733])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl2/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html

* igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-3:
- shard-apl: NOTRUN -> [SKIP][68] ([fdo#109271] / [i915#658]) +1 similar issue
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl2/igt@[email protected]
- shard-skl: NOTRUN -> [SKIP][69] ([fdo#109271] / [i915#658])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl3/igt@[email protected]

* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:
- shard-kbl: NOTRUN -> [SKIP][70] ([fdo#109271] / [i915#658]) +4 similar issues
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl2/igt@[email protected]

* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-5:
- shard-iclb: NOTRUN -> [SKIP][71] ([i915#658])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@kms_vblank@pipe-d-ts-continuation-idle:
- shard-apl: NOTRUN -> [SKIP][72] ([fdo#109271]) +56 similar issues
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl6/igt@[email protected]

* igt@kms_writeback@writeback-check-output:
- shard-apl: NOTRUN -> [SKIP][73] ([fdo#109271] / [i915#2437])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl2/igt@[email protected]
- shard-skl: NOTRUN -> [SKIP][74] ([fdo#109271] / [i915#2437])
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl3/igt@[email protected]

* igt@kms_writeback@writeback-invalid-parameters:
- shard-kbl: NOTRUN -> [SKIP][75] ([fdo#109271] / [i915#2437])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl1/igt@[email protected]

* igt@nouveau_crc@pipe-b-source-outp-inactive:
- shard-iclb: NOTRUN -> [SKIP][76] ([i915#2530])
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@nouveau_crc@pipe-d-source-outp-inactive:
- shard-iclb: NOTRUN -> [SKIP][77] ([fdo#109278] / [i915#2530])
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@perf@non-zero-reason:
- shard-skl: [PASS][78] -> [FAIL][79] ([i915#2938])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl3/igt@[email protected]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl1/igt@[email protected]

* igt@perf@polling-parameterized:
- shard-glk: [PASS][80] -> [FAIL][81] ([i915#1542])
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk9/igt@[email protected]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk5/igt@[email protected]

* igt@prime_nv_api@nv_i915_import_twice_check_flink_name:
- shard-iclb: NOTRUN -> [SKIP][82] ([fdo#109291])
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@prime_nv_api@nv_i915_import_twice_check_flink_name.html

* igt@sysfs_clients@recycle-many:
- shard-apl: NOTRUN -> [SKIP][83] ([fdo#109271] / [i915#2994])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl2/igt@[email protected]

* igt@sysfs_clients@sema-10:
- shard-iclb: NOTRUN -> [SKIP][84] ([i915#2994])
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@sysfs_clients@split-50:
- shard-kbl: NOTRUN -> [SKIP][85] ([fdo#109271] / [i915#2994]) +1 similar issue
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl1/igt@[email protected]

#### Possible fixes ####

* igt@gem_ctx_persistence@smoketest:
- shard-iclb: [FAIL][86] ([i915#2896]) -> [PASS][87]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb5/igt@[email protected]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb8/igt@[email protected]

* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-iclb: [FAIL][88] ([i915#2842]) -> [PASS][89]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb1/igt@gem_exec_fair@[email protected]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb8/igt@gem_exec_fair@[email protected]

* igt@gem_exec_fair@basic-pace@vecs0:
- shard-kbl: [FAIL][90] ([i915#2842]) -> [PASS][91]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl2/igt@gem_exec_fair@[email protected]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl4/igt@gem_exec_fair@[email protected]

* igt@gem_exec_schedule@deep@vcs0:
- shard-skl: [INCOMPLETE][92] -> [PASS][93]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl3/igt@gem_exec_schedule@[email protected]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl10/igt@gem_exec_schedule@[email protected]

* igt@gem_exec_whisper@basic-contexts-all:
- shard-glk: [DMESG-WARN][94] ([i915#118] / [i915#95]) -> [PASS][95]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk6/igt@[email protected]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk4/igt@[email protected]

* igt@gem_exec_whisper@basic-contexts-forked:
- shard-iclb: [INCOMPLETE][96] ([i915#1895]) -> [PASS][97]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb7/igt@[email protected]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb4/igt@[email protected]

* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [DMESG-WARN][98] ([i915#180]) -> [PASS][99] +1 similar issue
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-apl1/igt@[email protected]
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl2/igt@[email protected]

* igt@i915_module_load@reload-with-fault-injection:
- shard-snb: [DMESG-WARN][100] -> [PASS][101]
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-snb2/igt@[email protected]
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-snb6/igt@[email protected]

* igt@kms_async_flips@alternate-sync-async-flip:
- shard-skl: [FAIL][102] ([i915#2521]) -> [PASS][103]
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl10/igt@[email protected]
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl9/igt@[email protected]

* igt@kms_async_flips@test-time-stamp:
- shard-tglb: [FAIL][104] ([i915#2574]) -> [PASS][105]
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-tglb8/igt@[email protected]
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-tglb8/igt@[email protected]

* igt@kms_draw_crc@draw-method-rgb565-mmap-wc-ytiled:
- shard-glk: [FAIL][106] ([i915#52] / [i915#54]) -> [PASS][107]
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk3/igt@[email protected]
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk4/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible@b-edp1:
- shard-skl: [INCOMPLETE][108] ([i915#198]) -> [PASS][109]
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl9/igt@kms_flip@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl3/igt@kms_flip@[email protected]

* igt@kms_flip@plain-flip-fb-recreate-interruptible@c-edp1:
- shard-skl: [FAIL][110] ([i915#2122]) -> [PASS][111] +2 similar issues
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl4/igt@kms_flip@[email protected]
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl6/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [DMESG-WARN][112] ([i915#180]) -> [PASS][113] +9 similar issues
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl7/igt@[email protected]
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl1/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-1p-primscrn-shrfb-msflip-blt:
- shard-skl: [FAIL][114] ([i915#49]) -> [PASS][115]
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl6/igt@[email protected]
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl6/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: [FAIL][116] ([fdo#108145] / [i915#265]) -> [PASS][117]
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl7/igt@[email protected]
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl4/igt@[email protected]

* igt@kms_psr@psr2_cursor_plane_onoff:
- shard-iclb: [SKIP][118] ([fdo#109441]) -> [PASS][119] +2 similar issues
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb3/igt@kms_psr@psr2_cursor_plane_onoff.html
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html

* igt@perf@polling-small-buf:
- shard-skl: [FAIL][120] ([i915#1722]) -> [PASS][121]
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-skl9/igt@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-skl7/igt@[email protected]

#### Warnings ####

* igt@gem_exec_fair@basic-throttle@rcs0:
- shard-iclb: [FAIL][122] ([i915#2842]) -> [FAIL][123] ([i915#2849])
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb6/igt@gem_exec_fair@[email protected]
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb3/igt@gem_exec_fair@[email protected]

* igt@i915_pm_rc6_residency@rc6-fence:
- shard-iclb: [WARN][124] ([i915#2681] / [i915#2684]) -> [WARN][125] ([i915#2684]) +1 similar issue
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb8/igt@[email protected]
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb5/igt@[email protected]

* igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:
- shard-iclb: [SKIP][126] ([i915#2920]) -> [SKIP][127] ([i915#658]) +2 similar issues
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-iclb2/igt@[email protected]
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-iclb1/igt@[email protected]

* igt@runner@aborted:
- shard-kbl: ([FAIL][128], [FAIL][129], [FAIL][130], [FAIL][131], [FAIL][132], [FAIL][133], [FAIL][134], [FAIL][135], [FAIL][136]) ([fdo#109271] / [i915#1436] / [i915#180] / [i915#1814] / [i915#3002]) -> ([FAIL][137], [FAIL][138], [FAIL][139], [FAIL][140], [FAIL][141], [FAIL][142], [FAIL][143]) ([i915#180] / [i915#1814] / [i915#3002] / [i915#602])
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl1/igt@[email protected]
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl7/igt@[email protected]
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl7/igt@[email protected]
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl7/igt@[email protected]
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl1/igt@[email protected]
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl1/igt@[email protected]
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl1/igt@[email protected]
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl7/igt@[email protected]
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-kbl2/igt@[email protected]
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl3/igt@[email protected]
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl1/igt@[email protected]
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl1/igt@[email protected]
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl4/igt@[email protected]
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl7/igt@[email protected]
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl7/igt@[email protected]
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-kbl7/igt@[email protected]
- shard-apl: ([FAIL][144], [FAIL][145]) ([fdo#109271] / [i915#180] / [i915#1814]) -> [FAIL][146] ([fdo#109271] / [i915#1814])
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-apl1/igt@[email protected]
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-apl1/igt@[email protected]
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-apl6/igt@[email protected]
- shard-glk: ([FAIL][147], [FAIL][148]) ([i915#3002] / [k.org#202321]) -> ([FAIL][149], [FAIL][150], [FAIL][151]) ([i915#2722] / [i915#3002] / [k.org#202321])
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk5/igt@[email protected]
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9926/shard-glk3/igt@[email protected]
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/shard-glk6/igt@[email protected]
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_1989

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_19892/index.html

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
In reply to Takashi Iwai
Quoted 37 lines · Takashi Iwai

intel_dsm_platform_mux_info() tries to parse the ACPI package data from _DSM for the debug information, but it assumes the fixed format without checking what values are stored in the elements actually. When an unexpected value is returned from BIOS, it may lead to GPF or NULL dereference, as reported recently.

Add the checks of the contents in the returned values and skip the values for invalid cases.

v1->v2: Check the info contents before dereferencing, too

---
 drivers/gpu/drm/i915/display/intel_acpi.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_acpi.c +5 -1
index e21fb14d5e07..833d0c1be4f1 100644
@@ -84,13 +84,31 @@ static void intel_dsm_platform_mux_info(acpi_handle dhandle)
 		return;
 	}
 
+	if (!pkg->package.count) {
+		DRM_DEBUG_DRIVER("no connection in _DSM\n");
+		return;
+	}
+
 	connector_count = &pkg->package.elements[0];
 	DRM_DEBUG_DRIVER("MUX info connectors: %lld\n",
 		  (unsigned long long)connector_count->integer.value);
 	for (i = 1; i < pkg->package.count; i++) {
 		union acpi_object *obj = &pkg->package.elements[i];
-		union acpi_object *connector_id = &obj->package.elements[0];

drivers/gpu/drm/i915/display/intel_acpi.c static void intel_dsm_platform_mux_info(acpi_handle dhandle) · line 105

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_acpi.c +9 -1
-		union acpi_object *info = &obj->package.elements[1];
+		union acpi_object *connector_id;
+		union acpi_object *info;
+
+		if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < 2) {
+			DRM_DEBUG_DRIVER("Invalid object for MUX #%d\n", i);
+			continue;
+		}
+
+		connector_id = &obj->package.elements[0];

You don't want to check connector_id->type as well?

Quoted 16 lines
drivers/gpu/drm/i915/display/intel_acpi.c +6 -0
+		info = &obj->package.elements[1];
+		if (info->type != ACPI_TYPE_BUFFER || info->buffer.length < 4) {
+			DRM_DEBUG_DRIVER("Invalid info for MUX obj #%d\n", i);
+			continue;
+		}
+
 		DRM_DEBUG_DRIVER("Connector id: 0x%016llx\n",
 			  (unsigned long long)connector_id->integer.value);
 		DRM_DEBUG_DRIVER("  port id: %s\n",
Signature · 6 lines
2.26.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 43 lines · Ville Syrjälä
Quoted 41 lines · Takashi Iwai

intel_dsm_platform_mux_info() tries to parse the ACPI package data from _DSM for the debug information, but it assumes the fixed format without checking what values are stored in the elements actually. When an unexpected value is returned from BIOS, it may lead to GPF or NULL dereference, as reported recently.

Add the checks of the contents in the returned values and skip the values for invalid cases.

v1->v2: Check the info contents before dereferencing, too

---
 drivers/gpu/drm/i915/display/intel_acpi.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_acpi.c +8 -2
index e21fb14d5e07..833d0c1be4f1 100644
@@ -84,13 +84,31 @@ static void intel_dsm_platform_mux_info(acpi_handle dhandle)
 		return;
 	}
 
+	if (!pkg->package.count) {
+		DRM_DEBUG_DRIVER("no connection in _DSM\n");
+		return;
+	}
+
 	connector_count = &pkg->package.elements[0];
 	DRM_DEBUG_DRIVER("MUX info connectors: %lld\n",
 		  (unsigned long long)connector_count->integer.value);
 	for (i = 1; i < pkg->package.count; i++) {
 		union acpi_object *obj = &pkg->package.elements[i];
-		union acpi_object *connector_id = &obj->package.elements[0];
-		union acpi_object *info = &obj->package.elements[1];
+		union acpi_object *connector_id;
+		union acpi_object *info;
+
Quoted 8 lines

drivers/gpu/drm/i915/display/intel_acpi.c static void intel_dsm_platform_mux_info(acpi_handle dhandle) · line 105

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_acpi.c +6 -0
+		if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < 2) {
+			DRM_DEBUG_DRIVER("Invalid object for MUX #%d\n", i);
+			continue;
+		}
+
+		connector_id = &obj->package.elements[0];

You don't want to check connector_id->type as well?

I added only the minimal checks that may lead to Oops.

Takashi

Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/i915/display/intel_acpi.c +6 -0
+		info = &obj->package.elements[1];
+		if (info->type != ACPI_TYPE_BUFFER || info->buffer.length < 4) {
+			DRM_DEBUG_DRIVER("Invalid info for MUX obj #%d\n", i);
+			continue;
+		}
+
 		DRM_DEBUG_DRIVER("Connector id: 0x%016llx\n",
 			  (unsigned long long)connector_id->integer.value);
 		DRM_DEBUG_DRIVER("  port id: %s\n",
Signature · 1 line
2.26.2
Quoted 9 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 2 lines
Ville Syrjälä
Intel

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
Quoted 54 lines · Takashi Iwai
Quoted 43 lines · Ville Syrjälä
Quoted 41 lines · Takashi Iwai

intel_dsm_platform_mux_info() tries to parse the ACPI package data from _DSM for the debug information, but it assumes the fixed format without checking what values are stored in the elements actually. When an unexpected value is returned from BIOS, it may lead to GPF or NULL dereference, as reported recently.

Add the checks of the contents in the returned values and skip the values for invalid cases.

v1->v2: Check the info contents before dereferencing, too

---
 drivers/gpu/drm/i915/display/intel_acpi.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_acpi.c +8 -2
index e21fb14d5e07..833d0c1be4f1 100644
@@ -84,13 +84,31 @@ static void intel_dsm_platform_mux_info(acpi_handle dhandle)
 		return;
 	}
 
+	if (!pkg->package.count) {
+		DRM_DEBUG_DRIVER("no connection in _DSM\n");
+		return;
+	}
+
 	connector_count = &pkg->package.elements[0];
 	DRM_DEBUG_DRIVER("MUX info connectors: %lld\n",
 		  (unsigned long long)connector_count->integer.value);
 	for (i = 1; i < pkg->package.count; i++) {
 		union acpi_object *obj = &pkg->package.elements[i];
-		union acpi_object *connector_id = &obj->package.elements[0];
-		union acpi_object *info = &obj->package.elements[1];
+		union acpi_object *connector_id;
+		union acpi_object *info;
+
Quoted 8 lines

drivers/gpu/drm/i915/display/intel_acpi.c static void intel_dsm_platform_mux_info(acpi_handle dhandle) · line 105

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_acpi.c +6 -0
+		if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < 2) {
+			DRM_DEBUG_DRIVER("Invalid object for MUX #%d\n", i);
+			continue;
+		}
+
+		connector_id = &obj->package.elements[0];

You don't want to check connector_id->type as well?

Quoted 1 line

I added only the minimal checks that may lead to Oops.

OK. I guess misinterpreting something else as an integer isn't particular dangerous in this case.

Pushed to drm-intel-next. Thanks.

Oh, could you ask the bug reporter to attach an acpidump to the bug? Might be good to have that stuff on record somewhere if/when someone wants to actually figure out what's going on here.

That said, maybe we should just nuke this whole thing instead? Unless I'm missing someting this code doesn't seem to actually do anything...

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 56 lines · Ville Syrjälä
Quoted 54 lines · Takashi Iwai
Quoted 51 lines · Ville Syrjälä
Quoted 37 lines · Takashi Iwai

intel_dsm_platform_mux_info() tries to parse the ACPI package data from _DSM for the debug information, but it assumes the fixed format without checking what values are stored in the elements actually. When an unexpected value is returned from BIOS, it may lead to GPF or NULL dereference, as reported recently.

Add the checks of the contents in the returned values and skip the values for invalid cases.

v1->v2: Check the info contents before dereferencing, too

---
 drivers/gpu/drm/i915/display/intel_acpi.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_acpi.c +5 -1
index e21fb14d5e07..833d0c1be4f1 100644
@@ -84,13 +84,31 @@ static void intel_dsm_platform_mux_info(acpi_handle dhandle)
 		return;
 	}
 
+	if (!pkg->package.count) {
+		DRM_DEBUG_DRIVER("no connection in _DSM\n");
+		return;
+	}
+
 	connector_count = &pkg->package.elements[0];
 	DRM_DEBUG_DRIVER("MUX info connectors: %lld\n",
 		  (unsigned long long)connector_count->integer.value);
 	for (i = 1; i < pkg->package.count; i++) {
 		union acpi_object *obj = &pkg->package.elements[i];
-		union acpi_object *connector_id = &obj->package.elements[0];

drivers/gpu/drm/i915/display/intel_acpi.c static void intel_dsm_platform_mux_info(acpi_handle dhandle) · line 105

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_acpi.c +9 -1
-		union acpi_object *info = &obj->package.elements[1];
+		union acpi_object *connector_id;
+		union acpi_object *info;
+
+		if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < 2) {
+			DRM_DEBUG_DRIVER("Invalid object for MUX #%d\n", i);
+			continue;
+		}
+
+		connector_id = &obj->package.elements[0];

You don't want to check connector_id->type as well?

Quoted 6 lines
Quoted 1 line

I added only the minimal checks that may lead to Oops.

OK. I guess misinterpreting something else as an integer isn't particular dangerous in this case.

Pushed to drm-intel-next. Thanks.

Great, thanks!

Quoted 3 lines

Oh, could you ask the bug reporter to attach an acpidump to the bug? Might be good to have that stuff on record somewhere if/when someone wants to actually figure out what's going on here.

OK, I'll ask.

Quoted 3 lines

That said, maybe we should just nuke this whole thing instead? Unless I'm missing someting this code doesn't seem to actually do anything...

Yeah, that looks nothing but showing the debug information and that can be checked via acpidump output, too...

Takashi
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw
Quoted 9 lines · Takashi Iwai
Quoted 4 lines · Ville Syrjälä

Oh, could you ask the bug reporter to attach an acpidump to the bug? Might be good to have that stuff on record somewhere if/when someone wants to actually figure out what's going on here.

OK, I'll ask.

Available at
acpidump: https://susepaste.org/59777448
hwinfo: https://susepaste.org/86284020

thanks,

Takashi
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw
Quoted 10 lines · Takashi Iwai
Quoted 8 lines · Takashi Iwai
Quoted 4 lines · Ville Syrjälä

Oh, could you ask the bug reporter to attach an acpidump to the bug? Might be good to have that stuff on record somewhere if/when someone wants to actually figure out what's going on here.

Quoted 5 lines
Quoted 1 line

OK, I'll ask.

Available at
acpidump: https://susepaste.org/59777448
hwinfo: https://susepaste.org/86284020

Those will apparently expire real soon. I took local copies out of morbid curiosity, but that's not going to help anyone else in the future. I rather wish bug reporting tools would flat out refuse to accept any pastebin links.

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
Quoted 14 lines · Ville Syrjälä
Quoted 12 lines · Takashi Iwai
Quoted 9 lines · Takashi Iwai
Quoted 4 lines · Ville Syrjälä

Oh, could you ask the bug reporter to attach an acpidump to the bug? Might be good to have that stuff on record somewhere if/when someone wants to actually figure out what's going on here.

OK, I'll ask.

Quoted 8 lines
Quoted 3 lines

Available at
acpidump: https://susepaste.org/59777448
hwinfo: https://susepaste.org/86284020

Those will apparently expire real soon. I took local copies out of morbid curiosity, but that's not going to help anyone else in the future. I rather wish bug reporting tools would flat out refuse to accept any pastebin links.

Yeah, don't worry, I'll upload them to Bugzilla later in anyway.

Takashi