lkml.org 
[lkml]   [2014]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86_64,vsyscall: Restore orig_ax after vsyscall seccomp
Date
The vsyscall emulation code sets orig_ax for seccomp's benefit,
but it forgot to set it back.

I'm not sure that this is observable at all, but it could cause
confusion to various /proc or ptrace users, and it's possible that
it could cause minor artifacts if a signal were to be delivered
on return from vsyscall emulation.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
---

I misplaced this somehow as part of my vsyscall series. It's very minor,
so I don't care much whether it makes 3.19.

My vsyscall seccomp tests all pass with or without this change.

arch/x86/kernel/vsyscall_64.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 7d9eb4bc10ac..2dcc6ff6fdcc 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -206,6 +206,7 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
"seccomp tried to change syscall nr or ip");
do_exit(SIGSYS);
}
+ regs->orig_ax = -1;
if (tmp)
goto do_ret; /* skip requested */

--
1.9.3


\
 
 \ /
  Last update: 2014-11-05 01:01    [W:0.035 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site