Skip to contentSkip to conversation

BUILD SUCCESS WITH WARNING 0ba7324b44282870af740a5a121add62c7f5f730

paulmck-rcu:pmladek.2022.06.15a kernel test robot 2 participants 2 messages Jun 16, 2022 Context tracking

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git pmladek.2022.06.15a branch HEAD: 0ba7324b44282870af740a5a121add62c7f5f730 printk: Wait for the global console lock when the system is going down

Warning reports:

https://lore.kernel.org/lkml/[email protected]
https://lore.kernel.org/llvm/[email protected]

Warning: (recently discovered and may have been fixed)

vmlinux.o: warning: objtool: __ct_user_enter+0x7f: call to __kasan_check_read() leaves .noinstr.text section vmlinux.o: warning: objtool: __ct_user_exit+0x41: call to __kasan_check_read() leaves .noinstr.text section

Warning ids grouped by kconfigs:

gcc_recent_errors
`-- x86_64-randconfig-r003-20220516
|-- vmlinux.o:warning:objtool:__ct_user_enter:call-to-__kasan_check_read()-leaves-.noinstr.text-section `-- vmlinux.o:warning:objtool:__ct_user_exit:call-to-__kasan_check_read()-leaves-.noinstr.text-section

clang_recent_errors
`-- x86_64-randconfig-a005-20220613

    |-- vmlinux.o:warning:objtool:ct_kernel_enter:call-to-ftrace_likely_update()-leaves-.noinstr.text-section
    |-- vmlinux.o:warning:objtool:ct_kernel_enter_state:call-to-ftrace_likely_update()-leaves-.noinstr.text-section
    |-- vmlinux.o:warning:objtool:ct_kernel_exit:call-to-ftrace_likely_update()-leaves-.noinstr.text-section

`-- vmlinux.o:warning:objtool:ct_kernel_exit_state:call-to-ftrace_likely_update()-leaves-.noinstr.text-section

elapsed time: 1477m

configs tested: 51
configs skipped: 3

gcc tested configs:
arm64 allyesconfig
arm defconfig
arm64 defconfig

arm                              allmodconfig
arm                              allyesconfig
m68k                             allyesconfig
m68k                             allmodconfig

m68k defconfig
nios2 defconfig
arc allyesconfig
alpha defconfig
csky defconfig
nios2 allyesconfig
alpha allyesconfig
arc defconfig
xtensa allyesconfig
sh allmodconfig
s390 defconfig
s390 allmodconfig
parisc defconfig
parisc64 defconfig
parisc allyesconfig
s390 allyesconfig
i386 debian-10.3-kselftests
i386 debian-10.3
i386 defconfig
i386 allyesconfig
sparc allyesconfig
sparc defconfig
mips allyesconfig
mips allmodconfig
powerpc allnoconfig
powerpc allyesconfig
powerpc allmodconfig
riscv allnoconfig
riscv allmodconfig
riscv defconfig
riscv nommu_virt_defconfig
riscv rv32_defconfig
riscv nommu_k210_defconfig
riscv allyesconfig
um i386_defconfig
um x86_64_defconfig
x86_64 kexec
x86_64 defconfig
x86_64 allyesconfig
x86_64 rhel-8.3
x86_64 rhel-8.3-func
x86_64 rhel-8.3-syz
x86_64 rhel-8.3-kselftests
x86_64 rhel-8.3-kunit

Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp
maintainer Reviewed-by Marco Elver
#1 lore raw
Quoted 5 lines · kernel test robot

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git pmladek.2022.06.15a branch HEAD: 0ba7324b44282870af740a5a121add62c7f5f730 printk: Wait for the global console lock when the system is going down

Warning reports:

Quoted 7 lines

https://lore.kernel.org/lkml/[email protected]
https://lore.kernel.org/llvm/[email protected]

Warning: (recently discovered and may have been fixed)

vmlinux.o: warning: objtool: __ct_user_enter+0x7f: call to __kasan_check_read() leaves .noinstr.text section vmlinux.o: warning: objtool: __ct_user_exit+0x41: call to __kasan_check_read() leaves .noinstr.text section

Here is the alleged fix, and thank you for testing!

Thanx, Paul

------------------------------------------------------------------------

commit 571252796c089880b804835f6cfc9c3da3ae8c4f

Author: Paul E. McKenney <[email protected]>
Date:   Thu Jun 16 09:30:37 2022 -0700

context_tracking: Use arch_atomic_read() in __ct_state for KASAN

Context tracking's __ct_state() function can be invoked from noinstr state where RCU is not watching. This means that its use of atomic_read() causes KASAN to invoke the non-noinstr __kasan_check_read() function from the noinstr function __ct_state(). This is problematic because someone tracing the __kasan_check_read() function could get a nasty surprise because of RCU not watching.

This commit therefore replaces the __ct_state() function's use of atomic_read() with arch_atomic_read(), which KASAN does not attempt to add instrumention to.

include/linux/context_tracking_state.h +1 -1
index 0aecc07fb4f50..81c51e5f03143 100644
@@ -49,7 +49,7 @@ DECLARE_PER_CPU(struct context_tracking, context_tracking);
 
 static __always_inline int __ct_state(void)
 {
-	return atomic_read(this_cpu_ptr(&context_tracking.state)) & CT_STATE_MASK;
+	return arch_atomic_read(this_cpu_ptr(&context_tracking.state)) & CT_STATE_MASK;
 }
 #endif