Skip to content

sctp: fail the association when the INIT-ACK cannot be processed

Kyuwon Cho linux-sctp lkml netdev 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest1 patch 0 repliesNew
  2. v21 patch 0 repliesSuperseded

Changes in v3 from the cover letter

- Pass the error to SCTP_CMD_INIT_FAILED with SCTP_PERR(), like the
other callers; SCTP_U16() made sparse warn about the __be16 value (netdev CI).
v2: https://lore.kernel.org/netdev/[email protected]/
- Process the INIT-ACK in sctp_sf_do_5_1C_ack() as Xin suggested,
instead of skipping AUTH in sctp_auth_send_cid(), and remove SCTP_CMD_PEER_INIT and SCTP_CMD_ASSOC_SHKEY.
v1: https://lore.kernel.org/netdev/[email protected]/

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1sctp: fail the association when the INIT-ACK cannot be processedinclude/net/sctp/command.h net/sctp/sm_sideeffect.c net/sctp/sm_statefuns.c+12 -470 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH net v3 0/1] sctp: fail the association when the INIT-ACK cannot be processed

When processing an INIT-ACK fails to allocate memory, the association stays AUTH capable with a NULL association key, and close() with SO_LINGER {1, 0} then takes a reference on that NULL key. As Xin suggested, the patch processes the INIT-ACK and sets up the key directly in sctp_sf_do_5_1C_ack() and fails the association if either step fails.

The issue was found by an LLM-guided test generator that we are developing as a research prototype.

v3:
- Pass the error to SCTP_CMD_INIT_FAILED with SCTP_PERR(), like the
other callers; SCTP_U16() made sparse warn about the __be16 value (netdev CI).
v2: https://lore.kernel.org/netdev/[email protected]/
- Process the INIT-ACK in sctp_sf_do_5_1C_ack() as Xin suggested,
instead of skipping AUTH in sctp_auth_send_cid(), and remove SCTP_CMD_PEER_INIT and SCTP_CMD_ASSOC_SHKEY.
v1: https://lore.kernel.org/netdev/[email protected]/

The patch was written with LLM assistance; we reviewed and tested it. With it, the reproducer from v1 no longer triggers the report.

Kyuwon Cho (1):
sctp: fail the association when the INIT-ACK cannot be processed

 include/net/sctp/command.h |  4 ----
 net/sctp/sm_sideeffect.c   | 40 --------------------------------------
 net/sctp/sm_statefuns.c    | 15 +++++++++++---
 3 files changed, 12 insertions(+), 47 deletions(-)
Signature · 1 line
2.43.0