<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/net/ipv4, branch v3.13-rc7</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>ipv4: consistent reporting of pmtu data in case of corking</title>
<updated>2013-12-22T23:52:09+00:00</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2013-12-19T01:13:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=61e7f09d0f437c9614029445754099383ec2eec4'/>
<id>61e7f09d0f437c9614029445754099383ec2eec4</id>
<content type='text'>
We report different pmtu values back on the first write and on further
writes on an corked socket.

Also don't include the dst.header_len (respectively exthdrlen) as this
should already be dealt with by the interface mtu of the outgoing
(virtual) interface and policy of that interface should dictate if
fragmentation should happen.

Instead reduce the pmtu data by IP options as we do for IPv6. Make the
same changes for ip_append_data, where we did not care about options or
dst.header_len at all.

Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We report different pmtu values back on the first write and on further
writes on an corked socket.

Also don't include the dst.header_len (respectively exthdrlen) as this
should already be dealt with by the interface mtu of the outgoing
(virtual) interface and policy of that interface should dictate if
fragmentation should happen.

Instead reduce the pmtu data by IP options as we do for IPv6. Make the
same changes for ip_append_data, where we did not care about options or
dst.header_len at all.

Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: inet_diag: zero out uninitialized idiag_{src,dst} fields</title>
<updated>2013-12-19T19:55:52+00:00</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2013-12-16T23:38:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b1aac815c0891fe4a55a6b0b715910142227700f'/>
<id>b1aac815c0891fe4a55a6b0b715910142227700f</id>
<content type='text'>
Jakub reported while working with nlmon netlink sniffer that parts of
the inet_diag_sockid are not initialized when r-&gt;idiag_family != AF_INET6.
That is, fields of r-&gt;id.idiag_src[1 ... 3], r-&gt;id.idiag_dst[1 ... 3].

In fact, it seems that we can leak 6 * sizeof(u32) byte of kernel [slab]
memory through this. At least, in udp_dump_one(), we allocate a skb in ...

  rep = nlmsg_new(sizeof(struct inet_diag_msg) + ..., GFP_KERNEL);

... and then pass that to inet_sk_diag_fill() that puts the whole struct
inet_diag_msg into the skb, where we only fill out r-&gt;id.idiag_src[0],
r-&gt;id.idiag_dst[0] and leave the rest untouched:

  r-&gt;id.idiag_src[0] = inet-&gt;inet_rcv_saddr;
  r-&gt;id.idiag_dst[0] = inet-&gt;inet_daddr;

struct inet_diag_msg embeds struct inet_diag_sockid that is correctly /
fully filled out in IPv6 case, but for IPv4 not.

So just zero them out by using plain memset (for this little amount of
bytes it's probably not worth the extra check for idiag_family == AF_INET).

Similarly, fix also other places where we fill that out.

Reported-by: Jakub Zawadzki &lt;darkjames-ws@darkjames.pl&gt;
Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Jakub reported while working with nlmon netlink sniffer that parts of
the inet_diag_sockid are not initialized when r-&gt;idiag_family != AF_INET6.
That is, fields of r-&gt;id.idiag_src[1 ... 3], r-&gt;id.idiag_dst[1 ... 3].

In fact, it seems that we can leak 6 * sizeof(u32) byte of kernel [slab]
memory through this. At least, in udp_dump_one(), we allocate a skb in ...

  rep = nlmsg_new(sizeof(struct inet_diag_msg) + ..., GFP_KERNEL);

... and then pass that to inet_sk_diag_fill() that puts the whole struct
inet_diag_msg into the skb, where we only fill out r-&gt;id.idiag_src[0],
r-&gt;id.idiag_dst[0] and leave the rest untouched:

  r-&gt;id.idiag_src[0] = inet-&gt;inet_rcv_saddr;
  r-&gt;id.idiag_dst[0] = inet-&gt;inet_daddr;

struct inet_diag_msg embeds struct inet_diag_sockid that is correctly /
fully filled out in IPv6 case, but for IPv4 not.

So just zero them out by using plain memset (for this little amount of
bytes it's probably not worth the extra check for idiag_family == AF_INET).

Similarly, fix also other places where we fill that out.

Reported-by: Jakub Zawadzki &lt;darkjames-ws@darkjames.pl&gt;
Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ip_gre: fix msg_name parsing for recvfrom/recvmsg</title>
<updated>2013-12-18T22:44:33+00:00</updated>
<author>
<name>Timo Teräs</name>
<email>timo.teras@iki.fi</email>
</author>
<published>2013-12-16T09:02:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0e3da5bb8da45890b1dc413404e0f978ab71173e'/>
<id>0e3da5bb8da45890b1dc413404e0f978ab71173e</id>
<content type='text'>
ipgre_header_parse() needs to parse the tunnel's ip header and it
uses mac_header to locate the iphdr. This got broken when gre tunneling
was refactored as mac_header is no longer updated to point to iphdr.
Introduce skb_pop_mac_header() helper to do the mac_header assignment
and use it in ipgre_rcv() to fix msg_name parsing.

Bug introduced in commit c54419321455 (GRE: Refactor GRE tunneling code.)

Cc: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: Timo Teräs &lt;timo.teras@iki.fi&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ipgre_header_parse() needs to parse the tunnel's ip header and it
uses mac_header to locate the iphdr. This got broken when gre tunneling
was refactored as mac_header is no longer updated to point to iphdr.
Introduce skb_pop_mac_header() helper to do the mac_header assignment
and use it in ipgre_rcv() to fix msg_name parsing.

Bug introduced in commit c54419321455 (GRE: Refactor GRE tunneling code.)

Cc: Pravin B Shelar &lt;pshelar@nicira.com&gt;
Signed-off-by: Timo Teräs &lt;timo.teras@iki.fi&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf</title>
<updated>2013-12-17T20:06:20+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2013-12-17T20:06:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7089fdd81493986a39c8fa5563066c8e7e8e7cad'/>
<id>7089fdd81493986a39c8fa5563066c8e7e8e7cad</id>
<content type='text'>
Pablo Neira Ayuso says:

====================
The following patchset contains two Netfilter fixes for your net
tree, they are:

* Fix endianness in nft_reject, the NFTA_REJECT_TYPE netlink attributes
  was not converted to network byte order as needed by all nfnetlink
  subsystems, from Eric Leblond.

* Restrict SYNPROXY target to INPUT and FORWARD chains, this avoid a
  possible crash due to misconfigurations, from Patrick McHardy.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pablo Neira Ayuso says:

====================
The following patchset contains two Netfilter fixes for your net
tree, they are:

* Fix endianness in nft_reject, the NFTA_REJECT_TYPE netlink attributes
  was not converted to network byte order as needed by all nfnetlink
  subsystems, from Eric Leblond.

* Restrict SYNPROXY target to INPUT and FORWARD chains, this avoid a
  possible crash due to misconfigurations, from Patrick McHardy.
====================

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>udp: ipv4: do not use sk_dst_lock from softirq context</title>
<updated>2013-12-17T19:50:58+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-12-15T18:53:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e47eb5dfb296bf217e9ebee7b2f07486670b9c1b'/>
<id>e47eb5dfb296bf217e9ebee7b2f07486670b9c1b</id>
<content type='text'>
Using sk_dst_lock from softirq context is not supported right now.

Instead of adding BH protection everywhere,
udp_sk_rx_dst_set() can instead use xchg(), as suggested
by David.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Fixes: 975022310233 ("udp: ipv4: must add synchronization in udp_sk_rx_dst_set()")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using sk_dst_lock from softirq context is not supported right now.

Instead of adding BH protection everywhere,
udp_sk_rx_dst_set() can instead use xchg(), as suggested
by David.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Fixes: 975022310233 ("udp: ipv4: must add synchronization in udp_sk_rx_dst_set()")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: nft_reject: fix endianness in dump function</title>
<updated>2013-12-12T08:37:39+00:00</updated>
<author>
<name>Eric Leblond</name>
<email>eric@regit.org</email>
</author>
<published>2013-12-12T07:51:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a3adadf3018102c24754e0b53a5515c40fbaff4a'/>
<id>a3adadf3018102c24754e0b53a5515c40fbaff4a</id>
<content type='text'>
The dump function in nft_reject_ipv4 was not converting a u32
field to network order before sending it to userspace, this
needs to happen for consistency with other nf_tables and
nfnetlink subsystems.

Signed-off-by: Eric Leblond &lt;eric@regit.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The dump function in nft_reject_ipv4 was not converting a u32
field to network order before sending it to userspace, this
needs to happen for consistency with other nf_tables and
nfnetlink subsystems.

Signed-off-by: Eric Leblond &lt;eric@regit.org&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>udp: ipv4: must add synchronization in udp_sk_rx_dst_set()</title>
<updated>2013-12-12T01:21:10+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-12-11T22:46:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=975022310233fb0f0193873d79a7b8438070fa82'/>
<id>975022310233fb0f0193873d79a7b8438070fa82</id>
<content type='text'>
Unlike TCP, UDP input path does not hold the socket lock.

Before messing with sk-&gt;sk_rx_dst, we must use a spinlock, otherwise
multiple cpus could leak a refcount.

This patch also takes care of renewing a stale dst entry.
(When the sk-&gt;sk_rx_dst would not be used by IP early demux)

Fixes: 421b3885bf6d ("udp: ipv4: Add udp early demux")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unlike TCP, UDP input path does not hold the socket lock.

Before messing with sk-&gt;sk_rx_dst, we must use a spinlock, otherwise
multiple cpus could leak a refcount.

This patch also takes care of renewing a stale dst entry.
(When the sk-&gt;sk_rx_dst would not be used by IP early demux)

Fixes: 421b3885bf6d ("udp: ipv4: Add udp early demux")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>udp: ipv4: fix potential use after free in udp_v4_early_demux()</title>
<updated>2013-12-11T21:10:14+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-12-11T16:10:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=610438b74496b2986a9025f8e23c134cb638e338'/>
<id>610438b74496b2986a9025f8e23c134cb638e338</id>
<content type='text'>
pskb_may_pull() can reallocate skb-&gt;head, we need to move the
initialization of iph and uh pointers after its call.

Fixes: 421b3885bf6d ("udp: ipv4: Add udp early demux")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pskb_may_pull() can reallocate skb-&gt;head, we need to move the
initialization of iph and uh pointers after its call.

Fixes: 421b3885bf6d ("udp: ipv4: Add udp early demux")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: SYNPROXY target: restrict to INPUT/FORWARD</title>
<updated>2013-12-11T10:30:25+00:00</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2013-12-08T16:52:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f01b3926ee645974f549f4a6921268142047717c'/>
<id>f01b3926ee645974f549f4a6921268142047717c</id>
<content type='text'>
Fix a crash in synproxy_send_tcp() when using the SYNPROXY target in the
PREROUTING chain caused by missing routing information.

Reported-by: Nicki P. &lt;xastx@gmx.de&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a crash in synproxy_send_tcp() when using the SYNPROXY target in the
PREROUTING chain caused by missing routing information.

Reported-by: Nicki P. &lt;xastx@gmx.de&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>udp: ipv4: fix an use after free in __udp4_lib_rcv()</title>
<updated>2013-12-11T03:58:40+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-12-11T02:07:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8afdd99a1315e759de04ad6e2344f0c5f17ecb1b'/>
<id>8afdd99a1315e759de04ad6e2344f0c5f17ecb1b</id>
<content type='text'>
Dave Jones reported a use after free in UDP stack :

[ 5059.434216] =========================
[ 5059.434314] [ BUG: held lock freed! ]
[ 5059.434420] 3.13.0-rc3+ #9 Not tainted
[ 5059.434520] -------------------------
[ 5059.434620] named/863 is freeing memory ffff88005e960000-ffff88005e96061f, with a lock still held there!
[ 5059.434815]  (slock-AF_INET){+.-...}, at: [&lt;ffffffff8149bd21&gt;] udp_queue_rcv_skb+0xd1/0x4b0
[ 5059.435012] 3 locks held by named/863:
[ 5059.435086]  #0:  (rcu_read_lock){.+.+..}, at: [&lt;ffffffff8143054d&gt;] __netif_receive_skb_core+0x11d/0x940
[ 5059.435295]  #1:  (rcu_read_lock){.+.+..}, at: [&lt;ffffffff81467a5e&gt;] ip_local_deliver_finish+0x3e/0x410
[ 5059.435500]  #2:  (slock-AF_INET){+.-...}, at: [&lt;ffffffff8149bd21&gt;] udp_queue_rcv_skb+0xd1/0x4b0
[ 5059.435734]
stack backtrace:
[ 5059.435858] CPU: 0 PID: 863 Comm: named Not tainted 3.13.0-rc3+ #9 [loadavg: 0.21 0.06 0.06 1/115 1365]
[ 5059.436052] Hardware name:                  /D510MO, BIOS MOPNV10J.86A.0175.2010.0308.0620 03/08/2010
[ 5059.436223]  0000000000000002 ffff88007e203ad8 ffffffff8153a372 ffff8800677130e0
[ 5059.436390]  ffff88007e203b10 ffffffff8108cafa ffff88005e960000 ffff88007b00cfc0
[ 5059.436554]  ffffea00017a5800 ffffffff8141c490 0000000000000246 ffff88007e203b48
[ 5059.436718] Call Trace:
[ 5059.436769]  &lt;IRQ&gt;  [&lt;ffffffff8153a372&gt;] dump_stack+0x4d/0x66
[ 5059.436904]  [&lt;ffffffff8108cafa&gt;] debug_check_no_locks_freed+0x15a/0x160
[ 5059.437037]  [&lt;ffffffff8141c490&gt;] ? __sk_free+0x110/0x230
[ 5059.437147]  [&lt;ffffffff8112da2a&gt;] kmem_cache_free+0x6a/0x150
[ 5059.437260]  [&lt;ffffffff8141c490&gt;] __sk_free+0x110/0x230
[ 5059.437364]  [&lt;ffffffff8141c5c9&gt;] sk_free+0x19/0x20
[ 5059.437463]  [&lt;ffffffff8141cb25&gt;] sock_edemux+0x25/0x40
[ 5059.437567]  [&lt;ffffffff8141c181&gt;] sock_queue_rcv_skb+0x81/0x280
[ 5059.437685]  [&lt;ffffffff8149bd21&gt;] ? udp_queue_rcv_skb+0xd1/0x4b0
[ 5059.437805]  [&lt;ffffffff81499c82&gt;] __udp_queue_rcv_skb+0x42/0x240
[ 5059.437925]  [&lt;ffffffff81541d25&gt;] ? _raw_spin_lock+0x65/0x70
[ 5059.438038]  [&lt;ffffffff8149bebb&gt;] udp_queue_rcv_skb+0x26b/0x4b0
[ 5059.438155]  [&lt;ffffffff8149c712&gt;] __udp4_lib_rcv+0x152/0xb00
[ 5059.438269]  [&lt;ffffffff8149d7f5&gt;] udp_rcv+0x15/0x20
[ 5059.438367]  [&lt;ffffffff81467b2f&gt;] ip_local_deliver_finish+0x10f/0x410
[ 5059.438492]  [&lt;ffffffff81467a5e&gt;] ? ip_local_deliver_finish+0x3e/0x410
[ 5059.438621]  [&lt;ffffffff81468653&gt;] ip_local_deliver+0x43/0x80
[ 5059.438733]  [&lt;ffffffff81467f70&gt;] ip_rcv_finish+0x140/0x5a0
[ 5059.438843]  [&lt;ffffffff81468926&gt;] ip_rcv+0x296/0x3f0
[ 5059.438945]  [&lt;ffffffff81430b72&gt;] __netif_receive_skb_core+0x742/0x940
[ 5059.439074]  [&lt;ffffffff8143054d&gt;] ? __netif_receive_skb_core+0x11d/0x940
[ 5059.442231]  [&lt;ffffffff8108c81d&gt;] ? trace_hardirqs_on+0xd/0x10
[ 5059.442231]  [&lt;ffffffff81430d83&gt;] __netif_receive_skb+0x13/0x60
[ 5059.442231]  [&lt;ffffffff81431c1e&gt;] netif_receive_skb+0x1e/0x1f0
[ 5059.442231]  [&lt;ffffffff814334e0&gt;] napi_gro_receive+0x70/0xa0
[ 5059.442231]  [&lt;ffffffffa01de426&gt;] rtl8169_poll+0x166/0x700 [r8169]
[ 5059.442231]  [&lt;ffffffff81432bc9&gt;] net_rx_action+0x129/0x1e0
[ 5059.442231]  [&lt;ffffffff810478cd&gt;] __do_softirq+0xed/0x240
[ 5059.442231]  [&lt;ffffffff81047e25&gt;] irq_exit+0x125/0x140
[ 5059.442231]  [&lt;ffffffff81004241&gt;] do_IRQ+0x51/0xc0
[ 5059.442231]  [&lt;ffffffff81542bef&gt;] common_interrupt+0x6f/0x6f

We need to keep a reference on the socket, by using skb_steal_sock()
at the right place.

Note that another patch is needed to fix a race in
udp_sk_rx_dst_set(), as we hold no lock protecting the dst.

Fixes: 421b3885bf6d ("udp: ipv4: Add udp early demux")
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dave Jones reported a use after free in UDP stack :

[ 5059.434216] =========================
[ 5059.434314] [ BUG: held lock freed! ]
[ 5059.434420] 3.13.0-rc3+ #9 Not tainted
[ 5059.434520] -------------------------
[ 5059.434620] named/863 is freeing memory ffff88005e960000-ffff88005e96061f, with a lock still held there!
[ 5059.434815]  (slock-AF_INET){+.-...}, at: [&lt;ffffffff8149bd21&gt;] udp_queue_rcv_skb+0xd1/0x4b0
[ 5059.435012] 3 locks held by named/863:
[ 5059.435086]  #0:  (rcu_read_lock){.+.+..}, at: [&lt;ffffffff8143054d&gt;] __netif_receive_skb_core+0x11d/0x940
[ 5059.435295]  #1:  (rcu_read_lock){.+.+..}, at: [&lt;ffffffff81467a5e&gt;] ip_local_deliver_finish+0x3e/0x410
[ 5059.435500]  #2:  (slock-AF_INET){+.-...}, at: [&lt;ffffffff8149bd21&gt;] udp_queue_rcv_skb+0xd1/0x4b0
[ 5059.435734]
stack backtrace:
[ 5059.435858] CPU: 0 PID: 863 Comm: named Not tainted 3.13.0-rc3+ #9 [loadavg: 0.21 0.06 0.06 1/115 1365]
[ 5059.436052] Hardware name:                  /D510MO, BIOS MOPNV10J.86A.0175.2010.0308.0620 03/08/2010
[ 5059.436223]  0000000000000002 ffff88007e203ad8 ffffffff8153a372 ffff8800677130e0
[ 5059.436390]  ffff88007e203b10 ffffffff8108cafa ffff88005e960000 ffff88007b00cfc0
[ 5059.436554]  ffffea00017a5800 ffffffff8141c490 0000000000000246 ffff88007e203b48
[ 5059.436718] Call Trace:
[ 5059.436769]  &lt;IRQ&gt;  [&lt;ffffffff8153a372&gt;] dump_stack+0x4d/0x66
[ 5059.436904]  [&lt;ffffffff8108cafa&gt;] debug_check_no_locks_freed+0x15a/0x160
[ 5059.437037]  [&lt;ffffffff8141c490&gt;] ? __sk_free+0x110/0x230
[ 5059.437147]  [&lt;ffffffff8112da2a&gt;] kmem_cache_free+0x6a/0x150
[ 5059.437260]  [&lt;ffffffff8141c490&gt;] __sk_free+0x110/0x230
[ 5059.437364]  [&lt;ffffffff8141c5c9&gt;] sk_free+0x19/0x20
[ 5059.437463]  [&lt;ffffffff8141cb25&gt;] sock_edemux+0x25/0x40
[ 5059.437567]  [&lt;ffffffff8141c181&gt;] sock_queue_rcv_skb+0x81/0x280
[ 5059.437685]  [&lt;ffffffff8149bd21&gt;] ? udp_queue_rcv_skb+0xd1/0x4b0
[ 5059.437805]  [&lt;ffffffff81499c82&gt;] __udp_queue_rcv_skb+0x42/0x240
[ 5059.437925]  [&lt;ffffffff81541d25&gt;] ? _raw_spin_lock+0x65/0x70
[ 5059.438038]  [&lt;ffffffff8149bebb&gt;] udp_queue_rcv_skb+0x26b/0x4b0
[ 5059.438155]  [&lt;ffffffff8149c712&gt;] __udp4_lib_rcv+0x152/0xb00
[ 5059.438269]  [&lt;ffffffff8149d7f5&gt;] udp_rcv+0x15/0x20
[ 5059.438367]  [&lt;ffffffff81467b2f&gt;] ip_local_deliver_finish+0x10f/0x410
[ 5059.438492]  [&lt;ffffffff81467a5e&gt;] ? ip_local_deliver_finish+0x3e/0x410
[ 5059.438621]  [&lt;ffffffff81468653&gt;] ip_local_deliver+0x43/0x80
[ 5059.438733]  [&lt;ffffffff81467f70&gt;] ip_rcv_finish+0x140/0x5a0
[ 5059.438843]  [&lt;ffffffff81468926&gt;] ip_rcv+0x296/0x3f0
[ 5059.438945]  [&lt;ffffffff81430b72&gt;] __netif_receive_skb_core+0x742/0x940
[ 5059.439074]  [&lt;ffffffff8143054d&gt;] ? __netif_receive_skb_core+0x11d/0x940
[ 5059.442231]  [&lt;ffffffff8108c81d&gt;] ? trace_hardirqs_on+0xd/0x10
[ 5059.442231]  [&lt;ffffffff81430d83&gt;] __netif_receive_skb+0x13/0x60
[ 5059.442231]  [&lt;ffffffff81431c1e&gt;] netif_receive_skb+0x1e/0x1f0
[ 5059.442231]  [&lt;ffffffff814334e0&gt;] napi_gro_receive+0x70/0xa0
[ 5059.442231]  [&lt;ffffffffa01de426&gt;] rtl8169_poll+0x166/0x700 [r8169]
[ 5059.442231]  [&lt;ffffffff81432bc9&gt;] net_rx_action+0x129/0x1e0
[ 5059.442231]  [&lt;ffffffff810478cd&gt;] __do_softirq+0xed/0x240
[ 5059.442231]  [&lt;ffffffff81047e25&gt;] irq_exit+0x125/0x140
[ 5059.442231]  [&lt;ffffffff81004241&gt;] do_IRQ+0x51/0xc0
[ 5059.442231]  [&lt;ffffffff81542bef&gt;] common_interrupt+0x6f/0x6f

We need to keep a reference on the socket, by using skb_steal_sock()
at the right place.

Note that another patch is needed to fix a race in
udp_sk_rx_dst_set(), as we hold no lock protecting the dst.

Fixes: 421b3885bf6d ("udp: ipv4: Add udp early demux")
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Shawn Bohrer &lt;sbohrer@rgmadvisors.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
