[LU-9971] MR: ABA problem in lnet_discover_peer_locked Created: 11/Sep/17 Updated: 22/Sep/20 Resolved: 10/Jul/19 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.13.0, Lustre 2.12.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Amir Shehata (Inactive) | Assignee: | Amir Shehata (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Severity: | 3 | ||||||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||||||
| Description |
|
In lnet_discover_peer_locked() when we drop and re-acquire the net lock there is a possibility that the lpni might've been relinked, opening the window for an ABA problem. |
| Comments |
| Comment by Olaf Weber [ 11/Sep/17 ] |
|
Not so much an ABA problem as a use-after-free: the lp pointer might point to a different lnet_peer at the same address. Reshuffling the reference count addref and decref on lp a bit we can easily ensure that even if lpni is now linked to a different peer, at least that peer must have a different address. |
| Comment by Gerrit Updater [ 12/Sep/17 ] |
|
Olaf Weber (olaf.weber@hpe.com) uploaded a new patch: https://review.whamcloud.com/28944 |
| Comment by Gerrit Updater [ 07/Jul/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/28944/ |
| Comment by Andriy Skulysh [ 08/Jul/19 ] |
|
The patch has a defect caused by landing of |
| Comment by Gerrit Updater [ 08/Jul/19 ] |
|
Amir Shehata (ashehata@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35446 |
| Comment by Gerrit Updater [ 10/Jul/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35446/ |
| Comment by Peter Jones [ 10/Jul/19 ] |
|
Both patches landed for 2.13 |
| Comment by Gerrit Updater [ 10/Jun/20 ] |
|
Amir Shehata (ashehata@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38891 |
| Comment by Gerrit Updater [ 10/Jun/20 ] |
|
Amir Shehata (ashehata@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38892 |
| Comment by Gerrit Updater [ 01/Sep/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38891/ |