From: Alexander Duyck Date: Wed, 24 Feb 2016 17:29:51 +0000 (-0800) Subject: flow_dissector: Correctly handle parsing FCoE X-Git-Tag: v4.9.8~2476^2~196^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=224516b3a798a0563346748744f8cd19feaf09be;p=platform%2Fkernel%2Flinux-rpi3.git flow_dissector: Correctly handle parsing FCoE The flow dissector bits handling FCoE didn't bother to actually validate that the space there was enough for the FCoE header. So we need to update things so that if there is room we add the header and report a good result, otherwise we do not add the header, and report the bad result. Signed-off-by: Alexander Duyck Acked-by: Tom Herbert Signed-off-by: David S. Miller --- diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 8bd745f..6288153 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -340,8 +340,11 @@ mpls: } case htons(ETH_P_FCOE): - key_control->thoff = (u16)(nhoff + FCOE_HEADER_LEN); - /* fall through */ + if ((hlen - nhoff) < FCOE_HEADER_LEN) + goto out_bad; + + nhoff += FCOE_HEADER_LEN; + goto out_good; default: goto out_bad; }