flow: Add length check when retrieving TCP flags.
authorJesse Gross <jesse@nicira.com>
Fri, 23 Mar 2012 20:14:51 +0000 (13:14 -0700)
committerJesse Gross <jesse@nicira.com>
Sat, 24 Mar 2012 00:15:58 +0000 (17:15 -0700)
commit73eb8208354d560bee34195193801329fb6f7339
tree67edc87540d27501eb31a3cfb97f2a02858f488d
parent5708fd1fc09fb2b23ce12ef7c94e579715c23c02
flow: Add length check when retrieving TCP flags.

When collecting TCP flags we check that the IP header indicates that
a TCP header is present but not that the packet is actually long
enough to contain the header.  This adds a check to prevent reading
off the end of the packet.

In practice, this is only likely to result in reading of bad data and
not a crash due to the presence of struct skb_shared_info at the end
of the packet.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/flow.c
lib/dpif-netdev.c