Skip to contentSkip to conversation

Support kdump with LUKS encryption by reusing LUKS volume key

RFC In review Coiby Xu 3 participants 9 messages Nov 4, 2022 – Feb 1, 2023

Subsystems (7)
lore
Share & tools
lore

Coiby Xu

author
#0 lore raw

v2 cover Support kdump with LUKS encryption by reusing LUKS volume key

RFC v2
- libcryptsetup interacts with the kernel via sysfs instead of "hacking" dm-crypt
- to save a kdump copy of the LUKS volume key in 1st kernel
- to add a logon key using the copy for libcryptsetup in kdump kernel [Milan]
- to avoid the incorrect usage of LUKS master key in dm-crypt [Milan]
- save the kdump copy of LUKS volume key randomly [Jan]
- mark the kdump copy inaccessible [Pingfan]
- Miscellaneous
- explain when operations related to the LUKS volume key happen [Jan]
- s/master key/volume key/g
- use crash_ instead of kexec_ as function prefix
- fix commit subject prefixes e.g. "x86, kdump" to x86/crash

With kdump enabled, when the 1st kernel crashes, the system could boot into the kdump/crash kernel and dump the memory image i.e. /proc/vmcore to a specified target. Currently, when dumping vmcore to a LUKS encrypted device, there are two problems,

- 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. Take Fedora example, by default, only 256M is reserved for systems having memory between 4G-64G. With LUKS enabled, ~1300M needs to be reserved for kdump. Note if the memory reserved for kdump can't be used by 1st kernel i.e. an user sees ~1300M memory missing in the 1st kernel.

Besides users (at least for Fedora) usually expect kdump to work out of the box i.e. no manual password input is needed. And it doesn't make sense to derivate the key again in kdump kernel which seems to be redundant work.

Based on Milan's feedback [1] on Kairui's ideas to support kdump with LUKS encryption, this patch set addresses the above issues by reusing the LUKS volume key in kdump kernel and here is the life cycle of this kdump copy of LUKS volume key,

1. After the 1st kernel loads the initramfs during boot, systemd asks for a passphrase from the user and uses it to de-crypt the LUKS volume key

2. After the 1st kernel saving the volume key as a logon key, libcrytpsetup notifies the kernel to read this logon key and store a temporary copy by writing the key description to /sys/kernel/crash_luks_volume_key

3. After switching to the real root fs, kdump.serivce is started and it loads the kdump kernel using the kexec_file_load syscall

4. The kexec_file_load syscall saves the temporary copy of the volume key to kdump reserved memory and wipe the copy.

5. When the 1st kernel crashes and kdump kernel is booted, libcryptsetup asks the kdump kernel to add a logon key using the volume key stored in kdump reserved memory by writing the key description to /sys/kernel/crash_luks_volume_key

6. The system gets rebooted to the 1st kernel after dumping vmcore to the LUKS encrypted device is finished

Note the kdump copy of LUKS volume key never leaves the kernel space and is saved in the memory area exclusively reserved for kdump where even the 1st kernel has no direct access.

Milan's major concern [2] on previous version is "storing the encryption key to yet another place are creating another attack vector". To further secure this copy, two additional protections are added,
- save the copy randomly in kdump reserved memory as suggested by Jan
- clear the _PAGE_PRESENT flag of the page that stores the copy as suggested by Pingfan

If there is no further security concern with this approach or any other concern, I will drop the following assumptions,
- only x86 is supported
- there is only one LUKS device for the system

to extend the support to other architectures including POWER, ARM and s390x and address the case of multiple LUKS devices. Any feedback will be appreciated, thanks!

For a proof of concept, I've patched cryptsetup [3] in a quick-and-dirty way to support a new option "--kdump-kernel-master-key"
and hacked systemd [4]. It works for Fedora 35.

[1] https://yhbt.net/lore/all/[email protected]/
[2] https://lwn.net/ml/linux-kernel/[email protected]/
[3] https://gitlab.com/coxu/cryptsetup/-/commit/750a46d933fac82e0c994b5c41de40a0b8cac647
[4] https://github.com/coiby/systemd/tree/reuse_kdump_master_key

