From nobody@FreeBSD.org Fri Oct 2 08:10:38 2009 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E27B11065670 for ; Fri, 2 Oct 2009 08:10:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2158FC18 for ; Fri, 2 Oct 2009 08:10:38 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n928Ac4t078949 for ; Fri, 2 Oct 2009 08:10:38 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n928Acck078948; Fri, 2 Oct 2009 08:10:38 GMT (envelope-from nobody) Message-Id: <200910020810.n928Acck078948@www.freebsd.org> Date: Fri, 2 Oct 2009 08:10:38 GMT From: Dmitry Afanasiev To: freebsd-gnats-submit@FreeBSD.org Subject: acl_get_link_np() fails with "Invalid argument" on ZFS X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 139304 >Category: sparc64 >Synopsis: acl_get_link_np() fails with "Invalid argument" on ZFS >Confidential: no >Severity: critical >Priority: high >Responsible: trasz >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 02 08:20:01 UTC 2009 >Closed-Date: Mon Oct 05 19:57:15 UTC 2009 >Last-Modified: Fri Nov 6 11:30:07 UTC 2009 >Originator: Dmitry Afanasiev >Release: FreeBSD 9.0-CURRENT sparc64 >Organization: >Environment: FreeBSD sunrise-new 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Wed Sep 30 12:29:46 MSD 2009 root@sunrise-new:/usr/obj/usr/src/sys/sunrise sparc64 >Description: 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/ >Fix: >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-sparc64->trasz Responsible-Changed-By: trasz Responsible-Changed-When: Fri Oct 2 10:23:28 UTC 2009 Responsible-Changed-Why: I'll take it. http://www.freebsd.org/cgi/query-pr.cgi?pr=139304 From: Dmitry Afanasiev To: bug-followup@FreeBSD.org Cc: Subject: Re: sparc64/139304: acl_get_link_np() fails with "Invalid argument" on ZFS Date: Mon, 05 Oct 2009 11:39:01 +0400 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. State-Changed-From-To: open->closed State-Changed-By: trasz State-Changed-When: Mon Oct 5 19:57:14 UTC 2009 State-Changed-Why: Committed. Thanks! http://www.freebsd.org/cgi/query-pr.cgi?pr=139304 From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: sparc64/139304: commit references a PR Date: Mon, 5 Oct 2009 19:57:06 +0000 (UTC) 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 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" From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: sparc64/139304: commit references a PR Date: Fri, 6 Nov 2009 09:39:50 +0000 (UTC) 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 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" From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: sparc64/139304: commit references a PR Date: Fri, 6 Nov 2009 11:29:24 +0000 (UTC) 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 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" >Unformatted: