[SRU][F][J][PATCH 0/3] ip/nexthop: fix default address selection for connected nexthop

Luke Nowakowski-Krijger luke.nowakowskikrijger at canonical.com
Thu Sep 8 19:56:19 UTC 2022


These patches are based on an SRU request from Nicolas Dichtel.

BugLink: https://bugs.launchpad.net/bugs/1988809

[Backport]

For both jammy and focal needed to replace dev_hold_track with
dev_hold as dev_hold_track uses debugging infastructure that we don't
have in our kernels/don't want to backport.

Focal needed slight context adjustments in makefile for the 
fib_nexthop_nongw selftest.

[Impact]

Packets sent by userland apps are rejected/dropped if the source address is not specified and the corresponding route is using a connected nexthop object. 

This bug exists since linux v5.3 and has been fixed in v5.19 by the following upstream commits:
 - 747c14307214 ("ip: fix dflt addr selection for connected nexthop")
   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=747c14307214
 - cd72e61bad14 ("selftests/net: test nexthop without gw")
   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cd72e61bad14
 - eb55dc09b5dd ("ip: fix triggering of 'icmp redirect'")
   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb55dc09b5dd

The last commit (v6.0) fixes a regression introduced by the first commit.

[Test Case]

A detailed test case is explained in the first commit and a self-test is added in the second commit.

Lukenow: Ran selftest which fails before patches applied and passes
after they are applied.

[Regression Potential]

The patch modifies some internal routing states. It has been living in the upstream trees for 2 months and the reported regression about icmp redirects has been fixed.
The risk of regression should be contained.


Nicolas Dichtel (3):
  ip: fix dflt addr selection for connected nexthop
  ip: fix triggering of 'icmp redirect'
  selftests/net: test nexthop without gw

 net/ipv4/fib_frontend.c                       |   4 +-
 net/ipv4/fib_semantics.c                      |   2 +-
 tools/testing/selftests/net/Makefile          |   2 +-
 .../selftests/net/fib_nexthop_nongw.sh        | 119 ++++++++++++++++++
 4 files changed, 123 insertions(+), 4 deletions(-)
 create mode 100755 tools/testing/selftests/net/fib_nexthop_nongw.sh

-- 
2.34.1




More information about the kernel-team mailing list