dpif-netdev: Initialize packet RSS hash in dpif_netdev_execute().
authorDaniele Di Proietto <diproiettod@vmware.com>
Wed, 18 May 2016 01:38:20 +0000 (18:38 -0700)
committerDaniele Di Proietto <diproiettod@vmware.com>
Fri, 20 May 2016 18:08:23 +0000 (11:08 -0700)
commit36d8de17ffe5406b26e3f5920374a363ea8bc82f
tree12c8e66e90cff2e20d06e9c49389dc1bd6da2fef
parent1cceb31bc14a15b04bfea3bc36424f8eefb9033a
dpif-netdev: Initialize packet RSS hash in dpif_netdev_execute().

The datapath code expects the RSS hash to always be initialized.  This
is enforced by checking in emc_processing() that the hash is valid, and
eventually by computing a new one.

Unfortunately, there is another entry point to the datapath,
dpif_netdev_execute().  A packet generated by OVS (BFD frame,
packet-out from controller) doesn't have a valid RSS hash and so is
allowed to enter the datapath with an uninitialized hash value.

This commit recomputes the hash (if not valid) in dpif_netdev_execute().

The only place where we would use an invalid hash is netdev-vport, in
push_udp_header().  This caused an uninitialized memory read, and a
random value to be assigned to the outer tunnel header source port.

Reported-by: William Tu <u9012063@gmail.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: William Tu <u9012063@gmail.com>
Acked-by: Ben Pfaff <blp@ovn.org>
lib/dpif-netdev.c