lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 19 Mar 2020 01:45:43 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Xiao Yang <yangx.jy@...fujitsu.com>
Cc:     Michal Marek <michal.lkml@...kovi.net>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] modpost: Get proper section index by get_secindex()
 instead of st_shndx

On Wed, Mar 18, 2020 at 7:39 PM Xiao Yang <yangx.jy@...fujitsu.com> wrote:
>
> (uint16_t) st_shndx is limited to 65535(i.e. SHN_XINDEX) so sym_get_data() gets
> wrong section index by st_shndx if requested symbol contains extended section
> index that is more than 65535.  In this case, we need to get proper section index
> by .symtab_shndx section.
>
> Module.symvers generated by building kernel with "-ffunction-sections -fdata-sections"
> shows the issue.
>
> Fixes: 56067812d5b0 ("kbuild: modversions: add infrastructure for emitting relative CRCs")
> Fixes: e84f9fbbece1 ("modpost: refactor namespace_from_kstrtabns() to not hard-code section name")
> Reviewed-by: Masahiro Yamada <masahiroy@...nel.org>
> Signed-off-by: Xiao Yang <yangx.jy@...fujitsu.com>
> ---

Applied to linux-kbuild/fixes.
Thanks.




>  scripts/mod/modpost.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 7edfdb2f4497..1ce22896f3d8 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -308,7 +308,8 @@ static const char *sec_name(struct elf_info *elf, int secindex)
>
>  static void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym)
>  {
> -       Elf_Shdr *sechdr = &info->sechdrs[sym->st_shndx];
> +       unsigned int secindex = get_secindex(info, sym);
> +       Elf_Shdr *sechdr = &info->sechdrs[secindex];
>         unsigned long offset;
>
>         offset = sym->st_value;
> --
> 2.21.0
>
>
>


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