CVE-2023-52447

Updated: 2024-11-04

CWE: CWE-416

Description:

In the Linux kernel, the following vulnerability has been resolved: bpf: Defer the free of inner map when necessary When updating or deleting an inner map in map array or map htab, the map may still be accessed by non-sleepable program or sleepable program. However bpf_map_fd_put_ptr() decreases the ref-counter of the inner map directly through bpf_map_put(), if the ref-counter is the last one (which is true for most cases), the inner map will be freed by ops->map_free() in a kworker. But for now, most .map_free() callbacks don't use synchronize_rcu() or its variants to wait for the elapse of a RCU grace period, so after the invocation of ops->map_free completes, the bpf program which is accessing the inner map may incur use-after-free problem. Fix the free of inner map by invoking bpf_map_free_deferred() after both one RCU grace period and one tasks trace RCU grace period if the inner map has been removed from the outer map before. The deferment is accomplished by using call_rcu() or call_rcu_tasks_trace() when releasing the last ref-counter of bpf map. The newly-added rcu_head field in bpf_map shares the same storage space with work field to reduce the size of bpf_map.

CVSS3: 7.8


Vendor State

OS Vendor version Errata
Amazon Linux 1 6.1.75-99.163.amzn2023 ALAS-2024-519
Debian 11 5.10.216-1 DSA-5681-1
Ubuntu 22.04 5.15.0-112.122 USN-6820-1
Ubuntu 22.04 AWS 5.15.0-1063.69 USN-6821-3
Ubuntu 22.04 Azure 5.15.0-1066.75 USN-6821-4
Debian 11 cloud 5.10.216-1 DSA-5681-1
Ubuntu 20.04 HWE AWS 5.15.0-1063.69~20.04.1 USN-6821-3
Amazon Linux 2 5.10 5.10.214-202.855.amzn2 ALASKERNEL-5.10-2024-054
Amazon Linux 2023 6.1.75-99.163.amzn2023 ALAS-2024-519

KernelCare State

OS Original kernel version State
Amazon Linux 1
Will Not Fix
Debian 11
5.10.46-5 show all hide all
5.10.70-1 5.10.46-4 5.10.84-1 5.10.92-1 5.10.92-2 5.10.103-1 5.10.106-1 5.10.113-1 5.10.120-1 5.10.127-1 5.10.127-2 5.10.136-1 5.10.140-1 5.10.149-1 5.10.149-2 5.10.158-2 5.10.162-1 5.10.179-1 5.10.179-2 5.10.179-3 5.10.179-5 5.10.191-1 5.10.197-1 5.10.178-3 5.10.205-2 5.10.205-1 5.10.209-2
Released
Ubuntu 22.04
Ready For Release
Ubuntu 22.04 AWS
Planned
Ubuntu 22.04 Azure
Planned
Debian 11 cloud
5.10.113-1 show all hide all
5.10.179-2 5.10.179-3 5.10.179-5 5.10.191-1 5.10.197-1 5.10.205-2 5.10.209-2
Released
Ubuntu 20.04 HWE AWS
Planned
Amazon Linux 2 5.10
Planned
Amazon Linux 2023
Will Not Fix