CVE-2023-53188

EUVD-2023-59788
In the Linux kernel, the following vulnerability has been resolved:

net: openvswitch: fix race on port output

assume the following setup on a single machine:
1. An openvswitch instance with one bridge and default flows
2. two network namespaces "server" and "client"
3. two ovs interfaces "server" and "client" on the bridge
4. for each ovs interface a veth pair with a matching name and 32 rx and
   tx queues
5. move the ends of the veth pairs to the respective network namespaces
6. assign ip addresses to each of the veth ends in the namespaces (needs
   to be the same subnet)
7. start some http server on the server network namespace
8. test if a client in the client namespace can reach the http server

when following the actions below the host has a chance of getting a cpu
stuck in a infinite loop:
1. send a large amount of parallel requests to the http server (around
   3000 curls should work)
2. in parallel delete the network namespace (do not delete interfaces or
   stop the server, just kill the namespace)

there is a low chance that this will cause the below kernel cpu stuck
message. If this does not happen just retry.
Below there is also the output of bpftrace for the functions mentioned
in the output.

The series of events happening here is:
1. the network namespace is deleted calling
   `unregister_netdevice_many_notify` somewhere in the process
2. this sets first `NETREG_UNREGISTERING` on both ends of the veth and
   then runs `synchronize_net`
3. it then calls `call_netdevice_notifiers` with `NETDEV_UNREGISTER`
4. this is then handled by `dp_device_event` which calls
   `ovs_netdev_detach_dev` (if a vport is found, which is the case for
   the veth interface attached to ovs)
5. this removes the rx_handlers of the device but does not prevent
   packages to be sent to the device
6. `dp_device_event` then queues the vport deletion to work in
   background as a ovs_lock is needed that we do not hold in the
   unregistration path
7. `unregister_netdevice_many_notify` continues to call
   `netdev_unregister_kobject` which sets `real_num_tx_queues` to 0
8. port deletion continues (but details are not relevant for this issue)
9. at some future point the background task deletes the vport

If after 7. but before 9. a packet is send to the ovs vport (which is
not deleted at this point in time) which forwards it to the
`dev_queue_xmit` flow even though the device is unregistering.
In `skb_tx_hash` (which is called in the `dev_queue_xmit`) path there is
a while loop (if the packet has a rx_queue recorded) that is infinite if
`dev->real_num_tx_queues` is zero.

To prevent this from happening we update `do_output` to handle devices
without carrier the same as if the device is not found (which would
be the code path after 9. is done).

Additionally we now produce a warning in `skb_tx_hash` if we will hit
the infinite loop.

bpftrace (first word is function name):

__dev_queue_xmit server: real_num_tx_queues: 1, cpu: 2, pid: 28024, tid: 28024, skb_addr: 0xffff9edb6f207000, reg_state: 1
netdev_core_pick_tx server: addr: 0xffff9f0a46d4a000 real_num_tx_queues: 1, cpu: 2, pid: 28024, tid: 28024, skb_addr: 0xffff9edb6f207000, reg_state: 1
dp_device_event server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, event 2, reg_state: 1
synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024
synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024
synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024
synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024
dp_device_event server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, event 6, reg_state: 2
ovs_netdev_detach_dev server: real_num_tx_queues: 1 cpu 9, pid: 21024, tid: 21024, reg_state: 2
netdev_rx_handler_unregister server: real_num_tx_queues: 1, cpu: 9, pid: 21024, tid: 21024, reg_state: 2
synchronize_rcu_expedited: cpu 9, pid: 21024, tid: 21024
netdev_rx_handler_unregister ret server: real_num_tx_queues: 1, cpu: 9, pid: 21024, tid: 21024, reg_state: 2
dp_
---truncated---
Race Condition
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTPrimary
4.7 MEDIUM
LOCAL
HIGH
LOW
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Base Score
CVSS 3.x
EPSS Score
Percentile: 2%
Affected Products (NVD)
VendorProductVersion
linuxlinux_kernel
4.3 ≤
𝑥
< 5.4.293
linuxlinux_kernel
5.5 ≤
𝑥
< 5.10.237
linuxlinux_kernel
5.11 ≤
𝑥
< 5.15.181
linuxlinux_kernel
5.16 ≤
𝑥
< 6.1.25
linuxlinux_kernel
6.2 ≤
𝑥
< 6.2.12
linuxlinux_kernel
6.3:rc1
linuxlinux_kernel
6.3:rc2
linuxlinux_kernel
6.3:rc3
linuxlinux_kernel
6.3:rc4
linuxlinux_kernel
6.3:rc5
linuxlinux_kernel
6.3:rc6
𝑥
= Vulnerable software versions
Debian logo
Debian Releases
Debian Product
Codename
linux
bookworm
6.1.148-1
fixed
bookworm (security)
6.1.147-1
fixed
bullseye
vulnerable
bullseye (security)
5.10.237-1
fixed
forky
6.16.3-1
fixed
sid
6.16.7-1
fixed
trixie
6.12.43-1
fixed
trixie (security)
6.12.41-1
fixed
openSUSE logo
openSUSE / SLES Releases
openSUSE Product
Release
cluster-md-kmp-default
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
dlm-kmp-default
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
gfs2-kmp-default
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
kernel-default
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
kernel-default-base
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
kernel-default-man
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
kernel-macros
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
kernel-source
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
kernel-syms
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
ocfs2-kmp-default
suse enterprise server 12 SP5
4.12.14-122.280.1
fixed
Red Hat logo
Red Hat Enterprise Linux Releases
Red Hat Product
Release
bpftool
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:7.2.0-362.8.1.el9_3
fixed
kernel
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-debug
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-debug-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-debug-devel
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-debug-devel-matched
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-debug-modules
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-debug-modules-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-debug-modules-extra
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-devel
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-devel-matched
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-modules
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-modules-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-64k-modules-extra
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-abi-stablelists
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-core
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug-core
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug-devel
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug-devel-matched
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug-modules
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug-modules-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug-modules-extra
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-debug-uki-virt
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-devel
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-devel-matched
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-doc
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-modules
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-modules-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-modules-extra
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-debug
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-debug-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-debug-devel
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-debug-kvm
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-debug-modules
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-debug-modules-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-debug-modules-extra
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-devel
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-kvm
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-modules
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-modules-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-rt-modules-extra
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-tools
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-tools-libs
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-tools-libs-devel
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-uki-virt
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-zfcpdump
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-zfcpdump-core
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-zfcpdump-devel
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-zfcpdump-devel-matched
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-zfcpdump-modules
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-zfcpdump-modules-core
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
kernel-zfcpdump-modules-extra
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
libperf
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
perf
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
python3-perf
RHEL 8
0:4.18.0-513.5.1.el8_9
fixed
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
rtla
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed
rv
RHEL 9
0:5.14.0-362.8.1.el9_3
fixed