From owner-freebsd-stable@freebsd.org Fri Jul 14 07:56:14 2017 Return-Path: Delivered-To: freebsd-stable@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 9365FD99E16 for ; Fri, 14 Jul 2017 07:56:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BFF78097F for ; Fri, 14 Jul 2017 07:56:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v6E7u81i004953 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 14 Jul 2017 10:56:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v6E7u81i004953 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v6E7u7HV004952; Fri, 14 Jul 2017 10:56:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 14 Jul 2017 10:56:07 +0300 From: Konstantin Belousov To: Dewayne Geraghty Cc: FreeBSD Stable Mailing List Subject: Re: Extended "system" attributes within jailed environment dont work Message-ID: <20170714075607.GQ1935@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) 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.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 07:56:14 -0000 On Fri, Jul 14, 2017 at 01:53:40PM +1000, Dewayne Geraghty wrote: > Can someone advise how I can enable extended attributes in a "system" > namespace within a jailed (or bhyve) environment? There was no guidance > in "man jail" nor "man jail.conf". Mentioning jails and bhyve in a single sentence clearly indicates serious issues with understanding either feature. > > Simple test > >From the host or base system: > # touch /a ; setextattr user t1 first /a ; getextattr user t1 /a > /a first > # touch /a ; setextattr system t2 second /a ; getextattr system t2 /a > /a second > > Within a jail: > # touch /a ; setextattr user t1 first /a ; getextattr user t1 /a > /a first > # touch /a ; setextattr system t2 second /a ; getextattr system t2 /a > setextattr: /a: failed: Operation not permitted > getextattr: /a: failed: Operation not permitted > > The impact of this is that SAMBA after 4.3 uses "system" namespace > extended attributes; hence can not provision an Active Directory within > a jailed environment. (For the inclined, this affects sysvol, and > interestingly "rsync -x" is unable to copy extended attributes, so > having consistent sysvols across a SAMBA domain may be a challenge) System namespace access is not allowed for jailed processes by design. See sys/kern/vfs_subr.c:extattr_check_cred() and a comment there explicitely mentioning the behaviour. The behaviour predates ~ year 2002, where extended attributes were introduced, and it makes sense.