On Wed, Jul 08, 2026 at 02:05:37PM +0800, xuanqiang.luo@linux.dev wrote:
From: Xuanqiang Luo <redacted>
rt_flush_dev() can replace rt->dst.dev with blackhole_netdev while RCU
readers are running. ip_rt_send_redirect() and ip_rt_get_source() both
read rt->dst.dev more than once and use the results in one operation.
If rt->dst.dev changes between those reads, the operation can use values
from two devices. For example, ip_rt_send_redirect() can use in_dev from
the old device and the L3 master ifindex from blackhole_netdev.
Read rt->dst.dev once in these two functions and use the snapshot for the
later device accesses.
Signed-off-by: Xuanqiang Luo <redacted>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>