✗ CI.checkpatch: warning for drm/xe: replace format-less snprintf() with strscpy()

Patchwork patchwork at emeril.freedesktop.org
Tue May 28 13:39:14 UTC 2024


== Series Details ==

Series: drm/xe: replace format-less snprintf() with strscpy()
URL   : https://patchwork.freedesktop.org/series/134140/
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
51ce9f6cd981d42d7467409d7dbc559a450abc1e
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit e640d62e4f7fe7ff11315fcdde6d49c07f7fbbfa
Author: Arnd Bergmann <arnd at arndb.de>
Date:   Tue May 28 15:32:36 2024 +0200

    drm/xe: replace format-less snprintf() with strscpy()
    
    Using snprintf() with a format string from task->comm is a bit
    dangerous since the string may be controlled by unprivileged
    userspace:
    
    drivers/gpu/drm/xe/xe_devcoredump.c: In function 'devcoredump_snapshot':
    drivers/gpu/drm/xe/xe_devcoredump.c:184:9: error: format not a string literal and no format arguments [-Werror=format-security]
      184 |         snprintf(ss->process_name, sizeof(ss->process_name), process_name);
          |         ^~~~~~~~
    
    In this case there is no reason for an snprintf(), so use a simpler
    string copy.
    
    Fixes: b10d0c5e9df7 ("drm/xe: Add process name to devcoredump")
    Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+ /mt/dim checkpatch 74ca368d029a2f7918fd2702caa402c156821cca drm-intel
e640d62e4f7f drm/xe: replace format-less snprintf() with strscpy()
-:12: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#12: 
  184 |         snprintf(ss->process_name, sizeof(ss->process_name), process_name);

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




More information about the Intel-xe mailing list