lkml.org 
[lkml]   [2016]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] lkdtm: add usercopy tests
Hi,

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on v4.7-rc2 next-20160607]
[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/Kees-Cook/lkdtm-add-usercopy-and-rodata-fix-atomic/20160608-060444
config: x86_64-randconfig-s2-06080621 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

drivers/misc/lkdtm_core.c: In function 'do_usercopy_stack_callee':
>> drivers/misc/lkdtm_core.c:420:9: warning: function may return address of local variable [-Wreturn-local-addr]
return ptr;
^~~
drivers/misc/lkdtm_core.c:405:16: note: declared here
unsigned char buf[32];
^~~

vim +420 drivers/misc/lkdtm_core.c

404 {
405 unsigned char buf[32];
406 unsigned char *ptr = NULL;
407 int i;
408
409 /* Exercise stack to avoid everything living in registers. */
410 for (i = 0; i < sizeof(buf); i++) {
411 /*
412 * Hack to trick gcc into letting us return a reference
413 * to a local stack frame.
414 */
415 if (i == 0)
416 ptr = buf;
417 buf[i] = value & 0xff;
418 }
419
> 420 return ptr;
421 }
422
423 static noinline void do_usercopy_stack(bool to_user)
424 {
425 unsigned long user_addr;
426 unsigned char good_stack[32];
427 unsigned char *bad_stack;
428 int i;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2016-06-08 02:21    [W:0.464 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site