✗ CI.checkpatch: warning for drm/xe: Fix UBSAN shift-out-of-bounds failure (rev2)

Patchwork patchwork at emeril.freedesktop.org
Tue May 7 13:25:29 UTC 2024


== Series Details ==

Series: drm/xe: Fix UBSAN shift-out-of-bounds failure (rev2)
URL   : https://patchwork.freedesktop.org/series/133270/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
0daf0be5bb95eb0a0e42275e00a0e42d8d8fd543
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 4175211bac763ea41c043b4cdb0a1e7c6c221a01
Author: Shuicheng Lin <shuicheng.lin at intel.com>
Date:   Tue May 7 13:04:11 2024 +0000

    drm/xe: Fix UBSAN shift-out-of-bounds failure
    
    Here is the failure stack:
    [   12.988209] ------------[ cut here ]------------
    [   12.988216] UBSAN: shift-out-of-bounds in ./include/linux/log2.h:57:13
    [   12.988232] shift exponent 64 is too large for 64-bit type 'long unsigned int'
    [   12.988235] CPU: 4 PID: 1310 Comm: gnome-shell Tainted: G     U             6.9.0-rc6+prerelease1158+ #19
    [   12.988237] Hardware name: Intel Corporation Raptor Lake Client Platform/RPL-S ADP-S DDR5 UDIMM CRB, BIOS RPLSFWI1.R00.3301.A02.2208050712 08/05/2022
    [   12.988239] Call Trace:
    [   12.988240]  <TASK>
    [   12.988242]  dump_stack_lvl+0xd7/0xf0
    [   12.988248]  dump_stack+0x10/0x20
    [   12.988250]  ubsan_epilogue+0x9/0x40
    [   12.988253]  __ubsan_handle_shift_out_of_bounds+0x10e/0x170
    [   12.988260]  dma_resv_reserve_fences.cold+0x2b/0x48
    [   12.988262]  ? ww_mutex_lock_interruptible+0x3c/0x110
    [   12.988267]  drm_exec_prepare_obj+0x45/0x60 [drm_exec]
    [   12.988271]  ? vm_bind_ioctl_ops_execute+0x5b/0x740 [xe]
    [   12.988345]  vm_bind_ioctl_ops_execute+0x78/0x740 [xe]
    
    It is caused by the value 0 of parameter num_fences in function drm_exec_prepare_obj.
    And lead to in function __rounddown_pow_of_two, "0 - 1" causes the shift-out-of-bounds.
    For num_fences == 0 case, drm_exec_prepare_obj is the same as drm_exec_lock_obj in
    function, so call drm_exec_lock_obj instead to solve it.
    
    Cc: Nirmoy Das <nirmoy.das at intel.com>
    Cc: Matthew Brost <matthew.brost at intel.com>
    Signed-off-by: Shuicheng Lin <shuicheng.lin at intel.com>
+ /mt/dim checkpatch 3f34636963efe3febc3dc67fdbbba7a4ea671633 drm-intel
4175211bac76 drm/xe: Fix UBSAN shift-out-of-bounds failure
-:24: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#24: 
It is caused by the value 0 of parameter num_fences in function drm_exec_prepare_obj.

total: 0 errors, 1 warnings, 0 checks, 16 lines checked




More information about the Intel-xe mailing list