bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hou Tao <houtao@huaweicloud.com>
To: Sohil Mehta <sohil.mehta@intel.com>, x86@kernel.org, bpf@vger.kernel.org
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H . Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, xingwei lee <xrivendell7@gmail.com>,
	Jann Horn <jannh@google.com>,
	houtao1@huawei.com
Subject: Re: [PATCH bpf 3/3] selftest/bpf: Test the read of vsyscall page under x86-64
Date: Thu, 25 Jan 2024 15:54:21 +0800	[thread overview]
Message-ID: <01ce6947-8b46-9e27-6ce2-ce5763e3c5a9@huaweicloud.com> (raw)
In-Reply-To: <1c260ab1-d4c0-48e6-bf2b-df69bf083d27@intel.com>



On 1/23/2024 8:25 AM, Sohil Mehta wrote:
> On 1/18/2024 11:30 PM, Hou Tao wrote:
>
>> vsyscall page could be disabled by CONFIG_LEGACY_VSYSCALL_NONE or
>> vsyscall=none boot cmd-line, but it doesn't affect the reproduce of the
>> problem and the returned error codes.
>>
> With vsyscall=emulate a direct read of the vsyscall address from
> userspace is expected to go through. This is mode deprecated so maybe it
> wouldn't matter much. Without the fix in patch 2/3, do you see the same
> behavior with vsyscall=emulate set in the cmdline?

Er, I think it depends on whether or not SMAP [1] feature is available.
When SMAP feature is enabled, even the vsyscall page is populated,
reading the vsyscall page through bpf_read_kernel() will trigger a page
fault and then oops. But when there is not SMAP, bpf_read_kernel() will
succeed. So I think the test may need to be skipped if vsyscall_mode is
emulate.

[1]: https://en.wikipedia.org/wiki/Supervisor_Mode_Access_Prevention
>
> Sohil


      reply	other threads:[~2024-01-25  7:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19  7:30 [PATCH bpf 0/3] Fix the read of vsyscall page through bpf Hou Tao
2024-01-19  7:30 ` [PATCH bpf 1/3] x86/mm: Move is_vsyscall_vaddr() into mm_internal.h Hou Tao
2024-01-20  0:35   ` Sohil Mehta
2024-01-20  1:29     ` Hou Tao
2024-01-19  7:30 ` [PATCH bpf 2/3] x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() Hou Tao
2024-01-23  0:18   ` Sohil Mehta
2024-01-25  7:18     ` Hou Tao
2024-01-19  7:30 ` [PATCH bpf 3/3] selftest/bpf: Test the read of vsyscall page under x86-64 Hou Tao
2024-01-22  6:30   ` Yonghong Song
2024-01-25  6:37     ` Hou Tao
2024-01-23  0:25   ` Sohil Mehta
2024-01-25  7:54     ` Hou Tao [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=01ce6947-8b46-9e27-6ce2-ce5763e3c5a9@huaweicloud.com \
    --to=houtao@huaweicloud.com \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=houtao1@huawei.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sohil.mehta@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xrivendell7@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).