Patch "ipv4: fix source address selection with route leak" has been added to the 5.15-stable tree
Le 03/08/2024 à 16:55, Sasha Levin a écrit :
Quoted 7 lines
This is a note to let you know that I've just added the patch titled
ipv4: fix source address selection with route leak
to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
Quoted 6 lines
The filename of the patch is:
ipv4-fix-source-address-selection-with-route-leak.patch
and it can be found in the queue-5.15 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
I'm not sure I fully understand the process, but Greg already sent a mail because this patch doesn't compile on the 5.15 stable branch.
I sent a backport:
https://lore.kernel.org/stable/[email protected]/
Regards,
Nicolas
Quoted 49 lines
commit
dfd009372d960dc1ccf694e7369d58e63cd133c4Author: Nicolas Dichtel <[email protected]> Date: Wed Jul 10 10:14:27 2024 +0200ipv4: fix source address selection with route leak
[ Upstream commit
6807352353561187a718e87204458999dbcbba1b]By default, an address assigned to the output interface is selected when the source address is not specified. This is problematic when a route, configured in a vrf, uses an interface from another vrf (aka route leak). The original vrf does not own the selected source address.
Let's add a check against the output interface and call the appropriate function to select the source address.
Fixes 8cbb512c923d ("net: Add source address lookup op for VRF")Signed-off-by Nicolas Dichtel <[email protected]>Reviewed-by David Ahern <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>Signed-off-by Sasha Levin <[email protected]>net/ipv4/fib_semantics.c +11
-2@@ -2286,6 +2286,15 @@ void fib_select_path(struct net *net, struct fib_result *res,fib_select_default (fl4, res); check_saddr: -if (!fl4->saddr) - fl4->saddr =fib_result_prefsrc (net, res); +if (!fl4->saddr) { +struct net_device *l3mdev; + + l3mdev =dev_get_by_index_rcu (net, fl4->flowi4_l3mdev); + +if (!l3mdev || +l3mdev_master_dev_rcu (FIB_RES_DEV (*res)) == l3mdev) + fl4->saddr =fib_result_prefsrc (net, res); +else + fl4->saddr =inet_select_addr (l3mdev,0 ,RT_SCOPE_LINK ); + } }
Sasha Levin
maintainerQuoted 12 lines · Nicolas Dichtel
Le 03/08/2024 à 16:55, Sasha Levin a écrit :
Quoted 11 lines
This is a note to let you know that I've just added the patch titled
ipv4: fix source address selection with route leak
to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
ipv4-fix-source-address-selection-with-route-leak.patch
and it can be found in the queue-5.15 subdirectory.
Quoted 7 lines
Quoted 2 lines
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
I'm not sure I fully understand the process, but Greg already sent a mail because this patch doesn't compile on the 5.15 stable branch.
I sent a backport:
https://lore.kernel.org/stable/[email protected]/
Appologies, I haven't seen your backport, but instead I've picked up 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") as a dependency to address the build failure.
Signature · 2 lines
Thanks, Sasha
Le 05/08/2024 à 13:24, Sasha Levin a écrit :
Quoted 19 lines · Nicolas Dichtel
Quoted 18 lines
Le 03/08/2024 à 16:55, Sasha Levin a écrit :
Quoted 8 lines
This is a note to let you know that I've just added the patch titled
ipv4: fix source address selection with route leak
to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryQuoted 6 lines
The filename of the patch is:
ipv4-fix-source-address-selection-with-route-leak.patch and it can be found in the queue-5.15 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
I'm not sure I fully understand the process, but Greg already sent a mail because this patch doesn't compile on the 5.15 stable branch.
Quoted 7 lines
Quoted 2 lines
I sent a backport:
https://lore.kernel.org/stable/[email protected]/Appologies, I haven't seen your backport, but instead I've picked up
40867d74c374("net: Add l3mdev index to flow struct and avoid oif reset for port devices") as a dependency to address the build failure.
No problem, it's fine for me. I will launch the selftests to check the backport. I've just sent another backport for the last patch of the series.
Nicolas Dichtel
Tested-byLe 05/08/2024 à 14:56, Nicolas Dichtel a écrit :
Quoted 20 lines
Le 05/08/2024 à 13:24, Sasha Levin a écrit :
Quoted 19 lines · Nicolas Dichtel
Quoted 18 lines
Le 03/08/2024 à 16:55, Sasha Levin a écrit :
Quoted 8 lines
This is a note to let you know that I've just added the patch titled
ipv4: fix source address selection with route leak
to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryQuoted 6 lines
The filename of the patch is:
ipv4-fix-source-address-selection-with-route-leak.patch and it can be found in the queue-5.15 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
I'm not sure I fully understand the process, but Greg already sent a mail because this patch doesn't compile on the 5.15 stable branch.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
I sent a backport:
https://lore.kernel.org/stable/[email protected]/Appologies, I haven't seen your backport, but instead I've picked up
40867d74c374("net: Add l3mdev index to flow struct and avoid oif reset for port devices") as a dependency to address the build failure.No problem, it's fine for me. I will launch the selftests to check the backport.