Coiby Xu (5):
kexec_file: allow to place kexec_buf randomly
crash_dump: save the LUKS volume key temporarily x86/crash: pass the LUKS volume key to kdump kernel x86/crash: make the page that stores the LUKS volume key inaccessible
crash_dump: retrieve LUKS volume key in kdump kernel

 arch/x86/include/asm/crash.h       |   1 +
 arch/x86/kernel/crash.c            |  47 ++++++-
 arch/x86/kernel/kexec-bzimage64.c  |   7 +
 arch/x86/kernel/machine_kexec_64.c |  16 +++
 include/linux/crash_core.h         |   2 +
 include/linux/crash_dump.h         |   2 +
 include/linux/kexec.h              |   6 +
 kernel/crash_dump.c                | 200 +++++++++++++++++++++++++++++
 kernel/kexec_file.c                |  15 +++
 kernel/ksysfs.c                    |  19 +++
 10 files changed, 314 insertions(+), 1 deletion(-)
Signature · 1 line
2.37.3
author
#1 lore raw

RFC v2 1/5 kexec_file: allow to place kexec_buf randomly

Currently, kexec_buf is placed in order which means for the same machine, the info in the kexec_buf is always located at the same position each time the machine is booted. This may cause a risk for sensitive information like LUKS volume key. Now struct kexec_buf has a new field random which indicates it's supposed to be placed in a random position.

---
 include/linux/kexec.h |  2 ++
 kernel/kexec_file.c   | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
include/linux/kexec.h +2 -0
index 13e6c4b58f07..c0edb64bf6c4 100644
@@ -171,6 +171,7 @@ int kexec_image_post_load_cleanup_default(struct kimage *image);
  * @buf_min:	The buffer can't be placed below this address.
  * @buf_max:	The buffer can't be placed above this address.
  * @top_down:	Allocate from top of memory.
+ * @random:	Place the buffer at a random position.
  */
 struct kexec_buf {
 	struct kimage *image;
@@ -182,6 +183,7 @@ struct kexec_buf {
 	unsigned long buf_min;
 	unsigned long buf_max;
 	bool top_down;
+	bool random;
 };
 
 int kexec_load_purgatory(struct kimage *image, struct kexec_buf *kbuf);
kernel/kexec_file.c +15 -0
index a7b411c22f19..ed9fcc369312 100644
@@ -25,6 +25,7 @@
 #include <linux/elfcore.h>
 #include <linux/kernel.h>
 #include <linux/kernel_read_file.h>
+#include <linux/prandom.h>
 #include <linux/syscalls.h>
 #include <linux/vmalloc.h>
 #include "kexec_internal.h"
@@ -412,6 +413,16 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd,
 	return ret;
 }
 
