2021-06-09 10:26:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 000/137] 5.10.43-rc1 review

This is the start of the stable review cycle for the 5.10.43 release.
There are 137 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.

Responses should be made by Thu, 10 Jun 2021 17:59:18 +0000.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.43-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>
Linux 5.10.43-rc1

David Ahern <[email protected]>
neighbour: allow NUD_NOARP entries to be forced GCed

Roger Pau Monne <[email protected]>
xen-netback: take a reference to the RX task thread

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: missing error reporting for not selected expressions

Roja Rani Yarubandi <[email protected]>
i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops

Gao Xiang <[email protected]>
lib/lz4: explicitly support in-place decompression

Vitaly Kuznetsov <[email protected]>
x86/kvm: Disable all PV features on crash

Vitaly Kuznetsov <[email protected]>
x86/kvm: Disable kvmclock on all CPUs on shutdown

Vitaly Kuznetsov <[email protected]>
x86/kvm: Teardown PV features on boot CPU as well

Marc Zyngier <[email protected]>
KVM: arm64: Fix debug register indexing

Sean Christopherson <[email protected]>
KVM: SVM: Truncate GPR value for DR and CR accesses in !64-bit mode

Anand Jain <[email protected]>
btrfs: fix unmountable seed device after fstrim

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: always use mdp device to scale bandwidth

Mina Almasry <[email protected]>
mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY

Filipe Manana <[email protected]>
btrfs: fix deadlock when cloning inline extents and low on available space

Josef Bacik <[email protected]>
btrfs: abort in rename_exchange if we fail to insert the second ref

Josef Bacik <[email protected]>
btrfs: fixup error handling in fixup_inode_link_counts

Josef Bacik <[email protected]>
btrfs: return errors from btrfs_del_csums in cleanup_ref_head

Josef Bacik <[email protected]>
btrfs: fix error handling in btrfs_del_csums

Josef Bacik <[email protected]>
btrfs: mark ordered extent and inode with error if we fail to finish

Naveen N. Rao <[email protected]>
powerpc/kprobes: Fix validation of prefixed instructions across page boundary

Thomas Gleixner <[email protected]>
x86/apic: Mark _all_ legacy interrupts when IO/APIC is missing

Nirmoy Das <[email protected]>
drm/amdgpu: make sure we unpin the UVD BO

Luben Tuikov <[email protected]>
drm/amdgpu: Don't query CE and UE errors

Krzysztof Kozlowski <[email protected]>
nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect

Pu Wen <[email protected]>
x86/sev: Check SME/SEV support in CPUID first

Thomas Gleixner <[email protected]>
x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()

Ding Hui <[email protected]>
mm/page_alloc: fix counting of free pages after take off from buddy

Gerald Schaefer <[email protected]>
mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests()

Junxiao Bi <[email protected]>
ocfs2: fix data corruption by fallocate

Mark Rutland <[email protected]>
pid: take a reference when initializing `cad_pid`

Phil Elwell <[email protected]>
usb: dwc2: Fix build in periphal-only mode

Ritesh Harjani <[email protected]>
ext4: fix accessing uninit percpu counter variable with fast_commit

Phillip Potter <[email protected]>
ext4: fix memory leak in ext4_mb_init_backend on error path.

Harshad Shirwadkar <[email protected]>
ext4: fix fast commit alignment issues

Ye Bin <[email protected]>
ext4: fix bug on in ext4_es_cache_extent as ext4_split_extent_at failed

Alexey Makhalov <[email protected]>
ext4: fix memory leak in ext4_fill_super

Marek Vasut <[email protected]>
ARM: dts: imx6q-dhcom: Add PU,VDD1P1,VDD2P5 regulators

Michal Vokáč <[email protected]>
ARM: dts: imx6dl-yapp4: Fix RGMII connection to QCA8334 switch

Hui Wang <[email protected]>
ALSA: hda: update the power_state during the direct-complete

Carlos M <[email protected]>
ALSA: hda: Fix for mute key LED for HP Pavilion 15-CK0xx

Takashi Iwai <[email protected]>
ALSA: timer: Fix master timer notification

Bob Peterson <[email protected]>
gfs2: fix scheduling while atomic bug in glocks

Ahelenia Ziemiańska <[email protected]>
HID: multitouch: require Finger field to mark Win8 reports as MT

Johan Hovold <[email protected]>
HID: magicmouse: fix NULL-deref on disconnect

Johnny Chuang <[email protected]>
HID: i2c-hid: Skip ELAN power-on command after reset

Pavel Skripkin <[email protected]>
net: caif: fix memory leak in cfusbl_device_notify

Pavel Skripkin <[email protected]>
net: caif: fix memory leak in caif_device_notify

Pavel Skripkin <[email protected]>
net: caif: add proper error handling

Pavel Skripkin <[email protected]>
net: caif: added cfserl_release function

Jason A. Donenfeld <[email protected]>
wireguard: allowedips: free empty intermediate nodes when removing single node

Jason A. Donenfeld <[email protected]>
wireguard: allowedips: allocate nodes in kmem_cache

Jason A. Donenfeld <[email protected]>
wireguard: allowedips: remove nodes in O(1)

Jason A. Donenfeld <[email protected]>
wireguard: allowedips: initialize list head in selftest

Jason A. Donenfeld <[email protected]>
wireguard: selftests: make sure rp_filter is disabled on vethc

Jason A. Donenfeld <[email protected]>
wireguard: selftests: remove old conntrack kconfig value

Jason A. Donenfeld <[email protected]>
wireguard: use synchronize_net rather than synchronize_rcu

Jason A. Donenfeld <[email protected]>
wireguard: peer: allocate in kmem_cache

Jason A. Donenfeld <[email protected]>
wireguard: do not use -O3

Lin Ma <[email protected]>
Bluetooth: use correct lock to prevent UAF of hdev object

Lin Ma <[email protected]>
Bluetooth: fix the erroneous flush_work() order

James Zhu <[email protected]>
drm/amdgpu/jpeg3: add cancel_delayed_work_sync before power gate

James Zhu <[email protected]>
drm/amdgpu/jpeg2.5: add cancel_delayed_work_sync before power gate

James Zhu <[email protected]>
drm/amdgpu/vcn3: add cancel_delayed_work_sync before power gate

Pavel Begunkov <[email protected]>
io_uring: use better types for cflags

Pavel Begunkov <[email protected]>
io_uring: fix link timeout refs

Jisheng Zhang <[email protected]>
riscv: vdso: fix and clean-up Makefile

Johan Hovold <[email protected]>
serial: stm32: fix threaded interrupt handling

Hoang Le <[email protected]>
tipc: fix unique bearer names sanity check

Hoang Le <[email protected]>
tipc: add extack messages for bearer/media failure

Tony Lindgren <[email protected]>
bus: ti-sysc: Fix flakey idling of uarts and stop using swsup_sidle_act

Geert Uytterhoeven <[email protected]>
ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells

Fabio Estevam <[email protected]>
ARM: dts: imx7d-pico: Fix the 'tuning-step' property

Fabio Estevam <[email protected]>
ARM: dts: imx7d-meerkat96: Fix the 'tuning-step' property

Michael Walle <[email protected]>
arm64: dts: freescale: sl28: var4: fix RGMII clock and voltage

Lucas Stach <[email protected]>
arm64: dts: zii-ultra: fix 12V_MAIN voltage

Michael Walle <[email protected]>
arm64: dts: ls1028a: fix memory node

Tony Lindgren <[email protected]>
bus: ti-sysc: Fix am335x resume hang for usb otg module

Jens Wiklander <[email protected]>
optee: use export_uuid() to copy client UUID

Vignesh Raghavendra <[email protected]>
arm64: dts: ti: j7200-main: Mark Main NAVSS as dma-coherent

Magnus Karlsson <[email protected]>
ixgbe: add correct exception tracing for XDP

Magnus Karlsson <[email protected]>
ixgbe: optimize for XDP_REDIRECT in xsk path

Magnus Karlsson <[email protected]>
ice: add correct exception tracing for XDP

Magnus Karlsson <[email protected]>
ice: optimize for XDP_REDIRECT in xsk path

Maciej Fijalkowski <[email protected]>
ice: simplify ice_run_xdp

Magnus Karlsson <[email protected]>
i40e: add correct exception tracing for XDP

Magnus Karlsson <[email protected]>
i40e: optimize for XDP_REDIRECT in xsk path

Rahul Lakkireddy <[email protected]>
cxgb4: avoid link re-train during TC-MQPRIO configuration

Roja Rani Yarubandi <[email protected]>
i2c: qcom-geni: Add shutdown callback for i2c

Dave Ertman <[email protected]>
ice: Allow all LLDP packets from PF to Tx

Paul Greenwalt <[email protected]>
ice: report supported and advertised autoneg using PHY capabilities

Haiyue Wang <[email protected]>
ice: handle the VF VSI rebuild failure

Brett Creeley <[email protected]>
ice: Fix VFR issues for AVF drivers that expect ATQLEN cleared

Brett Creeley <[email protected]>
ice: Fix allowing VF to request more/less queues via virtchnl

Coco Li <[email protected]>
ipv6: Fix KASAN: slab-out-of-bounds Read in fib6_nh_flush_exceptions

Rahul Lakkireddy <[email protected]>
cxgb4: fix regression with HASH tc prio value update

Magnus Karlsson <[email protected]>
ixgbevf: add correct exception tracing for XDP

Magnus Karlsson <[email protected]>
igb: add correct exception tracing for XDP

Wei Yongjun <[email protected]>
ieee802154: fix error return code in ieee802154_llsec_getparams()

Zhen Lei <[email protected]>
ieee802154: fix error return code in ieee802154_add_iface()

Daniel Borkmann <[email protected]>
bpf, lockdown, audit: Fix buggy SELinux lockdown permission checks

Tobias Klauser <[email protected]>
bpf: Simplify cases in bpf_base_func_proto

Zhihao Cheng <[email protected]>
drm/i915/selftests: Fix return value check in live_breadcrumbs_smoketest()

Pablo Neira Ayuso <[email protected]>
netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches

Pablo Neira Ayuso <[email protected]>
netfilter: nft_ct: skip expectations for confirmed conntrack

Max Gurtovoy <[email protected]>
nvmet: fix freeing unallocated p2pmem

Yevgeny Kliteynik <[email protected]>
net/mlx5: DR, Create multi-destination flow table with level less than 64

Roi Dayan <[email protected]>
net/mlx5e: Check for needed capability for cvlan matching

Moshe Shemesh <[email protected]>
net/mlx5: Check firmware sync reset requested is set before trying to abort it

Aya Levin <[email protected]>
net/mlx5e: Fix incompatible casting

Maxim Mikityanskiy <[email protected]>
net/tls: Fix use-after-free after the TLS device goes down and up

Maxim Mikityanskiy <[email protected]>
net/tls: Replace TLS_RX_SYNC_RUNNING with RCU

Alexander Aring <[email protected]>
net: sock: fix in-kernel mark setting

Vladimir Oltean <[email protected]>
net: dsa: tag_8021q: fix the VLAN IDs used for encoding sub-VLANs

Li Huafei <[email protected]>
perf probe: Fix NULL pointer dereference in convert_variable_location()

Erik Kaneda <[email protected]>
ACPICA: Clean up context mutex during object deletion

Sagi Grimberg <[email protected]>
nvme-rdma: fix in-casule data send for chained sgls

Paolo Abeni <[email protected]>
mptcp: always parse mptcp options for MPC reqsk

Ariel Levkovich <[email protected]>
net/sched: act_ct: Fix ct template allocation for zone 0

Paul Blakey <[email protected]>
net/sched: act_ct: Offload connections with commit action

Parav Pandit <[email protected]>
devlink: Correct VIRTUAL port to not have phys_port attributes

Arnd Bergmann <[email protected]>
HID: i2c-hid: fix format string mismatch

Zhen Lei <[email protected]>
HID: pidff: fix error return code in hid_pidff_init()

Tom Rix <[email protected]>
HID: logitech-hidpp: initialize level variable

Julian Anastasov <[email protected]>
ipvs: ignore IP_VS_SVC_F_HASHED flag when adding service

Max Gurtovoy <[email protected]>
vfio/platform: fix module_put call in error flow

Wei Yongjun <[email protected]>
samples: vfio-mdev: fix error handing in mdpy_fb_probe()

Randy Dunlap <[email protected]>
vfio/pci: zap_vma_ptes() needs MMU

Zhen Lei <[email protected]>
vfio/pci: Fix error return code in vfio_ecap_init()

Rasmus Villemoes <[email protected]>
efi: cper: fix snprintf() use in cper_dimm_err_location()

Dan Carpenter <[email protected]>
efi/libstub: prevent read overflow in find_file_option()

Heiner Kallweit <[email protected]>
efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared

Changbin Du <[email protected]>
efi/fdt: fix panic when no valid fdt found

Florian Westphal <[email protected]>
netfilter: conntrack: unregister ipv4 sockopts on error unwind

Grant Peltier <[email protected]>
hwmon: (pmbus/isl68137) remove READ_TEMPERATURE_3 for RAA228228

Armin Wolf <[email protected]>
hwmon: (dell-smm-hwmon) Fix index values

Grant Grundler <[email protected]>
net: usb: cdc_ncm: don't spew notifications

Josef Bacik <[email protected]>
btrfs: tree-checker: do not error out if extent ref hash doesn't match


-------------

Diffstat:

Makefile | 4 +-
arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 6 +-
arch/arm/boot/dts/imx6q-dhcom-som.dtsi | 12 ++
arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi | 2 +-
arch/arm/boot/dts/imx7d-meerkat96.dts | 2 +-
arch/arm/boot/dts/imx7d-pico.dtsi | 2 +-
.../freescale/fsl-ls1028a-kontron-sl28-var4.dts | 5 +-
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 4 +-
.../arm64/boot/dts/freescale/imx8mq-zii-ultra.dtsi | 4 +-
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 2 +
arch/arm64/kvm/sys_regs.c | 42 ++---
arch/powerpc/kernel/kprobes.c | 4 +-
arch/riscv/kernel/vdso/Makefile | 4 +-
arch/x86/include/asm/apic.h | 1 +
arch/x86/include/asm/disabled-features.h | 7 +-
arch/x86/include/asm/fpu/api.h | 6 +-
arch/x86/include/asm/fpu/internal.h | 7 -
arch/x86/include/asm/kvm_para.h | 10 +-
arch/x86/kernel/apic/apic.c | 1 +
arch/x86/kernel/apic/vector.c | 20 +++
arch/x86/kernel/fpu/xstate.c | 57 -------
arch/x86/kernel/kvm.c | 92 +++++++---
arch/x86/kernel/kvmclock.c | 26 +--
arch/x86/kvm/svm/svm.c | 8 +-
arch/x86/mm/mem_encrypt_identity.c | 11 +-
drivers/acpi/acpica/utdelete.c | 8 +
drivers/bus/ti-sysc.c | 57 ++++++-
drivers/firmware/efi/cper.c | 4 +-
drivers/firmware/efi/fdtparams.c | 3 +
drivers/firmware/efi/libstub/file.c | 2 +-
drivers/firmware/efi/memattr.c | 5 -
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 16 --
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 4 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 4 +-
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 1 +
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 +-
drivers/gpu/drm/i915/selftests/i915_request.c | 4 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 3 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 +-----
drivers/hid/hid-logitech-hidpp.c | 1 +
drivers/hid/hid-magicmouse.c | 2 +-
drivers/hid/hid-multitouch.c | 10 +-
drivers/hid/i2c-hid/i2c-hid-core.c | 13 +-
drivers/hid/usbhid/hid-pidff.c | 1 +
drivers/hwmon/dell-smm-hwmon.c | 4 +-
drivers/hwmon/pmbus/isl68137.c | 4 +-
drivers/i2c/busses/i2c-qcom-geni.c | 21 ++-
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 2 -
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 4 +-
.../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 14 +-
.../net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c | 9 +-
drivers/net/ethernet/chelsio/cxgb4/sge.c | 6 +
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 +-
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 15 +-
drivers/net/ethernet/intel/ice/ice_ethtool.c | 51 +-----
drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 1 +
drivers/net/ethernet/intel/ice/ice_lib.c | 2 +
drivers/net/ethernet/intel/ice/ice_txrx.c | 24 +--
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 19 ++-
drivers/net/ethernet/intel/ice/ice_xsk.c | 16 +-
drivers/net/ethernet/intel/igb/igb_main.c | 10 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 16 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 21 ++-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 5 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 +
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 3 +
.../ethernet/mellanox/mlx5/core/steering/dr_fw.c | 3 +-
drivers/net/usb/cdc_ncm.c | 12 +-
drivers/net/wireguard/Makefile | 3 +-
drivers/net/wireguard/allowedips.c | 189 +++++++++++----------
drivers/net/wireguard/allowedips.h | 14 +-
drivers/net/wireguard/main.c | 17 +-
drivers/net/wireguard/peer.c | 27 ++-
drivers/net/wireguard/peer.h | 3 +
drivers/net/wireguard/selftest/allowedips.c | 165 +++++++++---------
drivers/net/wireguard/socket.c | 2 +-
drivers/net/xen-netback/interface.c | 6 +
drivers/nvme/host/rdma.c | 5 +-
drivers/nvme/target/core.c | 33 ++--
drivers/tee/optee/call.c | 6 +-
drivers/tee/optee/optee_msg.h | 6 +-
drivers/tty/serial/stm32-usart.c | 22 +--
drivers/usb/dwc2/core_intr.c | 4 +
drivers/vfio/pci/Kconfig | 1 +
drivers/vfio/pci/vfio_pci_config.c | 2 +-
drivers/vfio/platform/vfio_platform_common.c | 2 +-
fs/btrfs/extent-tree.c | 12 +-
fs/btrfs/file-item.c | 10 +-
fs/btrfs/inode.c | 19 ++-
fs/btrfs/reflink.c | 38 +++--
fs/btrfs/tree-checker.c | 16 +-
fs/btrfs/tree-log.c | 13 +-
fs/ext4/extents.c | 43 ++---
fs/ext4/fast_commit.c | 182 ++++++++++----------
fs/ext4/fast_commit.h | 7 -
fs/ext4/ialloc.c | 6 +-
fs/ext4/mballoc.c | 2 +-
fs/ext4/super.c | 11 +-
fs/gfs2/glock.c | 2 +
fs/io_uring.c | 6 +-
fs/ocfs2/file.c | 55 +++++-
include/linux/mlx5/mlx5_ifc.h | 2 +
include/linux/platform_data/ti-sysc.h | 1 +
include/linux/usb/usbnet.h | 2 +
include/net/caif/caif_dev.h | 2 +-
include/net/caif/cfcnfg.h | 2 +-
include/net/caif/cfserl.h | 1 +
include/net/tls.h | 10 +-
init/main.c | 2 +-
kernel/bpf/helpers.c | 19 +--
kernel/trace/bpf_trace.c | 32 ++--
lib/lz4/lz4_decompress.c | 6 +-
lib/lz4/lz4defs.h | 1 +
mm/debug_vm_pgtable.c | 4 +-
mm/hugetlb.c | 14 +-
mm/page_alloc.c | 2 +
net/bluetooth/hci_core.c | 7 +-
net/bluetooth/hci_sock.c | 4 +-
net/caif/caif_dev.c | 13 +-
net/caif/caif_usb.c | 14 +-
net/caif/cfcnfg.c | 16 +-
net/caif/cfserl.c | 5 +
net/core/devlink.c | 4 +-
net/core/neighbour.c | 1 +
net/core/sock.c | 16 +-
net/dsa/tag_8021q.c | 2 +-
net/ieee802154/nl-mac.c | 4 +-
net/ieee802154/nl-phy.c | 4 +-
net/ipv6/route.c | 8 +-
net/mptcp/subflow.c | 17 +-
net/netfilter/ipvs/ip_vs_ctl.c | 2 +-
net/netfilter/nf_conntrack_proto.c | 2 +-
net/netfilter/nf_tables_api.c | 4 +-
net/netfilter/nfnetlink_cthelper.c | 8 +-
net/netfilter/nft_ct.c | 2 +-
net/nfc/llcp_sock.c | 2 +
net/sched/act_ct.c | 10 +-
net/tipc/bearer.c | 94 +++++++---
net/tls/tls_device.c | 60 +++++--
net/tls/tls_device_fallback.c | 7 +
net/tls/tls_main.c | 1 +
samples/vfio-mdev/mdpy-fb.c | 13 +-
sound/core/timer.c | 3 +-
sound/pci/hda/hda_codec.c | 5 +
sound/pci/hda/patch_realtek.c | 1 +
tools/perf/util/dwarf-aux.c | 8 +-
tools/perf/util/probe-finder.c | 3 +
tools/testing/selftests/wireguard/netns.sh | 1 +
.../testing/selftests/wireguard/qemu/kernel.config | 1 -
150 files changed, 1260 insertions(+), 925 deletions(-)



