ipv6: flowlabel: fl6_sock_lookup() must use atomic_inc_not_zero
authorEric Dumazet <edumazet@google.com>
Thu, 6 Jun 2019 21:32:34 +0000 (14:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:15:13 +0000 (08:15 +0200)
commit7eadfacd2be2c961348de7d6ce25635b409aeb72
tree2a5ea76cb074df5fa9c28ffd662144ac41825113
parenta5ae5920426e9166af78658bb3e2a12b9fbf53e4
ipv6: flowlabel: fl6_sock_lookup() must use atomic_inc_not_zero

[ Upstream commit 65a3c497c0e965a552008db8bc2653f62bc925a1 ]

Before taking a refcount, make sure the object is not already
scheduled for deletion.

Same fix is needed in ipv6_flowlabel_opt()

Fixes: 18367681a10b ("ipv6 flowlabel: Convert np->ipv6_fl_list to RCU.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/ip6_flowlabel.c