diff --git a/kernel/module.c b/kernel/module.c index e978debc93df3d34f93a881d21037195e3fc0c39..57b34c32a9168530d0f7d1b76b00117da77d8492 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -3053,6 +3053,10 @@ static int elf_validity_check(struct load_info *info) * strings in the section safe. */ info->secstrings = (void *)info->hdr + strhdr->sh_offset; + if (strhdr->sh_size == 0) { + pr_err("empty section name table\n"); + return -ENOEXEC; + } if (info->secstrings[strhdr->sh_size - 1] != '\0') return -ENOEXEC;