mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
usercopy: Mark kmalloc caches as usercopy caches
Mark the kmalloc slab caches as entirely whitelisted. These caches are frequently used to fulfill kernel allocations that contain data to be copied to/from userspace. Internal-only uses are also common, but are scattered in the kernel. For now, mark all the kmalloc caches as whitelisted. 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. Signed-off-by: David Windsor <[email protected]> [kees: merged in moved kmalloc hunks, adjust commit log] Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Andrew Morton <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Kees Cook <[email protected]> Acked-by: Christoph Lameter <[email protected]>
This commit is contained in:
parent
2d891fbc3b
commit
6c0c21adc7
3 changed files with 10 additions and 6 deletions
|
|
@ -97,7 +97,8 @@ struct kmem_cache *kmalloc_slab(size_t, gfp_t);
|
|||
int __kmem_cache_create(struct kmem_cache *, slab_flags_t flags);
|
||||
|
||||
extern struct kmem_cache *create_kmalloc_cache(const char *name, size_t size,
|
||||
slab_flags_t flags);
|
||||
slab_flags_t flags, size_t useroffset,
|
||||
size_t usersize);
|
||||
extern void create_boot_cache(struct kmem_cache *, const char *name,
|
||||
size_t size, slab_flags_t flags, size_t useroffset,
|
||||
size_t usersize);
|
||||
|
|
|
|||
Loading…
Reference in a new issue