<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/selftests/netfilter, branch v5.19</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=v5.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-06-21T08:50:40Z</updated>
<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>
<entry>
<title>selftests: netfilter: fix a build error on openSUSE</title>
<updated>2022-03-03T22:17:54Z</updated>
<author>
<name>Geliang Tang</name>
<email>geliang.tang@suse.com</email>
</author>
<published>2022-03-02T05:29:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a50a88f026fb28ece512c50e8ef7cd4ef6d0a291'/>
<id>urn:sha1:a50a88f026fb28ece512c50e8ef7cd4ef6d0a291</id>
<content type='text'>
This patch fixed the following build error on openSUSE Leap 15.3:

=======================================================================
 gcc     nf-queue.c -lmnl -o tools/testing/selftests/netfilter/nf-queue
 nf-queue.c:13:10: fatal error: libmnl/libmnl.h: No such file or directory
  #include &lt;libmnl/libmnl.h&gt;
           ^~~~~~~~~~~~~~~~~
 compilation terminated.
=======================================================================

It is because libmnl.h is put in the directory of
"/usr/include/libmnl/libmnl/" on openSUSE, not "/usr/include/libmnl/":

 &gt; rpm -ql libmnl-devel
 /usr/include/libmnl
 /usr/include/libmnl/libmnl
 /usr/include/libmnl/libmnl/libmnl.h
 /usr/lib64/libmnl.so
 /usr/lib64/pkgconfig/libmnl.pc

Suggested-by: Kai Liu &lt;kai.liu@suse.com&gt;
Signed-off-by: Geliang Tang &lt;geliang.tang@suse.com&gt;
Reviewed-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: add nfqueue TCP_NEW_SYN_RECV socket race test</title>
<updated>2022-03-01T10:48:58Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-02-25T11:01:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e78855d311c401083df9776aa450d32d716e83e'/>
<id>urn:sha1:2e78855d311c401083df9776aa450d32d716e83e</id>
<content type='text'>
causes:
BUG: KASAN: slab-out-of-bounds in sk_free+0x25/0x80
Write of size 4 at addr ffff888106df0284 by task nf-queue/1459
 sk_free+0x25/0x80
 nf_queue_entry_release_refs+0x143/0x1a0
 nf_reinject+0x233/0x770

... without 'netfilter: nf_queue: don't assume sk is full socket'.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: disable rp_filter on router</title>
<updated>2022-02-10T23:01:04Z</updated>
<author>
<name>Hangbin Liu</name>
<email>liuhangbin@gmail.com</email>
</author>
<published>2022-02-10T09:50:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bbe4c0896d25009a7c86285d2ab024eed4374eea'/>
<id>urn:sha1:bbe4c0896d25009a7c86285d2ab024eed4374eea</id>
<content type='text'>
Some distros may enable rp_filter by default. After ns1 change addr to
10.0.2.99 and set default router to 10.0.2.1, while the connected router
address is still 10.0.1.1. The router will not reply the arp request
from ns1. Fix it by setting the router's veth0 rp_filter to 0.

Before the fix:
  # ./nft_fib.sh
  PASS: fib expression did not cause unwanted packet drops
  Netns nsrouter-HQkDORO2 fib counter doesn't match expected packet count of 1 for 1.1.1.1
  table inet filter {
          chain prerouting {
                  type filter hook prerouting priority filter; policy accept;
                  ip daddr 1.1.1.1 fib saddr . iif oif missing counter packets 0 bytes 0 drop
                  ip6 daddr 1c3::c01d fib saddr . iif oif missing counter packets 0 bytes 0 drop
          }
  }

After the fix:
  # ./nft_fib.sh
  PASS: fib expression did not cause unwanted packet drops
  PASS: fib expression did drop packets for 1.1.1.1
  PASS: fib expression did drop packets for 1c3::c01d

Fixes: 82944421243e ("selftests: netfilter: add fib test case")
Signed-off-by: Yi Chen &lt;yiche@redhat.com&gt;
Signed-off-by: Hangbin Liu &lt;liuhangbin@gmail.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: synproxy test requires nf_conntrack</title>
<updated>2022-02-10T15:34:46Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2022-02-10T09:11:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=249749c88906a00dc937a750406a36dfd11b5701'/>
<id>urn:sha1:249749c88906a00dc937a750406a36dfd11b5701</id>
<content type='text'>
Otherwise, this test does not find the sysctl entry in place:

 sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_tcp_loose: No such file or directory
 iperf3: error - unable to send control message: Bad file descriptor
 FAIL: iperf3 returned an error

Fixes: 7152303cbec4 ("selftests: netfilter: add synproxy test")
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>selftests: netfilter: fix exit value for nft_concat_range</title>
<updated>2022-02-09T10:07:06Z</updated>
<author>
<name>Hangbin Liu</name>
<email>liuhangbin@gmail.com</email>
</author>
<published>2022-02-09T08:25:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e71ec1a725a794a16e3862791ed43fe5ba6a06b'/>
<id>urn:sha1:2e71ec1a725a794a16e3862791ed43fe5ba6a06b</id>
<content type='text'>
When the nft_concat_range test failed, it exit 1 in the code
specifically.

But when part of, or all of the test passed, it will failed the
[ ${passed} -eq 0 ] check and thus exit with 1, which is the same
exit value with failure result. Fix it by exit 0 when passed is not 0.

Fixes: 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")
Signed-off-by: Hangbin Liu &lt;liuhangbin@gmail.com&gt;
Reviewed-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
</feed>
