lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu9109GjRqdVZBKckuEkj261gzW=RQGXHjP19TXDAC_cBw@mail.gmail.com>
Date:	Fri, 27 Nov 2015 11:39:09 +0100
From:	Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:	Will Deacon <will.deacon@....com>
Cc:	Catalin Marinas <catalin.marinas@....com>,
	Andrey Ryabinin <aryabinin@...tuozzo.com>,
	Mark Rutland <mark.rutland@....com>,
	Yury <yury.norov@...il.com>, Arnd Bergmann <arnd@...db.de>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	"Suzuki K. Poulose" <Suzuki.Poulose@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Alexey Klimov <klimov.linux@...il.com>,
	Alexander Potapenko <glider@...gle.com>,
	Dmitry Vyukov <dvyukov@...gle.com>,
	David Keitel <dkeitel@...eaurora.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH RFT] arm64: kasan: Make KASAN work with 16K pages + 48 bit VA

On 27 November 2015 at 11:02, Will Deacon <will.deacon@....com> wrote:
> On Fri, Nov 27, 2015 at 09:35:29AM +0000, Catalin Marinas wrote:
>> On Fri, Nov 27, 2015 at 11:12:28AM +0300, Andrey Ryabinin wrote:
>> > On 11/26/2015 07:40 PM, Ard Biesheuvel wrote:
>> > > On 26 November 2015 at 14:14, Andrey Ryabinin <aryabinin@...tuozzo.com> wrote:
>> > >> Currently kasan assumes that shadow memory covers one or more entire PGDs.
>> > >> That's not true for 16K pages + 48bit VA space, where PGDIR_SIZE is bigger
>> > >> than the whole shadow memory.
>> > >>
>> > >> This patch tries to fix that case.
>> > >> clear_page_tables() is a new replacement of clear_pgs(). Instead of always
>> > >> clearing pgds it clears top level page table entries that entirely belongs
>> > >> to shadow memory.
>> > >> In addition to 'tmp_pg_dir' we now have 'tmp_pud' which is used to store
>> > >> puds that now might be cleared by clear_page_tables.
>> > >>
>> > >> Reported-by: Suzuki K. Poulose <Suzuki.Poulose@....com>
>> > >> Signed-off-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
>> > >
>> > > I would argue that the Kasan code is complicated enough, and we should
>> > > avoid complicating it even further for a configuration that is highly
>> > > theoretical in nature.
>> > >
>> > > In a 16k configuration, the 4th level only adds a single bit of VA
>> > > space (which is, as I understand it, exactly the issue you need to
>> > > address here since the top level page table has only 2 entries and
>> > > hence does not divide by 8 cleanly), which means you are better off
>> > > using 3 levels unless you *really* need more than 128 TB of VA space.
>> > >
>> > > So can't we just live with the limitation, and keep the current code?
>> >
>> > No objections from my side. Let's keep the current code.
>>
>> Ard had a good point, so fine by me as well.
>
> Ok, so obvious follow-up question: why do we even support 48-bit + 16k
> pages in the kernel? Either it's useful, and we make things work with it,
> or it's not and we can drop it (or, at least, hide it behind EXPERT like
> we do for 36-bit).
>

So there's 10 kinds of features in the world, useful ones and !useful ones? :-)

I think 48-bit/16k is somewhat useful, and I think we should support
it. But I also think we should be pragmatic, and not go out of our way
to support the combinatorial expansion of all niche features enabled
together. I think it is perfectly fine to limit kasan support to
configurations whose top level translation table divides by 8 cleanly
(which only excludes 16k/48-bit anyway)

However, I think it deserves being hidden behind CONFIG_EXPERT more
than 36-bit/16k does.

-- 
Ard.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