diff options
author | Joel Stanley <joel@jms.id.au> | 2016-11-21 02:38:38 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2016-11-21 02:38:47 +0300 |
commit | c55cf1296a0429d91b940a49a59977617a4e4cb3 (patch) | |
tree | 11d7ae008a0ad5bfe4110966b6df7c44cff723fd /net/sctp/sm_statefuns.c | |
parent | 5509e6ee766f6b910c3b81c02bae291fc1d9a806 (diff) | |
parent | 86429bd405de5741df4127096deae0b1d90b68f1 (diff) | |
download | linux-dev-4.4.tar.xz |
Merge tag 'v4.4.33' into dev-4.4openbmc-4.4-20161121-1dev-4.4
This is the 4.4.33 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 22c2bf367d7e..29c7c43de108 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -3426,6 +3426,12 @@ sctp_disposition_t sctp_sf_ootb(struct net *net, return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, commands); + /* Report violation if chunk len overflows */ + ch_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); + if (ch_end > skb_tail_pointer(skb)) + return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, + commands); + /* Now that we know we at least have a chunk header, * do things that are type appropriate. */ @@ -3457,12 +3463,6 @@ sctp_disposition_t sctp_sf_ootb(struct net *net, } } - /* Report violation if chunk len overflows */ - ch_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); - if (ch_end > skb_tail_pointer(skb)) - return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, - commands); - ch = (sctp_chunkhdr_t *) ch_end; } while (ch_end < skb_tail_pointer(skb)); |