Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: remove arch_bprm_mm_init() hook

From: Dave Hansen <dave.hansen@linux.intel.com>

MPX is being removed from the kernel due to a lack of support
in the toolchain going forward (gcc).

arch_bprm_mm_init() is used at execve() time. The only non-stub
implementation is on x86 for MPX. Remove the hook entirely from
all architectures and generic code.

Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: x86@kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-arch@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>

authored by

Dave Hansen and committed by
Dave Hansen
42222eae aa9ccb7b

-27
-5
arch/powerpc/include/asm/mmu_context.h
··· 238 238 mm->context.vdso_base = 0; 239 239 } 240 240 241 - static inline void arch_bprm_mm_init(struct mm_struct *mm, 242 - struct vm_area_struct *vma) 243 - { 244 - } 245 - 246 241 #ifdef CONFIG_PPC_MEM_KEYS 247 242 bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, 248 243 bool execute, bool foreign);
-5
arch/um/include/asm/mmu_context.h
··· 25 25 unsigned long start, unsigned long end) 26 26 { 27 27 } 28 - static inline void arch_bprm_mm_init(struct mm_struct *mm, 29 - struct vm_area_struct *vma) 30 - { 31 - } 32 - 33 28 static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, 34 29 bool write, bool execute, bool foreign) 35 30 {
-5
arch/unicore32/include/asm/mmu_context.h
··· 89 89 { 90 90 } 91 91 92 - static inline void arch_bprm_mm_init(struct mm_struct *mm, 93 - struct vm_area_struct *vma) 94 - { 95 - } 96 - 97 92 static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, 98 93 bool write, bool execute, bool foreign) 99 94 {
-6
arch/x86/include/asm/mmu_context.h
··· 272 272 } 273 273 #endif 274 274 275 - static inline void arch_bprm_mm_init(struct mm_struct *mm, 276 - struct vm_area_struct *vma) 277 - { 278 - mpx_mm_init(mm); 279 - } 280 - 281 275 static inline void arch_unmap(struct mm_struct *mm, unsigned long start, 282 276 unsigned long end) 283 277 {
-1
fs/exec.c
··· 273 273 goto err; 274 274 275 275 mm->stack_vm = mm->total_vm = 1; 276 - arch_bprm_mm_init(mm, vma); 277 276 up_write(&mm->mmap_sem); 278 277 bprm->p = vma->vm_end - sizeof(void *); 279 278 return 0;
-5
include/asm-generic/mm_hooks.h
··· 22 22 { 23 23 } 24 24 25 - static inline void arch_bprm_mm_init(struct mm_struct *mm, 26 - struct vm_area_struct *vma) 27 - { 28 - } 29 - 30 25 static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, 31 26 bool write, bool execute, bool foreign) 32 27 {