* [PATCH net 0/5] rxrpc: Miscellaneous fixes
@ 2022-05-21 8:02 David Howells
2022-05-22 20:32 ` David Miller
2022-05-22 20:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 20+ messages in thread
From: David Howells @ 2022-05-21 8:02 UTC (permalink / raw)
To: netdev
Cc: linux-afs, Jeffrey Altman, Marc Dionne, dhowells, linux-afs,
linux-kernel
Here are some fixes for AF_RXRPC:
(1) Fix listen() allowing preallocation to overrun the prealloc buffer.
(2) Prevent resending the request if we've seen the reply starting to
arrive.
(3) Fix accidental sharing of ACK state between transmission and
reception.
(4) Ignore ACKs in which ack.previousPacket regresses. This indicates the
highest DATA number so far seen, so should not be seen to go
backwards.
(5) Fix the determination of when to generate an IDLE-type ACK,
simplifying it so that we generate one if we have more than two DATA
packets that aren't hard-acked (consumed) or soft-acked (in the rx
buffer, but could be discarded and re-requested).
The patches are tagged here:
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
rxrpc-fixes-20220521
and can also be found on the following branch:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
Tested-by: kafs-testing+fedora34_64checkkafs-build-495@auristor.com
Changes
=======
ver #2)
- Rebased onto net/master
- Dropped the IPv6 checksum patch as it's already upstream.
David
Link: https://lore.kernel.org/r/165306442115.34086.1818959430525328753.stgit@warthog.procyon.org.uk/ # v1
---
David Howells (5):
rxrpc: Fix listen() setting the bar too high for the prealloc rings
rxrpc: Don't try to resend the request if we're receiving the reply
rxrpc: Fix overlapping ACK accounting
rxrpc: Don't let ack.previousPacket regress
rxrpc: Fix decision on when to generate an IDLE ACK
include/trace/events/rxrpc.h | 2 +-
net/rxrpc/ar-internal.h | 13 +++++++------
net/rxrpc/call_event.c | 3 ++-
net/rxrpc/input.c | 31 ++++++++++++++++++++-----------
net/rxrpc/output.c | 20 ++++++++++++--------
net/rxrpc/recvmsg.c | 8 +++-----
net/rxrpc/sysctl.c | 4 ++--
7 files changed, 47 insertions(+), 34 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2022-05-21 8:02 David Howells
@ 2022-05-22 20:32 ` David Miller
2022-05-22 20:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 20+ messages in thread
From: David Miller @ 2022-05-22 20:32 UTC (permalink / raw)
To: dhowells; +Cc: netdev, linux-afs, jaltman, marc.dionne, linux-kernel
From: David Howells <dhowells@redhat.com>
Date: Sat, 21 May 2022 09:02:58 +0100
>
> Here are some fixes for AF_RXRPC:
>
> (1) Fix listen() allowing preallocation to overrun the prealloc buffer.
>
> (2) Prevent resending the request if we've seen the reply starting to
> arrive.
>
> (3) Fix accidental sharing of ACK state between transmission and
> reception.
>
> (4) Ignore ACKs in which ack.previousPacket regresses. This indicates the
> highest DATA number so far seen, so should not be seen to go
> backwards.
>
> (5) Fix the determination of when to generate an IDLE-type ACK,
> simplifying it so that we generate one if we have more than two DATA
> packets that aren't hard-acked (consumed) or soft-acked (in the rx
> buffer, but could be discarded and re-requested).
>
> The patches are tagged here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
> rxrpc-fixes-20220521
>
> and can also be found on the following branch:
>
> http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
I tried to pull from this url and it does not work, just fyi...
So I applied the series instead.
> Tested-by: kafs-testing+fedora34_64checkkafs-build-495@auristor.com
Thank you.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2022-05-21 8:02 David Howells
2022-05-22 20:32 ` David Miller
@ 2022-05-22 20:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 20+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-22 20:40 UTC (permalink / raw)
To: David Howells; +Cc: netdev, linux-afs, jaltman, marc.dionne, linux-kernel
Hello:
This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sat, 21 May 2022 09:02:58 +0100 you wrote:
> Here are some fixes for AF_RXRPC:
>
> (1) Fix listen() allowing preallocation to overrun the prealloc buffer.
>
> (2) Prevent resending the request if we've seen the reply starting to
> arrive.
>
> [...]
Here is the summary with links:
- [net,1/5] rxrpc: Fix listen() setting the bar too high for the prealloc rings
https://git.kernel.org/netdev/net/c/88e22159750b
- [net,2/5] rxrpc: Don't try to resend the request if we're receiving the reply
https://git.kernel.org/netdev/net/c/114af61f88fb
- [net,3/5] rxrpc: Fix overlapping ACK accounting
https://git.kernel.org/netdev/net/c/8940ba3cfe48
- [net,4/5] rxrpc: Don't let ack.previousPacket regress
https://git.kernel.org/netdev/net/c/81524b631253
- [net,5/5] rxrpc: Fix decision on when to generate an IDLE ACK
https://git.kernel.org/netdev/net/c/9a3dedcf1809
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH net 0/5] rxrpc: Miscellaneous fixes
@ 2024-05-03 15:07 David Howells
2024-05-08 2:44 ` Jakub Kicinski
2024-05-08 15:10 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 20+ messages in thread
From: David Howells @ 2024-05-03 15:07 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-afs, linux-kernel
Here some miscellaneous fixes for AF_RXRPC:
(1) Fix the congestion control algorithm to start cwnd at 4 and to not cut
ssthresh when the peer cuts its rwind size.
(2) Only transmit a single ACK for all the DATA packets glued together
into a jumbo packet to reduce the number of ACKs being generated.
(3) Clean up the generation of flags in the protocol header when creating
a packet for transmission. This means we don't carry the old
REQUEST-ACK bit around from previous transmissions, will make it
easier to fix the MORE-PACKETS flag and make it easier to do jumbo
packet assembly in future.
(4) Fix how the MORE-PACKETS flag is driven. We shouldn't be setting it
in sendmsg() as the packet is then queued and the bit is left in that
state, no matter how long it takes us to transmit the packet - and
will still be in that state if the packet is retransmitted.
(5) Request an ACK on an impending transmission stall due to the app layer
not feeding us new data fast enough. If we don't request an ACK, we
may have to hold on to the packet buffers for a significant amount of
time until the receiver gets bored and sends us an ACK anyway.
David
---
The patches can be found here also:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
David Howells (5):
rxrpc: Fix congestion control algorithm
rxrpc: Only transmit one ACK per jumbo packet received
rxrpc: Clean up Tx header flags generation handling
rxrpc: Change how the MORE-PACKETS rxrpc wire header flag is driven
rxrpc: Request an ACK on impending Tx stall
include/trace/events/rxrpc.h | 2 +-
net/rxrpc/ar-internal.h | 2 +-
net/rxrpc/call_object.c | 7 +-----
net/rxrpc/input.c | 49 +++++++++++++++++++++++++-----------
net/rxrpc/output.c | 26 ++++++++++++++-----
net/rxrpc/proc.c | 6 ++---
net/rxrpc/sendmsg.c | 3 ---
7 files changed, 61 insertions(+), 34 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2024-05-03 15:07 David Howells
@ 2024-05-08 2:44 ` Jakub Kicinski
2024-05-08 7:57 ` Jeffrey Altman
2024-05-08 14:00 ` David Howells
2024-05-08 15:10 ` patchwork-bot+netdevbpf
1 sibling, 2 replies; 20+ messages in thread
From: Jakub Kicinski @ 2024-05-08 2:44 UTC (permalink / raw)
To: David Howells
Cc: netdev, Marc Dionne, David S. Miller, Eric Dumazet, Paolo Abeni,
linux-afs, linux-kernel
On Fri, 3 May 2024 16:07:38 +0100 David Howells wrote:
> Here some miscellaneous fixes for AF_RXRPC:
>
> (1) Fix the congestion control algorithm to start cwnd at 4 and to not cut
> ssthresh when the peer cuts its rwind size.
>
> (2) Only transmit a single ACK for all the DATA packets glued together
> into a jumbo packet to reduce the number of ACKs being generated.
>
> (3) Clean up the generation of flags in the protocol header when creating
> a packet for transmission. This means we don't carry the old
> REQUEST-ACK bit around from previous transmissions, will make it
> easier to fix the MORE-PACKETS flag and make it easier to do jumbo
> packet assembly in future.
>
> (4) Fix how the MORE-PACKETS flag is driven. We shouldn't be setting it
> in sendmsg() as the packet is then queued and the bit is left in that
> state, no matter how long it takes us to transmit the packet - and
> will still be in that state if the packet is retransmitted.
>
> (5) Request an ACK on an impending transmission stall due to the app layer
> not feeding us new data fast enough. If we don't request an ACK, we
> may have to hold on to the packet buffers for a significant amount of
> time until the receiver gets bored and sends us an ACK anyway.
Looks like these got marked as Rejected in patchwork.
I think either because lore is confused and attaches an exchange with
DaveM from 2022 to them (?) or because I mentioned to DaveM that I'm
not sure these are fixes. So let me ask - on a scale of 1 to 10, how
convinced are you that these should go to Linus this week rather than
being categorized as general improvements and go during the merge
window (without the Fixes tags)?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2024-05-08 2:44 ` Jakub Kicinski
@ 2024-05-08 7:57 ` Jeffrey Altman
2024-05-08 13:54 ` Jakub Kicinski
2024-05-08 14:00 ` David Howells
1 sibling, 1 reply; 20+ messages in thread
From: Jeffrey Altman @ 2024-05-08 7:57 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David Howells, netdev, Marc Dionne, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-afs, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2071 bytes --]
> On May 7, 2024, at 8:44 PM, Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Fri, 3 May 2024 16:07:38 +0100 David Howells wrote:
>> Here some miscellaneous fixes for AF_RXRPC:
>>
>> (1) Fix the congestion control algorithm to start cwnd at 4 and to not cut
>> ssthresh when the peer cuts its rwind size.
>>
>> (2) Only transmit a single ACK for all the DATA packets glued together
>> into a jumbo packet to reduce the number of ACKs being generated.
>>
>> (3) Clean up the generation of flags in the protocol header when creating
>> a packet for transmission. This means we don't carry the old
>> REQUEST-ACK bit around from previous transmissions, will make it
>> easier to fix the MORE-PACKETS flag and make it easier to do jumbo
>> packet assembly in future.
>>
>> (4) Fix how the MORE-PACKETS flag is driven. We shouldn't be setting it
>> in sendmsg() as the packet is then queued and the bit is left in that
>> state, no matter how long it takes us to transmit the packet - and
>> will still be in that state if the packet is retransmitted.
>>
>> (5) Request an ACK on an impending transmission stall due to the app layer
>> not feeding us new data fast enough. If we don't request an ACK, we
>> may have to hold on to the packet buffers for a significant amount of
>> time until the receiver gets bored and sends us an ACK anyway.
>
> Looks like these got marked as Rejected in patchwork.
> I think either because lore is confused and attaches an exchange with
> DaveM from 2022 to them (?) or because I mentioned to DaveM that I'm
> not sure these are fixes. So let me ask - on a scale of 1 to 10, how
> convinced are you that these should go to Linus this week rather than
> being categorized as general improvements and go during the merge
> window (without the Fixes tags)?
Jakub,
In my opinion, the first two patches in the series I believe are important to back port to the stable branches.
Reviewed-by: Jeffrey Altman <jaltman@auristor.com <mailto:jaltman@auristor.com>>
Jeffrey
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3929 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2024-05-08 7:57 ` Jeffrey Altman
@ 2024-05-08 13:54 ` Jakub Kicinski
0 siblings, 0 replies; 20+ messages in thread
From: Jakub Kicinski @ 2024-05-08 13:54 UTC (permalink / raw)
To: Jeffrey Altman, David Howells
Cc: netdev, Marc Dionne, David S. Miller, Eric Dumazet, Paolo Abeni,
linux-afs, linux-kernel
On Wed, 8 May 2024 01:57:43 -0600 Jeffrey Altman wrote:
> > Looks like these got marked as Rejected in patchwork.
> > I think either because lore is confused and attaches an exchange with
> > DaveM from 2022 to them (?) or because I mentioned to DaveM that I'm
> > not sure these are fixes. So let me ask - on a scale of 1 to 10, how
> > convinced are you that these should go to Linus this week rather than
> > being categorized as general improvements and go during the merge
> > window (without the Fixes tags)?
>
> Jakub,
>
> In my opinion, the first two patches in the series I believe are important to back port to the stable branches.
>
> Reviewed-by: Jeffrey Altman <jaltman@auristor.com <mailto:jaltman@auristor.com>>
Are they regressions? Seems possible from the Fixes tag but unclear
from the text of the commit messages.
In any case, taking the first two may be a reasonable compromise.
Does it sounds good to you, David?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2024-05-08 2:44 ` Jakub Kicinski
2024-05-08 7:57 ` Jeffrey Altman
@ 2024-05-08 14:00 ` David Howells
2024-05-08 15:07 ` Jakub Kicinski
1 sibling, 1 reply; 20+ messages in thread
From: David Howells @ 2024-05-08 14:00 UTC (permalink / raw)
To: Jakub Kicinski
Cc: dhowells, netdev, Marc Dionne, David S. Miller, Eric Dumazet,
Paolo Abeni, linux-afs, linux-kernel
Jakub Kicinski <kuba@kernel.org> wrote:
> Looks like these got marked as Rejected in patchwork.
> I think either because lore is confused and attaches an exchange with
> DaveM from 2022 to them (?) or because I mentioned to DaveM that I'm
> not sure these are fixes. So let me ask - on a scale of 1 to 10, how
> convinced are you that these should go to Linus this week rather than
> being categorized as general improvements and go during the merge
> window (without the Fixes tags)?
Ah, sorry. I marked them rejected as I put myself as cc: not S-o-b on one of
them, but then got distracted and didn't get around to reposting them. And
Jeff mentioned that the use of the MORE-PACKETS flag is not exactly
consistent between various implementations.
So if you could take just the first two for the moment?
Thanks,
David
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2024-05-08 14:00 ` David Howells
@ 2024-05-08 15:07 ` Jakub Kicinski
0 siblings, 0 replies; 20+ messages in thread
From: Jakub Kicinski @ 2024-05-08 15:07 UTC (permalink / raw)
To: David Howells
Cc: netdev, Marc Dionne, David S. Miller, Eric Dumazet, Paolo Abeni,
linux-afs, linux-kernel
On Wed, 08 May 2024 15:00:28 +0100 David Howells wrote:
> Jakub Kicinski <kuba@kernel.org> wrote:
>
> > Looks like these got marked as Rejected in patchwork.
> > I think either because lore is confused and attaches an exchange with
> > DaveM from 2022 to them (?) or because I mentioned to DaveM that I'm
> > not sure these are fixes. So let me ask - on a scale of 1 to 10, how
> > convinced are you that these should go to Linus this week rather than
> > being categorized as general improvements and go during the merge
> > window (without the Fixes tags)?
>
> Ah, sorry. I marked them rejected as I put myself as cc: not S-o-b on one of
> them, but then got distracted and didn't get around to reposting them. And
> Jeff mentioned that the use of the MORE-PACKETS flag is not exactly
> consistent between various implementations.
Ah, mystery solved :)
> So if you could take just the first two for the moment?
Done!
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2024-05-03 15:07 David Howells
2024-05-08 2:44 ` Jakub Kicinski
@ 2024-05-08 15:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 20+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-08 15:10 UTC (permalink / raw)
To: David Howells
Cc: netdev, marc.dionne, davem, edumazet, kuba, pabeni, linux-afs,
linux-kernel
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 3 May 2024 16:07:38 +0100 you wrote:
> Here some miscellaneous fixes for AF_RXRPC:
>
> (1) Fix the congestion control algorithm to start cwnd at 4 and to not cut
> ssthresh when the peer cuts its rwind size.
>
> (2) Only transmit a single ACK for all the DATA packets glued together
> into a jumbo packet to reduce the number of ACKs being generated.
>
> [...]
Here is the summary with links:
- [net,1/5] rxrpc: Fix congestion control algorithm
https://git.kernel.org/netdev/net/c/ba4e103848d3
- [net,2/5] rxrpc: Only transmit one ACK per jumbo packet received
https://git.kernel.org/netdev/net/c/012b7206918d
- [net,3/5] rxrpc: Clean up Tx header flags generation handling
(no matching commit)
- [net,4/5] rxrpc: Change how the MORE-PACKETS rxrpc wire header flag is driven
(no matching commit)
- [net,5/5] rxrpc: Request an ACK on impending Tx stall
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH net 0/5] rxrpc: Miscellaneous fixes
@ 2025-07-16 11:52 David Howells
0 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2025-07-16 11:52 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, linux-afs, linux-kernel
Here are some fixes for rxrpc:
(1) Fix the calling of IP routing code with IRQs disabled.
(2) Fix a recvmsg/recvmsg race when the first completes a call.
(3) Fix a race between notification, recvmsg and sendmsg releasing a call.
(4) Fix abort of abort.
(5) Fix call-level aborts that should be connection-level aborts.
David
The patches can be found here also:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
David Howells (5):
rxrpc: Fix irq-disabled in local_bh_enable()
rxrpc: Fix recv-recv race of completed call
rxrpc: Fix notification vs call-release vs recvmsg
rxrpc: Fix transmission of an abort in response to an abort
rxrpc: Fix to use conn aborts for conn-wide failures
include/trace/events/rxrpc.h | 6 +++++-
net/rxrpc/ar-internal.h | 4 ++++
net/rxrpc/call_accept.c | 14 ++++++++------
net/rxrpc/call_object.c | 28 ++++++++++++----------------
net/rxrpc/io_thread.c | 14 ++++++++++++++
net/rxrpc/output.c | 22 +++++++++++++---------
net/rxrpc/peer_object.c | 6 ++----
net/rxrpc/recvmsg.c | 23 +++++++++++++++++++++--
net/rxrpc/security.c | 8 ++++----
9 files changed, 83 insertions(+), 42 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH net 0/5] rxrpc: Miscellaneous fixes
@ 2026-03-19 15:01 David Howells
0 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2026-03-19 15:01 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, linux-afs, linux-kernel
Here are some fixes for rxrpc:
(1) Fix missing bounds checks when parsing RxGK tickets.
(2) Fix use of wrong skbuff to get challenge serial number.
(3) Fix unexpected RACK timer warning to report old mode.
(4) Fix server keyring refcount leak.
(5) Fix call key refcount leak.
David
The patches can be found here also:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
Alok Tiwari (2):
rxrpc: Fix use of wrong skb when comparing queued RESP challenge
serial
rxrpc: Fix rack timer warning to report unexpected mode
Anderson Nascimento (2):
rxrpc: Fix keyring reference count leak in rxrpc_setsockopt()
rxrpc: Fix key reference count leak from call->key
Oleh Konko (1):
rxrpc: Fix RxGK token loading to check bounds
net/rxrpc/af_rxrpc.c | 2 +-
net/rxrpc/call_object.c | 1 +
net/rxrpc/conn_event.c | 2 +-
net/rxrpc/input_rack.c | 2 +-
net/rxrpc/key.c | 30 +++++++++++++++++-------------
5 files changed, 21 insertions(+), 16 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH net 0/5] rxrpc: Miscellaneous fixes
@ 2026-06-09 14:09 David Howells
2026-06-13 0:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 20+ messages in thread
From: David Howells @ 2026-06-09 14:09 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman, linux-afs, linux-kernel
Here are some miscellaneous AF_RXRPC fixes:
(1) Make sure rxrpc_verify_data() allocates a buffer, even if the DATA packet
being looked at is zero length to avoid potential NULL-pointer
exceptions.
(2) Don't move an OOB message (e.g. an RxGK CHALLENGE) off the receive queue
onto the pending queue in recvmsg() if MSG_PEEK is specified.
(3) Fix a potential UAF in rxgk_issue_challenge() in which a tracepoint
refers to memory just freed by a different pointer.
(4) Fix afs net namespace teardown to cancel the incoming call preallocation
charger before we disable listening (which will delete the preallocation
queue).
(5) Fix rxrpc_kernel_charge_accept() to use the socket mutex to defend
against listen(0)/shutdown simultaneously deleting the preallocation queue.
David
The patches can be found here also:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
David Howells (2):
rxrpc: Fix UAF in rxgk_issue_challenge()
afs: Fix netns teardown to cancel the preallocation charger
Hyunwoo Kim (1):
rxrpc: Don't move a peeked OOB message onto the pending queue
Jeffrey Altman (1):
rxrpc: rxrpc_verify_data ensure rx_dec_buffer alloc
Li Daming (1):
rxrpc: serialize kernel accept preallocation with socket teardown
fs/afs/rxrpc.c | 6 ++++--
net/rxrpc/call_accept.c | 25 +++++++++++++++++++------
net/rxrpc/recvmsg.c | 13 +++++++------
net/rxrpc/rxgk.c | 3 ++-
4 files changed, 32 insertions(+), 15 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net 0/5] rxrpc: Miscellaneous fixes
2026-06-09 14:09 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
@ 2026-06-13 0:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 20+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-13 0:00 UTC (permalink / raw)
To: David Howells
Cc: netdev, marc.dionne, kuba, davem, edumazet, pabeni, horms,
linux-afs, linux-kernel
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 9 Jun 2026 15:09:04 +0100 you wrote:
> Here are some miscellaneous AF_RXRPC fixes:
>
> (1) Make sure rxrpc_verify_data() allocates a buffer, even if the DATA packet
> being looked at is zero length to avoid potential NULL-pointer
> exceptions.
>
> (2) Don't move an OOB message (e.g. an RxGK CHALLENGE) off the receive queue
> onto the pending queue in recvmsg() if MSG_PEEK is specified.
>
> [...]
Here is the summary with links:
- [net,1/5] rxrpc: rxrpc_verify_data ensure rx_dec_buffer alloc
https://git.kernel.org/netdev/net/c/16c8ae9735c5
- [net,2/5] rxrpc: Don't move a peeked OOB message onto the pending queue
https://git.kernel.org/netdev/net/c/5801cff7d5d7
- [net,3/5] rxrpc: Fix UAF in rxgk_issue_challenge()
https://git.kernel.org/netdev/net/c/107a4cb0d47e
- [net,4/5] afs: Fix netns teardown to cancel the preallocation charger
https://git.kernel.org/netdev/net/c/47694fbc9d24
- [net,5/5] rxrpc: serialize kernel accept preallocation with socket teardown
https://git.kernel.org/netdev/net/c/dc175389b18c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH net 0/5] rxrpc: Miscellaneous fixes
@ 2026-06-16 15:57 David Howells
2026-06-16 15:57 ` [PATCH net 1/5] rxrpc: input: reject ACKALL outside transmit phase David Howells
` (4 more replies)
0 siblings, 5 replies; 20+ messages in thread
From: David Howells @ 2026-06-16 15:57 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman, linux-afs, linux-kernel
Here are some miscellaneous AF_RXRPC fixes for more stuff found by Sashiko[1]:
(1) Reject ACKALL packets for calls not in Tx or immediate post-Tx state.
(2) Fix connection leak from AF_RXRPC recvmsg userspace OOB handling.
(3) Fix double unlock in AF_RXRPC recvmsg userspace OOB handling.
(4) Fix AFS preallocate charge to flush the waitqueue after unlistening
the socket so that any charging thread that does manage to get started
will be waited for before socket destruction.
(5) Fix AFS OOB notify handling to cancel in-progress OOB notification
handling and then to flush the workqueue it's on.
David
The patches can be found here also:
http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=rxrpc-fixes
[1] https://sashiko.dev/#/patchset/20260609140911.838677-1-dhowells%40redhat.com
David Howells (4):
rxrpc: Fix leak of connection from OOB challenge
rxrpc: Fix double unlock in rxrpc_recvmsg()
afs: Fix further netns teardown to cancel the preallocation charger
afs: Fix uncancelled rxrpc OOB message handler
Wyatt Feng (1):
rxrpc: input: reject ACKALL outside transmit phase
fs/afs/cm_security.c | 3 ++-
fs/afs/rxrpc.c | 5 ++++-
net/rxrpc/input.c | 16 +++++++++++++++-
net/rxrpc/oob.c | 5 +++++
net/rxrpc/recvmsg.c | 2 +-
5 files changed, 27 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH net 1/5] rxrpc: input: reject ACKALL outside transmit phase
2026-06-16 15:57 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
@ 2026-06-16 15:57 ` David Howells
2026-06-16 15:57 ` [PATCH net 2/5] rxrpc: Fix leak of connection from OOB challenge David Howells
` (3 subsequent siblings)
4 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2026-06-16 15:57 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman, linux-afs, linux-kernel,
Wyatt Feng, stable, Yuan Tan, Yifan Wu, Juefei Pu,
Zhengchuan Liang, Xin Liu, Ren Wei
From: Wyatt Feng <bronzed_45_vested@icloud.com>
rxrpc_input_ackall() accepts ACKALL packets without checking whether
the call is in a state that can legitimately have outstanding transmit
buffers. A forged ACKALL can therefore reach a new service call in
RXRPC_CALL_SERVER_RECV_REQUEST before any reply packets have been
queued.
In that state call->tx_top is zero and call->tx_queue is NULL, so
rxrpc_rotate_tx_window() dereferences a NULL txqueue and triggers a
null-pointer dereference.
Fix rxrpc_input_ackall() to mirror the transmit-state gating already
used for normal ACK processing, and ignore ACKALL when there is no
outstanding transmit window to rotate.
Fixes: b341a0263b1b ("rxrpc: Implement progressive transmission queue struct")
Cc: stable@vger.kernel.org
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Assisted-by: Codex:GPT-5.4
Signed-off-by: Wyatt Feng <bronzed_45_vested@icloud.com>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
---
net/rxrpc/input.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index ce761466b02d..37881dffa898 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -1214,8 +1214,22 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
static void rxrpc_input_ackall(struct rxrpc_call *call, struct sk_buff *skb)
{
struct rxrpc_ack_summary summary = { 0 };
+ rxrpc_seq_t top = READ_ONCE(call->tx_top);
+
+ switch (__rxrpc_call_state(call)) {
+ case RXRPC_CALL_CLIENT_SEND_REQUEST:
+ case RXRPC_CALL_CLIENT_AWAIT_REPLY:
+ case RXRPC_CALL_SERVER_SEND_REPLY:
+ case RXRPC_CALL_SERVER_AWAIT_ACK:
+ break;
+ default:
+ return;
+ }
+
+ if (call->tx_bottom == top)
+ return;
- if (rxrpc_rotate_tx_window(call, call->tx_top, &summary))
+ if (rxrpc_rotate_tx_window(call, top, &summary))
rxrpc_end_tx_phase(call, false, rxrpc_eproto_unexpected_ackall);
}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net 2/5] rxrpc: Fix leak of connection from OOB challenge
2026-06-16 15:57 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
2026-06-16 15:57 ` [PATCH net 1/5] rxrpc: input: reject ACKALL outside transmit phase David Howells
@ 2026-06-16 15:57 ` David Howells
2026-06-16 15:57 ` [PATCH net 3/5] rxrpc: Fix double unlock in rxrpc_recvmsg() David Howells
` (2 subsequent siblings)
4 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2026-06-16 15:57 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman, linux-afs, linux-kernel,
stable
Fix leak of connection object from OOB challenge queue when response is
provided by userspace.
Fixes: 5800b1cf3fd8 ("rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE")
Link: https://sashiko.dev/#/patchset/20260609140911.838677-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
---
net/rxrpc/oob.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/rxrpc/oob.c b/net/rxrpc/oob.c
index 05ca9c1faa57..3318c8bd82ad 100644
--- a/net/rxrpc/oob.c
+++ b/net/rxrpc/oob.c
@@ -210,6 +210,11 @@ static int rxrpc_respond_to_oob(struct rxrpc_sock *rx,
break;
}
+ switch (skb->mark) {
+ case RXRPC_OOB_CHALLENGE:
+ rxrpc_put_connection(sp->chall.conn, rxrpc_conn_put_oob);
+ break;
+ }
rxrpc_free_skb(skb, rxrpc_skb_put_oob);
return ret;
}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net 3/5] rxrpc: Fix double unlock in rxrpc_recvmsg()
2026-06-16 15:57 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
2026-06-16 15:57 ` [PATCH net 1/5] rxrpc: input: reject ACKALL outside transmit phase David Howells
2026-06-16 15:57 ` [PATCH net 2/5] rxrpc: Fix leak of connection from OOB challenge David Howells
@ 2026-06-16 15:57 ` David Howells
2026-06-16 15:57 ` [PATCH net 4/5] afs: Fix further netns teardown to cancel the preallocation charger David Howells
2026-06-16 15:57 ` [PATCH net 5/5] afs: Fix uncancelled rxrpc OOB message handler David Howells
4 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2026-06-16 15:57 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman, linux-afs, linux-kernel,
stable
Fix a double unlock in rxrpc_recvmsg() when dealing with OOB messages.
Fixes: 5800b1cf3fd8 ("rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE")
Link: https://sashiko.dev/#/patchset/20260609140911.838677-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
---
net/rxrpc/recvmsg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c
index 82614cbdb60f..39a03684432d 100644
--- a/net/rxrpc/recvmsg.c
+++ b/net/rxrpc/recvmsg.c
@@ -471,7 +471,7 @@ int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
release_sock(&rx->sk);
if (ret == -EAGAIN)
goto try_again;
- goto error_no_call;
+ goto error_trace;
}
/* Find the next call and dequeue it if we're not just peeking. If we
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net 4/5] afs: Fix further netns teardown to cancel the preallocation charger
2026-06-16 15:57 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
` (2 preceding siblings ...)
2026-06-16 15:57 ` [PATCH net 3/5] rxrpc: Fix double unlock in rxrpc_recvmsg() David Howells
@ 2026-06-16 15:57 ` David Howells
2026-06-16 15:57 ` [PATCH net 5/5] afs: Fix uncancelled rxrpc OOB message handler David Howells
4 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2026-06-16 15:57 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman, linux-afs, linux-kernel,
Li Daming, Ren Wei, Jeffrey Altman, stable
When an afs network namespace is torn down, it cancels and waits for the
work item that keeps the preallocated rxrpc call/conn/peer queue charged
before disabling incoming (i.e. listen 0), but there's a small window in
which it can be requeued by an incoming call wending through the I/O
thread.
Fix this by flushing the workqueue on which the charger runs after reducing
the listen backlog to zero.
Fixes: 47694fbc9d24 ("afs: Fix netns teardown to cancel the preallocation charger")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://sashiko.dev/#/patchset/20260609140911.838677-1-dhowells%40redhat.com
cc: Li Daming <d4n.for.sec@gmail.com>
cc: Ren Wei <n05ec@lzu.edu.cn>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
---
fs/afs/rxrpc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index d5cfd24e815b..fd2d260fb25f 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -130,6 +130,7 @@ void afs_close_socket(struct afs_net *net)
cancel_work_sync(&net->charge_preallocation_work);
kernel_listen(net->socket, 0);
flush_workqueue(afs_async_calls);
+ flush_workqueue(afs_wq);
if (net->spare_incoming_call) {
afs_put_call(net->spare_incoming_call);
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net 5/5] afs: Fix uncancelled rxrpc OOB message handler
2026-06-16 15:57 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
` (3 preceding siblings ...)
2026-06-16 15:57 ` [PATCH net 4/5] afs: Fix further netns teardown to cancel the preallocation charger David Howells
@ 2026-06-16 15:57 ` David Howells
4 siblings, 0 replies; 20+ messages in thread
From: David Howells @ 2026-06-16 15:57 UTC (permalink / raw)
To: netdev
Cc: David Howells, Marc Dionne, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman, linux-afs, linux-kernel,
Li Daming, Ren Wei, Jeffrey Altman, stable
Fix AFS to cancel its OOB message processing (typically to respond to
security challenges). Also move OOB message processing to afs_wq so that
it's also waited for and make the OOB handler just return if the net
namespace is no longer live.
Fixes: 5800b1cf3fd8 ("rxrpc: Allow CHALLENGEs to the passed to the app for a RESPONSE")
Link: https://sashiko.dev/#/patchset/20260609140911.838677-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Li Daming <d4n.for.sec@gmail.com>
cc: Ren Wei <n05ec@lzu.edu.cn>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
---
fs/afs/cm_security.c | 3 ++-
fs/afs/rxrpc.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/afs/cm_security.c b/fs/afs/cm_security.c
index edcbd249d202..103168c70dd4 100644
--- a/fs/afs/cm_security.c
+++ b/fs/afs/cm_security.c
@@ -101,7 +101,8 @@ void afs_process_oob_queue(struct work_struct *work)
struct sk_buff *oob;
enum rxrpc_oob_type type;
- while ((oob = rxrpc_kernel_dequeue_oob(net->socket, &type))) {
+ while (READ_ONCE(net->live) &&
+ (oob = rxrpc_kernel_dequeue_oob(net->socket, &type))) {
switch (type) {
case RXRPC_OOB_CHALLENGE:
afs_respond_to_challenge(oob);
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index fd2d260fb25f..6241f9349f6b 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -128,6 +128,7 @@ void afs_close_socket(struct afs_net *net)
_enter("");
cancel_work_sync(&net->charge_preallocation_work);
+ cancel_work_sync(&net->rx_oob_work);
kernel_listen(net->socket, 0);
flush_workqueue(afs_async_calls);
flush_workqueue(afs_wq);
@@ -985,5 +986,6 @@ static void afs_rx_notify_oob(struct sock *sk, struct sk_buff *oob)
{
struct afs_net *net = sk->sk_user_data;
- schedule_work(&net->rx_oob_work);
+ if (net->live)
+ queue_work(afs_wq, &net->rx_oob_work);
}
^ permalink raw reply related [flat|nested] 20+ messages in thread
end of thread, other threads:[~2026-06-16 15:58 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 15:57 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
2026-06-16 15:57 ` [PATCH net 1/5] rxrpc: input: reject ACKALL outside transmit phase David Howells
2026-06-16 15:57 ` [PATCH net 2/5] rxrpc: Fix leak of connection from OOB challenge David Howells
2026-06-16 15:57 ` [PATCH net 3/5] rxrpc: Fix double unlock in rxrpc_recvmsg() David Howells
2026-06-16 15:57 ` [PATCH net 4/5] afs: Fix further netns teardown to cancel the preallocation charger David Howells
2026-06-16 15:57 ` [PATCH net 5/5] afs: Fix uncancelled rxrpc OOB message handler David Howells
-- strict thread matches above, loose matches on Subject: below --
2026-06-09 14:09 [PATCH net 0/5] rxrpc: Miscellaneous fixes David Howells
2026-06-13 0:00 ` patchwork-bot+netdevbpf
2026-03-19 15:01 David Howells
2025-07-16 11:52 David Howells
2024-05-03 15:07 David Howells
2024-05-08 2:44 ` Jakub Kicinski
2024-05-08 7:57 ` Jeffrey Altman
2024-05-08 13:54 ` Jakub Kicinski
2024-05-08 14:00 ` David Howells
2024-05-08 15:07 ` Jakub Kicinski
2024-05-08 15:10 ` patchwork-bot+netdevbpf
2022-05-21 8:02 David Howells
2022-05-22 20:32 ` David Miller
2022-05-22 20:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox