diff --git a/kernel/module.c b/kernel/module.c index 0dac54adf7e85dc09276a1fb440cb78662125f37..fad44b8fd08429d3e0e9918b996125d0063b5e8b 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -3048,6 +3048,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;