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

Patchwork patchwork at emeril.freedesktop.org
Wed May 29 17:40:51 UTC 2024


== Series Details ==

Series: drm/xe: replace format-less snprintf() with strscpy() (rev2)
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 6ace848605f9ac54bf691cb53c8386b6894898dd
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>
    Reviewed-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
+ /mt/dim checkpatch 55d6179b96e0390025f2ba101c03b94b50cab7a1 drm-intel
6ace848605f9 drm/xe: replace format-less snprintf() with strscpy()
-:15: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#15: 
  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