[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <f36f19ee-5bff-4cd0-b9a9-0fe987cf6d38@app.fastmail.com>
Date: Fri, 06 Jan 2023 12:53:41 -0800
From: "Andy Lutomirski" <luto@...nel.org>
To: "Linus Torvalds" <torvalds@...ux-foundation.org>,
"Jason A. Donenfeld" <Jason@...c4.com>
Cc: "Yann Droneaud" <ydroneaud@...eya.com>,
"Ingo Molnar" <mingo@...nel.org>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
patches@...ts.linux.dev, "Thomas Gleixner" <tglx@...utronix.de>,
"Linux Crypto Mailing List" <linux-crypto@...r.kernel.org>,
"Linux API" <linux-api@...r.kernel.org>,
"the arch/x86 maintainers" <x86@...nel.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Adhemerval Zanella Netto" <adhemerval.zanella@...aro.org>,
"Carlos O'Donell" <carlos@...hat.com>,
"Florian Weimer" <fweimer@...hat.com>,
"Arnd Bergmann" <arnd@...db.de>, "Jann Horn" <jannh@...gle.com>,
"Christian Brauner" <brauner@...nel.org>, linux-mm@...ck.org
Subject: Re: [PATCH v14 2/7] mm: add VM_DROPPABLE for designating always lazily
freeable mappings
On Thu, Jan 5, 2023, at 6:08 PM, Linus Torvalds wrote:
> On Thu, Jan 5, 2023 at 5:02 PM Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
>>
>> None of what you ask for is for any kind of real security, it's all
>> just crazy "but I want to feel the warm and fuzzies and take shortcuts
>> elsewhere, and push my pain onto other people".
>
> Actually, let me maybe soften that a bit and say that it's
> "convenience features". It might make some things more _convenient_ to
> do, exactly because it might allow other parts to do short-cuts.
>
> But because it's a convenience-feature, it had also better either be
> (a) really easy and clear to do in the kernel and (b) have
> sufficiently *wide* convenience so that it doesn't end up being one of
> those "corner case things we have to maintain forever and nobody
> uses".
>
> And I think VM_DROPPABLE matches (a), and would be fine if it had some
> other non-made-up use (although honestly, we should solve the 32-bit
> problem first - ignoring it isn't fine for anything that is supposed
> to be widely useful).
>
> We *have* talked about features kind of like it before, for people
> doing basically caches in user space that they can re-create on demand
> and are ok with just going away under memory pressure.
>
> But those people almost invariably want dropped pages to cause a
> SIGSEGV or SIGBUS, not to come back as zeroes.
>
> So you were insulting when you said kernel people don't care about
> security issues. And I'm just telling you that's not true, but it
> *is* 100% true that kernel people are often really fed up with
> security people who have their blinders on, focus on some small thing,
> and think nothing else ever matters.
>
> So yes, the way to get something like VM_DROPPABLE accepted is to
> remove the blinders, and have it be something more widely useful, and
> not be a "for made up bad code".
I'm going to suggest a very very different approach: fix secret storage in memory for real. That is, don't lock "super secret sensitive stuff" into memory, and don't wipe it either. *Encrypt* it.
This boils down to implementing proper encrypted swap support, which is not conceptually that difficult. The kernel already has identifiers (mapping, offset, etc) for every page in swap and already stores some metadata. Using that as part of a cryptographic operation seems conceptually fairly straightforward.
And a nice implementation of this could be on by default, and the kernel could even tell userspace that it's on, and then userspace could just stop worrying about this particular issue.
Powered by blists - more mailing lists