1. 31 Mar, 2022 1 commit
    • Matthew Wilcox (Oracle)'s avatar
      XArray: Update the LRU list in xas_split() · 3ed4bb77
      Matthew Wilcox (Oracle) authored
      When splitting a value entry, we may need to add the new nodes to the LRU
      list and remove the parent node from the LRU list.  The WARN_ON checks
      in shadow_lru_isolate() catch this oversight.  This bug was latent
      until we stopped splitting folios in shrink_page_list() with commit
      820c4e2e ("mm/vmscan: Free non-shmem folios without splitting them").
      That allows the creation of large shadow entries, and subsequently when
      trying to page in a small page, we will split the large shadow entry
      in __filemap_add_folio().
      
      Fixes: 8fc75643 ("XArray: add xas_split")
      Reported-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      3ed4bb77
  2. 28 Mar, 2022 1 commit
    • Matthew Wilcox (Oracle)'s avatar
      XArray: Fix xas_create_range() when multi-order entry present · 3e3c6580
      Matthew Wilcox (Oracle) authored
      If there is already an entry present that is of order >= XA_CHUNK_SHIFT
      when we call xas_create_range(), xas_create_range() will misinterpret
      that entry as a node and dereference xa_node->parent, generally leading
      to a crash that looks something like this:
      
      general protection fault, probably for non-canonical address 0xdffffc0000000001:
      0000 [#1] PREEMPT SMP KASAN
      KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
      CPU: 0 PID: 32 Comm: khugepaged Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2 #0
      RIP: 0010:xa_parent_locked include/linux/xarray.h:1207 [inline]
      RIP: 0010:xas_create_range+0x2d9/0x6e0 lib/xarray.c:725
      
      It's deterministically reproducable once you know what the problem is,
      but producing it in a live kernel requires khugepaged to hit a race.
      While the problem has been present since xas_create_range() was
      introduced, I'm not aware of a way to hit it before the page cache was
      converted to use multi-index entries.
      
      Fixes: 6b24ca4a ("mm: Use multi-index entries in the page cache")
      Reported-by: syzbot+0d2b0bf32ca5cfd09f2e@syzkaller.appspotmail.com
      Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      3e3c6580
  3. 03 Feb, 2022 8 commits
  4. 02 Feb, 2022 4 commits
  5. 01 Feb, 2022 12 commits
  6. 31 Jan, 2022 2 commits
  7. 30 Jan, 2022 12 commits