KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
80 stars 5 forks source link

Fix -Wstringop-overflow warning in fs/jfs/namei.c #302

Closed GustavoARSilva closed 5 months ago

GustavoARSilva commented 1 year ago
fs/jfs/namei.c: In function ‘jfs_symlink’:
./include/linux/fortify-string.h:57:33: warning: ‘__builtin_memcpy’ specified bound between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   57 | #define __underlying_memcpy     __builtin_memcpy
      |                                 ^
./include/linux/fortify-string.h:648:9: note: in expansion of macro ‘__underlying_memcpy’
  648 |         __underlying_##op(p, q, __fortify_size);                        \
      |         ^~~~~~~~~~~~~
./include/linux/fortify-string.h:693:26: note: in expansion of macro ‘__fortify_memcpy_chk’
  693 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
      |                          ^~~~~~~~~~~~~~~~~~~~
fs/jfs/namei.c:950:17: note: in expansion of macro ‘memcpy’
  950 |                 memcpy(ip->i_link, name, ssize);
      |                 ^~~~~~
GustavoARSilva commented 1 year ago

Patch: https://lore.kernel.org/lkml/20230204183355.never.877-kees@kernel.org/

kees commented 5 months ago

Fixed by commit 820eb59da8c7c.