<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netfilter, branch v6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.2</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-01-31T13:02:48Z</updated>
<entry>
<title>Revert "netfilter: conntrack: fix bug in for_each_sctp_chunk"</title>
<updated>2023-01-31T13:02:48Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2023-01-26T01:35:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bd0e06f0def75ba26572a94e5350324474a55562'/>
<id>urn:sha1:bd0e06f0def75ba26572a94e5350324474a55562</id>
<content type='text'>
There is no bug.  If sch-&gt;length == 0, this would result in an infinite
loop, but first caller, do_basic_checks(), errors out in this case.

After this change, packets with bogus zero-length chunks are no longer
detected as invalid, so revert &amp; add comment wrt. 0 length check.

Fixes: 98ee00774525 ("netfilter: conntrack: fix bug in for_each_sctp_chunk")
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: unify established states for SCTP paths</title>
<updated>2023-01-24T08:52:52Z</updated>
<author>
<name>Sriram Yagnaraman</name>
<email>sriram.yagnaraman@est.tech</email>
</author>
<published>2023-01-24T01:47:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a44b7651489f26271ac784b70895e8a85d0cebf4'/>
<id>urn:sha1:a44b7651489f26271ac784b70895e8a85d0cebf4</id>
<content type='text'>
An SCTP endpoint can start an association through a path and tear it
down over another one. That means the initial path will not see the
shutdown sequence, and the conntrack entry will remain in ESTABLISHED
state for 5 days.

By merging the HEARTBEAT_ACKED and ESTABLISHED states into one
ESTABLISHED state, there remains no difference between a primary or
secondary path. The timeout for the merged ESTABLISHED state is set to
210 seconds (hb_interval * max_path_retrans + rto_max). So, even if a
path doesn't see the shutdown sequence, it will expire in a reasonable
amount of time.

With this change in place, there is now more than one state from which
we can transition to ESTABLISHED, COOKIE_ECHOED and HEARTBEAT_SENT, so
handle the setting of ASSURED bit whenever a state change has happened
and the new state is ESTABLISHED. Removed the check for dir==REPLY since
the transition to ESTABLISHED can happen only in the reply direction.

