Skip to content

Commit fc5243d

Browse files
author
Martin Schwidefsky
committed
[S390] arch_setup_additional_pages arguments
arch_setup_additional_pages currently gets two arguments, the binary format descripton and an indication if the process uses an executable stack or not. The second argument is not used by anybody, it could be removed without replacement. What actually does make sense is to pass an indication if the process uses the elf interpreter or not. The glibc code will not use anything from the vdso if the process does not use the dynamic linker, so for statically linked binaries the architecture backend can choose not to map the vdso. Acked-by: Ingo Molnar <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent a114a9d commit fc5243d

File tree

8 files changed

+8
-10
lines changed

8 files changed

+8
-10
lines changed

arch/powerpc/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ extern int ucache_bsize;
267267
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
268268
struct linux_binprm;
269269
extern int arch_setup_additional_pages(struct linux_binprm *bprm,
270-
int executable_stack);
270+
int uses_interp);
271271
#define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b);
272272

273273
#endif /* __KERNEL__ */

arch/powerpc/kernel/vdso.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ static void dump_vdso_pages(struct vm_area_struct * vma)
184184
* This is called from binfmt_elf, we create the special vma for the
185185
* vDSO and insert it into the mm struct tree
186186
*/
187-
int arch_setup_additional_pages(struct linux_binprm *bprm,
188-
int executable_stack)
187+
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
189188
{
190189
struct mm_struct *mm = current->mm;
191190
struct page **vdso_pagelist;

arch/sh/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ do { \
204204
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
205205
struct linux_binprm;
206206
extern int arch_setup_additional_pages(struct linux_binprm *bprm,
207-
int executable_stack);
207+
int uses_interp);
208208

209209
extern unsigned int vdso_enabled;
210210
extern void __kernel_vsyscall;

arch/sh/kernel/vsyscall/vsyscall.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ int __init vsyscall_init(void)
5959
}
6060

6161
/* Setup a VMA at program startup for the vsyscall page */
62-
int arch_setup_additional_pages(struct linux_binprm *bprm,
63-
int executable_stack)
62+
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
6463
{
6564
struct mm_struct *mm = current->mm;
6665
unsigned long addr;

arch/x86/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ struct linux_binprm;
325325

326326
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
327327
extern int arch_setup_additional_pages(struct linux_binprm *bprm,
328-
int executable_stack);
328+
int uses_interp);
329329

330330
extern int syscall32_setup_pages(struct linux_binprm *, int exstack);
331331
#define compat_arch_setup_additional_pages syscall32_setup_pages

arch/x86/vdso/vdso32-setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ int __init sysenter_setup(void)
310310
}
311311

312312
/* Setup a VMA at program startup for the vsyscall page */
313-
int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
313+
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
314314
{
315315
struct mm_struct *mm = current->mm;
316316
unsigned long addr;

arch/x86/vdso/vma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
9898

9999
/* Setup a VMA at program startup for the vsyscall page.
100100
Not called for compat tasks */
101-
int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
101+
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
102102
{
103103
struct mm_struct *mm = current->mm;
104104
unsigned long addr;

fs/binfmt_elf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
949949
set_binfmt(&elf_format);
950950

951951
#ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES
952-
retval = arch_setup_additional_pages(bprm, executable_stack);
952+
retval = arch_setup_additional_pages(bprm, !!elf_interpreter);
953953
if (retval < 0) {
954954
send_sig(SIGKILL, current, 0);
955955
goto out;

0 commit comments

Comments
 (0)