Skip to content
  1. Oct 29, 2021
    • Yang Shi's avatar
      mm: filemap: check if THP has hwpoisoned subpage for PMD page fault · eac96c3e
      Yang Shi authored
      When handling shmem page fault the THP with corrupted subpage could be
      PMD mapped if certain conditions are satisfied.  But kernel is supposed
      to send SIGBUS when trying to map hwpoisoned page.
      
      There are two paths which may do PMD map: fault around and regular
      fault.
      
      Before commit f9ce0be7 ("mm: Cleanup faultaround and finish_fault()
      codepaths") the thing was even worse in fault around path.  The THP
      could be PMD mapped as long as the VMA fits regardless what subpage is
      accessed and corrupted.  After this commit as long as head page is not
      corrupted the THP could be PMD mapped.
      
      In the regular fault path the THP could be PMD mapped as long as the
      corrupted page is not accessed and the VMA fits.
      
      This loophole could be fixed by iterating every subpage to check if any
      of them is hwpoisoned or not, but it is somewhat costly in page fault
      path.
      
      So introduce a new page flag called HasHWPoisoned on the first tail
      page.  It indicates the THP has hwpoisoned subpage(s).  It is set if any
      subpage of THP is found hwpoisoned by memory failure and after the
      refcount is bumped successfully, then cleared when the THP is freed or
      split.
      
      The soft offline path doesn't need this since soft offline handler just
      marks a subpage hwpoisoned when the subpage is migrated successfully.
      But shmem THP didn't get split then migrated at all.
      
      Link: https://lkml.kernel.org/r/20211020210755.23964-3-shy828301@gmail.com
      Fixes: 800d8c63
      
       ("shmem: add huge pages support")
      Signed-off-by: default avatarYang Shi <shy828301@gmail.com>
      Reviewed-by: default avatarNaoya Horiguchi <naoya.horiguchi@nec.com>
      Suggested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Oscar Salvador <osalvador@suse.de>
      Cc: Peter Xu <peterx@redhat.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>
      eac96c3e
    • Yang Shi's avatar
      mm: hwpoison: remove the unnecessary THP check · c7cb42e9
      Yang Shi authored
      When handling THP hwpoison checked if the THP is in allocation or free
      stage since hwpoison may mistreat it as hugetlb page.  After commit
      415c64c1 ("mm/memory-failure: split thp earlier in memory error
      handling") the problem has been fixed, so this check is no longer
      needed.  Remove it.  The side effect of the removal is hwpoison may
      report unsplit THP instead of unknown error for shmem THP.  It seems not
      like a big deal.
      
      The following patch "mm: filemap: check if THP has hwpoisoned subpage
      for PMD page fault" depends on this, which fixes shmem THP with
      hwpoisoned subpage(s) are mapped PMD wrongly.  So this patch needs to be
      backported to -stable as well.
      
      Link: https://lkml.kernel.org/r/20211020210755.23964-2-shy828301@gmail.com
      
      
      Signed-off-by: default avatarYang Shi <shy828301@gmail.com>
      Suggested-by: default avatarNaoya Horiguchi <naoya.horiguchi@nec.com>
      Acked-by: default avatarNaoya Horiguchi <naoya.horiguchi@nec.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Oscar Salvador <osalvador@suse.de>
      Cc: Peter Xu <peterx@redhat.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>
      c7cb42e9
    • Shakeel Butt's avatar
      memcg: page_alloc: skip bulk allocator for __GFP_ACCOUNT · 8dcb3060
      Shakeel Butt authored
      Commit 5c1f4e69 ("mm/vmalloc: switch to bulk allocator in
      __vmalloc_area_node()") switched to bulk page allocator for order 0
      allocation backing vmalloc.  However bulk page allocator does not
      support __GFP_ACCOUNT allocations and there are several users of
      kvmalloc(__GFP_ACCOUNT).
      
      For now make __GFP_ACCOUNT allocations bypass bulk page allocator.  In
      future if there is workload that can be significantly improved with the
      bulk page allocator with __GFP_ACCCOUNT support, we can revisit the
      decision.
      
      Link: https://lkml.kernel.org/r/20211014151607.2171970-1-shakeelb@google.com
      Fixes: 5c1f4e69
      
       ("mm/vmalloc: switch to bulk allocator in __vmalloc_area_node()")
      Signed-off-by: default avatarShakeel Butt <shakeelb@google.com>
      Reported-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Tested-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: default avatarRoman Gushchin <guro@fb.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8dcb3060
    • Linus Torvalds's avatar
      Merge tag 'net-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 411a44c2
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from WiFi (mac80211), and BPF.
      
        Current release - regressions:
      
         - skb_expand_head: adjust skb->truesize to fix socket memory
           accounting
      
         - mptcp: fix corrupt receiver key in MPC + data + checksum
      
        Previous releases - regressions:
      
         - multicast: calculate csum of looped-back and forwarded packets
      
         - cgroup: fix memory leak caused by missing cgroup_bpf_offline
      
         - cfg80211: fix management registrations locking, prevent list
           corruption
      
         - cfg80211: correct false positive in bridge/4addr mode check
      
         - tcp_bpf: fix race in the tcp_bpf_send_verdict resulting in reusing
           previous verdict
      
        Previous releases - always broken:
      
         - sctp: enhancements for the verification tag, prevent attackers from
           killing SCTP sessions
      
         - tipc: fix size validations for the MSG_CRYPTO type
      
         - mac80211: mesh: fix HE operation element length check, prevent out
           of bound access
      
         - tls: fix sign of socket errors, prevent positive error codes being
           reported from read()/write()
      
         - cfg80211: scan: extend RCU protection in
           cfg80211_add_nontrans_list()
      
         - implement ->sock_is_readable() for UDP and AF_UNIX, fix poll() for
           sockets in a BPF sockmap
      
         - bpf: fix potential race in tail call compatibility check resulting
           in two operations which would make the map incompatible succeeding
      
         - bpf: prevent increasing bpf_jit_limit above max
      
         - bpf: fix error usage of map_fd and fdget() in generic batch update
      
         - phy: ethtool: lock the phy for consistency of results
      
         - prevent infinite while loop in skb_tx_hash() when Tx races with
           driver reconfiguring the queue <> traffic class mapping
      
         - usbnet: fixes for bad HW conjured by syzbot
      
         - xen: stop tx queues during live migration, prevent UAF
      
         - net-sysfs: initialize uid and gid before calling
           net_ns_get_ownership
      
         - mlxsw: prevent Rx stalls under memory pressure"
      
      * tag 'net-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (67 commits)
        Revert "net: hns3: fix pause config problem after autoneg disabled"
        mptcp: fix corrupt receiver key in MPC + data + checksum
        riscv, bpf: Fix potential NULL dereference
        octeontx2-af: Fix possible null pointer dereference.
        octeontx2-af: Display all enabled PF VF rsrc_alloc entries.
        octeontx2-af: Check whether ipolicers exists
        net: ethernet: microchip: lan743x: Fix skb allocation failure
        net/tls: Fix flipped sign in async_wait.err assignment
        net/tls: Fix flipped sign in tls_err_abort() calls
        net/smc: Correct spelling mistake to TCPF_SYN_RECV
        net/smc: Fix smc_link->llc_testlink_time overflow
        nfp: bpf: relax prog rejection for mtu check through max_pkt_offset
        vmxnet3: do not stop tx queues after netif_device_detach()
        r8169: Add device 10ec:8162 to driver r8169
        ptp: Document the PTP_CLK_MAGIC ioctl number
        usbnet: fix error return code in usbnet_probe()
        net: hns3: adjust string spaces of some parameters of tx bd info in debugfs
        net: hns3: expand buffer len for some debugfs command
        net: hns3: add more string spaces for dumping packets number of queue info in debugfs
        net: hns3: fix data endian problem of some functions of debugfs
        ...
      411a44c2
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 4fb7d85b
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A couple of final driver specific fixes for v5.15, one fixing
        potential ID collisions between two instances of the Altera driver and
        one making Microwire full duplex mode actually work on pl022"
      
      * tag 'spi-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: spl022: fix Microwire full duplex mode
        spi: altera: Change to dynamic allocation of spi id
      4fb7d85b
    • Linus Torvalds's avatar
      Merge tag 'regmap-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap · 8685de2e
      Linus Torvalds authored
      Pull regmap fix from Mark Brown:
       "This fixes a potential double free when handling an out of memory
        error inserting a node into an rbtree regcache"
      
      * tag 'regmap-fix-v5.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
        regmap: Fix possible double-free in regcache_rbtree_exit()
      8685de2e
    • Linus Torvalds's avatar
      Merge tag 'linux-watchdog-5.15-rc7' of git://www.linux-watchdog.org/linux-watchdog · eecd231a
      Linus Torvalds authored
      Pull watchdog fixes from Wim Van Sebroeck:
       "I overlooked Guenters request to sent this upstream earlier, so it's a
        bit late in the release cycle.
      
        This contains:
      
         - Revert "watchdog: iTCO_wdt: Account for rebooting on second
           timeout"
      
         - sbsa: only use 32-bit accessors
      
         - sbsa: drop unneeded MODULE_ALIAS
      
         - ixp4xx_wdt: Fix address space warning
      
         - Fix OMAP watchdog early handling"
      
      * tag 'linux-watchdog-5.15-rc7' of git://www.linux-watchdog.org/linux-watchdog:
        watchdog: Fix OMAP watchdog early handling
        watchdog: ixp4xx_wdt: Fix address space warning
        watchdog: sbsa: drop unneeded MODULE_ALIAS
        watchdog: sbsa: only use 32-bit accessors
        Revert "watchdog: iTCO_wdt: Account for rebooting on second timeout"
      eecd231a
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.15-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · fc18cc89
      Linus Torvalds authored
      Pull tracing fix from Steven Rostedt:
       "Do not WARN when attaching event probe to non-existent event
      
        If the user tries to attach an event probe (eprobe) to an event that
        does not exist, it will trigger a warning. There's an error check that
        only expects memory issues otherwise it is considered a bug. But
        changes in the code to move around the locking made it that it can
        error out if the user attempts to attach to an event that does not
        exist, returning an -ENODEV. As this path can be caused by user space
        putting in a bad value, do not trigger a WARN"
      
      * tag 'trace-v5.15-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Do not warn when connecting eprobe to non existing event
      fc18cc89
  2. Oct 28, 2021
  3. Oct 27, 2021