linux_dsm_epyc7002/net/rxrpc
David Howells d3be4d2443 rxrpc: Fix potential call vs socket/net destruction race
rxrpc_call structs don't pin sockets or network namespaces, but may attempt
to access both after their refcount reaches 0 so that they can detach
themselves from the network namespace.  However, there's no guarantee that
the socket still exists at this point (so sock_net(&call->socket->sk) may
be invalid) and the namespace may have gone away if the call isn't pinning
a peer.

Fix this by (a) carrying a net pointer in the rxrpc_call struct and (b)
waiting for all calls to be destroyed when the network namespace goes away.

This was detected by checker:

net/rxrpc/call_object.c:634:57: warning: incorrect type in argument 1 (different address spaces)
net/rxrpc/call_object.c:634:57:    expected struct sock const *sk
net/rxrpc/call_object.c:634:57:    got struct sock [noderef] <asn:4>*<noident>

Fixes: 2baec2c3f8 ("rxrpc: Support network namespacing")
Signed-off-by: David Howells <dhowells@redhat.com>
2018-03-30 21:05:23 +01:00
..
af_rxrpc.c rxrpc: Fix firewall route keepalive 2018-03-30 21:04:43 +01:00
ar-internal.h rxrpc: Fix potential call vs socket/net destruction race 2018-03-30 21:05:23 +01:00
call_accept.c rxrpc: Fix potential call vs socket/net destruction race 2018-03-30 21:05:23 +01:00
call_event.c rxrpc: Fix resend event time calculation 2018-03-30 21:04:44 +01:00
call_object.c rxrpc: Fix potential call vs socket/net destruction race 2018-03-30 21:05:23 +01:00
conn_client.c rxrpc: Fix checker warnings and errors 2018-03-30 21:05:17 +01:00
conn_event.c rxrpc: Fix firewall route keepalive 2018-03-30 21:04:43 +01:00
conn_object.c rxrpc: Fix checker warnings and errors 2018-03-30 21:05:17 +01:00
conn_service.c
input.c rxrpc: Don't treat call aborts as conn aborts 2018-03-30 21:04:44 +01:00
insecure.c
Kconfig
key.c
local_event.c
local_object.c
Makefile
misc.c rxrpc: Fix call timeouts 2017-11-24 10:18:41 +00:00
net_ns.c rxrpc: Fix potential call vs socket/net destruction race 2018-03-30 21:05:23 +01:00
output.c rxrpc: Fix firewall route keepalive 2018-03-30 21:04:43 +01:00
peer_event.c rxrpc: Fix firewall route keepalive 2018-03-30 21:04:43 +01:00
peer_object.c rxrpc: Fix firewall route keepalive 2018-03-30 21:04:43 +01:00
proc.c rxrpc: Fix checker warnings and errors 2018-03-30 21:05:17 +01:00
protocol.h
recvmsg.c rxrpc: remove redundant initialization of variable 'len' 2018-03-16 09:48:39 -04:00
rxkad.c rxrpc: Fix firewall route keepalive 2018-03-30 21:04:43 +01:00
security.c rxrpc: remove unused static variables 2018-03-30 21:04:44 +01:00
sendmsg.c rxrpc: Fix checker warnings and errors 2018-03-30 21:05:17 +01:00
skbuff.c
sysctl.c rxrpc: Fix call timeouts 2017-11-24 10:18:41 +00:00
utils.c