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] [thread-next>] [day] [month] [year] [list]
Date: Thu, 21 Dec 2023 19:22:11 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: deller@...nel.org
Cc: linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>, 
	linux-modules@...r.kernel.org, linux-arch@...r.kernel.org, 
	Luis Chamberlain <mcgrof@...nel.org>
Subject: Re: [PATCH 1/4] linux/export: Fix alignment for 64-bit ksymtab entries

On Thu, Nov 23, 2023 at 7:18 AM <deller@...nel.org> wrote:
>
> From: Helge Deller <deller@....de>
>
> An alignment of 4 bytes is wrong for 64-bit platforms which don't define
> CONFIG_HAVE_ARCH_PREL32_RELOCATIONS (which then store 64-bit pointers).
> Fix their alignment to 8 bytes.
>
> Signed-off-by: Helge Deller <deller@....de>


This is correct.

Acked-by: Masahiro Yamada <masahiroy@...nel.org>

Please add


Fixes: ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by modpost")





> ---
>  include/linux/export-internal.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/export-internal.h b/include/linux/export-internal.h
> index 69501e0ec239..cd253eb51d6c 100644
> --- a/include/linux/export-internal.h
> +++ b/include/linux/export-internal.h
> @@ -16,10 +16,13 @@
>   * and eliminates the need for absolute relocations that require runtime
>   * processing on relocatable kernels.
>   */
> +#define __KSYM_ALIGN           ".balign 4"
>  #define __KSYM_REF(sym)                ".long " #sym "- ."
>  #elif defined(CONFIG_64BIT)
> +#define __KSYM_ALIGN           ".balign 8"
>  #define __KSYM_REF(sym)                ".quad " #sym
>  #else
> +#define __KSYM_ALIGN           ".balign 4"
>  #define __KSYM_REF(sym)                ".long " #sym
>  #endif
>
> @@ -42,7 +45,7 @@
>             "   .asciz \"" ns "\""                                      "\n"    \
>             "   .previous"                                              "\n"    \
>             "   .section \"___ksymtab" sec "+" #name "\", \"a\""        "\n"    \
> -           "   .balign 4"                                              "\n"    \
> +               __KSYM_ALIGN                                            "\n"    \
>             "__ksymtab_" #name ":"                                      "\n"    \
>                 __KSYM_REF(sym)                                         "\n"    \
>                 __KSYM_REF(__kstrtab_ ##name)                           "\n"    \
> --
> 2.41.0
>


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