<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/tipc, branch v4.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-07-12T05:42:12Z</updated>
<entry>
<title>tipc: reset all unicast links when broadcast send link fails</title>
<updated>2016-07-12T05:42:12Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2016-07-11T20:08:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1fc07f3e1541cc49cc159beb3fdefc5013570eda'/>
<id>urn:sha1:1fc07f3e1541cc49cc159beb3fdefc5013570eda</id>
<content type='text'>
In test situations with many nodes and a heavily stressed system we have
observed that the transmission broadcast link may fail due to an
excessive number of retransmissions of the same packet. In such
situations we need to reset all unicast links to all peers, in order to
reset and re-synchronize the broadcast link.

In this commit, we add a new function tipc_bearer_reset_all() to be used
in such situations. The function scans across all bearers and resets all
their pertaining links.

Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: ensure correct broadcast send buffer release when peer is lost</title>
<updated>2016-07-12T05:42:12Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2016-07-11T20:08:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a71eb720355c28eaeb2de0c4d960247c69bb2c6f'/>
<id>urn:sha1:a71eb720355c28eaeb2de0c4d960247c69bb2c6f</id>
<content type='text'>
After a new receiver peer has been added to the broadcast transmission
link, we allow immediate transmission of new broadcast packets, trusting
that the new peer will not accept the packets until it has received the
previously sent unicast broadcast initialiation message. In the same
way, the sender must not accept any acknowledges until it has itself
received the broadcast initialization from the peer, as well as
confirmation of the reception of its own initialization message.

Furthermore, when a receiver peer goes down, the sender has to produce
the missing acknowledges from the lost peer locally, in order ensure
correct release of the buffers that were expected to be acknowledged by
the said peer.

In a highly stressed system we have observed that contact with a peer
may come up and be lost before the above mentioned broadcast initial-
ization and confirmation have been received. This leads to the locally
produced acknowledges being rejected, and the non-acknowledged buffers
to linger in the broadcast link transmission queue until it fills up
and the link goes into permanent congestion.

In this commit, we remedy this by temporarily setting the corresponding
broadcast receive link state to ESTABLISHED and the 'bc_peer_is_up'
state to true before we issue the local acknowledges. This ensures that
those acknowledges will always be accepted. The mentioned state values
are restored immediately afterwards when the link is reset.

Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: extend broadcast link initialization criteria</title>
<updated>2016-07-12T05:42:12Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2016-07-11T20:08:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2d18ac4ba7454a4260473e68be7e485ae71e7948'/>
<id>urn:sha1:2d18ac4ba7454a4260473e68be7e485ae71e7948</id>
<content type='text'>
At first contact between two nodes, an endpoint might sometimes have
time to send out a LINK_PROTOCOL/STATE packet before it has received
the broadcast initialization packet from the peer, i.e., before it has
received a valid broadcast packet number to add to the 'bc_ack' field
of the protocol message.

This means that the peer endpoint will receive a protocol packet with an
invalid broadcast acknowledge value of 0. Under unlucky circumstances
this may lead to the original, already received acknowledge value being
overwritten, so that the whole broadcast link goes stale after a while.

We fix this by delaying the setting of the link field 'bc_peer_is_up'
until we know that the peer really has received our own broadcast
initialization message. The latter is always sent out as the first
unicast message on a link, and always with seqeunce number 1. Because
of this, we only need to look for a non-zero unicast acknowledge value
in the arriving STATE messages, and once that is confirmed we know we
are safe and can set the mentioned field. Before this moment, we must
ignore all broadcast acknowledges from the peer.

Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix nl compat regression for link statistics</title>
<updated>2016-07-01T20:47:38Z</updated>
<author>
<name>Richard Alpe</name>
<email>richard.alpe@ericsson.com</email>
</author>
<published>2016-07-01T09:11:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55e77a3e8297581c919b45adcc4d0815b69afa84'/>
<id>urn:sha1:55e77a3e8297581c919b45adcc4d0815b69afa84</id>
<content type='text'>
Fix incorrect use of nla_strlcpy() where the first NLA_HDRLEN bytes
of the link name where left out.

