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

From: Sedat Dilek
Date: Sun Apr 25 2010 - 11:11:21 EST


[ Please CC - I am not subscribed to LKML ]

[QUOTE]

On 25.04.2010 16:26, Jongman Heo wrote:

> I also hit this bug today.

I also hit similar bug, maybe it is the same.

> Doing git bisect, first bad commit was
>
> commit fda48a0d7a8412cedacda46a9c0bf8ef9cd13559
> tcp: bind() fix when many ports are bound
>
> Reverting above commit fixes the problem.

How to do it? Would you please publish a reverting patch?

Regards,

Piotr Hosowicz

[/QUOTE]

Hi,

did forget to mention 2.6.34-rc5-git5 was OK.

Revering this commit did not help:

commit f4f914b58019f0e50d521bbbadfaee260d766f95
net: ipv6 bind to device issue

After looking into net-2.6 GIT repository, "tcp: bind() fix when many
ports are bound" could cause indeed the problems here, too.
Building now....

Regards,
- Sedat -

P.S.: Attached 0001-Revert-tcp-bind-fix-when-many-ports-are-bound.patch
From 9441e34ca40b81a7f84be8439d2d82dbad979967 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@xxxxxxxxx>
Date: Sun, 25 Apr 2010 16:54:13 +0200
Subject: [PATCH] Revert "tcp: bind() fix when many ports are bound"

This reverts commit fda48a0d7a8412cedacda46a9c0bf8ef9cd13559.
---
net/ipv4/inet_connection_sock.c | 16 +++++-----------
net/ipv6/inet6_connection_sock.c | 15 +++++----------
2 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 14825eb..8da6429 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -70,17 +70,13 @@ int inet_csk_bind_conflict(const struct sock *sk,
(!sk->sk_bound_dev_if ||
!sk2->sk_bound_dev_if ||
sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
- const __be32 sk2_rcv_saddr = inet_rcv_saddr(sk2);
-
if (!reuse || !sk2->sk_reuse ||
sk2->sk_state == TCP_LISTEN) {
+ const __be32 sk2_rcv_saddr = inet_rcv_saddr(sk2);
if (!sk2_rcv_saddr || !sk_rcv_saddr ||
sk2_rcv_saddr == sk_rcv_saddr)
break;
- } else if (reuse && sk2->sk_reuse &&
- sk2_rcv_saddr &&
- sk2_rcv_saddr == sk_rcv_saddr)
- break;
+ }
}
}
return node != NULL;
@@ -124,11 +120,9 @@ again:
smallest_size = tb->num_owners;
smallest_rover = rover;
if (atomic_read(&hashinfo->bsockets) > (high - low) + 1) {
- if (!inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) {
- spin_unlock(&head->lock);
- snum = smallest_rover;
- goto have_snum;
- }
+ spin_unlock(&head->lock);
+ snum = smallest_rover;
+ goto have_snum;
}
}
goto next;
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index b4b7d40..628db24 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -42,16 +42,11 @@ int inet6_csk_bind_conflict(const struct sock *sk,
if (sk != sk2 &&
(!sk->sk_bound_dev_if ||
!sk2->sk_bound_dev_if ||
- sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
- if ((!sk->sk_reuse || !sk2->sk_reuse ||
- sk2->sk_state == TCP_LISTEN) &&
- ipv6_rcv_saddr_equal(sk, sk2))
- break;
- else if (sk->sk_reuse && sk2->sk_reuse &&
- !ipv6_addr_any(inet6_rcv_saddr(sk2)) &&
- ipv6_rcv_saddr_equal(sk, sk2))
- break;
- }
+ sk->sk_bound_dev_if == sk2->sk_bound_dev_if) &&
+ (!sk->sk_reuse || !sk2->sk_reuse ||
+ sk2->sk_state == TCP_LISTEN) &&
+ ipv6_rcv_saddr_equal(sk, sk2))
+ break;
}

return node != NULL;
--
1.7.0.5