Thread (55 messages) 55 messages, 5 authors, 2018-01-17

Re: [PATCH 05/36] usercopy: WARN() on slab cache usercopy region violations

From: Kees Cook <hidden>
Date: 2018-01-10 20:14:07
Also in: linux-fsdevel, linux-mm, linux-xfs, lkml, netdev

On Wed, Jan 10, 2018 at 10:31 AM, Christopher Lameter [off-list ref] wrote:
On Tue, 9 Jan 2018, Kees Cook wrote:
quoted
@@ -3823,11 +3825,9 @@ int __check_heap_object(const void *ptr, unsigned long n, struct page *page,
Could we do the check in mm_slab_common.c for all allocators and just have
a small function in each allocators that give you the metadata needed for
the object?
That could be done, but there would still need to be some
implementation-specific checks in the per-implementation side (e.g.
red-zone, etc). I'll work up a patch and see if it's less ugly than
what I've currently got. :)
quoted
+ * carefully audit the whitelist range).
+ */
 int report_usercopy(const char *name, const char *detail, bool to_user,
                  unsigned long offset, unsigned long len)
 {
Should this not be added earlier?
This seemed like the best place to add this since it's where the WARN
is being added, so it's a bit more help for anyone looking at the
code.

-Kees

-- 
Kees Cook
Pixel Security

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help