From: kernel test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>,
Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: kbuild-all@lists.01.org, Kees Cook <keescook@chromium.org>,
Matthew Wilcox <willy@infradead.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] usercopy: Check valid lifetime via stack depth
Date: Thu, 17 Feb 2022 08:59:02 +0800 [thread overview]
Message-ID: <202202170844.jnpFFEmh-lkp@intel.com> (raw)
In-Reply-To: <20220216201449.2087956-1-keescook@chromium.org>
Hi Kees,
I love your patch! Yet something to improve:
[auto build test ERROR on hnaz-mm/master]
[also build test ERROR on kees/for-next/pstore v5.17-rc4 next-20220216]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Kees-Cook/usercopy-Check-valid-lifetime-via-stack-depth/20220217-041611
base: https://github.com/hnaz/linux-mm master
config: openrisc-randconfig-r002-20220216 (https://download.01.org/0day-ci/archive/20220217/202202170844.jnpFFEmh-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/77944e5fa0cf5a29903b72466a22152c6a5d41ac
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kees-Cook/usercopy-Check-valid-lifetime-via-stack-depth/20220217-041611
git checkout 77944e5fa0cf5a29903b72466a22152c6a5d41ac
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=openrisc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
mm/usercopy.c: In function 'check_stack_object':
>> mm/usercopy.c:41:42: error: 'current_stack_pointer' undeclared (first use in this function); did you mean 'user_stack_pointer'?
41 | const void * const low = (void *)current_stack_pointer;
| ^~~~~~~~~~~~~~~~~~~~~
| user_stack_pointer
mm/usercopy.c:41:42: note: each undeclared identifier is reported only once for each function it appears in
mm/usercopy.c: In function '__check_object_size':
mm/usercopy.c:287:41: error: 'current_stack_pointer' undeclared (first use in this function); did you mean 'user_stack_pointer'?
287 | (void *)current_stack_pointer - ptr,
| ^~~~~~~~~~~~~~~~~~~~~
| user_stack_pointer
vim +41 mm/usercopy.c
24
25 /*
26 * Checks if a given pointer and length is contained by the current
27 * stack frame (if possible).
28 *
29 * Returns:
30 * NOT_STACK: not at all on the stack
31 * GOOD_FRAME: fully within a valid stack frame
32 * GOOD_STACK: within the current stack (when can't frame-check exactly)
33 * BAD_STACK: error condition (invalid stack position or bad stack frame)
34 */
35 static noinline int check_stack_object(const void *obj, unsigned long len)
36 {
37 const void * const stack = task_stack_page(current);
38 const void * const stackend = stack + THREAD_SIZE;
39 #ifndef CONFIG_STACK_GROWSUP
40 const void * const high = stackend;
> 41 const void * const low = (void *)current_stack_pointer;
42 #else
43 const void * const high = (void *)current_stack_pointer;
44 const void * const low = stack;
45 #endif
46 int ret;
47
48 /* Object is not on the stack at all. */
49 if (obj + len <= stack || stackend <= obj)
50 return NOT_STACK;
51
52 /*
53 * Reject: object partially overlaps the stack (passing the
54 * check above means at least one end is within the stack,
55 * so if this check fails, the other end is outside the stack).
56 */
57 if (obj < stack || stackend < obj + len)
58 return BAD_STACK;
59
60 /* Check if object is safely within a valid frame. */
61 ret = arch_within_stack_frames(stack, stackend, obj, len);
62 if (ret)
63 return ret;
64
65 /*
66 * Reject: object not within current stack depth.
67 */
68 if (obj < low || high < obj + len)
69 return BAD_STACK;
70
71 return GOOD_STACK;
72 }
73
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] usercopy: Check valid lifetime via stack depth
Date: Thu, 17 Feb 2022 08:59:02 +0800 [thread overview]
Message-ID: <202202170844.jnpFFEmh-lkp@intel.com> (raw)
In-Reply-To: <20220216201449.2087956-1-keescook@chromium.org>
[-- Attachment #1: Type: text/plain, Size: 4474 bytes --]
Hi Kees,
I love your patch! Yet something to improve:
[auto build test ERROR on hnaz-mm/master]
[also build test ERROR on kees/for-next/pstore v5.17-rc4 next-20220216]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Kees-Cook/usercopy-Check-valid-lifetime-via-stack-depth/20220217-041611
base: https://github.com/hnaz/linux-mm master
config: openrisc-randconfig-r002-20220216 (https://download.01.org/0day-ci/archive/20220217/202202170844.jnpFFEmh-lkp(a)intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/77944e5fa0cf5a29903b72466a22152c6a5d41ac
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kees-Cook/usercopy-Check-valid-lifetime-via-stack-depth/20220217-041611
git checkout 77944e5fa0cf5a29903b72466a22152c6a5d41ac
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=openrisc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
mm/usercopy.c: In function 'check_stack_object':
>> mm/usercopy.c:41:42: error: 'current_stack_pointer' undeclared (first use in this function); did you mean 'user_stack_pointer'?
41 | const void * const low = (void *)current_stack_pointer;
| ^~~~~~~~~~~~~~~~~~~~~
| user_stack_pointer
mm/usercopy.c:41:42: note: each undeclared identifier is reported only once for each function it appears in
mm/usercopy.c: In function '__check_object_size':
mm/usercopy.c:287:41: error: 'current_stack_pointer' undeclared (first use in this function); did you mean 'user_stack_pointer'?
287 | (void *)current_stack_pointer - ptr,
| ^~~~~~~~~~~~~~~~~~~~~
| user_stack_pointer
vim +41 mm/usercopy.c
24
25 /*
26 * Checks if a given pointer and length is contained by the current
27 * stack frame (if possible).
28 *
29 * Returns:
30 * NOT_STACK: not at all on the stack
31 * GOOD_FRAME: fully within a valid stack frame
32 * GOOD_STACK: within the current stack (when can't frame-check exactly)
33 * BAD_STACK: error condition (invalid stack position or bad stack frame)
34 */
35 static noinline int check_stack_object(const void *obj, unsigned long len)
36 {
37 const void * const stack = task_stack_page(current);
38 const void * const stackend = stack + THREAD_SIZE;
39 #ifndef CONFIG_STACK_GROWSUP
40 const void * const high = stackend;
> 41 const void * const low = (void *)current_stack_pointer;
42 #else
43 const void * const high = (void *)current_stack_pointer;
44 const void * const low = stack;
45 #endif
46 int ret;
47
48 /* Object is not on the stack at all. */
49 if (obj + len <= stack || stackend <= obj)
50 return NOT_STACK;
51
52 /*
53 * Reject: object partially overlaps the stack (passing the
54 * check above means@least one end is within the stack,
55 * so if this check fails, the other end is outside the stack).
56 */
57 if (obj < stack || stackend < obj + len)
58 return BAD_STACK;
59
60 /* Check if object is safely within a valid frame. */
61 ret = arch_within_stack_frames(stack, stackend, obj, len);
62 if (ret)
63 return ret;
64
65 /*
66 * Reject: object not within current stack depth.
67 */
68 if (obj < low || high < obj + len)
69 return BAD_STACK;
70
71 return GOOD_STACK;
72 }
73
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next prev parent reply other threads:[~2022-02-17 1:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 20:14 [PATCH] usercopy: Check valid lifetime via stack depth Kees Cook
2022-02-17 0:59 ` kernel test robot [this message]
2022-02-17 0:59 ` kernel test robot
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=202202170844.jnpFFEmh-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=jpoimboe@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=usama.anjum@collabora.com \
--cc=willy@infradead.org \
/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.