+static unsigned long kexec_random_start(unsigned long start, unsigned long end)
+{
+	unsigned long temp_start;
+	unsigned short i;
+
+	get_random_bytes(&i, sizeof(unsigned short));
+	temp_start = start + (end - start) / USHRT_MAX * i;
+	return temp_start;
+}
+
 static int locate_mem_hole_top_down(unsigned long start, unsigned long end,
 				    struct kexec_buf *kbuf)
 {
@@ -420,6 +431,8 @@ static int locate_mem_hole_top_down(unsigned long start, unsigned long end,
 
 	temp_end = min(end, kbuf->buf_max);
 	temp_start = temp_end - kbuf->memsz;
+	if (kbuf->random)
+		temp_start = kexec_random_start(temp_start, temp_end);
 
 	do {
 		/* align down start */
@@ -457,6 +470,8 @@ static int locate_mem_hole_bottom_up(unsigned long start, unsigned long end,
 	unsigned long temp_start, temp_end;
 
 	temp_start = max(start, kbuf->buf_min);
+	if (kbuf->random)
+		temp_start = kexec_random_start(temp_start, end);
 
 	do {
 		temp_start = ALIGN(temp_start, kbuf->buf_align);
Signature · 1 line
2.37.3
author
#2 lore raw

RFC v2 2/5 crash_dump: save the LUKS volume key temporarily

In reply to Coiby Xu

After having the volume key, crytpsetup/systemd-cryptsetup saves the volume key as a logon key to its thread keyring and this key is destroyed immediately with the terminated thread. So a temporary copy of the volume key is needed in order to later save it to kdump reserved memory when the crash kernel is loaded later.

crytpsetup/systemd-cryptsetup will write the key description to /sys/kernel/crash_luks_volume_key so the kernel will read the logon key and save a temporary copy for later user. kdump has 1 hour at maximum to get the temporary copy before the key gets wiped. And after kdump retrieves the key, the key will be wiped immediately.

---
 include/linux/crash_core.h |  2 +
 kernel/crash_dump.c        | 88 ++++++++++++++++++++++++++++++++++++++
 kernel/ksysfs.c            | 19 ++++++++
 3 files changed, 109 insertions(+)
include/linux/crash_core.h +2 -0
index de62a722431e..596d83b8f362 100644
@@ -83,5 +83,7 @@ int parse_crashkernel_high(char *cmdline, unsigned long long system_ram,
 		unsigned long long *crash_size, unsigned long long *crash_base);
 int parse_crashkernel_low(char *cmdline, unsigned long long system_ram,
 		unsigned long long *crash_size, unsigned long long *crash_base);
+int crash_sysfs_luks_volume_key_write(const char *key_des, size_t count);
+int crash_pass_temp_luks_volume_key(void **addr, unsigned long *sz);
 
 #endif /* LINUX_CRASH_CORE_H */
kernel/crash_dump.c +88 -0

97 lines not on this page · raw message

kernel/ksysfs.c +19 -0
index b1292a57c2a5..e7a7433cb951 100644
@@ -135,6 +135,24 @@ static ssize_t vmcoreinfo_show(struct kobject *kobj,
 }
 KERNEL_ATTR_RO(vmcoreinfo);
 
+static ssize_t crash_luks_volume_key_show(struct kobject *kobj,
+					  struct kobj_attribute *attr,
+					  char *buf)
+{
+	return 0;
+}
+
+static ssize_t crash_luks_volume_key_store(struct kobject *kobj,
+					   struct kobj_attribute *attr,
+					   const char *buf, size_t count)
+{
+	int ret;
+
+	ret = crash_sysfs_luks_volume_key_write(buf, count);
+	return ret < 0 ? ret : count;
+}
+KERNEL_ATTR_RW(crash_luks_volume_key);
+
 #endif /* CONFIG_CRASH_CORE */
 
 /* whether file capabilities are enabled */
@@ -223,6 +241,7 @@ static struct attribute * kernel_attrs[] = {
 #endif
 #ifdef CONFIG_CRASH_CORE
 	&vmcoreinfo_attr.attr,
+	&crash_luks_volume_key_attr.attr,
 #endif
 #ifndef CONFIG_TINY_RCU
 	&rcu_expedited_attr.attr,
Signature · 1 line
2.37.3
author
#3 lore raw

RFC v2 3/5 x86/crash: pass the LUKS volume key to kdump kernel

In reply to Coiby Xu

1st kernel will build up the kernel command parameter luksvolumekey as similar to elfcorehdr to pass the memory address of the stored info of LUKS volume key to kdump kernel.

---
 arch/x86/include/asm/crash.h      |  1 +
 arch/x86/kernel/crash.c           | 47 ++++++++++++++++++++++++++++++-
 arch/x86/kernel/kexec-bzimage64.c |  7 +++++
 include/linux/kexec.h             |  4 +++
 4 files changed, 58 insertions(+), 1 deletion(-)
arch/x86/include/asm/crash.h +1 -0
index 8b6bd63530dc..485f75dce2ca 100644
@@ -4,6 +4,7 @@
 
 struct kimage;
 
+int crash_load_luks_volume_key(struct kimage *image);
 int crash_load_segments(struct kimage *image);
 int crash_setup_memmap_entries(struct kimage *image,
 		struct boot_params *params);
arch/x86/kernel/crash.c +46 -1

65 lines not on this page · raw message

arch/x86/kernel/kexec-bzimage64.c +7 -0
index f299b48f9c9f..e556dbf96695 100644
@@ -75,6 +75,10 @@ static int setup_cmdline(struct kimage *image, struct boot_params *params,
 	if (image->type == KEXEC_TYPE_CRASH) {
 		len = sprintf(cmdline_ptr,
 			"elfcorehdr=0x%lx ", image->elf_load_addr);
+
+		if (image->luks_volume_key_addr != 0)
+			len += sprintf(cmdline_ptr + len,
+					"luksvolumekey=0x%lx ", image->luks_volume_key_addr);
 	}
 	memcpy(cmdline_ptr + len, cmdline, cmdline_len);
 	cmdline_len += len;
@@ -371,6 +375,9 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
 		ret = crash_load_segments(image);
 		if (ret)
 			return ERR_PTR(ret);
+		ret = crash_load_luks_volume_key(image);
+		if (ret)
+			pr_debug("Either no LUKS volume key or error to retrieve the LUKS volume key\n");
 	}
 
 	/*
include/linux/kexec.h +4 -0
index c0edb64bf6c4..ed7a0ec70129 100644
@@ -385,6 +385,10 @@ struct kimage {
 	void *elf_headers;
 	unsigned long elf_headers_sz;
 	unsigned long elf_load_addr;
+
+	/* LUKS volume key buffer */
+	unsigned long luks_volume_key_addr;
+	unsigned long luks_volume_key_sz;
 };
 
 /* kexec interface functions */
Signature · 1 line
2.37.3
author
#4 lore raw

RFC v2 4/5 x86/crash: make the page that stores the LUKS volume key inaccessible

In reply to Coiby Xu

This adds an addition layer of protection for the saved copy of LUKS volume key. Trying to access the saved copy will cause page fault.

---
 arch/x86/kernel/machine_kexec_64.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/x86/kernel/machine_kexec_64.c +16 -0
index 0611fd83858e..f3d51c38a1c9 100644
@@ -557,9 +557,25 @@ static void kexec_mark_crashkres(bool protect)
 	kexec_mark_range(control, crashk_res.end, protect);
 }
 
+static void kexec_mark_luks_volume_key_inaccessible(void)
+{
+	unsigned long start, end;
+	struct page *page;
+	unsigned int nr_pages;
+
+	if (kexec_crash_image->luks_volume_key_addr) {
+		start = kexec_crash_image->luks_volume_key_addr;
+		end = start + kexec_crash_image->luks_volume_key_sz - 1;
+		page = pfn_to_page(start >> PAGE_SHIFT);
+		nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1;
+		set_memory_np((unsigned long)page_address(page), nr_pages);
+	}
+}
+
 void arch_kexec_protect_crashkres(void)
 {
 	kexec_mark_crashkres(true);
+	kexec_mark_luks_volume_key_inaccessible();
 }
 
 void arch_kexec_unprotect_crashkres(void)
Signature · 1 line
2.37.3
#5 lore raw

Re: [RFC v2 4/5] x86/crash: make the page that stores the LUKS volume key inaccessible

arch/x86/kernel/machine_kexec_64.c static void kexec_mark_crashkres(bool protect) · line 572

Quoted 7 lines · Coiby Xu
arch/x86/kernel/machine_kexec_64.c +7 -0
+	if (kexec_crash_image->luks_volume_key_addr) {
+		start = kexec_crash_image->luks_volume_key_addr;
+		end = start + kexec_crash_image->luks_volume_key_sz - 1;
+		page = pfn_to_page(start >> PAGE_SHIFT);
+		nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1;
+		set_memory_np((unsigned long)page_address(page), nr_pages);
+	}

Why does this go pfn -> page -> vaddr? What good does having the page do? Can you just do phys_to_virt() on the start address? Maybe:

start_paddr = kexec_crash_image->luks_volume_key_addr;
end_paddr = start_paddr + kexec_crash_image->luks_volume_key_sz - 1;
nr_pages = (PAGE_ALIGN(end_paddr) - PAGE_ALIGN_DOWN(start_paddr))/
PAGE_SIZE;
set_memory_np((unsigned long)phys_to_virt(start_paddr), nr_pages);

Also, if you resend this, please just cc the x86 folks on the series. The other patches and cover letter have desperately needed context around this.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

author
#6 lore raw

Re: [RFC v2 4/5] x86/crash: make the page that stores the LUKS volume key inaccessible

Hi Dave,

Thanks for the quick review!

Quoted 11 lines · Dave Hansen

arch/x86/kernel/machine_kexec_64.c static void kexec_mark_crashkres(bool protect) · line 572

Quoted 7 lines · Coiby Xu
arch/x86/kernel/machine_kexec_64.c +7 -0
+	if (kexec_crash_image->luks_volume_key_addr) {
+		start = kexec_crash_image->luks_volume_key_addr;
+		end = start + kexec_crash_image->luks_volume_key_sz - 1;
+		page = pfn_to_page(start >> PAGE_SHIFT);
+		nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1;
+		set_memory_np((unsigned long)page_address(page), nr_pages);
+	}

Why does this go pfn -> page -> vaddr? What good does having the page do?

Sorry it's an imitation of kexec_mark_crashkres.

Quoted 7 lines

Can you just do phys_to_virt() on the start address? Maybe:

	start_paddr = kexec_crash_image->luks_volume_key_addr;
	end_paddr   = start_paddr + kexec_crash_image->luks_volume_key_sz - 1;
	nr_pages = (PAGE_ALIGN(end_paddr) - PAGE_ALIGN_DOWN(start_paddr))/
PAGE_SIZE;
	set_memory_np((unsigned long)phys_to_virt(start_paddr), nr_pages);

Thanks for suggesting a smarter implementation! I'll apply it to next version.

Quoted 4 lines

Also, if you resend this, please just cc the x86 folks on the series. The other patches and cover letter have desperately needed context around this.

Sure, I'll cc the x86 list the complete patch set next time. Sorry you'll have to go to
https://lore.kernel.org/lkml/[email protected]/t/
to read related emails for now.

Quoted 1 line
Signature · 8 lines
Best regards,
Coiby


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
author
#7 lore raw

RFC v2 5/5 crash_dump: retrieve LUKS volume key in kdump kernel

In reply to Coiby Xu

Crash kernel will retrieve the LUKS volume key based on the luksvolumekey command line parameter. When libcryptsetup writes the key description to /sys/kernel/crash_luks_volume_key, crash kernel will create a thread keyring and add a logon key.

---
 include/linux/crash_dump.h |   2 +
 kernel/crash_dump.c        | 116 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 116 insertions(+), 2 deletions(-)
include/linux/crash_dump.h +2 -0
index 0f3a656293b0..bc848e058c64 100644
@@ -15,6 +15,8 @@
 extern unsigned long long elfcorehdr_addr;
 extern unsigned long long elfcorehdr_size;
 
+extern unsigned long long luks_volume_key_addr;
+
 #ifdef CONFIG_CRASH_DUMP
 extern int elfcorehdr_alloc(unsigned long long *addr, unsigned long long *size);
 extern void elfcorehdr_free(unsigned long long addr);
kernel/crash_dump.c +114 -2

152 lines not on this page · raw message

Signature · 1 line
2.37.3
#8 lore raw
In reply to Coiby Xu

Hi Coiby,

Quoted 14 lines · Coiby Xu

RFC v2
- libcryptsetup interacts with the kernel via sysfs instead of "hacking" dm-crypt
- to save a kdump copy of the LUKS volume key in 1st kernel
- to add a logon key using the copy for libcryptsetup in kdump kernel [Milan]
- to avoid the incorrect usage of LUKS master key in dm-crypt [Milan]
- save the kdump copy of LUKS volume key randomly [Jan]
- mark the kdump copy inaccessible [Pingfan]
- Miscellaneous
- explain when operations related to the LUKS volume key happen [Jan]
- s/master key/volume key/g
- use crash_ instead of kexec_ as function prefix
- fix commit subject prefixes e.g. "x86, kdump" to x86/crash

Quoted 4 lines

With kdump enabled, when the 1st kernel crashes, the system could boot into the kdump/crash kernel and dump the memory image i.e. /proc/vmcore to a specified target. Currently, when dumping vmcore to a LUKS encrypted device, there are two problems,

I went through this patchset, have some concerns. Do you mind sending a formal patchset with some adjustment?

1) maybe put the luks key handling related to crash_dump out into a separate file. e.g kernel/crash_dump_luks.c. This will reduce the code complexity to other kdump code from luks handling. At least from code reading side.
2) please rearrange your patches order so that generic luks handling at the beginning. Then the x86 specific code comes next. Please refer to below patchset. Like this, other arch can easily add its specific code accordingly.

[PATCH v18 0/7] crash: Kernel handling of CPU and memory hot un/plug

And I am wondering
1) in what proportion the luks system is used,
2) in which cases the dumped vmcore have to be saved into luks disk, no workaround?
3) with the 1 hour aging of luks key, to what extent it's still worthwhile to add the support of luks kdumping? E.g for me, I have been using Fedora, and often start kexec-tools service when I need to do test kdump w/o reboot. With that, the key has aged.

