diff options
| author | Sun Jian <sun.jian.kdev@gmail.com> | 2026-01-13 18:15:32 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-01-26 19:07:14 -0800 |
| commit | 499f86de4f8c34e19a57daf2b6f0cba848e91994 (patch) | |
| tree | d3ae3822b35928119ed1295b9c3f0e3d3750bf70 /include/linux/i2c/git@git.tavy.me:linux.git | |
| parent | a906f3ae4423d35c9804c8ec3a0db96ce9b54d44 (diff) | |
init/main: read bootconfig header with get_unaligned_le32()
get_boot_config_from_initrd() scans up to 3 bytes before initrd_end to
handle GRUB 4-byte alignment. As a result, the bootconfig header
immediately preceding the magic may be unaligned.
Read the size and checksum fields with get_unaligned_le32() instead of
casting to u32 * and using le32_to_cpu(), avoiding potential unaligned
access and silencing sparse "cast to restricted __le32" warnings.
Sparse warnings (gcc + C=1):
init/main.c:292:16: warning: cast to restricted __le32
init/main.c:293:16: warning: cast to restricted __le32
No functional change intended.
Link: https://lkml.kernel.org/r/20260113101532.1630770-1-sun.jian.kdev@gmail.com
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/i2c/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
