Erik Hugne | 17 Apr 15:41 2015
Picon

Re: [PATCH] tipc: fix topology server broken issue

I can't get it to work either, the topology server name is not published inside
the namespace with this patch.
But i don't see the crash that Adrian have, and the crash i had earlier seems solved.

//E

On Fri, Apr 17, 2015 at 02:11:41PM +0200, Adrian Szwej wrote:
> Hi
> 
> I did not manage to get it work with the patch. Note I use macvlan in my container where is set the bearer on.
> When I exit the container following is dumped:
> 
> Apr 17 14:03:54 da-1 kernel: [  172.028002] NMI watchdog: BUG: soft lockup - CPU#1 stuck for 23s! [kworker/u4:0:6]
> Apr 17 14:03:54 da-1 kernel: [  172.028002] Modules linked in: macvlan(E) veth(E) xt_addrtype(E)
xt_conntrack(E) ipt_MASQUERADE(E) nf_nat_masquerade_ipv4(E) iptable_nat(E) nf_conntrack_ipv4(
> E) nf_defrag_ipv4(E) nf_nat_ipv4(E) nf_nat(E) nf_conntrack(E) bridge(E) stp(E) llc(E)
dm_thin_pool(E) dm_persistent_data(E) dm_bio_prison(E) dm_bufio(E) libcrc32c(E)
ebtable_filter(E) ebtabl
> es(E) ip6table_filter(E) ip6_tables(E) iptable_filter(E) ip_tables(E) x_tables(E) ppdev(E)
snd_hda_codec_generic(E) kvm_intel(E) kvm(E) snd_hda_intel(E) cirrus(E) snd_hda_controller(E) snd_h
> da_codec(E) serio_raw(E) snd_hwdep(E) snd_pcm(E) snd_timer(E) ttm(E) snd(E) soundcore(E)
drm_kms_helper(E) drm(E) syscopyarea(E) sysfillrect(E) sysimgblt(E) i2c_piix4(E) pvpanic(E) 8250_fint
> ek(E) parport_pc(E) parport(E) mac_hid(E) tipc(E) ip6_udp_tunnel(E) udp_tunnel(E) autofs4(E)
psmouse(E) floppy(E) pata_acpi(E)
> Apr 17 14:03:54 da-1 kernel: [  172.028002] CPU: 1 PID: 6 Comm: kworker/u4:0 Tainted: G            E   4.0.0+ #7
> Apr 17 14:03:54 da-1 kernel: [  172.028002] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
Bochs 01/01/2011
> Apr 17 14:03:54 da-1 kernel: [  172.028002] Workqueue: tipc_rcv tipc_recv_work [tipc]
> Apr 17 14:03:54 da-1 kernel: [  172.028002] task: ffff88007c883250 ti: ffff88007c8ac000 task.ti: ffff88007c8ac000
> Apr 17 14:03:54 da-1 kernel: [  172.028002] RIP: 0010:[<ffffffff817c8482>]  [<ffffffff817c8482>] _raw_spin_lock_bh+0x32/0x60
(Continue reading)

erik.hugne | 17 Apr 13:44 2015
Picon

[PATCH 1/2] tipc: fix a message rejection bug

From: Erik Hugne <erik.hugne <at> ericsson.com>

Messages should only be rejected back if we succeed in reversing
the message. There is a bug in how this is handled for messages
received from the backlog queue. A message will be passed back to
the link layer unconditionally using an uninitialized destination
node if the skb was not consumed and no error code was set.
In the best case, the packet will be dropped because the
destination link cannot be found, but may also cause resets on
random links.
We fix this by only rejecting the message if an error occured
_and_ if reversal succeded. We also fix a potential memory leak
when we fail to reverse non-errored messages, for example if dest
droppable is true.

Signed-off-by: Erik Hugne <erik.hugne <at> ericsson.com>
---
 net/tipc/socket.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ee90d74..5bff7df 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
 <at>  <at>  -1701,8 +1701,13  <at>  <at>  static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
 			atomic_add(truesize, dcnt);
 		return 0;
 	}
-	if (!err || tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
-		tipc_link_xmit_skb(net, skb, dnode, tsk->portid);
(Continue reading)

Ying Xue | 17 Apr 11:18 2015

[PATCH] tipc: fix topology server broken issue

When a new topology server is launched in a new namespace, its
listening socket is inserted into the "init ns" namespace's socket
hash table rather than the one owned by the new namespace. Although
the socket's namespace is forcedly changed to the new namespace later,
the socket is still stored in the socket hash table of "init ns"
namespace. When a client created in the new namespace connects
its own topology server, the connection is failed as its server's
socket could not be found from its own namespace's socket table.

If __sock_create() instead of original sock_create_kern() is used
to create the server's socket through specifying an expected namesapce,
the socket will be inserted into the specified namespace's socket
table, thereby avoiding to the topology server broken issue.

Fixes: 76100a8a64bc ("tipc: fix netns refcnt leak")
Signed-off-by: Ying Xue <ying.xue <at> windriver.com>
Reported-by: Erik Hugne <erik.hugne <at> ericsson.com>
---
 net/tipc/server.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/tipc/server.c b/net/tipc/server.c
index ab6183c..77ff03e 100644
--- a/net/tipc/server.c
+++ b/net/tipc/server.c
 <at>  <at>  -102,7 +102,7  <at>  <at>  static void tipc_conn_kref_release(struct kref *kref)
 		}
 		saddr->scope = -TIPC_NODE_SCOPE;
 		kernel_bind(sock, (struct sockaddr *)saddr, sizeof(*saddr));
