21 Dec, 2009

1 commit


17 Dec, 2009

3 commits

  • * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (38 commits)
    direct I/O fallback sync simplification
    ocfs: stop using do_sync_mapping_range
    cleanup blockdev_direct_IO locking
    make generic_acl slightly more generic
    sanitize xattr handler prototypes
    libfs: move EXPORT_SYMBOL for d_alloc_name
    vfs: force reval of target when following LAST_BIND symlinks (try #7)
    ima: limit imbalance msg
    Untangling ima mess, part 3: kill dead code in ima
    Untangling ima mess, part 2: deal with counters
    Untangling ima mess, part 1: alloc_file()
    O_TRUNC open shouldn't fail after file truncation
    ima: call ima_inode_free ima_inode_free
    IMA: clean up the IMA counts updating code
    ima: only insert at inode creation time
    ima: valid return code from ima_inode_alloc
    fs: move get_empty_filp() deffinition to internal.h
    Sanitize exec_permission_lite()
    Kill cached_lookup() and real_lookup()
    Kill path_lookup_open()
    ...

    Trivial conflicts in fs/direct-io.c

    Linus Torvalds
     
  • Kill the 'update' argument of ima_path_check(), kill
    dead code in ima.

    Current rules: ima counters are bumped at the same time
    when the file switches from put_filp() fodder to fput()
    one. Which happens exactly in two places - alloc_file()
    and __dentry_open(). Nothing else needs to do that at
    all.

    Signed-off-by: Al Viro

    Al Viro
     
  • * do ima_get_count() in __dentry_open()
    * stop doing that in followups
    * move ima_path_check() to right after nameidata_to_filp()
    * don't bump counters on it

    Signed-off-by: Al Viro

    Al Viro
     

16 Dec, 2009

9 commits

  • The new .h files have paths at the top that are now out of date. While
    we're here, just remove all of those from fs/nfsd; they never served any
    purpose.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Most of this can be trivially moved to a private header as well.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • I can't see any use for writeable V4ROOT exports.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • On V4ROOT exports, only accept filehandles that are the *root* of some
    export. This allows mountd to allow or deny access to individual
    directories and symlinks on the pseudofilesystem.

    Note that the checks in readdir and lookup are not enough, since a
    malicious host with access to the network could guess filehandles that
    they weren't able to obtain through lookup or readdir.

    Signed-off-by: Steve Dickson
    Signed-off-by: J. Bruce Fields

    Steve Dickson
     
  • We want to allow exports of symlinks, to allow mountd to communicate to
    the kernel which symlinks lead to exports, and hence which symlinks need
    to be visible on the pseudofilesystem.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • As with lookup, we treat every boject as a mountpoint and pretend it
    doesn't exist if it isn't exported.

    The preexisting code here is confusing, but I haven't yet figured out
    how to make it clearer.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • We treat every object as a mountpoint and pretend it doesn't exist if
    it isn't exported.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • If /A/mount/point/ has filesystem "B" mounted on top of it, and if "A"
    is exported, but not "B", then the nfs server has always returned to the
    client a filehandle for the mountpoint, instead of for the root of "B",
    allowing the client to see the subtree of "A" that would otherwise be
    hidden by B.

    Disable this behavior in the case of V4ROOT exports; we implement the
    path restrictions of V4ROOT exports by treating *every* directory as if
    it were a mountpoint, and allowing traversal *only* if the new directory
    is exported.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • NFSv4 differs from v2 and v3 in that it presents a single unified
    filesystem tree, whereas v2 and v3 exported multiple filesystem (whose
    roots could be found using a separate mount protocol).

    Our original NFSv4 server implementation asked the administrator to
    designate a single filesystem as the NFSv4 root, then to mount
    filesystems they wished to export underneath. (Often using bind mounts
    of already-existing filesystems.)

    This was conceptually simple, and allowed easy implementation, but
    created a serious obstacle to upgrading between v2/v3: since the paths
    to v4 filesystems were different, administrators would have to adjust
    all the paths in client-side mount commands when switching to v4.

    Various workarounds are possible. For example, the administrator could
    export "/" and designate it as the v4 root. However, the security risks
    of that approach are obvious, and in any case we shouldn't be requiring
    the administrator to take extra steps to fix this problem; instead, the
    server should present consistent paths across different versions by
    default.

    These patches take a modified version of that approach: we provide a new
    export option which exports only a subset of a filesystem. With this
    flag, it becomes safe for mountd to export "/" by default, with no need
    for additional configuration.

    We begin just by defining the new flag.

    Signed-off-by: Steve Dickson
    Signed-off-by: J. Bruce Fields

    Steve Dickson
     

15 Dec, 2009

5 commits

  • This was an oversight; it should be among the export flags that can be
    allowed to vary by pseudoflavor. This allows an administrator to (for
    example) allow auth_sys mounts only from low ports, but allow auth_krb5
    mounts to use any port.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Soon we will add the new V4ROOT flag, and allow the INSECURE flag to
    vary by pseudoflavor. It would be useful for nfs-utils (for example,
    for improved exportfs error reporting) to be able to know when this
    happens. Use this new interface for that purpose.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Lots of include/linux/nfsd/* headers are only used by
    nfsd module. Move them to the source directory

    Signed-off-by: Boaz Harrosh
    Signed-off-by: J. Bruce Fields

    Boaz Harrosh
     
  • Now that the headers are fixed and carry their own wait, all fs/nfsd/
    source files can include a minimal set of headers. and still compile just
    fine.

    This patch should improve the compilation speed of the nfsd module.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: J. Bruce Fields

    Boaz Harrosh
     
  • NFSv4 opens may function as locks denying other NFSv4 users the rights
    to open a file.

    We're requiring a user to have write permissions before they can deny
    write. We're *not* requiring a user to have write permissions to deny
    read, which is if anything a more drastic denial.

    What was intended was to require write permissions for DENY_READ.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

26 Nov, 2009

1 commit

  • All nfsd security depends on the security checks in fh_verify, and
    especially on nfsd_setuser().

    It therefore bothers me that the nfsd_setuser call may be made from
    three different places, depending on whether the filehandle has already
    been mapped to a dentry, and on whether subtreechecking is in force.

    Instead, make an unconditional call in fh_verify(), so it's trivial to
    verify that the call always occurs.

    That leaves us with a redundant nfsd_setuser() call in the subtreecheck
    case--it needs the correct user set earlier in order to check execute
    permissions on the path to this filehandle--but I'm willing to accept
    that minor inefficiency in the subtreecheck case in return for more
    straightforward permission checking.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

24 Nov, 2009

1 commit


15 Nov, 2009

1 commit

  • Commit 8177e6d6dfb9cd03d9bdeb647c32161f8f58f686 ("nfsd: clean up
    readdirplus encoding") introduced single character typo in nfs3 readdir+
    implementation. Unfortunately that typo has quite bad side effects:
    random memory corruption, followed (on my box) with immediate
    spontaneous box reboot.

    Using 'p1' instead of 'p' fixes my Linux box rebooting whenever VMware
    ESXi box tries to list contents of my home directory.

    Signed-off-by: Petr Vandrovec
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Signed-off-by: Linus Torvalds

    Petr Vandrovec
     

14 Nov, 2009

1 commit


06 Nov, 2009

1 commit


05 Nov, 2009

1 commit

  • Modify the NFS server to register the NFS_ACL services with the rpcbind
    daemon. This allows the client to ping for the existence of the NFS_ACL
    support via commands such as "rpcinfo -t nfs_acl".

    This patch also modifies the NFS_ACL support so that responses to
    version 2 NULLPROC requests can be made.

    The changelog for the patch which turned off this functionality
    mentioned something about not registering the NFS_ACL as being part of
    some tradition. I can't find this tradition and the only other
    implementation which supports NFS_ACL does register them with the
    rpcbind daemon.

    Signed-off-by: Peter Staubach
    Signed-off-by: J. Bruce Fields

    Peter Staubach
     

28 Oct, 2009

4 commits


02 Oct, 2009

1 commit


29 Sep, 2009

4 commits

  • ca_maxresponsesize and ca_maxrequest size include the RPC header.

    sv_max_mesg is sv_max_payolad plus a page for overhead and is used in
    svc_init_buffer to allocate server buffer space for both the request and reply.
    Note that this means we can service an RPC compound that requires
    ca_maxrequestsize (MAXWRITE) or ca_max_responsesize (MAXREAD) but that we do
    not support an RPC compound that requires both ca_maxrequestsize and
    ca_maxresponsesize.

    Signed-off-by: Andy Adamson
    [bfields@citi.umich.edu: more documentation updates]
    Signed-off-by: J. Bruce Fields

    Andy Adamson
     
  • We really shouldn't hit this case at all, and forthcoming kernel and
    nfs-utils changes should eliminate this case; if it does happen,
    consider it a bug rather than reporting an error that doesn't really
    make sense for the operation (since there's no reason for a server to be
    accepting v4 traffic yet have no root filehandle).

    Also move some exp_pseudoroot code into a helper function while we're
    here.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Break out some of nfsd_lookup_dentry into helper functions.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • 3c394ddaa7ea4205f933fd9b481166b2669368a9 "nfsd4: nfsv4 clients should
    cross mountpoints" forgot to handle lookups of parents directories.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

24 Sep, 2009

1 commit

  • * remove asm/atomic.h inclusion from linux/utsname.h --
    not needed after kref conversion
    * remove linux/utsname.h inclusion from files which do not need it

    NOTE: it looks like fs/binfmt_elf.c do not need utsname.h, however
    due to some personality stuff it _is_ needed -- cowardly leave ELF-related
    headers and files alone.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

23 Sep, 2009

1 commit

  • Make all seq_operations structs const, to help mitigate against
    revectoring user-triggerable function pointers.

    This is derived from the grsecurity patch, although generated from scratch
    because it's simpler than extracting the changes from there.

    Signed-off-by: James Morris
    Acked-by: Serge Hallyn
    Acked-by: Casey Schaufler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Morris
     

22 Sep, 2009

3 commits

  • * 'for-2.6.32' of git://linux-nfs.org/~bfields/linux: (68 commits)
    nfsd4: nfsv4 clients should cross mountpoints
    nfsd: revise 4.1 status documentation
    sunrpc/cache: avoid variable over-loading in cache_defer_req
    sunrpc/cache: use list_del_init for the list_head entries in cache_deferred_req
    nfsd: return success for non-NFS4 nfs4_state_start
    nfsd41: Refactor create_client()
    nfsd41: modify nfsd4.1 backchannel to use new xprt class
    nfsd41: Backchannel: Implement cb_recall over NFSv4.1
    nfsd41: Backchannel: cb_sequence callback
    nfsd41: Backchannel: Setup sequence information
    nfsd41: Backchannel: Server backchannel RPC wait queue
    nfsd41: Backchannel: Add sequence arguments to callback RPC arguments
    nfsd41: Backchannel: callback infrastructure
    nfsd4: use common rpc_cred for all callbacks
    nfsd4: allow nfs4 state startup to fail
    SUNRPC: Defer the auth_gss upcall when the RPC call is asynchronous
    nfsd4: fix null dereference creating nfsv4 callback client
    nfsd4: fix whitespace in NFSPROC4_CLNT_CB_NULL definition
    nfsd41: sunrpc: add new xprt class for nfsv4.1 backchannel
    sunrpc/cache: simplify cache_fresh_locked and cache_fresh_unlocked.
    ...

    Linus Torvalds
     
  • Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Allow NFS v4 clients to seamlessly cross mount point without
    have to set either the 'crossmnt' or the 'nohide' export
    options.

    Signed-Off-By: Steve Dickson
    Signed-off-by: J. Bruce Fields

    Steve Dickson
     

16 Sep, 2009

2 commits