CVE-2026-64139 in Linuxinfo

Summary

by MITRE • 07/19/2026

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

ksmbd: fix SID memory leak in set_posix_acl_entries_dacl() on overflow

Commit 299f962c0b02 ("ksmbd: use check_add_overflow() to prevent u16 DACL size overflow") added check_add_overflow() guards that break out of the ACE-building loops in set_posix_acl_entries_dacl() when the accumulated DACL size would wrap past 65535.

However, each iteration allocates a struct smb_sid via kmalloc_obj() at the top of the loop and relies on the kfree(sid) call at the end of the loop body (the 'pass_same_sid' label in the first loop, and the explicit kfree at the tail of the second loop) to release it. The newly introduced 'break' statements bypass those kfree() calls, leaking the sid buffer every time an overflow is detected.

A malicious or malformed file with enough POSIX ACL entries to trip the overflow check will leak one or more struct smb_sid allocations on every request that touches the file's DACL, providing a trivial kernel memory exhaustion vector.

Free sid before breaking out of the loops to plug the leak.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 07/19/2026

The vulnerability exists within the ksmbd subsystem of the Linux kernel, specifically in the set_posix_acl_entries_dacl() function where improper memory management leads to a persistent memory leak. This flaw manifests when processing SMB file access control lists that contain an excessive number of POSIX ACL entries, triggering an overflow condition that was previously mitigated through the introduction of check_add_overflow() guards. The implementation introduces a critical oversight in the control flow where break statements bypass essential cleanup operations, creating a systematic resource depletion scenario.

The technical flaw stems from the improper handling of memory allocation within iterative processing loops that build DACL entries for SMB file access control. Each iteration of these loops allocates a struct smb_sid structure using kmalloc_obj() function at the beginning of the loop body, with the expectation that kfree(sid) calls at the end of each loop iteration would properly release these allocations. However, when overflow conditions are detected and break statements execute, these cleanup operations are circumvented entirely, leaving allocated memory unreclaimed. This creates a memory leak pattern where each overflow event results in one or more struct smb_sid buffer allocations remaining unreleased.

The operational impact of this vulnerability presents a straightforward yet severe kernel memory exhaustion vector that can be exploited through carefully crafted malformed files containing excessive POSIX ACL entries. Every request processing such files will trigger the overflow condition and subsequent memory leak, with the cumulative effect of multiple requests leading to progressive kernel memory depletion. This type of vulnerability directly maps to CWE-401 Memory Leak, representing a classic resource exhaustion attack vector that can lead to system instability or denial of service conditions.

The exploitation scenario involves creating or accessing files with sufficient POSIX ACL entries to trigger the u16 DACL size overflow check, where the check_add_overflow() function detects potential wraparound beyond 65535 bytes. When this condition is met, the break statements execute without performing the necessary kfree(sid) operations, causing each iteration to retain its allocated struct smb_sid structure. This memory leak occurs repeatedly with each file access operation that processes the affected DACL entries, creating a sustained resource consumption pattern that can gradually consume available kernel memory.

The mitigation strategy requires implementing proper memory cleanup before executing break statements in the overflow handling paths, ensuring that allocated struct smb_sid buffers are freed immediately upon detecting overflow conditions. This fix aligns with fundamental kernel security principles of resource management and proper control flow handling, where all allocated resources must be released regardless of execution path taken through conditional logic. The solution directly addresses ATT&CK technique T1499.004 Network Denial of Service by preventing memory exhaustion that could lead to system instability.

This vulnerability demonstrates the critical importance of proper resource management in kernel-space code, particularly when introducing overflow protection mechanisms that alter program control flow. The fix requires careful attention to loop termination conditions and ensures that all allocated resources are properly accounted for and released, regardless of whether normal execution paths or exceptional conditions occur. The implementation must maintain the original overflow protection functionality while ensuring complete memory cleanup during error handling scenarios.

Responsible

Linux

Reservation

07/19/2026

Disclosure

07/19/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you need the next level of professionalism?

Upgrade your account now!