From: Audra Mitchell <audra@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, raquini@redhat.com, aris@redhat.com,
akpm@linux-foundation.org, william.kucharski@oracle.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Stop PMD alignment for PIE shared objects
Date: Thu, 19 Dec 2024 16:59:46 -0500 [thread overview]
Message-ID: <Z2SXUhRog7Bak5F_@fedora> (raw)
In-Reply-To: <Z2SQkrldCVDiTeia@casper.infradead.org>
On Thu, Dec 19, 2024 at 09:30:58PM +0000, Matthew Wilcox wrote:
> On Thu, Dec 19, 2024 at 04:15:52PM -0500, Audra Mitchell wrote:
> > After commit 1854bc6e2420 ("mm/readahead: Align file mappings for non-DAX")
> > any request through thp_get_unmapped_area would align to a PMD_SIZE,
> > causing shared objects to have less randomization than previously (9 less
> > bits for 2MB PMDs). As these lower 9 bits are the most impactful for
> > ASLR, this change could be argued to have an impact on security.
>
> Yes, very tiresome people have been making that argument for a long
> time. Do you have anything further to add to the discussion that
> happened here:
>
> https://lore.kernel.org/linux-mm/20240118133504.2910955-1-shy828301@gmail.com/
>
> particularly in light of 3afb76a66b55 existing.
Hey all,
Happy Holidays! I was not aware of this discussion, so thank you for bringing
it to my attention. I've read over it and I'll take a closer look after the
holidays.
Respectfully, I'm trying to understand your view of this problem given your
feedback - can you clarify for me what you mean by "particularly in light
of" regarding 3afb76a66b55... it looks to me like this was reverted with
14d7c92f8df9 and there does appear to be some room for improvement for this
topic based on linus' commit message there.
I did play around with the idea of checking to see if kaslr was enabled and
only doing the return in that case, as users then could opt-in to the
solution or not..
Thanks in advance for your insight!
> > Fix this issue by checking that the request is aligned to the PMD_SIZE,
> > otherwise fall back to mm_get_unmapped_area_vmflags().
>
> NAK this version anyway. Even if the executable is, say, 2.1MB in size,
> we still want the first 2MB of the file to be covered with a PMD
> mapping.
>
next prev parent reply other threads:[~2024-12-19 21:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 21:15 Audra Mitchell
2024-12-19 21:30 ` Matthew Wilcox
2024-12-19 21:59 ` Audra Mitchell [this message]
2024-12-20 18:20 ` Rafael Aquini
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=Z2SXUhRog7Bak5F_@fedora \
--to=audra@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aris@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=raquini@redhat.com \
--cc=william.kucharski@oracle.com \
--cc=willy@infradead.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