tools/bootconfig: Reject short reads of configuration data
load_xbc_fd() places the terminator at the requested size even when
read() returns less. Its initrd caller then computes a checksum over
bytes that were never read, while the plain file callers can parse a
partial configuration. Reject a short read and release the allocated
buffer on both read failure paths.
Link: https://lore.kernel.org/all/20261120061912.98156-1-zhujun2@cmss.chinamobile.com/
Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
Cc: stable@vger.kernel.org
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
1 file changed