-		sk_release_kernel(sk);
(Continue reading)

Tomi Ollila | 16 Apr 13:04 2015
X-Face
Picon
Picon

tipc-config and linux kernel 4.0.0

Hi

Should this work on linux kernel 4.0.0 (commit: 39a8804455fb)

sudo ./tipc-config -V -s -v -lt eth/400 -lw eth/150 -lp eth/10

I get

TIPC configuration tool version 2.0.5
TIPC version 2.0.0
incorrect message format

on older kernels (3.13 & 3.17) I get

TIPC configuration tool version 2.0.5
TIPC version 2.0.0
Link <eth> changed tolerance to 400
Link <eth> changed window to 150
Link <eth> changed priority to 10

On 4.0.0 I also tried latest from 
http://git.code.sf.net/p/tipc/tipcutils
(81d9135,  Wed, 25 Mar 2015 13:16:10 -0400)
which printed 'TIPC configuration tool version 2.1.0'
as first line; otherwise results the same.

sudo ./tipc-config -v -netid=1234 -a=1.2.4 -be:eth=eth0
works fine, just that If I try second time I get
'incorrect message format' on 4.0.0 and 'unable to enable bearer'
on older kernels.
(Continue reading)

Richard Alpe | 15 Apr 10:44 2015
Picon

New tipc tool for iproute2 package

Hey guys,

I have rewritten the new tipc tool that is currently in our tipc-utils 
package. The intention is to get it included in the iproute2 package as 
previously discussed. The command line syntax has changed slightly and 
the internals are basically all new.

Worth mentioning is that I have spent quite a lot of time designing the 
"new" syntax and the internal command hierarchy. Keep in mind that this 
tool is not designed to be a simple tool for us who work daily with 
tipc, rather it's designed with the intention to live many years and be 
able to evolve while being as consistent and logical as possible.

Try it out! I would greatly appreciate code-review before submitting it 
to iproute2 (a good place to start is the README file).

https://github.com/rical/iproute2

Regards
Richard

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
Erik Hugne | 15 Apr 10:00 2015
Picon

topology server broken inside NS

Hi guys.
Adrian found a problem with the topology server in namespaces.
The name is published, but the server does not accept connections
for some reason.
node1 ~ # modprobe tipc
node1 ~ # tipc nametable show
Type       Lower      Upper      Port Identity              Publication Scope
1          1          1          <0.0.0:3223527917>         3223527918  node
node1 ~ # ip netns add test
node1 ~ # ip netns exec test /tmp/client_tipc &
node1 ~ # ****** TIPC client hello world program started ******
node1 ~ # cat /proc/$(pgrep client_tipc)/stack
[<ffffffffa00487a6>] tipc_wait_for_connect.isra.50+0xe6/0x170 [tipc]
[<ffffffffa0048987>] tipc_connect+0x157/0x1b0 [tipc]
[<ffffffff8152b34e>] SyS_connect+0xbe/0xe0
[<ffffffff816988f2>] system_call_fastpath+0x12/0x17
[<ffffffffffffffff>] 0xffffffffffffffff
node1 ~ # Client: failed to connect to topology server: Connection timed out

client_tipc is the hello_world example from /demos that tries to connect to the
topology server

//E

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
(Continue reading)

erik.hugne | 13 Apr 13:16 2015
Picon

[PATCH] tipc: fix a message rejection bug

From: Erik Hugne <erik.hugne <at> ericsson.com>

Messages should only be rejected back if we succeed in reversing
the message. There is a bug in how this is handled for messages
received from the backlog queue. A message will be passed back to
the link layer unconditionally using an uninitialized destination
node if the skb was not consumed and no error code was set.
In the best case, the packet will be dropped because the
destination link cannot be found, but may also cause resets on
random links.
We fix this by only rejecting the message if an error occured
_and_ if reversal succeded. We also fix a potential memory leak
when we fail to reverse non-errored messages, for example if dest
droppable is true.

Signed-off-by: Erik Hugne <erik.hugne <at> ericsson.com>
---
 net/tipc/socket.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ee90d74..5bff7df 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
 <at>  <at>  -1701,8 +1701,13  <at>  <at>  static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
 			atomic_add(truesize, dcnt);
 		return 0;
 	}
