1. Jun 09, 2023
  2. Jun 08, 2023
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.4-rc5-fixes' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 79b6fad5
      Linus Torvalds authored
      Pull xfs fixes from Dave Chinner:
       "These are a set of regression fixes discovered on recent kernels. I
        was hoping to send this to you a week and half ago, but events out of
        my control delayed finalising the changes until early this week.
      
        Whilst the diffstat looks large for this stage of the merge window, a
        large chunk of it comes from moving the guts of one function from one
        file to another i.e. it's the same code, it is just run in a different
        context where it is safe to hold a specific lock. Otherwise the
        individual changes are relatively small and straigtht forward.
      
        Summary:
      
         - Propagate unlinked inode list corruption back up to log recovery
           (regression fix)
      
         - improve corruption detection for AGFL entries, AGFL indexes and
           XEFI extents (syzkaller fuzzer oops report)
      
         - Avoid double perag reference release (regression fix)
      
         - Improve extent merging detection in scrub (regression fix)
      
         - Fix a new undefined high bit shift (regression fix)
      
         - Fix for AGF vs inode cluster buffer deadlock (regression fix)"
      
      * tag 'xfs-6.4-rc5-fixes' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: collect errors from inodegc for unlinked inode recovery
        xfs: validate block number being freed before adding to xefi
        xfs: validity check agbnos on the AGFL
        xfs: fix agf/agfl verification on v4 filesystems
        xfs: fix double xfs_perag_rele() in xfs_filestream_pick_ag()
        xfs: fix broken logic when detecting mergeable bmap records
        xfs: Fix undefined behavior of shift into sign bit
        xfs: fix AGF vs inode cluster buffer deadlock
        xfs: defered work could create precommits
        xfs: restore allocation trylock iteration
        xfs: buffer pins need to hold a buffer reference
      79b6fad5
    • Paolo Abeni's avatar
      Merge branch 'crypto-splice-net-make-af_alg-handle-sendmsg-msg_splice_pages' · bfd019d1
      Paolo Abeni authored
      David Howells says:
      
      ====================
      crypto, splice, net: Make AF_ALG handle sendmsg(MSG_SPLICE_PAGES)
      
      Here are patches to make AF_ALG handle the MSG_SPLICE_PAGES internal
      sendmsg flag.  MSG_SPLICE_PAGES is an internal hint that tells the protocol
      that it should splice the pages supplied if it can.  The sendpage functions
      are then turned into wrappers around that.
      
      This set consists of the following parts:
      
       (1) Move netfs_extract_iter_to_sg() to somewhere more general and rename
           it to drop the "netfs" prefix.  We use this to extract directly from
           an iterator into a scatterlist.
      
       (2) Make AF_ALG use iov_iter_extract_pages().  This has the additional
           effect of pinning pages obtained from userspace rather than taking
           refs on them.  Pages from kernel-backed iterators would not be pinned,
           but AF_ALG isn't really meant for use by kernel services.
      
       (3) Change AF_ALG still further to use extract_iter_to_sg().
      
       (4) Make af_alg_sendmsg() support MSG_SPLICE_PAGES support and make
           af_alg_sendpage() just a wrapper around sendmsg().  This has to take
           refs on the pages pinned for the moment.
      
       (5) Make hash_sendmsg() support MSG_SPLICE_PAGES by simply ignoring it.
           hash_sendpage() is left untouched to be removed later, after the
           splice core has been changed to call sendmsg().
      ====================
      
      Link: https://lore.kernel.org/r/20230606130856.1970660-1-dhowells@redhat.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      bfd019d1
    • David Howells's avatar
      crypto: af_alg/hash: Support MSG_SPLICE_PAGES · c662b043
      David Howells authored
      
      
      Make AF_ALG sendmsg() support MSG_SPLICE_PAGES in the hashing code.  This
      causes pages to be spliced from the source iterator if possible.
      
      This allows ->sendpage() to be replaced by something that can handle
      multiple multipage folios in a single transaction.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Herbert Xu <herbert@gondor.apana.org.au>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: Jens Axboe <axboe@kernel.dk>
      cc: Matthew Wilcox <willy@infradead.org>
      cc: linux-crypto@vger.kernel.org
      cc: netdev@vger.kernel.org
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      c662b043
    • David Howells's avatar
      crypto: af_alg: Convert af_alg_sendpage() to use MSG_SPLICE_PAGES · fb800fa4
      David Howells authored
      
      
      Convert af_alg_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather
      than directly splicing in the pages itself.
      
      This allows ->sendpage() to be replaced by something that can handle
      multiple multipage folios in a single transaction.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Herbert Xu <herbert@gondor.apana.org.au>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: Jens Axboe <axboe@kernel.dk>
      cc: Matthew Wilcox <willy@infradead.org>
      cc: linux-crypto@vger.kernel.org
      cc: netdev@vger.kernel.org
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      fb800fa4
    • David Howells's avatar
      crypto: af_alg: Support MSG_SPLICE_PAGES · bf63e250
      David Howells authored
      
      
      Make AF_ALG sendmsg() support MSG_SPLICE_PAGES.  This causes pages to be
      spliced from the source iterator.
      
      This allows ->sendpage() to be replaced by something that can handle
      multiple multipage folios in a single transaction.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Herbert Xu <herbert@gondor.apana.org.au>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: Jens Axboe <axboe@kernel.dk>
      cc: Matthew Wilcox <willy@infradead.org>
      cc: linux-crypto@vger.kernel.org
      cc: netdev@vger.kernel.org
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      bf63e250
    • David Howells's avatar
      crypto: af_alg: Indent the loop in af_alg_sendmsg() · 73d7409c
      David Howells authored
      
      
      Put the loop in af_alg_sendmsg() into an if-statement to indent it to make
      the next patch easier to review as that will add another branch to handle
      MSG_SPLICE_PAGES to the if-statement.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Herbert Xu <herbert@gondor.apana.org.au>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: Jens Axboe <axboe@kernel.dk>
      cc: Matthew Wilcox <willy@infradead.org>
      cc: linux-crypto@vger.kernel.org
      cc: netdev@vger.kernel.org
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      73d7409c
    • David Howells's avatar
      crypto: af_alg: Use extract_iter_to_sg() to create scatterlists · c1abe6f5
      David Howells authored
      
      
      Use extract_iter_to_sg() to decant the destination iterator into a
      scatterlist in af_alg_get_rsgl().  af_alg_make_sg() can then be removed.
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Herbert Xu <herbert@gondor.apana.org.au>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: Jens Axboe <axboe@kernel.dk>
      cc: Matthew Wilcox <willy@infradead.org>
      cc: linux-crypto@vger.kernel.org
      cc: netdev@vger.kernel.org
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      c1abe6f5
    • David Howells's avatar
      crypto: af_alg: Pin pages rather than ref'ing if appropriate · f9e7a5fa
      David Howells authored
      
      
      Convert AF_ALG to use iov_iter_extract_pages() instead of
      iov_iter_get_pages().  This will pin pages or leave them unaltered rather
      than getting a ref on them as appropriate to the iterator.
      
      The pages need to be pinned for DIO-read rather than having refs taken on
      them to prevent VM copy-on-write from malfunctioning during a concurrent
      fork() (the result of the I/O would otherwise end up only visible to the
      child process and not the parent).
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Herbert Xu <herbert@gondor.apana.org.au>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: Jens Axboe <axboe@kernel.dk>
      cc: Matthew Wilcox <willy@infradead.org>
      cc: linux-crypto@vger.kernel.org
      cc: netdev@vger.kernel.org
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f9e7a5fa