Re: [2.6.34-rc5-git6] EIP: is at inet6_csk_bind_conflict + 06xe/0xb7 [ipv6]

From: Sedat Dilek
Date: Sun Apr 25 2010 - 12:56:25 EST


Rebuild ipv6 kernel-modules by:

$ make M=net/ipv6

...and copied net/ipv6/*.ko and net/ipv6/netfilter/*.ko files manually
to the right place.

Applied your patch (seen on netdev ML) already and booted into new kernel.
Works, thanks.

Tested-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>

- Sedat -

On Sun, Apr 25, 2010 at 6:39 PM, Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:
> Le dimanche 25 avril 2010 Ã 18:36 +0200, Piotr Hosowicz a Ãcrit :
>> On 25.04.2010 18:31, Sedat Dilek wrote:
>> > [ CCing netdev ML ]
>> >
>> > Confirmed: The revert-patch [1] fixes the problem here.
>>
>> I confirm, I've built a git6 kernel and it works fine.
>>
>> > See also "Bug 15847 - Âcrash in inet6_csk_bind_conflict" [2].
>> >
>> > Feel free to add a... Tested-by: Sedat Dilek<sedat.dilek@xxxxxxxxx>
>>
>> I added created and tested phrase in my archive. ;-) Thank you a lot. I
>> hope there will be no this error in git7.
>>
>
> Did you test the proposed fix ?
>
>
> [PATCH] ipv6: Fix inet6_csk_bind_conflict()
>
> Commit fda48a0d7a84 (tcp: bind() fix when many ports are bound)
> introduced a bug on IPV6 part.
> We should not call ipv6_addr_any(inet6_rcv_saddr(sk2)) but
> ipv6_addr_any(inet6_rcv_saddr(sk)) because sk2 can be IPV4, while sk is
> IPV6.
>
> Reported-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
> Signed-off-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
> ---
> diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
> index b4b7d40..3a4d92b 100644
> --- a/net/ipv6/inet6_connection_sock.c
> +++ b/net/ipv6/inet6_connection_sock.c
> @@ -48,7 +48,7 @@ int inet6_csk_bind_conflict(const struct sock *sk,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â ipv6_rcv_saddr_equal(sk, sk2))
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Â Â Â Â Âelse if (sk->sk_reuse && sk2->sk_reuse &&
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â !ipv6_addr_any(inet6_rcv_saddr(sk2)) &&
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â !ipv6_addr_any(inet6_rcv_saddr(sk)) &&
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âipv6_rcv_saddr_equal(sk, sk2))
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âbreak;
> Â Â Â Â Â Â Â Â}
>
>
>
[PATCH] ipv6: Fix inet6_csk_bind_conflict()

Commit fda48a0d7a84 (tcp: bind() fix when many ports are bound)
introduced a bug on IPV6 part.
We should not call ipv6_addr_any(inet6_rcv_saddr(sk2)) but
ipv6_addr_any(inet6_rcv_saddr(sk)) because sk2 can be IPV4, while sk is
IPV6.

Reported-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
Signed-off-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
---
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index b4b7d40..3a4d92b 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -48,7 +48,7 @@ int inet6_csk_bind_conflict(const struct sock *sk,
ipv6_rcv_saddr_equal(sk, sk2))
break;
else if (sk->sk_reuse && sk2->sk_reuse &&
- !ipv6_addr_any(inet6_rcv_saddr(sk2)) &&
+ !ipv6_addr_any(inet6_rcv_saddr(sk)) &&
ipv6_rcv_saddr_equal(sk, sk2))
break;
}