{"id":"CVE-2024-47794","revision":"5dbf30e57bc1436f8d86453a7d7a2a6e","records":[{"revision":"5dbf30e57bc1436f8d86453a7d7a2a6e","observedAt":"2026-10-30T13:45:33.454+00:00","statement":{"source":"cve-program","id":"CVE-2024-47794","aliases":[],"title":"bpf: Prevent tailcall infinite loop caused by freplace","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Prevent tailcall infinite loop caused by freplace\n\nThere is a potential infinite loop issue that can occur when using a\ncombination of tail calls and freplace.\n\nIn an upcoming selftest, the attach target for entry_freplace of\ntailcall_freplace.c is subprog_tc of tc_bpf2bpf.c, while the tail call in\nentry_freplace leads to entry_tc. This results in an infinite loop:\n\nentry_tc -> subprog_tc -> entry_freplace --tailcall-> entry_tc.\n\nThe problem arises because the tail_call_cnt in entry_freplace resets to\nzero each time entry_freplace is executed, causing the tail call mechanism\nto never terminate, eventually leading to a kernel panic.\n\nTo fix this issue, the solution is twofold:\n\n1. Prevent updating a program extended by an freplace program to a\n   prog_array map.\n2. Prevent extending a program that is already part of a prog_array map\n   with an freplace program.\n\nThis ensures that:\n\n* If a program or its subprogram has been extended by an freplace program,\n  it can no longer be updated to a prog_array map.\n* If a program has been added to a prog_array map, neither it nor its\n  subprograms can be extended by an freplace program.\n\nMoreover, an extension program should not be tailcalled. As such, return\n-EINVAL if the program has a type of BPF_PROG_TYPE_EXT when adding it to a\nprog_array map.\n\nAdditionally, fix a minor code style issue by replacing eight spaces with a\ntab for proper formatting.","state":0,"publishedAt":"2025-01-11T12:25:14.419+00:00","modifiedAt":"2026-10-30T12:19:30.794+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/arraymap.c\",\n                        \"kernel/bpf/core.c\",\n                        \"kernel/bpf/syscall.c\",\n                        \"kernel/bpf/trampoline.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"be8704ff07d2374bcc5c675526f95e70c6459683\",\n                            \"lessThan\": \"272f92998cbec9e12fea8ef28f48d6b1bc625a34\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"be8704ff07d2374bcc5c675526f95e70c6459683\",\n                            \"lessThan\": \"f8ba0d22afa613b280fc40fcf6ae99f73c7b36e6\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"be8704ff07d2374bcc5c675526f95e70c6459683\",\n                            \"lessThan\": \"987aa730bad3e1ef66d9f30182294daa78f6387d\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"be8704ff07d2374bcc5c675526f95e70c6459683\",\n                            \"lessThan\": \"d6083f040d5d8f8d748462c77e90547097df936e\",\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/arraymap.c\",\n                        \"kernel/bpf/core.c\",\n                        \"kernel/bpf/syscall.c\",\n                        \"kernel/bpf/trampoline.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"5.6\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"5.6\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.1.191\",\n                            \"lessThanOrEqual\": \"6.1.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.6.160\",\n                            \"lessThanOrEqual\": \"6.6.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.12.5\",\n                            \"lessThanOrEqual\": \"6.12.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.13\",\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/272f92998cbec9e12fea8ef28f48d6b1bc625a34","https://git.kernel.org/stable/c/f8ba0d22afa613b280fc40fcf6ae99f73c7b36e6","https://git.kernel.org/stable/c/987aa730bad3e1ef66d9f30182294daa78f6387d","https://git.kernel.org/stable/c/d6083f040d5d8f8d748462c77e90547097df936e"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2024-47794","license":"CVE Program Terms of Use","key":"cve-program:CVE-2024-47794","identifiers":["CVE-2024-47794"]},"retained":false,"historicalAffected":[]}],"coverage":[]}