lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 31 Mar 2022 18:46:15 +0300
From:   Nikolay Aleksandrov <>
Cc:,,,,,, Nikolay Aleksandrov <>
Subject: [PATCH net 2/2] selftests: net: add delete nexthop route warning test

Add a test which causes a WARNING on kernels which treat a
nexthop route like a normal route when comparing for deletion and a
device is specified. That is, a route is found but we hit a warning while
matching it. The warning is from fib_info_nh() in include/net/nexthop.h
because we run it on a fib_info with nexthop object. The call chain is:
 inet_rtm_delroute -> fib_table_delete -> fib_nh_match (called with a
nexthop fib_info and also with fc_oif set thus calling fib_info_nh on
the fib_info and triggering the warning).

Repro steps:
 $ ip nexthop add id 12 via dev veth1
 $ ip route add nhid 12
 $ ip route delete dev veth1

Signed-off-by: Nikolay Aleksandrov <>
 tools/testing/selftests/net/ | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/testing/selftests/net/ b/tools/testing/selftests/net/
index d444ee6aa3cb..371e3e0c91b7 100755
--- a/tools/testing/selftests/net/
+++ b/tools/testing/selftests/net/
@@ -1208,6 +1208,19 @@ ipv4_fcnal()
 	set +e
 	check_nexthop "dev veth1" ""
 	log_test $? 0 "Nexthops removed on admin down"
+	# nexthop route delete warning
+	run_cmd "$IP li set dev veth1 up"
+	run_cmd "$IP nexthop add id 12 via dev veth1"
+	out1=`dmesg | grep "WARNING:.*fib_nh_match.*" | wc -l`
+	run_cmd "$IP route add nhid 12"
+	run_cmd "$IP route delete dev veth1"
+	out2=`dmesg | grep "WARNING:.*fib_nh_match.*" | wc -l`
+	[ $out1 -eq $out2 ]
+	rc=$?
+	log_test $rc 0 "Delete nexthop route warning"
+	run_cmd "$IP ip route delete nhid 12"
+	run_cmd "$IP ip nexthop del id 12"

Powered by blists - more mailing lists