sctp: Fix memory leak in sctp_sf_do_5_2_4_dupcook
Subsystems (3)
PATCH 1/1 sctp: Fix memory leak in sctp_sf_do_5_2_4_dupcook
In the implementation of sctp_sf_do_5_2_4_dupcook() the allocated new_asoc is leaked if security_sctp_assoc_request() fails. Release it via sctp_association_free().
Fixes 2277c7cd75e3 ("sctp: Add LSM hooks")
Signed-off-by Navid Emamdoost <[email protected]>
--- net/sctp/sm_statefuns.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/sctp/sm_statefuns.c +3 -1
@@ -2160,8 +2160,10 @@ enum sctp_disposition sctp_sf_do_5_2_4_dupcook(/* Update socket peer label if first association. */ if (security_sctp_assoc_request ((struct sctp_endpoint *)ep, - chunk->skb)) + chunk->skb)) { +sctp_association_free (new_asoc);return sctp_sf_pdiscard (net, ep, asoc, type, arg, commands); + }/* Set temp so that it won't be added into hashtable */ new_asoc->temp =1 ;
Signature · 1 line
2.17.1
Quoted 6 lines · Navid Emamdoost
In the implementation of
sctp_sf_do_5_2_4_dupcook()the allocatednew_asocis leaked ifsecurity_sctp_assoc_request()fails. Release it viasctp_association_free().Fixes 2277c7cd75e3 ("sctp: Add LSM hooks")Signed-off-by Navid Emamdoost <[email protected]>
Jakub Kicinski
AppliedQuoted 6 lines · Navid Emamdoost
In the implementation of
sctp_sf_do_5_2_4_dupcook()the allocatednew_asocis leaked ifsecurity_sctp_assoc_request()fails. Release it viasctp_association_free().Fixes 2277c7cd75e3 ("sctp: Add LSM hooks")Signed-off-by Navid Emamdoost <[email protected]>
Applied, queued for stable, thanks!