✗ CI.checkpatch: warning for drm/xe: Fix bounds checking in __xe_bo_placement_for_flags()

Patchwork patchwork at emeril.freedesktop.org
Thu Jan 11 03:16:19 UTC 2024


== Series Details ==

Series: drm/xe: Fix bounds checking in __xe_bo_placement_for_flags()
URL   : https://patchwork.freedesktop.org/series/128463/
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
faa12d3432d7ef7793d934cd9338c555e95a5aad
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit becc4a0f33d43a5a3020b83aced68ad91a4c2b67
Author: Brian Welty <brian.welty at intel.com>
Date:   Wed Jan 10 16:21:11 2024 -0800

    drm/xe: Fix bounds checking in __xe_bo_placement_for_flags()
    
    Requesting all memory regions on PVC will fill bo->placements up to
    XE_BO_MAX_PLACEMENTS. The subsequent call to try_add_stolen() will trip
    over the bounds checking even though XE_PL_STOLEN is not expected to
    be used in this case.
    
    This is hit with igt at xe_exec_fault_mode@once-basic-prefetch:
        xe 0000:8c:00.0: [drm] Assertion `*c < (sizeof(bo->placements) / sizeof((bo->placements)[0]) + ((int)(sizeof(struct { int:(-!!(__builtin_types_compatible_p(typeof((bo->placements)), typeof(&(bo->placements)[0])))); }))))` failed!
        WARNING: CPU: 30 PID: 6161 at drivers/gpu/drm/xe/xe_bo.c:203 __xe_bo_placement_for_flags+0x218/0x240 [xe]
    
    Is fixed here by moving the bounds checks closer to where we actually
    write into the bo->placement array.
    
    Fixes: 8c54ee8a8606 ("drm/xe: Ensure that we don't access the placements array out-of-bounds")
    Signed-off-by: Brian Welty <brian.welty at intel.com>
+ /mt/dim checkpatch bda9437030d914aefcbc145d3be1a9f5f05ea693 drm-intel
becc4a0f3 drm/xe: Fix bounds checking in __xe_bo_placement_for_flags()
-:12: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#12: 
    xe 0000:8c:00.0: [drm] Assertion `*c < (sizeof(bo->placements) / sizeof((bo->placements)[0]) + ((int)(sizeof(struct { int:(-!!(__builtin_types_compatible_p(typeof((bo->placements)), typeof(&(bo->placements)[0])))); }))))` failed!

-:18: WARNING:UNKNOWN_COMMIT_ID: Unknown commit id '8c54ee8a8606', maybe rebased or not pulled?
#18: 
Fixes: 8c54ee8a8606 ("drm/xe: Ensure that we don't access the placements array out-of-bounds")

total: 0 errors, 2 warnings, 0 checks, 38 lines checked




More information about the Intel-xe mailing list