<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include, branch v3.0.89</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.89</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.89'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-08-04T07:43:40Z</updated>
<entry>
<title>virtio: support unlocked queue poll</title>
<updated>2013-08-04T07:43:40Z</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2013-08-04T07:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8ff3d73133cb5a8a3514cc184152c553637e74a8'/>
<id>urn:sha1:8ff3d73133cb5a8a3514cc184152c553637e74a8</id>
<content type='text'>
commit cc229884d3f77ec3b1240e467e0236c3e0647c0c upstream.

This adds a way to check ring empty state after enable_cb outside any
locks. Will be used by virtio_net.

Note: there's room for more optimization: caller is likely to have a
memory barrier already, which means we might be able to get rid of a
barrier here.  Deferring this optimization until we do some
benchmarking.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
[wg: Backported to 3.2]
Signed-off-by: Wolfram Gloger &lt;wmglo@dent.med.uni-muenchen.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipv6: call udp_push_pending_frames when uncorking a socket with AF_INET pending data</title>
<updated>2013-07-28T23:18:39Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2013-07-01T18:21:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=639e5920a9ae14b1eefc44a8740f5d0f816adb9a'/>
<id>urn:sha1:639e5920a9ae14b1eefc44a8740f5d0f816adb9a</id>
<content type='text'>
[ Upstream commit 8822b64a0fa64a5dd1dfcf837c5b0be83f8c05d1 ]

We accidentally call down to ip6_push_pending_frames when uncorking
pending AF_INET data on a ipv6 socket. This results in the following
splat (from Dave Jones):

skbuff: skb_under_panic: text:ffffffff816765f6 len:48 put:40 head:ffff88013deb6df0 data:ffff88013deb6dec tail:0x2c end:0xc0 dev:&lt;NULL&gt;
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:126!
invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
Modules linked in: dccp_ipv4 dccp 8021q garp bridge stp dlci mpoa snd_seq_dummy sctp fuse hidp tun bnep nfnetlink scsi_transport_iscsi rfcomm can_raw can_bcm af_802154 appletalk caif_socket can caif ipt_ULOG x25 rose af_key pppoe pppox ipx phonet irda llc2 ppp_generic slhc p8023 psnap p8022 llc crc_ccitt atm bluetooth
+netrom ax25 nfc rfkill rds af_rxrpc coretemp hwmon kvm_intel kvm crc32c_intel snd_hda_codec_realtek ghash_clmulni_intel microcode pcspkr snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep usb_debug snd_seq snd_seq_device snd_pcm e1000e snd_page_alloc snd_timer ptp snd pps_core soundcore xfs libcrc32c
CPU: 2 PID: 8095 Comm: trinity-child2 Not tainted 3.10.0-rc7+ #37
task: ffff8801f52c2520 ti: ffff8801e6430000 task.ti: ffff8801e6430000
RIP: 0010:[&lt;ffffffff816e759c&gt;]  [&lt;ffffffff816e759c&gt;] skb_panic+0x63/0x65
RSP: 0018:ffff8801e6431de8  EFLAGS: 00010282
RAX: 0000000000000086 RBX: ffff8802353d3cc0 RCX: 0000000000000006
RDX: 0000000000003b90 RSI: ffff8801f52c2ca0 RDI: ffff8801f52c2520
RBP: ffff8801e6431e08 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffff88022ea0c800
R13: ffff88022ea0cdf8 R14: ffff8802353ecb40 R15: ffffffff81cc7800
FS:  00007f5720a10740(0000) GS:ffff880244c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000005862000 CR3: 000000022843c000 CR4: 00000000001407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Stack:
 ffff88013deb6dec 000000000000002c 00000000000000c0 ffffffff81a3f6e4
 ffff8801e6431e18 ffffffff8159a9aa ffff8801e6431e90 ffffffff816765f6
 ffffffff810b756b 0000000700000002 ffff8801e6431e40 0000fea9292aa8c0
Call Trace:
 [&lt;ffffffff8159a9aa&gt;] skb_push+0x3a/0x40
 [&lt;ffffffff816765f6&gt;] ip6_push_pending_frames+0x1f6/0x4d0
 [&lt;ffffffff810b756b&gt;] ? mark_held_locks+0xbb/0x140
 [&lt;ffffffff81694919&gt;] udp_v6_push_pending_frames+0x2b9/0x3d0
 [&lt;ffffffff81694660&gt;] ? udplite_getfrag+0x20/0x20
 [&lt;ffffffff8162092a&gt;] udp_lib_setsockopt+0x1aa/0x1f0
 [&lt;ffffffff811cc5e7&gt;] ? fget_light+0x387/0x4f0
 [&lt;ffffffff816958a4&gt;] udpv6_setsockopt+0x34/0x40
 [&lt;ffffffff815949f4&gt;] sock_common_setsockopt+0x14/0x20
 [&lt;ffffffff81593c31&gt;] SyS_setsockopt+0x71/0xd0
 [&lt;ffffffff816f5d54&gt;] tracesys+0xdd/0xe2
Code: 00 00 48 89 44 24 10 8b 87 d8 00 00 00 48 89 44 24 08 48 8b 87 e8 00 00 00 48 c7 c7 c0 04 aa 81 48 89 04 24 31 c0 e8 e1 7e ff ff &lt;0f&gt; 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55
RIP  [&lt;ffffffff816e759c&gt;] skb_panic+0x63/0x65
 RSP &lt;ffff8801e6431de8&gt;

This patch adds a check if the pending data is of address family AF_INET
and directly calls udp_push_ending_frames from udp_v6_push_pending_frames
if that is the case.

This bug was found by Dave Jones with trinity.

(Also move the initialization of fl6 below the AF_INET check, even if
not strictly necessary.)

Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: YOSHIFUJI Hideaki &lt;yoshfuji@linux-ipv6.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>ipv6,mcast: always hold idev-&gt;lock before mca_lock</title>
<updated>2013-07-28T23:18:37Z</updated>
<author>
<name>Amerigo Wang</name>
<email>amwang@redhat.com</email>
</author>
<published>2013-06-29T13:30:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=52ef39eeff06aecc56266902bba6bf28891cabd3'/>
<id>urn:sha1:52ef39eeff06aecc56266902bba6bf28891cabd3</id>
<content type='text'>
[ Upstream commit 8965779d2c0e6ab246c82a405236b1fb2adae6b2, with
  some bits from commit b7b1bfce0bb68bd8f6e62a28295922785cc63781
  ("ipv6: split duplicate address detection and router solicitation timer")
  to get the __ipv6_get_lladdr() used by this patch. ]

