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]
Message-ID: <6acbc2347a86153c2646a4bfebaa226e9b0e01f7@linux.dev>
Date: Wed, 02 Apr 2025 23:22:40 +0000
From: "Ihor Solodrai" <ihor.solodrai@...ux.dev>
To: "Vasily Gorbik" <gor@...ux.ibm.com>, "Steven Rostedt"
 <rostedt@...dmis.org>
Cc: "Masami Hiramatsu" <mhiramat@...nel.org>, "Catalin Marinas"
 <catalin.marinas@....com>, "Nathan Chancellor" <nathan@...nel.org>, "Ilya
 Leoshkevich" <iii@...ux.ibm.com>, "Heiko Carstens" <hca@...ux.ibm.com>,
 "Alexander Gordeev" <agordeev@...ux.ibm.com>,
 linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH] scripts/sorttable: Fix endianness handling in build-time
 mcount sort

On 4/1/25 6:15 PM, Vasily Gorbik wrote:
> Kernel cross-compilation with BUILDTIME_MCOUNT_SORT produces zeroed
> mcount values if the build-host endianness does not match the ELF
> file endianness.
>
> The mcount values array is converted from ELF file
> endianness to build-host endianness during initialization in
> fill_relocs()/fill_addrs(). Avoid extra conversion of these values during
> weak-function zeroing; otherwise, they do not match nm-parsed addresses
> and all mcount values are zeroed out.
>
> Fixes: ef378c3b8233 ("scripts/sorttable: Zero out weak functions in mcount_loc table")
> Reported-by: Ilya Leoshkevich <iii@...ux.ibm.com>
> Reported-by: Ihor Solodrai <ihor.solodrai@...ux.dev>
> Closes: https://lore.kernel.org/all/your-ad-here.call-01743522822-ext-4975@work.hours/
> Signed-off-by: Vasily Gorbik <gor@...ux.ibm.com>
> ---
>  scripts/sorttable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/sorttable.c b/scripts/sorttable.c
> index 7b4b3714b1af..deed676bfe38 100644
> --- a/scripts/sorttable.c
> +++ b/scripts/sorttable.c
> @@ -857,7 +857,7 @@ static void *sort_mcount_loc(void *arg)
>  		for (void *ptr = vals; ptr < vals + size; ptr += long_size) {
>  			uint64_t key;
>  
> -			key = long_size == 4 ? r((uint32_t *)ptr) : r8((uint64_t *)ptr);
> +			key = long_size == 4 ? *(uint32_t *)ptr : *(uint64_t *)ptr;
>  			if (!find_func(key)) {
>  				if (long_size == 4)
>  					*(uint32_t *)ptr = 0;

Hi Vasily,

I can confirm that this patch fixes BPF selftests on s390x:
https://github.com/kernel-patches/vmtest/actions/runs/14231181710

Tested-by: Ihor Solodrai <ihor.solodrai@...ux.dev>

Thank you!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