2021-06-09 10:26:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 032/137] net/mlx5: DR, Create multi-destination flow table with level less than 64

From: Yevgeny Kliteynik <[email protected]>

[ Upstream commit 216214c64a8c1cb9078c2c0aec7bb4a2f8e75397 ]

Flow table that contains flow pointing to multiple flow tables or multiple
TIRs must have a level lower than 64. In our case it applies to muli-
destination flow table.
Fix the level of the created table to comply with HW Spec definitions, and
still make sure that its level lower than SW-owned tables, so that it
would be possible to point from the multi-destination FW table to SW
tables.

Fixes: 34583beea4b7 ("net/mlx5: DR, Create multi-destination table for SW-steering use")
Signed-off-by: Yevgeny Kliteynik <[email protected]>
Reviewed-by: Alex Vesker <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c | 3 ++-
include/linux/mlx5/mlx5_ifc.h | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c
index 1fbcd012bb85..7ccfd40586ce 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_fw.c
@@ -112,7 +112,8 @@ int mlx5dr_fw_create_md_tbl(struct mlx5dr_domain *dmn,
int ret;

ft_attr.table_type = MLX5_FLOW_TABLE_TYPE_FDB;
- ft_attr.level = dmn->info.caps.max_ft_level - 2;
+ ft_attr.level = min_t(int, dmn->info.caps.max_ft_level - 2,
+ MLX5_FT_MAX_MULTIPATH_LEVEL);
ft_attr.reformat_en = reformat_req;
ft_attr.decap_en = reformat_req;

diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index cc9ee0776974..af8f4e2cf21d 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1223,6 +1223,8 @@ enum mlx5_fc_bulk_alloc_bitmask {

#define MLX5_FC_BULK_NUM_FCS(fc_enum) (MLX5_FC_BULK_SIZE_FACTOR * (fc_enum))

+#define MLX5_FT_MAX_MULTIPATH_LEVEL 63
+
enum {
MLX5_STEERING_FORMAT_CONNECTX_5 = 0,
MLX5_STEERING_FORMAT_CONNECTX_6DX = 1,
--
2.30.2



2021-06-09 10:26:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 033/137] nvmet: fix freeing unallocated p2pmem

From: Max Gurtovoy <[email protected]>

[ Upstream commit bcd9a0797d73eeff659582f23277e7ab6e5f18f3 ]

In case p2p device was found but the p2p pool is empty, the nvme target
is still trying to free the sgl from the p2p pool instead of the
regular sgl pool and causing a crash (BUG() is called). Instead, assign
the p2p_dev for the request only if it was allocated from p2p pool.

This is the crash that was caused:

[Sun May 30 19:13:53 2021] ------------[ cut here ]------------
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
[Sun May 30 19:13:53 2021] invalid opcode: 0000 [#1] SMP PTI
...
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
...
[Sun May 30 19:13:53 2021] RIP: 0010:gen_pool_free_owner+0xa8/0xb0
...
[Sun May 30 19:13:53 2021] Call Trace:
[Sun May 30 19:13:53 2021] ------------[ cut here ]------------
[Sun May 30 19:13:53 2021] pci_free_p2pmem+0x2b/0x70
[Sun May 30 19:13:53 2021] pci_p2pmem_free_sgl+0x4f/0x80
[Sun May 30 19:13:53 2021] nvmet_req_free_sgls+0x1e/0x80 [nvmet]
[Sun May 30 19:13:53 2021] kernel BUG at lib/genalloc.c:518!
[Sun May 30 19:13:53 2021] nvmet_rdma_release_rsp+0x4e/0x1f0 [nvmet_rdma]
[Sun May 30 19:13:53 2021] nvmet_rdma_send_done+0x1c/0x60 [nvmet_rdma]

Fixes: c6e3f1339812 ("nvmet: add metadata support for block devices")
Reviewed-by: Israel Rukshin <[email protected]>
Signed-off-by: Max Gurtovoy <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/nvme/target/core.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 46e4f7ea34c8..8b939e9db470 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -988,19 +988,23 @@ static unsigned int nvmet_data_transfer_len(struct nvmet_req *req)
return req->transfer_len - req->metadata_len;
}

-static int nvmet_req_alloc_p2pmem_sgls(struct nvmet_req *req)
+static int nvmet_req_alloc_p2pmem_sgls(struct pci_dev *p2p_dev,
+ struct nvmet_req *req)
{
- req->sg = pci_p2pmem_alloc_sgl(req->p2p_dev, &req->sg_cnt,
+ req->sg = pci_p2pmem_alloc_sgl(p2p_dev, &req->sg_cnt,
nvmet_data_transfer_len(req));
if (!req->sg)
goto out_err;

if (req->metadata_len) {
- req->metadata_sg = pci_p2pmem_alloc_sgl(req->p2p_dev,
+ req->metadata_sg = pci_p2pmem_alloc_sgl(p2p_dev,
&req->metadata_sg_cnt, req->metadata_len);
if (!req->metadata_sg)
goto out_free_sg;
}
+
+ req->p2p_dev = p2p_dev;
+
return 0;
out_free_sg:
pci_p2pmem_free_sgl(req->p2p_dev, req->sg);
@@ -1008,25 +1012,19 @@ out_err:
return -ENOMEM;
}

-static bool nvmet_req_find_p2p_dev(struct nvmet_req *req)
+static struct pci_dev *nvmet_req_find_p2p_dev(struct nvmet_req *req)
{
- if (!IS_ENABLED(CONFIG_PCI_P2PDMA))
- return false;
-
- if (req->sq->ctrl && req->sq->qid && req->ns) {
- req->p2p_dev = radix_tree_lookup(&req->sq->ctrl->p2p_ns_map,
- req->ns->nsid);
- if (req->p2p_dev)
- return true;
- }
-
- req->p2p_dev = NULL;
- return false;
+ if (!IS_ENABLED(CONFIG_PCI_P2PDMA) ||
+ !req->sq->ctrl || !req->sq->qid || !req->ns)
+ return NULL;
+ return radix_tree_lookup(&req->sq->ctrl->p2p_ns_map, req->ns->nsid);
}

int nvmet_req_alloc_sgls(struct nvmet_req *req)
{
- if (nvmet_req_find_p2p_dev(req) && !nvmet_req_alloc_p2pmem_sgls(req))
+ struct pci_dev *p2p_dev = nvmet_req_find_p2p_dev(req);
+
+ if (p2p_dev && !nvmet_req_alloc_p2pmem_sgls(p2p_dev, req))
return 0;

req->sg = sgl_alloc(nvmet_data_transfer_len(req), GFP_KERNEL,
@@ -1055,6 +1053,7 @@ void nvmet_req_free_sgls(struct nvmet_req *req)
pci_p2pmem_free_sgl(req->p2p_dev, req->sg);
if (req->metadata_sg)
pci_p2pmem_free_sgl(req->p2p_dev, req->metadata_sg);
+ req->p2p_dev = NULL;
} else {
sgl_free(req->sg);
if (req->metadata_sg)
--
2.30.2



2021-06-09 10:26:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 021/137] mptcp: always parse mptcp options for MPC reqsk

From: Paolo Abeni <[email protected]>

[ Upstream commit 06f9a435b3aa12f4de6da91f11fdce8ce7b46205 ]

In subflow_syn_recv_sock() we currently skip options parsing
for OoO packet, given that such packets may not carry the relevant
MPC option.

If the peer generates an MPC+data TSO packet and some of the early
segments are lost or get reorder, we server will ignore the peer key,
causing transient, unexpected fallback to TCP.

The solution is always parsing the incoming MPTCP options, and
do the fallback only for in-order packets. This actually cleans
the existing code a bit.

Fixes: d22f4988ffec ("mptcp: process MP_CAPABLE data option")
Reported-by: Matthieu Baerts <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Mat Martineau <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/mptcp/subflow.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index bdd6af38a9ae..96b6aca9d0ae 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -527,21 +527,20 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,

/* if the sk is MP_CAPABLE, we try to fetch the client key */
if (subflow_req->mp_capable) {
- if (TCP_SKB_CB(skb)->seq != subflow_req->ssn_offset + 1) {
- /* here we can receive and accept an in-window,
- * out-of-order pkt, which will not carry the MP_CAPABLE
- * opt even on mptcp enabled paths
- */
- goto create_msk;
- }
-
+ /* we can receive and accept an in-window, out-of-order pkt,
+ * which may not carry the MP_CAPABLE opt even on mptcp enabled
+ * paths: always try to extract the peer key, and fallback
+ * for packets missing it.
+ * Even OoO DSS packets coming legitly after dropped or
+ * reordered MPC will cause fallback, but we don't have other
+ * options.
+ */
mptcp_get_options(skb, &mp_opt);
if (!mp_opt.mp_capable) {
fallback = true;
goto create_child;
}

-create_msk:
new_msk = mptcp_sk_clone(listener->conn, &mp_opt, req);
if (!new_msk)
fallback = true;
--
2.30.2



2021-06-09 10:27:01

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 016/137] HID: pidff: fix error return code in hid_pidff_init()

From: Zhen Lei <[email protected]>

[ Upstream commit 3dd653c077efda8152f4dd395359617d577a54cd ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 224ee88fe395 ("Input: add force feedback driver for PID devices")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhen Lei <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/hid/usbhid/hid-pidff.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
index fddac7c72f64..07a9fe97d2e0 100644
--- a/drivers/hid/usbhid/hid-pidff.c
+++ b/drivers/hid/usbhid/hid-pidff.c
@@ -1292,6 +1292,7 @@ int hid_pidff_init(struct hid_device *hid)

if (pidff->pool[PID_DEVICE_MANAGED_POOL].value &&
pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) {
+ error = -EPERM;
hid_notice(hid,
"device does not support device managed pool\n");
goto fail;
--
2.30.2



2021-06-09 10:27:12

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 006/137] efi/fdt: fix panic when no valid fdt found

From: Changbin Du <[email protected]>

[ Upstream commit 668a84c1bfb2b3fd5a10847825a854d63fac7baa ]

setup_arch() would invoke efi_init()->efi_get_fdt_params(). If no
valid fdt found then initial_boot_params will be null. So we
should stop further fdt processing here. I encountered this
issue on risc-v.

Signed-off-by: Changbin Du <[email protected]>
Fixes: b91540d52a08b ("RISC-V: Add EFI runtime services")
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/firmware/efi/fdtparams.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/firmware/efi/fdtparams.c b/drivers/firmware/efi/fdtparams.c
index bb042ab7c2be..e901f8564ca0 100644
--- a/drivers/firmware/efi/fdtparams.c
+++ b/drivers/firmware/efi/fdtparams.c
@@ -98,6 +98,9 @@ u64 __init efi_get_fdt_params(struct efi_memory_map_data *mm)
BUILD_BUG_ON(ARRAY_SIZE(target) != ARRAY_SIZE(name));
BUILD_BUG_ON(ARRAY_SIZE(target) != ARRAY_SIZE(dt_params[0].params));

+ if (!fdt)
+ return 0;
+
for (i = 0; i < ARRAY_SIZE(dt_params); i++) {
node = fdt_path_offset(fdt, dt_params[i].path);
if (node < 0)
--
2.30.2



2021-06-09 10:27:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 038/137] bpf, lockdown, audit: Fix buggy SELinux lockdown permission checks

From: Daniel Borkmann <[email protected]>

[ Upstream commit ff40e51043af63715ab413995ff46996ecf9583f ]

Commit 59438b46471a ("security,lockdown,selinux: implement SELinux lockdown")
added an implementation of the locked_down LSM hook to SELinux, with the aim
to restrict which domains are allowed to perform operations that would breach
lockdown. This is indirectly also getting audit subsystem involved to report
events. The latter is problematic, as reported by Ondrej and Serhei, since it
can bring down the whole system via audit:

1) The audit events that are triggered due to calls to security_locked_down()
can OOM kill a machine, see below details [0].

2) It also seems to be causing a deadlock via avc_has_perm()/slow_avc_audit()
when trying to wake up kauditd, for example, when using trace_sched_switch()
tracepoint, see details in [1]. Triggering this was not via some hypothetical
corner case, but with existing tools like runqlat & runqslower from bcc, for
example, which make use of this tracepoint. Rough call sequence goes like:

rq_lock(rq) -> -------------------------+
trace_sched_switch() -> |
bpf_prog_xyz() -> +-> deadlock
selinux_lockdown() -> |
audit_log_end() -> |
wake_up_interruptible() -> |
try_to_wake_up() -> |
rq_lock(rq) --------------+

What's worse is that the intention of 59438b46471a to further restrict lockdown
settings for specific applications in respect to the global lockdown policy is
completely broken for BPF. The SELinux policy rule for the current lockdown check
looks something like this:

allow <who> <who> : lockdown { <reason> };

However, this doesn't match with the 'current' task where the security_locked_down()
is executed, example: httpd does a syscall. There is a tracing program attached
to the syscall which triggers a BPF program to run, which ends up doing a
bpf_probe_read_kernel{,_str}() helper call. The selinux_lockdown() hook does
the permission check against 'current', that is, httpd in this example. httpd
has literally zero relation to this tracing program, and it would be nonsensical
having to write an SELinux policy rule against httpd to let the tracing helper
pass. The policy in this case needs to be against the entity that is installing
the BPF program. For example, if bpftrace would generate a histogram of syscall
counts by user space application:

bpftrace -e 'tracepoint:raw_syscalls:sys_enter { @[comm] = count(); }'

bpftrace would then go and generate a BPF program from this internally. One way
of doing it [for the sake of the example] could be to call bpf_get_current_task()
helper and then access current->comm via one of bpf_probe_read_kernel{,_str}()
helpers. So the program itself has nothing to do with httpd or any other random
app doing a syscall here. The BPF program _explicitly initiated_ the lockdown
check. The allow/deny policy belongs in the context of bpftrace: meaning, you
want to grant bpftrace access to use these helpers, but other tracers on the
system like my_random_tracer _not_.

Therefore fix all three issues at the same time by taking a completely different
approach for the security_locked_down() hook, that is, move the check into the
program verification phase where we actually retrieve the BPF func proto. This
also reliably gets the task (current) that is trying to install the BPF tracing
program, e.g. bpftrace/bcc/perf/systemtap/etc, and it also fixes the OOM since
we're moving this out of the BPF helper's fast-path which can be called several
millions of times per second.

The check is then also in line with other security_locked_down() hooks in the
system where the enforcement is performed at open/load time, for example,
open_kcore() for /proc/kcore access or module_sig_check() for module signatures
just to pick few random ones. What's out of scope in the fix as well as in
other security_locked_down() hook locations /outside/ of BPF subsystem is that
if the lockdown policy changes on the fly there is no retrospective action.
This requires a different discussion, potentially complex infrastructure, and
it's also not clear whether this can be solved generically. Either way, it is
out of scope for a suitable stable fix which this one is targeting. Note that
the breakage is specifically on 59438b46471a where it started to rely on 'current'
as UAPI behavior, and _not_ earlier infrastructure such as 9d1f8be5cf42 ("bpf:
Restrict bpf when kernel lockdown is in confidentiality mode").

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1955585, Jakub Hrozek says:

I starting seeing this with F-34. When I run a container that is traced with
BPF to record the syscalls it is doing, auditd is flooded with messages like:

type=AVC msg=audit(1619784520.593:282387): avc: denied { confidentiality }
for pid=476 comm="auditd" lockdown_reason="use of bpf to read kernel RAM"
scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:system_r:auditd_t:s0
tclass=lockdown permissive=0

This seems to be leading to auditd running out of space in the backlog buffer
and eventually OOMs the machine.

[...]
auditd running at 99% CPU presumably processing all the messages, eventually I get:
Apr 30 12:20:42 fedora kernel: audit: backlog limit exceeded
Apr 30 12:20:42 fedora kernel: audit: backlog limit exceeded
Apr 30 12:20:42 fedora kernel: audit: audit_backlog=2152579 > audit_backlog_limit=64
Apr 30 12:20:42 fedora kernel: audit: audit_backlog=2152626 > audit_backlog_limit=64
Apr 30 12:20:42 fedora kernel: audit: audit_backlog=2152694 > audit_backlog_limit=64
Apr 30 12:20:42 fedora kernel: audit: audit_lost=6878426 audit_rate_limit=0 audit_backlog_limit=64
Apr 30 12:20:45 fedora kernel: oci-seccomp-bpf invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=-1000
Apr 30 12:20:45 fedora kernel: CPU: 0 PID: 13284 Comm: oci-seccomp-bpf Not tainted 5.11.12-300.fc34.x86_64 #1
Apr 30 12:20:45 fedora kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.fc32 04/01/2014
[...]

[1] https://lore.kernel.org/linux-audit/CANYvDQN7H5tVp47fbYcRasv4XF07eUbsDwT_eDCHXJUj43J7jQ@mail.gmail.com/,
Serhei Makarov says:

Upstream kernel 5.11.0-rc7 and later was found to deadlock during a
bpf_probe_read_compat() call within a sched_switch tracepoint. The problem
is reproducible with the reg_alloc3 testcase from SystemTap's BPF backend
testsuite on x86_64 as well as the runqlat, runqslower tools from bcc on
ppc64le. Example stack trace:

[...]
[ 730.868702] stack backtrace:
[ 730.869590] CPU: 1 PID: 701 Comm: in:imjournal Not tainted, 5.12.0-0.rc2.20210309git144c79ef3353.166.fc35.x86_64 #1
[ 730.871605] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[ 730.873278] Call Trace:
[ 730.873770] dump_stack+0x7f/0xa1
[ 730.874433] check_noncircular+0xdf/0x100
[ 730.875232] __lock_acquire+0x1202/0x1e10
[ 730.876031] ? __lock_acquire+0xfc0/0x1e10
[ 730.876844] lock_acquire+0xc2/0x3a0
[ 730.877551] ? __wake_up_common_lock+0x52/0x90
[ 730.878434] ? lock_acquire+0xc2/0x3a0
[ 730.879186] ? lock_is_held_type+0xa7/0x120
[ 730.880044] ? skb_queue_tail+0x1b/0x50
[ 730.880800] _raw_spin_lock_irqsave+0x4d/0x90
[ 730.881656] ? __wake_up_common_lock+0x52/0x90
[ 730.882532] __wake_up_common_lock+0x52/0x90
[ 730.883375] audit_log_end+0x5b/0x100
[ 730.884104] slow_avc_audit+0x69/0x90
[ 730.884836] avc_has_perm+0x8b/0xb0
[ 730.885532] selinux_lockdown+0xa5/0xd0
[ 730.886297] security_locked_down+0x20/0x40
[ 730.887133] bpf_probe_read_compat+0x66/0xd0
[ 730.887983] bpf_prog_250599c5469ac7b5+0x10f/0x820
[ 730.888917] trace_call_bpf+0xe9/0x240
[ 730.889672] perf_trace_run_bpf_submit+0x4d/0xc0
[ 730.890579] perf_trace_sched_switch+0x142/0x180
[ 730.891485] ? __schedule+0x6d8/0xb20
[ 730.892209] __schedule+0x6d8/0xb20
[ 730.892899] schedule+0x5b/0xc0
[ 730.893522] exit_to_user_mode_prepare+0x11d/0x240
[ 730.894457] syscall_exit_to_user_mode+0x27/0x70
[ 730.895361] entry_SYSCALL_64_after_hwframe+0x44/0xae
[...]

Fixes: 59438b46471a ("security,lockdown,selinux: implement SELinux lockdown")
Reported-by: Ondrej Mosnacek <[email protected]>
Reported-by: Jakub Hrozek <[email protected]>
Reported-by: Serhei Makarov <[email protected]>
Reported-by: Jiri Olsa <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Tested-by: Jiri Olsa <[email protected]>
Cc: Paul Moore <[email protected]>
Cc: James Morris <[email protected]>
Cc: Jerome Marchand <[email protected]>
Cc: Frank Eigler <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
kernel/bpf/helpers.c | 7 +++++--
kernel/trace/bpf_trace.c | 32 ++++++++++++--------------------
2 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index d0fc091d2ab4..f7e99bb8c3b6 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -14,6 +14,7 @@
#include <linux/jiffies.h>
#include <linux/pid_namespace.h>
#include <linux/proc_ns.h>
+#include <linux/security.h>

#include "../../lib/kstrtox.h"

@@ -728,11 +729,13 @@ bpf_base_func_proto(enum bpf_func_id func_id)
case BPF_FUNC_probe_read_user:
return &bpf_probe_read_user_proto;
case BPF_FUNC_probe_read_kernel:
- return &bpf_probe_read_kernel_proto;
+ return security_locked_down(LOCKDOWN_BPF_READ) < 0 ?
+ NULL : &bpf_probe_read_kernel_proto;
case BPF_FUNC_probe_read_user_str:
return &bpf_probe_read_user_str_proto;
case BPF_FUNC_probe_read_kernel_str:
- return &bpf_probe_read_kernel_str_proto;
+ return security_locked_down(LOCKDOWN_BPF_READ) < 0 ?
+ NULL : &bpf_probe_read_kernel_str_proto;
case BPF_FUNC_snprintf_btf:
return &bpf_snprintf_btf_proto;
default:
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index fcbfc9564996..01710831fd02 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -212,16 +212,11 @@ const struct bpf_func_proto bpf_probe_read_user_str_proto = {
static __always_inline int
bpf_probe_read_kernel_common(void *dst, u32 size, const void *unsafe_ptr)
{
- int ret = security_locked_down(LOCKDOWN_BPF_READ);
+ int ret;

- if (unlikely(ret < 0))
- goto fail;
ret = copy_from_kernel_nofault(dst, unsafe_ptr, size);
if (unlikely(ret < 0))
- goto fail;
- return ret;
-fail:
- memset(dst, 0, size);
+ memset(dst, 0, size);
return ret;
}

@@ -243,10 +238,7 @@ const struct bpf_func_proto bpf_probe_read_kernel_proto = {
static __always_inline int
bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsafe_ptr)
{
- int ret = security_locked_down(LOCKDOWN_BPF_READ);
-
- if (unlikely(ret < 0))
- goto fail;
+ int ret;

/*
* The strncpy_from_kernel_nofault() call will likely not fill the
@@ -259,11 +251,7 @@ bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsafe_ptr)
*/
ret = strncpy_from_kernel_nofault(dst, unsafe_ptr, size);
if (unlikely(ret < 0))
- goto fail;
-
- return ret;
-fail:
- memset(dst, 0, size);
+ memset(dst, 0, size);
return ret;
}

@@ -1293,16 +1281,20 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
case BPF_FUNC_probe_read_user:
return &bpf_probe_read_user_proto;
case BPF_FUNC_probe_read_kernel:
- return &bpf_probe_read_kernel_proto;
+ return security_locked_down(LOCKDOWN_BPF_READ) < 0 ?
+ NULL : &bpf_probe_read_kernel_proto;
case BPF_FUNC_probe_read_user_str:
return &bpf_probe_read_user_str_proto;
case BPF_FUNC_probe_read_kernel_str:
- return &bpf_probe_read_kernel_str_proto;
+ return security_locked_down(LOCKDOWN_BPF_READ) < 0 ?
+ NULL : &bpf_probe_read_kernel_str_proto;
#ifdef CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
case BPF_FUNC_probe_read:
- return &bpf_probe_read_compat_proto;
+ return security_locked_down(LOCKDOWN_BPF_READ) < 0 ?
+ NULL : &bpf_probe_read_compat_proto;
case BPF_FUNC_probe_read_str:
- return &bpf_probe_read_compat_str_proto;
+ return security_locked_down(LOCKDOWN_BPF_READ) < 0 ?
+ NULL : &bpf_probe_read_compat_str_proto;
#endif
#ifdef CONFIG_CGROUPS
case BPF_FUNC_get_current_cgroup_id:
--
2.30.2



2021-06-09 10:27:14

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 007/137] efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared

From: Heiner Kallweit <[email protected]>

[ Upstream commit 45add3cc99feaaf57d4b6f01d52d532c16a1caee ]

UEFI spec 2.9, p.108, table 4-1 lists the scenario that both attributes
are cleared with the description "No memory access protection is
possible for Entry". So we can have valid entries where both attributes
are cleared, so remove the check.

Signed-off-by: Heiner Kallweit <[email protected]>
Fixes: 10f0d2f577053 ("efi: Implement generic support for the Memory Attributes table")
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/firmware/efi/memattr.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/firmware/efi/memattr.c b/drivers/firmware/efi/memattr.c
index 5737cb0fcd44..0a9aba5f9cef 100644
--- a/drivers/firmware/efi/memattr.c
+++ b/drivers/firmware/efi/memattr.c
@@ -67,11 +67,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out)
return false;
}

- if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) {
- pr_warn("Entry attributes invalid: RO and XP bits both cleared\n");
- return false;
- }
-
if (PAGE_SIZE > EFI_PAGE_SIZE &&
(!PAGE_ALIGNED(in->phys_addr) ||
!PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) {
--
2.30.2



2021-06-09 10:27:45

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 005/137] netfilter: conntrack: unregister ipv4 sockopts on error unwind

From: Florian Westphal <[email protected]>

[ Upstream commit 22cbdbcfb61acc78d5fc21ebb13ccc0d7e29f793 ]

When ipv6 sockopt register fails, the ipv4 one needs to be removed.

Fixes: a0ae2562c6c ("netfilter: conntrack: remove l3proto abstraction")
Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/netfilter/nf_conntrack_proto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
index 47e9319d2cf3..71892822bbf5 100644
--- a/net/netfilter/nf_conntrack_proto.c
+++ b/net/netfilter/nf_conntrack_proto.c
@@ -660,7 +660,7 @@ int nf_conntrack_proto_init(void)

#if IS_ENABLED(CONFIG_IPV6)
cleanup_sockopt:
- nf_unregister_sockopt(&so_getorigdst6);
+ nf_unregister_sockopt(&so_getorigdst);
#endif
return ret;
}
--
2.30.2



2021-06-09 10:27:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 034/137] netfilter: nft_ct: skip expectations for confirmed conntrack

From: Pablo Neira Ayuso <[email protected]>

[ Upstream commit 1710eb913bdcda3917f44d383c32de6bdabfc836 ]

nft_ct_expect_obj_eval() calls nf_ct_ext_add() for a confirmed
conntrack entry. However, nf_ct_ext_add() can only be called for
!nf_ct_is_confirmed().

[ 1825.349056] WARNING: CPU: 0 PID: 1279 at net/netfilter/nf_conntrack_extend.c:48 nf_ct_xt_add+0x18e/0x1a0 [nf_conntrack]
[ 1825.351391] RIP: 0010:nf_ct_ext_add+0x18e/0x1a0 [nf_conntrack]
[ 1825.351493] Code: 41 5c 41 5d 41 5e 41 5f c3 41 bc 0a 00 00 00 e9 15 ff ff ff ba 09 00 00 00 31 f6 4c 89 ff e8 69 6c 3d e9 eb 96 45 31 ed eb cd <0f> 0b e9 b1 fe ff ff e8 86 79 14 e9 eb bf 0f 1f 40 00 0f 1f 44 00
[ 1825.351721] RSP: 0018:ffffc90002e1f1e8 EFLAGS: 00010202
[ 1825.351790] RAX: 000000000000000e RBX: ffff88814f5783c0 RCX: ffffffffc0e4f887
[ 1825.351881] RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffff88814f578440
[ 1825.351971] RBP: 0000000000000000 R08: 0000000000000000 R09: ffff88814f578447
[ 1825.352060] R10: ffffed1029eaf088 R11: 0000000000000001 R12: ffff88814f578440
[ 1825.352150] R13: ffff8882053f3a00 R14: 0000000000000000 R15: 0000000000000a20
[ 1825.352240] FS: 00007f992261c900(0000) GS:ffff889faec00000(0000) knlGS:0000000000000000
[ 1825.352343] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1825.352417] CR2: 000056070a4d1158 CR3: 000000015efe0000 CR4: 0000000000350ee0
[ 1825.352508] Call Trace:
[ 1825.352544] nf_ct_helper_ext_add+0x10/0x60 [nf_conntrack]
[ 1825.352641] nft_ct_expect_obj_eval+0x1b8/0x1e0 [nft_ct]
[ 1825.352716] nft_do_chain+0x232/0x850 [nf_tables]

