{"id":"CVE-2025-37776","state":"PUBLISHED","title":"ksmbd: fix use-after-free in smb_break_all_levII_oplock()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in smb_break_all_levII_oplock()\n\nThere is a room in smb_break_all_levII_oplock that can cause racy issues\nwhen unlocking in the middle of the loop. This patch use read lock\nto protect whole loop.","publishedAt":"2025-05-01T13:07:14.998Z","updatedAt":"2026-08-05T11:57:27.462Z","severity":{"score":8.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"296cb5457cc6f4a754c4ae29855f8a253d52bcc6","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"d54ab1520d43e95f9b2e22d7a05fc9614192e5a5","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"d73686367ad68534257cd88a36ca3c52cb8b81d8","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"18b4fac5ef17f77fed9417d22210ceafd6525fc7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/oplock.c","fs/smb/server/oplock.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.6.88","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.25","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.4","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","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/oplock.c","fs/smb/server/oplock.h"]}],"references":["https://git.kernel.org/stable/c/296cb5457cc6f4a754c4ae29855f8a253d52bcc6","https://git.kernel.org/stable/c/d54ab1520d43e95f9b2e22d7a05fc9614192e5a5","https://git.kernel.org/stable/c/d73686367ad68534257cd88a36ca3c52cb8b81d8","https://git.kernel.org/stable/c/18b4fac5ef17f77fed9417d22210ceafd6525fc7"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:03.054Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/37xxx/CVE-2025-37776.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-37776","state":"PUBLISHED","datePublished":"2025-05-01T13:07:14.998Z","dateUpdated":"2026-08-05T11:57:27.462Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:23.939Z"},"containers":{"cna":{"title":"ksmbd: fix use-after-free in smb_break_all_levII_oplock()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in smb_break_all_levII_oplock()\n\nThere is a room in smb_break_all_levII_oplock that can cause racy issues\nwhen unlocking in the middle of the loop. This patch use read lock\nto protect whole loop."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"296cb5457cc6f4a754c4ae29855f8a253d52bcc6","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"d54ab1520d43e95f9b2e22d7a05fc9614192e5a5","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"d73686367ad68534257cd88a36ca3c52cb8b81d8","versionType":"git"},{"version":"0626e6641f6b467447c81dd7678a69c66f7746cf","status":"affected","lessThan":"18b4fac5ef17f77fed9417d22210ceafd6525fc7","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/oplock.c","fs/smb/server/oplock.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.15","versionType":"semver"},{"version":"6.6.88","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.25","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.4","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","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/oplock.c","fs/smb/server/oplock.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/296cb5457cc6f4a754c4ae29855f8a253d52bcc6"},{"url":"https://git.kernel.org/stable/c/d54ab1520d43e95f9b2e22d7a05fc9614192e5a5"},{"url":"https://git.kernel.org/stable/c/d73686367ad68534257cd88a36ca3c52cb8b81d8"},{"url":"https://git.kernel.org/stable/c/18b4fac5ef17f77fed9417d22210ceafd6525fc7"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":8.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - ksmbd is the in-kernel SMB server on TCP/445, and every trigger path (SMB2 WRITE, CREATE with O_TRUNC, SET_INFO alloc-size/rename, IOCTL copychunk/zero-data, LOCK) is driven entirely by remote SMB2 traffic. No local access is required.\nAC:L - The attacker controls both sides of the race: one connection holds the level-II oplock and simply withholds the SMB2_OPLOCK_BREAK ack, pinning the RCU-unlocked window open for up to OPLOCK_WAIT_TIME (35 s), while other connections close handles on the same inode to drive opinfo_del()/opinfo_put(). An attacker-created race with a multi-second window is reliably winnable and repeatable.\nPR:L - All call sites dereference work->tcon->share_conf, so a completed SESSION_SETUP and TREE_CONNECT are needed — any unprivileged share account (including guest where \"map to guest\" is configured) suffices, with no administrative rights. This matches the sibling post-authentication ksmbd UAFs.\nUI:N - The attacker drives every step from its own SMB connections — taking the oplock, stalling the break ack, and closing handles concurrently. No action by an administrator or any other client is needed.\nS:U - The freed object and the resulting corruption are both inside the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The ~176-byte oplock_info lives in the general kmalloc-192 cache and is remotely sprayable, so the freed object can be reclaimed with attacker-controlled bytes at the op_entry.next offset, yielding a chosen brk_op whose ->conn and ->o_lease->state dereferences give arbitrary kernel memory disclosure.\nI:H - With a controlled brk_op pointer, atomic_inc_not_zero(&brk_op->refcount) is an arbitrary-address increment write, and oplock_break() then manipulates wait-queue lists and queues work off the fake object — a use-after-free that is exploitable for control-flow hijack and arbitrary kernel code execution.\nA:H - Even unweaponized, following op_entry.next out of a freed oplock_info dereferences freed/poisoned memory and reliably oopses or panics the kernel, and the attacker can repeat the sequence to keep the SMB server down."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:57:27.462Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.6.88"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.12.25"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.14.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.15","versionEndExcluding":"6.15"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}