Re: [PATCH v9 3/7] treewide: Prepare for expanding comm length

From: kernel test robot

Date: Sun Dec 06 2026 - 01:07:22 EST


Hi André,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1f9c740f15dae336d5dea23faf51e451e7e9f55b]

url: https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/treewide-Get-rid-of-get_task_comm/20261205-223915
base: 1f9c740f15dae336d5dea23faf51e451e7e9f55b
patch link: https://lore.kernel.org/r/20261205-tonyk-long_name-v9-3-98244983d8b3%40igalia.com
patch subject: [PATCH v9 3/7] treewide: Prepare for expanding comm length
config: csky-randconfig-1001-20261206 (https://download.01.org/0day-ci/archive/20261206/20261206140116.zrAx71sd-lkp@xxxxxxxxx/config)
compiler: csky-linux-gcc (GCC) 16.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261206/20261206140116.zrAx71sd-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261206140116.zrAx71sd-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from include/linux/bitmap.h:13,
from include/linux/cpumask.h:11,
from include/linux/smp.h:13,
from include/linux/interrupt_rc.h:18,
from include/linux/spinlock.h:60,
from include/linux/sched.h:38,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/pm_runtime.h:11,
from drivers/hwtracing/stm/core.c:10:
drivers/hwtracing/stm/core.c: In function 'stm_char_write':
>> include/linux/string.h:115:29: error: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
115 | const char *__src = (src); \
| ^
include/linux/string.h:83:9: note: in expansion of macro 'sized_strscpy_pad'
83 | sized_strscpy_pad(dst, src, sizeof(dst) + __must_be_array(dst) + \
| ^~~~~~~~~~~~~~~~~
include/linux/args.h:25:24: note: in expansion of macro '__strscpy_pad0'
25 | #define __CONCAT(a, b) a ## b
| ^
include/linux/args.h:26:27: note: in expansion of macro '__CONCAT'
26 | #define CONCATENATE(a, b) __CONCAT(a, b)
| ^~~~~~~~
include/linux/string.h:146:9: note: in expansion of macro 'CONCATENATE'
146 | CONCATENATE(__strscpy_pad, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
| ^~~~~~~~~~~
drivers/hwtracing/stm/core.c:637:17: note: in expansion of macro 'strscpy_pad'
637 | strscpy_pad(comm, TASK_COMM_LEN);
| ^~~~~~~~~~~
--
In file included from include/linux/bitmap.h:13,
from include/linux/cpumask.h:11,
from include/linux/smp.h:13,
from include/linux/interrupt_rc.h:18,
from include/linux/spinlock.h:60,
from include/linux/sched.h:38,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/pm_runtime.h:11,
from core.c:10:
core.c: In function 'stm_char_write':
>> include/linux/string.h:115:29: error: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
115 | const char *__src = (src); \
| ^
include/linux/string.h:83:9: note: in expansion of macro 'sized_strscpy_pad'
83 | sized_strscpy_pad(dst, src, sizeof(dst) + __must_be_array(dst) + \
| ^~~~~~~~~~~~~~~~~
include/linux/args.h:25:24: note: in expansion of macro '__strscpy_pad0'
25 | #define __CONCAT(a, b) a ## b
| ^
include/linux/args.h:26:27: note: in expansion of macro '__CONCAT'
26 | #define CONCATENATE(a, b) __CONCAT(a, b)
| ^~~~~~~~
include/linux/string.h:146:9: note: in expansion of macro 'CONCATENATE'
146 | CONCATENATE(__strscpy_pad, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
| ^~~~~~~~~~~
core.c:637:17: note: in expansion of macro 'strscpy_pad'
637 | strscpy_pad(comm, TASK_COMM_LEN);
| ^~~~~~~~~~~


vim +115 include/linux/string.h

e6584c3964f2ff Kees Cook 2023-09-20 71
e6584c3964f2ff Kees Cook 2023-09-20 72 /*
e6584c3964f2ff Kees Cook 2023-09-20 73 * The 2 argument style can only be used when dst is an array with a
e6584c3964f2ff Kees Cook 2023-09-20 74 * known size.
e6584c3964f2ff Kees Cook 2023-09-20 75 */
e6584c3964f2ff Kees Cook 2023-09-20 76 #define __strscpy0(dst, src, ...) \
559048d156ff33 Kees Cook 2024-08-05 77 sized_strscpy(dst, src, sizeof(dst) + __must_be_array(dst) + \
559048d156ff33 Kees Cook 2024-08-05 78 __must_be_cstr(dst) + __must_be_cstr(src))
559048d156ff33 Kees Cook 2024-08-05 79 #define __strscpy1(dst, src, size) \
559048d156ff33 Kees Cook 2024-08-05 80 sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
e6584c3964f2ff Kees Cook 2023-09-20 81
8366d124ec937c Kees Cook 2024-02-02 82 #define __strscpy_pad0(dst, src, ...) \
559048d156ff33 Kees Cook 2024-08-05 83 sized_strscpy_pad(dst, src, sizeof(dst) + __must_be_array(dst) + \
559048d156ff33 Kees Cook 2024-08-05 84 __must_be_cstr(dst) + __must_be_cstr(src))
559048d156ff33 Kees Cook 2024-08-05 85 #define __strscpy_pad1(dst, src, size) \
559048d156ff33 Kees Cook 2024-08-05 86 sized_strscpy_pad(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
458a3bf82df4fe Tobin C. Harding 2019-04-05 87
e6584c3964f2ff Kees Cook 2023-09-20 88 /**
e6584c3964f2ff Kees Cook 2023-09-20 89 * strscpy - Copy a C-string into a sized buffer
e6584c3964f2ff Kees Cook 2023-09-20 90 * @dst: Where to copy the string to
e6584c3964f2ff Kees Cook 2023-09-20 91 * @src: Where to copy the string from
e6584c3964f2ff Kees Cook 2023-09-20 92 * @...: Size of destination buffer (optional)
e6584c3964f2ff Kees Cook 2023-09-20 93 *
e6584c3964f2ff Kees Cook 2023-09-20 94 * Copy the source string @src, or as much of it as fits, into the
e6584c3964f2ff Kees Cook 2023-09-20 95 * destination @dst buffer. The behavior is undefined if the string
e6584c3964f2ff Kees Cook 2023-09-20 96 * buffers overlap. The destination @dst buffer is always NUL terminated,
e6584c3964f2ff Kees Cook 2023-09-20 97 * unless it's zero-sized.
e6584c3964f2ff Kees Cook 2023-09-20 98 *
e6584c3964f2ff Kees Cook 2023-09-20 99 * The size argument @... is only required when @dst is not an array, or
e6584c3964f2ff Kees Cook 2023-09-20 100 * when the copy needs to be smaller than sizeof(@dst).
e6584c3964f2ff Kees Cook 2023-09-20 101 *
e6584c3964f2ff Kees Cook 2023-09-20 102 * Preferred to strncpy() since it always returns a valid string, and
e6584c3964f2ff Kees Cook 2023-09-20 103 * doesn't unnecessarily force the tail of the destination buffer to be
e6584c3964f2ff Kees Cook 2023-09-20 104 * zero padded. If padding is desired please use strscpy_pad().
e6584c3964f2ff Kees Cook 2023-09-20 105 *
e6584c3964f2ff Kees Cook 2023-09-20 106 * Returns the number of characters copied in @dst (not including the
e6584c3964f2ff Kees Cook 2023-09-20 107 * trailing %NUL) or -E2BIG if @size is 0 or the copy from @src was
e6584c3964f2ff Kees Cook 2023-09-20 108 * truncated.
e6584c3964f2ff Kees Cook 2023-09-20 109 */
e6584c3964f2ff Kees Cook 2023-09-20 110 #define strscpy(dst, src, ...) \
e6584c3964f2ff Kees Cook 2023-09-20 111 CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)
458a3bf82df4fe Tobin C. Harding 2019-04-05 112
8366d124ec937c Kees Cook 2024-02-02 113 #define sized_strscpy_pad(dest, src, count) ({ \
8366d124ec937c Kees Cook 2024-02-02 114 char *__dst = (dest); \
8366d124ec937c Kees Cook 2024-02-02 @115 const char *__src = (src); \
8366d124ec937c Kees Cook 2024-02-02 116 const size_t __count = (count); \
8366d124ec937c Kees Cook 2024-02-02 117 ssize_t __wrote; \
8366d124ec937c Kees Cook 2024-02-02 118 \
8366d124ec937c Kees Cook 2024-02-02 119 __wrote = sized_strscpy(__dst, __src, __count); \
8366d124ec937c Kees Cook 2024-02-02 120 if (__wrote >= 0 && __wrote < __count) \
8366d124ec937c Kees Cook 2024-02-02 121 memset(__dst + __wrote + 1, 0, __count - __wrote - 1); \
8366d124ec937c Kees Cook 2024-02-02 122 __wrote; \
8366d124ec937c Kees Cook 2024-02-02 123 })
8366d124ec937c Kees Cook 2024-02-02 124

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki