From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org, luto@kernel.org,
peterz@infradead.org
Subject: Re: [PATCH] x86/mpx: pass 'mm' to kernel_managing_mpx_tables() in mpx_notify_unmap()
Date: Mon, 3 Dec 2018 16:54:43 -0800 [thread overview]
Message-ID: <20181204005443.GA5164@linux.intel.com> (raw)
In-Reply-To: <933b60c9-ad26-a377-f4e2-a7dca4fdae30@intel.com>
On Mon, Dec 03, 2018 at 12:49:44PM -0800, Dave Hansen wrote:
> On 12/3/18 12:43 PM, Jarkko Sakkinen wrote:
> > If mm is not the same as current->mm, mpx_notify_unmap() will yield
> > invalid results and at worst will lead to a crash if it gets called by
> > a kthread.
>
> It's also worth noting that this does not fix any actual,
> end-user-visible bug today. It really only prepares the code for the
> case where it is called for a different mm than current->mm.
>
> > --- a/arch/x86/mm/mpx.c
> > +++ b/arch/x86/mm/mpx.c
> > @@ -882,7 +882,7 @@ static int mpx_unmap_tables(struct mm_struct *mm,
> > * necessary, and the 'vma' is the first vma in this range (start -> end).
> > */
> > void mpx_notify_unmap(struct mm_struct *mm, struct vm_area_struct *vma,
> > - unsigned long start, unsigned long end)
> > + unsigned long start, unsigned long end)
> > {
> > int ret;
>
> Please leave superfluous whitespace changes out of these things.
>
> But, otherwise, this looks fine.
>
> > Fixes: 1de4fa14ee25 ("x86, mpx: Cleanup unused bound tables")
>
> FWIW, I'm not sure you should be submitting this separately from your
> SGX series. The deferred unmapping is really the thing that requires
> the code to be changed.
Thank you for the feedback. I'll include this to the next revision of the
SGX patch set and explain why the change is needed.
/Jarkko
prev parent reply other threads:[~2018-12-04 0:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 20:43 [PATCH] x86/mpx: pass 'mm' to kernel_managing_mpx_tables() in mpx_notify_unmap() Jarkko Sakkinen
2018-12-03 20:49 ` Dave Hansen
2018-12-04 0:54 ` Jarkko Sakkinen [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=20181204005443.GA5164@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--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 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).