CVE-2021-47505

In the Linux kernel, the following vulnerability has been resolved:

aio: fix use-after-free due to missing POLLFREE handling

signalfd_poll() and binder_poll() are special in that they use a
waitqueue whose lifetime is the current task, rather than the struct
file as is normally the case.  This is okay for blocking polls, since a
blocking poll occurs within one task; however, non-blocking polls
require another solution.  This solution is for the queue to be cleared
before it is freed, by sending a POLLFREE notification to all waiters.

Unfortunately, only eventpoll handles POLLFREE.  A second type of
non-blocking poll, aio poll, was added in kernel v4.18, and it doesn't
handle POLLFREE.  This allows a use-after-free to occur if a signalfd or
binder fd is polled with aio poll, and the waitqueue gets freed.

Fix this by making aio poll handle POLLFREE.

A patch by Ramji Jiyani <ramjiyani@google.com>
(https://lore.kernel.org/r/20211027011834.2497484-1-ramjiyani@google.com)
tried to do this by making aio_poll_wake() always complete the request
inline if POLLFREE is seen.  However, that solution had two bugs.
First, it introduced a deadlock, as it unconditionally locked the aio
context while holding the waitqueue lock, which inverts the normal
locking order.  Second, it didn't consider that POLLFREE notifications
are missed while the request has been temporarily de-queued.

The second problem was solved by my previous patch.  This patch then
properly fixes the use-after-free by handling POLLFREE in a
deadlock-free way.  It does this by taking advantage of the fact that
freeing of the waitqueue is RCU-delayed, similar to what eventpoll does.
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTPrimary
7.8 HIGH
LOCAL
LOW
LOW
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Base Score
CVSS 3.x
EPSS Score
Percentile: 5%
Affected Products (NVD)
VendorProductVersion
linuxlinux_kernel
4.18 ≤
𝑥
< 4.19.221
linuxlinux_kernel
4.20 ≤
𝑥
< 5.4.165
linuxlinux_kernel
5.5 ≤
𝑥
< 5.10.85
linuxlinux_kernel
5.11 ≤
𝑥
< 5.15.8
linuxlinux_kernel
5.16:rc1
linuxlinux_kernel
5.16:rc2
linuxlinux_kernel
5.16:rc3
linuxlinux_kernel
5.16:rc4
𝑥
= Vulnerable software versions
Debian logo
Debian Releases
Debian Product
Codename
linux
bookworm
6.1.106-3
fixed
bookworm (security)
6.1.112-1
fixed
bullseye
5.10.223-1
fixed
bullseye (security)
5.10.226-1
fixed
sid
6.11.5-1
fixed
trixie
6.11.5-1
fixed
Ubuntu logo
Ubuntu Releases
Ubuntu Product
Codename
linux
bionic
not-affected
focal
Fixed 5.4.0-100.113
released
jammy
not-affected
mantic
not-affected
noble
not-affected
trusty
not-affected
xenial
not-affected
linux-allwinner-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-aws
bionic
not-affected
focal
Fixed 5.4.0-1066.69
released
jammy
not-affected
mantic
not-affected
noble
not-affected
trusty
not-affected
xenial
not-affected
linux-aws-5.0
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-aws-5.11
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-aws-5.13
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-aws-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-aws-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-aws-5.3
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-aws-5.4
bionic
pending
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-aws-5.8
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-aws-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-aws-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-aws-fips
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-aws-hwe
focal
dne
jammy
dne
mantic
dne
noble
dne
xenial
not-affected
linux-azure
bionic
ignored
focal
Fixed 5.4.0-1070.73
released
jammy
not-affected
mantic
not-affected
noble
not-affected
trusty
not-affected
xenial
not-affected
linux-azure-4.15
bionic
not-affected
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-azure-5.11
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-azure-5.13
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-azure-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-azure-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-azure-5.3
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-azure-5.4
bionic
pending
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-azure-5.8
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-azure-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-azure-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-azure-edge
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-azure-fde
focal
ignored
jammy
not-affected
mantic
dne
noble
dne
linux-azure-fde-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-azure-fde-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-azure-fde-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-azure-fips
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-bluefield
focal
Fixed 5.4.0-1028.31
released
jammy
dne
mantic
dne
noble
dne
linux-fips
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-gcp
bionic
ignored
focal
Fixed 5.4.0-1065.69
released
jammy
not-affected
mantic
not-affected
noble
not-affected
xenial
not-affected
linux-gcp-4.15
bionic
not-affected
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-gcp-5.11
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-gcp-5.13
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-gcp-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-gcp-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-gcp-5.3
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-gcp-5.4
bionic
pending
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-gcp-5.8
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-gcp-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-gcp-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-gcp-fips
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-gke
focal
ignored
jammy
not-affected
mantic
dne
noble
not-affected
linux-gke-4.15
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-gke-5.15
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-gke-5.4
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-gkeop
focal
Fixed 5.4.0-1034.35
released
jammy
not-affected
mantic
dne
noble
dne
linux-gkeop-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-gkeop-5.4
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-hwe
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
xenial
not-affected
linux-hwe-5.11
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-hwe-5.13
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-hwe-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-hwe-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-hwe-5.4
bionic
pending
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-hwe-5.8
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-hwe-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-hwe-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-hwe-6.8
bionic
dne
focal
dne
jammy
not-affected
noble
dne
trusty
dne
xenial
dne
linux-hwe-edge
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
xenial
ignored
linux-ibm
focal
Fixed 5.4.0-1015.16
released
jammy
not-affected
mantic
ignored
noble
not-affected
linux-ibm-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-ibm-5.4
bionic
pending
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-intel
bionic
dne
focal
dne
jammy
dne
mantic
dne
noble
not-affected
trusty
dne
xenial
dne
linux-intel-5.13
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-intel-iot-realtime
bionic
dne
focal
dne
jammy
dne
noble
dne
trusty
dne
xenial
dne
linux-intel-iotg
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-intel-iotg-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-iot
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-kvm
bionic
not-affected
focal
Fixed 5.4.0-1056.58
released
jammy
not-affected
mantic
dne
noble
dne
xenial
not-affected
linux-laptop
focal
dne
jammy
dne
mantic
not-affected
noble
dne
linux-lowlatency
focal
dne
jammy
not-affected
mantic
not-affected
noble
not-affected
linux-lowlatency-hwe-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-lowlatency-hwe-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-lowlatency-hwe-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-lowlatency-hwe-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-lowlatency-hwe-6.8
bionic
dne
focal
dne
jammy
not-affected
noble
dne
trusty
dne
xenial
dne
linux-lts-xenial
focal
dne
jammy
dne
mantic
dne
noble
dne
trusty
not-affected
linux-nvidia
focal
dne
jammy
not-affected
mantic
dne
noble
not-affected
linux-nvidia-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-nvidia-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-nvidia-6.8
bionic
dne
focal
dne
jammy
not-affected
noble
dne
trusty
dne
xenial
dne
linux-nvidia-lowlatency
bionic
dne
focal
dne
jammy
dne
noble
not-affected
trusty
dne
xenial
dne
linux-oem
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-oem-5.10
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-oem-5.13
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-oem-5.14
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-oem-5.17
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-oem-5.6
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-oem-6.0
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-oem-6.1
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-oem-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-oem-6.8
bionic
dne
focal
dne
jammy
dne
mantic
dne
noble
not-affected
trusty
dne
xenial
dne
linux-oracle
bionic
not-affected
focal
Fixed 5.4.0-1064.68
released
jammy
not-affected
mantic
not-affected
noble
not-affected
xenial
not-affected
linux-oracle-5.0
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-oracle-5.11
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-oracle-5.13
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-oracle-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-oracle-5.3
bionic
ignored
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-oracle-5.4
bionic
pending
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-oracle-5.8
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-oracle-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-raspi
focal
Fixed 5.4.0-1053.60
released
jammy
not-affected
mantic
not-affected
noble
not-affected
linux-raspi-5.4
bionic
pending
focal
dne
jammy
dne
mantic
dne
noble
dne
linux-raspi-realtime
bionic
dne
focal
dne
jammy
dne
noble
dne
trusty
dne
xenial
dne
linux-raspi2
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-realtime
bionic
dne
focal
dne
jammy
ignored
noble
dne
trusty
dne
xenial
dne
linux-riscv
focal
ignored
jammy
ignored
mantic
not-affected
noble
not-affected
linux-riscv-5.11
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-riscv-5.15
focal
not-affected
jammy
dne
mantic
dne
noble
dne
linux-riscv-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-riscv-5.8
focal
ignored
jammy
dne
mantic
dne
noble
dne
linux-riscv-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-riscv-6.8
bionic
dne
focal
dne
jammy
not-affected
noble
dne
trusty
dne
xenial
dne
linux-starfive
focal
dne
jammy
dne
mantic
not-affected
noble
dne
linux-starfive-5.19
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-starfive-6.2
focal
dne
jammy
ignored
mantic
dne
noble
dne
linux-starfive-6.5
focal
dne
jammy
not-affected
mantic
dne
noble
dne
linux-xilinx-zynqmp
focal
not-affected
jammy
not-affected
mantic
dne
noble
dne