All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: kbuild-all@01.org, kernel-hardening@lists.openwall.com,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Jiri Slaby <jslaby@suse.cz>, Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] lkdtm: add usercopy tests
Date: Wed, 8 Jun 2016 08:07:21 +0800	[thread overview]
Message-ID: <201606080821.2ILzOcsM%fengguang.wu@intel.com> (raw)
In-Reply-To: <1465336628-18219-5-git-send-email-keescook@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

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

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 26281 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: kbuild-all@01.org, kernel-hardening@lists.openwall.com,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Jiri Slaby <jslaby@suse.cz>, Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org
Subject: [kernel-hardening] Re: [PATCH 4/5] lkdtm: add usercopy tests
Date: Wed, 8 Jun 2016 08:07:21 +0800	[thread overview]
Message-ID: <201606080821.2ILzOcsM%fengguang.wu@intel.com> (raw)
In-Reply-To: <1465336628-18219-5-git-send-email-keescook@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

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

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 26281 bytes --]

  parent reply	other threads:[~2016-06-08  0:04 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 21:57 [PATCH 0/5] lkdtm: add usercopy and rodata, fix atomic Kees Cook
2016-06-07 21:57 ` [kernel-hardening] " Kees Cook
2016-06-07 21:57 ` [PATCH 1/5] lkdtm: split build into multiple source files Kees Cook
2016-06-07 21:57   ` [kernel-hardening] " Kees Cook
2016-06-07 21:57 ` [PATCH 2/5] lkdtm: clean up after rename Kees Cook
2016-06-07 21:57   ` [kernel-hardening] " Kees Cook
2016-06-07 21:57 ` [PATCH 3/5] lkdtm: add function for testing .rodata section Kees Cook
2016-06-07 21:57   ` [kernel-hardening] " Kees Cook
2016-06-08  1:02   ` Laura Abbott
2016-06-08  1:02     ` [kernel-hardening] " Laura Abbott
2016-06-08 15:46     ` Kees Cook
2016-06-08 15:46       ` [kernel-hardening] " Kees Cook
2016-06-08 16:15       ` Laura Abbott
2016-06-08 16:15         ` [kernel-hardening] " Laura Abbott
2016-06-08 21:26       ` Kees Cook
2016-06-08 21:26         ` [kernel-hardening] " Kees Cook
2016-06-10  1:14         ` Laura Abbott
2016-06-10  1:14           ` [kernel-hardening] " Laura Abbott
2016-08-01 12:37   ` Linker segfault on powerpc when CONFIG_LKDTM=y (was Re: [kernel-hardening] [PATCH 3/5] lkdtm: add function for testing .rodata section) Michael Ellerman
2016-08-01 12:37     ` [kernel-hardening] " Michael Ellerman
2016-08-01 19:45     ` Kees Cook
2016-08-01 19:45       ` [kernel-hardening] " Kees Cook
2016-08-01 19:45       ` Kees Cook
2016-08-02  3:12       ` [kernel-hardening] " Michael Ellerman
2016-08-02  3:12         ` Michael Ellerman
2016-08-02  3:12         ` Michael Ellerman
2016-08-02 19:12         ` Kees Cook
2016-08-02 19:12           ` Kees Cook
2016-08-03  4:46           ` Michael Ellerman
2016-08-03  4:46             ` Michael Ellerman
2016-08-03  4:46             ` Michael Ellerman
2016-06-07 21:57 ` [PATCH 4/5] lkdtm: add usercopy tests Kees Cook
2016-06-07 21:57   ` [kernel-hardening] " Kees Cook
2016-06-07 23:36   ` kbuild test robot
2016-06-07 23:36     ` [kernel-hardening] " kbuild test robot
2016-06-08  0:07   ` kbuild test robot [this message]
2016-06-08  0:07     ` kbuild test robot
2016-06-07 21:57 ` [PATCH 5/5] lkdtm: split atomic test into over and underflow Kees Cook
2016-06-07 21:57   ` [kernel-hardening] " Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201606080821.2ILzOcsM%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.