01 May, 2020

1 commit

  • The struct nfs_server gets put on the cl_superblocks list before
    the server->super field has been initialised, in which case the
    call to nfs_sb_active() will Oops. Add a check to ensure that
    we skip such a list entry.

    Fixes: 3c9e502b59fb ("NFS: Add a helper nfs_client_for_each_server()")
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

29 Apr, 2020

1 commit

  • Currently, if the client sends BIND_CONN_TO_SESSION with
    NFS4_CDFC4_FORE_OR_BOTH but only gets NFS4_CDFS4_FORE back it ignores
    that it wasn't able to enable a backchannel.

    To make sure, the client sends BIND_CONN_TO_SESSION as the first
    operation on the connections (ie., no other session compounds haven't
    been sent before), and if the client's request to bind the backchannel
    is not satisfied, then reset the connection and retry.

    Cc: stable@vger.kernel.org
    Signed-off-by: Olga Kornievskaia
    Signed-off-by: Trond Myklebust

    Olga Kornievskaia
     

25 Apr, 2020

1 commit


20 Apr, 2020

3 commits


14 Apr, 2020

1 commit

  • We need to drop the inode spinlock while calling nfs4_select_rw_stateid(),
    since nfs4_copy_delegation_stateid() could take the delegation lock.
    Note that it is safe to do this, since all other calls to
    pnfs_update_layout() for that inode will find themselves blocked by
    the lock we hold on NFS_LAYOUT_FIRST_LAYOUTGET.

    Fixes: fc51b1cf391d ("NFS: Beware when dereferencing the delegation cred")
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

13 Apr, 2020

1 commit


11 Apr, 2020

1 commit

  • Another brown paper bag moment. pnfs_alloc_ds_commits_list() is leaking
    the RCU lock.

    Fixes: a9901899b649 ("pNFS: Add infrastructure for cleaning up per-layout commit structures")
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

08 Apr, 2020

1 commit

  • Pull NFS client updates from Trond Myklebust:
    "Highlights include:

    Stable fixes:
    - Fix a page leak in nfs_destroy_unlinked_subrequests()

    - Fix use-after-free issues in nfs_pageio_add_request()

    - Fix new mount code constant_table array definitions

    - finish_automount() requires us to hold 2 refs to the mount record

    Features:
    - Improve the accuracy of telldir/seekdir by using 64-bit cookies
    when possible.

    - Allow one RDMA active connection and several zombie connections to
    prevent blocking if the remote server is unresponsive.

    - Limit the size of the NFS access cache by default

    - Reduce the number of references to credentials that are taken by
    NFS

    - pNFS files and flexfiles drivers now support per-layout segment
    COMMIT lists.

    - Enable partial-file layout segments in the pNFS/flexfiles driver.

    - Add support for CB_RECALL_ANY to the pNFS flexfiles layout type

    - pNFS/flexfiles Report NFS4ERR_DELAY and NFS4ERR_GRACE errors from
    the DS using the layouterror mechanism.

    Bugfixes and cleanups:
    - SUNRPC: Fix krb5p regressions

    - Don't specify NFS version in "UDP not supported" error

    - nfsroot: set tcp as the default transport protocol

    - pnfs: Return valid stateids in nfs_layout_find_inode_by_stateid()

    - alloc_nfs_open_context() must use the file cred when available

    - Fix locking when dereferencing the delegation cred

    - Fix memory leaks in O_DIRECT when nfs_get_lock_context() fails

    - Various clean ups of the NFS O_DIRECT commit code

    - Clean up RDMA connect/disconnect

    - Replace zero-length arrays with C99-style flexible arrays"

    * tag 'nfs-for-5.7-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (86 commits)
    NFS: Clean up process of marking inode stale.
    SUNRPC: Don't start a timer on an already queued rpc task
    NFS/pnfs: Reference the layout cred in pnfs_prepare_layoutreturn()
    NFS/pnfs: Fix dereference of layout cred in pnfs_layoutcommit_inode()
    NFS: Beware when dereferencing the delegation cred
    NFS: Add a module parameter to set nfs_mountpoint_expiry_timeout
    NFS: finish_automount() requires us to hold 2 refs to the mount record
    NFS: Fix a few constant_table array definitions
    NFS: Try to join page groups before an O_DIRECT retransmission
    NFS: Refactor nfs_lock_and_join_requests()
    NFS: Reverse the submission order of requests in __nfs_pageio_add_request()
    NFS: Clean up nfs_lock_and_join_requests()
    NFS: Remove the redundant function nfs_pgio_has_mirroring()
    NFS: Fix memory leaks in nfs_pageio_stop_mirroring()
    NFS: Fix a request reference leak in nfs_direct_write_clear_reqs()
    NFS: Fix use-after-free issues in nfs_pageio_add_request()
    NFS: Fix races nfs_page_group_destroy() vs nfs_destroy_unlinked_subrequests()
    NFS: Fix a page leak in nfs_destroy_unlinked_subrequests()
    NFS: Remove unused FLUSH_SYNC support in nfs_initiate_pgio()
    pNFS/flexfiles: Specify the layout segment range in LAYOUTGET
    ...

    Linus Torvalds
     

