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, 13 Jun 2024 14:40:19 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: dwarves@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	bpf@...r.kernel.org, Alan Maguire <alan.maguire@...cle.com>,
	Jiri Olsa <jolsa@...nel.org>, Jan Engelhardt <jengelh@...i.de>,
	Matthias Schwarzott <zzam@...too.org>,
	Viktor Malik <vmalik@...hat.com>,
	Eduard Zingerman <eddyz87@...il.com>,
	Jan Alexander Steffens <heftig@...hlinux.org>,
	Domenico Andreoli <cavok@...ian.org>,
	Dominique Leuenberger <dimstar@...nsuse.org>,
	Daniel Xu <dxu@...uu.xyz>, Yonghong Song <yonghong.song@...ux.dev>,
	llvm@...ts.linux.dev
Subject: Re: ANNOUNCE: pahole v1.27 (reproducible builds, BTF kfuncs)

Hi Arnaldo,

On Tue, Jun 11, 2024 at 06:26:53PM -0300, Arnaldo Carvalho de Melo wrote:
> 	The v1.27 release of pahole and its friends is out, supporting
> parallel reproducible builds and encoding kernel kfuncs in BTF, allowing
> tools such as bpftrace to enumerate the available kfuncs and obtain its
> function signatures and return types.

After commit f632e75 ("dwarf_loader: Add the cu to the cus list early,
remove on LSK_DELETE"), I (and others[1]) notice a crash when running
pahole on modules built with Clang when CONFIG_LTO_CLANG is enabled:

  $ curl -LSso .config https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/main/config

  $ scripts/config -d LTO_NONE -e LTO_CLANG_THIN

  $ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 olddefconfig vmlinux crypto/cast_common.ko
  make[3]: *** [scripts/Makefile.modfinal:59: crypto/cast_common.ko] Error 139

I've isolated this to the following commands using the files available
at [2] (these were built with LLVM 18 but I could reproduce it with LLVM
17 and LLVM 19, so it appears to impact a number of versions):

  $ tar -tf clang-lto-pahole-1.27-crash.tar.zst
  clang-lto-pahole-1.27-crash/
  clang-lto-pahole-1.27-crash/cast_common.mod.o
  clang-lto-pahole-1.27-crash/module.lds
  clang-lto-pahole-1.27-crash/cast_common.o
  clang-lto-pahole-1.27-crash/cast_common.ko.bak
  clang-lto-pahole-1.27-crash/vmlinux
  clang-lto-pahole-1.27-crash/cast_common.ko

  $ tar -axf clang-lto-pahole-1.27-crash.tar.zst

  $ cd clang-lto-pahole-1.27-crash

  $ LLVM_OBJCOPY="llvm-objcopy" pahole-1.26 -J -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func --lang_exclude=rust --btf_base vmlinux cast_common.ko

  $ cp cast_common.ko{.bak,}

  $ LLVM_OBJCOPY="llvm-objcopy" pahole-1.27 -J -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func --lang_exclude=rust --btf_base vmlinux cast_common.ko
  fish: Job 1, '...' terminated by signal SIGSEGV (Address boundary error)

If there is any more information I can provide or patches I can test, I
am more than happy to do so.

[1]: https://gitlab.archlinux.org/archlinux/packaging/packages/pahole/-/issues/1
[2]: https://1drv.ms/u/s!AsQNYeB-IEbqqC2F28JuLy__Q7Vd?e=KsraMU

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