Skip to content

Commit 27b1060

Browse files
dsaherndavem330
authored andcommitted
net/ipv6: Fix gfp_flags arg to addrconf_prefix_route
Eric noticed that __ipv6_ifa_notify is called under rcu_read_lock, so the gfp argument to addrconf_prefix_route can not be GFP_KERNEL. While scrubbing other calls I noticed addrconf_addr_gen has one place with GFP_ATOMIC that can be GFP_KERNEL. Fixes: acb54e3 ("net/ipv6: Add gfp_flags to route add functions") Reported-by: syzbot+2add39b05179b31f912f@syzkaller.appspotmail.com Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent dcd1f57 commit 27b1060

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv6/addrconf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,7 +3245,7 @@ static void addrconf_addr_gen(struct inet6_dev *idev, bool prefix_route)
32453245
addrconf_add_linklocal(idev, &addr, 0);
32463246
else if (prefix_route)
32473247
addrconf_prefix_route(&addr, 64, idev->dev,
3248-
0, 0, GFP_ATOMIC);
3248+
0, 0, GFP_KERNEL);
32493249
break;
32503250
case IN6_ADDR_GEN_MODE_NONE:
32513251
default:
@@ -5620,7 +5620,7 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
56205620
if (!ipv6_addr_any(&ifp->peer_addr))
56215621
addrconf_prefix_route(&ifp->peer_addr, 128,
56225622
ifp->idev->dev, 0, 0,
5623-
GFP_KERNEL);
5623+
GFP_ATOMIC);
56245624
break;
56255625
case RTM_DELADDR:
56265626
if (ifp->idev->cnf.forwarding)

0 commit comments

Comments
 (0)