datapath: avoid memory corruption in queue_userspace_packet()
authorAndy Zhou <azhou@nicira.com>
Thu, 12 Jun 2014 20:19:25 +0000 (13:19 -0700)
committerAndy Zhou <azhou@nicira.com>
Fri, 13 Jun 2014 00:04:12 +0000 (17:04 -0700)
commit9a621f8274178f18d1ab8be7bc7db661c1f70104
tree3d304e1f1dc84ed275b1bd20b68cf88399cee735
parent6d8af7ab3b5240c8de411b25b15c94c2797ce068
datapath:  avoid memory corruption in queue_userspace_packet()

In queue_userspace_packet(), the ovs_nla_put_flow return value is
not checked. This is fine as long as key_attr_size() returns the
correct value. In case it does not, the current code may corrupt buffer
memory. Add a run time assertion catch this case to avoid silent
failure.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/datapath.c