vulnerability

Ubuntu: (Multiple Advisories) (CVE-2024-26737): Linux kernel vulnerabilities

Severity
5
CVSS
(AV:L/AC:L/Au:S/C:N/I:N/A:C)
Published
04/03/2024
Added
07/01/2024
Modified
02/20/2025

Description

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

bpf: Fix racing between bpf_timer_cancel_and_free and bpf_timer_cancel

The following race is possible between bpf_timer_cancel_and_free
and bpf_timer_cancel. It will lead a UAF on the timer->timer.

bpf_timer_cancel();
spin_lock();
t = timer->time;
spin_unlock();

bpf_timer_cancel_and_free();
spin_lock();
t = timer->timer;
timer->timer = NULL;
spin_unlock();
hrtimer_cancel(&t->timer);
kfree(t);

/* UAF on t */
hrtimer_cancel(&t->timer);

In bpf_timer_cancel_and_free, this patch frees the timer->timer
after a rcu grace period. This requires a rcu_head addition
to the "struct bpf_hrtimer". Another kfree(t) happens in bpf_timer_init,
this does not need a kfree_rcu because it is still under the
spin_lock and timer->timer has not been visible by others yet.

In bpf_timer_cancel, rcu_read_lock() is added because this helper
can be used in a non rcu critical section context (e.g. from
a sleepable bpf prog). Other timer->timer usages in helpers.c
have been audited, bpf_timer_cancel() is the only place where
timer->timer is used outside of the spin_lock.

Another solution considered is to mark a t->flag in bpf_timer_cancel
and clear it after hrtimer_cancel() is done. In bpf_timer_cancel_and_free,
it busy waits for the flag to be cleared before kfree(t). This patch
goes with a straight forward solution and frees timer->timer after
a rcu grace period.

Solution(s)

ubuntu-upgrade-linux-image-5-15-0-1030-xilinx-zynqmpubuntu-upgrade-linux-image-5-15-0-1046-gkeopubuntu-upgrade-linux-image-5-15-0-1056-ibmubuntu-upgrade-linux-image-5-15-0-1057-ibmubuntu-upgrade-linux-image-5-15-0-1058-intel-iotgubuntu-upgrade-linux-image-5-15-0-1058-nvidiaubuntu-upgrade-linux-image-5-15-0-1058-nvidia-lowlatencyubuntu-upgrade-linux-image-5-15-0-1058-raspiubuntu-upgrade-linux-image-5-15-0-1060-gkeubuntu-upgrade-linux-image-5-15-0-1060-kvmubuntu-upgrade-linux-image-5-15-0-1061-oracleubuntu-upgrade-linux-image-5-15-0-1062-gcpubuntu-upgrade-linux-image-5-15-0-1063-awsubuntu-upgrade-linux-image-5-15-0-1065-azure-fdeubuntu-upgrade-linux-image-5-15-0-1066-azureubuntu-upgrade-linux-image-5-15-0-110-lowlatencyubuntu-upgrade-linux-image-5-15-0-110-lowlatency-64kubuntu-upgrade-linux-image-5-15-0-112-genericubuntu-upgrade-linux-image-5-15-0-112-generic-64kubuntu-upgrade-linux-image-5-15-0-112-generic-lpaeubuntu-upgrade-linux-image-5-15-0-113-genericubuntu-upgrade-linux-image-5-15-0-113-generic-64kubuntu-upgrade-linux-image-5-15-0-113-generic-lpaeubuntu-upgrade-linux-image-awsubuntu-upgrade-linux-image-aws-lts-22-04ubuntu-upgrade-linux-image-azure-fde-lts-22-04ubuntu-upgrade-linux-image-azure-lts-22-04ubuntu-upgrade-linux-image-gcpubuntu-upgrade-linux-image-gcp-lts-22-04ubuntu-upgrade-linux-image-genericubuntu-upgrade-linux-image-generic-64kubuntu-upgrade-linux-image-generic-64k-hwe-20-04ubuntu-upgrade-linux-image-generic-hwe-20-04ubuntu-upgrade-linux-image-generic-lpaeubuntu-upgrade-linux-image-generic-lpae-hwe-20-04ubuntu-upgrade-linux-image-gkeubuntu-upgrade-linux-image-gke-5-15ubuntu-upgrade-linux-image-gkeopubuntu-upgrade-linux-image-gkeop-5-15ubuntu-upgrade-linux-image-ibmubuntu-upgrade-linux-image-intelubuntu-upgrade-linux-image-intel-iotgubuntu-upgrade-linux-image-kvmubuntu-upgrade-linux-image-lowlatencyubuntu-upgrade-linux-image-lowlatency-64kubuntu-upgrade-linux-image-lowlatency-64k-hwe-20-04ubuntu-upgrade-linux-image-lowlatency-hwe-20-04ubuntu-upgrade-linux-image-nvidiaubuntu-upgrade-linux-image-nvidia-lowlatencyubuntu-upgrade-linux-image-oem-20-04ubuntu-upgrade-linux-image-oem-20-04bubuntu-upgrade-linux-image-oem-20-04cubuntu-upgrade-linux-image-oem-20-04dubuntu-upgrade-linux-image-oracle-lts-22-04ubuntu-upgrade-linux-image-raspiubuntu-upgrade-linux-image-raspi-nolpaeubuntu-upgrade-linux-image-virtualubuntu-upgrade-linux-image-virtual-hwe-20-04ubuntu-upgrade-linux-image-xilinx-zynqmp
Title
NEW

Explore Exposure Command

Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.