[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202501092158.Gp5vNOZy-lkp@intel.com>
Date: Thu, 9 Jan 2025 22:14:54 +0800
From: kernel test robot <lkp@...el.com>
To: Vincent Mailhol <mailhol.vincent@...adoo.fr>,
Kees Cook <kees@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
David Laight <david.laight@...lab.com>,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
Vincent Mailhol <mailhol.vincent@...adoo.fr>
Subject: Re: [PATCH] fortify: turn strlen() into an inline function using
__builtin_constant_p()
Hi Vincent,
kernel test robot noticed the following build errors:
[auto build test ERROR on 9d89551994a430b50c4fffcb1e617a057fa76e20]
url: https://github.com/intel-lab-lkp/linux/commits/Vincent-Mailhol/fortify-turn-strlen-into-an-inline-function-using-__builtin_constant_p/20250108-223159
base: 9d89551994a430b50c4fffcb1e617a057fa76e20
patch link: https://lore.kernel.org/r/20250108-strlen_use_builtin_constant_p-v1-1-611b52e80a9f%40wanadoo.fr
patch subject: [PATCH] fortify: turn strlen() into an inline function using __builtin_constant_p()
config: x86_64-randconfig-001-20250109 (https://download.01.org/0day-ci/archive/20250109/202501092158.Gp5vNOZy-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/202501092158.Gp5vNOZy-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501092158.Gp5vNOZy-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from scripts/mod/devicetable-offsets.c:3:
In file included from include/linux/mod_devicetable.h:14:
In file included from include/linux/uuid.h:11:
In file included from include/linux/string.h:389:
>> include/linux/fortify-string.h:272:17: error: redeclaration of 'strlen' must not have the 'overloadable' attribute
272 | __kernel_size_t strlen(const char *p)
| ^
include/linux/string.h:200:24: note: previous unmarked overload of function is here
200 | extern __kernel_size_t strlen(const char *);
| ^
1 error generated.
make[3]: *** [scripts/Makefile.build:102: scripts/mod/devicetable-offsets.s] Error 1 shuffle=1556232066
make[3]: Target 'scripts/mod/' not remade because of errors.
make[2]: *** [Makefile:1262: prepare0] Error 2 shuffle=1556232066
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:251: __sub-make] Error 2 shuffle=1556232066
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:251: __sub-make] Error 2 shuffle=1556232066
make: Target 'prepare' not remade because of errors.
vim +272 include/linux/fortify-string.h
257
258 /**
259 * strlen - Return count of characters in a NUL-terminated string
260 *
261 * @p: pointer to NUL-terminated string to count.
262 *
263 * Do not use this function unless the string length is known at
264 * compile-time. When @p is unterminated, this function may crash
265 * or return unexpected counts that could lead to memory content
266 * exposures. Prefer strnlen().
267 *
268 * Returns number of characters in @p (NOT including the final NUL).
269 *
270 */
271 __FORTIFY_INLINE __diagnose_as(__builtin_strlen, 1)
> 272 __kernel_size_t strlen(const char *p)
273 {
274 if (__builtin_constant_p(__builtin_strlen(p)))
275 return __builtin_strlen(p);
276 return __fortify_strlen(p);
277 }
278
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists