From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: konrad.wilk@oracle.com, hpa@zytor.com, luto@amacapital.net,
mingo@kernel.org, tglx@linutronix.de,
linux-kernel@vger.kernel.org, josh@joshtriplett.org
Subject: [tip:x86/vdso] x86_64, vsyscall: Turn vsyscalls all the way off when vsyscall==none
Date: Mon, 3 Nov 2014 12:48:33 -0800 [thread overview]
Message-ID: <tip-87983c66bc02c9cd8e4a42e7924435145d52bb13@git.kernel.org> (raw)
In-Reply-To: <0dddbadc1d4e3bfbaf887938ff42afc97a7cc1f2.1414618407.git.luto@amacapital.net>
Commit-ID: 87983c66bc02c9cd8e4a42e7924435145d52bb13
Gitweb: http://git.kernel.org/tip/87983c66bc02c9cd8e4a42e7924435145d52bb13
Author: Andy Lutomirski <luto@amacapital.net>
AuthorDate: Wed, 29 Oct 2014 14:33:45 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 3 Nov 2014 21:44:57 +0100
x86_64, vsyscall: Turn vsyscalls all the way off when vsyscall==none
I see no point in having an unusable read-only page sitting at
0xffffffffff600000 when vsyscall=none. Instead, skip mapping it and
remove it from /proc/PID/maps.
I kept the ratelimited warning when programs try to use a vsyscall
in this mode, since it may help admins avoid confusion.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Link: http://lkml.kernel.org/r/0dddbadc1d4e3bfbaf887938ff42afc97a7cc1f2.1414618407.git.luto@amacapital.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/vsyscall_64.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 419e83b..2d91262 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -307,6 +307,8 @@ struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
if (!mm || mm->context.ia32_compat)
return NULL;
#endif
+ if (vsyscall_mode == NONE)
+ return NULL;
return &gate_vma;
}
@@ -327,7 +329,7 @@ int in_gate_area(struct mm_struct *mm, unsigned long addr)
*/
int in_gate_area_no_mm(unsigned long addr)
{
- return (addr & PAGE_MASK) == VSYSCALL_ADDR;
+ return vsyscall_mode != NONE && (addr & PAGE_MASK) == VSYSCALL_ADDR;
}
void __init map_vsyscall(void)
@@ -335,10 +337,12 @@ void __init map_vsyscall(void)
extern char __vsyscall_page;
unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page);
- __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall,
- vsyscall_mode == NATIVE
- ? PAGE_KERNEL_VSYSCALL
- : PAGE_KERNEL_VVAR);
+ if (vsyscall_mode != NONE)
+ __set_fixmap(VSYSCALL_PAGE, physaddr_vsyscall,
+ vsyscall_mode == NATIVE
+ ? PAGE_KERNEL_VSYSCALL
+ : PAGE_KERNEL_VVAR);
+
BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_PAGE) !=
(unsigned long)VSYSCALL_ADDR);
}
next prev parent reply other threads:[~2014-11-03 20:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 21:33 [PATCH v2 0/3] x86_64: Tidy up vsyscall emulation and make it optional Andy Lutomirski
2014-10-29 21:33 ` [PATCH v2 1/3] x86_64,vsyscall: Turn vsyscalls all the way off when vsyscall=none Andy Lutomirski
2014-11-03 20:48 ` tip-bot for Andy Lutomirski [this message]
2014-10-29 21:33 ` [PATCH v2 2/3] x86_64,vsyscall: Rewrite comment and clean up headers in vsyscall code Andy Lutomirski
2014-11-03 20:31 ` Thomas Gleixner
2014-11-03 20:34 ` Andy Lutomirski
2014-11-03 20:41 ` Thomas Gleixner
2014-11-03 20:42 ` Andy Lutomirski
2014-11-03 20:48 ` [tip:x86/vdso] x86_64, vsyscall: " tip-bot for Andy Lutomirski
2014-10-29 21:33 ` [PATCH v2 3/3] x86_64,vsyscall: Make vsyscall emulation configurable Andy Lutomirski
2014-11-03 20:49 ` [tip:x86/vdso] " tip-bot for Andy Lutomirski
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-87983c66bc02c9cd8e4a42e7924435145d52bb13@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=josh@joshtriplett.org \
--cc=konrad.wilk@oracle.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 \
/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