// For flags

CVE-2021-47366

afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server

Severity Score

"-"
*CVSS v-

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Track
*SSVC
Descriptions

In the Linux kernel, the following vulnerability has been resolved:

afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server

AFS-3 has two data fetch RPC variants, FS.FetchData and FS.FetchData64, and
Linux's afs client switches between them when talking to a non-YFS server
if the read size, the file position or the sum of the two have the upper 32
bits set of the 64-bit value.

This is a problem, however, since the file position and length fields of
FS.FetchData are *signed* 32-bit values.

Fix this by capturing the capability bits obtained from the fileserver when
it's sent an FS.GetCapabilities RPC, rather than just discarding them, and
then picking out the VICED_CAPABILITY_64BITFILES flag. This can then be
used to decide whether to use FS.FetchData or FS.FetchData64 - and also
FS.StoreData or FS.StoreData64 - rather than using upper_32_bits() to
switch on the parameter values.

This capabilities flag could also be used to limit the maximum size of the
file, but all servers must be checked for that.

Note that the issue does not exist with FS.StoreData - that uses *unsigned*
32-bit values. It's also not a problem with Auristor servers as its
YFS.FetchData64 op uses unsigned 64-bit values.

This can be tested by cloning a git repo through an OpenAFS client to an
OpenAFS server and then doing "git status" on it from a Linux afs
client[1]. Provided the clone has a pack file that's in the 2G-4G range,
the git status will show errors like:

error: packfile .git/objects/pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack does not match index
error: packfile .git/objects/pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack does not match index

This can be observed in the server's FileLog with something like the
following appearing:

Sun Aug 29 19:31:39 2021 SRXAFS_FetchData, Fid = 2303380852.491776.3263114, Host 192.168.11.201:7001, Id 1001
Sun Aug 29 19:31:39 2021 CheckRights: len=0, for host=192.168.11.201:7001
Sun Aug 29 19:31:39 2021 FetchData_RXStyle: Pos 18446744071815340032, Len 3154
Sun Aug 29 19:31:39 2021 FetchData_RXStyle: file size 2400758866
...
Sun Aug 29 19:31:40 2021 SRXAFS_FetchData returns 5

Note the file position of 18446744071815340032. This is the requested file
position sign-extended.

En el kernel de Linux, se resolvió la siguiente vulnerabilidad: afs: corrige la corrupción en las lecturas en fpos 2G-4G desde un servidor OpenAFS. AFS-3 tiene dos variantes RPC de recuperación de datos, FS.FetchData y FS.FetchData64, y conmutadores de cliente afs de Linux. entre ellos cuando se habla con un servidor que no es YFS si el tamaño de lectura, la posición del archivo o la suma de los dos tienen los 32 bits superiores establecidos del valor de 64 bits. Sin embargo, esto es un problema, ya que los campos de posición y longitud del archivo de FS.FetchData son valores *firmados* de 32 bits. Solucione este problema capturando los bits de capacidad obtenidos del servidor de archivos cuando se envía un RPC FS.GetCapabilities, en lugar de simplemente descartarlos, y luego seleccionando el indicador VICED_CAPABILITY_64BITFILES. Esto luego se puede usar para decidir si usar FS.FetchData o FS.FetchData64, y también FS.StoreData o FS.StoreData64, en lugar de usar Upper_32_bits() para activar los valores de los parámetros. Este indicador de capacidades también podría usarse para limitar el tamaño máximo del archivo, pero se deben verificar todos los servidores para eso. Tenga en cuenta que el problema no existe con FS.StoreData, que utiliza valores de 32 bits *sin firmar*. Tampoco es un problema con los servidores Auristor ya que su operación YFS.FetchData64 utiliza valores de 64 bits sin firmar. Esto se puede probar clonando un repositorio de git a través de un cliente OpenAFS en un servidor OpenAFS y luego ejecutando el "estado de git" desde un cliente afs de Linux[1]. Siempre que el clon tenga un archivo de paquete que esté en el rango 2G-4G, el estado de git mostrará errores como: error: packfile .git/objects/pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack no coincide con el índice error: packfile .git/objects/ pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack no coincide con el índice. Esto se puede observar en el FileLog del servidor y aparece algo como lo siguiente: Dom 29 de agosto 19:31:39 2021 SRXAFS_FetchData, Fid = 2303380852.491776.3263114 , Anfitrión 192.168.11.201:7001, Id 1001 dom 29 de agosto 19:31:39 2021 CheckRights: len=0, for host=192.168.11.201:7001 dom 29 de agosto 19:31:39 2021 FetchData_RXStyle: Pos 18446744071815340032, Len 3154 dom 29 de agosto 19:3 1:39 2021 FetchData_RXStyle: tamaño de archivo 2400758866 ... domingo 29 de agosto 19:31:40 2021 SRXAFS_FetchData devuelve 5 Tenga en cuenta la posición del archivo de 18446744071815340032. Esta es la posición del archivo solicitada con signo extendido.

*Credits: N/A
CVSS Scores
Attack Vector
-
Attack Complexity
-
Privileges Required
-
User Interaction
-
Scope
-
Confidentiality
-
Integrity
-
Availability
-
* Common Vulnerability Scoring System
SSVC
  • Decision:Track
Exploitation
None
Automatable
No
Tech. Impact
Partial
* Organization's Worst-case Scenario
Timeline
  • 2024-05-21 CVE Reserved
  • 2024-05-21 CVE Published
  • 2024-05-22 EPSS Updated
  • 2024-08-04 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 2.6.22 < 5.14.9
Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.22 < 5.14.9"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 2.6.22 < 5.15
Search vendor "Linux" for product "Linux Kernel" and version " >= 2.6.22 < 5.15"
en
Affected