Skip to contentSkip to conversation

Fixing Possible Null Pointer Dereference

PATCH In review Nischal Varide 4 participants 10 messages Aug 24, 2020 – Aug 27, 2020

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

PATCH 1/5 Fixing Possible Null Pointer Dereference

There is a possble Null Pointer dereference in intel_atomic.c and this patch fixes the same by introducting a check to old_state, new_state old_conn_state and new_conn_state variables.

---
 drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/display/intel_atomic.c +5 -0
index 630f49b7aa01..ab58f061c8a7 100644
@@ -132,6 +132,9 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
 		to_intel_digital_connector_state(old_state);
 	struct drm_crtc_state *crtc_state;
 
+	if (!(new_state && new_conn_state && old_state && old_conn_state))
+		return 0;
+
 	intel_hdcp_atomic_check(conn, old_state, new_state);
 	intel_psr_atomic_check(conn, old_state, new_state);
 
@@ -192,6 +195,8 @@ intel_connector_needs_modeset(struct intel_atomic_state *state,
 
 	old_conn_state = drm_atomic_get_old_connector_state(&state->base, connector);
 	new_conn_state = drm_atomic_get_new_connector_state(&state->base, connector);
+	if (!(old_conn_state && new_conn_state))
+		return 0;
 
 	return old_conn_state->crtc != new_conn_state->crtc ||
 	       (new_conn_state->crtc &&
Signature · 6 lines
2.26.0

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

PATCH 2/5 Fixing Possible Null Pointer Dereference.

A Possible Null Pointer Dereference of a Pointer obj is handled in intel_displa.c .This patch introduced a check on pointer obj before dereferencing

---
 drivers/gpu/drm/i915/display/intel_display.c | 22 +++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +12 -10
index 7d50b7177d40..30d5ab3f098d 100644
@@ -2265,9 +2265,9 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
 	pinctl = 0;
 	if (HAS_GMCH(dev_priv))
 		pinctl |= PIN_MAPPABLE;
-
-	vma = i915_gem_object_pin_to_display_plane(obj,
-						   alignment, view, pinctl);
+	if (obj)
+		vma = i915_gem_object_pin_to_display_plane(obj,
+			alignment, view, pinctl);
 	if (IS_ERR(vma))
 		goto err;
 
@@ -11309,10 +11309,13 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
 	const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
 	u32 base;
 
-	if (INTEL_INFO(dev_priv)->display.cursor_needs_physical)
-		base = sg_dma_address(obj->mm.pages->sgl);
-	else
-		base = intel_plane_ggtt_offset(plane_state);
+	if (obj) {
+
+		if (INTEL_INFO(dev_priv)->display.cursor_needs_physical)
+			base = sg_dma_address(obj->mm.pages->sgl);
+		else
+			base = intel_plane_ggtt_offset(plane_state);
+	}
 
 	return base + plane_state->color_plane[0].offset;
 }
@@ -17166,10 +17169,9 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
 					unsigned num_clips)
 {
 	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
-
-	i915_gem_object_flush_if_display(obj);
+	if (obj)
+		i915_gem_object_flush_if_display(obj);
 	intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB);
-
 	return 0;
 }
 
Signature · 6 lines
2.26.0

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

PATCH 3/5 Fixing a Possible Null Pointer Dereference.

In reply to Nischal Varide

This Patch addresses a Possible Null Pointer Dereference of variables new_stae, new_conn_state and old_state, old_conn_state in intel_sdvo.c

---
 drivers/gpu/drm/i915/display/intel_sdvo.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_sdvo.c +3 -0
