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] [day] [month] [year] [list]
Message-ID: <CANiq72kWumOHt=VgV3mb2G4mOE3bCVUCUrKdjk4caFJPVCTBbA@mail.gmail.com>
Date: Tue, 25 Mar 2025 20:48:17 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, 
	Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>, 
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, 
	Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH] rust: workaround `bindgen` issue with forward references
 to `enum` types

On Tue, Mar 25, 2025 at 7:43 PM Miguel Ojeda <ojeda@...nel.org> wrote:
>
> Instead, let's have a section at the top of our `bindings_helper.h` that
> `#include`s the headers with the affected types -- hopefully there are
> not many cases and there is a single ordering that covers all cases.

By the way, I was curious and from a quick look at generated bindings
lines matching `type.*i32` for a x86_64 build I have, I see only other
three cases:

  - `key_serial_t` is not an `enum`, i.e. it is correct.

  - `fs_value_type` and `drm_mode_status` are both `enum`s, and they
indeed suffer from this issue. However, we do not use them and I don't
see any patches posted for them either.

Those are good news.

However, there are also bad news: if for instance we actually needed
either of those two latter ones, then we cannot just include the
header that defines them, because that header happens to include
others that in turn use forward references to that `enum` the root one
defines.

So in some cases, if we start to use them before we have a fix, would
require C header changes to avoid the forward references. Thus, for
those, I think it may be simpler to instead use a cast and mark them
with a comment so that we know we should clean them up.

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