mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com,
	luto@amacapital.net
Subject: [tip:x86/vdso] x86_64/vsyscall: Restore orig_ax after vsyscall seccomp
Date: Mon, 10 Nov 2014 01:48:31 -0800	[thread overview]
Message-ID: <tip-26893107aa717cd11010f0c278d02535defa1ac9@git.kernel.org> (raw)
In-Reply-To: <cdc6a564517a4df09235572ee5f530ccdcf933f7.1415144089.git.luto@amacapital.net>

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 */
 

      reply	other threads:[~2014-11-10  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 23:36 [PATCH] x86_64,vsyscall: " Andy Lutomirski
2014-11-10  9:48 ` tip-bot for Andy Lutomirski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-26893107aa717cd11010f0c278d02535defa1ac9@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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