{"id":"CVE-2026-139165","state":"PUBLISHED","title":"ksmbd: avoid races between named-pipe operations","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: avoid races between named-pipe operations\n\nRPC IPC replies are matched by pipe handle. READ, WRITE, TRANSCEIVE and\nCLOSE on the same pipe all use that handle. The session RPC lock protects\nthe handle table, but is dropped before a pipe I/O request waits for its\nreply. Another operation, including CLOSE, can issue a request with the\nsame handle while that wait is still in progress.\n\nThese requests have no separate IPC correlation ID, so overlapping waits\ncan interfere with reply delivery. CLOSE can also release the handle\nbefore an earlier operation finishes. Protecting table access alone does\nnot provide the serialization or lifetime needed by an active pipe.\n\nSerialize operations per pipe and keep its state and handle alive until\nall users finish. Avoid holding the session table lock across IPC waits,\nso a blocked pipe does not hold up unrelated pipes. This also provides\nthe lifetime needed to retain unread replies in the following patch.\n\nRecheck cancellation, connection release and session teardown after taking\nthe pipe lock, and mark a removed pipe closed before waiting for its active\noperation. Close all session RPC pipes on logoff after the other requests\nhave drained; keeping the TCP connection open must not retain old handles.\nUse standard SMB2 error replies for failed pipe operations while preserving\nthe selected status.","publishedAt":"2026-11-30T13:32:11.026Z","updatedAt":"2026-11-30T13:32:11.026Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"dbb4b1d59549a3000d4ba4aca0d0abd05066bd79","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"a43e0718a4abed7f859a67bd7b154acf213589fa","versionType":"git"},{"version":"0","status":"affected","lessThan":"7.3.6","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h","fs/smb/server/smb2pdu.c","fs/smb/server/transport_ipc.c","fs/smb/server/transport_ipc.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h","fs/smb/server/smb2pdu.c","fs/smb/server/transport_ipc.c","fs/smb/server/transport_ipc.h"]}],"references":["https://git.kernel.org/stable/c/dbb4b1d59549a3000d4ba4aca0d0abd05066bd79","https://git.kernel.org/stable/c/a43e0718a4abed7f859a67bd7b154acf213589fa"],"weaknesses":[],"ingestedAt":"2026-11-30T13:44:05.999Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139165.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139165","state":"PUBLISHED","datePublished":"2026-11-30T13:32:11.026Z","dateUpdated":"2026-11-30T13:32:11.026Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.918Z"},"containers":{"cna":{"title":"ksmbd: avoid races between named-pipe operations","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: avoid races between named-pipe operations\n\nRPC IPC replies are matched by pipe handle. READ, WRITE, TRANSCEIVE and\nCLOSE on the same pipe all use that handle. The session RPC lock protects\nthe handle table, but is dropped before a pipe I/O request waits for its\nreply. Another operation, including CLOSE, can issue a request with the\nsame handle while that wait is still in progress.\n\nThese requests have no separate IPC correlation ID, so overlapping waits\ncan interfere with reply delivery. CLOSE can also release the handle\nbefore an earlier operation finishes. Protecting table access alone does\nnot provide the serialization or lifetime needed by an active pipe.\n\nSerialize operations per pipe and keep its state and handle alive until\nall users finish. Avoid holding the session table lock across IPC waits,\nso a blocked pipe does not hold up unrelated pipes. This also provides\nthe lifetime needed to retain unread replies in the following patch.\n\nRecheck cancellation, connection release and session teardown after taking\nthe pipe lock, and mark a removed pipe closed before waiting for its active\noperation. Close all session RPC pipes on logoff after the other requests\nhave drained; keeping the TCP connection open must not retain old handles.\nUse standard SMB2 error replies for failed pipe operations while preserving\nthe selected status."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"dbb4b1d59549a3000d4ba4aca0d0abd05066bd79","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"a43e0718a4abed7f859a67bd7b154acf213589fa","versionType":"git"},{"version":"0","status":"affected","lessThan":"7.3.6","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h","fs/smb/server/smb2pdu.c","fs/smb/server/transport_ipc.c","fs/smb/server/transport_ipc.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/mgmt/user_session.c","fs/smb/server/mgmt/user_session.h","fs/smb/server/smb2pdu.c","fs/smb/server/transport_ipc.c","fs/smb/server/transport_ipc.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/dbb4b1d59549a3000d4ba4aca0d0abd05066bd79"},{"url":"https://git.kernel.org/stable/c/a43e0718a4abed7f859a67bd7b154acf213589fa"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:32:11.026Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}