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:   Mon, 13 Feb 2023 16:03:46 +0000
From:   Eric Curtin <ecurtin@...hat.com>
To:     Andrea Righi <andrea.righi@...onical.com>
Cc:     Martin Rodriguez Reboredo <yakoyoku@...il.com>,
        miguel.ojeda.sandonis@...il.com, alex.gaynor@...il.com,
        bjorn3_gh@...tonmail.com, boqun.feng@...il.com, dxu@...uu.xyz,
        gary@...yguo.net, linux-kernel@...r.kernel.org, ojeda@...nel.org,
        rust-for-linux@...r.kernel.org, wedsonaf@...il.com
Subject: Re: [PATCH] rust: fix regexp in scripts/is_rust_module.sh

On Mon, 13 Feb 2023 at 15:48, Andrea Righi <andrea.righi@...onical.com> wrote:
>
> On Mon, Feb 13, 2023 at 12:13:39PM -0300, Martin Rodriguez Reboredo wrote:
> > On Mon, Feb 13, 2023 at 1:19 PM Miguel Ojeda <ojeda@...nel.org> wrote:
> > > On Fri, Feb 10, 2023 at 4:26 PM Andrea Righi <andrea.righi@...onical.com> wrote:
> > > >
> > > > nm can use "R" or "r" to show read-only data sections, but
> > > > scripts/is_rust_module.sh can only recognize "r", so with some versions
> > > > of binutils it can fail to detect if a module is a Rust module or not.
> > >
> > > Do you know which versions? If so, it would be nice to document it here.
> > >
> > > > Moreover, with this patch applied I can also relax the constraint of
> > > > "RUST depends on !DEBUG_INFO_BTF" and build a kernel with Rust and BTF
> > > > enabled at the same time (of course BTF generation is still skipped for
> > > > Rust modules).
> > >
> > > Even if that build succeeds, can you load the modules? i.e. the
> > > constraint was there due to
> > > https://github.com/Rust-for-Linux/linux/issues/735.
> >
> > Issue was that the kernel couldn't even load C modules, Rust CUs must be
> > skipped in vmlinux for it to work, and because of that the constraint
> > !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE [1] cannot be relaxed until
> > version 1.24+ of Pahole is the minimum requirement by the kernel. I'm OK
> > with this change but keep in mind that it won't remedy that condition.
> >
> > Link: https://lore.kernel.org/bpf/20230111152050.559334-1-yakoyoku@gmail.com/ [1]
>
> Oh yes, I'm using pahole 1.24, that's probably why it's all working for
> me. So we can't just drop !DEBUG_INFO_BTF, but we can definitely relax
> the constraint to "!DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE".

Yup the patch is ok, but we can only build with RUST and
DEBUG_INFO_BTF if we have pahole 1.24+ because that is the version
smart enough to exclude the Rust CUs.

If you have a version of pahole < 1.24 and you want to include RUST
you basically should not have DEBUG_INFO_BTF on at all because your
build will fail (unless this change alters the list of CUs passed to
pahole).

What is a little confusing is scripts/is_rust_module.sh and pahole
"--lang_exclude=rust" feature both attempt to do the same thing,
recognize and skip Rust CUs

>
> -Andrea
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