All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kernel@openeuler.org
Cc: oe-kbuild-all@lists.linux.dev
Subject: [openeuler:OLK-5.10 3386/3386] include/linux/string.h:290:33: warning: '__builtin_strncpy' specified bound depends on the length of the source argument
Date: Mon, 8 Dec 2025 23:17:28 +0800	[thread overview]
Message-ID: <202512082302.Kf4xjvAw-lkp@intel.com> (raw)

Hi Weili,

FYI, the error/warning still remains.

tree:   https://gitee.com/openeuler/kernel.git OLK-5.10
head:   69d9543977fd7abe8b555406c7a3e5d64d8292f8
commit: a1666f44c2250f7413e73e2f4c02cb2c01f9e3b0 [3386/3386] crypto: hisilicon/qm - support no-sva feature
config: arm64-randconfig-r054-20251208 (https://download.01.org/0day-ci/archive/20251208/202512082302.Kf4xjvAw-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251208/202512082302.Kf4xjvAw-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/202512082302.Kf4xjvAw-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/bitmap.h:9,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/mutex.h:17,
                    from include/linux/kernfs.h:13,
                    from include/linux/sysfs.h:17,
                    from include/linux/kobject.h:21,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from drivers/crypto/hisilicon/qm.c:4:
   In function 'strncpy',
       inlined from 'qm_alloc_uacce' at drivers/crypto/hisilicon/qm.c:2755:2:
>> include/linux/string.h:290:33: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-truncation]
     290 | #define __underlying_strncpy    __builtin_strncpy
         |                                 ^
   include/linux/string.h:300:16: note: in expansion of macro '__underlying_strncpy'
     300 |         return __underlying_strncpy(p, q, size);
         |                ^~~~~~~~~~~~~~~~~~~~
   In function 'strlen',
       inlined from 'qm_alloc_uacce' at drivers/crypto/hisilicon/qm.c:2748:13:
   include/linux/string.h:288:33: note: length computed here
     288 | #define __underlying_strlen     __builtin_strlen
         |                                 ^
   include/linux/string.h:321:24: note: in expansion of macro '__underlying_strlen'
     321 |                 return __underlying_strlen(p);
         |                        ^~~~~~~~~~~~~~~~~~~


vim +/__builtin_strncpy +290 include/linux/string.h

47227d27e2fcb0 Daniel Axtens 2020-06-03  268  
47227d27e2fcb0 Daniel Axtens 2020-06-03  269  #ifdef CONFIG_KASAN
47227d27e2fcb0 Daniel Axtens 2020-06-03  270  extern void *__underlying_memchr(const void *p, int c, __kernel_size_t size) __RENAME(memchr);
47227d27e2fcb0 Daniel Axtens 2020-06-03  271  extern int __underlying_memcmp(const void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
47227d27e2fcb0 Daniel Axtens 2020-06-03  272  extern void *__underlying_memcpy(void *p, const void *q, __kernel_size_t size) __RENAME(memcpy);
47227d27e2fcb0 Daniel Axtens 2020-06-03  273  extern void *__underlying_memmove(void *p, const void *q, __kernel_size_t size) __RENAME(memmove);
47227d27e2fcb0 Daniel Axtens 2020-06-03  274  extern void *__underlying_memset(void *p, int c, __kernel_size_t size) __RENAME(memset);
47227d27e2fcb0 Daniel Axtens 2020-06-03  275  extern char *__underlying_strcat(char *p, const char *q) __RENAME(strcat);
47227d27e2fcb0 Daniel Axtens 2020-06-03  276  extern char *__underlying_strcpy(char *p, const char *q) __RENAME(strcpy);
47227d27e2fcb0 Daniel Axtens 2020-06-03  277  extern __kernel_size_t __underlying_strlen(const char *p) __RENAME(strlen);
47227d27e2fcb0 Daniel Axtens 2020-06-03  278  extern char *__underlying_strncat(char *p, const char *q, __kernel_size_t count) __RENAME(strncat);
47227d27e2fcb0 Daniel Axtens 2020-06-03  279  extern char *__underlying_strncpy(char *p, const char *q, __kernel_size_t size) __RENAME(strncpy);
47227d27e2fcb0 Daniel Axtens 2020-06-03  280  #else
47227d27e2fcb0 Daniel Axtens 2020-06-03  281  #define __underlying_memchr	__builtin_memchr
47227d27e2fcb0 Daniel Axtens 2020-06-03  282  #define __underlying_memcmp	__builtin_memcmp
47227d27e2fcb0 Daniel Axtens 2020-06-03  283  #define __underlying_memcpy	__builtin_memcpy
47227d27e2fcb0 Daniel Axtens 2020-06-03  284  #define __underlying_memmove	__builtin_memmove
47227d27e2fcb0 Daniel Axtens 2020-06-03  285  #define __underlying_memset	__builtin_memset
47227d27e2fcb0 Daniel Axtens 2020-06-03  286  #define __underlying_strcat	__builtin_strcat
47227d27e2fcb0 Daniel Axtens 2020-06-03  287  #define __underlying_strcpy	__builtin_strcpy
47227d27e2fcb0 Daniel Axtens 2020-06-03  288  #define __underlying_strlen	__builtin_strlen
47227d27e2fcb0 Daniel Axtens 2020-06-03  289  #define __underlying_strncat	__builtin_strncat
47227d27e2fcb0 Daniel Axtens 2020-06-03 @290  #define __underlying_strncpy	__builtin_strncpy
47227d27e2fcb0 Daniel Axtens 2020-06-03  291  #endif
47227d27e2fcb0 Daniel Axtens 2020-06-03  292  

:::::: The code at line 290 was first introduced by commit
:::::: 47227d27e2fcb01a9e8f5958d8997cf47a820afc string.h: fix incompatibility between FORTIFY_SOURCE and KASAN

:::::: TO: Daniel Axtens <dja@axtens.net>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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

                 reply	other threads:[~2025-12-08 15:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202512082302.Kf4xjvAw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kernel@openeuler.org \
    --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.