From owner-svn-src-all@FreeBSD.ORG Mon Jul 7 06:24:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E05E6791; Mon, 7 Jul 2014 06:24:03 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 829E22E8B; Mon, 7 Jul 2014 06:24:03 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s676Nvig050827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Jul 2014 09:23:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s676Nvig050827 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s676Nvpf050826; Mon, 7 Jul 2014 09:23:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 7 Jul 2014 09:23:57 +0300 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r268087 - head/sys/kern Message-ID: <20140707062357.GF93733@kib.kiev.ua> References: <201407010921.s619LXHL063077@svn.freebsd.org> <20140701114245.GO93733@kib.kiev.ua> <20140701115612.GA26696@dft-labs.eu> <20140701123058.GP93733@kib.kiev.ua> <20140701125410.GB26696@dft-labs.eu> <20140701180903.GT93733@kib.kiev.ua> <20140706211850.GA17706@dft-labs.eu> <20140706213900.GB17706@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YKGyq5YQxDjF8U6+" Content-Disposition: inline In-Reply-To: <20140706213900.GB17706@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2014 06:24:04 -0000 --YKGyq5YQxDjF8U6+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 06, 2014 at 11:39:00PM +0200, Mateusz Guzik wrote: > On Sun, Jul 06, 2014 at 11:18:51PM +0200, Mateusz Guzik wrote: > > On Tue, Jul 01, 2014 at 09:09:03PM +0300, Konstantin Belousov wrote: > > > On Tue, Jul 01, 2014 at 02:54:10PM +0200, Mateusz Guzik wrote: > > > > It is passed down to MAC (mac_vnode_execve_will_transition and > > > > mac_vnode_execve_transition) and then vfs_mark_atime. > > > And we can lock it only there. > > >=20 > >=20 > > I don't see how this code could be reorganized to reduce vnode lock > > coverage and not add unlock + lock pair to the common case (no hwpmc and > > no credential change). > >=20 > > vfs_mark_atime is only called when execve cannot return an error > > anymore, with vnode locked and proc unlocked. Moving it before hwpmc > > checks would require additional pair of proc unlock/lock. > >=20 > > That said, I would prefer to just commit previously proposed fixup. > >=20 Ok. >=20 > hm, I only now notice that fexecve case does: > vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY) >=20 > I guess this can be safely changed to LK_SHARED. No, it cannot. The VV_TEXT flag must be handled under the exclusive lock. --YKGyq5YQxDjF8U6+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTujz9AAoJEJDCuSvBvK1B9xQQAJKAK5B6rrkQhaQfF/Aq7U26 rxlDFM9TRW2XY9M6NSAGYd9f47VfHqGKCcdfW3RANj2mJkAPBz9ZtAuQcQnhQFox 77nAiLi4XTGe8+cV9ZhSAsEpP7mG47etyqN7mi7Q9zg/spVOLUeL6hvxuV7W/QUZ aPgZBNR8+Oe5Wvu9+SvrM4vhxxEY/Ns1mrcrZsCMGVWWKq1KvrVLSkgXlHl5S6aJ xY1t6RVcOq3TAqqNMPD3MmBdpnc7l7Sjgx14WLbGN8ZjcZznwu0P17QYvxa+h0Pb 38HGUwGkFZaPlJIQzBtu04SRZJGpbhHrTQ0t3cNS9jII5sz0ARV/XoMS/HOtC9vy ETnHtt+La4E0u3cAvEwRO3JvJh19cHHOSDm+B3jv+0wHDIQ/IU71ZqUaKf8365YK HNlUBjc2GrW0U7yAYTd4WYaWNnfDyRnuNuyeh+x+f4poWcxzeN5FG1wegSb2upWP 48wpxAHPFFlxbgTqBX+DmUtxliiPHgMkvQPFKabLGbXXayPLmRzCdqn12iWBJ3Hr wy/xMU6fpY77fwn6U5eODtjkFpKlzSo6O9bxyD6Nvv4+HrHnmq80trAxQndM2ffD 7ditGe/IvNdotTHQdUzgnsZq42Mq548EsU87gHfLqTOijmXPyWscY7QzoR3X+8Tn 2r+2+gberebDSdVVzYxB =DL2z -----END PGP SIGNATURE----- --YKGyq5YQxDjF8U6+--