[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72k6vhzR8W72B-vqHy3rrTv+y9rYECx9bfHX=eD6TXye8A@mail.gmail.com>
Date: Mon, 19 May 2025 23:42:01 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Burak Emir <bqe@...gle.com>
Cc: Jann Horn <jannh@...gle.com>, 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>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v8 3/5] rust: add bitmap API.
On Mon, May 19, 2025 at 10:08 PM Burak Emir <bqe@...gle.com> wrote:
>
> The "unsafe" here should serve as reminder to argue why it is ok to
> not have any ordering guarantees.
`unsafe` should be used for unsafe functions, not as a general
"danger" or "advanced" marker.
(Having such a marker could be useful, but `unsafe fn` is not it)
> The last sentence is supposed to say: when you have a &mut bitmap, you
> can reborrow it as &bitmap, and then happily call this atomic op.
> Even though it is unnecessary.
I don't think that is related to safety preconditions. A "# Safety"
section is intended to explain what the preconditions are.
So, for instance, stating "The caller must ensure that this is safe"
does not add much.
Cheers,
Miguel
Powered by blists - more mailing lists