From: Catalin Marinas <catalin.marinas@arm.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
mingo <mingo@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mm/kasan: map KASAN zero page read only
Date: Thu, 7 Jan 2016 09:51:28 +0000 [thread overview]
Message-ID: <20160107095127.GQ6301@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAKv+Gu9b_2WWYhgQmdnAUk0G0W3dwWXdWmpEmMtKW+=-KaJYgw@mail.gmail.com>
On Wed, Jan 06, 2016 at 09:18:03PM +0100, Ard Biesheuvel wrote:
> On 6 January 2016 at 20:48, Andrey Ryabinin <ryabinin.a.a@gmail.com> wrote:
> > 2016-01-06 18:54 GMT+03:00 Ard Biesheuvel <ard.biesheuvel@linaro.org>:
> >> The original x86_64-only version of KASAN mapped its zero page
> >> read-only, but this got lost when the code was generalised and
> >> ported to arm64, since, at the time, the PAGE_KERNEL_RO define
> >> did not exist. It has been added to arm64 in the mean time, so
> >> let's use it.
> >>
> >
> > Read-only wasn't lost. Just look at the next line:
> > zero_pte = pte_wrprotect(zero_pte);
> >
> > PAGE_KERNEL_RO is not available on all architectures, thus it would be better
> > to not use it in generic code.
>
> OK, I didn't see that. For some reason, it is not working for me on
> arm64, though.
It's because the arm64 set_pte_at() doesn't bother checking for
!PTE_WRITE to set PTE_RDONLY when mapping kernel pages. It works fine
for user though. That's because usually all read-only kernel mappings
already have PTE_RDONLY set via PAGE_KERNEL_RO.
We may need to change the set_pte_at logic a bit to cover the above
case.
--
Catalin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-01-07 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 15:54 Ard Biesheuvel
2016-01-06 19:48 ` Andrey Ryabinin
2016-01-06 20:18 ` Ard Biesheuvel
2016-01-07 9:51 ` Catalin Marinas [this message]
2016-01-07 10:01 ` Ard Biesheuvel
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=20160107095127.GQ6301@e104818-lin.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=ryabinin.a.a@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