net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
Subsystems (3)
PATCH 1/1 net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
From: Alexandr Sapozhnikov <[email protected]>
If new_asoc->peer.adaptation_ind=0 and sctp_ulpevent_make_authkey=0 and sctp_ulpevent_make_authkey() returns 0, then the variable ai_ev remains zero and the zero will be dereferenced
in the sctp_ulpevent_free() function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- net/sctp/sm_statefuns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sctp/sm_statefuns.c +2 -1
@@ -885,7 +885,8 @@ enum sctp_disposition sctp_sf_do_5_1D_ce(struct net *net,return SCTP_DISPOSITION_CONSUME ; nomem_authev: -sctp_ulpevent_free (ai_ev); +if (ai_ev) +sctp_ulpevent_free (ai_ev); nomem_aiev:sctp_ulpevent_free (ev); nomem_ev:
Signature · 1 line
2.43.0
Quoted 11 lines · Alexandr Sapozhnkiov
From: Alexandr Sapozhnikov <[email protected]>
If new_asoc->peer.adaptation_ind=0 and sctp_ulpevent_make_authkey=0 and
sctp_ulpevent_make_authkey()returns 0, then the variableai_evremains zero and the zero will be dereferenced
in thesctp_ulpevent_free()function.Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexandr Sapozhnikov <[email protected]>
AUTHENTICATION_EVENT")
…
Quoted 3 lines
Quoted 3 lines
and
sctp_ulpevent_make_authkey()returns 0, then the variableai_evremains zero and the zero will be dereferenced in thesctp_ulpevent_free()function.
…
Quoted 2 lines
Fixes 30f6ebf65bc4 ("sctp: add SCTP_AUTH_NO_AUTH type for
AUTHENTICATION_EVENT")
…
Regards,
Markus
…
Quoted 3 lines
and
sctp_ulpevent_make_authkey()returns 0, then the variableai_evremains zero and the zero will be dereferenced in thesctp_ulpevent_free()function.
…
Would a corresponding imperative wording become helpful for an improved change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17#n94
Regards,
Markus
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 2 Oct 2025 12:14:47 +0300 you wrote:
From: Alexandr Sapozhnikov <[email protected]>
If new_asoc->peer.adaptation_ind=0 and sctp_ulpevent_make_authkey=0 and
sctp_ulpevent_make_authkey()returns 0, then the variableai_evremains zero and the zero will be dereferenced
in thesctp_ulpevent_free()function.[...]
Here is the summary with links:
- net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
https://git.kernel.org/netdev/net/c/2f3119686ef5
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html