All of lore.kernel.org
 help / color / mirror / Atom feed
From: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
To: Erik Kline <ek@google.com>, David Miller <davem@davemloft.net>
Cc: hideaki.yoshifuji@miraclelinux.com,
	netdev <netdev@vger.kernel.org>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Lorenzo Colitti <lorenzo@google.com>
Subject: Re: [PATCH net-next v2] ipv6: Do not iterate over all interfaces when finding source address on specific interface.
Date: Mon, 13 Jul 2015 15:32:18 +0900	[thread overview]
Message-ID: <55A35B72.2060009@miraclelinux.com> (raw)
In-Reply-To: <CAAedzxpMP-DmKOy-BfQkReGWmbujGqM_JsdmYtcuxVDqAdXNKg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

Hi,

Erik Kline wrote:
> Hmm, when I run a UML linux with this patch (which, I'm ashamed to
> say, I failed to do before) I get these kinds of errors:
> 
>     unregister_netdevice: waiting for <TAPdevice> to become free.
> Usage count = 1
>     unregister_netdevice: waiting for <TAPdevice> to become free.
> Usage count = 1
> 
> Perhaps they're unrelated... I'm still investigating.

Would you test attached patch please?

--yoshfuji

> 
> On 11 July 2015 at 15:19, David Miller <davem@davemloft.net> wrote:
>> From: YOSHIFUJI Hideaki/吉藤英明 <hideaki.yoshifuji@miraclelinux.com>
>> Date: Fri, 10 Jul 2015 16:58:31 +0900
>>
>>> If outgoing interface is specified and the candidate address is
>>> restricted to the outgoing interface, it is enough to iterate
>>> over that given interface only.
>>>
>>> Signed-off-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
>>> Acked-by: Erik Kline <ek@google.com>
>>
>> Applied, thanks!

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

[-- Attachment #2: 0001-ipv6-Avoid-NULL-pointer-dereference-in-__ipv6_dev_ge.patch --]
[-- Type: text/x-diff, Size: 1235 bytes --]

>From 38c5a10a5876ea47766ffc05b5a131a210d6e1aa Mon Sep 17 00:00:00 2001
From: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
Date: Mon, 13 Jul 2015 15:23:02 +0900
Subject: [PATCH] ipv6: Avoid NULL pointer dereference in
 __ipv6_dev_get_saddr().

Commit 9131f3de2 ("ipv6: Do not iterate over all interfaces when
finding source address on specific interface.") introduced
possible NULL pointer dereference if outgoing device is
specified.

Fixes: 9131f3de24db4dc12199aede7d931e6703e97f3b ("ipv6: Do not
	iterate over all interfaces when finding source address
	on specific interface.")
Signed-off-by: YOSHIFUJI Hideaki <hideaki.yoshifuji@miraclelinux.com>
---
 net/ipv6/addrconf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4ab74d5..50ad476 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1480,7 +1480,8 @@ int ipv6_dev_get_saddr(struct net *net, const struct net_device *dst_dev,
 	}
 
 	if (use_oif_addr) {
-		__ipv6_dev_get_saddr(net, &dst, prefs, saddr, idev, scores);
+		if (idev)
+			__ipv6_dev_get_saddr(net, &dst, prefs, saddr, idev, scores);
 	} else {
 		for_each_netdev_rcu(net, dev) {
 			idev = __in6_dev_get(dev);
-- 
1.9.1


  reply	other threads:[~2015-07-13  6:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10  7:58 [PATCH net-next v2] ipv6: Do not iterate over all interfaces when finding source address on specific interface YOSHIFUJI Hideaki/吉藤英明
2015-07-11  6:19 ` David Miller
2015-07-11  9:21   ` Erik Kline
2015-07-13  6:32     ` YOSHIFUJI Hideaki [this message]
2015-07-13  8:38       ` Erik Kline
2015-07-13 10:55         ` Hajime Tazaki
2015-07-13 13:49           ` YOSHIFUJI Hideaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55A35B72.2060009@miraclelinux.com \
    --to=hideaki.yoshifuji@miraclelinux.com \
    --cc=davem@davemloft.net \
    --cc=ek@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=lorenzo@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.