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: <CANiq72msV_jLFDtA4LUk01W6WF_hJEivdeKyR14xmA6ocYx3RQ@mail.gmail.com>
Date: Mon, 8 Sep 2025 11:33:24 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Burak Emir <bqe@...gle.com>, Kaibo Ma <ent3rm4n@...il.com>
Cc: Yury Norov <yury.norov@...il.com>, Kees Cook <kees@...nel.org>, 
	Rasmus Villemoes <linux@...musvillemoes.dk>, Viresh Kumar <viresh.kumar@...aro.org>, 
	Miguel Ojeda <ojeda@...nel.org>, 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>, 
	"Gustavo A . R . Silva" <gustavoars@...nel.org>, Carlos LLama <cmllamas@...gle.com>, 
	Pekka Ristola <pekkarr@...tonmail.com>, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v16 3/5] rust: add bitmap API.

On Mon, Sep 8, 2025 at 9:22 AM Burak Emir <bqe@...gle.com> wrote:
>
> +    #[test]
> +    fn owned_bitmap_out_of_bounds() -> Result<(), AllocError> {
> +        // TODO: Kunit #[test]s do not support `cfg` yet,
> +        // so we add it here in the body.
> +        #[cfg(not(CONFIG_RUST_BITMAP_HARDENED))]
> +        {
> +            let mut b = BitmapVec::new(128, GFP_KERNEL)?;
> +            b.set_bit(2048);
> +            b.set_bit_atomic(2048);
> +            b.clear_bit(2048);
> +            b.clear_bit_atomic(2048);
> +            assert_eq!(None, b.next_bit(2048));
> +            assert_eq!(None, b.next_zero_bit(2048));
> +            assert_eq!(None, b.last_bit());
> +        }
> +        Ok(())
> +    }

For context, Kaibo Ma already posted a patch to solve that limitation,
so we should be able to clean this up e.g. next cycle:

https://lore.kernel.org/rust-for-linux/20250907201558.104566-2-ent3rm4n@gmail.com/

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