linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kasan-dev@googlegroups.com,
	aneesh.kumar@linux.ibm.com, bsingharora@gmail.com
Subject: Re: [PATCH v2 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support
Date: Fri, 13 Dec 2019 00:41:14 +1100	[thread overview]
Message-ID: <87tv65br0l.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <414293e0-3b75-8e78-90d8-2c14182f3739@c-s.fr>

Hi Christophe,

I think I've covered everything you've mentioned in the v3 I'm about to
send, except for:

>> +	/* mark early shadow region as RO and wipe */
>> +	pte = __pte(__pa(kasan_early_shadow_page) |
>> +		    pgprot_val(PAGE_KERNEL_RO) | _PAGE_PTE);
>
> Any reason for _PAGE_PTE being required here and not being included in 
> PAGE_KERNEL_RO ?

I'm not 100% sure quite what you mean here. I think you're asking: why
do we need to supply _PAGE_PTE here, shouldn't PAGE_KERNEL_RO set that
bit or cover that case?

_PAGE_PTE is defined by section 5.7.10.2 of Book III of ISA 3.0: bit 1
(linux bit 62) is 'Leaf (entry is a PTE)' I originally had this because
it was set in Balbir's original implementation, but the bit is also set
by pte_mkpte which is called in set_pte_at, so I also think it's right
to set it.

I don't know why it's not included in the permission classes; I suspect
it's because it's not conceptually a permission, it's set and cleared in
things like swp entry code.

Does that answer your question?

Regards,
Daniel

  reply	other threads:[~2019-12-12 13:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10  4:47 [PATCH v2 0/4] KASAN for powerpc64 radix, plus generic mm change Daniel Axtens
2019-12-10  4:47 ` [PATCH v2 1/4] mm: define MAX_PTRS_PER_{PTE,PMD,PUD} Daniel Axtens
2019-12-10  6:35   ` Christophe Leroy
2019-12-10  9:35   ` Balbir Singh
2019-12-10 10:39   ` kbuild test robot
2019-12-10  4:47 ` [PATCH v2 2/4] kasan: use MAX_PTRS_PER_* for early shadow Daniel Axtens
2019-12-10  6:40   ` Christophe Leroy
2019-12-10  9:36   ` Balbir Singh
2019-12-10 14:39     ` Christophe Leroy
2019-12-10  4:47 ` [PATCH v2 3/4] kasan: Document support on 32-bit powerpc Daniel Axtens
2019-12-10  6:40   ` Christophe Leroy
2019-12-10  4:47 ` [PATCH v2 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support Daniel Axtens
2019-12-10  7:21   ` Christophe Leroy
2019-12-12 13:41     ` Daniel Axtens [this message]
2019-12-10 10:57   ` Balbir Singh
2019-12-11  5:21     ` Daniel Axtens
2019-12-11  8:57       ` Balbir Singh
2019-12-11 14:24         ` Daniel Axtens
2019-12-12  7:42           ` Balbir Singh
2019-12-12  9:38             ` Christophe Leroy
2019-12-12  9:56           ` Andrey Ryabinin
2019-12-10 11:20   ` kbuild test robot

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=87tv65br0l.fsf@dja-thinkpad.axtens.net \
    --to=dja@axtens.net \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=bsingharora@gmail.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=linuxppc-dev@lists.ozlabs.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).