07 Apr, 2020

1 commit


05 Apr, 2020

1 commit

  • Pull nfsd updates from Chuck Lever:

    - Fix EXCHANGE_ID response when NFSD runs in a container

    - A battery of new static trace points

    - Socket transports now use bio_vec to send Replies

    - NFS/RDMA now supports filesystems with no .splice_read method

    - Favor memcpy() over DMA mapping for small RPC/RDMA Replies

    - Add pre-requisites for supporting multiple Write chunks

    - Numerous minor fixes and clean-ups

    [ Chuck is filling in for Bruce this time while he and his family settle
    into a new house ]

    * tag 'nfsd-5.7' of git://git.linux-nfs.org/projects/cel/cel-2.6: (39 commits)
    svcrdma: Fix leak of transport addresses
    SUNRPC: Fix a potential buffer overflow in 'svc_print_xprts()'
    SUNRPC/cache: don't allow invalid entries to be flushed
    nfsd: fsnotify on rmdir under nfsd/clients/
    nfsd4: kill warnings on testing stateids with mismatched clientids
    nfsd: remove read permission bit for ctl sysctl
    NFSD: Fix NFS server build errors
    sunrpc: Add tracing for cache events
    SUNRPC/cache: Allow garbage collection of invalid cache entries
    nfsd: export upcalls must not return ESTALE when mountd is down
    nfsd: Add tracepoints for update of the expkey and export cache entries
    nfsd: Add tracepoints for exp_find_key() and exp_get_by_name()
    nfsd: Add tracing to nfsd_set_fh_dentry()
    nfsd: Don't add locks to closed or closing open stateids
    SUNRPC: Teach server to use xprt_sock_sendmsg for socket sends
    SUNRPC: Refactor xs_sendpages()
    svcrdma: Avoid DMA mapping small RPC Replies
    svcrdma: Fix double sync of transport header buffer
    svcrdma: Refactor chunk list encoders
    SUNRPC: Add encoders for list item discriminators
    ...

    Linus Torvalds
     

04 Apr, 2020

3 commits


03 Apr, 2020

3 commits

  • Setting nfs_mountpoint_expiry_timeout() to a negative value stops
    mountpoint expiration, while setting it to a positive value restarts
    the scheduler.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • We must not return from nfs_d_automount() without holding 2 references
    to the mount record. Doing so, will trigger the BUG() in finish_automount().
    Also ensure that we don't try to reschedule the automount timer with
    a negative or zero timeout value.

    Fixes: 22a1ae9a93fb ("NFS: If nfs_mountpoint_expiry_timeout < 0, do not expire submounts")
    Cc: stable@vger.kernel.org # v5.5+
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • nfs_vers_tokens, nfs_xprt_protocol_tokens, and nfs_secflavor_tokens were
    all missing an empty item at the end of the array, allowing
    lookup_constant() to potentially walk off the end and trigger and oops.

    Reported-by: Olga Kornievskaia
    Signed-off-by: Scott Mayhew
    Fixes: e38bb238ed8c ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
    Cc: stable@vger.kernel.org # v5.6
    Signed-off-by: Trond Myklebust

    Scott Mayhew
     

