[<prev] [next>] [day] [month] [year] [list]
Message-ID: <abafecde-06b4-46ae-9249-2584f6610763@p183>
Date: Sat, 19 Oct 2024 18:25:25 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Tobias Stoeckmann <tobias@...eckmann.org>
Cc: mcgrof@...nel.org, linux-modules@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] module: .strtab must be null terminated
> + strhdr = &info->sechdrs[info->index.str];
> + if (strhdr->sh_size > 0 && info->strtab[strhdr->sh_size - 1] != '\0') {
> + pr_err("module %s: string table isn't null terminated\n",
> + info->name ?: "(missing .modinfo section or name field)");
> + goto no_exec;
> + }
Reviewed-off-by: Alexey Dobriyan <adobriyan@...il.com>
The _very_ correct test is "there must be NUL between last index used
and the end of the section somewhere".
.shstrtab has the same overly restrictive test:
if (info->secstrings[strhdr->sh_size - 1] != '\0') {
But, of course, it doesn't matter in practice.
Powered by blists - more mailing lists