[PATCH v2 0/2] xarray: initialise the offset of a new root node

From: Andrew Morton

Date: Sat Nov 21 2026 - 17:18:31 EST


An RCU XArray walker can read a stale root offset just before another
thread grows the tree and links that root beneath a new one. The walker
can then return an entry with the wrong index or skip entries. Check the
root offset after slab reuse and initialize it on allocation.

Nickolai Zeldovich (2):
lib/test_xarray: check the offset of new root nodes
xarray: initialise the offset of a new root node

lib/test_xarray.c | 33 +++++++++++++++++++++++++++++++++
lib/xarray.c | 6 +++---
2 files changed, 36 insertions(+), 3 deletions(-)