<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/netfilter, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-04-11T12:16:21+00:00</updated>
<entry>
<title>netfilter: ipset: use nla_strcmp for IPSET_ATTR_NAME attr</title>
<updated>2026-04-11T12:16:21+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2026-03-30T12:16:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=caad62e0a731b2d75d1343dc4393c33ede4a91d2'/>
<id>urn:sha1:caad62e0a731b2d75d1343dc4393c33ede4a91d2</id>
<content type='text'>
[ Upstream commit b7e8590987aa94c9dc51518fad0e58cb887b1db5 ]

IPSET_ATTR_NAME and IPSET_ATTR_NAMEREF are of NLA_STRING type, they
cannot be treated like a c-string.

They either have to be switched to NLA_NUL_STRING, or the compare
operations need to use the nla functions.

Fixes: f830837f0eed ("netfilter: ipset: list:set set type support")
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>netfilter: ipset: fix performance regression in swap operation</title>
<updated>2024-02-23T08:12:49+00:00</updated>
<author>
<name>Jozsef Kadlecsik</name>
<email>kadlec@netfilter.org</email>
</author>
<published>2024-01-29T09:57:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=653bc5e6d9995d7d5f497c665b321875a626161c'/>
<id>urn:sha1:653bc5e6d9995d7d5f497c665b321875a626161c</id>
<content type='text'>
commit 97f7cf1cd80eeed3b7c808b7c12463295c751001 upstream.

The patch "netfilter: ipset: fix race condition between swap/destroy
and kernel side add/del/test", commit 28628fa9 fixes a race condition.
But the synchronize_rcu() added to the swap function unnecessarily slows
it down: it can safely be moved to destroy and use call_rcu() instead.

Eric Dumazet pointed out that simply calling the destroy functions as
rcu callback does not work: sets with timeout use garbage collectors
which need cancelling at destroy which can wait. Therefore the destroy
functions are split into two: cancelling garbage collectors safely at
executing the command received by netlink and moving the remaining
part only into the rcu callback.

Link: https://lore.kernel.org/lkml/C0829B10-EAA6-4809-874E-E1E9C05A8D84@automattic.com/
Fixes: 28628fa952fe ("netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test")
Reported-by: Ale Crismani &lt;ale.crismani@automattic.com&gt;
Reported-by: David Wang &lt;00107082@163.com&gt;
Tested-by: David Wang &lt;00107082@163.com&gt;
Signed-off-by: Jozsef Kadlecsik &lt;kadlec@netfilter.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>netfilter: handle the connecting collision properly in nf_conntrack_proto_sctp</title>
<updated>2023-10-10T20:00:43+00:00</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2023-10-03T17:17:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=00d35e6b1672b973a2bf8de1cb8167b287aa5797'/>
<id>urn:sha1:00d35e6b1672b973a2bf8de1cb8167b287aa5797</id>
<content type='text'>
[ Upstream commit 8e56b063c86569e51eed1c5681ce6361fa97fc7a ]

In Scenario A and B below, as the delayed INIT_ACK always changes the peer
vtag, SCTP ct with the incorrect vtag may cause packet loss.

Scenario A: INIT_ACK is delayed until the peer receives its own INIT_ACK

  192.168.1.2 &gt; 192.168.1.1: [INIT] [init tag: 1328086772]
    192.168.1.1 &gt; 192.168.1.2: [INIT] [init tag: 1414468151]
    192.168.1.2 &gt; 192.168.1.1: [INIT ACK] [init tag: 1328086772]
  192.168.1.1 &gt; 192.168.1.2: [INIT ACK] [init tag: 1650211246] *
  192.168.1.2 &gt; 192.168.1.1: [COOKIE ECHO]
    192.168.1.1 &gt; 192.168.1.2: [COOKIE ECHO]
    192.168.1.2 &gt; 192.168.1.1: [COOKIE ACK]

