Skip to content

Commit

Permalink
flow_dissector: Correctly handle parsing FCoE
Browse files Browse the repository at this point in the history
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 <aduyck@mirantis.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Feb 24, 2016
1 parent 43d2ccb commit 224516b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/core/flow_dissector.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,11 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
}

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;
}
Expand Down

0 comments on commit 224516b

Please sign in to comment.