1. 06 Apr, 2023 11 commits
    • Sergey Senozhatsky's avatar
      zsmalloc: document new fullness grouping · 119b57ea
      Sergey Senozhatsky authored
      Patch series "zsmalloc: minor documentation updates".
      
      Two minor patches that bring zsmalloc documentation up to date.
      
      
      This patch (of 2):
      
      Update documentation and reflect new zspages fullness grouping (we don't
      use almost_empty and almost_full anymore).
      
      Link: https://lkml.kernel.org/r/20230325024631.2817153-1-senozhatsky@chromium.org
      Link: https://lkml.kernel.org/r/20230325024631.2817153-2-senozhatsky@chromium.orgSigned-off-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
      Fixes: 67e157eb3639 ("zsmalloc: show per fullness group class stats")
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      119b57ea
    • Shiyang Ruan's avatar
      fsdax: force clear dirty mark if CoW · f76b3a32
      Shiyang Ruan authored
      XFS allows CoW on non-shared extents to combat fragmentation[1].  The old
      non-shared extent could be mwrited before, its dax entry is marked dirty. 
      
      This results in a WARNing:
      
      [   28.512349] ------------[ cut here ]------------
      [   28.512622] WARNING: CPU: 2 PID: 5255 at fs/dax.c:390 dax_insert_entry+0x342/0x390
      [   28.513050] Modules linked in: rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs lockd grace fscache netfs nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables
      [   28.515462] CPU: 2 PID: 5255 Comm: fsstress Kdump: loaded Not tainted 6.3.0-rc1-00001-g85e1481e19c1-dirty #117
      [   28.515902] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Arch Linux 1.16.1-1-1 04/01/2014
      [   28.516307] RIP: 0010:dax_insert_entry+0x342/0x390
      [   28.516536] Code: 30 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 48 8b 45 20 48 83 c0 01 e9 e2 fe ff ff 48 8b 45 20 48 83 c0 01 e9 cd fe ff ff <0f> 0b e9 53 ff ff ff 48 8b 7c 24 08 31 f6 e8 1b 61 a1 00 eb 8c 48
      [   28.517417] RSP: 0000:ffffc9000845fb18 EFLAGS: 00010086
      [   28.517721] RAX: 0000000000000053 RBX: 0000000000000155 RCX: 000000000018824b
      [   28.518113] RDX: 0000000000000000 RSI: ffffffff827525a6 RDI: 00000000ffffffff
      [   28.518515] RBP: ffffea00062092c0 R08: 0000000000000000 R09: ffffc9000845f9c8
      [   28.518905] R10: 0000000000000003 R11: ffffffff82ddb7e8 R12: 0000000000000155
      [   28.519301] R13: 0000000000000000 R14: 000000000018824b R15: ffff88810cfa76b8
      [   28.519703] FS:  00007f14a0c94740(0000) GS:ffff88817bd00000(0000) knlGS:0000000000000000
      [   28.520148] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   28.520472] CR2: 00007f14a0c8d000 CR3: 000000010321c004 CR4: 0000000000770ee0
      [   28.520863] PKRU: 55555554
      [   28.521043] Call Trace:
      [   28.521219]  <TASK>
      [   28.521368]  dax_fault_iter+0x196/0x390
      [   28.521595]  dax_iomap_pte_fault+0x19b/0x3d0
      [   28.521852]  __xfs_filemap_fault+0x234/0x2b0
      [   28.522116]  __do_fault+0x30/0x130
      [   28.522334]  do_fault+0x193/0x340
      [   28.522586]  __handle_mm_fault+0x2d3/0x690
      [   28.522975]  handle_mm_fault+0xe6/0x2c0
      [   28.523259]  do_user_addr_fault+0x1bc/0x6f0
      [   28.523521]  exc_page_fault+0x60/0x140
      [   28.523763]  asm_exc_page_fault+0x22/0x30
      [   28.524001] RIP: 0033:0x7f14a0b589ca
      [   28.524225] Code: c5 fe 7f 07 c5 fe 7f 47 20 c5 fe 7f 47 40 c5 fe 7f 47 60 c5 f8 77 c3 66 0f 1f 84 00 00 00 00 00 40 0f b6 c6 48 89 d1 48 89 fa <f3> aa 48 89 d0 c5 f8 77 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90
      [   28.525198] RSP: 002b:00007fff1dea1c98 EFLAGS: 00010202
      [   28.525505] RAX: 000000000000001e RBX: 000000000014a000 RCX: 0000000000006046
      [   28.525895] RDX: 00007f14a0c82000 RSI: 000000000000001e RDI: 00007f14a0c8d000
      [   28.526290] RBP: 000000000000006f R08: 0000000000000004 R09: 000000000014a000
      [   28.526681] R10: 0000000000000008 R11: 0000000000000246 R12: 028f5c28f5c28f5c
      [   28.527067] R13: 8f5c28f5c28f5c29 R14: 0000000000011046 R15: 00007f14a0c946c0
      [   28.527449]  </TASK>
      [   28.527600] ---[ end trace 0000000000000000 ]---
      
      
      To be able to delete this entry, clear its dirty mark before
      invalidate_inode_pages2_range().
      
      [1] https://lore.kernel.org/linux-xfs/20230321151339.GA11376@frogsfrogsfrogs/
      
      Link: https://lkml.kernel.org/r/1679653680-2-1-git-send-email-ruansy.fnst@fujitsu.com
      Fixes: f80e1668 ("fsdax: invalidate pages when CoW")
      Signed-off-by: default avatarShiyang Ruan <ruansy.fnst@fujitsu.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Darrick J. Wong <djwong@kernel.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      f76b3a32
    • Peter Xu's avatar
      mm/hugetlb: fix uffd wr-protection for CoW optimization path · 60d5b473
      Peter Xu authored
      This patch fixes an issue that a hugetlb uffd-wr-protected mapping can be
      writable even with uffd-wp bit set.  It only happens with hugetlb private
      mappings, when someone firstly wr-protects a missing pte (which will
      install a pte marker), then a write to the same page without any prior
      access to the page.
      
      Userfaultfd-wp trap for hugetlb was implemented in hugetlb_fault() before
      reaching hugetlb_wp() to avoid taking more locks that userfault won't
      need.  However there's one CoW optimization path that can trigger
      hugetlb_wp() inside hugetlb_no_page(), which will bypass the trap.
      
      This patch skips hugetlb_wp() for CoW and retries the fault if uffd-wp bit
      is detected.  The new path will only trigger in the CoW optimization path
      because generic hugetlb_fault() (e.g.  when a present pte was
      wr-protected) will resolve the uffd-wp bit already.  Also make sure
      anonymous UNSHARE won't be affected and can still be resolved, IOW only
      skip CoW not CoR.
      
      This patch will be needed for v5.19+ hence copy stable.
      
      [peterx@redhat.com: v2]
        Link: https://lkml.kernel.org/r/ZBzOqwF2wrHgBVZb@x1n
      [peterx@redhat.com: v3]
        Link: https://lkml.kernel.org/r/20230324142620.2344140-1-peterx@redhat.com
      Link: https://lkml.kernel.org/r/20230321191840.1897940-1-peterx@redhat.com
      Fixes: 166f3ecc ("mm/hugetlb: hook page faults for uffd write protection")
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Reported-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
      Tested-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
      Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Axel Rasmussen <axelrasmussen@google.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Nadav Amit <nadav.amit@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      60d5b473
    • Liam R. Howlett's avatar
      mm: enable maple tree RCU mode by default · 3dd44325
      Liam R. Howlett authored
      Use the maple tree in RCU mode for VMA tracking.
      
      The maple tree tracks the stack and is able to update the pivot
      (lower/upper boundary) in-place to allow the page fault handler to write
      to the tree while holding just the mmap read lock.  This is safe as the
      writes to the stack have a guard VMA which ensures there will always be a
      NULL in the direction of the growth and thus will only update a pivot.
      
      It is possible, but not recommended, to have VMAs that grow up/down
      without guard VMAs.  syzbot has constructed a testcase which sets up a VMA
      to grow and consume the empty space.  Overwriting the entire NULL entry
      causes the tree to be altered in a way that is not safe for concurrent
      readers; the readers may see a node being rewritten or one that does not
      match the maple state they are using.
      
      Enabling RCU mode allows the concurrent readers to see a stable node and
      will return the expected result.
      
      [Liam.Howlett@Oracle.com: we don't need to free the nodes with RCU[
      Link: https://lore.kernel.org/linux-mm/000000000000b0a65805f663ace6@google.com/
      Link: https://lkml.kernel.org/r/20230227173632.3292573-9-surenb@google.com
      Fixes: d4af56c5 ("mm: start tracking VMAs with maple tree")
      Signed-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Reported-by: syzbot+8d95422d3537159ca390@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      3dd44325
    • Liam R. Howlett's avatar
      maple_tree: add RCU lock checking to rcu callback functions · 790e1fa8
      Liam R. Howlett authored
      Dereferencing RCU objects within the RCU callback without the RCU check
      has caused lockdep to complain.  Fix the RCU dereferencing by using the
      RCU callback lock to ensure the operation is safe.
      
      Also stop creating a new lock to use for dereferencing during destruction
      of the tree or subtree.  Instead, pass through a pointer to the tree that
      has the lock that is held for RCU dereferencing checking.  It also does
      not make sense to use the maple state in the freeing scenario as the tree
      walk is a special case where the tree no longer has the normal encodings
      and parent pointers.
      
      Link: https://lkml.kernel.org/r/20230227173632.3292573-8-surenb@google.com
      Fixes: 54a611b6 ("Maple Tree: add new data structure")
      Signed-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
      Reported-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      790e1fa8
    • Liam R. Howlett's avatar
      maple_tree: add smp_rmb() to dead node detection · 0a2b18d9
      Liam R. Howlett authored
      Add an smp_rmb() before reading the parent pointer to ensure that anything
      read from the node prior to the parent pointer hasn't been reordered ahead
      of this check.
      
      The is necessary for RCU mode.
      
      Link: https://lkml.kernel.org/r/20230227173632.3292573-7-surenb@google.com
      Fixes: 54a611b6 ("Maple Tree: add new data structure")
      Signed-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      0a2b18d9
    • Liam R. Howlett's avatar
      maple_tree: fix write memory barrier of nodes once dead for RCU mode · c13af03d
      Liam R. Howlett authored
      During the development of the maple tree, the strategy of freeing multiple
      nodes changed and, in the process, the pivots were reused to store
      pointers to dead nodes.  To ensure the readers see accurate pivots, the
      writers need to mark the nodes as dead and call smp_wmb() to ensure any
      readers can identify the node as dead before using the pivot values.
      
      There were two places where the old method of marking the node as dead
      without smp_wmb() were being used, which resulted in RCU readers seeing
      the wrong pivot value before seeing the node was dead.  Fix this race
      condition by using mte_set_node_dead() which has the smp_wmb() call to
      ensure the race is closed.
      
      Add a WARN_ON() to the ma_free_rcu() call to ensure all nodes being freed
      are marked as dead to ensure there are no other call paths besides the two
      updated paths.
      
      This is necessary for the RCU mode of the maple tree.
      
      Link: https://lkml.kernel.org/r/20230227173632.3292573-6-surenb@google.com
      Fixes: 54a611b6 ("Maple Tree: add new data structure")
      Signed-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      c13af03d
    • Liam Howlett's avatar
      maple_tree: remove extra smp_wmb() from mas_dead_leaves() · 8372f4d8
      Liam Howlett authored
      The call to mte_set_dead_node() before the smp_wmb() already calls
      smp_wmb() so this is not needed.  This is an optimization for the RCU mode
      of the maple tree.
      
      Link: https://lkml.kernel.org/r/20230227173632.3292573-5-surenb@google.com
      Fixes: 54a611b6 ("Maple Tree: add new data structure")
      Signed-off-by: default avatarLiam Howlett <Liam.Howlett@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      8372f4d8
    • Liam Howlett's avatar
      maple_tree: fix freeing of nodes in rcu mode · 2e5b4921
      Liam Howlett authored
      The walk to destroy the nodes was not always setting the node type and
      would result in a destroy method potentially using the values as nodes. 
      Avoid this by setting the correct node types.  This is necessary for the
      RCU mode of the maple tree.
      
      Link: https://lkml.kernel.org/r/20230227173632.3292573-4-surenb@google.com
      Fixes: 54a611b6 ("Maple Tree: add new data structure")
      Signed-off-by: default avatarLiam Howlett <Liam.Howlett@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      2e5b4921
    • Liam Howlett's avatar
      maple_tree: detect dead nodes in mas_start() · a7b92d59
      Liam Howlett authored
      When initially starting a search, the root node may already be in the
      process of being replaced in RCU mode.  Detect and restart the walk if
      this is the case.  This is necessary for RCU mode of the maple tree.
      
      Link: https://lkml.kernel.org/r/20230227173632.3292573-3-surenb@google.com
      Fixes: 54a611b6 ("Maple Tree: add new data structure")
      Signed-off-by: default avatarLiam Howlett <Liam.Howlett@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      a7b92d59
    • Liam Howlett's avatar
      maple_tree: be more cautious about dead nodes · 39d0bd86
      Liam Howlett authored
      Patch series "Fix VMA tree modification under mmap read lock".
      
      Syzbot reported a BUG_ON in mm/mmap.c which was found to be caused by an
      inconsistency between threads walking the VMA maple tree.  The
      inconsistency is caused by the page fault handler modifying the maple tree
      while holding the mmap_lock for read.
      
      This only happens for stack VMAs.  We had thought this was safe as it only
      modifies a single pivot in the tree.  Unfortunately, syzbot constructed a
      test case where the stack had no guard page and grew the stack to abut the
      next VMA.  This causes us to delete the NULL entry between the two VMAs
      and rewrite the node.
      
      We considered several options for fixing this, including dropping the
      mmap_lock, then reacquiring it for write; and relaxing the definition of
      the tree to permit a zero-length NULL entry in the node.  We decided the
      best option was to backport some of the RCU patches from -next, which
      solve the problem by allocating a new node and RCU-freeing the old node. 
      Since the problem exists in 6.1, we preferred a solution which is similar
      to the one we intended to merge next merge window.
      
      These patches have been in -next since next-20230301, and have received
      intensive testing in Android as part of the RCU page fault patchset.  They
      were also sent as part of the "Per-VMA locks" v4 patch series.  Patches 1
      to 7 are bug fixes for RCU mode of the tree and patch 8 enables RCU mode
      for the tree.
      
      Performance v6.3-rc3 vs patched v6.3-rc3: Running these changes through
      mmtests showed there was a 15-20% performance decrease in
      will-it-scale/brk1-processes.  This tests creating and inserting a single
      VMA repeatedly through the brk interface and isn't representative of any
      real world applications.
      
      
      This patch (of 8):
      
      ma_pivots() and ma_data_end() may be called with a dead node.  Ensure to
      that the node isn't dead before using the returned values.
      
      This is necessary for RCU mode of the maple tree.
      
      Link: https://lkml.kernel.org/r/20230327185532.2354250-1-Liam.Howlett@oracle.com
      Link: https://lkml.kernel.org/r/20230227173632.3292573-1-surenb@google.com
      Link: https://lkml.kernel.org/r/20230227173632.3292573-2-surenb@google.com
      Fixes: 54a611b6 ("Maple Tree: add new data structure")
      Signed-off-by: default avatarLiam Howlett <Liam.Howlett@oracle.com>
      Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arjun Roy <arjunroy@google.com>
      Cc: Axel Rasmussen <axelrasmussen@google.com>
      Cc: Chris Li <chriscli@google.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: freak07 <michalechner92@googlemail.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Kent Overstreet <kent.overstreet@linux.dev>
      Cc: Laurent Dufour <ldufour@linux.ibm.com>
      Cc: Lorenzo Stoakes <lstoakes@gmail.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Mike Rapoport <rppt@kernel.org>
      Cc: Minchan Kim <minchan@google.com>
      Cc: Paul E. McKenney <paulmck@kernel.org>
      Cc: Peter Oskolkov <posk@google.com>
      Cc: Peter Xu <peterx@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Punit Agrawal <punit.agrawal@bytedance.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Shakeel Butt <shakeelb@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Will Deacon <will@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      39d0bd86
  2. 28 Mar, 2023 8 commits
  3. 26 Mar, 2023 7 commits
    • Linus Torvalds's avatar
      Linux 6.3-rc4 · 197b6b60
      Linus Torvalds authored
      197b6b60
    • Linus Torvalds's avatar
      Merge tag 'usb-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 0ec57cfa
      Linus Torvalds authored
      Pull USB / Thunderbolt driver fixes from Greg KH:
       "Here are a small set of USB and Thunderbolt driver fixes for reported
        problems and a documentation update, for 6.3-rc4.
      
        Included in here are:
      
         - documentation update for uvc gadget driver
      
         - small thunderbolt driver fixes
      
         - cdns3 driver fixes
      
         - dwc3 driver fixes
      
         - dwc2 driver fixes
      
         - chipidea driver fixes
      
         - typec driver fixes
      
         - onboard_usb_hub device id updates
      
         - quirk updates
      
        All of these have been in linux-next with no reported problems"
      
      * tag 'usb-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (30 commits)
        usb: dwc2: fix a race, don't power off/on phy for dual-role mode
        usb: dwc2: fix a devres leak in hw_enable upon suspend resume
        usb: chipidea: core: fix possible concurrent when switch role
        usb: chipdea: core: fix return -EINVAL if request role is the same with current role
        thunderbolt: Rename shadowed variables bit to interrupt_bit and auto_clear_bit
        thunderbolt: Disable interrupt auto clear for rings
        thunderbolt: Use const qualifier for `ring_interrupt_index`
        usb: gadget: Use correct endianness of the wLength field for WebUSB
        uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS583Gen 2
        usb: cdnsp: changes PCI Device ID to fix conflict with CNDS3 driver
        usb: cdns3: Fix issue with using incorrect PCI device function
        usb: cdnsp: Fixes issue with redundant Status Stage
        MAINTAINERS: make me a reviewer of USB/IP
        thunderbolt: Use scale field when allocating USB3 bandwidth
        thunderbolt: Limit USB3 bandwidth of certain Intel USB4 host routers
        thunderbolt: Call tb_check_quirks() after initializing adapters
        thunderbolt: Add missing UNSET_INBOUND_SBTX for retimer access
        thunderbolt: Fix memory leak in margining
        usb: dwc2: drd: fix inconsistent mode if role-switch-default-mode="host"
        docs: usb: Add documentation for the UVC Gadget
        ...
      0ec57cfa
    • Linus Torvalds's avatar
      Merge tag 'sched_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 18940c88
      Linus Torvalds authored
      Pull scheduler fix from Borislav Petkov:
      
       - Fix a corner case where vruntime of a task is not being sanitized
      
      * tag 'sched_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/fair: Sanitize vruntime of entity being migrated
      18940c88
    • Linus Torvalds's avatar
      Merge tag 'perf_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 974fc943
      Linus Torvalds authored
      Pull perf fix from Borislav Petkov:
      
       - Properly clear perf event status tracking in the AMD perf event
         overflow handler
      
      * tag 'perf_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/amd/core: Always clear status for idx
      974fc943
    • Linus Torvalds's avatar
      Merge tag 'core_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f6cdaeb0
      Linus Torvalds authored
      Pull core fixes from Borislav Petkov:
      
       - Do the delayed RCU wakeup for kthreads in the proper order so that
         former doesn't get ignored
      
       - A noinstr warning fix
      
      * tag 'core_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        entry/rcu: Check TIF_RESCHED _after_ delayed RCU wake-up
        entry: Fix noinstr warning in __enter_from_user_mode()
      f6cdaeb0
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 986c6374
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Add a AMX ptrace self test
      
       - Prevent a false-positive warning when retrieving the (invalid)
         address of dynamic FPU features in their init state which are not
         saved in init_fpstate at all
      
       - Randomize per-CPU entry areas only when KASLR is enabled
      
      * tag 'x86_urgent_for_v6.3_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        selftests/x86/amx: Add a ptrace test
        x86/fpu/xstate: Prevent false-positive warning in __copy_xstate_uabi_buf()
        x86/mm: Do not shuffle CPU entry areas without KASLR
      986c6374
    • Linus Torvalds's avatar
      Merge tag 'smb3-client-fixes-6.3-rc3' of git://git.samba.org/sfrench/cifs-2.6 · 6485ac65
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
       "Twelve cifs/smb3 client fixes (most also for stable)
      
         - forced umount fix
      
         - fix for two perf regressions
      
         - reconnect fixes
      
         - small debugging improvements
      
         - multichannel fixes"
      
      * tag 'smb3-client-fixes-6.3-rc3' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: fix unusable share after force unmount failure
        cifs: fix dentry lookups in directory handle cache
        smb3: lower default deferred close timeout to address perf regression
        cifs: fix missing unload_nls() in smb2_reconnect()
        cifs: avoid race conditions with parallel reconnects
        cifs: append path to open_enter trace event
        cifs: print session id while listing open files
        cifs: dump pending mids for all channels in DebugData
        cifs: empty interface list when server doesn't support query interfaces
        cifs: do not poll server interfaces too regularly
        cifs: lock chan_lock outside match_session
        cifs: check only tcon status on tcon related functions
      6485ac65
  4. 25 Mar, 2023 7 commits
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · da8e7da1
      Linus Torvalds authored
      Pull nfsd fix from Chuck Lever:
      
       - Fix a crash when using NFS with krb5p
      
      * tag 'nfsd-6.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        SUNRPC: Fix a crash in gss_krb5_checksum()
      da8e7da1
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.3-fixes-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 5b9ff397
      Linus Torvalds authored
      Pull yet more xfs bug fixes from Darrick Wong:
       "The first bugfix addresses a longstanding problem where we use the
        wrong file mapping cursors when trying to compute the speculative
        preallocation quantity. This has been causing sporadic crashes when
        alwayscow mode is engaged.
      
        The other two fixes correct minor problems in more recent changes.
      
         - Fix the new allocator tracepoints because git am mismerged the
           changes such that the trace_XXX got rebased to be in function YYY
           instead of XXX
      
         - Ensure that the perag AGFL_RESET state is consistent with whatever
           we've just read off the disk
      
         - Fix a bug where we used the wrong iext cursor during a write begin"
      
      * tag 'xfs-6.3-fixes-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: fix mismerged tracepoints
        xfs: clear incore AGFL_RESET state if it's not needed
        xfs: pass the correct cursor to xfs_iomap_prealloc_size
      5b9ff397
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.3-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · f768b35a
      Linus Torvalds authored
      Pull xfs percpu counter fixes from Darrick Wong:
       "We discovered a filesystem summary counter corruption problem that was
        traced to cpu hot-remove racing with the call to percpu_counter_sum
        that sets the free block count in the superblock when writing it to
        disk. The root cause is that percpu_counter_sum doesn't cull from
        dying cpus and hence misses those counter values if the cpu shutdown
        hooks have not yet run to merge the values.
      
        I'm hoping this is a fairly painless fix to the problem, since the
        dying cpu mask should generally be empty. It's been in for-next for a
        week without any complaints from the bots.
      
         - Fix a race in the percpu counters summation code where the
           summation failed to add in the values for any CPUs that were dying
           but not yet dead. This fixes some minor discrepancies and incorrect
           assertions when running generic/650"
      
      * tag 'xfs-6.3-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        pcpcntr: remove percpu_counter_sum_all()
        fork: remove use of percpu_counter_sum_all
        pcpcntrs: fix dying cpu summation race
        cpumask: introduce for_each_cpu_or
      f768b35a
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.3-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · d7044263
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "This batch started with some debugging enhancements to the new
        allocator refactoring that we put in 6.3-rc1 to assist developers in
        rebasing their dev branches.
      
        As for more serious code changes -- there's a bug fix to make the
        lockless allocator scan the whole filesystem before resorting to the
        locking allocator. We're also adding a selftest for the venerable
        directory/xattr hash function to make sure that it produces consistent
        results so that we can address any fallout as soon as possible.
      
         - Add a few debugging assertions so that people (me) trying to port
           code to the new allocator functions don't mess up the caller
           requirements
      
         - Relax some overly cautious lock ordering enforcement in the new
           allocator code, which means that file allocations will locklessly
           scan for the best space they can get before backing off to the
           traditional lock-and-really-get-it behavior
      
         - Add tracepoints to make it easier to trace the xfs allocator
           behavior
      
         - Actually test the dir/xattr hash algorithm to make sure it produces
           consistent results across all the platforms XFS supports"
      
      * tag 'xfs-6.3-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: test dir/attr hash when loading module
        xfs: add tracepoints for each of the externally visible allocators
        xfs: walk all AGs if TRYLOCK passed to xfs_alloc_vextent_iterate_ags
        xfs: try to idiot-proof the allocators
      d7044263
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v6.3-rc4' of... · 4bdec23f
      Linus Torvalds authored
      Merge tag 'hwmon-for-v6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - it87: Fix voltage scaling for chips with 10.9mV ADCs
      
       - xgene: Fix ioremap and memremap leak
      
       - peci/cputemp: Fix miscalculated DTS temperature for SKX
      
       - hwmon core: fix potential sensor registration failure with thermal
         subsystem if of_node is missing
      
      * tag 'hwmon-for-v6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon (it87): Fix voltage scaling for chips with 10.9mV  ADCs
        hwmon: (xgene) Fix ioremap and memremap leak
        hwmon: fix potential sensor registration fail if of_node is missing
        hwmon: (peci/cputemp) Fix miscalculated DTS for SKX
      4bdec23f
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2023-03-24-17-09' of... · 65aca32e
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2023-03-24-17-09' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "21 hotfixes, 8 of which are cc:stable. 11 are for MM, the remainder
        are for other subsystems"
      
      * tag 'mm-hotfixes-stable-2023-03-24-17-09' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (21 commits)
        mm: mmap: remove newline at the end of the trace
        mailmap: add entries for Richard Leitner
        kcsan: avoid passing -g for test
        kfence: avoid passing -g for test
        mm: kfence: fix using kfence_metadata without initialization in show_object()
        lib: dhry: fix unstable smp_processor_id(_) usage
        mailmap: add entry for Enric Balletbo i Serra
        mailmap: map Sai Prakash Ranjan's old address to his current one
        mailmap: map Rajendra Nayak's old address to his current one
        Revert "kasan: drop skip_kasan_poison variable in free_pages_prepare"
        mailmap: add entry for Tobias Klauser
        kasan, powerpc: don't rename memintrinsics if compiler adds prefixes
        mm/ksm: fix race with VMA iteration and mm_struct teardown
        kselftest: vm: fix unused variable warning
        mm: fix error handling for map_deny_write_exec
        mm: deduplicate error handling for map_deny_write_exec
        checksyscalls: ignore fstat to silence build warning on LoongArch
        nilfs2: fix kernel-infoleak in nilfs_ioctl_wrap_copy()
        test_maple_tree: add more testing for mas_empty_area()
        maple_tree: fix mas_skip_node() end slot detection
        ...
      65aca32e
    • Linus Torvalds's avatar
      Merge tag '6.3-rc3-ksmbd-smb3-server-fixes' of git://git.samba.org/ksmbd · 90c8ce31
      Linus Torvalds authored
      Pull ksmbd server fixes from Steve French:
      
       - return less confusing messages on unsupported dialects
         (STATUS_NOT_SUPPORTED instead of I/O error)
      
       - fix for overly frequent inactive session termination
      
       - fix refcount leak
      
       - fix bounds check problems found by static checkers
      
       - fix to advertise named stream support correctly
      
       - Fix AES256 signing bug when connected to from MacOS
      
      * tag '6.3-rc3-ksmbd-smb3-server-fixes' of git://git.samba.org/ksmbd:
        ksmbd: return unsupported error on smb1 mount
        ksmbd: return STATUS_NOT_SUPPORTED on unsupported smb2.0 dialect
        ksmbd: don't terminate inactive sessions after a few seconds
        ksmbd: fix possible refcount leak in smb2_open()
        ksmbd: add low bound validation to FSCTL_QUERY_ALLOCATED_RANGES
        ksmbd: add low bound validation to FSCTL_SET_ZERO_DATA
        ksmbd: set FILE_NAMED_STREAMS attribute in FS_ATTRIBUTE_INFORMATION
        ksmbd: fix wrong signingkey creation when encryption is AES256
      90c8ce31
  5. 24 Mar, 2023 7 commits
    • Linus Torvalds's avatar
      Merge tag 'arm-fixes-6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · e76db6e5
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "As usual, most of the bug fixes address issues in the devicetree
        files, and out of these, most are for the Qualcomm and NXP platforms,
        including:
      
         - A missing 'reserved-memory' property on LG G Watch R that is needed
           to prevent clashing with firmware
      
         - Annotations for cache coherency on multiple machines
      
         - Corrections for pinctrl, regulator, clock, iommu and power domain
           properties for i.MX and Qualcomm to correctly reflect the hardware
           settings
      
         - Firmware file names on multiple machines SA8540P Ride board
      
         - An incompatible change to the qcom vadc driver requires adding
           individual labels
      
         - Fix EQoS PHY reset GPIO by dropping the deprecated/wrong property
           and switch to the new bindings.
      
         - A fix for PCI bus address translation Tegra194 and Tegra234.
      
        There are also a couple of device driver fixes, addressing:
      
         - A race condition in the amdtee driver
      
         - A performance regression in the Qualcomm 'llcc' driver
      
         - An unitialized variable use NXP i.MX 'weim' driver
      
         - Error handling issues in Qualcomm 'rmtfs', and 'scm' drivers and
           the Arm scmi firmware driver"
      
      * tag 'arm-fixes-6.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (48 commits)
        arm64: dts: qcom: sc8280xp-x13s: mark bob regulator as always-on
        arm64: dts: qcom: sc8280xp-x13s: mark s12b regulator as always-on
        arm64: dts: qcom: sc8280xp-x13s: mark s10b regulator as always-on
        arm64: dts: qcom: sc8280xp-x13s: mark s11b regulator as always-on
        arm64: dts: imx93: add missing #address-cells and #size-cells to i2c nodes
        bus: imx-weim: fix branch condition evaluates to a garbage value
        arm64: dts: imx8mn: specify #sound-dai-cells for SAI nodes
        ARM: dts: imx6sl: tolino-shine2hd: fix usbotg1 pinctrl
        ARM: dts: imx6sll: e60k02: fix usbotg1 pinctrl
        ARM: dts: imx6sll: e70k02: fix usbotg1 pinctrl
        arm64: dts: imx93: Fix eqos properties
        arm64: dts: imx8mp: Fix LCDIF2 node clock order
        arm64: dts: imx8mm-nitrogen-r2: fix WM8960 clock name
        arm64: dts: imx8dxl-evk: Fix eqos phy reset gpio
        firmware: qcom: scm: fix bogus irq error at probe
        arm64: dts: qcom: sm8550: Mark UFS controller as cache coherent
        arm64: dts: qcom: sa8540p-ride: correct name of remoteproc_nsp0 firmware
        arm64: dts: qcom: sm8450: Mark UFS controller as cache coherent
        arm64: dts: qcom: sm8350: Mark UFS controller as cache coherent
        arm64: dts: qcom: sm8550: fix LPASS pinctrl slew base address
        ...
      e76db6e5
    • Linus Torvalds's avatar
      Merge tag 'for-v6.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply · d7b5c942
      Linus Torvalds authored
      Pull power supply fixes from Sebastian Reichel:
      
       - rk817: Fix compiler warning
      
       - cros_usbpd-charger: Fix excessive error printing
      
       - axp288_fuel_gauge: handle platform_get_irq error
      
       - bq24190 and da9150: Fix race condition in remove path
      
      * tag 'for-v6.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
        power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition
        power: supply: bq24190: Fix use after free bug in bq24190_remove due to race condition
        power: supply: axp288_fuel_gauge: Added check for negative values
        power: supply: cros_usbpd: reclassify "default case!" as debug
        power: supply: rk817: Fix unsigned comparison with less than zero
      d7b5c942
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2023-03-24' of git://anongit.freedesktop.org/drm/drm · 37154c19
      Linus Torvalds authored
      Pull drm fixes from Daniel Vetter:
      
       - usual pile of fixes for amdgpu & i915
      
       - probe error handling fixes for meson, lt8912b bridge
      
       - the host1x patch from Arnd
      
       - panel-orientation fix for Lenovo Book X90F
      
      * tag 'drm-fixes-2023-03-24' of git://anongit.freedesktop.org/drm/drm: (23 commits)
        gpu: host1x: fix uninitialized variable use
        drm/amd/display: Set dcn32 caps.seamless_odm
        drm/amd/display: fix wrong index used in dccg32_set_dpstreamclk
        drm/amdgpu/nv: Apply ASPM quirk on Intel ADL + AMD Navi
        drm/amd/display: remove outdated 8bpc comments
        drm/amdgpu/gfx: set cg flags to enter/exit safe mode
        drm/amdgpu: Force signal hw_fences that are embedded in non-sched jobs
        drm/amdgpu: add mes resume when do gfx post soft reset
        drm/amdgpu: skip ASIC reset for APUs when go to S4
        drm/amdgpu: reposition the gpu reset checking for reuse
        drm/bridge: lt8912b: return EPROBE_DEFER if bridge is not found
        drm/meson: fix missing component unbind on bind errors
        drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Book X90F
        Revert "drm/i915/hwmon: Enable PL1 power limit"
        drm/i915: Update vblank timestamping stuff on seamless M/N change
        drm/i915: Fix format for perf_limit_reasons
        drm/i915/gt: perform uc late init after probe error injection
        drm/i915/active: Fix missing debug object activation
        drm/i915/guc: Fix missing ecodes
        drm/i915/mtl: Disable MC6 for MTL A step
        ...
      37154c19
    • Linus Torvalds's avatar
      Merge tag 'for-6.3/dm-fixes' of... · 5ad4fe96
      Linus Torvalds authored
      Merge tag 'for-6.3/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
      
       - Fix DM thin to work as a swap device by using 'limit_swap_bios' DM
         target flag (initially added to allow swap to dm-crypt) to throttle
         the amount of outstanding swap bios.
      
       - Fix DM crypt soft lockup warnings by calling cond_resched() from the
         cpu intensive loop in dmcrypt_write().
      
       - Fix DM crypt to not access an uninitialized tasklet. This fix allows
         for consistent handling of IO completion, by _not_ needlessly punting
         to a workqueue when tasklets are not needed.
      
       - Fix DM core's alloc_dev() initialization for DM stats to check for
         and propagate alloc_percpu() failure.
      
      * tag 'for-6.3/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm stats: check for and propagate alloc_percpu failure
        dm crypt: avoid accessing uninitialized tasklet
        dm crypt: add cond_resched() to dmcrypt_write()
        dm thin: fix deadlock when swapping to thin device
      5ad4fe96
    • Linus Torvalds's avatar
      Merge tag 'block-6.3-2023-03-24' of git://git.kernel.dk/linux · 83511470
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request via Christoph:
           - Send Identify with CNS 06h only to I/O controllers (Martin
             George)
           - Fix nvme_tcp_term_pdu to match spec (Caleb Sander)
      
       - Pass in issue_flags for uring_cmd, so the end_io handlers don't need
         to assume what the right context is (me)
      
       - Fix for ublk, marking it as LIVE before adding it to avoid races on
         the initial IO (Ming)
      
      * tag 'block-6.3-2023-03-24' of git://git.kernel.dk/linux:
        nvme-tcp: fix nvme_tcp_term_pdu to match spec
        nvme: send Identify with CNS 06h only to I/O controllers
        block/io_uring: pass in issue_flags for uring_cmd task_work handling
        block: ublk_drv: mark device as LIVE before adding disk
      83511470
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.3-2023-03-24' of git://git.kernel.dk/linux · e344eb7b
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
      
       - Fix an issue with repeated -ECONNREFUSED on a socket (me)
      
       - Fix a NULL pointer deference due to a stale lookup cache for
         allocating direct descriptors (Savino)
      
      * tag 'io_uring-6.3-2023-03-24' of git://git.kernel.dk/linux:
        io_uring/rsrc: fix null-ptr-deref in io_file_bitmap_get()
        io_uring/net: avoid sending -ECONNABORTED on repeated connection requests
      e344eb7b
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · fd3d06ff
      Linus Torvalds authored
      Pull thermal control fixes from Rafael Wysocki:
       "These address two recent regressions related to thermal control.
      
        Specifics:
      
         - Restore the thermal core behavior regarding zero-temperature trip
           points to avoid a driver regression (Ido Schimmel)
      
         - Fix a recent regression in the ACPI processor driver preventing it
           from changing the number of CPU cooling device states exposed via
           sysfs after the given CPU cooling device has been registered
           (Rafael Wysocki)"
      
      * tag 'thermal-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: core: Restore behavior regarding invalid trip points
        ACPI: processor: thermal: Update CPU cooling devices on cpufreq policy changes
        thermal: core: Introduce thermal_cooling_device_update()
        thermal: core: Introduce thermal_cooling_device_present()
        ACPI: processor: Reorder acpi_processor_driver_init()
      fd3d06ff