<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/selftests/netfilter, branch v6.0</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.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-09-07T13:06:26Z</updated>
<entry>
<title>selftests: nft_concat_range: add socat support</title>
<updated>2022-09-07T13:06:26Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-08-31T13:12:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25b327d4f818b9d41265ea3eea26d805216589b8'/>
<id>urn:sha1:25b327d4f818b9d41265ea3eea26d805216589b8</id>
<content type='text'>
There are different flavors of 'nc' around, this script fails on
my test vm because 'nc' is 'nmap-ncat' which isn't 100% compatible.

Add socat support and use it if available.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
</content>
</entry>
<entry>
<title>netfilter: remove nf_conntrack_helper sysctl and modparam toggles</title>
<updated>2022-08-31T10:12:32Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2022-08-26T06:49:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b118509076b39cc5e616c0680312b5caaca535fe'/>
<id>urn:sha1:b118509076b39cc5e616c0680312b5caaca535fe</id>
<content type='text'>
__nf_ct_try_assign_helper() remains in place but it now requires a
template to configure the helper.

A toggle to disable automatic helper assignment was added by:

  a9006892643a ("netfilter: nf_ct_helper: allow to disable automatic helper assignment")

in 2012 to address the issues described in "Secure use of iptables and
connection tracking helpers". Automatic conntrack helper assignment was
disabled by:

  3bb398d925ec ("netfilter: nf_ct_helper: disable automatic helper assignment")

back in 2016.

This patch removes the sysctl and modparam toggles, users now have to
rely on explicit conntrack helper configuration via ruleset.

Update tools/testing/selftests/netfilter/nft_conntrack_helper.sh to
check that auto-assignment does not happen anymore.

Acked-by: Aaron Conole &lt;aconole@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>testing: selftests: nft_flowtable.sh: rework test to detect offload failure</title>
<updated>2022-08-17T13:12:01Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-08-16T12:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c8550b9077d271b9b4fbe5a9a260eb021f371c4f'/>
<id>urn:sha1:c8550b9077d271b9b4fbe5a9a260eb021f371c4f</id>
<content type='text'>
This test fails on current kernel releases because the flotwable path
now calls dst_check from packet path and will then remove the offload.

Test script has two purposes:
1. check that file (random content) can be sent to other netns (and vv)
2. check that the flow is offloaded (rather than handled by classic
   forwarding path).

Since dst_check is in place, 2) fails because the nftables ruleset in
router namespace 1 intentionally blocks traffic under the assumption
that packets are not passed via classic path at all.

Rework this: Instead of blocking traffic, create two named counters, one
for original and one for reverse direction.

The first three test cases are handled by classic forwarding path
(path mtu discovery is disabled and packets exceed MTU).

But all other tests enable PMTUD, so the originator and responder are
expected to lower packet size and flowtable is expected to do the packet
forwarding.

For those tests, check that the packet counters (which are only
incremented for packets that are passed up to classic forward path)
are significantly lower than the file size transferred.

I've tested that the counter-checks fail as expected when the 'flow add'
statement is removed from the ruleset.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
</content>
</entry>
<entry>
<title>testing: selftests: nft_flowtable.sh: use random netns names</title>
<updated>2022-08-17T06:47:02Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-08-16T12:15:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b71b7bfeac38c7a21c423ddafb29aa6258949df8'/>
<id>urn:sha1:b71b7bfeac38c7a21c423ddafb29aa6258949df8</id>
<content type='text'>
"ns1" is a too generic name, use a random suffix to avoid
errors when such a netns exists.  Also allows to run multiple
instances of the script in parallel.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: add test case for nf trace infrastructure</title>
<updated>2022-08-06T01:50:15Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-08-04T17:26:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe9e420defabd0f3b13239dd135d261fbeeb67ae'/>
<id>urn:sha1:fe9e420defabd0f3b13239dd135d261fbeeb67ae</id>
<content type='text'>
Enable/disable tracing infrastructure while packets are in-flight.
This triggers KASAN splat after
e34b9ed96ce3 ("netfilter: nf_tables: avoid skb access on nf_stolen").

While at it, reduce script run time as well.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: correct PKTGEN_SCRIPT_PATHS in nft_concat_range.sh</title>
<updated>2022-06-21T08:50:40Z</updated>
<author>
<name>Jie2x Zhou</name>
<email>jie2x.zhou@intel.com</email>
</author>
<published>2022-06-16T07:40:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d79d8af8dec58bf709b3124d09d9572edd9c617'/>
<id>urn:sha1:5d79d8af8dec58bf709b3124d09d9572edd9c617</id>
<content type='text'>
Before change:
make -C netfilter
 TEST: performance
   net,port                                                      [SKIP]
   perf not supported
   port,net                                                      [SKIP]
   perf not supported
   net6,port                                                     [SKIP]
   perf not supported
   port,proto                                                    [SKIP]
   perf not supported
   net6,port,mac                                                 [SKIP]
   perf not supported
   net6,port,mac,proto                                           [SKIP]
   perf not supported
   net,mac                                                       [SKIP]
   perf not supported

