Thread (6 messages) 6 messages, 3 authors, 4d ago

Re: [PATCH net-next v3 2/2] ipv4: snapshot dst.dev in ip_rt_send_redirect() and ip_rt_get_source()

From: Ido Schimmel <idosch@nvidia.com>
Date: 2026-07-13 15:59:16
Also in: lkml

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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help