diff options
| author | Paul E. McKenney <paulmck@kernel.org> | 2026-09-18 17:14:19 -0700 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-09-29 21:02:51 +0200 |
| commit | 66b29025b6761d9e0a8bd4d1b813b1f2c3c1a28e (patch) | |
| tree | f7bb243f03f9d8f1d6ee8a012c09241c737823e9 /include/linux/wait.h | |
| parent | cefc1a24ace53c9b26f5adee1f60a439cc0d53a4 (diff) | |
wait: Use accessor for hrtimer_sleeper ->task field
The hrtimer_sleeper structure's ->task field is used as a flag to indicate
that the associated hrtimer has expired. This means that the hrtimer
handler can be storing to this field while other code is loading from it
to check for expiry. Note that additional races appear for hrtimers that
can be restarted, which could be argued to be a user error. However, that
is no reason to let the compiler introduce additional confusion, and to
this end, the hrtimer_sleeper_task_get() was introduced, use of which also
has the benefit of avoiding open-code access to hrtimer_sleeper innards.
Therefore, apply this accessor to the __wait_event_hrtimeout() macro.
KCSAN located this issue.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260919001428.3133388-3-paulmck@kernel.org
Diffstat (limited to 'include/linux/wait.h')
| -rw-r--r-- | include/linux/wait.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h index 7e215330199c..c2af98b0074d 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -556,7 +556,7 @@ do { \ } \ \ __ret = ___wait_event(wq_head, condition, state, 0, 0, \ - if (!__t.task) { \ + if (!hrtimer_sleeper_task_get(&__t)) { \ __ret = -ETIME; \ break; \ } \ |