Add the ct helper extension only for unconfirmed conntrack. Skip rule
evaluation if the ct helper extension does not exist. Thus, you can
only create expectations from the first packet.

It should be possible to remove this limitation by adding a new action
to attach a generic ct helper to the first packet. Then, use this ct
helper extension from follow up packets to create the ct expectation.

While at it, add a missing check to skip the template conntrack too
and remove check for IPCT_UNTRACK which is implicit to !ct.

Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support")
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/netfilter/nft_ct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index a1b0aac46e9e..70d46e0bbf06 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -1218,7 +1218,7 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
struct nf_conn *ct;

ct = nf_ct_get(pkt->skb, &ctinfo);
- if (!ct || ctinfo == IP_CT_UNTRACKED) {
+ if (!ct || nf_ct_is_confirmed(ct) || nf_ct_is_template(ct)) {
regs->verdict.code = NFT_BREAK;
return;
}
--
2.30.2



2021-06-09 10:28:03

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 037/137] bpf: Simplify cases in bpf_base_func_proto

From: Tobias Klauser <[email protected]>

[ Upstream commit 61ca36c8c4eb3bae35a285b1ae18c514cde65439 ]

!perfmon_capable() is checked before the last switch(func_id) in
bpf_base_func_proto. Thus, the cases BPF_FUNC_trace_printk and
BPF_FUNC_snprintf_btf can be moved to that last switch(func_id) to omit
the inline !perfmon_capable() checks.

Signed-off-by: Tobias Klauser <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
kernel/bpf/helpers.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index c489430cac78..d0fc091d2ab4 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -707,14 +707,6 @@ bpf_base_func_proto(enum bpf_func_id func_id)
return &bpf_spin_lock_proto;
case BPF_FUNC_spin_unlock:
return &bpf_spin_unlock_proto;
- case BPF_FUNC_trace_printk:
- if (!perfmon_capable())
- return NULL;
- return bpf_get_trace_printk_proto();
- case BPF_FUNC_snprintf_btf:
- if (!perfmon_capable())
- return NULL;
- return &bpf_snprintf_btf_proto;
case BPF_FUNC_jiffies64:
return &bpf_jiffies64_proto;
case BPF_FUNC_per_cpu_ptr:
@@ -729,6 +721,8 @@ bpf_base_func_proto(enum bpf_func_id func_id)
return NULL;

switch (func_id) {
+ case BPF_FUNC_trace_printk:
+ return bpf_get_trace_printk_proto();
case BPF_FUNC_get_current_task:
return &bpf_get_current_task_proto;
case BPF_FUNC_probe_read_user:
@@ -739,6 +733,8 @@ bpf_base_func_proto(enum bpf_func_id func_id)
return &bpf_probe_read_user_str_proto;
case BPF_FUNC_probe_read_kernel_str:
return &bpf_probe_read_kernel_str_proto;
+ case BPF_FUNC_snprintf_btf:
+ return &bpf_snprintf_btf_proto;
default:
return NULL;
}
--
2.30.2



2021-06-09 10:29:59

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 010/137] vfio/pci: Fix error return code in vfio_ecap_init()

From: Zhen Lei <[email protected]>

[ Upstream commit d1ce2c79156d3baf0830990ab06d296477b93c26 ]

The error code returned from vfio_ext_cap_len() is stored in 'len', not
in 'ret'.

Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhen Lei <[email protected]>
Reviewed-by: Max Gurtovoy <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/vfio/pci/vfio_pci_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
index a402adee8a21..47f21a6ca7fe 100644
--- a/drivers/vfio/pci/vfio_pci_config.c
+++ b/drivers/vfio/pci/vfio_pci_config.c
@@ -1581,7 +1581,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
if (len == 0xFF) {
len = vfio_ext_cap_len(vdev, ecap, epos);
if (len < 0)
- return ret;
+ return len;
}
}

--
2.30.2



2021-06-09 10:30:08

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 012/137] samples: vfio-mdev: fix error handing in mdpy_fb_probe()

From: Wei Yongjun <[email protected]>

[ Upstream commit 752774ce7793a1f8baa55aae31f3b4caac49cbe4 ]

Fix to return a negative error code from the framebuffer_alloc() error
handling case instead of 0, also release regions in some error handing
cases.

