From: Alexey Khoroshilov Date: Fri, 5 Nov 2021 17:30:27 +0000 (+0300) Subject: sctp: remove unreachable code from sctp_sf_violation_chunk() X-Git-Tag: howlett/maple/20220722_2~1851^2~29 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e7ea51cd879c8214a824717d28a169b5f2262c02;p=users%2Fjedix%2Flinux-maple.git sctp: remove unreachable code from sctp_sf_violation_chunk() sctp_sf_violation_chunk() is not called with asoc argument equal to NULL, but if that happens it would lead to NULL pointer dereference in sctp_vtag_verify(). The patch removes code that handles NULL asoc in sctp_sf_violation_chunk(). Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexey Khoroshilov Proposed-by: Xin Long Signed-off-by: David S. Miller --- diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 5fabaa54b77d..39ba82ee87ce 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -4898,9 +4898,6 @@ static enum sctp_disposition sctp_sf_violation_chunk( { static const char err_str[] = "The following chunk violates protocol:"; - if (!asoc) - return sctp_sf_violation(net, ep, asoc, type, arg, commands); - return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, sizeof(err_str)); }