Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48479
b: refs/heads/master
c: 9fbbd4d
h: refs/heads/master
i:
  48477: 31f9bab
  48475: ff22b21
  48471: 0dd035d
  48463: 8c1848a
  48447: d434946
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Feb 13, 2007
1 parent 62e8436 commit bc7a49d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 120fad72401ebec2a126c16cc48f56c28f3eefe2
refs/heads/master: 9fbbd4dd17d0712054368e5e939e28b2456bfe1b
6 changes: 5 additions & 1 deletion trunk/arch/i386/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/suspend.h>
#include <linux/ptrace.h>
#include <linux/elf.h>
#include <linux/binfmts.h>
#include <asm/processor.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -349,7 +350,10 @@ static int setup_frame(int sig, struct k_sigaction *ka,
goto give_sigsegv;
}

restorer = (void *)VDSO_SYM(&__kernel_sigreturn);
if (current->binfmt->hasvdso)
restorer = (void *)VDSO_SYM(&__kernel_sigreturn);
else
restorer = (void *)&frame->retcode;
if (ka->sa.sa_flags & SA_RESTORER)
restorer = ka->sa.sa_restorer;

Expand Down
7 changes: 6 additions & 1 deletion trunk/arch/x86_64/ia32/ia32_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/stddef.h>
#include <linux/personality.h>
#include <linux/compat.h>
#include <linux/binfmts.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
#include <asm/i387.h>
Expand Down Expand Up @@ -449,7 +450,11 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,

/* Return stub is in 32bit vsyscall page */
{
void __user *restorer = VSYSCALL32_SIGRETURN;
void __user *restorer;
if (current->binfmt->hasvdso)
restorer = VSYSCALL32_SIGRETURN;
else
restorer = (void *)&frame->retcode;
if (ka->sa.sa_flags & SA_RESTORER)
restorer = ka->sa.sa_restorer;
err |= __put_user(ptr_to_compat(restorer), &frame->pretcode);
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ static struct linux_binfmt elf_format = {
.load_binary = load_elf_binary,
.load_shlib = load_elf_library,
.core_dump = elf_core_dump,
.min_coredump = ELF_EXEC_PAGESIZE
.min_coredump = ELF_EXEC_PAGESIZE,
.hasvdso = 1
};

#define BAD_ADDR(x) ((unsigned long)(x) >= TASK_SIZE)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/binfmts.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct linux_binfmt {
int (*load_shlib)(struct file *);
int (*core_dump)(long signr, struct pt_regs * regs, struct file * file);
unsigned long min_coredump; /* minimal dump size */
int hasvdso;
};

extern int register_binfmt(struct linux_binfmt *);
Expand Down

0 comments on commit bc7a49d

Please sign in to comment.