summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAlexandr Sapozhnikov <alsp705@gmail.com>2025-10-02 12:14:47 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-29 13:59:51 +0100
commit1014b83778c8677f1d7a57c26dc728baa801ac62 (patch)
tree7aae5a83703e2ef242240d1645a8d9f5fe2e515c /net
parent1822e5287b7dfa59d0af966756ebf1dc652b60ee (diff)
downloadlinux-1014b83778c8677f1d7a57c26dc728baa801ac62.tar.gz
linux-1014b83778c8677f1d7a57c26dc728baa801ac62.tar.bz2
linux-1014b83778c8677f1d7a57c26dc728baa801ac62.zip
net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
[ Upstream commit 2f3119686ef50319490ccaec81a575973da98815 ] 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. Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com> Acked-by: Xin Long <lucien.xin@gmail.com> Fixes: 30f6ebf65bc4 ("sctp: add SCTP_AUTH_NO_AUTH type for AUTHENTICATION_EVENT") Link: https://patch.msgid.link/20251002091448.11-1-alsp705@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/sm_statefuns.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 6b613569372a..9c714a6c9307 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -873,7 +873,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: