{"api_version":"1","generated_at":"2026-11-30T15:13:34+00:00","cve":"CVE-2026-139796","urls":{"html":"https://cve.report/CVE-2026-139796","api":"https://cve.report/api/cve/CVE-2026-139796.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-139796","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-139796"},"summary":{"title":"ocfs2/heartbeat: serialize concurrent writes to a region's dev attribute","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2/heartbeat: serialize concurrent writes to a region's dev attribute\n\no2hb_region_dev_store() checks reg->hr_bdev_file to see if the region\nis already started, but nothing stops two writers from doing that at\nthe same time. configfs only serializes writes through the same open\nfile, so two processes that each open the dev attribute can both get\npast the check:\n\n  A: hr_bdev_file is NULL, opens file A, sets hr_bdev_file = A\n  B: hr_bdev_file is NULL, opens file B, sets hr_bdev_file = B\n  A: start fails, fput(hr_bdev_file) drops B, sets it to NULL\n  B: start fails, fput(NULL)\n\nBoth calls also use the same hr_slots, hr_slot_data and hr_tmp_block,\nso the error paths can free the slot data twice.\n\nsyzbot hit the fput(NULL) with an unbound loop device, where every\nstart fails with -EIO. With four threads doing the same thing on a\nKASAN kernel I get both crashes within a second:\n\n  BUG: KASAN: double-free in o2hb_unmap_slot_data+0x14d/0x2f0\n  BUG: kernel NULL pointer dereference, address: 0000000000000158\n\nAdd a mutex to the region and hold it in dev_store(), in the\nblock_bytes, start_block and blocks stores, and in dev_show(), since\nthey all look at hr_bdev_file. dev_store() cleans up with goto, so it\ntakes the mutex in a small wrapper rather than with guard(). The mutex\nis dropped while dev_store() waits for the heartbeat to become steady,\nwhich takes seconds, so a read of dev doesn't stall behind a start.\nhr_bdev_file is already set at that point, so other writers still get\n-EINVAL, and the cleanup after the wait retakes the mutex.\n\nWith the patch the same test ran for 10 minutes with lockdep on and\nnothing was reported. So did a second one, with a working loop device,\nthat interrupts starts during the wait while other threads read and\nwrite the attributes.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:20:13","updated_at":"2026-11-30 14:20:13"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/0a8f258c0f012314c36b9e4818cdc0178c68f891","name":"https://git.kernel.org/stable/c/0a8f258c0f012314c36b9e4818cdc0178c68f891","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/2f90a8c3433854ab065d82326aa6e186a70b5b0d","name":"https://git.kernel.org/stable/c/2f90a8c3433854ab065d82326aa6e186a70b5b0d","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/9b153aeca9b4cdc0d220db0871ea2f6d3b82ea81","name":"https://git.kernel.org/stable/c/9b153aeca9b4cdc0d220db0871ea2f6d3b82ea81","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6479a6201fab97c5a4414f68d8a60deba747101f","name":"https://git.kernel.org/stable/c/6479a6201fab97c5a4414f68d8a60deba747101f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/34d005f236ec2fe6e3aea80c7070f28261b63fd3","name":"https://git.kernel.org/stable/c/34d005f236ec2fe6e3aea80c7070f28261b63fd3","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/0edd3a7cd5185cbb616316731c3c5dd0e0442b4e","name":"https://git.kernel.org/stable/c/0edd3a7cd5185cbb616316731c3c5dd0e0442b4e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/7e21341daa3f032901a026adfb5195c6e93d6db3","name":"https://git.kernel.org/stable/c/7e21341daa3f032901a026adfb5195c6e93d6db3","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/f46a0fa16ba2d27f8ef4af817006803b86fc948d","name":"https://git.kernel.org/stable/c/f46a0fa16ba2d27f8ef4af817006803b86fc948d","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-139796","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139796","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed f46a0fa16ba2d27f8ef4af817006803b86fc948d git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed 9b153aeca9b4cdc0d220db0871ea2f6d3b82ea81 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed 7e21341daa3f032901a026adfb5195c6e93d6db3 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed 6479a6201fab97c5a4414f68d8a60deba747101f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed 34d005f236ec2fe6e3aea80c7070f28261b63fd3 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed 2f90a8c3433854ab065d82326aa6e186a70b5b0d git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed 0edd3a7cd5185cbb616316731c3c5dd0e0442b4e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected a7f6a5fb4bde142b622706e2006ba33f793e13ed 0a8f258c0f012314c36b9e4818cdc0178c68f891 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 2.6.16","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 2.6.16 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.275 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.226 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.193 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.119 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.65 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.6 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc2 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/ocfs2/cluster/heartbeat.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"f46a0fa16ba2d27f8ef4af817006803b86fc948d","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"},{"lessThan":"9b153aeca9b4cdc0d220db0871ea2f6d3b82ea81","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"},{"lessThan":"7e21341daa3f032901a026adfb5195c6e93d6db3","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"},{"lessThan":"6479a6201fab97c5a4414f68d8a60deba747101f","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"},{"lessThan":"34d005f236ec2fe6e3aea80c7070f28261b63fd3","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"},{"lessThan":"2f90a8c3433854ab065d82326aa6e186a70b5b0d","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"},{"lessThan":"0edd3a7cd5185cbb616316731c3c5dd0e0442b4e","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"},{"lessThan":"0a8f258c0f012314c36b9e4818cdc0178c68f891","status":"affected","version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/ocfs2/cluster/heartbeat.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"2.6.16"},{"lessThan":"2.6.16","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.275","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.226","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.193","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.119","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.65","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc2","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.275","versionStartIncluding":"2.6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.226","versionStartIncluding":"2.6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.193","versionStartIncluding":"2.6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"2.6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.119","versionStartIncluding":"2.6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.65","versionStartIncluding":"2.6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6","versionStartIncluding":"2.6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc2","versionStartIncluding":"2.6.16","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2/heartbeat: serialize concurrent writes to a region's dev attribute\n\no2hb_region_dev_store() checks reg->hr_bdev_file to see if the region\nis already started, but nothing stops two writers from doing that at\nthe same time. configfs only serializes writes through the same open\nfile, so two processes that each open the dev attribute can both get\npast the check:\n\n  A: hr_bdev_file is NULL, opens file A, sets hr_bdev_file = A\n  B: hr_bdev_file is NULL, opens file B, sets hr_bdev_file = B\n  A: start fails, fput(hr_bdev_file) drops B, sets it to NULL\n  B: start fails, fput(NULL)\n\nBoth calls also use the same hr_slots, hr_slot_data and hr_tmp_block,\nso the error paths can free the slot data twice.\n\nsyzbot hit the fput(NULL) with an unbound loop device, where every\nstart fails with -EIO. With four threads doing the same thing on a\nKASAN kernel I get both crashes within a second:\n\n  BUG: KASAN: double-free in o2hb_unmap_slot_data+0x14d/0x2f0\n  BUG: kernel NULL pointer dereference, address: 0000000000000158\n\nAdd a mutex to the region and hold it in dev_store(), in the\nblock_bytes, start_block and blocks stores, and in dev_show(), since\nthey all look at hr_bdev_file. dev_store() cleans up with goto, so it\ntakes the mutex in a small wrapper rather than with guard(). The mutex\nis dropped while dev_store() waits for the heartbeat to become steady,\nwhich takes seconds, so a read of dev doesn't stall behind a start.\nhr_bdev_file is already set at that point, so other writers still get\n-EINVAL, and the cleanup after the wait retakes the mutex.\n\nWith the patch the same test ran for 10 minutes with lockdep on and\nnothing was reported. So did a second one, with a working loop device,\nthat interrupts starts during the wait while other threads read and\nwrite the attributes."}],"providerMetadata":{"dateUpdated":"2026-11-30T13:38:04.755Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/f46a0fa16ba2d27f8ef4af817006803b86fc948d"},{"url":"https://git.kernel.org/stable/c/9b153aeca9b4cdc0d220db0871ea2f6d3b82ea81"},{"url":"https://git.kernel.org/stable/c/7e21341daa3f032901a026adfb5195c6e93d6db3"},{"url":"https://git.kernel.org/stable/c/6479a6201fab97c5a4414f68d8a60deba747101f"},{"url":"https://git.kernel.org/stable/c/34d005f236ec2fe6e3aea80c7070f28261b63fd3"},{"url":"https://git.kernel.org/stable/c/2f90a8c3433854ab065d82326aa6e186a70b5b0d"},{"url":"https://git.kernel.org/stable/c/0edd3a7cd5185cbb616316731c3c5dd0e0442b4e"},{"url":"https://git.kernel.org/stable/c/0a8f258c0f012314c36b9e4818cdc0178c68f891"}],"title":"ocfs2/heartbeat: serialize concurrent writes to a region's dev attribute","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-139796","datePublished":"2026-11-30T13:38:04.755Z","dateReserved":"2026-11-30T13:22:15.953Z","dateUpdated":"2026-11-30T13:38:04.755Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:20:13","lastModifiedDate":"2026-11-30 14:20:13","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"139796","Ordinal":"1","Title":"ocfs2/heartbeat: serialize concurrent writes to a region's dev a","CVE":"CVE-2026-139796","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"139796","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2/heartbeat: serialize concurrent writes to a region's dev attribute\n\no2hb_region_dev_store() checks reg->hr_bdev_file to see if the region\nis already started, but nothing stops two writers from doing that at\nthe same time. configfs only serializes writes through the same open\nfile, so two processes that each open the dev attribute can both get\npast the check:\n\n  A: hr_bdev_file is NULL, opens file A, sets hr_bdev_file = A\n  B: hr_bdev_file is NULL, opens file B, sets hr_bdev_file = B\n  A: start fails, fput(hr_bdev_file) drops B, sets it to NULL\n  B: start fails, fput(NULL)\n\nBoth calls also use the same hr_slots, hr_slot_data and hr_tmp_block,\nso the error paths can free the slot data twice.\n\nsyzbot hit the fput(NULL) with an unbound loop device, where every\nstart fails with -EIO. With four threads doing the same thing on a\nKASAN kernel I get both crashes within a second:\n\n  BUG: KASAN: double-free in o2hb_unmap_slot_data+0x14d/0x2f0\n  BUG: kernel NULL pointer dereference, address: 0000000000000158\n\nAdd a mutex to the region and hold it in dev_store(), in the\nblock_bytes, start_block and blocks stores, and in dev_show(), since\nthey all look at hr_bdev_file. dev_store() cleans up with goto, so it\ntakes the mutex in a small wrapper rather than with guard(). The mutex\nis dropped while dev_store() waits for the heartbeat to become steady,\nwhich takes seconds, so a read of dev doesn't stall behind a start.\nhr_bdev_file is already set at that point, so other writers still get\n-EINVAL, and the cleanup after the wait retakes the mutex.\n\nWith the patch the same test ran for 10 minutes with lockdep on and\nnothing was reported. So did a second one, with a working loop device,\nthat interrupts starts during the wait while other threads read and\nwrite the attributes.","Type":"Description","Title":"ocfs2/heartbeat: serialize concurrent writes to a region's dev a"}]}}}