linux/net/rxrpc
David Howells ee3b0826b4 rxrpc: Restore removed timer deletion
A recent patch[1] from Eric Dumazet flipped the order in which the
keepalive timer and the keepalive worker were cancelled in order to fix a
syzbot reported issue[2].  Unfortunately, this enables the mirror image bug
whereby the timer races with rxrpc_exit_net(), restarting the worker after
it has been cancelled:

	CPU 1		CPU 2
	===============	=====================
			if (rxnet->live)
			<INTERRUPT>
	rxnet->live = false;
 	cancel_work_sync(&rxnet->peer_keepalive_work);
			rxrpc_queue_work(&rxnet->peer_keepalive_work);
	del_timer_sync(&rxnet->peer_keepalive_timer);

Fix this by restoring the removed del_timer_sync() so that we try to remove
the timer twice.  If the timer runs again, it should see ->live == false
and not restart the worker.

Fixes: 1946014ca3 ("rxrpc: fix a race in rxrpc_exit_net()")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Eric Dumazet <edumazet@google.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/20220404183439.3537837-1-eric.dumazet@gmail.com/ [1]
Link: https://syzkaller.appspot.com/bug?extid=724378c4bb58f703b09a [2]
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-04-15 10:54:49 +01:00
..
af_rxrpc.c
ar-internal.h rxrpc: Fix call timer start racing with call destruction 2022-03-31 12:25:25 +02:00
call_accept.c
call_event.c rxrpc: Fix call timer start racing with call destruction 2022-03-31 12:25:25 +02:00
call_object.c rxrpc: Fix call timer start racing with call destruction 2022-03-31 12:25:25 +02:00
conn_client.c rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() 2021-11-29 15:39:40 +00:00
conn_event.c
conn_object.c
conn_service.c
input.c
insecure.c
Kconfig net: RxRPC: make dependent Kconfig symbols be shown indented 2021-08-18 10:12:11 +01:00
key.c
local_event.c
local_object.c
Makefile
misc.c
net_ns.c rxrpc: Restore removed timer deletion 2022-04-15 10:54:49 +01:00
output.c rxrpc: Adjust retransmission backoff 2022-01-22 02:03:24 +00:00
peer_event.c
peer_object.c rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer() 2021-11-29 15:40:02 +00:00
proc.c
protocol.h
recvmsg.c
rtt.c rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies() 2021-09-24 14:18:34 +01:00
rxkad.c
security.c
sendmsg.c
server_key.c rxrpc: fix some null-ptr-deref bugs in server_key.c 2022-03-31 15:21:31 +02:00
skbuff.c
sysctl.c
utils.c