{"id":"CVE-2026-31526","aliases":["CVE-2026-31526"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Fix exception exit lock checking for subprogs","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix exception exit lock checking for subprogs\n\nprocess_bpf_exit_full() passes check_lock = !curframe to\ncheck_resource_leak(), which is false in cases when bpf_throw() is\ncalled from a static subprog. This makes check_resource_leak() to skip\nvalidation of active_rcu_locks, active_preempt_locks, and\nactive_irq_id on exception exits from subprogs.\n\nAt runtime bpf_throw() unwinds the stack via ORC without releasing any\nuser-acquired locks, which may cause various issues as the result.\n\nFix by setting check_lock = true for exception exits regardless of\ncurframe, since exceptions bypass all intermediate frame\ncleanup. Update the error message prefix to \"bpf_throw\" for exception\nexits to distinguish them from normal BPF_EXIT.\n\nFix reject_subprog_with_rcu_read_lock test which was previously\npassing for the wrong reason. Test program returned directly from the\nsubprog call without closing the RCU section, so the error was\ntriggered by the unclosed RCU lock on normal exit, not by\nbpf_throw. Update __msg annotations for affected tests to match the\nnew \"bpf_throw\" error prefix.\n\nThe spin_lock case is not affected because they are already checked [1]\nat the call site in do_check_insn() before bpf_throw can run.\n\n[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/verifier.c?h=v7.0-rc4#n21098","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix exception exit lock checking for subprogs\n\nprocess_bpf_exit_full() passes check_lock = !curframe to\ncheck_resource_leak(), which is false in cases when bpf_throw() is\ncalled from a static subprog. This makes check_resource_leak() to skip\nvalidation of active_rcu_locks, active_preempt_locks, and\nactive_irq_id on exception exits from subprogs.\n\nAt runtime bpf_throw() unwinds the stack via ORC without releasing any\nuser-acquired locks, which may cause various issues as the result.\n\nFix by setting check_lock = true for exception exits regardless of\ncurframe, since exceptions bypass all intermediate frame\ncleanup. Update the error message prefix to \"bpf_throw\" for exception\nexits to distinguish them from normal BPF_EXIT.\n\nFix reject_subprog_with_rcu_read_lock test which was previously\npassing for the wrong reason. Test program returned directly from the\nsubprog call without closing the RCU section, so the error was\ntriggered by the unclosed RCU lock on normal exit, not by\nbpf_throw. Update __msg annotations for affected tests to match the\nnew \"bpf_throw\" error prefix.\n\nThe spin_lock case is not affected because they are already checked [1]\nat the call site in do_check_insn() before bpf_throw can run.\n\n[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/verifier.c?h=v7.0-rc4#n21098","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbpf: Corrección de la comprobación de bloqueo en salida por excepción para subprogs\n\nprocess_bpf_exit_full() pasa check_lock = !curframe a check_resource_leak(), lo cual es falso en casos cuando se llama a bpf_throw() desde un subprog estático. Esto hace que check_resource_leak() omita la validación de active_rcu_locks, active_preempt_locks y active_irq_id en salidas por excepción desde subprogs.\n\nEn tiempo de ejecución, bpf_throw() desenrolla la pila a través de ORC sin liberar ningún bloqueo adquirido por el usuario, lo cual puede causar varios problemas como resultado.\n\nSolución estableciendo check_lock = true para salidas por excepción independientemente de curframe, ya que las excepciones omiten toda la limpieza de marcos intermedios. Actualizar el prefijo del mensaje de error a ’bpf_throw’ para salidas por excepción para distinguirlas de un BPF_EXIT normal.\n\nCorrección de la prueba reject_subprog_with_rcu_read_lock que anteriormente pasaba por la razón equivocada. El programa de prueba regresó directamente de la llamada al subprog sin cerrar la sección RCU, por lo que el error fue activado por el bloqueo RCU no cerrado en una salida normal, no por bpf_throw. Actualizar las anotaciones __msg para las pruebas afectadas para que coincidan con el nuevo prefijo de error ’bpf_throw’.\n\nEl caso spin_lock no se ve afectado porque ya se comprueban [1] en el sitio de llamada en do_check_insn() antes de que bpf_throw pueda ejecutarse.\n\n[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/verifier.c?h=v7.0-rc4#n21098","source":"nvd"}],"published":"2026-04-22T13:54:39.800Z","modified":"2026-11-11T23:10:00.263Z","severity":{"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"},"severities":[{"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-667"],"affected":[{"ranges":[{"type":"git","introduced":"f18b03fabaa9b7c80e80b72a621f481f0d706ae0","fixed":"4eca06a55417c3b2e538656d12c89e224343653e","status":"affected"},{"type":"git","introduced":"f18b03fabaa9b7c80e80b72a621f481f0d706ae0","fixed":"c0281da1f2aa5c2fca3a05f79b86bea96591c358","status":"affected"},{"type":"git","introduced":"f18b03fabaa9b7c80e80b72a621f481f0d706ae0","fixed":"5a399f3117642494e35545f6ca397d3e177c1f9b","status":"affected"},{"type":"git","introduced":"f18b03fabaa9b7c80e80b72a621f481f0d706ae0","fixed":"6c2128505f61b504c79a20b89596feba61388112","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.7","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.7","status":"unaffected"},{"type":"semver","introduced":"6.12.114","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.21","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.11","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","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":"6.7","fixed":"6.18.21"},{"status":"affected","introduced":"6.19","fixed":"6.19.11"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/4eca06a55417c3b2e538656d12c89e224343653e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c0281da1f2aa5c2fca3a05f79b86bea96591c358","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5a399f3117642494e35545f6ca397d3e177c1f9b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6c2128505f61b504c79a20b89596feba61388112","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T21:37:35.566Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31526","url":"https://www.cve.org/CVERecord?id=CVE-2026-31526","licence":"CVE Terms of Use","modified":"2026-11-05T21:45:06.185Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31526","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31526","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.312Z","epss":{"score":0.00132,"percentile":0.02995,"date":"2026-12-01T12:00:22.000Z"}}