remarkable-linux/net
David Lebrun dbad5abd2b ipv6: sr: fix scheduling in RCU when creating seg6 lwtunnel state
[ Upstream commit 191f86ca8e ]

The seg6_build_state() function is called with RCU read lock held,
so we cannot use GFP_KERNEL. This patch uses GFP_ATOMIC instead.

[   92.770271] =============================
[   92.770628] WARNING: suspicious RCU usage
[   92.770921] 4.16.0-rc4+ #12 Not tainted
[   92.771277] -----------------------------
[   92.771585] ./include/linux/rcupdate.h:302 Illegal context switch in RCU read-side critical section!
[   92.772279]
[   92.772279] other info that might help us debug this:
[   92.772279]
[   92.773067]
[   92.773067] rcu_scheduler_active = 2, debug_locks = 1
[   92.773514] 2 locks held by ip/2413:
[   92.773765]  #0:  (rtnl_mutex){+.+.}, at: [<00000000e5461720>] rtnetlink_rcv_msg+0x441/0x4d0
[   92.774377]  #1:  (rcu_read_lock){....}, at: [<00000000df4f161e>] lwtunnel_build_state+0x59/0x210
[   92.775065]
[   92.775065] stack backtrace:
[   92.775371] CPU: 0 PID: 2413 Comm: ip Not tainted 4.16.0-rc4+ #12
[   92.775791] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1.fc27 04/01/2014
[   92.776608] Call Trace:
[   92.776852]  dump_stack+0x7d/0xbc
[   92.777130]  __schedule+0x133/0xf00
[   92.777393]  ? unwind_get_return_address_ptr+0x50/0x50
[   92.777783]  ? __sched_text_start+0x8/0x8
[   92.778073]  ? rcu_is_watching+0x19/0x30
[   92.778383]  ? kernel_text_address+0x49/0x60
[   92.778800]  ? __kernel_text_address+0x9/0x30
[   92.779241]  ? unwind_get_return_address+0x29/0x40
[   92.779727]  ? pcpu_alloc+0x102/0x8f0
[   92.780101]  _cond_resched+0x23/0x50
[   92.780459]  __mutex_lock+0xbd/0xad0
[   92.780818]  ? pcpu_alloc+0x102/0x8f0
[   92.781194]  ? seg6_build_state+0x11d/0x240
[   92.781611]  ? save_stack+0x9b/0xb0
[   92.781965]  ? __ww_mutex_wakeup_for_backoff+0xf0/0xf0
[   92.782480]  ? seg6_build_state+0x11d/0x240
[   92.782925]  ? lwtunnel_build_state+0x1bd/0x210
[   92.783393]  ? ip6_route_info_create+0x687/0x1640
[   92.783846]  ? ip6_route_add+0x74/0x110
[   92.784236]  ? inet6_rtm_newroute+0x8a/0xd0

Fixes: 6c8702c60b ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels")
Signed-off-by: David Lebrun <dlebrun@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-31 18:10:39 +02:00
..
6lowpan
9p 9p/trans_virtio: discard zero-length reply 2018-02-22 15:42:30 +01:00
802
8021q 8021q: fix a memory leak for VLAN 0 device 2018-01-17 09:45:20 +01:00
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: Prevent stack info leak from the EFS element. 2018-01-17 09:45:26 +01:00
bpf
bridge netfilter: bridge: ebt_among: add missing match size checks 2018-03-15 10:54:24 +01:00
caif
can can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once 2018-01-23 19:58:17 +01:00
ceph
core devlink: Remove redundant free on error path 2018-03-31 18:10:39 +02:00
dcb
dccp dccp: CVE-2017-8824: use-after-free in DCCP code 2018-02-16 20:22:45 +01:00
decnet dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock 2018-02-25 11:07:52 +01:00
dns_resolver
dsa
ethernet
hsr
ieee802154
ife
ipv4 tcp: purge write queue upon aborting the connection 2018-03-31 18:10:38 +02:00
ipv6 ipv6: sr: fix scheduling in RCU when creating seg6 lwtunnel state 2018-03-31 18:10:39 +02:00
ipx
iucv
kcm kcm: Only allow TCP sockets to be attached to a KCM mux 2018-02-25 11:07:45 +01:00
key af_key: fix buffer overread in parse_exthdrs() 2018-01-23 19:58:12 +01:00
l2tp
l3mdev
lapb
llc
mac80211 mac80211: remove BUG() when interface type is invalid 2018-03-19 08:42:55 +01:00
mac802154
mpls mpls, nospec: Sanitize array index in mpls_label_ok() 2018-02-22 15:42:28 +01:00
ncsi
netfilter netfilter: IDLETIMER: be syzkaller friendly 2018-03-15 10:54:24 +01:00
netlabel
netlink netlink: put module reference if dump start fails 2018-03-08 22:41:17 -08:00
netrom
nfc
nsh
openvswitch openvswitch: fix the incorrect flow action alloc size 2018-02-03 17:39:03 +01:00
packet
phonet
psample
qrtr
rds rds: tcp: atomically purge entries from rds_tcp_conn_list during netns delete 2018-02-25 11:07:51 +01:00
rfkill
rose
rxrpc rxrpc: Fix send in rxrpc_send_data_packet() 2018-03-08 22:41:12 -08:00
sched net: sched: drop qdisc_reset from dev_graft_qdisc 2018-03-19 08:42:54 +01:00
sctp sctp: fix dst refcnt leak in sctp_v6_get_dst() 2018-03-08 22:41:15 -08:00
smc net/smc: fix NULL pointer dereference on sock_create_kern() error path 2018-03-15 10:54:28 +01:00
strparser
sunrpc xprtrdma: Fix BUG after a device removal 2018-02-22 15:42:29 +01:00
switchdev
tipc tipc: fix tipc_mon_delete() oops in tipc_enable_bearer() error path 2018-03-03 10:24:30 +01:00
tls tls: reset crypto_info when do_tls_setsockopt_tx fails 2018-01-31 14:03:48 +01:00
unix
vmw_vsock VSOCK: fix outdated sk_state value in hvs_release() 2018-02-25 11:07:59 +01:00
wimax
wireless nl80211: Check for the required netlink attribute presence 2018-03-03 10:24:34 +01:00
x25
xfrm xfrm: Fix xfrm_replay_overflow_offload_esn 2018-03-19 08:42:50 +01:00
compat.c
Kconfig
Makefile
socket.c kmemcheck: remove annotations 2018-02-22 15:42:23 +01:00
sysctl_net.c