02 Apr, 2020

9 commits


01 Apr, 2020

2 commits

  • When we detach a subrequest from the list, we must also release the
    reference it holds to the parent.

    Fixes: 5b2b5187fa85 ("NFS: Fix nfs_page_group_destroy() and nfs_lock_and_join_requests() race cases")
    Cc: stable@vger.kernel.org # v4.14+
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Pull SELinux updates from Paul Moore:
    "We've got twenty SELinux patches for the v5.7 merge window, the
    highlights are below:

    - Deprecate setting /sys/fs/selinux/checkreqprot to 1.

    This flag was originally created to deal with legacy userspace and
    the READ_IMPLIES_EXEC personality flag. We changed the default from
    1 to 0 back in Linux v4.4 and now we are taking the next step of
    deprecating it, at some point in the future we will take the final
    step of rejecting 1.

    - Allow kernfs symlinks to inherit the SELinux label of the parent
    directory. In order to preserve backwards compatibility this is
    protected by the genfs_seclabel_symlinks SELinux policy capability.

    - Optimize how we store filename transitions in the kernel, resulting
    in some significant improvements to policy load times.

    - Do a better job calculating our internal hash table sizes which
    resulted in additional policy load improvements and likely general
    SELinux performance improvements as well.

    - Remove the unused initial SIDs (labels) and improve how we handle
    initial SIDs.

    - Enable per-file labeling for the bpf filesystem.

    - Ensure that we properly label NFS v4.2 filesystems to avoid a
    temporary unlabeled condition.

    - Add some missing XFS quota command types to the SELinux quota
    access controls.

    - Fix a problem where we were not updating the seq_file position
    index correctly in selinuxfs.

    - We consolidate some duplicated code into helper functions.

    - A number of list to array conversions.

    - Update Stephen Smalley's email address in MAINTAINERS"

    * tag 'selinux-pr-20200330' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
    selinux: clean up indentation issue with assignment statement
    NFS: Ensure security label is set for root inode
    MAINTAINERS: Update my email address
    selinux: avtab_init() and cond_policydb_init() return void
    selinux: clean up error path in policydb_init()
    selinux: remove unused initial SIDs and improve handling
    selinux: reduce the use of hard-coded hash sizes
    selinux: Add xfs quota command types
    selinux: optimize storage of filename transitions
    selinux: factor out loop body from filename_trans_read()
    security: selinux: allow per-file labeling for bpffs
    selinux: generalize evaluate_cond_node()
    selinux: convert cond_expr to array
    selinux: convert cond_av_list to array
    selinux: convert cond_list to array
    selinux: sel_avc_get_stat_idx should increase position index
    selinux: allow kernfs symlinks to inherit parent directory context
    selinux: simplify evaluate_cond_node()
    Documentation,selinux: deprecate setting checkreqprot to 1
    selinux: move status variables out of selinux_ss

    Linus Torvalds
     

31 Mar, 2020

3 commits

  • When using NFSv4.2, the security label for the root inode should be set
    via a call to nfs_setsecurity() during the mount process, otherwise the
    inode will appear as unlabeled for up to acdirmin seconds. Currently
    the label for the root inode is allocated, retrieved, and freed entirely
    witin nfs4_proc_get_root().

    Add a field for the label to the nfs_fattr struct, and allocate & free
    the label in nfs_get_root(), where we also add a call to
    nfs_setsecurity(). Note that for the call to nfs_setsecurity() to
    succeed, it's necessary to also move the logic calling
    security_sb_{set,clone}_security() from nfs_get_tree_common() down into
    nfs_get_root()... otherwise the SBLABEL_MNT flag will not be set in the
    super_block's security flags and nfs_setsecurity() will silently fail.

    Reported-by: Richard Haines
    Signed-off-by: Scott Mayhew
    Acked-by: Stephen Smalley
    Tested-by: Stephen Smalley
    [PM: fixed 80-char line width problems]
    Signed-off-by: Paul Moore

    Scott Mayhew
     
  • Pull RCU updates from Ingo Molnar:
    "The main changes in this cycle were:

    - Make kfree_rcu() use kfree_bulk() for added performance

    - RCU updates

    - Callback-overload handling updates

    - Tasks-RCU KCSAN and sparse updates

    - Locking torture test and RCU torture test updates

    - Documentation updates

    - Miscellaneous fixes"

    * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (74 commits)
    rcu: Make rcu_barrier() account for offline no-CBs CPUs
    rcu: Mark rcu_state.gp_seq to detect concurrent writes
    Documentation/memory-barriers: Fix typos
    doc: Add rcutorture scripting to torture.txt
    doc/RCU/rcu: Use https instead of http if possible
    doc/RCU/rcu: Use absolute paths for non-rst files
    doc/RCU/rcu: Use ':ref:' for links to other docs
    doc/RCU/listRCU: Update example function name
    doc/RCU/listRCU: Fix typos in a example code snippets
    doc/RCU/Design: Remove remaining HTML tags in ReST files
    doc: Add some more RCU list patterns in the kernel
    rcutorture: Set KCSAN Kconfig options to detect more data races
    rcutorture: Manually clean up after rcu_barrier() failure
    rcutorture: Make rcu_torture_barrier_cbs() post from corresponding CPU
    rcuperf: Measure memory footprint during kfree_rcu() test
    rcutorture: Annotation lockless accesses to rcu_torture_current
    rcutorture: Add READ_ONCE() to rcu_torture_count and rcu_torture_batch
    rcutorture: Fix stray access to rcu_fwd_cb_nodelay
    rcutorture: Fix rcu_torture_one_read()/rcu_torture_writer() data race
    rcutorture: Make kvm-find-errors.sh abort on bad directory
    ...

    Linus Torvalds
     
  • Pull documentation updates from Jonathan Corbet:
    "This has been a busy cycle for documentation work.

    Highlights include:

    - Lots of RST conversion work by Mauro, Daniel ALmeida, and others.
    Maybe someday we'll get to the end of this stuff...maybe...

    - Some organizational work to bring some order to the core-api
    manual.

    - Various new docs and additions to the existing documentation.

    - Typo fixes, warning fixes, ..."

    * tag 'docs-5.7' of git://git.lwn.net/linux: (123 commits)
    Documentation: x86: exception-tables: document CONFIG_BUILDTIME_TABLE_SORT
    MAINTAINERS: adjust to filesystem doc ReST conversion
    docs: deprecated.rst: Add BUG()-family
    doc: zh_CN: add translation for virtiofs
    doc: zh_CN: index files in filesystems subdirectory
    docs: locking: Drop :c:func: throughout
    docs: locking: Add 'need' to hardirq section
    docs: conf.py: avoid thousands of duplicate label warning on Sphinx
    docs: prevent warnings due to autosectionlabel
    docs: fix reference to core-api/namespaces.rst
    docs: fix pointers to io-mapping.rst and io_ordering.rst files
    Documentation: Better document the softlockup_panic sysctl
    docs: hw-vuln: tsx_async_abort.rst: get rid of an unused ref
    docs: perf: imx-ddr.rst: get rid of a warning
    docs: filesystems: fuse.rst: supress a Sphinx warning
    docs: translations: it: avoid duplicate refs at programming-language.rst
    docs: driver.rst: supress two ReSt warnings
    docs: trace: events.rst: convert some new stuff to ReST format
    Documentation: Add io_ordering.rst to driver-api manual
    Documentation: Add io-mapping.rst to driver-api manual
    ...

    Linus Torvalds
     

28 Mar, 2020

8 commits