acl_get_link_np(name, ACL_TYPE_NFS4) on any ZFS returns NULL with errno=EINVAL. As result I have errors in ls -l output like this: # /bin/ls -ld / ls: /: Invalid argument drwxr-xr-x 19 root wheel - 25 Sep 29 14:59 / Also cp -p return 1 and buildworld fails with following messages: ===> share/zoneinfo (all) cp -p /usr/src/share/zoneinfo/yearistype.sh yearistype cp: failed to get acl entries while setting yearistype: Invalid argument *** Error code 1 Also this breaks building of some ports like www/apache22: configure.in:190: the top level rebuilding rpm spec file rebuilding srclib/apr-util/configure Looking for apr source in /var/ports/usr/ports/www/apache22/work/httpd-2.2.13/srclib/apr cp: failed to get acl entries while setting build/get-version.sh: Invalid argument cp: failed to get acl entries while setting build/config.sub: Invalid argument cp: failed to get acl entries while setting build/config.guess: Invalid argument cp: failed to get acl entries while setting build/install.sh: Invalid argument cp: failed to get acl entries while setting build/find_apr.m4: Invalid argument cp: failed to get acl entries while setting build/apr_common.m4: Invalid argument ./buildconf failed for apr-util *** Error code 1 How-To-Repeat: # zpool create tank `mdconfig -a -t swap -s 64m` # ls -ld /tank ls: /tank: Invalid argument drwxr-xr-x 2 root wheel - 2 Oct 2 12:09 /tank/
Responsible Changed From-To: freebsd-sparc64->trasz I'll take it.
In sys/kern/vfs_acl.c around line 164 I have added this check: default: +printf("%li != %i\n", fuword((char *)user_acl + offsetof(struct acl, acl_maxcnt)), ACL_MAX_ENTRIES); if (fuword((char *)user_acl + offsetof(struct acl, acl_maxcnt)) != ACL_MAX_ENTRIES) return (EINVAL); And I got many messages with: 1090921693184 != 254 I think here is a type conversion or address arithmetic error or a problem with not considered difference in byte order. IMHO, also same problem may affect NFSv4.
Author: trasz Date: Mon Oct 5 19:56:56 2009 New Revision: 197789 URL: http://svn.freebsd.org/changeset/base/197789 Log: Fix NFSv4 ACLs on sparc64. Turns out that fuword(9) fetches 64 bits instead of sizeof(int), and on sparc64 that resulted in fetching wrong value for acl_maxcnt, which in turn caused __acl_get_link(2) to fail with EINVAL. PR: sparc64/139304 Submitted by: Dmitry Afanasiev <KOT at MATPOCKuH.Ru> Modified: head/sys/kern/vfs_acl.c Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Mon Oct 5 19:29:49 2009 (r197788) +++ head/sys/kern/vfs_acl.c Mon Oct 5 19:56:56 2009 (r197789) @@ -161,7 +161,7 @@ acl_copyout(struct acl *kernel_acl, void break; default: - if (fuword((char *)user_acl + + if (fuword32((char *)user_acl + offsetof(struct acl, acl_maxcnt)) != ACL_MAX_ENTRIES) return (EINVAL); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!
Author: trasz Date: Fri Nov 6 09:39:35 2009 New Revision: 198975 URL: http://svn.freebsd.org/changeset/base/198975 Log: MFC r197789: Fix ACL support on sparc64. Turns out that fuword(9) fetches 64 bits instead of sizeof(int), and on sparc64 that resulted in fetching wrong value for acl_maxcnt, which in turn caused __acl_get_link(2) to fail with EINVAL. PR: sparc64/139304 Submitted by: Dmitry Afanasiev <KOT at MATPOCKuH.Ru> Modified: stable/8/sys/kern/vfs_acl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_acl.c ============================================================================== --- stable/8/sys/kern/vfs_acl.c Fri Nov 6 08:08:47 2009 (r198974) +++ stable/8/sys/kern/vfs_acl.c Fri Nov 6 09:39:35 2009 (r198975) @@ -161,7 +161,7 @@ acl_copyout(struct acl *kernel_acl, void break; default: - if (fuword((char *)user_acl + + if (fuword32((char *)user_acl + offsetof(struct acl, acl_maxcnt)) != ACL_MAX_ENTRIES) return (EINVAL); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Author: trasz Date: Fri Nov 6 11:29:10 2009 New Revision: 198984 URL: http://svn.freebsd.org/changeset/base/198984 Log: MFC r197789: Fix ACL support on sparc64. Turns out that fuword(9) fetches 64 bits instead of sizeof(int), and on sparc64 that resulted in fetching wrong value for acl_maxcnt, which in turn caused __acl_get_link(2) to fail with EINVAL. PR: sparc64/139304 Submitted by: Dmitry Afanasiev <KOT at MATPOCKuH.Ru> Approved by: re (kib) Modified: releng/8.0/sys/kern/vfs_acl.c Directory Properties: releng/8.0/sys/ (props changed) releng/8.0/sys/amd64/include/xen/ (props changed) releng/8.0/sys/cddl/contrib/opensolaris/ (props changed) releng/8.0/sys/contrib/dev/acpica/ (props changed) releng/8.0/sys/contrib/pf/ (props changed) releng/8.0/sys/dev/xen/xenpci/ (props changed) Modified: releng/8.0/sys/kern/vfs_acl.c ============================================================================== --- releng/8.0/sys/kern/vfs_acl.c Fri Nov 6 11:17:33 2009 (r198983) +++ releng/8.0/sys/kern/vfs_acl.c Fri Nov 6 11:29:10 2009 (r198984) @@ -161,7 +161,7 @@ acl_copyout(struct acl *kernel_acl, void break; default: - if (fuword((char *)user_acl + + if (fuword32((char *)user_acl + offsetof(struct acl, acl_maxcnt)) != ACL_MAX_ENTRIES) return (EINVAL); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"