[ovs-git] [openvswitch/ovs] 3665d7: dpif-netdev: Fix crash when add dp flow without in...

Ilya Maximets noreply at github.com
Tue Mar 2 09:49:18 UTC 2021

  Branch: refs/heads/branch-2.13
  Home:   https://github.com/openvswitch/ovs
  Commit: 3665d7f805d62cf299d9fef14002da94cb73dd1f
  Author: Mao YingMing <maoyingming at baidu.com>
  Date:   2021-03-01 (Mon, 01 Mar 2021)

  Changed paths:
    M lib/dpif-netdev.c
    M tests/dpif-netdev.at

  Log Message:
  dpif-netdev: Fix crash when add dp flow without in_port field.

Userspace datapath relies on fact that every datapath flow has exact
match on the in_port, but flows without in_port match could be
added directly via dpctl commands.  Even though dpctl is a debug
interface, datapath should just reject such flows instead of
crashing on assertion.

Fix the following crash and add a unit test for this issue
to tests/dpif-netdev.at:

$ ovs-appctl dpctl/add-flow "eth(),eth_type(0x0800),ipv4()" "3"
  unixctl|WARN|error communicating with unix:ovs-vswitchd.ctl: End of file
  ovs-appctl: ovs-vswitchd: transaction error (End of file)

ovs-vswitchd.log record:
    assertion match->wc.masks.in_port.odp_port == ODPP_NONE failed
    in dp_netdev_flow_add()
  daemon_unix(monitor)|ERR|2 crashes: pid 1995 died, killed (Aborted),
                                      core dumped, restarting

Fix result:

$ ovs-appctl dpctl/add-flow "eth(),eth_type(0x0800),ipv4()" "3"
  ovs-vswitchd: updating flow table (Invalid argument)
  ovs-appctl: ovs-vswitchd: server returned an error

ovs-vswitchd.log record:
  dpif_netdev|ERR|failed to put[create] flow: in_port is not an exact match
  dpif|WARN|netdev at ovs-netdev: failed to put[create] (Invalid argument)
    ufid:7e...d1 eth(src=00..00,dst=00..00),eth_type(0x0800),
    ipv4(src=,dst=,proto=0/0,tos=0/0,ttl=0/0), actions:3

Signed-off-by: Mao YingMing <maoyingming at baidu.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>

More information about the git mailing list