index 2da4388e1540..186a2d695bb6 100644
@@ -2505,6 +2505,9 @@ static int intel_sdvo_atomic_check(struct drm_connector *conn,
 	struct intel_sdvo_connector_state *new_state =
 		to_intel_sdvo_connector_state(new_conn_state);
 
+	if (!(new_conn_state && old_conn_state && old_state && new_state))
+		return 0;
+
 	if (new_conn_state->crtc &&
 	    (memcmp(&old_state->tv, &new_state->tv, sizeof(old_state->tv)) ||
 	     memcmp(&old_conn_state->tv, &new_conn_state->tv, sizeof(old_conn_state->tv)))) {
Signature · 6 lines
2.26.0

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

PATCH 4/5 Fixing Possible Null Pointer Dereference.

In reply to Nischal Varide

A possible Null Pointer dereference of new_state,old_state, new_crtc_state pointers from intel_tv.c is handled in this patch.

---
 drivers/gpu/drm/i915/display/intel_tv.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/display/intel_tv.c +10 -7
index 777032d9697b..5600d146ae81 100644
@@ -1836,17 +1836,20 @@ static int intel_tv_atomic_check(struct drm_connector *connector,
 	struct drm_connector_state *old_state;
 
 	new_state = drm_atomic_get_new_connector_state(state, connector);
-	if (!new_state->crtc)
-		return 0;
-
 	old_state = drm_atomic_get_old_connector_state(state, connector);
 	new_crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc);
 
+	if (!(old_state && new_state && new_crtc_state))
+		return 0;
+
+	if (!new_state->crtc)
+		return 0;
+
 	if (old_state->tv.mode != new_state->tv.mode ||
-	    old_state->tv.margins.left != new_state->tv.margins.left ||
-	    old_state->tv.margins.right != new_state->tv.margins.right ||
-	    old_state->tv.margins.top != new_state->tv.margins.top ||
-	    old_state->tv.margins.bottom != new_state->tv.margins.bottom) {
+		old_state->tv.margins.left != new_state->tv.margins.left ||
+		old_state->tv.margins.right != new_state->tv.margins.right ||
+		old_state->tv.margins.top != new_state->tv.margins.top ||
+		old_state->tv.margins.bottom != new_state->tv.margins.bottom) {
 		/* Force a modeset. */
 
 		new_crtc_state->connectors_changed = true;
Signature · 6 lines
2.26.0

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

PATCH 5/5 Fixing a Possible Null Pointer Dereference.

In reply to Nischal Varide

Fixing a Possible Null Pointer Dereference in intel_crt.c. Introduced a Null Check for dev_priv pointer before dereferencing.

---
 drivers/gpu/drm/i915/display/intel_crt.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/display/intel_crt.c +3 -0
index 5b4510ce5693..b5777fdc8cac 100644
@@ -504,6 +504,9 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
 	bool ret;
 	u32 save_adpa;
 
+	if (!(dev_priv))
+		return false;
+
 	/*
 	 * Doing a force trigger causes a hpd interrupt to get sent, which can
 	 * get us stuck in a loop if we're polling:
Signature · 6 lines
2.26.0

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

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] Fixing Possible Null Pointer Dereference

In reply to Nischal Varide
== Series Details ==

== Series Details ==

Series: series starting with [1/5] Fixing Possible Null Pointer Dereference
URL : https://patchwork.freedesktop.org/series/80939/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
e2dc6f705c6e Fixing Possible Null Pointer Dereference
3b7087647897 Fixing Possible Null Pointer Dereference.
-:25: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#25: FILE: drivers/gpu/drm/i915/display/intel_display.c:2270:
+		vma = i915_gem_object_pin_to_display_plane(obj,
+			alignment, view, pinctl);

-:38: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #38: FILE: drivers/gpu/drm/i915/display/intel_display.c:11313:
+ if (obj) {
+

total: 0 errors, 0 warnings, 2 checks, 41 lines checked 392417891b5b Fixing a Possible Null Pointer Dereference. 932de90c59ae Fixing Possible Null Pointer Dereference. fe514036c049 Fixing a Possible Null Pointer Dereference.

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

#6 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/5] Fixing Possible Null Pointer Dereference

In reply to Nischal Varide
== Series Details ==

== Series Details ==

Series: series starting with [1/5] Fixing Possible Null Pointer Dereference
URL : https://patchwork.freedesktop.org/series/80939/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8918 -> Patchwork_18392
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_rpm@module-reload:
- fi-apl-guc: [PASS][1] -> [DMESG-WARN][2] ([i915#1635] / [i915#1982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/fi-apl-guc/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/fi-apl-guc/igt@[email protected]

#### Possible fixes ####

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-n3050: [DMESG-WARN][3] ([i915#1982]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/fi-bsw-n3050/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/fi-bsw-n3050/igt@[email protected]
- fi-bsw-kefka: [DMESG-WARN][5] ([i915#1982]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/fi-bsw-kefka/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/fi-bsw-kefka/igt@[email protected]

* igt@kms_flip@basic-flip-vs-wf_vblank@c-hdmi-a2:
- fi-skl-guc: [DMESG-WARN][7] ([i915#2203]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/fi-skl-guc/igt@kms_flip@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/fi-skl-guc/igt@kms_flip@[email protected]

#### Warnings ####

* igt@kms_force_connector_basic@force-connector-state:
- fi-kbl-x1275: [DMESG-WARN][9] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][10] ([i915#62] / [i915#92]) +3 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/fi-kbl-x1275/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/fi-kbl-x1275/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-kbl-x1275: [DMESG-WARN][11] ([i915#62] / [i915#92]) -> [DMESG-WARN][12] ([i915#62] / [i915#92] / [i915#95]) +3 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/fi-kbl-x1275/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/fi-kbl-x1275/igt@[email protected]

[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (37 -> 34)
------------------------------

Missing (3): fi-byt-clapper fi-byt-squawks fi-bsw-cyan

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

* Linux: CI_DRM_8918 -> Patchwork_18392

CI-20190529: 20190529
CI_DRM_8918: 7296072da95d2d2550ef2d4836bc72663ee711cc @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5770: f1d0c240ea2e631dfb9f493f37f8fb61cb2b1cf2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18392: fe514036c04927db4d21ec423cc1d3ff9747700e @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

fe514036c049 Fixing a Possible Null Pointer Dereference. 932de90c59ae Fixing Possible Null Pointer Dereference. 392417891b5b Fixing a Possible Null Pointer Dereference. 3b7087647897 Fixing Possible Null Pointer Dereference. e2dc6f705c6e Fixing Possible Null Pointer Dereference

== Logs ==

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

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

#7 lore raw

[Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/5] Fixing Possible Null Pointer Dereference

In reply to Nischal Varide
== Series Details ==

== Series Details ==

Series: series starting with [1/5] Fixing Possible Null Pointer Dereference
URL : https://patchwork.freedesktop.org/series/80939/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8918_full -> Patchwork_18392_full
====================================================

Summary
-------

**FAILURE**

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

If you think the reported changes have nothing to do with the changes introduced in Patchwork_18392_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_18392_full:

### IGT changes ###

#### Possible regressions ####

* igt@gem_ctx_isolation@preservation-s3@bcs0:
- shard-skl: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl8/igt@gem_ctx_isolation@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl3/igt@gem_ctx_isolation@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_whisper@basic-forked:
- shard-glk: [PASS][3] -> [DMESG-WARN][4] ([i915#118] / [i915#95])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-glk6/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-glk9/igt@[email protected]

* igt@i915_pm_rpm@system-suspend:
- shard-skl: [PASS][5] -> [INCOMPLETE][6] ([i915#151])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl7/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl4/igt@[email protected]

* igt@i915_selftest@mock@contexts:
- shard-apl: [PASS][7] -> [INCOMPLETE][8] ([i915#1635] / [i915#2278])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-apl8/igt@i915_selftest@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-apl1/igt@i915_selftest@[email protected]

* igt@kms_color@pipe-b-ctm-negative:
- shard-skl: [PASS][9] -> [DMESG-WARN][10] ([i915#1982]) +12 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl1/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl5/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible@c-dp1:
- shard-apl: [PASS][11] -> [FAIL][12] ([i915#1635] / [i915#79])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-apl8/igt@kms_flip@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-apl8/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-kbl: [PASS][13] -> [DMESG-WARN][14] ([i915#180]) +5 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-kbl7/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-kbl4/igt@[email protected]

* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [PASS][15] -> [FAIL][16] ([i915#1188])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl9/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl3/igt@[email protected]

* igt@kms_psr@psr2_sprite_blt:
- shard-iclb: [PASS][17] -> [SKIP][18] ([fdo#109441]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-iclb6/igt@kms_psr@psr2_sprite_blt.html

* igt@perf_pmu@module-unload:
- shard-tglb: [PASS][19] -> [DMESG-WARN][20] ([i915#1982])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-tglb3/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-tglb2/igt@[email protected]

* igt@prime_busy@hang@bcs0:
- shard-hsw: [PASS][21] -> [FAIL][22] ([i915#2258]) +4 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-hsw8/igt@prime_busy@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-hsw4/igt@prime_busy@[email protected]

#### Possible fixes ####

* igt@gem_exec_create@forked:
- shard-glk: [DMESG-WARN][23] ([i915#118] / [i915#95]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-glk6/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-glk8/igt@[email protected]

* igt@kms_big_fb@x-tiled-8bpp-rotate-0:
- shard-kbl: [DMESG-WARN][25] ([i915#1982]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-kbl4/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-kbl2/igt@[email protected]

* igt@kms_cursor_legacy@cursora-vs-flipa-varying-size:
- shard-skl: [DMESG-WARN][27] ([i915#1982]) -> [PASS][28] +4 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl4/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl2/igt@[email protected]

* igt@kms_cursor_legacy@short-flip-after-cursor-toggle:
- shard-tglb: [DMESG-WARN][29] ([i915#1982]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-tglb8/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-tglb5/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-gtt:
- shard-skl: [FAIL][31] ([i915#49]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl8/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-gtt.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl1/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-gtt.html

* igt@kms_hdr@bpc-switch:
- shard-skl: [FAIL][33] ([i915#1188]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl9/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl9/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [FAIL][35] ([fdo#108145] / [i915#265]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-skl5/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-skl9/igt@[email protected]

* igt@kms_psr@psr2_no_drrs:
- shard-iclb: [SKIP][37] ([fdo#109441]) -> [PASS][38] +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-iclb6/igt@kms_psr@psr2_no_drrs.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-iclb2/igt@kms_psr@psr2_no_drrs.html

* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-kbl: [DMESG-WARN][39] ([i915#180]) -> [PASS][40] +2 similar issues
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-kbl4/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-kbl7/igt@[email protected]

* igt@perf@blocking-parameterized:
- shard-iclb: [FAIL][41] ([i915#1542]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-iclb1/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-iclb4/igt@[email protected]

* igt@perf_pmu@module-unload:
- shard-apl: [DMESG-WARN][43] ([i915#1635] / [i915#1982]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-apl4/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-apl8/igt@[email protected]

#### Warnings ####

* igt@kms_content_protection@atomic:
- shard-kbl: [TIMEOUT][45] ([i915#1319] / [i915#1958]) -> [TIMEOUT][46] ([i915#1319])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-kbl1/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-kbl2/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-cpu:
- shard-glk: [INCOMPLETE][47] -> [SKIP][48] ([fdo#109271])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8918/shard-glk2/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18392/shard-glk1/igt@[email protected]

[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#151]: https://gitlab.freedesktop.org/drm/intel/issues/151
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1958]: https://gitlab.freedesktop.org/drm/intel/issues/1958
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2258]: https://gitlab.freedesktop.org/drm/intel/issues/2258
[i915#2278]: https://gitlab.freedesktop.org/drm/intel/issues/2278
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (11 -> 11)
------------------------------

No changes in participating hosts

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

* Linux: CI_DRM_8918 -> Patchwork_18392

CI-20190529: 20190529
CI_DRM_8918: 7296072da95d2d2550ef2d4836bc72663ee711cc @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5770: f1d0c240ea2e631dfb9f493f37f8fb61cb2b1cf2 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18392: fe514036c04927db4d21ec423cc1d3ff9747700e @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

#8 lore raw
In reply to Nischal Varide
Quoted 3 lines · Nischal Varide

There is a possble Null Pointer dereference in intel_atomic.c and this patch fixes the same by introducting a check to old_state, new_state old_conn_state and new_conn_state variables.

Not possible. In fact none of the supposed null ptrs in the series seem possible to me.

Quoted 36 lines
---
 drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/display/intel_atomic.c +5 -0
index 630f49b7aa01..ab58f061c8a7 100644
@@ -132,6 +132,9 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
 		to_intel_digital_connector_state(old_state);
 	struct drm_crtc_state *crtc_state;
 
+	if (!(new_state && new_conn_state && old_state && old_conn_state))
+		return 0;
+
 	intel_hdcp_atomic_check(conn, old_state, new_state);
 	intel_psr_atomic_check(conn, old_state, new_state);
 
@@ -192,6 +195,8 @@ intel_connector_needs_modeset(struct intel_atomic_state *state,
 
 	old_conn_state = drm_atomic_get_old_connector_state(&state->base, connector);
 	new_conn_state = drm_atomic_get_new_connector_state(&state->base, connector);
+	if (!(old_conn_state && new_conn_state))
+		return 0;
 
 	return old_conn_state->crtc != new_conn_state->crtc ||
 	       (new_conn_state->crtc &&
Signature · 6 lines
2.26.0

_______________________________________________
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
#9 lore raw
Quoted 10 lines

-----Original Message-----
From: Intel-gfx <[email protected]> On Behalf Of Ville Syrjälä
Sent: Tuesday, August 25, 2020 1:29 AM
To: Varide, Nischal <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH 1/5] Fixing Possible Null Pointer Dereference

Quoted 7 lines
Quoted 3 lines · Nischal Varide

There is a possble Null Pointer dereference in intel_atomic.c and this patch fixes the same by introducting a check to old_state, new_state old_conn_state and new_conn_state variables.

Not possible. In fact none of the supposed null ptrs in the series seem possible to me.

Hi Nischal,
Yeah I agree with Ville, these all seem to be false positives. We don't expect these to be NULL at this deep in the call flow. You can drop these.

Regards,
Uma Shankar

Quoted 37 lines

drivers/gpu/drm/i915/display/intel_atomic.c int intel_digital_connector_atomic_check(struct

Quoted 12 lines
---
 drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/display/intel_atomic.c +0 -0
index 630f49b7aa01..ab58f061c8a7 100644
@@ -132,6 +132,9 @@ int intel_digital_connector_atomic_check(struct

drm_connector *conn,

drivers/gpu/drm/i915/display/intel_atomic.c intel_connector_needs_modeset(struct · line 197

Quoted 13 lines
drivers/gpu/drm/i915/display/intel_atomic.c +3 -0
 		to_intel_digital_connector_state(old_state);
 	struct drm_crtc_state *crtc_state;
 
+	if (!(new_state && new_conn_state && old_state && old_conn_state))
+		return 0;
+
 	intel_hdcp_atomic_check(conn, old_state, new_state);
 	intel_psr_atomic_check(conn, old_state, new_state);
 
@@ -192,6 +195,8 @@ intel_connector_needs_modeset(struct
 intel_atomic_state *state,
 
 	old_conn_state = drm_atomic_get_old_connector_state(&state->base,

connector);

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_atomic.c +2 -0
 	new_conn_state = drm_atomic_get_new_connector_state(&state->base,
 connector);
+	if (!(old_conn_state && new_conn_state))
+		return 0;
 
drivers/gpu/drm/i915/display/intel_atomic.c +0 -1
 	return old_conn_state->crtc != new_conn_state->crtc ||
 	       (new_conn_state->crtc &&
--

2.26.0

Quoted 12 lines
Quoted 4 lines

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

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

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