{"id":"CVE-2023-52447","revision":"35e3aebddddb45d09efce6b3998e60bb","records":[{"revision":"35e3aebddddb45d09efce6b3998e60bb","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2023-52447","aliases":[],"title":"bpf: Defer the free of inner map when necessary","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Defer the free of inner map when necessary\n\nWhen updating or deleting an inner map in map array or map htab, the map\nmay still be accessed by non-sleepable program or sleepable program.\nHowever bpf_map_fd_put_ptr() decreases the ref-counter of the inner map\ndirectly through bpf_map_put(), if the ref-counter is the last one\n(which is true for most cases), the inner map will be freed by\nops->map_free() in a kworker. But for now, most .map_free() callbacks\ndon't use synchronize_rcu() or its variants to wait for the elapse of a\nRCU grace period, so after the invocation of ops->map_free completes,\nthe bpf program which is accessing the inner map may incur\nuse-after-free problem.\n\nFix the free of inner map by invoking bpf_map_free_deferred() after both\none RCU grace period and one tasks trace RCU grace period if the inner\nmap has been removed from the outer map before. The deferment is\naccomplished by using call_rcu() or call_rcu_tasks_trace() when\nreleasing the last ref-counter of bpf map. The newly-added rcu_head\nfield in bpf_map shares the same storage space with work field to\nreduce the size of bpf_map.","state":0,"publishedAt":"2024-02-22T16:21:39.032+00:00","modifiedAt":"2026-10-15T00:16:57.695+00:00","affected":[{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"include/linux/bpf.h\",\n                        \"kernel/bpf/map_in_map.c\",\n                        \"kernel/bpf/syscall.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"bba1dc0b55ac462d24ed1228ad49800c238cd6d7\",\n                            \"lessThan\": \"90c445799fd1dc214d7c6279c144e33a35e29ef2\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"bba1dc0b55ac462d24ed1228ad49800c238cd6d7\",\n                            \"lessThan\": \"37d98fb9c3144c0fddf7f6e99aece9927ac8dce6\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"bba1dc0b55ac462d24ed1228ad49800c238cd6d7\",\n                            \"lessThan\": \"62fca83303d608ad4fec3f7428c8685680bb01b0\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"bba1dc0b55ac462d24ed1228ad49800c238cd6d7\",\n                            \"lessThan\": \"f91cd728b10c51f6d4a39957ccd56d1e802fc8ee\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"bba1dc0b55ac462d24ed1228ad49800c238cd6d7\",\n                            \"lessThan\": \"bfd9b20c4862f41d4590fde11d70a5eeae53dcc5\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"bba1dc0b55ac462d24ed1228ad49800c238cd6d7\",\n                            \"lessThan\": \"876673364161da50eed6b472d746ef88242b2368\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"affected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"include/linux/bpf.h\",\n                        \"kernel/bpf/map_in_map.c\",\n                        \"kernel/bpf/syscall.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"5.9\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"5.9\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.10.214\",\n                            \"lessThanOrEqual\": \"5.10.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.15.153\",\n                            \"lessThanOrEqual\": \"5.15.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.1.75\",\n                            \"lessThanOrEqual\": \"6.1.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.6.14\",\n                            \"lessThanOrEqual\": \"6.6.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.7.2\",\n                            \"lessThanOrEqual\": \"6.7.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.8\",\n                            \"lessThanOrEqual\": \"*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"original_commit_for_fix\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"severity":"HIGH"}],"references":["https://git.kernel.org/stable/c/90c445799fd1dc214d7c6279c144e33a35e29ef2","https://git.kernel.org/stable/c/37d98fb9c3144c0fddf7f6e99aece9927ac8dce6","https://git.kernel.org/stable/c/62fca83303d608ad4fec3f7428c8685680bb01b0","https://git.kernel.org/stable/c/f91cd728b10c51f6d4a39957ccd56d1e802fc8ee","https://git.kernel.org/stable/c/bfd9b20c4862f41d4590fde11d70a5eeae53dcc5","https://git.kernel.org/stable/c/876673364161da50eed6b472d746ef88242b2368"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2023-52447","license":"CVE Program Terms of Use","key":"cve-program:CVE-2023-52447","identifiers":["CVE-2023-52447"]},"retained":false,"historicalAffected":[]}],"coverage":[]}