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: <D8PMQ9AY26ST.1PH9M02PY6JI2@proton.me>
Date: Tue, 25 Mar 2025 20:29:01 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Tamir Duberstein <tamird@...il.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>, Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>, 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>, Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>, Brendan Higgins <brendan.higgins@...ux.dev>, David Gow <davidgow@...gle.com>, Rae Moar <rmoar@...gle.com>, Bjorn Helgaas <bhelgaas@...gle.com>, Luis Chamberlain <mcgrof@...nel.org>, Russ Weight <russ.weight@...ux.dev>, Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>, linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org, linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
	linux-pci@...r.kernel.org, linux-block@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v5 0/6] rust: reduce pointer casts, enable related lints

On Tue Mar 25, 2025 at 6:17 PM CET, Tamir Duberstein wrote:
> On Tue, Mar 25, 2025 at 11:33 AM Benno Lossin <benno.lossin@...ton.me> wrote:
>> On Tue Mar 25, 2025 at 2:34 PM CET, Tamir Duberstein wrote:
>> > On Tue, Mar 25, 2025 at 7:05 AM Benno Lossin <benno.lossin@...ton.me> wrote:
>> >> On Mon Mar 24, 2025 at 10:59 PM CET, Tamir Duberstein wrote:
>> >> > On Mon, Mar 24, 2025 at 5:55 PM Benno Lossin <benno.lossin@...ton.me> wrote:
>> >> >> On Mon Mar 24, 2025 at 9:55 PM CET, Tamir Duberstein wrote:
>> >> >> > On Mon, Mar 24, 2025 at 4:16 PM Benno Lossin <benno.lossin@...ton.me> wrote:
>> >> >> >> I'll leave it up to you what you want to do with this: add it to this
>> >> >> >> series, make a new one, or let someone else handle it. If you don't want
>> >> >> >> to handle it, let me know, then I'll create a good-first-issue :)
>> >> >> >
>> >> >> > I'll add a patch for `cast_lossless` -- the rest should probably go
>> >> >> > into an issue.
>> >> >>
>> >> >> Do you mind filing the issue? Then you can decide yourself what you want
>> >> >> to do yourself vs what you want to leave for others. Feel free to copy
>> >> >> from my mail summary.
>> >> >
>> >> > Well, I don't really know what's left to do. We're pretty close at
>> >> > this point to having enabled everything but the nukes. Then there's
>> >> > the strict provenance thing, which I suppose we can write down.
>> >>
>> >> Yes, but there are also these from my original mail:
>> >> * `shared_ref as *const _` (for example in rust/kernel/uaccess.rs:247,
>> >>   rust/kernel/str.rs:32 and rust/kernel/fs/file.rs:367), these we can
>> >>   replace with `let ptr: *const ... = shared_ref;`. Don't know if there
>> >>   is a clippy lint for this.
>> >
>> > I don't think we should go fixing things for which we don't have a
>> > clippy lint. That way lies madness, particularly as patches begin to
>> > be carried by other trees.
>>
>> There already exists a lint for that: `clippy::ref_as_ptr` (almost
>> created an issue asking for one :)
>
> 🫡 picked this one up as well.

Sniped yet again :)

Thanks a lot for adding this one as well.

>> Here is another lint that we probably want to enable (after the `&raw
>> {const,mut}` series lands): `clippy::borrow_as_ptr`.
>
> This sounds like a good one to file.

Since `raw_ref_op` is already enabled in rust-next, I just filed it:

    https://github.com/Rust-for-Linux/linux/issues/1152

---
Cheers,
Benno


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