I am not familiar with LUKS and it's key mechanism, my above concerns could be shallow, anyone please help clarify if it does impact. Please also show your support if this adding is really helpful.

Thanks
Baoquan

Quoted 82 lines

- 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. Take Fedora example, by default, only 256M is reserved for systems having memory between 4G-64G. With LUKS enabled, ~1300M needs to be reserved for kdump. Note if the memory reserved for kdump can't be used by 1st kernel i.e. an user sees ~1300M memory missing in the 1st kernel.

Besides users (at least for Fedora) usually expect kdump to work out of the box i.e. no manual password input is needed. And it doesn't make sense to derivate the key again in kdump kernel which seems to be redundant work.

Based on Milan's feedback [1] on Kairui's ideas to support kdump with LUKS encryption, this patch set addresses the above issues by reusing the LUKS volume key in kdump kernel and here is the life cycle of this kdump copy of LUKS volume key,

1. After the 1st kernel loads the initramfs during boot, systemd asks for a passphrase from the user and uses it to de-crypt the LUKS volume key

2. After the 1st kernel saving the volume key as a logon key, libcrytpsetup notifies the kernel to read this logon key and store a temporary copy by writing the key description to /sys/kernel/crash_luks_volume_key

3. After switching to the real root fs, kdump.serivce is started and it loads the kdump kernel using the kexec_file_load syscall

