2022-09-01 08:38:35

by David Howells

[permalink] [raw]
Subject: [PATCH net 0/6] rxrpc: Miscellaneous fixes


Here are some fixes for AF_RXRPC:

(1) Fix the handling of ICMP/ICMP6 packets. This is a problem due to
rxrpc being switched to acting as a UDP tunnel, thereby allowing it to
steal the packets before they go through the UDP Rx queue. UDP
tunnels can't get ICMP/ICMP6 packets, however. This patch adds an
additional encap hook so that they can.

(2) Fix the encryption routines in rxkad to handle packets that have more
than three parts correctly. The problem is that ->nr_frags doesn't
count the initial fragment, so the sglist ends up too short.

(3) Fix a problem with destruction of the local endpoint potentially
getting repeated.

(4) Fix the calculation of the time at which to resend.
jiffies_to_usecs() gives microseconds, not nanoseconds.

(5) Fix AFS to work out when callback promises and locks expire based on
the time an op was issued rather than the time the first reply packet
arrives. We don't know how long the server took between calculating
the expiry interval and transmitting the reply.

(6) Given (5), rxrpc_get_reply_time() is no longer used, so remove it.

The patches are tagged here:

git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
rxrpc-fixes-20220831

and can also be found on the following branch:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes

Changes
=======
ver #2)
- Added some missing cpp-conditionals for rxrpc IPV6 support.
- Replaced the callback promise time calculation patch with one that used
the time of op issue rather than time of first reply packet as a base.
- Added an additional patch to remove the rxrpc function to retrieve the
time of first reply.

Link: http://lists.infradead.org/pipermail/linux-afs/2022-August/005547.html # v1
Link: http://lists.infradead.org/pipermail/linux-afs/2022-August/005552.html # v2

David
---
David Howells (6):
rxrpc: Fix ICMP/ICMP6 error handling
rxrpc: Fix an insufficiently large sglist in rxkad_verify_packet_2()
rxrpc: Fix local destruction being repeated
rxrpc: Fix calc of resend age
afs: Use the operation issue time instead of the reply time for callbacks
rxrpc: Remove rxrpc_get_reply_time() which is no longer used


Documentation/networking/rxrpc.rst | 11 --
fs/afs/flock.c | 2 +-
fs/afs/fsclient.c | 2 +-
fs/afs/internal.h | 3 +-
fs/afs/rxrpc.c | 7 +-
fs/afs/yfsclient.c | 3 +-
include/linux/udp.h | 1 +
include/net/af_rxrpc.h | 2 -
include/net/udp_tunnel.h | 4 +
net/ipv4/udp.c | 2 +
net/ipv4/udp_tunnel_core.c | 1 +
net/ipv6/udp.c | 5 +-
net/rxrpc/ar-internal.h | 1 +
net/rxrpc/call_event.c | 2 +-
net/rxrpc/local_object.c | 4 +
net/rxrpc/peer_event.c | 291 +++++++++++++++++++++++++----
net/rxrpc/recvmsg.c | 43 -----
net/rxrpc/rxkad.c | 2 +-
18 files changed, 279 insertions(+), 107 deletions(-)



2022-09-01 09:19:14

by David Howells

[permalink] [raw]
Subject: [PATCH net 3/6] rxrpc: Fix local destruction being repeated

If the local processor work item for the rxrpc local endpoint gets requeued
by an event (such as an incoming packet) between it getting scheduled for
destruction and the UDP socket being closed, the rxrpc_local_destroyer()
function can get run twice. The second time it can hang because it can end
up waiting for cleanup events that will never happen.

Signed-off-by: David Howells <[email protected]>
---

net/rxrpc/local_object.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c
index 79bb02eb67b2..38ea98ff426b 100644
--- a/net/rxrpc/local_object.c
+++ b/net/rxrpc/local_object.c
@@ -406,6 +406,9 @@ static void rxrpc_local_processor(struct work_struct *work)
container_of(work, struct rxrpc_local, processor);
bool again;

+ if (local->dead)
+ return;
+
trace_rxrpc_local(local->debug_id, rxrpc_local_processing,
refcount_read(&local->ref), NULL);



2022-09-01 10:47:47

by David Howells

[permalink] [raw]
Subject: Re: [PATCH net 0/6] rxrpc: Miscellaneous fixes

Please don't pull this. The kernel test robot spotted a bug in it.

David