* [PATCH] x86_64,vsyscall: Restore orig_ax after vsyscall seccomp
@ 2014-11-04 23:36 Andy Lutomirski
2014-11-10 9:48 ` [tip:x86/vdso] x86_64/vsyscall: " tip-bot for Andy Lutomirski
0 siblings, 1 reply; 2+ messages in thread
From: Andy Lutomirski @ 2014-11-04 23:36 UTC (permalink / raw)
To: x86; +Cc: linux-kernel, Andy Lutomirski
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:x86/vdso] x86_64/vsyscall: Restore orig_ax after vsyscall seccomp
2014-11-04 23:36 [PATCH] x86_64,vsyscall: Restore orig_ax after vsyscall seccomp Andy Lutomirski
@ 2014-11-10 9:48 ` tip-bot for Andy Lutomirski
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Andy Lutomirski @ 2014-11-10 9:48 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, torvalds, mingo, tglx, hpa, luto
Commit-ID: 26893107aa717cd11010f0c278d02535defa1ac9
Gitweb: http://git.kernel.org/tip/26893107aa717cd11010f0c278d02535defa1ac9
Author: Andy Lutomirski <luto@amacapital.net>
AuthorDate: Tue, 4 Nov 2014 15:36:50 -0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 10 Nov 2014 10:46:35 +0100
x86_64/vsyscall: Restore orig_ax after vsyscall seccomp
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>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/cdc6a564517a4df09235572ee5f530ccdcf933f7.1415144089.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
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 7d9eb4b..2dcc6ff 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 */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-10 9:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04 23:36 [PATCH] x86_64,vsyscall: Restore orig_ax after vsyscall seccomp Andy Lutomirski
2014-11-10 9:48 ` [tip:x86/vdso] x86_64/vsyscall: " tip-bot for Andy Lutomirski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome