* [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop
@ 2019-06-25 0:14 Stephen Suryaputra
2019-06-25 17:51 ` David Ahern
2019-06-25 19:47 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Stephen Suryaputra @ 2019-06-25 0:14 UTC (permalink / raw)
To: netdev; +Cc: dsahern, Stephen Suryaputra
In commit 19e4e768064a8 ("ipv4: Fix raw socket lookup for local
traffic"), the dif argument to __raw_v4_lookup() is coming from the
returned value of inet_iif() but the change was done only for the first
lookup. Subsequent lookups in the while loop still use skb->dev->ifIndex.
Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com>
---
net/ipv4/raw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 0b8e06ca75d6..40a6abbc9cf6 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -197,7 +197,7 @@ static int raw_v4_input(struct sk_buff *skb, const struct iphdr *iph, int hash)
}
sk = __raw_v4_lookup(net, sk_next(sk), iph->protocol,
iph->saddr, iph->daddr,
- skb->dev->ifindex, sdif);
+ dif, sdif);
}
out:
read_unlock(&raw_v4_hashinfo.lock);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop
2019-06-25 0:14 [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop Stephen Suryaputra
@ 2019-06-25 17:51 ` David Ahern
2019-06-25 19:47 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Ahern @ 2019-06-25 17:51 UTC (permalink / raw)
To: Stephen Suryaputra, netdev; +Cc: dsahern
On 6/24/19 6:14 PM, Stephen Suryaputra wrote:
> In commit 19e4e768064a8 ("ipv4: Fix raw socket lookup for local
> traffic"), the dif argument to __raw_v4_lookup() is coming from the
> returned value of inet_iif() but the change was done only for the first
> lookup. Subsequent lookups in the while loop still use skb->dev->ifIndex.
>
> Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com>
> ---
> net/ipv4/raw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
> index 0b8e06ca75d6..40a6abbc9cf6 100644
> --- a/net/ipv4/raw.c
> +++ b/net/ipv4/raw.c
> @@ -197,7 +197,7 @@ static int raw_v4_input(struct sk_buff *skb, const struct iphdr *iph, int hash)
> }
> sk = __raw_v4_lookup(net, sk_next(sk), iph->protocol,
> iph->saddr, iph->daddr,
> - skb->dev->ifindex, sdif);
> + dif, sdif);
> }
> out:
> read_unlock(&raw_v4_hashinfo.lock);
>
ugh, missed that in 19e4e768064a8; thanks for the patch.
Reviewed-by: David Ahern <dsahern@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop
2019-06-25 0:14 [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop Stephen Suryaputra
2019-06-25 17:51 ` David Ahern
@ 2019-06-25 19:47 ` David Miller
2019-06-25 19:59 ` Stefano Brivio
1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2019-06-25 19:47 UTC (permalink / raw)
To: ssuryaextr; +Cc: netdev, dsahern
From: Stephen Suryaputra <ssuryaextr@gmail.com>
Date: Mon, 24 Jun 2019 20:14:06 -0400
> In commit 19e4e768064a8 ("ipv4: Fix raw socket lookup for local
> traffic"), the dif argument to __raw_v4_lookup() is coming from the
> returned value of inet_iif() but the change was done only for the first
> lookup. Subsequent lookups in the while loop still use skb->dev->ifIndex.
>
> Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com>
Applied and queued up for -stable.
I added the appropriate Fixes: tag, please do so next time.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop
2019-06-25 19:47 ` David Miller
@ 2019-06-25 19:59 ` Stefano Brivio
0 siblings, 0 replies; 4+ messages in thread
From: Stefano Brivio @ 2019-06-25 19:59 UTC (permalink / raw)
To: David Miller; +Cc: ssuryaextr, netdev, dsahern
On Tue, 25 Jun 2019 12:47:38 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Suryaputra <ssuryaextr@gmail.com>
> Date: Mon, 24 Jun 2019 20:14:06 -0400
>
> > In commit 19e4e768064a8 ("ipv4: Fix raw socket lookup for local
> > traffic"), the dif argument to __raw_v4_lookup() is coming from the
> > returned value of inet_iif() but the change was done only for the first
> > lookup. Subsequent lookups in the while loop still use skb->dev->ifIndex.
> >
> > Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com>
>
> Applied and queued up for -stable.
>
> I added the appropriate Fixes: tag, please do so next time.
I was about to point that out, but then I noticed that this
doesn't actually fix 19e4e768064a8 ("ipv4: Fix raw socket lookup for
local traffic"), it's just related as it fixes the same issue in
another (very likely) path in the same function.
I think this should have been:
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
I *guess* for -stable purposes the effect is the same.
--
Stefano
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-25 19:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25 0:14 [PATCH net] ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop Stephen Suryaputra
2019-06-25 17:51 ` David Ahern
2019-06-25 19:47 ` David Miller
2019-06-25 19:59 ` Stefano Brivio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).