From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: Coiby Xu <coiby.xu@gmail.com>
Cc: kexec@lists.infradead.org,
Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <baoquan.he@linux.dev>,
Dave Young <ruirui.yang@linux.dev>,
Pratyush Yadav <pratyush@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Coiby Xu <coxu@redhat.com>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 09/10] crash_dump: Disallow configfs/crash_dm_crypt_key/reuse if crash hotplug supported
Date: Sun, 9 Aug 2026 17:36:50 +0530 [thread overview]
Message-ID: <8d857834-e014-44d9-a112-d7fc8482d7c3@linux.ibm.com> (raw)
In-Reply-To: <anQb8aIXKXYzKqAR@Rk>
On 06/08/26 11:03, Coiby Xu wrote:
> On Wed, Aug 05, 2026 at 05:39:28PM +0530, Sourabh Jain wrote:
>>
>>
>> On 29/07/26 09:06, Coiby Xu wrote:
>>> If crash hotplug is supported, dm-crypt keys saved to reserved memory
>>> will be taken care of automatically. Thus it doesn't make sense to use
>>> configfs/crash_dm_crypt_key/reuse. Reserving image->dm_crypt_keys_addr
>>> is also unnecessary. Currently x86_64 and ppc64le have implemented
>>> crash hotplug feature.
>>>
>>> Also update the doc accordingly. Note two doc issues are fixed as well.
>>>
>>> Fixes: 9ebfa8dcaea7 ("crash_dump: reuse saved dm crypt keys for
>>> CPU/memory hot-plugging")
>>> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
>>> ---
>>> Documentation/admin-guide/kdump/kdump.rst | 16 ++++++++++------
>>> kernel/crash_dump_dm_crypt.c | 23 ++++++++++++++++++++---
>>> 2 files changed, 30 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/Documentation/admin-guide/kdump/kdump.rst
>>> b/Documentation/admin-guide/kdump/kdump.rst
>>> index 7587caadbae1..0bf2eb100a05 100644
>>> --- a/Documentation/admin-guide/kdump/kdump.rst
>>> +++ b/Documentation/admin-guide/kdump/kdump.rst
>>> @@ -577,9 +577,10 @@ with /sys/kernel/config/crash_dm_crypt_keys for
>>> setup,
>>> 1. Tell the first kernel what logon keys are needed to unlock the
>>> disk volumes,
>>> # Add key #1
>>> - mkdir
>>> /sys/kernel/config/crash_dm_crypt_keys/7d26b7b4-e342-4d2d-b660-7426b0996720
>>> + VOL1_UUID=7d26b7b4-e342-4d2d-b660-7426b0996720
>>> + mkdir /sys/kernel/config/crash_dm_crypt_keys/$VOL1_UUID
>>> # Add key #1's description
>>> - echo cryptsetup:7d26b7b4-e342-4d2d-b660-7426b0996720 >
>>> /sys/kernel/config/crash_dm_crypt_keys/description
>>> + echo cryptsetup:$VOL1_UUID >
>>> /sys/kernel/config/crash_dm_crypt_keys/$VOL1_UUID/description
>>> # how many keys do we have now?
>>> cat /sys/kernel/config/crash_dm_crypt_keys/count
>>> @@ -591,15 +592,18 @@ with /sys/kernel/config/crash_dm_crypt_keys
>>> for setup,
>>> cat /sys/kernel/config/crash_dm_crypt_keys/count
>>> 2
>>> - # To support CPU/memory hot-plugging, reuse keys already saved
>>> to reserved
>>> - # memory
>>> - echo true > /sys/kernel/config/crash_dm_crypt_key/reuse
>>> -
>>> 2. Load the dump-capture kernel
>>> 3. After the dump-capture kerne get booted, restore the keys to
>>> user keyring
>>> echo yes > /sys/kernel/crash_dm_crypt_keys/restore
>>> +For CPU/memory hot-plugging, you can reuse keys already saved to
>>> reserved
>>> +memory before reloading the kdump image,
>>> + echo true > /sys/kernel/config/crash_dm_crypt_keys/reuse
>>> +
>>> +Note if crash hotplug is supported, this API is totally unnecessary
>>> thus will
>>> +be disabled automatically.
>>> +
>>> Contact
>>> =======
>>> diff --git a/kernel/crash_dump_dm_crypt.c
>>> b/kernel/crash_dump_dm_crypt.c
>>> index b5b78656cf06..46d6b31c3ca4 100644
>>> --- a/kernel/crash_dump_dm_crypt.c
>>> +++ b/kernel/crash_dump_dm_crypt.c
>>> @@ -310,6 +310,15 @@ static ssize_t config_keys_reuse_show(struct
>>> config_item *item, char *page)
>>> return sysfs_emit(page, "%d\n", is_dm_key_reused);
>>> }
>>> +static bool crash_hotplug_support(struct kimage *image)
>>> +{
>>> +#ifdef CONFIG_CRASH_HOTPLUG
>>> + return image->hotplug_support;
>>
>> I don't think it is good idea to access kexec_crash_image properties
>> without
>> holding the kexec lock.
>
> Thanks for raising the concern! Let's discuss this issue in [PATCH v3
> 03/10].
>
>>
>> Also, would it make sense to move this API somewhere else?
>
> Can you help me understand why to move this API? Is it because using
> ifdef in .c file is discouraged?
This API is used to verify crash hotplug support, which is not directly
related to crash_dm_crypt_keys.
It also seems to be generally useful.
- Sourabh Jain
>
>>
>> - Sourabh Jain
> [...]
>
next prev parent reply other threads:[~2026-08-09 12:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260729033654.311541-1-coiby.xu@gmail.com>
2026-07-29 3:36 ` [PATCH v3 01/10] crash_dump: release keyring reference at the correct time Coiby Xu
2026-07-29 3:36 ` [PATCH v3 02/10] crash_dump: Fix potential double free and UAF of keys_header Coiby Xu
2026-07-29 3:36 ` [PATCH v3 03/10] crash_dump: Disallow writing to dm-crypt configfs during kexec_file_load syscall Coiby Xu
2026-08-05 10:30 ` Sourabh Jain
2026-08-06 5:20 ` Coiby Xu
2026-08-09 11:56 ` Sourabh Jain
2026-07-29 3:36 ` [PATCH v3 04/10] crash_dump: Read the number of dm-crypt keys from reserved memory Coiby Xu
2026-08-05 11:05 ` Sourabh Jain
2026-08-06 6:20 ` Coiby Xu
2026-08-09 12:26 ` Sourabh Jain
2026-07-29 3:36 ` [PATCH v3 05/10] crash_dump: Free temporary dm-crypt keys_header buffer in kdump kernel Coiby Xu
2026-07-29 3:36 ` [PATCH v3 06/10] crash_dump: Only use kexec_dprintk during the kexec_file_load syscall Coiby Xu
2026-08-05 11:36 ` Sourabh Jain
2026-08-06 5:27 ` Coiby Xu
2026-07-29 3:36 ` [PATCH v3 07/10] crash_dump: Improve readability of config_keys_restore_store Coiby Xu
2026-08-05 11:52 ` Sourabh Jain
2026-08-06 6:26 ` Coiby Xu
2026-07-29 3:36 ` [PATCH v3 08/10] crash_dump: Check the function return codes in restore_dm_crypt_keys_to_thread_keyring Coiby Xu
2026-08-05 12:03 ` Sourabh Jain
2026-07-29 3:36 ` [PATCH v3 09/10] crash_dump: Disallow configfs/crash_dm_crypt_key/reuse if crash hotplug supported Coiby Xu
2026-08-05 12:09 ` Sourabh Jain
2026-08-06 5:33 ` Coiby Xu
2026-08-09 12:06 ` Sourabh Jain [this message]
2026-07-29 3:36 ` [PATCH v3 10/10] Documentation: kdump: Add arm64 and ppc64le to encrypted dump target support list Coiby Xu
2026-08-05 12:10 ` Sourabh Jain
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=8d857834-e014-44d9-a112-d7fc8482d7c3@linux.ibm.com \
--to=sourabhjain@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=baoquan.he@linux.dev \
--cc=coiby.xu@gmail.com \
--cc=corbet@lwn.net \
--cc=coxu@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=ruirui.yang@linux.dev \
--cc=skhan@linuxfoundation.org \
/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