Making the output of tipc-config -ls look something like:
Link statistics:
dcast-link
1:data0-1.1.2:data0
1:data0-1.1.3:data0

Also, for the record, the patch that introduce this regression
claims "Sending the whole object out can cause a leak". Which isn't
very likely as this is a compat layer, where the data we are parsing
is generated by us and we know the string to be NULL terminated. But
you can of course never be to secure.

Fixes: 5d2be1422e02 (tipc: fix an infoleak in tipc_nl_compat_link_dump)
Signed-off-by: Richard Alpe &lt;richard.alpe@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: unclone unbundled buffers before forwarding</title>
<updated>2016-06-22T20:33:35Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2016-06-20T13:20:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=27777daa8b6df0c19aaf591d1536a586b3eb5e36'/>
<id>urn:sha1:27777daa8b6df0c19aaf591d1536a586b3eb5e36</id>
<content type='text'>
When extracting an individual message from a received "bundle" buffer,
we just create a clone of the base buffer, and adjust it to point into
the right position of the linearized data area of the latter. This works
well for regular message reception, but during periods of extremely high
load it may happen that an extracted buffer, e.g, a connection probe, is
reversed and forwarded through an external interface while the preceding
extracted message is still unhandled. When this happens, the header or
data area of the preceding message will be partially overwritten by a
MAC header, leading to unpredicatable consequences, such as a link
reset.

We now fix this by ensuring that the msg_reverse() function never
returns a cloned buffer, and that the returned buffer always contains
sufficient valid head and tail room to be forwarded.

Reported-by: Erik Hugne &lt;erik.hugne@gmail.com&gt;
Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix socket timer deadlock</title>
<updated>2016-06-18T04:38:10Z</updated>
<author>
<name>Jon Paul Maloy</name>
<email>jon.maloy@ericsson.com</email>
</author>
<published>2016-06-17T10:35:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f1d048f24e66ba85d3dabf3d076cefa5f2b546b0'/>
<id>urn:sha1:f1d048f24e66ba85d3dabf3d076cefa5f2b546b0</id>
<content type='text'>
We sometimes observe a 'deadly embrace' type deadlock occurring
between mutually connected sockets on the same node. This happens
when the one-hour peer supervision timers happen to expire
simultaneously in both sockets.

The scenario is as follows:

