CyberRota Analysis
AI-GeneratedThe vulnerability affects the Linux kernel on RISC-V architectures, specifically in the `machine_kexec_prepare()` function, where a NULL pointer dereference can occur due to unchecked copying of a potentially NULL buffer. This flaw could lead to system crashes or undefined behavior during kernel execution, making it critical for developers and system administrators using RISC-V Linux systems to prioritize this issue and apply necessary patches. Immediate attention is recommended to ensure system stability and security.
Original NVD Description
In the Linux kernel, the following vulnerability has been resolved: riscv: Prevent NULL pointer dereference in machine_kexec_prepare() A NULL pointer dereference issue is noticed in riscv's machine_kexec_prepare(), where image->segment[i].buf might be NULL and copied unchecked. The NULL buf comes from ima_add_kexec_buffer(), where kbuf is added by kexec_add_buffer(), but kbuf.buffer is NULL, then it is copied without a check in machine_kexec_prepare(): kexec_file_load -> kimage_file_alloc_init() -> kimage_file_prepare_segments() -> ima_add_kexec_buffer() -> kexec_add_buffer() -> machine_kexec_prepare() -> memcpy() Address this by adding a check before the data copy attempt.