RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2054023 - vrf test fail in kselftest net:fcnal-test.sh
Summary: vrf test fail in kselftest net:fcnal-test.sh
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: kernel
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Xin Long
QA Contact: Jianlin Shi
URL:
Whiteboard:
Depends On:
Blocks: 2090354
TreeView+ depends on / blocked
 
Reported: 2022-02-14 02:02 UTC by Jianlin Shi
Modified: 2022-11-15 12:19 UTC (History)
3 users (show)

Fixed In Version: kernel-5.14.0-86.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:55:35 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/src/kernel centos-stream-9 merge_requests 704 0 None None None 2022-04-10 17:47:10 UTC
Red Hat Issue Tracker RHELPLAN-112094 0 None None None 2022-02-14 02:05:23 UTC
Red Hat Product Errata RHSA-2022:8267 0 None None None 2022-11-15 10:55:56 UTC

Description Jianlin Shi 2022-02-14 02:02:15 UTC
Description of problem:
vrf test fail in kselftest net:fcnal-test.sh 

Version-Release number of selected component (if applicable):
5.14.0-59

How reproducible:
always

Steps to Reproduce:
./run_kselftest.sh -t net:fcnal-test.sh

Actual results:
# #################################################################                                   
# With VRF                                                                                            
#                                                                                                     
# SYSCTL: net.ipv4.raw_l3mdev_accept=1                                                                
#                                                                                                     
# TEST: ping out, VRF bind - ns-B IP                                            [ OK ]                
# TEST: ping out, device bind - ns-B IP                                         [ OK ]                
# TEST: ping out, vrf device + dev address bind - ns-B IP                       [ OK ]                
# TEST: ping out, vrf device + vrf address bind - ns-B IP                       [ OK ]                
# TEST: ping out, VRF bind - ns-B loopback IP                                   [ OK ]                
# TEST: ping out, device bind - ns-B loopback IP                                [ OK ]                
# TEST: ping out, vrf device + dev address bind - ns-B loopback IP              [ OK ]                
# TEST: ping out, vrf device + vrf address bind - ns-B loopback IP              [ OK ]                
# TEST: ping in - ns-A IP                                                       [ OK ]                
# TEST: ping in - VRF IP                                                        [ OK ]                
# TEST: ping local, VRF bind - ns-A IP                                          [ OK ]                
# TEST: ping local, VRF bind - VRF IP                                           [FAIL]                
# TEST: ping local, VRF bind - loopback                                         [ OK ]                
# TEST: ping local, device bind - ns-A IP                                       [FAIL]                
# TEST: ping local, device bind - VRF IP                                        [ OK ]                
# TEST: ping local, device bind - loopback                                      [ OK ]                
# TEST: ping out, vrf bind, blocked by rule - ns-B loopback IP                  [ OK ]                
# TEST: ping out, device bind, blocked by rule - ns-B loopback IP               [ OK ]                
# TEST: ping in, blocked by rule - ns-A loopback IP                             [ OK ]                
# TEST: ping out, vrf bind, unreachable route - ns-B loopback IP                [ OK ]                
# TEST: ping out, device bind, unreachable route - ns-B loopback IP             [ OK ]                
# TEST: ping in, unreachable route - ns-A loopback IP                           [ OK ]  

Expected results:
pass

Additional info:


[root@hp-dl388g8-08 kselftests]# uname -a
Linux hp-dl388g8-08.rhts.eng.pek2.redhat.com 5.14.0-59.el9.x86_64 #1 SMP PREEMPT Fri Feb 11 19:34:15 EST 2022 x86_64 x86_64 x86_64 GNU/Linux

Comment 1 Xin Long 2022-02-15 08:10:00 UTC
This is another issue caused by changing from PING socket to RAW socket for 'ping' cmd, and it was reported on:

https://github.com/iputils/iputils/issues/104

and fixed on iputils but in an incorrect way:

commit cc44f4c5c2e72f7aa833658a6978d924ff9e059d
Author: Sami Kerola <kerolasa>
Date:   Wed Oct 24 23:38:58 2018 +0100

    ping: do not bind to device when destination IP is on device

The right fix should be in PING socket in kernel:

diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index bcf7bc71cb56..99d832a33408 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -172,7 +172,7 @@ static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident)
        struct sock *sk = NULL;
        struct inet_sock *isk;
        struct hlist_nulls_node *hnode;
-       int dif = skb->dev->ifindex;
+       int dif = inet_iif(skb);

I will fix this in kernel and then revert the one in iputils.

Comment 3 Xin Long 2022-04-10 17:49:17 UTC
Use this bug to track the issue in https://github.com/iputils/iputils/issues/104, which should be fixed in kernel side.
Jianlin, can you open a new bug for user space iputils? Thanks.

Comment 9 Jianlin Shi 2022-05-23 01:16:01 UTC
the test still failed with the latest kernel:

