From: Andrew Stellman sctp_cmd_process_operr() reads the chunk type inside an Unrecognized Chunk cause without checking the cause length. A 4-byte cause passes sctp_walk_errors(), so the type byte is read from past the cause. In the case run, it comes from an ASCONF chunk bundled after the 8-byte ERROR chunk, and asconf_capable is cleared. Check that the cause holds a chunk header before reading its type. A short cause no longer disables ASCONF. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Andrew Stellman --- Tested only on net-next 19c484e12ed2 in arm64 QEMU with KASAN, with a debug print added and an injected ERROR chunk: asconf_capable changed from 1 to 0 without the fix and stayed 1 with it. Found with Quality Playbook (https://github.com/andrewstellman/quality-playbook) running Claude Opus 5; the fix was drafted with OpenAI GPT-6 (Codex). A reproducer is available on request. net/sctp/sm_sideeffect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 35f540fb15fc..e9c77577dc0c 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c @@ -997,6 +997,10 @@ static void sctp_cmd_process_operr(struct sctp_cmd_seq *cmds, { struct sctp_chunkhdr *unk_chunk_hdr; + if (ntohs(err_hdr->length) < + sizeof(*err_hdr) + sizeof(*unk_chunk_hdr)) + break; + unk_chunk_hdr = (struct sctp_chunkhdr *)(err_hdr + 1); switch (unk_chunk_hdr->type) { /* ADDIP 4.1 A9) If the peer responds to an ASCONF with -- 2.53.0