We were not acquiring the global sysvshm lock when handling cleanup of
sysvshm segments. Acquire the lock in shm_prison_cleanup() instead, to
be consistent with the sysv semaphore code.
Details
Details
- Reviewers
jamie - Group Reviewers
Jails - Commits
- rG546d15061962: sysvshm: Fix locking in shm_prison_set()
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Look good. I was hesitant because it's an sx lock, but I don't see any mutexes held when it's locked. I suspect that hesitance was why I didn't do it tthe same as sysv_sem and sysv_msg in the first place, but that was a while ago and has totally escaped my memory.
Comment Actions
For what it's worth I tested this a bit (and confirmed as well that the bug is there, since shm_deallocate_segment() asserts that the global lock is held) and didn't see any warnings from witness either.