Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement NFSv41 ACLs through xattr #9

Closed
wants to merge 27 commits into from

Commits on Apr 5, 2021

  1. Fix ZFS_DEBUG_MODIFY assert in arc_buf_try_copy_decompressed_data

    The assert does not account for the case where there is a single
    buffer in the chain that is decompressed and has a valid
    checksum.
    
    Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
    mattmacy authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    4ce12a4 View commit details
    Browse the repository at this point in the history
  2. Use setproctitle to report progress of zfs send

    This allows parsing of zfs send progress by checking the process
    title.
    
    Doing so requires some changes to the send code in libzfs_sendrecv.c;
    primarily these changes move some of the accounting around, to allow
    for the code to be verbose as normal, or set the process title. Unlike
    BSD, setproctitle() isn't standard in Linux; I found a reference to it
    in libbsd, and included autoconf-related changes to test for that.
    
    Authored-by: Sean Eric Fagan <sef@FreeBSD.org>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    c05bed2 View commit details
    Browse the repository at this point in the history
  3. Add zfsd for FreeBSD

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    60add51 View commit details
    Browse the repository at this point in the history
  4. Add rc.d/zfs script

    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    7c19e15 View commit details
    Browse the repository at this point in the history
  5. Add packaging bits for TrueNAS SCALE

    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    6385c0d View commit details
    Browse the repository at this point in the history
  6. Add CI for building zfs package

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    sonicaj authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    2339b56 View commit details
    Browse the repository at this point in the history
  7. Update changelog for TrueNAS SCALE deb 2.0.1

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    0460d34 View commit details
    Browse the repository at this point in the history
  8. Update changelog for TrueNAS SCALE deb 2.0.2

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    2ab2387 View commit details
    Browse the repository at this point in the history
  9. Bump release to -3

    Fixes an issue with zfs-utils being unable to install due to a mismatch
    with upstream Debian.
    kmoore134 authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    46fd796 View commit details
    Browse the repository at this point in the history
  10. Update changelog for TrueNAS SCALE deb 2.0.3

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    f5180f8 View commit details
    Browse the repository at this point in the history
  11. Add dockerfile for zfs

    Signed-off-by: Waqar Ahmed <waqarahmedjoyia@live.com>
    sonicaj authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    1b0612d View commit details
    Browse the repository at this point in the history
  12. Add action to build and push docker image on master update

    Signed-off-by: Waqar Ahmed <waqarahmedjoyia@live.com>
    sonicaj authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    d18b4c9 View commit details
    Browse the repository at this point in the history
  13. Use stable tag until upstream alien package is fixed

    Signed-off-by: Waqar Ahmed <waqarahmedjoyia@live.com>
    sonicaj authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    ce857d2 View commit details
    Browse the repository at this point in the history
  14. Update branch name for docker image CI

    sonicaj authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    1fac720 View commit details
    Browse the repository at this point in the history
  15. Add check for custom TrueNAS kernel

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    anodos325 authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    64d7701 View commit details
    Browse the repository at this point in the history
  16. Update changelog for TrueNAS SCALE deb 2.0.4

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    d13fcb4 View commit details
    Browse the repository at this point in the history
  17. Advertise support for large xattrs on TrueNAS

    SB_LARGEXATTR is used in TrueNAS SCALE to indicate to the kernel
    that the filesystem supports large-size xattrs (greater than 64KiB).
    
    This flag is used to evaluate whether to allow large xattr read
    or write requests (up to 2 MiB).
    
    Signed-off-by: Andrew Walker <awalker@ixsystems.com>
    anodos325 authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    114d18c View commit details
    Browse the repository at this point in the history
  18. CI checkstyle: pin ubuntu version

    Our checkstyle doesn't work well on Ubuntu 20.04,
    temporary pin it to 18.04.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: George Melikov <mail@gmelikov.ru>
    Closes openzfs#11713
    gmelikov authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    54a4da2 View commit details
    Browse the repository at this point in the history
  19. ZTS: Use ksh and current environment for user_run

    The current user_run often does not work as expected.  Commands are run
    in a different shell, with a different environment, and all output is
    discarded.
    
    Simplify user_run to retain the current environment, eliminate eval,
    and feed the command string into ksh.  Enhance the logging for
    user_run so we can see out and err.
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#11185
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    985187b View commit details
    Browse the repository at this point in the history
  20. ZTS: Fix incorrect use of libtest in user_run by xattr_003_neg

    You can't use user_run to eval ksh functions defined in libtest unless
    you include libtest in the user shell.
    
    Fix xattr_003_neg by:
    * include libtest in the user shell
    * *then* run get_xattr
    * assert this fails
    * use variables for filenames so they don't change in the user's shell
    * don't log the contents of /etc/passwd
    * cleanup all byproducts
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#11185
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    417fa4e View commit details
    Browse the repository at this point in the history
  21. ZTS: Add tests for DOS mode attributes

    Create a new section of tests to run with acltype=off.
    
    For now the only test we have is for the DOS mode READONLY attribute on
    FreeBSD.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#11734
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    e1ed850 View commit details
    Browse the repository at this point in the history
  22. Fix regression in POSIX mode behavior

    Commit 235a856 introduced a regression in evaluation of POSIX modes
    that require group DENY entries in the internal ZFS ACL. An example
    of such a POSX mode is 007. When write_implies_delete_child is set,
    then ACE_WRITE_DATA is added to `wanted_dirperms` in prior to calling
    zfs_zaccess_common(). This occurs is zfs_zaccess_delete().
    
    Unfortunately, when zfs_zaccess_aces_check hits this particular DENY
    ACE, zfs_groupmember() is checked to determine whether access should be
    denied, and since zfs_groupmember() always returns B_TRUE on Linux and
    so this check is failed, resulting ultimately in EPERM being returned.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Andrew Walker <awalker@ixsystems.com>
    Closes openzfs#11760
    anodos325 authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    2af305a View commit details
    Browse the repository at this point in the history
  23. Work around broken alien version

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    79bb891 View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2021

  1. Implement NFSv41 ACLs through xattr

    This implements NFSv41 (RFC 5661) ACLs in a manner
    compatible with vfs_nfs4acl_xattr in Samba and
    nfs4xdr-acl-tools.
    
    There are three key areas of change in this commit:
    1) NFSv4 ACL management through system.nfs4_acl_xdr xattr.
      Install an xattr handler for "system.nfs4_acl_xdr" that
      presents an xattr containing full NFSv41 ACL structures
      generated through rpcgen using specification from the Samba
      project. This xattr is used by userspace programs to read and
      set permissions.
    
    2) add an i_op->permissions endpoint: zpl_permissions(). This
      is used by the VFS in Linux to determine whether to allow /
      deny an operation. Wherever possible, we try to avoid having
      to call zfs_access(). If kernel has NFSv4 patch for VFS, then
      perform more complete check of avaiable access mask.
    
    3) add capability-based overrides to secpolicy_vnode_access2()
      there are various situations in which ACL may need to be
      overridden based on capabilities. This logic is almost directly
      copied from Linux VFS. For instance, root needs to be able to
      always read / write ACLs (otherwise admin can get locked out
      from files).
    
    This is commit was initially inspired by work from Paul B. Henson
    to implement NFSv4.0 (RFC3530) ACLs in ZFS on Linux. Key areas of
    divergence are as follows:
    - ACL specification, xattr format, xattr name
    - Addition of handling for NFSv4 masks from Linux VFS
    - Addition of ACL overrides based on capabilities
    
    Signed-off-by: Andrew Walker <awalker@ixsystems.com>
    anodos325 committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    85dcd0c View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2021

  1. Ensure ACE_IDENTIFIER_GROUP is set when ACE_GROUP is set

    In some situations samba's nfs4acl_xattr module will set ACE_GROUP
    without setting ACE_IDENTIFIER_GROUP. This will cause zfs_setacl()
    to fail with EINVAL. Since the two are always set together, it's
    simpler to just always ensure ACE_IDENTIFIER_GROUP is set when
    ACE_GROUP is.
    anodos325 committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    6525bd0 View commit details
    Browse the repository at this point in the history
  2. Add NULL DACL support

    Some applications over the SMB protocol will get / set ACLs with
    no entries in them. Rather than fail with EINVAL, convert the
    ACL to contain single owner@ entry with an empty mask and flags.
    This avoids having to touch ZFS ACL logic (only affects getting /
    setting thorugh xattr). If we have a single ACE and it's this one,
    strip it off of the returned xattr.
    anodos325 committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    aa23646 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2021

  1. Revert change to add NULL DACL handling

    On second thought this sort of special should be handled in Samba's
    VFS rather than in ZFS.
    anodos325 committed May 2, 2021
    Configuration menu
    Copy the full SHA
    b980fba View commit details
    Browse the repository at this point in the history