4. The kexec_file_load syscall saves the temporary copy of the volume key to kdump reserved memory and wipe the copy.

5. When the 1st kernel crashes and kdump kernel is booted, libcryptsetup asks the kdump kernel to add a logon key using the volume key stored in kdump reserved memory by writing the key description to /sys/kernel/crash_luks_volume_key

6. The system gets rebooted to the 1st kernel after dumping vmcore to the LUKS encrypted device is finished

Note the kdump copy of LUKS volume key never leaves the kernel space and is saved in the memory area exclusively reserved for kdump where even the 1st kernel has no direct access.

Milan's major concern [2] on previous version is "storing the encryption key to yet another place are creating another attack vector". To further secure this copy, two additional protections are added,
- save the copy randomly in kdump reserved memory as suggested by Jan
- clear the _PAGE_PRESENT flag of the page that stores the copy as suggested by Pingfan

If there is no further security concern with this approach or any other concern, I will drop the following assumptions,
- only x86 is supported
- there is only one LUKS device for the system

to extend the support to other architectures including POWER, ARM and s390x and address the case of multiple LUKS devices. Any feedback will be appreciated, thanks!

For a proof of concept, I've patched cryptsetup [3] in a quick-and-dirty way to support a new option "--kdump-kernel-master-key"
and hacked systemd [4]. It works for Fedora 35.