-	if (!err || tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
-		tipc_link_xmit_skb(net, skb, dnode, tsk->portid);
(Continue reading)

erik.hugne | 10 Apr 14:20 2015
Picon

[PATCH (resend) v2] tipc: don't reject messages if reversal fails

From: Erik Hugne <erik.hugne <at> ericsson.com>

When we fail to deliver a message to a socket, it is subject to
message reversal. If the call to tipc_msg_reverse fails, we are
passing dnode uninitialized to tipc_link_xmit_skb which causes the
packet to either be dropped, or sent out to a random link. In the
worst case this leads to a link reset.
We fix this by only transmitting the message if reversal succeded.
Also, the redundant check for 'err' is removed, because if the message
was not consumed, it will always be set.

Signed-off-by: Erik Hugne <erik.hugne <at> ericsson.com>
Reviewed-by: Billie Alsup <billie.alsup <at> ericsson.com>

---
Resend for internal review first, i sent it to netdev by accident.. :|

V2: fixed 'err' redundant check according to comment from Billie

 net/tipc/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ee90d74..d215f73 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
 <at>  <at>  -1701,7 +1701,7  <at>  <at>  static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
 			atomic_add(truesize, dcnt);
 		return 0;
 	}
(Continue reading)

Erik Hugne | 10 Apr 13:37 2015
Picon

Re: Retransmission failures -> Link resets

If we receive a CONN_MSG (tipc_sk_rcv()) to a socket that have been closed,
tipc_sk_enqueue() will return TIPC_ERR_NO_PORT.
We then need to figure out what to do with the received packet.

I see that the rejection logic differs a little for when we have the sk (tipc_sk_enqueue)
and when it's owned by the user (tipc_backlog_rcv).

Specifically, it will unconditionally bounce the packet back, even if tipc_msg_reverse fails,
and i think this code chunk should actually be: 

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ee90d74..34bc96c 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
 <at>  <at>  -1701,7 +1701,7  <at>  <at>  static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
                        atomic_add(truesize, dcnt);
                return 0;
        }
-       if (!err || tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
+       if (!err && tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
                tipc_link_xmit_skb(net, skb, dnode, tsk->portid);
        return 0;
 }

This might explain the randomness in how the prev.node field is mixed up (as seen in the pcap.

I'll send a proper patch soon.

//E

(Continue reading)

Jon Maloy | 2 Apr 16:21 2015
Picon

[PATCH net-next 0/5] tipc: some simplifications and improvements

There are still numerous occurrences of unnecessary complexity in
the TIPC code. This commit series addresses some of them.

Jon Maloy (5):
  tipc: simplify resetting and disabling of bearers
  tipc: simplify link timer handling
  tipc: simplify include dependencies
  tipc: simplify sequence number handling and checkpointing
  tipc: rename fields in struct tipc_link

 net/tipc/addr.c   |   7 --
 net/tipc/addr.h   |   8 +++
 net/tipc/bcast.c  |  18 ++---
 net/tipc/bearer.c |  18 +++--
 net/tipc/bearer.h |   2 +-
 net/tipc/core.h   |  37 +++++++++--
 net/tipc/link.c   | 193 ++++++++++++++++++++++++------------------------------
 net/tipc/link.h   |  59 ++++-------------
 net/tipc/msg.h    |   5 ++
 net/tipc/net.c    |   1 +
 net/tipc/node.c   |   1 +
 net/tipc/node.h   |   2 -
 net/tipc/socket.c |   1 +
 13 files changed, 163 insertions(+), 189 deletions(-)

--

-- 
1.9.1

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
(Continue reading)

Ying Xue | 31 Mar 04:33 2015

[PATCH net-next] tipc: fix slab object leak

When remove TIPC module, there is a warning to remind us that a slab
object is leaked like:

root <at> localhost:~# rmmod tipc
[   19.056226] =============================================================================
[   19.057549] BUG TIPC (Not tainted): Objects remaining in TIPC on kmem_cache_close()
[   19.058736] -----------------------------------------------------------------------------
[   19.058736]
[   19.060287] INFO: Slab 0xffffea0000519a00 objects=23 used=1 fp=0xffff880014668b00 flags=0x100000000004080
[   19.061915] INFO: Object 0xffff880014668000  <at> offset=0
[   19.062717] kmem_cache_destroy TIPC: Slab cache still has objects

This is because the listening socket of TIPC topology server is not
closed before TIPC proto handler is unregistered with proto_unregister().
However, as the socket is closed in tipc_exit_net(), the warning can
be eliminated if the handler of unregistering TIPC namespace operation
is moved before the instance of unregistering TIPC proto.

Fixes: e05b31f4bf89 ("tipc: make tipc socket support net namespace")
Signed-off-by: Ying Xue <ying.xue <at> windriver.com>
---
 net/tipc/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/core.c b/net/tipc/core.c
index 935205e..be1c9fa 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
 <at>  <at>  -152,11 +152,11  <at>  <at>  out_netlink:
 static void __exit tipc_exit(void)
(Continue reading)


Gmane