CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Peter Zijlstra <peterz(a)infradead.org>
CC: Valentin Schneider <valentin.schneider(a)arm.com>
CC: Daniel Bristot de Oliveira <bristot(a)redhat.com>
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0513e464f9007b70b96740271a948ca5ab6e7dd7
commit: 565790d28b1e33ee2f77bad5348b99f6dfc366fd sched: Fix balance_callback()
date: 11 months ago
:::::: branch date: 19 hours ago
:::::: commit date: 11 months ago
config: x86_64-randconfig-c007-20210927 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
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...
git remote add linus
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 565790d28b1e33ee2f77bad5348b99f6dfc366fd
# save the attached .config 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(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
crypto/skcipher.c:359:11: note: Calling 'skcipher_walk_done'
return skcipher_walk_done(walk, -EINVAL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/skcipher.c:109:6: note: Assuming 'n' is not equal to 0
if (!n)
^~
crypto/skcipher.c:109:2: note: Taking false branch
if (!n)
^
crypto/skcipher.c:112:2: note: Taking false branch
if (likely(err >= 0)) {
^
crypto/skcipher.c:117:13: note: Assuming the condition is false
if (likely(!(walk->flags & (SKCIPHER_WALK_PHYS |
^
include/linux/compiler.h:77:40: note: expanded from macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
crypto/skcipher.c:117:2: note: Taking false branch
if (likely(!(walk->flags & (SKCIPHER_WALK_PHYS |
^
crypto/skcipher.c:123:13: note: Assuming the condition is false
} else if (walk->flags & SKCIPHER_WALK_DIFF) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/skcipher.c:123:9: note: Taking false branch
} else if (walk->flags & SKCIPHER_WALK_DIFF) {
^
crypto/skcipher.c:126:13: note: Assuming the condition is true
} else if (walk->flags & SKCIPHER_WALK_COPY) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto/skcipher.c:126:9: note: Taking true branch
} else if (walk->flags & SKCIPHER_WALK_COPY) {
^
crypto/skcipher.c:127:3: note: Calling 'skcipher_map_dst'
skcipher_map_dst(walk);
^~~~~~~~~~~~~~~~~~~~~~
crypto/skcipher.c:66:1: note: Returning without writing to 'walk->page'
}
^
crypto/skcipher.c:127:3: note: Returning from 'skcipher_map_dst'
skcipher_map_dst(walk);
^~~~~~~~~~~~~~~~~~~~~~
crypto/skcipher.c:128:3: note: Null pointer passed as 2nd argument to memory copy
function
memcpy(walk->dst.virt.addr, walk->page, n);
^ ~~~~~~~~~~
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.
4 warnings generated.
fs/hfsplus/xattr_security.c:52:3: warning: Call to function 'strcpy' is
insecure as it does not provide bounding of the memory buffer. Replace unbounded copy
functions with analogous functions that support length arguments such as
'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(xattr_name, XATTR_SECURITY_PREFIX);
^~~~~~
fs/hfsplus/xattr_security.c:52:3: note: Call to function 'strcpy' is insecure
as it does not provide bounding of the memory buffer. Replace unbounded copy functions
with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(xattr_name, XATTR_SECURITY_PREFIX);
^~~~~~
fs/hfsplus/xattr_security.c:53:3: warning: Call to function 'strcpy' is
insecure as it does not provide bounding of the memory buffer. Replace unbounded copy
functions with analogous functions that support length arguments such as
'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(xattr_name +
^~~~~~
fs/hfsplus/xattr_security.c:53:3: note: Call to function 'strcpy' is insecure
as it does not provide bounding of the memory buffer. Replace unbounded copy functions
with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(xattr_name +
^~~~~~
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
crypto/algboss.c:196:6: warning: Value stored to 'type' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]
u32 type = param->type;
^~~~ ~~~~~~~~~~~
crypto/algboss.c:196:6: note: Value stored to 'type' during its initialization
is never read
u32 type = param->type;
^~~~ ~~~~~~~~~~~
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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
14 warnings generated.
> kernel/sched/core.c:3736:2: warning: Value stored to 'rq'
is never read [clang-analyzer-deadcode.DeadStores]
rq =
finish_task_switch(prev);
^ ~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:3736:2: note: Value stored to 'rq' is never read
rq = finish_task_switch(prev);
^ ~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:4269:16: warning: Value stored to 'preempt_disable_ip'
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:4269:16: note: Value stored to 'preempt_disable_ip' during
its initialization is never read
unsigned long preempt_disable_ip = get_preempt_disable_ip(current);
^~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:4549:3: warning: Value stored to 'rq' is never read
[clang-analyzer-deadcode.DeadStores]
rq = context_switch(rq, prev, next, &rf);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:4549:3: note: Value stored to 'rq' is never read
rq = context_switch(rq, prev, next, &rf);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:7128:3: warning: Value stored to 'ptr' is never read
[clang-analyzer-deadcode.DeadStores]
ptr += nr_cpu_ids * sizeof(void **);
^
kernel/sched/core.c:7128:3: note: Value stored to 'ptr' is never read
kernel/sched/core.c:7309:2: warning: Value stored to 'preempt_disable_ip' is
never read [clang-analyzer-deadcode.DeadStores]
preempt_disable_ip = get_preempt_disable_ip(current);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:7309:2: note: Value stored to 'preempt_disable_ip' is never
read
preempt_disable_ip = get_preempt_disable_ip(current);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 9 warnings (5 in non-user code, 4 with check filters).
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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
13 warnings generated.
mm/debug_vm_pgtable.c:80:8: warning: Value stored to 'pte' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]
pte_t pte = pfn_pte(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:80:8: note: Value stored to 'pte' during its
initialization is never read
pte_t pte = pfn_pte(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:121:8: warning: Value stored to 'pte' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]
pte_t pte = pfn_pte(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:121:8: note: Value stored to 'pte' during its
initialization is never read
pte_t pte = pfn_pte(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:159:8: warning: Value stored to 'pmd' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]
pmd_t pmd = pfn_pmd(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:159:8: note: Value stored to 'pmd' during its
initialization is never read
pmd_t pmd = pfn_pmd(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:201:2: warning: Value stored to 'pgtable' is never read
[clang-analyzer-deadcode.DeadStores]
pgtable = pgtable_trans_huge_withdraw(mm, pmdp);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:201:2: note: Value stored to 'pgtable' is never read
pgtable = pgtable_trans_huge_withdraw(mm, pmdp);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:241:8: warning: Value stored to 'pmd' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]
pmd_t pmd = pfn_pmd(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:241:8: note: Value stored to 'pmd' during its
initialization is never read
pmd_t pmd = pfn_pmd(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:599:8: warning: Value stored to 'pte' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]
pte_t pte = pfn_pte(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:599:8: note: Value stored to 'pte' during its
initialization is never read
pte_t pte = pfn_pte(pfn, prot);
^~~ ~~~~~~~~~~~~~~~~~~
mm/debug_vm_pgtable.c:612:8: warning: Value stored to 'pmd' during its
initialization is never read [clang-analyzer-deadcode.DeadStores]
vim +/rq +3736 kernel/sched/core.c
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3717
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3718 /**
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3719 * schedule_tail -
first thing a freshly forked thread must call.
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3720 * @prev: the
thread we just switched away from.
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3721 */
722a9f9299ca72 kernel/sched/core.c Andi Kleen 2014-05-02 3722 asmlinkage
__visible void schedule_tail(struct task_struct *prev)
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3723
__releases(rq->lock)
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3724 {
1a43a14a5bd9c3 kernel/sched/core.c Oleg Nesterov 2014-10-08 3725 struct rq *rq;
da19ab510343c6 kernel/sched.c Steven Rostedt 2009-07-29 3726
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3727 /*
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3728 * New tasks start
with FORK_PREEMPT_COUNT, see there and
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3729 *
finish_task_switch() for details.
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3730 *
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3731 *
finish_task_switch() will drop rq->lock() and lower preempt_count
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3732 * and the
preempt_enable() will end up enabling preemption (on
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3733 * PREEMPT_COUNT
kernels).
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3734 */
609ca066386b2e kernel/sched/core.c Peter Zijlstra 2015-09-28 3735
dfa50b605c2a93 kernel/sched/core.c Oleg Nesterov 2014-10-09 @3736 rq =
finish_task_switch(prev);
1a43a14a5bd9c3 kernel/sched/core.c Oleg Nesterov 2014-10-08 3737 preempt_enable();
70b97a7f0b19cf kernel/sched.c Ingo Molnar 2006-07-03 3738
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3739 if
(current->set_child_tid)
b488893a390edf kernel/sched.c Pavel Emelyanov 2007-10-18 3740
put_user(task_pid_vnr(current), current->set_child_tid);
088fe47ce95254 kernel/sched/core.c Eric W. Biederman 2018-07-23 3741
088fe47ce95254 kernel/sched/core.c Eric W. Biederman 2018-07-23 3742
calculate_sigpending();
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3743 }
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 3744
:::::: The code at line 3736 was first introduced by commit
:::::: dfa50b605c2a933b7bb1c1d575a0da4e897e3c7d sched: Make finish_task_switch() return
'struct rq *'
:::::: TO: Oleg Nesterov <oleg(a)redhat.com>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org