android_kernel_motorola_sm6375/net/rxrpc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Howells 68e798fa3c rxrpc: Fix deadlock around release of dst cached on udp tunnel
[ Upstream commit 5399d52233c47905bbf97dcbaa2d7a9cc31670ba ]

AF_RXRPC sockets use UDP ports in encap mode.  This causes socket and dst
from an incoming packet to get stolen and attached to the UDP socket from
whence it is leaked when that socket is closed.

When a network namespace is removed, the wait for dst records to be cleaned
up happens before the cleanup of the rxrpc and UDP socket, meaning that the
wait never finishes.

Fix this by moving the rxrpc (and, by dependence, the afs) private
per-network namespace registrations to the device group rather than subsys
group.  This allows cached rxrpc local endpoints to be cleared and their
UDP sockets closed before we try waiting for the dst records.

The symptom is that lines looking like the following:

	unregister_netdevice: waiting for lo to become free

get emitted at regular intervals after running something like the
referenced syzbot test.

Thanks to Vadim for tracking this down and work out the fix.

Reported-by: [email protected]
Reported-by: Vadim Fedorenko <[email protected]>
Fixes: 5271953cad ("rxrpc: Use the UDP encap_rcv hook")
Signed-off-by: David Howells <[email protected]>
Acked-by: Vadim Fedorenko <[email protected]>
Link: https://lore.kernel.org/r/161196443016.3868642.5577440140646403533.stgit@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2021-02-10 09:25:27 +01:00
..
af_rxrpc.c rxrpc: Fix deadlock around release of dst cached on udp tunnel 2021-02-10 09:25:27 +01:00
ar-internal.h rxrpc: Fix the excessive initial retransmission timeout 2020-05-27 17:46:48 +02:00
call_accept.c rxrpc: Fix memory leak in rxrpc_lookup_local 2021-02-03 23:26:01 +01:00
call_event.c rxrpc: Fix afs large storage transmission performance drop 2020-07-09 09:37:52 +02:00
call_object.c rxrpc: Fix race between recvmsg and sendmsg on immediate call failure 2020-08-11 15:33:40 +02:00
conn_client.c
conn_event.c rxrpc: Fix some missing _bh annotations on locking conn->state_lock 2020-10-14 10:33:05 +02:00
conn_object.c rxrpc: Fix race between recvmsg and sendmsg on immediate call failure 2020-08-11 15:33:40 +02:00
conn_service.c
input.c rxrpc: Call state should be read with READ_ONCE() under some circumstances 2021-01-23 15:57:59 +01:00
insecure.c
Kconfig
key.c rxrpc: Fix handling of an unsupported token type in rxrpc_read() 2021-01-23 15:58:00 +01:00
local_event.c
local_object.c
Makefile rxrpc: Fix the excessive initial retransmission timeout 2020-05-27 17:46:48 +02:00
misc.c rxrpc: Fix the excessive initial retransmission timeout 2020-05-27 17:46:48 +02:00
net_ns.c
output.c rxrpc: Fix the excessive initial retransmission timeout 2020-05-27 17:46:48 +02:00
peer_event.c rxrpc: Fix the excessive initial retransmission timeout 2020-05-27 17:46:48 +02:00
peer_object.c rxrpc: Make rxrpc_kernel_get_srtt() indicate validity 2020-09-09 19:12:23 +02:00
proc.c rxrpc: Adjust /proc/net/rxrpc/calls to display call->debug_id not user_ID 2020-06-24 17:50:37 +02:00
protocol.h
recvmsg.c rxrpc: Fix race between recvmsg and sendmsg on immediate call failure 2020-08-11 15:33:40 +02:00
rtt.c rxrpc: Fix the excessive initial retransmission timeout 2020-05-27 17:46:48 +02:00
rxkad.c rxrpc: Fix a memory leak in rxkad_verify_response() 2020-05-27 17:46:49 +02:00
security.c
sendmsg.c rxrpc: Fix race between recvmsg and sendmsg on immediate call failure 2020-08-11 15:33:40 +02:00
skbuff.c
sysctl.c rxrpc: Fix the excessive initial retransmission timeout 2020-05-27 17:46:48 +02:00
utils.c