drm: Check if primary mst is null
Subsystems (3)
PATCH v2 1/1 drm: Check if primary mst is null
Unfortunately drm_dp_get_mst_branch_device which is called from both drm_dp_mst_handle_down_rep and drm_dp_mst_handle_up_rep seem to rely on that mgr->mst_primary is not NULL, which seem to be wrong as it can be cleared with simultaneous mode set, if probing fails or in other case. mgr->lock mutex doesn't protect against that as it might just get assigned to NULL right before, not simultaneously.
There are currently bugs 107738, 108616 bugs which crash in drm_dp_get_mst_branch_device, caused by this issue.
v2: Refactored the code, as it was nicely noticed.
Fixed Bugzilla bug numbers(second was 108616, but not 108816) and added links.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108616
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107738
--- drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_dp_mst_topology.c +3 -0
@@ -1275,6 +1275,9 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_mutex_lock (&mgr->lock); mstb = mgr->mst_primary; +if (!mstb) + goto out; +for (i =0 ; i < lct -1 ; i++) {int shift = (i %2 ) ?0 :4 ;int port_num = (rad[i /2 ] >> shift) &0xf ;
Signature · 1 line
2.17.1
Quoted 9 lines · Stanislav Lisovskiy
Unfortunately
drm_dp_get_mst_branch_devicewhich is called from bothdrm_dp_mst_handle_down_repanddrm_dp_mst_handle_up_repseem to rely on thatmgr->mst_primaryis not NULL, which seem to be wrong as it can be
cleared with simultaneous mode set, if probing fails or in other case.mgr->lockmutex doesn't protect against that as it might just get assigned to NULL right before, not simultaneously.
Quoted 7 lines
There are currently bugs 107738, 108616 bugs which crash in
drm_dp_get_mst_branch_device, caused by this issue.v2: Refactored the code, as it was nicely noticed.
Fixed Bugzilla bugnumbers(second was 108616, but not 108816)and added links.
Hi Lyude Paul,
Thank you for quick review, just poking you
here as requested :)
Quoted 23 lines
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108616
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107738Signed-off-by Stanislav Lisovskiy <[email protected]>--- drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/drm_dp_mst_topology.c +3
-0@@ -1275,6 +1275,9 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_ mutex_lock(&mgr->lock); mstb = mgr->mst_primary; +if (!mstb) + goto out; +for (i =0 ; i < lct -1 ; i++) {int shift = (i %2 ) ?0 :4 ;int
port_num= (rad[i / 2] >> shift) &0xf;
Signature · 3 lines
Best Regards, Lisovskiy Stanislav
Patchwork
CI✗ Fi.CI.BAT: failure for drm: Check if primary mst is null (rev2)
In reply to Stanislav Lisovskiy== Series Details ==
== Series Details ==
Series: drm: Check if primary mst is null (rev2)
URL : https://patchwork.freedesktop.org/series/52174/
State : failure
== Summary ==
= CI Bug Log - changes from CI_DRM_5103 -> Patchwork_10770 =
== Summary - FAILURE ==
Serious unknown changes coming with Patchwork_10770 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_10770, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/52174/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_10770:
=== IGT changes ===
==== Possible regressions ====
igt@drv_selftest@live_hangcheck:
fi-cfl-8109u: PASS -> DMESG-FAIL +1== Known issues ==
Here are the changes found in Patchwork_10770 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_chamelium@common-hpd-after-suspend:
fi-skl-6700k2: PASS -> INCOMPLETE (fdo#104108, k.org#199541, fdo#107773, fdo#105524)
igt@kms_frontbuffer_tracking@basic:
fi-byt-clapper: PASS -> FAIL (fdo#103167)
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
fi-byt-clapper: PASS -> FAIL (fdo#107362)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-icl-u: PASS -> INCOMPLETE (fdo#107713)
==== Possible fixes ====
igt@gem_ctx_create@basic-files:
fi-icl-u2: DMESG-WARN (fdo#107724) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-byt-clapper: FAIL (fdo#107362, fdo#103191) -> PASS
igt@prime_vgem@basic-fence-flip:
fi-ilk-650: FAIL (fdo#104008) -> PASS
==== Warnings ====
igt@drv_selftest@live_contexts:
fi-icl-u2: DMESG-FAIL (fdo#108569) -> INCOMPLETE (fdo#108315) fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#105524 https://bugs.freedesktop.org/show_bug.cgi?id=105524
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107713 https://bugs.freedesktop.org/show_bug.cgi?id=107713
fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#108315 https://bugs.freedesktop.org/show_bug.cgi?id=108315
fdo#108569 https://bugs.freedesktop.org/show_bug.cgi?id=108569
k.org#199541 https://bugzilla.kernel.org/show_bug.cgi?id=199541
== Participating hosts (54 -> 47) ==
Missing (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-snb-2520m fi-ctg-p8600
== Build changes ==
* Linux: CI_DRM_5103 -> Patchwork_10770
CI_DRM_5103: 23c1138030ad65402f698ab0b356e2f55722bc77 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4712: a3ede1b535ac8137f6949c468edd7054453d5dae @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10770: 13e7715c72d20e925ff22507365c9273c54ed4c6 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
13e7715c72d2 drm: Check if primary mst is null
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10770/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: failure for drm: Check if primary mst is null (rev2)
Quoted 8 lines · Patchwork
== Series Details ==
Series: drm: Check if primary mst is null (rev2)
URL : https://patchwork.freedesktop.org/series/52174/
State : failure== Summary ==
Quoted 7 lines
= CI Bug Log - changes from
CI_DRM_5103->Patchwork_10770=== Summary - FAILURE ==
Serious unknown changes coming with
Patchwork_10770absolutely need
to be
verified manually.
The patch itself is a two line fix against NULL pointer dereference like if (!mgr->mst_primary) goto exit. So most likely this is noise. If this check made it go different code path, this means it would crash anyway. Otherwise codepath would be exactly same as before. Also previously v1 version passed, even though new v2 changes are cosmetic.
(just following instructions to notify you, instead of blindly tapping "test latest revision" button :D)
Quoted 106 lines
If you think the reported changes have nothing to do with the
changes
introduced inPatchwork_10770, please notify your bug team to allow
them
to document this new failure mode, which will reduce false
positives in CI.External URL: https://patchwork.freedesktop.org/api/1.0/series/5217
4/revisions/2/mbox/== Possible new issues ==
Here are the unknown changes that may have been introduced in
Patchwork_10770:=== IGT changes ===
==== Possible regressions ==== igt@drv_selftest@live_hangcheck: fi-cfl-8109u: PASS -> DMESG-FAIL +1== Known issues ==
Here are the changes found in
Patchwork_10770that come from known
issues:=== IGT changes ===
==== Issues hit ==== igt@kms_chamelium@common-hpd-after-suspend: fi-skl-6700k2: PASS -> INCOMPLETE (fdo#104108,k.org#199541, fdo#107773, fdo#105524)
igt@kms_frontbuffer_tracking@basic: fi-byt-clapper: PASS -> FAIL (fdo#103167) igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b: fi-byt-clapper: PASS -> FAIL (fdo#107362) igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c: fi-icl-u: PASS -> INCOMPLETE (fdo#107713) ==== Possible fixes ==== igt@gem_ctx_create@basic-files: fi-icl-u2: DMESG-WARN (fdo#107724) -> PASS igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b: fi-byt-clapper: FAIL (fdo#107362, fdo#103191) -> PASS igt@prime_vgem@basic-fence-flip: fi-ilk-650: FAIL (fdo#104008) -> PASS ==== Warnings ==== igt@drv_selftest@live_contexts: fi-icl-u2: DMESG-FAIL (fdo#108569) -> INCOMPLETE(fdo#108315)
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#105524 https://bugs.freedesktop.org/show_bug.cgi?id=105524
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107713 https://bugs.freedesktop.org/show_bug.cgi?id=107713
fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#108315 https://bugs.freedesktop.org/show_bug.cgi?id=108315
fdo#108569 https://bugs.freedesktop.org/show_bug.cgi?id=108569
k.org#199541 https://bugzilla.kernel.org/show_bug.cgi?id=199541== Participating hosts (54 -> 47) ==
Missing (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-
squawks fi-bsw-cyan fi-snb-2520m fi-ctg-p8600== Build changes ==
* Linux:
CI_DRM_5103->Patchwork_10770
CI_DRM_5103:23c1138030ad65402f698ab0b356e2f55722bc77@git://anongit.freedesktop.org/gfx-ci/linux
IGT_4712:a3ede1b535ac8137f6949c468edd7054453d5dae@git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10770:13e7715c72d20e925ff22507365c9273c54ed4c6@git://anongit.freedesktop.org/gfx-ci/linux== Linux commits ==
13e7715c72d2drm: Check if primary mst is null== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchw
ork_10770/issues.html
Signature · 7 lines
Best Regards, Lisovskiy Stanislav _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm: Check if primary mst is null (rev2)
In reply to Stanislav Lisovskiy== Series Details ==
== Series Details ==
Series: drm: Check if primary mst is null (rev2)
URL : https://patchwork.freedesktop.org/series/52174/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_5109 -> Patchwork_10786 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/52174/revisions/2/mbox/
== Known issues ==
Here are the changes found in Patchwork_10786 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_exec_suspend@basic-s3:
fi-cfl-8109u: PASS -> INCOMPLETE (fdo#107187, fdo#108126)
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-byt-clapper: PASS -> FAIL (fdo#107362)
==== Possible fixes ====
igt@drv_selftest@live_contexts:
fi-bsw-n3050: DMESG-FAIL (fdo#108626) -> PASS
igt@gem_ctx_create@basic-files:
fi-icl-u2: DMESG-WARN (fdo#107724) -> PASS
igt@gem_exec_suspend@basic-s3:
fi-blb-e6850: INCOMPLETE (fdo#107718) -> PASS
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a-frame-sequence:
fi-byt-clapper: FAIL (fdo#107362, fdo#103191) -> PASS fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#107187 https://bugs.freedesktop.org/show_bug.cgi?id=107187
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
fdo#107724 https://bugs.freedesktop.org/show_bug.cgi?id=107724
fdo#108126 https://bugs.freedesktop.org/show_bug.cgi?id=108126
fdo#108626 https://bugs.freedesktop.org/show_bug.cgi?id=108626
== Participating hosts (53 -> 46) ==
Additional (1): fi-pnv-d510
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-snb-2520m fi-ctg-p8600 fi-icl-u
== Build changes ==
* Linux: CI_DRM_5109 -> Patchwork_10786
CI_DRM_5109: fd007cc63a9d60ac2a6f966a3c790e710aa8ca94 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10786: 35039639998b92f5300948659f82f880e0ca4177 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
35039639998b drm: Check if primary mst is null
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10786/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm: Check if primary mst is null (rev2)
In reply to Stanislav Lisovskiy== Series Details ==
== Series Details ==
Series: drm: Check if primary mst is null (rev2)
URL : https://patchwork.freedesktop.org/series/52174/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_5109_full -> Patchwork_10786_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_10786_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_10786_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_10786_full:
=== IGT changes ===
==== Warnings ====
igt@perf_pmu@rc6:
shard-kbl: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_10786_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_cpu_reloc@full:
shard-skl: PASS -> INCOMPLETE (fdo#108073)
igt@gem_ctx_isolation@rcs0-s3:
shard-skl: PASS -> INCOMPLETE (fdo#107773, fdo#104108)
igt@gem_render_linear_blits@basic:
shard-kbl: PASS -> INCOMPLETE (fdo#103665)
igt@kms_available_modes_crc@available_mode_test_crc:
shard-skl: NOTRUN -> FAIL (fdo#106641)
igt@kms_busy@extended-modeset-hang-newfb-render-a:
shard-skl: NOTRUN -> DMESG-WARN (fdo#107956)
igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
shard-glk: NOTRUN -> DMESG-WARN (fdo#107956) +3
igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
shard-hsw: PASS -> DMESG-WARN (fdo#107956)
igt@kms_chv_cursor_fail@pipe-c-256x256-top-edge:
shard-skl: PASS -> FAIL (fdo#104671)
igt@kms_color@pipe-c-ctm-blue-to-red:
shard-skl: PASS -> FAIL (fdo#107201)
igt@kms_cursor_crc@cursor-256x256-suspend:
shard-apl: PASS -> FAIL (fdo#103191, fdo#103232)
igt@kms_cursor_crc@cursor-256x85-onscreen:
shard-glk: NOTRUN -> FAIL (fdo#103232) +1
igt@kms_cursor_crc@cursor-64x64-sliding:
shard-apl: PASS -> FAIL (fdo#103232) +1
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-move:
shard-glk: PASS -> FAIL (fdo#103167)
igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
shard-glk: NOTRUN -> FAIL (fdo#103167) +2
igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
shard-skl: NOTRUN -> FAIL (fdo#105683)
igt@kms_plane@plane-panning-bottom-right-pipe-b-planes:
shard-skl: PASS -> FAIL (fdo#103166)
igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
shard-skl: NOTRUN -> FAIL (fdo#108145)
igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
shard-glk: NOTRUN -> FAIL (fdo#108145) +5
igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
shard-glk: NOTRUN -> FAIL (fdo#103166) +3
igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
shard-apl: PASS -> FAIL (fdo#103166)
igt@kms_setmode@basic:
shard-kbl: PASS -> FAIL (fdo#99912)
igt@perf@short-reads:
shard-skl: PASS -> FAIL (fdo#103183)
igt@pm_rpm@debugfs-forcewake-user:
shard-skl: PASS -> INCOMPLETE (fdo#107807)
igt@pm_rpm@gem-pread:
shard-skl: NOTRUN -> INCOMPLETE (fdo#107807)
igt@pm_rpm@system-suspend-modeset:
shard-skl: NOTRUN -> INCOMPLETE (fdo#107773, fdo#107807, fdo#104108)
==== Possible fixes ====
igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
shard-glk: FAIL (fdo#108145) -> PASS
igt@kms_cursor_crc@cursor-256x256-onscreen:
shard-skl: FAIL (fdo#103232) -> PASS
igt@kms_cursor_crc@cursor-256x256-sliding:
shard-apl: FAIL (fdo#103232) -> PASS
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
shard-apl: FAIL (fdo#103167) -> PASS
igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
shard-skl: INCOMPLETE (fdo#107773, fdo#104108) -> PASS +2
igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
shard-skl: FAIL (fdo#107815) -> PASS
igt@pm_rpm@dpms-mode-unset-lpsp:
shard-skl: INCOMPLETE (fdo#107807) -> PASS fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103183 https://bugs.freedesktop.org/show_bug.cgi?id=103183
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671
fdo#105683 https://bugs.freedesktop.org/show_bug.cgi?id=105683
fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
fdo#107201 https://bugs.freedesktop.org/show_bug.cgi?id=107201
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107807 https://bugs.freedesktop.org/show_bug.cgi?id=107807
fdo#107815 https://bugs.freedesktop.org/show_bug.cgi?id=107815
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108073 https://bugs.freedesktop.org/show_bug.cgi?id=108073
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (6 -> 6) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_5109 -> Patchwork_10786
CI_DRM_5109: fd007cc63a9d60ac2a6f966a3c790e710aa8ca94 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4714: cab148ca3ec904a94d0cd43476cf7e1f8663f906 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10786: 35039639998b92f5300948659f82f880e0ca4177 @ 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_10786/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx