CVE-2024-50063

In the Linux kernel, the following vulnerability has been resolved: bpf: Prevent tail call between progs attached to different hooks bpf progs can be attached to kernel functions, and the attached functions can take different parameters or return different return values. If prog attached to one kernel function tail calls prog attached to another kernel function, the ctx access or return value verification could be bypassed. For example, if prog1 is attached to func1 which takes only 1 parameter and prog2 is attached to func2 which takes two parameters. Since verifier assumes the bpf ctx passed to prog2 is constructed based on func2's prototype, verifier allows prog2 to access the second parameter from the bpf ctx passed to it. The problem is that verifier does not prevent prog1 from passing its bpf ctx to prog2 via tail call. In this case, the bpf ctx passed to prog2 is constructed from func1 instead of func2, that is, the assumption for ctx access verification is bypassed. Another example, if BPF LSM prog1 is attached to hook file_alloc_security, and BPF LSM prog2 is attached to hook bpf_lsm_audit_rule_known. Verifier knows the return value rules for these two hooks, e.g. it is legal for bpf_lsm_audit_rule_known to return positive number 1, and it is illegal for file_alloc_security to return positive number. So verifier allows prog2 to return positive number 1, but does not allow prog1 to return positive number. The problem is that verifier does not prevent prog1 from calling prog2 via tail call. In this case, prog2's return value 1 will be used as the return value for prog1's hook file_alloc_security. That is, the return value rule is bypassed. This patch adds restriction for tail call to prevent such bypasses.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

25 Apr 2025, 11:15

Type Values Removed Values Added
References
  • () https://git.kernel.org/stable/c/d9a807fb7cbfad4328824186e2e4bee28f72169b -

22 Nov 2024, 17:26

Type Values Removed Values Added
References () https://git.kernel.org/stable/c/28ead3eaabc16ecc907cfb71876da028080f6356 - () https://git.kernel.org/stable/c/28ead3eaabc16ecc907cfb71876da028080f6356 - Patch
References () https://git.kernel.org/stable/c/5d5e3b4cbe8ee16b7bf96fd73a421c92a9da3ca1 - () https://git.kernel.org/stable/c/5d5e3b4cbe8ee16b7bf96fd73a421c92a9da3ca1 - Patch
References () https://git.kernel.org/stable/c/88c2a10e6c176c2860cd0659f4c0e9d20b3f64d1 - () https://git.kernel.org/stable/c/88c2a10e6c176c2860cd0659f4c0e9d20b3f64d1 - Patch
CWE NVD-CWE-noinfo
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
First Time Linux linux Kernel
Linux
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 7.8

23 Oct 2024, 15:12

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf: Evitar llamada de cola entre programas adjuntos a diferentes ganchos Los programas bpf se pueden adjuntar a funciones del kernel, y las funciones adjuntas pueden tomar diferentes parámetros o devolver diferentes valores de retorno. Si prog adjunto a una función del kernel llama de cola a prog adjunto a otra función del kernel, se podría omitir la verificación del acceso o del valor de retorno de ctx. Por ejemplo, si prog1 está adjunto a func1 que toma solo 1 parámetro y prog2 está adjunto a func2 que toma dos parámetros. Dado que el verificador asume que el bpf ctx pasado a prog2 se construye en base al prototipo de func2, el verificador permite a prog2 acceder al segundo parámetro del bpf ctx que se le pasa. El problema es que el verificador no impide que prog1 pase su bpf ctx a prog2 mediante llamada de cola. En este caso, el bpf ctx pasado a prog2 se construye a partir de func1 en lugar de func2, es decir, se omite la suposición de verificación de acceso a ctx. Otro ejemplo, si BPF LSM prog1 está conectado al gancho file_alloc_security y BPF LSM prog2 está conectado al gancho bpf_lsm_audit_rule_known. El verificador conoce las reglas de valor de retorno para estos dos ganchos, por ejemplo, es legal que bpf_lsm_audit_rule_known devuelva un número positivo 1 y es ilegal que file_alloc_security devuelva un número positivo. Por lo tanto, el verificador permite que prog2 devuelva un número positivo 1, pero no permite que prog1 devuelva un número positivo. El problema es que el verificador no impide que prog1 llame a prog2 a través de una llamada de cola. En este caso, el valor de retorno 1 de prog2 se utilizará como el valor de retorno para el gancho file_alloc_security de prog1. Es decir, se omite la regla del valor de retorno. Este parche agrega una restricción para la llamada de cola para evitar tales omisiones.

21 Oct 2024, 20:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-10-21 20:15

Updated : 2025-04-25 11:15


NVD link : CVE-2024-50063

Mitre link : CVE-2024-50063

CVE.ORG link : CVE-2024-50063


JSON object : View

Products Affected

linux

  • linux_kernel