Re: [PATCH 4/5] rust: hrtimer: use READ_ONCE instead of read_volatile

From: Gary Guo

Date: Tue Jan 06 2026 - 10:23:11 EST


On Tue, 06 Jan 2026 13:37:34 +0100
Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:

> "FUJITA Tomonori" <fujita.tomonori@xxxxxxxxx> writes:
> >
> > Sorry, of course this should be:
> >
> > +__rust_helper ktime_t rust_helper_hrtimer_get_expires(const struct hrtimer *timer)
> > +{
> > + return hrtimer_get_expires(timer);
> > +}
> >
>
> This is a potentially racy read. As far as I recall, we determined that
> using read_once is the proper way to handle the situation.
>
> I do not think it makes a difference that the read is done by C code.

If that's the case I think the C code should be fixed by inserting the
READ_ONCE?

Best,
Gary