Fixes: cacade1946a4 ("sample: vfio mdev display - guest driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
samples/vfio-mdev/mdpy-fb.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c
index 21dbf63d6e41..9ec93d90e8a5 100644
--- a/samples/vfio-mdev/mdpy-fb.c
+++ b/samples/vfio-mdev/mdpy-fb.c
@@ -117,22 +117,27 @@ static int mdpy_fb_probe(struct pci_dev *pdev,
if (format != DRM_FORMAT_XRGB8888) {
pci_err(pdev, "format mismatch (0x%x != 0x%x)\n",
format, DRM_FORMAT_XRGB8888);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_release_regions;
}
if (width < 100 || width > 10000) {
pci_err(pdev, "width (%d) out of range\n", width);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_release_regions;
}
if (height < 100 || height > 10000) {
pci_err(pdev, "height (%d) out of range\n", height);
- return -EINVAL;
+ ret = -EINVAL;
+ goto err_release_regions;
}
pci_info(pdev, "mdpy found: %dx%d framebuffer\n",
width, height);

info = framebuffer_alloc(sizeof(struct mdpy_fb_par), &pdev->dev);
- if (!info)
+ if (!info) {
+ ret = -ENOMEM;
goto err_release_regions;
+ }
pci_set_drvdata(pdev, info);
par = info->par;

--
2.30.2



2021-06-09 10:30:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 056/137] ice: add correct exception tracing for XDP

From: Magnus Karlsson <[email protected]>

[ Upstream commit 89d65df024c59988291f643b4e45d1528c51aef9 ]

Add missing exception tracing to XDP when a number of different
errors can occur. The support was only partial. Several errors
where not logged which would confuse the user quite a lot not
knowing where and why the packets disappeared.

Fixes: efc2214b6047 ("ice: Add support for XDP")
Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
Reported-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Magnus Karlsson <[email protected]>
Tested-by: Kiran Bhandare <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/intel/ice/ice_txrx.c | 12 +++++++++---
drivers/net/ethernet/intel/ice/ice_xsk.c | 8 ++++++--
2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 5cc2854a5d48..442a9bcbf60a 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -538,7 +538,7 @@ ice_run_xdp(struct ice_ring *rx_ring, struct xdp_buff *xdp,
struct bpf_prog *xdp_prog)
{
struct ice_ring *xdp_ring;
- int err;
+ int err, result;
u32 act;

act = bpf_prog_run_xdp(xdp_prog, xdp);
@@ -547,14 +547,20 @@ ice_run_xdp(struct ice_ring *rx_ring, struct xdp_buff *xdp,
return ICE_XDP_PASS;
case XDP_TX:
xdp_ring = rx_ring->vsi->xdp_rings[smp_processor_id()];
- return ice_xmit_xdp_buff(xdp, xdp_ring);
+ result = ice_xmit_xdp_buff(xdp, xdp_ring);
+ if (result == ICE_XDP_CONSUMED)
+ goto out_failure;
+ return result;
case XDP_REDIRECT:
err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
- return !err ? ICE_XDP_REDIR : ICE_XDP_CONSUMED;
+ if (err)
+ goto out_failure;
+ return ICE_XDP_REDIR;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
case XDP_ABORTED:
+out_failure:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough;
case XDP_DROP:
diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index 952148eede30..9f36f8d7a985 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -527,9 +527,10 @@ ice_run_xdp_zc(struct ice_ring *rx_ring, struct xdp_buff *xdp)

if (likely(act == XDP_REDIRECT)) {
err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
- result = !err ? ICE_XDP_REDIR : ICE_XDP_CONSUMED;
+ if (err)
+ goto out_failure;
rcu_read_unlock();
- return result;
+ return ICE_XDP_REDIR;
}

switch (act) {
@@ -538,11 +539,14 @@ ice_run_xdp_zc(struct ice_ring *rx_ring, struct xdp_buff *xdp)
case XDP_TX:
xdp_ring = rx_ring->vsi->xdp_rings[rx_ring->q_index];
result = ice_xmit_xdp_buff(xdp, xdp_ring);
+ if (result == ICE_XDP_CONSUMED)
+ goto out_failure;
break;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
case XDP_ABORTED:
+out_failure:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough;
case XDP_DROP:
--
2.30.2



2021-06-09 10:30:14

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 031/137] net/mlx5e: Check for needed capability for cvlan matching

From: Roi Dayan <[email protected]>

[ Upstream commit afe93f71b5d3cdae7209213ec8ef25210b837b93 ]

If not supported show an error and return instead of trying to offload
to the hardware and fail.

Fixes: 699e96ddf47f ("net/mlx5e: Support offloading tc double vlan headers match")
Reported-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Roi Dayan <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 1bdeb948f56d..80abdb0b47d7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -2253,11 +2253,13 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
misc_parameters);
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
struct flow_dissector *dissector = rule->match.dissector;
+ enum fs_flow_table_type fs_type;
u16 addr_type = 0;
u8 ip_proto = 0;
u8 *match_level;
int err;

+ fs_type = mlx5e_is_eswitch_flow(flow) ? FS_FT_FDB : FS_FT_NIC_RX;
match_level = outer_match_level;

if (dissector->used_keys &
@@ -2382,6 +2384,13 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
if (match.mask->vlan_id ||
match.mask->vlan_priority ||
match.mask->vlan_tpid) {
+ if (!MLX5_CAP_FLOWTABLE_TYPE(priv->mdev, ft_field_support.outer_second_vid,
+ fs_type)) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Matching on CVLAN is not supported");
+ return -EOPNOTSUPP;
+ }
+
if (match.key->vlan_tpid == htons(ETH_P_8021AD)) {
MLX5_SET(fte_match_set_misc, misc_c,
outer_second_svlan_tag, 1);
--
2.30.2



2021-06-09 10:30:15

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 058/137] ixgbe: add correct exception tracing for XDP

From: Magnus Karlsson <[email protected]>

[ Upstream commit 8281356b1cab1cccc71412eb4cf28b99d6bb2c19 ]

Add missing exception tracing to XDP when a number of different
errors can occur. The support was only partial. Several errors
where not logged which would confuse the user quite a lot not
knowing where and why the packets disappeared.

Fixes: 33fdc82f0883 ("ixgbe: add support for XDP_TX action")
Fixes: d0bcacd0a130 ("ixgbe: add AF_XDP zero-copy Rx support")
Reported-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Magnus Karlsson <[email protected]>
Tested-by: Vishakha Jambekar <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 16 ++++++++--------
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 14 ++++++++------
2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 0b9fddbc5db4..1bfba87f1ff6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2218,23 +2218,23 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter,
break;
case XDP_TX:
xdpf = xdp_convert_buff_to_frame(xdp);
- if (unlikely(!xdpf)) {
- result = IXGBE_XDP_CONSUMED;
- break;
- }
+ if (unlikely(!xdpf))
+ goto out_failure;
result = ixgbe_xmit_xdp_ring(adapter, xdpf);
+ if (result == IXGBE_XDP_CONSUMED)
+ goto out_failure;
break;
case XDP_REDIRECT:
err = xdp_do_redirect(adapter->netdev, xdp, xdp_prog);
- if (!err)
- result = IXGBE_XDP_REDIR;
- else
- result = IXGBE_XDP_CONSUMED;
+ if (err)
+ goto out_failure;
+ result = IXGBE_XDP_REDIR;
break;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
case XDP_ABORTED:
+out_failure:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough; /* handle aborts by dropping packet */
case XDP_DROP:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
index 91ad5b902673..f72d2978263b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
@@ -106,9 +106,10 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter,

if (likely(act == XDP_REDIRECT)) {
err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
- result = !err ? IXGBE_XDP_REDIR : IXGBE_XDP_CONSUMED;
+ if (err)
+ goto out_failure;
rcu_read_unlock();
- return result;
+ return IXGBE_XDP_REDIR;
}

switch (act) {
@@ -116,16 +117,17 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter,
break;
case XDP_TX:
xdpf = xdp_convert_buff_to_frame(xdp);
- if (unlikely(!xdpf)) {
- result = IXGBE_XDP_CONSUMED;
- break;
- }
+ if (unlikely(!xdpf))
+ goto out_failure;
result = ixgbe_xmit_xdp_ring(adapter, xdpf);
+ if (result == IXGBE_XDP_CONSUMED)
+ goto out_failure;
break;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
case XDP_ABORTED:
+out_failure:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough; /* handle aborts by dropping packet */
case XDP_DROP:
--
2.30.2



2021-06-09 10:30:18

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 009/137] efi: cper: fix snprintf() use in cper_dimm_err_location()

From: Rasmus Villemoes <[email protected]>

[ Upstream commit 942859d969de7f6f7f2659a79237a758b42782da ]

snprintf() should be given the full buffer size, not one less. And it
guarantees nul-termination, so doing it manually afterwards is
pointless.

It's even potentially harmful (though probably not in practice because
CPER_REC_LEN is 256), due to the "return how much would have been
written had the buffer been big enough" semantics. I.e., if the bank
and/or device strings are long enough that the "DIMM location ..."
output gets truncated, writing to msg[n] is a buffer overflow.

Signed-off-by: Rasmus Villemoes <[email protected]>
Fixes: 3760cd20402d4 ("CPER: Adjust code flow of some functions")
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/firmware/efi/cper.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index e15d484b6a5a..ea7ca74fc173 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -276,8 +276,7 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
if (!msg || !(mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE))
return 0;

- n = 0;
- len = CPER_REC_LEN - 1;
+ len = CPER_REC_LEN;
dmi_memdev_name(mem->mem_dev_handle, &bank, &device);
if (bank && device)
n = snprintf(msg, len, "DIMM location: %s %s ", bank, device);
@@ -286,7 +285,6 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg)
"DIMM location: not present. DMI handle: 0x%.4x ",
mem->mem_dev_handle);

- msg[n] = '\0';
return n;
}

--
2.30.2



2021-06-09 10:31:22

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 059/137] arm64: dts: ti: j7200-main: Mark Main NAVSS as dma-coherent

From: Vignesh Raghavendra <[email protected]>

[ Upstream commit 52ae30f55a2a40cff549fac95de82f25403bd387 ]

Traffic through main NAVSS interconnect is coherent wrt ARM caches on
J7200 SoC. Add missing dma-coherent property to main_navss node.

Also add dma-ranges to be consistent with mcu_navss node
and with AM65/J721e main_navss and mcu_navss nodes.

Fixes: d361ed88455fe ("arm64: dts: ti: Add support for J7200 SoC")
Signed-off-by: Vignesh Raghavendra <[email protected]>
Reviewed-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
index 72d6496e88dd..689538244392 100644
--- a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
@@ -78,6 +78,8 @@
#size-cells = <2>;
ranges = <0x00 0x30000000 0x00 0x30000000 0x00 0x0c400000>;
ti,sci-dev-id = <199>;
+ dma-coherent;
+ dma-ranges;

main_navss_intr: interrupt-controller1 {
compatible = "ti,sci-intr";
--
2.30.2



2021-06-09 10:32:16

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 054/137] ice: simplify ice_run_xdp

From: Maciej Fijalkowski <[email protected]>

[ Upstream commit 59c97d1b51b119eace6b1e61a6f820701f5a8299 ]

There's no need for 'result' variable, we can directly return the
internal status based on action returned by xdp prog.

Reviewed-by: Björn Töpel <[email protected]>
Signed-off-by: Maciej Fijalkowski <[email protected]>
Tested-by: Kiran Bhandare <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/intel/ice/ice_txrx.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 1510091a63e8..5cc2854a5d48 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -537,22 +537,20 @@ static int
ice_run_xdp(struct ice_ring *rx_ring, struct xdp_buff *xdp,
struct bpf_prog *xdp_prog)
{
- int err, result = ICE_XDP_PASS;
struct ice_ring *xdp_ring;
+ int err;
u32 act;

act = bpf_prog_run_xdp(xdp_prog, xdp);
switch (act) {
case XDP_PASS:
- break;
+ return ICE_XDP_PASS;
case XDP_TX:
xdp_ring = rx_ring->vsi->xdp_rings[smp_processor_id()];
- result = ice_xmit_xdp_buff(xdp, xdp_ring);
- break;
+ return ice_xmit_xdp_buff(xdp, xdp_ring);
case XDP_REDIRECT:
err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
- result = !err ? ICE_XDP_REDIR : ICE_XDP_CONSUMED;
- break;
+ return !err ? ICE_XDP_REDIR : ICE_XDP_CONSUMED;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
@@ -560,11 +558,8 @@ ice_run_xdp(struct ice_ring *rx_ring, struct xdp_buff *xdp,
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough;
case XDP_DROP:
- result = ICE_XDP_CONSUMED;
- break;
+ return ICE_XDP_CONSUMED;
}
-
- return result;
}

/**
--
2.30.2



2021-06-09 10:32:51

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 041/137] igb: add correct exception tracing for XDP

From: Magnus Karlsson <[email protected]>

[ Upstream commit 74431c40b9c5fa673fff83ec157a76a69efd5c72 ]

Add missing exception tracing to XDP when a number of different
errors can occur. The support was only partial. Several errors
where not logged which would confuse the user quite a lot not
knowing where and why the packets disappeared.

Fixes: 9cbc948b5a20 ("igb: add XDP support")
Reported-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Magnus Karlsson <[email protected]>
Tested-by: Vishakha Jambekar <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/intel/igb/igb_main.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 368f0aac5e1d..5c87c0a7ce3d 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -8419,18 +8419,20 @@ static struct sk_buff *igb_run_xdp(struct igb_adapter *adapter,
break;
case XDP_TX:
result = igb_xdp_xmit_back(adapter, xdp);
+ if (result == IGB_XDP_CONSUMED)
+ goto out_failure;
break;
case XDP_REDIRECT:
err = xdp_do_redirect(adapter->netdev, xdp, xdp_prog);
- if (!err)
- result = IGB_XDP_REDIR;
- else
- result = IGB_XDP_CONSUMED;
+ if (err)
+ goto out_failure;
+ result = IGB_XDP_REDIR;
break;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
case XDP_ABORTED:
+out_failure:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough;
case XDP_DROP:
--
2.30.2



2021-06-09 10:34:02

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 042/137] ixgbevf: add correct exception tracing for XDP

From: Magnus Karlsson <[email protected]>

[ Upstream commit faae81420d162551b6ef2d804aafc00f4cd68e0e ]

Add missing exception tracing to XDP when a number of different
errors can occur. The support was only partial. Several errors
where not logged which would confuse the user quite a lot not
knowing where and why the packets disappeared.

Fixes: 21092e9ce8b1 ("ixgbevf: Add support for XDP_TX action")
Reported-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Magnus Karlsson <[email protected]>
Tested-by: Vishakha Jambekar <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 82fce27f682b..a7d0a459969a 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1072,11 +1072,14 @@ static struct sk_buff *ixgbevf_run_xdp(struct ixgbevf_adapter *adapter,
case XDP_TX:
xdp_ring = adapter->xdp_ring[rx_ring->queue_index];
result = ixgbevf_xmit_xdp_ring(xdp_ring, xdp);
+ if (result == IXGBEVF_XDP_CONSUMED)
+ goto out_failure;
break;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
case XDP_ABORTED:
+out_failure:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough; /* handle aborts by dropping packet */
case XDP_DROP:
--
2.30.2



2021-06-09 10:35:01

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 039/137] ieee802154: fix error return code in ieee802154_add_iface()

From: Zhen Lei <[email protected]>

[ Upstream commit 79c6b8ed30e54b401c873dbad2511f2a1c525fd5 ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: be51da0f3e34 ("ieee802154: Stop using NLA_PUT*().")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhen Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stefan Schmidt <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
net/ieee802154/nl-phy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index 2cdc7e63fe17..88215b5c93aa 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -241,8 +241,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info)
}

if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) ||
- nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name))
+ nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) {
+ rc = -EMSGSIZE;
goto nla_put_failure;
+ }
dev_put(dev);

wpan_phy_put(phy);
--
2.30.2



2021-06-09 10:35:01

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 066/137] ARM: dts: imx7d-pico: Fix the tuning-step property

From: Fabio Estevam <[email protected]>

[ Upstream commit 0e2fa4959c4f44815ce33e46e4054eeb0f346053 ]

According to Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml, the
correct name of the property is 'fsl,tuning-step'.

Fix it accordingly.

Signed-off-by: Fabio Estevam <[email protected]>
Fixes: f13f571ac8a1 ("ARM: dts: imx7d-pico: Extend peripherals support")
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
arch/arm/boot/dts/imx7d-pico.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx7d-pico.dtsi b/arch/arm/boot/dts/imx7d-pico.dtsi
index e57da0d32b98..e519897fae08 100644
--- a/arch/arm/boot/dts/imx7d-pico.dtsi
+++ b/arch/arm/boot/dts/imx7d-pico.dtsi
@@ -351,7 +351,7 @@
pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
bus-width = <4>;
- tuning-step = <2>;
+ fsl,tuning-step = <2>;
vmmc-supply = <&reg_3p3v>;
wakeup-source;
no-1-8-v;
--
2.30.2



2021-06-09 10:35:01

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 085/137] wireguard: allowedips: initialize list head in selftest

From: Jason A. Donenfeld <[email protected]>

commit 46cfe8eee285cde465b420637507884551f5d7ca upstream.

The randomized trie tests weren't initializing the dummy peer list head,
resulting in a NULL pointer dereference when used. Fix this by
initializing it in the randomized trie test, just like we do for the
static unit test.

While we're at it, all of the other strings like this have the word
"self-test", so add it to the missing place here.

Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: [email protected]
Signed-off-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/wireguard/selftest/allowedips.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/net/wireguard/selftest/allowedips.c
+++ b/drivers/net/wireguard/selftest/allowedips.c
@@ -296,6 +296,7 @@ static __init bool randomized_test(void)
goto free;
}
kref_init(&peers[i]->refcount);
+ INIT_LIST_HEAD(&peers[i]->allowedips_list);
}

