Page MenuHomeFreeBSD

Code must not unlock a mutex while owning the thread lock.
ClosedPublic

Authored by kib on Jan 13 2020, 10:24 AM.

Details

Summary

Sponsored by: Mellanox Technologies

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 28633

Event Timeline

kib created this revision.Jan 13 2020, 10:24 AM

sys/compat/linuxkpi/common/src/linux_rcu.c has same bug. Please also fix there.

Should thread_lock() assert Giant not owned?

kib added a comment.Jan 13 2020, 10:52 AM

Should thread_lock() assert Giant not owned?

I do not think so. It might make sense to make a witness assert that no sleepable mutexes are owned, but really the check for recursion in the thread_lock_flags() catches the problematic cases.

kib updated this revision to Diff 66678.Jan 13 2020, 10:53 AM

Also change linux RCU code.

hselasky accepted this revision.Jan 13 2020, 10:56 AM
This revision is now accepted and ready to land.Jan 13 2020, 10:56 AM

Don't forget to MFC.

markj accepted this revision.Jan 13 2020, 1:40 PM
This revision was automatically updated to reflect the committed changes.