Skip to content

Commit b8c8abe

Browse files
mihalicynkuba-moo
authored andcommitted
ipv4: correctly iterate over the target netns in inet_dump_ifaddr()
A recent change to inet_dump_ifaddr had the function incorrectly iterate over net rather than tgt_net, resulting in the data coming for the incorrect network namespace. Fixes: cdb2f80 ("inet: use xa_array iterator to implement inet_dump_ifaddr()") Reported-by: Stéphane Graber <[email protected]> Closes: lxc/incus#892 Bisected-by: Stéphane Graber <[email protected]> Signed-off-by: Alexander Mikhalitsyn <[email protected]> Tested-by: Stéphane Graber <[email protected]> Acked-by: Christian Brauner <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 92f1655 commit b8c8abe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/devinet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
19031903

19041904
cb->seq = inet_base_seq(tgt_net);
19051905

1906-
for_each_netdev_dump(net, dev, ctx->ifindex) {
1906+
for_each_netdev_dump(tgt_net, dev, ctx->ifindex) {
19071907
in_dev = __in_dev_get_rcu(dev);
19081908
if (!in_dev)
19091909
continue;

0 commit comments

Comments
 (0)