From: Marcelo Ricardo Leitner Date: Tue, 25 Oct 2016 16:27:39 +0000 (-0200) Subject: sctp: validate chunk len before actually using it X-Git-Tag: v3.2.85~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba43cdd87d0aaed69ef1bb14a91c3e767a4c210f;p=pandora-kernel.git sctp: validate chunk len before actually using it commit bf911e985d6bbaa328c20c3e05f4eb03de11fdd6 upstream. Andrey Konovalov reported that KASAN detected that SCTP was using a slab beyond the boundaries. It was caused because when handling out of the blue packets in function sctp_sf_ootb() it was checking the chunk len only after already processing the first chunk, validating only for the 2nd and subsequent ones. The fix is to just move the check upwards so it's also validated for the 1st chunk. Reported-by: Andrey Konovalov Tested-by: Andrey Konovalov Signed-off-by: Marcelo Ricardo Leitner Reviewed-by: Xin Long Acked-by: Neil Horman Signed-off-by: David S. Miller [bwh: Backported to 3.2: moved code is slightly different] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed