CVE-2023-52447

Source
https://cve.org/CVERecord?id=CVE-2023-52447
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-52447.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2023-52447
Downstream
Related
Published
2024-02-22T16:21:39.032Z
Modified
2026-03-13T07:48:01.446800Z
Severity
  • 6.7 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
bpf: Defer the free of inner map when necessary
Details

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 bpfmapfdputptr() decreases the ref-counter of the inner map directly through bpfmapput(), if the ref-counter is the last one (which is true for most cases), the inner map will be freed by ops->mapfree() in a kworker. But for now, most .mapfree() callbacks don't use synchronizercu() or its variants to wait for the elapse of a RCU grace period, so after the invocation of ops->mapfree completes, the bpf program which is accessing the inner map may incur use-after-free problem.

Fix the free of inner map by invoking bpfmapfreedeferred() 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 callrcu() or callrcutaskstrace() when releasing the last ref-counter of bpf map. The newly-added rcuhead field in bpfmap shares the same storage space with work field to reduce the size of bpfmap.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52447.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
bba1dc0b55ac462d24ed1228ad49800c238cd6d7
Fixed
90c445799fd1dc214d7c6279c144e33a35e29ef2
Fixed
37d98fb9c3144c0fddf7f6e99aece9927ac8dce6
Fixed
62fca83303d608ad4fec3f7428c8685680bb01b0
Fixed
f91cd728b10c51f6d4a39957ccd56d1e802fc8ee
Fixed
bfd9b20c4862f41d4590fde11d70a5eeae53dcc5
Fixed
876673364161da50eed6b472d746ef88242b2368

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-52447.json"