Scenario B: INIT_ACK is delayed until the peer completes its own handshake

  192.168.1.2 &gt; 192.168.1.1: sctp (1) [INIT] [init tag: 3922216408]
    192.168.1.1 &gt; 192.168.1.2: sctp (1) [INIT] [init tag: 144230885]
    192.168.1.2 &gt; 192.168.1.1: sctp (1) [INIT ACK] [init tag: 3922216408]
    192.168.1.1 &gt; 192.168.1.2: sctp (1) [COOKIE ECHO]
    192.168.1.2 &gt; 192.168.1.1: sctp (1) [COOKIE ACK]
  192.168.1.1 &gt; 192.168.1.2: sctp (1) [INIT ACK] [init tag: 3914796021] *

This patch fixes it as below:

In SCTP_CID_INIT processing:
- clear ct-&gt;proto.sctp.init[!dir] if ct-&gt;proto.sctp.init[dir] &amp;&amp;
  ct-&gt;proto.sctp.init[!dir]. (Scenario E)
- set ct-&gt;proto.sctp.init[dir].

In SCTP_CID_INIT_ACK processing:
- drop it if !ct-&gt;proto.sctp.init[!dir] &amp;&amp; ct-&gt;proto.sctp.vtag[!dir] &amp;&amp;
  ct-&gt;proto.sctp.vtag[!dir] != ih-&gt;init_tag. (Scenario B, Scenario C)
- drop it if ct-&gt;proto.sctp.init[dir] &amp;&amp; ct-&gt;proto.sctp.init[!dir] &amp;&amp;
  ct-&gt;proto.sctp.vtag[!dir] != ih-&gt;init_tag. (Scenario A)

In SCTP_CID_COOKIE_ACK processing:
- clear ct-&gt;proto.sctp.init[dir] and ct-&gt;proto.sctp.init[!dir].
  (Scenario D)

Also, it's important to allow the ct state to move forward with cookie_echo
and cookie_ack from the opposite dir for the collision scenarios.

There are also other Scenarios where it should allow the packet through,
addressed by the processing above:

Scenario C: new CT is created by INIT_ACK.

Scenario D: start INIT on the existing ESTABLISHED ct.

Scenario E: start INIT after the old collision on the existing ESTABLISHED
ct.

  192.168.1.2 &gt; 192.168.1.1: sctp (1) [INIT] [init tag: 3922216408]
  192.168.1.1 &gt; 192.168.1.2: sctp (1) [INIT] [init tag: 144230885]
  (both side are stopped, then start new connection again in hours)
  192.168.1.2 &gt; 192.168.1.1: sctp (1) [INIT] [init tag: 242308742]

Fixes: 9fb9cbb1082d ("[NETFILTER]: Add nf_conntrack subsystem.")
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: don't write table validation state without mutex</title>
<updated>2023-05-11T14:03:26+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2023-04-13T15:13:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6cf1d03a423fb7bff1c8542ac0b506b158936508'/>
<id>urn:sha1:6cf1d03a423fb7bff1c8542ac0b506b158936508</id>
<content type='text'>
[ Upstream commit 9a32e9850686599ed194ccdceb6cd3dd56b2d9b9 ]

The -&gt;cleanup callback needs to be removed, this doesn't work anymore as
the transaction mutex is already released in the -&gt;abort function.

Just do it after a successful validation pass, this either happens
from commit or abort phases where transaction mutex is held.

Fixes: f102d66b335a ("netfilter: nf_tables: use dedicated mutex to guard transactions")
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>netfilter: ipset: Rework long task execution when adding/deleting entries</title>
<updated>2023-01-12T11:02:26+00:00</updated>
<author>
<name>Jozsef Kadlecsik</name>
<email>kadlec@netfilter.org</email>
</author>
<published>2022-12-30T12:24:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8964cc36ba011dc0e1041131fa2e91fb4c2a811b'/>
<id>urn:sha1:8964cc36ba011dc0e1041131fa2e91fb4c2a811b</id>
<content type='text'>
[ Upstream commit 5e29dc36bd5e2166b834ceb19990d9e68a734d7d ]