CPU 1:                          CPU 2:
--------                        --------
tipc_sk_timeout(sk1)            tipc_sk_timeout(sk2)
  lock(sk1.slock)                 lock(sk2.slock)
  msg_create(probe)               msg_create(probe)
  unlock(sk1.slock)               unlock(sk2.slock)
  tipc_node_xmit_skb()            tipc_node_xmit_skb()
    tipc_node_xmit()                tipc_node_xmit()
      tipc_sk_rcv(sk2)                tipc_sk_rcv(sk1)
        lock(sk2.slock)                 lock((sk1.slock)
        filter_rcv()                    filter_rcv()
          tipc_sk_proto_rcv()             tipc_sk_proto_rcv()
            msg_create(probe_rsp)           msg_create(probe_rsp)
            tipc_sk_respond()               tipc_sk_respond()
              tipc_node_xmit_skb()            tipc_node_xmit_skb()
                tipc_node_xmit()                tipc_node_xmit()
                  tipc_sk_rcv(sk1)                tipc_sk_rcv(sk2)
                    lock((sk1.slock)                lock((sk2.slock)
                    ===&gt; DEADLOCK                   ===&gt; DEADLOCK

Further analysis reveals that there are three different locations in the
socket code where tipc_sk_respond() is called within the context of the
socket lock, with ensuing risk of similar deadlocks.

We now solve this by passing a buffer queue along with all upcalls where
sk_lock.slock may potentially be held. Response or rejected message
buffers are accumulated into this queue instead of being sent out
directly, and only sent once we know we are safely outside the slock
context.

Reported-by: GUNA &lt;gbalasun@gmail.com&gt;
Acked-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: eliminate uninitialized variable warning</title>
<updated>2016-06-16T04:47:23Z</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2016-06-15T06:11:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c91522f860bb9dd4178c8280bbebd4f4321b7199'/>
<id>urn:sha1:c91522f860bb9dd4178c8280bbebd4f4321b7199</id>
<content type='text'>
net/tipc/link.c: In function ‘tipc_link_timeout’:
net/tipc/link.c:744:28: warning: ‘mtyp’ may be used uninitialized in this function [-Wuninitialized]

Fixes: 42b18f605fea ("tipc: refactor function tipc_link_timeout()")
Acked-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix suspicious RCU usage</title>
<updated>2016-06-16T04:47:23Z</updated>
<author>
<name>Ying Xue</name>
<email>ying.xue@windriver.com</email>
</author>
<published>2016-06-15T06:10:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=66d95b6705a6347f7b2645e042874ec0bb03b726'/>
<id>urn:sha1:66d95b6705a6347f7b2645e042874ec0bb03b726</id>
<content type='text'>
When run tipcTS&amp;tipcTC test suite, the following complaint appears:

[   56.926168] ===============================
[   56.926169] [ INFO: suspicious RCU usage. ]
[   56.926171] 4.7.0-rc1+ #160 Not tainted
[   56.926173] -------------------------------
[   56.926174] net/tipc/bearer.c:408 suspicious rcu_dereference_protected() usage!
[   56.926175]
[   56.926175] other info that might help us debug this:
[   56.926175]
[   56.926177]
[   56.926177] rcu_scheduler_active = 1, debug_locks = 1
[   56.926179] 3 locks held by swapper/4/0:
[   56.926180]  #0:  (((&amp;req-&gt;timer))){+.-...}, at: [&lt;ffffffff810e79b5&gt;] call_timer_fn+0x5/0x340
[   56.926203]  #1:  (&amp;(&amp;req-&gt;lock)-&gt;rlock){+.-...}, at: [&lt;ffffffffa000c29b&gt;] disc_timeout+0x1b/0xd0 [tipc]
[   56.926212]  #2:  (rcu_read_lock){......}, at: [&lt;ffffffffa00055e0&gt;] tipc_bearer_xmit_skb+0xb0/0x2e0 [tipc]
[   56.926218]
[   56.926218] stack backtrace:
[   56.926221] CPU: 4 PID: 0 Comm: swapper/4 Not tainted 4.7.0-rc1+ #160
[   56.926222] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[   56.926224]  0000000000000000 ffff880016803d28 ffffffff813c4423 ffff8800154252c0
[   56.926227]  0000000000000001 ffff880016803d58 ffffffff810b7512 ffff8800124d8120
[   56.926230]  ffff880013f8a160 ffff8800132b5ccc ffff8800124d8120 ffff880016803d88
[   56.926234] Call Trace:
[   56.926235]  &lt;IRQ&gt;  [&lt;ffffffff813c4423&gt;] dump_stack+0x67/0x94
[   56.926250]  [&lt;ffffffff810b7512&gt;] lockdep_rcu_suspicious+0xe2/0x120
[   56.926256]  [&lt;ffffffffa00051f1&gt;] tipc_l2_send_msg+0x131/0x1c0 [tipc]
[   56.926261]  [&lt;ffffffffa000567c&gt;] tipc_bearer_xmit_skb+0x14c/0x2e0 [tipc]
[   56.926266]  [&lt;ffffffffa00055e0&gt;] ? tipc_bearer_xmit_skb+0xb0/0x2e0 [tipc]
[   56.926273]  [&lt;ffffffffa000c280&gt;] ? tipc_disc_init_msg+0x1f0/0x1f0 [tipc]
[   56.926278]  [&lt;ffffffffa000c280&gt;] ? tipc_disc_init_msg+0x1f0/0x1f0 [tipc]
[   56.926283]  [&lt;ffffffffa000c2d6&gt;] disc_timeout+0x56/0xd0 [tipc]
[   56.926288]  [&lt;ffffffff810e7a68&gt;] call_timer_fn+0xb8/0x340
[   56.926291]  [&lt;ffffffff810e79b5&gt;] ? call_timer_fn+0x5/0x340
[   56.926296]  [&lt;ffffffffa000c280&gt;] ? tipc_disc_init_msg+0x1f0/0x1f0 [tipc]
[   56.926300]  [&lt;ffffffff810e8f4a&gt;] run_timer_softirq+0x23a/0x390
[   56.926306]  [&lt;ffffffff810f89ff&gt;] ? clockevents_program_event+0x7f/0x130
[   56.926316]  [&lt;ffffffff819727c3&gt;] __do_softirq+0xc3/0x4a2
[   56.926323]  [&lt;ffffffff8106ba5a&gt;] irq_exit+0x8a/0xb0
[   56.926327]  [&lt;ffffffff81972456&gt;] smp_apic_timer_interrupt+0x46/0x60
[   56.926331]  [&lt;ffffffff81970a49&gt;] apic_timer_interrupt+0x89/0x90
[   56.926333]  &lt;EOI&gt;  [&lt;ffffffff81027fda&gt;] ? default_idle+0x2a/0x1a0
[   56.926340]  [&lt;ffffffff81027fd8&gt;] ? default_idle+0x28/0x1a0
[   56.926342]  [&lt;ffffffff810289cf&gt;] arch_cpu_idle+0xf/0x20
[   56.926345]  [&lt;ffffffff810adf0f&gt;] default_idle_call+0x2f/0x50
[   56.926347]  [&lt;ffffffff810ae145&gt;] cpu_startup_entry+0x215/0x3e0
[   56.926353]  [&lt;ffffffff81040ad9&gt;] start_secondary+0xf9/0x100

The warning appears as rtnl_dereference() is wrongly used in
tipc_l2_send_msg() under RCU read lock protection. Instead the proper
usage should be that rcu_dereference_rtnl() is called here.

Fixes: 5b7066c3dd24 ("tipc: stricter filtering of packets in bearer layer")
Acked-by: Jon Maloy &lt;jon.maloy@ericsson.com&gt;
Signed-off-by: Ying Xue &lt;ying.xue@windriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix an infoleak in tipc_nl_compat_link_dump</title>
<updated>2016-06-03T04:32:37Z</updated>
<author>
<name>Kangjie Lu</name>
<email>kangjielu@gmail.com</email>
</author>
<published>2016-06-02T08:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d2be1422e02ccd697ccfcd45c85b4a26e6178e2'/>
<id>urn:sha1:5d2be1422e02ccd697ccfcd45c85b4a26e6178e2</id>
<content type='text'>
link_info.str is a char array of size 60. Memory after the NULL
byte is not initialized. Sending the whole object out can cause
a leak.

Signed-off-by: Kangjie Lu &lt;kjlu@gatech.edu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: fix potential null pointer dereferences in some compat functions</title>
<updated>2016-05-25T19:33:52Z</updated>
<author>
<name>Baozeng Ding</name>
<email>sploving1@gmail.com</email>
</author>
<published>2016-05-24T14:33:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=297f7d2cce6a156c174334ee452f2f7a7ba405ca'/>
<id>urn:sha1:297f7d2cce6a156c174334ee452f2f7a7ba405ca</id>
<content type='text'>
Before calling the nla_parse_nested function, make sure the pointer to the
attribute is not null. This patch fixes several potential null pointer
dereference vulnerabilities in the tipc netlink functions.

Signed-off-by: Baozeng Ding &lt;sploving1@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
