Skip to contentSkip to conversation

6.7.2-rc1 review

PATCH In review Greg Kroah-Hartman 12 participants 664 messages Jan 23, 2024 – Feb 7, 2024 Page 1 of 5

Subsystems (9)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 6.7.2-rc1 review

This is the start of the stable review cycle for the 6.7.2 release. There are 641 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 Wed, 24 Jan 2024 23:56:49 +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/v6.x/stable-review/patch-6.7.2-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-6.7.y
and the diffstat can be found below.

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 6.7.2-rc1

Marek Szyprowski <[email protected]>
i2c: s3c24xx: fix transferring more than one message in polling mode

Marek Szyprowski <[email protected]>
i2c: s3c24xx: fix read transfers in polling mode

Nikita Zhandarovich <[email protected]>
ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work

Amit Cohen <[email protected]>
selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes

Petr Machata <[email protected]>
mlxsw: spectrum_router: Register netdevice notifier before nexthop

Ido Schimmel <[email protected]>
mlxsw: spectrum_acl_tcam: Fix stack corruption

Ido Schimmel <[email protected]>
mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path

Amit Cohen <[email protected]>
mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure

Christoph Hellwig <[email protected]>
loop: fix the the direct I/O support check when used on top of block devices

Ludvig Pärsson <[email protected]>
ethtool: netlink: Add missing ethnl_ops_begin/complete

Mark Brown <[email protected]>
arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace

Christophe JAILLET <[email protected]>
kdb: Fix a potential buffer overflow in kdb_local()

Pavel Begunkov <[email protected]>
io_uring: adjust defer tw counting

Fedor Pchelkin <[email protected]>
ipvs: avoid stat macros calls from preemptible context

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: skip dead set elements in netlink dump

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: do not allow mismatch field size and set key length

Pavel Tikhomirov <[email protected]>
netfilter: bridge: replace physindev with physinif in nf_bridge_info

Pavel Tikhomirov <[email protected]>
netfilter: propagate net to nf_bridge_get_physindev

Pavel Tikhomirov <[email protected]>
netfilter: nf_queue: remove excess nf_bridge variable

Pavel Tikhomirov <[email protected]>
netfilter: nfnetlink_log: use proper helper for fetching physinif

Pablo Neira Ayuso <[email protected]>
netfilter: nft_limit: do not ignore unsupported flags

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: reject invalid set policy

Jakub Kicinski <[email protected]>
net: netdevsim: don't try to destroy PHC on VFs

Paolo Abeni <[email protected]>
mptcp: relax check on MPC passive fallback

Hengqi Chen <[email protected]>
LoongArch: BPF: Prevent out-of-bounds memory access

Kunwu Chan <[email protected]>
net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe

Hao Sun <[email protected]>
bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS

Qiang Ma <[email protected]>
net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls

Benjamin Poirier <[email protected]>
selftests: bonding: Change script interpreter

Alex Deucher <[email protected]>
drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL

Dafna Hirschfeld <[email protected]>
drm/amdkfd: fixes for HMM mem allocation

Lukas Wunner <[email protected]>
gpiolib: Fix scope-based gpio_device refcounting

Kai Vehmanen <[email protected]>
ASoC: SOF: ipc4-loader: remove the CPC check warnings

Su Hui <[email protected]>
gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe

Michal Simek <[email protected]>
dt-bindings: gpio: xilinx: Fix node address in gpio

Nikita Yushchenko <[email protected]>
net: ravb: Fix dma_addr_t truncation in error case

John Fastabend <[email protected]>
net: tls, fix WARNIING in __sk_msg_free

Martin KaFai Lau <[email protected]>

    bpf: Avoid iter->offset making backward progress in bpf_iter_udp

Martin KaFai Lau <[email protected]>
bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket

Marc Kleine-Budde <[email protected]>
net: netdev_queue: netdev_txq_completed_mb(): fix wake condition

Eric Dumazet <[email protected]>
net: add more sanity check in virtio_net_hdr_to_skb()

Gao Xiang <[email protected]>
erofs: fix inconsistent per-file compression format

Eric Dumazet <[email protected]>

    udp: annotate data-races around up->pending

Sneh Shah <[email protected]>
net: stmmac: Fix ethool link settings ops for integrated PCS

Jens Axboe <[email protected]>
block: ensure we hold a queue reference when using queue limits

Eric Dumazet <[email protected]>
mptcp: refine opt_mp_capable determination

Eric Dumazet <[email protected]>
mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req()

Eric Dumazet <[email protected]>
mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect()

Eric Dumazet <[email protected]>

    mptcp: strict validation before using mp_opt->hmac

Eric Dumazet <[email protected]>
mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN

Amadeusz Sławiński <[email protected]>
ALSA: hda: Properly setup HDMI stream

Claudiu Beznea <[email protected]>
net: phy: micrel: populate .soft_reset for KSZ9131

Horatiu Vultur <[email protected]>
net: micrel: Fix PTP frame parsing for lan8841

Chancel Liu <[email protected]>
ALSA: aloop: Introduce a function to get if access is interleaved mode

Taehee Yoo <[email protected]>
amt: do not use overwrapped cb area

Sanjuán García, Jorge <[email protected]>
net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames

Nithin Dabilpuram <[email protected]>
octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2

David Howells <[email protected]>
rxrpc: Fix use of Don't Fragment flag

Vladimir Oltean <[email protected]>
net: dsa: fix netdev_priv() dereference before check on non-DSA netdevice events

Lin Ma <[email protected]>
net: qualcomm: rmnet: fix global oob in rmnet_policy

Niklas Schnelle <[email protected]>
s390/pci: fix max size calculation in zpci_memcpy_toio()

AngeloGioacchino Del Regno <[email protected]>
ASoC: mediatek: sof-common: Add NULL check for normal_link string

Jianjun Wang <[email protected]>
PCI: mediatek-gen3: Fix translation window size calculation

Gaosheng Cui <[email protected]>
apparmor: Fix memory leak in unpack_profile()

Siddharth Vadapalli <[email protected]>
PCI: keystone: Fix race condition when initializing PHYs

Maurizio Lombardi <[email protected]>
nvmet-tcp: Fix the H2C expected PDU len calculation

Harshit Mogalapalli <[email protected]>
PCI: xilinx-xdma: Fix error code in xilinx_pl_dma_pcie_init_irq_domain()

Krzysztof Wilczyński <[email protected]>
PCI: xilinx-xdma: Fix uninitialized symbols in xilinx_pl_dma_pcie_setup_irq()

Arnd Bergmann <[email protected]>
nvme: trace: avoid memcpy overflow warning

Arnd Bergmann <[email protected]>
nvmet: re-fix tracing strncpy() warning

Shameer Kolothum <[email protected]>
hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume

Christophe JAILLET <[email protected]>
spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function

Dan Williams <[email protected]>
cxl/port: Fix missing target list lock

Ben Gainey <[email protected]>
perf db-export: Fix missing reference count get in call_path_from_sample()

Dan Carpenter <[email protected]>
cdx: Unlock on error path in rescan_store()

Dan Carpenter <[email protected]>
cdx: call of_node_put() on error path

Sam Ravnborg <[email protected]>
serial: apbuart: fix console prompt on qemu

Christoph Niedermaier <[email protected]>
serial: imx: Correct clock error message in function probe()

Chunfeng Yun <[email protected]>
usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer

Fedor Pchelkin <[email protected]>
apparmor: avoid crash when parsed profile name is empty

Fedor Pchelkin <[email protected]>
apparmor: fix possible memory leak in unpack_trans_table

Jim Harris <[email protected]>
cxl/region: fix x9 interleave typo

Ian Rogers <[email protected]>
perf stat: Fix hard coded LL miss units

Ian Rogers <[email protected]>

    perf env: Avoid recursively taking env->bpf_progs.lock

Fedor Pchelkin <[email protected]>
apparmor: free the allocated pdb objects

Christoph Hellwig <[email protected]>
nvmet-tcp: fix a missing endianess conversion in nvmet_tcp_try_peek_pdu

Maurizio Lombardi <[email protected]>
nvmet-tcp: fix a crash in nvmet_req_complete()

Maurizio Lombardi <[email protected]>
nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length

John Johansen <[email protected]>
apparmor: Fix ref count leak in task_kill

Christophe JAILLET <[email protected]>
vdpa: Fix an error handling path in eni_vdpa_probe()

Kunwu Chan <[email protected]>
power: supply: Fix null pointer dereference in smb2_probe

Jing Zhang <[email protected]>
perf vendor events: Remove UTF-8 characters from cmn.json

Ashish Mhetre <[email protected]>
iommu: Don't reserve 0-length IOVA region

Ayush Singh <[email protected]>
greybus: gb-beagleplay: Remove use of pad bytes

Andrzej Pietrasiewicz <[email protected]>
usb: gadget: webcam: Make g_webcam loadable again

Nícolas F. R. A. Prado <[email protected]>
spmi: mtk-pmif: Serialize PMIF status check and command submission

Rob Herring <[email protected]>
cdx: Explicitly include correct DT includes, again

Douglas Anderson <[email protected]>
usb: core: Fix crash w/ usb_choose_configuration() if no driver

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: qrb5165-rb5: use u16 for DP altmode svid

Oliver Neukum <[email protected]>
usb: cdc-acm: return correct error code on unsupported break

Manivannan Sadhasivam <[email protected]>
PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()

Manivannan Sadhasivam <[email protected]>
bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs

Manivannan Sadhasivam <[email protected]>
bus: mhi: ep: Use slab allocator where applicable

Manivannan Sadhasivam <[email protected]>
bus: mhi: ep: Do not allocate event ring element on stack

Namhyung Kim <[email protected]>
perf unwind-libunwind: Fix base address for .eh_frame

Namhyung Kim <[email protected]>
perf unwind-libdw: Handle JIT-generated DSOs properly

Namhyung Kim <[email protected]>
perf genelf: Set ELF program header addresses properly

Yicong Yang <[email protected]>
perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event()

Yicong Yang <[email protected]>
perf header: Fix one memory leakage in perf_event__fprintf_event_update()

Nuno Sa <[email protected]>
iio: adc: ad9467: fix scale setting

Nuno Sa <[email protected]>
iio: adc: ad9467: add mutex to struct ad9467_state

Nuno Sa <[email protected]>
iio: adc: ad9467: don't ignore error codes

Nuno Sa <[email protected]>
iio: adc: ad9467: fix reset gpio handling

Zhao Mengmeng <[email protected]>
selftests/sgx: Skip non X86_64 platform

Jo Van Bulck <[email protected]>
selftests/sgx: Include memory clobber for inline asm in test enclave

Jo Van Bulck <[email protected]>
selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry

Jo Van Bulck <[email protected]>
selftests/sgx: Fix uninitialized pointer dereference in error path

Paul Geurts <[email protected]>
serial: imx: fix tx statemachine deadlock

Sakari Ailus <[email protected]>
software node: Let args be NULL in software_node_get_reference_args

Sakari Ailus <[email protected]>
acpi: property: Let args be NULL in __acpi_node_get_property_reference

Gregory Price <[email protected]>
base/node.c: initialize the accessor list before registering

Ian Rogers <[email protected]>
perf stat: Exit perf stat if parse groups fails

Kan Liang <[email protected]>
perf mem: Fix error on hybrid related to availability of mem event in a PMU

Athira Rajeev <[email protected]>
perf vendor events powerpc: Update datasource event name to fix duplicate events

Ilkka Koskinen <[email protected]>
perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT

Brett Creeley <[email protected]>
vfio/pds: Fix calculations in pds_vfio_dirty_sync

Veronika Molnarova <[email protected]>
perf test record user-regs: Fix mask for vg register

Douglas Anderson <[email protected]>
r8152: Choose our USB config with choose_configuration() rather than probe()

Douglas Anderson <[email protected]>
usb: core: Allow subclassed USB drivers to override usb_choose_configuration()

Umang Jain <[email protected]>
staging: vc04_services: Do not pass NULL to vchiq_log_error()

Umang Jain <[email protected]>
staging: vc04_services: vchiq_core: Log through struct vchiq_instance

Arnaldo Carvalho de Melo <[email protected]>
libapi: Add missing linux/types.h header to get the __u64 type on io.h

Adrian Hunter <[email protected]>
perf header: Fix segfault on build_mem_topology() error path

Nick Forrington <[email protected]>
perf test: Remove atomics from test_loop to avoid test failures

Laurentiu Tudor <[email protected]>
iommu: Map reserved memory as cacheable if device is coherent

Uwe Kleine-König <[email protected]>
serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed

Andy Shevchenko <[email protected]>
PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()

Su Hui <[email protected]>
power: supply: bq256xx: fix some problem in bq256xx_hw_init

Jan Palus <[email protected]>
power: supply: cw2015: correct time_to_empty units in sysfs

Christophe JAILLET <[email protected]>
MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup()

Christophe JAILLET <[email protected]>
MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup()

Ankit Nautiyal <[email protected]>
drm/i915/dp: Fix the max DSC bpc supported by source

Frederik Haxel <[email protected]>
riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro

Alexandre Ghiti <[email protected]>
riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC

Alexandre Ghiti <[email protected]>
riscv: Fix module_alloc() that did not reset the linear mapping permissions

Alexandre Ghiti <[email protected]>
riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping

Alexandre Ghiti <[email protected]>
riscv: Check if the code to patch lies in the exit section

Vincent Whitchurch <[email protected]>
um: virt-pci: fix platform map offset

Serge Semin <[email protected]>
mips: Fix incorrect max_low_pfn adjustment

Serge Semin <[email protected]>
mips: dmi: Fix early remap on MIPS32

Sebastian Andrzej Siewior <[email protected]>
srcu: Use try-lock lockdep annotation for NMI-safe access.

Andy Shevchenko <[email protected]>
mfd: intel-lpss: Fix the fractional clock divider flags

Kunwu Chan <[email protected]>
mfd: tps6594: Add null pointer check to tps6594_device_init()

Martin Kurbanov <[email protected]>

    leds: aw200xx: Fix write to DIM parameter

Dang Huynh <[email protected]>
leds: aw2013: Select missing dependency REGMAP_I2C

Paul E. McKenney <[email protected]>
rcu: Restrict access to RCU CPU stall notifiers

Kunwu Chan <[email protected]>
mfd: syscon: Fix null pointer dereference in of_syscon_register()

Charles Keepax <[email protected]>
mfd: cs42l43: Correct SoundWire port list

Neil Armstrong <[email protected]>
mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO

Randy Dunlap <[email protected]>
ARM: 9330/1: davinci: also select PINCTRL

Hugo Villeneuve <[email protected]>
serial: sc16is7xx: set safe default SPI clock frequency

Hugo Villeneuve <[email protected]>
serial: sc16is7xx: add check for unsupported SPI modes during probe

Jason Gerecke <[email protected]>

    HID: wacom: Correct behavior when processing some confidence == false touches

Yauhen Kharuzhy <[email protected]>
HID: sensor-hub: Enable hid core report processing for all devices

Marcelo Schmitt <[email protected]>
iio: adc: ad7091r: Pass iio_dev to event handler

Sean Christopherson <[email protected]>
KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing

Sean Christopherson <[email protected]>
KVM: x86/pmu: Move PMU reset logic to common x86 code

Oliver Upton <[email protected]>
KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache

Marc Zyngier <[email protected]>
KVM: arm64: vgic-v4: Restore pending state on host userspace write

Kirill A. Shutemov <[email protected]>
x86/kvm: Do not try to disable kvmclock if it was not enabled

Manivannan Sadhasivam <[email protected]>
ARM: dts: qcom: sdx55: Fix the base address of PCIe PHY

qizhong cheng <[email protected]>
PCI: mediatek: Clear interrupt status before dispatching handler

Niklas Cassel <[email protected]>
PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support

Bjorn Helgaas <[email protected]>
x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS

Tadeusz Struk <[email protected]>
PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()

Huang Ying <[email protected]>
cxl/port: Fix decoder initialization when nr_targets > interleave_ways

Christian König <[email protected]>
drm/amdgpu: revert "Adjust removal control flow for smu v13_0_2"

Sean Christopherson <[email protected]>
Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB"

Nicolas Dichtel <[email protected]>
Revert "net: rtnetlink: Enslave device before bringing it up"

Romain Gantois <[email protected]>
net: stmmac: Prevent DSA tags from breaking COE

Petr Tesarik <[email protected]>
net: stmmac: fix ethtool per-queue statistics

David Lin <[email protected]>
wifi: mwifiex: fix uninitialized firmware_stat

David Lin <[email protected]>
wifi: mwifiex: configure BSSID consistently when starting AP

David Lin <[email protected]>
wifi: mwifiex: add extra delay for firmware ready

Ilpo Järvinen <[email protected]>
wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors

Ilpo Järvinen <[email protected]>
wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code

Christian Marangi <[email protected]>
wifi: mt76: fix broken precal loading from MTD for mt7915

Isaac J. Manjarres <[email protected]>
iommu/dma: Trace bounce buffer usage when mapping buffers

Rob Clark <[email protected]>
iommu/arm-smmu-qcom: Add missing GMU entry to match table

Aurelien Jarno <[email protected]>
media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c)

Jiri Olsa <[email protected]>
bpf: Fix re-attachment branch in bpf_tracing_prog_attach

Gui-Dong Han <[email protected]>
Bluetooth: Fix atomicity violation in {min,max}_key_size_set

Stefan Berger <[email protected]>
rootfs: Fix support for rootfstype= when root= is given

Bart Van Assche <[email protected]>
md/raid1: Use blk_opf_t for read and write operations

Uwe Kleine-König <[email protected]>
pwm: Fix out-of-bounds access in of_pwm_single_xlate()

Uwe Kleine-König <[email protected]>

    pwm: jz4740: Don't use dev_err_probe() in .request()

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: check if catch-all set element is active in next generation

Matthew Wilcox (Oracle) <[email protected]>
block: Fix iterating over an empty bio with bio_for_each_folio_all

Matthew Wilcox (Oracle) <[email protected]>
block: Remove special-casing of compound pages

Min Li <[email protected]>
block: add check that partition length needs to be aligned with block size

Mario Limonciello <[email protected]>
drm/amd: Enable PCIe PME from D3

Yu Kuai <[email protected]>
md: Fix md_seq_ops() regressions

Junxiao Bi <[email protected]>
md: bypass block throttle for superblock update

Chandrakanth patil <[email protected]>
scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State

Chandrakanth patil <[email protected]>
scsi: mpi3mr: Clean up block devices post controller reset

Chandrakanth patil <[email protected]>
scsi: mpi3mr: Refresh sdev queue depth after controller reset

Amir Goldstein <[email protected]>
scsi: target: core: add missing file_{start,end}_write()

Bart Van Assche <[email protected]>
scsi: ufs: core: Simplify power management during async scan

Nam Cao <[email protected]>
fbdev: flush deferred IO before closing

Nam Cao <[email protected]>
fbdev: flush deferred work in fb_deferred_io_fsync()

Thomas Zimmermann <[email protected]>
fbdev/acornfb: Fix name of fb_ops initializer macro

Jens Axboe <[email protected]>
io_uring: ensure local task_work is run on wait timeout

Jens Axboe <[email protected]>

    io_uring/rw: ensure io->bytes_done is always initialized

Pavel Begunkov <[email protected]>
io_uring: don't check iopoll if request completes

Xi Ruoyao <[email protected]>
LoongArch: Fix and simplify fcsr initialization on execve()

Eric Biggers <[email protected]>
ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION

Namjae Jeon <[email protected]>
ksmbd: only v2 leases handle the directory

Namjae Jeon <[email protected]>
ksmbd: fix UAF issue in ksmbd_tcp_new_connection()

Namjae Jeon <[email protected]>
ksmbd: validate mech token in session setup

Bin Li <[email protected]>
ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5

Yo-Jung Lin <[email protected]>
ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook

Çağhan Demir <[email protected]>
ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx

Takashi Iwai <[email protected]>
ALSA: oxygen: Fix right channel of capture volume mixer

Lino Sanfilippo <[email protected]>
serial: omap: do not override settings for RS485 support

Lino Sanfilippo <[email protected]>
serial: 8250_exar: Set missing rs485_supported flag

Christoph Niedermaier <[email protected]>
serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock

Lino Sanfilippo <[email protected]>
serial: core, imx: do not set RS485 enabled if it is not supported

Stefan Wahren <[email protected]>
serial: 8250_bcm2835aux: Restore clock error handling

Lino Sanfilippo <[email protected]>
serial: core: set missing supported flag for RX during TX GPIO

Lino Sanfilippo <[email protected]>
serial: core: make sure RS485 cannot be enabled when it is not supported

Lino Sanfilippo <[email protected]>
serial: core: fix sanitizing check for RTS settings

Lino Sanfilippo <[email protected]>
serial: Do not hold the port lock when setting rx-during-tx GPIO

Krzysztof Kozlowski <[email protected]>

    dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header

Gui-Dong Han <[email protected]>
usb: mon: Fix atomicity violation in mon_bin_vma_fault

RD Babiera <[email protected]>
usb: typec: class: fix typec_altmode_put_partner to put plugs

Heikki Krogerus <[email protected]>
Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"

Frank Li <[email protected]>
usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled

Frank Li <[email protected]>
usb: cdns3: fix iso transfer error when mult is not zero

Frank Li <[email protected]>
usb: cdns3: fix uvc failure work since sg support enabled

Xu Yang <[email protected]>
usb: chipidea: wait controller resume finished for wakeup irq

Thinh Nguyen <[email protected]>
Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only"

Thinh Nguyen <[email protected]>
Revert "usb: dwc3: Soft reset phy on probe for host"

Wesley Cheng <[email protected]>
usb: dwc3: gadget: Queue PM runtime idle on disconnect event

Wesley Cheng <[email protected]>
usb: dwc3: gadget: Handle EP0 request dequeuing properly

Uttkarsh Aggarwal <[email protected]>
usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart

Xu Yang <[email protected]>
usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host()

Richard Acayan <[email protected]>
usb: gadget: u_ether: Re-attach netif device to mirror detachment

Frank Li <[email protected]>
Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()"

Heiko Carstens <[email protected]>
tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug

Michael Ellerman <[email protected]>
powerpc/64s: Increase default stack size to 32KB

Arnd Bergmann <[email protected]>
clocksource/drivers/ep93xx: Fix error handling during probe

Inochi Amaoto <[email protected]>
dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

Tony Lindgren <[email protected]>
clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings

Carlos Llamas <[email protected]>
binder: fix race between mmput() and do_exit()

Jan Beulich <[email protected]>
xen-netback: don't produce zero-size SKB frags

Kaibo Ma <[email protected]>
Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole"

Matthew Maurer <[email protected]>
rust: Ignore preserve-most functions

Hans de Goede <[email protected]>
Input: atkbd - use ab83 as id when skipping the getid command

Carlos Llamas <[email protected]>

    binder: fix unused alloc->free_async_space

Carlos Llamas <[email protected]>
binder: fix async space check for 0-sized buffers

Jordan Rome <[email protected]>
selftests/bpf: Add assert for user stacks in test_task_stack

Tejun Heo <[email protected]>
Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock"

Andrea Righi <[email protected]>
kernfs: convert kernfs_idr_lock to an irq safe raw spinlock

Jing Xia <[email protected]>
class: fix use-after-free in class_register()

Geert Uytterhoeven <[email protected]>
of: unittest: Fix of_count_phandle_with_args() expected value message

Dario Binacchi <[email protected]>
fbdev: imxfb: fix left margin setting

Christian A. Ehrhardt <[email protected]>
of: Fix double free in of_parse_phandle_with_args_map

Li Nan <[email protected]>
ksmbd: validate the zero field of packet header

Mirsad Todorovac <[email protected]>
kselftest/alsa - conf: Stringify the printed errno in sysfs_get()

Mirsad Todorovac <[email protected]>
kselftest/alsa - mixer-test: Fix the print format specifier warning

Mirsad Todorovac <[email protected]>
kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()

Arnd Bergmann <[email protected]>
drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings()

Zhipeng Lu <[email protected]>
drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init

Srinivasan Shanmugam <[email protected]>
drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c

Sergey Gorenko <[email protected]>
IB/iser: Prevent invalidating wrong MR

Srinivasan Shanmugam <[email protected]>
drm/amdkfd: Fix type of 'dbg_flags' in 'struct kfd_process'

Peter Robinson <[email protected]>
mmc: sdhci_omap: Fix TI SoC dependencies

Peter Robinson <[email protected]>
mmc: sdhci_am654: Fix TI SoC dependencies

Geoffrey D. Bennett <[email protected]>
ALSA: scarlett2: Add missing mutex lock around get meter levels

Geoffrey D. Bennett <[email protected]>
ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put()

Geoffrey D. Bennett <[email protected]>
ALSA: scarlett2: Add missing error checks to *_ctl_get()

Geoffrey D. Bennett <[email protected]>
ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config()

Geoffrey D. Bennett <[email protected]>
ALSA: scarlett2: Add missing error check to scarlett2_config_save()

Hans de Goede <[email protected]>

    ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[]

Philipp Zabel <[email protected]>
pwm: stm32: Fix enable count for clk in .probe()

Philipp Zabel <[email protected]>
pwm: stm32: Use hweight32 in stm32_pwm_detect_channels

Théo Lebrun <[email protected]>
clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw

Konrad Dybcio <[email protected]>
clk: qcom: dispcc-sm8550: Use the correct PLL configuration function

Konrad Dybcio <[email protected]>
clk: qcom: dispcc-sm8550: Update disp PLL settings

Konrad Dybcio <[email protected]>
clk: qcom: gpucc-sm8550: Update GPU PLL settings

Konrad Dybcio <[email protected]>
clk: qcom: gcc-sm8550: Mark RCGs shared where applicable

Konrad Dybcio <[email protected]>
clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs

Konrad Dybcio <[email protected]>
clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable

Konrad Dybcio <[email protected]>
clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag

Xingyuan Mo <[email protected]>
accel/habanalabs: fix information leak in sec_attest_info()

Nícolas F. R. A. Prado <[email protected]>
drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency

Gergo Koteles <[email protected]>

    ASoC: tas2781: add support for FW version 0x0503

Cristian Ciocaltea <[email protected]>
ASoC: amd: vangogh: Drop conflicting ACPI-based probing

Su Hui <[email protected]>
clk: si5341: fix an error code problem in si5341_output_clk_set_rate

Marek Vasut <[email protected]>
clk: rs9: Fix DIF OEn bit placement on 9FGV0241

Vignesh Raghavendra <[email protected]>
watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused

Stefan Wahren <[email protected]>
watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling

Jerry Hoemann <[email protected]>
watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO

Curtis Klein <[email protected]>
watchdog: set cdev owner before adding

Jay Buddhabhatti <[email protected]>
drivers: clk: zynqmp: update divider round rate logic

Jay Buddhabhatti <[email protected]>
drivers: clk: zynqmp: calculate closest mux rate

Yang Yingliang <[email protected]>
clk: sp7021: fix return value check in sp7021_clk_probe()

Satya Priya Kakitapalli <[email protected]>
clk: qcom: videocc-sm8150: Add missing PLL config property

Zhiguo Niu <[email protected]>
f2fs: fix to check return value of f2fs_recover_xattr_data

Zhipeng Lu <[email protected]>
drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table

Zhipeng Lu <[email protected]>
gpu/drm/radeon: fix two memleaks in radeon_vm_init

Zhipeng Lu <[email protected]>
drivers/amd/pm: fix a use-after-free in kv_parse_power_table

Zhipeng Lu <[email protected]>
drm/amd/pm: fix a double-free in si_dpm_init

Alex Deucher <[email protected]>
drm/amdgpu/debugfs: fix error code when smc register accessors are NULL

Hsiao Chien Sung <[email protected]>
drm/mediatek: Fix underrun in VDO1 when switches off the layer

Hsiao Chien Sung <[email protected]>
drm/mediatek: Remove the redundant driver data for DPI

Hsiao Chien Sung <[email protected]>
drm/mediatek: Return error if MDP RDMA failed to enable the clock

Arnd Bergmann <[email protected]>
media: i2c: mt9m114: use fsleep() in place of udelay()

Jessica Zhang <[email protected]>
drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()

Jessica Zhang <[email protected]>
drm/msm/dpu: Set input_sel bit for INTF

Claudiu Beznea <[email protected]>
clk: renesas: rzg2l: Check reset monitor registers

Claudiu Beznea <[email protected]>
clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset()

Christophe JAILLET <[email protected]>
media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe()

Dan Carpenter <[email protected]>
media: dvbdev: drop refcount on error path in dvb_device_open()

Chao Yu <[email protected]>
f2fs: fix to update iostat correctly in f2fs_filemap_fault()

Chao Yu <[email protected]>
f2fs: fix to check compress file in f2fs_move_file_range()

Chao Yu <[email protected]>
f2fs: fix to wait on block writeback for post_read case

Chris Morgan <[email protected]>
drm/panel: st7701: Fix AVCL calculation

Bjorn Andersson <[email protected]>
drm/msm/adreno: Fix A680 chip id

Tomi Valkeinen <[email protected]>
media: rkisp1: Fix memory leaks in rkisp1_isp_unregister()

Tomi Valkeinen <[email protected]>
media: rkisp1: Fix media device memory leak

Mehdi Djait <[email protected]>
media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface

Tomi Valkeinen <[email protected]>
media: imx-mipi-csis: Drop extra clock enable at probe()

Tomi Valkeinen <[email protected]>
media: imx-mipi-csis: Fix clock handling in remove()

Hans Verkuil <[email protected]>
media: videobuf2: request more buffers for vb2_read

Hans Verkuil <[email protected]>
media: bttv: add back vbi hack

Hans Verkuil <[email protected]>
media: bttv: start_streaming should return a proper error code

Daniel Rosenberg <[email protected]>
f2fs: Restrict max filesize for 16K f2fs

Satya Priya Kakitapalli <[email protected]>
clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config

Chengchang Tang <[email protected]>
RDMA/hns: Fix memory leak in free_mr_init()

Pierre-Louis Bossart <[email protected]>
ASoC: SOF: Intel: pci-mtl: fix ARL-S definitions

Zhipeng Lu <[email protected]>
media: cx231xx: fix a memleak in cx231xx_init_isoc

Tomi Valkeinen <[email protected]>
drm/bridge: tc358767: Fix return value on error case

Tomi Valkeinen <[email protected]>
drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable

Zhipeng Lu <[email protected]>
drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table

Zhipeng Lu <[email protected]>
drm/radeon/dpm: fix a memleak in sumo_parse_power_table

Yang Yingliang <[email protected]>
drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()

Alex Hung <[email protected]>
drm/amd/display: Check writeback connectors in create_validate_stream_for_sink

Harry Wentland <[email protected]>
drm/amd/display: Use drm_connector in create_stream_for_sink

Harry Wentland <[email protected]>
drm/amd/display: Return drm_connector from find_first_crtc_matching_connector

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: correct clk bit for WB2 block

AngeloGioacchino Del Regno <[email protected]>
drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: populate SSPP scaler block version

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: enable SmartDMA on SM8450

Bard Liao <[email protected]>
ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget

Bard Liao <[email protected]>

    ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL

Brent Lu <[email protected]>
ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch

Sebastian Reichel <[email protected]>
media: v4l: async: Fix duplicated list deletion

Dmitry Baryshkov <[email protected]>
drm/drv: propagate errors from drm_modeset_register_all()

Konrad Dybcio <[email protected]>
drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks

Bjorn Andersson <[email protected]>

    drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog

Dmitry Baryshkov <[email protected]>
drm/msm/mdp4: flush vblank event on disable

Arnd Bergmann <[email protected]>
drm/msm/a6xx: add QMP dependency

Linus Walleij <[email protected]>
ASoC: cs35l34: Fix GPIO name and drop legacy include

Linus Walleij <[email protected]>
ASoC: cs35l33: Fix GPIO name and drop legacy include

Uwe Kleine-König <[email protected]>
drm/imx/lcdc: Fix double-free of driver data

Tomi Valkeinen <[email protected]>
drm/tidss: Fix dss reset

Tomi Valkeinen <[email protected]>
drm/tidss: Check for K2G in in dispc_softreset()

Tomi Valkeinen <[email protected]>
drm/tidss: Return error value from from softreset

Tomi Valkeinen <[email protected]>
drm/tidss: Move reset to the end of dispc_init()

Mario Limonciello <[email protected]>
drm/amd/display: Fix NULL pointer dereference at hibernate

Nikita Zhandarovich <[email protected]>
drm/radeon: check return value of radeon_ring_lock()

Nikita Zhandarovich <[email protected]>
drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()

Nikita Zhandarovich <[email protected]>
drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg()

Arnd Bergmann <[email protected]>
ASoC: fsl_rpmsg: update Kconfig dependencies

Thomas Zimmermann <[email protected]>
fbdev/sm712fb: Use correct initializer macros for struct fb_ops

Xin Ji <[email protected]>
Revert "drm/bridge: Add 200ms delay to wait FW HPD status stable"

Chao Yu <[email protected]>
f2fs: fix to avoid dirent corruption

Liu Ying <[email protected]>
drm/bridge: imx93-mipi-dsi: Fix a couple of building warnings

Dario Binacchi <[email protected]>
drm/bridge: Fix typo in post_disable() description

Luben Tuikov <[email protected]>
drm/sched: Fix bounds limiting when given a malformed entity

Alexander Stein <[email protected]>
media: amphion: Fix VPU core alias name

Paul Kocialkowski <[email protected]>
media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls

Paul Kocialkowski <[email protected]>
media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls

Paul Kocialkowski <[email protected]>
media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls

Zheng Wang <[email protected]>
media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices

Ricardo B. Marliere <[email protected]>
media: pvrusb2: fix use after free on context disconnection

Tomi Valkeinen <[email protected]>
drm/tilcdc: Fix irq free on unload

Uwe Kleine-König <[email protected]>
drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function

Abhinav Singh <[email protected]>
drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer

Chris Morgan <[email protected]>
drm/panel-elida-kd35t133: hold panel in reset for unprepare

Chris Morgan <[email protected]>
drm/panel: nv3051d: Hold panel in reset for unprepare

Junxian Huang <[email protected]>
RDMA/hns: Fix inappropriate err code for unsupported operations

Leon Romanovsky <[email protected]>
RDMA/usnic: Silence uninitialized symbol smatch warnings

AngeloGioacchino Del Regno <[email protected]>
drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()

Ville Syrjälä <[email protected]>
drm/dp_mst: Fix fractional DSC bpp handling

Jouni Högander <[email protected]>
drm/i915/display: Move releasing gem object away from fb tracking

Tomi Valkeinen <[email protected]>
Revert "drm/omapdrm: Annotate dma-fence critical section in commit path"

Tomi Valkeinen <[email protected]>
Revert "drm/tidss: Annotate dma-fence critical section in commit path"

Arnd Bergmann <[email protected]>
ARM: davinci: always select CONFIG_CPU_ARM926T

Eric Dumazet <[email protected]>
ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim()

David Howells <[email protected]>
rxrpc: Fix skbuff cleanup of call's recvmsg_queue and rx_oos_queue

Asmaa Mnebhi <[email protected]>
mlxbf_gige: Enable the GigE port in mlxbf_gige_open

Asmaa Mnebhi <[email protected]>
mlxbf_gige: Fix intermittent no ip issue

Tao Liu <[email protected]>
net/sched: act_ct: fix skb leak and crash on ooo frags

Ming Lei <[email protected]>
blk-cgroup: fix rcu lockdep warning in blkg_lookup()

Ilya Leoshkevich <[email protected]>
s390/bpf: Fix gotol with large offsets

Eric Dumazet <[email protected]>
sctp: fix busy polling

Eric Dumazet <[email protected]>
sctp: support MSG_ERRQUEUE flag in recvmsg()

John Fastabend <[email protected]>
bpf: sockmap, fix proto update hook to avoid dup calls

Benjamin Berg <[email protected]>
wifi: cfg80211: parse all ML elements in an ML probe response

Benjamin Berg <[email protected]>
wifi: cfg80211: correct comment about MLD ID

Kunwu Chan <[email protected]>
ice: Fix some null pointer dereference issues in ice_ptp.c

Andy Yan <[email protected]>
arm64: dts: rockchip: Fix led pinctrl of lubancat 1

Christoph Hellwig <[email protected]>
null_blk: don't cap max_hw_sectors to BLK_DEF_MAX_SECTORS

Francesco Dolcini <[email protected]>
Bluetooth: btmtkuart: fix recv_buf() return value

Francesco Dolcini <[email protected]>
Bluetooth: btnxpuart: fix recv_buf() return value

Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix bogus check for re-auth no supported with non-ssp

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: validate chain type update if available

Florian Westphal <[email protected]>
netfilter: nf_tables: mark newset as dead on transaction abort

Miri Korenblit <[email protected]>
wifi: iwlwifi: assign phy_ctxt before eSR activation

Anjaneyulu <[email protected]>
wifi: iwlwifi: fix out of bound copy_from_user

Ilan Peer <[email protected]>
wifi: iwlwifi: mvm: Do not warn if valid link pair was not found

Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: send TX path flush in rfkill

Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request

Ayala Beker <[email protected]>
wifi: mac80211: fix advertised TTLM scheduling

Su Hui <[email protected]>
wifi: rtlwifi: rtl8192se: using calculate_bit_shift()

Su Hui <[email protected]>
wifi: rtlwifi: rtl8192ee: using calculate_bit_shift()

Su Hui <[email protected]>
wifi: rtlwifi: rtl8192de: using calculate_bit_shift()

Su Hui <[email protected]>
wifi: rtlwifi: rtl8192ce: using calculate_bit_shift()

Su Hui <[email protected]>
wifi: rtlwifi: rtl8192cu: using calculate_bit_shift()

Su Hui <[email protected]>
wifi: rtlwifi: rtl8192c: using calculate_bit_shift()

Su Hui <[email protected]>
wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift()

Su Hui <[email protected]>
wifi: rtlwifi: add calculate_bit_shift()

Hou Tao <[email protected]>

    bpf: Use c->unit_size to select target cache during free

Konrad Dybcio <[email protected]>

    arm64: dts: qcom: sc8180x: Fix up PCIe nodes

Konrad Dybcio <[email protected]>

    arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent

Konrad Dybcio <[email protected]>
arm64: dts: qcom: sm8550: Update idle state time requirements

Konrad Dybcio <[email protected]>
arm64: dts: qcom: sm8550: Separate out X3 idle state

Chukun Pan <[email protected]>
arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK

Konrad Dybcio <[email protected]>
arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent

Li Nan <[email protected]>
block: add check of 'minors' and 'first_minor' in device_add_disk()

Abel Vesa <[email protected]>
soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset

Bartosz Golaszewski <[email protected]>
firmware: qcom: qseecom: fix memory leaks in error paths

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8150-hdk: fix SS USB regulators

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX

Konrad Dybcio <[email protected]>

    arm64: dts: qcom: sm6375: Hook up MPM

Johan Hovold <[email protected]>
arm64: dts: qcom: sm6375: fix USB wakeup interrupt types

Atul Dhudase <[email protected]>
soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration

Nikita Travkin <[email protected]>
arm64: dts: qcom: acer-aspire1: Correct audio codec definition

Hou Tao <[email protected]>
bpf: Limit the number of kprobes when attaching program to multiple kprobes

Hou Tao <[email protected]>
bpf: Limit the number of uprobes when attaching program to multiple uprobes

Joakim Zhang <[email protected]>

    dma-mapping: clear dev->dma_mem to NULL after freeing it

Arseniy Krasnov <[email protected]>
virtio/vsock: send credit update during setting SO_RCVLOWAT

Arseniy Krasnov <[email protected]>
virtio/vsock: fix logic which reduces credit update messages

Leone Fernando <[email protected]>
ipmr: support IP_PKTINFO on cache report IGMP msg

Hangbin Liu <[email protected]>
selftests/net: fix grep checking for fib_nexthop_multiprefix

Yonghong Song <[email protected]>
bpf: Fix a race condition between btf_put() and map_free()

Ahmad Fatoum <[email protected]>
ARM: dts: stm32: don't mix SCMI and non-SCMI board compatibles

Tushar Vyavahare <[email protected]>
selftests/xsk: Fix for SEND_RECEIVE_UNALIGNED test

Yihang Li <[email protected]>
scsi: hisi_sas: Correct the number of global debugfs registers

Yihang Li <[email protected]>
scsi: hisi_sas: Rollback some operations if FLR failed

Yihang Li <[email protected]>
scsi: hisi_sas: Check before using pointer variables

Yihang Li <[email protected]>
scsi: hisi_sas: Replace with standard error code return value

Manivannan Sadhasivam <[email protected]>
scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails

Manivannan Sadhasivam <[email protected]>
scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key()

Adam Ford <[email protected]>
arm64: dts: imx8mm: Reduce GPU to nominal speed

Geert Uytterhoeven <[email protected]>
arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control

Rob Herring <[email protected]>
arm64: dts: xilinx: Apply overlays to base dtbs

Li Nan <[email protected]>
block: Set memalloc_noio to false on device_add_disk() error path

YiFei Zhu <[email protected]>
selftests/bpf: Relax time_tai test for equal timestamps in tai_forward

Miri Korenblit <[email protected]>
wifi: iwlwifi: don't support triggered EHT CQI feedback

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7921: fix wrong 6Ghz power type

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7921: fix CLC command timeout when suspend/resume

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7921: fix country count limitation for CLC

Eugen Hristev <[email protected]>
arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0

Moudy Ho <[email protected]>
arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name

Moudy Ho <[email protected]>
arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes

Moudy Ho <[email protected]>
dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names

Tiezhu Yang <[email protected]>
test_bpf: Rename second ALU64_SMOD_X to ALU64_SMOD_K

Andrei Matei <[email protected]>
bpf: Fix accesses to uninit stack slots

Andrei Matei <[email protected]>
bpf: Guard stack limits against 32bit overflow

Johan Hovold <[email protected]>
arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties

Andrei Matei <[email protected]>
bpf: Fix verification of indirect var-off stack access

Wang Zhao <[email protected]>
wifi: mt76: mt7921s: fix workqueue problem causes STA association fail

Arnd Bergmann <[email protected]>

    wifi: mt76: mt7996: fix mt7996_mcu_all_sta_info_event struct packing

StanleyYP Wang <[email protected]>

    wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band

StanleyYP Wang <[email protected]>
wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981

StanleyYP Wang <[email protected]>
wifi: mt76: mt7996: fix alignment of sta info event

MeiChia Chiu <[email protected]>
wifi: mt76: mt7996: fix rate usage of inband discovery frames

Sujuan Chen <[email protected]>
wifi: mt76: mt7996: fix the size of struct bss_rate_tlv

Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()

Christian Marangi <[email protected]>
wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function

Yi-Chia Hsieh <[email protected]>
wifi: mt76: mt7996: fix uninitialized variable in parsing txfree

Johan Hovold <[email protected]>
arm64: dts: qcom: sm8550: fix USB wakeup interrupt types

Johan Hovold <[email protected]>
arm64: dts: qcom: sc7280: fix usb_2 wakeup interrupt types

Johan Hovold <[email protected]>
arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types

Konrad Dybcio <[email protected]>
arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent

Konrad Dybcio <[email protected]>
arm64: dts: qcom: sc7280: Fix up GPU SIDs

Nia Espera <[email protected]>

    arm64: dts: qcom: sm8350: Fix DMA0 address

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sdm845-db845c: correct LED panic indicator

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator

Caleb Connolly <[email protected]>
arm64: dts: qcom: qrb2210-rb1: use USB host mode

Artem Chernyshev <[email protected]>
scsi: fnic: Return error if vmalloc() failed

Andrii Nakryiko <[email protected]>
bpf: fix check for attempt to corrupt spilled pointer

Hangbin Liu <[email protected]>
selftests/net: specify the interface when do arping

Hou Tao <[email protected]>
bpf: Defer the free of inner map when necessary

Hou Tao <[email protected]>
bpf: Add map and need_defer parameters to .map_fd_put_ptr()

Douglas Anderson <[email protected]>
arm64: dts: qcom: sm6350: Make watchdog bark interrupt edge triggered

Douglas Anderson <[email protected]>

    arm64: dts: qcom: sc8280xp: Make watchdog bark interrupt edge triggered

Douglas Anderson <[email protected]>
arm64: dts: qcom: sa8775p: Make watchdog bark interrupt edge triggered

Douglas Anderson <[email protected]>
arm64: dts: qcom: sm8250: Make watchdog bark interrupt edge triggered

Douglas Anderson <[email protected]>
arm64: dts: qcom: sm8150: Make watchdog bark interrupt edge triggered

Douglas Anderson <[email protected]>
arm64: dts: qcom: sdm845: Make watchdog bark interrupt edge triggered

Douglas Anderson <[email protected]>
arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered

Douglas Anderson <[email protected]>
arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8550: correct TX Soundwire clock

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8450: correct TX Soundwire clock

Bjorn Andersson <[email protected]>

    arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity

Stephen Boyd <[email protected]>
dt-bindings: arm: qcom: Fix html link

Krzysztof Kozlowski <[email protected]>
ARM: dts: qcom: sdx65: correct SPMI node name

Krzysztof Kozlowski <[email protected]>
ARM: dts: qcom: sdx65: correct PCIe EP phy-names

Andrii Nakryiko <[email protected]>
bpf: enforce precision of R0 on callback return

Yu Kuai <[email protected]>
md: synchronize flush io with array reconfiguration

Jeroen van Ingen Schenau <[email protected]>
selftests/bpf: Fix erroneous bitmask operation

Martin Blumenstingl <[email protected]>
wifi: rtw88: sdio: Honor the host max_req_size in the RX path

Jan Kiszka <[email protected]>

    arm64: dts: ti: iot2050: Re-add aliases

Tomi Valkeinen <[email protected]>
arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type

Nitin Yadav <[email protected]>
arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes

Su Hui <[email protected]>
wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior

Karthikeyan Periyasamy <[email protected]>
wifi: ath12k: fix the error handler of rfkill config

Bart Van Assche <[email protected]>
scsi: bfa: Use the proper data type for BLIST flags

Christophe JAILLET <[email protected]>
firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()

Peter Delevoryas <[email protected]>
net/ncsi: Fix netlink major/minor version numbers

Justin Tee <[email protected]>
scsi: lpfc: Fix list_entry null check warning in lpfc_cmpl_els_plogi()

Dmitry Baryshkov <[email protected]>
ARM: dts: qcom: apq8064: correct XOADC register address

Arnd Bergmann <[email protected]>
wifi: libertas: stop selecting wext

Luca Weiss <[email protected]>
wifi: ath11k: Defer on rproc_get failure

Jordan Rome <[email protected]>
bpf: Add crosstask check to __bpf_get_stack

Dave Marchevsky <[email protected]>
bpf: Add KF_RCU flag to bpf_refcount_acquire_impl

Florian Lehner <[email protected]>
bpf, lpm: Fix check prefixlen before walking trie

Chih-Kang Chang <[email protected]>
wifi: rtw88: fix RX filter in FIF_ALLMULTI flag

Dan Carpenter <[email protected]>
wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async()

Luca Weiss <[email protected]>
ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc

Johan Hovold <[email protected]>

    arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config

Konrad Dybcio <[email protected]>

    arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible

Caleb Connolly <[email protected]>
arm64: dts: qcom: qrb4210-rb2: don't force usb peripheral mode

David McKay <[email protected]>
asm-generic: Fix 32 bit __generic_cmpxchg_local

Benjamin Coddington <[email protected]>
SUNRPC: Fixup v4.1 backchannel request timeouts

Trond Myklebust <[email protected]>
pNFS: Fix the pnfs block driver's calculation of layoutget size

Olga Kornievskaia <[email protected]>
SUNRPC: fix _xprt_switch_find_current_entry logic

Trond Myklebust <[email protected]>
NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT

Scott Mayhew <[email protected]>
NFS: Use parent's objective cred in nfs_access_login_time()

Benjamin Coddington <[email protected]>
blocklayoutdriver: Fix reference leak of pnfs_device_node

Arnd Bergmann <[email protected]>
csky: fix arch_jump_label_transform_static override

David Howells <[email protected]>
keys, dns: Fix size check of V1 server-list header

Chengming Zhou <[email protected]>

    crypto: scomp - fix req->dst buffer overflow

Ovidiu Panait <[email protected]>

    crypto: sahara - do not resize req->src when doing hash operations

Ovidiu Panait <[email protected]>

    crypto: sahara - fix processing hash requests with req->nbytes < sg->length

Ovidiu Panait <[email protected]>
crypto: sahara - improve error handling in sahara_sha_process()

Ovidiu Panait <[email protected]>
crypto: sahara - fix wait_for_completion_timeout() error handling

Ovidiu Panait <[email protected]>
crypto: sahara - fix ahash reqsize

Ovidiu Panait <[email protected]>
crypto: sahara - handle zero-length aes requests

Ovidiu Panait <[email protected]>
crypto: sahara - avoid skcipher fallback code duplication

wangyangxin <[email protected]>
crypto: virtio - Wait for tasklet to complete on device remove

Alexander Aring <[email protected]>
dlm: fix format seq ops type 4

Edward Adam Davis <[email protected]>
gfs2: fix kernel BUG in gfs2_quota_cleanup

Osama Muhammad <[email protected]>
gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump

Christian Brauner <[email protected]>
fs: indicate request originates from old mount API

Gao Xiang <[email protected]>
erofs: fix memory leak on short-lived bounced pages

Sergey Shtylyov <[email protected]>
pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()

Zhiqi Song <[email protected]>
crypto: hisilicon/zip - save capability registers in probe process

Zhiqi Song <[email protected]>
crypto: hisilicon/sec2 - save capability registers in probe process

Zhiqi Song <[email protected]>
crypto: hisilicon/hpre - save capability registers in probe process

Wenkai Lin <[email protected]>
crypto: hisilicon/qm - add a function to set qm algs

Chenghai Huang <[email protected]>
crypto: hisilicon/zip - add zip comp high perf mode configuration

Zhiqi Song <[email protected]>
crypto: hisilicon/qm - save capability registers in qm init process

Ovidiu Panait <[email protected]>
crypto: sahara - fix error handling in sahara_hw_descriptor_create()

Ovidiu Panait <[email protected]>

    crypto: sahara - fix processing requests with cryptlen < sg->length

Ovidiu Panait <[email protected]>
crypto: sahara - fix ahash selftest failure

Ovidiu Panait <[email protected]>
crypto: sahara - fix cbc selftest failure

Ovidiu Panait <[email protected]>
crypto: sahara - remove FLAGS_NEW_KEY logic

Nikita Zhandarovich <[email protected]>
crypto: safexcel - Add error handling for dma_map_sg() calls

Yang Yingliang <[email protected]>
hwrng: stm32 - add missing clk_disable_unprepare() in stm32_rng_init()

Giovanni Cabiddu <[email protected]>
crypto: qat - add NULL pointer check

Damian Muszynski <[email protected]>
crypto: qat - fix mutex ordering in adf_rl

Damian Muszynski <[email protected]>
crypto: qat - fix error path in add_update_sla()

Herbert Xu <[email protected]>
crypto: af_alg - Disallow multiple in-flight AIO requests

Dinghao Liu <[email protected]>
crypto: ccp - fix memleak in ccp_init_dm_workarea

Chen Ni <[email protected]>
crypto: sa2ul - Return crypto_aead_setkey to transfer the error

Damian Muszynski <[email protected]>
crypto: qat - add sysfs_added flag for rate limiting

Damian Muszynski <[email protected]>
crypto: qat - add sysfs_added flag for ras

Gonglei (Arei) <[email protected]>
crypto: virtio - Handle dataq logic with tasklet

Chanho Park <[email protected]>
crypto: jh7110 - Correct deferred probe return

Dan Carpenter <[email protected]>
crypto: qat - prevent underflow in rp2srv_store()

Dan Carpenter <[email protected]>
crypto: rsa - add a check for allocation failure

Mickaël Salaün <[email protected]>
selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket

Binbin Zhou <[email protected]>
drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment

Borislav Petkov (AMD) <[email protected]>
cpuidle: haltpoll: Do not enable interrupts when entering idle

ZhaoLong Wang <[email protected]>
mtd: Fix gluebi NULL pointer dereference caused by ftl notifier

Richard Fitzgerald <[email protected]>
kunit: debugfs: Handle errors from alloc_string_stream()

Richard Fitzgerald <[email protected]>
kunit: debugfs: Fix unchecked dereference in debugfs_print_results()

Rafael J. Wysocki <[email protected]>
thermal: core: Fix NULL pointer dereference in zone registration error path

Tony Luck <[email protected]>
ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error

Andy Shevchenko <[email protected]>
ACPI: LPSS: Fix the fractional clock divider flags

Wolfram Sang <[email protected]>
spi: sh-msiof: Enforce fixed DTDL for R-Car H3

Ard Biesheuvel <[email protected]>
efivarfs: Free s_fs_info on unmount

Ilias Apalodimas <[email protected]>
efivarfs: force RO when remounting if SetVariable is not supported

Gavrilov Ilia <[email protected]>
calipso: fix memory leak in netlbl_calipso_add_pass()

Alexandra Diupina <[email protected]>
cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()

David E. Box <[email protected]>
platform/x86/intel/vsec: Fix xa_alloc memory leak

Yang Yingliang <[email protected]>
spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()

Chen Ni <[email protected]>
KEYS: encrypted: Add check for strsep

Nikita Kiryushin <[email protected]>
ACPI: LPIT: Avoid u32 multiplication overflow

Nikita Kiryushin <[email protected]>
ACPI: video: check for error while searching for backlight device parent

Ronald Monthero <[email protected]>
mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response

Amit Kumar Mahapatra <[email protected]>
spi: spi-zynqmp-gqspi: fix driver kconfig dependencies

Alexander Antonov <[email protected]>
perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()

Yiwei Lin <[email protected]>
sched/fair: Update min_vruntime for reweight_entity() correctly

Kunwu Chan <[email protected]>
powerpc/imc-pmu: Add a null pointer check in update_events_in_group()

Kunwu Chan <[email protected]>
powerpc/powernv: Add a null pointer check in opal_powercap_init()

Kunwu Chan <[email protected]>
powerpc/powernv: Add a null pointer check in opal_event_init()

Kunwu Chan <[email protected]>
powerpc/powernv: Add a null pointer check to scom_debug_init_one()

Nathan Lynch <[email protected]>
powerpc/rtas: Avoid warning on invalid token argument to sys_rtas()

Kajol Jain <[email protected]>
powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function

Michael Ellerman <[email protected]>
selftests/powerpc: Fix error handling in FPU/VMX preemption tests

Nicholas Piggin <[email protected]>
KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE

Junhao He <[email protected]>
drivers/perf: hisi: Fix some event id for HiSilicon UC pmu

Robin Murphy <[email protected]>
perf/arm-cmn: Fix HN-F class_occup_id events

Borislav Petkov (AMD) <[email protected]>
x86/microcode/intel: Set new revision only after a successful update

Nathan Lynch <[email protected]>
powerpc/pseries/memhp: Fix access beyond end of drmem array

Randy Dunlap <[email protected]>
powerpc/44x: select I2C for CURRITUCK

Peter Zijlstra <[email protected]>
x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram

Jann Horn <[email protected]>
fs/pipe: Fix lockdep false-positive in watchqueue pipe_write()

Masahiro Yamada <[email protected]>
powerpc: add crtsavres.o to always-y instead of extra-y

Arnd Bergmann <[email protected]>
EDAC/thunderx: Fix possible out-of-bounds string access

Yazen Ghannam <[email protected]>
x86/mce/inject: Clear test status value

Colin Ian King <[email protected]>
x86/lib: Fix overflow when counting digits

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

Diffstat:

 Documentation/admin-guide/kernel-parameters.txt    |   6 +
 Documentation/devicetree/bindings/arm/qcom.yaml    |   2 +-
 .../devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml |   2 +-
 .../bindings/media/mediatek,mdp3-rdma.yaml         |  29 +-
 .../bindings/media/mediatek,mdp3-wrot.yaml         |  23 +-
 .../devicetree/bindings/media/rockchip-isp1.yaml   |  11 +-
 .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml         |   4 +-
 .../bindings/timer/thead,c900-aclint-mtimer.yaml   |   9 +-
 Documentation/driver-api/pci/p2pdma.rst            |  16 +-
 Makefile                                           |   4 +-
 arch/arm/boot/dts/qcom/qcom-apq8064.dtsi           |   2 +-
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi           |   4 +-
 arch/arm/boot/dts/qcom/qcom-sdx55.dtsi             |   4 +-
 arch/arm/boot/dts/qcom/qcom-sdx65.dtsi             |   4 +-
 arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts      |   2 +-
 arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts      |   2 +-
 arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts      |   2 +-
 arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts      |   3 +-
 arch/arm/mach-davinci/Kconfig                      |   2 +
 arch/arm64/boot/dts/freescale/imx8mm.dtsi          |   4 +-
 arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi   |   3 -
 arch/arm64/boot/dts/mediatek/mt8183.dtsi           |   6 +-
 arch/arm64/boot/dts/mediatek/mt8186.dtsi           |   6 +-
 arch/arm64/boot/dts/mediatek/mt8195.dtsi           |  24 +-
 arch/arm64/boot/dts/qcom/ipq6018.dtsi              |   2 +-
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts           |   4 +
 arch/arm64/boot/dts/qcom/qrb4210-rb2.dts           |   1 -
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts           |   4 +-
 arch/arm64/boot/dts/qcom/sa8775p.dtsi              |  14 +-
 arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts   |  17 +-
 arch/arm64/boot/dts/qcom/sc7180.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |  12 +-
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts        |   2 +-
 arch/arm64/boot/dts/qcom/sc8180x.dtsi              |  10 +-
 .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts     |  11 +
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi             |   2 +-
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts         |   2 +-
 arch/arm64/boot/dts/qcom/sdm845.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm6125.dtsi               |   4 +
 arch/arm64/boot/dts/qcom/sm6350.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm6375.dtsi               |  41 ++-
 arch/arm64/boot/dts/qcom/sm8150-hdk.dts            |  12 +-
 arch/arm64/boot/dts/qcom/sm8150.dtsi               |   3 +-
 arch/arm64/boot/dts/qcom/sm8250.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm8350.dtsi               |   4 +-
 arch/arm64/boot/dts/qcom/sm8450.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm8550.dtsi               |  38 ++-
 .../boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi  |   3 +
 arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts |   2 +-
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi          |   4 +-
 arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi |  10 +
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi           |   2 +-
 arch/arm64/boot/dts/xilinx/Makefile                |   9 +-
 arch/arm64/kernel/ptrace.c                         |  13 +-
 arch/arm64/kvm/vgic/vgic-its.c                     |   5 +
 arch/arm64/kvm/vgic/vgic-mmio-v3.c                 |  27 +-
 arch/csky/include/asm/jump_label.h                 |   5 +
 arch/loongarch/include/asm/elf.h                   |   5 -
 arch/loongarch/kernel/elf.c                        |   5 -
 arch/loongarch/kernel/process.c                    |   1 +
 arch/loongarch/net/bpf_jit.c                       |   5 +-
 arch/mips/alchemy/devboards/db1200.c               |   2 +-
 arch/mips/alchemy/devboards/db1550.c               |   2 +-
 arch/mips/include/asm/dmi.h                        |   2 +-
 arch/mips/kernel/setup.c                           |   4 +-
 arch/powerpc/Kconfig                               |   1 +
 arch/powerpc/kernel/rtas.c                         |  19 +-
 arch/powerpc/kvm/book3s_hv.c                       |  18 +-
 arch/powerpc/lib/Makefile                          |   2 +-
 arch/powerpc/perf/hv-gpci.c                        |   3 +
 arch/powerpc/perf/imc-pmu.c                        |   6 +
 arch/powerpc/platforms/44x/Kconfig                 |   1 +
 arch/powerpc/platforms/powernv/opal-irqchip.c      |   2 +
 arch/powerpc/platforms/powernv/opal-powercap.c     |   6 +
 arch/powerpc/platforms/powernv/opal-xscom.c        |   5 +
 arch/powerpc/platforms/pseries/hotplug-memory.c    |   9 +-
 arch/riscv/include/asm/sections.h                  |   1 +
 arch/riscv/include/asm/xip_fixup.h                 |   2 +-
 arch/riscv/kernel/module.c                         |   3 +-
 arch/riscv/kernel/patch.c                          |  11 +-
 arch/riscv/kernel/vmlinux-xip.lds.S                |   2 +
 arch/riscv/kernel/vmlinux.lds.S                    |   2 +
 arch/riscv/mm/pageattr.c                           |  11 +-
 arch/s390/include/asm/pci_io.h                     |  32 +-
 arch/s390/net/bpf_jit_comp.c                       |   2 +-
 arch/s390/pci/pci_mmio.c                           |  12 +-
 arch/um/drivers/virt-pci.c                         |   2 +-
 arch/x86/events/intel/uncore_snbep.c               |  10 +-
 arch/x86/include/asm/kvm-x86-pmu-ops.h             |   2 +-
 arch/x86/include/asm/mwait.h                       |  11 +-
 arch/x86/kernel/cpu/mce/inject.c                   |   1 +
 arch/x86/kernel/cpu/microcode/intel.c              |  14 +-
 arch/x86/kernel/kvmclock.c                         |  12 +-
 arch/x86/kvm/pmu.c                                 |  63 +++-
 arch/x86/kvm/pmu.h                                 |  18 --
 arch/x86/kvm/svm/nested.c                          |  15 -
 arch/x86/kvm/svm/pmu.c                             |  16 -
 arch/x86/kvm/vmx/pmu_intel.c                       |  20 --
 arch/x86/lib/misc.c                                |   2 +-
 arch/x86/pci/mmconfig-shared.c                     |  13 +-
 block/bio.c                                        |  46 +--
 block/blk-cgroup.h                                 |   3 +-
 block/blk-mq.c                                     |  16 +-
 block/genhd.c                                      |   5 +-
 block/ioctl.c                                      |  11 +-
 crypto/af_alg.c                                    |  14 +-
 crypto/rsa.c                                       |   2 +
 crypto/scompress.c                                 |   6 +
 drivers/accel/habanalabs/common/habanalabs_ioctl.c |   2 +-
 drivers/acpi/acpi_extlog.c                         |   7 +-
 drivers/acpi/acpi_lpit.c                           |   2 +-
 drivers/acpi/acpi_lpss.c                           |   3 +-
 drivers/acpi/acpi_video.c                          |  12 +-
 drivers/acpi/property.c                            |   4 +
 drivers/android/binder_alloc.c                     |  22 +-
 drivers/base/class.c                               |   1 +
 drivers/base/node.c                                |   9 +-
 drivers/base/swnode.c                              |   3 +
 drivers/block/loop.c                               |  52 ++--
 drivers/block/null_blk/main.c                      |  12 +-
 drivers/bluetooth/btmtkuart.c                      |  11 +-
 drivers/bluetooth/btnxpuart.c                      |   7 +-
 drivers/bus/mhi/ep/main.c                          | 139 ++++++---
 drivers/bus/mhi/ep/ring.c                          |  41 +--
 drivers/cdx/cdx.c                                  |  14 +-
 drivers/char/hw_random/stm32-rng.c                 |   1 +
 drivers/clk/clk-renesas-pcie.c                     |   2 +-
 drivers/clk/clk-si5341.c                           |   4 +-
 drivers/clk/clk-sp7021.c                           |  12 +-
 drivers/clk/qcom/dispcc-sm8550.c                   |  12 +-
 drivers/clk/qcom/gcc-sm8550.c                      | 110 +++----
 drivers/clk/qcom/gpucc-sm8150.c                    |   4 +-
 drivers/clk/qcom/gpucc-sm8550.c                    |   6 +-
 drivers/clk/qcom/videocc-sm8150.c                  |   1 +
 drivers/clk/renesas/rzg2l-cpg.c                    |  91 +++---
 drivers/clk/zynqmp/clk-mux-zynqmp.c                |   2 +-
 drivers/clk/zynqmp/divider.c                       |  66 +---
 drivers/clocksource/timer-ep93xx.c                 |   5 +-
 drivers/clocksource/timer-ti-dm.c                  |   4 +-
 drivers/cpufreq/scmi-cpufreq.c                     |   7 +-
 drivers/cpuidle/cpuidle-haltpoll.c                 |   9 +-
 drivers/crypto/ccp/ccp-ops.c                       |   5 +-
 drivers/crypto/hisilicon/hpre/hpre_main.c          | 122 ++++----
 drivers/crypto/hisilicon/qm.c                      |  98 +++++-
 drivers/crypto/hisilicon/sec2/sec.h                |   7 +
 drivers/crypto/hisilicon/sec2/sec_crypto.c         |  10 +-
 drivers/crypto/hisilicon/sec2/sec_main.c           |  70 +++--
 drivers/crypto/hisilicon/zip/zip_main.c            | 175 ++++++++---
 drivers/crypto/inside-secure/safexcel_cipher.c     |  19 +-
 .../intel/qat/qat_common/adf_accel_devices.h       |   1 +
 drivers/crypto/intel/qat/qat_common/adf_rl.c       |   7 +-
 drivers/crypto/intel/qat/qat_common/adf_rl.h       |   1 +
 drivers/crypto/intel/qat/qat_common/adf_sysfs.c    |   6 +-
 .../intel/qat/qat_common/adf_sysfs_ras_counters.c  |   7 +-
 drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c |   8 +
 drivers/crypto/sa2ul.c                             |   3 +-
 drivers/crypto/sahara.c                            | 248 +++++++--------
 drivers/crypto/starfive/jh7110-cryp.c              |  10 +-
 drivers/crypto/virtio/virtio_crypto_common.h       |   2 +
 drivers/crypto/virtio/virtio_crypto_core.c         |  26 +-
 drivers/cxl/core/port.c                            |  24 +-
 drivers/cxl/core/region.c                          |   2 +-
 drivers/cxl/cxl.h                                  |   2 -
 drivers/edac/thunderx_edac.c                       |  10 +-
 drivers/firmware/qcom/qcom_qseecom_uefisecapp.c    |  20 +-
 drivers/firmware/ti_sci.c                          |  10 +-
 drivers/gpio/gpio-mlxbf3.c                         |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c        |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c         |  32 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |  34 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c            |   7 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h          |   1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h           |   1 -
 drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c       |  26 +-
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c           |   6 +-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h              |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c          |  21 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  76 +++--
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |   2 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |   6 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |   4 +-
 .../display/dc/link/protocols/link_dp_training.c   |   2 +-
 .../display/dc/link/protocols/link_dp_training.h   |   2 +-
 drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c         |   4 +-
 drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c     |  52 +---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c         |   5 +-
 .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c    |   6 +-
 drivers/gpu/drm/bridge/analogix/anx7625.c          |   3 -
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c    |   3 +-
 drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c        |   4 +-
 drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
 drivers/gpu/drm/bridge/ti-tpd12s015.c              |   4 +-
 drivers/gpu/drm/display/drm_dp_mst_topology.c      |  20 +-
 drivers/gpu/drm/drm_drv.c                          |  10 +-
 drivers/gpu/drm/i915/display/intel_dp.c            |   2 +-
 drivers/gpu/drm/i915/display/intel_dp_mst.c        |   5 +-
 drivers/gpu/drm/i915/display/intel_frontbuffer.c   |   2 -
 .../gpu/drm/i915/gem/i915_gem_object_frontbuffer.h |   1 +
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c                |   9 -
 drivers/gpu/drm/mediatek/mtk_disp_merge.c          |   2 +-
 drivers/gpu/drm/mediatek/mtk_dp.c                  |   1 +
 drivers/gpu/drm/mediatek/mtk_dpi.c                 |  16 +-
 drivers/gpu/drm/mediatek/mtk_mdp_rdma.c            |   3 +-
 drivers/gpu/drm/msm/Kconfig                        |   1 +
 drivers/gpu/drm/msm/adreno/adreno_device.c         |   2 +-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h |   8 +-
 .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h    |   9 +-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h |   2 +-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h |   2 +-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h |   2 +-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_8_1_sm8450.h |  24 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c     |  95 ++++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h     |   3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c        |   6 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h        |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c          |   6 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h          |   3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c        |  20 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h        |   8 +-
 drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c          |   9 +
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c              |   4 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c            |   3 +-
 drivers/gpu/drm/nouveau/nv04_fence.c               |   2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c                 |   9 +-
 drivers/gpu/drm/panel/panel-elida-kd35t133.c       |   2 +
 drivers/gpu/drm/panel/panel-newvision-nv3051d.c    |   2 +
 drivers/gpu/drm/panel/panel-sitronix-st7701.c      |   2 +-
 drivers/gpu/drm/panfrost/panfrost_gpu.c            |  70 +++--
 drivers/gpu/drm/radeon/r100.c                      |   4 +-
 drivers/gpu/drm/radeon/r600_cs.c                   |   4 +-
 drivers/gpu/drm/radeon/radeon_display.c            |   7 +-
 drivers/gpu/drm/radeon/radeon_vm.c                 |   8 +-
 drivers/gpu/drm/radeon/si.c                        |   4 +
 drivers/gpu/drm/radeon/sumo_dpm.c                  |   4 +-
 drivers/gpu/drm/radeon/trinity_dpm.c               |   4 +-
 drivers/gpu/drm/scheduler/sched_entity.c           |  13 +-
 drivers/gpu/drm/tests/drm_dp_mst_helper_test.c     |   6 +-
 drivers/gpu/drm/tidss/tidss_dispc.c                |  63 +++-
 drivers/gpu/drm/tidss/tidss_kms.c                  |   4 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c                |   2 +-
 drivers/greybus/gb-beagleplay.c                    |  58 +++-
 drivers/hid/hid-sensor-hub.c                       |   2 +-
 drivers/hid/wacom_wac.c                            |  32 +-
 drivers/i2c/busses/i2c-s3c2410.c                   |  40 +--
 drivers/idle/intel_idle.c                          |  19 +-
 drivers/iio/adc/ad7091r-base.c                     |   6 +-
 drivers/iio/adc/ad9467.c                           | 112 +++++--
 drivers/iio/adc/adi-axi-adc.c                      |  74 +----
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |   6 +-
 drivers/infiniband/hw/hns/hns_roce_pd.c            |   2 +-
 drivers/infiniband/hw/mthca/mthca_cmd.c            |   4 +-
 drivers/infiniband/hw/mthca/mthca_main.c           |   2 +-
 drivers/infiniband/ulp/iser/iscsi_iser.h           |   2 -
 drivers/infiniband/ulp/iser/iser_initiator.c       |   5 +-
 drivers/infiniband/ulp/iser/iser_memory.c          |   8 +-
 drivers/infiniband/ulp/iser/iser_verbs.c           |   1 -
 drivers/input/keyboard/atkbd.c                     |  12 +-
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c         |   1 +
 drivers/iommu/dma-iommu.c                          |   3 +
 drivers/iommu/of_iommu.c                           |   7 +
 drivers/leds/Kconfig                               |   1 +
 drivers/leds/leds-aw200xx.c                        |   7 +-
 drivers/md/md.c                                    |  69 +++--
 drivers/md/raid1.c                                 |  12 +-
 drivers/media/common/videobuf2/videobuf2-core.c    |   9 +-
 drivers/media/dvb-core/dvbdev.c                    |   2 +
 drivers/media/dvb-frontends/m88ds3103.c            |   7 +-
 drivers/media/i2c/mt9m114.c                        |   2 +-
 drivers/media/pci/bt8xx/bttv-driver.c              |  27 +-
 drivers/media/pci/bt8xx/bttv-vbi.c                 |   8 +-
 drivers/media/pci/solo6x10/solo6x10-offsets.h      |  10 +-
 drivers/media/platform/amphion/vpu_core.c          |   2 +-
 .../media/platform/mediatek/jpeg/mtk_jpeg_core.c   |   1 -
 drivers/media/platform/nxp/imx-mipi-csis.c         |  17 +-
 .../media/platform/rockchip/rkisp1/rkisp1-dev.c    |   6 +-
 .../media/platform/rockchip/rkisp1/rkisp1-isp.c    |   1 +
 drivers/media/platform/verisilicon/hantro_drv.c    |   2 +
 drivers/media/platform/verisilicon/hantro_v4l2.c   |   3 +
 drivers/media/test-drivers/visl/visl-video.c       |   3 +
 drivers/media/usb/cx231xx/cx231xx-core.c           |   2 +
 drivers/media/usb/pvrusb2/pvrusb2-context.c        |   3 +-
 drivers/media/v4l2-core/v4l2-async.c               |   1 -
 drivers/mfd/cs42l43-sdw.c                          |  74 ++---
 drivers/mfd/intel-lpss.c                           |   2 +-
 drivers/mfd/rk8xx-core.c                           |  34 +--
 drivers/mfd/syscon.c                               |   4 +
 drivers/mfd/tps6594-core.c                         |   3 +
 drivers/mmc/host/Kconfig                           |  10 +-
 drivers/mtd/mtd_blkdevs.c                          |   4 +-
 drivers/mtd/nand/raw/fsl_ifc_nand.c                |   2 +-
 drivers/net/amt.c                                  |   6 +-
 drivers/net/dsa/vitesse-vsc73xx-core.c             |   2 +
 drivers/net/ethernet/intel/ice/ice_ptp.c           |   4 +
 drivers/net/ethernet/marvell/octeontx2/af/rpm.c    |   7 +-
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c |  26 +-
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c   |   6 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c |   8 +-
 .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c    |   6 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  24 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c |   2 +-
 drivers/net/ethernet/renesas/ravb_main.c           |   2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac.h       |   1 +
 .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |  29 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  33 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c           |   5 +-
 drivers/net/netdevsim/netdev.c                     |   9 +-
 drivers/net/phy/micrel.c                           |   9 +
 drivers/net/usb/r8152.c                            |  16 +-
 drivers/net/wireless/ath/ath11k/ahb.c              |   4 +-
 drivers/net/wireless/ath/ath12k/core.c             |   6 +-
 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c |   3 +-
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c   |   2 +-
 .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c  |   8 +-
 drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c  |  11 -
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |   2 +-
 drivers/net/wireless/marvell/libertas/Kconfig      |   2 -
 drivers/net/wireless/marvell/mwifiex/cfg80211.c    |   2 +
 drivers/net/wireless/marvell/mwifiex/fw.h          |   1 +
 drivers/net/wireless/marvell/mwifiex/ioctl.h       |   1 +
 drivers/net/wireless/marvell/mwifiex/sdio.c        |  21 +-
 drivers/net/wireless/marvell/mwifiex/sdio.h        |   2 +
 drivers/net/wireless/marvell/mwifiex/uap_cmd.c     |   8 +
 drivers/net/wireless/mediatek/mt76/eeprom.c        |   6 +-
 drivers/net/wireless/mediatek/mt76/mt76.h          |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7615/sdio.c   |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7915/main.c   |   5 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mmio.c   |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7921/init.c   |  23 +-
 drivers/net/wireless/mediatek/mt76/mt7921/main.c   |  38 ++-
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c    |  11 +-
 drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h |   1 +
 drivers/net/wireless/mediatek/mt76/mt7921/pci.c    |   3 +
 drivers/net/wireless/mediatek/mt76/mt7921/sdio.c   |   4 +-
 .../net/wireless/mediatek/mt76/mt7921/sdio_mac.c   |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c    |   6 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.h    |  10 +-
 drivers/net/wireless/mediatek/mt76/sdio.c          |  18 +-
 drivers/net/wireless/purelifi/plfxlc/usb.c         |   5 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c         |  79 +----
 drivers/net/wireless/realtek/rtlwifi/pci.h         |   5 -
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   |  14 +-
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c |  12 +-
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.h |   1 -
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   |   6 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.h   |   1 -
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   |   6 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   |  15 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   |  16 +-
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   |  15 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   |   5 +-
 drivers/net/wireless/realtek/rtlwifi/wifi.h        |   7 +
 drivers/net/wireless/realtek/rtw88/mac80211.c      |   4 +-
 drivers/net/wireless/realtek/rtw88/sdio.c          |  35 ++-
 drivers/net/xen-netback/netback.c                  |  44 ++-
 drivers/nvme/target/tcp.c                          |  22 +-
 drivers/nvme/target/trace.h                        |   5 +-
 drivers/of/base.c                                  |   1 +
 drivers/of/unittest-data/tests-phandle.dtsi        |  10 +-
 drivers/of/unittest.c                              |  74 +++--
 drivers/pci/controller/dwc/pci-keystone.c          |   9 +
 drivers/pci/controller/dwc/pcie-designware-ep.c    |   1 +
 drivers/pci/controller/pcie-mediatek-gen3.c        |  85 +++---
 drivers/pci/controller/pcie-mediatek.c             |  10 +-
 drivers/pci/controller/pcie-xilinx-dma-pl.c        |   6 +-
 drivers/pci/endpoint/functions/pci-epf-mhi.c       |  66 ++--
 drivers/perf/arm-cmn.c                             |   2 +-
 drivers/perf/hisilicon/hisi_uncore_uc_pmu.c        |   4 +-
 drivers/platform/x86/intel/vsec.c                  |  25 +-
 drivers/platform/x86/intel/vsec.h                  |   1 +
 drivers/power/supply/bq256xx_charger.c             |   5 +-
 drivers/power/supply/cw2015_battery.c              |   2 +-
 drivers/power/supply/qcom_pmi8998_charger.c        |   4 +
 drivers/pwm/core.c                                 |   2 +-
 drivers/pwm/pwm-jz4740.c                           |   7 +-
 drivers/pwm/pwm-stm32.c                            |  31 +-
 drivers/scsi/bfa/bfad_bsg.c                        |   2 +-
 drivers/scsi/fnic/fnic_debugfs.c                   |   3 +-
 drivers/scsi/hisi_sas/hisi_sas_main.c              |  11 +-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c             |   9 +-
 drivers/scsi/lpfc/lpfc_els.c                       |   4 +-
 drivers/scsi/mpi3mr/mpi3mr_app.c                   |  16 +
 drivers/scsi/mpi3mr/mpi3mr_os.c                    |  19 +-
 drivers/soc/qcom/llcc-qcom.c                       |  10 +-
 drivers/spi/Kconfig                                |   3 +-
 drivers/spi/spi-cadence-quadspi.c                  |   4 +-
 drivers/spi/spi-coldfire-qspi.c                    |   1 -
 drivers/spi/spi-sh-msiof.c                         |  17 ++
 drivers/spmi/spmi-mtk-pmif.c                       |  20 +-
 drivers/staging/media/rkvdec/rkvdec.c              |   3 +
 .../interface/vchiq_arm/vchiq_connected.c          |   4 +-
 .../interface/vchiq_arm/vchiq_connected.h          |   4 +-
 .../vc04_services/interface/vchiq_arm/vchiq_core.c |   6 +-
 drivers/target/target_core_file.c                  |  10 +-
 drivers/thermal/loongson2_thermal.c                |   2 +-
 drivers/thermal/thermal_core.c                     |   1 -
 drivers/tty/serial/8250/8250_bcm2835aux.c          |   2 +
 drivers/tty/serial/8250/8250_exar.c                |   5 +-
 drivers/tty/serial/8250/8250_omap.c                |   2 +-
 drivers/tty/serial/apbuart.c                       |   2 +-
 drivers/tty/serial/imx.c                           |  40 +--
 drivers/tty/serial/omap-serial.c                   |  27 +-
 drivers/tty/serial/sc16is7xx.c                     |   8 +-
 drivers/tty/serial/serial_core.c                   |  61 +++-
 drivers/tty/serial/stm32-usart.c                   |   8 +-
 drivers/tty/tty_io.c                               |   3 +
 drivers/ufs/core/ufshcd.c                          |   7 +-
 drivers/ufs/host/ufs-qcom.c                        |   4 +-
 drivers/usb/cdns3/cdns3-gadget.c                   | 142 ++++++---
 drivers/usb/cdns3/cdns3-gadget.h                   |   3 +
 drivers/usb/chipidea/core.c                        |   7 +
 drivers/usb/class/cdc-acm.c                        |   3 +
 drivers/usb/core/generic.c                         |  16 +
 drivers/usb/dwc3/core.c                            |  39 +--
 drivers/usb/dwc3/ep0.c                             |   5 +-
 drivers/usb/dwc3/gadget.c                          |  19 +-
 drivers/usb/gadget/function/f_uvc.c                |  63 ++--
 drivers/usb/gadget/function/u_ether.c              |   2 +
 drivers/usb/gadget/function/u_uvc.h                |   6 +
 drivers/usb/gadget/legacy/webcam.c                 | 333 ++++++++++++++++-----
 drivers/usb/host/xhci-mtk.c                        |  40 ++-
 drivers/usb/host/xhci-mtk.h                        |   2 +
 drivers/usb/mon/mon_bin.c                          |   7 +-
 drivers/usb/phy/phy-mxs-usb.c                      |   3 +-
 drivers/usb/typec/class.c                          |   4 +-
 drivers/vdpa/alibaba/eni_vdpa.c                    |   6 +-
 drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c     |   7 +-
 drivers/vfio/pci/pds/dirty.c                       |   6 +-
 drivers/vhost/vsock.c                              |   1 +
 drivers/video/fbdev/acornfb.c                      |   2 +-
 drivers/video/fbdev/core/fb_defio.c                |   8 +-
 drivers/video/fbdev/imxfb.c                        |  27 +-
 drivers/video/fbdev/sm712fb.c                      |   6 +-
 drivers/watchdog/bcm2835_wdt.c                     |   3 +-
 drivers/watchdog/hpwdt.c                           |   2 +-
 drivers/watchdog/rti_wdt.c                         |  13 +-
 drivers/watchdog/watchdog_dev.c                    |   3 +-
 fs/ceph/Kconfig                                    |   1 +
 fs/dlm/debug_fs.c                                  |   2 +-
 fs/efivarfs/super.c                                |  15 +
 fs/erofs/decompressor.c                            |   2 +-
 fs/erofs/zdata.c                                   |   5 +-
 fs/erofs/zmap.c                                    |  23 +-
 fs/f2fs/data.c                                     |   7 +-
 fs/f2fs/file.c                                     |   7 +-
 fs/f2fs/namei.c                                    |   2 +-
 fs/f2fs/node.c                                     |   6 +-
 fs/f2fs/super.c                                    |   8 +
 fs/f2fs/xattr.c                                    |  11 +-
 fs/gfs2/quota.c                                    |   3 +-
 fs/gfs2/rgrp.c                                     |   2 +-
 fs/namespace.c                                     |  11 +
 fs/nfs/blocklayout/blocklayout.c                   |   7 +-
 fs/nfs/dir.c                                       |   2 +-
 fs/nfs/direct.c                                    |   5 +-
 fs/nfs/internal.h                                  |   2 +-
 fs/nfs/nfs4proc.c                                  |   3 +
 fs/nfs/pnfs.c                                      |   3 +-
 fs/pipe.c                                          |  17 +-
 fs/pstore/ram_core.c                               |   2 +-
 fs/smb/server/asn1.c                               |   5 +
 fs/smb/server/connection.c                         |   6 -
 fs/smb/server/connection.h                         |   2 +-
 fs/smb/server/oplock.c                             |   6 +
 fs/smb/server/smb2pdu.c                            |  22 +-
 fs/smb/server/smb_common.c                         |   6 +-
 fs/smb/server/transport_rdma.c                     |  11 +-
 fs/smb/server/transport_tcp.c                      |  13 +-
 include/asm-generic/cmpxchg-local.h                |   2 +-
 include/crypto/if_alg.h                            |   3 +
 include/drm/display/drm_dp_mst_helper.h            |   2 +-
 include/drm/drm_bridge.h                           |   2 +-
 include/linux/bio.h                                |   9 +-
 include/linux/bpf.h                                |  13 +-
 include/linux/clk-provider.h                       |   4 +-
 include/linux/gpio/driver.h                        |   2 +-
 include/linux/hisi_acc_qm.h                        |  20 +-
 include/linux/iio/adc/adi-axi-adc.h                |   4 +
 include/linux/mhi_ep.h                             |  19 +-
 include/linux/netfilter_bridge.h                   |   6 +-
 include/linux/pci.h                                |  12 +-
 include/linux/rcu_notifier.h                       |   6 +-
 include/linux/rcupdate.h                           |   6 +
 include/linux/skbuff.h                             |   2 +-
 include/linux/srcu.h                               |   2 +-
 include/linux/usb.h                                |   6 +
 include/linux/virtio_net.h                         |   9 +-
 include/linux/virtio_vsock.h                       |   1 +
 include/net/af_vsock.h                             |   2 +-
 include/net/bluetooth/hci_core.h                   |   1 -
 include/net/netdev_queues.h                        |   2 +-
 include/uapi/linux/bpf.h                           |   3 +
 init/do_mounts.c                                   |   9 +-
 io_uring/io_uring.c                                |  22 +-
 io_uring/rw.c                                      |  10 +-
 kernel/bpf/arraymap.c                              |  12 +-
 kernel/bpf/hashtab.c                               |   6 +-
 kernel/bpf/helpers.c                               |   2 +-
 kernel/bpf/lpm_trie.c                              |   3 +
 kernel/bpf/map_in_map.c                            |  13 +-
 kernel/bpf/map_in_map.h                            |   2 +-
 kernel/bpf/memalloc.c                              | 105 +------
 kernel/bpf/stackmap.c                              |  11 +-
 kernel/bpf/syscall.c                               |  47 ++-
 kernel/bpf/verifier.c                              |  96 +++---
 kernel/debug/kdb/kdb_main.c                        |   2 -
 kernel/dma/coherent.c                              |   4 +-
 kernel/rcu/Kconfig.debug                           |  25 ++
 kernel/rcu/rcu.h                                   |   8 +-
 kernel/rcu/rcutorture.c                            |  12 +-
 kernel/rcu/tree_stall.h                            |  11 +-
 kernel/rcu/update.c                                |   6 +
 kernel/sched/fair.c                                |  20 +-
 kernel/time/tick-sched.c                           |   5 +
 kernel/trace/bpf_trace.c                           |   7 +
 lib/kunit/debugfs.c                                |  34 ++-
 lib/test_bpf.c                                     |   2 +-
 net/bluetooth/hci_conn.c                           |   8 +-
 net/bluetooth/hci_debugfs.c                        |  12 +-
 net/bluetooth/hci_event.c                          |  11 +-
 net/bridge/br_netfilter_hooks.c                    |  42 ++-
 net/bridge/br_netfilter_ipv6.c                     |  14 +-
 net/core/rtnetlink.c                               |  14 +-
 net/dns_resolver/dns_key.c                         |   2 +-
 net/dsa/user.c                                     |   7 +-
 net/ethtool/features.c                             |   9 +-
 net/ipv4/af_inet.c                                 |   1 +
 net/ipv4/ipmr.c                                    |  13 +-
 net/ipv4/netfilter/nf_reject_ipv4.c                |   9 +-
 net/ipv4/udp.c                                     |  34 +--
 net/ipv6/ip6_tunnel.c                              |  26 +-
 net/ipv6/mcast.c                                   |   4 +
 net/ipv6/netfilter/nf_reject_ipv6.c                |  11 +-
 net/ipv6/udp.c                                     |  16 +-
 net/mac80211/mlme.c                                |  49 ++-
 net/mptcp/options.c                                |   6 +-
 net/mptcp/subflow.c                                |  17 +-
 net/ncsi/internal.h                                |   7 +-
 net/ncsi/ncsi-netlink.c                            |   4 +-
 net/ncsi/ncsi-pkt.h                                |   7 +-
 net/ncsi/ncsi-rsp.c                                |  26 +-
 net/netfilter/ipset/ip_set_hash_netiface.c         |   8 +-
 net/netfilter/ipvs/ip_vs_xmit.c                    |   4 +-
 net/netfilter/nf_log_syslog.c                      |  13 +-
 net/netfilter/nf_queue.c                           |   6 +-
 net/netfilter/nf_tables_api.c                      |  38 ++-
 net/netfilter/nfnetlink_log.c                      |   8 +-
 net/netfilter/nft_limit.c                          |  19 +-
 net/netfilter/xt_physdev.c                         |   2 +-
 net/netlabel/netlabel_calipso.c                    |  49 +--
 net/rxrpc/ar-internal.h                            |   1 +
 net/rxrpc/call_object.c                            |   4 +-
 net/rxrpc/local_object.c                           |  13 +-
 net/rxrpc/output.c                                 |   6 +-
 net/rxrpc/rxkad.c                                  |   2 +
 net/sched/act_ct.c                                 |  12 +-
 net/sctp/socket.c                                  |  13 +-
 net/sunrpc/xprt.c                                  |  23 +-
 net/sunrpc/xprtmultipath.c                         |   2 +-
 net/tls/tls_sw.c                                   |   6 +-
 net/unix/unix_bpf.c                                |  21 +-
 net/vmw_vsock/af_vsock.c                           |   9 +-
 net/vmw_vsock/hyperv_transport.c                   |   4 +-
 net/vmw_vsock/virtio_transport.c                   |   1 +
 net/vmw_vsock/virtio_transport_common.c            |  43 ++-
 net/vmw_vsock/vsock_loopback.c                     |   1 +
 net/wireless/scan.c                                |  47 ++-
 rust/bindgen_parameters                            |   4 +
 security/apparmor/lib.c                            |   1 +
 security/apparmor/lsm.c                            |   1 -
 security/apparmor/policy.c                         |  13 +-
 security/apparmor/policy_unpack.c                  |  13 +-
 security/keys/encrypted-keys/encrypted.c           |   4 +
 security/selinux/hooks.c                           |   7 +
 sound/drivers/aloop.c                              |  23 +-
 sound/pci/hda/patch_hdmi.c                         |   6 +
 sound/pci/hda/patch_realtek.c                      |   3 +
 sound/pci/oxygen/oxygen_mixer.c                    |   2 +-
 sound/soc/amd/vangogh/acp5x-mach.c                 |  35 +--
 sound/soc/codecs/cs35l33.c                         |   4 +-
 sound/soc/codecs/cs35l34.c                         |   4 +-
 sound/soc/codecs/rt5645.c                          |   8 -
 sound/soc/codecs/tas2781-fmwlib.c                  |   1 +
 sound/soc/fsl/Kconfig                              |   1 +
 .../soc/intel/boards/sof_sdw_rt_sdca_jack_common.c |   1 +
 sound/soc/intel/common/soc-acpi-intel-glk-match.c  |  14 +-
 sound/soc/mediatek/common/mtk-dsp-sof-common.c     |   2 +-
 sound/soc/sof/intel/hda.h                          |   1 +
 sound/soc/sof/intel/mtl.c                          |  28 ++
 sound/soc/sof/intel/pci-mtl.c                      |  12 +-
 sound/soc/sof/ipc4-loader.c                        |  11 +-
 sound/soc/sof/topology.c                           |   2 +-
 sound/usb/mixer_scarlett2.c                        | 207 +++++++++----
 tools/include/uapi/linux/bpf.h                     |   3 +
 tools/lib/api/io.h                                 |   1 +
 tools/perf/builtin-stat.c                          |  18 +-
 .../arch/arm64/ampere/ampereone/core-imp-def.json  |   2 +-
 .../pmu-events/arch/arm64/arm/cmn/sys/cmn.json     |   2 +-
 .../arch/powerpc/power10/datasource.json           |  18 +-
 .../attr/test-record-user-regs-no-sve-aarch64      |   2 +-
 .../tests/attr/test-record-user-regs-sve-aarch64   |   2 +-
 tools/perf/tests/workloads/thloop.c                |   4 +-
 tools/perf/util/bpf-event.c                        |   8 +-
 tools/perf/util/bpf-event.h                        |  12 +-
 tools/perf/util/db-export.c                        |   4 +-
 tools/perf/util/env.c                              |  50 ++--
 tools/perf/util/env.h                              |   4 +
 tools/perf/util/genelf.c                           |   6 +-
 tools/perf/util/header.c                           |  17 +-
 tools/perf/util/hisi-ptt.c                         |   1 +
 tools/perf/util/mem-events.c                       |  25 +-
 tools/perf/util/stat-shadow.c                      |   2 +-
 tools/perf/util/unwind-libdw.c                     |  21 +-
 tools/perf/util/unwind-libunwind-local.c           |   2 +-
 tools/testing/selftests/alsa/conf.c                |   2 +-
 tools/testing/selftests/alsa/mixer-test.c          |   4 +-
 tools/testing/selftests/bpf/prog_tests/bpf_iter.c  |   2 +
 tools/testing/selftests/bpf/prog_tests/time_tai.c  |   2 +-
 .../selftests/bpf/progs/bpf_iter_task_stack.c      |   5 +
 tools/testing/selftests/bpf/progs/iters.c          |   2 +-
 .../selftests/bpf/progs/test_global_func16.c       |   2 +-
 .../selftests/bpf/progs/verifier_basic_stack.c     |   8 +-
 .../testing/selftests/bpf/progs/verifier_int_ptr.c |   5 +-
 .../selftests/bpf/progs/verifier_raw_stack.c       |   5 +-
 .../testing/selftests/bpf/progs/verifier_var_off.c |  62 +++-
 .../selftests/bpf/progs/xdp_synproxy_kern.c        |   4 +-
 .../selftests/bpf/verifier/atomic_cmpxchg.c        |  11 -
 tools/testing/selftests/bpf/verifier/calls.c       |   4 +-
 tools/testing/selftests/bpf/xskxceiver.c           |  25 +-
 .../drivers/net/bonding/mode-1-recovery-updelay.sh |   2 +-
 .../drivers/net/bonding/mode-2-recovery-updelay.sh |   2 +-
 .../testing/selftests/drivers/net/mlxsw/qos_pfc.sh |  18 +-
 .../drivers/net/mlxsw/spectrum-2/tc_flower.sh      | 106 ++++++-
 .../selftests/net/arp_ndisc_untracked_subnets.sh   |   2 +-
 .../selftests/net/fib_nexthop_multiprefix.sh       |   4 +-
 tools/testing/selftests/powerpc/math/fpu_preempt.c |   9 +-
 tools/testing/selftests/powerpc/math/vmx_preempt.c |  10 +-
 tools/testing/selftests/sgx/Makefile               |   2 +-
 tools/testing/selftests/sgx/load.c                 |   9 +-
 tools/testing/selftests/sgx/sigstruct.c            |   5 +-
 tools/testing/selftests/sgx/test_encl.c            |   8 +-
 643 files changed, 5372 insertions(+), 3267 deletions(-)
author maintainer
#1 lore raw

PATCH 1/641 x86/lib: Fix overflow when counting digits

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Colin Ian King <[email protected]>

[ Upstream commit a24d61c609813963aacc9f6ec8343f4fcaac7243 ]

tl;dr: The num_digits() function has a theoretical overflow issue. But it doesn't affect any actual in-tree users. Fix it by using a larger type for one of the local variables.

Long version:

There is an overflow in variable m in function num_digits when val is >= 1410065408 which leads to the digit calculation loop to iterate more times than required. This results in either more digits being counted or in some cases (for example where val is 1932683193) the value of m eventually overflows to zero and the while loop spins forever).

Currently the function num_digits is currently only being used for small values of val in the SMP boot stage for digit counting on the number of cpus and NUMA nodes, so the overflow is never encountered. However it is useful to fix the overflow issue in case the function is used for other purposes in the future. (The issue was discovered while investigating the digit counting performance in various kernel helper functions rather than any real-world use-case).

The simplest fix is to make m a long long, the overhead in multiplication speed for a long long is very minor for small values of val less than 10000 on modern processors. The alternative fix is to replace the multiplication with a constant division by 10 loop (this compiles down to an multiplication and shift) without needing to make m a long long, but this is slightly slower than the fix in this commit when measured on a range of x86 processors).

[ dhansen: subject and changelog tweaks ]

Fixes 646e29a1789a ("x86: Improve the printout of the SMP bootup CPU table")
---
 arch/x86/lib/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/lib/misc.c +1 -1
index 92cd8ecc3a2c..40b81c338ae5 100644
@@ -8,7 +8,7 @@
  */
 int num_digits(int val)
 {
-	int m = 10;
+	long long m = 10;
 	int d = 1;
 
 	if (val < 0) {
Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH 2/641 x86/mce/inject: Clear test status value

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Yazen Ghannam <[email protected]>

[ Upstream commit 6175b407756b22e7fdc771181b7d832ebdedef5c ]

AMD systems generally allow MCA "simulation" where MCA registers can be written with valid data and the full MCA handling flow can be tested by software.

However, the platform on Scalable MCA systems, can prevent software from writing data to the MCA registers. There is no architectural way to determine this configuration. Therefore, the MCE injection module will check for this behavior by writing and reading back a test status value. This is done during module init, and the check can run on any CPU with any valid MCA bank.

If MCA_STATUS writes are ignored by the platform, then there are no side effects on the hardware state.

If the writes are not ignored, then the test status value will remain in the hardware MCA_STATUS register. It is likely that the value will not be overwritten by hardware or software, since the tested CPU and bank are arbitrary. Therefore, the user may see a spurious, synthetic MCA error reported whenever MCA is polled for this CPU.

Clear the test value immediately after writing it. It is very unlikely that a valid MCA error is logged by hardware during the test. Errors that cause an #MC won't be affected.

Fixes 891e465a1bd8 ("x86/mce: Check whether writes to MCA_STATUS are getting ignored")
---
 arch/x86/kernel/cpu/mce/inject.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/mce/inject.c +1 -0
index 4d8d4bcf915d..72f0695c3dc1 100644
@@ -746,6 +746,7 @@ static void check_hw_inj_possible(void)
 
 		wrmsrl_safe(mca_msr_reg(bank, MCA_STATUS), status);
 		rdmsrl_safe(mca_msr_reg(bank, MCA_STATUS), &status);
+		wrmsrl_safe(mca_msr_reg(bank, MCA_STATUS), 0);
 
 		if (!status) {
 			hw_injection_possible = false;
Signature · 1 line
2.43.0
author maintainer
#3 lore raw

PATCH 3/641 EDAC/thunderx: Fix possible out-of-bounds string access

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Arnd Bergmann <[email protected]>

[ Upstream commit 475c58e1a471e9b873e3e39958c64a2d278275c8 ]

Enabling -Wstringop-overflow globally exposes a warning for a common bug in the usage of strncat():

  drivers/edac/thunderx_edac.c: In function 'thunderx_ocx_com_threaded_isr':
  drivers/edac/thunderx_edac.c:1136:17: error: 'strncat' specified bound 1024 equals destination size [-Werror=stringop-overflow=]
   1136 |                 strncat(msg, other, OCX_MESSAGE_SIZE);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ...
   1145 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);
   ...
   1150 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);

...

Apparently the author of this driver expected strncat() to behave the way that strlcat() does, which uses the size of the destination buffer as its third argument rather than the length of the source buffer. The result is that there is no check on the size of the allocated buffer.

Change it to strlcat().

[ bp: Trim compiler output, fixup commit message. ]

---
 drivers/edac/thunderx_edac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/edac/thunderx_edac.c +5 -5
index b9c5772da959..90d46e5c4ff0 100644
@@ -1133,7 +1133,7 @@ static irqreturn_t thunderx_ocx_com_threaded_isr(int irq, void *irq_id)
 		decode_register(other, OCX_OTHER_SIZE,
 				ocx_com_errors, ctx->reg_com_int);
 
-		strncat(msg, other, OCX_MESSAGE_SIZE);
+		strlcat(msg, other, OCX_MESSAGE_SIZE);
 
 		for (lane = 0; lane < OCX_RX_LANES; lane++)
 			if (ctx->reg_com_int & BIT(lane)) {
@@ -1142,12 +1142,12 @@ static irqreturn_t thunderx_ocx_com_threaded_isr(int irq, void *irq_id)
 					 lane, ctx->reg_lane_int[lane],
 					 lane, ctx->reg_lane_stat11[lane]);
 
-				strncat(msg, other, OCX_MESSAGE_SIZE);
+				strlcat(msg, other, OCX_MESSAGE_SIZE);
 
 				decode_register(other, OCX_OTHER_SIZE,
 						ocx_lane_errors,
 						ctx->reg_lane_int[lane]);
-				strncat(msg, other, OCX_MESSAGE_SIZE);
+				strlcat(msg, other, OCX_MESSAGE_SIZE);
 			}
 
 		if (ctx->reg_com_int & OCX_COM_INT_CE)
@@ -1217,7 +1217,7 @@ static irqreturn_t thunderx_ocx_lnk_threaded_isr(int irq, void *irq_id)
 		decode_register(other, OCX_OTHER_SIZE,
 				ocx_com_link_errors, ctx->reg_com_link_int);
 
-		strncat(msg, other, OCX_MESSAGE_SIZE);
+		strlcat(msg, other, OCX_MESSAGE_SIZE);
 
 		if (ctx->reg_com_link_int & OCX_COM_LINK_INT_UE)
 			edac_device_handle_ue(ocx->edac_dev, 0, 0, msg);
@@ -1896,7 +1896,7 @@ static irqreturn_t thunderx_l2c_threaded_isr(int irq, void *irq_id)
 
 		decode_register(other, L2C_OTHER_SIZE, l2_errors, ctx->reg_int);
 
-		strncat(msg, other, L2C_MESSAGE_SIZE);
+		strlcat(msg, other, L2C_MESSAGE_SIZE);
 
 		if (ctx->reg_int & mask_ue)
 			edac_device_handle_ue(l2c->edac_dev, 0, 0, msg);
Signature · 1 line
2.43.0
author maintainer
#4 lore raw

PATCH 4/641 powerpc: add crtsavres.o to always-y instead of extra-y

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Masahiro Yamada <[email protected]>

[ Upstream commit 1b1e38002648819c04773647d5242990e2824264 ]

crtsavres.o is linked to modules. However, as explained in commit d0e628cd817f ("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.

For example, the following command fails:

  $ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules
    [snip]
    LD [M]  arch/powerpc/platforms/cell/spufs/spufs.ko
  ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory
  make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1
  make[2]: *** [Makefile:1844: modules] Error 2
  make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2
  make: *** [Makefile:234: __sub-make] Error 2
Fixes baa25b571a16 ("powerpc/64: Do not link crtsavres.o in vmlinux")
---
 arch/powerpc/lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/lib/Makefile +1 -1
index 51ad0397c17a..6eac63e79a89 100644
@@ -45,7 +45,7 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION)	+= error-inject.o
 # so it is only needed for modules, and only for older linkers which
 # do not support --save-restore-funcs
 ifndef CONFIG_LD_IS_BFD
-extra-$(CONFIG_PPC64)	+= crtsavres.o
+always-$(CONFIG_PPC64)	+= crtsavres.o
 endif
 
 obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
Signature · 1 line
2.43.0
author maintainer
#5 lore raw

PATCH 5/641 fs/pipe: Fix lockdep false-positive in watchqueue pipe_write()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Jann Horn <[email protected]>

[ Upstream commit 055ca83559912f2cfd91c9441427bac4caf3c74e ]

When you try to splice between a normal pipe and a notification pipe, get_pipe_info(..., true) fails, so splice() falls back to treating the notification pipe like a normal pipe - so we end up in iter_file_splice_write(), which first locks the input pipe, then calls vfs_iter_write(), which locks the output pipe.

Lockdep complains about that, because we're taking a pipe lock while already holding another pipe lock.

I think this probably (?) can't actually lead to deadlocks, since you'd need another way to nest locking a normal pipe into locking a watch_queue pipe, but the lockdep annotations don't make that clear.

Bail out earlier in pipe_write() for notification pipes, before taking the pipe lock.

---
 fs/pipe.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
fs/pipe.c +12 -5
index 804a7d789452..226e7f66b590 100644
@@ -446,6 +446,18 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
 	bool was_empty = false;
 	bool wake_next_writer = false;
 
+	/*
+	 * Reject writing to watch queue pipes before the point where we lock
+	 * the pipe.
+	 * Otherwise, lockdep would be unhappy if the caller already has another
+	 * pipe locked.
+	 * If we had to support locking a normal pipe and a notification pipe at
+	 * the same time, we could set up lockdep annotations for that, but
+	 * since we don't actually need that, it's simpler to just bail here.
+	 */
+	if (pipe_has_watch_queue(pipe))
+		return -EXDEV;
+
 	/* Null write succeeds. */
 	if (unlikely(total_len == 0))
 		return 0;
@@ -458,11 +470,6 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
 		goto out;
 	}
 
-	if (pipe_has_watch_queue(pipe)) {
-		ret = -EXDEV;
-		goto out;
-	}
-
 	/*
 	 * If it wasn't empty we try to merge new data into
 	 * the last buffer.
Signature · 1 line
2.43.0
author maintainer
#6 lore raw

PATCH 6/641 x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Peter Zijlstra <[email protected]>

[ Upstream commit edc8fc01f608108b0b7580cb2c29dfb5135e5f0e ]

intel_idle_irq() re-enables IRQs very early. As a result, an interrupt may fire before mwait() is eventually called. If such an interrupt queues a timer, it may go unnoticed until mwait returns and the idle loop handles the tick re-evaluation. And monitoring TIF_NEED_RESCHED doesn't help because a local timer enqueue doesn't set that flag.

The issue is mitigated by the fact that this idle handler is only invoked for shallow C-states when, presumably, the next tick is supposed to be close enough. There may still be rare cases though when the next tick is far away and the selected C-state is shallow, resulting in a timer getting ignored for a while.

Fix this with using sti_mwait() whose IRQ-reenablement only triggers upon calling mwait(), dealing with the race while keeping the interrupt latency within acceptable bounds.

---
 arch/x86/include/asm/mwait.h | 11 +++++++++--
 drivers/idle/intel_idle.c    | 19 +++++++------------
 2 files changed, 16 insertions(+), 14 deletions(-)
arch/x86/include/asm/mwait.h +9 -2
index 778df05f8539..bae83810505b 100644
@@ -115,8 +115,15 @@ static __always_inline void mwait_idle_with_hints(unsigned long eax, unsigned lo
 		}
 
 		__monitor((void *)&current_thread_info()->flags, 0, 0);
-		if (!need_resched())
-			__mwait(eax, ecx);
+
+		if (!need_resched()) {
+			if (ecx & 1) {
+				__mwait(eax, ecx);
+			} else {
+				__sti_mwait(eax, ecx);
+				raw_local_irq_disable();
+			}
+		}
 	}
 	current_clr_polling();
 }
drivers/idle/intel_idle.c +7 -12
index dcda0afecfc5..3e01a6b23e75 100644
@@ -131,11 +131,12 @@ static unsigned int mwait_substates __initdata;
 #define MWAIT2flg(eax) ((eax & 0xFF) << 24)
 
 static __always_inline int __intel_idle(struct cpuidle_device *dev,
-					struct cpuidle_driver *drv, int index)
+					struct cpuidle_driver *drv,
+					int index, bool irqoff)
 {
 	struct cpuidle_state *state = &drv->states[index];
 	unsigned long eax = flg2MWAIT(state->flags);
-	unsigned long ecx = 1; /* break on interrupt flag */
+	unsigned long ecx = 1*irqoff; /* break on interrupt flag */
 
 	mwait_idle_with_hints(eax, ecx);
 
@@ -159,19 +160,13 @@ static __always_inline int __intel_idle(struct cpuidle_device *dev,
 static __cpuidle int intel_idle(struct cpuidle_device *dev,
 				struct cpuidle_driver *drv, int index)
 {
-	return __intel_idle(dev, drv, index);
+	return __intel_idle(dev, drv, index, true);
 }
 
 static __cpuidle int intel_idle_irq(struct cpuidle_device *dev,
 				    struct cpuidle_driver *drv, int index)
 {
-	int ret;
-
-	raw_local_irq_enable();
-	ret = __intel_idle(dev, drv, index);
-	raw_local_irq_disable();
-
-	return ret;
+	return __intel_idle(dev, drv, index, false);
 }
 
 static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
@@ -184,7 +179,7 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
 	if (smt_active)
 		__update_spec_ctrl(0);
 
-	ret = __intel_idle(dev, drv, index);
+	ret = __intel_idle(dev, drv, index, true);
 
 	if (smt_active)
 		__update_spec_ctrl(spec_ctrl);
@@ -196,7 +191,7 @@ static __cpuidle int intel_idle_xstate(struct cpuidle_device *dev,
 				       struct cpuidle_driver *drv, int index)
 {
 	fpu_idle_fpregs();
-	return __intel_idle(dev, drv, index);
+	return __intel_idle(dev, drv, index, true);
 }
 
 /**
Signature · 1 line
2.43.0
author maintainer
#7 lore raw

PATCH 7/641 powerpc/44x: select I2C for CURRITUCK

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Randy Dunlap <[email protected]>

[ Upstream commit 4a74197b65e69c46fe6e53f7df2f4d6ce9ffe012 ]

Fix build errors when CURRITUCK=y and I2C is not builtin (=m or is not set). Fixes these build errors:

powerpc-linux-ld: arch/powerpc/platforms/44x/ppc476.o: in function `avr_halt_system':
ppc476.c:(.text+0x58): undefined reference to `i2c_smbus_write_byte_data'
powerpc-linux-ld: arch/powerpc/platforms/44x/ppc476.o: in function `ppc47x_device_probe':
ppc476.c:(.init.text+0x18): undefined reference to `i2c_register_driver'

Fixes 2a2c74b2efcb ("IBM Akebono: Add the Akebono platform")
Closes lore.kernel.org/r/[email protected]
---
 arch/powerpc/platforms/44x/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/44x/Kconfig +1 -0
index 1624ebf95497..35a1f4b9f827 100644
@@ -173,6 +173,7 @@ config ISS4xx
 config CURRITUCK
 	bool "IBM Currituck (476fpe) Support"
 	depends on PPC_47x
+	select I2C
 	select SWIOTLB
 	select 476FPE
 	select FORCE_PCI
Signature · 1 line
2.43.0
author maintainer
#8 lore raw

PATCH 8/641 powerpc/pseries/memhp: Fix access beyond end of drmem array

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nathan Lynch <[email protected]>

[ Upstream commit bd68ffce69f6cf8ddd3a3c32549d1d2275e49fc5 ]

dlpar_memory_remove_by_index() may access beyond the bounds of the drmem lmb array when the LMB lookup fails to match an entry with the given DRC index. When the search fails, the cursor is left pointing to &drmem_info->lmbs[drmem_info->n_lmbs], which is one element past the last valid entry in the array. The debug message at the end of the function then dereferences this pointer:

pr_debug("Failed to hot-remove memory at %llx\n",
lmb->base_addr);

This was found by inspection and confirmed with KASAN:

pseries-hotplug-mem: Attempting to hot-remove LMB, drc index 1234
==================================================================

  BUG: KASAN: slab-out-of-bounds in dlpar_memory+0x298/0x1658
  Read of size 8 at addr c000000364e97fd0 by task bash/949

  dump_stack_lvl+0xa4/0xfc (unreliable)
  print_report+0x214/0x63c
  kasan_report+0x140/0x2e0
  __asan_load8+0xa8/0xe0
  dlpar_memory+0x298/0x1658
  handle_dlpar_errorlog+0x130/0x1d0
  dlpar_store+0x18c/0x3e0
  kobj_attr_store+0x68/0xa0
  sysfs_kf_write+0xc4/0x110
  kernfs_fop_write_iter+0x26c/0x390
  vfs_write+0x2d4/0x4e0
  ksys_write+0xac/0x1a0
  system_call_exception+0x268/0x530
  system_call_vectored_common+0x15c/0x2ec

  Allocated by task 1:
   kasan_save_stack+0x48/0x80
   kasan_set_track+0x34/0x50
   kasan_save_alloc_info+0x34/0x50
   __kasan_kmalloc+0xd0/0x120
   __kmalloc+0x8c/0x320
   kmalloc_array.constprop.0+0x48/0x5c
   drmem_init+0x2a0/0x41c
   do_one_initcall+0xe0/0x5c0
   kernel_init_freeable+0x4ec/0x5a0
   kernel_init+0x30/0x1e0
   ret_from_kernel_user_thread+0x14/0x1c

  The buggy address belongs to the object at c000000364e80000
   which belongs to the cache kmalloc-128k of size 131072
  The buggy address is located 0 bytes to the right of
   allocated 98256-byte region [c000000364e80000, c000000364e97fd0)

==================================================================
pseries-hotplug-mem: Failed to hot-remove memory at 0

Log failed lookups with a separate message and dereference the cursor only when it points to a valid entry.

Fixes 51925fb3c5c9 ("powerpc/pseries: Implement memory hotplug remove in the kernel")
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
arch/powerpc/platforms/pseries/hotplug-memory.c +5 -4
index a43bfb01720a..6f2eebae7bee 100644
@@ -436,14 +436,15 @@ static int dlpar_memory_remove_by_index(u32 drc_index)
 		}
 	}
 
-	if (!lmb_found)
+	if (!lmb_found) {
+		pr_debug("Failed to look up LMB for drc index %x\n", drc_index);
 		rc = -EINVAL;
-
-	if (rc)
+	} else if (rc) {
 		pr_debug("Failed to hot-remove memory at %llx\n",
 			 lmb->base_addr);
-	else
+	} else {
 		pr_debug("Memory at %llx was hot-removed\n", lmb->base_addr);
+	}
 
 	return rc;
 }
Signature · 1 line
2.43.0
author maintainer
#9 lore raw

PATCH 9/641 x86/microcode/intel: Set new revision only after a successful update

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Borislav Petkov (AMD) <[email protected]>

[ Upstream commit 9c21ea53e6bd1104c637b80a0688040f184cc761 ]

This was meant to be done only when early microcode got updated successfully. Move it into the if-branch.

Also, make sure the current revision is read unconditionally and only once.

Fixes 080990aa3344 ("x86/microcode: Rework early revisions reporting")
---
 arch/x86/kernel/cpu/microcode/intel.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/microcode/intel.c +7 -7
index 070426b9895f..334972c097d9 100644
@@ -370,14 +370,14 @@ static __init struct microcode_intel *get_microcode_blob(struct ucode_cpu_info *
 {
 	struct cpio_data cp;
 
+	intel_collect_cpu_info(&uci->cpu_sig);
+
 	if (!load_builtin_intel_microcode(&cp))
 		cp = find_microcode_in_initrd(ucode_path);
 
 	if (!(cp.data && cp.size))
 		return NULL;
 
-	intel_collect_cpu_info(&uci->cpu_sig);
-
 	return scan_microcode(cp.data, cp.size, uci, save);
 }
 
@@ -410,13 +410,13 @@ void __init load_ucode_intel_bsp(struct early_load_data *ed)
 {
 	struct ucode_cpu_info uci;
 
-	ed->old_rev = intel_get_microcode_revision();
-
 	uci.mc = get_microcode_blob(&uci, false);
-	if (uci.mc && apply_microcode_early(&uci) == UCODE_UPDATED)
-		ucode_patch_va = UCODE_BSP_LOADED;
+	ed->old_rev = uci.cpu_sig.rev;
 
-	ed->new_rev = uci.cpu_sig.rev;
+	if (uci.mc && apply_microcode_early(&uci) == UCODE_UPDATED) {
+		ucode_patch_va = UCODE_BSP_LOADED;
+		ed->new_rev = uci.cpu_sig.rev;
+	}
 }
 
 void load_ucode_intel_ap(void)
Signature · 1 line
2.43.0
author maintainer
#10 lore raw

PATCH 10/641 perf/arm-cmn: Fix HN-F class_occup_id events

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Robin Murphy <[email protected]>

[ Upstream commit 590f23b092401f29e410fd4ca67128fcc45192fc ]

A subtle copy-paste error managed to slip through the reorganisation of these patches in development, and not only give some HN-F events the wrong type, but use that wrong type before the subsequent patch defined it. Too late to fix history, but we can at least fix the bug.

---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm-cmn.c +1 -1
index 847b0dc41293..c584165b13ba 100644
@@ -811,7 +811,7 @@ static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj,
 #define CMN_EVENT_HNF_OCC(_model, _name, _event)			\
 	CMN_EVENT_HN_OCC(_model, hnf_##_name, CMN_TYPE_HNF, _event)
 #define CMN_EVENT_HNF_CLS(_model, _name, _event)			\
-	CMN_EVENT_HN_CLS(_model, hnf_##_name, CMN_TYPE_HNS, _event)
+	CMN_EVENT_HN_CLS(_model, hnf_##_name, CMN_TYPE_HNF, _event)
 #define CMN_EVENT_HNF_SNT(_model, _name, _event)			\
 	CMN_EVENT_HN_SNT(_model, hnf_##_name, CMN_TYPE_HNF, _event)
 
Signature · 1 line
2.43.0
author maintainer
#11 lore raw

PATCH 11/641 drivers/perf: hisi: Fix some event id for HiSilicon UC pmu

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Junhao He <[email protected]>

[ Upstream commit 38bbef7240b8c5f2dc4493eec356e2efbf2da5f4 ]

Some event id of HiSilicon uncore UC PMU driver is incorrect, fix them.

Fixes 312eca95e28d ("drivers/perf: hisi: Add support for HiSilicon UC PMU driver")
---
 drivers/perf/hisilicon/hisi_uncore_uc_pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/perf/hisilicon/hisi_uncore_uc_pmu.c +2 -2
index 63da05e5831c..636fb79647c8 100644
@@ -383,8 +383,8 @@ static struct attribute *hisi_uc_pmu_events_attr[] = {
 	HISI_PMU_EVENT_ATTR(cpu_rd,		0x10),
 	HISI_PMU_EVENT_ATTR(cpu_rd64,		0x17),
 	HISI_PMU_EVENT_ATTR(cpu_rs64,		0x19),
-	HISI_PMU_EVENT_ATTR(cpu_mru,		0x1a),
-	HISI_PMU_EVENT_ATTR(cycles,		0x9c),
+	HISI_PMU_EVENT_ATTR(cpu_mru,		0x1c),
+	HISI_PMU_EVENT_ATTR(cycles,		0x95),
 	HISI_PMU_EVENT_ATTR(spipe_hit,		0xb3),
 	HISI_PMU_EVENT_ATTR(hpipe_hit,		0xdb),
 	HISI_PMU_EVENT_ATTR(cring_rxdat_cnt,	0xfa),
Signature · 1 line
2.43.0
author maintainer
#12 lore raw

PATCH 12/641 KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nicholas Piggin <[email protected]>

[ Upstream commit ecd10702baae5c16a91d139bde7eff84ce55daee ]

Commit 026728dc5d41 ("KVM: PPC: Book3S HV P9: Inject pending xive interrupts at guest entry") changed guest entry so that if external interrupts are enabled, BOOK3S_IRQPRIO_EXTERNAL is not tested for. Test for this regardless of MSR_EE.

For an L1 host, do not inject an interrupt, but always use LPCR_MER. If the L0 desires it can inject an interrupt.

Fixes 026728dc5d41 ("KVM: PPC: Book3S HV P9: Inject pending xive interrupts at guest entry")
[jpn: use kvmpcc_get_msr(), write commit message]
---
 arch/powerpc/kvm/book3s_hv.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
arch/powerpc/kvm/book3s_hv.c +12 -6
index 1ed6ec140701..002a7573a5d4 100644
@@ -4736,13 +4736,19 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
 
 	if (!nested) {
 		kvmppc_core_prepare_to_enter(vcpu);
-		if (__kvmppc_get_msr_hv(vcpu) & MSR_EE) {
-			if (xive_interrupt_pending(vcpu))
+		if (test_bit(BOOK3S_IRQPRIO_EXTERNAL,
+			     &vcpu->arch.pending_exceptions) ||
+		    xive_interrupt_pending(vcpu)) {
+			/*
+			 * For nested HV, don't synthesize but always pass MER,
+			 * the L0 will be able to optimise that more
+			 * effectively than manipulating registers directly.
+			 */
+			if (!kvmhv_on_pseries() && (__kvmppc_get_msr_hv(vcpu) & MSR_EE))
 				kvmppc_inject_interrupt_hv(vcpu,
-						BOOK3S_INTERRUPT_EXTERNAL, 0);
-		} else if (test_bit(BOOK3S_IRQPRIO_EXTERNAL,
-			     &vcpu->arch.pending_exceptions)) {
-			lpcr |= LPCR_MER;
+							   BOOK3S_INTERRUPT_EXTERNAL, 0);
+			else
+				lpcr |= LPCR_MER;
 		}
 	} else if (vcpu->arch.pending_exceptions ||
 		   vcpu->arch.doorbell_request ||
Signature · 1 line
2.43.0
author maintainer
#13 lore raw

PATCH 13/641 selftests/powerpc: Fix error handling in FPU/VMX preemption tests

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Michael Ellerman <[email protected]>

[ Upstream commit 9dbd5927408c4a0707de73ae9dd9306b184e8fee ]

The FPU & VMX preemption tests do not check for errors returned by the low-level asm routines, preempt_fpu() / preempt_vsx() respectively. That means any register corruption detected by the asm routines does not result in a test failure.

Fix it by returning the return value of the asm routines from the pthread child routines.

Fixes e5ab8be68e44 ("selftests/powerpc: Test preservation of FPU and VMX regs across preemption")
---
 tools/testing/selftests/powerpc/math/fpu_preempt.c |  9 +++++----
 tools/testing/selftests/powerpc/math/vmx_preempt.c | 10 ++++++----
 2 files changed, 11 insertions(+), 8 deletions(-)
tools/testing/selftests/powerpc/math/fpu_preempt.c +5 -4
index 5235bdc8c0b1..3e5b5663d244 100644
@@ -37,19 +37,20 @@ __thread double darray[] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
 int threads_starting;
 int running;
 
-extern void preempt_fpu(double *darray, int *threads_starting, int *running);
+extern int preempt_fpu(double *darray, int *threads_starting, int *running);
 
 void *preempt_fpu_c(void *p)
 {
+	long rc;
 	int i;
+
 	srand(pthread_self());
 	for (i = 0; i < 21; i++)
 		darray[i] = rand();
 
-	/* Test failed if it ever returns */
-	preempt_fpu(darray, &threads_starting, &running);
+	rc = preempt_fpu(darray, &threads_starting, &running);
 
-	return p;
+	return (void *)rc;
 }
 
 int test_preempt_fpu(void)
tools/testing/selftests/powerpc/math/vmx_preempt.c +6 -4
index 6761d6ce30ec..6f7cf400c687 100644
@@ -37,19 +37,21 @@ __thread vector int varray[] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10,11,12},
 int threads_starting;
 int running;
 
-extern void preempt_vmx(vector int *varray, int *threads_starting, int *running);
+extern int preempt_vmx(vector int *varray, int *threads_starting, int *running);
 
 void *preempt_vmx_c(void *p)
 {
 	int i, j;
+	long rc;
+
 	srand(pthread_self());
 	for (i = 0; i < 12; i++)
 		for (j = 0; j < 4; j++)
 			varray[i][j] = rand();
 
-	/* Test fails if it ever returns */
-	preempt_vmx(varray, &threads_starting, &running);
-	return p;
+	rc = preempt_vmx(varray, &threads_starting, &running);
+
+	return (void *)rc;
 }
 
 int test_preempt_vmx(void)
Signature · 1 line
2.43.0
author maintainer
#14 lore raw

PATCH 14/641 powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Kajol Jain <[email protected]>

[ Upstream commit 070b71f428facd9130319707db854ed8bd24637a ]

To access hv-gpci kernel interface files data, the "Enable Performance Information Collection" option has to be set in hmc. Incase that option is not set and user try to read the interface files, it should give error message as operation not permitted.

Result of accessing added interface files with disabled performance collection option:

[command]# cat processor_bus_topology
cat: processor_bus_topology: Operation not permitted

[command]# cat processor_config
cat: processor_config: Operation not permitted

[command]# cat affinity_domain_via_domain
cat: affinity_domain_via_domain: Operation not permitted

[command]# cat affinity_domain_via_virtual_processor
cat: affinity_domain_via_virtual_processor: Operation not permitted

[command]# cat affinity_domain_via_partition

Based on above result there is no error message when reading affinity_domain_via_partition file because of missing check for failed hcall. Fix this issue by adding
a check in the start of affinity_domain_via_partition_show function, to return error incase hcall fails, with error type other then H_PARAMETER.

Fixes a15e0d6a6929 ("powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show affinity domain via partition information")
---
 arch/powerpc/perf/hv-gpci.c | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/perf/hv-gpci.c +3 -0
index 39dbe6b348df..27f18119fda1 100644
@@ -534,6 +534,9 @@ static ssize_t affinity_domain_via_partition_show(struct device *dev, struct dev
 	if (!ret)
 		goto parse_result;
 
+	if (ret && (ret != H_PARAMETER))
+		goto out;
+
 	/*
 	 * ret value as 'H_PARAMETER' implies that the current buffer size
 	 * can't accommodate all the information, and a partial buffer
Signature · 1 line
2.43.0
author maintainer
#15 lore raw

PATCH 15/641 powerpc/rtas: Avoid warning on invalid token argument to sys_rtas()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nathan Lynch <[email protected]>

[ Upstream commit 01e346ffefda3a7088afebf02b940614179688e7 ]

rtas_token_to_function() WARNs when passed an invalid token; it's meant to catch bugs in kernel-based users of RTAS functions. However, user space controls the token value passed to rtas_token_to_function() by block_rtas_call(), so user space with sufficient privilege to use sys_rtas() can trigger the warnings at will:

unexpected failed lookup for token 2048

  WARNING: CPU: 20 PID: 2247 at arch/powerpc/kernel/rtas.c:556
    rtas_token_to_function+0xfc/0x110
  ...
  NIP rtas_token_to_function+0xfc/0x110
  LR  rtas_token_to_function+0xf8/0x110
  Call Trace:
    rtas_token_to_function+0xf8/0x110 (unreliable)
    sys_rtas+0x188/0x880
    system_call_exception+0x268/0x530
    system_call_common+0x160/0x2c4

It's desirable to continue warning on bogus tokens in rtas_token_to_function(). Currently it is used to look up RTAS function descriptors when tracing, where we know there has to have been a successful descriptor lookup by different means already, and it would be a serious inconsistency for the reverse lookup to fail.

So instead of weakening rtas_token_to_function()'s contract by removing the warnings, introduce rtas_token_to_function_untrusted(), which has no opinion on failed lookups. Convert block_rtas_call() and rtas_token_to_function() to use it.

---
 arch/powerpc/kernel/rtas.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
arch/powerpc/kernel/rtas.c +17 -2
index eddc031c4b95..87d65bdd3eca 100644
@@ -544,6 +544,21 @@ static int __init rtas_token_to_function_xarray_init(void)
 }
 arch_initcall(rtas_token_to_function_xarray_init);
 
+/*
+ * For use by sys_rtas(), where the token value is provided by user
+ * space and we don't want to warn on failed lookups.
+ */
+static const struct rtas_function *rtas_token_to_function_untrusted(s32 token)
+{
+	return xa_load(&rtas_token_to_function_xarray, token);
+}
+
+/*
+ * Reverse lookup for deriving the function descriptor from a
+ * known-good token value in contexts where the former is not already
+ * available. @token must be valid, e.g. derived from the result of a
+ * prior lookup against the function table.
+ */
 static const struct rtas_function *rtas_token_to_function(s32 token)
 {
 	const struct rtas_function *func;
@@ -551,7 +566,7 @@ static const struct rtas_function *rtas_token_to_function(s32 token)
 	if (WARN_ONCE(token < 0, "invalid token %d", token))
 		return NULL;
 
-	func = xa_load(&rtas_token_to_function_xarray, token);
+	func = rtas_token_to_function_untrusted(token);
 
 	if (WARN_ONCE(!func, "unexpected failed lookup for token %d", token))
 		return NULL;
@@ -1726,7 +1741,7 @@ static bool block_rtas_call(int token, int nargs,
 	 * If this token doesn't correspond to a function the kernel
 	 * understands, you're not allowed to call it.
 	 */
-	func = rtas_token_to_function(token);
+	func = rtas_token_to_function_untrusted(token);
 	if (!func)
 		goto err;
 	/*
Signature · 1 line
2.43.0
author maintainer
#16 lore raw

PATCH 16/641 powerpc/powernv: Add a null pointer check to scom_debug_init_one()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Kunwu Chan <[email protected]>

[ Upstream commit 9a260f2dd827bbc82cc60eb4f4d8c22707d80742 ]

kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure.
Add a null pointer check, and release 'ent' to avoid memory leaks.

Fixes bfd2f0d49aef ("powerpc/powernv: Get rid of old scom_controller abstraction")
---
 arch/powerpc/platforms/powernv/opal-xscom.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/powerpc/platforms/powernv/opal-xscom.c +5 -0
index 262cd6fac907..748c2b97fa53 100644
@@ -165,6 +165,11 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
 	ent->chip = chip;
 	snprintf(ent->name, 16, "%08x", chip);
 	ent->path.data = (void *)kasprintf(GFP_KERNEL, "%pOF", dn);
+	if (!ent->path.data) {
+		kfree(ent);
+		return -ENOMEM;
+	}
+
 	ent->path.size = strlen((char *)ent->path.data);
 
 	dir = debugfs_create_dir(ent->name, root);
Signature · 1 line
2.43.0
author maintainer
#17 lore raw

PATCH 17/641 powerpc/powernv: Add a null pointer check in opal_event_init()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Kunwu Chan <[email protected]>

[ Upstream commit 8649829a1dd25199bbf557b2621cedb4bf9b3050 ]

kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure.

Fixes 2717a33d6074 ("powerpc/opal-irqchip: Use interrupt names if present")
---
 arch/powerpc/platforms/powernv/opal-irqchip.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/platforms/powernv/opal-irqchip.c +2 -0
index f9a7001dacb7..56a1f7ce78d2 100644
@@ -275,6 +275,8 @@ int __init opal_event_init(void)
 		else
 			name = kasprintf(GFP_KERNEL, "opal");
 
+		if (!name)
+			continue;
 		/* Install interrupt handler */
 		rc = request_irq(r->start, opal_interrupt, r->flags & IRQD_TRIGGER_MASK,
 				 name, NULL);
Signature · 1 line
2.43.0
author maintainer
#18 lore raw

PATCH 18/641 powerpc/powernv: Add a null pointer check in opal_powercap_init()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Kunwu Chan <[email protected]>

[ Upstream commit e123015c0ba859cf48aa7f89c5016cc6e98e018d ]

kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure.

Fixes b9ef7b4b867f ("powerpc: Convert to using %pOFn instead of device_node.name")
---
 arch/powerpc/platforms/powernv/opal-powercap.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/powerpc/platforms/powernv/opal-powercap.c +6 -0
index 7bfe4cbeb35a..ea917266aa17 100644
@@ -196,6 +196,12 @@ void __init opal_powercap_init(void)
 
 		j = 0;
 		pcaps[i].pg.name = kasprintf(GFP_KERNEL, "%pOFn", node);
+		if (!pcaps[i].pg.name) {
+			kfree(pcaps[i].pattrs);
+			kfree(pcaps[i].pg.attrs);
+			goto out_pcaps_pattrs;
+		}
+
 		if (has_min) {
 			powercap_add_attr(min, "powercap-min",
 					  &pcaps[i].pattrs[j]);
Signature · 1 line
2.43.0
author maintainer
#19 lore raw

PATCH 19/641 powerpc/imc-pmu: Add a null pointer check in update_events_in_group()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Kunwu Chan <[email protected]>

[ Upstream commit 0a233867a39078ebb0f575e2948593bbff5826b3 ]

kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure.

Fixes 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support")
---
 arch/powerpc/perf/imc-pmu.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/powerpc/perf/imc-pmu.c +6 -0
index 5d12ca386c1f..8664a7d297ad 100644
@@ -299,6 +299,8 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu)
 	attr_group->attrs = attrs;
 	do {
 		ev_val_str = kasprintf(GFP_KERNEL, "event=0x%x", pmu->events[i].value);
+		if (!ev_val_str)
+			continue;
 		dev_str = device_str_attr_create(pmu->events[i].name, ev_val_str);
 		if (!dev_str)
 			continue;
@@ -306,6 +308,8 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu)
 		attrs[j++] = dev_str;
 		if (pmu->events[i].scale) {
 			ev_scale_str = kasprintf(GFP_KERNEL, "%s.scale", pmu->events[i].name);
+			if (!ev_scale_str)
+				continue;
 			dev_str = device_str_attr_create(ev_scale_str, pmu->events[i].scale);
 			if (!dev_str)
 				continue;
@@ -315,6 +319,8 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu)
 
 		if (pmu->events[i].unit) {
 			ev_unit_str = kasprintf(GFP_KERNEL, "%s.unit", pmu->events[i].name);
+			if (!ev_unit_str)
+				continue;
 			dev_str = device_str_attr_create(ev_unit_str, pmu->events[i].unit);
 			if (!dev_str)
 				continue;
Signature · 1 line
2.43.0
author maintainer
#20 lore raw

PATCH 20/641 sched/fair: Update min_vruntime for reweight_entity() correctly

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Yiwei Lin <[email protected]>

[ Upstream commit 5068d84054b766efe7c6202fc71b2350d1c326f1 ]

Since reweight_entity() may have chance to change the weight of cfs_rq->curr entity, we should also update_min_vruntime() if this is the case

Fixes eab03c23c2a1 ("sched/eevdf: Fix vruntime adjustment on reweight")
---
 kernel/sched/fair.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
kernel/sched/fair.c +10 -10
index d7a3c63a2171..4182fb118ce9 100644
@@ -3811,17 +3811,17 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
 	enqueue_load_avg(cfs_rq, se);
 	if (se->on_rq) {
 		update_load_add(&cfs_rq->load, se->load.weight);
-		if (!curr) {
-			/*
-			 * The entity's vruntime has been adjusted, so let's check
-			 * whether the rq-wide min_vruntime needs updated too. Since
-			 * the calculations above require stable min_vruntime rather
-			 * than up-to-date one, we do the update at the end of the
-			 * reweight process.
-			 */
+		if (!curr)
 			__enqueue_entity(cfs_rq, se);
-			update_min_vruntime(cfs_rq);
-		}
+
+		/*
+		 * The entity's vruntime has been adjusted, so let's check
+		 * whether the rq-wide min_vruntime needs updated too. Since
+		 * the calculations above require stable min_vruntime rather
+		 * than up-to-date one, we do the update at the end of the
+		 * reweight process.
+		 */
+		update_min_vruntime(cfs_rq);
 	}
 }
 
Signature · 1 line
2.43.0
author maintainer
#21 lore raw

PATCH 21/641 perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Alexander Antonov <[email protected]>

[ Upstream commit 1692cf434ba13ee212495b5af795b6a07e986ce4 ]

Get logical socket id instead of physical id in discover_upi_topology() to avoid out-of-bound access on 'upi = &type->topology[nid][idx];' line that leads to NULL pointer dereference in upi_fill_topology()

Fixes f680b6e6062e ("perf/x86/intel/uncore: Enable UPI topology discovery for Icelake Server")
---
 arch/x86/events/intel/uncore_snbep.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
arch/x86/events/intel/uncore_snbep.c +8 -2
index 8250f0f59c2b..49bc27ab26ad 100644
@@ -5596,7 +5596,7 @@ static int discover_upi_topology(struct intel_uncore_type *type, int ubox_did, i
 	struct pci_dev *ubox = NULL;
 	struct pci_dev *dev = NULL;
 	u32 nid, gid;
-	int i, idx, ret = -EPERM;
+	int i, idx, lgc_pkg, ret = -EPERM;
 	struct intel_uncore_topology *upi;
 	unsigned int devfn;
 
@@ -5614,8 +5614,13 @@ static int discover_upi_topology(struct intel_uncore_type *type, int ubox_did, i
 		for (i = 0; i < 8; i++) {
 			if (nid != GIDNIDMAP(gid, i))
 				continue;
+			lgc_pkg = topology_phys_to_logical_pkg(i);
+			if (lgc_pkg < 0) {
+				ret = -EPERM;
+				goto err;
+			}
 			for (idx = 0; idx < type->num_boxes; idx++) {
-				upi = &type->topology[nid][idx];
+				upi = &type->topology[lgc_pkg][idx];
 				devfn = PCI_DEVFN(dev_link0 + idx, ICX_UPI_REGS_ADDR_FUNCTION);
 				dev = pci_get_domain_bus_and_slot(pci_domain_nr(ubox->bus),
 								  ubox->bus->number,
@@ -5626,6 +5631,7 @@ static int discover_upi_topology(struct intel_uncore_type *type, int ubox_did, i
 						goto err;
 				}
 			}
+			break;
 		}
 	}
 err:
Signature · 1 line
2.43.0
author maintainer
#22 lore raw

PATCH 22/641 spi: spi-zynqmp-gqspi: fix driver kconfig dependencies

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Amit Kumar Mahapatra <[email protected]>

[ Upstream commit 424a8166764e462258fdccaaefbdeb07517c8b21 ]

ZynqMP GQSPI driver no longer uses spi-master framework. It had been converted to use spi-mem framework. So remove driver dependency from spi-master and replace it with spi-mem.

Fixes 1c26372e5aa9 ("spi: spi-zynqmp-gqspi: Update driver to use spi-mem framework")
---
 drivers/spi/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/Kconfig +2 -1
index 70c9dd6b6a31..ddae0fde798e 100644
@@ -1177,9 +1177,10 @@ config SPI_ZYNQ_QSPI
 
 config SPI_ZYNQMP_GQSPI
 	tristate "Xilinx ZynqMP GQSPI controller"
-	depends on (SPI_MASTER && HAS_DMA) || COMPILE_TEST
+	depends on (SPI_MEM && HAS_DMA) || COMPILE_TEST
 	help
 	  Enables Xilinx GQSPI controller driver for Zynq UltraScale+ MPSoC.
+	  This controller only supports SPI memory interface.
 
 config SPI_AMD
 	tristate "AMD SPI controller"
Signature · 1 line
2.43.0
author maintainer
#23 lore raw

PATCH 23/641 mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ronald Monthero <[email protected]>

[ Upstream commit 923fb6238cb3ac529aa2bf13b3b1e53762186a8b ]

Under heavy load it is likely that the controller is done with its own task but the thread unlocking the wait is not scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the controller to respond within allowable timeslice of 1 sec.

fsl,ifc-nand 7e800000.nand: Controller is not responding

[<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a) [<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c) [<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c) [<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)

---
 drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/fsl_ifc_nand.c +1 -1
index 20bb1e0cb5eb..f0e2318ce088 100644
@@ -21,7 +21,7 @@
 
 #define ERR_BYTE		0xFF /* Value returned for read
 					bytes when read failed	*/
-#define IFC_TIMEOUT_MSECS	500  /* Maximum number of mSecs to wait
+#define IFC_TIMEOUT_MSECS	1000 /* Maximum timeout to wait
 					for IFC NAND Machine	*/
 
 struct fsl_ifc_ctrl;
Signature · 1 line
2.43.0
author maintainer
#24 lore raw

PATCH 24/641 ACPI: video: check for error while searching for backlight device parent

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nikita Kiryushin <[email protected]>

[ Upstream commit ccd45faf4973746c4f30ea41eec864e5cf191099 ]

If acpi_get_parent() called in acpi_video_dev_register_backlight() fails, for example, because acpi_ut_acquire_mutex() fails inside acpi_get_parent), this can lead to incorrect (uninitialized) acpi_parent handle being passed to acpi_get_pci_dev() for detecting the parent pci device.

Check acpi_get_parent() result and set parent device only in case of success.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 9661e92c10a9 ("acpi: tie ACPI backlight devices to PCI devices if possible")
---
 drivers/acpi/acpi_video.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/acpi/acpi_video.c +6 -6
index 6cee536c229a..375010e575d0 100644
@@ -1713,12 +1713,12 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
 		return;
 	count++;
 
-	acpi_get_parent(device->dev->handle, &acpi_parent);
-
-	pdev = acpi_get_pci_dev(acpi_parent);
-	if (pdev) {
-		parent = &pdev->dev;
-		pci_dev_put(pdev);
+	if (ACPI_SUCCESS(acpi_get_parent(device->dev->handle, &acpi_parent))) {
+		pdev = acpi_get_pci_dev(acpi_parent);
+		if (pdev) {
+			parent = &pdev->dev;
+			pci_dev_put(pdev);
+		}
 	}
 
 	memset(&props, 0, sizeof(struct backlight_properties));
Signature · 1 line
2.43.0
author maintainer
#25 lore raw

PATCH 25/641 ACPI: LPIT: Avoid u32 multiplication overflow

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nikita Kiryushin <[email protected]>

[ Upstream commit 56d2eeda87995245300836ee4dbd13b002311782 ]

In lpit_update_residency() there is a possibility of overflow in multiplication, if tsc_khz is large enough (> UINT_MAX/1000).

Change multiplication to mul_u32_u32().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes eeb2d80d502a ("ACPI / LPIT: Add Low Power Idle Table (LPIT) support")
---
 drivers/acpi/acpi_lpit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_lpit.c +1 -1
index c5598b6d5db8..794962c5c88e 100644
@@ -105,7 +105,7 @@ static void lpit_update_residency(struct lpit_residency_info *info,
 		return;
 
 	info->frequency = lpit_native->counter_frequency ?
-				lpit_native->counter_frequency : tsc_khz * 1000;
+				lpit_native->counter_frequency : mul_u32_u32(tsc_khz, 1000U);
 	if (!info->frequency)
 		info->frequency = 1;
 
Signature · 1 line
2.43.0
author maintainer
#26 lore raw

PATCH 26/641 KEYS: encrypted: Add check for strsep

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Chen Ni <[email protected]>

[ Upstream commit b4af096b5df5dd131ab796c79cedc7069d8f4882 ]

Add check for strsep() in order to transfer the error.

Fixes cd3bc044af48 ("KEYS: encrypted: Instantiate key with user-provided decrypted data")
---
 security/keys/encrypted-keys/encrypted.c | 4 ++++
 1 file changed, 4 insertions(+)
security/keys/encrypted-keys/encrypted.c +4 -0
index 8af2136069d2..76f55dd13cb8 100644
@@ -237,6 +237,10 @@ static int datablob_parse(char *datablob, const char **format,
 			break;
 		}
 		*decrypted_data = strsep(&datablob, " \t");
+		if (!*decrypted_data) {
+			pr_info("encrypted_key: decrypted_data is missing\n");
+			break;
+		}
 		ret = 0;
 		break;
 	case Opt_load:
Signature · 1 line
2.43.0
#27 lore raw

Re: [PATCH 6.7 026/641] KEYS: encrypted: Add check for strsep

Hi Greg,

Quoted 1 line · Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

The upstream patch needs to be reverted. Please don't backport it.

Thanks,

Mimi

Quoted 32 lines

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

From: Chen Ni <[email protected]>

[ Upstream commit b4af096b5df5dd131ab796c79cedc7069d8f4882 ]

Add check for strsep() in order to transfer the error.

Fixes cd3bc044af48 ("KEYS: encrypted: Instantiate key with user-provided decrypted data")
---
 security/keys/encrypted-keys/encrypted.c | 4 ++++
 1 file changed, 4 insertions(+)
security/keys/encrypted-keys/encrypted.c +4 -0
index 8af2136069d2..76f55dd13cb8 100644
@@ -237,6 +237,10 @@ static int datablob_parse(char *datablob, const char **format,
 			break;
 		}
 		*decrypted_data = strsep(&datablob, " \t");
+		if (!*decrypted_data) {
+			pr_info("encrypted_key: decrypted_data is missing\n");
+			break;
+		}
 		ret = 0;
 		break;
 	case Opt_load:
author maintainer
#28 lore raw

PATCH 27/641 spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Yang Yingliang <[email protected]>

[ Upstream commit 5cb475174cce1bfedf1025b6e235e2c43d81144f ]

cqspi_jh7110_clk_init() is called after clk_prepare_enable(cqspi->clk), if it fails, it should goto label 'probe_reset_failed' to disable cqspi->clk.

In the error path after calling cqspi_jh7110_clk_init(), cqspi_jh7110_disable_clk() need be called.

Fixes 33f1ef6d4eb6 ("spi: cadence-quadspi: Add clock configuration for StarFive JH7110 QSPI")
---
 drivers/spi/spi-cadence-quadspi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/spi/spi-cadence-quadspi.c +3 -1
index 3d7bf62da11c..f94e0d370d46 100644
@@ -1840,7 +1840,7 @@ static int cqspi_probe(struct platform_device *pdev)
 		if (ddata->jh7110_clk_init) {
 			ret = cqspi_jh7110_clk_init(pdev, cqspi);
 			if (ret)
-				goto probe_clk_failed;
+				goto probe_reset_failed;
 		}
 
 		if (of_device_is_compatible(pdev->dev.of_node,
@@ -1901,6 +1901,8 @@ static int cqspi_probe(struct platform_device *pdev)
 probe_setup_failed:
 	cqspi_controller_enable(cqspi, 0);
 probe_reset_failed:
+	if (cqspi->is_jh7110)
+		cqspi_jh7110_disable_clk(pdev, cqspi);
 	clk_disable_unprepare(cqspi->clk);
 probe_clk_failed:
 	return ret;
Signature · 1 line
2.43.0
author maintainer
#29 lore raw

PATCH 28/641 platform/x86/intel/vsec: Fix xa_alloc memory leak

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: David E. Box <[email protected]>

[ Upstream commit 8cbcc1dbf8a62c730fadd60de761e0658547a589 ]

Commit 936874b77dd0 ("platform/x86/intel/vsec: Add PCI error recovery support to Intel PMT") added an xarray to track the list of vsec devices to be recovered after a PCI error. But it did not provide cleanup for the list leading to a memory leak that was caught by kmemleak. Do xa_alloc() before devm_add_action_or_reset() so that the list may be cleaned up with xa_erase() in the release function.

Fixes 936874b77dd0 ("platform/x86/intel/vsec: Add PCI error recovery support to Intel PMT")

[[email protected]: Add missing xa_erase() on error-exit

---
 drivers/platform/x86/intel/vsec.c | 25 +++++++++++++++----------
 drivers/platform/x86/intel/vsec.h |  1 +
 2 files changed, 16 insertions(+), 10 deletions(-)
drivers/platform/x86/intel/vsec.c +15 -10
index c1f9e4471b28..343ab6a82c01 100644
@@ -120,6 +120,8 @@ static void intel_vsec_dev_release(struct device *dev)
 {
 	struct intel_vsec_device *intel_vsec_dev = dev_to_ivdev(dev);
 
+	xa_erase(&auxdev_array, intel_vsec_dev->id);
+
 	mutex_lock(&vsec_ida_lock);
 	ida_free(intel_vsec_dev->ida, intel_vsec_dev->auxdev.id);
 	mutex_unlock(&vsec_ida_lock);
@@ -135,19 +137,28 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
 	struct auxiliary_device *auxdev = &intel_vsec_dev->auxdev;
 	int ret, id;
 
-	mutex_lock(&vsec_ida_lock);
-	ret = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
-	mutex_unlock(&vsec_ida_lock);
+	ret = xa_alloc(&auxdev_array, &intel_vsec_dev->id, intel_vsec_dev,
+		       PMT_XA_LIMIT, GFP_KERNEL);
 	if (ret < 0) {
 		kfree(intel_vsec_dev->resource);
 		kfree(intel_vsec_dev);
 		return ret;
 	}
 
+	mutex_lock(&vsec_ida_lock);
+	id = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
+	mutex_unlock(&vsec_ida_lock);
+	if (id < 0) {
+		xa_erase(&auxdev_array, intel_vsec_dev->id);
+		kfree(intel_vsec_dev->resource);
+		kfree(intel_vsec_dev);
+		return id;
+	}
+
 	if (!parent)
 		parent = &pdev->dev;
 
-	auxdev->id = ret;
+	auxdev->id = id;
 	auxdev->name = name;
 	auxdev->dev.parent = parent;
 	auxdev->dev.release = intel_vsec_dev_release;
@@ -169,12 +180,6 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
 	if (ret < 0)
 		return ret;
 
-	/* Add auxdev to list */
-	ret = xa_alloc(&auxdev_array, &id, intel_vsec_dev, PMT_XA_LIMIT,
-		       GFP_KERNEL);
-	if (ret)
-		return ret;
-
 	return 0;
 }
 EXPORT_SYMBOL_NS_GPL(intel_vsec_add_aux, INTEL_VSEC);
drivers/platform/x86/intel/vsec.h +1 -0
index 0fd042c171ba..0a6201b4a0e9 100644
@@ -45,6 +45,7 @@ struct intel_vsec_device {
 	struct ida *ida;
 	struct intel_vsec_platform_info *info;
 	int num_resources;
+	int id; /* xa */
 	void *priv_data;
 	size_t priv_data_size;
 };
Signature · 1 line
2.43.0
author maintainer
#30 lore raw

PATCH 29/641 cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Alexandra Diupina <[email protected]>

[ Upstream commit c4a5118a3ae1eadc687d84eef9431f9e13eb015c ]

devm_of_clk_add_hw_provider() may return an errno, so add a return value check

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
---
 drivers/cpufreq/scmi-cpufreq.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/cpufreq/scmi-cpufreq.c +5 -2
index c8a7ccc42c16..4ee23f4ebf4a 100644
@@ -334,8 +334,11 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev)
 
 #ifdef CONFIG_COMMON_CLK
 	/* dummy clock provider as needed by OPP if clocks property is used */
-	if (of_property_present(dev->of_node, "#clock-cells"))
-		devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
+	if (of_property_present(dev->of_node, "#clock-cells")) {
+		ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
+		if (ret)
+			return dev_err_probe(dev, ret, "%s: registering clock provider failed\n", __func__);
+	}
 #endif
 
 	ret = cpufreq_register_driver(&scmi_cpufreq_driver);
Signature · 1 line
2.43.0
author maintainer
#31 lore raw

PATCH 30/641 calipso: fix memory leak in netlbl_calipso_add_pass()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Gavrilov Ilia <[email protected]>

[ Upstream commit ec4e9d630a64df500641892f4e259e8149594a99 ]

If IPv6 support is disabled at boot (ipv6.disable=1),
the calipso_init() -> netlbl_calipso_ops_register() function isn't called, and the netlbl_calipso_ops_get() function always returns NULL. In this case, the netlbl_calipso_add_pass() function allocates memory for the doi_def variable but doesn't free it with the calipso_doi_free().

BUG: memory leak
unreferenced object 0xffff888011d68180 (size 64):
  comm "syz-executor.1", pid 10746, jiffies 4295410986 (age 17.928s)
  hex dump (first 32 bytes):
    00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<...>] kmalloc include/linux/slab.h:552 [inline]
    [<...>] netlbl_calipso_add_pass net/netlabel/netlabel_calipso.c:76 [inline]
    [<...>] netlbl_calipso_add+0x22e/0x4f0 net/netlabel/netlabel_calipso.c:111
    [<...>] genl_family_rcv_msg_doit+0x22f/0x330 net/netlink/genetlink.c:739
    [<...>] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline]
    [<...>] genl_rcv_msg+0x341/0x5a0 net/netlink/genetlink.c:800
    [<...>] netlink_rcv_skb+0x14d/0x440 net/netlink/af_netlink.c:2515
    [<...>] genl_rcv+0x29/0x40 net/netlink/genetlink.c:811
    [<...>] netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
    [<...>] netlink_unicast+0x54b/0x800 net/netlink/af_netlink.c:1339
    [<...>] netlink_sendmsg+0x90a/0xdf0 net/netlink/af_netlink.c:1934
    [<...>] sock_sendmsg_nosec net/socket.c:651 [inline]
    [<...>] sock_sendmsg+0x157/0x190 net/socket.c:671
    [<...>] ____sys_sendmsg+0x712/0x870 net/socket.c:2342
    [<...>] ___sys_sendmsg+0xf8/0x170 net/socket.c:2396
    [<...>] __sys_sendmsg+0xea/0x1b0 net/socket.c:2429
    [<...>] do_syscall_64+0x30/0x40 arch/x86/entry/common.c:46
    [<...>] entry_SYSCALL_64_after_hwframe+0x61/0xc6

Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with Syzkaller

Fixes cb72d38211ea ("netlabel: Initial support for the CALIPSO netlink protocol.")
[PM: merged via the LSM tree at Jakub Kicinski request]
---
 net/netlabel/netlabel_calipso.c | 49 +++++++++++++++++----------------
 1 file changed, 26 insertions(+), 23 deletions(-)
net/netlabel/netlabel_calipso.c +26 -23
index f1d5b8465217..a07c2216d28b 100644
@@ -54,6 +54,28 @@ static const struct nla_policy calipso_genl_policy[NLBL_CALIPSO_A_MAX + 1] = {
 	[NLBL_CALIPSO_A_MTYPE] = { .type = NLA_U32 },
 };
 
+static const struct netlbl_calipso_ops *calipso_ops;
+
+/**
+ * netlbl_calipso_ops_register - Register the CALIPSO operations
+ * @ops: ops to register
+ *
+ * Description:
+ * Register the CALIPSO packet engine operations.
+ *
+ */
+const struct netlbl_calipso_ops *
+netlbl_calipso_ops_register(const struct netlbl_calipso_ops *ops)
+{
+	return xchg(&calipso_ops, ops);
+}
+EXPORT_SYMBOL(netlbl_calipso_ops_register);
+
+static const struct netlbl_calipso_ops *netlbl_calipso_ops_get(void)
+{
+	return READ_ONCE(calipso_ops);
+}
+
 /* NetLabel Command Handlers
  */
 /**
@@ -96,15 +118,18 @@ static int netlbl_calipso_add_pass(struct genl_info *info,
  *
  */
 static int netlbl_calipso_add(struct sk_buff *skb, struct genl_info *info)
-
 {
 	int ret_val = -EINVAL;
 	struct netlbl_audit audit_info;
+	const struct netlbl_calipso_ops *ops = netlbl_calipso_ops_get();
 
 	if (!info->attrs[NLBL_CALIPSO_A_DOI] ||
 	    !info->attrs[NLBL_CALIPSO_A_MTYPE])
 		return -EINVAL;
 
+	if (!ops)
+		return -EOPNOTSUPP;
+
 	netlbl_netlink_auditinfo(&audit_info);
 	switch (nla_get_u32(info->attrs[NLBL_CALIPSO_A_MTYPE])) {
 	case CALIPSO_MAP_PASS:
@@ -363,28 +388,6 @@ int __init netlbl_calipso_genl_init(void)
 	return genl_register_family(&netlbl_calipso_gnl_family);
 }
 
-static const struct netlbl_calipso_ops *calipso_ops;
-
-/**
- * netlbl_calipso_ops_register - Register the CALIPSO operations
- * @ops: ops to register
- *
- * Description:
- * Register the CALIPSO packet engine operations.
- *
- */
-const struct netlbl_calipso_ops *
-netlbl_calipso_ops_register(const struct netlbl_calipso_ops *ops)
-{
-	return xchg(&calipso_ops, ops);
-}
-EXPORT_SYMBOL(netlbl_calipso_ops_register);
-
-static const struct netlbl_calipso_ops *netlbl_calipso_ops_get(void)
-{
-	return READ_ONCE(calipso_ops);
-}
-
 /**
  * calipso_doi_add - Add a new DOI to the CALIPSO protocol engine
  * @doi_def: the DOI structure
Signature · 1 line
2.43.0
author maintainer
#32 lore raw

PATCH 31/641 efivarfs: force RO when remounting if SetVariable is not supported

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ilias Apalodimas <[email protected]>

[ Upstream commit 0e8d2444168dd519fea501599d150e62718ed2fe ]

If SetVariable at runtime is not supported by the firmware we never assign a callback for that function. At the same time mount the efivarfs as RO so no one can call that. However, we never check the permission flags when someone remounts the filesystem as RW. As a result this leads to a crash looking like this:

$ mount -o remount,rw /sys/firmware/efi/efivars
$ efi-updatevar -f PK.auth PK
[  303.279166] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[  303.280482] Mem abort info:
[  303.280854]   ESR = 0x0000000086000004
[  303.281338]   EC = 0x21: IABT (current EL), IL = 32 bits
[  303.282016]   SET = 0, FnV = 0
[  303.282414]   EA = 0, S1PTW = 0
[  303.282821]   FSC = 0x04: level 0 translation fault
[  303.283771] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004258c000
[  303.284913] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
[  303.286076] Internal error: Oops: 0000000086000004 [#1] PREEMPT SMP
[  303.286936] Modules linked in: qrtr tpm_tis tpm_tis_core crct10dif_ce arm_smccc_trng rng_core drm fuse ip_tables x_tables ipv6
[  303.288586] CPU: 1 PID: 755 Comm: efi-updatevar Not tainted 6.3.0-rc1-00108-gc7d0c4695c68 #1
[  303.289748] Hardware name: Unknown Unknown Product/Unknown Product, BIOS 2023.04-00627-g88336918701d 04/01/2023
[  303.291150] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  303.292123] pc : 0x0
[  303.292443] lr : efivar_set_variable_locked+0x74/0xec
[  303.293156] sp : ffff800008673c10
[  303.293619] x29: ffff800008673c10 x28: ffff0000037e8000 x27: 0000000000000000
[  303.294592] x26: 0000000000000800 x25: ffff000002467400 x24: 0000000000000027
[  303.295572] x23: ffffd49ea9832000 x22: ffff0000020c9800 x21: ffff000002467000
[  303.296566] x20: 0000000000000001 x19: 00000000000007fc x18: 0000000000000000
[  303.297531] x17: 0000000000000000 x16: 0000000000000000 x15: 0000aaaac807ab54
[  303.298495] x14: ed37489f673633c0 x13: 71c45c606de13f80 x12: 47464259e219acf4
[  303.299453] x11: ffff000002af7b01 x10: 0000000000000003 x9 : 0000000000000002
[  303.300431] x8 : 0000000000000010 x7 : ffffd49ea8973230 x6 : 0000000000a85201
[  303.301412] x5 : 0000000000000000 x4 : ffff0000020c9800 x3 : 00000000000007fc
[  303.302370] x2 : 0000000000000027 x1 : ffff000002467400 x0 : ffff000002467000
[  303.303341] Call trace:
[  303.303679]  0x0
[  303.303938]  efivar_entry_set_get_size+0x98/0x16c
[  303.304585]  efivarfs_file_write+0xd0/0x1a4
[  303.305148]  vfs_write+0xc4/0x2e4
[  303.305601]  ksys_write+0x70/0x104
[  303.306073]  __arm64_sys_write+0x1c/0x28
[  303.306622]  invoke_syscall+0x48/0x114
[  303.307156]  el0_svc_common.constprop.0+0x44/0xec
[  303.307803]  do_el0_svc+0x38/0x98
[  303.308268]  el0_svc+0x2c/0x84
[  303.308702]  el0t_64_sync_handler+0xf4/0x120
[  303.309293]  el0t_64_sync+0x190/0x194
[  303.309794] Code: ???????? ???????? ???????? ???????? (????????)
[  303.310612] ---[ end trace 0000000000000000 ]---

Fix this by adding a .reconfigure() function to the fs operations which we can use to check the requested flags and deny anything that's not RO if the firmware doesn't implement SetVariable at runtime.

Fixes f88814cc2578 ("efi/efivars: Expose RT service availability via efivars abstraction")
---
 fs/efivarfs/super.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
fs/efivarfs/super.c +12 -0
index 77240953a92e..869537f1a550 100644
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/magic.h>
 #include <linux/statfs.h>
+#include <linux/printk.h>
 
 #include "internal.h"
 
@@ -333,9 +334,20 @@ static int efivarfs_get_tree(struct fs_context *fc)
 	return get_tree_single(fc, efivarfs_fill_super);
 }
 
+static int efivarfs_reconfigure(struct fs_context *fc)
+{
+	if (!efivar_supports_writes() && !(fc->sb_flags & SB_RDONLY)) {
+		pr_err("Firmware does not support SetVariableRT. Can not remount with rw\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static const struct fs_context_operations efivarfs_context_ops = {
 	.get_tree	= efivarfs_get_tree,
 	.parse_param	= efivarfs_parse_param,
+	.reconfigure	= efivarfs_reconfigure,
 };
 
 static int efivarfs_init_fs_context(struct fs_context *fc)
Signature · 1 line
2.43.0
author maintainer
#33 lore raw

PATCH 32/641 efivarfs: Free s_fs_info on unmount

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ard Biesheuvel <[email protected]>

[ Upstream commit 547713d502f7b4b8efccd409cff84d731a23853b ]

Now that we allocate a s_fs_info struct on fs context creation, we should ensure that we free it again when the superblock goes away.

Fixes 5329aa5101f7 ("efivarfs: Add uid/gid mount options")
---
 fs/efivarfs/super.c | 3 +++
 1 file changed, 3 insertions(+)
fs/efivarfs/super.c +3 -0
index 869537f1a550..edf29c15db77 100644
@@ -368,6 +368,8 @@ static int efivarfs_init_fs_context(struct fs_context *fc)
 
 static void efivarfs_kill_sb(struct super_block *sb)
 {
+	struct efivarfs_fs_info *sfi = sb->s_fs_info;
+
 	kill_litter_super(sb);
 
 	if (!efivar_is_available())
@@ -375,6 +377,7 @@ static void efivarfs_kill_sb(struct super_block *sb)
 
 	/* Remove all entries and destroy */
 	efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL);
+	kfree(sfi);
 }
 
 static struct file_system_type efivarfs_type = {
Signature · 1 line
2.43.0
author maintainer
#34 lore raw

PATCH 33/641 spi: sh-msiof: Enforce fixed DTDL for R-Car H3

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Wolfram Sang <[email protected]>

[ Upstream commit e5c7bcb499840551cfbe85c6df177ebc50432bf0 ]

Documentation says only DTDL of 200 is allowed for this SoC.

Fixes 4286db8456f4 ("spi: sh-msiof: Add R-Car Gen 2 and 3 fallback bindings")
---
 drivers/spi/spi-sh-msiof.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/spi/spi-sh-msiof.c +17 -0
index fb452bc78372..cfc3b1ddbd22 100644
@@ -29,12 +29,15 @@
 
 #include <asm/unaligned.h>
 
+#define SH_MSIOF_FLAG_FIXED_DTDL_200	BIT(0)
+
 struct sh_msiof_chipdata {
 	u32 bits_per_word_mask;
 	u16 tx_fifo_size;
 	u16 rx_fifo_size;
 	u16 ctlr_flags;
 	u16 min_div_pow;
+	u32 flags;
 };
 
 struct sh_msiof_spi_priv {
@@ -1072,6 +1075,16 @@ static const struct sh_msiof_chipdata rcar_gen3_data = {
 	.min_div_pow = 1,
 };
 
+static const struct sh_msiof_chipdata rcar_r8a7795_data = {
+	.bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16) |
+			      SPI_BPW_MASK(24) | SPI_BPW_MASK(32),
+	.tx_fifo_size = 64,
+	.rx_fifo_size = 64,
+	.ctlr_flags = SPI_CONTROLLER_MUST_TX,
+	.min_div_pow = 1,
+	.flags = SH_MSIOF_FLAG_FIXED_DTDL_200,
+};
+
 static const struct of_device_id sh_msiof_match[] __maybe_unused = {
 	{ .compatible = "renesas,sh-mobile-msiof", .data = &sh_data },
 	{ .compatible = "renesas,msiof-r8a7743",   .data = &rcar_gen2_data },
@@ -1082,6 +1095,7 @@ static const struct of_device_id sh_msiof_match[] __maybe_unused = {
 	{ .compatible = "renesas,msiof-r8a7793",   .data = &rcar_gen2_data },
 	{ .compatible = "renesas,msiof-r8a7794",   .data = &rcar_gen2_data },
 	{ .compatible = "renesas,rcar-gen2-msiof", .data = &rcar_gen2_data },
+	{ .compatible = "renesas,msiof-r8a7795",   .data = &rcar_r8a7795_data },
 	{ .compatible = "renesas,msiof-r8a7796",   .data = &rcar_gen3_data },
 	{ .compatible = "renesas,rcar-gen3-msiof", .data = &rcar_gen3_data },
 	{ .compatible = "renesas,rcar-gen4-msiof", .data = &rcar_gen3_data },
@@ -1279,6 +1293,9 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
 		return -ENXIO;
 	}
 
+	if (chipdata->flags & SH_MSIOF_FLAG_FIXED_DTDL_200)
+		info->dtdl = 200;
+
 	if (info->mode == MSIOF_SPI_TARGET)
 		ctlr = spi_alloc_target(&pdev->dev,
 				        sizeof(struct sh_msiof_spi_priv));
Signature · 1 line
2.43.0
author maintainer
#35 lore raw

PATCH 34/641 ACPI: LPSS: Fix the fractional clock divider flags

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Andy Shevchenko <[email protected]>

[ Upstream commit 3ebccf1d1ca74bbb78e6f8c38d1d172e468d91f8 ]

The conversion to CLK_FRAC_DIVIDER_POWER_OF_TWO_PS uses wrong flags in the parameters and hence miscalculates the values in the clock divider. Fix this by applying the flag to the proper parameter.

Fixes 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag")
---
 drivers/acpi/acpi_lpss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpi_lpss.c +2 -1
index 875de44961bf..d48407472dfb 100644
@@ -461,8 +461,9 @@ static int register_device_clock(struct acpi_device *adev,
 		if (!clk_name)
 			return -ENOMEM;
 		clk = clk_register_fractional_divider(NULL, clk_name, parent,
+						      0, prv_base, 1, 15, 16, 15,
 						      CLK_FRAC_DIVIDER_POWER_OF_TWO_PS,
-						      prv_base, 1, 15, 16, 15, 0, NULL);
+						      NULL);
 		parent = clk_name;
 
 		clk_name = kasprintf(GFP_KERNEL, "%s-update", devname);
Signature · 1 line
2.43.0
author maintainer
#36 lore raw

PATCH 35/641 ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Tony Luck <[email protected]>

[ Upstream commit 38c872a9e96f72f2947affc0526cc05659367d3d ]

When both CONFIG_RAS_CEC and CONFIG_ACPI_EXTLOG are enabled, Linux does not clear the status word of the BIOS supplied error record for corrected errors. This may prevent logging of subsequent uncorrected errors.

Fix by clearing the status.

Fixes 23ba710a0864 ("x86/mce: Fix all mce notifiers to update the mce->kflags bitmask")
---
 drivers/acpi/acpi_extlog.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/acpi/acpi_extlog.c +6 -1
index e120a96e1eae..71e8d4e7a36c 100644
@@ -145,9 +145,14 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
 	static u32 err_seq;
 
 	estatus = extlog_elog_entry_check(cpu, bank);
-	if (estatus == NULL || (mce->kflags & MCE_HANDLED_CEC))
+	if (!estatus)
 		return NOTIFY_DONE;
 
+	if (mce->kflags & MCE_HANDLED_CEC) {
+		estatus->block_status = 0;
+		return NOTIFY_DONE;
+	}
+
 	memcpy(elog_buf, (void *)estatus, ELOG_ENTRY_LEN);
 	/* clear record status to enable BIOS to update it again */
 	estatus->block_status = 0;
Signature · 1 line
2.43.0
author maintainer
#37 lore raw

PATCH 36/641 thermal: core: Fix NULL pointer dereference in zone registration error path

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Rafael J. Wysocki <[email protected]>

[ Upstream commit 04e6ccfc93c5a1aa1d75a537cf27e418895e20ea ]

If device_register() in thermal_zone_device_register_with_trips() returns an error, the tz variable is set to NULL and subsequently dereferenced in kfree(tz->tzp).

Commit adc8749b150c ("thermal/drivers/core: Use put_device() if device_register() fails") added the tz = NULL assignment in question to avoid a possible double-free after dropping the reference to the zone device. However, after commit 4649620d9404 ("thermal: core: Make thermal_zone_device_unregister() return after freeing the zone"), that assignment has become redundant, because dropping the reference to the zone device does not cause the zone object to be freed any more.

Drop it to address the NULL pointer dereference.

Fixes 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure")
---
 drivers/thermal/thermal_core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/thermal/thermal_core.c +0 -1
index 9c17d35ccbbd..1bc7ba459406 100644
@@ -1369,7 +1369,6 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
 	device_del(&tz->device);
 release_device:
 	put_device(&tz->device);
-	tz = NULL;
 remove_id:
 	ida_free(&thermal_tz_ida, id);
 free_tzp:
Signature · 1 line
2.43.0
author maintainer
#38 lore raw

PATCH 37/641 kunit: debugfs: Fix unchecked dereference in debugfs_print_results()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Richard Fitzgerald <[email protected]>

[ Upstream commit 34dfd5bb2e5507e69d9b6d6c90f546600c7a4977 ]

Move the call to kunit_suite_has_succeeded() after the check that the kunit_suite pointer is valid.

This was found by smatch:

lib/kunit/debugfs.c:66 debugfs_print_results() warn: variable dereferenced before check 'suite' (see line 63)

Fixes 38289a26e1b8 ("kunit: fix debugfs code to use enum kunit_status, not bool")
---
 lib/kunit/debugfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/kunit/debugfs.c +3 -1
index 270d185737e6..5bfc18ad5fff 100644
@@ -60,12 +60,14 @@ static void debugfs_print_result(struct seq_file *seq, struct string_stream *log
 static int debugfs_print_results(struct seq_file *seq, void *v)
 {
 	struct kunit_suite *suite = (struct kunit_suite *)seq->private;
-	enum kunit_status success = kunit_suite_has_succeeded(suite);
+	enum kunit_status success;
 	struct kunit_case *test_case;
 
 	if (!suite)
 		return 0;
 
+	success = kunit_suite_has_succeeded(suite);
+
 	/* Print KTAP header so the debugfs log can be parsed as valid KTAP. */
 	seq_puts(seq, "KTAP version 1\n");
 	seq_puts(seq, "1..1\n");
Signature · 1 line
2.43.0
author maintainer
#39 lore raw

PATCH 38/641 kunit: debugfs: Handle errors from alloc_string_stream()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Richard Fitzgerald <[email protected]>

[ Upstream commit 1557e89d3af51a4f1bd6870b3117bed651de5dbf ]

In kunit_debugfs_create_suite() give up and skip creating the debugfs file if any of the alloc_string_stream() calls return an error or NULL. Only put a value in the log pointer of kunit_suite and kunit_test if it is a valid pointer to a log.

This prevents the potential invalid dereference reported by smatch:

lib/kunit/debugfs.c:115 kunit_debugfs_create_suite() error: 'suite->log'
dereferencing possible ERR_PTR()
lib/kunit/debugfs.c:119 kunit_debugfs_create_suite() error: 'test_case->log'
dereferencing possible ERR_PTR()

Fixes 05e2006ce493 ("kunit: Use string_stream for test log")
---
 lib/kunit/debugfs.c | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)
lib/kunit/debugfs.c +25 -5
index 5bfc18ad5fff..382706dfb47d 100644
@@ -111,14 +111,28 @@ static const struct file_operations debugfs_results_fops = {
 void kunit_debugfs_create_suite(struct kunit_suite *suite)
 {
 	struct kunit_case *test_case;
+	struct string_stream *stream;
 
-	/* Allocate logs before creating debugfs representation. */
-	suite->log = alloc_string_stream(GFP_KERNEL);
-	string_stream_set_append_newlines(suite->log, true);
+	/*
+	 * Allocate logs before creating debugfs representation.
+	 * The suite->log and test_case->log pointer are expected to be NULL
+	 * if there isn't a log, so only set it if the log stream was created
+	 * successfully.
+	 */
+	stream = alloc_string_stream(GFP_KERNEL);
+	if (IS_ERR_OR_NULL(stream))
+		return;
+
+	string_stream_set_append_newlines(stream, true);
+	suite->log = stream;
 
 	kunit_suite_for_each_test_case(suite, test_case) {
-		test_case->log = alloc_string_stream(GFP_KERNEL);
-		string_stream_set_append_newlines(test_case->log, true);
+		stream = alloc_string_stream(GFP_KERNEL);
+		if (IS_ERR_OR_NULL(stream))
+			goto err;
+
+		string_stream_set_append_newlines(stream, true);
+		test_case->log = stream;
 	}
 
 	suite->debugfs = debugfs_create_dir(suite->name, debugfs_rootdir);
@@ -126,6 +140,12 @@ void kunit_debugfs_create_suite(struct kunit_suite *suite)
 	debugfs_create_file(KUNIT_DEBUGFS_RESULTS, S_IFREG | 0444,
 			    suite->debugfs,
 			    suite, &debugfs_results_fops);
+	return;
+
+err:
+	string_stream_destroy(suite->log);
+	kunit_suite_for_each_test_case(suite, test_case)
+		string_stream_destroy(test_case->log);
 }
 
 void kunit_debugfs_destroy_suite(struct kunit_suite *suite)
Signature · 1 line
2.43.0
author maintainer
#40 lore raw

PATCH 39/641 mtd: Fix gluebi NULL pointer dereference caused by ftl notifier

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: ZhaoLong Wang <[email protected]>

[ Upstream commit a43bdc376deab5fff1ceb93dca55bcab8dbdc1d6 ]

If both ftl.ko and gluebi.ko are loaded, the notifier of ftl triggers NULL pointer dereference when trying to access ‘gluebi->desc’ in gluebi_read().

ubi_gluebi_init
ubi_register_volume_notifier

    ubi_enumerate_volumes
      ubi_notify_all
        gluebi_notify    nb->notifier_call()
          gluebi_create
            mtd_device_register
              mtd_device_parse_register
                add_mtd_device
                  blktrans_notify_add   not->add()
                    ftl_add_mtd         tr->add_mtd()
                      scan_header
                        mtd_read
                          mtd_read_oob
                            mtd_read_oob_std
                              gluebi_read   mtd->read()
                                gluebi->desc - NULL

Detailed reproduction information available at the Link [1],

In the normal case, obtain gluebi->desc in the gluebi_get_device(), and access gluebi->desc in the gluebi_read(). However, gluebi_get_device() is not executed in advance in the ftl_add_mtd() process, which leads to NULL pointer dereference.

The solution for the gluebi module is to run jffs2 on the UBI volume without considering working with ftl or mtdblock [2]. Therefore, this problem can be avoided by preventing gluebi from creating the mtdblock device after creating mtd partition of the type MTD_UBIVOLUME.

---
 drivers/mtd/mtd_blkdevs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/mtd_blkdevs.c +2 -2
index ff18636e0889..5bc32108ca03 100644
@@ -463,7 +463,7 @@ static void blktrans_notify_add(struct mtd_info *mtd)
 {
 	struct mtd_blktrans_ops *tr;
 
-	if (mtd->type == MTD_ABSENT)
+	if (mtd->type == MTD_ABSENT || mtd->type == MTD_UBIVOLUME)
 		return;
 
 	list_for_each_entry(tr, &blktrans_majors, list)
@@ -503,7 +503,7 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
 	mutex_lock(&mtd_table_mutex);
 	list_add(&tr->list, &blktrans_majors);
 	mtd_for_each_device(mtd)
-		if (mtd->type != MTD_ABSENT)
+		if (mtd->type != MTD_ABSENT && mtd->type != MTD_UBIVOLUME)
 			tr->add_mtd(tr, mtd);
 	mutex_unlock(&mtd_table_mutex);
 	return 0;
Signature · 1 line
2.43.0
author maintainer
#41 lore raw

PATCH 40/641 cpuidle: haltpoll: Do not enable interrupts when entering idle

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Borislav Petkov (AMD) <[email protected]>

[ Upstream commit c8f5caec3df84a02b937d6d9cda1f7ffa8dc443f ]

The cpuidle drivers' ->enter() methods are supposed to be IRQ invariant:

5e26aa933911 ("cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls") bb7b11258561 ("cpuidle: Move IRQ state validation")

Do that in the haltpoll driver too.

Fixes 5e26aa933911 ("cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls")
[ rjw: Changelog edits ]
---
 drivers/cpuidle/cpuidle-haltpoll.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/cpuidle/cpuidle-haltpoll.c +4 -5
index e66df22f9695..d8515d5c0853 100644
@@ -25,13 +25,12 @@ MODULE_PARM_DESC(force, "Load unconditionally");
 static struct cpuidle_device __percpu *haltpoll_cpuidle_devices;
 static enum cpuhp_state haltpoll_hp_state;
 
-static int default_enter_idle(struct cpuidle_device *dev,
-			      struct cpuidle_driver *drv, int index)
+static __cpuidle int default_enter_idle(struct cpuidle_device *dev,
+					struct cpuidle_driver *drv, int index)
 {
-	if (current_clr_polling_and_test()) {
-		local_irq_enable();
+	if (current_clr_polling_and_test())
 		return index;
-	}
+
 	arch_cpu_idle();
 	return index;
 }
Signature · 1 line
2.43.0
author maintainer
#42 lore raw

PATCH 41/641 drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Binbin Zhou <[email protected]>

[ Upstream commit 15ef92e9c41124ee9d88b01208364f3fe1f45f84 ]

PTR_ERR() returns -ENODEV when thermal-zones are undefined, and we need -ENODEV as the right value for comparison.

Otherwise, tz->type is NULL when thermal-zones is undefined, resulting in the following error:

[   12.290030] CPU 1 Unable to handle kernel paging request at virtual address fffffffffffffff1, era == 900000000355f410, ra == 90000000031579b8
[   12.302877] Oops[#1]:
[   12.305190] CPU: 1 PID: 181 Comm: systemd-udevd Not tainted 6.6.0-rc7+ #5385
[   12.312304] pc 900000000355f410 ra 90000000031579b8 tp 90000001069e8000 sp 90000001069eba10
[   12.320739] a0 0000000000000000 a1 fffffffffffffff1 a2 0000000000000014 a3 0000000000000001
[   12.329173] a4 90000001069eb990 a5 0000000000000001 a6 0000000000001001 a7 900000010003431c
[   12.337606] t0 fffffffffffffff1 t1 54567fd5da9b4fd4 t2 900000010614ec40 t3 00000000000dc901
[   12.346041] t4 0000000000000000 t5 0000000000000004 t6 900000010614ee20 t7 900000000d00b790
[   12.354472] t8 00000000000dc901 u0 54567fd5da9b4fd4 s9 900000000402ae10 s0 900000010614ec40
[   12.362916] s1 90000000039fced0 s2 ffffffffffffffed s3 ffffffffffffffed s4 9000000003acc000
[   12.362931] s5 0000000000000004 s6 fffffffffffff000 s7 0000000000000490 s8 90000001028b2ec8
[   12.362938]    ra: 90000000031579b8 thermal_add_hwmon_sysfs+0x258/0x300
[   12.386411]   ERA: 900000000355f410 strscpy+0xf0/0x160
[   12.391626]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
[   12.397898]  PRMD: 00000004 (PPLV0 +PIE -PWE)
[   12.403678]  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
[   12.409859]  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
[   12.415882] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
[   12.415907]  BADV: fffffffffffffff1
[   12.415911]  PRID: 0014a000 (Loongson-64bit, Loongson-2K1000)
[   12.415917] Modules linked in: loongson2_thermal(+) vfat fat uio_pdrv_genirq uio fuse zram zsmalloc
[   12.415950] Process systemd-udevd (pid: 181, threadinfo=00000000358b9718, task=00000000ace72fe3)
[   12.415961] Stack : 0000000000000dc0 54567fd5da9b4fd4 900000000402ae10 9000000002df9358
[   12.415982]         ffffffffffffffed 0000000000000004 9000000107a10aa8 90000001002a3410
[   12.415999]         ffffffffffffffed ffffffffffffffed 9000000107a11268 9000000003157ab0
[   12.416016]         9000000107a10aa8 ffffff80020fc0c8 90000001002a3410 ffffffffffffffed
[   12.416032]         0000000000000024 ffffff80020cc1e8 900000000402b2a0 9000000003acc000
[   12.416048]         90000001002a3410 0000000000000000 ffffff80020f4030 90000001002a3410
[   12.416065]         0000000000000000 9000000002df6808 90000001002a3410 0000000000000000
[   12.416081]         ffffff80020f4030 0000000000000000 90000001002a3410 9000000002df2ba8
[   12.416097]         00000000000000b4 90000001002a34f4 90000001002a3410 0000000000000002
[   12.416114]         ffffff80020f4030 fffffffffffffff0 90000001002a3410 9000000002df2f30
[   12.416131]         ...
[   12.416138] Call Trace:
[   12.416142] [<900000000355f410>] strscpy+0xf0/0x160
[   12.416167] [<90000000031579b8>] thermal_add_hwmon_sysfs+0x258/0x300
[   12.416183] [<9000000003157ab0>] devm_thermal_add_hwmon_sysfs+0x50/0xe0
[   12.416200] [<ffffff80020cc1e8>] loongson2_thermal_probe+0x128/0x200 [loongson2_thermal]
[   12.416232] [<9000000002df6808>] platform_probe+0x68/0x140
[   12.416249] [<9000000002df2ba8>] really_probe+0xc8/0x3c0
[   12.416269] [<9000000002df2f30>] __driver_probe_device+0x90/0x180
[   12.416286] [<9000000002df3058>] driver_probe_device+0x38/0x160
[   12.416302] [<9000000002df33a8>] __driver_attach+0xa8/0x200
[   12.416314] [<9000000002deffec>] bus_for_each_dev+0x8c/0x120
[   12.416330] [<9000000002df198c>] bus_add_driver+0x10c/0x2a0
[   12.416346] [<9000000002df46b4>] driver_register+0x74/0x160
[   12.416358] [<90000000022201a4>] do_one_initcall+0x84/0x220
[   12.416372] [<90000000022f3ab8>] do_init_module+0x58/0x2c0
[   12.416386] [<90000000022f6538>] init_module_from_file+0x98/0x100
[   12.416399] [<90000000022f67f0>] sys_finit_module+0x230/0x3c0
[   12.416412] [<900000000358f7c8>] do_syscall+0x88/0xc0
[   12.416431] [<900000000222137c>] handle_syscall+0xbc/0x158
---
 drivers/thermal/loongson2_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/loongson2_thermal.c +1 -1
index 133098dc0854..99ca0c7bc41c 100644
@@ -127,7 +127,7 @@ static int loongson2_thermal_probe(struct platform_device *pdev)
 		if (!IS_ERR(tzd))
 			break;
 
-		if (PTR_ERR(tzd) != ENODEV)
+		if (PTR_ERR(tzd) != -ENODEV)
 			continue;
 
 		return dev_err_probe(dev, PTR_ERR(tzd), "failed to register");
Signature · 1 line
2.43.0
author maintainer
#43 lore raw

PATCH 42/641 selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Mickaël Salaün <[email protected]>

[ Upstream commit bbf5a1d0e5d0fb3bdf90205aa872636122692a50 ]

The IPv6 network stack first checks the sockaddr length (-EINVAL error) before checking the family (-EAFNOSUPPORT error).

This was discovered thanks to commit a549d055a22e ("selftests/landlock:
Add network tests").

Cc Eric Paris <[email protected]>
Cc Konstantin Meskhidze <[email protected]>
Cc Paul Moore <[email protected]>
Cc Stephen Smalley <[email protected]>
Fixes 0f8db8cc73df ("selinux: add AF_UNSPEC and INADDR_ANY checks to selinux_socket_bind()")
---
 security/selinux/hooks.c | 7 +++++++
 1 file changed, 7 insertions(+)
security/selinux/hooks.c +7 -0
index 340b2bbbb2dd..0fb890bd72cb 100644
@@ -4661,6 +4661,13 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
 				return -EINVAL;
 			addr4 = (struct sockaddr_in *)address;
 			if (family_sa == AF_UNSPEC) {
+				if (family == PF_INET6) {
+					/* Length check from inet6_bind_sk() */
+					if (addrlen < SIN6_LEN_RFC2133)
+						return -EINVAL;
+					/* Family check from __inet6_bind() */
+					goto err_af;
+				}
 				/* see __inet_bind(), we only want to allow
 				 * AF_UNSPEC if the address is INADDR_ANY
 				 */
Signature · 1 line
2.43.0
author maintainer
#44 lore raw

PATCH 43/641 crypto: rsa - add a check for allocation failure

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Dan Carpenter <[email protected]>

[ Upstream commit d872ca165cb67112f2841ef9c37d51ef7e63d1e4 ]

Static checkers insist that the mpi_alloc() allocation can fail so add a check to prevent a NULL dereference. Small allocations like this can't actually fail in current kernels, but adding a check is very simple and makes the static checkers happy.

Fixes 6637e11e4ad2 ("crypto: rsa - allow only odd e and restrict value in FIPS mode")
---
 crypto/rsa.c | 2 ++
 1 file changed, 2 insertions(+)
crypto/rsa.c +2 -0
index c79613cdce6e..b9cd11fb7d36 100644
@@ -220,6 +220,8 @@ static int rsa_check_exponent_fips(MPI e)
 	}
 
 	e_max = mpi_alloc(0);
+	if (!e_max)
+		return -ENOMEM;
 	mpi_set_bit(e_max, 256);
 
 	if (mpi_cmp(e, e_max) >= 0) {
Signature · 1 line
2.43.0
author maintainer
#45 lore raw

PATCH 44/641 crypto: qat - prevent underflow in rp2srv_store()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Dan Carpenter <[email protected]>

[ Upstream commit e53c741303a59ee1682e11f61b7772863e02526d ]

The "ring" variable has an upper bounds check but nothing checks for negatives. This code uses kstrtouint() already and it was obviously intended to be declared as unsigned int. Make it so.

Fixes dbc8876dd873 ("crypto: qat - add rp2svc sysfs attribute")
---
 drivers/crypto/intel/qat/qat_common/adf_sysfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/intel/qat/qat_common/adf_sysfs.c +2 -1
index ddffc98119c6..6f0b3629da13 100644
@@ -242,7 +242,8 @@ static ssize_t rp2srv_store(struct device *dev, struct device_attribute *attr,
 			    const char *buf, size_t count)
 {
 	struct adf_accel_dev *accel_dev;
-	int ring, num_rings, ret;
+	int num_rings, ret;
+	unsigned int ring;
 
 	accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
 	if (!accel_dev)
Signature · 1 line
2.43.0
author maintainer
#46 lore raw

PATCH 45/641 crypto: jh7110 - Correct deferred probe return

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Chanho Park <[email protected]>

[ Upstream commit d57343022b71b9f41e731282dbe0baf0cff6ada8 ]

This fixes list_add corruption error when the driver is returned with -EPROBE_DEFER. It is also required to roll back the previous probe sequences in case of deferred_probe. So, this removes 'err_probe_defer" goto label and just use err_dma_init instead.

Fixes 42ef0e944b01 ("crypto: starfive - Add crypto engine support")
---
 drivers/crypto/starfive/jh7110-cryp.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/crypto/starfive/jh7110-cryp.c +3 -7
index 08e974e0dd12..3a67ddc4d936 100644
@@ -180,12 +180,8 @@ static int starfive_cryp_probe(struct platform_device *pdev)
 	spin_unlock(&dev_list.lock);
 
 	ret = starfive_dma_init(cryp);
-	if (ret) {
-		if (ret == -EPROBE_DEFER)
-			goto err_probe_defer;
-		else
-			goto err_dma_init;
-	}
+	if (ret)
+		goto err_dma_init;
 
 	/* Initialize crypto engine */
 	cryp->engine = crypto_engine_alloc_init(&pdev->dev, 1);
@@ -233,7 +229,7 @@ static int starfive_cryp_probe(struct platform_device *pdev)
 
 	tasklet_kill(&cryp->aes_done);
 	tasklet_kill(&cryp->hash_done);
-err_probe_defer:
+
 	return ret;
 }
 
Signature · 1 line
2.43.0
author maintainer
#47 lore raw

PATCH 46/641 crypto: virtio - Handle dataq logic with tasklet

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Gonglei (Arei) <[email protected]>

[ Upstream commit fed93fb62e05c38152b0fc1dc9609639e63eed76 ]

Doing ipsec produces a spinlock recursion warning.
This is due to crypto_finalize_request() being called in the upper half. Move virtual data queue processing of virtio-crypto driver to tasklet.

Fixes dbaf0624ffa57 ("crypto: add virtio-crypto driver")
---
 drivers/crypto/virtio/virtio_crypto_common.h |  2 ++
 drivers/crypto/virtio/virtio_crypto_core.c   | 23 +++++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)
drivers/crypto/virtio/virtio_crypto_common.h +2 -0
index 154590e1f764..7059bbe5a2eb 100644
@@ -10,6 +10,7 @@
 #include <linux/virtio.h>
 #include <linux/crypto.h>
 #include <linux/spinlock.h>
+#include <linux/interrupt.h>
 #include <crypto/aead.h>
 #include <crypto/aes.h>
 #include <crypto/engine.h>
@@ -28,6 +29,7 @@ struct data_queue {
 	char name[32];
 
 	struct crypto_engine *engine;
+	struct tasklet_struct done_task;
 };
 
 struct virtio_crypto {
drivers/crypto/virtio/virtio_crypto_core.c +13 -10
index 43a0838d31ff..428d76562447 100644
@@ -72,27 +72,28 @@ int virtio_crypto_ctrl_vq_request(struct virtio_crypto *vcrypto, struct scatterl
 	return 0;
 }
 
-static void virtcrypto_dataq_callback(struct virtqueue *vq)
+static void virtcrypto_done_task(unsigned long data)
 {
-	struct virtio_crypto *vcrypto = vq->vdev->priv;
+	struct data_queue *data_vq = (struct data_queue *)data;
+	struct virtqueue *vq = data_vq->vq;
 	struct virtio_crypto_request *vc_req;
-	unsigned long flags;
 	unsigned int len;
-	unsigned int qid = vq->index;
 
-	spin_lock_irqsave(&vcrypto->data_vq[qid].lock, flags);
 	do {
 		virtqueue_disable_cb(vq);
 		while ((vc_req = virtqueue_get_buf(vq, &len)) != NULL) {
-			spin_unlock_irqrestore(
-				&vcrypto->data_vq[qid].lock, flags);
 			if (vc_req->alg_cb)
 				vc_req->alg_cb(vc_req, len);
-			spin_lock_irqsave(
-				&vcrypto->data_vq[qid].lock, flags);
 		}
 	} while (!virtqueue_enable_cb(vq));
-	spin_unlock_irqrestore(&vcrypto->data_vq[qid].lock, flags);
+}
+
+static void virtcrypto_dataq_callback(struct virtqueue *vq)
+{
+	struct virtio_crypto *vcrypto = vq->vdev->priv;
+	struct data_queue *dq = &vcrypto->data_vq[vq->index];
+
+	tasklet_schedule(&dq->done_task);
 }
 
 static int virtcrypto_find_vqs(struct virtio_crypto *vi)
@@ -150,6 +151,8 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi)
 			ret = -ENOMEM;
 			goto err_engine;
 		}
+		tasklet_init(&vi->data_vq[i].done_task, virtcrypto_done_task,
+				(unsigned long)&vi->data_vq[i]);
 	}
 
 	kfree(names);
Signature · 1 line
2.43.0
author maintainer
#48 lore raw

PATCH 47/641 crypto: qat - add sysfs_added flag for ras

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Damian Muszynski <[email protected]>

[ Upstream commit 65089000ba8c2ae713ccac6603319143f3e1c08b ]

The qat_ras sysfs attribute group is registered within the adf_dev_start() function, alongside other driver components. If any of the functions preceding the group registration fails, the adf_dev_start() function returns, and the caller, to undo the operation, invokes adf_dev_stop() followed by adf_dev_shutdown(). However, the current flow lacks information about whether the registration of the qat_ras attribute group was successful or not.

In cases where this condition is encountered, an error similar to the following might be reported:

    4xxx 0000:6b:00.0: Starting device qat_dev0
    4xxx 0000:6b:00.0: qat_dev0 started 9 acceleration engines
    4xxx 0000:6b:00.0: Failed to send init message
    4xxx 0000:6b:00.0: Failed to start device qat_dev0
    sysfs group 'qat_ras' not found for kobject '0000:6b:00.0'
    ...
    sysfs_remove_groups+0x29/0x50
    adf_sysfs_stop_ras+0x4b/0x80 [intel_qat]
    adf_dev_stop+0x43/0x1d0 [intel_qat]
    adf_dev_down+0x4b/0x150 [intel_qat]
    ...
    4xxx 0000:6b:00.0: qat_dev0 stopped 9 acceleration engines
    4xxx 0000:6b:00.0: Resetting device qat_dev0

To prevent attempting to remove attributes from a group that has not been added yet, a flag named 'sysfs_added' is introduced. This flag is set to true upon the successful registration of the attribute group.

Fixes 532d7f6bc458 ("crypto: qat - add error counters")
---
 drivers/crypto/intel/qat/qat_common/adf_accel_devices.h    | 1 +
 .../crypto/intel/qat/qat_common/adf_sysfs_ras_counters.c   | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/crypto/intel/qat/qat_common/adf_accel_devices.h +1 -0
index 4ff5729a3496..9d5fdd529a2e 100644
@@ -92,6 +92,7 @@ enum ras_errors {
 
 struct adf_error_counters {
 	atomic_t counter[ADF_RAS_ERRORS];
+	bool sysfs_added;
 	bool enabled;
 };
 
drivers/crypto/intel/qat/qat_common/adf_sysfs_ras_counters.c +6 -1
index cffe2d722995..e97c67c87b3c 100644
@@ -99,6 +99,8 @@ void adf_sysfs_start_ras(struct adf_accel_dev *accel_dev)
 	if (device_add_group(&GET_DEV(accel_dev), &qat_ras_group))
 		dev_err(&GET_DEV(accel_dev),
 			"Failed to create qat_ras attribute group.\n");
+
+	accel_dev->ras_errors.sysfs_added = true;
 }
 
 void adf_sysfs_stop_ras(struct adf_accel_dev *accel_dev)
@@ -106,7 +108,10 @@ void adf_sysfs_stop_ras(struct adf_accel_dev *accel_dev)
 	if (!accel_dev->ras_errors.enabled)
 		return;
 
-	device_remove_group(&GET_DEV(accel_dev), &qat_ras_group);
+	if (accel_dev->ras_errors.sysfs_added) {
+		device_remove_group(&GET_DEV(accel_dev), &qat_ras_group);
+		accel_dev->ras_errors.sysfs_added = false;
+	}
 
 	ADF_RAS_ERR_CTR_CLEAR(accel_dev->ras_errors);
 }
Signature · 1 line
2.43.0
author maintainer
#49 lore raw

PATCH 48/641 crypto: qat - add sysfs_added flag for rate limiting

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Damian Muszynski <[email protected]>

[ Upstream commit d71fdd0f3c278c7f132c3a522645ebf9157edd6d ]

The qat_rl sysfs attribute group is registered within the adf_dev_start() function, alongside other driver components.
If any of the functions preceding the group registration fails, the adf_dev_start() function returns, and the caller, to undo the operation, invokes adf_dev_stop() followed by adf_dev_shutdown(). However, the current flow lacks information about whether the registration of the qat_rl attribute group was successful or not.

In cases where this condition is encountered, an error similar to the following might be reported:

    4xxx 0000:6b:00.0: Starting device qat_dev0
    4xxx 0000:6b:00.0: qat_dev0 started 9 acceleration engines
    4xxx 0000:6b:00.0: Failed to send init message
    4xxx 0000:6b:00.0: Failed to start device qat_dev0
    sysfs group 'qat_rl' not found for kobject '0000:6b:00.0'
    ...
    sysfs_remove_groups+0x2d/0x50
    adf_sysfs_rl_rm+0x44/0x70 [intel_qat]
    adf_rl_stop+0x2d/0xb0 [intel_qat]
    adf_dev_stop+0x33/0x1d0 [intel_qat]
    adf_dev_down+0xf1/0x150 [intel_qat]
    ...
    4xxx 0000:6b:00.0: qat_dev0 stopped 9 acceleration engines
    4xxx 0000:6b:00.0: Resetting device qat_dev0

To prevent attempting to remove attributes from a group that has not been added yet, a flag named 'sysfs_added' is introduced. This flag is set to true upon the successful registration of the attribute group.

Fixes d9fb8408376e ("crypto: qat - add rate limiting feature to qat_4xxx")
---
 drivers/crypto/intel/qat/qat_common/adf_rl.h       | 1 +
 drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c | 8 ++++++++
 2 files changed, 9 insertions(+)
drivers/crypto/intel/qat/qat_common/adf_rl.h +1 -0
index eb5a330f8543..269c6656fb90 100644
@@ -79,6 +79,7 @@ struct adf_rl_interface_data {
 	struct adf_rl_sla_input_data input;
 	enum adf_base_services cap_rem_srv;
 	struct rw_semaphore lock;
+	bool sysfs_added;
 };
 
 struct adf_rl_hw_data {
drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c +8 -0
index abf9c52474ec..bedb514d4e30 100644
@@ -441,11 +441,19 @@ int adf_sysfs_rl_add(struct adf_accel_dev *accel_dev)
 
 	data->cap_rem_srv = ADF_SVC_NONE;
 	data->input.srv = ADF_SVC_NONE;
+	data->sysfs_added = true;
 
 	return ret;
 }
 
 void adf_sysfs_rl_rm(struct adf_accel_dev *accel_dev)
 {
+	struct adf_rl_interface_data *data;
+
+	data = &GET_RL_STRUCT(accel_dev);
+	if (!data->sysfs_added)
+		return;
+
 	device_remove_group(&GET_DEV(accel_dev), &qat_rl_group);
+	data->sysfs_added = false;
 }
Signature · 1 line
2.43.0
author maintainer
#50 lore raw

PATCH 49/641 crypto: sa2ul - Return crypto_aead_setkey to transfer the error

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Chen Ni <[email protected]>

[ Upstream commit ce852f1308ac738e61c5b2502517deea593a1554 ]

Return crypto_aead_setkey() in order to transfer the error if it fails.

Fixes d2c8ac187fc9 ("crypto: sa2ul - Add AEAD algorithm support")
---
 drivers/crypto/sa2ul.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/sa2ul.c +1 -2
index 6846a8429574..78a4930c6480 100644
@@ -1869,9 +1869,8 @@ static int sa_aead_setkey(struct crypto_aead *authenc,
 	crypto_aead_set_flags(ctx->fallback.aead,
 			      crypto_aead_get_flags(authenc) &
 			      CRYPTO_TFM_REQ_MASK);
-	crypto_aead_setkey(ctx->fallback.aead, key, keylen);
 
-	return 0;
+	return crypto_aead_setkey(ctx->fallback.aead, key, keylen);
 }
 
 static int sa_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
Signature · 1 line
2.43.0
author maintainer
#51 lore raw

PATCH 50/641 crypto: ccp - fix memleak in ccp_init_dm_workarea

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Dinghao Liu <[email protected]>

[ Upstream commit a1c95dd5bc1d6a5d7a75a376c2107421b7d6240d ]

When dma_map_single() fails, wa->address is supposed to be freed by the callers of ccp_init_dm_workarea() through ccp_dm_free(). However, many of the call spots don't expect to have to call ccp_dm_free() on failure of ccp_init_dm_workarea(), which may lead to a memleak. Let's free wa->address in ccp_init_dm_workarea() when dma_map_single() fails.

Fixes 63b945091a07 ("crypto: ccp - CCP device driver and interface support")
---
 drivers/crypto/ccp/ccp-ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/crypto/ccp/ccp-ops.c +4 -1
index aa4e1a500691..cb8e99936abb 100644
@@ -179,8 +179,11 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa,
 
 		wa->dma.address = dma_map_single(wa->dev, wa->address, len,
 						 dir);
-		if (dma_mapping_error(wa->dev, wa->dma.address))
+		if (dma_mapping_error(wa->dev, wa->dma.address)) {
+			kfree(wa->address);
+			wa->address = NULL;
 			return -ENOMEM;
+		}
 
 		wa->dma.length = len;
 	}
Signature · 1 line
2.43.0
author maintainer
#52 lore raw

PATCH 51/641 crypto: af_alg - Disallow multiple in-flight AIO requests

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Herbert Xu <[email protected]>

[ Upstream commit 67b164a871af1d736f131fd6fe78a610909f06f3 ]

Having multiple in-flight AIO requests results in unpredictable output because they all share the same IV. Fix this by only allowing one request at a time.

Fixes 83094e5e9e49 ("crypto: af_alg - add async support to algif_aead")
Fixes a596999b7ddf ("crypto: algif - change algif_skcipher to be asynchronous")
---
 crypto/af_alg.c         | 14 +++++++++++++-
 include/crypto/if_alg.h |  3 +++
 2 files changed, 16 insertions(+), 1 deletion(-)
crypto/af_alg.c +13 -1
index ea6fb8e89d06..68cc9290cabe 100644
@@ -1116,9 +1116,13 @@ EXPORT_SYMBOL_GPL(af_alg_sendmsg);
 void af_alg_free_resources(struct af_alg_async_req *areq)
 {
 	struct sock *sk = areq->sk;
+	struct af_alg_ctx *ctx;
 
 	af_alg_free_areq_sgls(areq);
 	sock_kfree_s(sk, areq, areq->areqlen);
+
+	ctx = alg_sk(sk)->private;
+	ctx->inflight = false;
 }
 EXPORT_SYMBOL_GPL(af_alg_free_resources);
 
@@ -1188,11 +1192,19 @@ EXPORT_SYMBOL_GPL(af_alg_poll);
 struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk,
 					   unsigned int areqlen)
 {
-	struct af_alg_async_req *areq = sock_kmalloc(sk, areqlen, GFP_KERNEL);
+	struct af_alg_ctx *ctx = alg_sk(sk)->private;
+	struct af_alg_async_req *areq;
+
+	/* Only one AIO request can be in flight. */
+	if (ctx->inflight)
+		return ERR_PTR(-EBUSY);
 
+	areq = sock_kmalloc(sk, areqlen, GFP_KERNEL);
 	if (unlikely(!areq))
 		return ERR_PTR(-ENOMEM);
 
+	ctx->inflight = true;
+
 	areq->areqlen = areqlen;
 	areq->sk = sk;
 	areq->first_rsgl.sgl.sgt.sgl = areq->first_rsgl.sgl.sgl;
include/crypto/if_alg.h +3 -0
index ef8ce86b1f78..08b803a4fcde 100644
@@ -136,6 +136,7 @@ struct af_alg_async_req {
  *			recvmsg is invoked.
  * @init:		True if metadata has been sent.
  * @len:		Length of memory allocated for this data structure.
+ * @inflight:		Non-zero when AIO requests are in flight.
  */
 struct af_alg_ctx {
 	struct list_head tsgl_list;
@@ -154,6 +155,8 @@ struct af_alg_ctx {
 	bool init;
 
 	unsigned int len;
+
+	unsigned int inflight;
 };
 
 int af_alg_register_type(const struct af_alg_type *type);
Signature · 1 line
2.43.0
author maintainer
#53 lore raw

PATCH 52/641 crypto: qat - fix error path in add_update_sla()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Damian Muszynski <[email protected]>

[ Upstream commit 6627f03c21cb7001ae4dbbfb7a8514516d02331c ]

The input argument sla_in is a pointer to a structure that contains the parameters of the SLA which is being added or updated. If this pointer is NULL, the function should return an error as the data required for the algorithm is not available.
By mistake, the logic jumps to the error path which dereferences the pointer.

This results in a warnings reported by the static analyzer Smatch when executed without a database:

drivers/crypto/intel/qat/qat_common/adf_rl.c:871 add_update_sla()
error: we previously assumed 'sla_in' could be null (see line 812)

This issue was not found in internal testing as the pointer cannot be NULL. The function add_update_sla() is only called (indirectly) by the rate limiting sysfs interface implementation in adf_sysfs_rl.c which ensures that the data structure is allocated and valid. This is also proven by the fact that Smatch executed with a database does not report such error.

Fix it by returning with error if the pointer sla_in is NULL.

Fixes d9fb8408376e ("crypto: qat - add rate limiting feature to qat_4xxx")
---
 drivers/crypto/intel/qat/qat_common/adf_rl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/intel/qat/qat_common/adf_rl.c +1 -2
index 86e3e2152b1b..f2de3cd7d05d 100644
@@ -812,8 +812,7 @@ static int add_update_sla(struct adf_accel_dev *accel_dev,
 	if (!sla_in) {
 		dev_warn(&GET_DEV(accel_dev),
 			 "SLA input data pointer is missing\n");
-		ret = -EFAULT;
-		goto ret_err;
+		return -EFAULT;
 	}
 
 	/* Input validation */
Signature · 1 line
2.43.0
author maintainer
#54 lore raw

PATCH 53/641 crypto: qat - fix mutex ordering in adf_rl

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Damian Muszynski <[email protected]>

[ Upstream commit 487caa8d5ef9a9a27b092c5790d529a7a0c24f8b ]

If the function validate_user_input() returns an error, the error path attempts to unlock an unacquired mutex.
Acquire the mutex before calling validate_user_input(). This is not strictly necessary but simplifies the code.

Fixes d9fb8408376e ("crypto: qat - add rate limiting feature to qat_4xxx")
---
 drivers/crypto/intel/qat/qat_common/adf_rl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/intel/qat/qat_common/adf_rl.c +2 -2
index f2de3cd7d05d..de1b214dba1f 100644
@@ -815,13 +815,13 @@ static int add_update_sla(struct adf_accel_dev *accel_dev,
 		return -EFAULT;
 	}
 
+	mutex_lock(&rl_data->rl_lock);
+
 	/* Input validation */
 	ret = validate_user_input(accel_dev, sla_in, is_update);
 	if (ret)
 		goto ret_err;
 
-	mutex_lock(&rl_data->rl_lock);
-
 	if (is_update) {
 		ret = validate_sla_id(accel_dev, sla_in->sla_id);
 		if (ret)
Signature · 1 line
2.43.0
author maintainer
#55 lore raw

PATCH 54/641 crypto: qat - add NULL pointer check

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Giovanni Cabiddu <[email protected]>

[ Upstream commit a643212c9f28d09225c3792c316bc4aaf6be4a68 ]

There is a possibility that the function adf_devmgr_pci_to_accel_dev() might return a NULL pointer.
Add a NULL pointer check in the function rp2srv_show().

Fixes dbc8876dd873 ("crypto: qat - add rp2svc sysfs attribute")
---
 drivers/crypto/intel/qat/qat_common/adf_sysfs.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/intel/qat/qat_common/adf_sysfs.c +3 -0
index 6f0b3629da13..d450dad32c9e 100644
@@ -215,6 +215,9 @@ static ssize_t rp2srv_show(struct device *dev, struct device_attribute *attr,
 	enum adf_cfg_service_type svc;
 
 	accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
+	if (!accel_dev)
+		return -EINVAL;
+
 	hw_data = GET_HW_DATA(accel_dev);
 
 	if (accel_dev->sysfs.ring_num == UNSET_RING_NUM)
Signature · 1 line
2.43.0
author maintainer
#56 lore raw

PATCH 55/641 hwrng: stm32 - add missing clk_disable_unprepare() in stm32_rng_init()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Yang Yingliang <[email protected]>

[ Upstream commit 429fec81d12266e6402868672de8c68bf4d8db13 ]

Add clk_disable_unprepare() in the error path in stm32_rng_init().

Fixes 6b85a7e141cb ("hwrng: stm32 - implement STM32MP13x support")
---
 drivers/char/hw_random/stm32-rng.c | 1 +
 1 file changed, 1 insertion(+)
drivers/char/hw_random/stm32-rng.c +1 -0
index 41e1dbea5d2e..efd6edcd7066 100644
@@ -325,6 +325,7 @@ static int stm32_rng_init(struct hwrng *rng)
 							(!(reg & RNG_CR_CONDRST)),
 							10, 50000);
 		if (err) {
+			clk_disable_unprepare(priv->clk);
 			dev_err((struct device *)priv->rng.priv,
 				"%s: timeout %x!\n", __func__, reg);
 			return -EINVAL;
Signature · 1 line
2.43.0
author maintainer
#57 lore raw

PATCH 56/641 crypto: safexcel - Add error handling for dma_map_sg() calls

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nikita Zhandarovich <[email protected]>

[ Upstream commit 87e02063d07708cac5bfe9fd3a6a242898758ac8 ]

Macro dma_map_sg() may return 0 on error. This patch enables checks in case of the macro failure and ensures unmapping of previously mapped buffers with dma_unmap_sg().

Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE.

Fixes 49186a7d9e46 ("crypto: inside_secure - Avoid dma map if size is zero")
---
 .../crypto/inside-secure/safexcel_cipher.c    | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/crypto/inside-secure/safexcel_cipher.c +11 -8
index 272c28b5a088..b83818634ae4 100644
@@ -742,9 +742,9 @@ static int safexcel_send_req(struct crypto_async_request *base, int ring,
 				max(totlen_src, totlen_dst));
 			return -EINVAL;
 		}
-		if (sreq->nr_src > 0)
-			dma_map_sg(priv->dev, src, sreq->nr_src,
-				   DMA_BIDIRECTIONAL);
+		if (sreq->nr_src > 0 &&
+		    !dma_map_sg(priv->dev, src, sreq->nr_src, DMA_BIDIRECTIONAL))
+			return -EIO;
 	} else {
 		if (unlikely(totlen_src && (sreq->nr_src <= 0))) {
 			dev_err(priv->dev, "Source buffer not large enough (need %d bytes)!",
@@ -752,8 +752,9 @@ static int safexcel_send_req(struct crypto_async_request *base, int ring,
 			return -EINVAL;
 		}
 
-		if (sreq->nr_src > 0)
-			dma_map_sg(priv->dev, src, sreq->nr_src, DMA_TO_DEVICE);
+		if (sreq->nr_src > 0 &&
+		    !dma_map_sg(priv->dev, src, sreq->nr_src, DMA_TO_DEVICE))
+			return -EIO;
 
 		if (unlikely(totlen_dst && (sreq->nr_dst <= 0))) {
 			dev_err(priv->dev, "Dest buffer not large enough (need %d bytes)!",
@@ -762,9 +763,11 @@ static int safexcel_send_req(struct crypto_async_request *base, int ring,
 			goto unmap;
 		}
 
-		if (sreq->nr_dst > 0)
-			dma_map_sg(priv->dev, dst, sreq->nr_dst,
-				   DMA_FROM_DEVICE);
+		if (sreq->nr_dst > 0 &&
+		    !dma_map_sg(priv->dev, dst, sreq->nr_dst, DMA_FROM_DEVICE)) {
+			ret = -EIO;
+			goto unmap;
+		}
 	}
 
 	memcpy(ctx->base.ctxr->data, ctx->key, ctx->key_len);
Signature · 1 line
2.43.0
author maintainer
#58 lore raw

PATCH 57/641 crypto: sahara - remove FLAGS_NEW_KEY logic

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit 8fd183435728b139248a77978ea3732039341779 ]

Remove the FLAGS_NEW_KEY logic as it has the following issues:
- the wrong key may end up being used when there are multiple data streams:
t1 t2
setkey()
encrypt()
setkey()
encrypt()

encrypt() <--- key from t2 is used
- switching between encryption and decryption with the same key is not possible, as the hdr flags are only updated when a new setkey() is performed

With this change, the key is always sent along with the cryptdata when performing encryption/decryption operations.

Fixes 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
---
 drivers/crypto/sahara.c | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)
drivers/crypto/sahara.c +13 -21
index 02065131c300..5cc1cd59a384 100644
@@ -43,7 +43,6 @@
 #define FLAGS_MODE_MASK		0x000f
 #define FLAGS_ENCRYPT		BIT(0)
 #define FLAGS_CBC		BIT(1)
-#define FLAGS_NEW_KEY		BIT(3)
 
 #define SAHARA_HDR_BASE			0x00800000
 #define SAHARA_HDR_SKHA_ALG_AES	0
@@ -141,8 +140,6 @@ struct sahara_hw_link {
 };
 
 struct sahara_ctx {
-	unsigned long flags;
-
 	/* AES-specific context */
 	int keylen;
 	u8 key[AES_KEYSIZE_128];
@@ -447,26 +444,22 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	int i, j;
 	int idx = 0;
 
-	/* Copy new key if necessary */
-	if (ctx->flags & FLAGS_NEW_KEY) {
-		memcpy(dev->key_base, ctx->key, ctx->keylen);
-		ctx->flags &= ~FLAGS_NEW_KEY;
+	memcpy(dev->key_base, ctx->key, ctx->keylen);
 
-		if (dev->flags & FLAGS_CBC) {
-			dev->hw_desc[idx]->len1 = AES_BLOCK_SIZE;
-			dev->hw_desc[idx]->p1 = dev->iv_phys_base;
-		} else {
-			dev->hw_desc[idx]->len1 = 0;
-			dev->hw_desc[idx]->p1 = 0;
-		}
-		dev->hw_desc[idx]->len2 = ctx->keylen;
-		dev->hw_desc[idx]->p2 = dev->key_phys_base;
-		dev->hw_desc[idx]->next = dev->hw_phys_desc[1];
+	if (dev->flags & FLAGS_CBC) {
+		dev->hw_desc[idx]->len1 = AES_BLOCK_SIZE;
+		dev->hw_desc[idx]->p1 = dev->iv_phys_base;
+	} else {
+		dev->hw_desc[idx]->len1 = 0;
+		dev->hw_desc[idx]->p1 = 0;
+	}
+	dev->hw_desc[idx]->len2 = ctx->keylen;
+	dev->hw_desc[idx]->p2 = dev->key_phys_base;
+	dev->hw_desc[idx]->next = dev->hw_phys_desc[1];
+	dev->hw_desc[idx]->hdr = sahara_aes_key_hdr(dev);
 
-		dev->hw_desc[idx]->hdr = sahara_aes_key_hdr(dev);
+	idx++;
 
-		idx++;
-	}
 
 	dev->nb_in_sg = sg_nents_for_len(dev->in_sg, dev->total);
 	if (dev->nb_in_sg < 0) {
@@ -608,7 +601,6 @@ static int sahara_aes_setkey(struct crypto_skcipher *tfm, const u8 *key,
 	/* SAHARA only supports 128bit keys */
 	if (keylen == AES_KEYSIZE_128) {
 		memcpy(ctx->key, key, keylen);
-		ctx->flags |= FLAGS_NEW_KEY;
 		return 0;
 	}
 
Signature · 1 line
2.43.0
author maintainer
#59 lore raw

PATCH 58/641 crypto: sahara - fix cbc selftest failure

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit 9f10bc28c0fb676ae58aa3bfa358db8f5de124bb ]

The kernel crypto API requires that all CBC implementations update the IV buffer to contain the last ciphertext block.

This fixes the following cbc selftest error:
alg: skcipher: sahara-cbc-aes encryption test failed (wrong output IV) on test vector 0, cfg="in-place (one sglist)"

Fixes 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
---
 drivers/crypto/sahara.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)
drivers/crypto/sahara.c +31 -2
index 5cc1cd59a384..888e5e5157bb 100644
@@ -148,6 +148,7 @@ struct sahara_ctx {
 
 struct sahara_aes_reqctx {
 	unsigned long mode;
+	u8 iv_out[AES_BLOCK_SIZE];
 	struct skcipher_request fallback_req;	// keep at the end
 };
 
@@ -541,8 +542,24 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	return -EINVAL;
 }
 
+static void sahara_aes_cbc_update_iv(struct skcipher_request *req)
+{
+	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
+	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
+	unsigned int ivsize = crypto_skcipher_ivsize(skcipher);
+
+	/* Update IV buffer to contain the last ciphertext block */
+	if (rctx->mode & FLAGS_ENCRYPT) {
+		sg_pcopy_to_buffer(req->dst, sg_nents(req->dst), req->iv,
+				   ivsize, req->cryptlen - ivsize);
+	} else {
+		memcpy(req->iv, rctx->iv_out, ivsize);
+	}
+}
+
 static int sahara_aes_process(struct skcipher_request *req)
 {
+	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
 	struct sahara_dev *dev = dev_ptr;
 	struct sahara_ctx *ctx;
 	struct sahara_aes_reqctx *rctx;
@@ -564,8 +581,17 @@ static int sahara_aes_process(struct skcipher_request *req)
 	rctx->mode &= FLAGS_MODE_MASK;
 	dev->flags = (dev->flags & ~FLAGS_MODE_MASK) | rctx->mode;
 
-	if ((dev->flags & FLAGS_CBC) && req->iv)
-		memcpy(dev->iv_base, req->iv, AES_KEYSIZE_128);
+	if ((dev->flags & FLAGS_CBC) && req->iv) {
+		unsigned int ivsize = crypto_skcipher_ivsize(skcipher);
+
+		memcpy(dev->iv_base, req->iv, ivsize);
+
+		if (!(dev->flags & FLAGS_ENCRYPT)) {
+			sg_pcopy_to_buffer(req->src, sg_nents(req->src),
+					   rctx->iv_out, ivsize,
+					   req->cryptlen - ivsize);
+		}
+	}
 
 	/* assign new context to device */
 	dev->ctx = ctx;
@@ -588,6 +614,9 @@ static int sahara_aes_process(struct skcipher_request *req)
 	dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 		DMA_TO_DEVICE);
 
+	if ((dev->flags & FLAGS_CBC) && req->iv)
+		sahara_aes_cbc_update_iv(req);
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
author maintainer
#60 lore raw

PATCH 59/641 crypto: sahara - fix ahash selftest failure

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit afffcf3db98b9495114b79d5381f8cc3f69476fb ]

update() calls should not modify the result buffer, so add an additional check for "rctx->last" to make sure that only the final hash value is copied into the buffer.

Fixes the following selftest failure:
alg: ahash: sahara-sha256 update() used result buffer on test vector 3, cfg="init+update+final aligned buffer"

Fixes 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
---
 drivers/crypto/sahara.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/sahara.c +1 -1
index 888e5e5157bb..863171b44cda 100644
@@ -1047,7 +1047,7 @@ static int sahara_sha_process(struct ahash_request *req)
 
 	memcpy(rctx->context, dev->context_base, rctx->context_size);
 
-	if (req->result)
+	if (req->result && rctx->last)
 		memcpy(req->result, rctx->context, rctx->digest_size);
 
 	return 0;
Signature · 1 line
2.43.0
author maintainer
#61 lore raw

PATCH 60/641 crypto: sahara - fix processing requests with cryptlen < sg->length

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit 5b8668ce3452827d27f8c34ff6ba080a8f983ed0 ]

It's not always the case that the entire sg entry needs to be processed. Currently, when cryptlen is less than sg->legth, "Descriptor length" errors are encountered.

The error was noticed when testing xts(sahara-ecb-aes) with arbitrary sized input data. To fix this, take the actual request size into account when populating the hw links.

Fixes 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
---
 drivers/crypto/sahara.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/crypto/sahara.c +7 -2
index 863171b44cda..cbb7153e4162 100644
@@ -444,6 +444,7 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	int ret;
 	int i, j;
 	int idx = 0;
+	u32 len;
 
 	memcpy(dev->key_base, ctx->key, ctx->keylen);
 
@@ -494,12 +495,14 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	/* Create input links */
 	dev->hw_desc[idx]->p1 = dev->hw_phys_link[0];
 	sg = dev->in_sg;
+	len = dev->total;
 	for (i = 0; i < dev->nb_in_sg; i++) {
-		dev->hw_link[i]->len = sg->length;
+		dev->hw_link[i]->len = min(len, sg->length);
 		dev->hw_link[i]->p = sg->dma_address;
 		if (i == (dev->nb_in_sg - 1)) {
 			dev->hw_link[i]->next = 0;
 		} else {
+			len -= min(len, sg->length);
 			dev->hw_link[i]->next = dev->hw_phys_link[i + 1];
 			sg = sg_next(sg);
 		}
@@ -508,12 +511,14 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	/* Create output links */
 	dev->hw_desc[idx]->p2 = dev->hw_phys_link[i];
 	sg = dev->out_sg;
+	len = dev->total;
 	for (j = i; j < dev->nb_out_sg + i; j++) {
-		dev->hw_link[j]->len = sg->length;
+		dev->hw_link[j]->len = min(len, sg->length);
 		dev->hw_link[j]->p = sg->dma_address;
 		if (j == (dev->nb_out_sg + i - 1)) {
 			dev->hw_link[j]->next = 0;
 		} else {
+			len -= min(len, sg->length);
 			dev->hw_link[j]->next = dev->hw_phys_link[j + 1];
 			sg = sg_next(sg);
 		}
Signature · 1 line
2.43.0
author maintainer
#62 lore raw

PATCH 61/641 crypto: sahara - fix error handling in sahara_hw_descriptor_create()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit ee6e6f0a7f5b39d50a5ef5fcc006f4f693db18a7 ]

Do not call dma_unmap_sg() for scatterlists that were not mapped successfully.

Fixes 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
---
 drivers/crypto/sahara.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/crypto/sahara.c +3 -5
index cbb7153e4162..c4eb66d2e08d 100644
@@ -483,13 +483,14 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 			 DMA_TO_DEVICE);
 	if (!ret) {
 		dev_err(dev->device, "couldn't map in sg\n");
-		goto unmap_in;
+		return -EINVAL;
 	}
+
 	ret = dma_map_sg(dev->device, dev->out_sg, dev->nb_out_sg,
 			 DMA_FROM_DEVICE);
 	if (!ret) {
 		dev_err(dev->device, "couldn't map out sg\n");
-		goto unmap_out;
+		goto unmap_in;
 	}
 
 	/* Create input links */
@@ -537,9 +538,6 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 
 	return 0;
 
-unmap_out:
-	dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg,
-		DMA_FROM_DEVICE);
 unmap_in:
 	dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 		DMA_TO_DEVICE);
Signature · 1 line
2.43.0
author maintainer
#63 lore raw

PATCH 62/641 crypto: hisilicon/qm - save capability registers in qm init process

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Zhiqi Song <[email protected]>

[ Upstream commit cabe13d0bd2efb8dd50ed2310f57b33e1a69a0d4 ]

In previous capability register implementation, qm irq related values were read from capability registers dynamically when needed. But in abnormal scenario, e.g. the core is timeout and the device needs to soft reset and reset failed after disabling the MSE, the device can not be removed normally, causing the following call trace:

	| Call trace:
        |  pci_irq_vector+0xfc/0x140
        |  hisi_qm_uninit+0x278/0x3b0 [hisi_qm]
        |  hpre_remove+0x16c/0x1c0 [hisi_hpre]
        |  pci_device_remove+0x6c/0x264
        |  device_release_driver_internal+0x1ec/0x3e0
        |  device_release_driver+0x3c/0x60
        |  pci_stop_bus_device+0xfc/0x22c
        |  pci_stop_and_remove_bus_device+0x38/0x70
        |  pci_iov_remove_virtfn+0x108/0x1c0
        |  sriov_disable+0x7c/0x1e4
        |  pci_disable_sriov+0x4c/0x6c
        |  hisi_qm_sriov_disable+0x90/0x160 [hisi_qm]
        |  hpre_remove+0x1a8/0x1c0 [hisi_hpre]
        |  pci_device_remove+0x6c/0x264
        |  device_release_driver_internal+0x1ec/0x3e0
        |  driver_detach+0x168/0x2d0
        |  bus_remove_driver+0xc0/0x230
        |  driver_unregister+0x58/0xdc
        |  pci_unregister_driver+0x40/0x220
        |  hpre_exit+0x34/0x64 [hisi_hpre]
        |  __arm64_sys_delete_module+0x374/0x620
        [...]

        | Call trace:
        |  free_msi_irqs+0x25c/0x300
        |  pci_disable_msi+0x19c/0x264
        |  pci_free_irq_vectors+0x4c/0x70
        |  hisi_qm_pci_uninit+0x44/0x90 [hisi_qm]
        |  hisi_qm_uninit+0x28c/0x3b0 [hisi_qm]
        |  hpre_remove+0x16c/0x1c0 [hisi_hpre]
        |  pci_device_remove+0x6c/0x264
        [...]

The reason for this call trace is that when the MSE is disabled, the value of capability registers in the BAR space become invalid. This will make the subsequent unregister process get the wrong irq vector through capability registers and get the wrong irq number by pci_irq_vector().

So add a capability table structure to pre-store the valid value of the irq information capability register in qm init process, avoid obtaining invalid capability register value after the MSE is disabled.

Fixes 3536cc55cada ("crypto: hisilicon/qm - support get device irq information from hardware registers")
---
 drivers/crypto/hisilicon/qm.c | 62 +++++++++++++++++++++++++++++------
 include/linux/hisi_acc_qm.h   | 12 +++++++
 2 files changed, 64 insertions(+), 10 deletions(-)
drivers/crypto/hisilicon/qm.c +52 -10
index 18599f3634c3..30b43006d1db 100644
@@ -294,6 +294,13 @@ enum qm_basic_type {
 	QM_VF_IRQ_NUM_CAP,
 };
 
+enum qm_pre_store_cap_idx {
+	QM_EQ_IRQ_TYPE_CAP_IDX = 0x0,
+	QM_AEQ_IRQ_TYPE_CAP_IDX,
+	QM_ABN_IRQ_TYPE_CAP_IDX,
+	QM_PF2VF_IRQ_TYPE_CAP_IDX,
+};
+
 static const struct hisi_qm_cap_info qm_cap_info_comm[] = {
 	{QM_SUPPORT_DB_ISOLATION, 0x30,   0, BIT(0),  0x0, 0x0, 0x0},
 	{QM_SUPPORT_FUNC_QOS,     0x3100, 0, BIT(8),  0x0, 0x0, 0x1},
@@ -323,6 +330,13 @@ static const struct hisi_qm_cap_info qm_basic_info[] = {
 	{QM_VF_IRQ_NUM_CAP,     0x311c,   0,  GENMASK(15, 0), 0x1,       0x2,       0x3},
 };
 
+static const u32 qm_pre_store_caps[] = {
+	QM_EQ_IRQ_TYPE_CAP,
+	QM_AEQ_IRQ_TYPE_CAP,
+	QM_ABN_IRQ_TYPE_CAP,
+	QM_PF2VF_IRQ_TYPE_CAP,
+};
+
 struct qm_mailbox {
 	__le16 w0;
 	__le16 queue_num;
@@ -4816,7 +4830,7 @@ static void qm_unregister_abnormal_irq(struct hisi_qm *qm)
 	if (qm->fun_type == QM_HW_VF)
 		return;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_ABN_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_ABN_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_ABN_IRQ_TYPE_MASK))
 		return;
 
@@ -4833,7 +4847,7 @@ static int qm_register_abnormal_irq(struct hisi_qm *qm)
 	if (qm->fun_type == QM_HW_VF)
 		return 0;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_ABN_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_ABN_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_ABN_IRQ_TYPE_MASK))
 		return 0;
 
@@ -4850,7 +4864,7 @@ static void qm_unregister_mb_cmd_irq(struct hisi_qm *qm)
 	struct pci_dev *pdev = qm->pdev;
 	u32 irq_vector, val;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_PF2VF_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_PF2VF_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return;
 
@@ -4864,7 +4878,7 @@ static int qm_register_mb_cmd_irq(struct hisi_qm *qm)
 	u32 irq_vector, val;
 	int ret;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_PF2VF_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_PF2VF_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return 0;
 
@@ -4881,7 +4895,7 @@ static void qm_unregister_aeq_irq(struct hisi_qm *qm)
 	struct pci_dev *pdev = qm->pdev;
 	u32 irq_vector, val;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_AEQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_AEQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return;
 
@@ -4895,7 +4909,7 @@ static int qm_register_aeq_irq(struct hisi_qm *qm)
 	u32 irq_vector, val;
 	int ret;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_AEQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_AEQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return 0;
 
@@ -4913,7 +4927,7 @@ static void qm_unregister_eq_irq(struct hisi_qm *qm)
 	struct pci_dev *pdev = qm->pdev;
 	u32 irq_vector, val;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_EQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_EQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return;
 
@@ -4927,7 +4941,7 @@ static int qm_register_eq_irq(struct hisi_qm *qm)
 	u32 irq_vector, val;
 	int ret;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_EQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_EQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return 0;
 
@@ -5015,7 +5029,29 @@ static int qm_get_qp_num(struct hisi_qm *qm)
 	return 0;
 }
 
-static void qm_get_hw_caps(struct hisi_qm *qm)
+static int qm_pre_store_irq_type_caps(struct hisi_qm *qm)
+{
+	struct hisi_qm_cap_record *qm_cap;
+	struct pci_dev *pdev = qm->pdev;
+	size_t i, size;
+
+	size = ARRAY_SIZE(qm_pre_store_caps);
+	qm_cap = devm_kzalloc(&pdev->dev, sizeof(*qm_cap) * size, GFP_KERNEL);
+	if (!qm_cap)
+		return -ENOMEM;
+
+	for (i = 0; i < size; i++) {
+		qm_cap[i].type = qm_pre_store_caps[i];
+		qm_cap[i].cap_val = hisi_qm_get_hw_info(qm, qm_basic_info,
+							qm_pre_store_caps[i], qm->cap_ver);
+	}
+
+	qm->cap_tables.qm_cap_table = qm_cap;
+
+	return 0;
+}
+
+static int qm_get_hw_caps(struct hisi_qm *qm)
 {
 	const struct hisi_qm_cap_info *cap_info = qm->fun_type == QM_HW_PF ?
 						  qm_cap_info_pf : qm_cap_info_vf;
@@ -5046,6 +5082,9 @@ static void qm_get_hw_caps(struct hisi_qm *qm)
 		if (val)
 			set_bit(cap_info[i].type, &qm->caps);
 	}
+
+	/* Fetch and save the value of irq type related capability registers */
+	return qm_pre_store_irq_type_caps(qm);
 }
 
 static int qm_get_pci_res(struct hisi_qm *qm)
@@ -5067,7 +5106,10 @@ static int qm_get_pci_res(struct hisi_qm *qm)
 		goto err_request_mem_regions;
 	}
 
-	qm_get_hw_caps(qm);
+	ret = qm_get_hw_caps(qm);
+	if (ret)
+		goto err_ioremap;
+
 	if (test_bit(QM_SUPPORT_DB_ISOLATION, &qm->caps)) {
 		qm->db_interval = QM_QP_DB_INTERVAL;
 		qm->db_phys_base = pci_resource_start(pdev, PCI_BAR_4);
include/linux/hisi_acc_qm.h +12 -0
index ddc7ebb70523..b8da977711a7 100644
@@ -265,6 +265,16 @@ struct hisi_qm_cap_info {
 	u32 v3_val;
 };
 
+struct hisi_qm_cap_record {
+	u32 type;
+	u32 cap_val;
+};
+
+struct hisi_qm_cap_tables {
+	struct hisi_qm_cap_record *qm_cap_table;
+	struct hisi_qm_cap_record *dev_cap_table;
+};
+
 struct hisi_qm_list {
 	struct mutex lock;
 	struct list_head list;
@@ -376,6 +386,8 @@ struct hisi_qm {
 	u32 mb_qos;
 	u32 type_rate;
 	struct qm_err_isolate isolate_data;
+
+	struct hisi_qm_cap_tables cap_tables;
 };
 
 struct hisi_qp_status {
Signature · 1 line
2.43.0
author maintainer
#64 lore raw

PATCH 63/641 crypto: hisilicon/zip - add zip comp high perf mode configuration

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Chenghai Huang <[email protected]>

[ Upstream commit a9864bae1806499ebf3757a9e71dddde5b9c48c6 ]

To meet specific application scenarios, the function of switching between the high performance mode and the high compression mode is added.

Use the perf_mode=0/1 configuration to set the compression high perf mode, 0(default, high compression mode), 1(high performance mode). These two modes only apply to the compression direction and are compatible with software algorithm in both directions.

Stable-dep-of: cf8b5156bbc8 ("crypto: hisilicon/hpre - save capability registers in probe process")

---
 drivers/crypto/hisilicon/zip/zip_main.c | 65 +++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
drivers/crypto/hisilicon/zip/zip_main.c +65 -0
index db4c964cd649..85576f818278 100644
@@ -107,6 +107,14 @@
 #define HZIP_CLOCK_GATED_EN		(HZIP_CORE_GATED_EN | \
 					 HZIP_CORE_GATED_OOO_EN)
 
+/* zip comp high performance */
+#define HZIP_HIGH_PERF_OFFSET		0x301208
+
+enum {
+	HZIP_HIGH_COMP_RATE,
+	HZIP_HIGH_COMP_PERF,
+};
+
 static const char hisi_zip_name[] = "hisi_zip";
 static struct dentry *hzip_debugfs_root;
 
@@ -352,6 +360,37 @@ static int hzip_diff_regs_show(struct seq_file *s, void *unused)
 	return 0;
 }
 DEFINE_SHOW_ATTRIBUTE(hzip_diff_regs);
+
+static int perf_mode_set(const char *val, const struct kernel_param *kp)
+{
+	int ret;
+	u32 n;
+
+	if (!val)
+		return -EINVAL;
+
+	ret = kstrtou32(val, 10, &n);
+	if (ret != 0 || (n != HZIP_HIGH_COMP_PERF &&
+			 n != HZIP_HIGH_COMP_RATE))
+		return -EINVAL;
+
+	return param_set_int(val, kp);
+}
+
+static const struct kernel_param_ops zip_com_perf_ops = {
+	.set = perf_mode_set,
+	.get = param_get_int,
+};
+
+/*
+ * perf_mode = 0 means enable high compression rate mode,
+ * perf_mode = 1 means enable high compression performance mode.
+ * These two modes only apply to the compression direction.
+ */
+static u32 perf_mode = HZIP_HIGH_COMP_RATE;
+module_param_cb(perf_mode, &zip_com_perf_ops, &perf_mode, 0444);
+MODULE_PARM_DESC(perf_mode, "ZIP high perf mode 0(default), 1(enable)");
+
 static const struct kernel_param_ops zip_uacce_mode_ops = {
 	.set = uacce_mode_set,
 	.get = param_get_int,
@@ -417,6 +456,28 @@ bool hisi_zip_alg_support(struct hisi_qm *qm, u32 alg)
 	return false;
 }
 
+static int hisi_zip_set_high_perf(struct hisi_qm *qm)
+{
+	u32 val;
+	int ret;
+
+	val = readl_relaxed(qm->io_base + HZIP_HIGH_PERF_OFFSET);
+	if (perf_mode == HZIP_HIGH_COMP_PERF)
+		val |= HZIP_HIGH_COMP_PERF;
+	else
+		val &= ~HZIP_HIGH_COMP_PERF;
+
+	/* Set perf mode */
+	writel(val, qm->io_base + HZIP_HIGH_PERF_OFFSET);
+	ret = readl_relaxed_poll_timeout(qm->io_base + HZIP_HIGH_PERF_OFFSET,
+					 val, val == perf_mode, HZIP_DELAY_1_US,
+					 HZIP_POLL_TIMEOUT_US);
+	if (ret)
+		pci_err(qm->pdev, "failed to set perf mode\n");
+
+	return ret;
+}
+
 static int hisi_zip_set_qm_algs(struct hisi_qm *qm)
 {
 	struct device *dev = &qm->pdev->dev;
@@ -1115,6 +1176,10 @@ static int hisi_zip_pf_probe_init(struct hisi_zip *hisi_zip)
 	if (ret)
 		return ret;
 
+	ret = hisi_zip_set_high_perf(qm);
+	if (ret)
+		return ret;
+
 	hisi_zip_open_sva_prefetch(qm);
 	hisi_qm_dev_err_init(qm);
 	hisi_zip_debug_regs_clear(qm);
Signature · 1 line
2.43.0
author maintainer
#65 lore raw

PATCH 64/641 crypto: hisilicon/qm - add a function to set qm algs

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Wenkai Lin <[email protected]>

[ Upstream commit f76f0d7f20672611974d3cc705996751fc403734 ]

Extract a public function to set qm algs and remove the similar code for setting qm algs in each module.

Stable-dep-of: cf8b5156bbc8 ("crypto: hisilicon/hpre - save capability registers in probe process")

---
 drivers/crypto/hisilicon/hpre/hpre_main.c | 42 ++-----------------
 drivers/crypto/hisilicon/qm.c             | 36 +++++++++++++++++
 drivers/crypto/hisilicon/sec2/sec_main.c  | 47 ++++------------------
 drivers/crypto/hisilicon/zip/zip_main.c   | 49 ++++-------------------
 include/linux/hisi_acc_qm.h               |  8 +++-
 5 files changed, 62 insertions(+), 120 deletions(-)
drivers/crypto/hisilicon/hpre/hpre_main.c +4 -38
index 56777099ef69..84c92d85d23d 100644
@@ -118,8 +118,6 @@
 #define HPRE_DFX_COMMON2_LEN		0xE
 #define HPRE_DFX_CORE_LEN		0x43
 
-#define HPRE_DEV_ALG_MAX_LEN	256
-
 static const char hpre_name[] = "hisi_hpre";
 static struct dentry *hpre_debugfs_root;
 static const struct pci_device_id hpre_dev_ids[] = {
@@ -135,12 +133,7 @@ struct hpre_hw_error {
 	const char *msg;
 };
 
-struct hpre_dev_alg {
-	u32 alg_msk;
-	const char *alg;
-};
-
-static const struct hpre_dev_alg hpre_dev_algs[] = {
+static const struct qm_dev_alg hpre_dev_algs[] = {
 	{
 		.alg_msk = BIT(0),
 		.alg = "rsa\n"
@@ -362,35 +355,6 @@ bool hpre_check_alg_support(struct hisi_qm *qm, u32 alg)
 	return false;
 }
 
-static int hpre_set_qm_algs(struct hisi_qm *qm)
-{
-	struct device *dev = &qm->pdev->dev;
-	char *algs, *ptr;
-	u32 alg_msk;
-	int i;
-
-	if (!qm->use_sva)
-		return 0;
-
-	algs = devm_kzalloc(dev, HPRE_DEV_ALG_MAX_LEN * sizeof(char), GFP_KERNEL);
-	if (!algs)
-		return -ENOMEM;
-
-	alg_msk = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DEV_ALG_BITMAP_CAP, qm->cap_ver);
-
-	for (i = 0; i < ARRAY_SIZE(hpre_dev_algs); i++)
-		if (alg_msk & hpre_dev_algs[i].alg_msk)
-			strcat(algs, hpre_dev_algs[i].alg);
-
-	ptr = strrchr(algs, '\n');
-	if (ptr)
-		*ptr = '\0';
-
-	qm->uacce->algs = algs;
-
-	return 0;
-}
-
 static int hpre_diff_regs_show(struct seq_file *s, void *unused)
 {
 	struct hisi_qm *qm = s->private;
@@ -1141,6 +1105,7 @@ static void hpre_debugfs_exit(struct hisi_qm *qm)
 
 static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
+	u64 alg_msk;
 	int ret;
 
 	if (pdev->revision == QM_HW_V1) {
@@ -1171,7 +1136,8 @@ static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	ret = hpre_set_qm_algs(qm);
+	alg_msk = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DEV_ALG_BITMAP_CAP, qm->cap_ver);
+	ret = hisi_qm_set_algs(qm, alg_msk, hpre_dev_algs, ARRAY_SIZE(hpre_dev_algs));
 	if (ret) {
 		pci_err(pdev, "Failed to set hpre algs!\n");
 		hisi_qm_uninit(qm);
drivers/crypto/hisilicon/qm.c +36 -0
index 30b43006d1db..40da95dbab25 100644
@@ -229,6 +229,8 @@
 #define QM_QOS_MAX_CIR_U		6
 #define QM_AUTOSUSPEND_DELAY		3000
 
+#define QM_DEV_ALG_MAX_LEN		256
+
 #define QM_MK_CQC_DW3_V1(hop_num, pg_sz, buf_sz, cqe_sz) \
 	(((hop_num) << QM_CQ_HOP_NUM_SHIFT) | \
 	((pg_sz) << QM_CQ_PAGE_SIZE_SHIFT) | \
@@ -842,6 +844,40 @@ static void qm_get_xqc_depth(struct hisi_qm *qm, u16 *low_bits,
 	*high_bits = (depth >> QM_XQ_DEPTH_SHIFT) & QM_XQ_DEPTH_MASK;
 }
 
+int hisi_qm_set_algs(struct hisi_qm *qm, u64 alg_msk, const struct qm_dev_alg *dev_algs,
+		     u32 dev_algs_size)
+{
+	struct device *dev = &qm->pdev->dev;
+	char *algs, *ptr;
+	int i;
+
+	if (!qm->uacce)
+		return 0;
+
+	if (dev_algs_size >= QM_DEV_ALG_MAX_LEN) {
+		dev_err(dev, "algs size %u is equal or larger than %d.\n",
+			dev_algs_size, QM_DEV_ALG_MAX_LEN);
+		return -EINVAL;
+	}
+
+	algs = devm_kzalloc(dev, QM_DEV_ALG_MAX_LEN * sizeof(char), GFP_KERNEL);
+	if (!algs)
+		return -ENOMEM;
+
+	for (i = 0; i < dev_algs_size; i++)
+		if (alg_msk & dev_algs[i].alg_msk)
+			strcat(algs, dev_algs[i].alg);
+
+	ptr = strrchr(algs, '\n');
+	if (ptr) {
+		*ptr = '\0';
+		qm->uacce->algs = algs;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(hisi_qm_set_algs);
+
 static u32 qm_get_irq_num(struct hisi_qm *qm)
 {
 	if (qm->fun_type == QM_HW_PF)
drivers/crypto/hisilicon/sec2/sec_main.c +7 -40

84 lines not on this page · raw message

drivers/crypto/hisilicon/zip/zip_main.c +8 -41

86 lines not on this page · raw message

include/linux/hisi_acc_qm.h +7 -1
index b8da977711a7..4c5611d99c42 100644
@@ -160,6 +160,11 @@ enum qm_cap_bits {
 	QM_SUPPORT_RPM,
 };
 
+struct qm_dev_alg {
+	u64 alg_msk;
+	const char *alg;
+};
+
 struct dfx_diff_registers {
 	u32 *regs;
 	u32 reg_offset;
@@ -375,7 +380,6 @@ struct hisi_qm {
 	struct work_struct rst_work;
 	struct work_struct cmd_process;
 
-	const char *algs;
 	bool use_sva;
 
 	resource_size_t phys_base;
@@ -575,6 +579,8 @@ void hisi_qm_regs_dump(struct seq_file *s, struct debugfs_regset32 *regset);
 u32 hisi_qm_get_hw_info(struct hisi_qm *qm,
 			const struct hisi_qm_cap_info *info_table,
 			u32 index, bool is_read);
+int hisi_qm_set_algs(struct hisi_qm *qm, u64 alg_msk, const struct qm_dev_alg *dev_algs,
+		     u32 dev_algs_size);
 
 /* Used by VFIO ACC live migration driver */
 struct pci_driver *hisi_sec_get_pf_driver(void);
Signature · 1 line
2.43.0
author maintainer
#66 lore raw

PATCH 65/641 crypto: hisilicon/hpre - save capability registers in probe process

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Zhiqi Song <[email protected]>

[ Upstream commit cf8b5156bbc8c9376f699e8d35e9464b739e33ff ]

Pre-store the valid value of hpre alg support related capability register in hpre_qm_init(), which will be called by hpre_probe(). It can reduce the number of capability register queries and avoid obtaining incorrect values in abnormal scenarios, such as reset failed and the memory space disabled.

Fixes f214d59a0603 ("crypto: hisilicon/hpre - support hpre capability")
---
 drivers/crypto/hisilicon/hpre/hpre_main.c | 82 ++++++++++++++++++-----
 1 file changed, 64 insertions(+), 18 deletions(-)
drivers/crypto/hisilicon/hpre/hpre_main.c +64 -18
index 84c92d85d23d..3255b2a070c7 100644
@@ -226,6 +226,20 @@ static const struct hisi_qm_cap_info hpre_basic_info[] = {
 	{HPRE_CORE10_ALG_BITMAP_CAP, 0x3170, 0, GENMASK(31, 0), 0x0, 0x10, 0x10}
 };
 
+enum hpre_pre_store_cap_idx {
+	HPRE_CLUSTER_NUM_CAP_IDX = 0x0,
+	HPRE_CORE_ENABLE_BITMAP_CAP_IDX,
+	HPRE_DRV_ALG_BITMAP_CAP_IDX,
+	HPRE_DEV_ALG_BITMAP_CAP_IDX,
+};
+
+static const u32 hpre_pre_store_caps[] = {
+	HPRE_CLUSTER_NUM_CAP,
+	HPRE_CORE_ENABLE_BITMAP_CAP,
+	HPRE_DRV_ALG_BITMAP_CAP,
+	HPRE_DEV_ALG_BITMAP_CAP,
+};
+
 static const struct hpre_hw_error hpre_hw_errors[] = {
 	{
 		.int_msk = BIT(0),
@@ -348,7 +362,7 @@ bool hpre_check_alg_support(struct hisi_qm *qm, u32 alg)
 {
 	u32 cap_val;
 
-	cap_val = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DRV_ALG_BITMAP_CAP, qm->cap_ver);
+	cap_val = qm->cap_tables.dev_cap_table[HPRE_DRV_ALG_BITMAP_CAP_IDX].cap_val;
 	if (alg & cap_val)
 		return true;
 
@@ -424,16 +438,6 @@ static u32 vfs_num;
 module_param_cb(vfs_num, &vfs_num_ops, &vfs_num, 0444);
 MODULE_PARM_DESC(vfs_num, "Number of VFs to enable(1-63), 0(default)");
 
-static inline int hpre_cluster_num(struct hisi_qm *qm)
-{
-	return hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_CLUSTER_NUM_CAP, qm->cap_ver);
-}
-
-static inline int hpre_cluster_core_mask(struct hisi_qm *qm)
-{
-	return hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_CORE_ENABLE_BITMAP_CAP, qm->cap_ver);
-}
-
 struct hisi_qp *hpre_create_qp(u8 type)
 {
 	int node = cpu_to_node(smp_processor_id());
@@ -500,13 +504,15 @@ static int hpre_cfg_by_dsm(struct hisi_qm *qm)
 
 static int hpre_set_cluster(struct hisi_qm *qm)
 {
-	u32 cluster_core_mask = hpre_cluster_core_mask(qm);
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct device *dev = &qm->pdev->dev;
 	unsigned long offset;
+	u32 cluster_core_mask;
+	u8 clusters_num;
 	u32 val = 0;
 	int ret, i;
 
+	cluster_core_mask = qm->cap_tables.dev_cap_table[HPRE_CORE_ENABLE_BITMAP_CAP_IDX].cap_val;
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		offset = i * HPRE_CLSTR_ADDR_INTRVL;
 
@@ -701,11 +707,12 @@ static int hpre_set_user_domain_and_cache(struct hisi_qm *qm)
 
 static void hpre_cnt_regs_clear(struct hisi_qm *qm)
 {
-	u8 clusters_num = hpre_cluster_num(qm);
 	unsigned long offset;
+	u8 clusters_num;
 	int i;
 
 	/* clear clusterX/cluster_ctrl */
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		offset = HPRE_CLSTR_BASE + i * HPRE_CLSTR_ADDR_INTRVL;
 		writel(0x0, qm->io_base + offset + HPRE_CLUSTER_INQURY);
@@ -992,13 +999,14 @@ static int hpre_pf_comm_regs_debugfs_init(struct hisi_qm *qm)
 
 static int hpre_cluster_debugfs_init(struct hisi_qm *qm)
 {
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct device *dev = &qm->pdev->dev;
 	char buf[HPRE_DBGFS_VAL_MAX_LEN];
 	struct debugfs_regset32 *regset;
 	struct dentry *tmp_d;
+	u8 clusters_num;
 	int i, ret;
 
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		ret = snprintf(buf, HPRE_DBGFS_VAL_MAX_LEN, "cluster%d", i);
 		if (ret >= HPRE_DBGFS_VAL_MAX_LEN)
@@ -1103,6 +1111,34 @@ static void hpre_debugfs_exit(struct hisi_qm *qm)
 	debugfs_remove_recursive(qm->debug.debug_root);
 }
 
+static int hpre_pre_store_cap_reg(struct hisi_qm *qm)
+{
+	struct hisi_qm_cap_record *hpre_cap;
+	struct device *dev = &qm->pdev->dev;
+	size_t i, size;
+
+	size = ARRAY_SIZE(hpre_pre_store_caps);
+	hpre_cap = devm_kzalloc(dev, sizeof(*hpre_cap) * size, GFP_KERNEL);
+	if (!hpre_cap)
+		return -ENOMEM;
+
+	for (i = 0; i < size; i++) {
+		hpre_cap[i].type = hpre_pre_store_caps[i];
+		hpre_cap[i].cap_val = hisi_qm_get_hw_info(qm, hpre_basic_info,
+				      hpre_pre_store_caps[i], qm->cap_ver);
+	}
+
+	if (hpre_cap[HPRE_CLUSTER_NUM_CAP_IDX].cap_val > HPRE_CLUSTERS_NUM_MAX) {
+		dev_err(dev, "Device cluster num %u is out of range for driver supports %d!\n",
+			hpre_cap[HPRE_CLUSTER_NUM_CAP_IDX].cap_val, HPRE_CLUSTERS_NUM_MAX);
+		return -EINVAL;
+	}
+
+	qm->cap_tables.dev_cap_table = hpre_cap;
+
+	return 0;
+}
+
 static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
 	u64 alg_msk;
@@ -1136,7 +1172,15 @@ static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	alg_msk = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DEV_ALG_BITMAP_CAP, qm->cap_ver);
+	/* Fetch and save the value of capability registers */
+	ret = hpre_pre_store_cap_reg(qm);
+	if (ret) {
+		pci_err(pdev, "Failed to pre-store capability registers!\n");
+		hisi_qm_uninit(qm);
+		return ret;
+	}
+
+	alg_msk = qm->cap_tables.dev_cap_table[HPRE_DEV_ALG_BITMAP_CAP_IDX].cap_val;
 	ret = hisi_qm_set_algs(qm, alg_msk, hpre_dev_algs, ARRAY_SIZE(hpre_dev_algs));
 	if (ret) {
 		pci_err(pdev, "Failed to set hpre algs!\n");
@@ -1150,11 +1194,12 @@ static int hpre_show_last_regs_init(struct hisi_qm *qm)
 {
 	int cluster_dfx_regs_num =  ARRAY_SIZE(hpre_cluster_dfx_regs);
 	int com_dfx_regs_num = ARRAY_SIZE(hpre_com_dfx_regs);
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct qm_debug *debug = &qm->debug;
 	void __iomem *io_base;
+	u8 clusters_num;
 	int i, j, idx;
 
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	debug->last_words = kcalloc(cluster_dfx_regs_num * clusters_num +
 			com_dfx_regs_num, sizeof(unsigned int), GFP_KERNEL);
 	if (!debug->last_words)
@@ -1191,10 +1236,10 @@ static void hpre_show_last_dfx_regs(struct hisi_qm *qm)
 {
 	int cluster_dfx_regs_num =  ARRAY_SIZE(hpre_cluster_dfx_regs);
 	int com_dfx_regs_num = ARRAY_SIZE(hpre_com_dfx_regs);
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct qm_debug *debug = &qm->debug;
 	struct pci_dev *pdev = qm->pdev;
 	void __iomem *io_base;
+	u8 clusters_num;
 	int i, j, idx;
 	u32 val;
 
@@ -1209,6 +1254,7 @@ static void hpre_show_last_dfx_regs(struct hisi_qm *qm)
 			  hpre_com_dfx_regs[i].name, debug->last_words[i], val);
 	}
 
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		io_base = qm->io_base + hpre_cluster_offsets[i];
 		for (j = 0; j <  cluster_dfx_regs_num; j++) {
Signature · 1 line
2.43.0
author maintainer
#67 lore raw

PATCH 66/641 crypto: hisilicon/sec2 - save capability registers in probe process

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Zhiqi Song <[email protected]>

[ Upstream commit f1115b0096c3163592e04e74f5a7548c25bda957 ]

Pre-store the valid value of the sec alg support related capability register in sec_qm_init(), which will be called by probe process. It can reduce the number of capability register queries and avoid obtaining incorrect values in abnormal scenarios, such as reset failed and the memory space disabled.

Fixes 921715b6b782 ("crypto: hisilicon/sec - get algorithm bitmap from registers")
---
 drivers/crypto/hisilicon/sec2/sec.h        |  7 ++++
 drivers/crypto/hisilicon/sec2/sec_crypto.c | 10 ++++-
 drivers/crypto/hisilicon/sec2/sec_main.c   | 43 ++++++++++++++++++++--
 3 files changed, 55 insertions(+), 5 deletions(-)
drivers/crypto/hisilicon/sec2/sec.h +7 -0
index 3e57fc04b377..410c83712e28 100644
@@ -220,6 +220,13 @@ enum sec_cap_type {
 	SEC_CORE4_ALG_BITMAP_HIGH,
 };
 
+enum sec_cap_reg_record_idx {
+	SEC_DRV_ALG_BITMAP_LOW_IDX = 0x0,
+	SEC_DRV_ALG_BITMAP_HIGH_IDX,
+	SEC_DEV_ALG_BITMAP_LOW_IDX,
+	SEC_DEV_ALG_BITMAP_HIGH_IDX,
+};
+
 void sec_destroy_qps(struct hisi_qp **qps, int qp_num);
 struct hisi_qp **sec_create_qps(void);
 int sec_register_to_crypto(struct hisi_qm *qm);
drivers/crypto/hisilicon/sec2/sec_crypto.c +8 -2
index 6fcabbc87860..ba7f305d43c1 100644
@@ -2547,9 +2547,12 @@ static int sec_register_aead(u64 alg_mask)
 
 int sec_register_to_crypto(struct hisi_qm *qm)
 {
-	u64 alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH, SEC_DRV_ALG_BITMAP_LOW);
+	u64 alg_mask;
 	int ret = 0;
 
+	alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH_IDX,
+				      SEC_DRV_ALG_BITMAP_LOW_IDX);
+
 	mutex_lock(&sec_algs_lock);
 	if (sec_available_devs) {
 		sec_available_devs++;
@@ -2578,7 +2581,10 @@ int sec_register_to_crypto(struct hisi_qm *qm)
 
 void sec_unregister_from_crypto(struct hisi_qm *qm)
 {
-	u64 alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH, SEC_DRV_ALG_BITMAP_LOW);
+	u64 alg_mask;
+
+	alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH_IDX,
+				      SEC_DRV_ALG_BITMAP_LOW_IDX);
 
 	mutex_lock(&sec_algs_lock);
 	if (--sec_available_devs)
drivers/crypto/hisilicon/sec2/sec_main.c +40 -3

67 lines not on this page · raw message

Signature · 1 line
2.43.0
author maintainer
#68 lore raw

PATCH 67/641 crypto: hisilicon/zip - save capability registers in probe process

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Zhiqi Song <[email protected]>

[ Upstream commit 2ff0ad847951d61c2d8b309e1ccefb26c57dcc7b ]

Pre-store the valid value of the zip alg support related capability register in hisi_zip_qm_init(), which will be called by hisi_zip_probe(). It can reduce the number of capability register queries and avoid obtaining incorrect values in abnormal scenarios, such as reset failed and the memory space disabled.

Fixes db700974b69d ("crypto: hisilicon/zip - support zip capability")
---
 drivers/crypto/hisilicon/zip/zip_main.c | 73 ++++++++++++++++++++-----
 1 file changed, 60 insertions(+), 13 deletions(-)
drivers/crypto/hisilicon/zip/zip_main.c +60 -13
index f7cf54f02dd7..403b07468841 100644
@@ -249,6 +249,26 @@ static struct hisi_qm_cap_info zip_basic_cap_info[] = {
 	{ZIP_CAP_MAX, 0x317c, 0, GENMASK(0, 0), 0x0, 0x0, 0x0}
 };
 
+enum zip_pre_store_cap_idx {
+	ZIP_CORE_NUM_CAP_IDX = 0x0,
+	ZIP_CLUSTER_COMP_NUM_CAP_IDX,
+	ZIP_CLUSTER_DECOMP_NUM_CAP_IDX,
+	ZIP_DECOMP_ENABLE_BITMAP_IDX,
+	ZIP_COMP_ENABLE_BITMAP_IDX,
+	ZIP_DRV_ALG_BITMAP_IDX,
+	ZIP_DEV_ALG_BITMAP_IDX,
+};
+
+static const u32 zip_pre_store_caps[] = {
+	ZIP_CORE_NUM_CAP,
+	ZIP_CLUSTER_COMP_NUM_CAP,
+	ZIP_CLUSTER_DECOMP_NUM_CAP,
+	ZIP_DECOMP_ENABLE_BITMAP,
+	ZIP_COMP_ENABLE_BITMAP,
+	ZIP_DRV_ALG_BITMAP,
+	ZIP_DEV_ALG_BITMAP,
+};
+
 enum {
 	HZIP_COMP_CORE0,
 	HZIP_COMP_CORE1,
@@ -443,7 +463,7 @@ bool hisi_zip_alg_support(struct hisi_qm *qm, u32 alg)
 {
 	u32 cap_val;
 
-	cap_val = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_DRV_ALG_BITMAP, qm->cap_ver);
+	cap_val = qm->cap_tables.dev_cap_table[ZIP_DRV_ALG_BITMAP_IDX].cap_val;
 	if ((alg & cap_val) == alg)
 		return true;
 
@@ -568,10 +588,8 @@ static int hisi_zip_set_user_domain_and_cache(struct hisi_qm *qm)
 	}
 
 	/* let's open all compression/decompression cores */
-	dcomp_bm = hisi_qm_get_hw_info(qm, zip_basic_cap_info,
-				       ZIP_DECOMP_ENABLE_BITMAP, qm->cap_ver);
-	comp_bm = hisi_qm_get_hw_info(qm, zip_basic_cap_info,
-				      ZIP_COMP_ENABLE_BITMAP, qm->cap_ver);
+	dcomp_bm = qm->cap_tables.dev_cap_table[ZIP_DECOMP_ENABLE_BITMAP_IDX].cap_val;
+	comp_bm = qm->cap_tables.dev_cap_table[ZIP_COMP_ENABLE_BITMAP_IDX].cap_val;
 	writel(HZIP_DECOMP_CHECK_ENABLE | dcomp_bm | comp_bm, base + HZIP_CLOCK_GATE_CTRL);
 
 	/* enable sqc,cqc writeback */
@@ -798,9 +816,8 @@ static int hisi_zip_core_debug_init(struct hisi_qm *qm)
 	char buf[HZIP_BUF_SIZE];
 	int i;
 
-	zip_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CORE_NUM_CAP, qm->cap_ver);
-	zip_comp_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CLUSTER_COMP_NUM_CAP,
-						qm->cap_ver);
+	zip_core_num = qm->cap_tables.dev_cap_table[ZIP_CORE_NUM_CAP_IDX].cap_val;
+	zip_comp_core_num = qm->cap_tables.dev_cap_table[ZIP_CLUSTER_COMP_NUM_CAP_IDX].cap_val;
 
 	for (i = 0; i < zip_core_num; i++) {
 		if (i < zip_comp_core_num)
@@ -942,7 +959,7 @@ static int hisi_zip_show_last_regs_init(struct hisi_qm *qm)
 	u32 zip_core_num;
 	int i, j, idx;
 
-	zip_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CORE_NUM_CAP, qm->cap_ver);
+	zip_core_num = qm->cap_tables.dev_cap_table[ZIP_CORE_NUM_CAP_IDX].cap_val;
 
 	debug->last_words = kcalloc(core_dfx_regs_num * zip_core_num + com_dfx_regs_num,
 				    sizeof(unsigned int), GFP_KERNEL);
@@ -998,9 +1015,9 @@ static void hisi_zip_show_last_dfx_regs(struct hisi_qm *qm)
 				 hzip_com_dfx_regs[i].name, debug->last_words[i], val);
 	}
 
-	zip_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CORE_NUM_CAP, qm->cap_ver);
-	zip_comp_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CLUSTER_COMP_NUM_CAP,
-						qm->cap_ver);
+	zip_core_num = qm->cap_tables.dev_cap_table[ZIP_CORE_NUM_CAP_IDX].cap_val;
+	zip_comp_core_num = qm->cap_tables.dev_cap_table[ZIP_CLUSTER_COMP_NUM_CAP_IDX].cap_val;
+
 	for (i = 0; i < zip_core_num; i++) {
 		if (i < zip_comp_core_num)
 			scnprintf(buf, sizeof(buf), "Comp_core-%d", i);
@@ -1156,6 +1173,28 @@ static int hisi_zip_pf_probe_init(struct hisi_zip *hisi_zip)
 	return ret;
 }
 
+static int zip_pre_store_cap_reg(struct hisi_qm *qm)
+{
+	struct hisi_qm_cap_record *zip_cap;
+	struct pci_dev *pdev = qm->pdev;
+	size_t i, size;
+
+	size = ARRAY_SIZE(zip_pre_store_caps);
+	zip_cap = devm_kzalloc(&pdev->dev, sizeof(*zip_cap) * size, GFP_KERNEL);
+	if (!zip_cap)
+		return -ENOMEM;
+
+	for (i = 0; i < size; i++) {
+		zip_cap[i].type = zip_pre_store_caps[i];
+		zip_cap[i].cap_val = hisi_qm_get_hw_info(qm, zip_basic_cap_info,
+				     zip_pre_store_caps[i], qm->cap_ver);
+	}
+
+	qm->cap_tables.dev_cap_table = zip_cap;
+
+	return 0;
+}
+
 static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
 	u64 alg_msk;
@@ -1194,7 +1233,15 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	alg_msk = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_DEV_ALG_BITMAP, qm->cap_ver);
+	/* Fetch and save the value of capability registers */
+	ret = zip_pre_store_cap_reg(qm);
+	if (ret) {
+		pci_err(qm->pdev, "Failed to pre-store capability registers!\n");
+		hisi_qm_uninit(qm);
+		return ret;
+	}
+
+	alg_msk = qm->cap_tables.dev_cap_table[ZIP_DEV_ALG_BITMAP_IDX].cap_val;
 	ret = hisi_qm_set_algs(qm, alg_msk, zip_dev_algs, ARRAY_SIZE(zip_dev_algs));
 	if (ret) {
 		pci_err(qm->pdev, "Failed to set zip algs!\n");
Signature · 1 line
2.43.0
author maintainer
#69 lore raw

PATCH 68/641 pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Sergey Shtylyov <[email protected]>

[ Upstream commit 86222a8fc16ec517de8da2604d904c9df3a08e5d ]

In persistent_ram_init_ecc(), on 64-bit arches DIV_ROUND_UP() will return 64-bit value since persistent_ram_zone::buffer_size has type size_t which is derived from the 64-bit *unsigned long*, while the ecc_blocks variable this value gets assigned to has (always 32-bit) *int* type. Even if that value fits into *int* type, an overflow is still possible when calculating the size_t typed ecc_total variable further below since there's no cast to any 64-bit type before multiplication. Declaring the ecc_blocks variable as *size_t* should fix this mess...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.

Fixes 9cc05ad97c57 ("staging: android: persistent_ram: refactor ecc support")
---
 fs/pstore/ram_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/pstore/ram_core.c +1 -1
index 650e437b55e6..f1848cdd6d34 100644
@@ -190,7 +190,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
 {
 	int numerr;
 	struct persistent_ram_buffer *buffer = prz->buffer;
-	int ecc_blocks;
+	size_t ecc_blocks;
 	size_t ecc_total;
 
 	if (!ecc_info || !ecc_info->ecc_size)
Signature · 1 line
2.43.0
author maintainer
#70 lore raw

PATCH 69/641 erofs: fix memory leak on short-lived bounced pages

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Gao Xiang <[email protected]>

[ Upstream commit 93d6fda7f926451a0fa1121b9558d75ca47e861e ]

Both MicroLZMA and DEFLATE algorithms can use short-lived pages on demand for the overlapped inplace I/O decompression.

However, those short-lived pages are actually added to be->compressed_pages. Thus, it should be checked instead of pcl->compressed_bvecs.

The LZ4 algorithm doesn't work like this, so it won't be impacted.

Fixes 67139e36d970 ("erofs: introduce `z_erofs_parse_in_bvecs'")
---
 fs/erofs/zdata.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/erofs/zdata.c +2 -3
index a7e6847f6f8f..a33cd6757f98 100644
@@ -1309,12 +1309,11 @@ static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
 		put_page(page);
 	} else {
 		for (i = 0; i < pclusterpages; ++i) {
-			page = pcl->compressed_bvecs[i].page;
+			/* consider shortlived pages added when decompressing */
+			page = be->compressed_pages[i];
 
 			if (erofs_page_is_managed(sbi, page))
 				continue;
-
-			/* recycle all individual short-lived pages */
 			(void)z_erofs_put_shortlivedpage(be->pagepool, page);
 			WRITE_ONCE(pcl->compressed_bvecs[i].page, NULL);
 		}
Signature · 1 line
2.43.0
author maintainer
#71 lore raw

PATCH 70/641 fs: indicate request originates from old mount API

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Christian Brauner <[email protected]>

[ Upstream commit f67d922edb4e95a4a56d07d5d40a76dd4f23a85b ]

We already communicate to filesystems when a remount request comes from the old mount API as some filesystems choose to implement different behavior in the new mount API than the old mount API to e.g., take the chance to fix significant API bugs. Allow the same for regular mount requests.

---
 fs/namespace.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
fs/namespace.c +11 -0
index fbf0e596fcd3..6c39ec020a5f 100644
@@ -2875,7 +2875,12 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
 	if (IS_ERR(fc))
 		return PTR_ERR(fc);
 
+	/*
+	 * Indicate to the filesystem that the remount request is coming
+	 * from the legacy mount system call.
+	 */
 	fc->oldapi = true;
+
 	err = parse_monolithic_mount_data(fc, data);
 	if (!err) {
 		down_write(&sb->s_umount);
@@ -3324,6 +3329,12 @@ static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
 	if (IS_ERR(fc))
 		return PTR_ERR(fc);
 
+	/*
+	 * Indicate to the filesystem that the mount request is coming
+	 * from the legacy mount system call.
+	 */
+	fc->oldapi = true;
+
 	if (subtype)
 		err = vfs_parse_fs_string(fc, "subtype",
 					  subtype, strlen(subtype));
Signature · 1 line
2.43.0
author maintainer
#72 lore raw

PATCH 71/641 gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Osama Muhammad <[email protected]>

[ Upstream commit 8877243beafa7c6bfc42022cbfdf9e39b25bd4fa ]

Syzkaller has reported a NULL pointer dereference when accessing rgd->rd_rgl in gfs2_rgrp_dump(). This can happen when creating rgd->rd_gl fails in read_rindex_entry(). Add a NULL pointer check in gfs2_rgrp_dump() to prevent that.

Reported-and-tested-by [email protected]
Fixes 72244b6bc752 ("gfs2: improve debug information when lvb mismatches are found")
---
 fs/gfs2/rgrp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/rgrp.c +1 -1
index c2060203b98a..396d0f4a259d 100644
@@ -2306,7 +2306,7 @@ void gfs2_rgrp_dump(struct seq_file *seq, struct gfs2_rgrpd *rgd,
 		       (unsigned long long)rgd->rd_addr, rgd->rd_flags,
 		       rgd->rd_free, rgd->rd_free_clone, rgd->rd_dinodes,
 		       rgd->rd_requested, rgd->rd_reserved, rgd->rd_extfail_pt);
-	if (rgd->rd_sbd->sd_args.ar_rgrplvb) {
+	if (rgd->rd_sbd->sd_args.ar_rgrplvb && rgd->rd_rgl) {
 		struct gfs2_rgrp_lvb *rgl = rgd->rd_rgl;
 
 		gfs2_print_dbg(seq, "%s  L: f:%02x b:%u i:%u\n", fs_id_buf,
Signature · 1 line
2.43.0
author maintainer
#73 lore raw

PATCH 72/641 gfs2: fix kernel BUG in gfs2_quota_cleanup

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Edward Adam Davis <[email protected]>

[ Upstream commit 71733b4922007500ae259af9e96017080f5d36d9 ]

[Syz report]
kernel BUG at fs/gfs2/quota.c:1508!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN

CPU: 0 PID: 5060 Comm: syz-executor505 Not tainted 6.7.0-rc3-syzkaller-00134-g994d5c58e50e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:gfs2_quota_cleanup+0x6b5/0x6c0 fs/gfs2/quota.c:1508
Code: fe e9 cf fd ff ff 44 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c 2d fe ff ff 4c 89 ef e8 b6 19 23 fe e9 20 fe ff ff e8 ec 11 c7 fd 90 <0f> 0b e8 84 9c 4f 07 0f 1f 40 00 66 0f 1f 00 55 41 57 41 56 41 54
RSP: 0018:ffffc9000409f9e0 EFLAGS: 00010293
RAX: ffffffff83c76854 RBX: 0000000000000002 RCX: ffff888026001dc0
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
RBP: ffffc9000409fb00 R08: ffffffff83c762b0 R09: 1ffff1100fd38015
R10: dffffc0000000000 R11: ffffed100fd38016 R12: dffffc0000000000
R13: ffff88807e9c0828 R14: ffff888014693580 R15: ffff88807e9c0000
FS:  0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f16d1bd70f8 CR3: 0000000027199000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 gfs2_put_super+0x2e1/0x940 fs/gfs2/super.c:611
 generic_shutdown_super+0x13a/0x2c0 fs/super.c:696
 kill_block_super+0x44/0x90 fs/super.c:1667
 deactivate_locked_super+0xc1/0x130 fs/super.c:484
 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1256
 task_work_run+0x24a/0x300 kernel/task_work.c:180
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0xa34/0x2750 kernel/exit.c:871
 do_group_exit+0x206/0x2c0 kernel/exit.c:1021
 __do_sys_exit_group kernel/exit.c:1032 [inline]
 __se_sys_exit_group kernel/exit.c:1030 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1030
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

...

[pid 5060] fsconfig(4, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0) = 0
[pid 5060] exit_group(1) = ?
...

[Analysis]
When the task exits, it will execute cleanup_mnt() to recycle the mounted gfs2 file system, but it performs a system call fsconfig(4, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0) before executing the task exit operation.

This will execute the following kernel path to complete the setting of SDF_JOURNAL_LIVE for sd_flags:

SYSCALL_DEFINE5(fsconfig, ..)->

	vfs_fsconfig_locked()->
		vfs_cmd_reconfigure()->
			gfs2_reconfigure()->
				gfs2_make_fs_rw()->
					set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);

[Fix]
Add SDF_NORECOVERY check in gfs2_quota_cleanup() to avoid checking SDF_JOURNAL_LIVE on the path where gfs2 is being unmounted.

Reported-and-tested-by [email protected]
Fixes f66af88e3321 ("gfs2: Stop using gfs2_make_fs_ro for withdraw")
---
 fs/gfs2/quota.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/gfs2/quota.c +2 -1
index 95dae7838b4e..f139ce8cf5ce 100644
@@ -1505,7 +1505,8 @@ void gfs2_quota_cleanup(struct gfs2_sbd *sdp)
 	LIST_HEAD(dispose);
 	int count;
 
-	BUG_ON(test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags));
+	BUG_ON(!test_bit(SDF_NORECOVERY, &sdp->sd_flags) &&
+		test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags));
 
 	spin_lock(&qd_lock);
 	list_for_each_entry(qd, &sdp->sd_quota_list, qd_list) {
Signature · 1 line
2.43.0
author maintainer
#74 lore raw

PATCH 73/641 dlm: fix format seq ops type 4

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Alexander Aring <[email protected]>

[ Upstream commit 367e753d5c54a414d82610eb709fe71fda6cf1c3 ]

This patch fixes to set the type 4 format ops in case of table_open4(). It got accidentially changed by commit 541adb0d4d10 ("fs: dlm: debugfs for queued callbacks") and since them toss debug dumps the same format as format 5 that are the queued ast callbacks for lkbs.

Fixes 541adb0d4d10 ("fs: dlm: debugfs for queued callbacks")
---
 fs/dlm/debug_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dlm/debug_fs.c +1 -1
index 42f332f46359..c587bfadeff4 100644
@@ -748,7 +748,7 @@ static int table_open4(struct inode *inode, struct file *file)
 	struct seq_file *seq;
 	int ret;
 
-	ret = seq_open(file, &format5_seq_ops);
+	ret = seq_open(file, &format4_seq_ops);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.43.0
author maintainer
#75 lore raw

PATCH 74/641 crypto: virtio - Wait for tasklet to complete on device remove

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: wangyangxin <[email protected]>

[ Upstream commit 67cc511e8d436456cc98033e6d4ba83ebfc8e672 ]

The scheduled tasklet needs to be executed on device remove.

Fixes fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
---
 drivers/crypto/virtio/virtio_crypto_core.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/virtio/virtio_crypto_core.c +3 -0
index 428d76562447..b909c6a2bf1c 100644
@@ -500,12 +500,15 @@ static void virtcrypto_free_unused_reqs(struct virtio_crypto *vcrypto)
 static void virtcrypto_remove(struct virtio_device *vdev)
 {
 	struct virtio_crypto *vcrypto = vdev->priv;
+	int i;
 
 	dev_info(&vdev->dev, "Start virtcrypto_remove.\n");
 
 	flush_work(&vcrypto->config_work);
 	if (virtcrypto_dev_started(vcrypto))
 		virtcrypto_dev_stop(vcrypto);
+	for (i = 0; i < vcrypto->max_data_queues; i++)
+		tasklet_kill(&vcrypto->data_vq[i].done_task);
 	virtio_reset_device(vdev);
 	virtcrypto_free_unused_reqs(vcrypto);
 	virtcrypto_clear_crypto_engines(vcrypto);
Signature · 1 line
2.43.0
author maintainer
#76 lore raw

PATCH 75/641 crypto: sahara - avoid skcipher fallback code duplication

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit 01d70a4bbff20ea05cadb4c208841985a7cc6596 ]

Factor out duplicated skcipher fallback handling code to a helper function sahara_aes_fallback(). Also, keep a single check if fallback is required in sahara_aes_crypt().

Stable-dep-of: d1d6351e37aa ("crypto: sahara - handle zero-length aes requests")

---
 drivers/crypto/sahara.c | 85 ++++++++++++-----------------------------
 1 file changed, 25 insertions(+), 60 deletions(-)
drivers/crypto/sahara.c +25 -60
index c4eb66d2e08d..0771c7160c47 100644
@@ -648,12 +648,37 @@ static int sahara_aes_setkey(struct crypto_skcipher *tfm, const u8 *key,
 	return crypto_skcipher_setkey(ctx->fallback, key, keylen);
 }
 
+static int sahara_aes_fallback(struct skcipher_request *req, unsigned long mode)
+{
+	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
+	struct sahara_ctx *ctx = crypto_skcipher_ctx(
+		crypto_skcipher_reqtfm(req));
+
+	skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
+	skcipher_request_set_callback(&rctx->fallback_req,
+				      req->base.flags,
+				      req->base.complete,
+				      req->base.data);
+	skcipher_request_set_crypt(&rctx->fallback_req, req->src,
+				   req->dst, req->cryptlen, req->iv);
+
+	if (mode & FLAGS_ENCRYPT)
+		return crypto_skcipher_encrypt(&rctx->fallback_req);
+
+	return crypto_skcipher_decrypt(&rctx->fallback_req);
+}
+
 static int sahara_aes_crypt(struct skcipher_request *req, unsigned long mode)
 {
 	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
+	struct sahara_ctx *ctx = crypto_skcipher_ctx(
+		crypto_skcipher_reqtfm(req));
 	struct sahara_dev *dev = dev_ptr;
 	int err = 0;
 
+	if (unlikely(ctx->keylen != AES_KEYSIZE_128))
+		return sahara_aes_fallback(req, mode);
+
 	dev_dbg(dev->device, "nbytes: %d, enc: %d, cbc: %d\n",
 		req->cryptlen, !!(mode & FLAGS_ENCRYPT), !!(mode & FLAGS_CBC));
 
@@ -676,81 +701,21 @@ static int sahara_aes_crypt(struct skcipher_request *req, unsigned long mode)
 
 static int sahara_aes_ecb_encrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_encrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, FLAGS_ENCRYPT);
 }
 
 static int sahara_aes_ecb_decrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_decrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, 0);
 }
 
 static int sahara_aes_cbc_encrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_encrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, FLAGS_ENCRYPT | FLAGS_CBC);
 }
 
 static int sahara_aes_cbc_decrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_decrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, FLAGS_CBC);
 }
 
Signature · 1 line
2.43.0
author maintainer
#77 lore raw

PATCH 76/641 crypto: sahara - handle zero-length aes requests

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit d1d6351e37aac14b32a291731d0855996c459d11 ]

In case of a zero-length input, exit gracefully from sahara_aes_crypt().

Fixes 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
---
 drivers/crypto/sahara.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/sahara.c +3 -0
index 0771c7160c47..78666b82ac80 100644
@@ -676,6 +676,9 @@ static int sahara_aes_crypt(struct skcipher_request *req, unsigned long mode)
 	struct sahara_dev *dev = dev_ptr;
 	int err = 0;
 
+	if (!req->cryptlen)
+		return 0;
+
 	if (unlikely(ctx->keylen != AES_KEYSIZE_128))
 		return sahara_aes_fallback(req, mode);
 
Signature · 1 line
2.43.0
author maintainer
#78 lore raw

PATCH 77/641 crypto: sahara - fix ahash reqsize

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit efcb50f41740ac55e6ccc4986c1a7740e21c62b4 ]

Set the reqsize for sha algorithms to sizeof(struct sahara_sha_reqctx), the extra space is not needed.

Fixes 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
---
 drivers/crypto/sahara.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/sahara.c +1 -2
index 78666b82ac80..31973e6ce520 100644
@@ -1162,8 +1162,7 @@ static int sahara_sha_import(struct ahash_request *req, const void *in)
 static int sahara_sha_cra_init(struct crypto_tfm *tfm)
 {
 	crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
-				 sizeof(struct sahara_sha_reqctx) +
-				 SHA_BUFFER_LEN + SHA256_BLOCK_SIZE);
+				 sizeof(struct sahara_sha_reqctx));
 
 	return 0;
 }
Signature · 1 line
2.43.0
author maintainer
#79 lore raw

PATCH 78/641 crypto: sahara - fix wait_for_completion_timeout() error handling

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit 2dba8e1d1a7957dcbe7888846268538847b471d1 ]

The sg lists are not unmapped in case of timeout errors. Fix this.

Fixes 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Fixes 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
---
 drivers/crypto/sahara.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/crypto/sahara.c +10 -8
index 31973e6ce520..3661f02d131a 100644
@@ -607,16 +607,17 @@ static int sahara_aes_process(struct skcipher_request *req)
 
 	timeout = wait_for_completion_timeout(&dev->dma_completion,
 				msecs_to_jiffies(SAHARA_TIMEOUT_MS));
-	if (!timeout) {
-		dev_err(dev->device, "AES timeout\n");
-		return -ETIMEDOUT;
-	}
 
 	dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg,
 		DMA_FROM_DEVICE);
 	dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 		DMA_TO_DEVICE);
 
+	if (!timeout) {
+		dev_err(dev->device, "AES timeout\n");
+		return -ETIMEDOUT;
+	}
+
 	if ((dev->flags & FLAGS_CBC) && req->iv)
 		sahara_aes_cbc_update_iv(req);
 
@@ -1007,15 +1008,16 @@ static int sahara_sha_process(struct ahash_request *req)
 
 	timeout = wait_for_completion_timeout(&dev->dma_completion,
 				msecs_to_jiffies(SAHARA_TIMEOUT_MS));
-	if (!timeout) {
-		dev_err(dev->device, "SHA timeout\n");
-		return -ETIMEDOUT;
-	}
 
 	if (rctx->sg_in_idx)
 		dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 			     DMA_TO_DEVICE);
 
+	if (!timeout) {
+		dev_err(dev->device, "SHA timeout\n");
+		return -ETIMEDOUT;
+	}
+
 	memcpy(rctx->context, dev->context_base, rctx->context_size);
 
 	if (req->result && rctx->last)
Signature · 1 line
2.43.0
author maintainer
#80 lore raw

PATCH 79/641 crypto: sahara - improve error handling in sahara_sha_process()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit 5deff027fca49a1eb3b20359333cf2ae562a2343 ]

sahara_sha_hw_data_descriptor_create() returns negative error codes on failure, so make sure the errors are correctly handled / propagated.

Fixes 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
---
 drivers/crypto/sahara.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/crypto/sahara.c +8 -2
index 3661f02d131a..cfb02905c1ab 100644
@@ -987,7 +987,10 @@ static int sahara_sha_process(struct ahash_request *req)
 		return ret;
 
 	if (rctx->first) {
-		sahara_sha_hw_data_descriptor_create(dev, rctx, req, 0);
+		ret = sahara_sha_hw_data_descriptor_create(dev, rctx, req, 0);
+		if (ret)
+			return ret;
+
 		dev->hw_desc[0]->next = 0;
 		rctx->first = 0;
 	} else {
@@ -995,7 +998,10 @@ static int sahara_sha_process(struct ahash_request *req)
 
 		sahara_sha_hw_context_descriptor_create(dev, rctx, req, 0);
 		dev->hw_desc[0]->next = dev->hw_phys_desc[1];
-		sahara_sha_hw_data_descriptor_create(dev, rctx, req, 1);
+		ret = sahara_sha_hw_data_descriptor_create(dev, rctx, req, 1);
+		if (ret)
+			return ret;
+
 		dev->hw_desc[1]->next = 0;
 	}
 
Signature · 1 line
2.43.0
author maintainer
#81 lore raw

PATCH 80/641 crypto: sahara - fix processing hash requests with req->nbytes < sg->length

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit 7bafa74d1ba35dcc173e1ce915e983d65905f77e ]

It's not always the case that the entire sg entry needs to be processed. Currently, when nbytes is less than sg->length, "Descriptor length" errors are encountered.

To fix this, take the actual request size into account when populating the hw links.

Fixes 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
---
 drivers/crypto/sahara.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/crypto/sahara.c +4 -1
index cfb02905c1ab..dd8291a4442c 100644
@@ -776,6 +776,7 @@ static int sahara_sha_hw_links_create(struct sahara_dev *dev,
 				       int start)
 {
 	struct scatterlist *sg;
+	unsigned int len;
 	unsigned int i;
 	int ret;
 
@@ -797,12 +798,14 @@ static int sahara_sha_hw_links_create(struct sahara_dev *dev,
 	if (!ret)
 		return -EFAULT;
 
+	len = rctx->total;
 	for (i = start; i < dev->nb_in_sg + start; i++) {
-		dev->hw_link[i]->len = sg->length;
+		dev->hw_link[i]->len = min(len, sg->length);
 		dev->hw_link[i]->p = sg->dma_address;
 		if (i == (dev->nb_in_sg + start - 1)) {
 			dev->hw_link[i]->next = 0;
 		} else {
+			len -= min(len, sg->length);
 			dev->hw_link[i]->next = dev->hw_phys_link[i + 1];
 			sg = sg_next(sg);
 		}
Signature · 1 line
2.43.0
author maintainer
#82 lore raw

PATCH 81/641 crypto: sahara - do not resize req->src when doing hash operations

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Ovidiu Panait <[email protected]>

[ Upstream commit a3c6f4f4d249cecaf2f34471aadbfb4f4ef57298 ]

When testing sahara sha256 speed performance with tcrypt (mode=404) on imx53-qsrb board, multiple "Invalid numbers of src SG." errors are reported. This was traced to sahara_walk_and_recalc() resizing req->src and causing the subsequent dma_map_sg() call to fail.

Now that the previous commit fixed sahara_sha_hw_links_create() to take into account the actual request size, rather than relying on sg->length values, the resize operation is no longer necessary.

Therefore, remove sahara_walk_and_recalc() and simplify associated logic.

Fixes 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
---
 drivers/crypto/sahara.c | 38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)
drivers/crypto/sahara.c +2 -36
index dd8291a4442c..fabe4f381fb6 100644
@@ -886,24 +886,6 @@ static int sahara_sha_hw_context_descriptor_create(struct sahara_dev *dev,
 	return 0;
 }
 
-static int sahara_walk_and_recalc(struct scatterlist *sg, unsigned int nbytes)
-{
-	if (!sg || !sg->length)
-		return nbytes;
-
-	while (nbytes && sg) {
-		if (nbytes <= sg->length) {
-			sg->length = nbytes;
-			sg_mark_end(sg);
-			break;
-		}
-		nbytes -= sg->length;
-		sg = sg_next(sg);
-	}
-
-	return nbytes;
-}
-
 static int sahara_sha_prepare_request(struct ahash_request *req)
 {
 	struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
@@ -940,36 +922,20 @@ static int sahara_sha_prepare_request(struct ahash_request *req)
 					hash_later, 0);
 	}
 
-	/* nbytes should now be multiple of blocksize */
-	req->nbytes = req->nbytes - hash_later;
-
-	sahara_walk_and_recalc(req->src, req->nbytes);
-
+	rctx->total = len - hash_later;
 	/* have data from previous operation and current */
 	if (rctx->buf_cnt && req->nbytes) {
 		sg_init_table(rctx->in_sg_chain, 2);
 		sg_set_buf(rctx->in_sg_chain, rctx->rembuf, rctx->buf_cnt);
-
 		sg_chain(rctx->in_sg_chain, 2, req->src);
-
-		rctx->total = req->nbytes + rctx->buf_cnt;
 		rctx->in_sg = rctx->in_sg_chain;
-
-		req->src = rctx->in_sg_chain;
 	/* only data from previous operation */
 	} else if (rctx->buf_cnt) {
-		if (req->src)
-			rctx->in_sg = req->src;
-		else
-			rctx->in_sg = rctx->in_sg_chain;
-		/* buf was copied into rembuf above */
+		rctx->in_sg = rctx->in_sg_chain;
 		sg_init_one(rctx->in_sg, rctx->rembuf, rctx->buf_cnt);
-		rctx->total = rctx->buf_cnt;
 	/* no data from previous operation */
 	} else {
 		rctx->in_sg = req->src;
-		rctx->total = req->nbytes;
-		req->src = rctx->in_sg;
 	}
 
 	/* on next call, we only have the remaining data in the buffer */
Signature · 1 line
2.43.0
author maintainer
#83 lore raw

PATCH 82/641 crypto: scomp - fix req->dst buffer overflow

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Chengming Zhou <[email protected]>

[ Upstream commit 744e1885922a9943458954cfea917b31064b4131 ]

The req->dst buffer size should be checked before copying from the scomp_scratch->dst to avoid req->dst buffer overflow problem.

Fixes 1ab53a77b772 ("crypto: acomp - add driver-side scomp interface")
Reported-by [email protected]
---
 crypto/scompress.c | 6 ++++++
 1 file changed, 6 insertions(+)
crypto/scompress.c +6 -0
index 442a82c9de7d..b108a30a7600 100644
@@ -117,6 +117,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
 	struct crypto_scomp *scomp = *tfm_ctx;
 	void **ctx = acomp_request_ctx(req);
 	struct scomp_scratch *scratch;
+	unsigned int dlen;
 	int ret;
 
 	if (!req->src || !req->slen || req->slen > SCOMP_SCRATCH_SIZE)
@@ -128,6 +129,8 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
 	if (!req->dlen || req->dlen > SCOMP_SCRATCH_SIZE)
 		req->dlen = SCOMP_SCRATCH_SIZE;
 
+	dlen = req->dlen;
+
 	scratch = raw_cpu_ptr(&scomp_scratch);
 	spin_lock(&scratch->lock);
 
@@ -145,6 +148,9 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
 				ret = -ENOMEM;
 				goto out;
 			}
+		} else if (req->dlen > dlen) {
+			ret = -ENOSPC;
+			goto out;
 		}
 		scatterwalk_map_and_copy(scratch->dst, req->dst, 0, req->dlen,
 					 1);
Signature · 1 line
2.43.0
author maintainer
#84 lore raw

PATCH 83/641 keys, dns: Fix size check of V1 server-list header

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: David Howells <[email protected]>

[ Upstream commit acc657692aed438e9931438f8c923b2b107aebf9 ]

Fix the size check added to dns_resolver_preparse() for the V1 server-list header so that it doesn't give EINVAL if the size supplied is the same as the size of the header struct (which should be valid).

This can be tested with:

        echo -n -e '\0\0\01\xff\0\0' | keyctl padd dns_resolver desc @p

which will give "add_key: Invalid argument" without this fix.

Fixes 1997b3cb4217 ("keys, dns: Fix missing size check of V1 server-list header")
---
 net/dns_resolver/dns_key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/dns_resolver/dns_key.c +1 -1
index f18ca02aa95a..c42ddd85ff1f 100644
@@ -104,7 +104,7 @@ dns_resolver_preparse(struct key_preparsed_payload *prep)
 		const struct dns_server_list_v1_header *v1;
 
 		/* It may be a server list. */
-		if (datalen <= sizeof(*v1))
+		if (datalen < sizeof(*v1))
 			return -EINVAL;
 
 		v1 = (const struct dns_server_list_v1_header *)data;
Signature · 1 line
2.43.0
author maintainer
#85 lore raw

PATCH 84/641 csky: fix arch_jump_label_transform_static override

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Arnd Bergmann <[email protected]>

[ Upstream commit ca8e45c8048a2c9503c74751d25414601f730580 ]

The arch_jump_label_transform_static() function in csky was originally meant to override the generic __weak function, but that got changed to an #ifndef check.

This showed up as a missing-prototype warning:
arch/csky/kernel/jump_label.c:43:6: error: no previous prototype for 'arch_jump_label_transform_static' [-Werror=missing-prototypes]

Change the method to use the new method of having a #define and a prototype for the global function.

Fixes 7e6b9db27de9 ("jump_label: make initial NOP patching the special case")
Fixes 4e8bb4ba5a55 ("csky: Add jump-label implementation")
---
 arch/csky/include/asm/jump_label.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/csky/include/asm/jump_label.h +5 -0
index d488ba6084bc..98a3f4b168bd 100644
@@ -43,5 +43,10 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key,
 	return true;
 }
 
+enum jump_label_type;
+void arch_jump_label_transform_static(struct jump_entry *entry,
+				      enum jump_label_type type);
+#define arch_jump_label_transform_static arch_jump_label_transform_static
+
 #endif  /* __ASSEMBLY__ */
 #endif	/* __ASM_CSKY_JUMP_LABEL_H */
Signature · 1 line
2.43.0
author maintainer
#86 lore raw

PATCH 85/641 blocklayoutdriver: Fix reference leak of pnfs_device_node

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Benjamin Coddington <[email protected]>

[ Upstream commit 1530827b90025cdf80c9b0d07a166d045a0a7b81 ]

The error path for blocklayout's device lookup is missing a reference drop for the case where a lookup finds the device, but the device is marked with NFS_DEVICEID_UNAVAILABLE.

Fixes b3dce6a2f060 ("pnfs/blocklayout: handle transient devices")
---
 fs/nfs/blocklayout/blocklayout.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfs/blocklayout/blocklayout.c +2 -0
index 943aeea1eb16..1d1d7abc3205 100644
@@ -580,6 +580,8 @@ bl_find_get_deviceid(struct nfs_server *server,
 		nfs4_delete_deviceid(node->ld, node->nfs_client, id);
 		goto retry;
 	}
+
+	nfs4_put_deviceid_node(node);
 	return ERR_PTR(-ENODEV);
 }
 
Signature · 1 line
2.43.0
author maintainer
#87 lore raw

PATCH 86/641 NFS: Use parents objective cred in nfs_access_login_time()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Scott Mayhew <[email protected]>

[ Upstream commit a10a9233073d984b239e22358ba21825e27e2e88 ]

The subjective cred (task->cred) can potentially be overridden and subsquently freed in non-RCU context, which could lead to a panic if we try to use it in cred_fscmp(). Use __task_cred(), which returns the objective cred (task->real_cred) instead.

Fixes 0eb43812c027 ("NFS: Clear the file access cache upon login")
Fixes 5e9a7b9c2ea1 ("NFS: Fix up a sparse warning")
---
 fs/nfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfs/dir.c +1 -1
index 13dffe4201e6..273c0b68abf4 100644
@@ -2963,7 +2963,7 @@ static u64 nfs_access_login_time(const struct task_struct *task,
 	rcu_read_lock();
 	for (;;) {
 		parent = rcu_dereference(task->real_parent);
-		pcred = rcu_dereference(parent->cred);
+		pcred = __task_cred(parent);
 		if (parent == task || cred_fscmp(pcred, cred) != 0)
 			break;
 		task = parent;
Signature · 1 line
2.43.0
author maintainer
#88 lore raw

PATCH 87/641 NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Trond Myklebust <[email protected]>

[ Upstream commit 037e56a22ff37f9a9c2330b66cff55d3d1ff9b90 ]

Once the client has processed the CB_LAYOUTRECALL, but has not yet successfully returned the layout, the server is supposed to switch to returning NFS4ERR_RETURNCONFLICT. This patch ensures that we handle that return value correctly.

Fixes 183d9e7b112a ("pnfs: rework LAYOUTGET retry handling")
---
 fs/nfs/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)
fs/nfs/nfs4proc.c +3 -0
index 8a943fffaad5..23819a756508 100644
@@ -170,6 +170,7 @@ static int nfs4_map_errors(int err)
 	case -NFS4ERR_RESOURCE:
 	case -NFS4ERR_LAYOUTTRYLATER:
 	case -NFS4ERR_RECALLCONFLICT:
+	case -NFS4ERR_RETURNCONFLICT:
 		return -EREMOTEIO;
 	case -NFS4ERR_WRONGSEC:
 	case -NFS4ERR_WRONG_CRED:
@@ -558,6 +559,7 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
 		case -NFS4ERR_GRACE:
 		case -NFS4ERR_LAYOUTTRYLATER:
 		case -NFS4ERR_RECALLCONFLICT:
+		case -NFS4ERR_RETURNCONFLICT:
 			exception->delay = 1;
 			return 0;
 
@@ -9691,6 +9693,7 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
 		status = -EBUSY;
 		break;
 	case -NFS4ERR_RECALLCONFLICT:
+	case -NFS4ERR_RETURNCONFLICT:
 		status = -ERECALLCONFLICT;
 		break;
 	case -NFS4ERR_DELEG_REVOKED:
Signature · 1 line
2.43.0
author maintainer
#89 lore raw

PATCH 88/641 SUNRPC: fix _xprt_switch_find_current_entry logic

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Olga Kornievskaia <[email protected]>

[ Upstream commit 98b4e5137504a5bd9346562b1310cdc13486603b ]

Fix the logic for picking current transport entry.

Fixes 95d0d30c66b8 ("SUNRPC create an iterator to list only OFFLINE xprts")
---
 net/sunrpc/xprtmultipath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/xprtmultipath.c +1 -1
index 701250b305db..74ee2271251e 100644
@@ -284,7 +284,7 @@ struct rpc_xprt *_xprt_switch_find_current_entry(struct list_head *head,
 		if (cur == pos)
 			found = true;
 		if (found && ((find_active && xprt_is_active(pos)) ||
-			      (!find_active && xprt_is_active(pos))))
+			      (!find_active && !xprt_is_active(pos))))
 			return pos;
 	}
 	return NULL;
Signature · 1 line
2.43.0
author maintainer
#90 lore raw

PATCH 89/641 pNFS: Fix the pnfs block drivers calculation of layoutget size

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Trond Myklebust <[email protected]>

[ Upstream commit 8a6291bf3b0eae1bf26621e6419a91682f2d6227 ]

Instead of relying on the value of the 'bytes_left' field, we should calculate the layout size based on the offset of the request that is being written out.

---
 fs/nfs/blocklayout/blocklayout.c | 5 ++---
 fs/nfs/direct.c                  | 5 +++--
 fs/nfs/internal.h                | 2 +-
 fs/nfs/pnfs.c                    | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)
fs/nfs/blocklayout/blocklayout.c +2 -3
index 1d1d7abc3205..6be13e0ec170 100644
@@ -895,10 +895,9 @@ bl_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
 	}
 
 	if (pgio->pg_dreq == NULL)
-		wb_size = pnfs_num_cont_bytes(pgio->pg_inode,
-					      req->wb_index);
+		wb_size = pnfs_num_cont_bytes(pgio->pg_inode, req->wb_index);
 	else
-		wb_size = nfs_dreq_bytes_left(pgio->pg_dreq);
+		wb_size = nfs_dreq_bytes_left(pgio->pg_dreq, req_offset(req));
 
 	pnfs_generic_pg_init_write(pgio, req, wb_size);
 
fs/nfs/direct.c +3 -2
index f6c74f424691..5918c67dae0d 100644
@@ -205,9 +205,10 @@ static void nfs_direct_req_release(struct nfs_direct_req *dreq)
 	kref_put(&dreq->kref, nfs_direct_req_free);
 }
 
-ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq)
+ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq, loff_t offset)
 {
-	return dreq->bytes_left;
+	loff_t start = offset - dreq->io_start;
+	return dreq->max_count - start;
 }
 EXPORT_SYMBOL_GPL(nfs_dreq_bytes_left);
 
fs/nfs/internal.h +1 -1
index 9c9cf764f600..b1fa81c9dff6 100644
@@ -655,7 +655,7 @@ extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry);
 /* direct.c */
 void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
 			      struct nfs_direct_req *dreq);
-extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq);
+extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq, loff_t offset);
 
 /* nfs4proc.c */
 extern struct nfs_client *nfs4_init_client(struct nfs_client *clp,
fs/nfs/pnfs.c +2 -1
index 21a365357629..0c0fed1ecd0b 100644
@@ -2733,7 +2733,8 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r
 		if (pgio->pg_dreq == NULL)
 			rd_size = i_size_read(pgio->pg_inode) - req_offset(req);
 		else
-			rd_size = nfs_dreq_bytes_left(pgio->pg_dreq);
+			rd_size = nfs_dreq_bytes_left(pgio->pg_dreq,
+						      req_offset(req));
 
 		pgio->pg_lseg =
 			pnfs_update_layout(pgio->pg_inode, nfs_req_openctx(req),
Signature · 1 line
2.43.0
author maintainer
#91 lore raw

PATCH 90/641 SUNRPC: Fixup v4.1 backchannel request timeouts

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Benjamin Coddington <[email protected]>

[ Upstream commit e6f533b615971afcaa1141573a1a1714d9d4f31a ]

After commit 59464b262ff5 ("SUNRPC: SOFTCONN tasks should time out when on the sending list"), any 4.1 backchannel tasks placed on the sending queue would immediately return with -ETIMEDOUT since their req timers are zero.

Initialize the backchannel's rpc_rqst timeout parameters from the xprt's default timeout settings.

Fixes 59464b262ff5 ("SUNRPC: SOFTCONN tasks should time out when on the sending list")
---
 net/sunrpc/xprt.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
net/sunrpc/xprt.c +14 -9
index 2364c485540c..6cc9ffac962d 100644
@@ -651,9 +651,9 @@ static unsigned long xprt_abs_ktime_to_jiffies(ktime_t abstime)
 		jiffies + nsecs_to_jiffies(-delta);
 }
 
-static unsigned long xprt_calc_majortimeo(struct rpc_rqst *req)
+static unsigned long xprt_calc_majortimeo(struct rpc_rqst *req,
+		const struct rpc_timeout *to)
 {
-	const struct rpc_timeout *to = req->rq_task->tk_client->cl_timeout;
 	unsigned long majortimeo = req->rq_timeout;
 
 	if (to->to_exponential)
@@ -665,9 +665,10 @@ static unsigned long xprt_calc_majortimeo(struct rpc_rqst *req)
 	return majortimeo;
 }
 
-static void xprt_reset_majortimeo(struct rpc_rqst *req)
+static void xprt_reset_majortimeo(struct rpc_rqst *req,
+		const struct rpc_timeout *to)
 {
-	req->rq_majortimeo += xprt_calc_majortimeo(req);
+	req->rq_majortimeo += xprt_calc_majortimeo(req, to);
 }
 
 static void xprt_reset_minortimeo(struct rpc_rqst *req)
@@ -675,7 +676,8 @@ static void xprt_reset_minortimeo(struct rpc_rqst *req)
 	req->rq_minortimeo += req->rq_timeout;
 }
 
-static void xprt_init_majortimeo(struct rpc_task *task, struct rpc_rqst *req)
+static void xprt_init_majortimeo(struct rpc_task *task, struct rpc_rqst *req,
+		const struct rpc_timeout *to)
 {
 	unsigned long time_init;
 	struct rpc_xprt *xprt = req->rq_xprt;
@@ -684,8 +686,9 @@ static void xprt_init_majortimeo(struct rpc_task *task, struct rpc_rqst *req)
 		time_init = jiffies;
 	else
 		time_init = xprt_abs_ktime_to_jiffies(task->tk_start);
-	req->rq_timeout = task->tk_client->cl_timeout->to_initval;
-	req->rq_majortimeo = time_init + xprt_calc_majortimeo(req);
+
+	req->rq_timeout = to->to_initval;
+	req->rq_majortimeo = time_init + xprt_calc_majortimeo(req, to);
 	req->rq_minortimeo = time_init + req->rq_timeout;
 }
 
@@ -713,7 +716,7 @@ int xprt_adjust_timeout(struct rpc_rqst *req)
 	} else {
 		req->rq_timeout = to->to_initval;
 		req->rq_retries = 0;
-		xprt_reset_majortimeo(req);
+		xprt_reset_majortimeo(req, to);
 		/* Reset the RTT counters == "slow start" */
 		spin_lock(&xprt->transport_lock);
 		rpc_init_rtt(req->rq_task->tk_client->cl_rtt, to->to_initval);
@@ -1886,7 +1889,7 @@ xprt_request_init(struct rpc_task *task)
 	req->rq_snd_buf.bvec = NULL;
 	req->rq_rcv_buf.bvec = NULL;
 	req->rq_release_snd_buf = NULL;
-	xprt_init_majortimeo(task, req);
+	xprt_init_majortimeo(task, req, task->tk_client->cl_timeout);
 
 	trace_xprt_reserve(req);
 }
@@ -1996,6 +1999,8 @@ xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task)
 	 */
 	xbufp->len = xbufp->head[0].iov_len + xbufp->page_len +
 		xbufp->tail[0].iov_len;
+
+	xprt_init_majortimeo(task, req, req->rq_xprt->timeout);
 }
 #endif
 
Signature · 1 line
2.43.0
author maintainer
#92 lore raw

PATCH 91/641 asm-generic: Fix 32 bit __generic_cmpxchg_local

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: David McKay <[email protected]>

[ Upstream commit d93cca2f3109f88c94a32d3322ec8b2854a9c339 ]

Commit 656e9007ef58 ("asm-generic: avoid __generic_cmpxchg_local warnings") introduced a typo that means the code is incorrect for 32 bit values. It will work fine for postive numbers, but will fail for negative numbers on a system where longs are 64 bit.

Fixes 656e9007ef58 ("asm-generic: avoid __generic_cmpxchg_local warnings")
---
 include/asm-generic/cmpxchg-local.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/cmpxchg-local.h +1 -1
index 3df9f59a544e..f27d66fdc00a 100644
@@ -34,7 +34,7 @@ static inline unsigned long __generic_cmpxchg_local(volatile void *ptr,
 			*(u16 *)ptr = (new & 0xffffu);
 		break;
 	case 4: prev = *(u32 *)ptr;
-		if (prev == (old & 0xffffffffffu))
+		if (prev == (old & 0xffffffffu))
 			*(u32 *)ptr = (new & 0xffffffffu);
 		break;
 	case 8: prev = *(u64 *)ptr;
Signature · 1 line
2.43.0
author maintainer
#93 lore raw

PATCH 92/641 arm64: dts: qcom: qrb4210-rb2: dont force usb peripheral mode

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Caleb Connolly <[email protected]>

[ Upstream commit 27c2ca90e2f34cd3c4849af996e1a96a69e700d3 ]

The rb2 only has a single USB controller, it can be switched between a type-c port and an internal USB hub via a DIP switch. Until dynamic role switching is available it's preferable to put the USB controller in host mode so that the type-A ports and ethernet are available.

---
 arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/qcom/qrb4210-rb2.dts +0 -1
index a7278a9472ed..9738c0dacd58 100644
@@ -518,7 +518,6 @@ &usb {
 
 &usb_dwc3 {
 	maximum-speed = "super-speed";
-	dr_mode = "peripheral";
 };
 
 &usb_hsphy {
Signature · 1 line
2.43.0
author maintainer
#94 lore raw

PATCH 93/641 arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Konrad Dybcio <[email protected]>

[ Upstream commit 0cd080dd6d08817c9980d2069197b066636b0f23 ]

The DP PHY needs different settings when an eDP display is used. Make sure these apply on the X13s.

FWIW
I could not notice any user-facing change stemming from this commit.

Fixes f48c70b111b4 ("arm64: dts: qcom: sc8280xp-x13s: enable eDP display")
---
 arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +1 -0
index 38edaf51aa34..6a4c6cc19c09 100644
@@ -601,6 +601,7 @@ mdss0_dp3_out: endpoint {
 };
 
 &mdss0_dp3_phy {
+	compatible = "qcom,sc8280xp-edp-phy";
 	vdda-phy-supply = <&vreg_l6b>;
 	vdda-pll-supply = <&vreg_l3b>;
 
Signature · 1 line
2.43.0
author maintainer
#95 lore raw

PATCH 94/641 arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Johan Hovold <[email protected]>

[ Upstream commit a3457cc5bc30ad053c90ae9f14e9b7723d204a98 ]

Add the missing pin configuration for the recently added camera indicator LED.

Fixes 1c63dd1c5fda ("arm64: dts: qcom: sc8280xp-x13s: Add camera activity LED")
Cc Konrad Dybcio <[email protected]>
---
 .../boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +10 -0
index 6a4c6cc19c09..f2055899ae7a 100644
@@ -82,6 +82,9 @@ switch-lid {
 	leds {
 		compatible = "gpio-leds";
 
+		pinctrl-names = "default";
+		pinctrl-0 = <&cam_indicator_en>;
+
 		led-camera-indicator {
 			label = "white:camera-indicator";
 			function = LED_FUNCTION_INDICATOR;
@@ -1278,6 +1281,13 @@ hstp-sw-ctrl-pins {
 		};
 	};
 
+	cam_indicator_en: cam-indicator-en-state {
+		pins = "gpio28";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	edp_reg_en: edp-reg-en-state {
 		pins = "gpio25";
 		function = "gpio";
Signature · 1 line
2.43.0
author maintainer
#96 lore raw

PATCH 95/641 ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Luca Weiss <[email protected]>

[ Upstream commit 836d083524888069cd358776a4e6c4ceec04962e ]

Some mmcc clocks have dsi0pll & dsi0pllbyte as clock parents so we should provide them in the dt, which I missed in the commit adding the mdss nodes.

---
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/qcom/qcom-msm8226.dtsi +2 -2
index 97a377b5a0ec..5cd03ea7b084 100644
@@ -442,8 +442,8 @@ mmcc: clock-controller@fd8c0000 {
 				 <&gcc GPLL0_VOTE>,
 				 <&gcc GPLL1_VOTE>,
 				 <&rpmcc RPM_SMD_GFX3D_CLK_SRC>,
-				 <0>,
-				 <0>;
+				 <&mdss_dsi0_phy 1>,
+				 <&mdss_dsi0_phy 0>;
 			clock-names = "xo",
 				      "mmss_gpll0_vote",
 				      "gpll0_vote",
Signature · 1 line
2.43.0
author maintainer
#97 lore raw

PATCH 96/641 wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Dan Carpenter <[email protected]>

[ Upstream commit 40018a8fa9aa63ca5b26e803502138158fb0ff96 ]

Check for if the usb_alloc_urb() failed.

Fixes 68d57a07bfe5 ("wireless: add plfxlc driver for pureLiFi X, XL, XC devices")
---
 drivers/net/wireless/purelifi/plfxlc/usb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/purelifi/plfxlc/usb.c +4 -1
index 76d0a778636a..311676c1ece0 100644
@@ -493,9 +493,12 @@ int plfxlc_usb_wreq_async(struct plfxlc_usb *usb, const u8 *buffer,
 			  void *context)
 {
 	struct usb_device *udev = interface_to_usbdev(usb->ez_usb);
-	struct urb *urb = usb_alloc_urb(0, GFP_ATOMIC);
+	struct urb *urb;
 	int r;
 
+	urb = usb_alloc_urb(0, GFP_ATOMIC);
+	if (!urb)
+		return -ENOMEM;
 	usb_fill_bulk_urb(urb, udev, usb_sndbulkpipe(udev, EP_DATA_OUT),
 			  (void *)buffer, buffer_len, complete_fn, context);
 
Signature · 1 line
2.43.0
author maintainer
#98 lore raw

PATCH 97/641 wifi: rtw88: fix RX filter in FIF_ALLMULTI flag

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Chih-Kang Chang <[email protected]>

[ Upstream commit 53ee0b3b99edc6a47096bffef15695f5a895386f ]

The broadcast packets will be filtered in the FIF_ALLMULTI flag in the original code, which causes beacon packets to be filtered out and disconnection. Therefore, we fix it.

---
 drivers/net/wireless/realtek/rtw88/mac80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/mac80211.c +2 -2
index a99b53d44267..d8d68f16014e 100644
@@ -280,9 +280,9 @@ static void rtw_ops_configure_filter(struct ieee80211_hw *hw,
 
 	if (changed_flags & FIF_ALLMULTI) {
 		if (*new_flags & FIF_ALLMULTI)
-			rtwdev->hal.rcr |= BIT_AM | BIT_AB;
+			rtwdev->hal.rcr |= BIT_AM;
 		else
-			rtwdev->hal.rcr &= ~(BIT_AM | BIT_AB);
+			rtwdev->hal.rcr &= ~(BIT_AM);
 	}
 	if (changed_flags & FIF_FCSFAIL) {
 		if (*new_flags & FIF_FCSFAIL)
Signature · 1 line
2.43.0
author maintainer
#99 lore raw

PATCH 98/641 bpf, lpm: Fix check prefixlen before walking trie

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Florian Lehner <[email protected]>

[ Upstream commit 9b75dbeb36fcd9fc7ed51d370310d0518a387769 ]

When looking up an element in LPM trie, the condition 'matchlen == trie->max_prefixlen' will never return true, if key->prefixlen is larger than trie->max_prefixlen. Consequently all elements in the LPM trie will be visited and no element is returned in the end.

To resolve this, check key->prefixlen first before walking the LPM trie.

Fixes b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")
---
 kernel/bpf/lpm_trie.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/bpf/lpm_trie.c +3 -0
index 17c7e7782a1f..b32be680da6c 100644
@@ -231,6 +231,9 @@ static void *trie_lookup_elem(struct bpf_map *map, void *_key)
 	struct lpm_trie_node *node, *found = NULL;
 	struct bpf_lpm_trie_key *key = _key;
 
+	if (key->prefixlen > trie->max_prefixlen)
+		return NULL;
+
 	/* Start walking the trie from the root node ... */
 
 	for (node = rcu_dereference_check(trie->root, rcu_read_lock_bh_held());
Signature · 1 line
2.43.0
author maintainer
#100 lore raw

PATCH 99/641 bpf: Add KF_RCU flag to bpf_refcount_acquire_impl

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Dave Marchevsky <[email protected]>

[ Upstream commit 1500a5d9f49cb66906d3ea1c9158df25cc41dd40 ]

Refcounted local kptrs are kptrs to user-defined types with a bpf_refcount field. Recent commits ([0], [1]) modified the lifetime of refcounted local kptrs such that the underlying memory is not reused until RCU grace period has elapsed.

Separately, verification of bpf_refcount_acquire calls currently succeeds for MAYBE_NULL non-owning reference input, which is a problem as bpf_refcount_acquire_impl has no handling for this case.

This patch takes advantage of aforementioned lifetime changes to tag bpf_refcount_acquire_impl kfunc KF_RCU, thereby preventing MAYBE_NULL input to the kfunc. The KF_RCU flag applies to all kfunc params; it's fine for it to apply to the void *meta__ign param as that's populated by the verifier and is tagged __ign regardless.

[0]: commit 7e26cd12ad1c ("bpf: Use bpf_mem_free_rcu when
bpf_obj_dropping refcounted nodes") is the actual change to allocation behaivor
[1]: commit 0816b8c6bf7f ("bpf: Consider non-owning refs to refcounted
nodes RCU protected") modified verifier understanding of refcounted local kptrs to match [0]'s changes

---
 kernel/bpf/helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/helpers.c +1 -1
index 56b0c1f678ee..6950f0461634 100644
@@ -2520,7 +2520,7 @@ BTF_ID_FLAGS(func, bpf_obj_new_impl, KF_ACQUIRE | KF_RET_NULL)
 BTF_ID_FLAGS(func, bpf_percpu_obj_new_impl, KF_ACQUIRE | KF_RET_NULL)
 BTF_ID_FLAGS(func, bpf_obj_drop_impl, KF_RELEASE)
 BTF_ID_FLAGS(func, bpf_percpu_obj_drop_impl, KF_RELEASE)
-BTF_ID_FLAGS(func, bpf_refcount_acquire_impl, KF_ACQUIRE | KF_RET_NULL)
+BTF_ID_FLAGS(func, bpf_refcount_acquire_impl, KF_ACQUIRE | KF_RET_NULL | KF_RCU)
 BTF_ID_FLAGS(func, bpf_list_push_front_impl)
 BTF_ID_FLAGS(func, bpf_list_push_back_impl)
 BTF_ID_FLAGS(func, bpf_list_pop_front, KF_ACQUIRE | KF_RET_NULL)
Signature · 1 line
2.43.0
author maintainer
#101 lore raw

PATCH 100/641 bpf: Add crosstask check to __bpf_get_stack

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Jordan Rome <[email protected]>

[ Upstream commit b8e3a87a627b575896e448021e5c2f8a3bc19931 ]

Currently get_perf_callchain only supports user stack walking for the current task. Passing the correct *crosstask* param will return 0 frames if the task passed to __bpf_get_stack isn't the current one instead of a single incorrect frame/address. This change passes the correct *crosstask* param but also does a preemptive check in __bpf_get_stack if the task is current and returns -EOPNOTSUPP if it is not.

This issue was found using bpf_get_task_stack inside a BPF iterator ("iter/task"), which iterates over all tasks. bpf_get_task_stack works fine for fetching kernel stacks but because get_perf_callchain relies on the caller to know if the requested *task* is the current one (via *crosstask*) it was failing in a confusing way.

It might be possible to get user stacks for all tasks utilizing something like access_process_vm but that requires the bpf program calling bpf_get_task_stack to be sleepable and would therefore be a breaking change.

Fixes fa28dcb82a38 ("bpf: Introduce helper bpf_get_task_stack()")
---
 include/uapi/linux/bpf.h       |  3 +++
 kernel/bpf/stackmap.c          | 11 ++++++++++-
 tools/include/uapi/linux/bpf.h |  3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)
include/uapi/linux/bpf.h +3 -0
index 0f6cdf52b1da..bda948a685e5 100644
@@ -4517,6 +4517,8 @@ union bpf_attr {
  * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags)
  *	Description
  *		Return a user or a kernel stack in bpf program provided buffer.
+ *		Note: the user stack will only be populated if the *task* is
+ *		the current task; all other tasks will return -EOPNOTSUPP.
  *		To achieve this, the helper needs *task*, which is a valid
  *		pointer to **struct task_struct**. To store the stacktrace, the
  *		bpf program provides *buf* with a nonnegative *size*.
@@ -4528,6 +4530,7 @@ union bpf_attr {
  *
  *		**BPF_F_USER_STACK**
  *			Collect a user space stack instead of a kernel stack.
+ *			The *task* must be the current task.
  *		**BPF_F_USER_BUILD_ID**
  *			Collect buildid+offset instead of ips for user stack,
  *			only valid if **BPF_F_USER_STACK** is also specified.
kernel/bpf/stackmap.c +10 -1
index d6b277482085..dff7ba539701 100644
@@ -388,6 +388,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 {
 	u32 trace_nr, copy_len, elem_size, num_elem, max_depth;
 	bool user_build_id = flags & BPF_F_USER_BUILD_ID;
+	bool crosstask = task && task != current;
 	u32 skip = flags & BPF_F_SKIP_FIELD_MASK;
 	bool user = flags & BPF_F_USER_STACK;
 	struct perf_callchain_entry *trace;
@@ -410,6 +411,14 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 	if (task && user && !user_mode(regs))
 		goto err_fault;
 
+	/* get_perf_callchain does not support crosstask user stack walking
+	 * but returns an empty stack instead of NULL.
+	 */
+	if (crosstask && user) {
+		err = -EOPNOTSUPP;
+		goto clear;
+	}
+
 	num_elem = size / elem_size;
 	max_depth = num_elem + skip;
 	if (sysctl_perf_event_max_stack < max_depth)
@@ -421,7 +430,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 		trace = get_callchain_entry_for_task(task, max_depth);
 	else
 		trace = get_perf_callchain(regs, 0, kernel, user, max_depth,
-					   false, false);
+					   crosstask, false);
 	if (unlikely(!trace))
 		goto err_fault;
 
tools/include/uapi/linux/bpf.h +3 -0
index 0f6cdf52b1da..bda948a685e5 100644
@@ -4517,6 +4517,8 @@ union bpf_attr {
  * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags)
  *	Description
  *		Return a user or a kernel stack in bpf program provided buffer.
+ *		Note: the user stack will only be populated if the *task* is
+ *		the current task; all other tasks will return -EOPNOTSUPP.
  *		To achieve this, the helper needs *task*, which is a valid
  *		pointer to **struct task_struct**. To store the stacktrace, the
  *		bpf program provides *buf* with a nonnegative *size*.
@@ -4528,6 +4530,7 @@ union bpf_attr {
  *
  *		**BPF_F_USER_STACK**
  *			Collect a user space stack instead of a kernel stack.
+ *			The *task* must be the current task.
  *		**BPF_F_USER_BUILD_ID**
  *			Collect buildid+offset instead of ips for user stack,
  *			only valid if **BPF_F_USER_STACK** is also specified.
Signature · 1 line
2.43.0
author maintainer
#102 lore raw

PATCH 101/641 wifi: ath11k: Defer on rproc_get failure

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Luca Weiss <[email protected]>

[ Upstream commit 2a3ec40b98b46c339adb57313d3b933ee5e7a8e8 ]

If we already have gotten the rproc_handle (meaning the "qcom,rproc" property is defined in the devicetree), it's a valid state that the remoteproc module hasn't probed yet so we should defer probing instead of just failing to probe.

This resolves a race condition when the ath11k driver probes and fails before the wpss remoteproc driver has probed, like the following:

  [    6.232360] ath11k 17a10040.wifi: failed to get rproc
  [    6.232366] ath11k 17a10040.wifi: failed to get rproc: -22
  [    6.232478] ath11k: probe of 17a10040.wifi failed with error -22
       ...
  [    6.252415] remoteproc remoteproc2: 8a00000.remoteproc is available
  [    6.252776] remoteproc remoteproc2: powering up 8a00000.remoteproc
  [    6.252781] remoteproc remoteproc2: Booting fw image qcom/qcm6490/fairphone5/wpss.mdt, size 7188

So, defer the probe if we hit that so we can retry later once the wpss remoteproc is available.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01264-QCAMSLSWPLZ-1.37886.3

Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
---
 drivers/net/wireless/ath/ath11k/ahb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +2 -2
index 235336ef2a7a..f8f5e653cd03 100644
@@ -803,8 +803,8 @@ static int ath11k_core_get_rproc(struct ath11k_base *ab)
 
 	prproc = rproc_get_by_phandle(rproc_phandle);
 	if (!prproc) {
-		ath11k_err(ab, "failed to get rproc\n");
-		return -EINVAL;
+		ath11k_dbg(ab, ATH11K_DBG_AHB, "failed to get rproc, deferring\n");
+		return -EPROBE_DEFER;
 	}
 	ab_ahb->tgt_rproc = prproc;
 
Signature · 1 line
2.43.0
author maintainer
#103 lore raw

PATCH 102/641 wifi: libertas: stop selecting wext

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Arnd Bergmann <[email protected]>

[ Upstream commit 8170b04c2c92eee52ea50b96db4c54662197e512 ]

Libertas no longer references the iw_handler infrastructure or wext_spy, so neither of the 'select' statements are used any more.

---
 drivers/net/wireless/marvell/libertas/Kconfig | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/marvell/libertas/Kconfig +0 -2
index 6d62ab49aa8d..c7d02adb3eea 100644
@@ -2,8 +2,6 @@
 config LIBERTAS
 	tristate "Marvell 8xxx Libertas WLAN driver support"
 	depends on CFG80211
-	select WIRELESS_EXT
-	select WEXT_SPY
 	select LIB80211
 	select FW_LOADER
 	help
Signature · 1 line
2.43.0
author maintainer
#104 lore raw

PATCH 103/641 ARM: dts: qcom: apq8064: correct XOADC register address

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 554557542e709e190eff8a598f0cde02647d533a ]

The XOADC is present at the address 0x197 rather than just 197. It doesn't change a lot (since the driver hardcodes all register addresses), but the DT should present correct address anyway.

---
 arch/arm/boot/dts/qcom/qcom-apq8064.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-apq8064.dtsi +1 -1
index 59fd86b9fb47..099a16c34e1f 100644
@@ -738,7 +738,7 @@ pwrkey@1c {
 
 				xoadc: xoadc@197 {
 					compatible = "qcom,pm8921-adc";
-					reg = <197>;
+					reg = <0x197>;
 					interrupts-extended = <&pmicintc 78 IRQ_TYPE_EDGE_RISING>;
 					#address-cells = <2>;
 					#size-cells = <0>;
Signature · 1 line
2.43.0
author maintainer
#105 lore raw

PATCH 104/641 scsi: lpfc: Fix list_entry null check warning in lpfc_cmpl_els_plogi()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Justin Tee <[email protected]>

[ Upstream commit 1dec1311b9b6cc9c5fd26a77b936f542f03c51d1 ]

Smatch called out a warning for null checking a ptr that is assigned by list_entry(). list_entry() does not return null and, if the list is empty, can return an invalid ptr. Thus, the !psrp check does not execute properly.

drivers/scsi/lpfc/lpfc_els.c:2133 lpfc_cmpl_els_plogi()
warn: list_entry() does not return NULL 'prsp'

Replace list_entry() with list_get_first(), which does a list_empty() check before returning the first entry.

---
 drivers/scsi/lpfc/lpfc_els.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_els.c +2 -2
index f9627eddab08..0829fe6ddff8 100644
@@ -2128,8 +2128,8 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 						NLP_EVT_DEVICE_RM);
 	} else {
 		/* Good status, call state machine */
-		prsp = list_entry(cmdiocb->cmd_dmabuf->list.next,
-				  struct lpfc_dmabuf, list);
+		prsp = list_get_first(&cmdiocb->cmd_dmabuf->list,
+				      struct lpfc_dmabuf, list);
 		if (!prsp)
 			goto out;
 		if (!lpfc_is_els_acc_rsp(prsp))
Signature · 1 line
2.43.0
author maintainer
#106 lore raw

PATCH 105/641 net/ncsi: Fix netlink major/minor version numbers

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Peter Delevoryas <[email protected]>

[ Upstream commit 3084b58bfd0b9e4b5e034f31f31b42977db35f12 ]

The netlink interface for major and minor version numbers doesn't actually return the major and minor version numbers.

It reports a u32 that contains the (major, minor, update, alpha1) components as the major version number, and then alpha2 as the minor version number.

For whatever reason, the u32 byte order was reversed (ntohl): maybe it was assumed that the encoded value was a single big-endian u32, and alpha2 was the minor version.

The correct way to get the supported NC-SI version from the network controller is to parse the Get Version ID response as described in 8.4.44 of the NC-SI spec[1].

    Get Version ID Response Packet Format

              Bits
            +--------+--------+--------+--------+
     Bytes  | 31..24 | 23..16 | 15..8  | 7..0   |
    +-------+--------+--------+--------+--------+
    | 0..15 | NC-SI Header                      |
    +-------+--------+--------+--------+--------+
    | 16..19| Response code   | Reason code     |
    +-------+--------+--------+--------+--------+
    |20..23 | Major  | Minor  | Update | Alpha1 |
    +-------+--------+--------+--------+--------+
    |24..27 |         reserved         | Alpha2 |
    +-------+--------+--------+--------+--------+
    |            .... other stuff ....          |

The major, minor, and update fields are all binary-coded decimal (BCD) encoded [2]. The spec provides examples below the Get Version ID response format in section 8.4.44.1, but for practical purposes, this is an example from a live network card:

    root@bmc:~# ncsi-util 0x15
    NC-SI Command Response:
    cmd: GET_VERSION_ID(0x15)
    Response: COMMAND_COMPLETED(0x0000)  Reason: NO_ERROR(0x0000)
    Payload length = 40
    20: 0xf1 0xf1 0xf0 0x00 <<<<<<<<< (major, minor, update, alpha1)
    24: 0x00 0x00 0x00 0x00 <<<<<<<<< (_, _, _, alpha2)

    28: 0x6d 0x6c 0x78 0x30
    32: 0x2e 0x31 0x00 0x00
    36: 0x00 0x00 0x00 0x00
    40: 0x16 0x1d 0x07 0xd2
    44: 0x10 0x1d 0x15 0xb3
    48: 0x00 0x17 0x15 0xb3
    52: 0x00 0x00 0x81 0x19

This should be parsed as "1.1.0".

"f" in the upper-nibble means to ignore it, contributing zero.

If both nibbles are "f", I think the whole field is supposed to be ignored. Major and minor are "required", meaning they're not supposed to be "ff", but the update field is "optional" so I think it can be ff. I think the simplest thing to do is just set the major and minor to zero instead of juggling some conditional logic or something.

bcd2bin() from "include/linux/bcd.h" seems to assume both nibbles are 0-9, so I've provided a custom BCD decoding function.

Alpha1 and alpha2 are ISO/IEC 8859-1 encoded, which just means ASCII characters as far as I can tell, although the full encoding table for non-alphabetic characters is slightly different (I think).

I imagine the alpha fields are just supposed to be alphabetic characters, but I haven't seen any network cards actually report a non-zero value for either.

If people wrote software against this netlink behavior, and were parsing the major and minor versions themselves from the u32, then this would definitely break their code.

[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.0.0.pdf
[2] https://en.wikipedia.org/wiki/Binary-coded_decimal
[2] https://en.wikipedia.org/wiki/ISO/IEC_8859-1

Fixes 138635cc27c9 ("net/ncsi: NCSI response packet handler")
---
 net/ncsi/internal.h     |  7 +++++--
 net/ncsi/ncsi-netlink.c |  4 ++--
 net/ncsi/ncsi-pkt.h     |  7 +++++--
 net/ncsi/ncsi-rsp.c     | 26 ++++++++++++++++++++++++--
 4 files changed, 36 insertions(+), 8 deletions(-)
net/ncsi/internal.h +5 -2
index 03757e76bb6b..374412ed780b 100644
@@ -105,8 +105,11 @@ enum {
 
 
 struct ncsi_channel_version {
-	u32 version;		/* Supported BCD encoded NCSI version */
-	u32 alpha2;		/* Supported BCD encoded NCSI version */
+	u8   major;		/* NCSI version major */
+	u8   minor;		/* NCSI version minor */
+	u8   update;		/* NCSI version update */
+	char alpha1;		/* NCSI version alpha1 */
+	char alpha2;		/* NCSI version alpha2 */
 	u8  fw_name[12];	/* Firmware name string                */
 	u32 fw_version;		/* Firmware version                   */
 	u16 pci_ids[4];		/* PCI identification                 */
net/ncsi/ncsi-netlink.c +2 -2
index a3a6753a1db7..2f872d064396 100644
@@ -71,8 +71,8 @@ static int ncsi_write_channel_info(struct sk_buff *skb,
 	if (nc == nc->package->preferred_channel)
 		nla_put_flag(skb, NCSI_CHANNEL_ATTR_FORCED);
 
-	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MAJOR, nc->version.version);
-	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MINOR, nc->version.alpha2);
+	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MAJOR, nc->version.major);
+	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MINOR, nc->version.minor);
 	nla_put_string(skb, NCSI_CHANNEL_ATTR_VERSION_STR, nc->version.fw_name);
 
 	vid_nest = nla_nest_start_noflag(skb, NCSI_CHANNEL_ATTR_VLAN_LIST);
net/ncsi/ncsi-pkt.h +5 -2
index ba66c7dc3a21..c9d1da34dc4d 100644
@@ -197,9 +197,12 @@ struct ncsi_rsp_gls_pkt {
 /* Get Version ID */
 struct ncsi_rsp_gvi_pkt {
 	struct ncsi_rsp_pkt_hdr rsp;          /* Response header */
-	__be32                  ncsi_version; /* NCSI version    */
+	unsigned char           major;        /* NCSI version major */
+	unsigned char           minor;        /* NCSI version minor */
+	unsigned char           update;       /* NCSI version update */
+	unsigned char           alpha1;       /* NCSI version alpha1 */
 	unsigned char           reserved[3];  /* Reserved        */
-	unsigned char           alpha2;       /* NCSI version    */
+	unsigned char           alpha2;       /* NCSI version alpha2 */
 	unsigned char           fw_name[12];  /* f/w name string */
 	__be32                  fw_version;   /* f/w version     */
 	__be16                  pci_ids[4];   /* PCI IDs         */
net/ncsi/ncsi-rsp.c +24 -2
index 069c2659074b..480e80e3c283 100644
@@ -19,6 +19,19 @@
 #include "ncsi-pkt.h"
 #include "ncsi-netlink.h"
 
+/* Nibbles within [0xA, 0xF] add zero "0" to the returned value.
+ * Optional fields (encoded as 0xFF) will default to zero.
+ */
+static u8 decode_bcd_u8(u8 x)
+{
+	int lo = x & 0xF;
+	int hi = x >> 4;
+
+	lo = lo < 0xA ? lo : 0;
+	hi = hi < 0xA ? hi : 0;
+	return lo + hi * 10;
+}
+
 static int ncsi_validate_rsp_pkt(struct ncsi_request *nr,
 				 unsigned short payload)
 {
@@ -755,9 +768,18 @@ static int ncsi_rsp_handler_gvi(struct ncsi_request *nr)
 	if (!nc)
 		return -ENODEV;
 
-	/* Update to channel's version info */
+	/* Update channel's version info
+	 *
+	 * Major, minor, and update fields are supposed to be
+	 * unsigned integers encoded as packed BCD.
+	 *
+	 * Alpha1 and alpha2 are ISO/IEC 8859-1 characters.
+	 */
 	ncv = &nc->version;
-	ncv->version = ntohl(rsp->ncsi_version);
+	ncv->major = decode_bcd_u8(rsp->major);
+	ncv->minor = decode_bcd_u8(rsp->minor);
+	ncv->update = decode_bcd_u8(rsp->update);
+	ncv->alpha1 = rsp->alpha1;
 	ncv->alpha2 = rsp->alpha2;
 	memcpy(ncv->fw_name, rsp->fw_name, 12);
 	ncv->fw_version = ntohl(rsp->fw_version);
Signature · 1 line
2.43.0
author maintainer
#107 lore raw

PATCH 106/641 firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Christophe JAILLET <[email protected]>

[ Upstream commit 964946b88887089f447a9b6a28c39ee97dc76360 ]

The ending NULL is not taken into account by strncat(), so switch to snprintf() to correctly build 'debug_name'.

Using snprintf() also makes the code more readable.

---
 drivers/firmware/ti_sci.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/firmware/ti_sci.c +5 -5
index 7041befc756a..8b9a2556de16 100644
@@ -164,7 +164,7 @@ static int ti_sci_debugfs_create(struct platform_device *pdev,
 {
 	struct device *dev = &pdev->dev;
 	struct resource *res;
-	char debug_name[50] = "ti_sci_debug@";
+	char debug_name[50];
 
 	/* Debug region is optional */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
@@ -181,10 +181,10 @@ static int ti_sci_debugfs_create(struct platform_device *pdev,
 	/* Setup NULL termination */
 	info->debug_buffer[info->debug_region_size] = 0;
 
-	info->d = debugfs_create_file(strncat(debug_name, dev_name(dev),
-					      sizeof(debug_name) -
-					      sizeof("ti_sci_debug@")),
-				      0444, NULL, info, &ti_sci_debug_fops);
+	snprintf(debug_name, sizeof(debug_name), "ti_sci_debug@%s",
+		 dev_name(dev));
+	info->d = debugfs_create_file(debug_name, 0444, NULL, info,
+				      &ti_sci_debug_fops);
 	if (IS_ERR(info->d))
 		return PTR_ERR(info->d);
 
Signature · 1 line
2.43.0
author maintainer
#108 lore raw

PATCH 107/641 scsi: bfa: Use the proper data type for BLIST flags

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Bart Van Assche <[email protected]>

[ Upstream commit 0349be31e4ffc79723e46e2e373569567b06347b ]

Fix the following sparse warning:

drivers/scsi/bfa/bfad_bsg.c:2553:50: sparse: sparse: incorrect type in initializer (different base types)

---
 drivers/scsi/bfa/bfad_bsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/bfa/bfad_bsg.c +1 -1
index 520f9152f3bf..d4ceca2d435e 100644
@@ -2550,7 +2550,7 @@ bfad_iocmd_vf_clr_stats(struct bfad_s *bfad, void *cmd)
 static void bfad_reset_sdev_bflags(struct bfad_im_port_s *im_port,
 				   int lunmask_cfg)
 {
-	const u32 scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN;
+	const blist_flags_t scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN;
 	struct bfad_itnim_s *itnim;
 	struct scsi_device *sdev;
 	unsigned long flags;
Signature · 1 line
2.43.0
author maintainer
#109 lore raw

PATCH 108/641 wifi: ath12k: fix the error handler of rfkill config

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Karthikeyan Periyasamy <[email protected]>

[ Upstream commit 898d8b3e1414cd900492ee6a0b582f8095ba4a1a ]

When the core rfkill config throws error, it should free the allocated resources. Currently it is not freeing the core pdev create resources. Avoid this issue by calling the core pdev destroy in the error handler of core rfkill config.

Found this issue in the code review and it is compile tested only.

Fixes 004ccbc0dd49 ("wifi: ath12k: add support for hardware rfkill for WCN7850")
---
 drivers/net/wireless/ath/ath12k/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath12k/core.c +4 -2
index b936760b5140..6c01b282fcd3 100644
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/module.h>
@@ -698,13 +698,15 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
 	ret = ath12k_core_rfkill_config(ab);
 	if (ret && ret != -EOPNOTSUPP) {
 		ath12k_err(ab, "failed to config rfkill: %d\n", ret);
-		goto err_core_stop;
+		goto err_core_pdev_destroy;
 	}
 
 	mutex_unlock(&ab->core_lock);
 
 	return 0;
 
+err_core_pdev_destroy:
+	ath12k_core_pdev_destroy(ab);
 err_core_stop:
 	ath12k_core_stop(ab);
 	ath12k_mac_destroy(ab);
Signature · 1 line
2.43.0
author maintainer
#110 lore raw

PATCH 109/641 wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Su Hui <[email protected]>

[ Upstream commit bc8263083af60e7e57c6120edbc1f75d6c909a35 ]

Clang static checker warns:

drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:184:49:
The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'u32'. [core.UndefinedBinaryOperatorResult]

If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined.[1][2]

For example, when using different gcc's compilation optimization options (-O0 or -O2), the result of '(u32)data << 32' is different. One is 0, the other is old value of data. Let _rtl8821ae_phy_calculate_bit_shift()'s return value less than 32 to fix this problem. Warn if bitmask is zero.

[1] https://stackoverflow.com/questions/11270492/what-does-the-c-standard-say-about-bitshifting-more-bits-than-the-width-of-type
[2] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf

Fixes 21e4b0726dc6 ("rtlwifi: rtl8821ae: Move driver from staging to regular tree")
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c +3 -2
index 5323ead30db0..fa1839d8ee55 100644
@@ -29,9 +29,10 @@ static void _rtl8821ae_phy_rf_serial_write(struct ieee80211_hw *hw,
 					   u32 data);
 static u32 _rtl8821ae_phy_calculate_bit_shift(u32 bitmask)
 {
-	u32 i = ffs(bitmask);
+	if (WARN_ON_ONCE(!bitmask))
+		return 0;
 
-	return i ? i - 1 : 32;
+	return __ffs(bitmask);
 }
 static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw);
 /*static bool _rtl8812ae_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);*/
Signature · 1 line
2.43.0
author maintainer
#111 lore raw

PATCH 110/641 arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nitin Yadav <[email protected]>

[ Upstream commit 7dc4af358cc382c5d20bd5b726e53ef0f526eb6d ]

Fix number of gpio pins in main_gpio0 & main_gpio1 DT nodes according to AM62A7 datasheet[0].

[0] https://www.ti.com/lit/gpn/am62a3 Section: 6.3.10 GPIO (Page No. 52-55)

Fixes 5fc6b1b62639 ("arm64: dts: ti: Introduce AM62A7 family of SoCs")
---
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62a-main.dtsi +2 -2
index 4ae7fdc5221b..ccd708b09acd 100644
@@ -462,7 +462,7 @@ main_gpio0: gpio@600000 {
 			     <193>, <194>, <195>;
 		interrupt-controller;
 		#interrupt-cells = <2>;
-		ti,ngpio = <87>;
+		ti,ngpio = <92>;
 		ti,davinci-gpio-unbanked = <0>;
 		power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 77 0>;
@@ -480,7 +480,7 @@ main_gpio1: gpio@601000 {
 			     <183>, <184>, <185>;
 		interrupt-controller;
 		#interrupt-cells = <2>;
-		ti,ngpio = <88>;
+		ti,ngpio = <52>;
 		ti,davinci-gpio-unbanked = <0>;
 		power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 78 0>;
Signature · 1 line
2.43.0
author maintainer
#112 lore raw

PATCH 111/641 arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Tomi Valkeinen <[email protected]>

[ Upstream commit b57160859263c083c49482b0d083a586b1517f78 ]

DSS irq trigger type is set to IRQ_TYPE_EDGE_RISING in the DT file, but the TRM says it is level triggered.

For some reason triggering on rising edge results in double the amount of expected interrupts, e.g. for normal page flipping test the number of interrupts per second is 2 * fps. It is as if the IRQ triggers on both edges. There are no other side effects to this issue than slightly increased CPU & power consumption due to the extra interrupt.

Switching to IRQ_TYPE_LEVEL_HIGH is correct and fixes the issue, so let's do that.

---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +1 -1
index 5ebb87f467de..29048d6577cf 100644
@@ -1034,7 +1034,7 @@ dss: dss@4a00000 {
 		assigned-clocks = <&k3_clks 67 2>;
 		assigned-clock-parents = <&k3_clks 67 5>;
 
-		interrupts = <GIC_SPI 166 IRQ_TYPE_EDGE_RISING>;
+		interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
 
 		dma-coherent;
 
Signature · 1 line
2.43.0
author maintainer
#113 lore raw

PATCH 112/641 arm64: dts: ti: iot2050: Re-add aliases

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Jan Kiszka <[email protected]>

[ Upstream commit ad8edf4ff37ab157f6547da173aedc9f4e5c4015 ]

Lost while dropping them from the common dtsi.

---
 arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi +10 -0
index ba1c14a54acf..b849648d51f9 100644
@@ -14,6 +14,16 @@
 
 / {
 	aliases {
+		serial0 = &wkup_uart0;
+		serial1 = &mcu_uart0;
+		serial2 = &main_uart0;
+		serial3 = &main_uart1;
+		i2c0 = &wkup_i2c0;
+		i2c1 = &mcu_i2c0;
+		i2c2 = &main_i2c0;
+		i2c3 = &main_i2c1;
+		i2c4 = &main_i2c2;
+		i2c5 = &main_i2c3;
 		spi0 = &mcu_spi0;
 		mmc0 = &sdhci1;
 		mmc1 = &sdhci0;
Signature · 1 line
2.43.0
author maintainer
#114 lore raw

PATCH 113/641 wifi: rtw88: sdio: Honor the host max_req_size in the RX path

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Martin Blumenstingl <[email protected]>

[ Upstream commit 00384f565a91c08c4bedae167f749b093d10e3fe ]

Lukas reports skb_over_panic errors on his Banana Pi BPI-CM4 which comes with an Amlogic A311D (G12B) SoC and a RTL8822CS SDIO wifi/Bluetooth combo card. The error he observed is identical to what has been fixed in commit e967229ead0e ("wifi: rtw88: sdio: Check the HISR RX_REQUEST bit in rtw_sdio_rx_isr()") but that commit didn't fix Lukas' problem.

Lukas found that disabling or limiting RX aggregation works around the problem for some time (but does not fully fix it). In the following discussion a few key topics have been discussed which have an impact on this problem:
- The Amlogic A311D (G12B) SoC has a hardware bug in the SDIO controller which prevents DMA transfers. Instead all transfers need to go through the controller SRAM which limits transfers to 1536 bytes
- rtw88 chips don't split incoming (RX) packets, so if a big packet is received this is forwarded to the host in it's original form
- rtw88 chips can do RX aggregation, meaning more multiple incoming packets can be pulled by the host from the card with one MMC/SDIO transfer. This Depends on settings in the REG_RXDMA_AGG_PG_TH register (BIT_RXDMA_AGG_PG_TH limits the number of packets that will be aggregated, BIT_DMA_AGG_TO_V1 configures a timeout for aggregation and BIT_EN_PRE_CALC makes the chip honor the limits more effectively)

Use multiple consecutive reads in rtw_sdio_read_port() and limit the number of bytes which are copied by the host from the card in one MMC/SDIO transfer. This allows receiving a buffer that's larger than the hosts max_req_size (number of bytes which can be transferred in one MMC/SDIO transfer). As a result of this the skb_over_panic error is gone as the rtw88 driver is now able to receive more than 1536 bytes from the card (either because the incoming packet is larger than that or because multiple packets have been aggregated).

In case of an receive errors (-EILSEQ has been observed by Lukas) we need to drain the remaining data from the card's buffer, otherwise the card will return corrupt data for the next rtw_sdio_read_port() call.

---
 drivers/net/wireless/realtek/rtw88/sdio.c | 35 ++++++++++++++++++-----
 1 file changed, 28 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtw88/sdio.c +28 -7
index 2c1fb2dabd40..0cae5746f540 100644
@@ -500,19 +500,40 @@ static u32 rtw_sdio_get_tx_addr(struct rtw_dev *rtwdev, size_t size,
 static int rtw_sdio_read_port(struct rtw_dev *rtwdev, u8 *buf, size_t count)
 {
 	struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+	struct mmc_host *host = rtwsdio->sdio_func->card->host;
 	bool bus_claim = rtw_sdio_bus_claim_needed(rtwsdio);
 	u32 rxaddr = rtwsdio->rx_addr++;
-	int ret;
+	int ret = 0, err;
+	size_t bytes;
 
 	if (bus_claim)
 		sdio_claim_host(rtwsdio->sdio_func);
 
-	ret = sdio_memcpy_fromio(rtwsdio->sdio_func, buf,
-				 RTW_SDIO_ADDR_RX_RX0FF_GEN(rxaddr), count);
-	if (ret)
-		rtw_warn(rtwdev,
-			 "Failed to read %zu byte(s) from SDIO port 0x%08x",
-			 count, rxaddr);
+	while (count > 0) {
+		bytes = min_t(size_t, host->max_req_size, count);
+
+		err = sdio_memcpy_fromio(rtwsdio->sdio_func, buf,
+					 RTW_SDIO_ADDR_RX_RX0FF_GEN(rxaddr),
+					 bytes);
+		if (err) {
+			rtw_warn(rtwdev,
+				 "Failed to read %zu byte(s) from SDIO port 0x%08x: %d",
+				 bytes, rxaddr, err);
+
+			 /* Signal to the caller that reading did not work and
+			  * that the data in the buffer is short/corrupted.
+			  */
+			ret = err;
+
+			/* Don't stop here - instead drain the remaining data
+			 * from the card's buffer, else the card will return
+			 * corrupt data for the next rtw_sdio_read_port() call.
+			 */
+		}
+
+		count -= bytes;
+		buf += bytes;
+	}
 
 	if (bus_claim)
 		sdio_release_host(rtwsdio->sdio_func);
Signature · 1 line
2.43.0
author maintainer
#115 lore raw

PATCH 114/641 selftests/bpf: Fix erroneous bitmask operation

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Jeroen van Ingen Schenau <[email protected]>

[ Upstream commit b6a3451e0847d5d70fb5fa2b2a80ab9f80bf2c7b ]

xdp_synproxy_kern.c is a BPF program that generates SYN cookies on allowed TCP ports and sends SYNACKs to clients, accelerating synproxy iptables module.

Fix the bitmask operation when checking the status of an existing conntrack entry within tcp_lookup() function. Do not AND with the bit position number, but with the bitmask value to check whether the entry found has the IPS_CONFIRMED flag set.

---
 tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c +2 -2
index 80f620602d50..518329c666e9 100644
@@ -467,13 +467,13 @@ static __always_inline int tcp_lookup(void *ctx, struct header_pointers *hdr, bo
 		unsigned long status = ct->status;
 
 		bpf_ct_release(ct);
-		if (status & IPS_CONFIRMED_BIT)
+		if (status & IPS_CONFIRMED)
 			return XDP_PASS;
 	} else if (ct_lookup_opts.error != -ENOENT) {
 		return XDP_ABORTED;
 	}
 
-	/* error == -ENOENT || !(status & IPS_CONFIRMED_BIT) */
+	/* error == -ENOENT || !(status & IPS_CONFIRMED) */
 	return XDP_TX;
 }
 
Signature · 1 line
2.43.0
author maintainer
#116 lore raw

PATCH 115/641 md: synchronize flush io with array reconfiguration

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Yu Kuai <[email protected]>

[ Upstream commit fa2bbff7b0b4e211fec5e5686ef96350690597b5 ]

Currently rcu is used to protect iterating rdev from submit_flushes():

submit_flushes remove_and_add_spares

				synchronize_rcu
				pers->hot_remove_disk()
 rcu_read_lock()
 rdev_for_each_rcu
  if (rdev->raid_disk >= 0)
				rdev->radi_disk = -1;

atomic_inc(&rdev->nr_pending)
rcu_read_unlock()
bi = bio_alloc_bioset()
bi->bi_end_io = md_end_flush
bi->private = rdev
submit_bio
// issue io for removed rdev

Fix this problem by grabbing 'acive_io' before iterating rdev, make sure that remove_and_add_spares() won't concurrent with submit_flushes().

Fixes a2826aa92e2e ("md: support barrier requests on all personalities.")
---
 drivers/md/md.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/md/md.c +16 -6
index 9bdd57324c37..f246bb0932b0 100644
@@ -543,6 +543,9 @@ static void md_end_flush(struct bio *bio)
 	rdev_dec_pending(rdev, mddev);
 
 	if (atomic_dec_and_test(&mddev->flush_pending)) {
+		/* The pair is percpu_ref_get() from md_flush_request() */
+		percpu_ref_put(&mddev->active_io);
+
 		/* The pre-request flush has finished */
 		queue_work(md_wq, &mddev->flush_work);
 	}
@@ -562,12 +565,8 @@ static void submit_flushes(struct work_struct *ws)
 	rdev_for_each_rcu(rdev, mddev)
 		if (rdev->raid_disk >= 0 &&
 		    !test_bit(Faulty, &rdev->flags)) {
-			/* Take two references, one is dropped
-			 * when request finishes, one after
-			 * we reclaim rcu_read_lock
-			 */
 			struct bio *bi;
-			atomic_inc(&rdev->nr_pending);
+
 			atomic_inc(&rdev->nr_pending);
 			rcu_read_unlock();
 			bi = bio_alloc_bioset(rdev->bdev, 0,
@@ -578,7 +577,6 @@ static void submit_flushes(struct work_struct *ws)
 			atomic_inc(&mddev->flush_pending);
 			submit_bio(bi);
 			rcu_read_lock();
-			rdev_dec_pending(rdev, mddev);
 		}
 	rcu_read_unlock();
 	if (atomic_dec_and_test(&mddev->flush_pending))
@@ -631,6 +629,18 @@ bool md_flush_request(struct mddev *mddev, struct bio *bio)
 	/* new request after previous flush is completed */
 	if (ktime_after(req_start, mddev->prev_flush_start)) {
 		WARN_ON(mddev->flush_bio);
+		/*
+		 * Grab a reference to make sure mddev_suspend() will wait for
+		 * this flush to be done.
+		 *
+		 * md_flush_reqeust() is called under md_handle_request() and
+		 * 'active_io' is already grabbed, hence percpu_ref_is_zero()
+		 * won't pass, percpu_ref_tryget_live() can't be used because
+		 * percpu_ref_kill() can be called by mddev_suspend()
+		 * concurrently.
+		 */
+		WARN_ON(percpu_ref_is_zero(&mddev->active_io));
+		percpu_ref_get(&mddev->active_io);
 		mddev->flush_bio = bio;
 		bio = NULL;
 	}
Signature · 1 line
2.43.0
author maintainer
#117 lore raw

PATCH 116/641 bpf: enforce precision of R0 on callback return

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Andrii Nakryiko <[email protected]>

[ Upstream commit 0acd03a5bd188b0c501d285d938439618bd855c4 ]

Given verifier checks actual value, r0 has to be precise, so we need to propagate precision properly. r0 also has to be marked as read, otherwise subsequent state comparisons will ignore such register as unimportant and precision won't really help here.

---
 kernel/bpf/verifier.c | 7 +++++++
 1 file changed, 7 insertions(+)
kernel/bpf/verifier.c +7 -0
index af2819d5c8ee..4d59b200e898 100644
@@ -9829,6 +9829,13 @@ static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx)
 			verbose(env, "R0 not a scalar value\n");
 			return -EACCES;
 		}
+
+		/* we are going to rely on register's precise value */
+		err = mark_reg_read(env, r0, r0->parent, REG_LIVE_READ64);
+		err = err ?: mark_chain_precision(env, BPF_REG_0);
+		if (err)
+			return err;
+
 		if (!tnum_in(range, r0->var_off)) {
 			verbose_invalid_scalar(env, r0, &range, "callback return", "R0");
 			return -EINVAL;
Signature · 1 line
2.43.0
author maintainer
#118 lore raw

PATCH 117/641 ARM: dts: qcom: sdx65: correct PCIe EP phy-names

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 94da379dba88c4cdd562bad21c9ba5656e5ed5df ]

Qualcomm PCIe endpoint bindings expect phy-names to be "pciephy":

arch/arm/boot/dts/qcom/qcom-sdx65-mtp.dtb: pcie-ep@1c00000: phy-names:0: 'pciephy' was expected

---
 arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-sdx65.dtsi +1 -1
index e559adaaeee7..648899b5220f 100644
@@ -338,7 +338,7 @@ pcie_ep: pcie-ep@1c00000 {
 			power-domains = <&gcc PCIE_GDSC>;
 
 			phys = <&pcie_phy>;
-			phy-names = "pcie-phy";
+			phy-names = "pciephy";
 
 			max-link-speed = <3>;
 			num-lanes = <2>;
Signature · 1 line
2.43.0
author maintainer
#119 lore raw

PATCH 118/641 ARM: dts: qcom: sdx65: correct SPMI node name

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit a900ad783f507cb396e402827052e70c0c565ae9 ]

Node names should not have vendor prefixes:

qcom-sdx65-mtp.dtb: qcom,spmi@c440000: $nodename:0: 'qcom,spmi@c440000' does not match '^spmi@.*

---
 arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-sdx65.dtsi +1 -1
index 648899b5220f..27b7f50a1832 100644
@@ -530,7 +530,7 @@ restart@c264000 {
 			reg = <0x0c264000 0x1000>;
 		};
 
-		spmi_bus: qcom,spmi@c440000 {
+		spmi_bus: spmi@c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0xc440000 0xd00>,
 				<0xc600000 0x2000000>,
Signature · 1 line
2.43.0
author maintainer
#120 lore raw

PATCH 119/641 dt-bindings: arm: qcom: Fix html link

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Stephen Boyd <[email protected]>

[ Upstream commit 3c3fcac8d3b1b0f242845c3b3c3263bd38b3b92f ]

This link got broken by commit e790a4ce5290 ("arm: docs: Move Arm documentation to Documentation/arch/") when the doc moved from arm/ to arch/arm/. Fix the link so that it can continue to be followed.

Fixes e790a4ce5290 ("arm: docs: Move Arm documentation to Documentation/arch/")
Cc Alexandre TORGUE <[email protected]>
Cc Yanteng Si <[email protected]>
Cc Jonathan Corbet <[email protected]>
---
 Documentation/devicetree/bindings/arm/qcom.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -1
index 7f80f48a0954..8a6466d1fc4e 100644
@@ -138,7 +138,7 @@ description: |
   There are many devices in the list below that run the standard ChromeOS
   bootloader setup and use the open source depthcharge bootloader to boot the
   OS. These devices do not use the scheme described above. For details, see:
-  https://docs.kernel.org/arm/google/chromebook-boot-flow.html
+  https://docs.kernel.org/arch/arm/google/chromebook-boot-flow.html
 
 properties:
   $nodename:
Signature · 1 line
2.43.0
author maintainer
#121 lore raw

PATCH 120/641 arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Bjorn Andersson <[email protected]>

[ Upstream commit 1aaa08e8de365cce59203541cafadb5053b1ec1a ]

The hall sensor interrupt on the Primus is active low, which means that with the current configuration the device attempts to suspend when the LID is open.

Fix the polarity of the HALL_INT GPIO to avoid this.

---
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8180x-primus.dts +1 -1
index fd2fab4895b3..a40ef23a2a4f 100644
@@ -43,7 +43,7 @@ gpio-keys {
 		pinctrl-0 = <&hall_int_active_state>;
 
 		lid-switch {
-			gpios = <&tlmm 121 GPIO_ACTIVE_HIGH>;
+			gpios = <&tlmm 121 GPIO_ACTIVE_LOW>;
 			linux,input-type = <EV_SW>;
 			linux,code = <SW_LID>;
 			wakeup-source;
Signature · 1 line
2.43.0
author maintainer
#122 lore raw

PATCH 121/641 arm64: dts: qcom: sm8450: correct TX Soundwire clock

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 20e886590a310665244a354e3b693b881544edec ]

The TX Soundwire controller should take clock from TX macro codec, not VA macro codec clock, otherwise the clock stays disabled. This looks like a copy-paste issue, because the SC8280xp code uses here correctly clock from TX macro. The VA macro clock is already consumed by TX macro codec, thus it won't be disabled by this change.

---
 arch/arm64/boot/dts/qcom/sm8450.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +1 -1
index 1783fa78bdbc..dc904ccb3d6c 100644
@@ -2309,7 +2309,7 @@ swr2: soundwire-controller@33b0000 {
 				     <GIC_SPI 520 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "core", "wakeup";
 
-			clocks = <&vamacro>;
+			clocks = <&txmacro>;
 			clock-names = "iface";
 			label = "TX";
 
Signature · 1 line
2.43.0
author maintainer
#123 lore raw

PATCH 122/641 arm64: dts: qcom: sm8550: correct TX Soundwire clock

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit ead0f132fc494b46fcd94788456f9b264fd631bb ]

The TX Soundwire controller should take clock from TX macro codec, not VA macro codec clock, otherwise the clock stays disabled. This looks like a copy-paste issue, because the SC8280xp code uses here correctly clock from TX macro. The VA macro clock is already consumed by TX macro codec, thus it won't be disabled by this change.

---
 arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +1 -1
index 7b9ddde0b2c9..09353b27bcad 100644
@@ -2194,7 +2194,7 @@ swr2: soundwire-controller@6d30000 {
 			interrupts = <GIC_SPI 496 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 520 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "core", "wakeup";
-			clocks = <&lpass_vamacro>;
+			clocks = <&lpass_txmacro>;
 			clock-names = "iface";
 			label = "TX";
 
Signature · 1 line
2.43.0
author maintainer
#124 lore raw

PATCH 123/641 arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 7ac90b4cf107a3999b30844d7899e0331686b33b ]

On sc7180 when the watchdog timer fires your logs get filled with:
watchdog0: pretimeout event
watchdog0: pretimeout event
watchdog0: pretimeout event
...
watchdog0: pretimeout event

If you're using console-ramoops to debug crashes the above gets quite annoying since it blows away any other log messages that might have been there.

The issue is that the "bark" interrupt (AKA the "pretimeout" interrupt) remains high until the watchdog is pet. Since we've got things configured as "level" triggered we'll keep getting interrupted over and over.

Let's switch to edge triggered. Now we'll get one interrupt when the "bark" interrupt goes off and won't get another one until the "bark" interrupt is cleared and asserts again.

This matches how many older Qualcomm SoCs have things configured.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7180.dtsi +1 -1
index 11f353d416b4..c0365832c315 100644
@@ -3576,7 +3576,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sc7180", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
Signature · 1 line
2.43.0
author maintainer
#125 lore raw

PATCH 124/641 arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 6897fac411db7b43243f67d4fd4d3f95abf7f656 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered"), the Qualcomm watchdog timer's bark interrupt should be configured as edge triggered. Make the change.

---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +1 -1
index 66f1eb83cca7..6d01262199dc 100644
@@ -5222,7 +5222,7 @@ watchdog: watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sc7280", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 			status = "reserved"; /* Owned by Gunyah hyp */
 		};
 
Signature · 1 line
2.43.0
author maintainer
#126 lore raw

PATCH 125/641 arm64: dts: qcom: sdm845: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 263b348499454f38d36b9442c3cf9279c571bb54 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered"), the Qualcomm watchdog timer's bark interrupt should be configured as edge triggered. Make the change.

---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -1
index bf5e6eb9d313..9648505644ff 100644
@@ -5088,7 +5088,7 @@ watchdog@17980000 {
 			compatible = "qcom,apss-wdt-sdm845", "qcom,kpss-wdt";
 			reg = <0 0x17980000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		apss_shared: mailbox@17990000 {
Signature · 1 line
2.43.0
author maintainer
#127 lore raw

PATCH 126/641 arm64: dts: qcom: sm8150: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 9204e9a4099212c850e1703c374ef4538080825b ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered"), the Qualcomm watchdog timer's bark interrupt should be configured as edge triggered. Make the change.

---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -1
index 97623af13464..ad4fab61222b 100644
@@ -4170,7 +4170,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sm8150", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
Signature · 1 line
2.43.0
author maintainer
#128 lore raw

PATCH 127/641 arm64: dts: qcom: sm8250: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 735d80e2e8e5d073ae8b1fff8b1589ea284aa5af ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered"), the Qualcomm watchdog timer's bark interrupt should be configured as edge triggered. Make the change.

---
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8250.dtsi +1 -1
index be970472f6c4..72db75ca7731 100644
@@ -6018,7 +6018,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sm8250", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
Signature · 1 line
2.43.0
author maintainer
#129 lore raw

PATCH 128/641 arm64: dts: qcom: sa8775p: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 48d5cf4772ec6268853158d9ffc54612e988ebe6 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered"), the Qualcomm watchdog timer's bark interrupt should be configured as edge triggered. Make the change.

---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +1 -1
index b6a93b11cbbd..5e1d6756f245 100644
@@ -2181,7 +2181,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sa8775p", "qcom,kpss-wdt";
 			reg = <0x0 0x17c10000 0x0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		memtimer: timer@17c20000 {
Signature · 1 line
2.43.0
author maintainer
#130 lore raw

PATCH 129/641 arm64: dts: qcom: sc8280xp: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 6c4a9c7ea486da490400c84ba2768c90d228c283 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered"), the Qualcomm watchdog timer's bark interrupt should be configured as edge triggered. Make the change.

---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +1 -1
index cad59af7ccef..b8081513176a 100644
@@ -4225,7 +4225,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sc8280xp", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
Signature · 1 line
2.43.0
author maintainer
#131 lore raw

PATCH 130/641 arm64: dts: qcom: sm6350: Make watchdog bark interrupt edge triggered

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Douglas Anderson <[email protected]>

[ Upstream commit 5b84bb2b8d86595544fc8272364b0f1a34b68a4f ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered"), the Qualcomm watchdog timer's bark interrupt should be configured as edge triggered. Make the change.

---
 arch/arm64/boot/dts/qcom/sm6350.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm6350.dtsi +1 -1
index 8fd6f4d03490..6464e144c228 100644
@@ -2524,7 +2524,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sm6350", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
Signature · 1 line
2.43.0
author maintainer
#132 lore raw

PATCH 131/641 bpf: Add map and need_defer parameters to .map_fd_put_ptr()

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Hou Tao <[email protected]>

[ Upstream commit 20c20bd11a0702ce4dc9300c3da58acf551d9725 ]

map is the pointer of outer map, and need_defer needs some explanation. need_defer tells the implementation to defer the reference release of the passed element and ensure that the element is still alive before the bpf program, which may manipulate it, exits.

The following three cases will invoke map_fd_put_ptr() and different need_defer values will be passed to these callers:

1) release the reference of the old element in the map during map update or map deletion. The release must be deferred, otherwise the bpf program may incur use-after-free problem, so need_defer needs to be true.
2) release the reference of the to-be-added element in the error path of map update. The to-be-added element is not visible to any bpf program, so it is OK to pass false for need_defer parameter.
3) release the references of all elements in the map during map release. Any bpf program which has access to the map must have been exited and released, so need_defer=false will be OK.

These two parameters will be used by the following patches to fix the potential use-after-free problem for map-in-map.

Stable-dep-of: 876673364161 ("bpf: Defer the free of inner map when necessary")

---
 include/linux/bpf.h     |  6 +++++-
 kernel/bpf/arraymap.c   | 12 +++++++-----
 kernel/bpf/hashtab.c    |  6 +++---
 kernel/bpf/map_in_map.c |  2 +-
 kernel/bpf/map_in_map.h |  2 +-
 5 files changed, 17 insertions(+), 11 deletions(-)
include/linux/bpf.h +5 -1
index cff5bb08820e..741af9e5cb9d 100644
@@ -106,7 +106,11 @@ struct bpf_map_ops {
 	/* funcs called by prog_array and perf_event_array map */
 	void *(*map_fd_get_ptr)(struct bpf_map *map, struct file *map_file,
 				int fd);
-	void (*map_fd_put_ptr)(void *ptr);
+	/* If need_defer is true, the implementation should guarantee that
+	 * the to-be-put element is still alive before the bpf program, which
+	 * may manipulate it, exists.
+	 */
+	void (*map_fd_put_ptr)(struct bpf_map *map, void *ptr, bool need_defer);
 	int (*map_gen_lookup)(struct bpf_map *map, struct bpf_insn *insn_buf);
 	u32 (*map_fd_sys_lookup_elem)(void *ptr);
 	void (*map_seq_show_elem)(struct bpf_map *map, void *key,
kernel/bpf/arraymap.c +7 -5
index c85ff9162a5c..9bfad7e96913 100644
@@ -867,7 +867,7 @@ int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file,
 	}
 
 	if (old_ptr)
-		map->ops->map_fd_put_ptr(old_ptr);
+		map->ops->map_fd_put_ptr(map, old_ptr, true);
 	return 0;
 }
 
@@ -890,7 +890,7 @@ static long fd_array_map_delete_elem(struct bpf_map *map, void *key)
 	}
 
 	if (old_ptr) {
-		map->ops->map_fd_put_ptr(old_ptr);
+		map->ops->map_fd_put_ptr(map, old_ptr, true);
 		return 0;
 	} else {
 		return -ENOENT;
@@ -913,8 +913,9 @@ static void *prog_fd_array_get_ptr(struct bpf_map *map,
 	return prog;
 }
 
-static void prog_fd_array_put_ptr(void *ptr)
+static void prog_fd_array_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
+	/* bpf_prog is freed after one RCU or tasks trace grace period */
 	bpf_prog_put(ptr);
 }
 
@@ -1201,8 +1202,9 @@ static void *perf_event_fd_array_get_ptr(struct bpf_map *map,
 	return ee;
 }
 
-static void perf_event_fd_array_put_ptr(void *ptr)
+static void perf_event_fd_array_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
+	/* bpf_perf_event is freed after one RCU grace period */
 	bpf_event_entry_free_rcu(ptr);
 }
 
@@ -1256,7 +1258,7 @@ static void *cgroup_fd_array_get_ptr(struct bpf_map *map,
 	return cgroup_get_from_fd(fd);
 }
 
-static void cgroup_fd_array_put_ptr(void *ptr)
+static void cgroup_fd_array_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
 	/* cgroup_put free cgrp after a rcu grace period */
 	cgroup_put(ptr);
kernel/bpf/hashtab.c +3 -3
index fd8d4b0addfc..5b9146fa825f 100644
@@ -897,7 +897,7 @@ static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l)
 
 	if (map->ops->map_fd_put_ptr) {
 		ptr = fd_htab_map_get_ptr(map, l);
-		map->ops->map_fd_put_ptr(ptr);
+		map->ops->map_fd_put_ptr(map, ptr, true);
 	}
 }
 
@@ -2484,7 +2484,7 @@ static void fd_htab_map_free(struct bpf_map *map)
 		hlist_nulls_for_each_entry_safe(l, n, head, hash_node) {
 			void *ptr = fd_htab_map_get_ptr(map, l);
 
-			map->ops->map_fd_put_ptr(ptr);
+			map->ops->map_fd_put_ptr(map, ptr, false);
 		}
 	}
 
@@ -2525,7 +2525,7 @@ int bpf_fd_htab_map_update_elem(struct bpf_map *map, struct file *map_file,
 
 	ret = htab_map_update_elem(map, key, &ptr, map_flags);
 	if (ret)
-		map->ops->map_fd_put_ptr(ptr);
+		map->ops->map_fd_put_ptr(map, ptr, false);
 
 	return ret;
 }
kernel/bpf/map_in_map.c +1 -1
index cd5eafaba97e..2dfeb5835e16 100644
@@ -127,7 +127,7 @@ void *bpf_map_fd_get_ptr(struct bpf_map *map,
 	return inner_map;
 }
 
-void bpf_map_fd_put_ptr(void *ptr)
+void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
 	/* ptr->ops->map_free() has to go through one
 	 * rcu grace period by itself.
kernel/bpf/map_in_map.h +1 -1
index bcb7534afb3c..7d61602354de 100644
@@ -13,7 +13,7 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);
 void bpf_map_meta_free(struct bpf_map *map_meta);
 void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
 			 int ufd);
-void bpf_map_fd_put_ptr(void *ptr);
+void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer);
 u32 bpf_map_fd_sys_lookup_elem(void *ptr);
 
 #endif
Signature · 1 line
2.43.0
author maintainer
#133 lore raw

PATCH 132/641 bpf: Defer the free of inner map when necessary

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Hou Tao <[email protected]>

[ Upstream commit 876673364161da50eed6b472d746ef88242b2368 ]

When updating or deleting an inner map in map array or map htab, the map may still be accessed by non-sleepable program or sleepable program. However bpf_map_fd_put_ptr() decreases the ref-counter of the inner map directly through bpf_map_put(), if the ref-counter is the last one (which is true for most cases), the inner map will be freed by ops->map_free() in a kworker. But for now, most .map_free() callbacks don't use synchronize_rcu() or its variants to wait for the elapse of a RCU grace period, so after the invocation of ops->map_free completes, the bpf program which is accessing the inner map may incur use-after-free problem.

Fix the free of inner map by invoking bpf_map_free_deferred() after both one RCU grace period and one tasks trace RCU grace period if the inner map has been removed from the outer map before. The deferment is accomplished by using call_rcu() or call_rcu_tasks_trace() when releasing the last ref-counter of bpf map. The newly-added rcu_head field in bpf_map shares the same storage space with work field to reduce the size of bpf_map.

Fixes bba1dc0b55ac ("bpf: Remove redundant synchronize_rcu.")
Fixes 638e4b825d52 ("bpf: Allows per-cpu maps and map-in-map in sleepable programs")
---
 include/linux/bpf.h     |  7 ++++++-
 kernel/bpf/map_in_map.c | 11 ++++++++---
 kernel/bpf/syscall.c    | 32 +++++++++++++++++++++++++++-----
 3 files changed, 41 insertions(+), 9 deletions(-)
include/linux/bpf.h +6 -1
index 741af9e5cb9d..7a7859a5cce4 100644
@@ -276,7 +276,11 @@ struct bpf_map {
 	 */
 	atomic64_t refcnt ____cacheline_aligned;
 	atomic64_t usercnt;
-	struct work_struct work;
+	/* rcu is used before freeing and work is only used during freeing */
+	union {
+		struct work_struct work;
+		struct rcu_head rcu;
+	};
 	struct mutex freeze_mutex;
 	atomic64_t writecnt;
 	/* 'Ownership' of program-containing map is claimed by the first program
@@ -292,6 +296,7 @@ struct bpf_map {
 	} owner;
 	bool bypass_spec_v1;
 	bool frozen; /* write-once; write-protected by freeze_mutex */
+	bool free_after_mult_rcu_gp;
 	s64 __percpu *elem_count;
 };
 
kernel/bpf/map_in_map.c +8 -3
index 2dfeb5835e16..3248ff5d8161 100644
@@ -129,10 +129,15 @@ void *bpf_map_fd_get_ptr(struct bpf_map *map,
 
 void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
-	/* ptr->ops->map_free() has to go through one
-	 * rcu grace period by itself.
+	struct bpf_map *inner_map = ptr;
+
+	/* The inner map may still be used by both non-sleepable and sleepable
+	 * bpf program, so free it after one RCU grace period and one tasks
+	 * trace RCU grace period.
 	 */
-	bpf_map_put(ptr);
+	if (need_defer)
+		WRITE_ONCE(inner_map->free_after_mult_rcu_gp, true);
+	bpf_map_put(inner_map);
 }
 
 u32 bpf_map_fd_sys_lookup_elem(void *ptr)
kernel/bpf/syscall.c +27 -5
index 0ed286b8a0f0..c6579067eeea 100644
@@ -719,6 +719,28 @@ static void bpf_map_put_uref(struct bpf_map *map)
 	}
 }
 
+static void bpf_map_free_in_work(struct bpf_map *map)
+{
+	INIT_WORK(&map->work, bpf_map_free_deferred);
+	/* Avoid spawning kworkers, since they all might contend
+	 * for the same mutex like slab_mutex.
+	 */
+	queue_work(system_unbound_wq, &map->work);
+}
+
+static void bpf_map_free_rcu_gp(struct rcu_head *rcu)
+{
+	bpf_map_free_in_work(container_of(rcu, struct bpf_map, rcu));
+}
+
+static void bpf_map_free_mult_rcu_gp(struct rcu_head *rcu)
+{
+	if (rcu_trace_implies_rcu_gp())
+		bpf_map_free_rcu_gp(rcu);
+	else
+		call_rcu(rcu, bpf_map_free_rcu_gp);
+}
+
 /* decrement map refcnt and schedule it for freeing via workqueue
  * (underlying map implementation ops->map_free() might sleep)
  */
@@ -728,11 +750,11 @@ void bpf_map_put(struct bpf_map *map)
 		/* bpf_map_free_id() must be called first */
 		bpf_map_free_id(map);
 		btf_put(map->btf);
-		INIT_WORK(&map->work, bpf_map_free_deferred);
-		/* Avoid spawning kworkers, since they all might contend
-		 * for the same mutex like slab_mutex.
-		 */
-		queue_work(system_unbound_wq, &map->work);
+
+		if (READ_ONCE(map->free_after_mult_rcu_gp))
+			call_rcu_tasks_trace(&map->rcu, bpf_map_free_mult_rcu_gp);
+		else
+			bpf_map_free_in_work(map);
 	}
 }
 EXPORT_SYMBOL_GPL(bpf_map_put);
Signature · 1 line
2.43.0
author maintainer
#134 lore raw

PATCH 133/641 selftests/net: specify the interface when do arping

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Hangbin Liu <[email protected]>

[ Upstream commit 7f770d28f2e5abfd442ad689ba1129dd66593529 ]

When do arping, the interface need to be specified. Or we will get error: Interface "lo" is not ARPable. And the test failed. ]# ./arp_ndisc_untracked_subnets.sh

    TEST: test_arp:  accept_arp=0                                       [ OK ]
    TEST: test_arp:  accept_arp=1                                       [FAIL]
    TEST: test_arp:  accept_arp=2  same_subnet=0                        [ OK ]
    TEST: test_arp:  accept_arp=2  same_subnet=1                        [FAIL]

After fix:
]# ./arp_ndisc_untracked_subnets.sh

    TEST: test_arp:  accept_arp=0                                       [ OK ]
    TEST: test_arp:  accept_arp=1                                       [ OK ]
    TEST: test_arp:  accept_arp=2  same_subnet=0                        [ OK ]
    TEST: test_arp:  accept_arp=2  same_subnet=1                        [ OK ]
Fixes 0ea7b0a454ca ("selftests: net: arp_ndisc_untracked_subnets: test for arp_accept and accept_untracked_na")
---
 tools/testing/selftests/net/arp_ndisc_untracked_subnets.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/arp_ndisc_untracked_subnets.sh +1 -1
index c899b446acb6..327427ec10f5 100755
@@ -150,7 +150,7 @@ arp_test_gratuitous() {
 	fi
 	# Supply arp_accept option to set up which sets it in sysctl
 	setup ${arp_accept}
-	ip netns exec ${HOST_NS} arping -A -U ${HOST_ADDR} -c1 2>&1 >/dev/null
+	ip netns exec ${HOST_NS} arping -A -I ${HOST_INTF} -U ${HOST_ADDR} -c1 2>&1 >/dev/null
 
 	if verify_arp $1 $2; then
 		printf "    TEST: %-60s  [ OK ]\n" "${test_msg[*]}"
Signature · 1 line
2.43.0
author maintainer
#135 lore raw

PATCH 134/641 bpf: fix check for attempt to corrupt spilled pointer

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Andrii Nakryiko <[email protected]>

[ Upstream commit ab125ed3ec1c10ccc36bc98c7a4256ad114a3dae ]

When register is spilled onto a stack as a 1/2/4-byte register, we set slot_type[BPF_REG_SIZE - 1] (plus potentially few more below it, depending on actual spill size). So to check if some stack slot has spilled register we need to consult slot_type[7], not slot_type[0].

To avoid the need to remember and double-check this in the future, just use is_spilled_reg() helper.

Fixes 27113c59b6d0 ("bpf: Check the other end of slot_type for STACK_SPILL")
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/verifier.c +1 -1
index 4d59b200e898..c4fbfe499475 100644
@@ -4676,7 +4676,7 @@ static int check_stack_write_fixed_off(struct bpf_verifier_env *env,
 	 * so it's aligned access and [off, off + size) are within stack limits
 	 */
 	if (!env->allow_ptr_leaks &&
-	    state->stack[spi].slot_type[0] == STACK_SPILL &&
+	    is_spilled_reg(&state->stack[spi]) &&
 	    size != BPF_REG_SIZE) {
 		verbose(env, "attempt to corrupt spilled pointer on stack\n");
 		return -EACCES;
Signature · 1 line
2.43.0
author maintainer
#136 lore raw

PATCH 135/641 scsi: fnic: Return error if vmalloc() failed

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Artem Chernyshev <[email protected]>

[ Upstream commit f5f27a332a14f43463aa0075efa3a0c662c0f4a8 ]

In fnic_init_module() exists redundant check for return value from fnic_debugfs_init(), because at moment it only can return zero. It make sense to process theoretical vmalloc() failure.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes 9730ddfb123d ("scsi: fnic: remove redundant assignment of variable rc")
---
 drivers/scsi/fnic/fnic_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/fnic/fnic_debugfs.c +2 -1
index c4d9ed0d7d75..2619a2d4f5f1 100644
@@ -52,9 +52,10 @@ int fnic_debugfs_init(void)
 		fc_trc_flag->fnic_trace = 2;
 		fc_trc_flag->fc_trace = 3;
 		fc_trc_flag->fc_clear = 4;
+		return 0;
 	}
 
-	return 0;
+	return -ENOMEM;
 }
 
 /*
Signature · 1 line
2.43.0
author maintainer
#137 lore raw

PATCH 136/641 arm64: dts: qcom: qrb2210-rb1: use USB host mode

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Caleb Connolly <[email protected]>

[ Upstream commit e0cee8dc6757f9f18718eec553be9fffa503e103 ]

The default for the QCM2290 platform that this board is based on is OTG mode, however the role detection logic is not hooked up for this board and the dwc3 driver is configured to not allow role switching from userspace.

Force this board to host mode as this is the preferred usecase until we get role switching hooked up.

Fixes e18771961336 ("arm64: dts: qcom: Add initial QTI RB1 device tree")
---
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/qcom/qrb2210-rb1.dts +4 -0
index 94885b9c21c8..fd38a6278f2f 100644
@@ -415,6 +415,10 @@ &usb_qmpphy {
 	status = "okay";
 };
 
+&usb_dwc3 {
+	dr_mode = "host";
+};
+
 &usb_hsphy {
 	vdd-supply = <&pm2250_l12>;
 	vdda-pll-supply = <&pm2250_l13>;
Signature · 1 line
2.43.0
author maintainer
#138 lore raw

PATCH 137/641 arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit dc6b5562acbac0285ab3b2dad23930b6434bdfc6 ]

There is no "panic-indicator" default trigger but a property with that name:

qrb5165-rb5.dtb: leds: led-user4: Unevaluated properties are not allowed ('linux,default-trigger' was unexpected)

---
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts +1 -1
index c8cd40a462a3..f9464caddacc 100644
@@ -64,8 +64,8 @@ led-user4 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pm8150_gpios 10 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "panic-indicator";
 			default-state = "off";
+			panic-indicator;
 		};
 
 		led-wlan {
Signature · 1 line
2.43.0
author maintainer
#139 lore raw

PATCH 138/641 arm64: dts: qcom: sdm845-db845c: correct LED panic indicator

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 0c90c75e663246203a2b7f6dd9e08a110f4c3c43 ]

There is no "panic-indicator" default trigger but a property with that name:

sdm845-db845c.dtb: leds: led-0: Unevaluated properties are not allowed ('linux,default-trigger' was unexpected)

---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +1 -1
index c7eba6c491be..7e7bf3fb3be6 100644
@@ -67,8 +67,8 @@ led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pm8998_gpios 13 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "panic-indicator";
 			default-state = "off";
+			panic-indicator;
 		};
 
 		led-1 {
Signature · 1 line
2.43.0
author maintainer
#140 lore raw

PATCH 139/641 arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Krzysztof Kozlowski <[email protected]>

[ Upstream commit 67e4656f4487b95a39e45884c99235f62ebfaa47 ]

Add interrupts to SM6125 DWC3 USB controller, based on downstream/vendor code of Trinket DTSI from Xiaomi Laurel device, to fix dtbs_check warnings:

sm6125-xiaomi-laurel-sprout.dtb: usb@4ef8800: 'interrupt-names' is a required property sm6125-xiaomi-laurel-sprout.dtb: usb@4ef8800: 'oneOf' conditional failed, one must be fixed:
'interrupts' is a required property
'interrupts-extended' is a required property

---
 arch/arm64/boot/dts/qcom/sm6125.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/qcom/sm6125.dtsi +4 -0
index eb07eca3a48d..1dd3a4056e26 100644
@@ -1185,6 +1185,10 @@ usb3: usb@4ef8800 {
 					  <&gcc GCC_USB30_PRIM_MASTER_CLK>;
 			assigned-clock-rates = <19200000>, <66666667>;
 
+			interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "hs_phy_irq", "ss_phy_irq";
+
 			power-domains = <&gcc USB30_PRIM_GDSC>;
 			qcom,select-utmi-as-pipe-clk;
 			status = "disabled";
Signature · 1 line
2.43.0
author maintainer
#141 lore raw

PATCH 140/641 arm64: dts: qcom: sm8350: Fix DMA0 address

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Nia Espera <[email protected]>

[ Upstream commit 01a9e9eb6cdbce175ddea3cbe1163daed6d54344 ]

DMA0 node downstream is specified at 0x900000, so fix the typo. Without this, enabling any i2c node using DMA0 causes a hang.

Fixes bc08fbf49bc8 ("arm64: dts: qcom: sm8350: Define GPI DMA engines")
Fixes 41d6bca799b3 ("arm64: dts: qcom: sm8350: correct DMA controller unit address")
---
 arch/arm64/boot/dts/qcom/sm8350.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +2 -2
index b46236235b7f..1d597af15bb3 100644
@@ -919,9 +919,9 @@ spi19: spi@894000 {
 			};
 		};
 
-		gpi_dma0: dma-controller@9800000 {
+		gpi_dma0: dma-controller@900000 {
 			compatible = "qcom,sm8350-gpi-dma", "qcom,sm6350-gpi-dma";
-			reg = <0 0x09800000 0 0x60000>;
+			reg = <0 0x00900000 0 0x60000>;
 			interrupts = <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
author maintainer
#142 lore raw

PATCH 141/641 arm64: dts: qcom: sc7280: Fix up GPU SIDs

In reply to Greg Kroah-Hartman

6.7-stable review patch. If anyone has any objections, please let me know.

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

From: Konrad Dybcio <[email protected]>

[ Upstream commit 94085049fdad7a36fe14dd55e72e712fe55d6bca ]

GPU_SMMU SID 1 is meant for Adreno LPAC (Low Priority Async Compute). On platforms that support it (in firmware), it is necessary to describe that link, or Adreno register access will hang the board.

The current settings are functionally identical, *but* due to what is likely hardcoded security policies, the secure firmware rejects them, resulting in the board hanging. To avoid that, alter the settings such that SID 0 and 1 are described separately.

Fixes 96c471970b7b ("arm64: dts: qcom: sc7280: Add gpu support")
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +2 -1
index 6d01262199dc..ea183eadf700 100644
@@ -2598,7 +2598,8 @@ gpu: gpu@3d00000 {
 				    "cx_mem",
 				    "cx_dbgc";
 			interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;
-			iommus = <&adreno_smmu 0 0x401>;
+			iommus = <&adreno_smmu 0 0x400>,
+				 <&adreno_smmu 1 0x400>;
 			operating-points-v2 = <&gpu_opp_table>;
 			qcom,gmu = <&gmu>;
 			interconnects = <&gem_noc MASTER_GFX3D 0 &mc_virt SLAVE_EBI1 0>;
Signature · 1 line
2.43.0