[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251009173248.11881-1-bigalex934@gmail.com>
Date: Thu, 9 Oct 2025 20:32:49 +0300
From: Alexey Simakov <bigalex934@...il.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Cc: Alexey Simakov <bigalex934@...il.com>,
Xin Long <lucien.xin@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
linux-sctp@...r.kernel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: [PATCH] sctp: fix null derefer in sctp_sf_do_5_1D_ce()
The check of new_asoc->peer.adaptation_ind can fail,
leaving ai_ev unitilialized. In that case, the code
can jump to the nomem_authdev label and later call
sctp_ulpevent_free() with a null ai_ev pointer.
Leading to potential null dereference.
Add check of ai_ev pointer before call of
sctp_ulpevent_free function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 30f6ebf65bc4 ("sctp: add SCTP_AUTH_NO_AUTH type for AUTHENTICATION_EVENT")
Signed-off-by: Alexey Simakov <bigalex934@...il.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 a0524ba8d787..93cac73472c7 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -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:
--
2.34.1
I already have sent this patch from another email, but
he wasnt applicable since company mail server corrupt
it.
Powered by blists - more mailing lists