# #################################################################                                                                                                                                         
# With VRF                                                                                                                                                                                                  
#                                                                                                                                                                                                           
# SYSCTL: net.ipv4.raw_l3mdev_accept=1                                                                                                                                                                      
#                                                                                                                                                                                                           
# TEST: ping out, VRF bind - ns-B IP                                            [ OK ]                                                                                                                      
# TEST: ping out, device bind - ns-B IP                                         [ OK ]                                                                                                                      
# TEST: ping out, vrf device + dev address bind - ns-B IP                       [ OK ]                
# TEST: ping out, vrf device + vrf address bind - ns-B IP                       [ OK ]                
# TEST: ping out, VRF bind - ns-B loopback IP                                   [ OK ]                
# TEST: ping out, device bind - ns-B loopback IP                                [ OK ]                
# TEST: ping out, vrf device + dev address bind - ns-B loopback IP              [ OK ]                
# TEST: ping out, vrf device + vrf address bind - ns-B loopback IP              [ OK ]                
# TEST: ping in - ns-A IP                                                       [ OK ]                
# TEST: ping in - VRF IP                                                        [ OK ]                
# TEST: ping local, VRF bind - ns-A IP                                          [ OK ]                
# TEST: ping local, VRF bind - VRF IP                                           [FAIL]                
# TEST: ping local, VRF bind - loopback                                         [ OK ]                
# TEST: ping local, device bind - ns-A IP                                       [FAIL]                
# TEST: ping local, device bind - VRF IP                                        [ OK ]                
# TEST: ping local, device bind - loopback                                      [ OK ]                
# TEST: ping out, vrf bind, blocked by rule - ns-B loopback IP                  [ OK ]                
# TEST: ping out, device bind, blocked by rule - ns-B loopback IP               [ OK ]                
# TEST: ping in, blocked by rule - ns-A loopback IP                             [ OK ]                
# TEST: ping out, vrf bind, unreachable route - ns-B loopback IP                [ OK ]                
# TEST: ping out, device bind, unreachable route - ns-B loopback IP             [ OK ]                
# TEST: ping in, unreachable route - ns-A loopback IP                           [ OK ]                
#                                                                                                     
# ###########################################################################

[root@ibm-x3650m4-02-vm-06 kselftests]# uname -a
Linux ibm-x3650m4-02-vm-06.ibm2.lab.eng.bos.redhat.com 5.14.0-96.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 19 07:21:30 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@ibm-x3650m4-02-vm-06 kselftests]# rpm -qa | grep kernel
kernel-tools-libs-5.14.0-96.el9.x86_64
kernel-core-5.14.0-96.el9.x86_64
kernel-modules-5.14.0-96.el9.x86_64
kernel-5.14.0-96.el9.x86_64
kernel-tools-5.14.0-96.el9.x86_64
kernel-selftests-internal-5.14.0-96.el9.x86_64

Comment 10 Jianlin Shi 2022-05-24 01:36:19 UTC
install the iputils in https://github.com/lxin/iputils/tree/ping_fix and run the test again, it passed:

# #################################################################                                   
# With VRF                                                                                            
#                                                                                                     
# SYSCTL: net.ipv4.raw_l3mdev_accept=1                                                                
#                                                                                                     
# TEST: ping out, VRF bind - ns-B IP                                            [ OK ]                
# TEST: ping out, device bind - ns-B IP                                         [ OK ]                
# TEST: ping out, vrf device + dev address bind - ns-B IP                       [ OK ]                
# TEST: ping out, vrf device + vrf address bind - ns-B IP                       [ OK ]                
# TEST: ping out, VRF bind - ns-B loopback IP                                   [ OK ]                
# TEST: ping out, device bind - ns-B loopback IP                                [ OK ]                
# TEST: ping out, vrf device + dev address bind - ns-B loopback IP              [ OK ]                
# TEST: ping out, vrf device + vrf address bind - ns-B loopback IP              [ OK ]                
# TEST: ping in - ns-A IP                                                       [ OK ]                
# TEST: ping in - VRF IP                                                        [ OK ]                
# TEST: ping local, VRF bind - ns-A IP                                          [ OK ]                
# TEST: ping local, VRF bind - VRF IP                                           [ OK ]                
# TEST: ping local, VRF bind - loopback                                         [ OK ]                
# TEST: ping local, device bind - ns-A IP                                       [ OK ]                
# TEST: ping local, device bind - VRF IP                                        [ OK ]                
# TEST: ping local, device bind - loopback                                      [ OK ]                
# TEST: ping out, vrf bind, blocked by rule - ns-B loopback IP                  [ OK ]                
# TEST: ping out, device bind, blocked by rule - ns-B loopback IP               [ OK ]                
# TEST: ping in, blocked by rule - ns-A loopback IP                             [ OK ]                
# TEST: ping out, vrf bind, unreachable route - ns-B loopback IP                [ OK ]                
# TEST: ping out, device bind, unreachable route - ns-B loopback IP             [ OK ]                
# TEST: ping in, unreachable route - ns-A loopback IP                           [ OK ]                
#                                                                                                     
# ###########################################################################

Comment 12 errata-xmlrpc 2022-11-15 10:55:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: kernel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8267


Note You need to log in before you can comment on or make changes to this bug.