libthr shared locks

Eric van Gyzen vangyzen at
Tue Feb 16 14:56:44 UTC 2016

On 02/16/2016 05:32, Konstantin Belousov wrote:
> On Mon, Feb 15, 2016 at 03:39:18PM -0600, Eric van Gyzen wrote:
>> My only comment on kern_umtx.c is, why are the permission checks compiled out?
> Assume that we changed the ABI of libthr and shared locks do not require
> an offpage. Then, access to the locks is completely controlled by the
> access to the page containing the lock. If a process can mmap the page,
> it can own the lock.
> From this point of view, access to the offpage shared memory object
> is the same as the access to the key page. Which is the reason to not
> include the access permissions checks.

This makes sense.

> On the other hand, if you have something in kernel, which also owns a
> reference on ucred (for other means), you sure consider whether the usual
> access control is appropriate.

This sounds wise.  I'll keep it in mind.

> I
> definitely do not see much use of the shm_access() checks, but I am not
> completely sure about possible mac policies utilization there, although
> I do not really think they could be usefully attached to the app-level
> locks.

I would tend to agree, but I haven't used MAC for several years, so I'm
not sure either.



More information about the freebsd-threads mailing list