android_kernel_motorola_sm6225/drivers/net
Taehee Yoo 0a5eca2c94 gtp: fix Illegal context switch in RCU read-side critical section.
[ Upstream commit 3f167e1921865b379a9becf03828e7202c7b4917 ]

ipv4_pdp_add() is called in RCU read-side critical section.
So GFP_KERNEL should not be used in the function.
This patch make ipv4_pdp_add() to use GFP_ATOMIC instead of GFP_KERNEL.

Test commands:
gtp-link add gtp1 &
gtp-tunnel add gtp1 v1 100 200 1.1.1.1 2.2.2.2

Splat looks like:
[  130.618881] =============================
[  130.626382] WARNING: suspicious RCU usage
[  130.626994] 5.2.0-rc6+ #50 Not tainted
[  130.627622] -----------------------------
[  130.628223] ./include/linux/rcupdate.h:266 Illegal context switch in RCU read-side critical section!
[  130.629684]
[  130.629684] other info that might help us debug this:
[  130.629684]
[  130.631022]
[  130.631022] rcu_scheduler_active = 2, debug_locks = 1
[  130.632136] 4 locks held by gtp-tunnel/1025:
[  130.632925]  #0: 000000002b93c8b7 (cb_lock){++++}, at: genl_rcv+0x15/0x40
[  130.634159]  #1: 00000000f17bc999 (genl_mutex){+.+.}, at: genl_rcv_msg+0xfb/0x130
[  130.635487]  #2: 00000000c644ed8e (rtnl_mutex){+.+.}, at: gtp_genl_new_pdp+0x18c/0x1150 [gtp]
[  130.636936]  #3: 0000000007a1cde7 (rcu_read_lock){....}, at: gtp_genl_new_pdp+0x187/0x1150 [gtp]
[  130.638348]
[  130.638348] stack backtrace:
[  130.639062] CPU: 1 PID: 1025 Comm: gtp-tunnel Not tainted 5.2.0-rc6+ #50
[  130.641318] Call Trace:
[  130.641707]  dump_stack+0x7c/0xbb
[  130.642252]  ___might_sleep+0x2c0/0x3b0
[  130.642862]  kmem_cache_alloc_trace+0x1cd/0x2b0
[  130.643591]  gtp_genl_new_pdp+0x6c5/0x1150 [gtp]
[  130.644371]  genl_family_rcv_msg+0x63a/0x1030
[  130.645074]  ? mutex_lock_io_nested+0x1090/0x1090
[  130.645845]  ? genl_unregister_family+0x630/0x630
[  130.646592]  ? debug_show_all_locks+0x2d0/0x2d0
[  130.647293]  ? check_flags.part.40+0x440/0x440
[  130.648099]  genl_rcv_msg+0xa3/0x130
[ ... ]

Fixes: 459aa660eb ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-26 09:14:17 +02:00
..
appletalk net/appletalk: fix minor pointer leak to userspace in SIOCFINDIPDDPRT 2018-09-13 10:35:57 -07:00
arcnet
bonding bonding: validate ip header before check IPPROTO_IGMP 2019-07-26 09:14:15 +02:00
caif
can can: m_can: implement errata "Needless activation of MRAF irq" 2019-07-14 08:11:07 +02:00
dsa net: dsa: mv88e6xxx: fix shift of FID bits in mv88e6185_g1_vtu_loadpurge() 2019-07-14 08:11:15 +02:00
ethernet bnx2x: Prevent ptp_task to be rescheduled indefinitely 2019-07-26 09:14:15 +02:00
fddi
fjes
hamradio net/hamradio/6pack: use mod_timer() to rearm timers 2019-01-09 17:38:32 +01:00
hippi
hyperv hv_netvsc: Set probe mode to sync 2019-06-22 08:15:13 +02:00
ieee802154 net: ieee802154: fix missing checks for regmap_update_bits 2019-05-25 18:23:43 +02:00
ipvlan net: ipvlan: Fix ipvlan device tso disabled while NETIF_F_IP_CSUM is set 2019-06-25 11:35:58 +08:00
netdevsim
phy net: sfp: add mutex to prevent concurrent state checks 2019-07-26 09:14:05 +02:00
plip
ppp ppp: mppe: Add softdep to arc4 2019-07-21 09:03:07 +02:00
slip slip: make slhc_free() silently accept an error pointer 2019-05-02 09:58:56 +02:00
team team: Always enable vlan tx offload 2019-07-03 13:14:47 +02:00
usb net: usb: asix: init MAC address buffers 2019-07-26 09:14:15 +02:00
vmxnet3
wan net/wan: fix a double free in x25_asy_open_tty() 2019-01-09 17:38:32 +01:00
wimax wimax/i2400m: fix spelling mistake "not unitialized" -> "uninitialized" 2018-09-26 20:09:58 -07:00
wireless iwlwifi: mvm: Drop large non sta frames 2019-07-26 09:14:14 +02:00
xen-netback xen-netback: fix occasional leak of grant ref mappings under memory pressure 2019-03-10 07:17:19 +01:00
dummy.c
eql.c
geneve.c geneve: correctly handle ipv6.disable module parameter 2019-03-10 07:17:17 +01:00
gtp.c gtp: fix Illegal context switch in RCU read-side critical section. 2019-07-26 09:14:17 +02:00
ifb.c
Kconfig gtp: change NET_UDP_TUNNEL dependency to select 2019-04-03 06:26:15 +02:00
LICENSE.SRC
loopback.c net: loopback: clear skb->tstamp before netif_rx() 2018-11-13 11:08:20 -08:00
macsec.c
macvlan.c macvlan: return correct error value 2018-12-21 14:15:20 +01:00
macvtap.c
Makefile net: Always descend into dsa/ 2019-05-25 18:23:19 +02:00
mdio.c
mii.c
net_failover.c failover: Add missing check to validate 'slave_dev' in net_failover_slave_unregister 2018-11-13 11:08:28 -08:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c rapidio/rionet: do not free skb before reading its length 2018-12-05 19:31:59 +01:00
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending 2019-06-15 11:54:07 +02:00
tun.c tun: wake up waitqueues after IFF_UP is set 2019-07-03 13:14:48 +02:00
veth.c veth: Orphan skb before GRO 2018-09-16 15:33:50 -07:00
virtio_net.c virtio_net: Account for tx bytes and packets on sending xdp_frames 2019-02-12 19:47:23 +01:00
vrf.c vrf: prevent adding upper devices 2019-04-03 06:26:18 +02:00
vsockmon.c
vxlan.c vxlan: Don't call gro_cells_destroy() before device is unregistered 2019-04-03 06:26:18 +02:00
xen-netfront.c xen/netfront: tolerate frags with no data 2019-01-09 17:38:34 +01:00