From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 8 23:45:15 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 456E5473 for ; Fri, 8 Nov 2013 23:45:15 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CFD502887 for ; Fri, 8 Nov 2013 23:45:13 +0000 (UTC) Received: from server.rulingia.com (c220-239-250-249.belrs5.nsw.optusnet.com.au [220.239.250.249]) by vps.rulingia.com (8.14.7/8.14.5) with ESMTP id rA8NjABW030185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 9 Nov 2013 10:45:11 +1100 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.7/8.14.7) with ESMTP id rA8Nj5UO069142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 9 Nov 2013 10:45:05 +1100 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.7/8.14.7/Submit) id rA8Nj5Xq069141 for freebsd-hackers@freebsd.org; Sat, 9 Nov 2013 10:45:05 +1100 (EST) (envelope-from peter) Date: Sat, 9 Nov 2013 10:45:05 +1100 From: Peter Jeremy To: freebsd-hackers@freebsd.org Subject: Are extended attributes data or meta-data? Message-ID: <20131108234505.GC8321@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WChQLJJJfbwij+9x" Content-Disposition: inline X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2013 23:45:15 -0000 --WChQLJJJfbwij+9x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've been getting regular error messages logged by afpd: Nov 9 00:00:19 server afpd[1966]: sys_getextattr_size: error: Permission d= enied I have spent some time digging into it and it's triggered by extattr_get_link(2) returning EACCESS because a file is not readable, but stat(2) on the file succeeded. According to extattr(2), "[n]amed extended attributes are meta-data associated with vnodes" but the actual code for VOP_GETEXTATTR() (at least for ufs & zfs) checks for VREAD access, whereas the VOP_GETATTR() call (used by stat(2)) doesn't include any access checks (so stat(2) will succeed unless namei() fails). IMHO, this behaviour is inconsistent: The extended attributes are documented as "meta-data" and but the access checks are for "data". Which is correct? --=20 Peter Jeremy --WChQLJJJfbwij+9x Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iKYEARECAGYFAlJ9d4FfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDBCRjc3QTcyNTg5NEVCRTY0RjREN0VFRUZF OEE0N0JGRjAwRkI4ODcACgkQ/opHv/APuIdsXwCgifYKpNQPZjbFwD9/ShF0+Od9 TcQAni/HkJh9NkXA4zYgIhBZigDr6PHy =hsuY -----END PGP SIGNATURE----- --WChQLJJJfbwij+9x--