<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/ipv4, branch v4.5</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.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-03-07T20:47:13Z</updated>
<entry>
<title>tcp: fix tcpi_segs_in after connection establishment</title>
<updated>2016-03-07T20:47:13Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2016-03-06T17:29:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a9d99ce28ed359d68cf6f3c1a69038aefedf6d6a'/>
<id>urn:sha1:a9d99ce28ed359d68cf6f3c1a69038aefedf6d6a</id>
<content type='text'>
If final packet (ACK) of 3WHS is lost, it appears we do not properly
account the following incoming segment into tcpi_segs_in

While we are at it, starts segs_in with one, to count the SYN packet.

We do not yet count number of SYN we received for a request sock, we
might add this someday.

packetdrill script showing proper behavior after fix :

// Tests tcpi_segs_in when 3rd packet (ACK) of 3WHS is lost
0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
   +0 bind(3, ..., ...) = 0
   +0 listen(3, 1) = 0

   +0 &lt; S 0:0(0) win 32792 &lt;mss 1000,sackOK,nop,nop&gt;
   +0 &gt; S. 0:0(0) ack 1 &lt;mss 1460,nop,nop,sackOK&gt;
+.020 &lt; P. 1:1001(1000) ack 1 win 32792

   +0 accept(3, ..., ...) = 4

+.000 %{ assert tcpi_segs_in == 2, 'tcpi_segs_in=%d' % tcpi_segs_in }%

Fixes: 2efd055c53c06 ("tcp: add tcpi_segs_in and tcpi_segs_out to tcp_info")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mld, igmp: Fix reserved tailroom calculation</title>
<updated>2016-03-03T20:41:07Z</updated>
<author>
<name>Benjamin Poirier</name>
<email>bpoirier@suse.com</email>
</author>
<published>2016-02-29T23:03:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1837b2e2bcd23137766555a63867e649c0b637f0'/>
<id>urn:sha1:1837b2e2bcd23137766555a63867e649c0b637f0</id>
<content type='text'>
The current reserved_tailroom calculation fails to take hlen and tlen into
account.

skb:
[__hlen__|__data____________|__tlen___|__extra__]
^                                               ^
head                                            skb_end_offset

In this representation, hlen + data + tlen is the size passed to alloc_skb.
"extra" is the extra space made available in __alloc_skb because of
rounding up by kmalloc. We can reorder the representation like so:

[__hlen__|__data____________|__extra__|__tlen___]
^                                               ^
head                                            skb_end_offset

The maximum space available for ip headers and payload without
fragmentation is min(mtu, data + extra). Therefore,
reserved_tailroom
= data + extra + tlen - min(mtu, data + extra)
= skb_end_offset - hlen - min(mtu, skb_end_offset - hlen - tlen)
= skb_tailroom - min(mtu, skb_tailroom - tlen) ; after skb_reserve(hlen)

Compare the second line to the current expression:
reserved_tailroom = skb_end_offset - min(mtu, skb_end_offset)
and we can see that hlen and tlen are not taken into account.

The min() in the third line can be expanded into:
if mtu &lt; skb_tailroom - tlen:
	reserved_tailroom = skb_tailroom - mtu
else:
	reserved_tailroom = tlen

Depending on hlen, tlen, mtu and the number of multicast address records,
the current code may output skbs that have less tailroom than
dev-&gt;needed_tailroom or it may output more skbs than needed because not all
space available is used.

Fixes: 4c672e4b ("ipv6: mld: fix add_grhead skb_over_panic for devs with large MTUs")
Signed-off-by: Benjamin Poirier &lt;bpoirier@suse.com&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4: only create late gso-skb if skb is already set up with CHECKSUM_PARTIAL</title>
<updated>2016-02-24T19:11:34Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2016-02-22T17:43:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a8c4a2522a0808c5c2143612909717d1115c40cf'/>
<id>urn:sha1:a8c4a2522a0808c5c2143612909717d1115c40cf</id>
<content type='text'>
Otherwise we break the contract with GSO to only pass CHECKSUM_PARTIAL
skbs down. This can easily happen with UDP+IPv4 sockets with the first
MSG_MORE write smaller than the MTU, second write is a sendfile.

Returning -EOPNOTSUPP lets the callers fall back into normal sendmsg path,
were we calculate the checksum manually during copying.