mutex_lock(&mutex);
@@ -333,7 +334,7 @@ static __init bool randomized_test(void)
if (wg_allowedips_insert_v4(&t,
(struct in_addr *)mutated,
cidr, peer, &mutex) < 0) {
- pr_err("allowedips random malloc: FAIL\n");
+ pr_err("allowedips random self-test malloc: FAIL\n");
goto free_locked;
}
if (horrible_allowedips_insert_v4(&h,


2021-06-09 10:35:04

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 092/137] net: caif: fix memory leak in cfusbl_device_notify

From: Pavel Skripkin <[email protected]>

commit 7f5d86669fa4d485523ddb1d212e0a2d90bd62bb upstream.

In case of caif_enroll_dev() fail, allocated
link_support won't be assigned to the corresponding
structure. So simply free allocated pointer in case
of error.

Fixes: 7ad65bf68d70 ("caif: Add support for CAIF over CDC NCM USB interface")
Cc: [email protected]
Signed-off-by: Pavel Skripkin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/caif/caif_usb.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

--- a/net/caif/caif_usb.c
+++ b/net/caif/caif_usb.c
@@ -115,6 +115,11 @@ static struct cflayer *cfusbl_create(int
return (struct cflayer *) this;
}

+static void cfusbl_release(struct cflayer *layer)
+{
+ kfree(layer);
+}
+
static struct packet_type caif_usb_type __read_mostly = {
.type = cpu_to_be16(ETH_P_802_EX1),
};
@@ -127,6 +132,7 @@ static int cfusbl_device_notify(struct n
struct cflayer *layer, *link_support;
struct usbnet *usbnet;
struct usb_device *usbdev;
+ int res;

/* Check whether we have a NCM device, and find its VID/PID. */
if (!(dev->dev.parent && dev->dev.parent->driver &&
@@ -169,8 +175,11 @@ static int cfusbl_device_notify(struct n
if (dev->num_tx_queues > 1)
pr_warn("USB device uses more than one tx queue\n");

- caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
+ res = caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN,
&layer, &caif_usb_type.func);
+ if (res)
+ goto err;
+
if (!pack_added)
dev_add_pack(&caif_usb_type);
pack_added = true;
@@ -178,6 +187,9 @@ static int cfusbl_device_notify(struct n
strlcpy(layer->name, dev->name, sizeof(layer->name));

return 0;
+err:
+ cfusbl_release(link_support);
+ return res;
}

static struct notifier_block caif_device_notifier = {


2021-06-09 10:35:09

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 098/137] ALSA: hda: Fix for mute key LED for HP Pavilion 15-CK0xx

From: Carlos M <[email protected]>

commit 901be145a46eb79879367d853194346a549e623d upstream.

For the HP Pavilion 15-CK0xx, with audio subsystem ID 0x103c:0x841c,
adding a line in patch_realtek.c to apply the ALC269_FIXUP_HP_MUTE_LED_MIC3
fix activates the mute key LED.

Signed-off-by: Carlos M <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
sound/pci/hda/patch_realtek.c | 1 +
1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -8289,6 +8289,7 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
+ SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),


2021-06-09 10:35:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 099/137] ALSA: hda: update the power_state during the direct-complete

From: Hui Wang <[email protected]>

commit b8b90c17602689eeaa5b219d104bbc215d1225cc upstream.

The patch_realtek.c needs to check if the power_state.event equals
PM_EVENT_SUSPEND, after using the direct-complete, the suspend() and
resume() will be skipped if the codec is already rt_suspended, in this
case, the patch_realtek.c will always get PM_EVENT_ON even the system
is really resumed from S3.

We could set power_state to PMSG_SUSPEND in the prepare(), if other
PM functions are called before complete(), those functions will
override power_state; if no other PM functions are called before
complete(), we could know the suspend() and resume() are skipped since
only S3 pm functions could be skipped by direct-complete, in this case
set power_state to PMSG_RESUME in the complete(). This could guarantee
the first time of calling hda_codec_runtime_resume() after complete()
has the correct power_state.

Fixes: 215a22ed31a1 ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
Cc: <[email protected]>
Signed-off-by: Hui Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
sound/pci/hda/hda_codec.c | 5 +++++
1 file changed, 5 insertions(+)

--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2973,6 +2973,7 @@ static int hda_codec_runtime_resume(stru
#ifdef CONFIG_PM_SLEEP
static int hda_codec_pm_prepare(struct device *dev)
{
+ dev->power.power_state = PMSG_SUSPEND;
return pm_runtime_suspended(dev);
}

@@ -2980,6 +2981,10 @@ static void hda_codec_pm_complete(struct
{
struct hda_codec *codec = dev_to_hda_codec(dev);

+ /* If no other pm-functions are called between prepare() and complete() */
+ if (dev->power.power_state.event == PM_EVENT_SUSPEND)
+ dev->power.power_state = PMSG_RESUME;
+
if (pm_runtime_suspended(dev) && (codec->jackpoll_interval ||
hda_codec_need_resume(codec) || codec->forced_resume))
pm_request_resume(dev);


2021-06-09 10:35:26

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 089/137] net: caif: added cfserl_release function

From: Pavel Skripkin <[email protected]>

commit bce130e7f392ddde8cfcb09927808ebd5f9c8669 upstream.

Added cfserl_release() function.

Cc: [email protected]
Signed-off-by: Pavel Skripkin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
include/net/caif/cfserl.h | 1 +
net/caif/cfserl.c | 5 +++++
2 files changed, 6 insertions(+)

--- a/include/net/caif/cfserl.h
+++ b/include/net/caif/cfserl.h
@@ -9,4 +9,5 @@
#include <net/caif/caif_layer.h>

struct cflayer *cfserl_create(int instance, bool use_stx);
+void cfserl_release(struct cflayer *layer);
#endif
--- a/net/caif/cfserl.c
+++ b/net/caif/cfserl.c
@@ -31,6 +31,11 @@ static int cfserl_transmit(struct cflaye
static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
int phyid);

+void cfserl_release(struct cflayer *layer)
+{
+ kfree(layer);
+}
+
struct cflayer *cfserl_create(int instance, bool use_stx)
{
struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC);


2021-06-09 10:35:27

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 107/137] usb: dwc2: Fix build in periphal-only mode

From: Phil Elwell <[email protected]>

In branches to which 24d209dba5a3 ("usb: dwc2: Fix hibernation between
host and device modes.") has been back-ported, the bus_suspended member
of struct dwc2_hsotg is only present in builds that support host-mode.
To avoid having to pull in several more non-Fix commits in order to
get it to compile, wrap the usage of the member in a macro conditional.

Fixes: 24d209dba5a3 ("usb: dwc2: Fix hibernation between host and device modes.")
Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/dwc2/core_intr.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/drivers/usb/dwc2/core_intr.c
+++ b/drivers/usb/dwc2/core_intr.c
@@ -707,7 +707,11 @@ static inline void dwc_handle_gpwrdn_dis
dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN);

hsotg->hibernated = 0;
+
+#if IS_ENABLED(CONFIG_USB_DWC2_HOST) || \
+ IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
hsotg->bus_suspended = 0;
+#endif

if (gpwrdn & GPWRDN_IDSTS) {
hsotg->op_state = OTG_STATE_B_PERIPHERAL;


2021-06-09 10:35:34

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 090/137] net: caif: add proper error handling

From: Pavel Skripkin <[email protected]>

commit a2805dca5107d5603f4bbc027e81e20d93476e96 upstream.

caif_enroll_dev() can fail in some cases. Ingnoring
these cases can lead to memory leak due to not assigning
link_support pointer to anywhere.

Fixes: 7c18d2205ea7 ("caif: Restructure how link caif link layer enroll")
Cc: [email protected]
Signed-off-by: Pavel Skripkin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
include/net/caif/caif_dev.h | 2 +-
include/net/caif/cfcnfg.h | 2 +-
net/caif/caif_dev.c | 8 +++++---
net/caif/cfcnfg.c | 16 +++++++++++-----
4 files changed, 18 insertions(+), 10 deletions(-)

--- a/include/net/caif/caif_dev.h
+++ b/include/net/caif/caif_dev.h
@@ -119,7 +119,7 @@ void caif_free_client(struct cflayer *ad
* The link_support layer is used to add any Link Layer specific
* framing.
*/
-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
+int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
struct cflayer *link_support, int head_room,
struct cflayer **layer, int (**rcv_func)(
struct sk_buff *, struct net_device *,
--- a/include/net/caif/cfcnfg.h
+++ b/include/net/caif/cfcnfg.h
@@ -62,7 +62,7 @@ void cfcnfg_remove(struct cfcnfg *cfg);
* @fcs: Specify if checksum is used in CAIF Framing Layer.
* @head_room: Head space needed by link specific protocol.
*/
-void
+int
cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
struct net_device *dev, struct cflayer *phy_layer,
enum cfcnfg_phy_preference pref,
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -308,7 +308,7 @@ static void dev_flowctrl(struct net_devi
caifd_put(caifd);
}

-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
+int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
struct cflayer *link_support, int head_room,
struct cflayer **layer,
int (**rcv_func)(struct sk_buff *, struct net_device *,
@@ -319,11 +319,12 @@ void caif_enroll_dev(struct net_device *
enum cfcnfg_phy_preference pref;
struct cfcnfg *cfg = get_cfcnfg(dev_net(dev));
struct caif_device_entry_list *caifdevs;
+ int res;

caifdevs = caif_device_list(dev_net(dev));
caifd = caif_device_alloc(dev);
if (!caifd)
- return;
+ return -ENOMEM;
*layer = &caifd->layer;
spin_lock_init(&caifd->flow_lock);

@@ -344,7 +345,7 @@ void caif_enroll_dev(struct net_device *
strlcpy(caifd->layer.name, dev->name,
sizeof(caifd->layer.name));
caifd->layer.transmit = transmit;
- cfcnfg_add_phy_layer(cfg,
+ res = cfcnfg_add_phy_layer(cfg,
dev,
&caifd->layer,
pref,
@@ -354,6 +355,7 @@ void caif_enroll_dev(struct net_device *
mutex_unlock(&caifdevs->lock);
if (rcv_func)
*rcv_func = receive;
+ return res;
}
EXPORT_SYMBOL(caif_enroll_dev);

--- a/net/caif/cfcnfg.c
+++ b/net/caif/cfcnfg.c
@@ -450,7 +450,7 @@ unlock:
rcu_read_unlock();
}

-void
+int
cfcnfg_add_phy_layer(struct cfcnfg *cnfg,
struct net_device *dev, struct cflayer *phy_layer,
enum cfcnfg_phy_preference pref,
@@ -459,7 +459,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg
{
struct cflayer *frml;
struct cfcnfg_phyinfo *phyinfo = NULL;
- int i;
+ int i, res = 0;
u8 phyid;

mutex_lock(&cnfg->lock);
@@ -473,12 +473,15 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg
goto got_phyid;
}
pr_warn("Too many CAIF Link Layers (max 6)\n");
+ res = -EEXIST;
goto out;

got_phyid:
phyinfo = kzalloc(sizeof(struct cfcnfg_phyinfo), GFP_ATOMIC);
- if (!phyinfo)
+ if (!phyinfo) {
+ res = -ENOMEM;
goto out_err;
+ }

phy_layer->id = phyid;
phyinfo->pref = pref;
@@ -492,8 +495,10 @@ got_phyid:

frml = cffrml_create(phyid, fcs);

- if (!frml)
+ if (!frml) {
+ res = -ENOMEM;
goto out_err;
+ }
phyinfo->frm_layer = frml;
layer_set_up(frml, cnfg->mux);

@@ -511,11 +516,12 @@ got_phyid:
list_add_rcu(&phyinfo->node, &cnfg->phys);
out:
mutex_unlock(&cnfg->lock);
- return;
+ return res;

out_err:
kfree(phyinfo);
mutex_unlock(&cnfg->lock);
+ return res;
}
EXPORT_SYMBOL(cfcnfg_add_phy_layer);



2021-06-09 10:35:49

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 105/137] ext4: fix memory leak in ext4_mb_init_backend on error path.

From: Phillip Potter <[email protected]>

commit a8867f4e3809050571c98de7a2d465aff5e4daf5 upstream.

Fix a memory leak discovered by syzbot when a file system is corrupted
with an illegally large s_log_groups_per_flex.

Reported-by: [email protected]
Signed-off-by: Phillip Potter <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/ext4/mballoc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2738,7 +2738,7 @@ static int ext4_mb_init_backend(struct s
*/
if (sbi->s_es->s_log_groups_per_flex >= 32) {
ext4_msg(sb, KERN_ERR, "too many log groups per flexible block group");
- goto err_freesgi;
+ goto err_freebuddy;
}
sbi->s_mb_prefetch = min_t(uint, 1 << sbi->s_es->s_log_groups_per_flex,
BLK_MAX_SEGMENT_SIZE >> (sb->s_blocksize_bits - 9));


2021-06-09 10:35:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 075/137] drm/amdgpu/vcn3: add cancel_delayed_work_sync before power gate

From: James Zhu <[email protected]>

[ Upstream commit 4a62542ae064e3b645d6bbf2295a6c05136956c6 ]

Add cancel_delayed_work_sync before set power gating state
to avoid race condition issue when power gating.

Signed-off-by: James Zhu <[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
index 700621ddc02e..c9c888be1228 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
@@ -345,15 +345,14 @@ done:
static int vcn_v3_0_hw_fini(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- struct amdgpu_ring *ring;
int i;

+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+
for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
if (adev->vcn.harvest_config & (1 << i))
continue;

- ring = &adev->vcn.inst[i].ring_dec;
-
if (!amdgpu_sriov_vf(adev)) {
if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) ||
(adev->vcn.cur_state != AMD_PG_STATE_GATE &&
--
2.30.2



2021-06-09 10:35:58

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 110/137] mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests()

From: Gerald Schaefer <[email protected]>

commit 04f7ce3f07ce39b1a3ca03a56b238a53acc52cfd upstream.

In pmd/pud_advanced_tests(), the vaddr is aligned up to the next pmd/pud
entry, and so it does not match the given pmdp/pudp and (aligned down)
pfn any more.

For s390, this results in memory corruption, because the IDTE
instruction used e.g. in xxx_get_and_clear() will take the vaddr for
some calculations, in combination with the given pmdp. It will then end
up with a wrong table origin, ending on ...ff8, and some of those
wrongly set low-order bits will also select a wrong pagetable level for
the index addition. IDTE could therefore invalidate (or 0x20) something
outside of the page tables, depending on the wrongly picked index, which
in turn depends on the random vaddr.

As result, we sometimes see "BUG task_struct (Not tainted): Padding
overwritten" on s390, where one 0x5a padding value got overwritten with
0x7a.

Fix this by aligning down, similar to how the pmd/pud_aligned pfns are
calculated.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: a5c3b9ffb0f40 ("mm/debug_vm_pgtable: add tests validating advanced arch page table helpers")
Signed-off-by: Gerald Schaefer <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Cc: Vineet Gupta <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: <[email protected]> [5.9+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
mm/debug_vm_pgtable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/debug_vm_pgtable.c
+++ b/mm/debug_vm_pgtable.c
@@ -163,7 +163,7 @@ static void __init pmd_advanced_tests(st

pr_debug("Validating PMD advanced\n");
/* Align the address wrt HPAGE_PMD_SIZE */
- vaddr = (vaddr & HPAGE_PMD_MASK) + HPAGE_PMD_SIZE;
+ vaddr &= HPAGE_PMD_MASK;

pgtable_trans_huge_deposit(mm, pmdp, pgtable);

@@ -285,7 +285,7 @@ static void __init pud_advanced_tests(st

pr_debug("Validating PUD advanced\n");
/* Align the address wrt HPAGE_PUD_SIZE */
- vaddr = (vaddr & HPAGE_PUD_MASK) + HPAGE_PUD_SIZE;
+ vaddr &= HPAGE_PUD_MASK;

set_pud_at(mm, vaddr, pudp, pud);
pudp_set_wrprotect(mm, vaddr, pudp);


2021-06-09 10:36:45

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 122/137] btrfs: fixup error handling in fixup_inode_link_counts

From: Josef Bacik <[email protected]>

commit 011b28acf940eb61c000059dd9e2cfcbf52ed96b upstream.

This function has the following pattern

while (1) {
ret = whatever();
if (ret)
goto out;
}
ret = 0
out:
return ret;

However several places in this while loop we simply break; when there's
a problem, thus clearing the return value, and in one case we do a
return -EIO, and leak the memory for the path.

Fix this by re-arranging the loop to deal with ret == 1 coming from
btrfs_search_slot, and then simply delete the

ret = 0;
out:

bit so everybody can break if there is an error, which will allow for
proper error handling to occur.

CC: [email protected] # 4.4+
Signed-off-by: Josef Bacik <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/btrfs/tree-log.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1752,6 +1752,7 @@ static noinline int fixup_inode_link_cou
break;

if (ret == 1) {
+ ret = 0;
if (path->slots[0] == 0)
break;
path->slots[0]--;
@@ -1764,17 +1765,19 @@ static noinline int fixup_inode_link_cou

ret = btrfs_del_item(trans, root, path);
if (ret)
- goto out;
+ break;

btrfs_release_path(path);
inode = read_one_inode(root, key.offset);
- if (!inode)
- return -EIO;
+ if (!inode) {
+ ret = -EIO;
+ break;
+ }

ret = fixup_inode_link_count(trans, root, inode);
iput(inode);
if (ret)
- goto out;
+ break;

/*
* fixup on a directory may create new entries,
@@ -1783,8 +1786,6 @@ static noinline int fixup_inode_link_cou
*/
key.offset = (u64)-1;
}
- ret = 0;
-out:
btrfs_release_path(path);
return ret;
}


2021-06-09 10:36:59

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 086/137] wireguard: allowedips: remove nodes in O(1)

From: Jason A. Donenfeld <[email protected]>

commit f634f418c227c912e7ea95a3299efdc9b10e4022 upstream.

Previously, deleting peers would require traversing the entire trie in
order to rebalance nodes and safely free them. This meant that removing
1000 peers from a trie with a half million nodes would take an extremely
long time, during which we're holding the rtnl lock. Large-scale users
were reporting 200ms latencies added to the networking stack as a whole
every time their userspace software would queue up significant removals.
That's a serious situation.

This commit fixes that by maintaining a double pointer to the parent's
bit pointer for each node, and then using the already existing node list
belonging to each peer to go directly to the node, fix up its pointers,
and free it with RCU. This means removal is O(1) instead of O(n), and we
don't use gobs of stack.

The removal algorithm has the same downside as the code that it fixes:
it won't collapse needlessly long runs of fillers. We can enhance that
in the future if it ever becomes a problem. This commit documents that
limitation with a TODO comment in code, a small but meaningful
improvement over the prior situation.

Currently the biggest flaw, which the next commit addresses, is that
because this increases the node size on 64-bit machines from 60 bytes to
68 bytes. 60 rounds up to 64, but 68 rounds up to 128. So we wind up
using twice as much memory per node, because of power-of-two
allocations, which is a big bummer. We'll need to figure something out
there.

Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: [email protected]
Signed-off-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/wireguard/allowedips.c | 130 +++++++++++++++----------------------
drivers/net/wireguard/allowedips.h | 9 --
2 files changed, 56 insertions(+), 83 deletions(-)

--- a/drivers/net/wireguard/allowedips.c
+++ b/drivers/net/wireguard/allowedips.c
@@ -66,60 +66,6 @@ static void root_remove_peer_lists(struc
}
}

-static void walk_remove_by_peer(struct allowedips_node __rcu **top,
- struct wg_peer *peer, struct mutex *lock)
-{
-#define REF(p) rcu_access_pointer(p)
-#define DEREF(p) rcu_dereference_protected(*(p), lockdep_is_held(lock))
-#define PUSH(p) ({ \
- WARN_ON(IS_ENABLED(DEBUG) && len >= 128); \
- stack[len++] = p; \
- })
-
- struct allowedips_node __rcu **stack[128], **nptr;
- struct allowedips_node *node, *prev;
- unsigned int len;
-
- if (unlikely(!peer || !REF(*top)))
- return;
-
- for (prev = NULL, len = 0, PUSH(top); len > 0; prev = node) {
- nptr = stack[len - 1];
- node = DEREF(nptr);
- if (!node) {
- --len;
- continue;
- }
- if (!prev || REF(prev->bit[0]) == node ||
- REF(prev->bit[1]) == node) {
- if (REF(node->bit[0]))
- PUSH(&node->bit[0]);
- else if (REF(node->bit[1]))
- PUSH(&node->bit[1]);
- } else if (REF(node->bit[0]) == prev) {
- if (REF(node->bit[1]))
- PUSH(&node->bit[1]);
- } else {
- if (rcu_dereference_protected(node->peer,
- lockdep_is_held(lock)) == peer) {
- RCU_INIT_POINTER(node->peer, NULL);
- list_del_init(&node->peer_list);
- if (!node->bit[0] || !node->bit[1]) {
- rcu_assign_pointer(*nptr, DEREF(
- &node->bit[!REF(node->bit[0])]));
- kfree_rcu(node, rcu);
- node = DEREF(nptr);
- }
- }
- --len;
- }
- }
-
-#undef REF
-#undef DEREF
-#undef PUSH
-}
-
static unsigned int fls128(u64 a, u64 b)
{
return a ? fls64(a) + 64U : fls64(b);
@@ -224,6 +170,7 @@ static int add(struct allowedips_node __
RCU_INIT_POINTER(node->peer, peer);
list_add_tail(&node->peer_list, &peer->allowedips_list);
copy_and_assign_cidr(node, key, cidr, bits);
+ rcu_assign_pointer(node->parent_bit, trie);
rcu_assign_pointer(*trie, node);
return 0;
}
@@ -243,9 +190,9 @@ static int add(struct allowedips_node __
if (!node) {
down = rcu_dereference_protected(*trie, lockdep_is_held(lock));
} else {
- down = rcu_dereference_protected(CHOOSE_NODE(node, key),
- lockdep_is_held(lock));
+ down = rcu_dereference_protected(CHOOSE_NODE(node, key), lockdep_is_held(lock));
if (!down) {
+ rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, key));
rcu_assign_pointer(CHOOSE_NODE(node, key), newnode);
return 0;
}
@@ -254,29 +201,37 @@ static int add(struct allowedips_node __
parent = node;

if (newnode->cidr == cidr) {
+ rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(newnode, down->bits));
rcu_assign_pointer(CHOOSE_NODE(newnode, down->bits), down);
- if (!parent)
+ if (!parent) {
+ rcu_assign_pointer(newnode->parent_bit, trie);
rcu_assign_pointer(*trie, newnode);
- else
- rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits),
- newnode);
- } else {
- node = kzalloc(sizeof(*node), GFP_KERNEL);
- if (unlikely(!node)) {
- list_del(&newnode->peer_list);
- kfree(newnode);
- return -ENOMEM;
+ } else {
+ rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(parent, newnode->bits));
+ rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits), newnode);
}
- INIT_LIST_HEAD(&node->peer_list);
- copy_and_assign_cidr(node, newnode->bits, cidr, bits);
+ return 0;
+ }
+
+ node = kzalloc(sizeof(*node), GFP_KERNEL);
+ if (unlikely(!node)) {
+ list_del(&newnode->peer_list);
+ kfree(newnode);
+ return -ENOMEM;
+ }
+ INIT_LIST_HEAD(&node->peer_list);
+ copy_and_assign_cidr(node, newnode->bits, cidr, bits);

- rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
- rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
- if (!parent)
- rcu_assign_pointer(*trie, node);
- else
- rcu_assign_pointer(CHOOSE_NODE(parent, node->bits),
- node);
+ rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(node, down->bits));
+ rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
+ rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, newnode->bits));
+ rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
+ if (!parent) {
+ rcu_assign_pointer(node->parent_bit, trie);
+ rcu_assign_pointer(*trie, node);
+ } else {
+ rcu_assign_pointer(node->parent_bit, &CHOOSE_NODE(parent, node->bits));
+ rcu_assign_pointer(CHOOSE_NODE(parent, node->bits), node);
}
return 0;
}
@@ -335,9 +290,30 @@ int wg_allowedips_insert_v6(struct allow
void wg_allowedips_remove_by_peer(struct allowedips *table,
struct wg_peer *peer, struct mutex *lock)
{
+ struct allowedips_node *node, *child, *tmp;
+
+ if (list_empty(&peer->allowedips_list))
+ return;
++table->seq;
- walk_remove_by_peer(&table->root4, peer, lock);
- walk_remove_by_peer(&table->root6, peer, lock);
+ list_for_each_entry_safe(node, tmp, &peer->allowedips_list, peer_list) {
+ list_del_init(&node->peer_list);
+ RCU_INIT_POINTER(node->peer, NULL);
+ if (node->bit[0] && node->bit[1])
+ continue;
+ child = rcu_dereference_protected(
+ node->bit[!rcu_access_pointer(node->bit[0])],
+ lockdep_is_held(lock));
+ if (child)
+ child->parent_bit = node->parent_bit;
+ *rcu_dereference_protected(node->parent_bit, lockdep_is_held(lock)) = child;
+ kfree_rcu(node, rcu);
+
+ /* TODO: Note that we currently don't walk up and down in order to
+ * free any potential filler nodes. This means that this function
+ * doesn't free up as much as it could, which could be revisited
+ * at some point.
+ */
+ }
}

int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr)
--- a/drivers/net/wireguard/allowedips.h
+++ b/drivers/net/wireguard/allowedips.h
@@ -15,14 +15,11 @@ struct wg_peer;
struct allowedips_node {
struct wg_peer __rcu *peer;
struct allowedips_node __rcu *bit[2];
- /* While it may seem scandalous that we waste space for v4,
- * we're alloc'ing to the nearest power of 2 anyway, so this
- * doesn't actually make a difference.
- */
- u8 bits[16] __aligned(__alignof(u64));
u8 cidr, bit_at_a, bit_at_b, bitlen;
+ u8 bits[16] __aligned(__alignof(u64));

- /* Keep rarely used list at bottom to be beyond cache line. */
+ /* Keep rarely used members at bottom to be beyond cache line. */
+ struct allowedips_node *__rcu *parent_bit; /* XXX: this puts us at 68->128 bytes instead of 60->64 bytes!! */
union {
struct list_head peer_list;
struct rcu_head rcu;


2021-06-09 10:37:16

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 083/137] wireguard: selftests: remove old conntrack kconfig value

From: Jason A. Donenfeld <[email protected]>

commit acf2492b51c9a3c4dfb947f4d3477a86d315150f upstream.

On recent kernels, this config symbol is no longer used.

Reported-by: Rui Salvaterra <[email protected]>
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: [email protected]
Signed-off-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
tools/testing/selftests/wireguard/qemu/kernel.config | 1 -
1 file changed, 1 deletion(-)

--- a/tools/testing/selftests/wireguard/qemu/kernel.config
+++ b/tools/testing/selftests/wireguard/qemu/kernel.config
@@ -19,7 +19,6 @@ CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XT_NAT=y
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
CONFIG_NETFILTER_XT_MARK=y
-CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_NF_NAT_IPV4=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_FILTER=y


2021-06-09 10:37:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 084/137] wireguard: selftests: make sure rp_filter is disabled on vethc

