]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sctp: avoid NULL dereference when chunk data buffer is missing
authorAlexey Simakov <bigalex934@gmail.com>
Tue, 21 Oct 2025 13:00:36 +0000 (16:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:04:37 +0000 (14:04 +0100)
commit4f6da435fb5d8a21cbf8cae5ca5a2ba0e1012b71
treec3ebbcea950652d0d104016015d34975ec62d92b
parenteeed0eda9c939bef8b09f8090e860a3e2dcc5d9f
sctp: avoid NULL dereference when chunk data buffer is missing

[ Upstream commit 441f0647f7673e0e64d4910ef61a5fb8f16bfb82 ]

chunk->skb pointer is dereferenced in the if-block where it's supposed
to be NULL only.

chunk->skb can only be NULL if chunk->head_skb is not. Check for frag_list
instead and do it just before replacing chunk->skb. We're sure that
otherwise chunk->skb is non-NULL because of outer if() condition.

Fixes: 90017accff61 ("sctp: Add GSO support")
Signed-off-by: Alexey Simakov <bigalex934@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Link: https://patch.msgid.link/20251021130034.6333-1-bigalex934@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sctp/inqueue.c