drbd: add missing kref_get in handle_write_conflicts
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 668700b40a7c8727bbd2b3fd4fd22e0ce3f1aeb6 · < 7d483ad300fc0a06f69b019dda8f74970714baf8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drbd: add missing kref_get in handle_write_conflicts
With `two-primaries` enabled, DRBD tries to detect "concurrent" writes and handle write conflicts, so that even if you write to the same sector simultaneously on both nodes, they end up with the identical data once the writes are completed.
In handling "superseeded" writes, we forgot a kref_get, resulting in a premature drbd_destroy_device and use after free, and further to kernel crashes with symptoms.
Relevance: No one should use DRBD as a random data generator, and apparently all users of "two-primaries" handle concurrent writes correctly on layer up. That is cluster file systems use some distributed lock manager, and live migration in virtualization environments stops writes on one node before starting writes on the other node.
Which means that other than for "test cases", this code path is never taken in real life.
FYI, in DRBD 9, things are handled differently nowadays. We still detect "write conflicts", but no longer try to be smart about them. We decided to disconnect hard instead: upper layers must not submit concurrent writes. If they do, that's their fault.
From the CVE record · Linux
The Linux kernel's DRBD write-conflict handling has a use-after-free flaw. With two-primaries enabled, concurrent writes to the same sector on both nodes can trigger a kernel crash; the input does not identify an attacker route or authentication requirements.
Operators running Linux with DRBD two-primaries enabled should check their systems; affected versions are not specified.