Linux Documentation
 help / color / mirror / Atom feed
From: "Jan Sebastian Götte" <contact@jaseg.de>
To: "Baoquan He" <baoquan.he@linux.dev>,
	"Jan Sebastian Götte" <linux@jaseg.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mike Rapoport <rppt@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Dave Young <ruirui.yang@linux.dev>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	David Howells <dhowells@redhat.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Lukas Wunner <lukas@wunner.de>, Ignat Korchagin <ignat@linux.win>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	Mimi Zohar <zohar@linux.ibm.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Marc Dionne <marc.dionne@auristor.com>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Eric Biggers <ebiggers@kernel.org>,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
	keyrings@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-crypto@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-nfs@vger.kernel.org, linux-integrity@vger.kernel.org,
	linux-afs@lists.infradead.org, netdev@vger.kernel.org,
	linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	dm-devel@lists.linux.dev
Subject: Re: [PATCH v2 01/13] kexec: add CRASH_WIPE_SECRETS to wipe secrets before kdump
Date: Wed, 12 Aug 2026 12:08:39 +0200	[thread overview]
Message-ID: <9765f7ea-36bb-4c7b-a19b-7facec97b762@jaseg.de> (raw)
In-Reply-To: <anw9ILJiO5xIjP4f@MiWiFi-R3L-srv>

On 8/12/26 11:30, Baoquan He wrote:
> On 08/11/26 at 07:52pm, Jan Sebastian Götte wrote:
> .....snip...
>> @@ -142,6 +170,7 @@ void __noclone __crash_kexec(struct pt_regs *regs)
>>   			crash_save_vmcoreinfo();
>>   			machine_crash_shutdown(&fixed_regs);
>>   			crash_cma_clear_pending_dma();
>> +			crash_wipe_secrets();
> 
> I remember when crash_cma added this, we argued a lot about the risk,
> finally it's added in with an added note to tell it's an opt-in feature
> and risky. I don't know if it opens a Pandora box, I think anything
> wanted being here need prove anything else has been tried, and the thing
> is very very important. If we don't guard the door well, one day one guy
> cold come and said I need ask Oracle database to do some transactions
> before juming into kdump kernel because the actions will save billions
> of dollar.

I see your point.

> And what does security people say about this wiping? Is it very
> important information and wiping is mandotary? There's no any other way
> to wipe it or pollute it, no way in kdump kernel?

I'm doing both - my kdump kernel does a linear memzero of all of DRAM. 
However, that's too slow - it takes several hundred milliseconds, and I 
want these cryptographic keys gone within no more than 10 ms.

Doing this in the original kernel is cleanest I think, because to do a 
targeted erase in the kdump kernel, that kernel would have to know all 
the original kernel's symbols, and it would have to forensically 
reconstruct it's memory content similar to the crash utility. I think 
that's too complex and error-prone to do in this use case.

I can imagine one alternative way to approach this, tell me what you 
think: Instead of registering wipe handlers that memzero places on 
panic, I could put an optional registry of (addr, len) descriptors into 
crashkernel memory that the original kernel populates with the PAs of 
buffers to clear ahead of time. Then the kdump kernel could do the 
actual memzero. This would remove all code from the actual kdump path 
here. The registry could be made per-core to avoid locks.

> I noticed it's
> happening on en embedded target, is it possible you do this on your
> embedded kernel tree, but not mainline tree?

I could keep it in a vendor tree, but I think the functionality is 
useful beyond my particular use case.

  reply	other threads:[~2026-08-12 10:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 17:52 [PATCH v2 00/13] CRASH_WIPE_SECRETS: Wipe secrets before kdump (was: CRASH_ZEROIZE) Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 01/13] kexec: add CRASH_WIPE_SECRETS to wipe secrets before kdump Jan Sebastian Götte
2026-08-12  9:30   ` Baoquan He
2026-08-12 10:08     ` Jan Sebastian Götte [this message]
2026-08-11 17:52 ` [PATCH v2 02/13] crash-core: Flush caches on CRASH_WIPE_SECRETS Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 03/13] arm64/mm: add set_direct_map_default_nosplit() Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 04/13] mm/secretmem: wipe secret pages before kdump Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 05/13] security/keys: wipe key payloads " Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 06/13] security/keys: implement wipe op for user-type keys Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 07/13] security/keys: implement wipe op for big_key Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 08/13] security/keys: implement wipe op for trusted and encrypted keys Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 09/13] security/keys: implement wipe op for asymmetric keys Jan Sebastian Götte
2026-08-11 17:52 ` [PATCH v2 10/13] rxrpc: implement wipe op for rxrpc keys Jan Sebastian Götte
2026-08-11 17:53 ` [PATCH v2 11/13] fscrypt: wipe master keys before kdump Jan Sebastian Götte
2026-08-11 17:53 ` [PATCH v2 12/13] crypto: api - wipe tfm contexts " Jan Sebastian Götte
2026-08-11 17:53 ` [PATCH v2 13/13] dm crypt: wipe key material " Jan Sebastian Götte
2026-08-11 20:18   ` Milan Broz
2026-08-12  9:56     ` Jan Sebastian Götte
2026-08-11 18:20 ` [PATCH v2 00/13] CRASH_WIPE_SECRETS: Wipe secrets before kdump (was: CRASH_ZEROIZE) Eric Biggers
2026-08-11 19:38   ` Jan Sebastian Götte
2026-08-11 20:41     ` Eric Biggers

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=9765f7ea-36bb-4c7b-a19b-7facec97b762@jaseg.de \
    --to=contact@jaseg.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=anna@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=baoquan.he@linux.dev \
    --cc=bmarzins@redhat.com \
    --cc=brauner@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=ebiggers@kernel.org \
    --cc=edumazet@google.com \
    --cc=hch@lst.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=ignat@linux.win \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=jarkko@kernel.org \
    --cc=jmorris@namei.org \
    --cc=kbusch@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=keyrings@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux@jaseg.de \
    --cc=lukas@wunner.de \
    --cc=marc.dionne@auristor.com \
    --cc=mpatocka@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=paul@paul-moore.com \
    --cc=pratyush@kernel.org \
    --cc=rppt@kernel.org \
    --cc=ruirui.yang@linux.dev \
    --cc=sagi@grimberg.me \
    --cc=serge@hallyn.com \
    --cc=skhan@linuxfoundation.org \
    --cc=snitzer@kernel.org \
    --cc=trondmy@kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=will@kernel.org \
    --cc=zohar@linux.ibm.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