IM
IronMonkey Threat Research

CVE-2024-38621 HIGH

Published: 2024-06-21 | Last Modified: 2025-11-04 | Status: Modified

Description

In the Linux kernel, the following vulnerability has been resolved: media: stk1160: fix bounds checking in stk1160_copy_video() The subtract in this condition is reversed. The ->length is the length of the buffer. The ->bytesused is how many bytes we have copied thus far. When the condition is reversed that means the result of the subtraction is always negative but since it's unsigned then the result is a very high positive value. That means the overflow check is never true. Additionally, the ->bytesused doesn't actually work for this purpose because we're not writing to "buf->mem + buf->bytesused". Instead, the math to calculate the destination where we are writing is a bit involved. You calculate the number of full lines already written, multiply by two, skip a line if necessary so that we start on an odd numbered line, and add the offset into the line. To fix this buffer overflow, just take the actual destination where we are writing, if the offset is already out of bounds print an error and return. Otherwise, write up to buf->length bytes.

Additional Descriptions (1)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: medios: stk1160: revisión de los límites fijos en stk1160_copy_video() La resta en esta condición se invierte. La ->longitud es la longitud del búfer. El ->byteused es cuántos bytes hemos copiado hasta ahora. Cuando la condición se invierte, eso significa que el resultado de la resta siempre es negativo, pero como no tiene signo, el resultado es un valor positivo muy alto. Eso significa que la verificación de desbordamiento nunca es cierta. Además, ->bytesused en realidad no funciona para este propósito porque no estamos escribiendo en "buf->mem + buf->bytesused". En cambio, las matemáticas para calcular el destino donde estamos escribiendo son un poco complicadas. Calcula el número de líneas completas ya escritas, multiplica por dos, omite una línea si es necesario para comenzar en una línea impar y agrega el desplazamiento a la línea. Para solucionar este desbordamiento del búfer, simplemente tome el destino real donde estamos escribiendo, si el desplazamiento ya está fuera de los límites imprima un error y regrese. De lo contrario, escriba hasta buf->bytes de longitud.

CVSS Metrics

Base Score: 7.1 (HIGH)

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H

Attack VectorLOCAL
Attack ComplexityLOW
Privileges RequiredLOW
User InteractionNONE
ScopeUNCHANGED
Confidentiality ImpactHIGH
Integrity ImpactNONE
Availability ImpactHIGH

Source: [email protected]

Type: Primary

Exploitability Score: 1.8

Impact Score: 5.2

Weaknesses

Source Type Description
[email protected] Primary
en CWE-787

Affected Products

Vendor Product Version Update Type
linux linux_kernel * <built-in method update of dict object at 0x7fd39c4a7c80> Operating System
linux linux_kernel * <built-in method update of dict object at 0x7fd3854491c0> Operating System
linux linux_kernel * <built-in method update of dict object at 0x7fd36b434500> Operating System
linux linux_kernel * <built-in method update of dict object at 0x7fd3853fa640> Operating System
linux linux_kernel * <built-in method update of dict object at 0x7fd385448980> Operating System
linux linux_kernel * <built-in method update of dict object at 0x7fd38544bb80> Operating System
linux linux_kernel * <built-in method update of dict object at 0x7fd2d2495240> Operating System

Affected Configurations

Operator: OR

Vulnerable CPE
Yes cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Yes cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Yes cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Yes cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Yes cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Yes cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Yes cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

References