Skip to content
  1. Sep 07, 2023
    • Will Deacon's avatar
      arm64: csum: Fix OoB access in IP checksum code for negative lengths · 8bd795fe
      Will Deacon authored
      Although commit c2c24edb ("arm64: csum: Fix pathological zero-length
      calls") added an early return for zero-length input, syzkaller has
      popped up with an example of a _negative_ length which causes an
      undefined shift and an out-of-bounds read:
      
       | BUG: KASAN: slab-out-of-bounds in do_csum+0x44/0x254 arch/arm64/lib/csum.c:39
       | Read of size 4294966928 at addr ffff0000d7ac0170 by task syz-executor412/5975
       |
       | CPU: 0 PID: 5975 Comm: syz-executor412 Not tainted 6.4.0-rc4-syzkaller-g908f31f2a05b #0
       | Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
       | Call trace:
       |  dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:233
       |  show_stack+0x2c/0x44 arch/arm64/kernel/stacktrace.c:240
       |  __dump_stack lib/dump_stack.c:88 [inline]
       |  dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106
       |  print_address_description mm/kasan/report.c:351 [inline]
       |  print_report+0x174/0x514 mm/kasan/report.c:462
       |  kasan_report+0xd4/0x130 mm/kasan/report.c:572
       |  kasan_check_range+0x264/0x2a4 mm/kasan/generic.c:187
       |  __kasan_check_read+0x20/0x30 mm/kasan/shadow.c:31
       |  do_csum+0x44/0x254 arch/arm64/lib/csum.c:39
       |  csum_partial+0x30/0x58 lib/checksum.c:128
       |  gso_make_checksum include/linux/skbuff.h:4928 [inline]
       |  __udp_gso_segment+0xaf4/0x1bc4 net/ipv4/udp_offload.c:332
       |  udp6_ufo_fragment+0x540/0xca0 net/ipv6/udp_offload.c:47
       |  ipv6_gso_segment+0x5cc/0x1760 net/ipv6/ip6_offload.c:119
       |  skb_mac_gso_segment+0x2b4/0x5b0 net/core/gro.c:141
       |  __skb_gso_segment+0x250/0x3d0 net/core/dev.c:3401
       |  skb_gso_segment include/linux/netdevice.h:4859 [inline]
       |  validate_xmit_skb+0x364/0xdbc net/core/dev.c:3659
       |  validate_xmit_skb_list+0x94/0x130 net/core/dev.c:3709
       |  sch_direct_xmit+0xe8/0x548 net/sched/sch_generic.c:327
       |  __dev_xmit_skb net/core/dev.c:3805 [inline]
       |  __dev_queue_xmit+0x147c/0x3318 net/core/dev.c:4210
       |  dev_queue_xmit include/linux/netdevice.h:3085 [inline]
       |  packet_xmit+0x6c/0x318 net/packet/af_packet.c:276
       |  packet_snd net/packet/af_packet.c:3081 [inline]
       |  packet_sendmsg+0x376c/0x4c98 net/packet/af_packet.c:3113
       |  sock_sendmsg_nosec net/socket.c:724 [inline]
       |  sock_sendmsg net/socket.c:747 [inline]
       |  __sys_sendto+0x3b4/0x538 net/socket.c:2144
      
      Extend the early return to reject negative lengths as well, aligning our
      implementation with the generic code in lib/checksum.c
      
      Cc: Robin Murphy <robin.murphy@arm.com>
      Fixes: 5777eaed
      
       ("arm64: Implement optimised checksum routine")
      Reported-by: default avatar <syzbot+4a9f9820bd8d302e22f7@syzkaller.appspotmail.com>
      Link: https://lore.kernel.org/r/000000000000e0e94c0603f8d213@google.com
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      8bd795fe
    • Will Deacon's avatar
      arm64/sysreg: Fix broken strncpy() -> strscpy() conversion · ab41a974
      Will Deacon authored
      Mostafa reports that commit d2326067
      
       ("arm64/sysreg: refactor
      deprecated strncpy") breaks our early command-line parsing because the
      original code is working on space-delimited substrings rather than
      NUL-terminated strings.
      
      Rather than simply reverting the broken conversion patch, replace the
      strscpy() with a simple memcpy() with an explicit NUL-termination of the
      result.
      
      Reported-by: default avatarMostafa Saleh <smostafa@google.com>
      Tested-by: default avatarMostafa Saleh <smostafa@google.com>
      Fixes: d2326067
      
       ("arm64/sysreg: refactor deprecated strncpy")
      Signed-off-by: default avatarJustin Stitt <justinstitt@google.com>
      Link: https://lore.kernel.org/r/20230905-strncpy-arch-arm64-v4-1-bc4b14ddfaef@google.com
      Link: https://lore.kernel.org/r/20230831162227.2307863-1-smostafa@google.com
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      ab41a974
  2. Sep 05, 2023
  3. Aug 25, 2023
    • Will Deacon's avatar
      Merge branch 'for-next/selftests' into for-next/core · e1df2721
      Will Deacon authored
      * for-next/selftests: (22 commits)
        kselftest/arm64: Fix hwcaps selftest build
        kselftest/arm64: add jscvt feature to hwcap test
        kselftest/arm64: add pmull feature to hwcap test
        kselftest/arm64: add AES feature check to hwcap test
        kselftest/arm64: add SHA1 and related features to hwcap test
        kselftest/arm64: build BTI tests in output directory
        kselftest/arm64: fix a memleak in zt_regs_run()
        kselftest/arm64: Size sycall-abi buffers for the actual maximum VL
        kselftest/arm64: add lse and lse2 features to hwcap test
        kselftest/arm64: add test item that support to capturing the SIGBUS signal
        kselftest/arm64: add DEF_SIGHANDLER_FUNC() and DEF_INST_RAISE_SIG() helpers
        kselftest/arm64: add crc32 feature to hwcap test
        kselftest/arm64: add float-point feature to hwcap test
        kselftest/arm64: Use the tools/include compiler.h rather than our own
        kselftest/arm64: Use shared OPTIMZER_HIDE_VAR() definiton
        kselftest/arm64: Make the tools/include headers available
        tools include: Add some common function attributes
        tools compiler.h: Add OPTIMIZER_HIDE_VAR()
        kselftest/arm64: Exit streaming mode after collecting signal context
        kselftest/arm64: add RCpc load-acquire to hwcap test
        ...
      e1df2721
    • Will Deacon's avatar
      Merge branch 'for-next/perf' into for-next/core · f8f62118
      Will Deacon authored
      * for-next/perf:
        drivers/perf: hisi: Update HiSilicon PMU maintainers
        arm_pmu: acpi: Add a representative platform device for TRBE
        arm_pmu: acpi: Refactor arm_spe_acpi_register_device()
        hw_breakpoint: fix single-stepping when using bpf_overflow_handler
        perf/imx_ddr: don't enable counter0 if none of 4 counters are used
        perf/imx_ddr: speed up overflow frequency of cycle
        drivers/perf: hisi: Schedule perf session according to locality
        perf/arm-dmc620: Fix dmc620_pmu_irqs_lock/cpu_hotplug_lock circular lock dependency
        perf/smmuv3: Add MODULE_ALIAS for module auto loading
        perf/smmuv3: Enable HiSilicon Erratum 162001900 quirk for HIP08/09
        perf: pmuv3: Remove comments from armv8pmu_[enable|disable]_event()
        perf/arm-cmn: Add CMN-700 r3 support
        perf/arm-cmn: Refactor HN-F event selector macros
        perf/arm-cmn: Remove spurious event aliases
        drivers/perf: Explicitly include correct DT includes
        perf: pmuv3: Add Cortex A520, A715, A720, X3 and X4 PMUs
        dt-bindings: arm: pmu: Add Cortex A520, A715, A720, X3, and X4
        perf/smmuv3: Remove build dependency on ACPI
        perf: xgene_pmu: Convert to devm_platform_ioremap_resource()
        driver/perf: Add identifier sysfs file for Yitian 710 DDR
      f8f62118
    • Will Deacon's avatar
      Merge branch 'for-next/mm' into for-next/core · 7abb3e4e
      Will Deacon authored
      * for-next/mm:
        arm64: fix build warning for ARM64_MEMSTART_SHIFT
        arm64: Remove unsued extern declaration init_mem_pgprot()
        arm64/mm: Set only the PTE_DIRTY bit while preserving the HW dirty state
        arm64/mm: Add pte_rdonly() helper
        arm64/mm: Directly use ID_AA64MMFR2_EL1_VARange_MASK
        arm64/mm: Replace an open coding with ID_AA64MMFR1_EL1_HAFDBS_MASK
      7abb3e4e
    • Will Deacon's avatar
      Merge branch 'for-next/misc' into for-next/core · 438ddc3c
      Will Deacon authored
      * for-next/misc:
        arm64/sysreg: refactor deprecated strncpy
        arm64: sysreg: Generate C compiler warnings on {read,write}_sysreg_s arguments
        arm64: sdei: abort running SDEI handlers during crash
        arm64: Explicitly include correct DT includes
        arm64/Kconfig: Sort the RCpc feature under the ARMv8.3 features menu
        arm64: vdso: remove two .altinstructions related symbols
        arm64/ptrace: Clean up error handling path in sve_set_common()
      438ddc3c
    • Will Deacon's avatar
      Merge branch 'for-next/errata' into for-next/core · d36dccca
      Will Deacon authored
      * for-next/errata:
        arm64: errata: Group all Cortex-A510 errata together
      d36dccca
    • Will Deacon's avatar
      Merge branch 'for-next/entry' into for-next/core · cd074557
      Will Deacon authored
      * for-next/entry:
        arm64: syscall: unmask DAIF earlier for SVCs
      cd074557
    • Will Deacon's avatar
      Merge branch 'for-next/docs' into for-next/core · 0f4f768f
      Will Deacon authored
      * for-next/docs:
        Documentation: arm64: Correct SME ZA macros name
      0f4f768f
    • Will Deacon's avatar
      Merge branch 'for-next/cpufeature' into for-next/core · 1f5a062d
      Will Deacon authored
      * for-next/cpufeature:
        arm64/fpsimd: Only provide the length to cpufeature for xCR registers
        selftests/arm64: add HWCAP2_HBC test
        arm64: add HWCAP for FEAT_HBC (hinted conditional branches)
        arm64/cpufeature: Use ARM64_CPUID_FIELD() to match EVT
      1f5a062d
    • Jijie Shao's avatar
      drivers/perf: hisi: Update HiSilicon PMU maintainers · 21b61fe4
      Jijie Shao authored
      
      
      Since Guangbin and Shaokun have left HiSilicon and will no longer
      maintain the drivers, update the maintainer information and
      thanks for their work.
      
      Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
      Acked-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Acked-by: default avatarYicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20230824024135.1291459-1-shaojijie@huawei.com
      
      
      [will: left the HNS3 title as-is to avoid the churn of resorting the entries]
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      21b61fe4
  4. Aug 19, 2023
  5. Aug 16, 2023
  6. Aug 15, 2023
  7. Aug 11, 2023
  8. Aug 10, 2023
    • Mark Brown's avatar
      arm64/fpsimd: Only provide the length to cpufeature for xCR registers · 01948b09
      Mark Brown authored
      For both SVE and SME we abuse the generic register field comparison
      support in the cpufeature code as part of our detection of unsupported
      variations in the vector lengths available to PEs, reporting the maximum
      vector lengths via ZCR_EL1.LEN and SMCR_EL1.LEN.  Since these are
      configuration registers rather than identification registers the
      assumptions the cpufeature code makes about how unknown bitfields behave
      are invalid, leading to warnings when SME features like FA64 are enabled
      and we hotplug a CPU:
      
        CPU features: SANITY CHECK: Unexpected variation in SYS_SMCR_EL1. Boot CPU: 0x0000000000000f, CPU3: 0x0000008000000f
        CPU features: Unsupported CPU feature variation detected.
      
      SVE has no controls other than the vector length so is not yet impacted
      but the same issue will apply there if any are defined.
      
      Since the only field we are interested in having the cpufeature code
      handle is the length field and we use a custom read function to obtain
      the value we can avoid these warnings by filtering out all other bits
      when we return the register value, if we're doing that we don't need to
      bother reading the register at all and can simply use the RDVL/RDSVL
      value we were filling in instead.
      
      Fixes: 2e0f2478 ("arm64/sve: Probe SVE capabilities and usable vector lengths")
      FixeS: b42990d3
      
       ("arm64/sme: Identify supported SME vector lengths at boot")
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Link: https://lore.kernel.org/r/20230731-arm64-sme-fa64-hotplug-v2-1-7714c00dd902@kernel.org
      
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      01948b09
  9. Aug 05, 2023