{"id":"CVE-2023-52447","aliases":["CVE-2023-52447"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Defer the free of inner map when necessary","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf: posponer la liberación del mapa interno cuando sea necesario Al actualizar o eliminar un mapa interno en la matriz de mapas o en el htab de mapas, aún se puede acceder al mapa mediante un programa que no se puede dormir o un programa que se puede dormir. . Sin embargo, bpf_map_fd_put_ptr() disminuye el contador de referencias del mapa interno directamente a través de bpf_map_put(), si el contador de referencias es el último (lo cual es cierto en la mayoría de los casos), el mapa interno será liberado por ops-&gt;map_free() en un kworker. Pero por ahora, la mayoría de las devoluciones de llamada .map_free() no usan sincronizar_rcu() o sus variantes para esperar a que transcurra el período de gracia de RCU, por lo que después de que se completa la invocación de ops-&gt;map_free, el programa bpf que accede al interior El mapa puede sufrir un problema de uso después de su liberación. Corrija la liberación del mapa interno invocando bpf_map_free_deferred() después de un período de gracia de RCU y un período de gracia de seguimiento de tareas de RCU si el mapa interno se eliminó del mapa externo antes. El aplazamiento se logra utilizando call_rcu() o call_rcu_tasks_trace() al liberar el último contador de referencia del mapa bpf. El campo rcu_head recién agregado en bpf_map comparte el mismo espacio de almacenamiento con el campo de trabajo para reducir el tamaño de bpf_map.","source":"nvd"}],"published":"2024-02-22T16:21:39.032Z","modified":"2026-10-15T01:17:13.813Z","severity":{"scorer":"Linux","scheme":"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,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"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,"rating":"HIGH"},{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"bba1dc0b55ac462d24ed1228ad49800c238cd6d7","fixed":"90c445799fd1dc214d7c6279c144e33a35e29ef2","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac462d24ed1228ad49800c238cd6d7","fixed":"37d98fb9c3144c0fddf7f6e99aece9927ac8dce6","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac462d24ed1228ad49800c238cd6d7","fixed":"62fca83303d608ad4fec3f7428c8685680bb01b0","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac462d24ed1228ad49800c238cd6d7","fixed":"f91cd728b10c51f6d4a39957ccd56d1e802fc8ee","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac462d24ed1228ad49800c238cd6d7","fixed":"bfd9b20c4862f41d4590fde11d70a5eeae53dcc5","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac462d24ed1228ad49800c238cd6d7","fixed":"876673364161da50eed6b472d746ef88242b2368","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.9","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.9","status":"unaffected"},{"type":"semver","introduced":"5.10.214","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.153","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.75","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.14","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.7.2","lastAffected":"6.7.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.8","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"type":"git","introduced":"bba1dc0b55ac","fixed":"90c445799fd1","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac","fixed":"37d98fb9c314","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac","fixed":"62fca83303d6","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac","fixed":"f91cd728b10c","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac","fixed":"bfd9b20c4862","status":"affected"},{"type":"git","introduced":"bba1dc0b55ac","fixed":"876673364161","status":"affected"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"version":"5.9","status":"affected"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:5.9:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"5.9","status":"unaffected"},{"type":"custom","introduced":"5.10.214","lastAffected":"5.10.*","status":"unaffected"},{"type":"custom","introduced":"5.15.153","lastAffected":"5.15.*","status":"unaffected"},{"type":"custom","introduced":"6.1.75","lastAffected":"6.1.*","status":"unaffected"},{"type":"custom","introduced":"6.6.14","lastAffected":"6.6.*","status":"unaffected"},{"type":"custom","introduced":"6.7.2","lastAffected":"6.7.*","status":"unaffected"},{"type":"custom","introduced":"6.8","lastAffected":"*","status":"unaffected"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.9.0","fixed":"5.10.214"},{"status":"affected","introduced":"5.11","fixed":"5.15.153"},{"status":"affected","introduced":"5.16","fixed":"6.1.75"},{"status":"affected","introduced":"6.2","fixed":"6.6.14"},{"status":"affected","introduced":"6.7","fixed":"6.7.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/90c445799fd1dc214d7c6279c144e33a35e29ef2","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/37d98fb9c3144c0fddf7f6e99aece9927ac8dce6","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/62fca83303d608ad4fec3f7428c8685680bb01b0","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f91cd728b10c51f6d4a39957ccd56d1e802fc8ee","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bfd9b20c4862f41d4590fde11d70a5eeae53dcc5","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/876673364161da50eed6b472d746ef88242b2368","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2024-10-15T21:02:24.907Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-52447","url":"https://www.cve.org/CVERecord?id=CVE-2023-52447","licence":"CVE Terms of Use","modified":"2026-10-15T00:16:57.695Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-52447","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-52447","licence":"Public domain","modified":"2026-10-15T01:17:13.813Z"}],"updatedAt":"2026-11-25T22:58:33.053Z","epss":{"score":0.00247,"percentile":0.17144,"date":"2026-12-01T12:00:22.000Z"}}