Skip to contentSkip to conversation

ima: do not copy measurement list to kdump kernel

PATCH In review steven chen 3 participants 3 messages May 13, 2025 – May 16, 2025

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ima: do not copy measurement list to kdump kernel

From: Steven Chen <[email protected]>

Kdump kernel doesn't need IMA to do integrity measurement. Hence the measurement list in 1st kernel doesn't need to be copied to kdump kernel.

Here skip allocating buffer for measurement list copying if loading kdump kernel. Then there won't be the later handling related to ima_kexec_buffer.

---
V1 - https://lore.kernel.org/all/[email protected]/
V2 - Incorporated feedback from the community (Baoquan He and Mimi Zohar) on v1

 security/integrity/ima/ima_kexec.c | 3 +++
 1 file changed, 3 insertions(+)
security/integrity/ima/ima_kexec.c +3 -0
index 38cb2500f4c3..7362f68f2d8b 100644
@@ -146,6 +146,9 @@ void ima_add_kexec_buffer(struct kimage *image)
 	void *kexec_buffer = NULL;
 	int ret;
 
+	if (image->type == KEXEC_TYPE_CRASH)
+		return;
+
 	/*
 	 * Reserve extra memory for measurements added during kexec.
 	 */
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 6 lines · steven chen

From: Steven Chen <[email protected]>

Kdump kernel doesn't need IMA to do integrity measurement. Hence the measurement list in 1st kernel doesn't need to be copied to kdump kernel.

Quoted 7 lines

Here skip allocating buffer for measurement list copying if loading kdump kernel. Then there won't be the later handling related to ima_kexec_buffer.

Thanks, Boaquan, Steven.

This patch is now queued in next-integrity and next-integrity-testing.

Mimi

#2 lore raw
Quoted 11 lines · Mimi Zohar
Quoted 10 lines · steven chen

From: Steven Chen <[email protected]>

Kdump kernel doesn't need IMA to do integrity measurement. Hence the measurement list in 1st kernel doesn't need to be copied to kdump kernel.

Here skip allocating buffer for measurement list copying if loading kdump kernel. Then there won't be the later handling related to ima_kexec_buffer.

Quoted 7 lines
Quoted 3 lines

Thanks, Boaquan, Steven.

This patch is now queued in next-integrity and next-integrity-testing.

Thanks for taking care of this.