Re: [PATCH] add param that allows bootline control of hardened usercopy

From: kbuild test robot
Date: Mon Jun 25 2018 - 14:05:54 EST


Hi Chris,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.18-rc2 next-20180625]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Chris-von-Recklinghausen/add-param-that-allows-bootline-control-of-hardened-usercopy/20180625-232835
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=m68k

All error/warnings (new ones prefixed by >>):

WARNING: unmet direct dependencies detected for PREEMPT_COUNT
Depends on COLDFIRE
Selected by
- DEBUG_ATOMIC_SLEEP && DEBUG_KERNEL
In file included from include/linux/thread_info.h:112:0,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:81,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:5,
from include/linux/rcupdate.h:38,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/m68k/kernel/asm-offsets.c:15:
include/linux/jump_label.h: In function 'static_key_count':
>> include/linux/jump_label.h:194:9: error: implicit declaration of function 'atomic_read'; did you mean
return atomic_read(&key->enabled);
^~~~~~~~~~~
__atomic_load
include/linux/jump_label.h: In function 'static_key_slow_inc':
>> include/linux/jump_label.h:221:2: error: implicit declaration of function 'atomic_inc'; did you mean
atomic_inc(&key->enabled);
^~~~~~~~~~
__atomic_load
include/linux/jump_label.h: In function 'static_key_slow_dec':
>> include/linux/jump_label.h:227:2: error: implicit declaration of function 'atomic_dec'; did you mean
atomic_dec(&key->enabled);
^~~~~~~~~~
__atomic_clear
include/linux/jump_label.h: In function 'static_key_enable':
>> include/linux/jump_label.h:254:2: error: implicit declaration of function 'atomic_set'; did you mean
atomic_set(&key->enabled, 1);
^~~~~~~~~~
__atomic_clear
In file included from include/linux/atomic.h:5:0,
from include/linux/rcupdate.h:38,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/m68k/kernel/asm-offsets.c:15:
arch/m68k/include/asm/atomic.h: At top level:
>> arch/m68k/include/asm/atomic.h:125:20: warning: conflicting types for 'atomic_inc'
static inline void atomic_inc(atomic_t
^~~~~~~~~~
>> arch/m68k/include/asm/atomic.h:125:20: error: static declaration of 'atomic_inc' follows non-static declaration
In file included from include/linux/thread_info.h:112:0,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:81,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:5,
from include/linux/rcupdate.h:38,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/m68k/kernel/asm-offsets.c:15:
include/linux/jump_label.h:221:2: note: previous implicit declaration of 'atomic_inc' was here
atomic_inc(&key->enabled);
^~~~~~~~~~
In file included from include/linux/atomic.h:5:0,
from include/linux/rcupdate.h:38,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/m68k/kernel/asm-offsets.c:15:
>> arch/m68k/include/asm/atomic.h:130:20: warning: conflicting types for 'atomic_dec'
static inline void atomic_dec(atomic_t
^~~~~~~~~~
>> arch/m68k/include/asm/atomic.h:130:20: error: static declaration of 'atomic_dec' follows non-static declaration
In file included from include/linux/thread_info.h:112:0,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:81,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:5,
from include/linux/rcupdate.h:38,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/m68k/kernel/asm-offsets.c:15:
include/linux/jump_label.h:227:2: note: previous implicit declaration of 'atomic_dec' was here
atomic_dec(&key->enabled);
^~~~~~~~~~
cc1: some warnings being treated as errors
Makefile Module.symvers System.map arch block built-in.a certs crypto drivers firmware fs include init ipc kernel lib mm modules.builtin modules.order net scripts security sound source usr virt vmlinux vmlinux.gz vmlinux.o Error 1
Target '__build' not remade because of errors.
Makefile Module.symvers System.map arch block built-in.a certs crypto drivers firmware fs include init ipc kernel lib mm modules.builtin modules.order net scripts security sound source usr virt vmlinux vmlinux.gz vmlinux.o Error 2
Target 'prepare' not remade because of errors.
make: Makefile Module.symvers System.map arch block built-in.a certs crypto drivers firmware fs include init ipc kernel lib mm modules.builtin modules.order net scripts security sound source usr virt vmlinux vmlinux.gz vmlinux.o Error 2

vim +/atomic_read +194 include/linux/jump_label.h

1f69bf9c6 Jason Baron 2016-08-03 191
4c5ea0a9c Paolo Bonzini 2016-06-21 192 static inline int static_key_count(struct static_key *key)
4c5ea0a9c Paolo Bonzini 2016-06-21 193 {
4c5ea0a9c Paolo Bonzini 2016-06-21 @194 return atomic_read(&key->enabled);
4c5ea0a9c Paolo Bonzini 2016-06-21 195 }
4c5ea0a9c Paolo Bonzini 2016-06-21 196
97ce2c88f Jeremy Fitzhardinge 2011-10-12 197 static __always_inline void jump_label_init(void)
97ce2c88f Jeremy Fitzhardinge 2011-10-12 198 {
c4b2c0c5f Hannes Frederic Sowa 2013-10-19 199 static_key_initialized = true;
97ce2c88f Jeremy Fitzhardinge 2011-10-12 200 }
97ce2c88f Jeremy Fitzhardinge 2011-10-12 201
578ae447e Josh Poimboeuf 2018-03-19 202 static inline void jump_label_invalidate_initmem(void) {}
333522447 Josh Poimboeuf 2018-02-20 203
c5905afb0 Ingo Molnar 2012-02-24 204 static __always_inline bool static_key_false(struct static_key *key)
c5905afb0 Ingo Molnar 2012-02-24 205 {
ea5e9539a Mel Gorman 2014-06-04 206 if (unlikely(static_key_count(key) > 0))
c5905afb0 Ingo Molnar 2012-02-24 207 return true;
c5905afb0 Ingo Molnar 2012-02-24 208 return false;
c5905afb0 Ingo Molnar 2012-02-24 209 }
c5905afb0 Ingo Molnar 2012-02-24 210
c5905afb0 Ingo Molnar 2012-02-24 211 static __always_inline bool static_key_true(struct static_key *key)
d430d3d7e Jason Baron 2011-03-16 212 {
ea5e9539a Mel Gorman 2014-06-04 213 if (likely(static_key_count(key) > 0))
d430d3d7e Jason Baron 2011-03-16 214 return true;
d430d3d7e Jason Baron 2011-03-16 215 return false;
d430d3d7e Jason Baron 2011-03-16 216 }
bf5438fca Jason Baron 2010-09-17 217
c5905afb0 Ingo Molnar 2012-02-24 218 static inline void static_key_slow_inc(struct static_key *key)
d430d3d7e Jason Baron 2011-03-16 219 {
5cdda5117 Borislav Petkov 2017-10-18 220 STATIC_KEY_CHECK_USE(key);
d430d3d7e Jason Baron 2011-03-16 @221 atomic_inc(&key->enabled);
d430d3d7e Jason Baron 2011-03-16 222 }
bf5438fca Jason Baron 2010-09-17 223
c5905afb0 Ingo Molnar 2012-02-24 224 static inline void static_key_slow_dec(struct static_key *key)
bf5438fca Jason Baron 2010-09-17 225 {
5cdda5117 Borislav Petkov 2017-10-18 226 STATIC_KEY_CHECK_USE(key);
d430d3d7e Jason Baron 2011-03-16 @227 atomic_dec(&key->enabled);
bf5438fca Jason Baron 2010-09-17 228 }
bf5438fca Jason Baron 2010-09-17 229
ce48c1464 Peter Zijlstra 2018-01-22 230 #define static_key_slow_inc_cpuslocked(key) static_key_slow_inc(key)
ce48c1464 Peter Zijlstra 2018-01-22 231 #define static_key_slow_dec_cpuslocked(key) static_key_slow_dec(key)
ce48c1464 Peter Zijlstra 2018-01-22 232
4c3ef6d79 Jason Baron 2010-09-17 233 static inline int jump_label_text_reserved(void *start, void *end)
4c3ef6d79 Jason Baron 2010-09-17 234 {
4c3ef6d79 Jason Baron 2010-09-17 235 return 0;
4c3ef6d79 Jason Baron 2010-09-17 236 }
4c3ef6d79 Jason Baron 2010-09-17 237
91bad2f8d Jason Baron 2010-10-01 238 static inline void jump_label_lock(void) {}
91bad2f8d Jason Baron 2010-10-01 239 static inline void jump_label_unlock(void) {}
91bad2f8d Jason Baron 2010-10-01 240
d430d3d7e Jason Baron 2011-03-16 241 static inline int jump_label_apply_nops(struct module *mod)
d430d3d7e Jason Baron 2011-03-16 242 {
d430d3d7e Jason Baron 2011-03-16 243 return 0;
d430d3d7e Jason Baron 2011-03-16 244 }
b20295207 Gleb Natapov 2011-11-27 245
e33886b38 Peter Zijlstra 2015-07-24 246 static inline void static_key_enable(struct static_key *key)
e33886b38 Peter Zijlstra 2015-07-24 247 {
5cdda5117 Borislav Petkov 2017-10-18 248 STATIC_KEY_CHECK_USE(key);
e33886b38 Peter Zijlstra 2015-07-24 249
1dbb6704d Paolo Bonzini 2017-08-01 250 if (atomic_read(&key->enabled) != 0) {
1dbb6704d Paolo Bonzini 2017-08-01 251 WARN_ON_ONCE(atomic_read(&key->enabled) != 1);
1dbb6704d Paolo Bonzini 2017-08-01 252 return;
1dbb6704d Paolo Bonzini 2017-08-01 253 }
1dbb6704d Paolo Bonzini 2017-08-01 @254 atomic_set(&key->enabled, 1);
e33886b38 Peter Zijlstra 2015-07-24 255 }
e33886b38 Peter Zijlstra 2015-07-24 256

:::::: The code at line 194 was first introduced by commit
:::::: 4c5ea0a9cd02d6aa8adc86e100b2a4cff8d614ff locking/static_key: Fix concurrent static_key_slow_inc()

:::::: TO: Paolo Bonzini <pbonzini@xxxxxxxxxx>
:::::: CC: Ingo Molnar <mingo@xxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip