Article View: linux.kernel.netdev
Article #5693Re: [PATCH net v10 3/3] rxrpc: bound DATA receive queues
From: netdev-bot+sashiko
Date: Tue, 20 Oct 2026 20:21
Date: Tue, 20 Oct 2026 20:21
186 lines
14689 bytes
14689 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 2 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] rxrpc_input_data_one() (net/rxrpc/input.c:556) now charges every
accepted DATA skb, from every call on a local endpoint, to one…
- [High] Out-of-sequence DATA can deadlock a call.
- [Medium] When a call completes, the DATA skbs on call->rx_oos_queue
keep their charge against the shared per-local budget until…
--
rxrpc: bound DATA receive queues
This patch charges accepted DATA skbs, including split jumbo subpackets,
to the per-local asynchronous receive budget (local->rx_async_queue_bytes).
The charge is released when recvmsg consumes the packets or when they are
purged. The per-call receive window limit is now based on rx_consumed
instead of ackr_window.
Link: https://lore.kernel.org/all/cover.1791994057.git.zihanx@nebusec.ai/
> diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
> index 21be9c86d7a74..9360852604645 100644
> --- a/net/rxrpc/call_event.c
> +++ b/net/rxrpc/call_event.c
> @@ -473,6 +473,7 @@ bool rxrpc_input_call_event(struct rxrpc_call *call)
> out:
> if (__rxrpc_call_is_complete(call)) {
> timer_delete_sync(&call->timer);
> + rxrpc_purge_queue(&call->rx_queue);
[Severity: Medium]
Should this purge rx_oos_queue instead of rx_queue?
Nothing on call->rx_queue is charged, and rxrpc_purge_queue() only
uncharges RXRPC_SKB_MARK_SERVICE_CONN_SECURED skbs.
The DATA skbs on call->rx_oos_queue were charged in rxrpc_input_data_one().
Once the call is complete they can never be delivered, because
rxrpc_input_data() returns early for completed calls.
Those charges are only released in
rxrpc_destroy_call()->rxrpc_cleanup_rx_buffers():
rxrpc_purge_data_queue(call, &call->rx_oos_queue);
Suppose a peer fills rx_oos_queue and then aborts the call. Does the charge
stay held against the shared local budget until the application reads the
termination and releases the call, or until a kernel user drops its last
reference?
Only the I/O thread and the destroy path touch rx_oos_queue, so it looks
safe to purge it here with rxrpc_purge_data_queue().
> if (!test_bit(RXRPC_CALL_DISCONNECTED, &call->flags))
> rxrpc_disconnect_call(call);
[ ... ]
> diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
> index 73cafe6bfa9f5..6f0ba50097390 100644
> --- a/net/rxrpc/input.c
> +++ b/net/rxrpc/input.c
[ ... ]
> @@ -511,17 +531,33 @@ static void rxrpc_input_data_one(struct rxrpc_call *call, struct sk_buff *skb,
[ ... ]
> + sp->data.charge = NULL;
> + if (sp->offset != sizeof(struct rxrpc_wire_header) ||
> + (sp->hdr.flags & RXRPC_JUMBO_PACKET)) {
> + if (!*_charge)
> + *_charge = rxrpc_alloc_async_queue_charge(skb);
> + sp->data.charge = *_charge;
> + }
> + if (!rxrpc_charge_async_queue(call->local, skb)) {
> + sp->data.charge = NULL;
> + if (set_last)
> + clear_bit(RXRPC_CALL_RX_LAST, &call->flags);
> + ack_reason = RXRPC_ACK_NOSPACE;
> goto send_ack;
> }
[Severity: High]
Can one call use up the receive budget for the whole local endpoint here?
Every accepted DATA skb from every call on the rxrpc_local is now charged
to local->rx_async_queue_bytes. rxrpc_charge_async_queue_bytes() caps that
counter at the UDP socket's sk_rcvbuf:
net/rxrpc/skbuff.c:rxrpc_charge_async_queue_bytes() {
...
if (queued &&
(queued >= rcvbuf || size >= rcvbuf - queued)) {
sk_drops_inc(sk);
return false;
}
...
}
rxrpc_adjust_rcvbuf() sizes sk_rcvbuf for about one call's window and
clamps it to sysctl_rmem_max (212992 by default). That is room for about
90-100 normal DATA skbs across the whole endpoint.
Meanwhile rxrpc_fill_out_ack() still advertises up to rx_winsize (255)
packets to each peer:
net/rxrpc/output.c:rxrpc_fill_out_ack() {
...
qsize = (window - 1) - call->rx_consumed;
rsize = max_t(int, call->rx_winsize - qsize, 0);
...
}
The charge is released only when the application reads the data, in
rxrpc_rotate_rx_window(), or when the call is destroyed.
A remote peer could open a call to a listening service, for example kafs on
AFS_CM_PORT using its shared socket. It sends seq 1, then seq 3..N, and
never seq 2. Each of those packets is charged and queued on rx_oos_queue,
all within wlimit.
No authentication seems to be needed, since DATA is queued even while the
connection is still challenging. Each packet also refreshes expect_req_by,
so the call stays alive. A slow reader on a single call could have the same
effect.
Once the budget is full, would every other call on the endpoint get
RXRPC_ACK_NOSPACE drops?
The same counter also gates CHALLENGE/RESPONSE posting in
rxrpc_post_packet_to_conn() and OOB CHALLENGE delivery. Would connection
security setup for unrelated connections fail as well?
Before this patch DATA wasn't charged, so other calls couldn't be starved
this way. Does this need a per-call or per-peer split of the budget, or a
reserved portion? The commit message also doesn't mention that calls now
share this limit.
[Severity: High]
Can ordinary packet loss livelock a call through this check?
The charge is applied before the seq == window test. The packet that would
fill the hole therefore goes through the same budget check as
out-of-sequence packets, with no exemption or reserved space.
With the defaults, rxrpc_rx_window_size is 255 and the budget is clamped to
rmem_max, roughly 90-100 skbs at a typical truesize. A Linux sender can
have up to RXRPC_TX_MAX_WINDOW (128) packets in flight.
Suppose the packet at seq == window is lost early in a large flight. The
packets after it are charged and queued on rx_oos_queue until the budget is
nearly full.
Every retransmission of the missing packet would then fail here and be
dropped with RXRPC_ACK_NOSPACE. The OOS packets move to recvmsg_queue only
after the hole is filled:
while ((oos = skb_peek(&call->rx_oos_queue))) {
rxrpc_recvmsg_data() only reads recvmsg_queue, so the application can't
release anything either.
Does anything break this cycle other than call destruction? The
retransmissions keep refreshing the call timers. The call could then stall
indefinitely while holding the shared budget, which also starves the other
calls on the same rxrpc_local.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1792168462.git.zihanx%40nebusec.ai
Technical Details
Message-ID:
<179252767364.3135.10345050454011895644@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349547-linux-kernel-netdev=dewy.ruReferences:
<d74b9bee555058bd56e884f9ef0dab5fb9ccedcf.1792174935.git.zihanx@nebusec.ai>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349547-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v10 3/3] rxrpc: bound DATA receive queues Date: Tue, 20 Oct 2026 20:21:13 +0000 Organization: Usenet Network Message-ID: <179252767364.3135.10345050454011895644@kernel.org> References: <d74b9bee555058bd56e884f9ef0dab5fb9ccedcf.1792174935.git.zihanx@nebusec.ai> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3949868"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:OS10ICJ7+PNNhcNPqiRfXGApXWQ= sha256:+fyv/6YoD5it2+vSaN4kMsD0qTKqBvI8+lGh42sIgKM= sha1:CzJ+FHsmJL9X1w4cfLdlUy1rnRk= sha256:C79G3jBMEfYiiXDO/QeY8HWU41t+SqgYjNcbM65261c= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 300AF110E32; Tue, 20 Oct 2026 23:25:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.729 X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yQlRvUFFKKt9; Tue, 20 Oct 2026 23:25:50 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-349547-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 17D43110E18; Tue, 20 Oct 2026 23:25:41 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 1C2922DDB6; Tue, 20 Oct 2026 20:21:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792527676; b=cKz4L53KfrL9dGbyXWRpy44Pm44TP5/nUrJuhScqvRj/OOaW9kicqxUkNMDpBLvDfGTa jsuu0uE0BDvlnHQMvs1I5LXW5W9yHLqJvVoNR4fDCHE7X7EPOuUy3whmsP3UDDNiM6Wfy nrASLxnB7koUWydEa95t2ZSaBmU1ghjK9JAMxsIbzy2f29XAFC4hSBk+uuDFfRy2A1uR2 VtsINHz8ZYiDTd+xkCoVKiNilNXR4CuULSouKqAGcQXAwwqd4tMjDjSXxEM/O2NMgi0n9 dbeE4IAotgpqawfSzqUqEeNc2b9wXn4hxkrh8yF/BTN1rD2zo+ur9g1K5ukCYRLZ4FQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792527676; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=PIk/27vrC8tFZSqMzqtn6yu+JCHiDh7H3FxEkoyebTU=; b=3t5D1Iooe0YUJ9BRKu3XmhO0HKeIgRTgNxyK5dCwQ6cf3d979kQfv+Mdb7cOWKJl5sGo 8e2JpQ+yrB3WyYc4STrlGdp+k0J+fxgULieMjYg1QIXMMdrDFRmpCCgU/szyuJr5TjFUQ lewPJLwnm5aVXZSC+DL7X4C0/i/w8dxM9cFJTnkoGky1Bto+0vLpUt9JF4ocd5NmaM7Ha wRS7A05BUnmC9CvPdqme++9MGwyMf3VFvPvf6N78ebATL2ZyQr1z2HCPbeeRFws8dpJjZ ++YUQooE2RdSNyYUZlKgmn7sdi4BTxFdfNQQxXj739rC9I4Esm2bg9dH+hREUW/NiHQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DA9bTy85; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E234606A329; Tue, 20 Oct 2026 20:21:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DA9bTy85 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792527675; b=AtFhCM506mkBPm+5ShnIBI28DhOukScW/zCRFmGecVnVcFHWmj9vUjJwQ0OGr+1IhlX7 r8N/Vn/eMI33AtL3V2jfCS6wEugv5j2o1FOOouzJxJ2lPFc7BUO4oBn4hy5MAtOVDIoOo qRDlpGLkeAMZyUKkoknh5pGdXT00G6Kw3kUm/falrw/ESqPSJhpW23XP41I13zfqKWhKw XmKm1lrWudXzk32yiyAnLQE3MLhm6QWB33DOQeWir03GhzKOy8dP+npfwsMBTIO5bNlsD vATpAg7+LUMQtRNHnK+unOvM0LI9LcE7Omn1nfmB0skEKdlf1qgR62MwJle8z2nnoVg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792527675; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=PIk/27vrC8tFZSqMzqtn6yu+JCHiDh7H3FxEkoyebTU=; b=E+4fGIoPMkmC6MRYmC5cI95GrJ4td+G+sKhQNrRw+X6xF/ZRgnG0bdj1XjNK9MQkXZY0 GC/vqum/YvLjVAuq1bc0RmYjaR/+tgmOSfRQl38HL9lKSVi2/FHZmL9nb9PhCBDxynW3i Na5bYyf/8kmYH1s34KcY46Oa9pTx5OAU7t5dj3G8lJd12XFRnLTy8l6zqhf9e9m4+13qU 259rw7npm4enfIVIP0+0q6I3x2sVtBe2jsnraMKH1ZVQR7tGgiQqjc68PfIm9Ri9PSwV3 JTnMg8nYkQRxUgJ0Amwdw4jWEegOs/r2/VQ2yx3v2SaJorDU7JAYyJQD/gk3Y9QL7lA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DA9bTy85; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A519606A321 for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 20:21:14 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D2651F000CA; Tue, 20 Oct 2026 20:21:14 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792527674; bh=PIk/27vrC8tFZSqMzqtn6yu+JCHiDh7H3FxEkoyebTU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=DA9bTy85VE4Uov8Lg16+ABaJLU4vJhOrylsiR282w4y13e3xkq1lMXpgHqV+QWCND Nxk6DXJeAyX7zezhXG7wI2Z+Vyz3GYvJFZox/v2k9yQjuiQt+yrRnREdZPKWipgG5f 20muVJ9XGRUQqtamCICzc2hxAI0UDtJkH/6oHfEUVj5JEA32hJbnAnc/MJL/069+CS LltA1cc7xMzfHRQAmEUPxLw3wegrhlfDMa7Asgthuv4izmLM5jelDZxyj829dHYS3v Ze5JiZv96G2unA0Zla6wW5pfpJHWxV25C//CzBOmzAQQbtkaAB90EEFRRmaO5XR2sz JKQ2tc+iCsduQ== X-Cc: linux-afs@lists.infradead.org, netdev@vger.kernel.org, dhowells@redhat.com, marc.dionne@auristor.com, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org, vega@nebusec.ai, root@tr0jan.top, kuba@kernel.org X-In-Reply-To: <d74b9bee555058bd56e884f9ef0dab5fb9ccedcf.1792174935.git.zihanx@nebusec.ai> X-sashiko-severity: High X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list