Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1465538
| From | Rik van Riel <riel@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB |
| Date | 2016-08-18 16:30 +0200 |
| Message-ID | <s7wuv-WK-87@gated-at.bofh.it> (permalink) |
| References | <s7hvt-7wd-47@gated-at.bofh.it> |
| Organization | Red Hat, Inc. |
On Wed, 2016-08-17 at 15:29 -0700, Kees Cook wrote: > When an allocator does not mark all allocations as PageSlab, or does > not > mark multipage allocations with __GFP_COMP, hardened usercopy cannot > correctly validate the allocation. SLOB lacks this, so short-circuit > the checking for the allocators that aren't marked with > CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR. This also updates the config > help and corrects a typo in the usercopy comments. > > Reported-by: xiaolong.ye@intel.com > Signed-off-by: Kees Cook <keescook@chromium.org> There may still be some subsystems that do not go through kmalloc for multi-page allocations, and also do not use __GFP_COMP I do not know whether there are, but if they exist those would still trip up the same way SLOB got tripped up before your patch. One big question I have for Linus is, do we want to allow code that does a higher order allocation, and then frees part of it in smaller orders, or individual pages, and keeps using the remainder? From both a hardening and a simple stability point of view, allowing memory to be allocated in one size, and freed in another, seems like it could be asking for bugs. If we decide we do not want to allow that, we can just do the __GFP_COMP markings unconditionally, and show a big fat warning when memory gets freed in a different size than it was allocated. Is that something we want to do?
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] usercopy: Skip multi-page bounds checking on SLOB Kees Cook <keescook@chromium.org> - 2016-08-18 00:30 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Rik van Riel <riel@redhat.com> - 2016-08-18 16:30 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Rik van Riel <riel@redhat.com> - 2016-08-19 03:20 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Kees Cook <keescook@chromium.org> - 2016-08-19 20:10 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-19 04:40 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Michal Hocko <mhocko@kernel.org> - 2016-08-19 12:50 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-19 21:50 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-19 22:10 +0200
Re: [PATCH] usercopy: Skip multi-page bounds checking on SLOB Kees Cook <keescook@chromium.org> - 2016-08-19 22:10 +0200
csiph-web