From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: net/compat.c:444:5: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
Date: Tue, 30 Nov 2021 04:32:54 +0800 [thread overview]
Message-ID: <202111300429.yXuxMpIr-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 14568 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Kees Cook <keescook@chromium.org>
CC: Miguel Ojeda <ojeda@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d58071a8a76d779eedab38033ae4c821c30295a5
commit: c80d92fbb67b2c80b8eeb8759ee79d676eb33520 compiler_types.h: Remove __compiletime_object_size()
date: 9 weeks ago
:::::: branch date: 22 hours ago
:::::: commit date: 9 weeks ago
config: x86_64-randconfig-c007-20211118 (https://download.01.org/0day-ci/archive/20211130/202111300429.yXuxMpIr-lkp(a)intel.com/config)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c80d92fbb67b2c80b8eeb8759ee79d676eb33520
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c80d92fbb67b2c80b8eeb8759ee79d676eb33520
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/gfs2/dir.c:815:6: note: Assuming the condition is false
if (ip->i_diskflags & GFS2_DIF_EXHASH) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/gfs2/dir.c:815:2: note: Taking false branch
if (ip->i_diskflags & GFS2_DIF_EXHASH) {
^
fs/gfs2/dir.c:848:6: note: Assuming 'error' is not equal to 0
if (error)
^~~~~
fs/gfs2/dir.c:848:2: note: Taking true branch
if (error)
^
fs/gfs2/dir.c:849:3: note: Returning without writing to '*pbh'
return ERR_PTR(error);
^
fs/gfs2/dir.c:2169:9: note: Returning from 'gfs2_dirent_search'
dent = gfs2_dirent_search(inode, name, gfs2_dirent_find_space, &bh);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/gfs2/dir.c:2170:6: note: Assuming 'dent' is non-null
if (!dent) {
^~~~~
fs/gfs2/dir.c:2170:2: note: Taking false branch
if (!dent) {
^
fs/gfs2/dir.c:2177:6: note: Calling 'IS_ERR'
if (IS_ERR(dent))
^~~~~~~~~~~~
include/linux/err.h:36:9: note: Assuming the condition is false
return IS_ERR_VALUE((unsigned long)ptr);
^
include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/err.h:36:2: note: Returning zero, which participates in a condition later
return IS_ERR_VALUE((unsigned long)ptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/gfs2/dir.c:2177:6: note: Returning from 'IS_ERR'
if (IS_ERR(dent))
^~~~~~~~~~~~
fs/gfs2/dir.c:2177:2: note: Taking false branch
if (IS_ERR(dent))
^
fs/gfs2/dir.c:2180:6: note: Assuming field 'save_loc' is 0
if (da->save_loc) {
^~~~~~~~~~~~
fs/gfs2/dir.c:2180:2: note: Taking false branch
if (da->save_loc) {
^
fs/gfs2/dir.c:2184:3: note: 1st function call argument is an uninitialized value
brelse(bh);
^ ~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
net/core/net-sysfs.c:1719:2: warning: Value stored to 'txq' is never read [clang-analyzer-deadcode.DeadStores]
txq = real_tx;
^ ~~~~~~~
net/core/net-sysfs.c:1719:2: note: Value stored to 'txq' is never read
txq = real_tx;
^ ~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
37 warnings generated.
Suppressed 37 warnings (37 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
>> net/compat.c:444:5: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
a0 = a[0];
^
net/compat.c:424:1: note: Calling '__se_compat_sys_socketcall'
COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args)
^
include/linux/compat.h:55:2: note: expanded from macro 'COMPAT_SYSCALL_DEFINE2'
COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:206:2: note: expanded from macro 'COMPAT_SYSCALL_DEFINEx'
__X32_COMPAT_SYS_STUBx(x, name, __VA_ARGS__) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:172:2: note: expanded from macro '__X32_COMPAT_SYS_STUBx'
__SYS_STUBx(x64, compat_sys##name, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:79:10: note: expanded from macro '__SYS_STUBx'
return __se_##name(__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~
note: expanded from here
net/compat.c:424:1: note: Calling '__do_compat_sys_socketcall'
COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args)
^
include/linux/compat.h:55:2: note: expanded from macro 'COMPAT_SYSCALL_DEFINE2'
COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:209:10: note: expanded from macro 'COMPAT_SYSCALL_DEFINEx'
return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: expanded from here
net/compat.c:431:6: note: Assuming 'call' is >= SYS_SOCKET
if (call < SYS_SOCKET || call > SYS_SENDMMSG)
^~~~~~~~~~~~~~~~~
net/compat.c:431:6: note: Left side of '||' is false
net/compat.c:431:27: note: Assuming 'call' is <= SYS_SENDMMSG
if (call < SYS_SOCKET || call > SYS_SENDMMSG)
^~~~~~~~~~~~~~~~~~~
net/compat.c:431:2: note: Taking false branch
if (call < SYS_SOCKET || call > SYS_SENDMMSG)
^
net/compat.c:434:6: note: Assuming the condition is false
if (len > sizeof(a))
^~~~~~~~~~~~~~~
net/compat.c:434:2: note: Taking false branch
if (len > sizeof(a))
^
net/compat.c:437:6: note: Calling 'copy_from_user'
if (copy_from_user(a, args, len))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:191:13: note: Calling 'check_copy_size'
if (likely(check_copy_size(to, n, false)))
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/linux/thread_info.h:207:15: note: Assuming 'sz' is >= 0
if (unlikely(sz >= 0 && sz < bytes)) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/thread_info.h:207:15: note: Left side of '&&' is true
if (unlikely(sz >= 0 && sz < bytes)) {
^
include/linux/thread_info.h:207:26: note: Assuming 'sz' is < 'bytes', which participates in a condition later
if (unlikely(sz >= 0 && sz < bytes)) {
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
include/linux/thread_info.h:207:2: note: Taking true branch
if (unlikely(sz >= 0 && sz < bytes)) {
^
include/linux/thread_info.h:208:3: note: Taking true branch
if (!__builtin_constant_p(bytes))
^
include/linux/uaccess.h:191:13: note: Returning from 'check_copy_size'
if (likely(check_copy_size(to, n, false)))
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
include/linux/uaccess.h:191:2: note: Taking false branch
if (likely(check_copy_size(to, n, false)))
^
include/linux/uaccess.h:193:2: note: Returning without writing to '*to'
return n;
^
include/linux/uaccess.h:193:2: note: Returning value (loaded from 'n'), which participates in a condition later
return n;
^~~~~~~~
net/compat.c:437:6: note: Returning from 'copy_from_user'
if (copy_from_user(a, args, len))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/compat.c:437:6: note: Assuming the condition is false
if (copy_from_user(a, args, len))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/compat.c:437:2: note: Taking false branch
if (copy_from_user(a, args, len))
^
net/compat.c:440:8: note: Calling 'audit_socketcall_compat'
ret = audit_socketcall_compat(len / sizeof(a[0]), a);
vim +444 net/compat.c
157b334aa84dc5 Dominik Brodowski 2018-03-16 423
361d93c46f688d Heiko Carstens 2014-03-03 424 COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args)
^1da177e4c3f41 Linus Torvalds 2005-04-16 425 {
62bc306e208343 Richard Guy Briggs 2017-01-17 426 u32 a[AUDITSC_ARGS];
62bc306e208343 Richard Guy Briggs 2017-01-17 427 unsigned int len;
^1da177e4c3f41 Linus Torvalds 2005-04-16 428 u32 a0, a1;
62bc306e208343 Richard Guy Briggs 2017-01-17 429 int ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 430
228e548e602061 Anton Blanchard 2011-05-02 431 if (call < SYS_SOCKET || call > SYS_SENDMMSG)
^1da177e4c3f41 Linus Torvalds 2005-04-16 432 return -EINVAL;
62bc306e208343 Richard Guy Briggs 2017-01-17 433 len = nas[call];
62bc306e208343 Richard Guy Briggs 2017-01-17 434 if (len > sizeof(a))
62bc306e208343 Richard Guy Briggs 2017-01-17 435 return -EINVAL;
62bc306e208343 Richard Guy Briggs 2017-01-17 436
62bc306e208343 Richard Guy Briggs 2017-01-17 437 if (copy_from_user(a, args, len))
^1da177e4c3f41 Linus Torvalds 2005-04-16 438 return -EFAULT;
62bc306e208343 Richard Guy Briggs 2017-01-17 439
62bc306e208343 Richard Guy Briggs 2017-01-17 440 ret = audit_socketcall_compat(len / sizeof(a[0]), a);
62bc306e208343 Richard Guy Briggs 2017-01-17 441 if (ret)
62bc306e208343 Richard Guy Briggs 2017-01-17 442 return ret;
62bc306e208343 Richard Guy Briggs 2017-01-17 443
^1da177e4c3f41 Linus Torvalds 2005-04-16 @444 a0 = a[0];
:::::: The code at line 444 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2021-11-29 20:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 20:32 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-06-01 21:40 net/compat.c:444:5: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign] kernel test robot
2021-11-27 17: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=202111300429.yXuxMpIr-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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.