Fixes: 9fb9cbb1082d ("[NETFILTER]: Add nf_conntrack subsystem.")
Signed-off-by: Sriram Yagnaraman &lt;sriram.yagnaraman@est.tech&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>Revert "netfilter: conntrack: add sctp DATA_SENT state"</title>
<updated>2023-01-24T08:52:32Z</updated>
<author>
<name>Sriram Yagnaraman</name>
<email>sriram.yagnaraman@est.tech</email>
</author>
<published>2023-01-24T01:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13bd9b31a969b03c8ec1d4eb0f2b9aebd30ebfd8'/>
<id>urn:sha1:13bd9b31a969b03c8ec1d4eb0f2b9aebd30ebfd8</id>
<content type='text'>
This reverts commit (bff3d0534804: "netfilter: conntrack: add sctp
DATA_SENT state")

Using DATA/SACK to detect a new connection on secondary/alternate paths
works only on new connections, while a HEARTBEAT is required on
connection re-use. It is probably consistent to wait for HEARTBEAT to
create a secondary connection in conntrack.

Signed-off-by: Sriram Yagnaraman &lt;sriram.yagnaraman@est.tech&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: fix bug in for_each_sctp_chunk</title>
<updated>2023-01-24T08:52:31Z</updated>
<author>
<name>Sriram Yagnaraman</name>
<email>sriram.yagnaraman@est.tech</email>
</author>
<published>2023-01-24T01:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=98ee0077452527f971567db01386de3c3d97ce13'/>
<id>urn:sha1:98ee0077452527f971567db01386de3c3d97ce13</id>
<content type='text'>
skb_header_pointer() will return NULL if offset + sizeof(_sch) exceeds
skb-&gt;len, so this offset &lt; skb-&gt;len test is redundant.

if sch-&gt;length == 0, this will end up in an infinite loop, add a check
for sch-&gt;length &gt; 0

Fixes: 9fb9cbb1082d ("[NETFILTER]: Add nf_conntrack subsystem.")
Suggested-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Sriram Yagnaraman &lt;sriram.yagnaraman@est.tech&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE</title>
<updated>2023-01-24T08:52:31Z</updated>
<author>
<name>Sriram Yagnaraman</name>
<email>sriram.yagnaraman@est.tech</email>
</author>
<published>2023-01-24T01:47:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a9993591fa94246b16b444eea55d84c54608282a'/>
<id>urn:sha1:a9993591fa94246b16b444eea55d84c54608282a</id>
<content type='text'>
RFC 9260, Sec 8.5.1 states that for ABORT/SHUTDOWN_COMPLETE, the chunk
MUST be accepted if the vtag of the packet matches its own tag and the
T bit is not set OR if it is set to its peer's vtag and the T bit is set
in chunk flags. Otherwise the packet MUST be silently dropped.

Update vtag verification for ABORT/SHUTDOWN_COMPLETE based on the above
description.

Fixes: 9fb9cbb1082d ("[NETFILTER]: Add nf_conntrack subsystem.")
Signed-off-by: Sriram Yagnaraman &lt;sriram.yagnaraman@est.tech&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_set_rbtree: skip elements in transaction from garbage collection</title>
<updated>2023-01-23T20:38:33Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2023-01-14T22:49:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d235d6ce75c12a7fdee375eb211e4116f7ab01b'/>
<id>urn:sha1:5d235d6ce75c12a7fdee375eb211e4116f7ab01b</id>
<content type='text'>
Skip interference with an ongoing transaction, do not perform garbage
collection on inactive elements. Reset annotated previous end interval
if the expired element is marked as busy (control plane removed the
element right before expiration).

Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support")
Reviewed-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_set_rbtree: Switch to node list walk for overlap detection</title>
<updated>2023-01-23T20:36:38Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2023-01-14T22:38:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c9e6978e2725a7d4b6cd23b2facd3f11422c0643'/>
<id>urn:sha1:c9e6978e2725a7d4b6cd23b2facd3f11422c0643</id>
<content type='text'>
...instead of a tree descent, which became overly complicated in an
attempt to cover cases where expired or inactive elements would affect
comparisons with the new element being inserted.

Further, it turned out that it's probably impossible to cover all those
cases, as inactive nodes might entirely hide subtrees consisting of a
complete interval plus a node that makes the current insertion not
overlap.

To speed up the overlap check, descent the tree to find a greater
element that is closer to the key value to insert. Then walk down the
node list for overlap detection. Starting the overlap check from
rb_first() unconditionally is slow, it takes 10 times longer due to the
full linear traversal of the list.

Moreover, perform garbage collection of expired elements when walking
down the node list to avoid bogus overlap reports.

For the insertion operation itself, this essentially reverts back to the
implementation before commit 7c84d41416d8 ("netfilter: nft_set_rbtree:
Detect partial overlaps on insertion"), except that cases of complete
overlap are already handled in the overlap detection phase itself, which
slightly simplifies the loop to find the insertion point.

Based on initial patch from Stefano Brivio, including text from the
original patch description too.

Fixes: 7c84d41416d8 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion")
Reviewed-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: conntrack: handle tcp challenge acks during connection reuse</title>
<updated>2023-01-17T22:00:06Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2023-01-11T13:42:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c410cb974f2ba562920ecb8492ee66945dcf88af'/>
<id>urn:sha1:c410cb974f2ba562920ecb8492ee66945dcf88af</id>
<content type='text'>
When a connection is re-used, following can happen:
[ connection starts to close, fin sent in either direction ]
 &gt; syn   # initator quickly reuses connection
 &lt; ack   # peer sends a challenge ack
 &gt; rst   # rst, sequence number == ack_seq of previous challenge ack
 &gt; syn   # this syn is expected to pass

Problem is that the rst will fail window validation, so it gets
tagged as invalid.

If ruleset drops such packets, we get repeated syn-retransmits until
initator gives up or peer starts responding with syn/ack.

Before the commit indicated in the "Fixes" tag below this used to work:

The challenge-ack made conntrack re-init state based on the challenge
ack itself, so the following rst would pass window validation.

Add challenge-ack support: If we get ack for syn, record the ack_seq,
and then check if the rst sequence number matches the last ack number
seen in reverse direction.

Fixes: c7aab4f17021 ("netfilter: nf_conntrack_tcp: re-init for syn packets only")
Reported-by: Michal Tesar &lt;mtesar@redhat.com&gt;
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: nft_payload: incorrect arithmetics when fetching VLAN header bits</title>
<updated>2023-01-11T18:18:04Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2023-01-11T16:07:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=696e1a48b1a1b01edad542a1ef293665864a4dd0'/>
<id>urn:sha1:696e1a48b1a1b01edad542a1ef293665864a4dd0</id>
<content type='text'>
If the offset + length goes over the ethernet + vlan header, then the
length is adjusted to copy the bytes that are within the boundaries of
the vlan_ethhdr scratchpad area. The remaining bytes beyond ethernet +
vlan header are copied directly from the skbuff data area.

Fix incorrect arithmetic operator: subtract, not add, the size of the
vlan header in case of double-tagged packets to adjust the length
accordingly to address CVE-2023-0179.

Reported-by: Davide Ornaghi &lt;d.ornaghi97@gmail.com&gt;
Fixes: f6ae9f120dad ("netfilter: nft_payload: add C-VLAN support")
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.</title>
<updated>2023-01-11T18:18:04Z</updated>
<author>
<name>Gavrilov Ilia</name>
<email>Ilia.Gavrilov@infotecs.ru</email>
</author>
<published>2023-01-11T11:57:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9ea4b476cea1b7d461d16dda25ca3c7e616e2d15'/>
<id>urn:sha1:9ea4b476cea1b7d461d16dda25ca3c7e616e2d15</id>
<content type='text'>
When first_ip is 0, last_ip is 0xFFFFFFFF, and netmask is 31, the value of
an arithmetic expression 2 &lt;&lt; (netmask - mask_bits - 1) is subject
to overflow due to a failure casting operands to a larger data type
before performing the arithmetic.

Note that it's harmless since the value will be checked at the next step.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: b9fed748185a ("netfilter: ipset: Check and reject crazy /0 input parameters")
Signed-off-by: Ilia.Gavrilov &lt;Ilia.Gavrilov@infotecs.ru&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
</feed>
