mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 21:02:43 +01:00
Commit4e6e8c2b75("binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4") added support for AT_HWCAP3 and AT_HWCAP4, but it missed updating the AUX vector size calculation in create_elf_fdpic_tables() and AT_VECTOR_SIZE_BASE in include/linux/auxvec.h. Similar to the fix for AT_HWCAP2 in commitc6a09e342f("binfmt_elf_fdpic: fix AUXV size calculation when ELF_HWCAP2 is defined"), this omission leads to a mismatch between the reserved space and the actual number of AUX entries, eventually triggering a kernel BUG_ON(csp != sp). Fix this by incrementing nitems when ELF_HWCAP3 or ELF_HWCAP4 are defined and updating AT_VECTOR_SIZE_BASE. Cc: Mark Brown <[email protected]> Cc: Max Filippov <[email protected]> Reviewed-by: Michal Koutný <[email protected]> Reviewed-by: Mark Brown <[email protected]> Reviewed-by: Cyrill Gorcunov <[email protected]> Reviewed-by: Alexander Mikhalitsyn <[email protected]> Fixes:4e6e8c2b75("binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4") Signed-off-by: Andrei Vagin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Kees Cook <[email protected]>
10 lines
304 B
C
10 lines
304 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_AUXVEC_H
|
|
#define _LINUX_AUXVEC_H
|
|
|
|
#include <uapi/linux/auxvec.h>
|
|
|
|
#define AT_VECTOR_SIZE_BASE 24 /* NEW_AUX_ENT entries in auxiliary table */
|
|
/* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */
|
|
#endif /* _LINUX_AUXVEC_H */
|