UBSAN warning on unplugging USB4 DP alt mode from AMD Yellow Carp graphics card

Bug #1956497 reported by You-Sheng Yang
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HWE Next
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
High
You-Sheng Yang
Focal
Invalid
Undecided
Unassigned
Jammy
Fix Released
High
You-Sheng Yang
linux-oem-5.14 (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
High
Unassigned
Jammy
Invalid
Undecided
Unassigned

Bug Description

[SRU Justification]

[Impact]

An UBSAN error is dumped once when unpluging a type-c cable (at DP Alt
Mode) from a AMD Yellow Carp equipped platform. No side effects found
so far, and subsequent hotplugs won't have this error again.

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6084:84
[ 38.099550] load of value 32 is not a valid value for type '_Bool'
[ 38.099552] CPU: 9 PID: 1451 Comm: Xorg Not tainted
5.15.0-2013-generic #13~20.04.1+pre14+lp1953008.1
[ 38.099554] Hardware name: AMD LilacKD-RMB/LilacKD-RMB, BIOS
RRL0080C 09/15/2021
[ 38.099555] Call Trace:
[ 38.099556] <TASK>
[ 38.099558] dump_stack_lvl+0x4a/0x5f
[ 38.099563] dump_stack+0x10/0x12
[ 38.099564] ubsan_epilogue+0x9/0x45
[ 38.099565] __ubsan_handle_load_invalid_value+0x70/0x80
[ 38.099568] create_stream_for_sink.cold+0x5d/0xbb [amdgpu]
...

[Fix]

Commit 63ad5371cd1e ("drm/amd/display: explicitly set is_dsc_supported
to false before use") in linux-next.

[Test Case]

1. Connect an external monitor via USB Type-C able to target platform
2. After external monitor turned on and screen was extended, unplug
   Type-C cable
3. check if a similar ubsan warning is dumpped to dmesg.

[Where problems could occur]

No. This initialize a variable before being referenced.

[Other Info]

While UBSAN is only turned on on 5.15 and newer, only Jammy is nominated
for this fix.

========== original bug report ==========

This is a follow-up for jammy 5.15 kernel backport of bug 1953008.

An UBSAN error is dumped once when unpluging a type-c cable (at DP Alt Mode). No side effects found so far, and subsequent hotplug won't have this error again.

[ 38.099545] ================================================================================
[ 38.099548] UBSAN: invalid-load in
/tmp/kernel-vicamo-28e409f5f0ef-xHcq/build/drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:6084:84
[ 38.099550] load of value 32 is not a valid value for type '_Bool'
[ 38.099552] CPU: 9 PID: 1451 Comm: Xorg Not tainted
5.15.0-2013-generic #13~20.04.1+pre14+lp1953008.1
[ 38.099554] Hardware name: AMD LilacKD-RMB/LilacKD-RMB, BIOS
RRL0080C 09/15/2021
[ 38.099555] Call Trace:
[ 38.099556] <TASK>
[ 38.099558] dump_stack_lvl+0x4a/0x5f
[ 38.099563] dump_stack+0x10/0x12
[ 38.099564] ubsan_epilogue+0x9/0x45
[ 38.099565] __ubsan_handle_load_invalid_value+0x70/0x80
[ 38.099568] create_stream_for_sink.cold+0x5d/0xbb [amdgpu]
[ 38.099707] ? dc_link_should_enable_fec+0x6a/0xa0 [amdgpu]
[ 38.099819] create_validate_stream_for_sink+0x59/0x150 [amdgpu]
[ 38.099918] dm_update_crtc_state+0x4f8/0x7a0 [amdgpu]
[ 38.100010] ? drm_atomic_get_private_obj_state+0x128/0x150 [drm]
[ 38.100024] amdgpu_dm_atomic_check+0x625/0xfb0 [amdgpu]
[ 38.100114] ? __ww_mutex_lock.isra.0+0x39/0x6d0
[ 38.100117] ? __cond_resched+0x19/0x30
[ 38.100118] ? __kmalloc_track_caller+0x1ab/0x4c0
[ 38.100121] ? amdgpu_dm_connector_atomic_duplicate_state+0x2c/0xf0 [amdgpu]
[ 38.100209] ? drm_mode_object_get+0x2a/0x60 [drm]
[ 38.100222] ?
__drm_atomic_helper_connector_duplicate_state+0x58/0x80
[drm_kms_helper]
[ 38.100231] drm_atomic_check_only+0x603/0x980 [drm]
[ 38.100243] drm_atomic_commit+0x18/0x50 [drm]
[ 38.100253] drm_atomic_connector_commit_dpms+0xdf/0x100 [drm]
[ 38.100264] drm_mode_obj_set_property_ioctl+0x1ae/0x420 [drm]
[ 38.100274] ? drm_mode_object_put.part.0+0x23/0x60 [drm]
[ 38.100284] ? drm_connector_set_obj_prop+0x90/0x90 [drm]
[ 38.100295] drm_connector_property_set_ioctl+0x3b/0x60 [drm]
[ 38.100305] drm_ioctl_kernel+0xae/0xf0 [drm]
[ 38.100315] drm_ioctl+0x271/0x490 [drm]
[ 38.100324] ? drm_connector_set_obj_prop+0x90/0x90 [drm]
[ 38.100334] ? do_epoll_ctl+0x255/0x640
[ 38.100337] amdgpu_drm_ioctl+0x4e/0x80 [amdgpu]
[ 38.100401] __x64_sys_ioctl+0x91/0xc0
[ 38.100403] do_syscall_64+0x5c/0xc0
[ 38.100404] ? syscall_exit_to_user_mode+0x27/0x50
[ 38.100406] ? do_syscall_64+0x69/0xc0
[ 38.100407] ? syscall_exit_to_user_mode+0x27/0x50
[ 38.100408] ? do_syscall_64+0x69/0xc0
[ 38.100409] ? syscall_exit_to_user_mode+0x27/0x50
[ 38.100410] ? do_syscall_64+0x69/0xc0
[ 38.100410] ? syscall_exit_to_user_mode+0x27/0x50
[ 38.100411] ? do_syscall_64+0x69/0xc0
[ 38.100412] ? asm_sysvec_apic_timer_interrupt+0xa/0x20
[ 38.100414] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 38.100415] RIP: 0033:0x7ff1c744050b
[ 38.100417] Code: 0f 1e fa 48 8b 05 85 39 0d 00 64 c7 00 26 00 00
00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00
00 0f 05 <48>
3d 01 f0 ff ff 73 01 c3 48 8b 0d 55 39 0d 00 f7 d8 64 89 01 48
[ 38.100419] RSP: 002b:00007ffe958832f8 EFLAGS: 00000246 ORIG_RAX:
0000000000000010
[ 38.100421] RAX: ffffffffffffffda RBX: 00007ffe95883330 RCX: 00007ff1c744050b
[ 38.100421] RDX: 00007ffe95883330 RSI: 00000000c01064ab RDI: 000000000000000c
[ 38.100422] RBP: 00000000c01064ab R08: 0000000000000000 R09: 0000563365760270
[ 38.100422] R10: 0000000000000000 R11: 0000000000000246 R12: 00005633655bdf00
[ 38.100423] R13: 000000000000000c R14: 0000563365e674d0 R15: 0000000000000000
[ 38.100425] </TASK>
[ 38.100425] ================================================================================

Revision history for this message
You-Sheng Yang (vicamo) wrote :
no longer affects: linux-firmware (Ubuntu)
You-Sheng Yang (vicamo)
tags: added: oem-priority originate-from-1956498
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1956497

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: jammy
Revision history for this message
You-Sheng Yang (vicamo) wrote :
You-Sheng Yang (vicamo)
Changed in linux (Ubuntu):
status: Incomplete → In Progress
importance: Undecided → High
assignee: nobody → You-Sheng Yang (vicamo)
Revision history for this message
You-Sheng Yang (vicamo) wrote :
description: updated
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Landed via linux-stable to linux-oem-5.14 version -1023, linux/jammy version 5.15.0-19.19.

Changed in linux-oem-5.14 (Ubuntu Jammy):
status: New → Invalid
Changed in linux (Ubuntu Focal):
status: New → Invalid
Changed in linux-oem-5.14 (Ubuntu Focal):
status: New → Fix Committed
importance: Undecided → High
Changed in linux (Ubuntu Jammy):
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
Changed in linux-oem-5.14 (Ubuntu Focal):
status: Fix Committed → Fix Released
Changed in hwe-next:
status: New → Fix Released
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-hwe-5.15/5.15.0-23.23~20.04.1 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
MichaelE (michael-eitelwein) wrote :

This UBSAN disappeared with kernel 5.15.0-22-generic on my LENOVO 82N7/LNVNB161216, BIOS H9CN25WW (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1961468)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.