CVE-2026-99109: smb: client: reject SetEA requests that do not fit the request buffer
In the Linux kernel, the following vulnerability has been resolved:
smb: client: reject SetEA requests that do not fit the request buffer
CIFSSMBSetEA() copies the caller's extended attribute value into the SMB request buffer without checking that it fits. The requirement is stated in the source but was never implemented:
/BB add length check to see if it would fit in negotiated SMB buffer size BB / / if (eavaluelen > buffersize - 512 (enough for header)) / if (eavaluelen) memcpy(parmdata->list.name + namelen + 1, eavalue, eavaluelen);
The only bound applied on the way in is in cifsxattrset():
#define MAXEAVALUESIZE CIFSMaxBufSize ... if (size > MAXEAVALUESIZE)
CIFSMaxBufSize is the full payload capacity of the buffer, so a value of exactly that size leaves no room for the SMB header, the TRANS2 parameter block, the fealist header and the EA name that are written ahead of it in the same object.
SendReceive() already enforces the correct limit on this very length:
if (inlen > CIFSMaxBufSize + MAXCIFSHDRSIZE)
but it is called after the copy has taken place. An unprivileged setxattr(2) on an SMB1 mount with a 250-byte name and a 16384-byte value writes 16384 bytes starting 345 bytes into a 16588-byte cifsrequest object, ending 141 bytes past it:
BUG: KASAN: slab-out-of-bounds in CIFSSMBSetEA+0xabc/0xde0 Write of size 16384 at addr ffff888003aa0159 by task init/68 asanmemcpy+0x3c/0x60 CIFSSMBSetEA+0xabc/0xde0 cifsxattrset+0xd3a/0xff0 vfssetxattr+0x13e/0x1a0 The buggy address is located 345 bytes inside of allocated 16588-byte region
Apply SendReceive()'s limit to the assembled request before the copy rather than after it, and widen the byte counters so the sum cannot wrap before it is tested.
bytecount is also tested against U16MAX, because it is stored in the 16-bit pSMB->ByteCount. That becomes reachable when CIFSMaxBufSize is raised at module load, where it may be set as high as 1024127: with a 5-byte EA name and a 65521-byte value, count is exactly U16MAX while bytecount is 65556, and cputole16() would truncate it to 20 and transmit a frame whose ByteCount does not match its length. Testing bytecount covers count as well, since bytecount is the larger of the two and count's only 16-bit consumer is written after this point.
checkaddoverflow() is evaluated first so that totallen is assigned before it is reported.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.2.13 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.2.13-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1Fixed in 7.3.4-1 - Compensating control
In the Linux kernel SMB client’s CIFSSMBSetEA(), validate the assembled request against SendReceive()’s limit before copying the EA value, and widen the byte counters so the total cannot wrap before being checked against U16_MAX.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems with an SMB1 mount are exposed when a local user can set extended attributes on that mount. The described trigger uses an unprivileged setxattr(2) call.
What input is needed to trigger the overflow condition?
The extended attribute value must be accepted by the client-side maximum-size check but leave insufficient room in the SMB request buffer for protocol headers and EA metadata. The description gives an example using a 250-byte name and a 16,384-byte value.
Does the existing maximum EA value-size check prevent exploitation?
No. The check permits values up to CIFSMaxBufSize, but that represents the full payload capacity and does not reserve space for the SMB header, TRANS2 parameter block, FEALIST header, and EA name.
Can the later SendReceive() length validation protect against this issue?
No. SendReceive() enforces the appropriate request-length limit only after CIFSSMBSetEA() has copied the extended attribute value into the request buffer.