From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "lstoakes@gmail.com" <lstoakes@gmail.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"hch@infradead.org" <hch@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"urezki@gmail.com" <urezki@gmail.com>,
"ycliang@andestech.com" <ycliang@andestech.com>
Cc: "patrick@andestech.com" <patrick@andestech.com>
Subject: Re: [RFC PATCH 1/1] mm/vmalloc: Modify permission reset procedure to avoid invalid access
Date: Tue, 11 Jun 2024 14:21:42 +0000 [thread overview]
Message-ID: <5e603eedf9e8fbd6efe1d118706dd82666e54251.camel@intel.com> (raw)
In-Reply-To: <20240611131301.2988047-1-ycliang@andestech.com>
On Tue, 2024-06-11 at 21:13 +0800, Leo Yu-Chi Liang wrote:
> The previous reset procedure is
> 1. Set direct map attribute to invalid
> 2. Flush TLB
> 3. Reset direct map attribute to default
>
> It is possible that kernel forks another process
> on another core that access the invalid mappings after
> sync_kernel_mappings.
>
> We could reproduce this scenario by running LTP/bpf_prog
> multiple times on RV32 kernel on QEMU.
>
> Therefore, the following procedure is proposed
> to avoid mappings being invalid.
> 1. Reset direct map attribute to default
> 2. Flush TLB
Can you explain more about what is happening in this scenario? Looking briefly,
riscv is doing something unique around sync_kernel_mappings(). If a RO mapping
is copied instead of a NP/invalid mapping, how is the problem avoided?
next parent reply other threads:[~2024-06-11 14:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240611131301.2988047-1-ycliang@andestech.com>
2024-06-11 14:21 ` Edgecombe, Rick P [this message]
2024-06-18 12:08 ` Leo Liang
2024-06-18 16:08 ` Edgecombe, Rick P
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=5e603eedf9e8fbd6efe1d118706dd82666e54251.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=akpm@linux-foundation.org \
--cc=bpf@vger.kernel.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lstoakes@gmail.com \
--cc=patrick@andestech.com \
--cc=urezki@gmail.com \
--cc=ycliang@andestech.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