Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295877 > unrolled thread

[PATCH] ipv6/addrlabel: fix ip6addrlbl_get()

Started byAndrey Ryabinin <aryabinin@virtuozzo.com>
First post2015-12-21 11:00 +0100
Last post2015-12-22 22:00 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ipv6/addrlabel: fix ip6addrlbl_get() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-12-21 11:00 +0100
    Re: [PATCH] ipv6/addrlabel: fix ip6addrlbl_get() Cong Wang <cwang@twopensource.com> - 2015-12-21 20:40 +0100
      Re: [PATCH] ipv6/addrlabel: fix ip6addrlbl_get() YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com> - 2015-12-22 09:10 +0100
    Re: [PATCH] ipv6/addrlabel: fix ip6addrlbl_get() David Miller <davem@davemloft.net> - 2015-12-22 22:00 +0100

#1295877 — [PATCH] ipv6/addrlabel: fix ip6addrlbl_get()

FromAndrey Ryabinin <aryabinin@virtuozzo.com>
Date2015-12-21 11:00 +0100
Subject[PATCH] ipv6/addrlabel: fix ip6addrlbl_get()
Message-ID<qI5q2-4Ow-25@gated-at.bofh.it>
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: 2a8cc6c89039 ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.")
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 net/ipv6/addrlabel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index 882124e..a8f6986 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -552,7 +552,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();
-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1296170

FromCong Wang <cwang@twopensource.com>
Date2015-12-21 20:40 +0100
Message-ID<qIetj-2e0-1@gated-at.bofh.it>
In reply to#1295877
On Mon, Dec 21, 2015 at 1:54 AM, Andrey Ryabinin
<aryabinin@virtuozzo.com> wrote:
> 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: 2a8cc6c89039 ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.")
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>

Good catch!

Reviewed-by: Cong Wang <cwang@twopensource.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1296606

FromYOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
Date2015-12-22 09:10 +0100
Message-ID<qIqb8-1nm-9@gated-at.bofh.it>
In reply to#1296170
Cong Wang wrote:
> On Mon, Dec 21, 2015 at 1:54 AM, Andrey Ryabinin
> <aryabinin@virtuozzo.com> wrote:
>> 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: 2a8cc6c89039 ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.")
>> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> 
> Good catch!
> 
> Reviewed-by: Cong Wang <cwang@twopensource.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1297061

FromDavid Miller <davem@davemloft.net>
Date2015-12-22 22:00 +0100
Message-ID<qICch-kW-1@gated-at.bofh.it>
In reply to#1295877
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date: Mon, 21 Dec 2015 12:54:45 +0300

> 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: 2a8cc6c89039 ("[IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table.")
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web