Thread (36 messages) flat view 36 messages, 11 authors, 2016-07-11

[PATCH 1/9] mm: Hardened usercopy

From: baruch@tkos.co.il (Baruch Siach)
Date: 2016-07-07 18:44:20
Also in: linux-arch, linux-mm, linuxppc-dev, lkml, sparclinux

Hi Kees,

On Thu, Jul 07, 2016 at 01:25:21PM -0400, Kees Cook wrote:
On Thu, Jul 7, 2016 at 1:37 AM, Baruch Siach [off-list ref] wrote:
quoted
On Wed, Jul 06, 2016 at 03:25:20PM -0700, Kees Cook wrote:
quoted
+#ifdef CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR
Should be CONFIG_HARDENED_USERCOPY to match the slab/slub implementation
condition.
quoted
+const char *__check_heap_object(const void *ptr, unsigned long n,
+                             struct page *page);
+#else
+static inline const char *__check_heap_object(const void *ptr,
+                                           unsigned long n,
+                                           struct page *page)
+{
+     return NULL;
+}
+#endif
Hmm, I think what I have is correct: if the allocator supports the
heap object checking, it defines __check_heap_object as existing via
CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR. If usercopy checking is done
at all is controlled by CONFIG_HARDENED_USERCOPY.

I.e. you can have the other usercopy checks even if your allocator
doesn't support object size checking.
Right. I missed the fact that usercopy.c build also depends on 
CONFIG_HARDENED_USERCOPY. Sorry for the noise.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help