From: Jason A. Donenfeld <[email protected]>

commit f8873d11d4121aad35024f9379e431e0c83abead upstream.

Some distros may enable strict rp_filter by default, which will prevent
vethc from receiving the packets with an unrouteable reverse path address.

Reported-by: Hangbin Liu <[email protected]>
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: [email protected]
Signed-off-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
tools/testing/selftests/wireguard/netns.sh | 1 +
1 file changed, 1 insertion(+)

--- a/tools/testing/selftests/wireguard/netns.sh
+++ b/tools/testing/selftests/wireguard/netns.sh
@@ -363,6 +363,7 @@ ip1 -6 rule add table main suppress_pref
ip1 -4 route add default dev wg0 table 51820
ip1 -4 rule add not fwmark 51820 table 51820
ip1 -4 rule add table main suppress_prefixlength 0
+n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/vethc/rp_filter'
# Flood the pings instead of sending just one, to trigger routing table reference counting bugs.
n1 ping -W 1 -c 100 -f 192.168.99.7
n1 ping -W 1 -c 100 -f abab::1111


2021-06-09 10:37:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 126/137] drm/msm/dpu: always use mdp device to scale bandwidth

From: Dmitry Baryshkov <[email protected]>

commit a670ff578f1fb855fedc7931fa5bbc06b567af22 upstream.

Currently DPU driver scales bandwidth and core clock for sc7180 only,
while the rest of chips get static bandwidth votes. Make all chipsets
scale bandwidth and clock per composition requirements like sc7180 does.
Drop old voting path completely.

Tested on RB3 (SDM845) and RB5 (SM8250).

Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Clark <[email protected]>
Signed-off-by: Amit Pundir <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 3 -
drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 -------------------------------
2 files changed, 2 insertions(+), 52 deletions(-)

--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -931,8 +931,7 @@ static int dpu_kms_hw_init(struct msm_km
DPU_DEBUG("REG_DMA is not defined");
}

- if (of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss"))
- dpu_kms_parse_data_bus_icc_path(dpu_kms);
+ dpu_kms_parse_data_bus_icc_path(dpu_kms);

pm_runtime_get_sync(&dpu_kms->pdev->dev);

--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
@@ -31,40 +31,8 @@ struct dpu_mdss {
void __iomem *mmio;
struct dss_module_power mp;
struct dpu_irq_controller irq_controller;
- struct icc_path *path[2];
- u32 num_paths;
};

-static int dpu_mdss_parse_data_bus_icc_path(struct drm_device *dev,
- struct dpu_mdss *dpu_mdss)
-{
- struct icc_path *path0 = of_icc_get(dev->dev, "mdp0-mem");
- struct icc_path *path1 = of_icc_get(dev->dev, "mdp1-mem");
-
- if (IS_ERR_OR_NULL(path0))
- return PTR_ERR_OR_ZERO(path0);
-
- dpu_mdss->path[0] = path0;
- dpu_mdss->num_paths = 1;
-
- if (!IS_ERR_OR_NULL(path1)) {
- dpu_mdss->path[1] = path1;
- dpu_mdss->num_paths++;
- }
-
- return 0;
-}
-
-static void dpu_mdss_icc_request_bw(struct msm_mdss *mdss)
-{
- struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss);
- int i;
- u64 avg_bw = dpu_mdss->num_paths ? MAX_BW / dpu_mdss->num_paths : 0;
-
- for (i = 0; i < dpu_mdss->num_paths; i++)
- icc_set_bw(dpu_mdss->path[i], avg_bw, kBps_to_icc(MAX_BW));
-}
-
static void dpu_mdss_irq(struct irq_desc *desc)
{
struct dpu_mdss *dpu_mdss = irq_desc_get_handler_data(desc);
@@ -178,8 +146,6 @@ static int dpu_mdss_enable(struct msm_md
struct dss_module_power *mp = &dpu_mdss->mp;
int ret;

- dpu_mdss_icc_request_bw(mdss);
-
ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true);
if (ret) {
DPU_ERROR("clock enable failed, ret:%d\n", ret);
@@ -213,15 +179,12 @@ static int dpu_mdss_disable(struct msm_m
{
struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss);
struct dss_module_power *mp = &dpu_mdss->mp;
- int ret, i;
+ int ret;

ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, false);
if (ret)
DPU_ERROR("clock disable failed, ret:%d\n", ret);

- for (i = 0; i < dpu_mdss->num_paths; i++)
- icc_set_bw(dpu_mdss->path[i], 0, 0);
-
return ret;
}

@@ -232,7 +195,6 @@ static void dpu_mdss_destroy(struct drm_
struct dpu_mdss *dpu_mdss = to_dpu_mdss(priv->mdss);
struct dss_module_power *mp = &dpu_mdss->mp;
int irq;
- int i;

pm_runtime_suspend(dev->dev);
pm_runtime_disable(dev->dev);
@@ -242,9 +204,6 @@ static void dpu_mdss_destroy(struct drm_
msm_dss_put_clk(mp->clk_config, mp->num_clk);
devm_kfree(&pdev->dev, mp->clk_config);

- for (i = 0; i < dpu_mdss->num_paths; i++)
- icc_put(dpu_mdss->path[i]);
-
if (dpu_mdss->mmio)
devm_iounmap(&pdev->dev, dpu_mdss->mmio);
dpu_mdss->mmio = NULL;
@@ -276,12 +235,6 @@ int dpu_mdss_init(struct drm_device *dev

DRM_DEBUG("mapped mdss address space @%pK\n", dpu_mdss->mmio);

- if (!of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss")) {
- ret = dpu_mdss_parse_data_bus_icc_path(dev, dpu_mdss);
- if (ret)
- return ret;
- }
-
mp = &dpu_mdss->mp;
ret = msm_dss_parse_clock(pdev, mp);
if (ret) {
@@ -307,8 +260,6 @@ int dpu_mdss_init(struct drm_device *dev

pm_runtime_enable(dev->dev);

- dpu_mdss_icc_request_bw(priv->mdss);
-
return ret;

irq_error:


2021-06-09 10:38:03

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 129/137] KVM: arm64: Fix debug register indexing

From: Marc Zyngier <[email protected]>

commit cb853ded1d25e5b026ce115dbcde69e3d7e2e831 upstream.

Commit 03fdfb2690099 ("KVM: arm64: Don't write junk to sysregs on
reset") flipped the register number to 0 for all the debug registers
in the sysreg table, hereby indicating that these registers live
in a separate shadow structure.

However, the author of this patch failed to realise that all the
accessors are using that particular index instead of the register
encoding, resulting in all the registers hitting index 0. Not quite
a valid implementation of the architecture...

Address the issue by fixing all the accessors to use the CRm field
of the encoding, which contains the debug register index.

Fixes: 03fdfb2690099 ("KVM: arm64: Don't write junk to sysregs on reset")
Reported-by: Ricardo Koller <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
arch/arm64/kvm/sys_regs.c | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)

--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -464,14 +464,14 @@ static bool trap_bvr(struct kvm_vcpu *vc
struct sys_reg_params *p,
const struct sys_reg_desc *rd)
{
- u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg];
+ u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->CRm];

if (p->is_write)
reg_to_dbg(vcpu, p, dbg_reg);
else
dbg_to_reg(vcpu, p, dbg_reg);

- trace_trap_reg(__func__, rd->reg, p->is_write, *dbg_reg);
+ trace_trap_reg(__func__, rd->CRm, p->is_write, *dbg_reg);

return true;
}
@@ -479,7 +479,7 @@ static bool trap_bvr(struct kvm_vcpu *vc
static int set_bvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->CRm];

if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -489,7 +489,7 @@ static int set_bvr(struct kvm_vcpu *vcpu
static int get_bvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->CRm];

if (copy_to_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -499,21 +499,21 @@ static int get_bvr(struct kvm_vcpu *vcpu
static void reset_bvr(struct kvm_vcpu *vcpu,
const struct sys_reg_desc *rd)
{
- vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg] = rd->val;
+ vcpu->arch.vcpu_debug_state.dbg_bvr[rd->CRm] = rd->val;
}

static bool trap_bcr(struct kvm_vcpu *vcpu,
struct sys_reg_params *p,
const struct sys_reg_desc *rd)
{
- u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg];
+ u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->CRm];

if (p->is_write)
reg_to_dbg(vcpu, p, dbg_reg);
else
dbg_to_reg(vcpu, p, dbg_reg);

- trace_trap_reg(__func__, rd->reg, p->is_write, *dbg_reg);
+ trace_trap_reg(__func__, rd->CRm, p->is_write, *dbg_reg);

return true;
}
@@ -521,7 +521,7 @@ static bool trap_bcr(struct kvm_vcpu *vc
static int set_bcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->CRm];

if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -532,7 +532,7 @@ static int set_bcr(struct kvm_vcpu *vcpu
static int get_bcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->CRm];

if (copy_to_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -542,22 +542,22 @@ static int get_bcr(struct kvm_vcpu *vcpu
static void reset_bcr(struct kvm_vcpu *vcpu,
const struct sys_reg_desc *rd)
{
- vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg] = rd->val;
+ vcpu->arch.vcpu_debug_state.dbg_bcr[rd->CRm] = rd->val;
}

static bool trap_wvr(struct kvm_vcpu *vcpu,
struct sys_reg_params *p,
const struct sys_reg_desc *rd)
{
- u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg];
+ u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->CRm];

if (p->is_write)
reg_to_dbg(vcpu, p, dbg_reg);
else
dbg_to_reg(vcpu, p, dbg_reg);

- trace_trap_reg(__func__, rd->reg, p->is_write,
- vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg]);
+ trace_trap_reg(__func__, rd->CRm, p->is_write,
+ vcpu->arch.vcpu_debug_state.dbg_wvr[rd->CRm]);

return true;
}
@@ -565,7 +565,7 @@ static bool trap_wvr(struct kvm_vcpu *vc
static int set_wvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->CRm];

if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -575,7 +575,7 @@ static int set_wvr(struct kvm_vcpu *vcpu
static int get_wvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->CRm];

if (copy_to_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -585,21 +585,21 @@ static int get_wvr(struct kvm_vcpu *vcpu
static void reset_wvr(struct kvm_vcpu *vcpu,
const struct sys_reg_desc *rd)
{
- vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg] = rd->val;
+ vcpu->arch.vcpu_debug_state.dbg_wvr[rd->CRm] = rd->val;
}

static bool trap_wcr(struct kvm_vcpu *vcpu,
struct sys_reg_params *p,
const struct sys_reg_desc *rd)
{
- u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg];
+ u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->CRm];

if (p->is_write)
reg_to_dbg(vcpu, p, dbg_reg);
else
dbg_to_reg(vcpu, p, dbg_reg);

- trace_trap_reg(__func__, rd->reg, p->is_write, *dbg_reg);
+ trace_trap_reg(__func__, rd->CRm, p->is_write, *dbg_reg);

return true;
}
@@ -607,7 +607,7 @@ static bool trap_wcr(struct kvm_vcpu *vc
static int set_wcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->CRm];

if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -617,7 +617,7 @@ static int set_wcr(struct kvm_vcpu *vcpu
static int get_wcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
const struct kvm_one_reg *reg, void __user *uaddr)
{
- __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg];
+ __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->CRm];

if (copy_to_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0)
return -EFAULT;
@@ -627,7 +627,7 @@ static int get_wcr(struct kvm_vcpu *vcpu
static void reset_wcr(struct kvm_vcpu *vcpu,
const struct sys_reg_desc *rd)
{
- vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg] = rd->val;
+ vcpu->arch.vcpu_debug_state.dbg_wcr[rd->CRm] = rd->val;
}

static void reset_amair_el1(struct kvm_vcpu *vcpu, const struct sys_reg_desc *r)


2021-06-09 10:51:24

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 028/137] net/tls: Fix use-after-free after the TLS device goes down and up

From: Maxim Mikityanskiy <[email protected]>

[ Upstream commit c55dcdd435aa6c6ad6ccac0a4c636d010ee367a4 ]

When a netdev with active TLS offload goes down, tls_device_down is
called to stop the offload and tear down the TLS context. However, the
socket stays alive, and it still points to the TLS context, which is now
deallocated. If a netdev goes up, while the connection is still active,
and the data flow resumes after a number of TCP retransmissions, it will
lead to a use-after-free of the TLS context.

This commit addresses this bug by keeping the context alive until its
normal destruction, and implements the necessary fallbacks, so that the
connection can resume in software (non-offloaded) kTLS mode.

On the TX side tls_sw_fallback is used to encrypt all packets. The RX
side already has all the necessary fallbacks, because receiving
non-decrypted packets is supported. The thing needed on the RX side is
to block resync requests, which are normally produced after receiving
non-decrypted packets.

The necessary synchronization is implemented for a graceful teardown:
first the fallbacks are deployed, then the driver resources are released
(it used to be possible to have a tls_dev_resync after tls_dev_del).

A new flag called TLS_RX_DEV_DEGRADED is added to indicate the fallback
mode. It's used to skip the RX resync logic completely, as it becomes
useless, and some objects may be released (for example, resync_async,
which is allocated and freed by the driver).

Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure")
Signed-off-by: Maxim Mikityanskiy <[email protected]>
Reviewed-by: Tariq Toukan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
include/net/tls.h | 9 ++++++
net/tls/tls_device.c | 52 +++++++++++++++++++++++++++++++----
net/tls/tls_device_fallback.c | 7 +++++
net/tls/tls_main.c | 1 +
4 files changed, 64 insertions(+), 5 deletions(-)

