]> git.proxmox.com Git - mirror_ovs.git/commit
system-traffic: Check frozen state handling with TLV map change
authorYifeng Sun <pkusunyifeng@gmail.com>
Thu, 9 Apr 2020 18:37:39 +0000 (11:37 -0700)
committerWilliam Tu <u9012063@gmail.com>
Fri, 10 Apr 2020 15:20:45 +0000 (08:20 -0700)
commit134e6831acca48f10df3d59b8e1567c24dd925d2
tree143c597b440265f880b24eb6e2361bea060abc06
parent02f641e2c583799eb38d3b4a59ba5872da04c6d9
system-traffic: Check frozen state handling with TLV map change

This patch enhances a system traffic test to prevent regression on
the tunnel metadata table (tun_table) handling with frozen state.
Without a proper fix this test can crash ovs-vswitchd due to a
use-after-free bug on tun_table.

These are the timed sequence of how this bug is triggered:

- Adds an OpenFlow rule in OVS that matches Geneve tunnel metadata that
contains a controller action.
- When the first packet matches the aforementioned OpenFlow rule,
during the miss upcall, OVS stores a pointer to the tun_table (that
decodes the Geneve tunnel metadata) in a frozen state and pushes down
a datapath flow into kernel datapath.
- Issues a add-tlv-map command to reprogram the tun_table on OVS.
OVS frees the old tun_table and create a new tun_table.
- A subsequent packet hits the kernel datapath flow again. Since
there is a controller action associated with that flow, it triggers
slow path controller upcall.
- In the slow path controller upcall, OVS derives the tun_table
from the frozen state, which points to the old tun_table that is
already being freed at this time point.
- In order to access the tunnel metadata, OVS uses the invalid
pointer that points to the old tun_table and triggers the core dump.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Co-authored-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: William Tu <u9012063@gmail.com>
tests/system-traffic.at