6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qing Luo [ Upstream commit 9ae7ed101cf28613071ebfbc42668c8917a670cf ] When processing AUTH + COOKIE-ECHO packets, if skb_clone() fails due to memory pressure, chunk->auth_chunk is NULL. The original code still sets chunk->auth = 1 and continues, leaving the COOKIE-ECHO to be processed without a valid auth_chunk for deferred verification. Discard the AUTH chunk early via pdiscard when skb_clone() fails, so that the receive loop can continue processing remaining chunks in the inqueue instead of stalling the entire packet. Signed-off-by: Qing Luo Acked-by: Xin Long Link: https://patch.msgid.link/20260723061107.384106-1-l1138897701@163.com Signed-off-by: Jakub Kicinski Signed-off-by: Harshvardhan Jha Signed-off-by: Harshit Mogalapalli Signed-off-by: Sasha Levin --- net/sctp/associola.c | 4 ++++ net/sctp/endpointola.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 0a19aea3b5246..9f90cf8f95988 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -1027,6 +1027,10 @@ static void sctp_assoc_bh_rcv(struct work_struct *work) if (next_hdr->type == SCTP_CID_COOKIE_ECHO) { chunk->auth_chunk = skb_clone(chunk->skb, GFP_ATOMIC); + if (!chunk->auth_chunk) { + chunk->pdiscard = 1; + continue; + } chunk->auth = 1; continue; } diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 7e77b450697c0..ffb7e722c9eae 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c @@ -367,6 +367,10 @@ static void sctp_endpoint_bh_rcv(struct work_struct *work) if (next_hdr->type == SCTP_CID_COOKIE_ECHO) { chunk->auth_chunk = skb_clone(chunk->skb, GFP_ATOMIC); + if (!chunk->auth_chunk) { + chunk->pdiscard = 1; + continue; + } chunk->auth = 1; continue; } -- 2.53.0