diff --git a/include/net/tls.h b/include/net/tls.h
index d32a06705587..43891b28fc48 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -193,6 +193,11 @@ struct tls_offload_context_tx {
(sizeof(struct tls_offload_context_tx) + TLS_DRIVER_STATE_SIZE_TX)

enum tls_context_flags {
+ /* tls_device_down was called after the netdev went down, device state
+ * was released, and kTLS works in software, even though rx_conf is
+ * still TLS_HW (needed for transition).
+ */
+ TLS_RX_DEV_DEGRADED = 0,
/* Unlike RX where resync is driven entirely by the core in TX only
* the driver knows when things went out of sync, so we need the flag
* to be atomic.
@@ -264,6 +269,7 @@ struct tls_context {

/* cache cold stuff */
struct proto *sk_proto;
+ struct sock *sk;

void (*sk_destruct)(struct sock *sk);

@@ -446,6 +452,9 @@ static inline u16 tls_user_config(struct tls_context *ctx, bool tx)
struct sk_buff *
tls_validate_xmit_skb(struct sock *sk, struct net_device *dev,
struct sk_buff *skb);
+struct sk_buff *
+tls_validate_xmit_skb_sw(struct sock *sk, struct net_device *dev,
+ struct sk_buff *skb);

static inline bool tls_is_sk_tx_device_offloaded(struct sock *sk)
{
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index abc04045577d..f718c7346088 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -50,6 +50,7 @@ static void tls_device_gc_task(struct work_struct *work);
static DECLARE_WORK(tls_device_gc_work, tls_device_gc_task);
static LIST_HEAD(tls_device_gc_list);
static LIST_HEAD(tls_device_list);
+static LIST_HEAD(tls_device_down_list);
static DEFINE_SPINLOCK(tls_device_lock);

static void tls_device_free_ctx(struct tls_context *ctx)
@@ -759,6 +760,8 @@ void tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq)

if (tls_ctx->rx_conf != TLS_HW)
return;
+ if (unlikely(test_bit(TLS_RX_DEV_DEGRADED, &tls_ctx->flags)))
+ return;

prot = &tls_ctx->prot_info;
rx_ctx = tls_offload_ctx_rx(tls_ctx);
@@ -961,6 +964,17 @@ int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx,

ctx->sw.decrypted |= is_decrypted;

+ if (unlikely(test_bit(TLS_RX_DEV_DEGRADED, &tls_ctx->flags))) {
+ if (likely(is_encrypted || is_decrypted))
+ return 0;
+
+ /* After tls_device_down disables the offload, the next SKB will
+ * likely have initial fragments decrypted, and final ones not
+ * decrypted. We need to reencrypt that single SKB.
+ */
+ return tls_device_reencrypt(sk, skb);
+ }
+
/* Return immediately if the record is either entirely plaintext or
* entirely ciphertext. Otherwise handle reencrypt partially decrypted
* record.
@@ -1288,6 +1302,26 @@ static int tls_device_down(struct net_device *netdev)
spin_unlock_irqrestore(&tls_device_lock, flags);

list_for_each_entry_safe(ctx, tmp, &list, list) {
+ /* Stop offloaded TX and switch to the fallback.
+ * tls_is_sk_tx_device_offloaded will return false.
+ */
+ WRITE_ONCE(ctx->sk->sk_validate_xmit_skb, tls_validate_xmit_skb_sw);
+
+ /* Stop the RX and TX resync.
+ * tls_dev_resync must not be called after tls_dev_del.
+ */
+ WRITE_ONCE(ctx->netdev, NULL);
+
+ /* Start skipping the RX resync logic completely. */
+ set_bit(TLS_RX_DEV_DEGRADED, &ctx->flags);
+
+ /* Sync with inflight packets. After this point:
+ * TX: no non-encrypted packets will be passed to the driver.
+ * RX: resync requests from the driver will be ignored.
+ */
+ synchronize_net();
+
+ /* Release the offload context on the driver side. */
if (ctx->tx_conf == TLS_HW)
netdev->tlsdev_ops->tls_dev_del(netdev, ctx,
TLS_OFFLOAD_CTX_DIR_TX);
@@ -1295,13 +1329,21 @@ static int tls_device_down(struct net_device *netdev)
!test_bit(TLS_RX_DEV_CLOSED, &ctx->flags))
netdev->tlsdev_ops->tls_dev_del(netdev, ctx,
TLS_OFFLOAD_CTX_DIR_RX);
- WRITE_ONCE(ctx->netdev, NULL);
- synchronize_net();
+
dev_put(netdev);
- list_del_init(&ctx->list);

- if (refcount_dec_and_test(&ctx->refcount))
- tls_device_free_ctx(ctx);
+ /* Move the context to a separate list for two reasons:
+ * 1. When the context is deallocated, list_del is called.
+ * 2. It's no longer an offloaded context, so we don't want to
+ * run offload-specific code on this context.
+ */
+ spin_lock_irqsave(&tls_device_lock, flags);
+ list_move_tail(&ctx->list, &tls_device_down_list);
+ spin_unlock_irqrestore(&tls_device_lock, flags);
+
+ /* Device contexts for RX and TX will be freed in on sk_destruct
+ * by tls_device_free_ctx. rx_conf and tx_conf stay in TLS_HW.
+ */
}

up_write(&device_offload_lock);
diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c
index 28895333701e..0d40016bf69e 100644
--- a/net/tls/tls_device_fallback.c
+++ b/net/tls/tls_device_fallback.c
@@ -430,6 +430,13 @@ struct sk_buff *tls_validate_xmit_skb(struct sock *sk,
}
EXPORT_SYMBOL_GPL(tls_validate_xmit_skb);

+struct sk_buff *tls_validate_xmit_skb_sw(struct sock *sk,
+ struct net_device *dev,
+ struct sk_buff *skb)
+{
+ return tls_sw_fallback(sk, skb);
+}
+
struct sk_buff *tls_encrypt_skb(struct sk_buff *skb)
{
return tls_sw_fallback(skb->sk, skb);
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index 8d93cea99f2c..32a51b20509c 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -633,6 +633,7 @@ struct tls_context *tls_ctx_create(struct sock *sk)
mutex_init(&ctx->tx_lock);
rcu_assign_pointer(icsk->icsk_ulp_data, ctx);
ctx->sk_proto = READ_ONCE(sk->sk_prot);
+ ctx->sk = sk;
return ctx;
}

--
2.30.2



2021-06-09 10:52:10

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 057/137] ixgbe: optimize for XDP_REDIRECT in xsk path

From: Magnus Karlsson <[email protected]>

[ Upstream commit 7d52fe2eaddfa3d7255d43c3e89ebf2748b7ea7a ]

Optimize ixgbe_run_xdp_zc() for the XDP program verdict being
XDP_REDIRECT in the xsk zero-copy path. This path is only used when
having AF_XDP zero-copy on and in that case most packets will be
directed to user space. This provides a little under 100k extra
packets in throughput on my server when running l2fwd in xdpsock.

Signed-off-by: Magnus Karlsson <[email protected]>
Tested-by: Vishakha Jambekar <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
index 3771857cf887..91ad5b902673 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c
@@ -104,6 +104,13 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter,
xdp_prog = READ_ONCE(rx_ring->xdp_prog);
act = bpf_prog_run_xdp(xdp_prog, xdp);

+ if (likely(act == XDP_REDIRECT)) {
+ err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
+ result = !err ? IXGBE_XDP_REDIR : IXGBE_XDP_CONSUMED;
+ rcu_read_unlock();
+ return result;
+ }
+
switch (act) {
case XDP_PASS:
break;
@@ -115,10 +122,6 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter,
}
result = ixgbe_xmit_xdp_ring(adapter, xdpf);
break;
- case XDP_REDIRECT:
- err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
- result = !err ? IXGBE_XDP_REDIR : IXGBE_XDP_CONSUMED;
- break;
default:
bpf_warn_invalid_xdp_action(act);
fallthrough;
--
2.30.2



2021-06-09 12:30:36

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 5.10 000/137] 5.10.43-rc1 review

On 6/8/21 12:25 PM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.43 release.
> There are 137 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu, 10 Jun 2021 17:59:18 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.43-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>

Compiled and booted on my test system. No dmesg regressions.

Tested-by: Shuah Khan <[email protected]>

thanks,
-- Shuah


2021-06-09 14:10:46

by Naresh Kamboju

[permalink] [raw]
Subject: Re: [PATCH 5.10 000/137] 5.10.43-rc1 review

On Wed, 9 Jun 2021 at 00:09, Greg Kroah-Hartman
<[email protected]> wrote:
>
> This is the start of the stable review cycle for the 5.10.43 release.
> There are 137 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu, 10 Jun 2021 17:59:18 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.43-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

Tested-by: Linux Kernel Functional Testing <[email protected]>

## Build
* kernel: 5.10.43-rc1
* git: ['https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git',
'https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc']
* git branch: linux-5.10.y
* git commit: c108263eaf06733c15c23cb4fdf83d188c0e2881
* git describe: v5.10.42-138-gc108263eaf06
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.42-138-gc108263eaf06

## No regressions (compared to v5.10.42)

## No fixes (compared to v5.10.42)


## Test result summary
total: 79560, pass: 65027, fail: 2540, skip: 11224, xfail: 769,

## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 193 total, 193 passed, 0 failed
* arm64: 27 total, 27 passed, 0 failed
* dragonboard-410c: 1 total, 1 passed, 0 failed
* hi6220-hikey: 1 total, 1 passed, 0 failed
* i386: 26 total, 26 passed, 0 failed
* juno-r2: 1 total, 1 passed, 0 failed
* mips: 42 total, 42 passed, 0 failed
* parisc: 9 total, 9 passed, 0 failed
* powerpc: 27 total, 27 passed, 0 failed
* riscv: 18 total, 18 passed, 0 failed
* s390: 18 total, 18 passed, 0 failed
* sh: 18 total, 18 passed, 0 failed
* sparc: 9 total, 9 passed, 0 failed
* x15: 1 total, 1 passed, 0 failed
* x86: 1 total, 1 passed, 0 failed
* x86_64: 27 total, 27 passed, 0 failed

## Test suites summary
* fwts
* install-android-platform-tools-r2600
* kselftest-
* kselftest-android
* kselftest-bpf
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-lkdtm
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-vsyscall-mode-native-
* kselftest-vsyscall-mode-none-
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* packetdrill
* perf
* rcutorture
* ssuite
* v4l2-compliance

--
Linaro LKFT
https://lkft.linaro.org

2021-06-09 17:07:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 022/137] nvme-rdma: fix in-casule data send for chained sgls

From: Sagi Grimberg <[email protected]>

[ Upstream commit 12b2aaadb6d5ef77434e8db21f469f46fe2d392e ]

We have only 2 inline sg entries and we allow 4 sg entries for the send
wr sge. Larger sgls entries will be chained. However when we build
in-capsule send wr sge, we iterate without taking into account that the
sgl may be chained and still fit in-capsule (which can happen if the sgl
is bigger than 2, but lower-equal to 4).

Fix in-capsule data mapping to correctly iterate chained sgls.

