mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 18:55:12 +00:00
ipv6/addrlabel: fix ip6addrlbl_get()
commite459dfeeb6
upstream. ip6addrlbl_get() has never worked. If ip6addrlbl_hold() succeeded, ip6addrlbl_get() will exit with '-ESRCH'. If ip6addrlbl_hold() failed, ip6addrlbl_get() will use about to be free ip6addrlbl_entry pointer. Fix this by inverting ip6addrlbl_hold() check. Fixes:2a8cc6c890
("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.") Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Reviewed-by: Cong Wang <cwang@twopensource.com> Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> (cherry picked from commit39b214ba1a
) Signed-off-by: Willy Tarreau <w@1wt.eu>
This commit is contained in:
parent
3bf5fe19a9
commit
5a7fbabb10
@ -557,7 +557,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,
|
||||
|
||||
rcu_read_lock();
|
||||
p = __ipv6_addr_label(net, addr, ipv6_addr_type(addr), ifal->ifal_index);
|
||||
if (p && ip6addrlbl_hold(p))
|
||||
if (p && !ip6addrlbl_hold(p))
|
||||
p = NULL;
|
||||
lseq = ip6addrlbl_table.seq;
|
||||
rcu_read_unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user