Skip to content

Commit 6d07d1c

Browse files
committed
usercopy: Restrict non-usercopy caches to size 0
With all known usercopied cache whitelists now defined in the kernel, switch the default usercopy region of kmem_cache_create() to size 0. Any new caches with usercopy regions will now need to use kmem_cache_create_usercopy() instead of kmem_cache_create(). This patch is modified from Brad Spengler/PaX Team's PAX_USERCOPY whitelisting code in the last public patch of grsecurity/PaX based on my understanding of the code. Changes or omissions from the original code are mine and don't reflect the original grsecurity/PaX code. Cc: David Windsor <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Andrew Morton <[email protected]> Cc: [email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 5177604 commit 6d07d1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/slab_common.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ struct kmem_cache *
532532
kmem_cache_create(const char *name, size_t size, size_t align,
533533
slab_flags_t flags, void (*ctor)(void *))
534534
{
535-
return kmem_cache_create_usercopy(name, size, align, flags, 0, size,
535+
return kmem_cache_create_usercopy(name, size, align, flags, 0, 0,
536536
ctor);
537537
}
538538
EXPORT_SYMBOL(kmem_cache_create);

0 commit comments

Comments
 (0)