ocfs2/dlm: hold the lookup reference across convert AST enqueue
NIST has received this entry but not started reviewing it.
In the Linux kernel, the following vulnerability has been resolved: ocfs2/dlm: hold the lookup reference across convert AST enqueue dlm_convert_lock_handler() drops the reference it took when it found the lock on res->granted at its leave label, one statement before it calls dlm_queue_ast(). dlm_free_dead_locks() takes res->spinlock and drops the list and base references, so a peer death landing in that gap leaves the handler's own put as the one that frees the lock, and __dlm_queue_ast() then reads lock->lockres from freed memory. The handler is registered next to dlm_create_lock_handler(), so a convert message buffered on a dying peer's socket arrives on the same o2net receive work that o2net_disconnect_node() does not wait for. The two can interleave as follows, with the reference counts as they are before this fix: Socket data-ready Node-down thread Receive worker ----------------- ---------------- -------------- o2net_data_ready() select sc under callback read lock o2net_disconnect_node() queue shutdown begin flush; new color queue sc_rx_work in the new color release callback lock shutdown socket flush returns read buffered convert_lock dlm_convert_lock_handler() find lock on res->granted dlm_lock_get() refs = 3 lock res->spinlock __dlmconvert_master() call_ast = 1 unlock res->spinlock DLM node-down cleanup lock res->spinlock dlm_free_dead_locks() unlink lock put list ref refs = 2 put base ref refs = 1 unlock res->spinlock dlm_lock_put() refs = 0 free lock dlm_queue_ast() __dlm_queue_ast() read lock->lockres (use-after-free) __dlmconvert_master() only moves the lock between lists, so the count entering the gap is base, list and lookup. Drop the lookup reference after the AST is queued instead of before it and the race ends with the one __dlm_queue_ast() took, which dlm_flush_asts() releases later with ast_pending cleared and ast_list unlinked. No extra get is needed, and the normal case ends with the same count as before. dlmconvert_master() has the same shape but is only reached from dlmlock() for a lock this node owns, which dlm_free_dead_locks() never matches.
New to this? Read how to keep your software updated.
The products and versions NIST lists as vulnerable, 2 products in all. If what you run is not listed it is probably not affected, but ask your provider if you are unsure.
| Product | Type | Vulnerable versions | Fixed in |
|---|---|---|---|
| Linux Linux | Software | from 2c5c54aca9d0263f81bd4886232835ba31f7635a, before a57126a2f5a81232b3453fab8fd9f2f8fcf27017; from 2c5c54aca9d0263f81bd4886232835ba31f7635a, before 059d951ef87959435d6f1126ed7d2305dc836d45; from 2c5c54aca9d0263f81bd4886232835ba31f7635a, before c736487fc0b933238ca59ec976dbd628c6ba1bf7; from 2c5c54aca9d0263f81bd4886232835ba31f7635a, before 7b8a7bb21a478dc1f0212f99bbfa017f2ee566d0; from 2c5c54aca9d0263f81bd4886232835ba31f7635a, before ecc5b17b8d2b1f720262e991896da2c909154a4d; from 2c5c54aca9d0263f81bd4886232835ba31f7635a, before a3dd8d3af023837516d8715393acbaa7b252f6d7; and 2 more | a57126a2f5a81232b3453fab8fd9f2f8fcf27017; 059d951ef87959435d6f1126ed7d2305dc836d45; c736487fc0b933238ca59ec976dbd628c6ba1bf7; 7b8a7bb21a478dc1f0212f99bbfa017f2ee566d0 |
| Linux Linux | Software | 2.6.25 | not recorded |
The 8.8 severity score (high) from the company that reported it, broken into what it means in practice. Red means it makes the flaw easier or worse.
| How it is reached | Network | Can be attacked from anywhere on the internet, with no need to be near the target. |
| How hard it is | Low | Easy to carry out. No special conditions have to line up. |
| Login needed | Low | The attacker needs an ordinary user account. |
| Someone has to act | None | Nobody has to click or open anything. It can happen on its own. |
| Reaches beyond the program | Unchanged | The damage stays inside the vulnerable program. |
| Data exposed | High | Total loss of confidentiality: the attacker can read all the data the program can reach. |
| Data changed | High | The attacker can change or delete anything the program can reach. |
| Service disrupted | High | The attacker can take the service down completely. |
| Ease of attack | 2.8 | A score for how easy it is to use the flaw. Higher is easier. |
| Damage | 5.9 | A score for how bad the harm is if it works. Higher is worse. |
NIST lists 8 sources for this flaw, none tagged as a vendor patch.