openvswitch: vport: fix self-deadlock on release of tunnel ports
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 6931d21f87bc6d657f145798fad0bf077b82486c · < 366c482965c673565ecb8bcfb15d5548f13a6a10| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
openvswitch: vport: fix self-deadlock on release of tunnel ports
vports are used concurrently and protected by RCU, so netdev_put() must happen after the RCU grace period. So, either in an RCU call or after the synchronize_net(). The rtnl_delete_link() must happen under RTNL and so can't be executed in RCU context. Calling synchronize_net() while holding RTNL is not a good idea for performance and system stability under load in general, so calling netdev_put() in RCU call is the right solution here.
However, when the device is deleted, rtnl_unlock() will call netdev_run_todo() and block until all the references are gone. In the current code this means that we never reach the call_rcu() and the vport is never freed and the reference is never released, causing a self-deadlock on device removal.
Fix that by moving the rcu_call() before the rtnl_unlock(), so the scheduled RCU callback will be executed when synchronize_net() is called from the rtnl_unlock()->netdev_run_todo() while the RTNL itself is already released.
From the CVE record · Linux
The Linux kernel's Open vSwitch vport code can self-deadlock when a tunnel port device is removed. Removing the device can leave its reference unreleased and block device removal. The input does not specify whether an attacker can trigger this, or what access or interaction would be required.
Engineers running Linux kernels with Open vSwitch tunnel ports should check their kernel versions against the vendor advisory; affected versions are not specified.