]> Git Repo - linux.git/commitdiff
sctp: remove unreachable code from sctp_sf_violation_chunk()
authorAlexey Khoroshilov <[email protected]>
Fri, 5 Nov 2021 17:30:27 +0000 (20:30 +0300)
committerDavid S. Miller <[email protected]>
Sun, 7 Nov 2021 19:32:39 +0000 (19:32 +0000)
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 <[email protected]>
Proposed-by: Xin Long <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/sctp/sm_statefuns.c

index 5fabaa54b77d8ec8ae25cc08f220d608eab23a04..39ba82ee87cec1daf48b231815e125dff35a5c34 100644 (file)
@@ -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));
 }
This page took 0.05267 seconds and 4 git commands to generate.