Go to file
Florian Westphal a60f7bf4a1 netfilter: nft_set_rbtree: continue traversal if element is inactive
When the rbtree lookup function finds a match in the rbtree, it sets the
range start interval to a potentially inactive element.

Then, after tree lookup, if the matching element is inactive, it returns
NULL and suppresses a matching result.

This is wrong and leads to false negative matches when a transaction has
already entered the commit phase.

cpu0					cpu1
  has added new elements to clone
  has marked elements as being
  inactive in new generation
					perform lookup in the set
  enters commit phase:
I) increments the genbit
					A) observes new genbit
					B) finds matching range
					C) returns no match: found
					range invalid in new generation
II) removes old elements from the tree
					C New nft_lookup happening now
				       	  will find matching element,
					  because it is no longer
					  obscured by old, inactive one.

Consider a packet matching range r1-r2:

cpu0 processes following transaction:
1. remove r1-r2
2. add r1-r3

P is contained in both ranges. Therefore, cpu1 should always find a match
for P.  Due to above race, this is not the case:

cpu1 does find r1-r2, but then ignores it due to the genbit indicating
the range has been removed.  It does NOT test for further matches.

The situation persists for all lookups until after cpu0 hits II) after
which r1-r3 range start node is tested for the first time.

Move the "interval start is valid" check ahead so that tree traversal
continues if the starting interval is not valid in this generation.

Thanks to Stefan Hanreich for providing an initial reproducer for this
bug.

Reported-by: Stefan Hanreich <s.hanreich@proxmox.com>
Fixes: c1eda3c639 ("netfilter: nft_rbtree: ignore inactive matching element with no descendants")
Signed-off-by: Florian Westphal <fw@strlen.de>
2025-09-10 20:30:37 +02:00
Documentation doc: mptcp: net.mptcp.pm_type is deprecated 2025-09-09 18:39:52 -07:00
LICENSES
arch Including fixes from netfilter, wireless and Bluetooth. 2025-09-04 09:59:15 -07:00
block
certs
crypto
drivers macsec: sync features on RTM_NEWLINK 2025-09-09 18:28:27 -07:00
fs a ksmbd server fix 2025-09-03 20:44:15 -07:00
include Including fixes from netfilter, wireless and Bluetooth. 2025-09-04 09:59:15 -07:00
init
io_uring
ipc
kernel sched: Fix sched_numa_find_nth_cpu() if mask offline 2025-09-03 12:20:06 -04:00
lib hardening fixes for v6.17-rc4 2025-08-31 08:56:45 -07:00
mm slab fixes for 6.17-rc5 2025-09-04 09:54:20 -07:00
net netfilter: nft_set_rbtree: continue traversal if element is inactive 2025-09-10 20:30:37 +02:00
rust
samples
scripts
security
sound ALSA: hda/hdmi: Add pin fix for another HP EliteDesk 800 G4 model 2025-09-01 13:51:57 +02:00
tools selftests: mptcp: shellcheck: support v0.11.0 2025-09-09 18:39:52 -07:00
usr
virt
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap MAINTAINERS: Update Nobuhiro Iwamatsu's email address 2025-09-01 10:36:10 +02:00
.pylintrc
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Including fixes from netfilter, wireless and Bluetooth. 2025-09-04 09:59:15 -07:00
Makefile Linux 6.17-rc4 2025-08-31 15:33:07 -07:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.