From: kernel test robot <lkp@intel.com>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
Kees Cook <kees@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
David Laight <david.laight@aculab.com>,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Subject: Re: [PATCH] fortify: turn strlen() into an inline function using __builtin_constant_p()
Date: Thu, 9 Jan 2025 22:14:54 +0800 [thread overview]
Message-ID: <202501092158.Gp5vNOZy-lkp@intel.com> (raw)
In-Reply-To: <20250108-strlen_use_builtin_constant_p-v1-1-611b52e80a9f@wanadoo.fr>
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@intel.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
next prev parent reply other threads:[~2025-01-09 14:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 14:27 [PATCH] fortify: turn strlen() into an inline function using __builtin_constant_p() Vincent Mailhol
2025-01-08 21:46 ` Kees Cook
2025-01-09 7:52 ` Vincent Mailhol
2025-01-11 14:40 ` Vincent Mailhol
2025-01-11 16:58 ` David Laight
2025-01-11 18:05 ` Vincent Mailhol
2025-01-09 14:14 ` kernel test robot [this message]
2025-01-11 2:13 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202501092158.Gp5vNOZy-lkp@intel.com \
--to=lkp@intel.com \
--cc=david.laight@aculab.com \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mailhol.vincent@wanadoo.fr \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.