From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B85AB2D73BD for ; Thu, 18 Jun 2026 13:48:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781790514; cv=none; b=LWvav2QP3gNogOFJotO0ul3iIooRsPHjelH7deplbWLh1bizCzgbkGiu/ZlJEfPwshToqmExfrchCu72K03jw7qgVmLgnVSy2+IosLoTxjtvaveD+K+UJmCj9TvWRO60LFj3p/OczBOQ8tHXxEb656JLl5nK/Wp7WeDrBHCH55E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781790514; c=relaxed/simple; bh=P1I+KWbK76llHaE2wH3T1Kgg++GDTr9b0M+6bQ/aXrk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iYBSXw8GwijxkA/zgO2+tdf7hcQhUKJGpLzlVNtt2RisVVdQ5RTp8U5r6hSX7p+ZfQlMOzYNFDtGxyfykgtxp7WQt/pyxlIu5EEyrh2Rrkb89ZE32Zf6hslVKJrrKTTTdN2XpJVfpLdO12T0jFbaE4WuHsgJbOhg47wWZlzgrXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=TNrRV/J6; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TNrRV/J6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781790510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vZ6shKU2Olrq5XLk9VR7nCy5qua26jmULBJsUITnQx4=; b=TNrRV/J6MqH0Xsv/w0iFOdl5PsHODMeJMjtfO6Vk19olcqjr5SiA6t9ocIsIqNWS16i78r hBakb3R8/+ZF2MHdqEVS5G0fdJ0anJVmv8DofA0N97eEsNZzHj2TqnEOj+7OO400eIna1G 9LhLK0ao3hd6o360wWuBQdsz92D0Vxo= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-6JVXqKUHMc2u0MXzeQltBQ-1; Thu, 18 Jun 2026 09:48:25 -0400 X-MC-Unique: 6JVXqKUHMc2u0MXzeQltBQ-1 X-Mimecast-MFC-AGG-ID: 6JVXqKUHMc2u0MXzeQltBQ_1781790503 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 925B5189F3BC; Thu, 18 Jun 2026 13:48:16 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.50.44]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D04D618001D2; Thu, 18 Jun 2026 13:48:10 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Wyatt Feng , stable@vger.kernel.org, Yuan Tan , Yifan Wu , Juefei Pu , Zhengchuan Liang , Xin Liu , Ren Wei Subject: [PATCH net v2 01/10] rxrpc: input: reject ACKALL outside transmit phase Date: Thu, 18 Jun 2026 14:47:52 +0100 Message-ID: <20260618134802.2477777-2-dhowells@redhat.com> In-Reply-To: <20260618134802.2477777-1-dhowells@redhat.com> References: <20260618134802.2477777-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 From: Wyatt Feng 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 Reported-by: Yifan Wu Reported-by: Juefei Pu Reported-by: Zhengchuan Liang Reported-by: Xin Liu Assisted-by: Codex:GPT-5.4 Signed-off-by: Wyatt Feng Signed-off-by: Ren Wei Signed-off-by: David Howells cc: Marc Dionne 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); }