<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/tipc, branch v3.10.45</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/tipc?h=v3.10.45</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/tipc?h=v3.10.45'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-06-26T19:12:37Z</updated>
<entry>
<title>net: Use netlink_ns_capable to verify the permisions of netlink messages</title>
<updated>2014-06-26T19:12:37Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2014-04-23T21:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1141a455802884d3bcbcf6b30e1d65d09cf286e1'/>
<id>urn:sha1:1141a455802884d3bcbcf6b30e1d65d09cf286e1</id>
<content type='text'>
[ Upstream commit 90f62cf30a78721641e08737bda787552428061e ]

It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.

To keep this from happening replace bare capable and ns_capable calls
with netlink_capable, netlink_net_calls and netlink_ns_capable calls.
Which act the same as the previous calls except they verify that the
opener of the socket had the desired permissions as well.

Reported-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: rework recvmsg handler msg_name and msg_namelen logic</title>
<updated>2013-12-08T15:29:25Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2013-11-21T02:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2f73d7fde99d702cba6a05062c27605a6eef1b78'/>
<id>urn:sha1:2f73d7fde99d702cba6a05062c27605a6eef1b78</id>
<content type='text'>
[ Upstream commit f3d3342602f8bcbf37d7c46641cb9bca7618eb1c ]

This patch now always passes msg-&gt;msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size &lt;= sizeof(struct sockaddr_storage)
to return msg_name to the user.

This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers and makes it harder for new code to accidentally leak
uninitialized memory.

Optimize for the case recvfrom is called with NULL as address. We don't
need to copy the address at all, so set it to NULL before invoking the
recvmsg handler. We can do so, because all the recvmsg handlers must
cope with the case a plain read() is called on them. read() also sets
msg_name to NULL.

Also document these changes in include/linux/net.h as suggested by David
Miller.

Changes since RFC:

Set msg-&gt;msg_name = NULL if user specified a NULL in msg_name but had a
non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
affect sendto as it would bail out earlier while trying to copy-in the
address. It also more naturally reflects the logic by the callers of
verify_iovec.

With this change in place I could remove "
if (!uaddr || msg_sys-&gt;msg_namelen == 0)
	msg-&gt;msg_name = NULL
".

This change does not alter the user visible error logic as we ignore
msg_namelen as long as msg_name is NULL.

Also remove two unnecessary curly brackets in ___sys_recvmsg and change
comments to netdev style.

Cc: David Miller &lt;davem@davemloft.net&gt;
Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tipc: set sk_err correctly when connection fails</title>
<updated>2013-09-14T13:54:56Z</updated>
<author>
<name>Erik Hugne</name>
<email>erik.hugne@ericsson.com</email>
</author>
<published>2013-08-28T07:29:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8db07b82b70897d868d864402b43a68da5e0cd59'/>
<id>urn:sha1:8db07b82b70897d868d864402b43a68da5e0cd59</id>
<content type='text'>
[ Upstream commit 2c8d85182348021fc0a1bed193a4be4161dc8364 ]

Should a connect fail, if the publication/server is unavailable or
due to some other error, a positive value will be returned and errno
is never set. If the application code checks for an explicit zero
return from connect (success) or a negative return (failure), it
will not catch the error and subsequent send() calls will fail as
shown from the strace snippet below.

socket(0x1e /* PF_??? */, SOCK_SEQPACKET, 0) = 3
connect(3, {sa_family=0x1e /* AF_??? */, sa_data="\2\1\322\4\0\0\322\4\0\0\0\0\0\0"}, 16) = 111
sendto(3, "test", 4, 0, NULL, 0)        = -1 EPIPE (Broken pipe)

The reason for this behaviour is that TIPC wrongly inverts error
codes set in sk_err.

Signed-off-by: Erik Hugne &lt;erik.hugne@ericsson.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tipc: potential divide by zero in tipc_link_recv_fragment()</title>
<updated>2013-05-06T20:16:52Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2013-05-06T09:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6bf15191f666c5965d212561d7a5c7b78b808dfa'/>
<id>urn:sha1:6bf15191f666c5965d212561d7a5c7b78b808dfa</id>
<content type='text'>
The worry here is that fragm_sz could be zero since it comes from
skb-&gt;data.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: add a bounds check in link_recv_changeover_msg()</title>
<updated>2013-05-06T20:16:52Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2013-05-06T08:28:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cb4b102f0ab29fcbaf945c6b1f85ef006cdb8edc'/>
<id>urn:sha1:cb4b102f0ab29fcbaf945c6b1f85ef006cdb8edc</id>
<content type='text'>
The bearer_id here comes from skb-&gt;data and it can be a number from 0 to
7.  The problem is that the -&gt;links[] array has only 2 elements so I
have added a range check.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: pskb_copy() buffers when sending on more than one bearer</title>
<updated>2013-05-03T20:08:58Z</updated>
<author>
<name>Gerlando Falauto</name>
<email>gerlando.falauto@keymile.com</email>
</author>
<published>2013-05-01T12:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=488fc9af8267d0cd9036bc9db9f5dbbfde6de208'/>
<id>urn:sha1:488fc9af8267d0cd9036bc9db9f5dbbfde6de208</id>
<content type='text'>
When sending packets, TIPC bearers use skb_clone() before writing their
hardware header. This will however NOT copy the data buffer.
So when the same packet is sent over multiple bearers (to reach multiple
nodes), the same socket buffer data will be treated by multiple
tipc_media drivers which will write their own hardware header through
dev_hard_header().
Most of the time this is not a problem, because by the time the
packet is processed by the second media, it has already been sent over
the first one. However, when the first transmission is delayed (e.g.
because of insufficient bandwidth or through a shaper), the next bearer
will overwrite the hardware header, resulting in the packet being sent:
a) with the wrong source address, when bearers of the same type,
e.g. ethernet, are involved
b) with a completely corrupt header, or even dropped, when bearers of
different types are involved.

