Skip to content

Commit

Permalink
sctp: remove unreachable code from sctp_sf_violation_chunk()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
khoroshilov authored and davem330 committed Nov 7, 2021
1 parent 8ac9dfd commit e7ea51c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/sctp/sm_statefuns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit e7ea51c

Please sign in to comment.