{"id":"CVE-2026-99109","aliases":[],"title":"smb: client: reject SetEA requests that do not fit the request buffer","titleSource":"Linux","descriptionSource":"Linux","products":[{"vendor":"Linux","name":"Linux","platforms":[],"versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"9efbd764ab80fa86d2258550877a74d78a25e855","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"4aa2c106aef4bf3dfd97c30842db0767b26e8428","versionType":"git"}],"defaultStatus":"unaffected","source":"Linux","url":"https://www.cve.org/CVERecord?id=CVE-2026-99109"},{"vendor":"Linux","name":"Linux","platforms":[],"versions":[{"version":"2.6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.12","versionType":"semver"},{"version":"7.2.13","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"defaultStatus":"affected","source":"Linux","url":"https://www.cve.org/CVERecord?id=CVE-2026-99109"}],"remediation":[],"description":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: reject SetEA requests that do not fit the request buffer\n\nCIFSSMBSetEA() copies the caller's extended attribute value into the\nSMB request buffer without checking that it fits.  The requirement is\nstated in the source but was never implemented:\n\n\t/*BB add length check to see if it would fit in\n\t     negotiated SMB buffer size BB */\n\t/* if (ea_value_len > buffer_size - 512 (enough for header)) */\n\tif (ea_value_len)\n\t\tmemcpy(parm_data->list.name + name_len + 1,\n\t\t       ea_value, ea_value_len);\n\nThe only bound applied on the way in is in cifs_xattr_set():\n\n\t#define MAX_EA_VALUE_SIZE CIFSMaxBufSize\n\t...\n\tif (size > MAX_EA_VALUE_SIZE)\n\nCIFSMaxBufSize is the full payload capacity of the buffer, so a value\nof exactly that size leaves no room for the SMB header, the TRANS2\nparameter block, the fealist header and the EA name that are written\nahead of it in the same object.\n\nSendReceive() already enforces the correct limit on this very length:\n\n\tif (in_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE)\n\nbut it is called after the copy has taken place.  An unprivileged\nsetxattr(2) on an SMB1 mount with a 250-byte name and a 16384-byte\nvalue writes 16384 bytes starting 345 bytes into a 16588-byte\ncifs_request object, ending 141 bytes past it:\n\n  BUG: KASAN: slab-out-of-bounds in CIFSSMBSetEA+0xabc/0xde0\n  Write of size 16384 at addr ffff888003aa0159 by task init/68\n   __asan_memcpy+0x3c/0x60\n   CIFSSMBSetEA+0xabc/0xde0\n   cifs_xattr_set+0xd3a/0xff0\n   __vfs_setxattr+0x13e/0x1a0\n  The buggy address is located 345 bytes inside of\n   allocated 16588-byte region\n\nApply SendReceive()'s limit to the assembled request before the copy\nrather than after it, and widen the byte counters so the sum cannot\nwrap before it is tested.\n\nbyte_count is also tested against U16_MAX, because it is stored in the\n16-bit pSMB->ByteCount.  That becomes reachable when CIFSMaxBufSize is\nraised at module load, where it may be set as high as 1024*127: with a\n5-byte EA name and a 65521-byte value, count is exactly U16_MAX while\nbyte_count is 65556, and cpu_to_le16() would truncate it to 20 and\ntransmit a frame whose ByteCount does not match its length.  Testing\nbyte_count covers count as well, since byte_count is the larger of the\ntwo and count's only 16-bit consumer is written after this point.\n\ncheck_add_overflow() is evaluated first so that total_len is assigned\nbefore it is reported.","severity":"unknown","score":null,"published":"2026-10-28T10:34:27.507Z","modified":"2026-10-28T10:34:27.507Z","withdrawn":false,"knownExploited":false,"affected":[],"references":["https://git.kernel.org/stable/c/9efbd764ab80fa86d2258550877a74d78a25e855","https://git.kernel.org/stable/c/4aa2c106aef4bf3dfd97c30842db0767b26e8428"],"sources":[{"name":"CVE","id":"CVE-2026-99109","modified":"2026-10-28T10:34:27.507Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-99109"}],"assessments":[],"sourceAffected":[],"kev":{"status":"not-listed","checkedAt":"2026-10-28T20:40:31.555Z"},"coverage":[{"source":"NVD","status":"not-checked"},{"source":"GHSA","status":"not-checked"},{"source":"EUVD","status":"not-checked"},{"source":"EPSS","status":"not-checked"}],"evidence":[]}