Fixes: 38e1800275d3 ("nvme-rdma: Avoid preallocating big SGL for data")
Reported-by: Walker, Benjamin <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
Reviewed-by: Max Gurtovoy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
drivers/nvme/host/rdma.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 8b326508a480..e6d58402b829 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1327,16 +1327,17 @@ static int nvme_rdma_map_sg_inline(struct nvme_rdma_queue *queue,
int count)
{
struct nvme_sgl_desc *sg = &c->common.dptr.sgl;
- struct scatterlist *sgl = req->data_sgl.sg_table.sgl;
struct ib_sge *sge = &req->sge[1];
+ struct scatterlist *sgl;
u32 len = 0;
int i;

- for (i = 0; i < count; i++, sgl++, sge++) {
+ for_each_sg(req->data_sgl.sg_table.sgl, sgl, count, i) {
sge->addr = sg_dma_address(sgl);
sge->length = sg_dma_len(sgl);
sge->lkey = queue->device->pd->local_dma_lkey;
len += sge->length;
+ sge++;
}

sg->addr = cpu_to_le64(queue->ctrl->ctrl.icdoff);
--
2.30.2



2021-06-09 18:51:07

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 5.10 000/137] 5.10.43-rc1 review



On 6/8/2021 11:25 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.43 release.
> There are 137 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu, 10 Jun 2021 17:59:18 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.43-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h


On ARCH_BRCMSTB, using 32-bit and 64-bit ARM kernels:

Tested-by: Florian Fainelli <[email protected]>

>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <[email protected]>
> Linux 5.10.43-rc1
>
> David Ahern <[email protected]>
> neighbour: allow NUD_NOARP entries to be forced GCed
>
> Roger Pau Monne <[email protected]>
> xen-netback: take a reference to the RX task thread
>
> Pablo Neira Ayuso <[email protected]>
> netfilter: nf_tables: missing error reporting for not selected expressions
>
> Roja Rani Yarubandi <[email protected]>
> i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops
>
> Gao Xiang <[email protected]>
> lib/lz4: explicitly support in-place decompression
>
> Vitaly Kuznetsov <[email protected]>
> x86/kvm: Disable all PV features on crash
>
> Vitaly Kuznetsov <[email protected]>
> x86/kvm: Disable kvmclock on all CPUs on shutdown
>
> Vitaly Kuznetsov <[email protected]>
> x86/kvm: Teardown PV features on boot CPU as well
>
> Marc Zyngier <[email protected]>
> KVM: arm64: Fix debug register indexing
>
> Sean Christopherson <[email protected]>
> KVM: SVM: Truncate GPR value for DR and CR accesses in !64-bit mode
>
> Anand Jain <[email protected]>
> btrfs: fix unmountable seed device after fstrim
>
> Dmitry Baryshkov <[email protected]>
> drm/msm/dpu: always use mdp device to scale bandwidth
>
> Mina Almasry <[email protected]>
> mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY
>
> Filipe Manana <[email protected]>
> btrfs: fix deadlock when cloning inline extents and low on available space
>
> Josef Bacik <[email protected]>
> btrfs: abort in rename_exchange if we fail to insert the second ref
>
> Josef Bacik <[email protected]>
> btrfs: fixup error handling in fixup_inode_link_counts
>
> Josef Bacik <[email protected]>
> btrfs: return errors from btrfs_del_csums in cleanup_ref_head
>
> Josef Bacik <[email protected]>
> btrfs: fix error handling in btrfs_del_csums
>
> Josef Bacik <[email protected]>
> btrfs: mark ordered extent and inode with error if we fail to finish
>
> Naveen N. Rao <[email protected]>
> powerpc/kprobes: Fix validation of prefixed instructions across page boundary
>
> Thomas Gleixner <[email protected]>
> x86/apic: Mark _all_ legacy interrupts when IO/APIC is missing
>
> Nirmoy Das <[email protected]>
> drm/amdgpu: make sure we unpin the UVD BO
>
> Luben Tuikov <[email protected]>
> drm/amdgpu: Don't query CE and UE errors
>
> Krzysztof Kozlowski <[email protected]>
> nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect
>
> Pu Wen <[email protected]>
> x86/sev: Check SME/SEV support in CPUID first
>
> Thomas Gleixner <[email protected]>
> x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid()
>
> Ding Hui <[email protected]>
> mm/page_alloc: fix counting of free pages after take off from buddy
>
> Gerald Schaefer <[email protected]>
> mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests()
>
> Junxiao Bi <[email protected]>
> ocfs2: fix data corruption by fallocate
>
> Mark Rutland <[email protected]>
> pid: take a reference when initializing `cad_pid`
>
> Phil Elwell <[email protected]>
> usb: dwc2: Fix build in periphal-only mode
>
> Ritesh Harjani <[email protected]>
> ext4: fix accessing uninit percpu counter variable with fast_commit
>
> Phillip Potter <[email protected]>
> ext4: fix memory leak in ext4_mb_init_backend on error path.
>
> Harshad Shirwadkar <[email protected]>
> ext4: fix fast commit alignment issues
>
> Ye Bin <[email protected]>
> ext4: fix bug on in ext4_es_cache_extent as ext4_split_extent_at failed
>
> Alexey Makhalov <[email protected]>
> ext4: fix memory leak in ext4_fill_super
>
> Marek Vasut <[email protected]>
> ARM: dts: imx6q-dhcom: Add PU,VDD1P1,VDD2P5 regulators
>
> Michal Vokáč <[email protected]>
> ARM: dts: imx6dl-yapp4: Fix RGMII connection to QCA8334 switch
>
> Hui Wang <[email protected]>
> ALSA: hda: update the power_state during the direct-complete
>
> Carlos M <[email protected]>
> ALSA: hda: Fix for mute key LED for HP Pavilion 15-CK0xx
>
> Takashi Iwai <[email protected]>
> ALSA: timer: Fix master timer notification
>
> Bob Peterson <[email protected]>
> gfs2: fix scheduling while atomic bug in glocks
>
> Ahelenia Ziemiańska <[email protected]>
> HID: multitouch: require Finger field to mark Win8 reports as MT
>
> Johan Hovold <[email protected]>
> HID: magicmouse: fix NULL-deref on disconnect
>
> Johnny Chuang <[email protected]>
> HID: i2c-hid: Skip ELAN power-on command after reset
>
> Pavel Skripkin <[email protected]>
> net: caif: fix memory leak in cfusbl_device_notify
>
> Pavel Skripkin <[email protected]>
> net: caif: fix memory leak in caif_device_notify
>
> Pavel Skripkin <[email protected]>
> net: caif: add proper error handling
>
> Pavel Skripkin <[email protected]>
> net: caif: added cfserl_release function
>
> Jason A. Donenfeld <[email protected]>
> wireguard: allowedips: free empty intermediate nodes when removing single node
>
> Jason A. Donenfeld <[email protected]>
> wireguard: allowedips: allocate nodes in kmem_cache
>
> Jason A. Donenfeld <[email protected]>
> wireguard: allowedips: remove nodes in O(1)
>
> Jason A. Donenfeld <[email protected]>
> wireguard: allowedips: initialize list head in selftest
>
> Jason A. Donenfeld <[email protected]>
> wireguard: selftests: make sure rp_filter is disabled on vethc
>
> Jason A. Donenfeld <[email protected]>
> wireguard: selftests: remove old conntrack kconfig value
>
> Jason A. Donenfeld <[email protected]>
> wireguard: use synchronize_net rather than synchronize_rcu
>
> Jason A. Donenfeld <[email protected]>
> wireguard: peer: allocate in kmem_cache
>
> Jason A. Donenfeld <[email protected]>
> wireguard: do not use -O3
>
> Lin Ma <[email protected]>
> Bluetooth: use correct lock to prevent UAF of hdev object
>
> Lin Ma <[email protected]>
> Bluetooth: fix the erroneous flush_work() order
>
> James Zhu <[email protected]>
> drm/amdgpu/jpeg3: add cancel_delayed_work_sync before power gate
>
> James Zhu <[email protected]>
> drm/amdgpu/jpeg2.5: add cancel_delayed_work_sync before power gate
>
> James Zhu <[email protected]>
> drm/amdgpu/vcn3: add cancel_delayed_work_sync before power gate
>
> Pavel Begunkov <[email protected]>
> io_uring: use better types for cflags
>
> Pavel Begunkov <[email protected]>
> io_uring: fix link timeout refs
>
> Jisheng Zhang <[email protected]>
> riscv: vdso: fix and clean-up Makefile
>
> Johan Hovold <[email protected]>
> serial: stm32: fix threaded interrupt handling
>
> Hoang Le <[email protected]>
> tipc: fix unique bearer names sanity check
>
> Hoang Le <[email protected]>
> tipc: add extack messages for bearer/media failure
>
> Tony Lindgren <[email protected]>
> bus: ti-sysc: Fix flakey idling of uarts and stop using swsup_sidle_act
>
> Geert Uytterhoeven <[email protected]>
> ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells
>
> Fabio Estevam <[email protected]>
> ARM: dts: imx7d-pico: Fix the 'tuning-step' property
>
> Fabio Estevam <[email protected]>
> ARM: dts: imx7d-meerkat96: Fix the 'tuning-step' property
>
> Michael Walle <[email protected]>
> arm64: dts: freescale: sl28: var4: fix RGMII clock and voltage
>
> Lucas Stach <[email protected]>
> arm64: dts: zii-ultra: fix 12V_MAIN voltage
>
> Michael Walle <[email protected]>
> arm64: dts: ls1028a: fix memory node
>
> Tony Lindgren <[email protected]>
> bus: ti-sysc: Fix am335x resume hang for usb otg module
>
> Jens Wiklander <[email protected]>
> optee: use export_uuid() to copy client UUID
>
> Vignesh Raghavendra <[email protected]>
> arm64: dts: ti: j7200-main: Mark Main NAVSS as dma-coherent
>
> Magnus Karlsson <[email protected]>
> ixgbe: add correct exception tracing for XDP
>
> Magnus Karlsson <[email protected]>
> ixgbe: optimize for XDP_REDIRECT in xsk path
>
> Magnus Karlsson <[email protected]>
> ice: add correct exception tracing for XDP
>
> Magnus Karlsson <[email protected]>
> ice: optimize for XDP_REDIRECT in xsk path
>
> Maciej Fijalkowski <[email protected]>
> ice: simplify ice_run_xdp
>
> Magnus Karlsson <[email protected]>
> i40e: add correct exception tracing for XDP
>
> Magnus Karlsson <[email protected]>
> i40e: optimize for XDP_REDIRECT in xsk path
>
> Rahul Lakkireddy <[email protected]>
> cxgb4: avoid link re-train during TC-MQPRIO configuration
>
> Roja Rani Yarubandi <[email protected]>
> i2c: qcom-geni: Add shutdown callback for i2c
>
> Dave Ertman <[email protected]>
> ice: Allow all LLDP packets from PF to Tx
>
> Paul Greenwalt <[email protected]>
> ice: report supported and advertised autoneg using PHY capabilities
>
> Haiyue Wang <[email protected]>
> ice: handle the VF VSI rebuild failure
>
> Brett Creeley <[email protected]>
> ice: Fix VFR issues for AVF drivers that expect ATQLEN cleared
>
> Brett Creeley <[email protected]>
> ice: Fix allowing VF to request more/less queues via virtchnl
>
> Coco Li <[email protected]>
> ipv6: Fix KASAN: slab-out-of-bounds Read in fib6_nh_flush_exceptions
>
> Rahul Lakkireddy <[email protected]>
> cxgb4: fix regression with HASH tc prio value update
>
> Magnus Karlsson <[email protected]>
> ixgbevf: add correct exception tracing for XDP
>
> Magnus Karlsson <[email protected]>
> igb: add correct exception tracing for XDP
>
> Wei Yongjun <[email protected]>
> ieee802154: fix error return code in ieee802154_llsec_getparams()
>
> Zhen Lei <[email protected]>
> ieee802154: fix error return code in ieee802154_add_iface()
>
> Daniel Borkmann <[email protected]>
> bpf, lockdown, audit: Fix buggy SELinux lockdown permission checks
>
> Tobias Klauser <[email protected]>
> bpf: Simplify cases in bpf_base_func_proto
>
> Zhihao Cheng <[email protected]>
> drm/i915/selftests: Fix return value check in live_breadcrumbs_smoketest()
>
> Pablo Neira Ayuso <[email protected]>
> netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches
>
> Pablo Neira Ayuso <[email protected]>
> netfilter: nft_ct: skip expectations for confirmed conntrack
>
> Max Gurtovoy <[email protected]>
> nvmet: fix freeing unallocated p2pmem
>
> Yevgeny Kliteynik <[email protected]>
> net/mlx5: DR, Create multi-destination flow table with level less than 64
>
> Roi Dayan <[email protected]>
> net/mlx5e: Check for needed capability for cvlan matching
>
> Moshe Shemesh <[email protected]>
> net/mlx5: Check firmware sync reset requested is set before trying to abort it
>
> Aya Levin <[email protected]>
> net/mlx5e: Fix incompatible casting
>
> Maxim Mikityanskiy <[email protected]>
> net/tls: Fix use-after-free after the TLS device goes down and up
>
> Maxim Mikityanskiy <[email protected]>
> net/tls: Replace TLS_RX_SYNC_RUNNING with RCU
>
> Alexander Aring <[email protected]>
> net: sock: fix in-kernel mark setting
>
> Vladimir Oltean <[email protected]>
> net: dsa: tag_8021q: fix the VLAN IDs used for encoding sub-VLANs
>
> Li Huafei <[email protected]>
> perf probe: Fix NULL pointer dereference in convert_variable_location()
>
> Erik Kaneda <[email protected]>
> ACPICA: Clean up context mutex during object deletion
>
> Sagi Grimberg <[email protected]>
> nvme-rdma: fix in-casule data send for chained sgls
>
> Paolo Abeni <[email protected]>
> mptcp: always parse mptcp options for MPC reqsk
>
> Ariel Levkovich <[email protected]>
> net/sched: act_ct: Fix ct template allocation for zone 0
>
> Paul Blakey <[email protected]>
> net/sched: act_ct: Offload connections with commit action
>
> Parav Pandit <[email protected]>
> devlink: Correct VIRTUAL port to not have phys_port attributes
>
> Arnd Bergmann <[email protected]>
> HID: i2c-hid: fix format string mismatch
>
> Zhen Lei <[email protected]>
> HID: pidff: fix error return code in hid_pidff_init()
>
> Tom Rix <[email protected]>
> HID: logitech-hidpp: initialize level variable
>
> Julian Anastasov <[email protected]>
> ipvs: ignore IP_VS_SVC_F_HASHED flag when adding service
>
> Max Gurtovoy <[email protected]>
> vfio/platform: fix module_put call in error flow
>
> Wei Yongjun <[email protected]>
> samples: vfio-mdev: fix error handing in mdpy_fb_probe()
>
> Randy Dunlap <[email protected]>
> vfio/pci: zap_vma_ptes() needs MMU
>
> Zhen Lei <[email protected]>
> vfio/pci: Fix error return code in vfio_ecap_init()
>
> Rasmus Villemoes <[email protected]>
> efi: cper: fix snprintf() use in cper_dimm_err_location()
>
> Dan Carpenter <[email protected]>
> efi/libstub: prevent read overflow in find_file_option()
>
> Heiner Kallweit <[email protected]>
> efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared
>
> Changbin Du <[email protected]>
> efi/fdt: fix panic when no valid fdt found
>
> Florian Westphal <[email protected]>
> netfilter: conntrack: unregister ipv4 sockopts on error unwind
>
> Grant Peltier <[email protected]>
> hwmon: (pmbus/isl68137) remove READ_TEMPERATURE_3 for RAA228228
>
> Armin Wolf <[email protected]>
> hwmon: (dell-smm-hwmon) Fix index values
>
> Grant Grundler <[email protected]>
> net: usb: cdc_ncm: don't spew notifications
>
> Josef Bacik <[email protected]>
> btrfs: tree-checker: do not error out if extent ref hash doesn't match
>
>
> -------------
>
> Diffstat:
>
> Makefile | 4 +-
> arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 6 +-
> arch/arm/boot/dts/imx6q-dhcom-som.dtsi | 12 ++
> arch/arm/boot/dts/imx6qdl-emcon-avari.dtsi | 2 +-
> arch/arm/boot/dts/imx7d-meerkat96.dts | 2 +-
> arch/arm/boot/dts/imx7d-pico.dtsi | 2 +-
> .../freescale/fsl-ls1028a-kontron-sl28-var4.dts | 5 +-
> arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 4 +-
> .../arm64/boot/dts/freescale/imx8mq-zii-ultra.dtsi | 4 +-
> arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 2 +
> arch/arm64/kvm/sys_regs.c | 42 ++---
> arch/powerpc/kernel/kprobes.c | 4 +-
> arch/riscv/kernel/vdso/Makefile | 4 +-
> arch/x86/include/asm/apic.h | 1 +
> arch/x86/include/asm/disabled-features.h | 7 +-
> arch/x86/include/asm/fpu/api.h | 6 +-
> arch/x86/include/asm/fpu/internal.h | 7 -
> arch/x86/include/asm/kvm_para.h | 10 +-
> arch/x86/kernel/apic/apic.c | 1 +
> arch/x86/kernel/apic/vector.c | 20 +++
> arch/x86/kernel/fpu/xstate.c | 57 -------
> arch/x86/kernel/kvm.c | 92 +++++++---
> arch/x86/kernel/kvmclock.c | 26 +--
> arch/x86/kvm/svm/svm.c | 8 +-
> arch/x86/mm/mem_encrypt_identity.c | 11 +-
> drivers/acpi/acpica/utdelete.c | 8 +
> drivers/bus/ti-sysc.c | 57 ++++++-
> drivers/firmware/efi/cper.c | 4 +-
> drivers/firmware/efi/fdtparams.c | 3 +
> drivers/firmware/efi/libstub/file.c | 2 +-
> drivers/firmware/efi/memattr.c | 5 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 16 --
> drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 4 +-
> drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 4 +-
> drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 1 +
> drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 +-
> drivers/gpu/drm/i915/selftests/i915_request.c | 4 +-
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 3 +-
> drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 +-----
> drivers/hid/hid-logitech-hidpp.c | 1 +
> drivers/hid/hid-magicmouse.c | 2 +-
> drivers/hid/hid-multitouch.c | 10 +-
> drivers/hid/i2c-hid/i2c-hid-core.c | 13 +-
> drivers/hid/usbhid/hid-pidff.c | 1 +
> drivers/hwmon/dell-smm-hwmon.c | 4 +-
> drivers/hwmon/pmbus/isl68137.c | 4 +-
> drivers/i2c/busses/i2c-qcom-geni.c | 21 ++-
> drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 2 -
> drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 4 +-
> .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 14 +-
> .../net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c | 9 +-
> drivers/net/ethernet/chelsio/cxgb4/sge.c | 6 +
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 +-
> drivers/net/ethernet/intel/i40e/i40e_xsk.c | 15 +-
> drivers/net/ethernet/intel/ice/ice_ethtool.c | 51 +-----
> drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 1 +
> drivers/net/ethernet/intel/ice/ice_lib.c | 2 +
> drivers/net/ethernet/intel/ice/ice_txrx.c | 24 +--
> drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 19 ++-
> drivers/net/ethernet/intel/ice/ice_xsk.c | 16 +-
> drivers/net/ethernet/intel/igb/igb_main.c | 10 +-
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 16 +-
> drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 21 ++-
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +
> .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 5 +-
> drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 9 +
> drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 3 +
> .../ethernet/mellanox/mlx5/core/steering/dr_fw.c | 3 +-
> drivers/net/usb/cdc_ncm.c | 12 +-
> drivers/net/wireguard/Makefile | 3 +-
> drivers/net/wireguard/allowedips.c | 189 +++++++++++----------
> drivers/net/wireguard/allowedips.h | 14 +-
> drivers/net/wireguard/main.c | 17 +-
> drivers/net/wireguard/peer.c | 27 ++-
> drivers/net/wireguard/peer.h | 3 +
> drivers/net/wireguard/selftest/allowedips.c | 165 +++++++++---------
> drivers/net/wireguard/socket.c | 2 +-
> drivers/net/xen-netback/interface.c | 6 +
> drivers/nvme/host/rdma.c | 5 +-
> drivers/nvme/target/core.c | 33 ++--
> drivers/tee/optee/call.c | 6 +-
> drivers/tee/optee/optee_msg.h | 6 +-
> drivers/tty/serial/stm32-usart.c | 22 +--
> drivers/usb/dwc2/core_intr.c | 4 +
> drivers/vfio/pci/Kconfig | 1 +
> drivers/vfio/pci/vfio_pci_config.c | 2 +-
> drivers/vfio/platform/vfio_platform_common.c | 2 +-
> fs/btrfs/extent-tree.c | 12 +-
> fs/btrfs/file-item.c | 10 +-
> fs/btrfs/inode.c | 19 ++-
> fs/btrfs/reflink.c | 38 +++--
> fs/btrfs/tree-checker.c | 16 +-
> fs/btrfs/tree-log.c | 13 +-
> fs/ext4/extents.c | 43 ++---
> fs/ext4/fast_commit.c | 182 ++++++++++----------
> fs/ext4/fast_commit.h | 7 -
> fs/ext4/ialloc.c | 6 +-
> fs/ext4/mballoc.c | 2 +-
> fs/ext4/super.c | 11 +-
> fs/gfs2/glock.c | 2 +
> fs/io_uring.c | 6 +-
> fs/ocfs2/file.c | 55 +++++-
> include/linux/mlx5/mlx5_ifc.h | 2 +
> include/linux/platform_data/ti-sysc.h | 1 +
> include/linux/usb/usbnet.h | 2 +
> include/net/caif/caif_dev.h | 2 +-
> include/net/caif/cfcnfg.h | 2 +-
> include/net/caif/cfserl.h | 1 +
> include/net/tls.h | 10 +-
> init/main.c | 2 +-
> kernel/bpf/helpers.c | 19 +--
> kernel/trace/bpf_trace.c | 32 ++--
> lib/lz4/lz4_decompress.c | 6 +-
> lib/lz4/lz4defs.h | 1 +
> mm/debug_vm_pgtable.c | 4 +-
> mm/hugetlb.c | 14 +-
> mm/page_alloc.c | 2 +
> net/bluetooth/hci_core.c | 7 +-
> net/bluetooth/hci_sock.c | 4 +-
> net/caif/caif_dev.c | 13 +-
> net/caif/caif_usb.c | 14 +-
> net/caif/cfcnfg.c | 16 +-
> net/caif/cfserl.c | 5 +
> net/core/devlink.c | 4 +-
> net/core/neighbour.c | 1 +
> net/core/sock.c | 16 +-
> net/dsa/tag_8021q.c | 2 +-
> net/ieee802154/nl-mac.c | 4 +-
> net/ieee802154/nl-phy.c | 4 +-
> net/ipv6/route.c | 8 +-
> net/mptcp/subflow.c | 17 +-
> net/netfilter/ipvs/ip_vs_ctl.c | 2 +-
> net/netfilter/nf_conntrack_proto.c | 2 +-
> net/netfilter/nf_tables_api.c | 4 +-
> net/netfilter/nfnetlink_cthelper.c | 8 +-
> net/netfilter/nft_ct.c | 2 +-
> net/nfc/llcp_sock.c | 2 +
> net/sched/act_ct.c | 10 +-
> net/tipc/bearer.c | 94 +++++++---
> net/tls/tls_device.c | 60 +++++--
> net/tls/tls_device_fallback.c | 7 +
> net/tls/tls_main.c | 1 +
> samples/vfio-mdev/mdpy-fb.c | 13 +-
> sound/core/timer.c | 3 +-
> sound/pci/hda/hda_codec.c | 5 +
> sound/pci/hda/patch_realtek.c | 1 +
> tools/perf/util/dwarf-aux.c | 8 +-
> tools/perf/util/probe-finder.c | 3 +
> tools/testing/selftests/wireguard/netns.sh | 1 +
> .../testing/selftests/wireguard/qemu/kernel.config | 1 -
> 150 files changed, 1260 insertions(+), 925 deletions(-)
>
>

--
Florian

2021-06-09 18:53:22

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 5.10 000/137] 5.10.43-rc1 review

On Tue, Jun 08, 2021 at 08:25:40PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.43 release.
> There are 137 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu, 10 Jun 2021 17:59:18 +0000.
> Anything received after that time might be too late.
>

Build results:
total: 156 pass: 156 fail: 0
Qemu test results:
total: 455 pass: 455 fail: 0

Tested-by: Guenter Roeck <[email protected]>

Guenter

2021-06-09 19:19:49

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 5.10 000/137] 5.10.43-rc1 review

Hi!

> This is the start of the stable review cycle for the 5.10.43 release.
> There are 137 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.

CIP testing did not find any problems here:

https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-5.10.y

Tested-by: Pavel Machek (CIP) <[email protected]>

Best regards,
Pavel

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


Attachments:
(No filename) (663.00 B)
signature.asc (188.00 B)
Digital signature
Download all attachments

2021-06-10 09:05:14

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH 5.10 000/137] 5.10.43-rc1 review

Hi Greg,

On Tue, Jun 08, 2021 at 08:25:40PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.10.43 release.
> There are 137 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu, 10 Jun 2021 17:59:18 +0000.
> Anything received after that time might be too late.

Build test:
mips (gcc version 11.1.1 20210523): 63 configs -> no failure
arm (gcc version 11.1.1 20210523): 105 configs -> no new failure
arm64 (gcc version 11.1.1 20210523): 2 configs -> no failure
x86_64 (gcc version 10.2.1 20210110): 2 configs -> no failure

Boot test:
x86_64: Booted on my test laptop. No regression.
x86_64: Booted on qemu. No regression.
arm64: Booted on rpi4b (4GB model). No regression.

Tested-by: Sudip Mukherjee <[email protected]>

--
Regards
Sudip