From: netdev-bot+sashiko@kernel.org
To: bsdhenrymartin@gmail.com
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
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 [thread overview]
Message-ID: <179585217768.3135.9630756221208198819@kernel.org> (raw)
In-Reply-To: <20261127065017.2922776-1-bsdhenrymartin@gmail.com>
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
prev parent reply other threads:[~2026-11-28 7:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 6:50 [PATCH net] sctp: don't count pending-deleted addresses as survivors on bindx del Henry Martin
2026-11-28 7:49 ` netdev-bot+sashiko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179585217768.3135.9630756221208198819@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=bsdhenrymartin@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=vladislav.yasevich@hp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox