CVE-2026-31712
JSON

8.3high

ksmbd: require minimum ACE size in smb_check_perm_dacl()

Severity
8.3high CVSS:3.1 by Linux
Exploit likelihood
0.33% (higher than 28% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ksmbd: require minimum ACE size in smb_check_perm_dacl() Both ACE-walk loops in smb_check_perm_dacl() only guard against an under-sized remaining buffer, not against an ACE whose declared `ace->size` is smaller than the struct it claims to describe: if (offsetof(struct smb_ace, access_req) > aces_size) break; ace_size = le16_to_cpu(ace->size); if (ace_size > aces_size) break; The first check only requires the 4-byte ACE header to be in bounds; it does not require access_req (4 bytes at offset 4) to be readable. An attacker who has set a crafted DACL on a file they own can declare ace->size == 4 with aces_size == 4, pass both checks, and then granted |= le32_to_cpu(ace->access_req); /* upper loop */ compare_sids(&sid, &ace->sid); /* lower loop */ reads access_req at offset 4 (OOB by up to 4 bytes) and ace->sid at offset 8 (OOB by up to CIFS_SID_BASE_SIZE + SID_MAX_SUB_AUTHORITIES * 4 bytes). Tighten both loops to require ace_size >= offsetof(struct smb_ace, sid) + CIFS_SID_BASE_SIZE which is the smallest valid on-wire ACE layout (4-byte header + 4-byte access_req + 8-byte sid base with zero sub-auths). Also reject ACEs whose sid.num_subauth exceeds SID_MAX_SUB_AUTHORITIES before letting compare_sids() dereference sub_auth[] entries. parse_sec_desc() already enforces an equivalent check (lines 441-448); smb_check_perm_dacl() simply grew weaker validation over time. Reachability: authenticated SMB client with permission to set an ACL on a file. On a subsequent CREATE against that file, the kernel walks the stored DACL via smb_check_perm_dacl() and triggers the OOB read. Not pre-auth, and the OOB read is not reflected to the attacker, but KASAN reports and kernel state corruption are possible.

Affected

Product or packageVersionsReported by
Linux Linuxfrom e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 282cbbb476b9f35793452bc461934af4c7eca169, from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before f20adc4ef7428bc485ee83fd1a592252fb87718b, from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 325d4ac11f526cb8964cff14548ccf02d8c756d8, from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 95e5aa3c3261da8c95b27d7aecf8ee39b9f86a4c, from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 90089584b2e25c4510b7b987387b4405f0673ece, from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 151b1799861fde38087c08f613abc2843ef597b0, from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before d07b26f39246a82399661936dd0c853983cfade7, 5.15
Not affected: before 5.15, from 5.15.210 up to 5.15.*, from 6.1.176 up to 6.1.*, from 6.6.140 up to 6.6.*, from 6.12.84 up to 6.12.*, from 6.18.25 up to 6.18.*
CVE List
linux linux_kernelfrom 5.15 before 6.12.84, from 6.13 before 6.18.25, from 6.19 before 7.0.2NVD

Classification

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: ksmbd: require minimum ACE size in smb_check_perm_dacl() Both ACE-walk loops in smb_check_perm_dacl() only guard against an under-sized remaining buffer, not against an ACE whose declared `ace->size` is smaller than the struct it claims to describe: if (offsetof(struct smb_ace, access_req) > aces_size) break; ace_size = le16_to_cpu(ace->size); if (ace_size > aces_size) break; The first check only requires the 4-byte ACE header to be in bounds; it does not require access_req (4 bytes at offset 4) to be readable. An attacker who has set a crafted DACL on a file they own can declare ace->size == 4 with aces_size == 4, pass both checks, and then granted |= le32_to_cpu(ace->access_req); /* upper loop */ compare_sids(&sid, &ace->sid); /* lower loop */ reads access_req at offset 4 (OOB by up to 4 bytes) and ace->sid at offset 8 (OOB by up to CIFS_SID_BASE_SIZE + SID_MAX_SUB_AUTHORITIES * 4 bytes). Tighten both loops to require ace_size >= offsetof(struct smb_ace, sid) + CIFS_SID_BASE_SIZE which is the smallest valid on-wire ACE layout (4-byte header + 4-byte access_req + 8-byte sid base with zero sub-auths). Also reject ACEs whose sid.num_subauth exceeds SID_MAX_SUB_AUTHORITIES before letting compare_sids() dereference sub_auth[] entries. parse_sec_desc() already enforces an equivalent check (lines 441-448); smb_check_perm_dacl() simply grew weaker validation over time. Reachability: authenticated SMB client with permission to set an ACL on a file. On a subsequent CREATE against that file, the kernel walks the stored DACL via smb_check_perm_dacl() and triggers the OOB read. Not pre-auth, and the OOB read is not reflected to the attacker, but KASAN reports and kernel state corruption are possible.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ksmbd: requerir tamaño mínimo de ACE en smb_check_perm_dacl() Ambos bucles de recorrido de ACE en smb_check_perm_dacl() solo protegen contra un búfer restante de tamaño insuficiente, no contra un ACE cuyo ’ace -> size’ declarado es más pequeño que la estructura que afirma describir: if (offsetof(struct smb_ace, access_req) > aces_size) break; ace_size = le16_to_cpu(ace -> size); if (ace_size > aces_size) break; La primera comprobación solo requiere que el encabezado ACE de 4 bytes esté dentro de los límites; no requiere que access_req (4 bytes en el desplazamiento 4) sea legible. Un atacante que ha establecido un DACL manipulado en un archivo de su propiedad puede declarar ace -> size == 4 con aces_size == 4, pasar ambas comprobaciones y luego granted |= le32_to_cpu(ace -> access_req); /* upper loop */ compare_sids(&sid, &ace -> sid); /* lower loop */ lee access_req en el desplazamiento 4 (fuera de límites por hasta 4 bytes) y ace -> sid en el desplazamiento 8 (fuera de límites por hasta CIFS_SID_BASE_SIZE + SID_MAX_SUB_AUTHORITIES * 4 bytes). Ajustar ambos bucles para requerir ace_size >= offsetof(struct smb_ace, sid) + CIFS_SID_BASE_SIZE que es el diseño de ACE en la red más pequeño y válido (encabezado de 4 bytes + access_req de 4 bytes + base sid de 8 bytes con cero sub-autoridades). También rechazar ACEs cuyo sid.num_subauth excede SID_MAX_SUB_AUTHORITIES antes de permitir que compare_sids() desreferencie las entradas de sub_auth[]. parse_sec_desc() ya aplica una comprobación equivalente (líneas 441-448); smb_check_perm_dacl() simplemente desarrolló una validación más débil con el tiempo. Alcanzabilidad: cliente SMB autenticado con permiso para establecer una ACL en un archivo. En un CREATE posterior contra ese archivo, el kernel recorre el DACL almacenado a través de smb_check_perm_dacl() y desencadena la lectura fuera de límites (OOB). No es pre-autenticación, y la lectura fuera de límites (OOB) no se refleja al atacante, pero los informes de KASAN y la corrupción del estado del kernel son posibles.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-31712 changed 2026-10-15CVE Terms of Use
NVDCVE-2026-31712 changed 2026-11-11Public domain