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: <aQ0ERJiTpiA_rL5D@x1>
Date: Thu, 6 Nov 2025 17:25:40 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
	Alice Ryhl <aliceryhl@...gle.com>,
	Andreas Hindborg <a.hindborg@...nel.org>,
	Benno Lossin <lossin@...nel.org>,
	Björn Roy Baron <bjorn3_gh@...tonmail.com>,
	Boqun Feng <boqun.feng@...il.com>,
	Danilo Krummrich <dakr@...nel.org>, Gary Guo <gary@...yguo.net>,
	Trevor Gross <tmgross@...ch.edu>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Ian Rogers <irogers@...gle.com>,
	James Clark <james.clark@...aro.org>, Jiri Olsa <jolsa@...nel.org>,
	linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 1/1] perf symbols: Handle '1' symbols in /proc/kallsyms

On Mon, Nov 03, 2025 at 07:06:45PM -0800, Namhyung Kim wrote:
> On Mon, Nov 03, 2025 at 03:03:23PM -0300, Arnaldo Carvalho de Melo wrote:
> > Just FYI, I'm carrying this on the perf tools tree.

> > I started seeing this in recent Fedora 42 kernels:

> >   root@x1:~# uname -a
> >   Linux x1 6.17.4-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Oct 19 18:47:49 UTC 2025 x86_64 GNU/Linux
> >   root@x1:~#

> >   root@x1:~# perf test 1
> >     1: vmlinux symtab matches kallsyms     : FAILED!
> >   root@x1:~#

> > Related to:

> >   root@x1:~# grep ' 1 ' /proc/kallsyms
> >   ffffffffb098bc00 1 __pfx__RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   ffffffffb098bc10 1 _RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   root@x1:~#

> > That is found in:
 
> >   root@x1:~# pahole --running_kernel_vmlinux
> >   /usr/lib/debug/lib/modules/6.17.4-200.fc42.x86_64/vmlinux
> >   root@x1:~#
 
> >   root@x1:~# readelf -sW /usr/lib/debug/lib/modules/6.17.4-200.fc42.x86_64/vmlinux | grep __pfx__RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   150649: ffffffff81f8bc00    16 FUNC    LOCAL  DEFAULT    1 __pfx__RNCINvNtNtNtCsfwaGRd4cjqE_4core4iter8adapters3map12map_try_foldjNtCskFudTml27HW_12drm_panic_qr7VersionuINtNtNtBa_3ops12control_flow11ControlFlowB10_ENcB10_0NCINvNvNtNtNtB8_6traits8iterator8Iterator4find5checkB10_NCNvMB12_B10_13from_segments0E0E0B12_
> >   root@x1:~#
> > 
> > But was being filtered out when reading /proc/kallsyms, as the '1'
> > symbol type was not being handled, do it, there are just two of them at
> > this point.
> 
> Do you know what the type '1' means?  It seems they are from Rust.

They are related to anonymous Rust closures in the QR encoder for the
DRM panic, this part:

drivers/gpu/drm/drm_panic_qr.rs

    fn from_segments(segments: &[&Segment<'_>]) -> Option<Version> {
        (1..=40)
            .map(Version)
            .find(|&v| v.max_data() * 8 >= segments.iter().map(|s| s.total_size_bits(v)).sum())
    }

That 

Using rustfilt we get:

core::iter::adapters::map::map_try_fold::<usize, drm_panic_qr::Version, (), core::ops::control_flow::ControlFlow<drm_panic_qr::Version>, drm_panic_qr::Version, core::iter::traits::iterator::Iterator::find::check<drm_panic_qr::Version, <drm_panic_qr::Version>::from_segments::{closure#0}>::{closure#0}>::{closure#0}
#

Both are for the same symbol, the __pfx__ is to do some stack probing.
LLVM may introduce this for other reasons.

So far, '1' symbols are Rust symbols, in the Linux kernel, for unnamed
closures and its prefix code checking for stack space, Miguel, do you
have something to add?

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