linux-stable/tools
Matthew Wilcox (Oracle) ec5cf2977c XArray: Do not return sibling entries from xa_load()
commit cbc0285433 upstream.

It is possible for xa_load() to observe a sibling entry pointing to
another sibling entry.  An example:

Thread A:		Thread B:
			xa_store_range(xa, entry, 188, 191, gfp);
xa_load(xa, 191);
entry = xa_entry(xa, node, 63);
[entry is a sibling of 188]
			xa_store_range(xa, entry, 184, 191, gfp);
if (xa_is_sibling(entry))
offset = xa_to_sibling(entry);
entry = xa_entry(xas->xa, node, offset);
[entry is now a sibling of 184]

It is sufficient to go around this loop until we hit a non-sibling entry.
Sibling entries always point earlier in the node, so we are guaranteed
to terminate this search.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Fixes: 6b24ca4a1a ("mm: Use multi-index entries in the page cache")
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:48:39 +02:00
..
accounting
arch x86/bugs: Increase the x86 bugs vector size to two u32s 2023-08-08 20:04:51 +02:00
bootconfig
bpf bpftool: Use a local bpf_perf_event_value to fix accessing its fields 2023-09-13 09:48:00 +02:00
build
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-05-11 10:56:24 +02:00
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-09-13 09:47:53 +02:00
iio
include tools/nolibc: ensure stack protector guard is never zero 2023-07-27 08:56:48 +02:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix realloc API handling in zero-sized edge cases 2023-09-13 09:48:00 +02:00
memory-model
mm
net/ynl tools: ynl-gen: fix enum index in _decode_enum(..) 2023-08-03 10:25:53 +02:00
objtool x86/retpoline,kprobes: Fix position of thunk sections with CONFIG_LTO_CLANG 2023-08-23 17:32:41 +02:00
pci
pcmcia
perf Revert "perf report: Append inlines to non-DWARF callchains" 2023-08-23 17:32:56 +02:00
power cpupower: Make TSC read per CPU for Mperf monitor 2023-05-08 10:46:49 -06:00
rcu
scripts
spi
testing XArray: Do not return sibling entries from xa_load() 2023-09-13 09:48:39 +02:00
thermal
time
tracing rtla/hwnoise: Reduce runtime to 75% 2023-07-19 16:36:36 +02:00
usb
verification
virtio tools/virtio: fix build break for aarch64 2023-07-19 16:36:41 +02:00
wmi
Makefile