After change:
   net,mac                                                       [ OK ]
     baseline (drop from netdev hook):               2061098pps
     baseline hash (non-ranged entries):             1606741pps
     baseline rbtree (match on first field only):    1191607pps
     set with  1000 full, ranged entries:            1639119pps
ok 8 selftests: netfilter: nft_concat_range.sh

Fixes: 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Jie2x Zhou &lt;jie2x.zhou@intel.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nat: really support inet nat without l3 address</title>
<updated>2022-06-01T13:53:39Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-06-01T08:47:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=282e5f8fe907dc3f2fbf9f2103b0e62ffc3a68a5'/>
<id>urn:sha1:282e5f8fe907dc3f2fbf9f2103b0e62ffc3a68a5</id>
<content type='text'>
When no l3 address is given, priv-&gt;family is set to NFPROTO_INET and
the evaluation function isn't called.

Call it too so l4-only rewrite can work.
Also add a test case for this.

Fixes: a33f387ecd5aa ("netfilter: nft_nat: allow to specify layer 4 protocol NAT only")
Reported-by: Yi Chen &lt;yiche@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>selftests: netfilter: add fib expression forward test case</title>
<updated>2022-04-11T10:10:09Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-03-31T13:46:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0c7b27616fbd64b3b86c59ad5441f82a1a0c4176'/>
<id>urn:sha1:0c7b27616fbd64b3b86c59ad5441f82a1a0c4176</id>
<content type='text'>
Its now possible to use fib expression in the forward chain (where both
the input and output interfaces are known).

Add a simple test case for this.

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>Merge tag 'linux-kselftest-next-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest</title>
<updated>2022-03-23T19:53:00Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-03-23T19:53:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=23d1dea55520c5cf89849279cd25de4da8392687'/>
<id>urn:sha1:23d1dea55520c5cf89849279cd25de4da8392687</id>
<content type='text'>
Pull Kselftest updates from Shuah Khan:
 "Several build and cleanup fixes:

   - removing obsolete config options

   - removing dependency on internal kernel macros

   - adding config options

   - several build fixes related to headers and install paths"

* tag 'linux-kselftest-next-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (22 commits)
  selftests: Fix build when $(O) points to a relative path
  selftests: netfilter: fix a build error on openSUSE
  selftests: kvm: add generated file to the .gitignore
  selftests/exec: add generated files to .gitignore
  selftests: add kselftest_install to .gitignore
  selftests/rtc: continuously read RTC in a loop for 30s
  selftests/lkdtm: Add UBSAN config
  selftests/lkdtm: Remove dead config option
  selftests/exec: Rename file binfmt_script to binfmt_script.py
  selftests: Use -isystem instead of -I to include headers
  selftests: vm: remove dependecy from internal kernel macros
  selftests: vm: Add the uapi headers include variable
  selftests: mptcp: Add the uapi headers include variable
  selftests: net: Add the uapi headers include variable
  selftests: landlock: Add the uapi headers include variable
  selftests: kvm: Add the uapi headers include variable
  selftests: futex: Add the uapi headers include variable
  selftests: Correct the headers install path
  selftests: Add and export a kernel uapi headers path
  selftests: set the BUILD variable to absolute path
  ...
</content>
</entry>
<entry>
<title>Revert "netfilter: nat: force port remap to prevent shadowing well-known ports"</title>
<updated>2022-03-08T12:52:11Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-03-08T12:52:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a82c25c366b0963d33ddf699196e6cf57f6d89b1'/>
<id>urn:sha1:a82c25c366b0963d33ddf699196e6cf57f6d89b1</id>
<content type='text'>
This reverts commit 878aed8db324bec64f3c3f956e64d5ae7375a5de.

This change breaks existing setups where conntrack is used with
asymmetric paths.

In these cases, the NAT transformation occurs on the syn-ack instead of
the syn:

1. SYN    x:12345 -&gt; y -&gt; 443 // sent by initiator, receiverd by responder
2. SYNACK y:443 -&gt; x:12345 // First packet seen by conntrack, as sent by responder
3. tuple_force_port_remap() gets called, sees:
  'tcp from 443 to port 12345 NAT' -&gt; pick a new source port, inititor receives
4. SYNACK y:$RANDOM -&gt; x:12345   // connection is never established

While its possible to avoid the breakage with NOTRACK rules, a kernel
update should not break working setups.

An alternative to the revert is to augment conntrack to tag
mid-stream connections plus more code in the nat core to skip NAT
for such connections, however, this leads to more interaction/integration
between conntrack and NAT.

Therefore, revert, users will need to add explicit nat rules to avoid
port shadowing.

Link: https://lore.kernel.org/netfilter-devel/20220302105908.GA5852@breakpoint.cc/#R
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2051413
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
</content>
</entry>
</feed>
