netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
To: David Ahern <dsahern@gmail.com>, Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Po-Hsu Lin <po-hsu.lin@canonical.com>
Subject: Re: [BUG] selftests/net: icmp_redirect.sh: 12 out of 40 test result with [FAIL]
Date: Tue, 19 Mar 2024 05:53:38 +0100	[thread overview]
Message-ID: <cf4f320d-f031-4c27-a9c6-8880e32444a0@alu.unizg.hr> (raw)
In-Reply-To: <2b5e831b-baf1-4681-b3b1-b223df07ab83@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 7608 bytes --]

On 3/18/24 15:42, David Ahern wrote:
> On 3/17/24 8:38 PM, Hangbin Liu wrote:
>> Wild guess, the last change of icmp_redirect is my netns update. Maybe
>> there are something default sysctl settings in netns cause the error?
> 
> It is most likely sysctl settings. It would be good to chase those down
> and make sure we have the script setting them.
> 
> Mirsad: What OS are you testing with? That script has a verbose option
> (-v) to get more output like the commands run and pause-on-fail (-p) to
> manually debug at that point.

Hi, David,

I am running an Ubuntu 22.04 LTS box, with the iptools upgraded to iproute2-next
tree of March 15th, on the torvalds tree.

Right now I have tried it against the net-next tree, and I get the same result:

# timeout set to 3600
# selftests: net: icmp_redirect.sh
#
# ###########################################################################
# Legacy routing
# ###########################################################################
#
# TEST: IPv4: redirect exception                                      [FAIL]
# TEST: IPv6: redirect exception                                      [ OK ]
# TEST: IPv4: redirect exception plus mtu                             [FAIL]
# TEST: IPv6: redirect exception plus mtu                             [ OK ]
# TEST: IPv4: routing reset                                           [ OK ]
# TEST: IPv6: routing reset                                           [ OK ]
# TEST: IPv4: mtu exception                                           [ OK ]
# TEST: IPv6: mtu exception                                           [ OK ]
# TEST: IPv4: mtu exception plus redirect                             [FAIL]
# TEST: IPv6: mtu exception plus redirect                             [ OK ]
#
# ###########################################################################
# Legacy routing with VRF
# ###########################################################################
#
# TEST: IPv4: redirect exception                                      [FAIL]
# TEST: IPv6: redirect exception                                      [ OK ]
# TEST: IPv4: redirect exception plus mtu                             [FAIL]
# TEST: IPv6: redirect exception plus mtu                             [ OK ]
# TEST: IPv4: routing reset                                           [ OK ]
# TEST: IPv6: routing reset                                           [ OK ]
# TEST: IPv4: mtu exception                                           [ OK ]
# TEST: IPv6: mtu exception                                           [ OK ]
# TEST: IPv4: mtu exception plus redirect                             [FAIL]
# TEST: IPv6: mtu exception plus redirect                             [ OK ]
#
# ###########################################################################
# Routing with nexthop objects
# ###########################################################################
#
# TEST: IPv4: redirect exception                                      [FAIL]
# TEST: IPv6: redirect exception                                      [ OK ]
# TEST: IPv4: redirect exception plus mtu                             [FAIL]
# TEST: IPv6: redirect exception plus mtu                             [ OK ]
# TEST: IPv4: routing reset                                           [ OK ]
# TEST: IPv6: routing reset                                           [ OK ]
# TEST: IPv4: mtu exception                                           [ OK ]
# TEST: IPv6: mtu exception                                           [ OK ]
# TEST: IPv4: mtu exception plus redirect                             [FAIL]
# TEST: IPv6: mtu exception plus redirect                             [ OK ]
#
# ###########################################################################
# Routing with nexthop objects and VRF
# ###########################################################################
#
# TEST: IPv4: redirect exception                                      [FAIL]
# TEST: IPv6: redirect exception                                      [ OK ]
# TEST: IPv4: redirect exception plus mtu                             [FAIL]
# TEST: IPv6: redirect exception plus mtu                             [ OK ]
# TEST: IPv4: routing reset                                           [ OK ]
# TEST: IPv6: routing reset                                           [ OK ]
# TEST: IPv4: mtu exception                                           [ OK ]
# TEST: IPv6: mtu exception                                           [ OK ]
# TEST: IPv4: mtu exception plus redirect                             [FAIL]
# TEST: IPv6: mtu exception plus redirect                             [ OK ]
#
# Tests passed:  28
# Tests failed:  12
# Tests xfailed:   0
not ok 45 selftests: net: icmp_redirect.sh # exit=1

So, it is probably the sysctl you said, but I cannot tell which one.

My /etc/sysctl.conf looks like this (I think something like Libreswan VPN required these
to be redirects turned off):

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

###################################################################
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1

net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.icmp_ignore_bogus_error_responses = 1
#
# Do not accept IP source route packets (we are not a router)
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
net.ipv4.conf.all.log_martians = 0
net.ipv4.conf.default.log_martians = 0
#

###################################################################
# Magic system request Key
# 0=disable, 1=enable all, >1 bitmask of sysrq functions
# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html
# for what other values do
#kernel.sysrq=438

Thank you.

Best regards,
Mirsad

[-- Attachment #2: sysctl-all.conf.xz --]
[-- Type: application/x-xz, Size: 12432 bytes --]

      reply	other threads:[~2024-03-19  4:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16 22:59 [BUG] selftests/net: icmp_redirect.sh: 12 out of 40 test result with [FAIL] Mirsad Todorovac
2024-03-18  2:38 ` Hangbin Liu
2024-03-18 14:42   ` David Ahern
2024-03-19  4:53     ` Mirsad Todorovac [this message]

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=cf4f320d-f031-4c27-a9c6-8880e32444a0@alu.unizg.hr \
    --to=mirsad.todorovac@alu.unizg.hr \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=po-hsu.lin@canonical.com \
    --cc=shuah@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).