build failure on x86 because commit 22e460b6333a
Subsystems (3)
Dear All,
upgrade to v6.6.128, build fail in x86 with our config with the commit:
git show 22e460b6333a5f818b042ac89201f8e735556f4a
commit 22e460b6333a5f818b042ac89201f8e735556f4a
Author: Harshit Mogalapalli <[email protected]> Date: Tue Dec 30 22:16:09 2025 -0800
x86/kexec: add a sanity check on previous kernel's ima kexec buffer
[ Upstream commit c5489d04337b47e93c0623e8145fcba3f5739efd ]
BRs
Wentao Guan
config:
https://gist.github.com/opsiff/4343c07b55697837f816c706309510c1
Log:arch/x86/kernel/setup.c: In function ‘ima_get_kexec_buffer’:arch/x86/kernel/setup.c:380:15: error: implicit declaration of function ‘ima_validate_range’ [-Werror=implicit-function-declaration]
380 | ret = ima_validate_range(ima_kexec_buffer_phys, ima_kexec_buffer_size);
| ^~~~~~~~~~~~~~~~~~ CC [M] fs/zonefs/file.o
[REGRESSION v6.12.75] build failure on x86 because commit f8f73bf0f8a57
Dear All,
I found v6.12.75 have same issue too, it can be reproduced on x86, with CONFIG_OF_FLATTREE not set(disbale CONFIG_OF).
The reason is miss the mainline commit 10d1c75ed438
("ima: verify the previous kernel's IMA buffer lies in addressable RAM")
BRs
Wentao Guan
Log:arch/x86/kernel/setup.c: In function ‘ima_get_kexec_buffer’:arch/x86/kernel/setup.c:380:15: error: implicit declaration of function ‘ima_validate_range’ [-Werror=implicit-function-declaration]
380 | ret = ima_validate_range(ima_kexec_buffer_phys, ima_kexec_buffer_size);
| ^~~~~~~~~~~~~~~~~~config:
https://gist.github.com/opsiff/a139103d92b05504c05e42600958242d
commit:
git show f8f73bf0f8a57
commit f8f73bf0f8a57ee9b86792456bd42079bc98c6b7
Author: Harshit Mogalapalli <[email protected]> Date: Tue Dec 30 22:16:09 2025 -0800
x86/kexec: add a sanity check on previous kernel's ima kexec buffer
[ Upstream commit c5489d04337b47e93c0623e8145fcba3f5739efd ]
When the second-stage kernel is booted via kexec with a limiting command line such as "mem=<size>", the physical range that contains the carried over IMA measurement list may fall outside the truncated RAM leading to a kernel panic.
BUG: unable to handle page fault for address: ffff97793ff47000
RIP: ima_restore_measurement_list+0xdc/0x45a
#PF: error_code(0x0000) – not-present page
Other architectures already validate the range with page_is_ram(), as done in commit cbf9c4b9617b ("of: check previous kernel's ima-kexec-buffer against memory bounds") do a similar check on x86.
Without carrying the measurement list across kexec, the attestation would fail.
arch/x86/kernel/setup.c +6 -0
@@ -372,9 +372,15 @@ int __init ima_free_kexec_buffer(void)int __init ima_get_kexec_buffer (void **addr,size_t *size) { +int ret; +if (!ima_kexec_buffer_size)return -ENOENT ; + ret =ima_validate_range (ima_kexec_buffer_phys, ima_kexec_buffer_size); +if (ret) +return ret; + *addr =__va (ima_kexec_buffer_phys); *size = ima_kexec_buffer_size;
Quoted 3 lines · Wentao Guan
Dear All,
upgrade to v6.6.128, build fail in x86 with our config with the commit:
kernel.org already offers 6.12.76 and 6.6.129, which from a quick look should fix this error (and the other one you reported which is basically the same problem afaics)
Quoted 21 lines
git show
22e460b6333a5f818b042ac89201f8e735556f4a
commit22e460b6333a5f818b042ac89201f8e735556f4aAuthor: Harshit Mogalapalli <[email protected]> Date: Tue Dec 30 22:16:09 2025 -0800x86/kexec: add a sanity check on previous kernel's ima kexec buffer
[ Upstream commit
c5489d04337b47e93c0623e8145fcba3f5739efd]BRs
Wentao Guanconfig:
https://gist.github.com/opsiff/4343c07b55697837f816c706309510c1Log:
arch/x86/kernel/setup.c: In function ‘ima_get_kexec_buffer’:arch/x86/kernel/setup.c:380:15: error: implicit declaration of function ‘ima_validate_range’ [-Werror=implicit-function-declaration]380 | ret = ima_validate_range(ima_kexec_buffer_phys, ima_kexec_buffer_size); | ^~~~~~~~~~~~~~~~~~CC [M]
fs/zonefs/file.o
Thanks for your notice,
I tested the v6.6.129 and v6.12.76 with our config, the build problem has been solved.
BRs
Wentao Guan