diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-12 21:46:19 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-12 21:46:19 -0400 |
| commit | c202baf017aea0c860e53131bc55bb1af7177e76 (patch) | |
| tree | f3b19d008aac14979e115542f4b689e6c99f33cd /include/linux | |
| parent | ba68bc0115ebfc37f911db4e87bf5f7991f89698 (diff) | |
| parent | 7feee590bb18ffc42636975f74c2c3120ce1901c (diff) | |
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton:
"13 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
memcg: disable hierarchy support if bound to the legacy cgroup hierarchy
mm: reorder can_do_mlock to fix audit denial
kasan, module: move MODULE_ALIGN macro into <linux/moduleloader.h>
kasan, module, vmalloc: rework shadow allocation for modules
fanotify: fix event filtering with FAN_ONDIR set
mm/nommu.c: export symbol max_mapnr
arch/c6x/include/asm/pgtable.h: define dummy pgprot_writecombine for !MMU
nilfs2: fix deadlock of segment constructor during recovery
mm: cma: fix CMA aligned offset calculation
mm, hugetlb: close race when setting PageTail for gigantic pages
mm, oom: do not fail __GFP_NOFAIL allocation if oom killer is disabled
drivers/rtc/rtc-s3c.c: add .needs_src_clk to s3c6410 RTC data
ocfs2: make append_dio an incompat feature
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kasan.h | 9 | ||||
| -rw-r--r-- | include/linux/moduleloader.h | 8 | ||||
| -rw-r--r-- | include/linux/vmalloc.h | 1 |
3 files changed, 12 insertions, 6 deletions
diff --git a/include/linux/kasan.h b/include/linux/kasan.h index 72ba725ddf9c..5bb074431eb0 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | struct kmem_cache; | 6 | struct kmem_cache; |
| 7 | struct page; | 7 | struct page; |
| 8 | struct vm_struct; | ||
| 8 | 9 | ||
| 9 | #ifdef CONFIG_KASAN | 10 | #ifdef CONFIG_KASAN |
| 10 | 11 | ||
| @@ -49,15 +50,11 @@ void kasan_krealloc(const void *object, size_t new_size); | |||
| 49 | void kasan_slab_alloc(struct kmem_cache *s, void *object); | 50 | void kasan_slab_alloc(struct kmem_cache *s, void *object); |
| 50 | void kasan_slab_free(struct kmem_cache *s, void *object); | 51 | void kasan_slab_free(struct kmem_cache *s, void *object); |
| 51 | 52 | ||
| 52 | #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT) | ||
| 53 | |||
| 54 | int kasan_module_alloc(void *addr, size_t size); | 53 | int kasan_module_alloc(void *addr, size_t size); |
| 55 | void kasan_module_free(void *addr); | 54 | void kasan_free_shadow(const struct vm_struct *vm); |
| 56 | 55 | ||
| 57 | #else /* CONFIG_KASAN */ | 56 | #else /* CONFIG_KASAN */ |
| 58 | 57 | ||
| 59 | #define MODULE_ALIGN 1 | ||
| 60 | |||
| 61 | static inline void kasan_unpoison_shadow(const void *address, size_t size) {} | 58 | static inline void kasan_unpoison_shadow(const void *address, size_t size) {} |
| 62 | 59 | ||
| 63 | static inline void kasan_enable_current(void) {} | 60 | static inline void kasan_enable_current(void) {} |
| @@ -82,7 +79,7 @@ static inline void kasan_slab_alloc(struct kmem_cache *s, void *object) {} | |||
| 82 | static inline void kasan_slab_free(struct kmem_cache *s, void *object) {} | 79 | static inline void kasan_slab_free(struct kmem_cache *s, void *object) {} |
| 83 | 80 | ||
| 84 | static inline int kasan_module_alloc(void *addr, size_t size) { return 0; } | 81 | static inline int kasan_module_alloc(void *addr, size_t size) { return 0; } |
| 85 | static inline void kasan_module_free(void *addr) {} | 82 | static inline void kasan_free_shadow(const struct vm_struct *vm) {} |
| 86 | 83 | ||
| 87 | #endif /* CONFIG_KASAN */ | 84 | #endif /* CONFIG_KASAN */ |
| 88 | 85 | ||
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index f7556261fe3c..4d0cb9bba93e 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h | |||
| @@ -84,4 +84,12 @@ void module_arch_cleanup(struct module *mod); | |||
| 84 | 84 | ||
| 85 | /* Any cleanup before freeing mod->module_init */ | 85 | /* Any cleanup before freeing mod->module_init */ |
| 86 | void module_arch_freeing_init(struct module *mod); | 86 | void module_arch_freeing_init(struct module *mod); |
| 87 | |||
| 88 | #ifdef CONFIG_KASAN | ||
| 89 | #include <linux/kasan.h> | ||
| 90 | #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT) | ||
| 91 | #else | ||
| 92 | #define MODULE_ALIGN PAGE_SIZE | ||
| 93 | #endif | ||
| 94 | |||
| 87 | #endif | 95 | #endif |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 7d7acb35603d..0ec598381f97 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -17,6 +17,7 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | |||
| 17 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ | 17 | #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ |
| 18 | #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ | 18 | #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ |
| 19 | #define VM_NO_GUARD 0x00000040 /* don't add guard page */ | 19 | #define VM_NO_GUARD 0x00000040 /* don't add guard page */ |
| 20 | #define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */ | ||
| 20 | /* bits [20..32] reserved for arch specific ioremap internals */ | 21 | /* bits [20..32] reserved for arch specific ioremap internals */ |
| 21 | 22 | ||
| 22 | /* | 23 | /* |
