mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
modpost: fix off by one in is_executable_section()
[ Upstream commit3a3f1e573a
] The > comparison should be >= to prevent an out of bounds array access. Fixes:52dc0595d5
("modpost: handle relocations mismatch in __ex_table.") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1030c0c309
commit
02dc8e8bdb
1 changed files with 1 additions and 1 deletions
|
@ -1633,7 +1633,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
|
|||
|
||||
static int is_executable_section(struct elf_info* elf, unsigned int section_index)
|
||||
{
|
||||
if (section_index > elf->num_sections)
|
||||
if (section_index >= elf->num_sections)
|
||||
fatal("section_index is outside elf->num_sections!\n");
|
||||
|
||||
return ((elf->sechdrs[section_index].sh_flags & SHF_EXECINSTR) == SHF_EXECINSTR);
|
||||
|
|
Loading…
Reference in a new issue