From: Florian Westphal <fw@strlen.de>
To: kadlec@netfilter.org
Cc: <netfilter-devel@vger.kernel.org>, Florian Westphal <fw@strlen.de>
Subject: [PATCH ipset 4/5] tests: hash:net,iface.t: add reproducer for UaF
Date: Thu, 23 Jul 2026 12:35:03 +0200 [thread overview]
Message-ID: <20260723103504.3175-5-fw@strlen.de> (raw)
In-Reply-To: <20260723103504.3175-1-fw@strlen.de>
A faulty (never merged) kernel patch for ipset had a use-after-free
where an element was free'd without unlinking it from the table, yet
the faulty kernel passed all tests. Check that we don't free
non-matching elements, the request to delete is for non-existing
element, no free must happen and the command must fail.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
tests/hash:net,iface.t | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/hash:net,iface.t b/tests/hash:net,iface.t
index bcd0ba451c62..556d56df5c4b 100644
--- a/tests/hash:net,iface.t
+++ b/tests/hash:net,iface.t
@@ -228,6 +228,11 @@
0 ipset -! a test 2.0.0.20/25,wlan0 timeout 700
# Counters and timeout: check counters
0 ./check_extensions test 2.0.0.0/25,wlan0 700 13 12479
+0 ipset flush test
+0 ipset add test 10.0.1.0/24,eth0
+1 ( for i in $(seq 1 10000); do ipset del test 10.0.1.0/24,eth1 ; done )
+0 ipset t test 10.0.1.0/24,eth0
+0 ipset list
# Counters and timeout: destroy set
0 ipset x test
# eof
--
2.54.0
next prev parent reply other threads:[~2026-07-23 10:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 10:34 [PATCH ipset 0/5] ipset test updates Florian Westphal
2026-07-23 10:35 ` [PATCH ipset 1/5] tests: check_extensions: introduce and use IPSET_MACHINE_SLOW Florian Westphal
2026-07-23 10:35 ` [PATCH ipset 2/5] tests: hash:net.t: prefer tail -n Florian Westphal
2026-07-23 10:35 ` [PATCH ipset 3/5] tests: prefer diff -u to cmp Florian Westphal
2026-07-23 10:35 ` Florian Westphal [this message]
2026-07-23 10:35 ` [PATCH ipset 5/5] tests: match_target.t check for proper cidr matching Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260723103504.3175-5-fw@strlen.de \
--to=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.