Commit d749c9cbffd6 ("ipv4: no CHECKSUM_PARTIAL on MSG_MORE corked
sockets") started to exposes this bug.

Fixes: d749c9cbffd6 ("ipv4: no CHECKSUM_PARTIAL on MSG_MORE corked sockets")
Reported-by: Jiri Benc &lt;jbenc@redhat.com&gt;
Cc: Jiri Benc &lt;jbenc@redhat.com&gt;
Reported-by: Wakko Warner &lt;wakko@animx.eu.org&gt;
Cc: Wakko Warner &lt;wakko@animx.eu.org&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tunnel: Clear IPCB(skb)-&gt;opt before dst_link_failure called</title>
<updated>2016-02-24T00:11:56Z</updated>
<author>
<name>Bernie Harris</name>
<email>bernie.harris@alliedtelesis.co.nz</email>
</author>
<published>2016-02-21T23:58:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5146d1f151122e868e594c7b45115d64825aee5f'/>
<id>urn:sha1:5146d1f151122e868e594c7b45115d64825aee5f</id>
<content type='text'>
IPCB may contain data from previous layers (in the observed case the
qdisc layer). In the observed scenario, the data was misinterpreted as
ip header options, which later caused the ihl to be set to an invalid
value (&lt;5). This resulted in an infinite loop in the mips implementation
of ip_fast_csum.

This patch clears IPCB(skb)-&gt;opt before dst_link_failure can be called for
various types of tunnels. This change only applies to encapsulated ipv4
packets.

The code introduced in 11c21a30 which clears all of IPCB has been removed
to be consistent with these changes, and instead the opt field is cleared
unconditionally in ip_tunnel_xmit. The change in ip_tunnel_xmit applies to
SIT, GRE, and IPIP tunnels.

The relevant vti, l2tp, and pptp functions already contain similar code for
clearing the IPCB.

Signed-off-by: Bernie Harris &lt;bernie.harris@alliedtelesis.co.nz&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: convert cached rtt from usec to jiffies when feeding initial rto</title>
<updated>2016-02-23T23:28:46Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@yandex-team.ru</email>
</author>
<published>2016-02-21T07:12:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9bdfb3b79e61c60e1a3e2dc05ad164528afa6b8a'/>
<id>urn:sha1:9bdfb3b79e61c60e1a3e2dc05ad164528afa6b8a</id>
<content type='text'>
Currently it's converted into msecs, thus HZ=1000 intact.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Fixes: 740b0f1841f6 ("tcp: switch rtt estimations to usec resolution")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>rtnl: RTM_GETNETCONF: fix wrong return value</title>
<updated>2016-02-19T20:33:46Z</updated>
<author>
<name>Anton Protopopov</name>
<email>a.s.protopopov@gmail.com</email>
</author>
<published>2016-02-17T02:43:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a97eb33ff225f34a8124774b3373fd244f0e83ce'/>
<id>urn:sha1:a97eb33ff225f34a8124774b3373fd244f0e83ce</id>
<content type='text'>
An error response from a RTM_GETNETCONF request can return the positive
error value EINVAL in the struct nlmsgerr that can mislead userspace.

Signed-off-by: Anton Protopopov &lt;a.s.protopopov@gmail.com&gt;
Acked-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>gre: clear IFF_TX_SKB_SHARING</title>
<updated>2016-02-18T19:43:48Z</updated>
<author>
<name>Jiri Benc</name>
<email>jbenc@redhat.com</email>
</author>
<published>2016-02-17T14:32:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d13b161c2c7c67401bb222c30302339285ac148e'/>
<id>urn:sha1:d13b161c2c7c67401bb222c30302339285ac148e</id>
<content type='text'>
ether_setup sets IFF_TX_SKB_SHARING but this is not supported by gre
as it modifies the skb on xmit.

Also, clean up whitespace in ipgre_tap_setup when we're already touching it.

Signed-off-by: Jiri Benc &lt;jbenc@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp/dccp: fix another race at listener dismantle</title>
<updated>2016-02-18T16:35:51Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2016-02-18T13:39:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7716682cc58e305e22207d5bb315f26af6b1e243'/>
<id>urn:sha1:7716682cc58e305e22207d5bb315f26af6b1e243</id>
<content type='text'>
Ilya reported following lockdep splat:

kernel: =========================
kernel: [ BUG: held lock freed! ]
kernel: 4.5.0-rc1-ceph-00026-g5e0a311 #1 Not tainted
kernel: -------------------------
kernel: swapper/5/0 is freeing memory
ffff880035c9d200-ffff880035c9dbff, with a lock still held there!
kernel: (&amp;(&amp;queue-&gt;rskq_lock)-&gt;rlock){+.-...}, at:
[&lt;ffffffff816f6a88&gt;] inet_csk_reqsk_queue_add+0x28/0xa0
kernel: 4 locks held by swapper/5/0:
kernel: #0:  (rcu_read_lock){......}, at: [&lt;ffffffff8169ef6b&gt;]
netif_receive_skb_internal+0x4b/0x1f0
kernel: #1:  (rcu_read_lock){......}, at: [&lt;ffffffff816e977f&gt;]
ip_local_deliver_finish+0x3f/0x380
kernel: #2:  (slock-AF_INET){+.-...}, at: [&lt;ffffffff81685ffb&gt;]
sk_clone_lock+0x19b/0x440
kernel: #3:  (&amp;(&amp;queue-&gt;rskq_lock)-&gt;rlock){+.-...}, at:
[&lt;ffffffff816f6a88&gt;] inet_csk_reqsk_queue_add+0x28/0xa0

To properly fix this issue, inet_csk_reqsk_queue_add() needs
to return to its callers if the child as been queued
into accept queue.

We also need to make sure listener is still there before
calling sk-&gt;sk_data_ready(), by holding a reference on it,
since the reference carried by the child can disappear as
soon as the child is put on accept queue.

Reported-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Fixes: ebb516af60e1 ("tcp/dccp: fix race at listener dismantle phase")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>route: check and remove route cache when we get route</title>
<updated>2016-02-18T16:31:36Z</updated>
<author>
<name>Xin Long</name>
<email>lucien.xin@gmail.com</email>
</author>
<published>2016-02-18T13:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=deed49df7390d5239024199e249190328f1651e7'/>
<id>urn:sha1:deed49df7390d5239024199e249190328f1651e7</id>
<content type='text'>
Since the gc of ipv4 route was removed, the route cached would has
no chance to be removed, and even it has been timeout, it still could
be used, cause no code to check it's expires.

Fix this issue by checking  and removing route cache when we get route.

Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: correctly crypto_alloc_hash return check</title>
<updated>2016-02-18T03:23:04Z</updated>
<author>
<name>Insu Yun</name>
<email>wuninsu@gmail.com</email>
</author>
<published>2016-02-16T02:30:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1eea84b74cd28773c37bf1bda69915f7b9a67efc'/>
<id>urn:sha1:1eea84b74cd28773c37bf1bda69915f7b9a67efc</id>
<content type='text'>
crypto_alloc_hash never returns NULL

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