CONFIG_CRASH_DM_CRYPT has been introduced to support LUKS-encrypted
device dump target by addressing two challenges [1],
- Kdump kernel may not be able to decrypt the LUKS partition. For some
machines, a system administrator may not have a chance to enter the
password to decrypt the device in kdump initramfs after the 1st kernel
crashes
- LUKS2 by default use the memory-hard Argon2 key derivation function
which is quite memory-consuming compared to the limited memory reserved
for kdump.
To also enable this feature for ARM64 and PowerPC, we only need to add a
device tree property dmcryptkeys [2] as similar to elfcorehdr to pass the
memory address of the stored info of dm-crypt keys to the kdump kernel.
[1] https://lore.kernel.org/all/20250502011246.99238-1-coxu@redhat.com/
[2] https://github.com/devicetree-org/dt-schema/pull/181
v4
- Make arch-specific code more succinct by printing more logs in
arch-independent code [Will Deacon]
- Also use device tree for PowerPC to pass memory address of dm-crypt
keys info
- powerpc v2 patch that passes the dmcryptkeys kernel cmdline
parameter:
https://lore.kernel.org/all/20260106074039.564707-1-coxu@redhat.com/
v3
- Delete the property after reading it [Rob Herring]
v2
- Krzysztof
- Use imperative mood for commit message
- Add dt-schema ABI Documentation
https://github.com/devicetree-org/dt-schema/pull/181
- Don't print dm-crypt keys address via pr_debug
Coiby Xu (2):
crash_dump/dm-crypt: Don't print in arch-specific code
arm64,ppc64le/kdump: pass dm-crypt keys to kdump kernel
arch/arm64/kernel/machine_kexec_file.c | 4 ++++
arch/powerpc/kexec/elf_64.c | 4 ++++
arch/x86/kernel/kexec-bzimage64.c | 6 +-----
drivers/of/fdt.c | 21 +++++++++++++++++++++
drivers/of/kexec.c | 19 +++++++++++++++++++
kernel/crash_dump_dm_crypt.c | 7 +++++--
6 files changed, 54 insertions(+), 7 deletions(-)
base-commit: 2619c62b7ef2f463bcbbb34af122689c09855c23
--
2.53.0
When the vmcore dumping target is not a LUKS-encrypted target, it's
expected that there is no dm-crypt key thus no need to return -ENOENT.
Also print more logs in crash_load_dm_crypt_keys. The benefit is
arch-specific code can be more succinct.
Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Coiby Xu <redacted>
---
arch/x86/kernel/kexec-bzimage64.c | 6 +-----
kernel/crash_dump_dm_crypt.c | 7 +++++--
2 files changed, 6 insertions(+), 7 deletions(-)
CONFIG_CRASH_DM_CRYPT has been introduced to support LUKS-encrypted
device dump target by addressing two challenges [1],
- Kdump kernel may not be able to decrypt the LUKS partition. For some
machines, a system administrator may not have a chance to enter the
password to decrypt the device in kdump initramfs after the 1st kernel
crashes
- LUKS2 by default use the memory-hard Argon2 key derivation function
which is quite memory-consuming compared to the limited memory reserved
for kdump.
To also enable this feature for ARM64 and PowerPC, we only need to add
a device tree property dmcryptkeys [2] as similar to elfcorehdr to pass
the memory address of the stored info of dm-crypt keys to the kdump
kernel. Since this property is only needed by the kdump kernel, it won't
be exposed to user space.
[1] https://lore.kernel.org/all/20250502011246.99238-1-coxu@redhat.com/
[2] https://github.com/devicetree-org/dt-schema/pull/181
Cc: Arnaud Lefebvre <redacted>
Cc: Baoquan he <redacted>
Cc: Dave Young <redacted>
Cc: Kairui Song <redacted>
Cc: Pingfan Liu <redacted>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Thomas Staudt <redacted>
Cc: Sourabh Jain <redacted>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Coiby Xu <redacted>
---
arch/arm64/kernel/machine_kexec_file.c | 4 ++++
arch/powerpc/kexec/elf_64.c | 4 ++++
drivers/of/fdt.c | 21 +++++++++++++++++++++
drivers/of/kexec.c | 19 +++++++++++++++++++
4 files changed, 48 insertions(+)
CONFIG_CRASH_DM_CRYPT has been introduced to support LUKS-encrypted
device dump target by addressing two challenges [1],
- Kdump kernel may not be able to decrypt the LUKS partition. For some
machines, a system administrator may not have a chance to enter the
password to decrypt the device in kdump initramfs after the 1st kernel
crashes
- LUKS2 by default use the memory-hard Argon2 key derivation function
which is quite memory-consuming compared to the limited memory reserved
for kdump.
To also enable this feature for ARM64 and PowerPC, we only need to add
On Wed, Feb 11, 2026 at 10:55:17AM +0100, Christophe Leroy (CS GROUP) wrote:
Le 11/02/2026 à 09:24, Coiby Xu a écrit :
quoted
CONFIG_CRASH_DM_CRYPT has been introduced to support LUKS-encrypted
device dump target by addressing two challenges [1],
- Kdump kernel may not be able to decrypt the LUKS partition. For some
machines, a system administrator may not have a chance to enter the
password to decrypt the device in kdump initramfs after the 1st kernel
crashes
- LUKS2 by default use the memory-hard Argon2 key derivation function
which is quite memory-consuming compared to the limited memory reserved
for kdump.
To also enable this feature for ARM64 and PowerPC, we only need to add
What do you want to say exactly with 'only' ?
Hi Christophe,
Thanks for raising the question! To clarify, CONFIG_CRASH_DM_CRYPT
provides the framework to address these challenges for LUKS-encrypted
dump target. Since the heavy lifting is handled in the arch-independent
code, we only need to...
If it looks good to you, I'll rephrase it as "To also enable this
feature for ARM64 and PowerPC, the missing piece is to let the kdump
kernel know where to find the dm-crypt keys which are randomly stored in
memory reserved for kdump. I'll introduce a new device tree property
dmcryptkeys ...".
@@ -866,6 +866,26 @@ static void __init early_init_dt_check_for_elfcorehdr(unsigned long node)elfcorehdr_addr,elfcorehdr_size);}+staticvoid__initearly_init_dt_check_for_dmcryptkeys(unsignedlongnode)+{+constchar*prop_name="linux,dmcryptkeys";+const__be32*prop;++if(!IS_ENABLED(CONFIG_CRASH_DM_CRYPT))+return;++pr_debug("Looking for dmcryptkeys property... ");++prop=of_get_flat_dt_prop(node,prop_name,NULL);+if(!prop)+return;++dm_crypt_keys_addr=dt_mem_next_cell(dt_root_addr_cells,&prop);++/* Property only accessible to crash dump kernel */+fdt_delprop(initial_boot_params,node,prop_name);
Shouldn't this property be deleted regardless of whether kernel is
built with CONFIG_CRASH_DM_CRYPT or without ?
This property will be created only if 1) CONFIG_CRASH_DM_CRYPT is
enabled and 2) the dump target is LUKS-encrypted. So there is no need to
delete it if it doesn't exist at all.
quoted
+}
+
static unsigned long chosen_node_offset = -FDT_ERR_NOTFOUND;
/*
@@ -1097,6 +1117,7 @@ int __init early_init_dt_scan_chosen(char *cmdline) early_init_dt_check_for_initrd(node); early_init_dt_check_for_elfcorehdr(node);+ early_init_dt_check_for_dmcryptkeys(node); rng_seed = of_get_flat_dt_prop(node, "rng-seed", &l); if (rng_seed && l > 0) {