When adding/deleting large number of elements in one step in ipset, it can
take a reasonable amount of time and can result in soft lockup errors. The
patch 5f7b51bf09ba ("netfilter: ipset: Limit the maximal range of
consecutive elements to add/delete") tried to fix it by limiting the max
elements to process at all. However it was not enough, it is still possible
that we get hung tasks. Lowering the limit is not reasonable, so the
approach in this patch is as follows: rely on the method used at resizing
sets and save the state when we reach a smaller internal batch limit,
unlock/lock and proceed from the saved state. Thus we can avoid long
continuous tasks and at the same time removed the limit to add/delete large
number of elements in one step.

The nfnl mutex is held during the whole operation which prevents one to
issue other ipset commands in parallel.

Fixes: 5f7b51bf09ba ("netfilter: ipset: Limit the maximal range of consecutive elements to add/delete")
Reported-by: syzbot+9204e7399656300bf271@syzkaller.appspotmail.com
Signed-off-by: Jozsef Kadlecsik &lt;kadlec@netfilter.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>netfilter: h323: merge nat hook pointers into one</title>
<updated>2022-07-11T14:25:16+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-06-22T09:00:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d3f2d0a292c24fc624afb2b4f47f838e83775721'/>
<id>urn:sha1:d3f2d0a292c24fc624afb2b4f47f838e83775721</id>
<content type='text'>
sparse complains about incorrect rcu usage.

Code uses the correct rcu access primitives, but the function pointers
lack rcu annotations.

Collapse all of them into a single structure, then annotate the pointer.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_conntrack: add missing __rcu annotations</title>
<updated>2022-07-11T14:25:15+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-06-22T09:00:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6976890e8998afd8abbbd9fe27ed71387b24f57f'/>
<id>urn:sha1:6976890e8998afd8abbbd9fe27ed71387b24f57f</id>
<content type='text'>
Access to the hook pointers use correct helpers but the pointers lack
the needed __rcu annotation.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: pptp: use single option structure</title>
<updated>2022-02-04T05:30:28+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-01-20T15:09:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=20ff32024624102596f2b4083a17a97ca71d6cd8'/>
<id>urn:sha1:20ff32024624102596f2b4083a17a97ca71d6cd8</id>
<content type='text'>
Instead of exposing the four hooks individually use a sinle hook ops
structure.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: avoid useless indirection during conntrack destruction</title>
<updated>2022-01-09T22:30:13+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-01-07T04:03:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6ae7989c9af0d98ab64196f4f4c6f6499454bd23'/>
<id>urn:sha1:6ae7989c9af0d98ab64196f4f4c6f6499454bd23</id>
<content type='text'>
nf_ct_put() results in a usesless indirection:

nf_ct_put -&gt; nf_conntrack_put -&gt; nf_conntrack_destroy -&gt; rcu readlock +
indirect call of ct_hooks-&gt;destroy().

There are two _put helpers:
nf_ct_put and nf_conntrack_put.  The latter is what should be used in
code that MUST NOT cause a linker dependency on the conntrack module
(e.g. calls from core network stack).

Everyone else should call nf_ct_put() instead.

A followup patch will convert a few nf_conntrack_put() calls to
nf_ct_put(), in particular from modules that already have a conntrack
dependency such as act_ct or even nf_conntrack itself.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: convert to refcount_t api</title>
<updated>2022-01-09T22:30:13+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-01-07T04:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=719774377622bc4025d2a74f551b5dc2158c6c30'/>
<id>urn:sha1:719774377622bc4025d2a74f551b5dc2158c6c30</id>
<content type='text'>
Convert nf_conn reference counting from atomic_t to refcount_t based api.
refcount_t api provides more runtime sanity checks and will warn on
certain constructs, e.g. refcount_inc() on a zero reference count, which
usually indicates use-after-free.

For this reason template allocation is changed to init the refcount to
1, the subsequenct add operations are removed.

Likewise, init_conntrack() is changed to set the initial refcount to 1
instead refcount_inc().

This is safe because the new entry is not (yet) visible to other cpus.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
</feed>