So when the same socket buffer is to be sent multiple times, send a
pskb_copy() instead (from the second instance on), and release it
afterwards (the bearer will skb_clone() it anyway).

Signed-off-by: Gerlando Falauto &lt;gerlando.falauto@keymile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: tipc_bcbearer_send(): simplify bearer selection</title>
<updated>2013-05-03T20:08:58Z</updated>
<author>
<name>Gerlando Falauto</name>
<email>gerlando.falauto@keymile.com</email>
</author>
<published>2013-05-01T12:04:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=77861d9c00900c0105b9d66ecf9fa612a43f8df5'/>
<id>urn:sha1:77861d9c00900c0105b9d66ecf9fa612a43f8df5</id>
<content type='text'>
Signed-off-by: Gerlando Falauto &lt;gerlando.falauto@keymile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: cosmetic: clean up comments and break a long line</title>
<updated>2013-05-03T20:08:58Z</updated>
<author>
<name>Gerlando Falauto</name>
<email>gerlando.falauto@keymile.com</email>
</author>
<published>2013-05-01T12:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e616071094c214a274fb66d0b297f8b25a1a34d7'/>
<id>urn:sha1:e616071094c214a274fb66d0b297f8b25a1a34d7</id>
<content type='text'>
Signed-off-by: Gerlando Falauto &lt;gerlando.falauto@keymile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: add InfiniBand media type</title>
<updated>2013-04-17T18:18:33Z</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2013-04-17T06:18:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a29a194a15df9840b24c6c383a9a9a1236979db5'/>
<id>urn:sha1:a29a194a15df9840b24c6c383a9a9a1236979db5</id>
<content type='text'>
Add InfiniBand media type based on the ethernet media type.

The only real difference is that in case of InfiniBand, we need the entire
20 bytes of space reserved for media addresses, so the TIPC media type ID is
not explicitly stored in the packet payload.

Sample output of tipc-config:

# tipc-config -v -addr -netid -nt=all -p -m -b -n -ls

node address: &lt;10.1.4&gt;
current network id: 4711
Type       Lower      Upper      Port Identity              Publication Scope
0          167776257  167776257  &lt;10.1.1:1855512577&gt;        1855512578  cluster
           167776260  167776260  &lt;10.1.4:1216454657&gt;        1216454658  zone
1          1          1          &lt;10.1.4:1216479235&gt;        1216479236  node
Ports:
1216479235: bound to {1,1}
1216454657: bound to {0,167776260}
Media:
eth
ib
Bearers:
ib:ib0
Nodes known:
&lt;10.1.1&gt;: up
Link &lt;broadcast-link&gt;
  Window:20 packets
  RX packets:0 fragments:0/0 bundles:0/0
  TX packets:0 fragments:0/0 bundles:0/0
  RX naks:0 defs:0 dups:0
  TX naks:0 acks:0 dups:0
  Congestion bearer:0 link:0  Send queue max:0 avg:0

Link &lt;10.1.4:ib0-10.1.1:ib0&gt;
  ACTIVE  MTU:2044  Priority:10  Tolerance:1500 ms  Window:50 packets
  RX packets:80 fragments:0/0 bundles:0/0
  TX packets:40 fragments:0/0 bundles:0/0
  TX profile sample:22 packets  average:54 octets
  0-64:100% -256:0% -1024:0% -4096:0% -16384:0% -32768:0% -66000:0%
  RX states:410 probes:213 naks:0 defs:0 dups:0
  TX states:410 probes:197 naks:0 acks:0 dups:0
  Congestion bearer:0 link:0  Send queue max:1 avg:0

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tipc: set skb-&gt;protocol in eth_media packet transmission</title>
<updated>2013-04-17T18:18:33Z</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2013-04-17T06:18:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=76f5c6f359a18abd3359ad8523cb23fbf58602b7'/>
<id>urn:sha1:76f5c6f359a18abd3359ad8523cb23fbf58602b7</id>
<content type='text'>
The skb-&gt;protocol field is used by packet classifiers and for AF_PACKET
cooked format, TIPC needs to set it properly.

Fixes packet classification and ethertype of 0x0000 in cooked captures:

Out 20:c9:d0:43:12:d9 ethertype Unknown (0x0000), length 56:
	0x0000:  5b50 0028 0000 30d4 0100 1000 0100 1001  [P.(..0.........
	0x0010:  0000 03e8 0000 0001 20c9 d043 12d9 0000  ...........C....
	0x0020:  0000 0000 0000 0000                      ........

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
