[PATCH v2 2/5] crash_dump: save the dm crypt key temporarily

2024-01-09 Thread Coiby Xu
User space is supposed to write the key description to /sys/kernel/crash_dm_crypt_key so the kernel will read the key and save a temporary copy for later user. User space has 2 minutes at maximum to load the kdump initrd before the key gets wiped. And after kdump retrieves the key, the key will be

[PATCH v2 1/5] kexec_file: allow to place kexec_buf randomly

2024-01-09 Thread Coiby Xu
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

[PATCH v2 0/5] Support kdump with LUKS encryption by reusing LUKS volume key

2024-01-09 Thread Coiby Xu
LUKS is the standard for Linux disk encryption. Many users choose LUKS and in some use cases like Confidential VM it's mandated. 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.

[PATCH v2 4/5] x86/crash: pass the dm crypt key to kdump kernel

2024-01-09 Thread Coiby Xu
1st kernel will build up the kernel command parameter dmcryptkey as similar to elfcorehdr to pass the memory address of the stored info of dm crypt key to kdump kernel. Signed-off-by: Coiby Xu --- arch/x86/kernel/crash.c | 15 ++- arch/x86/kernel/kexec-bzimage64.c | 7

[PATCH v2 5/5] x86/crash: make the page that stores the dm crypt key inaccessible

2024-01-09 Thread Coiby Xu
This adds an addition layer of protection for the saved copy of dm crypt key. Trying to access the saved copy will cause page fault. Suggested-by: Pingfan Liu Signed-off-by: Coiby Xu --- arch/x86/kernel/machine_kexec_64.c | 18 ++ 1 file changed, 18 insertions(+) diff --git

[PATCH v2 3/5] crash_dump: retrieve dm crypt key in kdump kernel

2024-01-09 Thread Coiby Xu
Crash kernel will retrieve the dm crypt volume key based on the dmcryptkey command line parameter. When user space writes the key description to /sys/kernel/crash_dm_crypt_key, the crash kernel will save the encryption key to the user keyring. Then user space e.g. cryptsetup's --volume-key-keyring

Re: [PATCHv4 05/14] x86/kvm: Do not try to disable kvmclock if it was not enabled

2024-01-09 Thread Sean Christopherson
On Thu, Jan 04, 2024, Kirill A. Shutemov wrote: > On Wed, Dec 13, 2023 at 09:22:34AM -0800, Sean Christopherson wrote: > > On Tue, Dec 12, 2023, Kirill A. Shutemov wrote: > > > On Tue, Dec 05, 2023 at 03:45:01AM +0300, Kirill A. Shutemov wrote: > > > > kvm_guest_cpu_offline() tries to disable