Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/2] ipv6: fix IPv6 scope check of the source address in a VRF
@ 2026-11-23 14:30 Vincent Jardin via B4 Relay
  2026-11-23 14:30 ` [PATCH net 1/2] ipv6: check the scope of the best source address candidate " Vincent Jardin via B4 Relay
  2026-11-23 14:30 ` [PATCH net 2/2] selftests: fib_tests: test IPv6 source address of " Vincent Jardin via B4 Relay
  0 siblings, 2 replies; 5+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-11-23 14:30 UTC (permalink / raw)
  To: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
	Nicolas Dichtel, Shuah Khan
  Cc: netdev, linux-kselftest, Vincent Jardin, stable

When a packet is sent through a device of a VRF, ipv6_dev_get_saddr()
first checks the addresses of that device and of the VRF device,
and stops when the best of them has a scope that fits the destination.

Since the commit abb9a68d2c64 ("ipv6: take care of scope when
choosing the src addr"), the check reads the scopedist of the best
candidate, which is an issue:

- with a single candidate, scopedist is not written: when the stack is
  zero-initialized, a device that only has a link-local address sends
  to global destinations with it, although another device of the VRF
  has a global address

- with more candidates, scopedist is negative, whether the scope fits
  or not: all the devices of the VRF are looked at, and one of their
  addresses can win over the address of the VRF device

Changes:
- patch 1 compares the scope of the best candidate with the scope
  of the destination

- patch 2 adds test cases to fib_tests.sh

Note: abb9a68d2c64 is in every kernel since v6.11 and was backported down
to 4.19, so the bug is in all the maintained trees (5.10, 5.15, 6.1, 6.6,
6.12, 6.18 and 7.3), hence this series for net.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
Vincent Jardin (2):
      ipv6: check the scope of the best source address candidate in a VRF
      selftests: fib_tests: test IPv6 source address of a VRF

 net/ipv6/addrconf.c                      |  6 ++--
 tools/testing/selftests/net/fib_tests.sh | 47 +++++++++++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 3 deletions(-)
---
base-commit: af6737b9066832a2017c281159950ba92385ce00
change-id: 20261123-for-upstream-ipv6-vrf-saddr-scope-v1-4e0165804d43

Best regards,
-- 
Vincent Jardin <vjardin@free.fr>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-24 14:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 14:30 [PATCH net 0/2] ipv6: fix IPv6 scope check of the source address in a VRF Vincent Jardin via B4 Relay
2026-11-23 14:30 ` [PATCH net 1/2] ipv6: check the scope of the best source address candidate " Vincent Jardin via B4 Relay
2026-11-24 13:55   ` Nicolas Dichtel
2026-11-23 14:30 ` [PATCH net 2/2] selftests: fib_tests: test IPv6 source address of " Vincent Jardin via B4 Relay
2026-11-24 14:11   ` Nicolas Dichtel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox