lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1447668260.141421.440863153.156433F8@webmail.messagingengine.com>
Date:	Mon, 16 Nov 2015 11:04:20 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	"Jason A. Donenfeld" <Jason@...c4.com>,
	Netdev <netdev@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	David Miller <davem@...emloft.net>, tgraf@...g.ch,
	Tom Herbert <tom@...bertland.com>,
	Jiri Benc <jbenc@...hat.com>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>
Subject: Re: [PATCH v2] ip_tunnel: disable preemption when updating per-cpu
 tstats

On Thu, Nov 12, 2015, at 17:35, Jason A. Donenfeld wrote:
> Drivers like vxlan use the recently introduced
> udp_tunnel_xmit_skb/udp_tunnel6_xmit_skb APIs. udp_tunnel6_xmit_skb
> makes use of ip6tunnel_xmit, and ip6tunnel_xmit, after sending the
> packet, updates the struct stats using the usual
> u64_stats_update_begin/end calls on this_cpu_ptr(dev->tstats).
> udp_tunnel_xmit_skb makes use of iptunnel_xmit, which doesn't touch
> tstats, so drivers like vxlan, immediately after, call
> iptunnel_xmit_stats, which does the same thing - calls
> u64_stats_update_begin/end on this_cpu_ptr(dev->tstats).
> 
> While vxlan is probably fine (I don't know?), calling a similar function
> from, say, an unbound workqueue, on a fully preemptable kernel causes
> real issues:
> 
> [  188.434537] BUG: using smp_processor_id() in preemptible [00000000]
> code: kworker/u8:0/6
> [  188.435579] caller is debug_smp_processor_id+0x17/0x20
> [  188.435583] CPU: 0 PID: 6 Comm: kworker/u8:0 Not tainted 4.2.6 #2
> [  188.435607] Call Trace:
> [  188.435611]  [<ffffffff8234e936>] dump_stack+0x4f/0x7b
> [  188.435615]  [<ffffffff81915f3d>]
> check_preemption_disabled+0x19d/0x1c0
> [  188.435619]  [<ffffffff81915f77>] debug_smp_processor_id+0x17/0x20
> 
> The solution would be to protect the whole
> this_cpu_ptr(dev->tstats)/u64_stats_update_begin/end blocks with
> disabling preemption and then reenabling it.
> 
> Signed-off-by: Jason A. Donenfeld <Jason@...c4.com>

Acked-by: Hannes Frederic Sowa <hannes@...essinduktion.org>

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