* [PATCH] net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
@ 2025-10-02 9:14 Alexandr Sapozhnkiov
2025-10-02 19:27 ` Xin Long
2025-10-03 15:30 ` Markus Elfring
0 siblings, 2 replies; 4+ messages in thread
From: Alexandr Sapozhnkiov @ 2025-10-02 9:14 UTC (permalink / raw)
To: Marcelo Ricardo Leitner, Xin Long, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-sctp, netdev, linux-kernel
Cc: Alexandr Sapozhnikov, lvc-project
From: Alexandr Sapozhnikov <alsp705@gmail.com>
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.
Signed-off-by: Alexandr Sapozhnikov <alsp705@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 5adf0c0a6c1a..056544e1ca15 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.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
2025-10-02 9:14 [PATCH] net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce() Alexandr Sapozhnkiov
@ 2025-10-02 19:27 ` Xin Long
2025-10-03 15:36 ` Markus Elfring
2025-10-03 15:30 ` Markus Elfring
1 sibling, 1 reply; 4+ messages in thread
From: Xin Long @ 2025-10-02 19:27 UTC (permalink / raw)
To: Alexandr Sapozhnkiov
Cc: Marcelo Ricardo Leitner, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-sctp, netdev, linux-kernel,
lvc-project
On Thu, Oct 2, 2025 at 5:14 AM Alexandr Sapozhnkiov <alsp705@gmail.com> wrote:
>
> From: Alexandr Sapozhnikov <alsp705@gmail.com>
>
> 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.
>
> Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
Fixes: 30f6ebf65bc4 ("sctp: add SCTP_AUTH_NO_AUTH type for
AUTHENTICATION_EVENT")
Acked-by: Xin Long <lucien.xin@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
2025-10-02 9:14 [PATCH] net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce() Alexandr Sapozhnkiov
2025-10-02 19:27 ` Xin Long
@ 2025-10-03 15:30 ` Markus Elfring
1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2025-10-03 15:30 UTC (permalink / raw)
To: Alexandr Sapozhnikov, linux-sctp, netdev, lvc-project
Cc: LKML, David S. Miller, Eric Dumazet, Jakub Kicinski,
Marcelo Ricardo Leitner, Paolo Abeni, Xin Long
…
> 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.
…
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
2025-10-02 19:27 ` Xin Long
@ 2025-10-03 15:36 ` Markus Elfring
0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2025-10-03 15:36 UTC (permalink / raw)
To: Xin Long, Alexandr Sapozhnikov, linux-sctp, netdev, lvc-project
Cc: LKML, David S. Miller, Eric Dumazet, Jakub Kicinski,
Marcelo Ricardo Leitner, Paolo Abeni
…
> > 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.
…
> Fixes: 30f6ebf65bc4 ("sctp: add SCTP_AUTH_NO_AUTH type for
> AUTHENTICATION_EVENT")
…
See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17#n145
Regards,
Markus
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-03 15:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 9:14 [PATCH] net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce() Alexandr Sapozhnkiov
2025-10-02 19:27 ` Xin Long
2025-10-03 15:36 ` Markus Elfring
2025-10-03 15:30 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).