{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139796","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-11-30T13:22:15.953Z","datePublished":"2026-11-30T13:38:04.755Z","dateUpdated":"2026-11-30T13:38:04.755Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-30T13:38:04.755Z"},"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."}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/cluster/heartbeat.c"],"versions":[{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"f46a0fa16ba2d27f8ef4af817006803b86fc948d","status":"affected","versionType":"git"},{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"9b153aeca9b4cdc0d220db0871ea2f6d3b82ea81","status":"affected","versionType":"git"},{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"7e21341daa3f032901a026adfb5195c6e93d6db3","status":"affected","versionType":"git"},{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"6479a6201fab97c5a4414f68d8a60deba747101f","status":"affected","versionType":"git"},{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"34d005f236ec2fe6e3aea80c7070f28261b63fd3","status":"affected","versionType":"git"},{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"2f90a8c3433854ab065d82326aa6e186a70b5b0d","status":"affected","versionType":"git"},{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"0edd3a7cd5185cbb616316731c3c5dd0e0442b4e","status":"affected","versionType":"git"},{"version":"a7f6a5fb4bde142b622706e2006ba33f793e13ed","lessThan":"0a8f258c0f012314c36b9e4818cdc0178c68f891","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/cluster/heartbeat.c"],"versions":[{"version":"2.6.16","status":"affected"},{"version":"0","lessThan":"2.6.16","status":"unaffected","versionType":"semver"},{"version":"5.10.275","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.226","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.193","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.163","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.119","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.65","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.6","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc2","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.16","versionEndExcluding":"7.4-rc2"}]}]}],"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"}}}}