From: Florian Weimer <fweimer@redhat.com>
To: Andrei Vagin <avagin@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>,
linux-arch@vger.kernel.org,
Linux API <linux-api@vger.kernel.org>,
linux-x86_64@vger.kernel.org,
kernel-hardening@lists.openwall.com, linux-mm@kvack.org,
"the arch/x86 maintainers" <x86@kernel.org>,
musl@lists.openwall.com, libc-alpha@sourceware.org,
LKML <linux-kernel@vger.kernel.org>,
Dave Hansen <dave.hansen@intel.com>,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH v2] x86: Implement arch_prctl(ARCH_VSYSCALL_CONTROL) to disable vsyscall
Date: Mon, 27 Dec 2021 18:40:38 +0100 [thread overview]
Message-ID: <87o8520wvd.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CANaxB-xpQr1mUUvWK5a53q49VK_HvR4Pws_NGKGa8-jihxkc_A@mail.gmail.com> (Andrei Vagin's message of "Mon, 27 Dec 2021 08:49:38 -0800")
* Andrei Vagin:
>> diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c
>> index fd2ee9408e91..8eb3bcf2cedf 100644
>> --- a/arch/x86/entry/vsyscall/vsyscall_64.c
>> +++ b/arch/x86/entry/vsyscall/vsyscall_64.c
>> @@ -174,6 +174,12 @@ bool emulate_vsyscall(unsigned long error_code,
>>
>> tsk = current;
>>
>> + if (tsk->mm->context.vsyscall_disabled) {
>> + warn_bad_vsyscall(KERN_WARNING, regs,
>> + "vsyscall after lockout (exploit attempt?)");
>
> I don't think that we need this warning message. If we disable
> vsyscall, its address range is not differ from other addresses around
> and has to be handled the same way. For example, gVisor or any other
> sandbox engines may want to emulate vsyscall, but the kernel log will
> be full of such messages.
But with vsyscall=none, such messages are already printed. That's why I
added the warning for the lockout case as well.
>> diff --git a/tools/testing/selftests/x86/vsyscall_control.c b/tools/testing/selftests/x86/vsyscall_control.c
>> new file mode 100644
>> index 000000000000..ee966f936c89
>> --- /dev/null
>> +++ b/tools/testing/selftests/x86/vsyscall_control.c
>
> I would move the test in a separate patch...
I can do that if it simplifies matters.
Thanks,
Florian
prev parent reply other threads:[~2021-12-27 17:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 18:50 [PATCH v2] x86: Implement arch_prctl(ARCH_VSYSCALL_CONTROL) to disable vsyscall Florian Weimer
2021-12-27 16:49 ` Andrei Vagin
2021-12-27 17:40 ` Florian Weimer [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=87o8520wvd.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=avagin@gmail.com \
--cc=dave.hansen@intel.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-x86_64@vger.kernel.org \
--cc=luto@kernel.org \
--cc=musl@lists.openwall.com \
--cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.