{"id":"CVE-2023-53221","aliases":["CVE-2023-53221"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Fix memleak due to fentry attach failure","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix memleak due to fentry attach failure\n\nIf it fails to attach fentry, the allocated bpf trampoline image will be\nleft in the system. That can be verified by checking /proc/kallsyms.\n\nThis meamleak can be verified by a simple bpf program as follows:\n\n  SEC(\"fentry/trap_init\")\n  int fentry_run()\n  {\n      return 0;\n  }\n\nIt will fail to attach trap_init because this function is freed after\nkernel init, and then we can find the trampoline image is left in the\nsystem by checking /proc/kallsyms.\n\n  $ tail /proc/kallsyms\n  ffffffffc0613000 t bpf_trampoline_6442453466_1  [bpf]\n  ffffffffc06c3000 t bpf_trampoline_6442453466_1  [bpf]\n\n  $ bpftool btf dump file /sys/kernel/btf/vmlinux | grep \"FUNC 'trap_init'\"\n  [2522] FUNC 'trap_init' type_id=119 linkage=static\n\n  $ echo $((6442453466 & 0x7fffffff))\n  2522\n\nNote that there are two left bpf trampoline images, that is because the\nlibbpf will fallback to raw tracepoint if -EINVAL is returned.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix memleak due to fentry attach failure\n\nIf it fails to attach fentry, the allocated bpf trampoline image will be\nleft in the system. That can be verified by checking /proc/kallsyms.\n\nThis meamleak can be verified by a simple bpf program as follows:\n\n  SEC(\"fentry/trap_init\")\n  int fentry_run()\n  {\n      return 0;\n  }\n\nIt will fail to attach trap_init because this function is freed after\nkernel init, and then we can find the trampoline image is left in the\nsystem by checking /proc/kallsyms.\n\n  $ tail /proc/kallsyms\n  ffffffffc0613000 t bpf_trampoline_6442453466_1  [bpf]\n  ffffffffc06c3000 t bpf_trampoline_6442453466_1  [bpf]\n\n  $ bpftool btf dump file /sys/kernel/btf/vmlinux | grep \"FUNC 'trap_init'\"\n  [2522] FUNC 'trap_init' type_id=119 linkage=static\n\n  $ echo $((6442453466 & 0x7fffffff))\n  2522\n\nNote that there are two left bpf trampoline images, that is because the\nlibbpf will fallback to raw tracepoint if -EINVAL is returned.","source":"cvelist"}],"published":"2025-09-15T14:21:50.053Z","modified":"2026-06-17T06:44:32.793Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"type":"git","introduced":"e21aa341785c679dd409c8cb71f864c00fe6c463","fixed":"20109ddd5bea2c24d790debf5d02584ef24c3f5e","status":"affected"},{"type":"git","introduced":"e21aa341785c679dd409c8cb71f864c00fe6c463","fixed":"f72c67d1a82dada7d6d504c806e111e913721a30","status":"affected"},{"type":"git","introduced":"e21aa341785c679dd409c8cb71f864c00fe6c463","fixed":"6aa27775db63ba8c7c73891c7dfb71ddc230c48d","status":"affected"},{"type":"git","introduced":"e21aa341785c679dd409c8cb71f864c00fe6c463","fixed":"108598c39eefbedc9882273ac0df96127a629220","status":"affected"},{"type":"git","version":"e21d2b92354b3cd25dd774ebb0f0e52ff04a7861","status":"affected"},{"type":"git","version":"85d177f56e5256e14b74a65940f981f6e3e8bb32","status":"affected"},{"type":"semver","introduced":"5.10.28","fixed":"5.11","status":"affected"},{"type":"semver","introduced":"5.11.11","fixed":"5.12","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.12","status":"unaffected"},{"type":"semver","introduced":"6.1.39","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.3.13","lastAffected":"6.3.*","status":"unaffected"},{"type":"semver","introduced":"6.4.4","lastAffected":"6.4.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.5","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.10.28","fixed":"5.11"},{"status":"affected","introduced":"5.11.11","fixed":"5.12"},{"status":"affected","introduced":"5.12.1","fixed":"6.1.39"},{"status":"affected","introduced":"6.2","fixed":"6.3.13"},{"status":"affected","introduced":"6.4","fixed":"6.4.4"},{"status":"affected","version":"5.12"},{"status":"affected","version":"5.12"},{"status":"affected","version":"5.12"},{"status":"affected","version":"5.12"},{"status":"affected","version":"5.12"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/20109ddd5bea2c24d790debf5d02584ef24c3f5e","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f72c67d1a82dada7d6d504c806e111e913721a30","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6aa27775db63ba8c7c73891c7dfb71ddc230c48d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/108598c39eefbedc9882273ac0df96127a629220","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-14T17:50:19.613Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-53221","url":"https://www.cve.org/CVERecord?id=CVE-2023-53221","licence":"CVE Terms of Use","modified":"2026-05-23T15:28:16.750Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-53221","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-53221","licence":"Public domain","modified":"2026-06-17T06:44:32.793Z"}],"updatedAt":"2026-11-25T22:58:34.782Z","epss":{"score":0.00165,"percentile":0.06049,"date":"2026-12-01T12:00:22.000Z"}}