1. 24 Apr, 2018 36 commits
  2. 19 Apr, 2018 4 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.14.35 · 672f07d8
      Greg Kroah-Hartman authored
      672f07d8
    • J. Bruce Fields's avatar
      nfsd: fix incorrect umasks · 9a0a5098
      J. Bruce Fields authored
      commit 880a3a53 upstream.
      
      We're neglecting to clear the umask after it's set, which can cause a
      later unrelated rpc to (incorrectly) use the same umask if it happens to
      be processed by the same thread.
      
      There's a more subtle problem here too:
      
      An NFSv4 compound request is decoded all in one pass before any
      operations are executed.
      
      Currently we're setting current->fs->umask at the time we decode the
      compound.  In theory a single compound could contain multiple creates
      each setting a umask.  In that case we'd end up using whichever umask
      was passed in the *last* operation as the umask for all the creates,
      whether that was correct or not.
      
      So, we should just be saving the umask at decode time and waiting to set
      it until we actually process the corresponding operation.
      
      In practice it's unlikely any client would do multiple creates in a
      single compound.  And even if it did they'd likely be from the same
      process (hence carry the same umask).  So this is a little academic, but
      we should get it right anyway.
      
      Fixes: 47057abd (nfsd: add support for the umask attribute)
      Cc: stable@vger.kernel.org
      Reported-by: default avatarLucash Stach <l.stach@pengutronix.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9a0a5098
    • Mike Kravetz's avatar
      hugetlbfs: fix bug in pgoff overflow checking · 61534984
      Mike Kravetz authored
      commit 5df63c2a upstream.
      
      This is a fix for a regression in 32 bit kernels caused by an invalid
      check for pgoff overflow in hugetlbfs mmap setup.  The check incorrectly
      specified that the size of a loff_t was the same as the size of a long.
      The regression prevents mapping hugetlbfs files at offsets greater than
      4GB on 32 bit kernels.
      
      On 32 bit kernels conversion from a page based unsigned long can not
      overflow a loff_t byte offset.  Therefore, skip this check if
      sizeof(unsigned long) != sizeof(loff_t).
      
      Link: http://lkml.kernel.org/r/20180330145402.5053-1-mike.kravetz@oracle.com
      Fixes: 63489f8e ("hugetlbfs: check for pgoff value overflow")
      Reported-by: default avatarDan Rue <dan.rue@linaro.org>
      Signed-off-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Tested-by: default avatarAnders Roxell <anders.roxell@linaro.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Yisheng Xie <xieyisheng1@huawei.com>
      Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Nic Losby <blurbdust@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      61534984
    • Simon Gaiser's avatar
      xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling · 0319ce67
      Simon Gaiser authored
      commit 2a22ee6c upstream.
      
      Commit fd8aa909 ("xen: optimize xenbus driver for multiple
      concurrent xenstore accesses") made a subtle change to the semantic of
      xenbus_dev_request_and_reply() and xenbus_transaction_end().
      
      Before on an error response to XS_TRANSACTION_END
      xenbus_dev_request_and_reply() would not decrement the active
      transaction counter. But xenbus_transaction_end() has always counted the
      transaction as finished regardless of the response.
      
      The new behavior is that xenbus_dev_request_and_reply() and
      xenbus_transaction_end() will always count the transaction as finished
      regardless the response code (handled in xs_request_exit()).
      
      But xenbus_dev_frontend tries to end a transaction on closing of the
      device if the XS_TRANSACTION_END failed before. Trying to close the
      transaction twice corrupts the reference count. So fix this by also
      considering a transaction closed if we have sent XS_TRANSACTION_END once
      regardless of the return code.
      
      Cc: <stable@vger.kernel.org> # 4.11
      Fixes: fd8aa909 ("xen: optimize xenbus driver for multiple concurrent xenstore accesses")
      Signed-off-by: default avatarSimon Gaiser <simon@invisiblethingslab.com>
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0319ce67