1. 06 Mar, 2022 2 commits
  2. 05 Mar, 2022 13 commits
  3. 04 Mar, 2022 14 commits
  4. 03 Mar, 2022 11 commits
    • Alexandre Ghiti's avatar
      riscv: Fix kasan pud population · e4fcfe6e
      Alexandre Ghiti authored
      In sv48, the kasan inner regions are not aligned on PGDIR_SIZE and then
      when we populate the kasan linear mapping region, we clear the kasan
      vmalloc region which is in the same PGD.
      
      Fix this by copying the content of the kasan early pud after allocating a
      new PGD for the first time.
      
      Fixes: e8a62cc2 ("riscv: Implement sv48 support")
      Signed-off-by: default avatarAlexandre Ghiti <alexandre.ghiti@canonical.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      e4fcfe6e
    • Alexandre Ghiti's avatar
      riscv: Move high_memory initialization to setup_bootmem · 625e24a5
      Alexandre Ghiti authored
      high_memory used to be initialized in mem_init, way after setup_bootmem.
      But a call to dma_contiguous_reserve in this function gives rise to the
      below warning because high_memory is equal to 0 and is used at the very
      beginning at cma_declare_contiguous_nid.
      
      It went unnoticed since the move of the kasan region redefined
      KERN_VIRT_SIZE so that it does not encompass -1 anymore.
      
      Fix this by initializing high_memory in setup_bootmem.
      
      ------------[ cut here ]------------
      virt_to_phys used for non-linear address: ffffffffffffffff (0xffffffffffffffff)
      WARNING: CPU: 0 PID: 0 at arch/riscv/mm/physaddr.c:14 __virt_to_phys+0xac/0x1b8
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper Not tainted 5.17.0-rc1-00007-ga68b89289e26 #27
      Hardware name: riscv-virtio,qemu (DT)
      epc : __virt_to_phys+0xac/0x1b8
       ra : __virt_to_phys+0xac/0x1b8
      epc : ffffffff80014922 ra : ffffffff80014922 sp : ffffffff84a03c30
       gp : ffffffff85866c80 tp : ffffffff84a3f180 t0 : ffffffff86bce657
       t1 : fffffffef09406e8 t2 : 0000000000000000 s0 : ffffffff84a03c70
       s1 : ffffffffffffffff a0 : 000000000000004f a1 : 00000000000f0000
       a2 : 0000000000000002 a3 : ffffffff8011f408 a4 : 0000000000000000
       a5 : 0000000000000000 a6 : 0000000000f00000 a7 : ffffffff84a03747
       s2 : ffffffd800000000 s3 : ffffffff86ef4000 s4 : ffffffff8467f828
       s5 : fffffff800000000 s6 : 8000000000006800 s7 : 0000000000000000
       s8 : 0000000480000000 s9 : 0000000080038ea0 s10: 0000000000000000
       s11: ffffffffffffffff t3 : ffffffff84a035c0 t4 : fffffffef09406e8
       t5 : fffffffef09406e9 t6 : ffffffff84a03758
      status: 0000000000000100 badaddr: 0000000000000000 cause: 0000000000000003
      [<ffffffff8322ef4c>] cma_declare_contiguous_nid+0xf2/0x64a
      [<ffffffff83212a58>] dma_contiguous_reserve_area+0x46/0xb4
      [<ffffffff83212c3a>] dma_contiguous_reserve+0x174/0x18e
      [<ffffffff83208fc2>] paging_init+0x12c/0x35e
      [<ffffffff83206bd2>] setup_arch+0x120/0x74e
      [<ffffffff83201416>] start_kernel+0xce/0x68c
      irq event stamp: 0
      hardirqs last  enabled at (0): [<0000000000000000>] 0x0
      hardirqs last disabled at (0): [<0000000000000000>] 0x0
      softirqs last  enabled at (0): [<0000000000000000>] 0x0
      softirqs last disabled at (0): [<0000000000000000>] 0x0
      ---[ end trace 0000000000000000 ]---
      
      Fixes: f7ae0233 ("riscv: Move KASAN mapping next to the kernel mapping")
      Signed-off-by: default avatarAlexandre Ghiti <alexandre.ghiti@canonical.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      625e24a5
    • Alexandre Ghiti's avatar
      riscv: Fix config KASAN && DEBUG_VIRTUAL · c648c4bb
      Alexandre Ghiti authored
      __virt_to_phys function is called very early in the boot process (ie
      kasan_early_init) so it should not be instrumented by KASAN otherwise it
      bugs.
      
      Fix this by declaring phys_addr.c as non-kasan instrumentable.
      Signed-off-by: default avatarAlexandre Ghiti <alexandre.ghiti@canonical.com>
      Fixes: 8ad8b727 (riscv: Add KASAN support)
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      c648c4bb
    • Alexandre Ghiti's avatar
      riscv: Fix DEBUG_VIRTUAL false warnings · 5f763b3b
      Alexandre Ghiti authored
      KERN_VIRT_SIZE used to encompass the kernel mapping before it was
      redefined when moving the kasan mapping next to the kernel mapping to only
      match the maximum amount of physical memory.
      
      Then, kernel mapping addresses that go through __virt_to_phys are now
      declared as wrong which is not true, one can use __virt_to_phys on such
      addresses.
      
      Fix this by redefining the condition that matches wrong addresses.
      
      Fixes: f7ae0233 ("riscv: Move KASAN mapping next to the kernel mapping")
      Signed-off-by: default avatarAlexandre Ghiti <alexandre.ghiti@canonical.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      5f763b3b
    • Alexandre Ghiti's avatar
      riscv: Fix config KASAN && SPARSEMEM && !SPARSE_VMEMMAP · a3d32803
      Alexandre Ghiti authored
      In order to get the pfn of a struct page* when sparsemem is enabled
      without vmemmap, the mem_section structures need to be initialized which
      happens in sparse_init.
      
      But kasan_early_init calls pfn_to_page way before sparse_init is called,
      which then tries to dereference a null mem_section pointer.
      
      Fix this by removing the usage of this function in kasan_early_init.
      
      Fixes: 8ad8b727 ("riscv: Add KASAN support")
      Signed-off-by: default avatarAlexandre Ghiti <alexandre.ghiti@canonical.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      a3d32803
    • Alexandre Ghiti's avatar
      riscv: Fix is_linear_mapping with recent move of KASAN region · 8b274f22
      Alexandre Ghiti authored
      The KASAN region was recently moved between the linear mapping and the
      kernel mapping, is_linear_mapping used to check the validity of an
      address by using the start of the kernel mapping, which is now wrong.
      
      Fix this by using the maximum size of the physical memory.
      
      Fixes: f7ae0233 ("riscv: Move KASAN mapping next to the kernel mapping")
      Signed-off-by: default avatarAlexandre Ghiti <alexandre.ghiti@canonical.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      8b274f22
    • Ammar Faizi's avatar
      MAINTAINERS: Remove dead patchwork link · 38f80f42
      Ammar Faizi authored
      The patchwork link is dead. It says:
      
        404: File not found
        The page URL requested (/project/LKML/list/) does not exist.
      
      Remove it.
      Signed-off-by: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      38f80f42
    • David Howells's avatar
      cachefiles: Fix incorrect length to fallocate() · b08968f1
      David Howells authored
      When cachefiles_shorten_object() calls fallocate() to shape the cache
      file to match the DIO size, it passes the total file size it wants to
      achieve, not the amount of zeros that should be inserted.  Since this is
      meant to preallocate that amount of storage for the file, it can cause
      the cache to fill up the disk and hit ENOSPC.
      
      Fix this by passing the length actually required to go from the current
      EOF to the desired EOF.
      
      Fixes: 7623ed67 ("cachefiles: Implement cookie resize for truncate")
      Reported-by: default avatarJeffle Xu <jefflexu@linux.alibaba.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarJeff Layton <jlayton@kernel.org>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      cc: linux-cachefs@redhat.com
      Link: https://lore.kernel.org/r/164630854858.3665356.17419701804248490708.stgit@warthog.procyon.org.uk # v1
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b08968f1
    • Linus Torvalds's avatar
      Merge tag 'net-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · b949c21f
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from can, xfrm, wifi, bluetooth, and netfilter.
      
        Lots of various size fixes, the length of the tag speaks for itself.
        Most of the 5.17-relevant stuff comes from xfrm, wifi and bt trees
        which had been lagging as you pointed out previously. But there's also
        a larger than we'd like portion of fixes for bugs from previous
        releases.
      
        Three more fixes still under discussion, including and xfrm revert for
        uAPI error.
      
        Current release - regressions:
      
         - iwlwifi: don't advertise TWT support, prevent FW crash
      
         - xfrm: fix the if_id check in changelink
      
         - xen/netfront: destroy queues before real_num_tx_queues is zeroed
      
         - bluetooth: fix not checking MGMT cmd pending queue, make scanning
           work again
      
        Current release - new code bugs:
      
         - mptcp: make SIOCOUTQ accurate for fallback socket
      
         - bluetooth: access skb->len after null check
      
         - bluetooth: hci_sync: fix not using conn_timeout
      
         - smc: fix cleanup when register ULP fails
      
         - dsa: restore error path of dsa_tree_change_tag_proto
      
         - iwlwifi: fix build error for IWLMEI
      
         - iwlwifi: mvm: propagate error from request_ownership to the user
      
        Previous releases - regressions:
      
         - xfrm: fix pMTU regression when reported pMTU is too small
      
         - xfrm: fix TCP MSS calculation when pMTU is close to 1280
      
         - bluetooth: fix bt_skb_sendmmsg not allocating partial chunks
      
         - ipv6: ensure we call ipv6_mc_down() at most once, prevent leaks
      
         - ipv6: prevent leaks in igmp6 when input queues get full
      
         - fix up skbs delta_truesize in UDP GRO frag_list
      
         - eth: e1000e: fix possible HW unit hang after an s0ix exit
      
         - eth: e1000e: correct NVM checksum verification flow
      
         - ptp: ocp: fix large time adjustments
      
        Previous releases - always broken:
      
         - tcp: make tcp_read_sock() more robust in presence of urgent data
      
         - xfrm: distinguishing SAs and SPs by if_id in xfrm_migrate
      
         - xfrm: fix xfrm_migrate issues when address family changes
      
         - dcb: flush lingering app table entries for unregistered devices
      
         - smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error
      
         - mac80211: fix EAPoL rekey fail in 802.3 rx path
      
         - mac80211: fix forwarded mesh frames AC & queue selection
      
         - netfilter: nf_queue: fix socket access races and bugs
      
         - batman-adv: fix ToCToU iflink problems and check the result belongs
           to the expected net namespace
      
         - can: gs_usb, etas_es58x: fix opened_channel_cnt's accounting
      
         - can: rcar_canfd: register the CAN device when fully ready
      
         - eth: igb, igc: phy: drop premature return leaking HW semaphore
      
         - eth: ixgbe: xsk: change !netif_carrier_ok() handling in
           ixgbe_xmit_zc(), prevent live lock when link goes down
      
         - eth: stmmac: only enable DMA interrupts when ready
      
         - eth: sparx5: move vlan checks before any changes are made
      
         - eth: iavf: fix races around init, removal, resets and vlan ops
      
         - ibmvnic: more reset flow fixes
      
        Misc:
      
         - eth: fix return value of __setup handlers"
      
      * tag 'net-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits)
        ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
        net: dsa: make dsa_tree_change_tag_proto actually unwind the tag proto change
        ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc()
        selftests: mlxsw: resource_scale: Fix return value
        selftests: mlxsw: tc_police_scale: Make test more robust
        net: dcb: disable softirqs in dcbnl_flush_dev()
        bnx2: Fix an error message
        sfc: extend the locking on mcdi->seqno
        net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error cause by server
        net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error generated by client
        net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe()
        tcp: make tcp_read_sock() more robust
        bpf, sockmap: Do not ignore orig_len parameter
        net: ipa: add an interconnect dependency
        net: fix up skbs delta_truesize in UDP GRO frag_list
        iwlwifi: mvm: return value for request_ownership
        nl80211: Update bss channel on channel switch for P2P_CLIENT
        iwlwifi: fix build error for IWLMEI
        ptp: ocp: Add ptp_ocp_adjtime_coarse for large adjustments
        batman-adv: Don't expect inter-netns unique iflink indices
        ...
      b949c21f
    • Linus Torvalds's avatar
      Merge tag 'mips-fixes-5.17_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · e58bd49d
      Linus Torvalds authored
      Pull MIPS fixes from Thomas Bogendoerfer:
      
       - Fix memory detection for MT7621 devices
      
       - Fix setnocoherentio kernel option
      
       - Fix warning when CONFIG_SCHED_CORE is enabled
      
      * tag 'mips-fixes-5.17_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: ralink: mt7621: use bitwise NOT instead of logical
        mips: setup: fix setnocoherentio() boolean setting
        MIPS: smp: fill in sibling and core maps earlier
        MIPS: ralink: mt7621: do memory detection on KSEG1
      e58bd49d
    • Linus Torvalds's avatar
      Merge tag 'auxdisplay-for-linus-v5.17-rc7' of git://github.com/ojeda/linux · 4d5ae234
      Linus Torvalds authored
      Pull auxdisplay fixes from Miguel Ojeda:
       "A few lcd2s fixes from Andy Shevchenko"
      
      * tag 'auxdisplay-for-linus-v5.17-rc7' of git://github.com/ojeda/linux:
        auxdisplay: lcd2s: Use proper API to free the instance of charlcd object
        auxdisplay: lcd2s: Fix memory leak in ->remove()
        auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature
      4d5ae234