diff options
| author | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | 2026-09-08 11:22:14 -0400 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@kernel.org> | 2026-09-18 16:07:11 -0700 |
| commit | 68d4a710ab3234a50e5988693f96fc78b24fa66d (patch) | |
| tree | fbe746f4aadf2b9c34f5d3d6af44dafd6e2c50ad /tools/perf/scripts/python | |
| parent | 0b8114b25f170df7577ae592a195efc4643d2484 (diff) | |
| download | linux-next-68d4a710ab3234a50e5988693f96fc78b24fa66d.tar.gz linux-next-68d4a710ab3234a50e5988693f96fc78b24fa66d.zip | |
hazptr: handle NULL address in hazptr_detach
When hazptr_acquire loads a NULL pointer, it sets:
- slot_item->slot.addr = NULL,
- slot_item->ctx.ctx = ctx
- ctx->slot = slot
And it returns NULL.
Then hazptr_detach is called on this ctx, it will act on the ctx as if
needed to be promoted to backup slot, even though it has a NULL addr.
Looking at what hazptr_note_context_switch() does before promoting
to backup slot, it checks for a NULL slot->addr, which is exactly
what is missing from hazptr_detach.
With this in place there would be no need to explicitly check the
hazptr_acquire() return value before calling hazptr_detach().
hazptr_release() has a early return check for NULL addr as well, so it
makes sense that detach does an early return (no-op) similarly.
Fixes: 6357ec235c59 ("hazptrtorture: Fix hazptr ownership issue")
Reported-by: kernel test robot <yi1.lai@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202608130915.62b53936-lkp@intel.com
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Boqun Feng <boqun@kernel.org>
Cc: Bradley Morgan <brads@mainlining.org>
Cc: <rcu@vger.kernel.org>
Cc: <lkmm@lists.linux.dev>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: kernel test robot <yi1.lai@intel.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