[1] https://yhbt.net/lore/all/[email protected]/
[2] https://lwn.net/ml/linux-kernel/[email protected]/
[3] https://gitlab.com/coxu/cryptsetup/-/commit/750a46d933fac82e0c994b5c41de40a0b8cac647
[4] https://github.com/coiby/systemd/tree/reuse_kdump_master_key

Coiby Xu (5):
kexec_file: allow to place kexec_buf randomly
crash_dump: save the LUKS volume key temporarily x86/crash: pass the LUKS volume key to kdump kernel x86/crash: make the page that stores the LUKS volume key inaccessible
crash_dump: retrieve LUKS volume key in kdump kernel

Quoted 15 lines
 arch/x86/include/asm/crash.h       |   1 +
 arch/x86/kernel/crash.c            |  47 ++++++-
 arch/x86/kernel/kexec-bzimage64.c  |   7 +
 arch/x86/kernel/machine_kexec_64.c |  16 +++
 include/linux/crash_core.h         |   2 +
 include/linux/crash_dump.h         |   2 +
 include/linux/kexec.h              |   6 +
 kernel/crash_dump.c                | 200 +++++++++++++++++++++++++++++
 kernel/kexec_file.c                |  15 +++
 kernel/ksysfs.c                    |  19 +++
 10 files changed, 314 insertions(+), 1 deletion(-)
Signature · 1 line
2.37.3

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec