summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_flat.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-06-13 09:08:51 +0200
committerGreg Ungerer <gerg@kernel.org>2019-06-24 01:16:46 +0200
commitbdd15a288492f2f496a904c69c4b332057ae2ef6 (patch)
tree453e2a0303f4ff9c2b8381a413fe9285a56472d5 /fs/binfmt_flat.c
parentbinfmt_flat: remove flat_old_ram_flag (diff)
downloadlinux-bdd15a288492f2f496a904c69c4b332057ae2ef6.tar.xz
linux-bdd15a288492f2f496a904c69c4b332057ae2ef6.zip
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>
Diffstat (limited to 'fs/binfmt_flat.c')
-rw-r--r--fs/binfmt_flat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 3e7f4a6cffa2..a15fdd5d95ed 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -124,14 +124,15 @@ static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start
sp -= bprm->envc + 1;
sp -= bprm->argc + 1;
- sp -= flat_argvp_envp_on_stack() ? 2 : 0;
+ if (IS_ENABLED(CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK))
+ sp -= 2; /* argvp + envp */
sp -= 1; /* &argc */
current->mm->start_stack = (unsigned long)sp & -FLAT_STACK_ALIGN;
sp = (unsigned long __user *)current->mm->start_stack;
__put_user(bprm->argc, sp++);
- if (flat_argvp_envp_on_stack()) {
+ if (IS_ENABLED(CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK)) {
unsigned long argv, envp;
argv = (unsigned long)(sp + 2);
envp = (unsigned long)(sp + 2 + bprm->argc + 1);