Commit 3a3f1e57 authored by Dan Carpenter's avatar Dan Carpenter Committed by Masahiro Yamada
Browse files

modpost: fix off by one in is_executable_section()



The > comparison should be >= to prevent an out of bounds array
access.

Fixes: 52dc0595 ("modpost: handle relocations mismatch in __ex_table.")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 98d7c754
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1141,7 +1141,7 @@ static Elf_Sym *find_tosym(struct elf_info *elf, Elf_Addr addr, Elf_Sym *sym)

static bool is_executable_section(struct elf_info *elf, unsigned int secndx)
{
	if (secndx > elf->num_sections)
	if (secndx >= elf->num_sections)
		return false;

	return (elf->sechdrs[secndx].sh_flags & SHF_EXECINSTR) != 0;