Re: [PATCH v4 1/2] rust: hrtimer: Restrict expires() to safe contexts

FUJITA Tomonori <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Mon, 10 Aug 2026 13:11:00 +0200
Andreas Hindborg <[email protected]> wrote:

> "FUJITA Tomonori" <[email protected]> writes:
> 
>> From: FUJITA Tomonori <[email protected]>
>>
>> HrTimer::expires() previously read node.expires via a volatile load, which
>> can race with C-side updates. Rework the API so it is only callable with
>> exclusive access or from the callback context.
>>
>> Introduce expires_unchecked() with an explicit safety contract, switch
>> HrTimer::expires() to Pin<&mut Self>, add
>> HrTimerCallbackContext::expires(), and route the read through
>> hrtimer_get_expires() via a Rust helper.
>>
>> Fixes: 4b0147494275 ("rust: hrtimer: Add HrTimer::expires()")
>> Closes: https://lore.kernel.org/rust-for-linux/[email protected]/
>> Signed-off-by: FUJITA Tomonori <[email protected]>
> 
> This looks good to me now.
> 
> @Miguel, can you take this through rust or rust-fixes? Please add the
> missing bullet in the invariant on patch 2.
> 
> Acked-by: Andreas Hindborg <[email protected]>

Miguel, on the missing bullet Andreas mentioned: we agreed to leave it
as is.

Is this still fine to pick up for this cycle?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.