From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] arm64: mm: Mark .rodata as RO
Date: Wed, 17 Feb 2016 17:02:47 +0000 [thread overview]
Message-ID: <20160217170246.GF32647@leverpostej> (raw)
In-Reply-To: <CAKv+Gu-TgwNHEeqe3+H1ork5N-pVROTrJ4FPzUBvUGo-Z9RehA@mail.gmail.com>
On Wed, Feb 17, 2016 at 05:55:57PM +0100, Ard Biesheuvel wrote:
> On 17 February 2016 at 17:54, Jeremy Linton <jeremy.linton@arm.com> wrote:
> > On 02/17/2016 10:46 AM, Ard Biesheuvel wrote:
> >>
> >> On 17 February 2016 at 17:41, Jeremy Linton <jeremy.linton@arm.com> wrote:
> >>>
> >>> Currently the .rodata section is actually still executable when
> >>> DEBUG_RODATA
> >>> is enabled. This changes that so the .rodata is actually read only, no
> >>> execute.
> >>>
> > (trimming)
> >>>
> >>>
> >>> - map_kernel_chunk(pgd, _stext, _etext, PAGE_KERNEL_EXEC);
> >>> + map_kernel_chunk(pgd, _stext, __start_rodata, PAGE_KERNEL_EXEC);
> >>> + map_kernel_chunk(pgd, __start_rodata, _etext, PAGE_KERNEL_EXEC);
> >>
> >>
> >> Couldn't we map this non-exec from the start?
> >
> >
> > Probably, Mark suggested that, but Kees seemed to have reasons not to.
> > Either way, my opinion is that for that change to make sense we also need to
> > always enable the functionality turned on by DEBUG_RODATA.
> >
>
> Actually, I think that was about mapping read-only, not non-exec. For
> text patching and Kees's __ro_after_init stuff, the region would need
> to be writable early on. But I don't think there is a reason to make
> it executable.
Yup, we should be able to make it PAGE_KERNEL here, even if we can't
make it PAGE_KERNEL_RO.
Mark.
next prev parent reply other threads:[~2016-02-17 17:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 16:41 [PATCH v2 0/2] arm64: mm: Mark .rodata as RO Jeremy Linton
2016-02-17 16:41 ` [PATCH v2 1/2] " Jeremy Linton
2016-02-17 16:46 ` Ard Biesheuvel
2016-02-17 16:54 ` Jeremy Linton
2016-02-17 16:55 ` Ard Biesheuvel
2016-02-17 17:02 ` Mark Rutland [this message]
2016-02-17 16:41 ` [PATCH v2 2/2] arm64/mm: Add .rodata to kernel virtual memory boot notice Jeremy Linton
2016-02-17 17:04 ` Mark Rutland
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=20160217170246.GF32647@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.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;
as well as URLs for NNTP newsgroup(s).