Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Xin Long
Thu, 12 Nov 2026 15:01
[PATCH net] sctp: validate SACK pull length against chunk length, not skb length
Author: Xin Long
Date: Thu, 12 Nov 2026 15:01
Date: Thu, 12 Nov 2026 15:01
40 lines
12247 bytes
12247 bytes
sctp_sm_pull_sack() derives its pull length from the num_gap_ack_blocks
and num_dup_tsns fields in the SACK body, but validates it against
chunk->skb->len (the remaining packet data) rather than the SACK chunk's
declared length. A malformed SACK with an inflated num_dup_tsns can pass
this check when subsequent chunks pad the skb, advancing skb->data past
the SACK boundary into later chunks.
This misaligns the skb cursor for subsequent chunk processing. When an
AUTH chunk follows, sctp_sf_authenticate() reads and compares the HMAC
digest from the wrong skb offset while sctp_auth_calculate_hmac() writes
the computed HMAC through the correct chunk_hdr pointer, bypassing the
authentication check.
Fix by validating the computed pull length against the chunk's declared
body length instead of the total remaining skb data.
Fixes: 730fc3d05cd4 ("[SCTP]: Implete SCTP-AUTH parameter processing")
Reported-by: on Sim <tlatkdgus1@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/sctp/sm_statefuns.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index b2f609f177fb..44b1770d43c1 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -6368,7 +6368,8 @@ static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk)
num_dup_tsns = ntohs(sack->num_dup_tsns);
len = sizeof(struct sctp_sackhdr);
len += (num_blocks + num_dup_tsns) * sizeof(__u32);
- if (len > chunk->skb->len)
+ if (len > ntohs(chunk->chunk_hdr->length) -
+ sizeof(struct sctp_chunkhdr))
return NULL;
skb_pull(chunk->skb, len);
--
2.47.1
Re: [PATCH net] sctp: validate SACK pull length against chunk length, not skb length
Author: patchwork-bot+netdevbpf
Date: Tue, 17 Nov 2026 00:20
Date: Tue, 17 Nov 2026 00:20
24 lines
8775 bytes
8775 bytes
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 12 Nov 2026 10:01:42 -0500 you wrote:
> sctp_sm_pull_sack() derives its pull length from the num_gap_ack_blocks
> and num_dup_tsns fields in the SACK body, but validates it against
> chunk->skb->len (the remaining packet data) rather than the SACK chunk's
> declared length. A malformed SACK with an inflated num_dup_tsns can pass
> this check when subsequent chunks pad the skb, advancing skb->data past
> the SACK boundary into later chunks.
>
> [...]
Here is the summary with links:
- [net] sctp: validate SACK pull length against chunk length, not skb length
https://git.kernel.org/netdev/net/c/533ec433efdc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads