tree:
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/core
head: c4dfe2b515b510d7db6858c14f9b2492130a543b
commit: 589bcab3e46636fc4fb4f56b3f51adba98f50ee0 [1/2] seqlock,headers: Untangle the
spaghetti monster
config: i386-randconfig-a014-20200731 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
git checkout 589bcab3e46636fc4fb4f56b3f51adba98f50ee0
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/smp.h:18,
from arch/x86/include/asm/apic.h:485,
from arch/x86/kernel/apic/local.h:13,
from arch/x86/kernel/apic/ipi.c:6:
arch/x86/include/asm/thread_info.h: In function 'arch_within_stack_frames':
> arch/x86/include/asm/thread_info.h:208:5: error:
'GOOD_FRAME' undeclared (first use in this function)
208 |
GOOD_FRAME : BAD_STACK;
| ^~~~~~~~~~
arch/x86/include/asm/thread_info.h:208:5: note: each undeclared identifier is reported
only once for each function it appears in
> arch/x86/include/asm/thread_info.h:208:18: error:
'BAD_STACK' undeclared (first use in this function)
208 |
GOOD_FRAME : BAD_STACK;
| ^~~~~~~~~
arch/x86/kernel/apic/ipi.c: At top level:
arch/x86/kernel/apic/ipi.c:315:5: warning: no previous prototype for
'safe_smp_processor_id' [-Wmissing-prototypes]
315 | int safe_smp_processor_id(void)
| ^~~~~~~~~~~~~~~~~~~~~
--
In file included from arch/x86/include/asm/smp.h:18,
from arch/x86/include/asm/apic.h:485,
from arch/x86/kernel/apic/probe_32.c:13:
arch/x86/include/asm/thread_info.h: In function 'arch_within_stack_frames':
> arch/x86/include/asm/thread_info.h:208:5: error:
'GOOD_FRAME' undeclared (first use in this function)
208 |
GOOD_FRAME : BAD_STACK;
| ^~~~~~~~~~
arch/x86/include/asm/thread_info.h:208:5: note: each undeclared identifier is reported
only once for each function it appears in
> arch/x86/include/asm/thread_info.h:208:18: error:
'BAD_STACK' undeclared (first use in this function)
208 |
GOOD_FRAME : BAD_STACK;
| ^~~~~~~~~
vim +/GOOD_FRAME +208 arch/x86/include/asm/thread_info.h
2052e8d40ad58b1 include/asm-x86/thread_info.h Christoph Lameter 2008-05-12 172
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 173 /*
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 174 *
Walks up the stack frames to make sure that the specified object is
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 175 *
entirely contained by a single stack frame.
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 176 *
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 177 *
Returns:
96dc4f9fb64690f arch/x86/include/asm/thread_info.h Sahara 2017-02-16 178
* GOOD_FRAME if within a frame
96dc4f9fb64690f arch/x86/include/asm/thread_info.h Sahara 2017-02-16 179
* BAD_STACK if placed across a frame boundary (or outside stack)
96dc4f9fb64690f arch/x86/include/asm/thread_info.h Sahara 2017-02-16 180
* NOT_STACK unable to determine (no frame pointers, etc)
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 181 */
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 182
static inline int arch_within_stack_frames(const void * const stack,
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 183
const void * const stackend,
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 184
const void *obj, unsigned long len)
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 185 {
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 186 #if
defined(CONFIG_FRAME_POINTER)
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 187
const void *frame = NULL;
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 188
const void *oldframe;
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 189
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 190
oldframe = __builtin_frame_address(1);
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 191 if
(oldframe)
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 192
frame = __builtin_frame_address(2);
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 193 /*
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 194 *
low ----------------------------------------------> high
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 195 *
[saved bp][saved ip][args][local vars][saved bp][saved ip]
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 196 *
^----------------^
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 197 *
allow copies only within here
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 198
*/
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 199
while (stack <= frame && frame < stackend) {
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 200
/*
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 201 *
If obj + len extends past the last frame, this
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 202 *
check won't pass and the next frame will be 0,
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 203 *
causing us to bail out and correctly report
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 204 *
the copy as invalid.
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 205
*/
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 206 if
(obj + len <= frame)
96dc4f9fb64690f arch/x86/include/asm/thread_info.h Sahara 2017-02-16 207
return obj >= oldframe + 2 * sizeof(void *) ?
96dc4f9fb64690f arch/x86/include/asm/thread_info.h Sahara 2017-02-16 @208
GOOD_FRAME : BAD_STACK;
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 209
oldframe = frame;
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 210
frame = *(const void * const *)frame;
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 211 }
96dc4f9fb64690f arch/x86/include/asm/thread_info.h Sahara 2017-02-16 212
return BAD_STACK;
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 213
#else
96dc4f9fb64690f arch/x86/include/asm/thread_info.h Sahara 2017-02-16 214
return NOT_STACK;
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 215
#endif
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 216 }
0f60a8efe4005ab arch/x86/include/asm/thread_info.h Kees Cook 2016-07-12 217
:::::: The code at line 208 was first introduced by commit
:::::: 96dc4f9fb64690fc34410415fd1fc609cf803f61 usercopy: Move enum for
arch_within_stack_frames()
:::::: TO: Sahara <keun-o.park(a)darkmatter.ae>
:::::: CC: Kees Cook <keescook(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org