{"id":"CVE-2024-47794","aliases":["CVE-2024-47794"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Prevent tailcall infinite loop caused by freplace","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf: Evitar bucle infinito de tailcall causado por freplace Existe un posible problema de bucle infinito que puede ocurrir al usar una combinación de llamadas de cola y freplace. En una próxima autoprueba, el objetivo de conexión para entry_freplace de tailcall_freplace.c es subprog_tc de tc_bpf2bpf.c, mientras que la llamada de cola en entry_freplace conduce a entry_tc. Esto da como resultado un bucle infinito: entry_tc -&gt; subprog_tc -&gt; entry_freplace --tailcall-&gt; entry_tc. El problema surge porque tail_call_cnt en entry_freplace se restablece a cero cada vez que se ejecuta entry_freplace, lo que hace que el mecanismo de llamada de cola nunca finalice, lo que finalmente conduce a un pánico del kernel. Para solucionar este problema, la solución es doble: 1. Evitar actualizar un programa extendido por un programa freplace a un mapa prog_array. 2. Evite extender un programa que ya es parte de un mapa prog_array con un programa freplace. Esto garantiza que: * Si un programa o su subprograma ha sido extendido por un programa freplace, ya no puede actualizarse a un mapa prog_array. * Si un programa ha sido agregado a un mapa prog_array, ni él ni sus subprogramas pueden ser extendidos por un programa freplace. Además, un programa de extensión no debe ser llamado al final. Como tal, devuelva -EINVAL si el programa tiene un tipo de BPF_PROG_TYPE_EXT al agregarlo a un mapa prog_array. Además, solucione un problema menor de estilo de código reemplazando ocho espacios con una tabulación para un formato adecuado.","source":"nvd"}],"published":"2025-01-11T12:25:14.419Z","modified":"2026-10-30T13:17:37.863Z","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":"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-835"],"affected":[{"ranges":[{"type":"git","introduced":"be8704ff07d2374bcc5c675526f95e70c6459683","fixed":"272f92998cbec9e12fea8ef28f48d6b1bc625a34","status":"affected"},{"type":"git","introduced":"be8704ff07d2374bcc5c675526f95e70c6459683","fixed":"f8ba0d22afa613b280fc40fcf6ae99f73c7b36e6","status":"affected"},{"type":"git","introduced":"be8704ff07d2374bcc5c675526f95e70c6459683","fixed":"987aa730bad3e1ef66d9f30182294daa78f6387d","status":"affected"},{"type":"git","introduced":"be8704ff07d2374bcc5c675526f95e70c6459683","fixed":"d6083f040d5d8f8d748462c77e90547097df936e","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.6","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.5","lastAffected":"6.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.13","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.6","fixed":"6.12.5"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/272f92998cbec9e12fea8ef28f48d6b1bc625a34","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f8ba0d22afa613b280fc40fcf6ae99f73c7b36e6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/987aa730bad3e1ef66d9f30182294daa78f6387d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d6083f040d5d8f8d748462c77e90547097df936e","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-15T21:40:26.998Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-47794","url":"https://www.cve.org/CVERecord?id=CVE-2024-47794","licence":"CVE Terms of Use","modified":"2026-10-30T12:19:30.794Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-47794","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-47794","licence":"Public domain","modified":"2026-10-30T13:17:37.863Z"}],"updatedAt":"2026-11-25T22:58:50.916Z","epss":{"score":0.00276,"percentile":0.21488,"date":"2026-12-01T12:00:22.000Z"}}