CC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: Francis Laniel <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   abaf6f60176f1ae9d946d63e4db63164600b7b1a
commit: b51b6c192637b963a6ab7afc50009f2eef986c9b [11771/11865] string.h: move 
fortified functions definitions in a dedicated header.
:::::: branch date: 33 hours ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-s021-20210219 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-229-g60c1f270-dirty
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b51b6c192637b963a6ab7afc50009f2eef986c9b
        git remote add linux-next 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout b51b6c192637b963a6ab7afc50009f2eef986c9b
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


"sparse warnings: (new ones prefixed by >>)"
   mm/util.c: note: in included file (through include/linux/mm.h):
   include/linux/gfp.h:20:32: sparse: sparse: symbol 'gfp_t' redeclared with 
different type (different base types):
   include/linux/gfp.h:20:32: sparse:    restricted gfp_t [usertype] gfp_t
   mm/util.c: note: in included file (through include/linux/kasan-checks.h, 
include/asm-generic/rwonce.h, arch/x86/include/generated/asm/rwonce.h, ...):
   include/linux/types.h:148:32: sparse: note: previously declared as:
   include/linux/types.h:148:32: sparse:    restricted gfp_t [usertype] gfp_t
   mm/util.c:51:6: sparse: sparse: symbol 'kstrdup' redeclared with different 
type (incompatible argument 2 (different base types)):
   mm/util.c:51:6: sparse:    char *extern [addressable] [toplevel] kstrdup( 
... )
   mm/util.c: note: in included file (through include/linux/bitmap.h, 
include/linux/cpumask.h, arch/x86/include/asm/cpumask.h, ...):
   include/linux/string.h:177:13: sparse: note: previously declared as:
   include/linux/string.h:177:13: sparse:    char *extern [addressable] 
[toplevel] kstrdup( ... )
   mm/util.c:78:12: sparse: sparse: symbol 'kstrdup_const' redeclared with 
different type (incompatible argument 2 (different base types)):
   mm/util.c:78:12: sparse:    char const *extern [addressable] [toplevel] 
kstrdup_const( ... )
   include/linux/string.h:178:19: sparse: note: previously declared as:
   include/linux/string.h:178:19: sparse:    char const *extern [addressable] 
[toplevel] kstrdup_const( ... )
   mm/util.c:97:6: sparse: sparse: symbol 'kstrndup' redeclared with different 
type (incompatible argument 3 (different base types)):
   mm/util.c:97:6: sparse:    char *extern [addressable] [toplevel] kstrndup( 
... )
   include/linux/string.h:179:13: sparse: note: previously declared as:
   include/linux/string.h:179:13: sparse:    char *extern [addressable] 
[toplevel] kstrndup( ... )
   mm/util.c:124:6: sparse: sparse: symbol 'kmemdup' redeclared with different 
type (incompatible argument 3 (different base types)):
   mm/util.c:124:6: sparse:    void *extern [addressable] [toplevel] kmemdup( 
... )
   mm/util.c: note: in included file (through include/linux/string.h, 
include/linux/bitmap.h, include/linux/cpumask.h, ...):
   include/linux/fortify-string.h:262:23: sparse: note: previously declared as:
>> include/linux/fortify-string.h:262:23: sparse:    void *extern inline 
>> [gnu_inline] [toplevel] kmemdup( ... )
   mm/util.c:144:6: sparse: sparse: symbol 'kmemdup_nul' redeclared with 
different type (incompatible argument 3 (different base types)):
   mm/util.c:144:6: sparse:    char *extern [addressable] [toplevel] 
kmemdup_nul( ... )
   mm/util.c: note: in included file (through include/linux/bitmap.h, 
include/linux/cpumask.h, arch/x86/include/asm/cpumask.h, ...):
   include/linux/string.h:181:13: sparse: note: previously declared as:
   include/linux/string.h:181:13: sparse:    char *extern [addressable] 
[toplevel] kmemdup_nul( ... )

vim +262 include/linux/fortify-string.h

b51b6c192637b9 Francis Laniel 2021-02-19  260  
b51b6c192637b9 Francis Laniel 2021-02-19  261  extern void 
*__real_kmemdup(const void *src, size_t len, gfp_t gfp) __RENAME(kmemdup);
b51b6c192637b9 Francis Laniel 2021-02-19 @262  __FORTIFY_INLINE void 
*kmemdup(const void *p, size_t size, gfp_t gfp)
b51b6c192637b9 Francis Laniel 2021-02-19  263  {
b51b6c192637b9 Francis Laniel 2021-02-19  264   size_t p_size = 
__builtin_object_size(p, 0);
b51b6c192637b9 Francis Laniel 2021-02-19  265  
b51b6c192637b9 Francis Laniel 2021-02-19  266   if (__builtin_constant_p(size) 
&& p_size < size)
b51b6c192637b9 Francis Laniel 2021-02-19  267           __read_overflow();
b51b6c192637b9 Francis Laniel 2021-02-19  268   if (p_size < size)
b51b6c192637b9 Francis Laniel 2021-02-19  269           fortify_panic(__func__);
b51b6c192637b9 Francis Laniel 2021-02-19  270   return __real_kmemdup(p, size, 
gfp);
b51b6c192637b9 Francis Laniel 2021-02-19  271  }
b51b6c192637b9 Francis Laniel 2021-02-19  272  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to