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

Configure Feed

Select the types of activity you want to include in your feed.

binfmt_flat: replace flat_argvp_envp_on_stack with a Kconfig variable

This will eventually allow us to kill the need for an <asm/flat.h> for
many cases.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>

authored by

Christoph Hellwig and committed by
Greg Ungerer
bdd15a28 1d52dca1

+9 -12
+1
arch/arm/Kconfig
··· 30 30 select ARCH_USE_BUILTIN_BSWAP 31 31 select ARCH_USE_CMPXCHG_LOCKREF 32 32 select ARCH_WANT_IPC_PARSE_VERSION 33 + select BINFMT_FLAT_ARGVP_ENVP_ON_STACK 33 34 select BUILDTIME_EXTABLE_SORT if MMU 34 35 select CLONE_BACKWARDS 35 36 select CPU_PM if SUSPEND || CPU_IDLE
-2
arch/arm/include/asm/flat.h
··· 8 8 9 9 #include <linux/uaccess.h> 10 10 11 - #define flat_argvp_envp_on_stack() 1 12 - 13 11 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 14 12 u32 *addr, u32 *persistent) 15 13 {
-1
arch/c6x/include/asm/flat.h
··· 4 4 5 5 #include <asm/unaligned.h> 6 6 7 - #define flat_argvp_envp_on_stack() 0 8 7 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 9 8 u32 *addr, u32 *persistent) 10 9 {
+1
arch/h8300/Kconfig
··· 2 2 config H8300 3 3 def_bool y 4 4 select ARCH_32BIT_OFF_T 5 + select BINFMT_FLAT_ARGVP_ENVP_ON_STACK 5 6 select BINFMT_FLAT_OLD_ALWAYS_RAM 6 7 select GENERIC_ATOMIC64 7 8 select HAVE_UID16
-2
arch/h8300/include/asm/flat.h
··· 8 8 9 9 #include <asm/unaligned.h> 10 10 11 - #define flat_argvp_envp_on_stack() 1 12 - 13 11 /* 14 12 * on the H8 a couple of the relocations have an instruction in the 15 13 * top byte. As there can only be 24bits of address space, we just
+1
arch/m68k/Kconfig
··· 7 7 select ARCH_MIGHT_HAVE_PC_PARPORT if ISA 8 8 select ARCH_NO_COHERENT_DMA_MMAP if !MMU 9 9 select ARCH_NO_PREEMPT if !COLDFIRE 10 + select BINFMT_FLAT_ARGVP_ENVP_ON_STACK 10 11 select HAVE_IDE 11 12 select HAVE_AOUT if MMU 12 13 select HAVE_DEBUG_BUGVERBOSE
-1
arch/m68k/include/asm/flat.h
··· 8 8 9 9 #include <linux/uaccess.h> 10 10 11 - #define flat_argvp_envp_on_stack() 1 12 11 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 13 12 u32 *addr, u32 *persistent) 14 13 {
-2
arch/microblaze/include/asm/flat.h
··· 13 13 14 14 #include <asm/unaligned.h> 15 15 16 - #define flat_argvp_envp_on_stack() 0 17 - 18 16 /* 19 17 * Microblaze works a little differently from other arches, because 20 18 * of the MICROBLAZE_64 reloc type. Here, a 32 bit address is split
-1
arch/sh/include/asm/flat.h
··· 11 11 12 12 #include <asm/unaligned.h> 13 13 14 - #define flat_argvp_envp_on_stack() 0 15 14 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 16 15 u32 *addr, u32 *persistent) 17 16 {
-1
arch/xtensa/include/asm/flat.h
··· 4 4 5 5 #include <asm/unaligned.h> 6 6 7 - #define flat_argvp_envp_on_stack() 0 8 7 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 9 8 u32 *addr, u32 *persistent) 10 9 {
+3
fs/Kconfig.binfmt
··· 97 97 help 98 98 Support uClinux FLAT format binaries. 99 99 100 + config BINFMT_FLAT_ARGVP_ENVP_ON_STACK 101 + bool 102 + 100 103 config BINFMT_FLAT_OLD_ALWAYS_RAM 101 104 bool 102 105
+3 -2
fs/binfmt_flat.c
··· 124 124 125 125 sp -= bprm->envc + 1; 126 126 sp -= bprm->argc + 1; 127 - sp -= flat_argvp_envp_on_stack() ? 2 : 0; 127 + if (IS_ENABLED(CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK)) 128 + sp -= 2; /* argvp + envp */ 128 129 sp -= 1; /* &argc */ 129 130 130 131 current->mm->start_stack = (unsigned long)sp & -FLAT_STACK_ALIGN; 131 132 sp = (unsigned long __user *)current->mm->start_stack; 132 133 133 134 __put_user(bprm->argc, sp++); 134 - if (flat_argvp_envp_on_stack()) { 135 + if (IS_ENABLED(CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK)) { 135 136 unsigned long argv, envp; 136 137 argv = (unsigned long)(sp + 2); 137 138 envp = (unsigned long)(sp + 2 + bprm->argc + 1);