Skip to content

Commit

Permalink
SCTP: Explicitely discard OOTB chunks
Browse files Browse the repository at this point in the history
Explicitely discard OOTB chunks, whether the result is a
SHUTDOWN COMPLETE or an ABORT.  We need to discard the OOTB
SHUTDOWN ACK to prevent bombing attackes since responsed
MUST NOT be bundled.  We also explicietely discard in the
ABORT case since that function is widely used internally.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Sep 26, 2007
1 parent 02c4e12 commit d3f2596
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions net/sctp/sm_statefuns.c
Original file line number Diff line number Diff line change
Expand Up @@ -2965,6 +2965,7 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep,

SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);

sctp_sf_pdiscard(ep, asoc, type, arg, commands);
return SCTP_DISPOSITION_CONSUME;
}

Expand Down Expand Up @@ -3148,11 +3149,9 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep,
} while (ch_end < skb_tail_pointer(skb));

if (ootb_shut_ack)
sctp_sf_shut_8_4_5(ep, asoc, type, arg, commands);
return sctp_sf_shut_8_4_5(ep, asoc, type, arg, commands);
else
sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);

return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
}

/*
Expand Down Expand Up @@ -3218,7 +3217,11 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep,
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);

return SCTP_DISPOSITION_CONSUME;
/* We need to discard the rest of the packet to prevent
* potential bomming attacks from additional bundled chunks.
* This is documented in SCTP Threats ID.
*/
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
}

return SCTP_DISPOSITION_NOMEM;
Expand Down

0 comments on commit d3f2596

Please sign in to comment.