ocfs2: cluster: don't sleep while holding o2hb_live_lock in o2hb_region_pin()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 58a3158a5d17ddf4894db9e8ccaf92093ff8e42e · < ce035f208d68b812d83e5482980f2b1c88a9cd94| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: cluster: don't sleep while holding o2hb_live_lock in o2hb_region_pin()
Patch series "ocfs2: cluster: o2hb_region_pin() fixes", v2.
This series fixes three related issues in o2hb_region_pin(), all are from the original implementation in commit: 58a3158a5d17 ("ocfs2/cluster: Pin/unpin o2hb regions"):
1) It is called with o2hb_live_lock (a spinlock) held, but the underlying configfs_depend_item() sleeps (takes inode rwsem and pins the filesystem). This triggers BUG under CONFIG_DEBUG_ATOMIC_SLEEP.
2) When called from the configfs drop_item callback, it creates a lock order inversion: parent inode_lock -> configfs root inode_lock, which can deadlock against subsystem unregistration paths taking root -> parent.
3) If pinning fails partway through o2hb_region_inc_user(), the o2hb_dependent_users counter is leaked and partially-pinned regions are never released, leaving heartbeat regions unprotected on subsequent mounts.
Patch 1 reworks o2hb_region_pin() to drop o2hb_live_lock across each sleeping configfs_depend_item() call, using a config_item reference to keep the region alive while unlocked.
From the CVE record · Linux
The ocfs2 heartbeat code can sleep while holding a spinlock during an OCFS2 mount, triggering a kernel BUG when CONFIG_DEBUG_ATOMIC_SLEEP is enabled. The input does not describe an attacker path or specify network access, authentication, or user-interaction requirements.
Engineers running Linux kernels with ocfs2 should check their exposure; affected versions are not specified.