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: <DFWEIHKOKVQS.1MGF5PHL2JFVT@gmail.com>
Date: Sat, 24 Jan 2026 09:43:09 +0900
From: "Jesung Yang" <y.j3ms.n@...il.com>
To: <engineer.jjhama@...il.com>, "Miguel Ojeda" <ojeda@...nel.org>, "Boqun
 Feng" <boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Benno Lossin"
 <lossin@...nel.org>, "Andreas Hindborg" <a.hindborg@...nel.org>, "Alice
 Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>, "Danilo
 Krummrich" <dakr@...nel.org>, "Tamir Duberstein" <tamird@...nel.org>
Cc: <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 "Jesung Yang" <y.j3ms.n@...il.com>
Subject: Re: [PATCH v2] scripts: generate_rust_analyzer: fix resolution of
 #[pin_data] macros

On Fri Jan 23, 2026 at 10:18 PM KST, SeungJong Ha via B4 Relay wrote:
> From: SeungJong Ha <engineer.jjhama@...il.com>
>
> Currently, rust-analyzer fails to properly resolve structs annotated with
> `#[pin_data]`. This prevents IDE features like "Go to Definition" from
> working correctly for those structs.
>
> Add the missing configuration to `generate_rust_analyzer.py` to ensure
> the `pin-init` crate macros are handled correctly.
>
> Signed-off-by: SeungJong Ha <engineer.jjhama@...il.com>

Perhaps I'm missing something, but I wasn't able to reproduce this
problem (which I think is expected as the `kernel` crate already depends
on `pin_init`) with the following setup:

Tree: linux-next (next-20260122) [1]
      (includes latest changes from `rust-fixes` and `pin-init-next`)
Files: samples/rust/rust_*.rs, specifically rust_configfs.rs
rust-analyzer: 2024-04-29 (which corresponds to our MSRV), 2026-01-12

Could you share your environment details and a minimal reproducible
example?

Thanks!

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tag/?h=next-20260122

Best regards,
Jesung

> ---
> I encountered an issue where rust-analyzer fails to analyze
> structs decorated with the #[pin_data] attribute while testing
> Rust kernel modules.
>
> It appears that the dependencies for pin-init and drivers were
> missing from the analyzer's configuration. This patch adds
> those missing dependencies.
>
> I have verified that my rust-analyzer correctly processes
> \#[pin_data] structs after applying this fix.
>
> Best regards, SeungJong
> ---
> Changes in v2:
> - Fix typos
> - Drop the quote module workaround (will be handled separately)
> - Rebase onto `rust-fixes`
> - Add `pin_init` dependency for Rust drivers
> - Link to v1: https://lore.kernel.org/r/20260123-fix-pin-init-crate-dependecies-v1-1-1c6cfe9aa352@gmail.com
> ---
>  scripts/generate_rust_analyzer.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
> index 3b645da90092..766c2d91cd81 100755
> --- a/scripts/generate_rust_analyzer.py
> +++ b/scripts/generate_rust_analyzer.py
> @@ -214,7 +214,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
>              append_crate(
>                  name,
>                  path,
> -                ["core", "kernel"],
> +                ["core", "kernel", "pin_init"],
>                  cfg=cfg,
>              )
>  
>
> ---
> base-commit: 6d7fef23043553336259211346b6b135d6c1f4c3
> change-id: 20260123-fix-pin-init-crate-dependecies-b94ac4247a48
>
> Best regards,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