From owner-freebsd-threads@freebsd.org Tue Feb 16 14:56:44 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FF8AAA806 for ; Tue, 16 Feb 2016 14:56:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 1793184 for ; Tue, 16 Feb 2016 14:56:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 1376CAAA804; Tue, 16 Feb 2016 14:56:44 +0000 (UTC) Delivered-To: threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 129D2AAA801; Tue, 16 Feb 2016 14:56:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id F155A82; Tue, 16 Feb 2016 14:56:43 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 2A87556B13; Tue, 16 Feb 2016 08:56:37 -0600 (CST) Subject: Re: libthr shared locks To: Konstantin Belousov References: <20151223172528.GT3625@kib.kiev.ua> <56BE69B8.9020808@FreeBSD.org> <56C24586.9050906@FreeBSD.org> <20160216113222.GY91220@kib.kiev.ua> Cc: threads@freebsd.org, arch@freebsd.org From: Eric van Gyzen X-Enigmail-Draft-Status: N1110 Message-ID: <56C338A0.2060205@FreeBSD.org> Date: Tue, 16 Feb 2016 08:56:32 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160216113222.GY91220@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2016 14:56:44 -0000 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. Cheers, Eric