Article View: linux.kernel.netdev
Article #23814Re: [PATCH net] sctp: don't count pending-deleted addresses as survivors on bindx del
From: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 07:49
Date: Sat, 28 Nov 2026 07:49
180 lines
14347 bytes
14347 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 1 · Low: 1
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] The patch only partly closes the bug class it claims to fix.
- [Medium] The patch sends a second delete into the keep-last branch of
sctp_send_asconf_del_ip() (net/sctp/socket.c:863-896) while the first…
- [Low] Two comments no longer match the patched code: - The header
comment of sctp_find_unmatch_addr() (net/sctp/bind_addr.c:429-431)…
--
sctp: don't count pending-deleted addresses as survivors on bindx del
This patch makes sctp_find_unmatch_addr() skip entries that are already
marked SCTP_ADDR_DEL. Two bindx deletes in a row, with unacknowledged
ASCONFs, should then no longer be able to empty the association's bind
address list. When no undeleted survivor is left, the keep-last handling
in sctp_send_asconf_del_ip() is used instead.
> diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
> index 31737f144c7f0..e20006b9f12e4 100644
> --- a/net/sctp/bind_addr.c
> +++ b/net/sctp/bind_addr.c
> @@ -445,6 +445,12 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
> * can't change.
> */
> list_for_each_entry(laddr, &bp->address_list, list) {
> + /* An address already being deleted cannot serve as the
> + * one remaining address.
> + */
> + if (laddr->state == SCTP_ADDR_DEL)
> + continue;
[Severity: High]
Can the SCTP_ADDR_DEL mark be overwritten while its delete is still
queued?
The new check relies only on laddr->state. However,
sctp_asconf_param_success() sets the state back to SRC on a successful
ADD_IP ack, without checking the current state:
net/sctp/sm_make_chunk.c:sctp_asconf_param_success() {
...
case SCTP_PARAM_ADD_IP:
...
list_for_each_entry(saddr, &bp->address_list, list) {
if (sctp_cmp_addr_exact(&saddr->a, &addr))
saddr->state = SCTP_ADDR_SRC;
}
...
}
Take an association whose list is only A(SRC). The endpoint also holds a
third address D, which is needed to pass the endpoint-level check in
sctp_bindx_rem(). The reproducer in the commit message needs the same
thing.
bindx ADD B
B is SCTP_ADDR_NEW, ASCONF1 (ADD B) sent
bindx DEL B
sctp_find_unmatch_addr() returns A
ASCONF2 (DEL B) queued behind ASCONF1, B marked SCTP_ADDR_DEL
peer acks ASCONF1
sctp_asconf_param_success() sets B back to SCTP_ADDR_SRC
ASCONF2 sent, peer holds the ack
bindx DEL A
B is SRC, so the new check doesn't skip it; B returned as survivor
keep-last branch skipped, ASCONF3 (DEL A) queued, A marked DEL
peer acks ASCONF2 and ASCONF3
sctp_del_bind_addr() runs for B and A, asoc list is now empty
sctp_sf_do_asconf_ack() matches acks by serial number only.
The next bindx ADD then reaches sctp_send_asconf_add_ip(). It takes the
first entry without checking whether the list is empty:
net/sctp/socket.c:sctp_send_asconf_add_ip() {
...
bp = &asoc->base.bind_addr;
p = bp->address_list.next;
laddr = list_entry(p, struct sctp_sockaddr_entry, list);
chunk = sctp_make_asconf_update_ip(asoc, &laddr->a, addrs,
...
}
Wouldn't this hit the same NULL af dereference in sctp_make_asconf(), and
the same diag leak, that the commit message describes?
Could pending deletes be tracked in a way the ADD-ack path can't reset?
For example, sctp_asconf_param_success() could skip entries that are
SCTP_ADDR_DEL. Or the survivor check could look at the queued and
outstanding DEL params.
[Severity: Medium]
Is the keep-last branch really the same as the single-address case here?
With this change, a second delete issued while the first DEL ASCONF is
still outstanding goes into the keep-last branch of
sctp_send_asconf_del_ip(), which does:
asoc->src_out_of_asoc_ok = 1;
stored = 1;
goto skip_mkasconf;
sctp_process_asconf_ack() clears that flag on any error-free ack, even if
asconf_addr_del_pending is still set:
net/sctp/sm_make_chunk.c:sctp_process_asconf_ack() {
...
if (no_err && asoc->src_out_of_asoc_ok) {
asoc->src_out_of_asoc_ok = 0;
sctp_transport_immediate_rtx(asoc->peer.primary_path);
}
...
}
Take an association with [A(SRC), B(SRC)]:
bindx DEL A
ASCONF(DEL A) sent, A marked DEL
bindx DEL B
patched sctp_find_unmatch_addr() skips A, returns NULL
keep-last: pending = B, src_out_of_asoc_ok = 1, B marked DEL
peer acks DEL A, delayed only by normal RTT
A removed, pending B kept (no match), src_out_of_asoc_ok cleared
That leaves the association with [B(DEL)] and src_out_of_asoc_ok == 0.
sctp_v4_get_dst() then rejects every candidate source address, and the
IPv6 version does the same:
if (!laddr->valid || (laddr->state == SCTP_ADDR_DEL) ||
(laddr->state != SCTP_ADDR_SRC &&
!asoc->src_out_of_asoc_ok))
continue;
sctp_packet_transmit() drops packets when tp->dst is NULL.
Keep-last relies on a later bindx ADD C to recover, by sending
ASCONF(ADD C, DEL B). That ASCONF doesn't look like it can be sent
either:
- C is SCTP_ADDR_NEW, so it can't be a source address without
src_out_of_asoc_ok.
- The transport reset block in sctp_send_asconf_add_ip() runs only when
asoc->src_out_of_asoc_ok is set, so it is skipped.
Can the association do anything other than stall until the
retransmission limits abort it?
The clear-on-any-ack logic is older than this patch. Still, the commit
message's "same as it already does for a single-address delete" relies on
it.
[Severity: Low]
This isn't a bug, but the header comment of sctp_find_unmatch_addr() still
says:
/* Find the first address in the bind address list that is not present in
* the addrs packed array.
*/
With this change the function also skips SCTP_ADDR_DEL entries. It can
return NULL even when an unmatched address exists.
Should this comment be updated? The same applies to the "Find one address
in the association's bind address list that is not in the packed array of
addresses" comment in sctp_send_asconf_del_ip().
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261127065017.2922776-1-bsdhenrymartin%40gmail.com
Technical Details
Message-ID:
<179585217768.3135.9630756221208198819@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373048-linux-kernel-netdev=dewy.ruReferences:
<20261127065017.2922776-1-bsdhenrymartin@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373048-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] sctp: don't count pending-deleted addresses as survivors on bindx del Date: Sat, 28 Nov 2026 07:49:37 +0000 Organization: Usenet Network Message-ID: <179585217768.3135.9630756221208198819@kernel.org> References: <20261127065017.2922776-1-bsdhenrymartin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="907344"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:p7fbiVWYLXGqM93ZTbirfzYo5EA= sha256:qUSXsJMtFk4YLqt7XEyd/Y2pMqzmeYFJQcaCgfh7x/c= sha1:l7q5TKbp1bHtMaiV08/1OYbc9dY= sha256:v8rDpv8aQPSiUKJckudP40iZG0sZH9l6IlhXGdrgqu0= 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 D9ABC125F6F; Sat, 28 Nov 2026 10:50:05 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.5 X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, 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, URIBL_BLOCKED=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 OErsXWw0OzTx; Sat, 28 Nov 2026 10:49:58 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-373048-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 2A379125F6D; Sat, 28 Nov 2026 10:49:48 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id DFA81602328; Sat, 28 Nov 2026 07:49:47 +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=1795852185; b=EZRPmVFLm/oqQON4N3HqRgP8YC13srqNO8IerzzcUs+HFtxeKU4FPmG9KBvyDamsQ7Em SFU3IBitjaQy2bJXENp4JE39h0ioTmPsbo4HwAhaeAMr3Ucp5MEsVC0uzzqsDi90QZrSP ieC3dxg3YcvpjNuQgm1aboTFBVqTb1RgTGm8hJUVLqgn52I62UaLwEIi31eR2F+uaWJqX OqwLNhuQhZ8xMqfPZnxSh6bhKDL+z1ro2/ceC8qlDXSf4XdX83DMtE/alYOBcuG27xALA VQEnh9pK42UqQteG6lsTjGY4/d7p7l6KSjTvjOO8QjHzN+Du81bybZFfykJ68Ud8VdQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795852185; 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=Y2CkVKlJv9q8tIcTk64or8wHGvQhFgWI4FBCczrgvuk=; b=Kv54MP3T5JkjkFXnorOTscdBfrdy1poA5gE5fDtDLA6bvRFmnTxUGemSLhwMz+T9kCi6 nM8mbM+PgMub18NlCQ2uEkj91YF1y2nm0f1OhR+pXjRdCsWniHRYvxIjowUFnJ8kFTOP3 /YxmnvCMp2E/fo1KVc24idAU79pNNkn1bpTzeaFDPCwhPDMmX32wur2MNH6SgJdJYBgpu YBR8TT+M0Zhj+Bey4MXDOeLe1RyZD2AAlWaPTJ4ASmQxOrUO6LOfOSVKyIxPsEERfGvXj JfnPpx7pCDCwCd/QuxX9Gm9NHeKwQtso+q8Izu0A7w+N2QTkfmOGEEwjbGL5ir+GJ0g== 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=I0vOHecQ; 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 132FD606A329; Sat, 28 Nov 2026 07:49:45 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I0vOHecQ 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=1795852179; b=5bnsBUjeS1nFcLf2scyDRzknthNqQ0uJUqlw8qQ90NVyY4O8/N5DivOVANbUGavYqgsv MMLnHKm/vM2nI4uAoxJBgkamrmioOCKX/srcBXmfMX3bBOm30sJZbxGcAHZLVlYdIXIuf x91x3VlETMO2nQc12jYKLwk9IgnuWhUici8T3cqeh1DpACoS9AVxARAtUuLX1PsRBYy8+ wwJPKrVfKHYHOUkrahVl2N0ES76W6qI1PeyianepOeHINY0HLiuBkUyp2Xw8cMySrlgdH TfaZ3VFvMiWvNTU/HYwBudVj8R+/tWfI6TpzBXQHkmuDrH8NNBn+CUeNt7RbKhxRdCw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795852179; 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=Y2CkVKlJv9q8tIcTk64or8wHGvQhFgWI4FBCczrgvuk=; b=KZ5PQ3ZJKGyIp76HYIcmIZFLAC/82u7A7eksE/kn7IIor4jM//2sXJMHscvX94eZZ370 T5SV/Y3Bv0JIItE/eIiTOCF45hxi77L/hDl/Oq+r51grPRp0qxmeOBsK7h+bietFs7bYU Vc08ZXOn90l3/+xO1KUdIzx4dO0HBKPMsDHFyqOCslSUgBct3zZygRZu9WXdrqY/oXwoW DV41pUkZOr/W+FzUGFIWXmLGJmubOEVb+zySEaUTCyygIh18054816HFyTzEtE3Qw7/a+ CTIFNfmyknUHSrlMEfHoY85sABe3yNTdS3S9PM7LFuYzGU4yRlKe7yQUA+jlJl0CL6w== 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=I0vOHecQ; 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 298E5606A31F; Sat, 28 Nov 2026 07:49:38 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 268751F00893; Sat, 28 Nov 2026 07:49:38 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795852178; bh=Y2CkVKlJv9q8tIcTk64or8wHGvQhFgWI4FBCczrgvuk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=I0vOHecQV/wHc5kazkWzvIkJy1qsJ4shaHWLmvJKjTL7VYHJYfkc+dv5XMexB9ZFz oJbZ9/F03jrJBIdwmc+KjAnT29rJ2L86YGtYNzcV4iM9zc18uKJQC3HnJdgrF7u6b2 YcdsiwlgIg37hLa9Z6Km7aFnEc3fb6/TXP/D/QWctoP7ip5B1I7ofT33oV40Q1clGL m3UCOWuHzfdieEBcbgWrZ87z8K26ELNhT0M84XbrHljPNa2UX/LdF9ViGZa3TWERJ3 F6cGt8E4mFxxtgcohgxNBE7TQCB+PshRzNDkl4TSho76xf+puWoVzTLVGG1hI3AgFD jzIP+vLd3l9HA== X-Cc: lucien.xin@gmail.com, marcelo.leitner@gmail.com, vladislav.yasevich@hp.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, stable@vger.kernel.org X-In-Reply-To: <20261127065017.2922776-1-bsdhenrymartin@gmail.com> 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