dingtianhong reported the following deadlock detected by lockdep:

 ======================================================
 [ INFO: possible circular locking dependency detected ]
 3.4.24.05-0.1-default #1 Not tainted
 -------------------------------------------------------
 ksoftirqd/0/3 is trying to acquire lock:
  (&amp;ndev-&gt;lock){+.+...}, at: [&lt;ffffffff8147f804&gt;] ipv6_get_lladdr+0x74/0x120

 but task is already holding lock:
  (&amp;mc-&gt;mca_lock){+.+...}, at: [&lt;ffffffff8149d130&gt;] mld_send_report+0x40/0x150

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (&amp;mc-&gt;mca_lock){+.+...}:
        [&lt;ffffffff810a8027&gt;] validate_chain+0x637/0x730
        [&lt;ffffffff810a8417&gt;] __lock_acquire+0x2f7/0x500
        [&lt;ffffffff810a8734&gt;] lock_acquire+0x114/0x150
        [&lt;ffffffff814f691a&gt;] rt_spin_lock+0x4a/0x60
        [&lt;ffffffff8149e4bb&gt;] igmp6_group_added+0x3b/0x120
        [&lt;ffffffff8149e5d8&gt;] ipv6_mc_up+0x38/0x60
        [&lt;ffffffff81480a4d&gt;] ipv6_find_idev+0x3d/0x80
        [&lt;ffffffff81483175&gt;] addrconf_notify+0x3d5/0x4b0
        [&lt;ffffffff814fae3f&gt;] notifier_call_chain+0x3f/0x80
        [&lt;ffffffff81073471&gt;] raw_notifier_call_chain+0x11/0x20
        [&lt;ffffffff813d8722&gt;] call_netdevice_notifiers+0x32/0x60
        [&lt;ffffffff813d92d4&gt;] __dev_notify_flags+0x34/0x80
        [&lt;ffffffff813d9360&gt;] dev_change_flags+0x40/0x70
        [&lt;ffffffff813ea627&gt;] do_setlink+0x237/0x8a0
        [&lt;ffffffff813ebb6c&gt;] rtnl_newlink+0x3ec/0x600
        [&lt;ffffffff813eb4d0&gt;] rtnetlink_rcv_msg+0x160/0x310
        [&lt;ffffffff814040b9&gt;] netlink_rcv_skb+0x89/0xb0
        [&lt;ffffffff813eb357&gt;] rtnetlink_rcv+0x27/0x40
        [&lt;ffffffff81403e20&gt;] netlink_unicast+0x140/0x180
        [&lt;ffffffff81404a9e&gt;] netlink_sendmsg+0x33e/0x380
        [&lt;ffffffff813c4252&gt;] sock_sendmsg+0x112/0x130
        [&lt;ffffffff813c537e&gt;] __sys_sendmsg+0x44e/0x460
        [&lt;ffffffff813c5544&gt;] sys_sendmsg+0x44/0x70
        [&lt;ffffffff814feab9&gt;] system_call_fastpath+0x16/0x1b

 -&gt; #0 (&amp;ndev-&gt;lock){+.+...}:
        [&lt;ffffffff810a798e&gt;] check_prev_add+0x3de/0x440
        [&lt;ffffffff810a8027&gt;] validate_chain+0x637/0x730
        [&lt;ffffffff810a8417&gt;] __lock_acquire+0x2f7/0x500
        [&lt;ffffffff810a8734&gt;] lock_acquire+0x114/0x150
        [&lt;ffffffff814f6c82&gt;] rt_read_lock+0x42/0x60
        [&lt;ffffffff8147f804&gt;] ipv6_get_lladdr+0x74/0x120
        [&lt;ffffffff8149b036&gt;] mld_newpack+0xb6/0x160
        [&lt;ffffffff8149b18b&gt;] add_grhead+0xab/0xc0
        [&lt;ffffffff8149d03b&gt;] add_grec+0x3ab/0x460
        [&lt;ffffffff8149d14a&gt;] mld_send_report+0x5a/0x150
        [&lt;ffffffff8149f99e&gt;] igmp6_timer_handler+0x4e/0xb0
        [&lt;ffffffff8105705a&gt;] call_timer_fn+0xca/0x1d0
        [&lt;ffffffff81057b9f&gt;] run_timer_softirq+0x1df/0x2e0
        [&lt;ffffffff8104e8c7&gt;] handle_pending_softirqs+0xf7/0x1f0
        [&lt;ffffffff8104ea3b&gt;] __do_softirq_common+0x7b/0xf0
        [&lt;ffffffff8104f07f&gt;] __thread_do_softirq+0x1af/0x210
        [&lt;ffffffff8104f1c1&gt;] run_ksoftirqd+0xe1/0x1f0
        [&lt;ffffffff8106c7de&gt;] kthread+0xae/0xc0
        [&lt;ffffffff814fff74&gt;] kernel_thread_helper+0x4/0x10

actually we can just hold idev-&gt;lock before taking pmc-&gt;mca_lock,
and avoid taking idev-&gt;lock again when iterating idev-&gt;addr_list,
since the upper callers of mld_newpack() already take
read_lock_bh(&amp;idev-&gt;lock).

Reported-by: dingtianhong &lt;dingtianhong@huawei.com&gt;
Cc: dingtianhong &lt;dingtianhong@huawei.com&gt;
Cc: Hideaki YOSHIFUJI &lt;yoshfuji@linux-ipv6.org&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Tested-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
Tested-by: Chen Weilong &lt;chenweilong@huawei.com&gt;
Signed-off-by: Cong Wang &lt;amwang@redhat.com&gt;
Acked-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>net: Swap ver and type in pppoe_hdr</title>
<updated>2013-07-28T23:18:36Z</updated>
<author>
<name>Changli Gao</name>
<email>xiaosuo@gmail.com</email>
</author>
<published>2013-06-28T16:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e533fb01a23b2c572b11f5357c330daba10039a9'/>
<id>urn:sha1:e533fb01a23b2c572b11f5357c330daba10039a9</id>
<content type='text'>
[ Upstream commit b1a5a34bd0b8767ea689e68f8ea513e9710b671e ]

Ver and type in pppoe_hdr should be swapped as defined by RFC2516
section-4.

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: force a reload of first item in hlist_nulls_for_each_entry_rcu</title>
<updated>2013-06-27T17:34:33Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2013-05-29T09:06:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=64274c35beebe1be22650a9353c0c33a7b8b723c'/>
<id>urn:sha1:64274c35beebe1be22650a9353c0c33a7b8b723c</id>
<content type='text'>
[ Upstream commit c87a124a5d5e8cf8e21c4363c3372bcaf53ea190 ]

Roman Gushchin discovered that udp4_lib_lookup2() was not reloading
first item in the rcu protected list, in case the loop was restarted.

This produced soft lockups as in https://lkml.org/lkml/2013/4/16/37

rcu_dereference(X)/ACCESS_ONCE(X) seem to not work as intended if X is
ptr-&gt;field :

In some cases, gcc caches the value or ptr-&gt;field in a register.

Use a barrier() to disallow such caching, as documented in
Documentation/atomic_ops.txt line 114

Thanks a lot to Roman for providing analysis and numerous patches.

Diagnosed-by: Roman Gushchin &lt;klamm@yandex-team.ru&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Boris Zhmurov &lt;zhmurov@yandex-team.ru&gt;
Signed-off-by: Roman Gushchin &lt;klamm@yandex-team.ru&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.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: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg</title>
<updated>2013-06-27T17:34:32Z</updated>
<author>
<name>Andy Lutomirski</name>
<email>luto@amacapital.net</email>
</author>
<published>2013-05-22T21:07:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e1b796f9408a33d18709e9fdbf18ce91dfede962'/>
<id>urn:sha1:e1b796f9408a33d18709e9fdbf18ce91dfede962</id>
<content type='text'>
[ Upstream commits 1be374a0518a288147c6a7398792583200a67261 and
  a7526eb5d06b0084ef12d7b168d008fcf516caab ]

MSG_CMSG_COMPAT is (AFAIK) not intended to be part of the API --
it's a hack that steals a bit to indicate to other networking code
that a compat entry was used.  So don't allow it from a non-compat
syscall.

This prevents an oops when running this code:

int main()
{
	int s;
	struct sockaddr_in addr;
	struct msghdr *hdr;

	char *highpage = mmap((void*)(TASK_SIZE_MAX - 4096), 4096,
	                      PROT_READ | PROT_WRITE,
	                      MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
	if (highpage == MAP_FAILED)
		err(1, "mmap");

	s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
	if (s == -1)
		err(1, "socket");

        addr.sin_family = AF_INET;
        addr.sin_port = htons(1);
        addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
	if (connect(s, (struct sockaddr*)&amp;addr, sizeof(addr)) != 0)
		err(1, "connect");

	void *evil = highpage + 4096 - COMPAT_MSGHDR_SIZE;
	printf("Evil address is %p\n", evil);

	if (syscall(__NR_sendmmsg, s, evil, 1, MSG_CMSG_COMPAT) &lt; 0)
		err(1, "sendmmsg");

	return 0;
}

Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Andy Lutomirski &lt;luto@amacapital.net&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>mm: migration: add migrate_entry_wait_huge()</title>
<updated>2013-06-20T18:28:20Z</updated>
<author>
<name>Naoya Horiguchi</name>
<email>n-horiguchi@ah.jp.nec.com</email>
</author>
<published>2013-06-12T21:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=79848ba66d91e0c171ff203363e0c96629279c15'/>
<id>urn:sha1:79848ba66d91e0c171ff203363e0c96629279c15</id>
<content type='text'>
commit 30dad30922ccc733cfdbfe232090cf674dc374dc upstream.

When we have a page fault for the address which is backed by a hugepage
under migration, the kernel can't wait correctly and do busy looping on
hugepage fault until the migration finishes.  As a result, users who try
to kick hugepage migration (via soft offlining, for example) occasionally
experience long delay or soft lockup.

This is because pte_offset_map_lock() can't get a correct migration entry
or a correct page table lock for hugepage.  This patch introduces
migration_entry_wait_huge() to solve this.

Signed-off-by: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Reviewed-by: Rik van Riel &lt;riel@redhat.com&gt;
Reviewed-by: Wanpeng Li &lt;liwanp@linux.vnet.ibm.com&gt;
Reviewed-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>wait: fix false timeouts when using wait_event_timeout()</title>
<updated>2013-06-07T19:46:36Z</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2013-05-24T22:55:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=26deb18bd5aa6e3d7099b291038fef47b31cbf69'/>
<id>urn:sha1:26deb18bd5aa6e3d7099b291038fef47b31cbf69</id>
<content type='text'>
commit 4c663cfc523a88d97a8309b04a089c27dc57fd7e upstream.

Many callers of the wait_event_timeout() and
wait_event_interruptible_timeout() expect that the return value will be
positive if the specified condition becomes true before the timeout
elapses.  However, at the moment this isn't guaranteed.  If the wake-up
handler is delayed enough, the time remaining until timeout will be
calculated as 0 - and passed back as a return value - even if the
condition became true before the timeout has passed.

Fix this by returning at least 1 if the condition becomes true.  This
semantic is in line with what wait_for_condition_timeout() does; see
commit bb10ed09 ("sched: fix wait_for_completion_timeout() spurious
failure under heavy load").

Daniel said "We have 3 instances of this bug in drm/i915.  One case even
where we switch between the interruptible and not interruptible
wait_event_timeout variants, foolishly presuming they have the same
semantics.  I very much like this."

One such bug is reported at
  https://bugs.freedesktop.org/show_bug.cgi?id=64133

Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: "Paul E.  McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ipv6: do not clear pinet6 field</title>
<updated>2013-05-19T17:04:46Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-05-09T10:28:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1e74f2ea952f201c5ee5edce74daab21aea89b31'/>
<id>urn:sha1:1e74f2ea952f201c5ee5edce74daab21aea89b31</id>
<content type='text'>
[ Upstream commit f77d602124d865c38705df7fa25c03de9c284ad2 ]

We have seen multiple NULL dereferences in __inet6_lookup_established()

After analysis, I found that inet6_sk() could be NULL while the
check for sk_family == AF_INET6 was true.

Bug was added in linux-2.6.29 when RCU lookups were introduced in UDP
and TCP stacks.

Once an IPv6 socket, using SLAB_DESTROY_BY_RCU is inserted in a hash
table, we no longer can clear pinet6 field.

This patch extends logic used in commit fcbdf09d9652c891
("net: fix nulls list corruptions in sk_prot_alloc")

TCP/UDP/UDPLite IPv6 protocols provide their own .clear_sk() method
to make sure we do not clear pinet6 field.

At socket clone phase, we do not really care, as cloning the parent (non
NULL) pinet6 is not adding a fatal race.

Signed-off-by: Eric Dumazet &lt;edumazet@google.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>macvlan: fix passthru mode race between dev removal and rx path</title>
<updated>2013-05-19T17:04:46Z</updated>
<author>
<name>Jiri Pirko</name>
<email>jiri@resnulli.us</email>
</author>
<published>2013-05-09T04:23:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5bf240fa193989d605a715bda7cb3283b1abc89'/>
<id>urn:sha1:d5bf240fa193989d605a715bda7cb3283b1abc89</id>
<content type='text'>
[ Upstream commit 233c7df0821c4190e2d3f4be0f2ca0ab40a5ed8c, note
  that I had to add list_first_or_null_rcu to rculist.h in order
  to accomodate this fix. ]

Currently, if macvlan in passthru mode is created and data are rxed and
you remove this device, following panic happens:

NULL pointer dereference at 0000000000000198
IP: [&lt;ffffffffa0196058&gt;] macvlan_handle_frame+0x153/0x1f7 [macvlan]

I'm using following script to trigger this:
&lt;script&gt;
while [ 1 ]
do
	ip link add link e1 name macvtap0 type macvtap mode passthru
	ip link set e1 up
	ip link set macvtap0 up
	IFINDEX=`ip link |grep macvtap0 | cut -f 1 -d ':'`
	cat /dev/tap$IFINDEX  &gt;/dev/null &amp;
	ip link del dev macvtap0
done
&lt;/script&gt;

I run this script while "ping -f" is running on another machine to send
packets to e1 rx.

Reason of the panic is that list_first_entry() is blindly called in
macvlan_handle_frame() even if the list was empty. vlan is set to
incorrect pointer which leads to the crash.

I'm fixing this by protecting port-&gt;vlans list by rcu and by preventing
from getting incorrect pointer in case the list is empty.

Introduced by: commit eb06acdc85585f2 "macvlan: Introduce 'passthru' mode to takeover the underlying device"

Signed-off-by: Jiri Pirko &lt;jiri@resnulli.us&gt;
Acked-by: Eric Dumazet &lt;edumazet@google.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>
</feed>
