Skip to contentSkip to conversation

7.3.7-rc1 review

PATCH In review Greg Kroah-Hartman 5 participants 1,010 messages Nov 25 Page 1 of 9

Subsystems (3)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 7.3.7-rc1 review

This is the start of the stable review cycle for the 7.3.7 release. There are 1005 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 Fri, 27 Nov 2026 14:36:53 +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/v7.x/stable-review/patch-7.3.7-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-7.3.y
and the diffstat can be found below.

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 7.3.7-rc1

Kuniyuki Iwashima <[email protected]>
tcp: Set unhashed_state in inet_twsk_hashdance_schedule().

Luiz Capitulino (Red Hat) <[email protected]>
powerpc/watchdog: disable watchdog when watchdog_thresh=0

Thomas Lamprecht <[email protected]>
drm/amd/display: Don't warn about links without an HPD GPIO

Hyunwoo Kim <[email protected]>
tcp: fix NULL pointer dereference when restarting a Fast Open listener

Mani Tofigh <[email protected]>
nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem()

Henry Martin <[email protected]>
sctp: fix skb_over_panic when adding addresses with a pending delete of another family

Karol Wachowski <[email protected]>
accel/ivpu: Defer recovery until probe completes

Hyunjung Ko <[email protected]>
gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes

Mani Tofigh <[email protected]>
blk-mq: take quiesce_lock when removing a queue from the tag set

Theodor Arsenij Larionov Trichkine <[email protected]>
fou: reserve headroom before pushing the encap header

Karl Mehltretter <[email protected]>
iio: trigger: Return an error when the trigger has no free irq

Changyul Lee <[email protected]>
iio: trigger: free the trigger ID after device_del()

Salah Triki <[email protected]>
iio: temperature: mlx90614: Fix dual channel probe condition check

Christopher Hoover <[email protected]>
iio: temperature: hid-sensor-temperature: Use per-instance callbacks

Arnav Kapoor <[email protected]>
iio: proximity: sx9500: ignore event config writes that don't change state

Arnav Kapoor <[email protected]>
iio: proximity: sx9360: fix sampling frequency write and available range

Arnav Kapoor <[email protected]>
iio: proximity: sx9324: fix out-of-bounds read of scan period table

Myeonghun Pak <[email protected]>
iio: proximity: hx9023s: Allocate trigger before requesting IRQ

Viral Patel <[email protected]>
iio: magnetometer: tlv493d: fix magnetic field scale

Shashank Mohan Jain <[email protected]>
iio: magnetometer: mmc5633: leave cache-only mode before the cache sync

Shashank Mohan Jain <[email protected]>
iio: magnetometer: mmc35240: leave cache-only mode before the cache sync

Alexander Sarmanow <[email protected]>
iio: light: vcnl4035: Fix reversed ALS mode bit

Jan Remes <[email protected]>
iio: light: tsl2591: don't divide by zero

Jean-Baptiste Maneyrol <[email protected]>
iio: inv_sensors: prevent timestamps going back in time in transitions

Jean-Baptiste Maneyrol <[email protected]>
iio: inv_sensors: do not compute period estimation when updating odr

Jiale Yao <[email protected]>
iio: imu: kmx61: reject duplicate event disable

Arnav Kapoor <[email protected]>
iio: imu: inv_mpu6050: fix swapped accel and gyro startup times

Arnav Kapoor <[email protected]>
iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes

Jean-Baptiste Maneyrol <[email protected]>
iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change

Christopher Hoover <[email protected]>
iio: humidity: hid-sensor-humidity: Use per-instance callbacks

Vidhu Sarwal <[email protected]>
iio: humidity: am2315: fix negative temperature decoding

Srinivas Pandruvada <[email protected]>
iio: hid-sensors: fix fractional part for unit exponents -7 and -8

Maximilian Czirr <[email protected]>
iio: hid-sensor: Fix scale for magnetic north heading

Jiale Yao <[email protected]>
iio: gyro: bmg160: reject duplicate event disable

Baek Kyu, Kim <[email protected]>
iio: dac: mcp4725: Update the cached DAC value only on success

Arnav Kapoor <[email protected]>
iio: common: scmi_sensors: fix truncating 64-bit divisions

Nikhil Gautam <[email protected]>
iio: atlas-ezo: Fix humidity channel read support

Andrea Amer <[email protected]>
iio: afe: rescale: expose offset if rescaler or source has one

Billy Tsai <[email protected]>
iio: adc: aspeed: Use syscon phandle for trimming data when available

Yu-Hsiang Tseng <[email protected]>
iio: acpi: Accept comma separated values in ROTM strings

Guangshuo Li <[email protected]>
iio: accel: kxsd9: Fix potential use-after-free on removal

Alexis Bouzigues <[email protected]>
iio: accel: adxl313: add missing buffer selections in Kconfig

Billy Tsai <[email protected]>
dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs

Johan Hovold <[email protected]>
USB: serial: io_edgeport: serialise MCR accesses

Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential use-after-free on disconnect

Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential fifo corruption

Johan Hovold <[email protected]>
USB: serial: io_edgeport: move initial termios update to open()

Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential NULL-deref at open

Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix potential close() use-after-free

Johan Hovold <[email protected]>
USB: serial: io_edgeport: fix NULL-deref on early status

Johan Hovold <[email protected]>
USB: serial: upd78f0730: fix NULL-deref on hangup

Tristan Madani <[email protected]>
USB: serial: sierra: validate URB length in instat callback

Hui Peng <[email protected]>
USB: serial: garmin_gps: validate packet data length in nat_receive()

Jesse Zhang <[email protected]>
drm/amdgpu: fix the error handling of amdgpu_vm_init_entities()

Jesse Zhang <[email protected]>
drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings

Josef Bacik <[email protected]>
w1: w1_therm: leave the slaves of other families alone

Josef Bacik <[email protected]>
w1: use the bus mutex for the "rw" file

Josef Bacik <[email protected]>
w1: remove the master's files before taking its locks

Josef Bacik <[email protected]>
w1: netlink: drop the slave after the bus is unlocked

Josef Bacik <[email protected]>
w1: ds28e04: use the bus mutex to talk on the bus

Josef Bacik <[email protected]>
w1: ds2805: use the bus mutex to talk on the bus

Josef Bacik <[email protected]>
w1: ds2482: set the strong pull-up with its byte

Josef Bacik <[email protected]>
w1: don't hold list_mutex while a slave is torn down

Radhey Shyam Pandey <[email protected]>
usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove

Radhey Shyam Pandey <[email protected]>
usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths

Radhey Shyam Pandey <[email protected]>
usb: dwc3: xilinx: fix system suspend and resume PHY handling

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Wait for End Transfer completion on ep disable

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Track a timed out End Transfer

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Reset endpoint flags on controller start

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Reject requests to a disabled endpoint

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Recover from End Transfer timeout

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Clear delayed stop on End Transfer completion

Thinh Nguyen <[email protected]>
usb: dwc3: trace: Restore request name assignment

Krystian Kaniewski <[email protected]>
usb: gadget: u_serial: pin ports while TTYs are installed

Brian Ellis <[email protected]>
usb: gadget: u_serial: fix NULL deref in gs_close() after failed open

Cosmin Tanislav <[email protected]>
usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty

Sonali Pradhan <[email protected]>
usb: gadget: f_midi: fix UAF race during IN request handling

Yu Zhang <[email protected]>
usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF

Niklas Neronin <[email protected]>
usb: xhci: clear stale bandwidth data after hibernation

Xu Rao <[email protected]>
usb: xhci: disable the correct slot on alloc_dev failure

Uttkarsh Aggarwal <[email protected]>

    usb: typec: ucsi: Set ucsi->connector before enabling notifications

Ali Ahmet Memiş <[email protected]>
usb: typec: ucsi: debugfs: Fix GET commands on UCSI < 2.0

Ihor Urazov <[email protected]>
usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14

YuanZhe Liu <[email protected]>
usb: usbtest: prevent divide by zero in simple_io() with zero length

Olivier Kaloudoff <[email protected]>
usb: uas: ignore UAS for ASMT135x bridges (174c:55aa)

Chaz Bailey <[email protected]>
usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove

Joonhoe Kim <[email protected]>
usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes

Josef Bacik <[email protected]>
USB: serial: oti6858: fix the teardown order in close

Johan Hovold <[email protected]>
USB: serial: garmin_gps: fix deadlock on reset request

Rishabh Jain <[email protected]>
usb: pci-quirks: always assert xHCI OS ownership

Johan Hovold <[email protected]>
USB: cdc-acm: fix NULL-deref on hangup

Jiri Slaby (SUSE) <[email protected]>
tty: fix misapplied compat_ptr() in tty_compat_ioctl()

Josef Bacik <[email protected]>
thunderbolt: stream: Undo more if the start fails

Josef Bacik <[email protected]>
serial: samsung: put the previous baud clock

Josef Bacik <[email protected]>
serial: samsung: don't leak the tty on an RX IRQ

Josef Bacik <[email protected]>
serial: rda: free the interrupt on shutdown

Josef Bacik <[email protected]>
serial: imx: fix the tty reference of the wakeup event

Josef Bacik <[email protected]>
serial: fsl_lpuart: fix tty ref of wakeup event

Josef Bacik <[email protected]>
serial: core: respect runtime PM when sending x_char

Josef Bacik <[email protected]>
serial: 8250_mxpcie: handle hangup during break

Josef Bacik <[email protected]>
serial: 8250_lpss: don't divide by 0 above 6.25 Mbaud

Jiri Slaby (SUSE) <[email protected]>

    serial: 8250_exar: check priv->gpio properly

Josef Bacik <[email protected]>
misc: vmw_vmci: wait for callbacks in event unsubscribe

Jiale Yao <[email protected]>
misc: ibmvmc: initialize HMC state before device registration

Guangshuo Li <[email protected]>
misc: bcm-vk: fix DMA allocation memory leak

Antonio Vázquez Blanco <[email protected]>
mei: me: add ice lake point LP iTouch DID

Josef Bacik <[email protected]>
mei: lb: read the MTU once

Josef Bacik <[email protected]>
iio: sx9310: use the data of the I2C table

Josef Bacik <[email protected]>
iio: hid-sensors: fix a division by zero

Josef Bacik <[email protected]>
iio: addac: ad74413r: fix the values of set_multiple

Josef Bacik <[email protected]>
iio: adc: check the result of ad_sd_init()

Josef Bacik <[email protected]>
iio: adc: ad7923: add the AD7927 to the SPI ID table

Josef Bacik <[email protected]>
iio: accel: adxl380: don't stay in standby on -EINVAL

Josef Bacik <[email protected]>

    comedi: vmk80xx: report failed transfers of the K8061

Josef Bacik <[email protected]>
comedi: ni_tio: Fix overflow of the clock period

Josef Bacik <[email protected]>

    comedi: ni_660x: don't poll without a DMA channel

Josef Bacik <[email protected]>
comedi: fix endless recursion in comedi_event()

Josef Bacik <[email protected]>
comedi: addi_apci_1500: fix clearing of the gate enable

Chris Mason <[email protected]>
vt: serialise the producers of the flip buffer

Mikulas Patocka <[email protected]>
dm-thin: fix parsing of feature arguments

Mikulas Patocka <[email protected]>
dm-thin: fix leak if __set_snapshot_details fails

Mikulas Patocka <[email protected]>
dm-thin: fix data corruption if discard races with regular I/O

Li Youhong <[email protected]>
dm-raid: fix use-after-free in raid_dtr()

Jay Vadayath <[email protected]>
dm-raid: bound array_position before indexing failed_devices

Mikulas Patocka <[email protected]>
dm-integrity: don't attempt to commit journal on disabled device

Sinan Polat <[email protected]>
dm-integrity: don't recalculate with HMAC because of a dirty bitmap

Josef Schlehofer <[email protected]>
dm-crypt: defer async write submission to write thread

xietangxin <[email protected]>
dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers

Mikulas Patocka <[email protected]>
dm-cache: fix ending a cursor that never began

Mikulas Patocka <[email protected]>
dm-cache: fix NULL pointer dereference on open failure

Kyrylo Biryuk <[email protected]>
dm zoned: do not reclaim a random zone into another random zone

Kyrylo Biryuk <[email protected]>
dm zoned: back off when reclaim cannot make progress

Chen Cheng <[email protected]>
dm snapshot: fix discard writing into the next COW chunk

Chen Cheng <[email protected]>
dm snapshot: split discards on chunk boundaries

wuyuehong <[email protected]>
dm snapshot: fix discard_granularity unit in snapshot_io_hints

Mikulas Patocka <[email protected]>
dm persistent data: don't leak bufio buffer if find_leaf fails

Mikulas Patocka <[email protected]>
dm persistent data: don't ignore writeback errors

Mikulas Patocka <[email protected]>
dm persistent data: test return value of node_copy

Weijiang Zhou <[email protected]>
dm-verity: don't restart or panic on errors during system shutdown

Mikulas Patocka <[email protected]>
dm-sysfs: fix misbehavior if kobject_init_and_add fails

guolingxing <[email protected]>
dm-pcache: do not advance dirty_tail after backing flush failure

Yingjie Wang <[email protected]>
dm thin: avoid wrapping no_space_timeout

Yingjie Wang <[email protected]>
dm mpath: cap queue_if_no_path_timeout_secs

[email protected] <[email protected]>
dm mpath: fix buffer overflow in parse_hw_handler()

Zhao Feng <[email protected]>
dm crypt: fix use of uninitialized percpu_counter in ctr error path

Kirtikumar Anandrao Ramchandani <[email protected]>
dm cache: validate the discard block size before narrowing

Edward Adam Davis <[email protected]>
dm cache: reject kcopyd client destory if it setup failed

Kirtikumar Anandrao Ramchandani <[email protected]>
dm: Reject table setup after queue or disk teardown

Ming-Hung Tsai <[email protected]>
dm: fix use-after-free when dm_get_device() widens the open mode

Mark Bundschuh <[email protected]>
dm: fix infinite loop in dm_blk_do_report_zones()

Daejun Park <[email protected]>
dm: fail a REQ_PREFLUSH bio with data when its preflush fails

Yaohan Li <[email protected]>
dm: avoid double-dropping the zone reset submission reference

[email protected] <[email protected]>
dm log userspace: drop the device reference on error

Paulo Alcantara <[email protected]>
smb: client: don't write back through O_DIRECT handles

Paulo Alcantara <[email protected]>
smb: client: don't spend read retries on reads cut short by a reconnect

Paulo Alcantara <[email protected]>
smb: client: don't retry failed writes forever regardless of mount options

Paulo Alcantara <[email protected]>
smb: client: don't give up writeback on the first replayable error

liuyong <[email protected]>
smb: client: validate descriptor headers before query result allocation

Joseph Qi <[email protected]>
smb: client: skip NULL channel in __cifs_put_smb_ses()

Paulo Alcantara <[email protected]>
smb: client: retry writes that couldn't be issued due to a reconnect

Paulo Alcantara <[email protected]>
smb: client: retry writeback on interrupts and allocation failures

Paulo Alcantara <[email protected]>
smb: client: let umount -f abort retried reads and writes

Paulo Alcantara <[email protected]>
smb: client: issue writes from a worker if the task is dying

Joseph Qi <[email protected]>
smb: client: hold the inode across cifs_oplock_break()

Joseph Qi <[email protected]>
smb: client: hold server ref while queueing reconnect work

Paulo Alcantara <[email protected]>
smb: client: flush deferred handles of other names before a hard link open

Fredric Cover <[email protected]>
smb: client: fix out-of-bounds read in dfs_parse_target_referral()

Andrey Misiurov <[email protected]>
smb: client: fix OOB write when compounding SMB2_IOCTL with encryption

Fredric Cover <[email protected]>
smb: client: fix double conversion of DFS path in setup_dfs_ref()

Paulo Alcantara <[email protected]>
smb: client: don't block dying tasks waiting for writeback on fsync

Paulo Alcantara <[email protected]>
smb: client: don't block dying tasks waiting for writeback on close

liuyong <[email protected]>
smb: client: compare owner and group SIDs using their encoded lengths

Yifan Zhang <[email protected]>
smb: client: bound invalid NTLMSSP signature diagnostic

Giuseppe Scrivano <[email protected]>
ovl: follow lower to lowerdata redirects from any lower layer

Amir Goldstein <[email protected]>
ovl: do not check the deferred lowerdata redirect on index lookup

Amir Goldstein <[email protected]>
ovl: do not allow nfs_export with data-only layers

Daejun Park <[email protected]>
ovl: bump the impure dir version when linking a file with origin

Giuseppe Scrivano <[email protected]>
ovl: return EIO if the lowerdata is missing

Amir Goldstein <[email protected]>
ovl: report the requested redirect_dir mode in conflicting options

Jérémy Jean <[email protected]>
ovl: reject different lower idmaps on the same fs

Amir Goldstein <[email protected]>
ovl: fix leak of lowerdata redirect on ovl_get_inode() failure

Amir Goldstein <[email protected]>
ovl: do not read the flags of a put upper dentry in lookup

Giuseppe Scrivano <[email protected]>
ovl: do not always clear absolute_redirect

Bartosz Golaszewski <[email protected]>
gpiolib: synchronize updates of descriptor labels

Bartosz Golaszewski <[email protected]>
gpiolib: fix stack out-of-bounds access in gpiochip_add_hog()

Yu Zhang <[email protected]>
gpio: virtuser: remove the debugfs files before freeing the line data

Bartosz Golaszewski <[email protected]>
gpio: virtuser: fix interrupt leak and UAF

Bartosz Golaszewski <[email protected]>
gpio: sodaville: fix use-after-free bug when registering the irqchip

Bartosz Golaszewski <[email protected]>
gpio: shared: fix a race in shared desc release path

Dmitry Torokhov <[email protected]>
gpio: sa1100: defer GPIO chip registration to postcore_initcall

Cunhao Lu <[email protected]>
gpio: rockchip: Fix debounce arithmetic for GPIO v2

Bartosz Golaszewski <[email protected]>
gpio: of: fix potential misconfiguration of hogged lines

Wentao Liang <[email protected]>
gpio: keep the chip reference when deferred setup fails

Guangshuo Li <[email protected]>
gpio: brcmstb: fix UAF after IRQ domain setup failure

Billy Tsai <[email protected]>
gpio: aspeed: Preserve the pending G7 interrupt status on control writes

Billy Tsai <[email protected]>
gpio: aspeed: Clear only the acked line's G4 interrupt status

Ian Bridges <[email protected]>
ksmbd: evaluate the DACL in order for explicit access requests

Zhao Li <[email protected]>
wifi: mac80211: bound pending OCB station allocations

Zhao Li <[email protected]>
wifi: mac80211: bound pending IBSS station allocations

Johannes Berg <[email protected]>
wifi: mac80211: fix use-after-free on TTLM disconnect

Zhao Li <[email protected]>
wifi: mac80211: restore dormant links when link updates fail

Zhao Li <[email protected]>
wifi: mac80211: reject invalid EHT guard intervals in airtime estimates

Zhao Li <[email protected]>
wifi: mac80211: recheck the OCB station limit before insertion

Zhao Li <[email protected]>
wifi: mac80211: recheck the IBSS station limit before insertion

Zhao Li <[email protected]>
wifi: mac80211: recheck injected headers after removing FCS

Zhao Li <[email protected]>
wifi: mac80211: drain link readers before stopping removed links

Zhao Li <[email protected]>
wifi: mac80211: fix use-after-free when MLO link setup is rolled back

Wahid Khan <[email protected]>
wifi: cfg80211: don't truncate the merged MBSSID profile length

Zhao Li <[email protected]>
wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers

Zhao Li <[email protected]>
wifi: cfg80211: release rejected nontransmitted BSS reference

Tristan Madani <[email protected]>
wifi: nxpwifi: validate scan response TLV sizes before indexed access

Zhao Li <[email protected]>
wifi: mac80211_hwsim: ignore non-generic netlink releases

Mehmet Fide <[email protected]>
wifi: ath9k_htc: do not start ANI before the first channel is set

Benoit Masson <[email protected]>
wifi: ath12k: assign device id from the WSI index

Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Reject array count on non-dereference string sources

Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Fix user-space dereference string array store type

Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Fix missing BTF kind checks in char pointer/array helpers

Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write

Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Enable newly appended probe when target event is enabled

Masami Hiramatsu (Google) <[email protected]>
tracing/probes: Check enabled and busy state before unlinking sibling probes

Masami Hiramatsu (Google) <[email protected]>
tracing/eprobe: Disallow attaching eprobes to fprobe events

Masami Hiramatsu (Google) <[email protected]>
tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()

Masami Hiramatsu (Google) <[email protected]>
tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create()

Paolo Bertinetti <[email protected]>
tracing/perf: Clear stop state in perf_trace_add()

Tao Cui <[email protected]>
LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT

Tao Cui <[email protected]>
LoongArch: KVM: Propagate real error code in kvm_pch_pic_create()

Tao Cui <[email protected]>
LoongArch: KVM: Clear device pointer in irqchip destroy callbacks

Mike Rapoport (Microsoft) <[email protected]>
LoongArch: Restore KFENCE pages through DMW on resume

Jinjie Ruan <[email protected]>
LoongArch: kexec_file: Fix elf_headers memory leak in retry loop

Jinjie Ruan <[email protected]>
LoongArch: kexec_file: Fix a modified cmdline leak

Tiezhu Yang <[email protected]>
LoongArch: BPF: Make use of beqz and bnez for trampoline branches

Tiezhu Yang <[email protected]>
LoongArch: BPF: Make arena support depend on 128-bit cmpxchg

Michail Andreas Michalopoulos <[email protected]>
ksmbd: refuse reauthentication of an expired session as another user

Ian Bridges <[email protected]>
ksmbd: keep group denials when a POSIX ACL entry decides access

Ian Bridges <[email protected]>
ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow

Weiming Shi <[email protected]>
sctp: reset stored flag for each association

Tim Budding <[email protected]>
sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED

Tim Budding <[email protected]>
sctp: fix I-FORWARD-TSN handling of fragments on other streams

Andrey Misiurov <[email protected]>
sctp: fix ASCONF address change on single-homed hosts

Kyle Zeng <[email protected]>
sctp: avoid requeueing pending control chunks

Tim Budding <[email protected]>
sctp: abort unordered partial delivery when its message is skipped

Kuba Piecuch <[email protected]>
sched_ext: Read exit_kind before flushing in scx_flush_disable_work()

Tejun Heo <[email protected]>
sched_ext: Factor out drain_offline_rq()

Tejun Heo <[email protected]>
sched_ext: Fix stale pick when the donor changes during dispatch

Seiji Nishikawa <[email protected]>
sched/core: Do not touch SMT siblings that have not joined the core yet

Andrea Parri <[email protected]>
sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler()

Andrea Parri <[email protected]>
sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE

Andrea Parri <[email protected]>
sched/deadline: Fix spurious -EPERM for migration-disabled tasks

Stefan Haberland <[email protected]>
s390/dasd: Don't trust userspace-supplied result field in format check

Stefan Haberland <[email protected]>
s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path

Stanislav Aleksandrov <[email protected]>
hwmon: (max31760) Report 0 RPM before the first fan speed measurement

Stanislav Aleksandrov <[email protected]>
hwmon: (max31760) Leave standby mode at probe

Stanislav Aleksandrov <[email protected]>
hwmon: (max31760) Fix the local temperature limit registers

Sudeep Holla <[email protected]>
hwmon: (scmi) Configure sensors before exposing channels

Xu Rao <[email protected]>
hwmon: (scmi) Enable temperature sensors using their sensor IDs

Sudeep Holla <[email protected]>
hwmon: (scmi) Check channel config allocation

Pablo Mazzini <[email protected]>
hwmon: (sy7636a) fix negative temperatures

Felix Radensky <[email protected]>
hwmon: (pmbus/mp2975) Get vout fault limits dynamically

Guenter Roeck <[email protected]>
hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown

Rupesh Majhi <[email protected]>
hwmon: (aht10) Fix update_interval overflow on 64-bit

Miguel Ojeda <[email protected]>
kbuild: rust: support stabilized flag -Cprofile-sample-use for Rust >= 1.100

Yehyeong Lee <[email protected]>
xen/pvcalls: destroy the per-socket workqueue on release

Yehyeong Lee <[email protected]>
xen/pvcalls: unwind pvcalls_new_active_socket() step by step

Qihang <[email protected]>
xen/privcmd: fix double free when an irqfd is shut down twice

Andrey Misiurov <[email protected]>
xen/gntdev: fix deadlock between map ioctl and mmap

Hengyu Liang <[email protected]>
x86/video: Preserve the default VGA fallback for legacy modes

Dave Hansen <[email protected]>
x86/mm: Ensure write visibility during LDT installation

Jason Andryuk <[email protected]>
x86/CPU/AMD: Don't print reset reason in VMs

Lad Prabhakar <[email protected]>
watchdog: rzv2h: Drop runtime PM handling from WDTDCR init

Lad Prabhakar <[email protected]>
watchdog: rzv2h: Use pm_runtime_put_sync()

Zhao Feng <[email protected]>
watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog

Stanislav Aleksandrov <[email protected]>
watchdog: gunyah_wdt: Re-enable the watchdog on resume

Vishwaroop A <[email protected]>
spi: tegra210-quad: Unmap DMA buffers on transfer timeout

Vishwaroop A <[email protected]>
spi: tegra210-quad: Track DMA mapping state

Kees Cook <[email protected]>
spi: axi-spi-engine: Start the program length at zero

Hyunjung Ko <[email protected]>
tpm: flush timeout work outside buffer_mutex to avoid deadlock

Guanglei Zhu <[email protected]>
tpm: eventlog: check the payload size before reading tag events

Eric Biggers <[email protected]>
tpm: Check return value of crypto_kpp_set_secret()

Takashi Iwai <[email protected]>
tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path

Avi Weiss <[email protected]>
timekeeping: Refresh auxiliary base before offset validation

Avi Weiss <[email protected]>
timekeeping: Reject cross timestamps for invalid AUX clocks

Hungyu Lin <[email protected]>
timekeeping: Read getboottime64() offsets under the sequence counter

Avi Weiss <[email protected]>
SUNRPC: Fix TCP-with-TLS transport class identification

Bartosz Golaszewski <[email protected]>
software node: only let the owner release a managed node

Rafael J. Wysocki <[email protected]>
cpufreq: Fix updates of cached resolved frequency and index

Rafael J. Wysocki <[email protected]>
cpufreq: Cache post-resolution target frequency in __resolve_freq()

Rafael J. Wysocki <[email protected]>
cpufreq: Force passing target frequency to driver during resume

Li Zhaoxin <[email protected]>
cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT

Rafael J. Wysocki <[email protected]>
cpufreq: intel_pstate: Clear last written P-state value on suspend

Rafael J. Wysocki <[email protected]>
cpufreq: Improve suspend-resume synchronization

Li RongQing <[email protected]>
cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()

Uladzislau Zhauniarovich <[email protected]>
arm64: suspend: Only track cpuidle context for idle tasks

Mark Brown <[email protected]>
arm64: suspend: Save GCS state over suspend

Mark Brown <[email protected]>
arm64: suspend: Save POR_EL0 over suspend

Zhao Gongyi <[email protected]>
arm64: ptrace: don't warn on missing siginfo in a group-stop

Jinjie Ruan <[email protected]>
arm64: kexec_file: Do not use CMA for images with a non-zero text_offset

Chris Down <[email protected]>
arm64: hugetlb: Prevent write fault livelocks on stale TLB entries

Beata Michalska <[email protected]>
arm64: errata: Add Cortex-A715/A720 AMU core counter workaround

Beata Michalska <[email protected]>
arm64: errata: Extend the workaround for broken AMEVCNTR01 counter

Mark Brown <[email protected]>
arm64/gcs: Ignore attempts to change GCS mode during signal return

Christian Brauner <[email protected]>
fs: don't strand I_METADATA_WRITEBACK inodes outside the LRU

Cheng Yongkang <[email protected]>
fs/splice: clamp an over-reported write_iter result

Cheng Yongkang <[email protected]>
fs/proc: fix the write length returned by proc_sys_call_handler()

HyeongJun An <[email protected]>
fs/adfs: bound directory entry name length in adfs_fplus_getnext()

Christian Brauner <[email protected]>
ext4: don't read the inode block in ext4_sync_inode_metadata()

Christian Brauner <[email protected]>
ext4: use sb_find_get_block_nonatomic() in ext4_get_inode_loc_noio()

Christian Brauner <[email protected]>
ext2: don't read the inode block in ext2_sync_inode_metadata()

Christian Brauner <[email protected]>
ext2: add ext2_inode_block() helper

Josef Bacik <[email protected]>
dcache: let umount find a disconnected ex-mountpoint

Josef Bacik <[email protected]>
dcache: wait for a racing eviction of a secondary root

Christian Brauner <[email protected]>
dcache: let d_invalidate() wait for a d_set_mounted() in flight

Jérémy Jean <[email protected]>
crypto: essiv - fix use-after-free in AEAD path

Jérémy Jean <[email protected]>
crypto: caam - reject overlong RSA CRT parameters

Mani Tofigh <[email protected]>
cgroup: arm the notify timer only while the file exists

Tejun Heo <[email protected]>
cgroup/freezer: Fix exiting tasks left frozen forever after rmdir

Mani Tofigh <[email protected]>
cgroup/freezer: walk exiting tasks in the v1 freezer

Ridong Chen <[email protected]>
cgroup/cpuset: Don't revive invalid partition without active CPU on hotplug

Waiman Long <[email protected]>
cgroup/cpuset: Correctly set isolated_cpus when switching partition state

Zhao Li <[email protected]>
Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel

YuanZhe Liu <[email protected]>
Bluetooth: hci_qca: fix use-after-free in ibs debugfs files

YuanZhe Liu <[email protected]>
Bluetooth: btusb: fix use-after-free in force_poll_sync

Baoli Zhang <[email protected]>
ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup

Michael McAllister <[email protected]>
ASoC: qcom: q6asm: Reset PCM positions when preparing a stream

Bartosz Golaszewski <[email protected]>
power: sequencing: pcie-m2: fix serdev controller reference leak

Bartosz Golaszewski <[email protected]>
power: sequencing: pcie-m2: fix use-after-free in pwrseq_pcie_m2_vregs_enable()

Dennis Chen <[email protected]>
Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask"

Rafael J. Wysocki <[email protected]>
PM: runtime: Update last_busy in rpm_resume() for active devices

Paolo Bertinetti <[email protected]>
perf/hw_breakpoint: Clear stop state in hw_breakpoint_add()

Phat Dinh <[email protected]>

    perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit

Joas Antonio dos Santos <[email protected]>
openvswitch: advance by the real header length in get_ipv6_ext_hdrs()

Wahid Khan <[email protected]>
ntfs: open the index allocation before reading or writing an index block

Wahid Khan <[email protected]>
ntfs: do not read an index block outside $INDEX_ALLOCATION

Wahid Khan <[email protected]>
ntfs: check the file name against the key length of an index entry

Tim Menninger <[email protected]>
NFSv4: Prevent indefinite waits for out-of-order OPEN stateids

Christian Brauner <[email protected]>
minix: don't read the inode block in minix_sync_inode_metadata()

Christian Brauner <[email protected]>
minix: add minix_inode_block() helper

Eric Dumazet <[email protected]>
net: wait for in-flight device unregistrations before netns dismantle

Jamal Hadi Salim <[email protected]>
net/sched: act_ife: require a full Ethernet header on egress

Jamal Hadi Salim <[email protected]>
net/sched: act_ife: encode configured zero metadata values

Jamal Hadi Salim <[email protected]>
net/sched: sch_teql: reject qdiscs from another network namespace

Paulo Alcantara <[email protected]>
netfs: don't hang a read whose retry is abandoned

Paulo Alcantara <[email protected]>
netfs: keep the prepare_read errno when abandoning read retries

Iván Ezequiel Rodriguez <[email protected]>
netfs: preserve prepare_write errno on reissue

Michail Andreas Michalopoulos <[email protected]>
netfilter: flowtable: extend ct timeout of offloaded GRE flows

Cen Zhang (Microsoft) <[email protected]>
netfilter: xt_recent: do not call remove_proc_entry() under recent_lock

Zihan Xi <[email protected]>
netfilter: nf_dup: preserve guard across NFQUEUE reinjection

Eric Dumazet <[email protected]>
net: gro: invalidate frag0 after a pull

Eric Dumazet <[email protected]>
net: gro: do not undo remote checksum offload on merged packets

Kyle Zeng <[email protected]>
net: gro: avoid parsing headers from shared fragments

Andrea Parri <[email protected]>
hv_sock: Report no unread data before a channel is available

Erni Sri Satya Vennela <[email protected]>
hv_netvsc: Stop PPI parsing on invalid metadata

Joas Antonio dos Santos <[email protected]>
gtp: free the skb after handling an echo response

Chengfeng Ye <[email protected]>
ipvs: fix protocol data lifetime during namespace teardown

Chengfeng Ye <[email protected]>
ipvs: Defer application parent freeing until after RCU readers

Yingjie Wang <[email protected]>
ipv6: reject routes without an inet6_dev

Xia Yan <[email protected]>
ipv6: fix cached route reuse for control messages

Daniël Trujillo <[email protected]>
ipv4: fib_trie: prevent speculative out-of-bounds child access

Kyle Zeng <[email protected]>
ipv4: keep XFRM headers out of corked skb lengths

Kyle Zeng <[email protected]>
mptcp: reject DATA_ACKs against a reversed send interval

Zixuan Chai <[email protected]>
seg6: validate state in netfilter continuations

Hyunwoo Kim <[email protected]>
tcp: fix request_sock use-after-free during Fast Open accept()

Jérémy Jean <[email protected]>
tcp: fix authentication bypass via unsupported TCP auth options

Hyunwoo Kim <[email protected]>
tcp: do not coalesce segments after FIN

Yingjie Wang <[email protected]>
tcp: free saved_syn after an RCU grace period

Eduardo Mucelli Rezende Oliveira <[email protected]>
tools/bootconfig: Close only opened braces in compact output

Rishikesh Jethwani <[email protected]>
tls: only install push_pending_record for a TX context

Hungyu Lin <[email protected]>
tsacct: Keep task begin times stable across suspend

Jerome Mohm <[email protected]>

    vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore

Ian Rogers <[email protected]>
vdso: Add VDSO_UNALIGNED_PACKED config option

Christian Brauner <[email protected]>
udf: don't allocate the inode block in udf_sync_inode_metadata()

Rongzheng Wang <[email protected]>
xsk: defer software checksum until the skb is complete

Tim Menninger <[email protected]>
xprtrdma: serialize unmap_sync with xprt_disconnect

YuanZhe Liu <[email protected]>
net: usb: lan78xx: let unregister_netdev() stop phylink

James Clark <[email protected]>
net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl

Zhao Gongyi <[email protected]>
net: netns: fix INT_MAX nsid cleanup

Hamza Mahfooz <[email protected]>
net: mana: report RX checksum offload for IPv6

Jens Axboe <[email protected]>
net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls

Tapio Reijonen <[email protected]>
net: dsa: microchip: initialize the IRQ access mutex

Jun Yang <[email protected]>
net: bridge: use one headroom snapshot for ND replies

Mahanta Jambigi <[email protected]>
net/smc: fix link group ownership in handshake abort

Mahanta Jambigi <[email protected]>
net/smc: fix lgr/lnk lifetime vs diag reader race

Kyle Zeng <[email protected]>
net/rds: Do not unpin a page after a failed atomic pin

Jiabin Deng <[email protected]>
net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported

Breno Leitao <[email protected]>
net/mlx5e: Fix queue stats access to queues without stats

Davidlohr Bueso <[email protected]>
mctp: accept MSG_CMSG_COMPAT in recvmsg

Kyle Zeng <[email protected]>
macsec: reject frames that decapsulate into runt Ethernet frames

Christian Aurich Zanettini Martins <[email protected]>
liveupdate: check for duplicate session before growing block set

Jean-Paul Sergent <[email protected]>
net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp

Florian Bezdeka <[email protected]>
entry: Fix return type of syscall_trace_enter()

Florian Bezdeka <[email protected]>
entry: Complete syscall_enter_from_user_mode_work() to bool migration

Hungyu Lin <[email protected]>
coda: honor the append state of each write

Cheng Yongkang <[email protected]>
btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT

Mani Tofigh <[email protected]>
btrfs: fix bio counter and bioc leak when async checksumming fails

Eduardo Mucelli Rezende Oliveira <[email protected]>
bootconfig: Trim unquoted values at end of file

Breno Leitao <[email protected]>
ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr()

Vlastimil Babka (SUSE) <[email protected]>
mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()

Josef Bacik <[email protected]>

    mm/page_alloc: clear ->private of deferred free pages

Gregory Price (Meta) <[email protected]>
mm/page_alloc: snapshot the preferred zone against shrink rebuilds

Gregory Price (Meta) <[email protected]>
mm/page_alloc: detect zonelist rebuilds from memory hot-add

Josef Bacik <[email protected]>
mm/page_alloc: keep the pagesets of an empty zone

Gregory Price (Meta) <[email protected]>
mm/page_alloc: reset can_retry_reserves when the slowpath restarts

Gregory Price (Meta) <[email protected]>
mm/page_alloc: don't undo another isolation in alloc_contig_range

Josef Bacik <[email protected]>
mm: page_isolation: do not take slab pages for free

Josef Bacik <[email protected]>
mm/memory_hotplug: resize zones under their seqlock

Gregory Price (Meta) <[email protected]>
mm/mmzone: read each zoneref slot once when filtering by nodemask

Gregory Price (Meta) <[email protected]>
mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()

Josef Bacik <[email protected]>
mm: page_frag: refill the cache for large fragments

Gregory Price (Meta) <[email protected]>
mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt

Josef Bacik <[email protected]>
mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone

Gregory Price (Meta) <[email protected]>
mm/mmzone: read the zoneref slot once in zonelist_zone()

Christian Brauner <[email protected]>
libfs: make i_rwsem the lock of the offset tree

Avi Weiss <[email protected]>
splice, net: avoid MSG_MORE when the bvec array fills

Christian Brauner <[email protected]>
fs: fix the SEEK_CUR f_lock condition

Christian Brauner <[email protected]>
aio: don't let exit_aio() return before complete() is done

Mani Tofigh <[email protected]>
eventpoll: wake the next waiter when a woken waiter is killed

Chen Linxuan <[email protected]>
pidfd: restrict task access ioctls to the caller's pid namespace

Chris Mason <[email protected]>
backing-file: pass RWF_NOAPPEND to synchronous writes

Shashank Mohan Jain <[email protected]>
errseq: don't let errseq_check_and_advance() hide later errors

Joshua Mulloy <[email protected]>

    memstick: core: don't clear dev->driver in memstick_device_remove()

Igor Velkov <[email protected]>
mmc: meson-gx: name the limit of the CMD_CFG timeout field

Igor Velkov <[email protected]>
mmc: meson-gx: report the longest busy wait the controller can do

Igor Velkov <[email protected]>
mmc: meson-gx: honour the busy timeout for R1b commands

Igor Velkov <[email protected]>
mmc: meson-gx: report busy from DAT0 alone

Ian Ray <[email protected]>
mmc: sdhci-esdhc-imx: map unsupported driver type to Type B

Runyu Xiao <[email protected]>
mmc: omap: synchronize clock timer before disabling fclk

Anfernee Cao <[email protected]>
mmc: mmci: fix DMA channel leak when mmc_add_host() fails

Anfernee Cao <[email protected]>
mmc: sunxi: fix clock and runtime PM leaks on probe failure

Karl Mehltretter <[email protected]>
mmc: sdhci-brcmstb: don't log an error for missing BOOT registers

Olivier Louvignes <[email protected]>
mmc: jz4740: Remove the host before resetting the controller

Masami Hiramatsu (Google) <[email protected]>
kprobes: Validate re-registration earlier in register_kretprobe()

Masami Hiramatsu (Google) <[email protected]>
kprobes: Fix double free and NULL deref in unregister_kretprobes()

Masami Hiramatsu (Google) <[email protected]>
kprobes: Fix error return and slot leak in __register_kprobe()

Steven Rostedt <[email protected]>
tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc

Jaewon Jung <[email protected]>
selftests/ftrace: Add missing spaces after ! in probe syntax tests

Andrew Davison <[email protected]>
ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set

Gichoon Han <[email protected]>
ALSA: usb-audio: Drop capture packets with bogus actual_length

Angel J <[email protected]>
ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone

Takashi Iwai <[email protected]>

    Revert "ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2"

Sergei Nizovtsev <[email protected]>
ALSA: caiaq: Kill EP1 URB before unregistering the input device

Zhiqi Zhang <[email protected]>
bootconfig: Allow keys with the maximum supported depth

Yuansheng Yang <[email protected]>
KEYS: Protect pkey method checks against type removal

Jarkko Sakkinen <[email protected]>
KEYS: Verify the key identity in __key_unlink_begin

Jarkko Sakkinen <[email protected]>
KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE

Jarkko Sakkinen <[email protected]>

    KEYS: Expand key->{datalen,quotalen} to unsigned int

David Carlier <[email protected]>
tracing/eprobe: Install the trigger for every instance that enables the eprobe

Ridong Chen <[email protected]>
cpuset: generalize the validate_partition() interface

Jan Beulich <[email protected]>
Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()

Jude Gyimah <[email protected]>
ALSA: aw2-alsa: select SND_PCM

Guixiong Wei <[email protected]>
KEYS: do not let an unmatched key decide the search result

Manuel Ebner <[email protected]>
docs, kprobes: Fix bracket

Wenwen Fu <[email protected]>
tracing: skip boot kprobe setup when no events were requested

Eric Dumazet <[email protected]>
nsh: limit recursion in nsh_gso_segment()

Chuck Lever <[email protected]>
selftests: tls: Skip the zero_len tests when TLS is unavailable

Chuck Lever <[email protected]>
tls: Consume empty data records in tls_sw_splice_read()

Jakub Kicinski <[email protected]>
tls: Break the connection after a burst of empty data records

Iustin Stolniceanu <[email protected]>
net: phy: c45: select BASE-T1 type for the forced speed

Alexei Lazar <[email protected]>
net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure

Alexei Lazar <[email protected]>
net/mlx5e: Rename state_destroy to rx_mode_active in flow steering

Cosmin Ratiu <[email protected]>
net/mlx5e: IPsec, don't match upper proto selectors in crypto offload TX

Jiahao Xu <[email protected]>
net: usb: cdc_ncm: don't underflow the NDP room check

Wenbo Sun <[email protected]>
amt: use ipv6_hdr() in amt_mldv1_leave_handler()

Wenbo Sun <[email protected]>
af_unix: Inherit SO_INQ in unix_stream_connect()

Kuniyuki Iwashima <[email protected]>

    tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().

Eric Dumazet <[email protected]>
net: virtio: fix UDP tunnel GSO header of VLAN tagged packets

Uri Dar <[email protected]>
net/mlx5: Lag, Return error when enabling MPESW without LAG support

Antonio Quartulli <[email protected]>
udp_tunnel: don't treat IPv4 sockets bound to an address as wildcard

Xuanqiang Luo <[email protected]>
net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload

Ivan Vecera <[email protected]>
ice: dpll: set the SyncE divider only for the port driving the output

Ivan Vecera <[email protected]>
ice: dpll: serialize changes of the SyncE CGU registers

Tao Cui <[email protected]>
sched_ext: Reject DSQ iterator kfuncs in tracing programs

Wei Wang <[email protected]>
net: Make PSP skb extension survive packet scrubbing

Junyoung Jang <[email protected]>
igmp: use the joined device when leaving a multicast group

Fa-Iz Faadhillah Ibrahim <[email protected]>
ALSA: hda/realtek: Update quirk for Acer Predator PHN16-72

Kailang Yang <[email protected]>
ALSA: hda/realtek - remove headphone MIC support for Dell Pro QC1255

Gustavo Sousa <[email protected]>

    drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule

Satyanarayana K V P <[email protected]>
drm/xe/pf: Program LMTT directory pointer from each GT's init path

Varun Gupta <[email protected]>
drm/xe/guc: Demote uncorrectable local error log on CRI

Daniel Charles <[email protected]>
drm/xe/pm: Apply tile workarounds after PCODE initialization

Alexandre Cassen <[email protected]>
net/mlx5: HWS, fix flow meter release on FTE update

Ofri Zangi <[email protected]>
tls: fix async encryption race on weakly ordered architectures

Kalpesh Solanki <[email protected]>
tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK

Avi Weiss <[email protected]>
net: ena: avoid RX copybreak for multi-descriptor packets

Breno Leitao <[email protected]>
net: ena: Keep the RX buffer mapped if skb allocation fails

Omar Ramadan <[email protected]>
amt: tear down every amt device on an unregistering lower

Chris Mason <[email protected]>
tcp: Drop any segments if DEFER_CONNECT is set.

Kuniyuki Iwashima <[email protected]>
tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort().

Zhan Xusheng <[email protected]>

    erofs: reset buf->off in erofs_init_metabuf()

LiangCheng Wang <[email protected]>
ASoC: max98090: keep the MIC boost across mic input power-up

Kavitha Daula <[email protected]>
xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()

Pengpeng Hou <[email protected]>
drm/bridge: sii902x: validate I2S data lane values

Kyle Zeng <[email protected]>
udp: check frag_list IP family before using skb_segment_list()

Jouni Högander <[email protected]>
drm/i915/psr: Flush on cursor update also when not using Selective Fetch

Janne Grunau <[email protected]>
ASoC: apple: mca: Fix clock selection for clock consumer FEs

Anandu Padinhare <[email protected]>
net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path

Eric Dumazet <[email protected]>

    net: gro: compare skb->protocol in gro_list_prepare()

Eric Dumazet <[email protected]>
udp: do not use a cross-family sk_rx_dst in early demux

Eric Dumazet <[email protected]>
tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF

Kuniyuki Iwashima <[email protected]>
tcp: Do not allow buggy transitions between ehash and lhash2.

Eric Dumazet <[email protected]>
fou: gue: check IP version of held packets for direct IP encapsulation

Kuniyuki Iwashima <[email protected]>
net: Fix memory_allocated leak in __sk_mem_raise_allocated().

Cosmin Ratiu <[email protected]>
net/mlx5e: Serialize TC and IPsec offload exclusion counters

Cosmin Ratiu <[email protected]>
net/mlx5e: Block E-Switch mode changes during IPsec state creation

Cosmin Ratiu <[email protected]>
net/mlx5e: Block E-Switch mode changes during IPsec policy creation

Cosmin Ratiu <[email protected]>
net/mlx5e: Fix ipsec core device access during profile changes

Cosmin Ratiu <[email protected]>
net/mlx5e: Fix E-Switch races in uplink unbind

Cosmin Ratiu <[email protected]>

    net/mlx5e: Take HCA devcom lock before esw->mode_lock

Cosmin Ratiu <[email protected]>
net/mlx5e: Serialize ipsec encap reservations with eswitch operations

Cosmin Ratiu <[email protected]>
net/mlx5e: Release IPsec root table reference on RX setup failure

Chris Mason <[email protected]>
net: skbuff: uncharge trimmed zerocopy frags on error

Yuho Choi <[email protected]>
ptp: kvm: x86: Leak clock_pair page if changing its encryption fails

Chase Hiltz <[email protected]>
ipv4: route: don't blackhole in-use routes when retiring fnhe routes

Ivan Vecera <[email protected]>
dpll: notify about a reference sync pair only if it was added

Changyul Lee <[email protected]>
net/mlx5: macsec: Don't remove fs_id when adding a rule fails

Shay Drory <[email protected]>
net/mlx5: E-switch, Restore host PF enable for ECPF that isn't E-switch manager

Tim Menninger <[email protected]>
NFSv4/flexfiles: limit transport disconnects when cancelling I/O

Tim Menninger <[email protected]>
SUNRPC: add request-scoped disconnects when cancelling tasks

Benjamin Coddington <[email protected]>
NFSv4/flexfiles: Make the pinned device node pointer RCU-managed

Benjamin Coddington <[email protected]>
NFSv4/flexfiles: Hold a device node reference for layoutstats encoding

Benjamin Coddington <[email protected]>
NFSv4/flexfiles: Reference the device node across DS setup

Alexander Duyck <[email protected]>
net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist

Alexander Duyck <[email protected]>
fbnic: Wait for the outbound flush to complete on mailbox teardown

Alexander Duyck <[email protected]>
fbnic: Suspend phylink after taking the datapath down in ndo_stop

Alexander Duyck <[email protected]>
fbnic: Disable PTP completions during the Tx force-flush

Alexander Duyck <[email protected]>
fbnic: Fix service task races with ndo_stop and PM suspend

Umang Pokhriyal <[email protected]>
tun: delete the flow entries of the moved queue on detach

Kang Chen <[email protected]>
sched_ext: make DSQ iterator stay drained after NULL

Tejun Heo <[email protected]>
sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration

Olga Kornievskaia <[email protected]>
NFSv4: remember that the server may send CB_NOTIFY_LOCK

Olga Kornievskaia <[email protected]>
NFSv4: wake blocking lock waiters when a delegated lock is released

Jeff Layton <[email protected]>
NFS: stamp after the server's ctime following a CLONE

Jeff Layton <[email protected]>
NFS: stamp after the server's ctime when truncating under delegated times

Jeff Layton <[email protected]>
NFS: don't let delegated c/mtime stamps go backward

Waiman Long <[email protected]>

    cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork()

Zhang Qiao <[email protected]>
sched_ext: Fix partial-SMT core counting in calc_shard_layout()

Eric Dumazet <[email protected]>
bonding: fix slave_cnt leak on XDP enslave failure

Orgad Shaneh <[email protected]>
net: mana: fix XDP_REDIRECT of pre-allocated RX buffers

Denis V. Lunev <[email protected]>
ovl: release the upperdir/workdir in-use locks before the umount sync

Tianyi Gao <[email protected]>
net: fix mac_len of skbs copied by generic XDP

Mehmet Fide <[email protected]>
wifi: mac80211: abort chanswitch when leaving an IBSS

Johannes Berg <[email protected]>
wifi: mac80211: mesh: don't linearize SKBs unnecessarily

Loïc Kassel <[email protected]>
wifi: mac80211_hwsim: use CLOCK_BOOTTIME for the beacon timer

Kyle Zeng <[email protected]>
ipvlan: make outbound skb headers writable

Kyle Zeng <[email protected]>
net: require a full socket in sock_confirm_neigh()

Kyle Zeng <[email protected]>
net: protect negative destination advice with RCU

Mark Bloch <[email protected]>
net/mlx5: Lag, free steering resources on LAG destroy failure

Carolina Jubran <[email protected]>
net/mlx5: Use only loaded devices for PTP clock operations

Arnd Bergmann <[email protected]>
net: octeontx2: fix building without DEBUGFS

Li RongQing <[email protected]>
team: fix promisc/allmulti leak in team_port_add error path

Yaroslav Dudkov <[email protected]>
ipv6: ignore link state in gateway check

Gal Pressman <[email protected]>
net/mlx5: Bridge, fix bogus MDB offload errors

Kuniyuki Iwashima <[email protected]>
af_unix: Remove gc_in_progress check in unix_peek_fpl().

Kuniyuki Iwashima <[email protected]>
af_unix: Convert unsigned long to u64 for GC.

Francesco Valla <[email protected]>
spi: virtio: move teardown to .remove()

Jiayuan Chen <[email protected]>
net: raw: fix ICMP unreachable sent when receive queue is full

Stefano Munari <[email protected]>
net: usb: lan78xx: resume phylink on non-reset USB resume

Maciej Fijalkowski <[email protected]>
idpf: free stashed XSk Rx frame when releasing the queue

Maciej Fijalkowski <[email protected]>
ice: xsk: free stashed Rx frame when cleaning the ring

Chenguang Zhao <[email protected]>
i40e: xsk: fix multi-buffer XDP_PASS skb construction

Maciej Fijalkowski <[email protected]>
libeth: xsk: do not free in-flight frags on XDP_TX completion

Maciej Fijalkowski <[email protected]>
ice: xsk: do not free in-flight frags on XDP_TX completion

Maciej Fijalkowski <[email protected]>
ice: xsk: fix leaking Rx buffers in multi-buffer path

Maciej Fijalkowski <[email protected]>
i40e: xsk: fix xsk_buff_add_frag() error handling in Rx

Maciej Fijalkowski <[email protected]>
xsk: fix list corruption in xsk_buff_add_frag()

Kyle Zeng <[email protected]>
net: skbuff: preserve fclone lifetime when freeing stolen heads

Mark Korenberg <[email protected]>
ublk: publish a new device by its id only once it is set up

Mike Snitzer <[email protected]>
NFS/localio: hold the client across an asynchronous LOCALIO probe

Avi Weiss <[email protected]>
SUNRPC: Balance queue accounting when relocating a task

Avi Weiss <[email protected]>
SUNRPC: Balance switch queue length on transport removal

Avi Weiss <[email protected]>
SUNRPC: preserve transport security policy when cloning clients

Avi Weiss <[email protected]>
SUNRPC: preserve timeout policy when cloning clients

Avi Weiss <[email protected]>
SUNRPC: preserve fatal network errors during RPC binding

Avi Weiss <[email protected]>
sunrpc: instantiate rpc_pipefs dentry before publishing it

Avi Weiss <[email protected]>
SUNRPC: wake poll waiters when an empty pipe is unlinked

Avi Weiss <[email protected]>
NFS: restore directory index when resuming readdir

Avi Weiss <[email protected]>
NFS: Fix inverted cross-directory rename check

Avi Weiss <[email protected]>
NFS: update ctime for atime-only UTIME_NOW requests

Avi Weiss <[email protected]>
NFS: honor UTIME_NOW atime with explicit mtime

Avi Weiss <[email protected]>
NFSv4.1: retain MDS I/O until both thresholds are met

Zachary Huang <[email protected]>
ASoC: es9356: fix the capture gain dB scale

Eric Dumazet <[email protected]>
tcp: rate limit receive queue collapsing

Cheng Yongkang <[email protected]>
btrfs: handle zero num_stripes in btrfs_chunk_item_size()

Filipe Manana <[email protected]>
btrfs: zstd: prevent leak of workspace below maximum level

Johannes Thumshirn <[email protected]>
btrfs: zoned: fix lockdep splat on mount

Johannes Thumshirn <[email protected]>
btrfs: zoned: don't wait for ordered extents in do_zone_finish()

Johannes Thumshirn <[email protected]>
btrfs: zoned: requeue block group if zone reset bails out

Johannes Thumshirn <[email protected]>
btrfs: zoned: fix possible UAF in wait_eb_writebacks()

Johannes Thumshirn <[email protected]>
btrfs: zoned: only change active zone counter on successful (de)activation

Samuel Leyva <[email protected]>
ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output

Ridong Chen <[email protected]>
cgroup/cpuset: Reset partition data when an invalid partition stays invalid

Vijendar Mukunda <[email protected]>

    ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler

Vijendar Mukunda <[email protected]>

    ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler

Boris Brezillon <[email protected]>
drm/panfrost: Enable cycle counting when perfcnt is enabled

Tyler Baker <[email protected]>
ASoC: qcom: x1e80100: recreate the headset jack on card rebind

Hongyang Zhao <[email protected]>
ASoC: qcom: common: Add generic headset jack helpers

Tyler Baker <[email protected]>
ASoC: soc-core: copy the DAI link names into the card

Dmitry Torokhov <[email protected]>
gpiolib: of: return -ENOENT from of_gpio_count() stub

Dmitry Torokhov <[email protected]>
gpiolib: fix fast-path cancellation in gpiod_get_array()

Dmitry Torokhov <[email protected]>
gpiolib: fix GPIO descriptor leak in gpiod_get_array()

Jagmeet Randhawa <[email protected]>
drm/xe/guc: Do not attribute a TDR disable to a pending suspend

Jagmeet Randhawa <[email protected]>

    drm/xe/guc: Fix race around q->guc->suspend_pending access

Arvind Yadav <[email protected]>
drm/xe/svm: Preserve default PAT index when resetting VMA attributes

Badal Nilawar <[email protected]>
drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry

Vinay Belgaumkar <[email protected]>
drm/xe: Access GT MMIO after pcode init

Vinay Belgaumkar <[email protected]>
drm/xe: Toggle the D3Cold enable flag at runtime resume

Arvind Yadav <[email protected]>
drm/xe: Rebind BOs evicted before the first LR queue

Raag Jadav <[email protected]>
drm/xe/pci_error: Flush GT wedge worker before bus reset

Raag Jadav <[email protected]>
drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early()

Raag Jadav <[email protected]>
drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM

Raag Jadav <[email protected]>
drm/xe/gt: Use GT ordered workqueue for wedging

Rodrigo Vivi <[email protected]>
drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m

Helen Koike <[email protected]>
drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2

Daniele Ceraolo Spurio <[email protected]>
drm/xe/gsc: Fix NVL-S GSC compatibility number

Nitin Gote <[email protected]>
drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines

Karthik Poosa <[email protected]>
drm/xe/hwmon: Handle unavailable memory controller sensors

Karthik Poosa <[email protected]>
drm/xe/hwmon: Add helpers to validate thermal sensor readings

Karthik Poosa <[email protected]>
drm/xe/hwmon: Fix thermal sensor data handling

Karthik Poosa <[email protected]>
drm/xe/hwmon: Decode mailbox temperature as sign-magnitude

Karthik Poosa <[email protected]>
drm/xe/hwmon: Fix pcode power limit handling

Karthik Poosa <[email protected]>
drm/xe/hwmon: Use shared pcode default timeout for power limit write

Karthik Poosa <[email protected]>
drm/xe/pcode: Increase default pcode mailbox timeout to 10ms

Michał Grzelak <[email protected]>
drm/xe/pcode: match argument naming with PCODE_DATAx

Satyanarayana K V P <[email protected]>
drm/xe/gt: Disable GT reset worker before engine teardown

Satyanarayana K V P <[email protected]>
drm/xe/guc: Protect timeout handling from device unplug

Satyanarayana K V P <[email protected]>
drm/xe: Prevent VF memory IRQ from accessing a torn-down engine

Dnyaneshwar Bhadane <[email protected]>
drm/xe/pat: Return error from xe_pat_init_early() on unknown platform

Alan Previn <[email protected]>
drm/xe/gsc: Define GSC for NVL-S

Badal Nilawar <[email protected]>
drm/xe/cri: Expose device UID through sysfs

Greg Thelen <[email protected]>
kho: check fdt_phys in is_kho_boot()

Yifan Zhang <[email protected]>
tracing/probes: bound symstr stores to reserved length

Shao Mingyin <[email protected]>
ata: libata-scsi: set the field pointer when rejecting CDL

Niklas Cassel <[email protected]>
ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers

Niklas Cassel <[email protected]>
ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length

Niklas Cassel <[email protected]>
ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages

Niklas Cassel <[email protected]>
ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit

Niklas Cassel <[email protected]>
ata: libata-scsi: do not accept subpage code FFh in MODE SELECT

Niklas Cassel <[email protected]>
ata: libata-scsi: fix MODE SELECT handling of data after the mode page

Alexei Starovoitov <[email protected]>
ipv6: Check the Home Address option again before its address is used

Eric Dumazet <[email protected]>
calipso: do not charge request socket options to the listener

Or Har-Toov <[email protected]>
net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum

Jesper L. Nielsen <[email protected]>
net: ethernet: ti: am65-cpts: keep port and direction when matching PTPv1 TX timestamps

Anil Kaushik <[email protected]>
netlink: Do not call the unbind callback with the table locked

Prathamesh Deshpande <[email protected]>
net/mlx5e: IPoIB, Fix QPN lookup race

Kyle Pepper <[email protected]>
Bluetooth: reject invalid LE supervision timeout relationships

Rahad Bhuiya <[email protected]>
sched_ext: Reset task fields on exit of an SCX_TASK_READY task

Christian Loehle <[email protected]>
cpufreq: Serialize global boost updates

Christian Loehle <[email protected]>
cpufreq: Preserve global boost state on failed updates

Dheeraj Kumar Srivastava <[email protected]>
iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails

Benjamin Segall <[email protected]>

    perf: Fix racy update of cpc->hrtimer_interval

Sandipan Das <[email protected]>
perf/x86/amd/uncore: Avoid context migration from non-owners

Peter Zijlstra <[email protected]>
locking/osq: Fix unlink queue corruption

Peter Zijlstra <[email protected]>
locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering

Zhuangzhuang Wang <[email protected]>
locking/lockdep: Fix inverted "on"/"last" CPU label in lockdep_print_held_locks()

Thomas Fourier <[email protected]>
net/mlx5e: TC, Fix double free of branch in failure

Ridge Lomont <[email protected]>
x86/kcfi: Don't emit KCFI_REFERENCE() in modules

Isaac Adjei <[email protected]>
gpio: mpfs: reject unsupported interrupt types

Eric Dumazet <[email protected]>
tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND

Kayra Cizmeci <[email protected]>
sched/cache: Ignore non-fair current in alb_break_llc()

Hui Su <[email protected]>
sched/topology: Balance cluster static-key updates

Hui Su <[email protected]>
sched/pelt: Fix u32 truncation of the PELT period count

Christian Loehle <[email protected]>
sched/core: Account I/O waits independently of delayed dequeue

Nickolai Zeldovich <[email protected]>
sched/deadline: Fix this_bw on class change of a dying task

Ravi Bangoria <[email protected]>
perf/amd/ibs: Simplify event state handling with IBS_CAPS_DIS

Ravi Bangoria <[email protected]>
perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR

Kan Liang <[email protected]>
perf: Add sampling support for SIMD registers

Kan Liang <[email protected]>
perf: Move and enhance has_extended_regs() for arch-specific use

Dapeng Mi <[email protected]>
perf: Eliminate duplicate arch-specific function definitions

Ravi Bangoria <[email protected]>
perf/amd/ibs: Reset CPU0 IBS state on syscore resume

Ian Rogers <[email protected]>
perf/core: Clamp deferred callchain entry count to fit u16 header.size

Ian Rogers <[email protected]>
perf/core: Include perf_event_attr::defer_output in is_sb_event() check

Siddharth Chintamaneni <[email protected]>
fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()

Jeff Layton <[email protected]>
statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask

Hungyu Lin <[email protected]>
vfs: preserve subsecond timestamps at filesystem time limits

Andrea Parri <[email protected]>
iov_iter: take an unsigned long segment count in import_iovec()

Abbott Liu <[email protected]>
initrd: flush deferred fput() before mounting root

Christian Brauner <[email protected]>
libfs: end offset readdir at positions past DIR_OFFSET_EOD

Christian Brauner <[email protected]>
libfs: walk offset directories in offset order

Florian Fainelli <[email protected]>
MIPS: SB1250: Validate and update IRQ affinity

Florian Fainelli <[email protected]>
MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window

Florian Fainelli <[email protected]>
MIPS: Alchemy: Save the Ethernet address before reusing PROM memory

Florian Fainelli <[email protected]>
MIPS: Alchemy: Register interrupt chips with the IRQ core

Imre Kaloz <[email protected]>
MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC

Rosen Penev <[email protected]>
MIPS: Avoid dead code/data elimination when using recordmcount

Imre Kaloz <[email protected]>
MIPS: SGI-IP27: print the NMI dump on an nbcon console

Eric Dumazet <[email protected]>

    tcp: ipv6: free ireq->ipv6_opt after an RCU grace period

Long Zhao <[email protected]>
gpio: regmap: free the irqchip if adding the irq domain fails

Florian Westphal <[email protected]>
netfilter: nat: zero newrange before filling it in

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload

Joas Antonio dos Santos <[email protected]>
netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport()

Fernando Fernandez Mancera <[email protected]>
netfilter: x_tables: check target name before accessing verdict

Laveesh Bansal <[email protected]>
netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()

Xingyuan Mo <[email protected]>
netfilter: nft_set_rbtree: check catchall_sync return before queue_done

Qingfang Deng <[email protected]>
tcp: initialize send sequence numbers before deferring TFO

Cheng Yongkang <[email protected]>
net: bridge: disable MRP ports before the FDB flush in del_nbp()

Lorenzo Bianconi <[email protected]>
net: stmmac: set XDP metadata length on the page_pool RX path

Timur Stukan <[email protected]>

    bonding: fix missing down path on speed/duplex failure after FAIL->UP

Kyle Zeng <[email protected]>
ip6mr: Serialize multicast router socket ownership

Timur Stukan <[email protected]>
bonding: 3ad: don't set BOND_LINK_FAIL on a slave that is not up

Colton Pawielski <[email protected]>
net: 8139cp: keep Rx masked while NAPI is scheduled

Jinseob Kim <[email protected]>
gpiolib: reset lookup flags for each hogged line

Chris Chiu <[email protected]>
ALSA: hda/realtek: Use inverted mute LED quirk for HP ZBook 8 G2a

Richard Fitzgerald <[email protected]>
ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()

Richard Fitzgerald <[email protected]>
ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load()

Michał Kopeć <[email protected]>
ALSA: hda/core: Stop capability walk on empty capability header

Takashi Sakamoto <[email protected]>
ALSA: firewire: fix inverted streaming speed between tx and rx streams

Shivam Madlani <[email protected]>
ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP OmniBook 7

Munique Feitoza <[email protected]>
drm/nouveau: Fix CE channel creation on pre-Kepler GPUs

Rosen Penev <[email protected]>
drm/nouveau/fifo: map Kepler video engine contexts non-privileged

Frederic Konrad <[email protected]>
spi: cadence-quadspi: Fix race between DMA completion and transfer start

Luiz Augusto von Dentz <[email protected]>

    Bluetooth: Fix not updating of hdev->commands[] after reset

Florian Fainelli <[email protected]>
net: dsa: b53: restore the NSP IMP port 2 Gbps mode

Florian Fainelli <[email protected]>
net: ethernet: bgmac: preserve forced 2.5 Gbps link speed

Stanislavs Nilovs <[email protected]>
Bluetooth: qca: Disable SoC debug logging for WCN3950

Zhao Li <[email protected]>
Bluetooth: L2CAP: Clear request identifiers on incoming LE connections

Zijun Hu <[email protected]>
Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path

Richard Fitzgerald <[email protected]>
ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add()

Sasha Levin <[email protected]>
ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online()

Sasha Levin <[email protected]>
ACPI: scan: Print the offline failure message in acpi_bus_offline()

Richard Fitzgerald <[email protected]>
firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path

Stanley Jhu <[email protected]>
PM: runtime: Update runtime_pm.rst for non-fatal resume errors

Brian Norris <[email protected]>

    PM: runtime: Clarify ->runtime_idle() callback return value handling

Brian Norris <[email protected]>
PM: runtime: Add "Section" hyperlinks

Brian Norris <[email protected]>
PM: runtime: Misc improvements to runtime_pm.rst

Mario Limonciello <[email protected]>
drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence

Eric Dumazet <[email protected]>

    tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()

Kuniyuki Iwashima <[email protected]>
ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow().

Kuniyuki Iwashima <[email protected]>

    ipv6: Flush rt->from in rt6_uncached_list_flush_dev().

Kuniyuki Iwashima <[email protected]>
ipv6: Batch rt6_uncached_list_flush_dev() in netdev_run_todo().

Kuniyuki Iwashima <[email protected]>
ipv4: Batch rt_flush_dev() in netdev_run_todo().

Kuniyuki Iwashima <[email protected]>
ipv6: Flush exception route while replacing nexthop.

Zhou Minqiang <[email protected]>
PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove

Avi Weiss <[email protected]>
net: skbuff: reject zero MPLS TTL before decrementing

Christian Loehle <[email protected]>
cpufreq: Hold the policy write lock when changing boost state

Guillaume Nault <[email protected]>
tcp: Fix dup-ack detection on non-SACK bidirectional data transfer.

Hungyu Lin <[email protected]>
isofs: handle Rock Ridge long-form dates before 1900

Daejun Park <[email protected]>
erofs: treat files shared by inode_share as stacked

Joseph Kain <[email protected]>
net: stop defer_count outliving the deferred-free list

James Clark <[email protected]>
net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes

Jude Gyimah <[email protected]>
ASoC: rockchip_spdif: select REGMAP_MMIO

Jude Gyimah <[email protected]>
ASoC: rockchip_sai: select REGMAP_MMIO

Jude Gyimah <[email protected]>
ASoC: rockchip_pdm: select REGMAP_MMIO

Jude Gyimah <[email protected]>
ASoC: rockchip_i2s_tdm: select REGMAP_MMIO

Jude Gyimah <[email protected]>
ASoC: rockchip_i2s: select REGMAP_MMIO

Chris Mason <[email protected]>
nvmet-rdma: disconnect a queue on device removal

Chris Mason <[email protected]>
nvmet-rdma: queue the release work under the mutex

Chris Mason <[email protected]>
nvmet-rdma: take a device off the list last

Josef Bacik <[email protected]>
nvmet-tcp: limit the connections accepted per work run

Chris Mason <[email protected]>
nvmet-rdma: disconnect only established queues

Josef Bacik <[email protected]>
nvmet-auth: keep the old keys if the new ones fail

Josef Bacik <[email protected]>
nvmet-tcp: ask for the TLS record type on every receive

Josef Bacik <[email protected]>
nvme-loop: delete the controller if a reset fails

Eric Dumazet <[email protected]>
ipmr, ip6mr: queue netlink route queries out of band

Alexander Goodkind <[email protected]>
net: ethernet: mediatek: preserve sibling PPE bindings

Florian Fainelli <[email protected]>
net: dsa: b53: Enable IGMP and MLD control packet CPU copies

ChunYuZhiQiang <[email protected]>
can: dev: can_tdc_fill_info(): don't read automatic TDCV if interface is down

Cunhao Lu <[email protected]>
can: skb: make CAN skb allocation failure paths IRQ-safe

James Fantin-Hardesty <[email protected]>
nvmet: fix arbitration burst field mask

Kyle Zeng <[email protected]>
tcp: wait for TIME_WAIT teardown before freeing per-netns ehash

Niklas Cassel <[email protected]>
null_blk: don't finish zones to set them read-only or offline

Niklas Cassel <[email protected]>
null_blk: fix opening closed zones at the active zone limit

Nguyen Dinh Phi <[email protected]>
vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT

Yunye Zhao <[email protected]>
virtio_blk: freeze the virtqueue layout at probe time

Shao Mingyin <[email protected]>
zloop: reject mismatched conventional zone files on restore

Shao Mingyin <[email protected]>
zloop: fix the error code in the blk_mq_alloc_disk message

Avi Weiss <[email protected]>
block: report the correct discard alignment in sysfs

Zizhi Wo <[email protected]>
block: partitions: reject GPT entries with starting_lba > ending_lba

Shao Mingyin <[email protected]>
virtio-blk: Fix zone append sector reporting in batched completion

Jianan Huang <[email protected]>
blk-mq: reset queue state on scheduler teardown

John Ogness <[email protected]>
printk: Avoid multiple unregistration in unregister_console_locked()

Josef Bacik <[email protected]>
ext2: only flush DIRSYNC directories on every change

Jia Jia <[email protected]>
vhost-scsi: fix page reference leak in misaligned I/O fallback

Mingbing Zhai <[email protected]>
virtio_balloon: initialize wakeup_lock before virtqueues are set up

Linfeng Sun <[email protected]>
vhost-vdpa: initialize state before publishing cdev

Linfeng Sun <[email protected]>
vhost: reject backend enable without a kick file

Linfeng Sun <[email protected]>
vhost-scsi: reject delayed virtqueue setup

sungbyeongchan <[email protected]>
virtio_ring: use shadow flags when detaching split descriptors

Linfeng Sun <[email protected]>
vhost-scsi: validate event queue descriptor direction

Shuai Zhang <[email protected]>
power: sequencing: qcom-wcn: increase WCN7850 power-up delay

Eric Dumazet <[email protected]>
xfrm: iptfs: fix skb leak on error in __input_process_payload()

Jia Jia <[email protected]>
vhost-scsi: do not count PI bytes in the data length

Eric Dumazet <[email protected]>

    soreuseport: annotate data-races around reuse->socks[] and num_socks

Yifan Zhang <[email protected]>
ksmbd: require NUL-terminated EA names

Bart Van Assche <[email protected]>
mctp i3c: Fix locking in an error path

Ville Syrjälä <[email protected]>

    drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start()

Yehyeong Lee <[email protected]>
wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response

Yehyeong Lee <[email protected]>
wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset

Yehyeong Lee <[email protected]>
wifi: nxpwifi: guard the 11ax response handlers against a detached command buffer

Danish Khateeb <[email protected]>
selftests/mm: merge: keep the far mremap() targets in the carveout

Xu Yunxiang <[email protected]>
bpf: Propagate scalar precision through stack arguments

Alexei Starovoitov <[email protected]>
bpf: Emit timed may_goto for JITed progs only

Kevin Dewald <[email protected]>
Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery

Yifan Zhang <[email protected]>
Bluetooth: validate retained LE Set CIG Parameters command length

Yifan Zhang <[email protected]>
Bluetooth: validate retained LE Create CIS command length

Cen Zhang <[email protected]>
Bluetooth: hci_core: Initialize advertising RPA work only once

Kevin Dewald <[email protected]>
Bluetooth: MGMT: Clear disabled connection parameters when loading none

Cen Zhang <[email protected]>
Bluetooth: hci_sync: Copy the resolving-list IRK under RCU

Cen Zhang <[email protected]>
Bluetooth: SMP: Protect LTK encryption with RCU

Cen Zhang <[email protected]>
Bluetooth: SMP: Protect link keys during LTK derivation

Cen Zhang <[email protected]>
Bluetooth: hci_core: Keep link-key filtering inside RCU

Ismail Tarim <[email protected]>
Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init()

Tobias Wilken <[email protected]>
Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller

Shuai Zhang <[email protected]>
Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping

Cen Zhang <[email protected]>
Bluetooth: hci_sync: Protect resolving-list lookups

Cen Zhang <[email protected]>

    Bluetooth: hci_sync: Copy the LE accept list under hdev->lock

Chris Lu <[email protected]>
Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD

Chris Lu <[email protected]>
Bluetooth: btmtk: bound the ISO payload length by the controller's MTU

Chris Lu <[email protected]>
Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Update the CIS host feature when enabling LE

Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Hold incoming data until encryption key size is known

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Convert hci_conn flags to a bitmap

Frédéric Danis <[email protected]>
Bluetooth: MGMT: Add management security level changed event

Peng Fan <[email protected]>
Bluetooth: use assign_bit() where applicable

Kevin Dewald <[email protected]>
Bluetooth: hci_event: Clear explicit connect state on LE connection

Catherine L <[email protected]>
Bluetooth: btintel: fix buffer over-read in fw payload

Akhil Arul <[email protected]>
Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained

Binbin Deng <[email protected]>
Bluetooth: hci_core: Initialize LTK before publication

Binbin Deng <[email protected]>
Bluetooth: hci_core: Initialize link key before publication

Binbin Deng <[email protected]>
Bluetooth: hci_core: Initialize IRK before publication

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix invalid Supervision_Timeout in LE Set Default Rate

Alexandre Mergnat <[email protected]>
regulator: mt6363: Fix VEMC voltage selection

Alexandre Mergnat <[email protected]>
regulator: mt6363: Use 8-bit register values

GIBEOM LEE (이기범) <[email protected]>
regulator: mt6363: Fix the registers of the VSRAM CPU and APU LDOs

Alexei Starovoitov <[email protected]>
bpf: Don't trust pointers spilled in slots that a callee can write

Alexei Starovoitov <[email protected]>
bpf: Prepare static analysis passes for callx instruction

Yonghong Song <[email protected]>
bpf: Rename bpf_call_summary::num_params to arg_slot_cnt

Alexei Starovoitov <[email protected]>
bpf: Fix the join of fp+0 with a value that is not a pointer to stack

Jerome Brunet <[email protected]>
ASoC: meson: axg-fifo: request the irq with the clock enabled

Shubhang Kaushik (Ampere) <[email protected]>
sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs

Alexei Starovoitov <[email protected]>
bpf: Don't move a MAP_FIXED address in arena_get_unmapped_area()

Lorenzo Bianconi <[email protected]>
net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()

Lorenzo Bianconi <[email protected]>
net: stmmac: pass the desired EST enable state to est_configure()

Lorenzo Bianconi <[email protected]>
net: stmmac: initialize est_lock at probe time

James Clark <[email protected]>
net: stmmac: ptp: switch to gettimex64() interface

Lorenzo Bianconi <[email protected]>
net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume()

Baochen Qiang <[email protected]>
wifi: ath12k: don't advertise EHT-MCS15 to firmware unless we support it

Nguyen Ngoc Thang <[email protected]>
net: phy: don't require RTNL to detach a PHY from an unregistered netdev

Markus Stockhausen <[email protected]>
net: phy: add phy_detach_internal() helper

Bryam Vargas <[email protected]>
net/iucv: take a private, writable frame before rewriting it in place

Guangshuo Li <[email protected]>
gpio: mpc8xxx: Fix potential use-after-free of IRQ domain

Daniel Machon <[email protected]>
net: sparx5/lan969x: release the in-flight slot of a stale TX skb

Dmitry Baryshkov <[email protected]>
regulator: qcom_spmi: don't take a sleeping lock in the SAW IPI

Yuho Choi <[email protected]>
virtio_blk: Reset device on probe error paths after DRIVER_OK

Jia Jia <[email protected]>
vduse: avoid infinite loop when no affinity CPU is online

Sergii Ushakov <[email protected]>
virtio-blk: clamp max_segments to virtqueue ring size

Yu Zhang <[email protected]>
vhost-vdpa: drop the parent's vq callback before the call fd is released

Linfeng Sun <[email protected]>
vhost: reject invalid IOTLB update permissions

Xiang Mei <[email protected]>
vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit()

Maoxia <[email protected]>
virtio_pci: add missing newline to the pmcsr error message

Linfeng Sun <[email protected]>
vhost: fix dirty logging for in-order used ring entries

Jia Jia <[email protected]>
vhost-scsi: do not relock event vq mutex on send_evt fallback

Jia Jia <[email protected]>
vhost-scsi: preserve event ordering

Linfeng Sun <[email protected]>
vdpa: invalidate DMA mappings before releasing memory

Linfeng Sun <[email protected]>
vdpa_sim: serialize IOTLB updates with dataplane access

Li RongQing <[email protected]>
virtio_ring: reset IN_ORDER state in virtqueue_init()

Karl Mehltretter <[email protected]>
virtio-spi: Fix virtio_spi_config kernel-doc

Alex Austin <[email protected]>
sfc: ptp: avoid racing PPS timestamp updates

Alex Austin <[email protected]>
sfc: ptp: serialize host and MC synchronization transactions

Alex Austin <[email protected]>
sfc: ptp: drop the stale frequency reset in efx_ptp_start()

Namjae Jeon <[email protected]>
ntfs: don't allow resident values to overlap the attribute header

Vladimir Zapolskiy <[email protected]>
drm/panel: visionox-r66451: Wait longer after the panel reset

Vladimir Zapolskiy <[email protected]>
drm/panel: visionox-r66451: Send the brightness value MSB first

Daejun Park <[email protected]>
erofs: apply the stacked fs check to extra file-backed devices

Daniel Machon <[email protected]>
net: lan966x: don't free XDP buffers in fdma tx clear with budget 0

Giuseppe Piscitelli <[email protected]>
ata: libata-core: Check device support before querying power state

Lorenzo Bianconi <[email protected]>
net: stmmac: fix XDP RX buffer DMA sync length

Lorenzo Bianconi <[email protected]>
net: stmmac: fix VLAN tag stripping on short and non-linear RX frames

Lorenzo Bianconi <[email protected]>
net: stmmac: copy XDP metadata in AF_XDP zero-copy RX

Lorenzo Bianconi <[email protected]>
net: stmmac: drop multi-buffer frames in XDP mode

Lorenzo Bianconi <[email protected]>
net: stmmac: drop split frames on AF_XDP zero-copy RX

James Hilliard <[email protected]>
net: stmmac: take ownership of saved RX state at poll entry

Niklas Cassel <[email protected]>
ata: libata-eh: Retry non-NCQ commands when their sense data asks for it

Igor Pylypiv <[email protected]>
ata: libata-sata: allow re-enabling NCQ with the same queue_depth

Eric Dumazet <[email protected]>
tcp: do not let tcp_collapse() drive sk_forward_alloc negative

Cen Zhang (Microsoft) <[email protected]>
ipv6: fix fib6 walker UAF on NLM_F_REPLACE

Shawn Guo <[email protected]>
gpio: shared-proxy: Drop the vote when switching to input

Shawn Guo <[email protected]>
gpio: shared-proxy: Drive the default value when no votes are cast

Shawn Guo <[email protected]>
gpio: shared-proxy: Drop the vote of a released proxy on write failure

Shawn Guo <[email protected]>
gpio: shared-proxy: Fix race between concurrent first users

Vlad Poenaru <[email protected]>
bnxt_en: Don't keep MSI-X vectors added before FW reserves them

Joas Antonio dos Santos <[email protected]>
net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period

Animesh Manna <[email protected]>
drm/i915/cmtg: Disable CMTG after encoder disable in hsw_crtc_disable()

Suraj Kandpal <[email protected]>
drm/i915/display: Limit NVL TRANS_VTOTAL.Vtotal skip to A-step

Yuqiang Sun <[email protected]>
bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom

Michał Kopeć <[email protected]>
firmware: coreboot: Don't skip CBMEM entries outside of known memory

Rosen Penev <[email protected]>
spi: acpi: only look up the IRQ of confirmed SPI devices

Alban Bedel <[email protected]>
spi: Fix ACPI SPI resources using relative path

James Calligeros <[email protected]>
ASoC: tas2770: Configure transmit clock edge when setting DAI format

Chris Mason <[email protected]>
bpf: Check the offset in bpf_skb_generic_{push,pop}()

Chris Mason <[email protected]>
bpf: Use the inner transport header after a decap

Chris Mason <[email protected]>
bpf: Move the transport header with the moved headers

Alexei Starovoitov <[email protected]>
bpf: Don't let lwt_in progs call into IPv6 when it is disabled

Alexei Starovoitov <[email protected]>
bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol

Alexei Starovoitov <[email protected]>

    bpf: Reset skb->cb after an lwt prog pushes an IP header

Alexei Starovoitov <[email protected]>
bpf: Don't leave a stale MAC header in bpf_lwt_push_ip_encap()

Chris Mason <[email protected]>
bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()

Alexei Starovoitov <[email protected]>
bpf: Don't look for the SRH again in the End.BPF helpers

Chris Mason <[email protected]>
bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh()

Alexei Starovoitov <[email protected]>
bpf: Set a dst for test runs of lwt_in progs

Chris Mason <[email protected]>
bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6

Alexei Starovoitov <[email protected]>
bpf: Don't let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS

Chris Mason <[email protected]>
bpf, cgroup: Keep the skb network offset signed

Chris Mason <[email protected]>
bpf: Require prog fd or capability for cgroup detach

Alexei Starovoitov <[email protected]>
bpf: Remove the WARN from arena_get_unmapped_area()

Alexei Starovoitov <[email protected]>
bpf: Refuse an arena mmap() longer than max_entries pages

Alexei Starovoitov <[email protected]>
bpf: Don't let bpf_arena_free_pages() see a half-set user range

Alexei Starovoitov <[email protected]>
bpf: Refuse to map an arena at address 0

Alexei Starovoitov <[email protected]>
bpf: Clamp the trace length before the skip test in stackid_init()

Josef Bacik <[email protected]>
bpf: Clamp the trace length in __bpf_get_stack() again

Hongjian Dai <[email protected]>
spi: pic32-sqi: fail transfer when the BD ring is exhausted

Alexei Starovoitov <[email protected]>
bpf, x86: Fix bpf_throw() in a prog with a private stack

Tang Bin <[email protected]>
ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable

Fernando Fernandez Mancera <[email protected]>
netfilter: nft_reject: prevent unbounded recursion in output hooks

Ayushman Rout <[email protected]>
bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet

Sasha Levin <[email protected]>
ALSA: hda/core: Fix double free on stream page allocation failure

Sasha Levin <[email protected]>
ALSA: memalloc: Free the new pages when WC DMA mapping fails

Thomas Fourier <[email protected]>
net: ipa: Fix double free of the interrupt structure on config error

Tung Nguyen <[email protected]>
tipc: reject attaching bearer of different media to the same occupied device

Jia Jia <[email protected]>
scsi: target: Validate REGISTER AND MOVE TransportID length

Vincent YUE <[email protected]>
scsi: mpt3sas: Register devices during SANITIZE

Damien Le Moal <[email protected]>
scsi: mpt3sas: Use combined sense codes

Fernando Fernandez Mancera <[email protected]>
net/smc: fix limit_smc_hs sysctl on big-endian architecture

James Hilliard <[email protected]>
ptp: vclock: preserve missing hardware timestamps

James Hilliard <[email protected]>
ptp: vclock: serialize extended samples with counter updates

James Hilliard <[email protected]>
ptp: vclock: propagate physical clock sampling errors

James Hilliard <[email protected]>
ptp: unwind partially completed virtual clock creation

James Hilliard <[email protected]>
ptp: drain virtual clock sysfs operations before unregistering children

Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986

Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: free up rings during detach

Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: fix reset condition for rx wdma

Zhi-Jun You <[email protected]>
net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3

Puranjay Mohan <[email protected]>
bpf: Drop percpu_counter from the htab element count

Thomas Fourier <[email protected]>
btrfs: zoned: fix double free of bitmaps on clone failure

Filipe Manana <[email protected]>
btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing

Filipe Manana <[email protected]>
btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe

Filipe Manana <[email protected]>
btrfs: fix fiemap merging compressed extents

guolingxing <[email protected]>
btrfs: verity: propagate orphan insertion errors when enabling verity

Tejun Heo <[email protected]>
sched_ext: Call ops.sub_attach() only while the cgroup is online

Jose Fernandez (Anthropic) <[email protected]>
bpf: Fix jited line info off by the CFI preamble

Daniel Borkmann <[email protected]>
x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address

Avi Weiss <[email protected]>
gpio: omap: Propagate runtime PM failures in probe and request

Michal Wilczynski <[email protected]>
drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes

Andrea Mayer <[email protected]>
seg6: fix transport header for inner IPv4 with IP options

Kang Yang <[email protected]>
wifi: ath12k: set MSDU payload correctly

P Praneesh <[email protected]>
wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler

Filippo Falezza <[email protected]>
wifi: ath10k: Stop unanswered temperature reads

Hyunchul Lee <[email protected]>
ntfs: avoid overflow when limiting attribute read length

Hyunchul Lee <[email protected]>
ntfs: initialize VCN when inserting index entries

Yuanfu Xie <[email protected]>
9p: do not store the create fid on special files

Yuanfu Xie <[email protected]>
9p: fall back to the normal open path for non-regular files

Omokefe Emmanuel Onanaroghene <[email protected]>
9p: fix kernel-doc warning for enum p9_session_flags

Barret Rhoden <[email protected]>
9p: treat read return values of 0 as EOF

Matthew Whitehead <[email protected]>
scsi: aha1542: Remove unneeded scsi_dma_unmap() call

Giuseppe Piscitelli <[email protected]>
scsi: core: Balance the pseudo target reap reference

Giuseppe Piscitelli <[email protected]>
scsi: scsi_debug: Drain target cleanup before module exit

Imre Kaloz <[email protected]>
scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts

Davidlohr Bueso <[email protected]>
dma-buf: validate the attachment before asserting its reservation lock

Karl Mehltretter <[email protected]>
dma-buf: keep the DMA flags in the DMABUF_DEBUG copy

Leon Romanovsky <[email protected]>
dma-buf: Restore the scatterlist entry count before freeing

Wang Wensheng <[email protected]>

    printk_ringbuffer: Fix space_used() when blk_lpos->next overflows

Bart Van Assche <[email protected]>
ntfs: Fix error handling in __ntfs_create()

Mehmet Fide <[email protected]>
wifi: ath9k_htc: start ANI when an AP interface begins to beacon

Miaoqing Pan <[email protected]>
wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect

Lorenzo Bianconi <[email protected]>
wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers

Avi Weiss <[email protected]>
fsnotify: preserve 64-bit pre-content ranges

Cosmin Ratiu <[email protected]>
wifi: wext: Limit notifier event flushes to the device's netns

Devin Wittmayer <[email protected]>
drm/panic: Accept a trailing newline in panic_screen

Antony Antony <[email protected]>
docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple

Antony Antony <[email protected]>
xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state()

Antony Antony <[email protected]>
xfrm: include mark in MIGRATE_STATE SA collision check

Antony Antony <[email protected]>
xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path

Antony Antony <[email protected]>
xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state()

Antony Antony <[email protected]>
xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups

Deepanshu Kartikey <[email protected]>
batman-adv: avoid WARN_ON for orig_ifinfo allocation failure

Shubham Antil <[email protected]>
xfrm: zero-initialise km_event in the replay-notify path

Haobin Wu <[email protected]>
9p: skip intermediate directory entry name copy in p9dirent_read()

Yizhou Zhao <[email protected]>
net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx

Yizhou Zhao <[email protected]>
net/9p/usbg: fix descriptor cleanup use-after-free

Yizhou Zhao <[email protected]>

    9p: use fc->net_ns for network namespace in RDMA and socket transports

Nick Venenga <[email protected]>

    wifi: rtw89: 8922au: add ASUS BE93

Nick Venenga <[email protected]>
wifi: rtw89: 8922au: Add support for TP-Link TBE400U

Bitterblue Smith <[email protected]>
wifi: rtw89: usb: Avoid crash with dynamically added device ID

Dmitry Torokhov <[email protected]>
Input: destroy force-feedback device on input unregistration

Bryan Cochrane <[email protected]>
bnxt_en: Take RTNL before netif_close() when aborting FW reset

Mikhail Malyshev <[email protected]>
io_uring/io-wq: apply the current cpuset to new workers

Siddharth Chintamaneni <[email protected]>

    io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()

Cheng Yongkang <[email protected]>
io_uring/rsrc: keep the old file when a file update fails

Cheng Yongkang <[email protected]>
io_uring/timeout: don't rearm a multishot timeout on cancel

Jens Axboe <[email protected]>
io_uring/io-wq: show stuck workers rather than WARN on a slow exit

Yang Xiuwei <[email protected]>
io_uring/rw: fail soft links on IOPOLL short or error IO

Yang Xiuwei <[email protected]>
io_uring/futex: fail soft links when cancelling a wait

Yang Xiuwei <[email protected]>
io_uring: fail soft links on negative IOU_COMPLETE results

Cinq Prairie <[email protected]>
io_uring/napi: don't end the single NAPI busy poll early on need_resched()

Hui Peng <[email protected]>

    udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()

Sasha Levin <[email protected]>
Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"

Vladimir Petrzhikovskii <[email protected]>
virtio_net: check RX buffer length before DMA sync

Antheas Kapenekakis <[email protected]>
ALSA: hda/tas2781: Prevent throwing away custom calibration addresses

Krittikun Wongnin <[email protected]>

    ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]

Hakan Abay <[email protected]>
ACPI: PM: Add unused power resource quirk for Casper Excalibur G900

Matthias Dittrich <[email protected]>

    ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250)

Hao Li <[email protected]>
mm/slub: refill prefilled sheaves from the barn

Sergey Lebedev <[email protected]>
soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel)

Charles Keepax <[email protected]>
soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9

Sataporn Saijai <[email protected]>
soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11

Eric Dumazet <[email protected]>
net: virtio: validate outer protocol of UDP tunnel GSO packets

Eric Dumazet <[email protected]>

    tun: clear stale skb->protocol of NAPI frags skbs

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

Diffstat:

 .../ABI/testing/sysfs-driver-intel-xe-gpu          |  10 +
 Documentation/arch/arm64/gcs.rst                   |  13 +-
 Documentation/arch/arm64/silicon-errata.rst        |  12 +
 .../bindings/iio/adc/aspeed,ast2600-adc.yaml       |  17 +
 Documentation/filesystems/9p.rst                   |   2 +-
 Documentation/filesystems/overlayfs.rst            |  24 +-
 .../networking/net_cachelines/tcp_sock.rst         |   1 +
 .../networking/xfrm/xfrm_migrate_state.rst         |  25 +-
 Documentation/power/runtime_pm.rst                 |  89 ++++--
 Documentation/trace/kprobes.rst                    |   2 +-
 Makefile                                           |   4 +-
 arch/arm/kernel/perf_regs.c                        |   6 -
 arch/arm64/Kconfig                                 |  44 ++-
 arch/arm64/include/asm/suspend.h                   |   2 +-
 arch/arm64/kernel/cpu_errata.c                     |  28 ++
 arch/arm64/kernel/cpufeature.c                     |   3 +-
 arch/arm64/kernel/kexec_image.c                    |   7 +
 arch/arm64/kernel/perf_regs.c                      |   6 -
 arch/arm64/kernel/ptrace.c                         |   8 +-
 arch/arm64/kernel/signal.c                         |  22 +-
 arch/arm64/kernel/suspend.c                        |  11 +-
 arch/arm64/kernel/topology.c                       |   3 +-
 arch/arm64/mm/hugetlbpage.c                        |  21 +-
 arch/arm64/mm/proc.S                               |  20 ++
 arch/arm64/tools/cpucaps                           |   1 +
 arch/csky/kernel/perf_regs.c                       |   6 -
 arch/loongarch/include/asm/inst.h                  |  21 ++
 arch/loongarch/kernel/inst.c                       |  28 ++
 arch/loongarch/kernel/machine_kexec.c              |   2 +
 arch/loongarch/kernel/machine_kexec_file.c         |   4 +
 arch/loongarch/kernel/perf_regs.c                  |   6 -
 arch/loongarch/kvm/intc/dmsintc.c                  |   1 +
 arch/loongarch/kvm/intc/eiointc.c                  |   1 +
 arch/loongarch/kvm/intc/ipi.c                      |   1 +
 arch/loongarch/kvm/intc/pch_pic.c                  |  18 +-
 arch/loongarch/net/bpf_jit.c                       |  16 +-
 arch/loongarch/power/hibernate.c                   |   6 +
 arch/mips/Kconfig                                  |   2 +-
 arch/mips/alchemy/common/irq.c                     |  11 +-
 arch/mips/alchemy/common/prom.c                    |  23 +-
 arch/mips/cobalt/pci.c                             |  11 +-
 arch/mips/cobalt/setup.c                           |   4 +-
 arch/mips/configs/ip30_defconfig                   |   9 +-
 arch/mips/include/asm/mach-cobalt/cobalt.h         |   1 +
 arch/mips/kernel/perf_regs.c                       |   6 -
 arch/mips/sgi-ip27/ip27-nmi.c                      |   8 +
 arch/mips/sibyte/sb1250/irq.c                      |   3 +
 arch/parisc/kernel/perf_regs.c                     |   6 -
 arch/powerpc/kernel/watchdog.c                     |   3 +
 arch/riscv/kernel/perf_regs.c                      |   6 -
 arch/s390/net/bpf_jit_comp.c                       |   2 -
 arch/x86/events/amd/ibs.c                          | 199 ++++++++++--
 arch/x86/events/amd/uncore.c                       |   2 +-
 arch/x86/kernel/cpu/amd.c                          |   3 +-
 arch/x86/kernel/ftrace_64.S                        |   6 +-
 arch/x86/kernel/ldt.c                              |  12 +-
 arch/x86/kernel/perf_regs.c                        |   6 -
 arch/x86/net/bpf_jit_comp.c                        |   7 +-
 arch/x86/video/video-common.c                      |   2 +-
 block/blk-mq-sched.c                               |   6 +-
 block/blk-mq.c                                     |   3 +
 block/genhd.c                                      |   2 +-
 block/partitions/efi.c                             |   1 +
 crypto/essiv.c                                     |   2 +-
 drivers/accel/ivpu/ivpu_pm.c                       |   9 +-
 drivers/acpi/apei/ghes.c                           |   2 +-
 drivers/acpi/power.c                               |  38 +++
 drivers/acpi/scan.c                                | 108 +++++--
 drivers/ata/libata-core.c                          |   8 +-
 drivers/ata/libata-eh.c                            |  16 +-
 drivers/ata/libata-sata.c                          |   2 +-
 drivers/ata/libata-scsi.c                          | 178 ++++++-----
 drivers/base/power/runtime.c                       |   8 +-
 drivers/base/swnode.c                              |   7 +-
 drivers/block/null_blk/zoned.c                     |  48 ++-
 drivers/block/ublk_drv.c                           |  23 +-
 drivers/block/virtio_blk.c                         | 100 +++++-
 drivers/block/zloop.c                              |   5 +-
 drivers/bluetooth/btintel.c                        |  24 +-
 drivers/bluetooth/btmtk.c                          |  49 ++-
 drivers/bluetooth/btqca.c                          |   1 +
 drivers/bluetooth/btusb_main.c                     |  10 +-
 drivers/bluetooth/hci_qca.c                        |   5 +
 drivers/char/tpm/eventlog/acpi.c                   |   4 +-
 drivers/char/tpm/eventlog/tpm1.c                   |   7 +
 drivers/char/tpm/tpm-dev-common.c                  |  12 +-
 drivers/char/tpm/tpm2-sessions.c                   |   4 +-
 drivers/comedi/comedi_fops.c                       |   2 +-
 drivers/comedi/drivers/addi_apci_1500.c            |   2 +-
 drivers/comedi/drivers/ni_660x.c                   |   3 +-
 drivers/comedi/drivers/ni_tio.c                    |   2 +-
 drivers/comedi/drivers/vmk80xx.c                   |  25 +-
 drivers/cpufreq/acpi-cpufreq.c                     |   9 +-
 drivers/cpufreq/cpufreq.c                          | 162 +++++++---
 drivers/cpufreq/intel_pstate.c                     |  18 +-
 drivers/crypto/caam/caampkc.c                      |  75 ++---
 drivers/dma-buf/dma-buf-mapping.c                  |   6 +-
 drivers/dma-buf/dma-buf.c                          |   4 +
 drivers/dpll/dpll_core.c                           |   3 +-
 drivers/firmware/cirrus/cs_dsp.c                   |   6 +
 drivers/firmware/google/coreboot_table.c           |  42 ++-
 drivers/gpio/gpio-aspeed.c                         |  19 +-
 drivers/gpio/gpio-brcmstb.c                        |   1 +
 drivers/gpio/gpio-mpc8xxx.c                        |  22 +-
 drivers/gpio/gpio-mpfs.c                           |   2 +
 drivers/gpio/gpio-mpsse.c                          |   4 +
 drivers/gpio/gpio-omap.c                           |  13 +-
 drivers/gpio/gpio-regmap.c                         |   5 +
 drivers/gpio/gpio-rockchip.c                       |  15 +-
 drivers/gpio/gpio-sa1100.c                         |  32 +-
 drivers/gpio/gpio-shared-proxy.c                   |  98 +++++-
 drivers/gpio/gpio-sodaville.c                      |   9 +-
 drivers/gpio/gpio-virtuser.c                       |  85 +++--
 drivers/gpio/gpiolib-of.c                          |   2 +-
 drivers/gpio/gpiolib-of.h                          |   2 +-
 drivers/gpio/gpiolib-shared.c                      |   6 +-
 drivers/gpio/gpiolib-shared.h                      |   1 +
 drivers/gpio/gpiolib.c                             |  69 ++--
 drivers/gpio/gpiolib.h                             |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c             |  10 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c           |   4 +-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |   5 +-
 .../amd/display/dc/dio/dcn10/dcn10_link_encoder.c  |   5 +-
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c     |  20 +-
 drivers/gpu/drm/bridge/sii902x.c                   |   8 +-
 drivers/gpu/drm/drm_panic.c                        |   2 +-
 drivers/gpu/drm/i915/display/intel_display.c       |  19 +-
 drivers/gpu/drm/i915/display/intel_psr.c           |   7 +-
 drivers/gpu/drm/i915/display/intel_vrr.c           |  12 +-
 drivers/gpu/drm/imagination/pvr_rogue_fwif.h       |   2 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c              |   7 +-
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c   |  13 +
 .../gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c    |  20 --
 drivers/gpu/drm/panel/panel-visionox-r66451.c      |   4 +-
 drivers/gpu/drm/panfrost/panfrost_gpu.c            |   7 +-
 drivers/gpu/drm/panfrost/panfrost_perfcnt.c        |   3 +
 drivers/gpu/drm/xe/display/xe_display_pcode.c      |   4 +-
 drivers/gpu/drm/xe/regs/xe_gt_regs.h               |   1 +
 drivers/gpu/drm/xe/regs/xe_lrc_layout.h            |   3 +
 drivers/gpu/drm/xe/regs/xe_regs.h                  |   2 +
 drivers/gpu/drm/xe/xe_configfs.h                   |   2 +-
 drivers/gpu/drm/xe/xe_device.c                     |  25 +-
 drivers/gpu/drm/xe/xe_device.h                     |   4 +
 drivers/gpu/drm/xe/xe_device_sysfs.c               |  36 +++
 drivers/gpu/drm/xe/xe_device_types.h               |   7 +
 drivers/gpu/drm/xe/xe_gpu_scheduler_types.h        |   5 +-
 drivers/gpu/drm/xe/xe_gt.c                         |  74 +++--
 drivers/gpu/drm/xe/xe_gt_types.h                   |   9 +
 drivers/gpu/drm/xe/xe_guc.c                        |   1 -
 drivers/gpu/drm/xe/xe_guc_exec_queue_types.h       |   5 +-
 drivers/gpu/drm/xe/xe_guc_submit.c                 | 132 +++++---
 drivers/gpu/drm/xe/xe_hw_engine.c                  |  17 +-
 drivers/gpu/drm/xe/xe_hw_error.c                   |   2 +
 drivers/gpu/drm/xe/xe_hwmon.c                      | 187 +++++++----
 drivers/gpu/drm/xe/xe_irq.c                        |   3 +
 drivers/gpu/drm/xe/xe_late_bind_fw.c               |  15 +-
 drivers/gpu/drm/xe/xe_lmtt.c                       |  58 +++-
 drivers/gpu/drm/xe/xe_lmtt.h                       |   5 +-
 drivers/gpu/drm/xe/xe_lrc.c                        |   8 +-
 drivers/gpu/drm/xe/xe_memirq.c                     |   3 +
 drivers/gpu/drm/xe/xe_pat.c                        |  11 +-
 drivers/gpu/drm/xe/xe_pat.h                        |   4 +-
 drivers/gpu/drm/xe/xe_pci.c                        |   7 +
 drivers/gpu/drm/xe/xe_pci_error.c                  |   4 +-
 drivers/gpu/drm/xe/xe_pci_types.h                  |   2 +
 drivers/gpu/drm/xe/xe_pcode.c                      |   4 +-
 drivers/gpu/drm/xe/xe_pcode.h                      |   6 +-
 drivers/gpu/drm/xe/xe_pm.c                         |  20 +-
 drivers/gpu/drm/xe/xe_svm.c                        |   1 +
 drivers/gpu/drm/xe/xe_tuning.c                     |   2 +-
 drivers/gpu/drm/xe/xe_uc_fw.c                      |   1 +
 drivers/gpu/drm/xe/xe_vm.c                         |   9 +-
 drivers/gpu/drm/xe/xe_wa.c                         |   5 +-
 drivers/gpu/drm/xe/xe_wa_oob.rules                 |   1 +
 drivers/hwmon/aht10.c                              |   2 +-
 drivers/hwmon/gpio-fan.c                           |  24 +-
 drivers/hwmon/max31760.c                           |  12 +-
 drivers/hwmon/pmbus/mp2975.c                       | 207 ++++++------
 drivers/hwmon/scmi-hwmon.c                         |  25 +-
 drivers/hwmon/sy7636a-hwmon.c                      |   2 +-
 drivers/iio/accel/Kconfig                          |   2 +
 drivers/iio/accel/adxl380.c                        |  11 +-
 drivers/iio/accel/kxsd9.c                          |   2 +-
 drivers/iio/adc/ad7780.c                           |   4 +-
 drivers/iio/adc/ad7791.c                           |   4 +-
 drivers/iio/adc/ad7793.c                           |   4 +-
 drivers/iio/adc/ad7923.c                           |   1 +
 drivers/iio/adc/aspeed_adc.c                       |  25 +-
 drivers/iio/adc/max11205.c                         |   4 +-
 drivers/iio/addac/ad74413r.c                       |   2 +-
 drivers/iio/afe/iio-rescale.c                      |   3 +-
 drivers/iio/chemical/atlas-ezo-sensor.c            |   3 -
 .../iio/common/hid-sensors/hid-sensor-attributes.c |  14 +-
 .../iio/common/inv_sensors/inv_sensors_timestamp.c |  24 +-
 drivers/iio/common/scmi_sensors/scmi_iio.c         |  27 +-
 drivers/iio/dac/mcp4725.c                          |   2 +
 drivers/iio/gyro/bmg160_core.c                     |   2 +-
 drivers/iio/humidity/am2315.c                      |  12 +-
 drivers/iio/humidity/hid-sensor-humidity.c         |  14 +-
 drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c |  24 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c         |  97 ++++--
 drivers/iio/imu/kmx61.c                            |   2 +-
 drivers/iio/industrialio-acpi.c                    |   9 +
 drivers/iio/industrialio-trigger.c                 |   4 +-
 drivers/iio/light/tsl2591.c                        |  32 +-
 drivers/iio/light/vcnl4035.c                       |   4 +-
 drivers/iio/magnetometer/mmc35240.c                |   3 +-
 drivers/iio/magnetometer/mmc5633.c                 |   3 +-
 drivers/iio/magnetometer/tlv493d.c                 |   6 +-
 drivers/iio/proximity/hx9023s.c                    |  16 +-
 drivers/iio/proximity/sx9310.c                     |   2 +-
 drivers/iio/proximity/sx9324.c                     |  13 +-
 drivers/iio/proximity/sx9360.c                     |  29 +-
 drivers/iio/proximity/sx9500.c                     |   6 +
 drivers/iio/temperature/hid-sensor-temperature.c   |  14 +-
 drivers/iio/temperature/mlx90614.c                 |   2 +-
 drivers/input/ff-core.c                            |   2 +-
 drivers/input/ff-memless.c                         |  23 --
 drivers/input/input.c                              |   5 +-
 drivers/iommu/amd/init.c                           |   1 +
 drivers/md/dm-cache-metadata.c                     |   4 +-
 drivers/md/dm-cache-target.c                       |  15 +-
 drivers/md/dm-crypt.c                              |  22 +-
 drivers/md/dm-integrity.c                          |  30 +-
 drivers/md/dm-ioctl.c                              |   2 +-
 drivers/md/dm-log-userspace-base.c                 |   6 +-
 drivers/md/dm-mpath.c                              |   6 +-
 drivers/md/dm-pcache/backing_dev.c                 |   4 +-
 drivers/md/dm-pcache/backing_dev.h                 |   2 +-
 drivers/md/dm-pcache/cache_writeback.c             |  28 +-
 drivers/md/dm-raid.c                               |   5 +-
 drivers/md/dm-snap.c                               |  18 +-
 drivers/md/dm-sysfs.c                              |  17 +-
 drivers/md/dm-table.c                              | 146 +++++----
 drivers/md/dm-thin-metadata.c                      |   5 +-
 drivers/md/dm-thin.c                               |   7 +-
 drivers/md/dm-verity-target.c                      |  27 +-
 drivers/md/dm-zone.c                               |   2 +
 drivers/md/dm-zoned-reclaim.c                      |  18 +-
 drivers/md/dm.c                                    |  21 +-
 drivers/md/dm.h                                    |  18 +-
 drivers/md/persistent-data/dm-btree-remove.c       |  13 +-
 drivers/md/persistent-data/dm-btree.c              |   8 +-
 drivers/md/persistent-data/dm-space-map-common.c   |   9 +-
 drivers/memstick/core/memstick.c                   |   1 -
 drivers/misc/bcm-vk/bcm_vk_sg.c                    |  43 ++-
 drivers/misc/ibmvmc.c                              |  16 +-
 drivers/misc/mei/hw-me-regs.h                      |   1 +
 drivers/misc/mei/mei_lb.c                          |  12 +-
 drivers/misc/mei/pci-me.c                          |   1 +
 drivers/misc/vmw_vmci/vmci_event.c                 |   7 +-
 drivers/mmc/host/jz4740_mmc.c                      |   5 +-
 drivers/mmc/host/meson-gx-mmc.c                    |  26 +-
 drivers/mmc/host/mmci.c                            |   4 +-
 drivers/mmc/host/omap.c                            |   4 +-
 drivers/mmc/host/sdhci-brcmstb.c                   |  11 +-
 drivers/mmc/host/sdhci-esdhc-imx.c                 |  17 +
 drivers/mmc/host/sunxi-mmc.c                       |  24 +-
 drivers/net/amt.c                                  |  61 ++--
 drivers/net/bonding/bond_main.c                    |  87 ++---
 drivers/net/can/dev/netlink.c                      |  17 +-
 drivers/net/can/dev/skb.c                          |   6 +-
 drivers/net/dsa/b53/b53_common.c                   |  69 +++-
 drivers/net/dsa/b53/b53_priv.h                     |   1 +
 drivers/net/dsa/b53/b53_regs.h                     |  17 +
 drivers/net/dsa/bcm_sf2.c                          |   5 +
 drivers/net/dsa/microchip/ksz_common.c             |   1 +
 drivers/net/ethernet/amazon/ena/ena_netdev.c       |  13 +-
 drivers/net/ethernet/broadcom/bgmac-platform.c     |   3 +-
 drivers/net/ethernet/broadcom/bgmac.c              |   8 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |  49 ++-
 drivers/net/ethernet/intel/i40e/i40e_xsk.c         |  35 +-
 drivers/net/ethernet/intel/ice/ice_adapter.c       |   2 +
 drivers/net/ethernet/intel/ice/ice_adapter.h       |   4 +
 drivers/net/ethernet/intel/ice/ice_dpll.c          |  11 +-
 drivers/net/ethernet/intel/ice/ice_dpll.h          |   4 +
 drivers/net/ethernet/intel/ice/ice_ptp.c           |   8 +-
 drivers/net/ethernet/intel/ice/ice_tspll.c         |   8 +-
 drivers/net/ethernet/intel/ice/ice_xsk.c           |  19 +-
 drivers/net/ethernet/intel/idpf/xsk.c              |   5 +
 drivers/net/ethernet/marvell/octeontx2/af/rvu.h    |   5 -
 drivers/net/ethernet/mediatek/mtk_ppe.c            |   5 +-
 drivers/net/ethernet/mediatek/mtk_wed.c            |  27 +-
 drivers/net/ethernet/mellanox/mlx5/core/en/fs.h    |   5 +-
 .../net/ethernet/mellanox/mlx5/core/en/params.c    |   5 +-
 .../ethernet/mellanox/mlx5/core/en_accel/ipsec.c   |  99 ++++--
 .../ethernet/mellanox/mlx5/core/en_accel/ipsec.h   |   2 +-
 .../mellanox/mlx5/core/en_accel/ipsec_fs.c         |  90 +++---
 .../ethernet/mellanox/mlx5/core/en_accel/ktls.c    |   6 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_fs.c    |  17 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  29 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c    |  19 +-
 .../net/ethernet/mellanox/mlx5/core/esw/bridge.c   |  21 +-
 .../net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c |  15 +-
 .../net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h |   6 +
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c  |  48 ++-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h  |  15 +-
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c |  88 ++---
 .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h  |   2 +-
 .../ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c |  26 +-
 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c  |   3 +-
 .../net/ethernet/mellanox/mlx5/core/lag/mpesw.c    |   2 +-
 .../net/ethernet/mellanox/mlx5/core/lib/clock.c    | 248 +++++++++++----
 .../net/ethernet/mellanox/mlx5/core/lib/clock.h    |   2 +
 .../ethernet/mellanox/mlx5/core/lib/macsec_fs.c    |  41 ++-
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |   1 +
 .../mellanox/mlx5/core/steering/hws/fs_hws.c       |   8 +-
 .../mellanox/mlx5/core/steering/hws/fs_hws.h       |   2 +-
 drivers/net/ethernet/meta/fbnic/fbnic_csr.h        |   5 +
 drivers/net/ethernet/meta/fbnic/fbnic_fw.c         |  16 +
 drivers/net/ethernet/meta/fbnic/fbnic_netdev.c     |   4 +-
 drivers/net/ethernet/meta/fbnic/fbnic_pci.c        |  38 ++-
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c       |  10 +-
 .../net/ethernet/microchip/lan966x/lan966x_fdma.c  |   6 +
 drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c |  10 +-
 drivers/net/ethernet/microsoft/mana/mana_bpf.c     |   9 +-
 drivers/net/ethernet/microsoft/mana/mana_en.c      |  18 +-
 drivers/net/ethernet/realtek/8139cp.c              |   8 +-
 drivers/net/ethernet/sfc/ptp.c                     | 108 ++++---
 drivers/net/ethernet/stmicro/stmmac/enh_desc.c     |   2 +-
 drivers/net/ethernet/stmicro/stmmac/hwif.h         |   7 +-
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c    |   2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac.h       |   8 +
 drivers/net/ethernet/stmicro/stmmac/stmmac_est.c   |  61 +++-
 drivers/net/ethernet/stmicro/stmmac/stmmac_est.h   |   8 +
 .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |   3 +-
 .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c  |   7 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 333 ++++++++++++-------
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   6 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c   |  65 ++--
 .../net/ethernet/stmicro/stmmac/stmmac_selftests.c |   4 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c    |  99 +++---
 drivers/net/ethernet/ti/am65-cpts.c                |  98 ++++--
 drivers/net/gtp.c                                  |  22 +-
 drivers/net/hyperv/rndis_filter.c                  |   6 +-
 drivers/net/ipa/ipa_interrupt.c                    |  12 +-
 drivers/net/ipvlan/ipvlan_core.c                   |   6 +-
 drivers/net/macsec.c                               |  15 +-
 drivers/net/mctp/mctp-i3c.c                        |   3 +-
 drivers/net/phy/phy-c45.c                          |  46 ++-
 drivers/net/phy/phy_device.c                       | 176 +++++-----
 drivers/net/team/team_core.c                       |   9 +-
 drivers/net/tun.c                                  |  21 +-
 drivers/net/tun_vnet.h                             |   5 +-
 drivers/net/usb/cdc_ncm.c                          |   4 +-
 drivers/net/usb/lan78xx.c                          |  21 +-
 drivers/net/virtio_net.c                           |  65 ++--
 drivers/net/wireless/ath/ath10k/core.c             |   1 +
 drivers/net/wireless/ath/ath10k/thermal.c          |   9 +-
 drivers/net/wireless/ath/ath10k/thermal.h          |   2 +
 drivers/net/wireless/ath/ath12k/ahb.c              |  11 +-
 drivers/net/wireless/ath/ath12k/core.c             |   3 +-
 drivers/net/wireless/ath/ath12k/dp_mon.c           |   8 +-
 drivers/net/wireless/ath/ath12k/mac.c              |  17 +-
 .../net/wireless/ath/ath12k/wifi7/hal_qcc2072.c    |  30 +-
 .../net/wireless/ath/ath12k/wifi7/hal_qcn9274.c    |  32 +-
 .../net/wireless/ath/ath12k/wifi7/hal_wcn7850.c    |  30 +-
 drivers/net/wireless/ath/ath9k/htc_drv_main.c      |   8 +-
 drivers/net/wireless/nxp/nxpwifi/11ax.c            |  67 ++--
 drivers/net/wireless/nxp/nxpwifi/scan.c            |  18 +-
 drivers/net/wireless/realtek/rtw89/rtw8851bu.c     |   8 +-
 drivers/net/wireless/realtek/rtw89/rtw8852au.c     |   8 +-
 drivers/net/wireless/realtek/rtw89/rtw8852bu.c     |   8 +-
 drivers/net/wireless/realtek/rtw89/rtw8852cu.c     |   8 +-
 drivers/net/wireless/realtek/rtw89/rtw8922au.c     |  14 +-
 drivers/net/wireless/realtek/rtw89/usb.c           |   5 +-
 drivers/net/wireless/realtek/rtw89/usb.h           |   3 +-
 drivers/net/wireless/virtual/mac80211_hwsim_main.c |   4 +-
 drivers/nvme/host/core.c                           |   4 +
 drivers/nvme/target/admin-cmd.c                    |   4 +-
 drivers/nvme/target/auth.c                         |  69 ++--
 drivers/nvme/target/loop.c                         |   5 +-
 drivers/nvme/target/rdma.c                         |  55 ++--
 drivers/nvme/target/tcp.c                          |  13 +-
 drivers/power/sequencing/pwrseq-pcie-m2.c          |  46 ++-
 drivers/power/sequencing/pwrseq-qcom-wcn.c         |   2 +-
 drivers/powercap/intel_rapl_common.c               |  15 +-
 drivers/ptp/ptp_clock.c                            |   5 +
 drivers/ptp/ptp_kvm_x86.c                          |   7 +-
 drivers/ptp/ptp_private.h                          |   7 +-
 drivers/ptp/ptp_sysfs.c                            |  18 +-
 drivers/ptp/ptp_vclock.c                           | 123 ++++---
 drivers/regulator/Kconfig                          |   1 +
 drivers/regulator/mt6363-regulator.c               | 156 +++------
 drivers/regulator/qcom_spmi-regulator.c            |  35 +-
 drivers/s390/block/dasd_eckd.c                     |   3 +-
 drivers/s390/block/dasd_ioctl.c                    |   4 +-
 drivers/scsi/aha1542.c                             |   2 -
 drivers/scsi/aic7xxx/aic7xxx_core.c                |   2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c               |  71 +++--
 drivers/scsi/scsi_debug.c                          |   1 +
 drivers/scsi/scsi_scan.c                           |   5 +-
 drivers/soundwire/dmi-quirks.c                     |  42 +++
 drivers/spi/spi-axi-spi-engine.c                   |   2 +
 drivers/spi/spi-cadence-quadspi.c                  |   4 +-
 drivers/spi/spi-pic32-sqi.c                        |   3 +-
 drivers/spi/spi-tegra210-quad.c                    |  41 ++-
 drivers/spi/spi-virtio.c                           |  26 +-
 drivers/spi/spi.c                                  |  40 ++-
 drivers/target/target_core_pr.c                    |   9 +-
 drivers/thunderbolt/stream.c                       |   6 +
 drivers/tty/serial/8250/8250_exar.c                |   2 +-
 drivers/tty/serial/8250/8250_lpss.c                |   3 +
 drivers/tty/serial/8250/8250_mxpcie.c              |  13 +-
 drivers/tty/serial/fsl_lpuart.c                    |  10 +-
 drivers/tty/serial/imx.c                           |  10 +-
 drivers/tty/serial/rda-uart.c                      |   2 +
 drivers/tty/serial/samsung_tty.c                   |   8 +-
 drivers/tty/serial/serial_core.c                   |  25 +-
 drivers/tty/serial/serial_port.c                   |   4 +-
 drivers/tty/tty_io.c                               |   3 +-
 drivers/tty/vt/keyboard.c                          |   6 +
 drivers/tty/vt/vt.c                                |   2 +
 drivers/usb/class/cdc-acm.c                        |  18 +-
 drivers/usb/dwc3/core.h                            |   4 +-
 drivers/usb/dwc3/dwc3-xilinx.c                     | 123 +++++--
 drivers/usb/dwc3/ep0.c                             |   2 +-
 drivers/usb/dwc3/gadget.c                          | 160 ++++++----
 drivers/usb/dwc3/trace.h                           |   1 +
 drivers/usb/gadget/function/f_mass_storage.c       |   8 +-
 drivers/usb/gadget/function/f_midi.c               |   4 +
 drivers/usb/gadget/function/f_ncm.c                |   7 +-
 drivers/usb/gadget/function/storage_common.c       |   7 +-
 drivers/usb/gadget/function/storage_common.h       |   3 +-
 drivers/usb/gadget/function/u_serial.c             | 170 ++++++++--
 drivers/usb/host/pci-quirks.c                      |  13 +-
 drivers/usb/host/xhci-mem.c                        |  16 +-
 drivers/usb/host/xhci.c                            |   3 +-
 drivers/usb/misc/usbtest.c                         |   3 +
 drivers/usb/serial/garmin_gps.c                    |  31 +-
 drivers/usb/serial/io_edgeport.c                   | 141 ++++----
 drivers/usb/serial/oti6858.c                       |  16 +-
 drivers/usb/serial/sierra.c                        |  18 +-
 drivers/usb/serial/upd78f0730.c                    |  13 +-
 drivers/usb/storage/uas-detect.h                   |   8 +-
 drivers/usb/typec/mux/fsa4480.c                    |   9 +-
 drivers/usb/typec/mux/nb7vpq904m.c                 |   1 +
 drivers/usb/typec/ucsi/debugfs.c                   |   3 +-
 drivers/usb/typec/ucsi/ucsi.c                      |  10 +-
 drivers/usb/typec/ucsi/ucsi_acpi.c                 |  35 ++
 drivers/vdpa/mlx5/net/mlx5_vnet.c                  |  10 +-
 drivers/vdpa/vdpa.c                                |   7 +-
 drivers/vdpa/vdpa_sim/vdpa_sim.c                   |   7 +
 drivers/vdpa/vdpa_user/vduse_dev.c                 |  15 +-
 drivers/vhost/scsi.c                               |  61 +++-
 drivers/vhost/test.c                               |   4 +
 drivers/vhost/vdpa.c                               |  87 ++++-
 drivers/vhost/vhost.c                              |  33 +-
 drivers/virtio/virtio_balloon.c                    |   3 +-
 drivers/virtio/virtio_pci_common.c                 |   2 +-
 drivers/virtio/virtio_ring.c                       |   8 +-
 drivers/w1/masters/ds2482.c                        |  36 ++-
 drivers/w1/slaves/w1_ds2805.c                      |   8 +-
 drivers/w1/slaves/w1_ds28e04.c                     |  18 +-
 drivers/w1/slaves/w1_therm.c                       |  37 ++-
 drivers/w1/w1.c                                    |  21 +-
 drivers/w1/w1_int.c                                |   8 +-
 drivers/w1/w1_netlink.c                            |   8 +-
 drivers/watchdog/gunyah_wdt.c                      |  27 +-
 drivers/watchdog/npcm_wdt.c                        |  15 +-
 drivers/watchdog/rzv2h_wdt.c                       |  10 +-
 drivers/xen/gntdev.c                               |   8 +-
 drivers/xen/grant-table.c                          |  37 ++-
 drivers/xen/privcmd.c                              |  15 +
 drivers/xen/pvcalls-back.c                         |  26 +-
 fs/9p/v9fs.h                                       |  26 +-
 fs/9p/vfs_addr.c                                   |   3 +
 fs/9p/vfs_dir.c                                    |   6 +-
 fs/9p/vfs_inode.c                                  |  10 +
 fs/9p/vfs_inode_dotl.c                             |  36 ++-
 fs/adfs/dir_fplus.c                                |   2 +
 fs/aio.c                                           |   4 +-
 fs/backing-file.c                                  |   7 +-
 fs/btrfs/bio.c                                     |   4 +
 fs/btrfs/fiemap.c                                  |   3 +-
 fs/btrfs/ioctl.c                                   |   8 +-
 fs/btrfs/scrub.c                                   |  10 +-
 fs/btrfs/verity.c                                  |   2 +-
 fs/btrfs/volumes.h                                 |   5 +-
 fs/btrfs/zoned.c                                   |  81 +++--
 fs/btrfs/zstd.c                                    |   3 +-
 fs/coda/file.c                                     |   3 +-
 fs/dcache.c                                        |  44 ++-
 fs/erofs/data.c                                    |   1 +
 fs/erofs/super.c                                   |  23 +-
 fs/eventpoll.c                                     |  11 +-
 fs/ext2/dir.c                                      |   3 +
 fs/ext2/inode.c                                    |  61 ++--
 fs/ext4/inode.c                                    |  17 +-
 fs/file.c                                          |  10 +-
 fs/inode.c                                         |  16 +-
 fs/isofs/util.c                                    |   8 +-
 fs/libfs.c                                         | 133 +++-----
 fs/minix/bitmap.c                                  |  37 ++-
 fs/minix/inode.c                                   |  16 +-
 fs/minix/minix.h                                   |   1 +
 fs/netfs/read_retry.c                              |  17 +-
 fs/netfs/write_issue.c                             |   4 +-
 fs/nfs/delegation.h                                |   2 +
 fs/nfs/dir.c                                       |   4 +-
 fs/nfs/flexfilelayout/flexfilelayout.c             | 223 ++++++++-----
 fs/nfs/flexfilelayout/flexfilelayout.h             |  29 +-
 fs/nfs/flexfilelayout/flexfilelayoutdev.c          | 160 ++++++----
 fs/nfs/inode.c                                     |  69 +++-
 fs/nfs/localio.c                                   |  13 +-
 fs/nfs/nfs42proc.c                                 |  25 +-
 fs/nfs/nfs4proc.c                                  |  26 +-
 fs/nfs/pnfs.c                                      |   2 +-
 fs/notify/fanotify/fanotify.h                      |   2 +-
 fs/notify/fsnotify.c                               |   2 +-
 fs/ntfs/attrib.c                                   |   9 +-
 fs/ntfs/dir.c                                      |  14 +
 fs/ntfs/index.c                                    |  32 +-
 fs/ntfs/inode.c                                    |   2 +-
 fs/ntfs/namei.c                                    |   6 +-
 fs/overlayfs/dir.c                                 |  20 +-
 fs/overlayfs/namei.c                               |  61 +++-
 fs/overlayfs/overlayfs.h                           |  22 +-
 fs/overlayfs/ovl_entry.h                           |   2 +
 fs/overlayfs/params.c                              |  91 ++++--
 fs/overlayfs/params.h                              |   2 +
 fs/overlayfs/super.c                               |  52 ++-
 fs/overlayfs/util.c                                |  12 +
 fs/pidfs.c                                         |   8 +
 fs/proc/proc_sysctl.c                              |   5 +-
 fs/read_write.c                                    |  10 +-
 fs/smb/client/cifs_fs_sb.h                         |   2 +
 fs/smb/client/cifsacl.c                            |  11 +-
 fs/smb/client/cifsacl.h                            |  14 -
 fs/smb/client/cifsfs.c                             |  23 +-
 fs/smb/client/cifsglob.h                           |   4 +
 fs/smb/client/cifsproto.h                          |   2 +
 fs/smb/client/connect.c                            |   3 +-
 fs/smb/client/dfs.c                                |  12 +-
 fs/smb/client/file.c                               | 205 +++++++++++-
 fs/smb/client/sess.c                               |   4 +-
 fs/smb/client/smb2ops.c                            |   9 +-
 fs/smb/client/smb2pdu.c                            |  95 +++---
 fs/smb/client/smb2proto.h                          |   9 +
 fs/smb/server/mgmt/user_config.h                   |   5 +
 fs/smb/server/smb2pdu.c                            |  31 +-
 fs/smb/server/smbacl.c                             | 215 ++++++++++---
 fs/smb/server/smbacl.h                             |   2 +-
 fs/splice.c                                        |  11 +-
 fs/stat.c                                          |   6 +-
 fs/udf/inode.c                                     |  31 +-
 fs/udf/super.c                                     |  14 +-
 include/acpi/acpi_bus.h                            |   1 +
 include/linux/blk-mq.h                             |   3 +-
 include/linux/bpf.h                                |   2 +
 include/linux/bpf_verifier.h                       |   8 +-
 include/linux/compiler.h                           |   7 +-
 include/linux/cpufreq.h                            |   7 +-
 include/linux/entry-common.h                       |   4 +-
 include/linux/fs.h                                 |   2 +-
 include/linux/fs/super_types.h                     |   2 +-
 include/linux/fsnotify.h                           |   4 +-
 include/linux/fsnotify_backend.h                   |   6 +-
 include/linux/ftrace.h                             |   8 +-
 include/linux/iio/common/inv_sensors_timestamp.h   |   3 +-
 include/linux/input.h                              |   3 -
 include/linux/key.h                                |   7 +-
 include/linux/mlx5/driver.h                        |   8 +-
 include/linux/mmzone.h                             |   3 +-
 include/linux/mroute_base.h                        |   2 +
 include/linux/netdevice_xmit.h                     |   4 +-
 include/linux/nfs_fs_sb.h                          |   1 +
 include/linux/perf_event.h                         |  28 ++
 include/linux/perf_regs.h                          |  36 +--
 include/linux/ptp_clock_kernel.h                   |   2 +-
 include/linux/regulator/mt6363-regulator.h         |   1 +
 include/linux/sched.h                              |   2 +
 include/linux/sched/ext.h                          |   1 +
 include/linux/stat.h                               |   3 +
 include/linux/sunrpc/sched.h                       |   4 +
 include/linux/sunrpc/xprt.h                        |   5 +
 include/linux/tcp.h                                |  10 +-
 include/linux/uio.h                                |   8 +-
 include/linux/virtio_net.h                         | 181 ++++++++++-
 include/net/9p/client.h                            |   2 +-
 include/net/bluetooth/hci_core.h                   | 135 ++++----
 include/net/bluetooth/mgmt.h                       |  14 +
 include/net/dst_metadata.h                         |   2 +
 include/net/gro.h                                  |  18 +-
 include/net/gso.h                                  |   2 +-
 include/net/inet_common.h                          |   2 +-
 include/net/inet_connection_sock.h                 |   1 +
 include/net/ip6_route.h                            |   7 +
 include/net/iw_handler.h                           |   8 +-
 include/net/libeth/xsk.h                           |  10 +-
 include/net/mana/mana.h                            |   5 +-
 include/net/net_namespace.h                        |   1 +
 include/net/netfilter/nf_dup_netdev.h              |  35 --
 include/net/netfilter/nf_queue.h                   |   1 +
 include/net/netfilter/nf_recursion.h               |  42 +++
 include/net/request_sock.h                         |   3 +-
 include/net/route.h                                |   6 +
 include/net/sock.h                                 |  24 +-
 include/net/tcp.h                                  |   9 +
 include/net/tcp_ao.h                               |   3 +-
 include/net/tls.h                                  |   1 +
 include/net/xdp_sock_drv.h                         |   7 +-
 include/net/xfrm.h                                 |   7 +
 include/trace/events/oom.h                         |   8 +-
 include/uapi/linux/mdio.h                          |  13 +-
 include/uapi/linux/perf_event.h                    |  49 ++-
 include/uapi/linux/virtio_spi.h                    |   2 +-
 include/vdso/unaligned.h                           |  16 +
 init/do_mounts_rd.c                                |   5 +
 io_uring/futex.c                                   |   1 +
 io_uring/io-wq.c                                   |  68 +++-
 io_uring/io_uring.c                                |   8 +-
 io_uring/io_uring.h                                |   1 +
 io_uring/kbuf.c                                    |   1 +
 io_uring/napi.c                                    |  31 +-
 io_uring/rsrc.c                                    |   6 +-
 io_uring/rw.c                                      |   4 +-
 io_uring/timeout.c                                 |   3 +-
 kernel/bpf/arena.c                                 |  29 +-
 kernel/bpf/backtrack.c                             |  31 +-
 kernel/bpf/cgroup.c                                |  26 +-
 kernel/bpf/const_fold.c                            |   3 +-
 kernel/bpf/core.c                                  |   8 +-
 kernel/bpf/fixups.c                                |   9 +-
 kernel/bpf/hashtab.c                               |  64 ++--
 kernel/bpf/helpers.c                               |  16 +-
 kernel/bpf/liveness.c                              | 131 +++++---
 kernel/bpf/stackmap.c                              |  33 +-
 kernel/bpf/states.c                                |  14 +
 kernel/bpf/verifier.c                              |   8 +-
 kernel/cgroup/cgroup.c                             |  22 +-
 kernel/cgroup/cpuset.c                             | 174 ++++++----
 kernel/cgroup/legacy_freezer.c                     |  40 ++-
 kernel/events/core.c                               | 230 +++++++++++---
 kernel/events/hw_breakpoint.c                      |   3 +-
 kernel/kprobes.c                                   |  82 +++--
 kernel/liveupdate/kexec_handover.c                 |   2 +-
 kernel/liveupdate/luo_session.c                    |  21 +-
 kernel/locking/lockdep.c                           |   2 +-
 kernel/locking/osq_lock.c                          |  62 +++-
 kernel/printk/printk.c                             |  34 +-
 kernel/printk/printk_ringbuffer.c                  |   8 +-
 kernel/sched/core.c                                |  42 +--
 kernel/sched/core_sched.c                          |   3 +-
 kernel/sched/deadline.c                            |   2 +-
 kernel/sched/ext/cid.c                             |   8 +-
 kernel/sched/ext/ext.c                             | 162 ++++++++--
 kernel/sched/ext/inlines.h                         |  37 ++-
 kernel/sched/ext/internal.h                        |   6 +
 kernel/sched/ext/sub.c                             |  13 +
 kernel/sched/fair.c                                |   9 +-
 kernel/sched/pelt.c                                |   2 +-
 kernel/sched/sched.h                               |  26 +-
 kernel/sched/syscalls.c                            |  10 +-
 kernel/sched/topology.c                            |  16 +-
 kernel/time/timekeeping.c                          |  12 +-
 kernel/trace/trace_eprobe.c                        |  83 ++---
 kernel/trace/trace_event_perf.c                    |   3 +-
 kernel/trace/trace_fprobe.c                        |  22 +-
 kernel/trace/trace_kprobe.c                        |  11 +-
 kernel/trace/trace_probe.c                         |  79 ++++-
 kernel/trace/trace_probe_tmpl.h                    |  14 +-
 kernel/trace/trace_uprobe.c                        |  67 ++--
 kernel/tsacct.c                                    |  10 +-
 lib/bootconfig.c                                   |   7 +-
 lib/errseq.c                                       |  29 +-
 lib/iov_iter.c                                     |   6 +-
 lib/vdso/Kconfig                                   |  10 +
 mm/memory_hotplug.c                                |  51 ++-
 mm/mempolicy.c                                     |   4 +-
 mm/mmzone.c                                        |  11 +-
 mm/page_alloc.c                                    |  78 +++--
 mm/page_frag_cache.c                               |  21 +-
 mm/page_isolation.c                                |   7 +
 mm/shmem.c                                         |   2 +-
 mm/slub.c                                          |  81 +++++
 net/9p/protocol.c                                  |  12 +-
 net/9p/trans_fd.c                                  |  11 +-
 net/9p/trans_rdma.c                                |   2 +-
 net/9p/trans_usbg.c                                |  10 +-
 net/batman-adv/bat_iv_ogm.c                        |   2 +-
 net/bluetooth/hci_conn.c                           | 132 +++++---
 net/bluetooth/hci_core.c                           |  66 ++--
 net/bluetooth/hci_event.c                          | 353 ++++++++++++++-------
 net/bluetooth/hci_sync.c                           | 198 +++++++++---
 net/bluetooth/iso.c                                |  35 +-
 net/bluetooth/l2cap_core.c                         |  23 +-
 net/bluetooth/l2cap_sock.c                         |  25 +-
 net/bluetooth/mgmt.c                               | 121 ++++++-
 net/bluetooth/rfcomm/core.c                        |   6 +-
 net/bluetooth/rfcomm/sock.c                        |   5 +-
 net/bluetooth/sco.c                                |  10 +-
 net/bluetooth/smp.c                                |  53 ++--
 net/bpf/test_run.c                                 |   3 +-
 net/bridge/br_arp_nd_proxy.c                       |   6 +-
 net/bridge/br_if.c                                 |   6 +-
 net/bridge/netfilter/nf_conntrack_bridge.c         |   2 +-
 net/core/dev.c                                     |  62 +++-
 net/core/filter.c                                  | 138 ++++++--
 net/core/gro.c                                     |  31 +-
 net/core/lwt_bpf.c                                 |  57 +++-
 net/core/net_namespace.c                           |  17 +-
 net/core/skbuff.c                                  |  65 +++-
 net/core/sock.c                                    |   4 +-
 net/core/sock_reuseport.c                          |  26 +-
 net/ipv4/af_inet.c                                 |  10 +-
 net/ipv4/esp4_offload.c                            |   1 +
 net/ipv4/fib_trie.c                                |  14 +-
 net/ipv4/fou_core.c                                |  31 +-
 net/ipv4/igmp.c                                    |   2 +
 net/ipv4/inet_connection_sock.c                    |  29 +-
 net/ipv4/inet_hashtables.c                         |  11 +
 net/ipv4/inet_timewait_sock.c                      |   6 +-
 net/ipv4/ip_output.c                               |   8 +-
 net/ipv4/ip_tunnel.c                               |   6 +-
 net/ipv4/ipmr.c                                    | 104 +++---
 net/ipv4/netfilter/arp_tables.c                    |   5 +-
 net/ipv4/netfilter/ip_tables.c                     |   5 +-
 net/ipv4/netfilter/nf_reject_ipv4.c                |  12 +
 net/ipv4/raw.c                                     |  15 +-
 net/ipv4/route.c                                   |  36 ++-
 net/ipv4/tcp.c                                     |  16 +-
 net/ipv4/tcp_fastopen.c                            |   2 +
 net/ipv4/tcp_input.c                               |  80 ++++-
 net/ipv4/tcp_ipv4.c                                |  25 +-
 net/ipv4/tcp_metrics.c                             |   3 +-
 net/ipv4/tcp_minisocks.c                           |   2 +-
 net/ipv4/udp.c                                     |   5 +-
 net/ipv4/udp_offload.c                             |  10 +-
 net/ipv4/udp_tunnel_core.c                         |   6 +-
 net/ipv6/calipso.c                                 |  12 +-
 net/ipv6/esp6_offload.c                            |   1 +
 net/ipv6/exthdrs.c                                 |   5 +-
 net/ipv6/exthdrs_core.c                            |   7 +-
 net/ipv6/icmp.c                                    |   7 +-
 net/ipv6/ip6_fib.c                                 |  50 ++-
 net/ipv6/ip6_output.c                              |  13 +-
 net/ipv6/ip6mr.c                                   | 112 ++++---
 net/ipv6/mip6.c                                    |   9 +-
 net/ipv6/netfilter/ip6_tables.c                    |   5 +-
 net/ipv6/netfilter/nf_reject_ipv6.c                |  13 +
 net/ipv6/raw.c                                     |  15 +-
 net/ipv6/route.c                                   |  54 +++-
 net/ipv6/seg6_iptunnel.c                           |  46 ++-
 net/ipv6/seg6_local.c                              | 124 ++++++--
 net/ipv6/tcp_ipv6.c                                |   9 +-
 net/ipv6/udp.c                                     |   5 +-
 net/iucv/af_iucv.c                                 |   9 +
 net/mac80211/airtime.c                             |   2 +
 net/mac80211/ibss.c                                |  27 +-
 net/mac80211/ieee80211_i.h                         |   3 +
 net/mac80211/link.c                                |  13 +-
 net/mac80211/mlme.c                                |  25 +-
 net/mac80211/ocb.c                                 |  23 +-
 net/mac80211/rx.c                                  |   7 +-
 net/mac80211/tx.c                                  |   6 +
 net/mctp/af_mctp.c                                 |   2 +-
 net/mptcp/options.c                                |  12 +-
 net/mptcp/protocol.c                               |   5 +-
 net/netfilter/ipvs/ip_vs_app.c                     |   2 +-
 net/netfilter/ipvs/ip_vs_core.c                    |  12 +-
 net/netfilter/nf_conntrack_sip.c                   |   4 +-
 net/netfilter/nf_dup_netdev.c                      |   1 +
 net/netfilter/nf_flow_table_core.c                 |   1 +
 net/netfilter/nf_nat_masquerade.c                  |   4 +-
 net/netfilter/nf_queue.c                           |   1 +
 net/netfilter/nf_tables_api.c                      |  21 +-
 net/netfilter/nf_tables_offload.c                  |   3 +
 net/netfilter/nfnetlink_queue.c                    |  17 +-
 net/netfilter/nft_fwd_netdev.c                     |   1 +
 net/netfilter/nft_set_rbtree.c                     |   3 +-
 net/netfilter/xt_NETMAP.c                          |   4 +-
 net/netfilter/xt_recent.c                          |   7 +-
 net/netlink/af_netlink.c                           |   3 +-
 net/nsh/nsh.c                                      |   7 +
 net/openvswitch/flow.c                             |  19 +-
 net/rds/rdma.c                                     |   5 +-
 net/sched/act_ife.c                                |  13 +-
 net/sched/sch_teql.c                               |   9 +-
 net/sctp/sm_make_chunk.c                           |  43 +--
 net/sctp/sm_statefuns.c                            |  16 +-
 net/sctp/socket.c                                  |   2 +-
 net/sctp/stream.c                                  |   2 +
 net/sctp/stream_interleave.c                       |  38 +--
 net/smc/af_smc.c                                   |  21 +-
 net/smc/smc.h                                      |   1 +
 net/smc/smc_close.c                                |  14 +
 net/smc/smc_core.c                                 |  86 +++--
 net/smc/smc_core.h                                 |   6 +-
 net/smc/smc_diag.c                                 |  12 +-
 net/smc/smc_sysctl.c                               |   6 +-
 net/socket.c                                       |  11 +-
 net/sunrpc/clnt.c                                  | 108 +++++--
 net/sunrpc/rpc_pipe.c                              |   3 +-
 net/sunrpc/sunrpc.h                                |   8 +
 net/sunrpc/xprt.c                                  | 107 ++++++-
 net/sunrpc/xprtrdma/frwr_ops.c                     |  89 ++++--
 net/sunrpc/xprtrdma/transport.c                    |   2 +
 net/sunrpc/xprtrdma/verbs.c                        |  16 +-
 net/sunrpc/xprtrdma/xprt_rdma.h                    |  10 +-
 net/sunrpc/xprtsock.c                              |   2 +-
 net/tipc/bearer.c                                  |  33 ++
 net/tls/tls_sw.c                                   |  93 ++++--
 net/unix/af_unix.c                                 |   1 +
 net/unix/garbage.c                                 |  31 +-
 net/vmw_vsock/af_vsock.c                           |   3 +-
 net/vmw_vsock/hyperv_transport.c                   |   3 +
 net/vmw_vsock/virtio_transport.c                   |  16 +-
 net/wireless/core.c                                |   2 +-
 net/wireless/scan.c                                |   3 +-
 net/wireless/util.c                                |   6 +-
 net/wireless/wext-core.c                           |  33 +-
 net/xdp/xsk.c                                      |  23 +-
 net/xfrm/xfrm_iptfs.c                              |   3 +-
 net/xfrm/xfrm_replay.c                             |   6 +-
 net/xfrm/xfrm_state.c                              |  98 +++++-
 net/xfrm/xfrm_user.c                               |  49 +--
 scripts/Makefile.autofdo                           |   2 +-
 security/keys/key.c                                |  10 +-
 security/keys/keyctl.c                             |   2 -
 security/keys/keyctl_pkey.c                        | 100 ++++--
 security/keys/keyring.c                            |  25 +-
 security/keys/request_key.c                        |  14 +-
 sound/core/memalloc.c                              |   2 +-
 sound/firewire/tascam/tascam-stream.c              |   4 +-
 sound/hda/codecs/cirrus/cs420x.c                   |   2 -
 sound/hda/codecs/realtek/alc269.c                  |  31 +-
 sound/hda/codecs/realtek/alc882.c                  |  10 +
 sound/hda/codecs/side-codecs/cs35l56_hda.c         |  14 +-
 sound/hda/codecs/side-codecs/tas2781_hda.c         |   4 +-
 sound/hda/common/sysfs.c                           |   5 +-
 sound/hda/core/controller.c                        |  15 +-
 sound/pci/Kconfig                                  |   1 +
 sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c      |  16 +-
 sound/soc/amd/ps/pci-ps.c                          |  32 +-
 sound/soc/apple/mca.c                              |  10 +-
 sound/soc/codecs/es9356.c                          |   4 +-
 sound/soc/codecs/lpass-rx-macro.c                  |   2 +-
 sound/soc/codecs/max98090.c                        |  22 +-
 sound/soc/codecs/tas2770.c                         |   9 +
 sound/soc/codecs/tas2770.h                         |   4 +-
 sound/soc/codecs/wm_adsp.c                         |  10 +
 sound/soc/meson/axg-fifo.c                         |  30 +-
 sound/soc/qcom/common.c                            |  61 +++-
 sound/soc/qcom/common.h                            |   3 +
 sound/soc/qcom/qdsp6/q6asm-dai.c                   |   3 +
 sound/soc/qcom/qdsp6/q6asm.c                       |   2 +
 sound/soc/qcom/x1e80100.c                          |  18 ++
 sound/soc/rockchip/Kconfig                         |   5 +
 sound/soc/soc-core.c                               |  16 +
 sound/soc/sof/amd/acp.c                            |  32 +-
 sound/soc/sof/ipc4-topology.c                      |   2 +-
 sound/usb/caiaq/device.c                           |  11 +-
 sound/usb/pcm.c                                    |   6 +
 tools/bootconfig/main.c                            |  29 +-
 tools/bootconfig/samples/exp-good-mixed-kv1.bconf  |   5 +
 tools/bootconfig/samples/good-mixed-kv1.bconf      |   5 +
 tools/bootconfig/test-bootconfig.sh                |  18 ++
 tools/sched_ext/include/scx/common.bpf.h           |   1 +
 tools/sched_ext/include/scx/compat.bpf.h           |   6 +
 .../selftests/bpf/progs/verifier_live_stack.c      |  12 +-
 .../selftests/bpf/progs/verifier_may_goto_1.c      |   1 +
 tools/testing/selftests/cgroup/test_cpuset_prs.sh  |  18 ++
 .../ftrace/test.d/dynevent/fprobe_syntax_errors.tc |   4 +-
 .../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc |   2 +-
 .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc   |   2 +-
 tools/testing/selftests/mm/merge.c                 |  33 +-
 .../tcp_bidir_fast_retransmit_nosack.pkt           |  42 +++
 tools/testing/selftests/net/tls.c                  |   3 +
 870 files changed, 13531 insertions(+), 5610 deletions(-)
author maintainer
#1 lore raw

PATCH 1/1005 tun: clear stale skb->protocol of NAPI frags skbs

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit 3287cd714a853d9443c4a743eca010aedcfbbcdd ]

With IFF_NAPI_FRAGS, tun_napi_alloc_frags() gets its skb from napi_get_frags(). If GRO merged the previous frame with GRO_MERGED_FREE, that skb was recycled by napi_reuse_skb(), which does not reset skb->protocol set by napi_frags_skb() for the previous frame.

tun_get_user() calls tun_vnet_hdr_tnl_to_skb() before eth_type_trans(), so the virtio header checks see the protocol of the previous frame:
GSO packets without VIRTIO_NET_HDR_F_NEEDS_CSUM are dissected with the wrong protocol. A following change checks the outer protocol of UDP tunnel GSO packets, which would then reject a valid frame when the two ethertypes differ.

This needs GRO to hold packets across writes, and IFF_NAPI_FRAGS needs CAP_NET_ADMIN.

Clear skb->protocol in tun_napi_alloc_frags(), like skbs allocated by tun_alloc_skb() or build_skb(). eth_type_trans() sets it later.

---
 drivers/net/tun.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/tun.c +6 -0
index 2ed348b953159..8a5ffd6904891 100644
@@ -1500,6 +1500,12 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile,
 	if (!skb)
 		return ERR_PTR(-ENOMEM);
 
+	/* An skb recycled by napi_reuse_skb() keeps the protocol of a
+	 * previous frame. eth_type_trans() sets it after the virtio
+	 * header checks, which must not see a stale one.
+	 */
+	skb->protocol = 0;
+
 	linear = iov_iter_single_seg_count(it);
 	err = __skb_grow(skb, linear);
 	if (err)
Signature · 1 line
2.53.0
author maintainer
#2 lore raw

PATCH 2/1005 net: virtio: validate outer protocol of UDP tunnel GSO packets

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit 73e08d50eb139e7329032c89a4cb105cf43ef278 ]

virtio_net_hdr_tnl_to_skb() trusts the virtio header to describe a UDP tunnel over IPv4 or IPv6, but never checks that the frame actually carries such outer headers. Because VIRTIO_NET_HDR_F_NEEDS_CSUM is mandatory for tunnel GSO, __virtio_net_hdr_to_skb() skips the flow dissector, so virtio_net_hdr_match_proto() is never applied either.

A guest (or a tap writer) can then inject a frame with an arbitrary outer ethertype, for example ETH_P_NSH, with SKB_GSO_UDP_TUNNEL set. The GSO stack then runs nsh_gso_segment() on top of the UDP tunnel segmentation, which assumes a different header layout. The result is segments with skb->data before skb->head, and a host crash in skb_under_panic() as soon as a later layer pushes a header:

skbuff: skb_under_panic: ... put:4 ... dev:gretap1 kernel BUG at net/core/skbuff.c:215!
skb_push
__gre_xmit
gre_tap_xmit
...
tun_get_user

Validate the outer headers with the parsing helpers from Michael's series "net: resolve uncommon partial checksums at ingress":

- locate the L3 header: Ethernet with optional VLAN tags, or the network header set by the caller. skb->protocol is not trusted when it disagrees with the frame.
- require the outer L3 protocol to match the declared tunnel type.
- require the outer UDP header exactly at outer_th_offset, after IPv4 options or IPv6 extension headers, and reject fragments.

Unlike the original helpers:

- the callers tell whether the frame starts with an Ethernet header, with a new has_eth argument of virtio_net_hdr_tnl_to_skb(), instead of using the device type. tun frames packets from its IFF_TAP and IFF_TUN flags, and TUNSETLINK can set the device type to any value. virtio_net and tun_xdp_one() always pass true, tun_get_user() passes whether the device is IFF_TAP.
- ipv6_find_hdr() stops at an AH header, as Willem suggested in the review of that series.

---
 drivers/net/tun.c          |   9 +-
 drivers/net/tun_vnet.h     |   5 +-
 drivers/net/virtio_net.c   |   2 +-
 include/linux/virtio_net.h | 169 +++++++++++++++++++++++++++++++++++++
 4 files changed, 180 insertions(+), 5 deletions(-)
drivers/net/tun.c +7 -2
index 8a5ffd6904891..dfdc4b5bd27f8 100644
@@ -1949,7 +1949,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 		break;
 	}
 
-	if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, &hdr)) {
+	if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, &hdr,
+				    (tun->flags & TUN_TYPE_MASK) == IFF_TAP)) {
 		atomic_long_inc(&tun->rx_frame_errors);
 		err = -EINVAL;
 		goto free_skb;
@@ -2625,7 +2626,11 @@ static int tun_xdp_one(struct tun_struct *tun,
 	tnl_hdr = (struct virtio_net_hdr_v1_hash_tunnel *)gso;
 	skb->dev = tun->dev;
 	skb_set_network_header(skb, ETH_HLEN);
-	if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, tnl_hdr)) {
+	/* Frames always start with an Ethernet header here, as the
+	 * eth_type_trans() call below expects.
+	 */
+	if (tun_vnet_hdr_tnl_to_skb(tun->flags, features, skb, tnl_hdr,
+				    true)) {
 		atomic_long_inc(&tun->rx_frame_errors);
 		kfree_skb(skb);
 		ret = -EINVAL;
drivers/net/tun_vnet.h +3 -2
index f4c652b1fa44d..3364e08dd6e08 100644
@@ -197,9 +197,10 @@ static inline netdev_features_t tun_vnet_hdr_guest_features(int vnet_hdr_sz)
 static inline int
 tun_vnet_hdr_tnl_to_skb(unsigned int flags, netdev_features_t features,
 			struct sk_buff *skb,
-			const struct virtio_net_hdr_v1_hash_tunnel *hdr)
+			const struct virtio_net_hdr_v1_hash_tunnel *hdr,
+			bool has_eth)
 {
-	return virtio_net_hdr_tnl_to_skb(skb, hdr,
+	return virtio_net_hdr_tnl_to_skb(skb, hdr, has_eth,
 				features & NETIF_F_GSO_UDP_TUNNEL,
 				features & NETIF_F_GSO_UDP_TUNNEL_CSUM,
 				tun_vnet_is_little_endian(flags));
drivers/net/virtio_net.c +1 -1
index 584bc05c577c7..9d92d318e2fae 100644
@@ -2520,7 +2520,7 @@ static void virtnet_receive_done(struct virtnet_info *vi, struct receive_queue *
 
 	skb->dev = dev;
 	skb_set_network_header(skb, ETH_HLEN);
-	if (virtio_net_hdr_tnl_to_skb(skb, &hdr->tnl_hdr, vi->rx_tnl,
+	if (virtio_net_hdr_tnl_to_skb(skb, &hdr->tnl_hdr, true, vi->rx_tnl,
 				      vi->rx_tnl_csum,
 				      virtio_is_little_endian(vi->vdev))) {
 		net_warn_ratelimited("%s: bad gso: type: %x, size: %u, flags %x tunnel %d tnl csum %d\n",
include/linux/virtio_net.h +169 -0

197 lines not on this page · raw message

Signature · 1 line
2.53.0
author maintainer
#3 lore raw

PATCH 3/1005 soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11

In reply to Greg Kroah-Hartman

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

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

From: Sataporn Saijai <[email protected]>

[ Upstream commit c3133906d5bda343bd5c1d8ad63074a14506ad72 ]

The Lenovo Yoga Slim 7i 14IPH11 (DMI product 83QM) declares an RT722 on link 3 that is not actually present and never attaches, leaving the machine with no audio. Since the address is already handled by the ghost_realtek table, only the DMI match is needed.

---
 drivers/soundwire/dmi-quirks.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/soundwire/dmi-quirks.c +7 -0
index 62fa64b224123..8140f9b9db0a7 100644
@@ -221,6 +221,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = {
 		},
 		.driver_data = (void *)ghost_realtek,
 	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "83QM"),
+		},
+		.driver_data = (void *)ghost_realtek,
+	},
 	{
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
Signature · 1 line
2.53.0
author maintainer
#4 lore raw

PATCH 4/1005 soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9

In reply to Greg Kroah-Hartman

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

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

From: Charles Keepax <[email protected]>

[ Upstream commit a6a867552a36e647cbd35aceae24754c9bcd3661 ]

The Lenovo Pro 9 also has a Realtek device in the ACPI that doesn't exist in the physical hardware. This confuses the machine driver into attempting to create DAI links for the device. Add a quirk to remove this device.

---
 drivers/soundwire/dmi-quirks.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/soundwire/dmi-quirks.c +7 -0
index 8140f9b9db0a7..197b754068920 100644
@@ -242,6 +242,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = {
 		},
 		.driver_data = (void *)ghost_realtek,
 	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "83U9"),
+		},
+		.driver_data = (void *)ghost_realtek,
+	},
 	{}
 };
 
Signature · 1 line
2.53.0
author maintainer
#5 lore raw

PATCH 5/1005 soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel)

In reply to Greg Kroah-Hartman

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

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

From: Sergey Lebedev <[email protected]>

[ Upstream commit d32e04c052342d7d1cc03f6ba4cbd135cd0112bc ]

The Microsoft Surface Pro 11 for Business (Intel, Lunar Lake) carries a single physical RT1320 amplifier on link 0 and describes it twice:

  SWRA  _ADR 0x000030025D132000   SDCA class 0
  SWRB  _ADR 0x000030025D132001   SDCA class 1

Identical apart from the class id: same link, same manufacturer, part and version, same unique id 0. The part reports class 1, so only SWRB enumerates. SWRA never attaches on any boot or firmware version tested, including the November 2025 bundle.

The ghost is not harmless. It consumes an amplifier index in find_acpi_adr_device(), so the real part is named "rt1320-2" and the stock sof-soundwire UCM profile enables switches on a device that is not there. Its endpoints also reach create_sdw_dailink(), which builds DAI link names from link id and function type alone; the ghost declares the same SmartMic function as the real part, so the card fails to register at all:

sysfs: cannot create duplicate filename

    '.../sof_sdw/SDW0-Capture-SmartMic'

kobject_add_internal failed for SDW0-Capture-SmartMic with -EEXIST sof_sdw sof_sdw: probe with driver sof_sdw failed with error -12

Remap its _ADR to zero so sdw_acpi_find_slaves() never creates the peripheral, which is how ghost devices are handled already - see ghost_realtek and global_ghost_adr in this file. Both failures then disappear, because neither path is reached.

Matched on DMI_PRODUCT_SKU rather than the product name. A later batch of the same model could carry a different RT1320 version, which would change the _ADR; keying on the SKU keeps this remap to the hardware it was verified on, and follows dell_sku_0A3E above.

---
 drivers/soundwire/dmi-quirks.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
drivers/soundwire/dmi-quirks.c +28 -0
index 197b754068920..0daa877cd9055 100644
@@ -111,6 +111,25 @@ static const struct adr_remap ghost_realtek[] = {
 	{}
 };
 
+/*
+ * The Microsoft Surface Pro 11 (Intel) describes its single physical RT1320
+ * amplifier twice on link 0, as two _ADR entries differing only in SDCA class
+ * id and sharing the same unique id. Only the class 1 entry enumerates; the
+ * class 0 entry is a ghost.
+ *
+ * Matched on the product SKU rather than the product name: a later batch of the
+ * same model could carry a different RT1320 version, which would change the
+ * _ADR. Keying on the SKU keeps this remap to the hardware it was verified on.
+ */
+static const struct adr_remap microsoft_sp11_intel[] = {
+	/* ghost rt1320 on link0 */
+	{
+		0x000030025d132000ull,
+		0x0000000000000000ull
+	},
+	{}
+};
+
 static const struct dmi_system_id adr_remap_quirk_table[] = {
 	/* TGL devices */
 	{
@@ -249,6 +268,15 @@ static const struct dmi_system_id adr_remap_quirk_table[] = {
 		},
 		.driver_data = (void *)ghost_realtek,
 	},
+	/* LNL devices */
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_SKU,
+					"Surface_Pro_11th_Edition_With_Intel_For_Business_2103")
+		},
+		.driver_data = (void *)microsoft_sp11_intel,
+	},
 	{}
 };
 
Signature · 1 line
2.53.0
author maintainer
#6 lore raw

PATCH 6/1005 mm/slub: refill prefilled sheaves from the barn

In reply to Greg Kroah-Hartman

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

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

From: Hao Li <[email protected]>

commit 1b87ea06a34b213e45e3e0c4effd5043f15046ed upstream.

Currently, when the prefill API refills a non-full sheaf, it takes the objects from partial slabs and never from the full sheaves in the barn, so once the barn's full list becomes saturated, it stays saturated.

For objects freed via kfree_rcu(), every RCU sheaf then has to be flushed to slabs because the barn's full list has no room.

To fix this, let the sheaf refill from the barn first, and introduce a partial sheaf in the barn, which holds the leftover objects [1].

Only the prefill path needs the partial sheaf. The generic allocation path (__pcs_replace_empty_main()) exchanges an empty sheaf for a full one from the barn, so nothing is left over. The prefill path refills a sheaf that is not necessarily empty, so taking objects from the barn usually leaves leftovers, and the partial sheaf is where they are kept. refill_sheaf() only takes objects from partial slabs and never involves the partial sheaf.

The sheaf is refilled by copying objects from the partial sheaf, and then from a full sheaf taken from the barn if it is still not full. A sheaf that objects were copied from stays in the barn as the partial sheaf if it still holds objects, or goes on the empty list if it is empty. The sheaf being refilled is never replaced.

The gain comes from two sides: every full sheaf taken out makes room on the barn's full list for a future RCU sheaf, and refilling from the barn is cheaper than refilling from partial slabs under list_lock.

Note that putting the sheaf with the leftover objects on the full list instead would not work: it would occupy room on the full list, so the list would stay saturated and rcu_free_sheaf() would still keep flushing.

An earlier version of this patch swapped sheaves instead, to minimize the memcpy overhead. As Harry Yoo pointed out [2], replacing the caller's sheaf loses cache affinity, filling it directly is more straightforward, and testing showed no measurable difference between the two approaches, so the approach he suggested is used.

Tested with will-it-scale mmap1 (192 processes, one-minute runs) on the maple_node cache.

throughput: 27778727 -> 34500556 (+24.2%)

metric baseline patched change
=====================================================================
alloc_fastpath 54,124 56,696 +4.75%
alloc_slab 7,100,651 159,739 -97.75%

barn_get                          849       194,460,392    +22904539.81%
barn_get_fail                       2               217    +10750.00%
barn_put                          851       182,306,701    +21422544.07%
barn_put_fail             260,400,484       145,522,675       -44.12%
cmpxchg_double_fail         1,029,204           334,228       -67.53%
free_add_partial          326,694,687       181,935,790       -44.31%
free_fastpath                  13,297            15,611       +17.40%
free_rcu_sheaf          8,332,839,104    10,490,535,227       +25.89%
free_remove_partial         7,099,788           158,297       -97.77%
free_slab                   7,099,788           158,297       -97.77%
free_slowpath              10,969,156           782,851       -92.86%
objects                        15,295            14,849        -2.92%
objects_partial                15,295            14,849        -2.92%

partial 1,604 2,336 +45.64%
sheaf_alloc 137,757,895 141,208,076 +2.50%
sheaf_flush 8,332,823,922 4,656,725,764 -44.12%
sheaf_free 137,757,883 141,208,072 +2.50%

sheaf_prefill_fast      3,337,502,163     4,196,506,116       +25.74%
sheaf_prefill_slow                685               400       -41.61%
sheaf_refill            8,343,794,364     4,657,509,724       -44.18%
sheaf_return_fast       3,337,502,411     4,196,506,382       +25.74%
sheaf_return_slow                 437               134       -69.34%
slabs                           1,604             2,336       +45.64%
total_objects                 102,656           149,504       +45.64%

Here is what the important metric changes mean.

barn_get and barn_put: refills now take full sheaves out of the barn, and RCU sheaves are put into the barn again. Before, the barn's full list was saturated once and hardly ever consumed.

barn_put_fail: more than half of the RCU sheaves are now put into the barn instead of being flushed. The rest are still flushed because they arrive while the barn's full list is at its limit.

sheaf_refill and free_add_partial: fewer objects are taken from partial slabs to refill sheaves, and fewer slabs are added to the partial list, by the same percentage.

alloc_slab and free_slab: the partial list is almost never empty when a refill looks at it, so slabs are almost never allocated and freed again only to serve refills.

After the test, the maple_node cache holds 1604 slabs without the patch and 2336 with it. After a manual shrink
(echo 1 > /sys/kernel/slab/maple_node/shrink), it holds 485 without the patch and 563 with it. So most of the extra slabs are held only by objects sitting in sheaves and are returned by a shrink, and what remains is a small difference, because objects handed out from the barn come from many more slabs than a refill from partial slabs would use.

---
 mm/slub.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
mm/slub.c +81 -0
index 6bb75db087a2d..41a66fc15edf8 100644
@@ -422,6 +422,7 @@ struct node_barn {
 	spinlock_t lock;
 	struct list_head sheaves_full;
 	struct list_head sheaves_empty;
+	struct slab_sheaf *sheaf_partial;
 	unsigned int nr_full;
 	unsigned int nr_empty;
 };
@@ -3298,6 +3299,7 @@ static void barn_init(struct node_barn *barn)
 	spin_lock_init(&barn->lock);
 	INIT_LIST_HEAD(&barn->sheaves_full);
 	INIT_LIST_HEAD(&barn->sheaves_empty);
+	barn->sheaf_partial = NULL;
 	barn->nr_full = 0;
 	barn->nr_empty = 0;
 }
@@ -3315,6 +3317,10 @@ static void barn_shrink(struct kmem_cache *s, struct node_barn *barn)
 	barn->nr_full = 0;
 	list_splice_init(&barn->sheaves_empty, &empty_list);
 	barn->nr_empty = 0;
+	if (barn->sheaf_partial) {
+		list_add(&barn->sheaf_partial->barn_list, &full_list);
+		barn->sheaf_partial = NULL;
+	}
 
 	spin_unlock_irqrestore(&barn->lock, flags);
 
@@ -5073,12 +5079,87 @@ void *kmem_cache_alloc_node_noprof(struct kmem_cache *s, gfp_t gfpflags, int nod
 }
 EXPORT_SYMBOL(kmem_cache_alloc_node_noprof);
 
+/*
+ * Refill @sheaf from the barn: from its partial sheaf first, then from its full
+ * sheaves. A sheaf that objects were copied from stays in the barn as the
+ * partial sheaf if it still holds objects, or goes on the empty list if it is
+ * empty.
+ *
+ * Returns true if the sheaf is now full, at s->sheaf_capacity.
+ * Returns false if the sheaf is still not full.
+ */
+static bool refill_sheaf_from_barn(struct kmem_cache *s,
+				   struct slab_sheaf *sheaf)
+{
+	struct node_barn *barn = get_barn(s);
+	struct slab_sheaf *src;
+	unsigned int to_move;
+	unsigned long flags;
+
+	if (!barn)
+		return false;
+
+	if (!data_race(barn->nr_full) && !data_race(barn->sheaf_partial))
+		return false;
+
+	spin_lock_irqsave(&barn->lock, flags);
+
+	/*
+	 * The partial sheaf can hold fewer objects than @sheaf needs to
+	 * reach capacity, and a sheaf on the full list is not necessarily
+	 * full (see the comment in rcu_free_sheaf()), so keep taking from
+	 * the barn until @sheaf is full or nothing is left.
+	 */
+	while (sheaf->size < s->sheaf_capacity) {
+		src = barn->sheaf_partial;
+		barn->sheaf_partial = NULL;
+		if (!src) {
+			if (!barn->nr_full)
+				break;
+			src = list_first_entry(&barn->sheaves_full,
+					       struct slab_sheaf, barn_list);
+			list_del(&src->barn_list);
+			barn->nr_full--;
+		}
+
+		to_move = min(s->sheaf_capacity - sheaf->size, src->size);
+		src->size -= to_move;
+		memcpy(&sheaf->objects[sheaf->size], &src->objects[src->size],
+		       to_move * sizeof(void *));
+		sheaf->size += to_move;
+
+		if (src->size) {
+			barn->sheaf_partial = src;
+		} else {
+			/*
+			 * No empty-limit check: the sheaf put on the empty list
+			 * was already in the barn, so the barn holds no more
+			 * sheaves than before. barn_replace_empty_sheaf() skips
+			 * the check for the same reason.
+			 */
+			list_add(&src->barn_list, &barn->sheaves_empty);
+			barn->nr_empty++;
+		}
+	}
+
+	spin_unlock_irqrestore(&barn->lock, flags);
+
+	if (sheaf->size < s->sheaf_capacity)
+		return false;
+
+	stat(s, BARN_GET);
+	return true;
+}
+
 static int __prefill_sheaf_pfmemalloc(struct kmem_cache *s,
 				      struct slab_sheaf *sheaf, gfp_t gfp)
 {
 	gfp_t gfp_nomemalloc;
 	int ret;
 
+	if (refill_sheaf_from_barn(s, sheaf))
+		return 0;
+
 	gfp_nomemalloc = gfp | __GFP_NOMEMALLOC;
 	if (gfp_pfmemalloc_allowed(gfp))
 		gfp_nomemalloc |= __GFP_NOWARN;
Signature · 1 line
2.53.0
author maintainer
#7 lore raw

PATCH 7/1005 ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250)

In reply to Greg Kroah-Hartman

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

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

From: Matthias Dittrich <[email protected]>

[ Upstream commit a0039113053d4d3f629ea1b9cd74130ca597f14a ]

The Acer Swift 3 SF314-56G (with NVIDIA GeForce MX250) suffers from the same ACPI power resource regression as the Thunderobot ZERO. The power resource controlling the dGPU is incorrectly turned off during initialization, causing the GPU to fall off the bus (D3cold).

This commit adds a DMI quirk to keep the power resource on for this model, similar to the existing Thunderobot quirk.

Tested on Acer Swift 3 SF314-56G with NVIDIA MX250.

---
 drivers/acpi/power.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/acpi/power.c +13 -0
index 23a4e207a01eb..c6955d1ad29db 100644
@@ -1120,6 +1120,19 @@ static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "ZERO"),
 		}
 
+	},
+	{
+		/*
+		 * Acer Swift 3 SF314-56G with NVIDIA MX250 suffers from the
+		 * same ACPI power resource regression as the Thunderobot ZERO.
+		 * The power resource controlling the dGPU is incorrectly turned off
+		 * during initialization, causing the GPU to fall off the bus (D3cold).
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Swift SF314-56G"),
+		}
+
 	},
 	{}
 };
Signature · 1 line
2.53.0
author maintainer
#8 lore raw

PATCH 8/1005 ACPI: PM: Add unused power resource quirk for Casper Excalibur G900

In reply to Greg Kroah-Hartman

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

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

From: Hakan Abay <[email protected]>

[ Upstream commit 23ec17231cc6a83bb11d8660db5bfc5336f53a0e ]

On the Casper Excalibur G900, the NVIDIA discrete GPU and the second NVMe device become inaccessible when unused ACPI power resources are turned off during initialization.

The failure is similar to the THUNDEROBOT ZERO case addressed by
commit cd7ef20ba8c6 ("ACPI: PM: Add unused power resource quirk for THUNDEROBOT ZERO").

Without the quirk, the NVIDIA GPU and the second NVMe device are left inaccessible in D3cold and attempts to transition them back to D0 fail.

Add a DMI quirk for the affected Casper Excalibur G900 with NLCC 001 mainboard to leave unused ACPI power resources on.

With the quirk applied, the second NVMe device remains accessible. The NVIDIA GPU can enter D3cold while idle and subsequently return to D0 for accelerated rendering.

---
 drivers/acpi/power.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/acpi/power.c +12 -0
index c6955d1ad29db..34b73f320b184 100644
@@ -1134,6 +1134,18 @@ static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = {
 		}
 
 	},
+	{
+		/*
+		 * CASPER EXCALIBUR G900 laptop: Keep unused ACPI power
+		 * resources on to prevent the NVIDIA dGPU and NVMe #2
+		 * from becoming inaccessible.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "CASPER BILGISAYAR SISTEMLERI"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "EXCALIBUR G900"),
+			DMI_MATCH(DMI_BOARD_NAME, "NLCC 001"),
+		},
+	},
 	{}
 };
 
Signature · 1 line
2.53.0
author maintainer
#9 lore raw

PATCH 9/1005 ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]

In reply to Greg Kroah-Hartman

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

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

From: Krittikun Wongnin <[email protected]>

[ Upstream commit 8eb2754ef96d77d870d6b1ef1e0e8470c892b6b4 ]

On the Acer Aspire A515-53G (Whiskey Lake + NVIDIA GeForce MX230), the dGPU behind root port RP05 (00:1c.4) falls off the bus during boot and is unusable until the next power cycle:

nvidia 0000:02:00.0: Unable to change power state from D3cold to D0, device inaccessible
NVRM: The NVIDIA GPU 0000:02:00.0 ... has fallen off the bus

The firmware ships two SSDTs which both provide power management for the dGPU:

- One SSDT defines \_SB.PCI0.RP05.PC01 together with RP05._PR0/_PR2/_PR3 = { PC01 }.

- A second SSDT defines \_SB.PCI0.RP05.PCRP (_STA initially One, _OFF calls \_SB.PCI0.HGOF, which puts the link into L2/L3 and drops the dGPU power enable GPIO) and its own RP05._PR0/_PR2/_PR3/_S0W. The latter fail to load:

ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.RP05._PR0], AE_ALREADY_EXISTS

As a result PCRP is not referenced by any device and acpi_turn_off_unused_power_resources() turns it off right after the ACPI namespace scan. This cuts power to the dGPU, but PC01 still believes it is on, so its _ON method is a no-op when the PCI core later tries to bring the GPU back to D0.

Windows does not turn off unused power resources, so the dGPU works there.

Add the machine to dmi_leave_unused_power_resources_on[], like the THUNDEROBOT ZERO which has a similar SSDT bug. With this change the dGPU stays on the bus and the nvidia driver binds. Runtime PM of the dGPU is unaffected, as it is handled through PC01: with no driver bound and power/control set to auto, RP05 reaches D3cold and the GPU comes back to D0 on resume.

---
 drivers/acpi/power.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/acpi/power.c +13 -0
index 34b73f320b184..c77342a584f0c 100644
@@ -1146,6 +1146,19 @@ static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = {
 			DMI_MATCH(DMI_BOARD_NAME, "NLCC 001"),
 		},
 	},
+	{
+		/*
+		 * Acer Aspire A515-53G: Two SSDTs both define power resources
+		 * for the dGPU root port RP05 ('PC01' and 'PCRP'). Only PC01 ends
+		 * up in RP05's _PR0/_PR3, so 'PCRP' is shut down on
+		 * initialization, cutting power to the NVIDIA dGPU behind the
+		 * back of 'PC01' and making the dGPU unavailable.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A515-53G"),
+		},
+	},
 	{}
 };
 
Signature · 1 line
2.53.0
author maintainer
#10 lore raw

PATCH 10/1005 ALSA: hda/tas2781: Prevent throwing away custom calibration addresses

In reply to Greg Kroah-Hartman

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

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

From: Antheas Kapenekakis <[email protected]>

[ Upstream commit ba39a31448857da3b848174c9130b466b3ccddba ]

The V2 UEFI spec for per-device calibration data in TAS allows for manufacturers to specify up to five custom calibration register addresses and values to optimize per-device in factory.

A basic description of the spec is found in a comment in function tas2781_apply_calib(). However, currently, for the condition of p->dspbin_typ != TASDEV_BASIC, if custom calibration addresses have been provided by the manufacturer, they are ignored and the ones listed in firmware are used.

In case the manufacturer chose to change different registers other than the default ones (r0, invr0, r0_low, pow, tlimit), this causes the UEFI calibration data to scratch different registers and cause the firmware to misbehave. This is true in the Xbox ROG Ally X, for one of the firmwares, where it pops and has audio dropouts after the calibration data is applied.

Therefore, add a new bool to indicate that UEFI supplied custom calibration addresses, and if so, use them regardless of dspbin_typ.

---
 sound/hda/codecs/side-codecs/tas2781_hda.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/hda/codecs/side-codecs/tas2781_hda.c +3 -1
index 9162173ccb105..b9b6e44f8791a 100644
@@ -89,6 +89,7 @@ static void tas2781_apply_calib(struct tasdevice_priv *p)
 		TASDEVICE_REG(0, 0x18, 0x7c),
 	};
 	unsigned int crc, oft, node_num;
+	bool custom_addr = false;
 	unsigned char *buf;
 	int i, j, k, l;
 
@@ -129,6 +130,7 @@ static void tas2781_apply_calib(struct tasdevice_priv *p)
 		for (j = 0, k = 0; j < node_num; j++) {
 			oft = j * 6 + 3;
 			if (tmp_val[oft] == TASDEV_UEFI_CALI_REG_ADDR_FLG) {
+				custom_addr = true;
 				for (i = 0; i < TASDEV_CALIB_N; i++) {
 					buf = &data[(oft + i + 1) * 4];
 					cali_reg[i] = TASDEVICE_REG(buf[1],
@@ -188,7 +190,7 @@ static void tas2781_apply_calib(struct tasdevice_priv *p)
 		}
 	}
 
-	if (p->dspbin_typ == TASDEV_BASIC) {
+	if (custom_addr || p->dspbin_typ == TASDEV_BASIC) {
 		r->r0_reg = cali_reg[0];
 		r->invr0_reg = cali_reg[1];
 		r->r0_low_reg = cali_reg[2];
Signature · 1 line
2.53.0
author maintainer
#11 lore raw

PATCH 11/1005 virtio_net: check RX buffer length before DMA sync

In reply to Greg Kroah-Hartman

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

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

From: Vladimir Petrzhikovskii <[email protected]>

[ Upstream commit 29dfa436bc488056a84ee423ba82336db453e2a6 ]

An RX queue that uses the DMA API (rq->use_page_pool_dma, for example with VIRTIO_F_ACCESS_PLATFORM) syncs each received buffer with page_pool_dma_sync_for_cpu() using the length the device wrote to the used ring, and checks that length against the posted buffer only after the sync.

With SWIOTLB bouncing (swiotlb=force, or a confidential-computing guest), the sync copies from the shared bounce buffer into the guest's private page, so an oversized length also copies the bytes the device wrote past the posted buffer over the neighbouring page pool fragments. The later check drops the packet, but the copy has already happened. A malicious device, such as a host the confidential guest does not trust, can overwrite guest kernel memory next to an RX buffer with bytes it chooses, which is enough to take an unprivileged guest process to root.

Check the length before the sync in the per-fragment loops. receive_buf() has to sync the header before the length check, because the mergeable error path reads num_buffers from it, so limit that sync to the posted length. A device that reports correct lengths sees no change.

The driver has synced with the device's length since
commit 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers"), at first in virtnet_rq_unmap(). Commit 24fbd3967f3f ("virtio_net: add page_pool support for buffer allocation") moved the sync to the page_pool call sites that this patch changes, so the patch applies to v7.1 and later. Older kernels need a separate backport that limits the sync in virtnet_rq_unmap().

Found by an LLM code review agent auditing users of the DMA API; the fix and this changelog were also written with an LLM coding assistant and reviewed by us. Reproduced in QEMU with swiotlb=force and iommu_platform=on, a test-only device change that reports a used length 64 bytes past the posted buffer and writes a marker there, and a guest kprobe module that reads the buffer after the sync: without this patch the marker reaches the guest page for small and mergeable buffers; with it the packets are dropped and counted in rx_length_errors. The virtio_net selftest basic_features.sh passes with and without mergeable buffers.

---
 drivers/net/virtio_net.c | 63 +++++++++++++++++++++++++++-------------
 1 file changed, 43 insertions(+), 20 deletions(-)
drivers/net/virtio_net.c +43 -20
index 9d92d318e2fae..3a34a1376752d 100644
@@ -790,19 +790,32 @@ static unsigned int mergeable_ctx_to_truesize(void *mrg_ctx)
 	return (unsigned long)mrg_ctx & ((1 << MRG_CTX_HEADER_SHIFT) - 1);
 }
 
-static int check_mergeable_len(struct net_device *dev, void *mrg_ctx,
-			       unsigned int len)
+/* Length of the mergeable buffer that add_recvbuf_mergeable() posted. */
+static unsigned int mergeable_ctx_to_buflen(void *mrg_ctx)
 {
-	unsigned int headroom, tailroom, room, truesize;
+	unsigned int headroom, tailroom, room;
 
-	truesize = mergeable_ctx_to_truesize(mrg_ctx);
 	headroom = mergeable_ctx_to_headroom(mrg_ctx);
 	tailroom = headroom ? sizeof(struct skb_shared_info) : 0;
 	room = SKB_DATA_ALIGN(headroom + tailroom);
 
-	if (len > truesize - room) {
-		pr_debug("%s: rx error: len %u exceeds truesize %lu\n",
-			 dev->name, len, (unsigned long)(truesize - room));
+	return mergeable_ctx_to_truesize(mrg_ctx) - room;
+}
+
+/* Length of the small buffer that add_recvbuf_small() posts. */
+static unsigned int small_buflen(const struct virtnet_info *vi)
+{
+	return vi->hdr_len + GOOD_PACKET_LEN;
+}
+
+static int check_mergeable_len(struct net_device *dev, void *mrg_ctx,
+			       unsigned int len)
+{
+	unsigned int buflen = mergeable_ctx_to_buflen(mrg_ctx);
+
+	if (len > buflen) {
+		pr_debug("%s: rx error: len %u exceeds buffer length %u\n",
+			 dev->name, len, buflen);
 		DEV_STATS_INC(dev, rx_length_errors);
 		return -1;
 	}
@@ -1795,15 +1808,15 @@ static struct page *xdp_linearize_page(struct net_device *dev,
 		p = virt_to_head_page(buf);
 		off = buf - page_address(p);
 
-		if (rq->use_page_pool_dma)
-			page_pool_dma_sync_for_cpu(rq->page_pool, p,
-						   off, buflen);
-
 		if (check_mergeable_len(dev, ctx, buflen)) {
 			page_pool_put_page(rq->page_pool, p, -1, true);
 			goto err_buf;
 		}
 
+		if (rq->use_page_pool_dma)
+			page_pool_dma_sync_for_cpu(rq->page_pool, p,
+						   off, buflen);
+
 		/* guard against a misconfigured or uncooperative backend that
 		 * is sending packet larger than the MTU.
 		 */
@@ -2158,15 +2171,15 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev,
 		page = virt_to_head_page(buf);
 		offset = buf - page_address(page);
 
-		if (rq->use_page_pool_dma)
-			page_pool_dma_sync_for_cpu(rq->page_pool, page,
-						   offset, len);
-
 		if (check_mergeable_len(dev, ctx, len)) {
 			page_pool_put_page(rq->page_pool, page, -1, true);
 			goto err;
 		}
 
+		if (rq->use_page_pool_dma)
+			page_pool_dma_sync_for_cpu(rq->page_pool, page,
+						   offset, len);
+
 		truesize = mergeable_ctx_to_truesize(ctx);
 		xdp_frags_truesz += truesize;
 
@@ -2435,15 +2448,15 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
 		u64_stats_add(&stats->bytes, len);
 		page = virt_to_head_page(buf);
 
+		if (check_mergeable_len(dev, ctx, len))
+			goto err_skb;
+
 		if (rq->use_page_pool_dma) {
 			offset = buf - page_address(page);
 			page_pool_dma_sync_for_cpu(rq->page_pool, page,
 						   offset, len);
 		}
 
-		if (check_mergeable_len(dev, ctx, len))
-			goto err_skb;
-
 		truesize = mergeable_ctx_to_truesize(ctx);
 		curr_skb  = virtnet_skb_append_frag(rq, head_skb, curr_skb, page,
 						    buf, len, truesize);
@@ -2561,12 +2574,22 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq,
 
 	/* Sync the memory before touching anything through buf,
 	 * unless virtio core did it already.
+	 *
+	 * len comes from the device and is checked against the buffer
+	 * only later, so never sync past the buffer posted to the device.
+	 * The sync still covers the header, which receive_buf() and the
+	 * mergeable drop path read. Big buffers never come from the page
+	 * pool, so a buffer here is either mergeable or small.
 	 */
 	if (rq->use_page_pool_dma) {
 		struct page *page = virt_to_head_page(buf);
 		int offset = buf - page_address(page);
+		unsigned int buflen = vi->mergeable_rx_bufs ?
+				      mergeable_ctx_to_buflen(ctx) :
+				      small_buflen(vi);
 
-		page_pool_dma_sync_for_cpu(rq->page_pool, page, offset, len);
+		page_pool_dma_sync_for_cpu(rq->page_pool, page, offset,
+					   min(len, buflen));
 	}
 
 	/* About the flags below:
@@ -2642,7 +2665,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq,
 	buf += VIRTNET_RX_PAD + xdp_headroom;
 
 	ctx = mergeable_len_to_ctx(alloc_len, xdp_headroom);
-	err = virtnet_rq_submit(rq, buf, vi->hdr_len + GOOD_PACKET_LEN, ctx, gfp);
+	err = virtnet_rq_submit(rq, buf, small_buflen(vi), ctx, gfp);
 
 	if (err < 0)
 		page_pool_put_page(rq->page_pool, virt_to_head_page(buf), -1, false);
Signature · 1 line
2.53.0
author maintainer
#12 lore raw

PATCH 12/1005 Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"

In reply to Greg Kroah-Hartman

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

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

This reverts commit 992f7f5f34f803144c9cac31d49ff853d8e861a9.

---
 .../drm/nouveau/nvkm/subdev/devinit/gf100.c   | 20 -------------------
 1 file changed, 20 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c +0 -20
index 186e09ea0cb10..5368e705e7fd6 100644
@@ -27,7 +27,6 @@
 #include <subdev/bios/init.h>
 #include <subdev/bios/pll.h>
 #include <subdev/clk/pll.h>
-#include <subdev/vga.h>
 
 int
 gf100_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)
@@ -100,25 +99,6 @@ gf100_devinit_preinit(struct nvkm_devinit *base)
 	 * can use it as a reliable way to know whether we should run devinit.
 	 */
 	base->post = ((nvkm_rd32(device, 0x2240c) & BIT(1)) == 0);
-
-	/*
-	 * However some VBIOS init sequences miss this bit. So fall back to
-	 * the nv50 method of checking if the bit is not set. Running the
-	 * VBIOS multiple times may have detrimental effects.
-	 */
-	if (base->post) {
-		u64 disable = nvkm_devinit_disable(base);
-		/* magic to detect whether or not x86 vbios code has
-		 * executed the devinit scripts to initialise the
-		 * board. only works if there's a display engine.
-		 */
-		if (!(disable & (1ULL << NVKM_ENGINE_DISP))) {
-			if (nvkm_rdvgac(device, 0, 0x00) ||
-			    nvkm_rdvgac(device, 0, 0x1a)) {
-				base->post = false;
-			}
-		}
-	}
 }
 
 static const struct nvkm_devinit_func
Signature · 1 line
2.53.0
author maintainer
#13 lore raw

PATCH 13/1005 udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()

In reply to Greg Kroah-Hartman

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

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

From: Hui Peng <[email protected]>

[ Upstream commit 49f771d14578733a350c45e34e1bc6ad14f56952 ]

In udf_load_vat() (fs/udf/super.c), validate that vat20->lengthHeader is at least sizeof(struct virtualAllocationTable20) and does not exceed the mapped buffer or VAT inode size so computing the VAT table pointer and entry count cannot underflow or read out of bounds.

---
 fs/udf/super.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
fs/udf/super.c +12 -2
index 7570506ff2dde..a81a8509524a9 100644
@@ -1329,6 +1329,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
 			(sbi->s_vat_inode->i_size - 36) >> 2;
 	} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {
 		vati = UDF_I(sbi->s_vat_inode);
+		if (sbi->s_vat_inode->i_size <
+		    sizeof(struct virtualAllocationTable20)) {
+			udf_err(sb, "Too short VAT inode size %lld\n",
+				sbi->s_vat_inode->i_size);
+			return -EFSCORRUPTED;
+		}
 		if (vati->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
 			int err = 0;
 
@@ -1346,8 +1352,12 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
 
 		map->s_type_specific.s_virtual.s_start_offset =
 			le16_to_cpu(vat20->lengthHeader);
-		if (map->s_type_specific.s_virtual.s_start_offset
-		    > sbi->s_vat_inode->i_size) {
+		if (map->s_type_specific.s_virtual.s_start_offset <
+				sizeof(struct virtualAllocationTable20) ||
+		    map->s_type_specific.s_virtual.s_start_offset >
+				sb->s_blocksize ||
+		    map->s_type_specific.s_virtual.s_start_offset >
+				sbi->s_vat_inode->i_size) {
 			udf_err(sb, "Corrupted VAT header length %u (VAT inode size %lld)\n",
 				map->s_type_specific.s_virtual.s_start_offset,
 				sbi->s_vat_inode->i_size);
Signature · 1 line
2.53.0
author maintainer
#14 lore raw

PATCH 14/1005 io_uring/napi: dont end the single NAPI busy poll early on need_resched()

In reply to Greg Kroah-Hartman

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

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

From: Cinq Prairie <[email protected]>

Commit 39c7210e970200f8b17de3767c73efe64173a95f upstream.

With a single registered NAPI, io_napi_blocking_busy_loop() hands io_napi_busy_loop_should_end() to napi_busy_loop_rcu() as loop_end and runs its own loop once, relying on __napi_busy_loop() to spin until that predicate fires. napi_busy_loop_rcu() sets NAPI_F_END_ON_RESCHED, so __napi_busy_loop() also returns on the first need_resched(). io_uring treats the return as the end of the busy poll period and sleeps in schedule_hrtimeout() for the rest of the wait timeout.

With two or more NAPIs the inner loop is single-shot and io_uring's own loop runs until its predicate is met, so busy_poll_to is honoured. The same registration therefore behaves differently for one NAPI than for several.

Make the busy poll deadline absolute, stored in io_wait_queue, so that io_napi_busy_loop_should_end() no longer depends on the start_time the napi loop snapshots on every entry. The single NAPI loop can then be re-entered after an early need_resched() exit if there is budget left, and the loop condition drops the "run once" special case. The fast path that holds the NAPI across polls is kept.

Measured on io_uring-7.4 at 9c207aa58e54, x86-64, HZ=1000, PREEMPT_DYNAMIC (lazy), no CPU isolation, low RX traffic, r8169 with one RX queue, prefer_busy_poll, busy_poll_to = wait timeout = 10 ms. "waker" is a SCHED_FIFO task pinned to the polling CPU waking every 1 ms:

  1 NAPI, waker, before:  busy 0.5-1.5 ms per 10 ms wait, ~0.8M polls/s
  1 NAPI, waker, after:   busy 10 ms per 10 ms wait,      ~16.2M polls/s
  1 NAPI, idle, before:   busy 10 ms per 10 ms wait,      ~15.3M polls/s
  1 NAPI, idle, after:    busy 10 ms per 10 ms wait,      ~16.2M polls/s

2 NAPIs, waker, before: busy 10 ms per 10 ms wait, ~7.2M polls/s
2 NAPIs, waker, after: busy 10 ms per 10 ms wait, ~7.1M polls/s

The held-NAPI fast path polls about twice as often as the single-shot path used for several NAPIs, which is why it is kept.

Fixes 8d0c12a80cde ("io-uring: add napi busy poll support")
[axboe: trim comments, drop __always_unused]
---
 io_uring/io_uring.h |  1 +
 io_uring/napi.c     | 31 ++++++++++++++-----------------
 2 files changed, 15 insertions(+), 17 deletions(-)
io_uring/io_uring.h +1 -0
index 2d6b2158605ad..0cb053aabe4b0 100644
@@ -139,6 +139,7 @@ struct io_wait_queue {
 
 #ifdef CONFIG_NET_RX_BUSY_POLL
 	ktime_t napi_busy_poll_dt;
+	ktime_t napi_busy_poll_end;
 	bool napi_prefer_busy_poll;
 #endif
 };
io_uring/napi.c +14 -17
index 7e698720cd51a..54c1b328a89d3 100644
@@ -134,19 +134,15 @@ static inline void io_napi_remove_stale(struct io_ring_ctx *ctx, bool is_stale)
 		__io_napi_remove_stale(ctx);
 }
 
-static inline bool io_napi_busy_loop_timeout(ktime_t start_time,
-					     ktime_t bp)
+static inline bool io_napi_busy_loop_timeout(struct io_wait_queue *iowq)
 {
-	if (bp) {
-		ktime_t end_time = ktime_add(start_time, bp);
-		ktime_t now = net_to_ktime(busy_loop_current_time());
-
-		return ktime_after(now, end_time);
-	}
-
-	return true;
+	if (!iowq->napi_busy_poll_dt)
+		return true;
+	return ktime_after(net_to_ktime(busy_loop_current_time()),
+			   iowq->napi_busy_poll_end);
 }
 
+/* Uses an absolute deadline, so the napi loop can be re-entered */
 static bool io_napi_busy_loop_should_end(void *data,
 					 unsigned long start_time)
 {
@@ -156,8 +152,7 @@ static bool io_napi_busy_loop_should_end(void *data,
 		return true;
 	if (io_should_wake(iowq) || io_has_work(iowq->ctx))
 		return true;
-	if (io_napi_busy_loop_timeout(net_to_ktime(start_time),
-				      iowq->napi_busy_poll_dt))
+	if (io_napi_busy_loop_timeout(iowq))
 		return true;
 
 	return false;
@@ -215,13 +210,16 @@ __io_napi_do_busy_loop(struct io_ring_ctx *ctx,
 static void io_napi_blocking_busy_loop(struct io_ring_ctx *ctx,
 				       struct io_wait_queue *iowq)
 {
-	unsigned long start_time = busy_loop_current_time();
+	ktime_t now = net_to_ktime(busy_loop_current_time());
 	bool (*loop_end)(void *, unsigned long) = NULL;
 	void *loop_end_arg = NULL;
 	bool is_stale = false;
 
-	/* Singular lists use a different napi loop end check function and are
-	 * only executed once.
+	iowq->napi_busy_poll_end = ktime_add(now, iowq->napi_busy_poll_dt);
+
+	/*
+	 * A single NAPI is held by __napi_busy_loop() for the whole spin. It
+	 * may return early on need_resched(), loop until our own deadline.
 	 */
 	if (list_is_singular(&ctx->napi_list)) {
 		loop_end = io_napi_busy_loop_should_end;
@@ -232,8 +230,7 @@ static void io_napi_blocking_busy_loop(struct io_ring_ctx *ctx,
 		do {
 			is_stale = __io_napi_do_busy_loop(ctx, loop_end,
 							  loop_end_arg);
-		} while (!io_napi_busy_loop_should_end(iowq, start_time) &&
-			 !loop_end_arg);
+		} while (!io_napi_busy_loop_should_end(iowq, 0));
 	}
 
 	io_napi_remove_stale(ctx, is_stale);
Signature · 1 line
2.53.0
author maintainer
#15 lore raw

PATCH 15/1005 io_uring: fail soft links on negative IOU_COMPLETE results

In reply to Greg Kroah-Hartman

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

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

From: Yang Xiuwei <[email protected]>

Commit 9ed19503a7b34e1ffb2b81236843204c473b0ae0 upstream.

Handlers such as fsync return IOU_COMPLETE with a negative cqe.res. The old io_req_complete() path called req_set_fail() for res < 0. After completions moved into the core, that check was dropped, so IOSQE_IO_LINK dependents kept running after the head failed.

Fixes 97b388d70b53 ("io_uring: handle completions in the core")
---
 io_uring/io_uring.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
io_uring/io_uring.c +5 -3
index 41a03979cb8bb..c6bd17cca45f2 100644
@@ -1498,9 +1498,11 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
 	ret = __io_issue_sqe(req, issue_flags, def);
 
 	if (ret == IOU_COMPLETE) {
-		/* not all handlers take care of the internal restart codes */
-		if (unlikely(req->cqe.res <= -ERESTARTSYS))
-			req->cqe.res = io_fixup_restart_res(req->cqe.res);
+		if (unlikely(req->cqe.res < 0)) {
+			if (req->cqe.res <= -ERESTARTSYS)
+				req->cqe.res = io_fixup_restart_res(req->cqe.res);
+			req_set_fail(req);
+		}
 		if (issue_flags & IO_URING_F_COMPLETE_DEFER)
 			io_req_complete_defer(req);
 		else
Signature · 1 line
2.53.0
author maintainer
#16 lore raw

PATCH 16/1005 io_uring/futex: fail soft links when cancelling a wait

In reply to Greg Kroah-Hartman

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

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

From: Yang Xiuwei <[email protected]>

Commit 9a7cbe50dd95594d6fb3c57b8454ace58d8d8d0a upstream.

__io_futex_cancel() completes the request with -ECANCELED but does not call req_set_fail(). IOSQE_IO_LINK dependents then still run.

Fixes 194bb58c6090 ("io_uring: add support for futex wake and wait")
---
 io_uring/futex.c | 1 +
 1 file changed, 1 insertion(+)
io_uring/futex.c +1 -0
index 9203998654ffb..8a85ae20964b3 100644
@@ -107,6 +107,7 @@ static bool __io_futex_cancel(struct io_kiocb *req)
 	}
 
 	hlist_del_init(&req->hash_node);
+	req_set_fail(req);
 	io_req_set_res(req, -ECANCELED, 0);
 	io_req_task_work_add(req);
 	return true;
Signature · 1 line
2.53.0
author maintainer
#17 lore raw

PATCH 17/1005 io_uring/rw: fail soft links on IOPOLL short or error IO

In reply to Greg Kroah-Hartman

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

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

From: Yang Xiuwei <[email protected]>

Commit 4d3db66c5363dcf42c3d43ebaea330ac2d1888bb upstream.

io_complete_rw_iopoll() updates cqe.res when the transfer does not match the requested length, but it does not call req_set_fail(). Soft linked requests then still run after a short or failed IOPOLL read or write.

Fixes b66ceaf324b3 ("io_uring: move iopoll reissue into regular IO path")
---
 io_uring/rw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/rw.c +3 -1
index b21daa3cfa5c2..0426c27f3c4c9 100644
@@ -603,8 +603,10 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
 
 	if (res == -EAGAIN && io_rw_should_reissue(req))
 		req->flags |= REQ_F_REISSUE | REQ_F_BL_NO_RECYCLE;
-	else if (unlikely(final_res != req->cqe.res))
+	else if (unlikely(final_res != req->cqe.res)) {
+		req_set_fail(req);
 		req->cqe.res = final_res;
+	}
 
 	/* order with io_iopoll_complete() checking ->iopoll_completed */
 	smp_store_release(&req->iopoll_completed, 1);
Signature · 1 line
2.53.0
author maintainer
#18 lore raw

PATCH 18/1005 io_uring/io-wq: show stuck workers rather than WARN on a slow exit

In reply to Greg Kroah-Hartman

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

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

From: Jens Axboe <[email protected]>

Commit d4912d6440bf6d255e1fa1c360c8ddb39d0e01bd upstream.

io_wq_exit_workers() triggers a WARN_ON_ONCE() if it has waited more than IO_URING_EXIT_WAIT_MAX for the workers to exit. That can be triggered at will, for example with an open on a FUSE mount where the server never replies to the lookup. The worker can't be canceled, and the exit waits until the server goes away.

The stack trace from the WARN isn't useful either, as it's that of the exiting task and that is always the task exit, exec, or SQPOLL thread exit path. Print a message and show the workers that are still around instead, that's where the interesting stack traces are.

---
 io_uring/io-wq.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
io_uring/io-wq.c +21 -3
index 6b93950602621..358f32888a853 100644
@@ -9,6 +9,7 @@
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/sched/signal.h>
+#include <linux/sched/debug.h>
 #include <linux/percpu.h>
 #include <linux/slab.h>
 #include <linux/rculist_nulls.h>
@@ -1444,6 +1445,22 @@ static void io_wq_cancel_tw_create(struct io_wq *wq)
 	}
 }
 
+static bool io_wq_worker_show(struct io_worker *worker, void *data)
+{
+	sched_show_task(worker->task);
+	return false;
+}
+
+/* The exit path is always the same, show what the workers are stuck on */
+static void io_wq_show_stuck_workers(struct io_wq *wq)
+{
+	pr_warn("io-wq: %s/%d stuck waiting for workers to exit\n",
+		current->comm, task_pid_nr(current));
+	rcu_read_lock();
+	io_wq_for_each_worker(wq, io_wq_worker_show, NULL);
+	rcu_read_unlock();
+}
+
 static void io_wq_exit_workers(struct io_wq *wq)
 {
 	unsigned long timeout, warn_timeout;
@@ -1465,8 +1482,8 @@ static void io_wq_exit_workers(struct io_wq *wq)
 	 *
 	 * where completely overloading the system with tons of long running
 	 * io-wq items can easily trigger the hung task timeout. Only sleep
-	 * uninterruptibly for half that time, and warn if we exceeded end
-	 * up waiting more than IO_URING_EXIT_WAIT_MAX.
+	 * uninterruptibly for half that time, and show the stuck workers if
+	 * we end up waiting more than IO_URING_EXIT_WAIT_MAX.
 	 */
 	timeout = sysctl_hung_task_timeout_secs * HZ / 2;
 	if (!timeout)
@@ -1475,7 +1492,8 @@ static void io_wq_exit_workers(struct io_wq *wq)
 	do {
 		if (wait_for_completion_timeout(&wq->worker_done, timeout))
 			break;
-		WARN_ON_ONCE(time_after(jiffies, warn_timeout));
+		if (time_after(jiffies, warn_timeout))
+			DO_ONCE_LITE(io_wq_show_stuck_workers, wq);
 	} while (1);
 
 	spin_lock_irq(&wq->hash->wait.lock);
Signature · 1 line
2.53.0
author maintainer
#19 lore raw

PATCH 19/1005 io_uring/timeout: dont rearm a multishot timeout on cancel

In reply to Greg Kroah-Hartman

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

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

From: Cheng Yongkang <[email protected]>

Commit 97d4a585db2b91d855f957be0a9f126068c5be93 upstream.

io_timeout_complete() does not check tw.cancel. When it runs from io_cancel_local_task_work(), a multishot timeout that has not reached its count still posts an IORING_CQE_F_MORE completion and rearms its timer. With a zero interval the timer expires again right away and queues new task work, so the drain keeps running it until posting a CQE fails.

Normally the CQ fills up quickly and the request then completes. But if userspace moves the CQ head far ahead of the tail, for example to cq.tail + 0x7fffffff, posting keeps succeeding and ring teardown is delayed for a long time.

Don't post another CQE or rearm the timer when tw.cancel is set, so the request completes through io_req_task_complete(), like the poll and linked timeout task work does when cancelled.

Fixes ea97f6c8558e ("io_uring: add support for multishot timeouts")
---
 io_uring/timeout.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
io_uring/timeout.c +2 -1
index 8e7a4bd7e5141..b46a50b395177 100644
@@ -115,7 +115,8 @@ static void io_timeout_complete(struct io_tw_req tw_req, io_tw_token_t tw)
 	struct io_ring_ctx *ctx = req->ctx;
 
 	if (!io_timeout_finish(timeout, data)) {
-		if (io_req_post_cqe(req, -ETIME, IORING_CQE_F_MORE)) {
+		if (!tw.cancel &&
+		    io_req_post_cqe(req, -ETIME, IORING_CQE_F_MORE)) {
 			/* re-arm timer */
 			raw_spin_lock_irq(&ctx->timeout_lock);
 			list_add(&timeout->list, ctx->timeout_list.prev);
Signature · 1 line
2.53.0
author maintainer
#20 lore raw

PATCH 20/1005 io_uring/rsrc: keep the old file when a file update fails

In reply to Greg Kroah-Hartman

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

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

From: Cheng Yongkang <[email protected]>

Commit e5a346e4309d720c47fe8331a00068608fad47dd upstream.

__io_sqe_files_update() resets the slot before it calls fget() on the new fd. If fget() fails, the fd is an io_uring file, or the node allocation fails, the update stops and reports that entry as not done, but the old file has already been removed. Later requests that use the slot fail with -EBADF, and if the old file was registered with a tag, its tag CQE is posted as if it had been removed on purpose.

Reset the slot only after the new file has been checked and its node allocated, as io_install_fixed_file() does. Removal with fd == -1 still resets the slot right away.

Fixes c3a31e605620 ("io_uring: add support for IORING_REGISTER_FILES_UPDATE")
---
 io_uring/rsrc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
io_uring/rsrc.c +4 -2
index c1ab760c4591c..d1ba00390c58d 100644
@@ -330,8 +330,6 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
 		if (i >= ctx->file_table.data.nr)
 			break;
 		i = array_index_nospec(i, ctx->file_table.data.nr);
-		if (io_reset_rsrc_node(ctx, &ctx->file_table.data, i))
-			io_file_bitmap_clear(&ctx->file_table, i);
 
 		if (fd != -1) {
 			struct file *file = fget(fd);
@@ -355,11 +353,15 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
 				fput(file);
 				break;
 			}
+			if (io_reset_rsrc_node(ctx, &ctx->file_table.data, i))
+				io_file_bitmap_clear(&ctx->file_table, i);
 			ctx->file_table.data.nodes[i] = node;
 			if (tag)
 				node->tag = tag;
 			io_fixed_file_set(node, file);
 			io_file_bitmap_set(&ctx->file_table, i);
+		} else if (io_reset_rsrc_node(ctx, &ctx->file_table.data, i)) {
+			io_file_bitmap_clear(&ctx->file_table, i);
 		}
 	}
 	return done ? done : err;
Signature · 1 line
2.53.0
author maintainer
#21 lore raw

PATCH 21/1005 io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()

In reply to Greg Kroah-Hartman

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

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

From: Siddharth Chintamaneni <[email protected]>

Commit b7322810d1870ccc0d293ad383d94ef583d5057b upstream.

io_buffers_select() passes &arg->out_len to io_provided_buffers_select() on the legacy provided-buffer path. Because callers initialize arg->max_len (from sqe->len) while leaving arg->out_len as 0, io_provided_buffers_select() sees *len == 0 and always selects the full buffer size buf->len, ignoring the user-specified sqe->len limit.

Initialize arg->out_len = arg->max_len before calling io_provided_buffers_select().

Fixes 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers")
---
 io_uring/kbuf.c | 1 +
 1 file changed, 1 insertion(+)
io_uring/kbuf.c +1 -0
index abf44f5dba26a..873d66a06b360 100644
@@ -370,6 +370,7 @@ int io_buffers_select(struct io_kiocb *req, struct buf_sel_arg *arg,
 				req->flags |= REQ_F_BUF_MORE;
 		}
 	} else {
+		arg->out_len = arg->max_len;
 		ret = io_provided_buffers_select(req, &arg->out_len, sel->buf_list, arg->iovs);
 	}
 out_unlock:
Signature · 1 line
2.53.0
author maintainer
#22 lore raw

PATCH 22/1005 io_uring/io-wq: apply the current cpuset to new workers

In reply to Greg Kroah-Hartman

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

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

From: Mikhail Malyshev <[email protected]>

Commit 0659e44ce739ecd856164c75a5325b7959a2921d upstream.

Since commit 84eacf177faa ("io_uring/io-wq: inherit cpuset of cgroup in io worker"), io_wq_create() copies the cpuset of the creating task into wq->cpu_mask, and io_init_new_worker() gives each new worker that copy. A cpuset change, or a move of the task to another cgroup, updates the workers that exist but not the copy, so workers started later run on the CPUs the cgroup had when the io-wq was created, which may since have been given to other tasks. Workers come and go for the life of the io-wq, and a worker that cpuset moved is also retired at its next idle timeout and replaced on the old CPUs.

Keep wq->cpu_mask for the affinity of the io-wq itself, all CPUs or the mask set with IORING_REGISTER_IOWQ_AFF, and intersect it with the cpuset of the worker when the worker starts, falling back to the cpuset if the two do not intersect, as __set_cpus_allowed_ptr() does. Use the same mask in the idle exit test, and go back to all CPUs when the registered affinity is removed.

Fixes 84eacf177faa ("io_uring/io-wq: inherit cpuset of cgroup in io worker")
---
 io_uring/io-wq.c | 44 +++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 5 deletions(-)
io_uring/io-wq.c +39 -5
index 358f32888a853..d2ef08d65ec89 100644
@@ -738,6 +738,34 @@ static bool io_worker_retire(struct io_wq_acct *acct, struct io_worker *worker)
 	return false;
 }
 
+/*
+ * The CPUs a worker of @wq runs on: those of the io-wq affinity that the
+ * worker's cpuset allows, or the cpuset if they have none in common, as the
+ * scheduler does with a task's requested affinity when its cpuset changes.
+ * Read the cpuset each time: it can change while the io-wq exists.
+ */
+static void io_wq_worker_cpus(struct io_wq *wq, struct task_struct *tsk,
+			      struct cpumask *cpus)
+{
+	cpuset_cpus_allowed(tsk, cpus);
+	if (cpumask_intersects(cpus, wq->cpu_mask))
+		cpumask_and(cpus, cpus, wq->cpu_mask);
+}
+
+/* Is the current worker on a CPU that a new worker would not get? */
+static bool io_wq_worker_off_cpus(struct io_wq *wq)
+{
+	cpumask_var_t cpus;
+	bool off;
+
+	if (!alloc_cpumask_var(&cpus, GFP_KERNEL))
+		return false;
+	io_wq_worker_cpus(wq, current, cpus);
+	off = !cpumask_test_cpu(raw_smp_processor_id(), cpus);
+	free_cpumask_var(cpus);
+	return off;
+}
+
 static int io_wq_worker(void *data)
 {
 	struct io_worker *worker = data;
@@ -816,8 +844,7 @@ static int io_wq_worker(void *data)
 		}
 		if (!ret) {
 			last_timeout = true;
-			exit_mask = !cpumask_test_cpu(raw_smp_processor_id(),
-							wq->cpu_mask);
+			exit_mask = io_wq_worker_off_cpus(wq);
 		}
 	}
 
@@ -867,9 +894,16 @@ void io_wq_worker_sleeping(struct task_struct *tsk)
 static void io_init_new_worker(struct io_wq *wq, struct io_wq_acct *acct, struct io_worker *worker,
 			       struct task_struct *tsk)
 {
+	cpumask_var_t cpus;
+
 	tsk->worker_private = worker;
 	worker->task = tsk;
-	set_cpus_allowed_ptr(tsk, wq->cpu_mask);
+	/* Without a mask, the worker keeps its creator's CPUs. */
+	if (alloc_cpumask_var(&cpus, GFP_KERNEL)) {
+		io_wq_worker_cpus(wq, tsk, cpus);
+		set_cpus_allowed_ptr(tsk, cpus);
+		free_cpumask_var(cpus);
+	}
 
 	raw_spin_lock(&acct->workers_lock);
 	hlist_nulls_add_head_rcu(&worker->nulls_node, &acct->free_list);
@@ -1366,7 +1400,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
 
 	if (!alloc_cpumask_var(&wq->cpu_mask, GFP_KERNEL))
 		goto err;
-	cpuset_cpus_allowed(data->task, wq->cpu_mask);
+	cpumask_copy(wq->cpu_mask, cpu_possible_mask);
 	wq->acct[IO_WQ_ACCT_BOUND].max_workers = bounded;
 	wq->acct[IO_WQ_ACCT_UNBOUND].max_workers =
 				task_rlimit(current, RLIMIT_NPROC);
@@ -1588,7 +1622,7 @@ int io_wq_cpu_affinity(struct io_uring_task *tctx, cpumask_var_t mask)
 		else
 			ret = -EINVAL;
 	} else {
-		cpumask_copy(tctx->io_wq->cpu_mask, allowed_mask);
+		cpumask_copy(tctx->io_wq->cpu_mask, cpu_possible_mask);
 	}
 	rcu_read_unlock();
 
Signature · 1 line
2.53.0
author maintainer
#23 lore raw

PATCH 23/1005 bnxt_en: Take RTNL before netif_close() when aborting FW reset

In reply to Greg Kroah-Hartman

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

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

From: Bryan Cochrane <[email protected]>

[ Upstream commit bf83b257423bb557b970df3d7ece32fbd85f3bd4 ]

netif_close() must be called with RTNL held in addition to the netdev instance lock: __dev_close_many() asserts it, and the NETDEV_GOING_DOWN and NETDEV_DOWN notifier chains it runs rely on it for serialization.

Commit 004b5008016a ("eth: bnxt: remove most dependencies on RTNL") replaced rtnl_lock() with netdev_lock() in bnxt_fw_reset_task() and bnxt_fw_reset(). That is sufficient for the paths that only tear the NIC down internally with __bnxt_close_nic(), but the abort paths close the netdev via bnxt_fw_reset_abort() -> netif_close(), and the error path in bnxt_fw_reset() calls netif_close() directly. Those now run without RTNL and trigger a WARN_ONCE() cascade when a firmware reset is aborted:

RTNL: assertion failed at net/core/dev.c (1740)

  WARNING: net/core/dev.c:1740 at __dev_close_many+0x1be/0x1f0
  Workqueue: bnxt_pf_wq bnxt_fw_reset_task [bnxt_en]
  Call Trace:
   netif_close_many+0xb5/0x190
   netif_close+0xa2/0xd0
   bnxt_fw_reset_task.cold+0x8d/0x213 [bnxt_en]
   process_one_work+0x19d/0x3a0
   worker_thread+0x1af/0x320
   kthread+0xe3/0x120

followed by the same assertion from call_netdevice_notifiers_info(), fib_rules_event(), inetdev_event(), rtnl_fill_ifinfo(), devlink_compat_phys_port_name_get() and ip_mc_down().

This was observed on a machine in real use with a BCM57504 (4 PFs, FW 236.1.153.0) running v7.1.6: the firmware crashed, announced a "Fatal firmware reset event" and then failed to come back within the advertised max wait, so bnxt_fw_reset_task() aborted the reset on all ports:

bnxt_en 0000:c1:00.1 eno16905np1: Firmware reset aborted bnxt_en 0000:c1:00.1 eno16905np1: fw_health_status 0x448100

Take RTNL (before the netdev instance lock, matching the OPENING state which already uses rtnl_trylock()) in the fw_reset_abort path of bnxt_fw_reset_task() and route the POLL_VF abort through that same path.

In bnxt_fw_reset(), only a PF can reach the bnxt_get_registered_vfs() error path that calls netif_close(), so take RTNL up front via bnxt_rtnl_lock_sp() when BNXT_PF(bp) is true and keep bnxt_lock_sp() on VFs. That avoids dropping the instance lock mid-reset (which would expose a transient BNXT_STATE_IN_FW_RESET and let a concurrent devlink health recover set BNXT_STATE_IN_SP_TASK), avoids racing with bnxt_sriov_configure() updating active_vfs outside RTNL, and keeps VFs from contending on RTNL during recovery while PFs already run on the single-threaded bnxt_pf_wq.

The bug was found by inspecting the kernel log of the affected machine and the driver source; the fix was prepared with the help of an AI coding assistant (Gemini based) and reviewed by the submitter. It is build tested (allmodconfig with W=1, plus the same change on top of v7.1.6 built as a module for the affected BCM57504 host). The aborted reset path itself only runs when the firmware fails to return from a reset, which could not be reproduced on demand.

Fixes 004b5008016a ("eth: bnxt: remove most dependencies on RTNL")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +11 -4
index 1fd6a676085b5..94d764230e47d 100644
@@ -14806,7 +14806,10 @@ static int bnxt_get_registered_vfs(struct bnxt *bp)
 void bnxt_fw_reset(struct bnxt *bp)
 {
 	bnxt_ulp_stop(bp);
-	bnxt_lock_sp(bp);
+	if (BNXT_PF(bp))
+		bnxt_rtnl_lock_sp(bp);
+	else
+		bnxt_lock_sp(bp);
 	if (test_bit(BNXT_STATE_OPEN, &bp->state) &&
 	    !test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) {
 		struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
@@ -14852,7 +14855,10 @@ void bnxt_fw_reset(struct bnxt *bp)
 		bnxt_queue_fw_reset_work(bp, tmo);
 	}
 fw_reset_exit:
-	bnxt_unlock_sp(bp);
+	if (BNXT_PF(bp))
+		bnxt_rtnl_unlock_sp(bp);
+	else
+		bnxt_unlock_sp(bp);
 }
 
 static void bnxt_chk_missed_irq(struct bnxt *bp)
@@ -15503,9 +15509,8 @@ static void bnxt_fw_reset_task(struct work_struct *work)
 		bp->fw_reset_timestamp = jiffies;
 		netdev_lock(bp->dev);
 		if (test_bit(BNXT_STATE_ABORT_ERR, &bp->state)) {
-			bnxt_fw_reset_abort(bp, rc);
 			netdev_unlock(bp->dev);
-			goto ulp_start;
+			goto fw_reset_abort;
 		}
 		bnxt_fw_reset_close(bp);
 		if (bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD) {
@@ -15638,9 +15643,11 @@ static void bnxt_fw_reset_task(struct work_struct *work)
 		netdev_err(bp->dev, "fw_health_status 0x%x\n", sts);
 	}
 fw_reset_abort:
+	rtnl_lock();
 	netdev_lock(bp->dev);
 	bnxt_fw_reset_abort(bp, rc);
 	netdev_unlock(bp->dev);
+	rtnl_unlock();
 ulp_start:
 	if (!rc)
 		bnxt_ulp_start(bp);
Signature · 1 line
2.53.0
author maintainer
#24 lore raw

PATCH 24/1005 Input: destroy force-feedback device on input unregistration

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Torokhov <[email protected]>

[ Upstream commit 2ae35f090d029d2d8491b0a7f98a04c5c05d0a44 ]

When an input device is unregistered while userspace holds an open file descriptor to its event node, input_dev_release() is deferred until the last file descriptor is closed. Because input_ff_destroy() was only called from input_dev_release(), force-feedback teardown (ff->destroy and freeing ff->private) could run after the parent driver had already unbound, freed its device state, or even been unloaded via rmmod, causing use-after-free errors or page faults in unmapped module text.

Commit ef166ce08801 ("Input: stop force-feedback timer when unregistering input devices") added a separate ff->stop callback for ff-memless, but left ff->destroy invoked from input_dev_release().

Once __input_unregister_device() has disconnected all input handlers (which flushes effects, closes the device, and marks evdev dead) and deleted the device from sysfs, nothing accesses dev->ff anymore. Call input_ff_destroy() directly in __input_unregister_device() so that ff->destroy() always runs synchronously while the driver and its module are still active, and remove the now-redundant ff->stop callback. Keep input_ff_destroy() in input_dev_release() (where it is a no-op once dev->ff is NULL) to handle input_free_device() on devices that were never registered.

---
 drivers/input/ff-core.c    |  2 +-
 drivers/input/ff-memless.c | 23 -----------------------
 drivers/input/input.c      |  5 ++---
 include/linux/input.h      |  3 ---
 4 files changed, 3 insertions(+), 30 deletions(-)
drivers/input/ff-core.c +1 -1
index 0e5d1d1ceb460..133b4622dc49a 100644
@@ -338,7 +338,7 @@ EXPORT_SYMBOL_GPL(input_ff_create);
  *
  * This function is only needed in error path as input core will
  * automatically free force feedback structures when device is
- * destroyed.
+ * unregistered or destroyed.
  */
 void input_ff_destroy(struct input_dev *dev)
 {
drivers/input/ff-memless.c +0 -23
index d1fefd1dfc0de..3069436148ec1 100644
@@ -483,32 +483,10 @@ static void ml_ff_destroy(struct ff_device *ff)
 {
 	struct ml_device *ml = ff->private;
 
-	/*
-	 * The timer is normally shut down in ml_ff_stop() when the device
-	 * is unregistered. However, we still shut it down here as a safety
-	 * net and for cases where the device was never registered (e.g.
-	 * error paths during probe).
-	 */
 	timer_shutdown_sync(&ml->timer);
-
 	kfree(ml->private);
 }
 
-static void ml_ff_stop(struct ff_device *ff)
-{
-	struct ml_device *ml = ff->private;
-
-	/*
-	 * Even though we stop all playing effects when tearing down an
-	 * input device (by the way of evdev calling input_flush_device()
-	 * that calls into input_ff_flush() that stops and erases all
-	 * effects), we do not actually shutdown the timer, and therefore
-	 * we should do it here to prevent it firing after the input
-	 * device is unregistered and its associated resources are freed.
-	 */
-	timer_shutdown_sync(&ml->timer);
-}
-
 /**
  * input_ff_create_memless() - create memoryless force-feedback device
  * @dev: input device supporting force-feedback
@@ -543,7 +521,6 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
 	ff->playback = ml_ff_playback;
 	ff->set_gain = ml_ff_set_gain;
 	ff->destroy = ml_ff_destroy;
-	ff->stop = ml_ff_stop;
 
 	/* we can emulate periodic effects with RUMBLE */
 	if (test_bit(FF_RUMBLE, ff->ffbit)) {
drivers/input/input.c +2 -3
index 6c45a158047f2..2f0fa8ebee857 100644
@@ -2265,10 +2265,9 @@ static void __input_unregister_device(struct input_dev *dev)
 		input_wakeup_procfs_readers();
 	}
 
-	if (dev->ff && dev->ff->stop)
-		dev->ff->stop(dev->ff);
-
 	device_del(&dev->dev);
+
+	input_ff_destroy(dev);
 }
 
 static void devm_input_device_unregister(struct device *dev, void *res)
include/linux/input.h +0 -3
index 3381608127f72..02047cc45d04c 100644
@@ -549,8 +549,6 @@ extern const struct class input_class;
  * @set_autocenter: Called to auto-center device
  * @destroy: called by input core when parent input device is being
  *	destroyed
- * @stop: called by input core when parent input device is being
- *	unregistered
  * @private: driver-specific data, will be freed automatically
  * @ffbit: bitmap of force feedback capabilities truly supported by
  *	device (not emulated like ones in input_dev->ffbit)
@@ -579,7 +577,6 @@ struct ff_device {
 	void (*set_autocenter)(struct input_dev *dev, u16 magnitude);
 
 	void (*destroy)(struct ff_device *);
-	void (*stop)(struct ff_device *);
 
 	void *private;
 
Signature · 1 line
2.53.0
author maintainer
#25 lore raw

PATCH 25/1005 wifi: rtw89: usb: Avoid crash with dynamically added device ID

In reply to Greg Kroah-Hartman

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

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

From: Bitterblue Smith <[email protected]>

[ Upstream commit b1827227176821af9bba0cb643728d23328f3660 ]

Adding a device ID via sysfs causes a crash when the device is plugged in, because the driver_info pointer is null.

Check for null driver_info in rtw89_usb_probe() and add a wrapper in each driver to pass it a reasonable default value.

---
 drivers/net/wireless/realtek/rtw89/rtw8851bu.c | 8 +++++++-
 drivers/net/wireless/realtek/rtw89/rtw8852au.c | 8 +++++++-
 drivers/net/wireless/realtek/rtw89/rtw8852bu.c | 8 +++++++-
 drivers/net/wireless/realtek/rtw89/rtw8852cu.c | 8 +++++++-
 drivers/net/wireless/realtek/rtw89/rtw8922au.c | 8 +++++++-
 drivers/net/wireless/realtek/rtw89/usb.c       | 5 ++++-
 drivers/net/wireless/realtek/rtw89/usb.h       | 3 ++-
 7 files changed, 41 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtw89/rtw8851bu.c +7 -1
index 1e827205f2540..6672ebe68f172 100644
@@ -59,10 +59,16 @@ static const struct usb_device_id rtw_8851bu_id_table[] = {
 };
 MODULE_DEVICE_TABLE(usb, rtw_8851bu_id_table);
 
+static int rtw8851bu_probe(struct usb_interface *intf,
+			   const struct usb_device_id *id)
+{
+	return rtw89_usb_probe(intf, id, &rtw89_8851bu_info);
+}
+
 static struct usb_driver rtw_8851bu_driver = {
 	.name = KBUILD_MODNAME,
 	.id_table = rtw_8851bu_id_table,
-	.probe = rtw89_usb_probe,
+	.probe = rtw8851bu_probe,
 	.disconnect = rtw89_usb_disconnect,
 };
 module_usb_driver(rtw_8851bu_driver);
drivers/net/wireless/realtek/rtw89/rtw8852au.c +7 -1
index 065f4e5b17afa..1a2e5dfbaab3c 100644
@@ -73,10 +73,16 @@ static const struct usb_device_id rtw_8852au_id_table[] = {
 };
 MODULE_DEVICE_TABLE(usb, rtw_8852au_id_table);
 
+static int rtw8852au_probe(struct usb_interface *intf,
+			   const struct usb_device_id *id)
+{
+	return rtw89_usb_probe(intf, id, &rtw89_8852au_info);
+}
+
 static struct usb_driver rtw_8852au_driver = {
 	.name = KBUILD_MODNAME,
 	.id_table = rtw_8852au_id_table,
-	.probe = rtw89_usb_probe,
+	.probe = rtw8852au_probe,
 	.disconnect = rtw89_usb_disconnect,
 };
 module_usb_driver(rtw_8852au_driver);
drivers/net/wireless/realtek/rtw89/rtw8852bu.c +7 -1
index de79a19a2824d..550fc4ac7a21f 100644
@@ -73,10 +73,16 @@ static const struct usb_device_id rtw_8852bu_id_table[] = {
 };
 MODULE_DEVICE_TABLE(usb, rtw_8852bu_id_table);
 
+static int rtw8852bu_probe(struct usb_interface *intf,
+			   const struct usb_device_id *id)
+{
+	return rtw89_usb_probe(intf, id, &rtw89_8852bu_info);
+}
+
 static struct usb_driver rtw_8852bu_driver = {
 	.name = KBUILD_MODNAME,
 	.id_table = rtw_8852bu_id_table,
-	.probe = rtw89_usb_probe,
+	.probe = rtw8852bu_probe,
 	.disconnect = rtw89_usb_disconnect,
 };
 module_usb_driver(rtw_8852bu_driver);
drivers/net/wireless/realtek/rtw89/rtw8852cu.c +7 -1
index 2dec9b8454815..6f852f4a713e1 100644
@@ -133,10 +133,16 @@ static const struct usb_device_id rtw_8852cu_id_table[] = {
 };
 MODULE_DEVICE_TABLE(usb, rtw_8852cu_id_table);
 
+static int rtw8852cu_probe(struct usb_interface *intf,
+			   const struct usb_device_id *id)
+{
+	return rtw89_usb_probe(intf, id, &rtw89_8852cu_info);
+}
+
 static struct usb_driver rtw_8852cu_driver = {
 	.name = KBUILD_MODNAME,
 	.id_table = rtw_8852cu_id_table,
-	.probe = rtw89_usb_probe,
+	.probe = rtw8852cu_probe,
 	.disconnect = rtw89_usb_disconnect,
 };
 module_usb_driver(rtw_8852cu_driver);
drivers/net/wireless/realtek/rtw89/rtw8922au.c +7 -1
index 56c79b1ec865f..2cd2b76d19acf 100644
@@ -74,10 +74,16 @@ static const struct usb_device_id rtw_8922au_id_table[] = {
 };
 MODULE_DEVICE_TABLE(usb, rtw_8922au_id_table);
 
+static int rtw8922au_probe(struct usb_interface *intf,
+			   const struct usb_device_id *id)
+{
+	return rtw89_usb_probe(intf, id, &rtw89_8922au_info);
+}
+
 static struct usb_driver rtw_8922au_driver = {
 	.name = KBUILD_MODNAME,
 	.id_table = rtw_8922au_id_table,
-	.probe = rtw89_usb_probe,
+	.probe = rtw8922au_probe,
 	.disconnect = rtw89_usb_disconnect,
 };
 module_usb_driver(rtw_8922au_driver);
drivers/net/wireless/realtek/rtw89/usb.c +4 -1
index 22a1a988f3073..8dc2c93e502ee 100644
@@ -1206,7 +1206,8 @@ static const struct attribute_group rtw89_usb_group = {
 __ATTRIBUTE_GROUPS(rtw89_usb);
 
 int rtw89_usb_probe(struct usb_interface *intf,
-		    const struct usb_device_id *id)
+		    const struct usb_device_id *id,
+		    const struct rtw89_driver_info *default_info)
 {
 	const struct rtw89_driver_info *info;
 	struct rtw89_dev *rtwdev;
@@ -1214,6 +1215,8 @@ int rtw89_usb_probe(struct usb_interface *intf,
 	int ret;
 
 	info = (const struct rtw89_driver_info *)id->driver_info;
+	if (!info)
+		info = default_info;
 
 	rtwdev = rtw89_alloc_ieee80211_hw(&intf->dev,
 					  sizeof(struct rtw89_usb), info);
drivers/net/wireless/realtek/rtw89/usb.h +2 -1
index bdf3125597438..d2af29d068f19 100644
@@ -95,7 +95,8 @@ static inline struct rtw89_usb *rtw89_usb_priv(struct rtw89_dev *rtwdev)
 }
 
 int rtw89_usb_probe(struct usb_interface *intf,
-		    const struct usb_device_id *id);
+		    const struct usb_device_id *id,
+		    const struct rtw89_driver_info *default_info);
 void rtw89_usb_disconnect(struct usb_interface *intf);
 
 #endif
Signature · 1 line
2.53.0
author maintainer
#26 lore raw

PATCH 26/1005 wifi: rtw89: 8922au: Add support for TP-Link TBE400U

In reply to Greg Kroah-Hartman

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

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

From: Nick Venenga <[email protected]>

[ Upstream commit de2cb461456143a69845c24ce38ac14a61d6e166 ]

idVendor=37ad, idProduct=0104 TP-Link TBE400U (USB-C, no external antenna)
idVendor=37ad, idProduct=0106 TP-Link Archer TBE400U Plus (USB-A, antenna)

https://github.com/morrownr/rtw89/pull/123
https://github.com/morrownr/rtw89/commit/c98e6ff31c331be35383b5a500cfaf76620e2d0c

---
 drivers/net/wireless/realtek/rtw89/rtw8922au.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/realtek/rtw89/rtw8922au.c +4 -0
index 2cd2b76d19acf..7854e6aca749d 100644
@@ -64,6 +64,10 @@ static const struct usb_device_id rtw_8922au_id_table[] = {
 	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x37ad, 0x0101, 0xff, 0xff, 0xff),
 	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x37ad, 0x0104, 0xff, 0xff, 0xff),
+	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x37ad, 0x0106, 0xff, 0xff, 0xff),
+	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0x3822, 0xff, 0xff, 0xff),
 	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0x4822, 0xff, 0xff, 0xff),
Signature · 1 line
2.53.0
author maintainer
#27 lore raw

PATCH 27/1005 wifi: rtw89: 8922au: add ASUS BE93

In reply to Greg Kroah-Hartman

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

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

From: Nick Venenga <[email protected]>

[ Upstream commit 475539db19530b7e134f58555e1afcae21d419f3 ]

ASUS USB-BE93 Mini USB-C adapter
Originally added and tested here https://github.com/morrownr/rtw89/pull/121

---
 drivers/net/wireless/realtek/rtw89/rtw8922au.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/realtek/rtw89/rtw8922au.c +2 -0
index 7854e6aca749d..b146bd79c675e 100644
@@ -52,6 +52,8 @@ static const struct usb_device_id rtw_8922au_id_table[] = {
 	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1bd2, 0xff, 0xff, 0xff),
 	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1d84, 0xff, 0xff, 0xff),
+	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x0bda, 0x8912, 0xff, 0xff, 0xff),
 	  .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x0db0, 0xda0e, 0xff, 0xff, 0xff),
Signature · 1 line
2.53.0
author maintainer
#28 lore raw

PATCH 28/1005 9p: use fc->net_ns for network namespace in RDMA and socket transports

In reply to Greg Kroah-Hartman

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

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

From: Yizhou Zhao <[email protected]>

[ Upstream commit 37dce65a0b4356d7ec289a5d09cece5db241c302 ]

The 9p RDMA transport currently passes &init_net to rdma_create_id(). As a result, RDMA address resolution and connection setup are performed in the initial network namespace, even when the mount is initiated from a non-initial network namespace.

This differs from the socket-based 9p transports, which create sockets in current->nsproxy->net_ns. Use fc->net_ns for both the RDMA and socket transports instead, so that transport setup follows the VFS mount namespace context rather than depending on the calling process's current namespace.

This avoids surprising behaviour where a 9p RDMA mount from a container or other non-initial network namespace may use the host namespace for RDMA CM operations.

Fixes fa20105e09e9 ("IB/cma: Add support for network namespaces")
Assisted-by GLM:GLM-5.1

Message-ID: <[email protected]>

---
 net/9p/trans_fd.c   | 11 +++++------
 net/9p/trans_rdma.c |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)
net/9p/trans_fd.c +5 -6
index eb685b52aeb26..dce963332a046 100644
@@ -887,8 +887,8 @@ p9_fd_create_tcp(struct p9_client *client, struct fs_context *fc)
 		return -EINVAL;
 
 	sprintf(port_str, "%u", opts.port);
-	err = inet_pton_with_scope(current->nsproxy->net_ns, AF_UNSPEC, addr,
-				   port_str, &stor);
+	err = inet_pton_with_scope(fc->net_ns, AF_UNSPEC, addr, port_str,
+				   &stor);
 	if (err < 0)
 		return err;
 
@@ -896,8 +896,8 @@ p9_fd_create_tcp(struct p9_client *client, struct fs_context *fc)
 
 	client->trans_opts.tcp.port = opts.port;
 	client->trans_opts.tcp.privport = opts.privport;
-	err = __sock_create(current->nsproxy->net_ns, stor.ss_family,
-			    SOCK_STREAM, IPPROTO_TCP, &csocket, 1);
+	err = __sock_create(fc->net_ns, stor.ss_family, SOCK_STREAM,
+			    IPPROTO_TCP, &csocket, 1);
 	if (err) {
 		pr_err("%s (%d): problem creating socket\n",
 		       __func__, task_pid_nr(current));
@@ -946,8 +946,7 @@ p9_fd_create_unix(struct p9_client *client, struct fs_context *fc)
 		       __func__, task_pid_nr(current), addr);
 		return -ENAMETOOLONG;
 	}
-	err = __sock_create(current->nsproxy->net_ns, PF_UNIX,
-			    SOCK_STREAM, 0, &csocket, 1);
+	err = __sock_create(fc->net_ns, PF_UNIX, SOCK_STREAM, 0, &csocket, 1);
 	if (err < 0) {
 		pr_err("%s (%d): problem creating socket\n",
 		       __func__, task_pid_nr(current));
net/9p/trans_rdma.c +1 -1
index b4274f10fa448..f4450e779a791 100644
@@ -556,7 +556,7 @@ rdma_create_trans(struct p9_client *client, struct fs_context *fc)
 		return -ENOMEM;
 
 	/* Create the RDMA CM ID */
-	rdma->cm_id = rdma_create_id(&init_net, p9_cm_event_handler, client,
+	rdma->cm_id = rdma_create_id(fc->net_ns, p9_cm_event_handler, client,
 				     RDMA_PS_TCP, IB_QPT_RC);
 	if (IS_ERR(rdma->cm_id))
 		goto error;
Signature · 1 line
2.53.0
author maintainer
#29 lore raw

PATCH 29/1005 net/9p/usbg: fix descriptor cleanup use-after-free

In reply to Greg Kroah-Hartman

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

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

From: Yizhou Zhao <[email protected]>

[ Upstream commit 0955472fff1e9f9e410a0300136924ebc8bd7a16 ]

usb9pfs_free_func() frees the f_usb9pfs object before calling usb_free_all_descriptors(). The usb_function passed to the latter is embedded in the freed object, so removing the function from a gadget dereferences freed memory.

The failing teardown sequence is:

configfs unlink
usb9pfs_free_func()
kfree(usb9pfs)
usb_free_all_descriptors(f)
dereference the embedded usb_function

KASAN reported:

  BUG: KASAN: slab-use-after-free in usb_free_all_descriptors+0x138/0x190
  Read of size 8 at addr ffff888106a73088 by task poc/95
  Call Trace:
   usb_free_all_descriptors+0x138/0x190
   config_usb_cfg_unlink+0x1f0/0x2f0
   configfs_unlink+0x321/0x6f0

Free the descriptors before freeing their containing object.

Fixes a3be076dc174 ("net/9p/usbg: Add new usb gadget function transport")
Assisted-by GLM:GLM-5.1

Message-ID: <[email protected]>
Message-ID: <[email protected]>

---
 net/9p/trans_usbg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/9p/trans_usbg.c +2 -2
index 7d600e1288a30..6bc7de04bd514 100644
@@ -754,8 +754,6 @@ static void usb9pfs_free_func(struct usb_function *f)
 	struct f_usb9pfs *usb9pfs = func_to_usb9pfs(f);
 	struct f_usb9pfs_opts *opts;
 
-	kfree(usb9pfs);
-
 	opts = container_of(f->fi, struct f_usb9pfs_opts, func_inst);
 
 	mutex_lock(&opts->lock);
@@ -763,6 +761,8 @@ static void usb9pfs_free_func(struct usb_function *f)
 	mutex_unlock(&opts->lock);
 
 	usb_free_all_descriptors(f);
+
+	kfree(usb9pfs);
 }
 
 static int usb9pfs_set_alt(struct usb_function *f,
Signature · 1 line
2.53.0
author maintainer
#30 lore raw

PATCH 30/1005 net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx

In reply to Greg Kroah-Hartman

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

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

From: Yizhou Zhao <[email protected]>

[ Upstream commit 5c69297356bf6d04d8222f52717c6c4aa73e5d2c ]

When p9_usbg_close() is called, it invokes usb9pfs_clear_tx() but does not clear usb9pfs->client nor usb9pfs->in_req->context afterwards. The 9p client core (p9_client_destroy) calls close() and then kfree(clnt), so after p9_usbg_close returns the client struct is freed.

If the USB gadget is later disabled (e.g., host disconnect), usb9pfs_disable calls usb9pfs_clear_tx again, which passes the dangling usb9pfs->client pointer to p9_client_cb. Inside p9_client_cb, p9_req_put(c, req) dereferences the freed client to access its reqs IDR, causing a use-after-free.

Additionally, usb9pfs_clear_tx does not clear usb9pfs->in_req->context after calling p9_client_cb, so a second invocation finds a stale request pointer and attempts double-completion, further compounding the UAF risk.

Fix by:
1. Clearing usb9pfs->in_req->context to NULL in usb9pfs_clear_tx() before checking usb9pfs->client, so that even if the client is gone the stale request pointer is consumed and cannot cause double-completion.
2. Adding a NULL check on usb9pfs->client in usb9pfs_clear_tx() to skip p9_client_cb() when the client has already been destroyed.
3. Setting usb9pfs->client = NULL in p9_usbg_close() after calling usb9pfs_clear_tx(), to prevent any subsequent call from dereferencing the freed client pointer.

Fixes a3be076dc174 ("net/9p/usbg: Add new usb gadget function transport")
Assisted-by GLM:GLM-5.1

Message-ID: <[email protected]>

---
 net/9p/trans_usbg.c | 6 ++++++
 1 file changed, 6 insertions(+)
net/9p/trans_usbg.c +6 -0
index 6bc7de04bd514..45b0ea594211c 100644
@@ -460,6 +460,11 @@ static void usb9pfs_clear_tx(struct f_usb9pfs *usb9pfs)
 	if (!req || !client)
 		return;
 
+	usb9pfs->in_req->context = NULL;
+
+	if (!usb9pfs->client)
+		return;
+
 	if (!req->t_err)
 		req->t_err = -ECONNRESET;
 
@@ -483,6 +488,7 @@ static void p9_usbg_close(struct p9_client *client)
 	client->status = Disconnected;
 
 	usb9pfs_clear_tx(usb9pfs);
+	usb9pfs->client = NULL;
 
 	opts = container_of(usb9pfs->function.fi,
 			    struct f_usb9pfs_opts, func_inst);
Signature · 1 line
2.53.0
author maintainer
#31 lore raw

PATCH 31/1005 9p: skip intermediate directory entry name copy in p9dirent_read()

In reply to Greg Kroah-Hartman

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

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

From: Haobin Wu <[email protected]>

[ Upstream commit 8bb0279930cc90975f03bad4d83282613e5f57fa ]

v9fs_dir_readdir_dotl() decodes each entry of a Rreaddir reply with p9dirent_read(), which parses it through p9pdu_readf("Qqbs"). The 's' conversion in p9pdu_vreadf() already allocates a NUL-terminated copy of the name from the wire buffer; p9dirent_read() then strscpy()s that copy into the fixed 256-byte p9_dirent::d_name and frees the original.

The wire format carries the name length in 16 bits, so a name longer than 255 bytes is valid on the wire and may well be valid on the server's filesystem, but it makes strscpy() return -E2BIG. v9fs_dir_readdir_dotl() turns that into -EIO and aborts getdents64(), so every entry after the long one disappears from the listing.

Drop the second copy: keep the string allocated by p9pdu_vreadf() in p9_dirent and let v9fs_dir_readdir_dotl(), its only user, free it once dir_emit() has consumed it. p9_dirent is a short-lived stack object, so the string's lifetime does not change.

Note that the VFS only rejects names of PATH_MAX bytes or more in verify_dirent_name(), so after this change a name between NAME_MAX and PATH_MAX is returned by getdents64() even though any later lookup on it fails with -ENAMETOOLONG. The next patch skips such entries.

Fixes 7751bdb3a095 ("9p: readdir implementation for 9p2000.L")

Message-ID: <[email protected]>

---
 fs/9p/vfs_dir.c         |  6 +++++-
 include/net/9p/client.h |  2 +-
 net/9p/protocol.c       | 12 ++----------
 3 files changed, 8 insertions(+), 12 deletions(-)
fs/9p/vfs_dir.c +5 -1
index 323f85352f6a4..733ec42258bc6 100644
@@ -196,8 +196,12 @@ static int v9fs_dir_readdir_dotl(struct file *file, struct dir_context *ctx)
 			if (!dir_emit(ctx, curdirent.d_name,
 				      strlen(curdirent.d_name),
 				      QID2INO(&curdirent.qid),
-				      curdirent.d_type))
+				      curdirent.d_type)) {
+				kfree(curdirent.d_name);
 				return 0;
+			}
+
+			kfree(curdirent.d_name);
 
 			ctx->pos = curdirent.d_off;
 			rdir->head += err;
include/net/9p/client.h +1 -1
index 55c6cb54bd254..0a1de81c8cd8b 100644
@@ -270,7 +270,7 @@ struct p9_dirent {
 	struct p9_qid qid;
 	u64 d_off;
 	unsigned char d_type;
-	char d_name[256];
+	char *d_name;
 };
 
 struct iov_iter;
net/9p/protocol.c +2 -10
index 67b0586d807f9..d4335884e0c08 100644
@@ -770,7 +770,7 @@ int p9dirent_read(struct p9_client *clnt, char *buf, int len,
 {
 	struct p9_fcall fake_pdu;
 	int ret;
-	char *nameptr;
+	char *nameptr = NULL;
 
 	fake_pdu.size = len;
 	fake_pdu.capacity = len;
@@ -785,15 +785,7 @@ int p9dirent_read(struct p9_client *clnt, char *buf, int len,
 		return ret;
 	}
 
-	ret = strscpy(dirent->d_name, nameptr, sizeof(dirent->d_name));
-	if (ret < 0) {
-		p9_debug(P9_DEBUG_ERROR,
-			 "On the wire dirent name too long: %s\n",
-			 nameptr);
-		kfree(nameptr);
-		return ret;
-	}
-	kfree(nameptr);
+	dirent->d_name = nameptr;
 
 	return fake_pdu.offset;
 }
Signature · 1 line
2.53.0
author maintainer
#32 lore raw

PATCH 32/1005 xfrm: zero-initialise km_event in the replay-notify path

In reply to Greg Kroah-Hartman

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

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

From: Shubham Antil <[email protected]>

[ Upstream commit e35a12dffd5da67b6ca12bd23eebdd0570592205 ]

xfrm_replay_notify(), xfrm_replay_notify_bmp() and xfrm_replay_notify_esn() declare a struct km_event on the stack and initialise only its .event and .data.aevent fields, leaving .seq and .portid uninitialised. build_aevent() then builds the XFRM_MSG_NEWAE message with those fields:

nlmsg_put(skb, c->portid, c->seq, ...)

so the netlink header of a replay event carries uninitialised stack values rather than defined ones. This was confirmed at runtime rather than by inspection alone: the .seq and .portid carried in that header hold values that nothing in the replay path assigns.

The request-driven paths set these header fields from the requester (xfrm_get_ae() / xfrm_new_ae()); only the kernel-originated replay path leaves them unset. Zero-initialise the event so the header fields are 0, the correct value for a kernel-originated notification.

Fixes f8cd54884e67 ("[IPSEC]: Sync series - core changes")
Assisted-by Claude:claude-opus-4-8
---
 net/xfrm/xfrm_replay.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/xfrm/xfrm_replay.c +3 -3
index dbdf8a39dffee..9394953247ab9 100644
@@ -40,7 +40,7 @@ static void xfrm_replay_notify_esn(struct xfrm_state *x, int event);
 
 void xfrm_replay_notify(struct xfrm_state *x, int event)
 {
-	struct km_event c;
+	struct km_event c = {};
 	/* we send notify messages in case
 	 *  1. we updated on of the sequence numbers, and the seqno difference
 	 *     is at least x->replay_maxdiff, in this case we also update the
@@ -304,7 +304,7 @@ static void xfrm_replay_advance_bmp(struct xfrm_state *x, __be32 net_seq)
 
 static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event)
 {
-	struct km_event c;
+	struct km_event c = {};
 	struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
 	struct xfrm_replay_state_esn *preplay_esn = x->preplay_esn;
 
@@ -356,7 +356,7 @@ static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event)
 static void xfrm_replay_notify_esn(struct xfrm_state *x, int event)
 {
 	u32 seq_diff, oseq_diff;
-	struct km_event c;
+	struct km_event c = {};
 	struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
 	struct xfrm_replay_state_esn *preplay_esn = x->preplay_esn;
 
Signature · 1 line
2.53.0
author maintainer
#33 lore raw

PATCH 33/1005 batman-adv: avoid WARN_ON for orig_ifinfo allocation failure

In reply to Greg Kroah-Hartman

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

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

From: Deepanshu Kartikey <[email protected]>

[ Upstream commit dfa953ba5366b0a80c303700dab2bbcbdc5c27e9 ]

batadv_orig_ifinfo_new() returns NULL only when its GFP_ATOMIC allocation fails, which is a normal runtime condition and not a bug. batadv_v_ogm_forward() already handles this the same way, simply checking for NULL without a WARN_ON.

Do the same in batadv_iv_ogm_update_seqnos() to avoid a spurious WARN_ON splat when the allocation fails (e.g. under fault injection).

Fixes 7351a4822d42 ("batman-adv: split out router from orig_node")
Reported-by [email protected]
---
 net/batman-adv/bat_iv_ogm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/bat_iv_ogm.c +1 -1
index 1c2ab79adabc2..084970404d3e5 100644
@@ -1410,7 +1410,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
 		return BATADV_NO_DUP;
 
 	orig_ifinfo = batadv_orig_ifinfo_new(orig_node, if_outgoing);
-	if (WARN_ON(!orig_ifinfo)) {
+	if (!orig_ifinfo) {
 		batadv_orig_node_put(orig_node);
 		return 0;
 	}
Signature · 1 line
2.53.0
author maintainer
#34 lore raw

PATCH 34/1005 xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups

In reply to Greg Kroah-Hartman

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

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

From: Antony Antony <[email protected]>

[ Upstream commit 6362f459bfc485d805f0439ae4566c1b014abfa4 ]

Add __xfrm_state_lookup_exact(); wire it into DELSA/GETSA, GETAE/NEWAE, EXPIRE, MIGRATE_STATE. xfrm_state_update() (UPDSA) keeps wildcard match because ALLOCSPI's larval state may be unmarked (mark 0/0), so an exact-match UPDSA would not find it and the ADD fallback would then fail with -EEXIST via xfrm_state_add().

Fixes 3d6acfa7641f ("xfrm: SA lookups with mark")
---
 include/net/xfrm.h    |  3 +++
 net/xfrm/xfrm_state.c | 56 +++++++++++++++++++++++++++++++++++--------
 net/xfrm/xfrm_user.c  | 29 +++++++++++-----------
 3 files changed, 64 insertions(+), 24 deletions(-)
include/net/xfrm.h +3 -0
index 298ca9bb00835..1cc76a0d73224 100644
@@ -1765,6 +1765,9 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
 					    const xfrm_address_t *saddr,
 					    u8 proto,
 					    unsigned short family);
+struct xfrm_state *xfrm_state_lookup_exact(struct net *net, const struct xfrm_mark *mark,
+					   const xfrm_address_t *daddr, __be32 spi,
+					   u8 proto, unsigned short family);
 #ifdef CONFIG_XFRM_SUB_POLICY
 void xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n,
 		    unsigned short family);
net/xfrm/xfrm_state.c +46 -10

104 lines not on this page · raw message

net/xfrm/xfrm_user.c +15 -14
index a2587c7e796b4..fffce22389e88 100644
@@ -1089,11 +1089,12 @@ static struct xfrm_state *xfrm_user_state_lookup(struct net *net,
 	struct xfrm_state *x = NULL;
 	struct xfrm_mark m;
 	int err;
-	u32 mark = xfrm_mark_get(attrs, &m);
+
+	xfrm_mark_get(attrs, &m);
 
 	if (xfrm_id_proto_match(p->proto, IPSEC_PROTO_ANY)) {
 		err = -ESRCH;
-		x = xfrm_state_lookup(net, mark, &p->daddr, p->spi, p->proto, p->family);
+		x = xfrm_state_lookup_exact(net, &m, &p->daddr, p->spi, p->proto, p->family);
 	} else {
 		xfrm_address_t *saddr = NULL;
 
@@ -1104,7 +1105,7 @@ static struct xfrm_state *xfrm_user_state_lookup(struct net *net,
 		}
 
 		err = -ESRCH;
-		x = xfrm_state_lookup_byaddr(net, mark,
+		x = xfrm_state_lookup_byaddr(net, m.v & m.m,
 					     &p->daddr, saddr,
 					     p->proto, p->family);
 	}
@@ -2795,14 +2796,13 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct sk_buff *r_skb;
 	int err;
 	struct km_event c;
-	u32 mark;
 	struct xfrm_mark m;
 	struct xfrm_aevent_id *p = nlmsg_data(nlh);
 	struct xfrm_usersa_id *id = &p->sa_id;
 
-	mark = xfrm_mark_get(attrs, &m);
+	xfrm_mark_get(attrs, &m);
 
-	x = xfrm_state_lookup(net, mark, &id->daddr, id->spi, id->proto, id->family);
+	x = xfrm_state_lookup_exact(net, &m, &id->daddr, id->spi, id->proto, id->family);
 	if (x == NULL)
 		return -ESRCH;
 
@@ -2843,7 +2843,6 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct xfrm_state *x;
 	struct km_event c;
 	int err = -EINVAL;
-	u32 mark = 0;
 	struct xfrm_mark m;
 	struct xfrm_aevent_id *p = nlmsg_data(nlh);
 	struct nlattr *rp = attrs[XFRMA_REPLAY_VAL];
@@ -2863,9 +2862,10 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
 		return err;
 	}
 
-	mark = xfrm_mark_get(attrs, &m);
+	xfrm_mark_get(attrs, &m);
 
-	x = xfrm_state_lookup(net, mark, &p->sa_id.daddr, p->sa_id.spi, p->sa_id.proto, p->sa_id.family);
+	x = xfrm_state_lookup_exact(net, &m, &p->sa_id.daddr, p->sa_id.spi,
+				    p->sa_id.proto, p->sa_id.family);
 	if (x == NULL)
 		return -ESRCH;
 
@@ -2999,9 +2999,10 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct xfrm_user_expire *ue = nlmsg_data(nlh);
 	struct xfrm_usersa_info *p = &ue->state;
 	struct xfrm_mark m;
-	u32 mark = xfrm_mark_get(attrs, &m);
 
-	x = xfrm_state_lookup(net, mark, &p->id.daddr, p->id.spi, p->id.proto, p->family);
+	xfrm_mark_get(attrs, &m);
+
+	x = xfrm_state_lookup_exact(net, &m, &p->id.daddr, p->id.spi, p->id.proto, p->family);
 
 	err = -ENOENT;
 	if (x == NULL)
@@ -3372,9 +3373,9 @@ static int xfrm_do_migrate_state(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 	copy_from_user_migrate_state(&m, um);
 
-	x = xfrm_state_lookup(net, m.old_mark.v & m.old_mark.m,
-			      &um->id.daddr, um->id.spi,
-			      um->id.proto, um->id.family);
+	x = xfrm_state_lookup_exact(net, &m.old_mark,
+				    &um->id.daddr, um->id.spi,
+				    um->id.proto, um->id.family);
 	if (!x) {
 		NL_SET_ERR_MSG(extack, "Can not find state");
 		return -ESRCH;
Signature · 1 line
2.53.0
author maintainer
#35 lore raw

PATCH 35/1005 xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state()

In reply to Greg Kroah-Hartman

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

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

From: Antony Antony <[email protected]>

[ Upstream commit 3eb841b771e81e0692b3ebfc75fdb774022cc4f6 ]

A concurrent delete can free the migrated state before xfrm_do_migrate_state() finishes using it.

Fixes a9d155ea9b44 ("xfrm: add XFRM_MSG_MIGRATE_STATE for single SA migration")
---
 net/xfrm/xfrm_user.c | 3 +++
 1 file changed, 3 insertions(+)
net/xfrm/xfrm_user.c +3 -0
index fffce22389e88..48b8a0af95e25 100644
@@ -3479,6 +3479,7 @@ static int xfrm_do_migrate_state(struct sk_buff *skb, struct nlmsghdr *nlh,
 	__xfrm_state_delete(x);
 	spin_unlock_bh(&x->lock);
 
+	xfrm_state_hold(xc);
 	err = xfrm_state_migrate_install(x, xc, &m, extack);
 	if (err < 0) {
 		/*
@@ -3486,6 +3487,7 @@ static int xfrm_do_migrate_state(struct sk_buff *skb, struct nlmsghdr *nlh,
 		 * free under xfrm_cfg_mutex. Both SAs are gone if it does;
 		 * restoring x would risk SN/IV reuse.
 		 */
+		xfrm_state_put(xc);
 		goto out;
 	}
 
@@ -3504,6 +3506,7 @@ static int xfrm_do_migrate_state(struct sk_buff *skb, struct nlmsghdr *nlh,
 		err = 0;
 	}
 
+	xfrm_state_put(xc);
 out:
 	xfrm_state_put(x);
 	return err;
Signature · 1 line
2.53.0
author maintainer
#36 lore raw

PATCH 36/1005 xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path

In reply to Greg Kroah-Hartman

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

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

From: Antony Antony <[email protected]>

[ Upstream commit da94223774ea012188ef76f89e0bd642b39ba517 ]

In the error path, the cloned state is dropped without removing its hardware offload, leaking the offloaded SA entry.

Fixes a9d155ea9b44 ("xfrm: add XFRM_MSG_MIGRATE_STATE for single SA migration")
---
 net/xfrm/xfrm_user.c | 2 ++
 1 file changed, 2 insertions(+)
net/xfrm/xfrm_user.c +2 -0
index 48b8a0af95e25..aac12991d2ca8 100644
@@ -3511,6 +3511,8 @@ static int xfrm_do_migrate_state(struct sk_buff *skb, struct nlmsghdr *nlh,
 	xfrm_state_put(x);
 	return err;
 out_xc:
+	if (m.xuo)
+		xfrm_dev_state_delete(xc);
 	xc->km.state = XFRM_STATE_DEAD;
 	xfrm_state_put(xc);
 	xfrm_state_put(x);
Signature · 1 line
2.53.0
author maintainer
#37 lore raw

PATCH 37/1005 xfrm: include mark in MIGRATE_STATE SA collision check

In reply to Greg Kroah-Hartman

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

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

From: Antony Antony <[email protected]>

[ Upstream commit a46232c697c809aaa2b0ad18157b49d66201fd7f ]

The SA lookup tuple is (daddr, spi, proto, family, mark), but the EEXIST pre-check and the xfrm_state_insert() vs xfrm_state_add() decision only considered daddr and family, ignoring mark. A migration that only changes the mark inserts a duplicate SA tuple into the hash tables.

The collision check is implemented as xfrm_state_mark_collides(), which walks the SPI hash bucket for the target tuple and excludes the state being migrated by pointer, rather than doing a separate exact-match lookup followed by a wildcard lookup and comparing the result against self.

Before:

root@west:~# ip xfrm state add src 10.1.1.1 dst 10.1.1.2 proto esp \
        spi 0x1000  reqid 100 mode tunnel aead "rfc4106(gcm(aes))" \
        0x1111111111111111111111111111111111111111 96 \
        mark 0x1 mask 0xff
root@west:~# ip xfrm state add src 10.1.1.1 dst 10.1.1.2 proto esp \
        spi 0x1000  reqid 100 mode tunnel aead "rfc4106(gcm(aes))" \
        0x1111111111111111111111111111111111111111 96 \
        mark 0x2 mask 0xff
root@west:~# ip xfrm state migrate dst 10.1.1.2 proto esp spi 0x1000 \
        mark 0x1 mask 0xff \
        new-dst 10.1.1.2 new-src 10.1.1.1 new-reqid 100 \
        new-mark 0x2 mask 0xff
ip x s
src 10.1.1.1 dst 10.1.1.2
    proto esp spi 0x00001000 reqid 100 mode tunnel
    replay-window 0
    mark 0x2/0xff
    aead rfc4106(gcm(aes)) 0x1111111111111111111111111111111111111111 96
    anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000
src 10.1.1.1 dst 10.1.1.2
    proto esp spi 0x00001000 reqid 100 mode tunnel
    replay-window 0
    mark 0x2/0xff
    aead rfc4106(gcm(aes)) 0x1111111111111111111111111111111111111111 96
    anti-replay context: seq 0x0, oseq 0x0, bitmap 0x00000000
    sel src 0.0.0.0/0 dst 0.0.0.0/0

Notice two states with same mark 0x2/0xff.
After:

Error: New SA tuple already occupied.

Fixes a9d155ea9b44 ("xfrm: add XFRM_MSG_MIGRATE_STATE for single SA migration")
---
 include/net/xfrm.h    |  4 ++++
 net/xfrm/xfrm_state.c | 40 +++++++++++++++++++++++++++++++++++++---
 net/xfrm/xfrm_user.c  | 17 ++++++++---------
 3 files changed, 49 insertions(+), 12 deletions(-)
include/net/xfrm.h +4 -0
index 1cc76a0d73224..445223a8dc6f1 100644
@@ -1768,6 +1768,10 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
 struct xfrm_state *xfrm_state_lookup_exact(struct net *net, const struct xfrm_mark *mark,
 					   const xfrm_address_t *daddr, __be32 spi,
 					   u8 proto, unsigned short family);
+bool xfrm_state_mark_collides(struct net *net, u32 mark,
+			      const xfrm_address_t *daddr, __be32 spi,
+			      u8 proto, unsigned short family,
+			      const struct xfrm_state *self);
 #ifdef CONFIG_XFRM_SUB_POLICY
 void xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n,
 		    unsigned short family);
net/xfrm/xfrm_state.c +37 -3
index 7c5724fab4894..d340dc9d73461 100644
@@ -2205,10 +2205,12 @@ int xfrm_state_migrate_install(const struct xfrm_state *x,
 			       struct netlink_ext_ack *extack)
 {
 	if (m->new_family == m->old_family &&
-	    xfrm_addr_equal(&x->id.daddr, &m->new_daddr, m->new_family)) {
+	    xfrm_addr_equal(&x->id.daddr, &m->new_daddr, m->new_family) &&
+	    xc->mark.v == x->mark.v && xc->mark.m == x->mark.m) {
 		/*
-		 * Care is needed when the destination address of the state is
-		 * to be updated as it is a part of triplet.
+		 * Care is needed when the destination address or mark of the
+		 * state is to be updated, as they are part of the lookup
+		 * triplet.
 		 */
 		xfrm_state_insert(xc);
 	} else {
@@ -2443,6 +2445,38 @@ xfrm_state_lookup_exact(struct net *net, const struct xfrm_mark *mark,
 }
 EXPORT_SYMBOL(xfrm_state_lookup_exact);
 
+/* True if some OTHER state at this tuple would wildcard-match "mark".
+ * Used by MIGRATE_STATE, which must exclude the state being migrated.
+ */
+bool xfrm_state_mark_collides(struct net *net, u32 mark,
+			      const xfrm_address_t *daddr, __be32 spi,
+			      u8 proto, unsigned short family,
+			      const struct xfrm_state *self)
+{
+	struct xfrm_hash_state_ptrs state_ptrs;
+	unsigned int h;
+	struct xfrm_state *x;
+	bool collides = false;
+
+	rcu_read_lock();
+	xfrm_hash_ptrs_get(net, &state_ptrs);
+	h = __xfrm_spi_hash(daddr, spi, proto, family, state_ptrs.hmask);
+
+	hlist_for_each_entry_rcu(x, state_ptrs.byspi + h, byspi) {
+		if (x != self && x->props.family == family &&
+		    x->id.spi == spi && x->id.proto == proto &&
+		    xfrm_addr_equal(&x->id.daddr, daddr, family) &&
+		    (mark & x->mark.m) == x->mark.v) {
+			collides = true;
+			break;
+		}
+	}
+	rcu_read_unlock();
+
+	return collides;
+}
+EXPORT_SYMBOL(xfrm_state_mark_collides);
+
 struct xfrm_state *
 xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, u8 mode, u32 reqid,
 	      u32 if_id, u32 pcpu_num, u8 proto, const xfrm_address_t *daddr,
net/xfrm/xfrm_user.c +8 -9
index aac12991d2ca8..f8c2b17c6f2b7 100644
@@ -3446,15 +3446,14 @@ static int xfrm_do_migrate_state(struct sk_buff *skb, struct nlmsghdr *nlh,
 						       x->nat_keepalive_interval);
 
 	if (m.new_family != um->id.family ||
-	    !xfrm_addr_equal(&m.new_daddr, &um->id.daddr, um->id.family)) {
-		u32 new_mark_key = m.new_mark ? m.new_mark->v & m.new_mark->m :
-						m.old_mark.v & m.old_mark.m;
-		struct xfrm_state *x_new;
-
-		x_new = xfrm_state_lookup(net, new_mark_key, &m.new_daddr,
-					  um->id.spi, um->id.proto, m.new_family);
-		if (x_new) {
-			xfrm_state_put(x_new);
+	    !xfrm_addr_equal(&m.new_daddr, &um->id.daddr, um->id.family) ||
+	    (m.new_mark && (m.new_mark->v != x->mark.v ||
+			   m.new_mark->m != x->mark.m))) {
+		const struct xfrm_mark *new_mark = m.new_mark ? m.new_mark : &x->mark;
+
+		if (xfrm_state_mark_collides(net, new_mark->v & new_mark->m,
+					     &m.new_daddr, um->id.spi,
+					     um->id.proto, m.new_family, x)) {
 			NL_SET_ERR_MSG(extack, "New SA tuple already occupied");
 			err = -EEXIST;
 			goto out;
Signature · 1 line
2.53.0
author maintainer
#38 lore raw

PATCH 38/1005 xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state()

In reply to Greg Kroah-Hartman

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

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

From: Antony Antony <[email protected]>

[ Upstream commit 24bc5e549913c37fa30693fd3a62a16757c14327 ]

xfrm_init_state() takes an extack parameter but doesn't pass it to xfrm_init_replay(), so replay-window errors can't be reported via extack.

Fixes 231a1744dc43 ("xfrm: add extack to xfrm_init_state")
---
 net/xfrm/xfrm_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/xfrm/xfrm_state.c +1 -1
index d340dc9d73461..5b241dfcae62b 100644
@@ -3387,7 +3387,7 @@ int xfrm_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack)
 	if (err)
 		return err;
 
-	err = xfrm_init_replay(x, NULL);
+	err = xfrm_init_replay(x, extack);
 	if (err)
 		return err;
 
Signature · 1 line
2.53.0
author maintainer
#39 lore raw

PATCH 39/1005 docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple

In reply to Greg Kroah-Hartman

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

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

From: Antony Antony <[email protected]>

[ Upstream commit dcf413245c8c2351f7f80502f89c344256f61a66 ]

Document mark as part of the EEXIST tuple and update the SA lookup description to match.

Fixes c13c0cc6f52e ("xfrm: add documentation for XFRM_MSG_MIGRATE_STATE")
---
 .../networking/xfrm/xfrm_migrate_state.rst    | 25 +++++++++++++------
 1 file changed, 17 insertions(+), 8 deletions(-)
Documentation/networking/xfrm/xfrm_migrate_state.rst +17 -8
index 9d53cb22b0075..ca2c9e5aaf33a 100644
@@ -27,15 +27,20 @@ SA Identification
 =================
 
 The struct is defined in ``include/uapi/linux/xfrm.h``. The SA is looked
-up using ``xfrm_state_lookup()`` with ``id.spi``,
-``id.daddr``, ``id.proto``, ``id.family``, and
-``old_mark.v & old_mark.m`` as the mark key::
+up using ``xfrm_state_lookup_exact()`` with ``id.spi``, ``id.daddr``,
+``id.proto``, ``id.family``, and an exact match against ``old_mark.v``
+and ``old_mark.m``. Unlike the data path, which uses a masked
+comparison, this requires the SA's mark and mask to equal ``old_mark``
+exactly, so a broad-mask SA is never matched when a more specific one
+was intended. If no such SA exists, ``-ESRCH`` is returned.
+
+The layout is::
 
     struct xfrm_user_migrate_state {
         struct xfrm_usersa_id  id;       /* spi, daddr, proto, family */
         xfrm_address_t         new_daddr;
         xfrm_address_t         new_saddr;
-        struct xfrm_mark       old_mark; /* SA lookup: key = v & m */
+        struct xfrm_mark       old_mark; /* SA lookup key (exact v/m match) */
         struct xfrm_selector   new_sel;  /* new selector (see Flags) */
         __u32                  new_reqid;
         __u32                  flags;    /* XFRM_MIGRATE_STATE_* */
@@ -72,8 +77,8 @@ inherits the value from the existing SA (omit-to-inherit).
      - Description
    * - ``XFRMA_MARK``
      - Mark on the migrated SA (``struct xfrm_mark``). Absent inherits
-       ``old_mark``. To use no mark on the new SA, send ``XFRMA_MARK``
-       with ``{0, 0}``.
+       the mark of the existing SA. To use no mark on the new SA, send
+       ``XFRMA_MARK`` with ``{0, 0}``.
    * - ``XFRMA_ENCAP``
      - UDP encapsulation template; only ``UDP_ENCAP_ESPINUDP`` is supported.
        Set ``encap_type=0`` to remove encap.
@@ -259,8 +264,12 @@ Attributes in the notification
 Error Handling
 ==============
 
-If the target SA tuple (new daddr, SPI, proto, new family) is already
-occupied, the operation returns ``-EEXIST`` before the migration begins.
+If the target SA tuple (new daddr, SPI, proto, new family, mark) is
+already occupied, the operation returns ``-EEXIST`` before the migration
+begins. "Occupied" includes wildcard shadowing: an existing SA with a
+broader mask (e.g. mark 0/0) claims every mark value, so it blocks
+migrating to any more specific mark at the same tuple, not just an
+exact mark/mask duplicate.
 The old SA remains intact and the operation is safe to retry after
 resolving the conflict.
 
Signature · 1 line
2.53.0
author maintainer
#40 lore raw

PATCH 40/1005 drm/panic: Accept a trailing newline in panic_screen

In reply to Greg Kroah-Hartman

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

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

From: Devin Wittmayer <[email protected]>

[ Upstream commit 3706caf4da279686b9b95a253eb1d39b1fa12192 ]

Setting the panic screen through sysfs with echo fails with EINVAL, because the value ends in a newline. Ignore it when matching.

---
 drivers/gpu/drm/drm_panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panic.c +1 -1
index fef47625c5268..1dca0b05e9240 100644
@@ -842,7 +842,7 @@ static int drm_panic_type_set(const char *val, const struct kernel_param *kp)
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(drm_panic_type_map); i++) {
-		if (!strcmp(val, drm_panic_type_map[i])) {
+		if (sysfs_streq(val, drm_panic_type_map[i])) {
 			drm_panic_type = i;
 			return 0;
 		}
Signature · 1 line
2.53.0
author maintainer
#41 lore raw

PATCH 41/1005 wifi: wext: Limit notifier event flushes to the devices netns

In reply to Greg Kroah-Hartman

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

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

From: Cosmin Ratiu <[email protected]>

[ Upstream commit 48c0045366bec142d053f7cf76fb9dd7127cd231 ]

With mlx5 netdev instance locking enabled, registering an IPoIB netdev calls the WEXT notifier while holding the instance mutex. Its call to wireless_nlevent_flush() takes net_rwsem to walk every namespace, completing the following lockdep dependency cycle:

netdev instance mutex -> net_rwsem (read) -> GID table mutex

    -> event_handler_rwsem (read) -> netdev instance mutex

RoCE GID enumeration takes the GID table mutex under net_rwsem. GID updates dispatch events under the table mutex, taking event_handler_rwsem. The IPoIB event handler takes the netdev instance mutex in ipoib_queue_work() to traverse child interfaces.

The all-namespace walk originated in the single global worker servicing per-namespace WEXT queues. The ordering fixes later reused that routine in netdevice notifiers to prevent delayed WEXT RTM_NEWLINK messages from following RTM_DELLINK or reporting stale interface flags. A notifier only needs to drain the affected device's namespace; there is no reason for it to walk and flush all namespaces.

Pass dev_net(dev) from both notifier callers and make the flush helper operate on that namespace. Keep the all-namespace walk and net_rwsem in the existing worker. This removes the instance-mutex -> net_rwsem dependency while retaining synchronous flushing from the notifiers.

It may seem strange that the fix for a lock cycle across multiple subsystems lies in a completely unrelated part of the code, but this seemed the most justified lock cycle edge to break.

Fixes 8f7b00307bf1 ("net/mlx5e: Convert mlx5 netdevs to instance locking")
---
 include/net/iw_handler.h |  8 +++++---
 net/wireless/core.c      |  2 +-
 net/wireless/wext-core.c | 33 +++++++++++++++++----------------
 3 files changed, 23 insertions(+), 20 deletions(-)
include/net/iw_handler.h +5 -3
index b80e474cb0aa9..632618d9ff937 100644
@@ -201,6 +201,8 @@
 #include <linux/wireless.h>		/* IOCTL user space API */
 #include <linux/if_ether.h>
 
+struct net;
+
 /***************************** VERSION *****************************/
 /*
  * This constant is used to know which version of the driver API is
@@ -411,10 +413,10 @@ struct iw_spy_data {
 void wireless_send_event(struct net_device *dev, unsigned int cmd,
 			 union iwreq_data *wrqu, const char *extra);
 #ifdef CONFIG_WEXT_CORE
-/* flush all previous wext events - if work is done from netdev notifiers */
-void wireless_nlevent_flush(void);
+/* Flush previous wext events in this netns from netdev notifiers. */
+void wireless_nlevent_flush(struct net *net);
 #else
-static inline void wireless_nlevent_flush(void) {}
+static inline void wireless_nlevent_flush(struct net *net) {}
 #endif
 
 /* We may need a function to send a stream of events to user space.
net/wireless/core.c +1 -1
index 3ac3b2a67a9c9..625cb2c2a05a5 100644
@@ -1913,7 +1913,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
 		return NOTIFY_DONE;
 	}
 
-	wireless_nlevent_flush();
+	wireless_nlevent_flush(dev_net(dev));
 
 	return NOTIFY_OK;
 }
net/wireless/wext-core.c +17 -16
index db77912b3994b..f09c589ff94cd 100644
@@ -342,32 +342,28 @@ static const int compat_event_type_size[] = {
 
 /* IW event code */
 
-void wireless_nlevent_flush(void)
+void wireless_nlevent_flush(struct net *net)
 {
 	struct sk_buff *skb;
-	struct net *net;
 
-	down_read(&net_rwsem);
-	for_each_net(net) {
-		while ((skb = skb_dequeue(&net->wext_nlevents)))
-			rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL,
-				    GFP_KERNEL);
-	}
-	up_read(&net_rwsem);
+	while ((skb = skb_dequeue(&net->wext_nlevents)))
+		rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_KERNEL);
 }
 EXPORT_SYMBOL_GPL(wireless_nlevent_flush);
 
 static int wext_netdev_notifier_call(struct notifier_block *nb,
 				     unsigned long state, void *ptr)
 {
+	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
+
 	/*
-	 * When a netdev changes state in any way, flush all pending messages
-	 * to avoid them going out in a strange order, e.g. RTM_NEWLINK after
-	 * RTM_DELLINK, or with IFF_UP after without IFF_UP during dev_close()
-	 * or similar - all of which could otherwise happen due to delays from
-	 * schedule_work().
+	 * When a netdev changes state in any way, flush all pending messages in
+	 * its network namespace to avoid them going out in a strange order,
+	 * e.g. RTM_NEWLINK after RTM_DELLINK, or with IFF_UP after without
+	 * IFF_UP during dev_close() or similar - all of which could otherwise
+	 * happen due to delays from schedule_work().
 	 */
-	wireless_nlevent_flush();
+	wireless_nlevent_flush(dev_net(dev));
 
 	return NOTIFY_OK;
 }
@@ -410,7 +406,12 @@ subsys_initcall(wireless_nlevent_init);
 /* Process events generated by the wireless layer or the driver. */
 static void wireless_nlevent_process(struct work_struct *work)
 {
-	wireless_nlevent_flush();
+	struct net *net;
+
+	down_read(&net_rwsem);
+	for_each_net(net)
+		wireless_nlevent_flush(net);
+	up_read(&net_rwsem);
 }
 
 static DECLARE_WORK(wireless_nlevent_work, wireless_nlevent_process);
Signature · 1 line
2.53.0
author maintainer
#42 lore raw

PATCH 42/1005 fsnotify: preserve 64-bit pre-content ranges

In reply to Greg Kroah-Hartman

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

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

From: Avi Weiss <[email protected]>

[ Upstream commit 1dcf2be94b9be2d366a0d2b70c2b1c7ebccf1443 ]

vfs_fallocate() and remap_verify_area() pass 64-bit lengths to fsnotify_file_area_perm(), which truncates them to size_t on 32-bit systems.

Use 64 bit (unsigned) types throughout the entire pre-content notification chain to keep the full range. The userspace range field is already 64-bits.

Fixes 9740d17162de ("fsnotify: pass optional file access range in pre-content event")
---
 fs/notify/fanotify/fanotify.h    | 2 +-
 fs/notify/fsnotify.c             | 2 +-
 include/linux/fsnotify.h         | 4 ++--
 include/linux/fsnotify_backend.h | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)
fs/notify/fanotify/fanotify.h +1 -1
index 87ba788574bff..c25cf5c1fc70f 100644
@@ -444,7 +444,7 @@ struct fanotify_perm_event {
 	struct fanotify_event fae;
 	struct path path;
 	loff_t pos;			/* FANOTIFY_NO_RANGE if unavailable */
-	size_t count;
+	u64 count;
 	u32 response;			/* userspace answer to the event */
 	unsigned short state;		/* state of the event */
 	unsigned short watchdog_cnt;	/* already scanned by watchdog? */
fs/notify/fsnotify.c +1 -1
index 7e2f330fd2837..8657bb94dfa8b 100644
@@ -157,7 +157,7 @@ static inline __u32 fsnotify_object_watched(struct inode *inode, __u32 mnt_mask,
 
 /* Report pre-content event with optional range info */
 int fsnotify_pre_content(const struct path *path, const loff_t *ppos,
-			 size_t count)
+			 u64 count)
 {
 	struct file_range range;
 
include/linux/fsnotify.h +2 -2
index bda798bc67bc5..a4a29b3650080 100644
@@ -135,7 +135,7 @@ int fsnotify_open_perm_and_set_mode(struct file *file);
  * fsnotify_file_area_perm - permission hook before access to file range
  */
 static inline int fsnotify_file_area_perm(struct file *file, int perm_mask,
-					  const loff_t *ppos, size_t count)
+					  const loff_t *ppos, u64 count)
 {
 	/*
 	 * filesystem may be modified in the context of permission events
@@ -213,7 +213,7 @@ static inline int fsnotify_open_perm_and_set_mode(struct file *file)
 }
 
 static inline int fsnotify_file_area_perm(struct file *file, int perm_mask,
-					  const loff_t *ppos, size_t count)
+					  const loff_t *ppos, u64 count)
 {
 	return 0;
 }
include/linux/fsnotify_backend.h +3 -3
index a6d5c1a89cffa..faf21564380d9 100644
@@ -323,7 +323,7 @@ struct fs_error_report {
 struct file_range {
 	const struct path *path;
 	loff_t pos;
-	size_t count;
+	u64 count;
 };
 
 static inline const struct path *file_range_path(const struct file_range *range)
@@ -946,12 +946,12 @@ static inline void fsnotify_init_event(struct fsnotify_event *event)
 	INIT_LIST_HEAD(&event->list);
 }
 int fsnotify_pre_content(const struct path *path, const loff_t *ppos,
-			 size_t count);
+			 u64 count);
 
 #else
 
 static inline int fsnotify_pre_content(const struct path *path,
-				       const loff_t *ppos, size_t count)
+				       const loff_t *ppos, u64 count)
 {
 	return 0;
 }
Signature · 1 line
2.53.0
author maintainer
#43 lore raw

PATCH 43/1005 wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers

In reply to Greg Kroah-Hartman

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

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

From: Lorenzo Bianconi <[email protected]>

[ Upstream commit 1e678e37ff13e45f22d78d802fcefa8f9a0d9395 ]

When a MSDU is split across multiple RX buffers, the msdu_end TLV is populated only in the last buffer. Since commit e8a1e49c6328 ("wifi: ath12k: Add new infra for the rx path"), the RX info extraction in ath12k_hal_extract_rx_desc_data_*() helpers runs before the MSDU is coalesced, so the msdu_end-derived fields (decap_type, mesh_ctrl_present, is_from_ds, is_to_ds, is_mcbc, is_decrypted, sgi, rate_mcs, bw, phy_meta_data, pkt_type, nss, checksum flags and err_bitmap, plus tid on QCN9274) were read from the first buffer, where that TLV is not valid.

As a result decap_type was reported as DP_RX_DECAP_TYPE_RAW and the frame was handed to mac80211 with a raw 802.11 header instead of being converted to an ethernet frame, breaking reception of any frame larger than the single RX buffer.

Fix it by parsing the msdu_end fields from the last buffer (ldesc) in ath12k_hal_extract_rx_desc_data_{wcn7850,qcn9274,qcc2072}(), keeping the mpdu_start fields (enctype, seq_no, peer_id and addr2) on the first buffer (rx_desc). The tid field is read from mpdu_start on WCN7850 and QCC2072, and from msdu_end on QCN9274. For single-buffer MSDUs rx_desc and ldesc point to the same descriptor so the behavior is unchanged.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

---
 .../wireless/ath/ath12k/wifi7/hal_qcc2072.c   | 30 ++++++++---------
 .../wireless/ath/ath12k/wifi7/hal_qcn9274.c   | 32 +++++++++----------
 .../wireless/ath/ath12k/wifi7/hal_wcn7850.c   | 30 ++++++++---------
 3 files changed, 46 insertions(+), 46 deletions(-)
drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c +15 -15
index 7cf00fda996f3..7ea7559e882c2 100644
@@ -402,32 +402,32 @@ static void ath12k_hal_extract_rx_desc_data_qcc2072(struct hal_rx_desc_data *rx_
 	rx_desc_data->is_last_msdu = ath12k_hal_rx_desc_get_last_msdu_qcc2072(ldesc);
 	rx_desc_data->l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_qcc2072(ldesc);
 	rx_desc_data->enctype = ath12k_hal_rx_desc_get_encrypt_type_qcc2072(rx_desc);
-	rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcc2072(rx_desc);
+	rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcc2072(ldesc);
 	rx_desc_data->mesh_ctrl_present =
-				ath12k_hal_rx_desc_get_mesh_ctl_qcc2072(rx_desc);
+				ath12k_hal_rx_desc_get_mesh_ctl_qcc2072(ldesc);
 	rx_desc_data->seq_ctl_valid =
 				ath12k_hal_rx_desc_get_mpdu_seq_ctl_vld_qcc2072(rx_desc);
 	rx_desc_data->fc_valid = ath12k_hal_rx_desc_get_mpdu_fc_valid_qcc2072(rx_desc);
 	rx_desc_data->seq_no = ath12k_hal_rx_desc_get_mpdu_start_seq_no_qcc2072(rx_desc);
 	rx_desc_data->msdu_len = ath12k_hal_rx_desc_get_msdu_len_qcc2072(ldesc);
-	rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcc2072(rx_desc);
-	rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcc2072(rx_desc);
-	rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcc2072(rx_desc);
-	rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcc2072(rx_desc);
-	rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcc2072(rx_desc);
-	rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcc2072(rx_desc);
-	rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcc2072(rx_desc);
-	rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcc2072(rx_desc));
+	rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcc2072(ldesc);
+	rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcc2072(ldesc);
+	rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcc2072(ldesc);
+	rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcc2072(ldesc);
+	rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcc2072(ldesc);
+	rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcc2072(ldesc);
+	rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcc2072(ldesc);
+	rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcc2072(ldesc));
 	rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_qcc2072(rx_desc);
 	rx_desc_data->peer_id = ath12k_hal_rx_desc_get_mpdu_peer_id_qcc2072(rx_desc);
 	rx_desc_data->addr2_present = ath12k_hal_rx_desc_mac_addr2_valid_qcc2072(rx_desc);
 	rx_desc_data->addr2 = ath12k_hal_rx_desc_mpdu_start_addr2_qcc2072(rx_desc);
-	rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcc2072(rx_desc);
+	rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcc2072(ldesc);
 	rx_desc_data->msdu_done = ath12k_hal_rx_h_msdu_done_qcc2072(ldesc);
-	rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcc2072(rx_desc);
-	rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcc2072(rx_desc);
-	rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcc2072(rx_desc);
-	rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcc2072(rx_desc);
+	rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcc2072(ldesc);
+	rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcc2072(ldesc);
+	rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcc2072(ldesc);
+	rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcc2072(ldesc);
 }
 
 static int ath12k_hal_srng_create_config_qcc2072(struct ath12k_hal *hal)
drivers/net/wireless/ath/ath12k/wifi7/hal_qcn9274.c +16 -16
index 052b59265af85..355cf50d2785f 100644
@@ -922,32 +922,32 @@ void ath12k_hal_extract_rx_desc_data_qcn9274(struct hal_rx_desc_data *rx_desc_da
 	rx_desc_data->is_last_msdu = ath12k_hal_rx_desc_get_last_msdu_qcn9274(ldesc);
 	rx_desc_data->l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_qcn9274(ldesc);
 	rx_desc_data->enctype = ath12k_hal_rx_desc_get_encrypt_type_qcn9274(rx_desc);
-	rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcn9274(rx_desc);
+	rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_qcn9274(ldesc);
 	rx_desc_data->mesh_ctrl_present =
-		ath12k_hal_rx_desc_get_mesh_ctl_qcn9274(rx_desc);
+		ath12k_hal_rx_desc_get_mesh_ctl_qcn9274(ldesc);
 	rx_desc_data->seq_ctl_valid =
 		ath12k_hal_rx_desc_get_mpdu_seq_ctl_vld_qcn9274(rx_desc);
 	rx_desc_data->fc_valid = ath12k_hal_rx_desc_get_mpdu_fc_valid_qcn9274(rx_desc);
-	rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcn9274(rx_desc);
-	rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcn9274(rx_desc);
+	rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_qcn9274(ldesc);
+	rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_qcn9274(ldesc);
 	rx_desc_data->seq_no = ath12k_hal_rx_desc_get_mpdu_start_seq_no_qcn9274(rx_desc);
 	rx_desc_data->msdu_len = ath12k_hal_rx_desc_get_msdu_len_qcn9274(ldesc);
-	rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcn9274(rx_desc);
-	rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcn9274(rx_desc);
-	rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcn9274(rx_desc);
-	rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcn9274(rx_desc);
-	rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcn9274(rx_desc);
-	rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcn9274(rx_desc));
-	rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_qcn9274(rx_desc);
+	rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_qcn9274(ldesc);
+	rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_qcn9274(ldesc);
+	rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_qcn9274(ldesc);
+	rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_qcn9274(ldesc);
+	rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_qcn9274(ldesc);
+	rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_qcn9274(ldesc));
+	rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_qcn9274(ldesc);
 	rx_desc_data->peer_id = ath12k_hal_rx_desc_get_mpdu_peer_id_qcn9274(rx_desc);
 	rx_desc_data->addr2_present = ath12k_hal_rx_desc_mac_addr2_valid_qcn9274(rx_desc);
 	rx_desc_data->addr2 = ath12k_hal_rx_desc_mpdu_start_addr2_qcn9274(rx_desc);
-	rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcn9274(rx_desc);
+	rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_qcn9274(ldesc);
 	rx_desc_data->msdu_done = ath12k_hal_rx_h_msdu_done_qcn9274(ldesc);
-	rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcn9274(rx_desc);
-	rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcn9274(rx_desc);
-	rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcn9274(rx_desc);
-	rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcn9274(rx_desc);
+	rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_qcn9274(ldesc);
+	rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_qcn9274(ldesc);
+	rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_qcn9274(ldesc);
+	rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_qcn9274(ldesc);
 }
 
 static u16 ath12k_hal_reo_status_dec_tlv_hdr_qcn9274(void *tlv, void **desc)
drivers/net/wireless/ath/ath12k/wifi7/hal_wcn7850.c +15 -15
index 61be8443e46ee..abe982faeb2b7 100644
@@ -604,32 +604,32 @@ void ath12k_hal_extract_rx_desc_data_wcn7850(struct hal_rx_desc_data *rx_desc_da
 	rx_desc_data->is_last_msdu = ath12k_hal_rx_desc_get_last_msdu_wcn7850(ldesc);
 	rx_desc_data->l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_wcn7850(ldesc);
 	rx_desc_data->enctype = ath12k_hal_rx_desc_get_encrypt_type_wcn7850(rx_desc);
-	rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_wcn7850(rx_desc);
+	rx_desc_data->decap_type = ath12k_hal_rx_desc_get_decap_type_wcn7850(ldesc);
 	rx_desc_data->mesh_ctrl_present =
-		ath12k_hal_rx_desc_get_mesh_ctl_wcn7850(rx_desc);
+		ath12k_hal_rx_desc_get_mesh_ctl_wcn7850(ldesc);
 	rx_desc_data->seq_ctl_valid =
 		ath12k_hal_rx_desc_get_mpdu_seq_ctl_vld_wcn7850(rx_desc);
 	rx_desc_data->fc_valid = ath12k_hal_rx_desc_get_mpdu_fc_valid_wcn7850(rx_desc);
 	rx_desc_data->seq_no = ath12k_hal_rx_desc_get_mpdu_start_seq_no_wcn7850(rx_desc);
 	rx_desc_data->msdu_len = ath12k_hal_rx_desc_get_msdu_len_wcn7850(ldesc);
-	rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_wcn7850(rx_desc);
-	rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_wcn7850(rx_desc);
-	rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_wcn7850(rx_desc);
-	rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_wcn7850(rx_desc);
-	rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_wcn7850(rx_desc);
-	rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_wcn7850(rx_desc);
-	rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_wcn7850(rx_desc);
-	rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_wcn7850(rx_desc));
+	rx_desc_data->sgi = ath12k_hal_rx_desc_get_msdu_sgi_wcn7850(ldesc);
+	rx_desc_data->is_from_ds = ath12k_wifi7_hal_rx_h_from_ds_wcn7850(ldesc);
+	rx_desc_data->is_to_ds = ath12k_wifi7_hal_rx_h_to_ds_wcn7850(ldesc);
+	rx_desc_data->rate_mcs = ath12k_hal_rx_desc_get_msdu_rate_mcs_wcn7850(ldesc);
+	rx_desc_data->bw = ath12k_hal_rx_desc_get_msdu_rx_bw_wcn7850(ldesc);
+	rx_desc_data->phy_meta_data = ath12k_hal_rx_desc_get_msdu_freq_wcn7850(ldesc);
+	rx_desc_data->pkt_type = ath12k_hal_rx_desc_get_msdu_pkt_type_wcn7850(ldesc);
+	rx_desc_data->nss = hweight8(ath12k_hal_rx_desc_get_msdu_nss_wcn7850(ldesc));
 	rx_desc_data->tid = ath12k_hal_rx_desc_get_mpdu_tid_wcn7850(rx_desc);
 	rx_desc_data->peer_id = ath12k_hal_rx_desc_get_mpdu_peer_id_wcn7850(rx_desc);
 	rx_desc_data->addr2_present = ath12k_hal_rx_desc_mac_addr2_valid_wcn7850(rx_desc);
 	rx_desc_data->addr2 = ath12k_hal_rx_desc_mpdu_start_addr2_wcn7850(rx_desc);
-	rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_wcn7850(rx_desc);
+	rx_desc_data->is_mcbc = ath12k_hal_rx_desc_is_da_mcbc_wcn7850(ldesc);
 	rx_desc_data->msdu_done = ath12k_hal_rx_h_msdu_done_wcn7850(ldesc);
-	rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_wcn7850(rx_desc);
-	rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_wcn7850(rx_desc);
-	rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_wcn7850(rx_desc);
-	rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_wcn7850(rx_desc);
+	rx_desc_data->l4_csum_fail = ath12k_hal_rx_h_l4_cksum_fail_wcn7850(ldesc);
+	rx_desc_data->ip_csum_fail = ath12k_hal_rx_h_ip_cksum_fail_wcn7850(ldesc);
+	rx_desc_data->is_decrypted = ath12k_hal_rx_h_is_decrypted_wcn7850(ldesc);
+	rx_desc_data->err_bitmap = ath12k_hal_rx_h_mpdu_err_wcn7850(ldesc);
 }
 
 int ath12k_hal_srng_create_config_wcn7850(struct ath12k_hal *hal)
Signature · 1 line
2.53.0
author maintainer
#44 lore raw

PATCH 44/1005 wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect

In reply to Greg Kroah-Hartman

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

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

From: Miaoqing Pan <[email protected]>

[ Upstream commit 843a011534b007a609ae25a91581c5c535e78741 ]

In ath12k_mac_op_sta_state(), when transitioning an MLO station from IEEE80211_STA_NOTEXIST to IEEE80211_STA_NONE, after ath12k_dp_peer_create() succeeds, on is_sta_assoc_link verification failure, it takes the 'goto exit' path instead of 'goto peer_delete', leaving a stale dp_peer on the dp_peers_list.

On the next connection attempt, ath12k_dp_peer_create() finds the stale entry and returns -EEXIST (-17):

wlP4p1s0: failed to insert STA entry for the AP (error -17)

Fix it by changing 'goto exit' to 'goto free_unassign_link'.

Also, there is another error path in ath12k_mac_op_sta_state() that jumps to peer_delete after ath12k_mac_assign_link_sta() succeeds, without undoing the assignment through ath12k_mac_free_unassign_link_sta(). As a result, the link RCU pointer remains assigned and a stale bit is left in ahsta->links_map, which can trigger the same -EEXIST failure on subsequent reconnect attempts. Fix this by redirecting that error path to free_unassign_link instead.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Fixes 0cd46d1f36ce ("wifi: ath12k: identify assoc link vif in station mode")
Fixes ee16dcf573d5 ("wifi: ath12k: Define ath12k_dp_peer structure & APIs for create & delete")
---
 drivers/net/wireless/ath/ath12k/mac.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath12k/mac.c +4 -2
index 56578321e88c6..b5c3519065a2a 100644
@@ -7845,7 +7845,7 @@ int ath12k_mac_op_sta_state(struct ieee80211_hw *hw,
 				ath12k_hw_warn(ah, "failed to verify assoc link setting with link id %u\n",
 					       link_id);
 				ret = -EINVAL;
-				goto exit;
+				goto free_unassign_link;
 			}
 
 			arsta->is_assoc_link = true;
@@ -7903,7 +7903,7 @@ int ath12k_mac_op_sta_state(struct ieee80211_hw *hw,
 
 			if (old_state == IEEE80211_STA_NOTEXIST &&
 			    new_state == IEEE80211_STA_NONE)
-				goto peer_delete;
+				goto free_unassign_link;
 			else
 				goto exit;
 		}
@@ -7943,6 +7943,8 @@ int ath12k_mac_op_sta_state(struct ieee80211_hw *hw,
 	ret = 0;
 	goto exit;
 
+free_unassign_link:
+	ath12k_mac_free_unassign_link_sta(ah, ahsta, link_id);
 peer_delete:
 	ath12k_dp_peer_delete(&ah->dp_hw, sta->addr, sta);
 ml_peer_id_clear:
Signature · 1 line
2.53.0
author maintainer
#45 lore raw

PATCH 45/1005 wifi: ath9k_htc: start ANI when an AP interface begins to beacon

In reply to Greg Kroah-Hartman

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

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

From: Mehmet Fide <[email protected]>

[ Upstream commit 5c1b202d67a212c87e7389aaa093ce77828fa98f ]

ath9k_htc_vif_reconfig() re-arms ANI after a channel change when an AP interface beacons. mac80211 configures the channel before it enables the beacon, so during a normal AP start that never triggers, and the start from add_interface that the previous patch removed was cancelled by the same channel configuration: with hostapd, ANI and the periodic calibration it drives did not run in AP mode until a later channel change.

Start ANI when the beacon is enabled. The channel and its calibration data are in place by then, which is the state vif_reconfig() re-arms it in, and remove_interface() already stops it with the last AP interface.

---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath9k/htc_drv_main.c +3 -0
index 0d6272ac0dac8..611d17202eba2 100644
@@ -1554,6 +1554,9 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
 		ath9k_htc_set_tsfadjust(priv, vif);
 		priv->cur_beacon_conf.enable_beacon = 1;
 		ath9k_htc_beacon_config(priv, vif);
+		if (priv->ah->opmode == NL80211_IFTYPE_AP &&
+		    !test_bit(ATH_OP_ANI_RUN, &common->op_flags))
+			ath9k_htc_start_ani(priv);
 	}
 
 	if ((changed & BSS_CHANGED_BEACON_ENABLED) && !bss_conf->enable_beacon) {
Signature · 1 line
2.53.0
author maintainer
#46 lore raw

PATCH 46/1005 ntfs: Fix error handling in __ntfs_create()

In reply to Greg Kroah-Hartman

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

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

From: Bart Van Assche <[email protected]>

[ Upstream commit 5210eadc44ccdd9632b1ee66205742610a486989 ]

In __ntfs_create(), if ntfs_init_acl() fails before ntfs_mft_record_alloc() is called, jumping to err_out frees MFT record 0 ($MFT), unmaps an unmapped record and unlocks the unheld &dir_ni->mrec_lock and &ni->mrec_lock mutexes. Call iput(vi) and return ERR_PTR(err) directly instead, matching the ntfs_mft_record_alloc() failure path right below it.

Fixes af0db57d4293 ("ntfs: update inode operations")
---
 fs/ntfs/namei.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/ntfs/namei.c +4 -2
index 3e0adb9a0ea42..850555bc22b22 100644
@@ -449,8 +449,10 @@ static struct ntfs_inode *__ntfs_create(struct mnt_idmap *idmap, struct inode *d
 #ifdef CONFIG_NTFS_FS_POSIX_ACL
 	if (!S_ISLNK(mode) && (sb->s_flags & SB_POSIXACL)) {
 		err = ntfs_init_acl(idmap, vi, dir);
-		if (err)
-			goto err_out;
+		if (err) {
+			iput(vi);
+			return ERR_PTR(err);
+		}
 	} else
 #endif
 	{
Signature · 1 line
2.53.0
author maintainer
#47 lore raw

PATCH 47/1005 printk_ringbuffer: Fix space_used() when blk_lpos->next overflows

In reply to Greg Kroah-Hartman

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

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

From: Wang Wensheng <[email protected]>

[ Upstream commit 2b2dc9dd356aed030e7ac11469d12f736793bc89 ]

Since commit 67e1b0052f6b ("printk_ringbuffer: don't needlessly wrap data blocks around") blk_lpos is treated as not wrapped when blk_lpos->next overflows to the start of data_ring. We use the indices of blk_lpos->next and blk_lpos->start to calculate the size of the data_block. This computes zero minus a small positive value, resulting in underflow and an unexpectedly large value. Simply using the original lpos with wrap-counts solves the problem.

Fixes 67e1b0052f6b ("printk_ringbuffer: don't needlessly wrap data blocks around")
---
 kernel/printk/printk_ringbuffer.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
kernel/printk/printk_ringbuffer.c +3 -5
index 85c0c854b3ce2..1b0198317a2fc 100644
@@ -1238,11 +1238,9 @@ static unsigned int space_used(struct prb_data_ring *data_ring,
 	if (BLK_DATALESS(blk_lpos))
 		return 0;
 
-	if (!is_blk_wrapped(data_ring, blk_lpos->begin, blk_lpos->next)) {
-		/* Data block does not wrap. */
-		return (DATA_INDEX(data_ring, blk_lpos->next) -
-			DATA_INDEX(data_ring, blk_lpos->begin));
-	}
+	/* Data block does not wrap. */
+	if (!is_blk_wrapped(data_ring, blk_lpos->begin, blk_lpos->next))
+		return blk_lpos->next - blk_lpos->begin;
 
 	/*
 	 * For wrapping data blocks, the trailing (wasted) space is
Signature · 1 line
2.53.0
author maintainer
#48 lore raw

PATCH 48/1005 dma-buf: Restore the scatterlist entry count before freeing

In reply to Greg Kroah-Hartman

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

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

From: Leon Romanovsky <[email protected]>

[ Upstream commit 052947a3b5e7402eaad53379dfec2ecab27a2d80 ]

dma_buf_phys_vec_to_sgt() clears orig_nents to mark the returned table as DMA-only. Since sg_free_table() uses orig_nents to walk and free the scatterlist, dma_buf_free_sgt() leaks the allocation on every successful map/unmap cycle.

Restore orig_nents from nents before freeing the table. The helper allocates the DMA list directly, so nents retains the allocation count, including for chained scatterlists.

The reported kmemleak output was:

KMEMLEAK LEAK: 2 driver-related leak(s)
KMEMLEAK LEAK: unreferenced object 0xff11000125ceff00 (size 32):
KMEMLEAK LEAK:   comm dtr, pid 4432, jiffies 4295031027
KMEMLEAK LEAK:   hex dump (first 32 bytes):
KMEMLEAK LEAK:     02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
KMEMLEAK LEAK:     00 00 01 00 28 38 00 00 00 10 00 00 00 00 00 00  ....(8..........
KMEMLEAK LEAK:   backtrace (crc 4e8077f2):
KMEMLEAK LEAK:     __kmalloc_noprof+0x451/0x8b0
KMEMLEAK LEAK:     __sg_alloc_table+0x2a0/0x4d0
KMEMLEAK LEAK:     sg_alloc_table+0x24/0x170
KMEMLEAK LEAK:     dma_buf_phys_vec_to_sgt+0x84f/0xed0
KMEMLEAK LEAK:     0xffffffffa1ad21a8
KMEMLEAK LEAK:     dma_buf_map_attachment+0x138/0x690
KMEMLEAK LEAK:     ib_umem_dmabuf_map_pages+0x249/0xc90 [ib_core]
KMEMLEAK LEAK:     0xffffffffa138f8d2
KMEMLEAK LEAK:     0xffffffffa1396abe
KMEMLEAK LEAK:     0xffffffffa1331a5f
KMEMLEAK LEAK:     0xffffffffa13320dd
KMEMLEAK LEAK:     0xffffffffa1ad696d
KMEMLEAK LEAK:     0xffffffffa1acecc7
KMEMLEAK LEAK:     0xffffffffa1acfd17
KMEMLEAK LEAK:     __x64_sys_ioctl+0x72c/0x11f0
KMEMLEAK LEAK:     do_syscall_64+0xa1/0x4f0
KMEMLEAK LEAK: unreferenced object 0xff1100016dbf3a80 (size 32):
KMEMLEAK LEAK:   comm dtr, pid 4432, jiffies 4295034705
KMEMLEAK LEAK:   hex dump (first 32 bytes):
KMEMLEAK LEAK:     02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
KMEMLEAK LEAK:     00 20 10 00 28 38 00 00 00 10 00 00 00 00 00 00  . ..(8..........
Fixes 3aa31a8bb11e ("dma-buf: provide phys_vec to scatter-gather mapping routine")
---
 drivers/dma-buf/dma-buf-mapping.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/dma-buf/dma-buf-mapping.c +2 -0
index ef0f22854d018..e1e9c93127b51 100644
@@ -251,6 +251,8 @@ void dma_buf_free_sgt(struct dma_buf_attachment *attach, struct sg_table *sgt,
 				       sg_dma_len(sgl), dir, DMA_ATTR_MMIO);
 	}
 
+	/* Restore the allocation count cleared for the DMA-only table. */
+	sgt->orig_nents = sgt->nents;
 	sg_free_table(sgt);
 	kfree(dma->state);
 	kfree(dma);
Signature · 1 line
2.53.0
author maintainer
#49 lore raw

PATCH 49/1005 dma-buf: keep the DMA flags in the DMABUF_DEBUG copy

In reply to Greg Kroah-Hartman

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

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

From: Karl Mehltretter <[email protected]>

[ Upstream commit e87fd0513792a5cf90f502399faa9e19439747e6 ]

With DMABUF_DEBUG, dma_buf_map_attachment() hands the importer a copy of the sg_table that keeps only sg_dma_address() and sg_dma_len(). The dma_flags (SG_DMA_BUS_ADDRESS, SG_DMA_SWIOTLB) are dropped.

The flags describe the DMA side of an entry, which is the side importers may use. Copy them as well.

This is not a bug fix. No importer reads the flags today. Their only readers are dma-iommu, dma-direct and iommu_map_sg(), which are not supposed to see an importer's copy at all. The warn mode added in the next patch keeps its marker in dma_flags and lets importers that do get there continue. They should then see the same flags as without DMABUF_DEBUG.

Assisted-by LLM
Fixes 51db5336e16d ("dma-buf: improve sg_table debugging hack v4")
---
 drivers/dma-buf/dma-buf.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/dma-buf/dma-buf.c +4 -0
index 4c9add51f9ef5..b3d311acb8838 100644
@@ -904,6 +904,10 @@ static int dma_buf_wrap_sg_table(struct sg_table **sg_table)
 		sg_assign_page(to_sg, NULL);
 		sg_dma_address(to_sg) = sg_dma_address(from_sg);
 		sg_dma_len(to_sg) = sg_dma_len(from_sg);
+#ifdef CONFIG_NEED_SG_DMA_FLAGS
+		/* the flags describe the DMA side, e.g. SG_DMA_BUS_ADDRESS */
+		to_sg->dma_flags = from_sg->dma_flags;
+#endif
 		to_sg = sg_next(to_sg);
 	}
 
Signature · 1 line
2.53.0
author maintainer
#50 lore raw

PATCH 50/1005 dma-buf: validate the attachment before asserting its reservation lock

In reply to Greg Kroah-Hartman

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

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

From: Davidlohr Bueso <[email protected]>

[ Upstream commit 6ce0c151d52f6741b6c04569e1886bc7837faa5d ]

dma_buf_phys_vec_to_sgt() asserts the reservation lock before its NULL checks run. Validate first, then assert.

Fixes 3aa31a8bb11e ("dma-buf: provide phys_vec to scatter-gather mapping routine")
---
 drivers/dma-buf/dma-buf-mapping.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma-buf/dma-buf-mapping.c +2 -2
index e1e9c93127b51..5167cda7ea216 100644
@@ -111,12 +111,12 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach,
 	size_t i;
 	int ret;
 
-	dma_resv_assert_held(attach->dmabuf->resv);
-
 	if (WARN_ON(!attach || !attach->dmabuf || !provider))
 		/* This function is supposed to work on MMIO memory only */
 		return ERR_PTR(-EINVAL);
 
+	dma_resv_assert_held(attach->dmabuf->resv);
+
 	dma = kzalloc_obj(*dma);
 	if (!dma)
 		return ERR_PTR(-ENOMEM);
Signature · 1 line
2.53.0
author maintainer
#51 lore raw

PATCH 51/1005 scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts

In reply to Greg Kroah-Hartman

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

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

From: Imre Kaloz <[email protected]>

[ Upstream commit 9a2690eb4bbea8d7fbc3dfe478fca75fe956abb4 ]

The REQUEST SENSE length was taken from sg->len after the AHC_DMA_LAST_SEG flag was or-ed in and the value converted to little-endian, so the 8-bit field is 0x80 on big-endian hosts and the target is asked for 128 bytes into a 32-byte buffer. Use the buffer size, as aic79xx does. On an SGI O2 with a Fujitsu MAX3147NC, the sense data of its CHECK CONDITIONs during probe was lost.

---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aic7xxx/aic7xxx_core.c +1 -1
index 8ad82171e925d..af6115bfb2808 100644
@@ -1097,7 +1097,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
 				sc->byte2 = SCB_GET_LUN(scb) << 5;
 			sc->unused[0] = 0;
 			sc->unused[1] = 0;
-			sc->length = sg->len;
+			sc->length = ahc_get_sense_bufsize(ahc, scb);
 			sc->control = 0;
 
 			/*
Signature · 1 line
2.53.0
author maintainer
#52 lore raw

PATCH 52/1005 scsi: scsi_debug: Drain target cleanup before module exit

In reply to Greg Kroah-Hartman

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

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

From: Giuseppe Piscitelli <[email protected]>

[ Upstream commit 34c99ce2993971712d89010a948d2f650687b796 ]

Target destruction queues cleanup in an exclusive async domain. The module loader's async_synchronize_full() does not wait for exclusive domains. Wait for target cleanup after removing the hosts and before removing the debugfs root and returning from module exit.

Fixes b402a0dce64a ("scsi: scsi_debug: Fix create target debugfs failure")
---
 drivers/scsi/scsi_debug.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/scsi_debug.c +1 -0
index 8290feadc212b..232b4eccd5a11 100644
@@ -8723,6 +8723,7 @@ static void __exit scsi_debug_exit(void)
 
 	sdebug_erase_all_stores(false);
 	xa_destroy(per_store_ap);
+	async_synchronize_full_domain(&sdebug_async_domain);
 	debugfs_remove(sdebug_debugfs_root);
 }
 
Signature · 1 line
2.53.0
author maintainer
#53 lore raw

PATCH 53/1005 scsi: core: Balance the pseudo target reap reference

In reply to Greg Kroah-Hartman

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

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

From: Giuseppe Piscitelli <[email protected]>

[ Upstream commit 8a832fb632da303cdf0704e0d56722ec47799f19 ]

With memory allocation profiling enabled, unloading scsi_debug reports allocations left at module unload. A stock Linux 7.2.11 VM without OpenZFS emitted the following on each of three load/unload cycles:

[    1.644665] drivers/scsi/scsi_debug.c:8863 module scsi_debug func:sdebug_add_host_helper has 1024 allocated at module unload
[    1.656260] drivers/scsi/scsi_debug.c:1261 module scsi_debug func:sdebug_target_alloc has 16 allocated at module unload

scsi_alloc_target() supplies a reap reference for its caller. The SCSI device initializer takes another reference, which device removal drops. scsi_get_pseudo_sdev() drops its caller reference only when device allocation fails. On success the target cannot be destroyed, retaining its driver-private data and its parent host and adapter.

Drop the caller reference in the common cleanup path, as the other scsi_alloc_target() callers do.

---
 drivers/scsi/scsi_scan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/scsi_scan.c +2 -3
index 6cd77b0592e45..53a0af2104ef0 100644
@@ -2156,14 +2156,13 @@ struct scsi_device *scsi_get_pseudo_sdev(struct Scsi_Host *shost)
 		goto out;
 
 	sdev = scsi_alloc_sdev(starget, U64_MAX, NULL);
-	if (!sdev) {
-		scsi_target_reap(starget);
+	if (!sdev)
 		goto put_target;
-	}
 
 	sdev->borken = 0;
 
 put_target:
+	scsi_target_reap(starget);
 	/* See also the get_device(dev) call in scsi_alloc_target(). */
 	put_device(&starget->dev);
 
Signature · 1 line
2.53.0
author maintainer
#54 lore raw

PATCH 54/1005 scsi: aha1542: Remove unneeded scsi_dma_unmap() call

In reply to Greg Kroah-Hartman

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

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

From: Matthew Whitehead <[email protected]>

[ Upstream commit 9ec6671b137de06f0345962fb8091466b7d56a96 ]

aha1542 never DMA maps the command's scatterlist. Data is bounced through a per-command buffer allocated with dma_alloc_coherent() in aha1542_init_cmd_priv(), the adapter is programmed with acmd->data_buffer_handle, and the payload is copied to and from the request segments in aha1542_queuecommand() and aha1542_free_cmd().

The scsi_dma_unmap() call left in aha1542_free_cmd() therefore unmaps a scatterlist that was never mapped. With CONFIG_DMA_API_DEBUG enabled this results in:

device driver tries to free DMA memory it has not allocated

    [device address=0x0000000000000000] [size=0 bytes]

Remove the call.

Verified by testing on real hardware.

---
 drivers/scsi/aha1542.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/aha1542.c +0 -2
index 93dab19c1cb95..1cd85da47cc9c 100644
@@ -271,8 +271,6 @@ static void aha1542_free_cmd(struct scsi_cmnd *cmd)
 			buf += bv.bv_len;
 		}
 	}
-
-	scsi_dma_unmap(cmd);
 }
 
 static irqreturn_t aha1542_interrupt(int irq, void *dev_id)
Signature · 1 line
2.53.0
author maintainer
#55 lore raw

PATCH 55/1005 9p: treat read return values of 0 as EOF

In reply to Greg Kroah-Hartman

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

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

From: Barret Rhoden <[email protected]>

[ Upstream commit a3a6212c7d67baebebd0e4c2cf2ae1b75eb9231e ]

If your 9p server shares a synthetic file system such as sysfs, the file size from stat often disagrees with the actual file size.

Treat non-error reads of 0 as EOF, except in the case where the request was for 0 bytes.

Tested:

	[email protected]:hugelgupf/p9.git, served "/" on 10.0.2.2

	bash-5.3# mount -t 9p -o trans=tcp,port=12345,cache=none 10.0.2.2 /tmp/foo
	bash-5.3# cat /tmp/foo/sys/devices/system/cpu/online
	0-47
Fixes eb497943fa21 ("9p: Convert to using the netfs helper lib to do reads and caching")

Message-ID: <[email protected]>

---
 fs/9p/vfs_addr.c | 3 +++
 1 file changed, 3 insertions(+)
fs/9p/vfs_addr.c +3 -0
index 13cf87a5f90cb..a48cc34b9a23a 100644
@@ -99,6 +99,7 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)
 	char *target;
 	unsigned long long pos = subreq->start + subreq->transferred;
 	int total = 0, err, len, n;
+	size_t to_read = iov_iter_count(&subreq->io_iter);
 
 	if (S_ISLNK(rreq->inode->i_mode)) {
 		/* p9_client_readlink() must not be called for legacy protocols
@@ -131,6 +132,8 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)
 		__set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags);
 	if (pos + total >= i_size_read(rreq->inode))
 		__set_bit(NETFS_SREQ_HIT_EOF, &subreq->flags);
+	if (!err && !total && to_read)
+		__set_bit(NETFS_SREQ_HIT_EOF, &subreq->flags);
 	if (!err && total) {
 		subreq->transferred += total;
 		__set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);
Signature · 1 line
2.53.0
author maintainer
#56 lore raw

PATCH 56/1005 9p: fix kernel-doc warning for enum p9_session_flags

In reply to Greg Kroah-Hartman

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

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

From: Omokefe Emmanuel Onanaroghene <[email protected]>

[ Upstream commit d037e9c1b40c28eb57ea10947141cad3781b91a7 ]

kernel-doc cannot parse enum p9_session_flags, since its documentation comment is followed by #define lines instead of the enum declaration:

fs/9p/v9fs.h:31 : error: Cannot parse enum!

Move the three #define lines below the enum whose values they are derived from, and give V9FS_ACCESS_ANY and V9FS_ACCESS_MASK their own kernel-doc comments with the descriptions they had in the enum comment.

Also document the four enum members that had no description, using the corresponding mount option wording from Documentation/filesystems/9p.rst.

Fixes 76381a42e4a5 ("fs/9p: Add access = client option to opt in acl evaluation.")
Assisted-by LLM

Message-ID: <[email protected]>

[Dominique: slight reword, also fixed typo in Doc/ for access=client]
---
 Documentation/filesystems/9p.rst |  2 +-
 fs/9p/v9fs.h                     | 26 ++++++++++++++++++--------
 2 files changed, 19 insertions(+), 9 deletions(-)
Documentation/filesystems/9p.rst +1 -1
index 3f65db648db06..dc1f5f9632d8d 100644
@@ -228,7 +228,7 @@ Options
 			any
 				v9fs does single attach and performs all
 				operations as one user
-			clien
+			client
 				 ACL based access check on the 9p client
 			         side for access validation
 
fs/9p/v9fs.h +18 -8
index 2ac863dc8446c..9a730d2d9d87d 100644
@@ -21,20 +21,16 @@
  * @V9FS_ACCESS_SINGLE: only the mounting user can access the hierarchy
  * @V9FS_ACCESS_USER: a new attach will be issued for every user (default)
  * @V9FS_ACCESS_CLIENT: Just like user, but access check is performed on client.
- * @V9FS_ACCESS_ANY: use a single attach for all users
- * @V9FS_ACCESS_MASK: bit mask of different ACCESS options
  * @V9FS_POSIX_ACL: POSIX ACLs are enforced
+ * @V9FS_NO_XATTR: do not offer xattr functions on this mount
+ * @V9FS_IGNORE_QV: ignore qid.version==0 as a marker to disable data cache
+ * @V9FS_DIRECT_IO: disable data read/write cache
+ * @V9FS_SYNC: disable data write cache
  * @V9FS_NDENTRY_TIMEOUT_SET: Has negative dentry timeout retention time been
  *                            overridden by negtimeout mount option
  *
  * Session flags reflect options selected by users at mount time
  */
-#define	V9FS_ACCESS_ANY (V9FS_ACCESS_SINGLE | \
-			 V9FS_ACCESS_USER |   \
-			 V9FS_ACCESS_CLIENT)
-#define V9FS_ACCESS_MASK V9FS_ACCESS_ANY
-#define V9FS_ACL_MASK V9FS_POSIX_ACL
-
 enum p9_session_flags {
 	V9FS_PROTO_2000U         = 0x01,
 	V9FS_PROTO_2000L         = 0x02,
@@ -49,6 +45,20 @@ enum p9_session_flags {
 	V9FS_NDENTRY_TIMEOUT_SET = 0x400,
 };
 
+/**
+ * V9FS_ACCESS_ANY - use a single attach for all users
+ */
+#define	V9FS_ACCESS_ANY (V9FS_ACCESS_SINGLE | \
+			 V9FS_ACCESS_USER |   \
+			 V9FS_ACCESS_CLIENT)
+
+/**
+ * V9FS_ACCESS_MASK - bit mask of different ACCESS options
+ */
+#define V9FS_ACCESS_MASK V9FS_ACCESS_ANY
+
+#define V9FS_ACL_MASK V9FS_POSIX_ACL
+
 /**
  * enum p9_cache_shortcuts - human readable cache preferences
  * @CACHE_SC_NONE: disable all caches
Signature · 1 line
2.53.0
author maintainer
#57 lore raw

PATCH 57/1005 9p: fall back to the normal open path for non-regular files

In reply to Greg Kroah-Hartman

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

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

From: Yuanfu Xie <[email protected]>

[ Upstream commit ff1baa01a6e1f24741f7428119e6f3a61b995604 ]

v9fs_vfs_atomic_open() and v9fs_vfs_atomic_open_dotl() call finish_open(file, dentry, generic_file_open) regardless of the file type the server reported for the created dentry. The supplied callback replaces f_op->open in do_dentry_open(), so blkdev_open() never runs for a server-reported device node: an open() with O_CREAT succeeds with f_op = def_blk_fops while f_mapping still points at the 9p inode, because the bdev mapping swap only happens inside blkdev_open(). The block file methods then derive their block_device from that inode with I_BDEV(); the loads land at the tail of a 656-byte v9fs_inode_cache object (offsets +624 and +632), which KASAN reports as slab-out-of-bounds, and the garbage they read is then dereferenced, so the first read(), write(), ioctl() or close() ends in a NULL pointer write and a panic. In the ioctl(BLKGETSIZE64) variant the value read this way is returned to userspace.

The server controls the file type reported for the create, so a malicious server can crash the client this way. KASAN report of the read() variant, on a build of linux-stable 2709dd5ae32f:

BUG: KASAN: slab-out-of-bounds in blkdev_read_iter+0x3cd/0x440
Read of size 8 at addr ffff88800828ceb0 by task repro/1

Call Trace:
 <TASK>
 dump_stack_lvl+0x7b/0xa0
 print_report+0xd0/0x630
 kasan_report+0xe5/0x120
 blkdev_read_iter+0x3cd/0x440
 vfs_read+0x718/0xa50
 ksys_read+0x10f/0x200
 do_syscall_64+0xdd/0x4a0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
 </TASK>

The buggy address belongs to the object at ffff88800828cc40
 which belongs to the cache v9fs_inode_cache of size 656

The buggy address is located 624 bytes inside of
allocated 656-byte region [ffff88800828cc40, ffff88800828ced0)

A plain open() without O_CREAT is not affected: it runs blkdev_open() and either maps the device correctly or fails with -ENXIO for an rdev with no registered device. When the created inode is not a regular file, clunk the fid the create opened. The unopened fid is already on the dentry. Set FMODE_CREATED and return finish_no_open(file, NULL) so the VFS keeps its dentry reference and calls the inode's ->open. Regular files still use finish_open() with generic_file_open.

Fixes be12af3ef5e6 ("getting rid of 'opened' argument of ->atomic_open() - part 1")

Message-ID: <[email protected]>

---
 fs/9p/vfs_inode.c      | 10 ++++++++++
 fs/9p/vfs_inode_dotl.c | 12 ++++++++++++
 2 files changed, 22 insertions(+)
fs/9p/vfs_inode.c +10 -0
index 2d7e0c1a5353a..347739b81513f 100644
@@ -810,6 +810,16 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
 	v9fs_invalidate_inode_attr(dir);
 	inode = d_inode(dentry);
 	v9inode = V9FS_I(inode);
+	if (!S_ISREG(inode->i_mode)) {
+		/*
+		 * Not a regular file.  v9fs_create() already stored the
+		 * unopened fid on the dentry.  Clunk the opened fid from
+		 * the create and let the VFS call ->open.
+		 */
+		p9_fid_put(fid);
+		file->f_mode |= FMODE_CREATED;
+		return finish_no_open(file, NULL);
+	}
 	err = finish_open(file, dentry, generic_file_open);
 	if (unlikely(err)) {
 		p9_fid_put(fid);
fs/9p/vfs_inode_dotl.c +12 -0
index 116b29e95f21e..1431549b1f4d8 100644
@@ -312,6 +312,18 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
 	v9fs_fid_add(dentry, &fid);
 	d_instantiate(dentry, inode);
 
+	if (!S_ISREG(inode->i_mode)) {
+		/*
+		 * Not a regular file.  The unopened fid is already on the
+		 * dentry.  Clunk the opened create fid and let the VFS call
+		 * ->open.
+		 */
+		p9_fid_put(ofid);
+		ofid = NULL;
+		file->f_mode |= FMODE_CREATED;
+		err = finish_no_open(file, NULL);
+		goto out;
+	}
 	/* Since we are opening a file, assign the open fid to the file */
 	err = finish_open(file, dentry, generic_file_open);
 	if (err)
Signature · 1 line
2.53.0
author maintainer
#58 lore raw

PATCH 58/1005 9p: do not store the create fid on special files

In reply to Greg Kroah-Hartman

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

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

From: Yuanfu Xie <[email protected]>

[ Upstream commit 56894cadf21c34abbba7f74b8f5d78dabf69dd39 ]

v9fs_vfs_atomic_open_dotl() always stores the create fid in file->private_data after finish_open(). FIFO and device inodes already have type-specific file_operations that own that field. Overwriting it with the fid makes later read/write/close treat the p9_fid as a pipe_inode_info, which corrupts the fid and can use it after it has been clunked. The non-dotl atomic_open path does not assign the fid this way.

Only attach the fid for regular files and directories. Special files do not need the create fid; leave it for the existing p9_fid_put() on the out path so it is clunked before return.

KASAN report, linux-stable 4982d3552a3b:

BUG: KASAN: slab-use-after-free in anon_pipe_prefill_and_lock+0x376/0x3f0
Read of size 4 at addr ffff88800ab30538 by task repro/1

Call Trace:
 <TASK>
 anon_pipe_prefill_and_lock+0x376/0x3f0
 anon_pipe_write+0x127/0x1600
 fifo_pipe_write+0x24/0x300
 vfs_write+0x659/0xd00
 ksys_write+0x10f/0x200
 do_syscall_64+0xdd/0x4a0
 </TASK>
Fixes 30d904947459 ("kill struct opendata")

Message-ID: <[email protected]>

---
 fs/9p/vfs_inode_dotl.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
fs/9p/vfs_inode_dotl.c +16 -8
index 1431549b1f4d8..d9156b2509aca 100644
@@ -328,16 +328,24 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
 	err = finish_open(file, dentry, generic_file_open);
 	if (err)
 		goto out;
-	file->private_data = ofid;
+	/*
+	 * Special files have type-specific fops that own
+	 * file->private_data.  The create fid is unused
+	 * there: leave it for p9_fid_put() on the out
+	 * path so it is clunked before we return.
+	 */
+	if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) {
+		file->private_data = ofid;
 #ifdef CONFIG_9P_FSCACHE
-	if (v9ses->cache & CACHE_FSCACHE) {
-		struct v9fs_inode *v9inode = V9FS_I(inode);
-		fscache_use_cookie(v9fs_inode_cookie(v9inode),
-				   file->f_mode & FMODE_WRITE);
-	}
+		if (v9ses->cache & CACHE_FSCACHE) {
+			struct v9fs_inode *v9inode = V9FS_I(inode);
+			fscache_use_cookie(v9fs_inode_cookie(v9inode),
+					   file->f_mode & FMODE_WRITE);
+		}
 #endif
-	v9fs_fid_add_modes(ofid, v9ses->flags, v9ses->cache, flags);
-	v9fs_open_fid_add(inode, &ofid);
+		v9fs_fid_add_modes(ofid, v9ses->flags, v9ses->cache, flags);
+		v9fs_open_fid_add(inode, &ofid);
+	}
 	file->f_mode |= FMODE_CREATED;
 out:
 	p9_fid_put(dfid);
Signature · 1 line
2.53.0
author maintainer
#59 lore raw

PATCH 59/1005 ntfs: initialize VCN when inserting index entries

In reply to Greg Kroah-Hartman

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

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

From: Hyunchul Lee <[email protected]>

[ Upstream commit 1f3c5ba3c55c112a0b33c03caa9d5f88bb9e7759 ]

When a leaf index entry is promoted during a split, ntfs_ih_insert() extends a copied entry with the NODE VCN field. Initialize that field before copying the new entry into the parent index. The promoted entry must reference the old child VCN, while the existing parent entry is updated to reference the newly allocated right child.

Fixes 0a8ac0c1fa0b ("ntfs: update directory operations")
---
 fs/ntfs/index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs/index.c +1 -1
index 9a23d0786959b..9309e617451e1 100644
@@ -1547,9 +1547,9 @@ static int ntfs_ih_insert(struct index_header *ih, struct index_entry *orig_ie,
 	ie_node = ntfs_ie_get_by_pos(ih, pos);
 	old_vcn = ntfs_ie_get_vcn(ie_node);
 	ntfs_ie_set_vcn(ie_node, new_vcn);
+	ntfs_ie_set_vcn(ie, old_vcn);
 
 	ntfs_ie_insert(ih, ie, ie_node);
-	ntfs_ie_set_vcn(ie_node, old_vcn);
 out:
 	kfree(ie);
 	return ret;
Signature · 1 line
2.53.0
author maintainer
#60 lore raw

PATCH 60/1005 ntfs: avoid overflow when limiting attribute read length

In reply to Greg Kroah-Hartman

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

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

From: Hyunchul Lee <[email protected]>

[ Upstream commit 4b927614d92d7326f265d22b50ba7b4a33966e48 ]

ntfs_inode_attr_pread() limits a read to the attribute size using pos + count. A large count can overflow the signed sum and bypass the attribute EOF boundary check. Compare count with isize - pos instead, after validating pos, so the read length limit cannot wrap.

Fixes af0db57d4293 ("ntfs: update inode operations")
---
 fs/ntfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs/inode.c +1 -1
index 64c415edc398c..907fe8ecb2a30 100644
@@ -3630,7 +3630,7 @@ s64 ntfs_inode_attr_pread(struct inode *vi, s64 pos, s64 count, u8 *buf)
 		mutex_unlock(&ni->mrec_lock);
 		return -EINVAL;
 	}
-	if (pos + count > isize)
+	if (count > isize - pos)
 		count = isize - pos;
 
 	if (!NInoNonResident(ni)) {
Signature · 1 line
2.53.0
author maintainer
#61 lore raw

PATCH 61/1005 wifi: ath10k: Stop unanswered temperature reads

In reply to Greg Kroah-Hartman

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

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

From: Filippo Falezza <[email protected]>

[ Upstream commit 2a87e367c62856b87a90f745c6b7d2eb91e0c51f ]

Reading the ath10k hwmon temperature sends WMI_PDEV_GET_TEMPERATURE and waits up to 5 s (ATH10K_THERMAL_SYNC_TIMEOUT_HZ) for the reply event, holding conf_mutex. Not all firmware answers: the WCN3990 firmware WLAN.HL.3.3.1-00694-QCAHLSWMTPLZ-1 on a Motorola Moto G 5G Plus codename nairo (SM7250) never sends the event, so every read of temp1_input stalls for 5 s, logs

ath10k_snoc 18800000.wifi: failed to synchronize thermal read

and returns -ETIMEDOUT. Tools that read all hwmon sensors, such as lm-sensors, hang for 5 s on every run, and configuration changes of the interface wait for conf_mutex in the meantime.

Whether the firmware answers cannot be told from the chip: firmware that answers and firmware that does not both advertise WMI_SERVICE_THERM_THROT, and WCN3990 firmware differs between devices. Instead, remember that the running firmware did not answer, and return -EOPNOTSUPP right away on later reads. Forget it when the firmware starts, so that a restarted or updated firmware is asked again.

The first read after each firmware start still takes 5 s when the firmware does not answer. Reads on firmware that answers are unchanged.

Fixes e98199a8c27f ("ath10k: enable QCA6174/QCA9377 to read the chip temperature")
---
 drivers/net/wireless/ath/ath10k/core.c    | 1 +
 drivers/net/wireless/ath/ath10k/thermal.c | 9 ++++++++-
 drivers/net/wireless/ath/ath10k/thermal.h | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/core.c +1 -0
index 7c2939cbde5f0..a749ae582b0a4 100644
@@ -2985,6 +2985,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
 	clear_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags);
 
 	ar->running_fw = fw;
+	ar->thermal.broken = false;
 
 	if (!test_bit(ATH10K_FW_FEATURE_NON_BMI,
 		      ar->running_fw->fw_file.fw_features)) {
drivers/net/wireless/ath/ath10k/thermal.c +8 -1
index 9bb486f8e9207..9ff7de0abd129 100644
@@ -75,6 +75,12 @@ static ssize_t ath10k_thermal_show_temp(struct device *dev,
 		goto out;
 	}
 
+	/* Don't stall every read on firmware that never answers */
+	if (ar->thermal.broken) {
+		ret = -EOPNOTSUPP;
+		goto out;
+	}
+
 	reinit_completion(&ar->thermal.wmi_sync);
 	ret = ath10k_wmi_pdev_get_temperature(ar);
 	if (ret) {
@@ -90,7 +96,8 @@ static ssize_t ath10k_thermal_show_temp(struct device *dev,
 	time_left = wait_for_completion_timeout(&ar->thermal.wmi_sync,
 						ATH10K_THERMAL_SYNC_TIMEOUT_HZ);
 	if (!time_left) {
-		ath10k_warn(ar, "failed to synchronize thermal read\n");
+		ath10k_warn(ar, "failed to synchronize thermal read, not asking again until the firmware restarts\n");
+		ar->thermal.broken = true;
 		ret = -ETIMEDOUT;
 		goto out;
 	}
drivers/net/wireless/ath/ath10k/thermal.h +2 -0
index 1f4de9fbf2b30..d1fb5b958c37c 100644
@@ -19,6 +19,8 @@ struct ath10k_thermal {
 	/* protected by conf_mutex */
 	u32 throttle_state;
 	u32 quiet_period;
+	/* the running firmware did not answer a temperature request */
+	bool broken;
 	/* temperature value in Celsius degree
 	 * protected by data_lock
 	 */
Signature · 1 line
2.53.0
author maintainer
#62 lore raw

PATCH 62/1005 wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler

In reply to Greg Kroah-Hartman

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

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

From: P Praneesh <[email protected]>

[ Upstream commit 216dd4fc57435726506e250ba2483f31ddc3c01b ]

On AHB platforms such as IPQ5332, IRQ group 3 maps multiple hardware rings to a single NAPI instance. Each ring is assigned its own IRQ line, but all IRQs in the group share one napi struct and one poll function.

When two IRQs from the same group fire simultaneously on different CPUs, both handlers call ath12k_ahb_ext_grp_disable(), which invokes disable_irq_nosync() for every IRQ in the group. This increments the interrupt controller's disable reference count for each IRQ twice. The single NAPI poll that runs calls ath12k_ahb_ext_grp_enable() once, decrementing each count from 2 to 1. Because the count never reaches 0, all IRQs in the group remain permanently masked by the interrupt controller.

With no further interrupts, TX completions stop being reaped from the WBM release ring. The pending TX descriptor count grows until the WBM idle link descriptor pool is exhausted. Once full, TX ring allocation fails and no new packets including management frames can be enqueued. This causes stations to disassociate with reason 34 (DISASSOC_LOW_ACK) and ath12k_mac_flush() to time out:
"failed to flush transmit queue, data pkts req N pending N" where N equals ATH12K_NUM_POOL_TX_DESC(ab).

Fix this by using napi_schedule_prep() to atomically test-and-set NAPI_STATE_SCHED before disabling IRQs. Only the first CPU to win the atomic operation disables the group and calls __napi_schedule(). Any concurrent handler that loses the race skips the disable entirely, keeping the reference count balanced. Guard the enable_irq() call in the poll routine with the return value of napi_complete_done() to prevent an unbalanced enable if the NAPI instance was re-scheduled before the poll completed.

Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.7-00587-QCAHKSWPL_SILICONZ-1

---
 drivers/net/wireless/ath/ath12k/ahb.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath12k/ahb.c +6 -5
index df79f15c1ccae..31009313e07b8 100644
@@ -574,8 +574,8 @@ static int ath12k_ahb_ext_grp_napi_poll(struct napi_struct *napi, int budget)
 
 	work_done = ath12k_dp_service_srng(dp, irq_grp, budget);
 	if (work_done < budget) {
-		napi_complete_done(napi, work_done);
-		ath12k_ahb_ext_grp_enable(irq_grp);
+		if (likely(napi_complete_done(napi, work_done)))
+			ath12k_ahb_ext_grp_enable(irq_grp);
 	}
 
 	if (work_done > budget)
@@ -591,9 +591,10 @@ static irqreturn_t ath12k_ahb_ext_interrupt_handler(int irq, void *arg)
 	/* last interrupt received for this group */
 	irq_grp->timestamp = jiffies;
 
-	ath12k_ahb_ext_grp_disable(irq_grp);
-
-	napi_schedule(&irq_grp->napi);
+	if (napi_schedule_prep(&irq_grp->napi)) {
+		ath12k_ahb_ext_grp_disable(irq_grp);
+		__napi_schedule(&irq_grp->napi);
+	}
 
 	return IRQ_HANDLED;
 }
Signature · 1 line
2.53.0
author maintainer
#63 lore raw

PATCH 63/1005 wifi: ath12k: set MSDU payload correctly

In reply to Greg Kroah-Hartman

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

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

From: Kang Yang <[email protected]>

[ Upstream commit fe74d991f3387febfd57b65c7383d2d49e14e19a ]

ath12k_dp_mon_rx_merg_msdus() mistakenly passes head_msdu to ath12k_dp_mon_rx_msdus_set_payload() while iterating over all MSDUs in the chain.

As a result, skb_pull() is applied repeatedly to the head MSDU, whereas the remaining MSDUs are never adjusted.

Pass the current MSDU instead so each MSDU is processed exactly once.

Also rename the helper parameter from head_msdu to msdu since the helper operates on any MSDU in the chain.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

---
 drivers/net/wireless/ath/ath12k/dp_mon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath12k/dp_mon.c +4 -4
index db20d27b63338..fdbdad72a3c9f 100644
@@ -186,7 +186,7 @@ ath12k_dp_mon_fill_rx_rate(struct ath12k_pdev_dp *dp_pdev,
 }
 
 static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k_base *ab,
-					       struct sk_buff *head_msdu,
+					       struct sk_buff *msdu,
 					       struct sk_buff *tail_msdu)
 {
 	u32 rx_pkt_offset, l2_hdr_offset, total_offset;
@@ -200,7 +200,7 @@ static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k_base *ab,
 	else
 		total_offset = rx_pkt_offset + l2_hdr_offset;
 
-	skb_pull(head_msdu, total_offset);
+	skb_pull(msdu, total_offset);
 }
 
 struct sk_buff *
@@ -261,7 +261,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k_pdev_dp *dp_pdev,
 		head_frag_list = NULL;
 
 		while (msdu) {
-			ath12k_dp_mon_rx_msdus_set_payload(ab, head_msdu, tail_msdu);
+			ath12k_dp_mon_rx_msdus_set_payload(ab, msdu, tail_msdu);
 
 			if (!head_frag_list)
 				head_frag_list = msdu;
@@ -296,7 +296,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k_pdev_dp *dp_pdev,
 		msdu = head_msdu;
 
 		while (msdu) {
-			ath12k_dp_mon_rx_msdus_set_payload(ab, head_msdu, tail_msdu);
+			ath12k_dp_mon_rx_msdus_set_payload(ab, msdu, tail_msdu);
 			if (qos_pkt) {
 				dest = skb_push(msdu, sizeof(__le16));
 				if (!dest)
Signature · 1 line
2.53.0
author maintainer
#64 lore raw

PATCH 64/1005 seg6: fix transport header for inner IPv4 with IP options

In reply to Greg Kroah-Hartman

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

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

From: Andrea Mayer <[email protected]>

[ Upstream commit 5838f10563d58afca6711edb5e4eda968ca181d9 ]

The End.DT4, End.DT46 (its IPv4 path only) and End.DX4 behaviors set the transport header of the decapsulated IPv4 packet at a fixed 20 bytes, the size of an IPv4 header without options. They do not validate the header length either. With options, the transport header points at the first option byte. The effects include:
- ping -R sends an echo request with a 60-byte IPv4 header to a local address through an End.DT4 or an End.DX4 SID. Since icmp_rcv() computes the ICMP checksum from the first option byte, the request fails the check and is counted in IcmpInCsumErrors.
- A UDP datagram can reach a port that an iptables rule drops. The rule checks the UDP header after the full IPv4 header, while the socket lookup reads it at the fixed 20-byte offset.
- With an inbound AH state, ah_input() reads the AH header at the fixed 20-byte offset, but copies the IPv4 header over it with the length in the IHL field. A packet shorter than that length can make ah_input() write past the end of the data, into skb_shared_info when the skb has no tailroom.

Validate the inner IPv4 header length with the new helper seg6_validate_iphdr_len() and set the transport header at that length. A packet that is not IPv4, whose header length field is below 5, or whose header is truncated, is dropped with a drop reason. The fix is limited to the header length, which the transport header relies on. Other checks done on IPv4 input, such as the header checksum, the total length and the IP options, are not addressed here.

Found by code inspection while reviewing commit 44930446dde4 ("ipv6: seg6:
clear IPv4 control block on IPIP decapsulation"), as a pre-existing issue that Sashiko also reported on v2 of that patch. Without this patch, a bpftrace probe on ah_input() shows the reporter's reproducer packet written into skb_shared_info. With it, that packet is dropped before ah_input(), ping -R no longer fails the ICMP checksum, the UDP datagram reaches its real port, and the SRv6 selftests still pass. These effects reproduce on an unmodified kernel, without error injection.

Fixes 891ef8dd2a8d ("ipv6: sr: implement additional seg6local actions")
Fixes 664d6f86868b ("seg6: add support for the SRv6 End.DT4 behavior")
---
 net/ipv6/seg6_local.c | 69 +++++++++++++++++++++++++++++++++----------
 1 file changed, 53 insertions(+), 16 deletions(-)
net/ipv6/seg6_local.c +53 -16
index 0c3d1be7f1299..0d952514d095b 100644
@@ -149,9 +149,7 @@ struct seg6_end_dt_info {
 	int vrf_ifindex;
 	int vrf_table;
 
-	/* tunneled packet family (IPv4 or IPv6).
-	 * Protocol and header length are inferred from family.
-	 */
+	/* tunneled packet family (IPv4 or IPv6) */
 	u16 family;
 };
 
@@ -1056,6 +1054,40 @@ static int input_action_end_dx6(struct sk_buff *skb,
 	return -EINVAL;
 }
 
+/* Validate the length of the IPv4 header at skb->data (which must point to
+ * the network header) and report that length, options included.
+ * Only the version, the header length and the presence of the whole header
+ * are checked.
+ * The length is written only when SKB_NOT_DROPPED_YET is returned.
+ *
+ * skb pointers may change: after this call, the caller must evaluate again
+ * any pointer into the packet data.
+ */
+static enum skb_drop_reason
+seg6_validate_iphdr_len(struct sk_buff *skb, int *hdrlen)
+{
+	enum skb_drop_reason reason;
+	const struct iphdr *iph;
+	int len;
+
+	reason = pskb_may_pull_reason(skb, sizeof(struct iphdr));
+	if (reason)
+		return reason;
+
+	iph = ip_hdr(skb);
+	if (iph->version != 4 || iph->ihl < 5)
+		return SKB_DROP_REASON_IP_INHDR;
+
+	len = ip_hdrlen(skb);
+
+	reason = pskb_may_pull_reason(skb, len);
+	if (reason)
+		return reason;
+
+	*hdrlen = len;
+	return SKB_NOT_DROPPED_YET;
+}
+
 static int input_action_end_dx4_finish(struct net *net, struct sock *sk,
 				       struct sk_buff *skb)
 {
@@ -1085,14 +1117,18 @@ static int input_action_end_dx4_finish(struct net *net, struct sock *sk,
 static int input_action_end_dx4(struct sk_buff *skb,
 				struct seg6_local_lwt *slwt)
 {
+	SKB_DR(reason);
+	int hdrlen;
+
 	if (!decap_and_validate(skb, IPPROTO_IPIP))
 		goto drop;
 
-	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
+	reason = seg6_validate_iphdr_len(skb, &hdrlen);
+	if (reason)
 		goto drop;
 
 	skb->protocol = htons(ETH_P_IP);
-	skb_set_transport_header(skb, sizeof(struct iphdr));
+	skb_set_transport_header(skb, hdrlen);
 	nf_reset_ct(skb);
 
 	if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
@@ -1102,7 +1138,7 @@ static int input_action_end_dx4(struct sk_buff *skb,
 
 	return input_action_end_dx4_finish(dev_net(skb->dev), NULL, skb);
 drop:
-	kfree_skb(skb);
+	kfree_skb_reason(skb, reason);
 	return -EINVAL;
 }
 
@@ -1237,16 +1273,24 @@ static struct sk_buff *end_dt_vrf_core(struct sk_buff *skb,
 	struct seg6_end_dt_info *info = &slwt->dt_info;
 	struct net_device *vrf;
 	__be16 protocol;
+	SKB_DR(reason);
 	int hdrlen;
 
 	vrf = end_dt_get_vrf_rcu(skb, info);
 	if (unlikely(!vrf))
 		goto drop;
 
+	if (unlikely(info->family != AF_UNSPEC && info->family != family)) {
+		pr_warn_once("seg6local: SRv6 End.DT* family mismatch");
+		goto drop;
+	}
+
 	switch (family) {
 	case AF_INET:
 		protocol = htons(ETH_P_IP);
-		hdrlen = sizeof(struct iphdr);
+		reason = seg6_validate_iphdr_len(skb, &hdrlen);
+		if (unlikely(reason))
+			goto drop;
 		break;
 	case AF_INET6:
 		protocol = htons(ETH_P_IPV6);
@@ -1258,11 +1302,6 @@ static struct sk_buff *end_dt_vrf_core(struct sk_buff *skb,
 		goto drop;
 	}
 
-	if (unlikely(info->family != AF_UNSPEC && info->family != family)) {
-		pr_warn_once("seg6local: SRv6 End.DT* family mismatch");
-		goto drop;
-	}
-
 	skb->protocol = protocol;
 
 	skb_dst_drop(skb);
@@ -1273,7 +1312,7 @@ static struct sk_buff *end_dt_vrf_core(struct sk_buff *skb,
 	return end_dt_vrf_rcv(skb, family, vrf);
 
 drop:
-	kfree_skb(skb);
+	kfree_skb_reason(skb, reason);
 	return ERR_PTR(-EINVAL);
 }
 
@@ -1286,9 +1325,7 @@ static int input_action_end_dt4(struct sk_buff *skb,
 	if (!decap_and_validate(skb, IPPROTO_IPIP))
 		goto drop;
 
-	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
-		goto drop;
-
+	/* end_dt_vrf_core() validates the inner IPv4 header length */
 	skb = end_dt_vrf_core(skb, slwt, AF_INET);
 	if (!skb)
 		/* packet has been processed and consumed by the VRF */
Signature · 1 line
2.53.0
author maintainer
#65 lore raw

PATCH 65/1005 drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes

In reply to Greg Kroah-Hartman

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

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

From: Michal Wilczynski <[email protected]>

[ Upstream commit 6c6200ffebf9766fd5d9293002298ea371c261c1 ]

Sparse (W=1) builds fail because SIZE_CHECK(struct rogue_fwif_hwrtdata, 384) expects 384 bytes, but the compiler generates a 336-byte structure.

This is due to an alignment conflict: the inner member cleanup_state requires 64-byte alignment, but the outer struct is explicitly marked __aligned(8).

While a non-sparse build implicitly pads the size to a multiple of 64, a sparse build strictly respects the 8-byte outer alignment, resulting in a size mismatch.

Fix this by aligning the entire structure to 64 bytes, which resolves the contradiction and forces the correct 384 byte size on all builds.

---
 drivers/gpu/drm/imagination/pvr_rogue_fwif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/imagination/pvr_rogue_fwif.h +1 -1
index 5d590c4c25663..2f8daa93c9e68 100644
@@ -2174,7 +2174,7 @@ struct rogue_fwif_hwrtdata {
 	bool geom_caches_need_zeroing __aligned(4);
 
 	struct rogue_fwif_cleanup_ctl cleanup_state __aligned(64);
-} __aligned(8);
+} __aligned(64);
 
 /*
  ******************************************************************************
Signature · 1 line
2.53.0
author maintainer
#66 lore raw

PATCH 66/1005 gpio: omap: Propagate runtime PM failures in probe and request

In reply to Greg Kroah-Hartman

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

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

From: Avi Weiss <[email protected]>

[ Upstream commit 05be1a99d6d68b24cbe24a191e1af67c70193ac3 ]

pm_runtime_get_sync() can fail when the OMAP PM domain cannot resume a GPIO controller, but omap_gpio_probe() and omap_gpio_request() ignore its return value.

Consequently, probe can register a GPIO controller despite a failed resume, while a GPIO request can report success and modify GPIO state even though runtime-PM acquisition failed.

Use pm_runtime_resume_and_get() in both paths and propagate resume errors. On probe failure, disable runtime PM and unprepare the debounce clock when applicable.

Reproduced both failures on QEMU N800 by injecting -EIO from the OMAP PM-domain resume callback. The original driver continues probe and accepts the GPIO request - while the patched driver rejects both operations with -EIO. Normal GPIO controller registration continues to work without fault injection.

Fixes 77640aabd755 ("OMAP: GPIO: Implement GPIO as a platform device")
Fixes 55b93c32520d ("gpio/omap: use pm-runtime framework")
---
 drivers/gpio/gpio-omap.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/gpio/gpio-omap.c +11 -2
index 005420baecf4d..98a88dfda1954 100644
@@ -813,8 +813,11 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset)
 {
 	struct gpio_bank *bank = gpiochip_get_data(chip);
 	unsigned long flags;
+	int ret;
 
-	pm_runtime_get_sync(chip->parent);
+	ret = pm_runtime_resume_and_get(chip->parent);
+	if (ret < 0)
+		return ret;
 
 	raw_spin_lock_irqsave(&bank->lock, flags);
 	omap_enable_gpio_module(bank, offset);
@@ -1468,7 +1471,13 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, bank);
 
 	pm_runtime_enable(dev);
-	pm_runtime_get_sync(dev);
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret < 0) {
+		pm_runtime_disable(dev);
+		if (bank->dbck_flag)
+			clk_unprepare(bank->dbck);
+		return ret;
+	}
 
 	if (bank->is_mpuio)
 		omap_mpuio_init(bank);
Signature · 1 line
2.53.0
author maintainer
#67 lore raw

PATCH 67/1005 x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address

In reply to Greg Kroah-Hartman

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

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

From: Daniel Borkmann <[email protected]>

[ Upstream commit 31ac959c915cc7f379d84cf9dadf3664cbcace02 ]

Since commit 0c3772a8db1f ("x86/ftrace: Implement DYNAMIC_FTRACE_WITH_JMP") ftrace_call_replace() emits a jmp instead of a call when bit 0 of the target is set, the mark of a direct trampoline that is entered by a jmp. ftrace_update_ftrace_func() and arch_ftrace_update_trampoline() use it too, for the call of the ftrace callback in ftrace_caller, ftrace_regs_caller and the ftrace trampolines, but a callback is a C function and can start at an odd address. It does with gcc13 and CONFIG_CC_OPTIMIZE_FOR_SIZE=y:
gcc13 has no -fmin-function-alignment, so CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT is not set, and the -falign-functions=16 used in its place does not apply to functions optimized for size. Here ftrace_ops_list_func() starts at:

ffffffff810e0147 T ftrace_ops_list_func

ftrace_regs_call then becomes a jmp to the byte before it:

ftrace_regs_call ffffffff810374f3: e9 4e 8c 0a 00

That byte is the last one of the preceding function's tail jump, and with the first two of ftrace_ops_list_func() it decodes as an inc DWORD PTR [rcx+0x57], which swallows the push %r15 of the prologue. Entered without a return address and one push short, the list function returns through the pt_regs that ftrace_regs_caller saved, here to the saved R14:

  BUG: unable to handle page fault for address: ffff888116c29f40
  #PF: supervisor instruction fetch in kernel mode
  RIP: 0010:0xffff888116c29f40
  R13: 0000000000000000 R14: ffff888116c29f40 R15: 0000000000000000
  Call Trace:
   ? bpf_trampoline_6442499918+0x1/0x149
   ? bpf_lsm_file_open+0x5/0x8
   ? bpf_lsm_file_open+0x5/0x8
   ? security_file_open+0x19/0x46
   ? do_dentry_open+0x16c/0x32a

The list function is installed whenever two ftrace_ops are registered, and a function that two of them trace calls it. A kprobe next to a BPF trampoline is one such case, and with the single ftrace_ops of the BPF trampolines every update_ftrace_direct_mod() is another, as it registers a stub ops for the sites it modifies. Here, detaching one of several BPF LSM programs from a busy hook crashed the tasks that ran the hook during the update.

Bit 0 is free only in the direct trampolines that a dyn_ftrace record can point to, but bit 63 is set in every kernel text address on x86_64. Thus, mark jmp mode by clearing bit 63 instead, so that ftrace_is_jmp() is false for any callback, whatever its alignment, and ftrace_regs_caller sets the bit again where it cleared bit 0 before. A marked address is not canonical, so a return or indirect branch to one that missed ftrace_jmp_get() faults instead of running from a byte before its target.

---
 arch/x86/kernel/ftrace_64.S | 6 +++---
 include/linux/ftrace.h      | 8 +++++---
 2 files changed, 8 insertions(+), 6 deletions(-)
arch/x86/kernel/ftrace_64.S +3 -3
index 62c1c93aa1c6a..4b20673a33959 100644
@@ -286,9 +286,9 @@ SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL)
 	RET
 
 1:
-	testb	$1, %al
-	jz	2f
-	andq $0xfffffffffffffffe, %rax
+	/* See ftrace_jmp_set(), jmp to the trampoline */
+	btsq	$63, %rax
+	jc	2f
 	movq %rax, MCOUNT_REG_SIZE+8(%rsp)
 	restore_mcount_regs
 	/* Restore flags */
include/linux/ftrace.h +5 -3
index b041d9142d2b8..1c2056a1a68b3 100644
@@ -618,19 +618,21 @@ static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs,
 #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
 
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_JMP
+#define FTRACE_JMP_BIT	BIT(BITS_PER_LONG - 1)
+
 static inline bool ftrace_is_jmp(unsigned long addr)
 {
-	return addr & 1;
+	return !(addr & FTRACE_JMP_BIT);
 }
 
 static inline unsigned long ftrace_jmp_set(unsigned long addr)
 {
-	return addr | 1UL;
+	return addr & ~FTRACE_JMP_BIT;
 }
 
 static inline unsigned long ftrace_jmp_get(unsigned long addr)
 {
-	return addr & ~1UL;
+	return addr | FTRACE_JMP_BIT;
 }
 #else
 static inline bool ftrace_is_jmp(unsigned long addr)
Signature · 1 line
2.53.0
author maintainer
#68 lore raw

PATCH 68/1005 bpf: Fix jited line info off by the CFI preamble

In reply to Greg Kroah-Hartman

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

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

From: Jose Fernandez (Anthropic) <[email protected]>

[ Upstream commit 3e4279dc5144a5afcda101df23792b13e94c3859 ]

With CONFIG_CFI=y, every jited line info entry after a function's first is cfi_get_offset() bytes too high on x86-64, riscv64 and arm64, so tools that use it show the wrong source line.

The JITs count the insn_to_jit_off[] offsets from the start of the image. Since the CFI commits below, prog->bpf_func starts cfi_get_offset() bytes into the image, and bpf_prog_fill_jited_linfo() adds the offsets to prog->bpf_func. s390 corrects its offsets before the call, the other three JITs do not.

Subtract cfi_get_offset() once in bpf_prog_fill_jited_linfo() and drop the s390 correction. jited_linfo[0] stays prog->bpf_func, the function's ksym address. Without CONFIG_CFI, cfi_get_offset() is 0 and nothing changes.

Fixes 4f9087f16651 ("x86/cfi,bpf: Fix BPF JIT call")
Fixes e63985ecd226 ("bpf, riscv64/cfi: Support kCFI + BPF on riscv64")
Fixes 710618c760c0 ("arm64/cfi,bpf: Support kCFI + BPF on arm64")
---
 arch/s390/net/bpf_jit_comp.c | 2 --
 kernel/bpf/core.c            | 8 +++++---
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/s390/net/bpf_jit_comp.c +0 -2
index 1b2566012b63a..cddea4580843b 100644
@@ -2452,8 +2452,6 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
 	fp->jited_len = jit.size - cfi_get_offset();
 
 	if (!fp->is_func || extra_pass) {
-		for (int i = 0; i < fp->len; i++)
-			jit.addrs[i] -= cfi_get_offset();
 		bpf_prog_fill_jited_linfo(fp, jit.addrs + 1);
 free_addrs:
 		kvfree(jit.addrs);
kernel/bpf/core.c +5 -3
index f4682bcaea9d0..37f6cbfac5113 100644
@@ -210,7 +210,9 @@ void bpf_prog_jit_attempt_done(struct bpf_prog *prog)
  * here is relative to the prog itself instead of the main prog.
  * This array has one entry for each xlated bpf insn.
  *
- * jited_off is the byte off to the end of the jited insn.
+ * jited_off is the byte off to the end of the jited insn, counted from
+ * the start of the jited image, which is cfi_get_offset() bytes before
+ * prog->bpf_func.
  *
  * Hence, with
  * insn_start:
@@ -224,7 +226,7 @@ void bpf_prog_jit_attempt_done(struct bpf_prog *prog)
  *
  * For i > linfo_idx,
  *
- * jited_linfo[i] = prog->bpf_func +
+ * jited_linfo[i] = prog->bpf_func - cfi_get_offset() +
  *	insn_to_jit_off[linfo[i].insn_off - insn_start - 1]
  */
 void bpf_prog_fill_jited_linfo(struct bpf_prog *prog,
@@ -252,7 +254,7 @@ void bpf_prog_fill_jited_linfo(struct bpf_prog *prog,
 		/* The verifier ensures that linfo[i].insn_off is
 		 * strictly increasing
 		 */
-		jited_linfo[i] = prog->bpf_func +
+		jited_linfo[i] = prog->bpf_func - cfi_get_offset() +
 			insn_to_jit_off[linfo[i].insn_off - insn_start - 1];
 }
 
Signature · 1 line
2.53.0
author maintainer
#69 lore raw

PATCH 69/1005 sched_ext: Call ops.sub_attach() only while the cgroup is online

In reply to Greg Kroah-Hartman

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

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

From: Tejun Heo <[email protected]>

[ Upstream commit 0aba89317f386f43c946d91238af28250b4dbc60 ]

The parent's ops.sub_attach() runs before the enable work checks that the cgroup is still online, so the parent can get an attach for a cgroup whose rmdir already returned. That complicates parents where cgroup cleanup and sub-scheduler attach race.

Check CSS_ONLINE and call ops.sub_attach() under cgroup_lock(), so that the parent sees an attach only for a cgroup that is online.

Fixes ebeca1f930ea ("sched_ext: Introduce cgroup sub-sched support")
---
 kernel/sched/ext/internal.h |  4 ++++
 kernel/sched/ext/sub.c      | 13 +++++++++++++
 2 files changed, 17 insertions(+)
kernel/sched/ext/internal.h +4 -0
index 68703b10d8998..2f35b98adb72b 100644
@@ -839,6 +839,10 @@ struct sched_ext_ops {
 	 * @sub_attach: Attach a sub-scheduler
 	 * @args: argument container, see the struct definition
 	 *
+	 * The sub-scheduler's cgroup is online for the whole call. If it goes
+	 * offline after the sub-scheduler is accepted, ops.sub_detach()
+	 * follows.
+	 *
 	 * Return 0 to accept the sub-scheduler. -errno to reject.
 	 */
 	s32 (*sub_attach)(struct scx_sub_attach_args *args);
kernel/sched/ext/sub.c +13 -0
index cb75d1912a7b8..4dc3bb12aca3a 100644
@@ -2064,8 +2064,21 @@ void scx_sub_enable_workfn(struct kthread_work *work)
 		.cgroup_path = sch->cgrp_path,
 	};
 
+	/*
+	 * The cgroup stays online across ops.sub_attach(), so the parent never
+	 * sees an attach for a cgroup that rmdir already removed.
+	 */
+	cgroup_lock();
+	if (!(cgrp->self.flags & CSS_ONLINE)) {
+		cgroup_unlock();
+		scx_error(sch, "cgroup is not online");
+		ret = -ENODEV;
+		goto err_disable;
+	}
 	ret = SCX_CALL_OP_RET(parent, sub_attach, NULL,
 			      &sub_attach_args);
+	cgroup_unlock();
+
 	if (ret) {
 		ret = scx_ops_sanitize_err(sch, "sub_attach", ret);
 		scx_error(sch, "parent rejected (%d)", ret);
Signature · 1 line
2.53.0
author maintainer
#70 lore raw

PATCH 70/1005 btrfs: verity: propagate orphan insertion errors when enabling verity

In reply to Greg Kroah-Hartman

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

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

From: guolingxing <[email protected]>

[ Upstream commit 45a686dff6b91c3667cd8188d3a02c69f62f4d00 ]

btrfs_begin_enable_verity() ignores the return value of btrfs_orphan_add() and unconditionally returns 0. If orphan insertion fails, btrfs_orphan_add() aborts the transaction, but the generic fs-verity code still proceeds with Merkle tree construction because the begin_enable_verity callback reported success.

Return the error so that fs-verity stops immediately instead of continuing after the initialization failure.

The transaction is already aborted by btrfs_orphan_add() and the handle is released by btrfs_end_transaction(), so no additional cleanup is needed.

Fixes 705242538ff3 ("btrfs: verity metadata orphan items")
---
 fs/btrfs/verity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/verity.c +1 -1
index c29d92c3bbc3e..87722e5d41868 100644
@@ -610,7 +610,7 @@ static int btrfs_begin_enable_verity(struct file *filp)
 		set_bit(BTRFS_INODE_VERITY_IN_PROGRESS, &inode->runtime_flags);
 	btrfs_end_transaction(trans);
 
-	return 0;
+	return ret;
 }
 
 /*
Signature · 1 line
2.53.0
author maintainer
#71 lore raw

PATCH 71/1005 btrfs: fix fiemap merging compressed extents

In reply to Greg Kroah-Hartman

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

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

From: Filipe Manana <[email protected]>

[ Upstream commit 980fbbd041ac2538fdbe7cfda4253dfc28fdcad1 ]

Compressed extents are never supposed to be merged by the fiemap code and reported as a single extent, as each extent's content comes from a different compression stream and has its own header and context.

We currently rely on checking the logical and physical address adjacency to prevent merging compressed extents but that is broken. Consider the following reproducer which explains why the merging happens:

  $ cat test.sh
  #!/bin/bash

DEV=/dev/sdi
MNT=/mnt/sdi

mkfs.btrfs -s 4K -f $DEV
mount -o compress $DEV $MNT

# Do a write that compresses to a single 4K extent and represents the

  # maximum compressed chunk size (128K).
  xfs_io -f -c "pwrite 0 128K" $MNT/foo

# Sync to flush delalloc and allocate the 4K extent. sync -f $MNT

# Now allocate a 124K extent in some other file, which will be adjacent # (to the right) of the 4K extent previously allocated. xfs_io -f -c "falloc 0 124K" $MNT/filler

# Do another write to the main file at its current EOF that is

  # compressible and fits in a 4K extent.
  xfs_io -c "pwrite 128K 128K" $MNT/foo
  # Sync to flush delalloc and allocate the 4K extent.
  sync -f $MNT

# Run fiemap which should report 2 encoded extents, each with a

  # logical size of 128K.
  xfs_io -c "fiemap -v" $MNT/foo

umount $MNT

Running this, fiemap will report a single extent:

  $ ./test.sh
  (...)
  /mnt/sdi/foo:
   EXT: FILE-OFFSET      BLOCK-RANGE      TOTAL FLAGS
     0: [0..511]:        26624..27135       512   0x9

Fix this by never attempting to merge extents if the flags contain FIEMAP_EXTENT_ENCODED.

Fixes 4751832da990 ("btrfs: fiemap: Cache and merge fiemap extent before submit it to user")
---
 fs/btrfs/fiemap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/fiemap.c +2 -1
index 7a2a971800993..817171028413c 100644
@@ -228,7 +228,8 @@ static int emit_fiemap_extent(struct fiemap_extent_info *fieinfo,
 	 *
 	 * 3) Share same flags
 	 */
-	if (cache->offset + cache->len  == offset &&
+	if (!(flags & FIEMAP_EXTENT_ENCODED) &&
+	    cache->offset + cache->len == offset &&
 	    cache->phys + cache->len == phys  &&
 	    cache->flags == flags) {
 		cache->len += len;
Signature · 1 line
2.53.0
author maintainer
#72 lore raw

PATCH 72/1005 btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe

In reply to Greg Kroah-Hartman

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

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

From: Filipe Manana <[email protected]>

[ Upstream commit 387d5be169e6644a41dd5865e6a01c9489e996e2 ]

If we find errors we are returning the value of 'ret', which has a value of 0 from some previous function call that succeeded, instead of returning an -EIO error. Fix this by returning -EIO instead of 'ret'.

Fixes fab0c0f03cfd ("btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper")
---
 fs/btrfs/scrub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/scrub.c +1 -1
index 479c0e037015a..ba2e27cc53519 100644
@@ -2250,7 +2250,7 @@ static int scrub_raid56_parity_stripe(struct scrub_ctx *sctx,
 "scrub: unrepaired sectors detected, full stripe %llu data stripe %u errors %*pbl",
 				  full_stripe_start, i, stripe->nr_sectors,
 				  &error);
-			return ret;
+			return -EIO;
 		}
 		bitmap_or(&extent_bitmap, &extent_bitmap, &has_extent,
 			  stripe->nr_sectors);
Signature · 1 line
2.53.0
author maintainer
#73 lore raw

PATCH 73/1005 btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing

In reply to Greg Kroah-Hartman

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

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

From: Filipe Manana <[email protected]>

[ Upstream commit bda65e5115fe66ee0d8cf4ade11807f9fca4f0e1 ]

When scrub finishes, it does a wakeup on the fs_info->scrub_pause_wait wait queue and then sets dev->scrub_sctx to NULL. On the other hand the scrub cancel code (btrfs_scrub_cancel_dev()) waits on that wait queue for dev->scrub_sctx to be NULL. So this means if btrfs_scrub_cancel_dev() is called right when scrub is finishing and sees the wakeup before the NULL is assigned to dev->scrub_sctx by btrfs_scrub_dev(), it hangs.

Fix this by doing the wakeup in btrfs_scrub_dev() after setting dev->scrub_sctx to NULL.

Fixes a2de733c78fa ("btrfs: scrub")
---
 fs/btrfs/scrub.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
fs/btrfs/scrub.c +7 -1
index ba2e27cc53519..91e441d0ff3cb 100644
@@ -3171,7 +3171,6 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
 	memalloc_nofs_restore(nofs_flag);
 
 	atomic_dec(&fs_info->scrubs_running);
-	wake_up(&fs_info->scrub_pause_wait);
 
 	if (progress)
 		memcpy(progress, &sctx->stat, sizeof(*progress));
@@ -3184,6 +3183,13 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
 	dev->scrub_ctx = NULL;
 	mutex_unlock(&fs_info->scrub_lock);
 
+	/*
+	 * We have set dev->scrub_ctx to NULL, now do the wakeup as a concurrent
+	 * scrub cancel (btrfs_scrub_cancel_dev()) waits for dev->scrub_ctx to
+	 * be set to NULL.
+	 */
+	wake_up(&fs_info->scrub_pause_wait);
+
 	scrub_workers_put(fs_info);
 	scrub_put_ctx(sctx);
 
Signature · 1 line
2.53.0
author maintainer
#74 lore raw

PATCH 74/1005 btrfs: zoned: fix double free of bitmaps on clone failure

In reply to Greg Kroah-Hartman

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

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

From: Thomas Fourier <[email protected]>

[ Upstream commit 8c66a6aa59a5df1d672d72b7cd379d897ff73200 ]

btrfs_clone_dev_zone_info() duplicates the original orig_dev->zone_info with kmemdup(), which also copies the seq_zones, empty_zones and active_zones pointers. The clone then replaces them one by one with fresh bitmaps. If one of the allocations fails, the error path frees all three pointers, including those not yet replaced, which still point to the bitmaps owned by the original device.

Clear the three pointers right after kmemdup() so the error path only frees what this function allocated.

Fixes 21e61ec6d0bb ("btrfs: zoned: clone zoned device info when cloning a device")
---
 fs/btrfs/zoned.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/btrfs/zoned.c +5 -0
index 3b41e964d2096..a64af9d5d2376 100644
@@ -645,6 +645,11 @@ struct btrfs_zoned_device_info *btrfs_clone_dev_zone_info(struct btrfs_device *o
 	if (!zone_info)
 		return NULL;
 
+	/* Don't let the error path free the bitmaps still owned by @orig_dev. */
+	zone_info->seq_zones = NULL;
+	zone_info->empty_zones = NULL;
+	zone_info->active_zones = NULL;
+
 	zone_info->seq_zones = bitmap_zalloc(zone_info->nr_zones, GFP_KERNEL);
 	if (!zone_info->seq_zones)
 		goto out;
Signature · 1 line
2.53.0
author maintainer
#75 lore raw

PATCH 75/1005 bpf: Drop percpu_counter from the htab element count

In reply to Greg Kroah-Hartman

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

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

From: Puranjay Mohan <[email protected]>

[ Upstream commit 1cd28b5354ab77c727ed87255bf289a87178b415 ]

The element count of a large non-preallocated hash map is a percpu_counter, whose slow path takes fbc->lock with raw_spin_lock_irqsave(). That is not safe against BPF programs that run while the lock is held or contended: NMI programs and, as queued_spin_lock_slowpath() calls trace_contention_end() with the lock already held, programs attached to the contention_end tracepoint. If such a program updates the same map it spins on the lock its own CPU holds:

WARNING: possible recursive locking detected cend/250 is trying to acquire lock:
(key#5){....}-{2:2}, at: _raw_spin_lock_irqsave+0x18/0x30 but task is already holding lock:
(key#5){....}-{2:2}, at: _raw_spin_lock_irqsave+0x18/0x30

    percpu_counter_add_batch+0xd8/0x160
    alloc_htab_elem+0x408/0x480
    htab_map_update_elem+0x1e8/0x6a0
    bpf_prog_7a29a1ae68aedf07_cend+0x14c/0x1f8
    __bpf_trace_contention_end+0x14/0x20
    queued_spin_lock_slowpath+0x2e8/0x468
    percpu_counter_add_batch+0xd8/0x160
    alloc_htab_elem+0x408/0x480
    htab_map_update_elem+0x1e8/0x6a0

is_map_full() is affected too, as __percpu_counter_compare() falls back to percpu_counter_sum(), which takes the same lock.

map.elem_count already is a lockless per-cpu count of the same elements. Make htab->count follow it in steps of PERCPU_COUNTER_BATCH and let is_map_full() sum elem_count once count is within nr_cpu_ids * batch of max_entries. Each cpu's elem_count is ahead of count by less than the batch, so that is exact, in NMI as well.

Fixes 86fe28f7692d ("bpf: Optimize element count in non-preallocated hash map.")
---
 include/linux/bpf.h  |  2 ++
 kernel/bpf/hashtab.c | 64 ++++++++++++++++++--------------------------
 2 files changed, 28 insertions(+), 38 deletions(-)
include/linux/bpf.h +2 -0
index a628f182bb64c..c4d1053bfe2bf 100644
@@ -2916,6 +2916,8 @@ static inline void bpf_map_dec_elem_count(struct bpf_map *map)
 	this_cpu_dec(*map->elem_count);
 }
 
+s64 bpf_map_sum_elem_count(const struct bpf_map *map);
+
 extern int sysctl_unprivileged_bpf_disabled;
 
 bool bpf_token_capable(const struct bpf_token *token, int cap);
kernel/bpf/hashtab.c +26 -38

120 lines not on this page · raw message

Signature · 1 line
2.53.0
author maintainer
#76 lore raw

PATCH 76/1005 net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3

In reply to Greg Kroah-Hartman

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

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

From: Zhi-Jun You <[email protected]>

[ Upstream commit cb50f16f37fc3429085c454ee5978e05732d10ba ]

Currently WED v3 tx wdma ring, ring reset happens in a separate code block unconditionally.

Moreover, v3 has double the size of wdma_desc and has different init values. mtk_wed_ring_reset doens't deal with that and would corrupt the wdma_desc.

Fix this by skipping mtk_wed_ring_reset in mtk_wdma_tx_ring_setup for WED v3.

---
 drivers/net/ethernet/mediatek/mtk_wed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_wed.c +1 -1
index 53d3b7e00e1cd..d55042ccaff16 100644
@@ -1938,7 +1938,7 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
 	wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_CPU_IDX, 0);
 	wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_DMA_IDX, 0);
 
-	if (reset)
+	if (!mtk_wed_is_v3_or_greater(dev->hw) && reset)
 		mtk_wed_ring_reset(wdma, MTK_WED_WDMA_RING_SIZE, true);
 
 	if (!idx)  {
Signature · 1 line
2.53.0
author maintainer
#77 lore raw

PATCH 77/1005 net: ethernet: mtk_wed: fix reset condition for rx wdma

In reply to Greg Kroah-Hartman

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

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

From: Zhi-Jun You <[email protected]>

[ Upstream commit 7180a42d8e616f919dcff4b90a13b9a5ecea665b ]

In mtk_wdma_rx_reset, currently only resets the CPU index of the rings that doesn't have a descriptor. This is wrong because no descriptor means the ring is not configured.

Also mtk_wed_start makes sure that all rx_wdma rings are set up this would lead to no ring getting their CPU index reset.

Fix this by inverting the reset condition so allocated rings will be reset.

---
 drivers/net/ethernet/mediatek/mtk_wed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_wed.c +1 -1
index d55042ccaff16..3f0be70c3f145 100644
@@ -257,7 +257,7 @@ mtk_wdma_rx_reset(struct mtk_wed_device *dev)
 	wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
 
 	for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++) {
-		if (dev->rx_wdma[i].desc)
+		if (!dev->rx_wdma[i].desc)
 			continue;
 
 		wdma_w32(dev,
Signature · 1 line
2.53.0
author maintainer
#78 lore raw

PATCH 78/1005 net: ethernet: mtk_wed: free up rings during detach

In reply to Greg Kroah-Hartman

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

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

From: Zhi-Jun You <[email protected]>

[ Upstream commit 5b8d12512cbd3495dbd8c38e8047bb5d716f0f3f ]

During __mtk_wed_detach, rx_ring and tx_wdma aren't freed up.

Fix this by add them to mtk_wed_free_rx_rings.

This patch is pulled from mtk-openwrt-feeds to address Sashiko's review and edit to rely on ring->desc instead of an extra flag.

---
 drivers/net/ethernet/mediatek/mtk_wed.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/ethernet/mediatek/mtk_wed.c +8 -0
index 3f0be70c3f145..3044a7a8ea03e 100644
@@ -949,6 +949,14 @@ mtk_wed_free_ring(struct mtk_wed_device *dev, struct mtk_wed_ring *ring)
 static void
 mtk_wed_free_rx_rings(struct mtk_wed_device *dev)
 {
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(dev->rx_ring); i++)
+		mtk_wed_free_ring(dev, &dev->rx_ring[i]);
+
+	for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
+		mtk_wed_free_ring(dev, &dev->tx_wdma[i]);
+
 	mtk_wed_free_rx_buffer(dev);
 	mtk_wed_free_ring(dev, &dev->rro.ring);
 }
Signature · 1 line
2.53.0
author maintainer
#79 lore raw

PATCH 79/1005 net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986

In reply to Greg Kroah-Hartman

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

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

From: Zhi-Jun You <[email protected]>

[ Upstream commit dd6efae5529107cc8db277eaeaff5c5f15e6bc15 ]

WDMA_RING_TX(0) is required to set MTK_WED_WDMA_RING_TX for WED RX but on a non-DBDC MT7986 it is never setup because idx is 1.

Setting MTK_WED_WDMA_RING_TX with WDMA_RING_TX(1) is not feasible because WED still tries to send through WDMA_RING_TX(0). This is verified with register dump.

Fix this by calling mtk_wed_wdma_tx_ring_setup if wed is v2 and rx_ring[0] is not allocated and reset tx_wdma[0] if it's already allocated also add error messages and bail when mtk_wed_start fails.

Fixes 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support")
---
 drivers/net/ethernet/mediatek/mtk_wed.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_wed.c +14 -1
index 3044a7a8ea03e..f40ac5794341c 100644
@@ -2345,7 +2345,20 @@ mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
 
 	for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
 		if (!dev->rx_wdma[i].desc)
-			mtk_wed_wdma_rx_ring_setup(dev, i, 16, false);
+			if (mtk_wed_wdma_rx_ring_setup(dev, i, 16, false)) {
+				dev_err(dev->hw->dev, "wdma rx ring %d setup failed\n", i);
+				return;
+			}
+
+	/*
+	 * non-DBDC MT7986 allocates only rx_ring[1] and tx_wdma[1] during setup
+	 * but tx_wdma[0] is also needed for WED to function.
+	 */
+	if (mtk_wed_is_v2(dev->hw) && !dev->rx_ring[0].desc)
+		if (mtk_wed_wdma_tx_ring_setup(dev, 0, MTK_WED_WDMA_RING_SIZE, !!dev->tx_wdma[0].desc)) {
+			dev_err(dev->hw->dev, "wdma tx ring 0 setup failed\n");
+			return;
+		}
 
 	if (dev->wlan.hw_rro) {
 		for (i = 0; i < MTK_WED_RX_PAGE_QUEUES; i++) {
Signature · 1 line
2.53.0
author maintainer
#80 lore raw

PATCH 80/1005 ptp: drain virtual clock sysfs operations before unregistering children

In reply to Greg Kroah-Hartman

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

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

From: James Hilliard <[email protected]>

[ Upstream commit 0e4a135aebc7686286d87e286499ce55e5bd5aad ]

Parent clock removal walks its virtual clocks before removing the n_vclocks sysfs attribute. The mutex taken by ptp_vclock_in_use() is released before that walk, so a concurrent sysfs deletion can pick the same child and unregister and free its ptp_vclock a second time. A reference held by the device iterator does not protect that separately allocated virtual clock.

Remove n_vclocks before walking the children. Removing the attribute prevents new stores and drains stores already running, without holding n_vclocks_mux across a callback that needs that mutex. Skip virtual clocks, which do not have this attribute.

This race was found by code inspection of virtual-clock registration failure cleanup and parent removal.

Fixes bfcbb76b0f59 ("ptp: unregister virtual clocks when unregistering physical clock.")
---
 drivers/ptp/ptp_clock.c   | 5 +++++
 drivers/ptp/ptp_private.h | 1 +
 drivers/ptp/ptp_sysfs.c   | 6 ++++++
 3 files changed, 12 insertions(+)
drivers/ptp/ptp_clock.c +5 -0
index 4111342d64f03..47ffc773065a3 100644
@@ -508,6 +508,11 @@ static int unregister_vclock(struct device *dev, void *data)
 
 int ptp_clock_unregister(struct ptp_clock *ptp)
 {
+	/*
+	 * Stop and drain virtual-clock creation and deletion before walking the
+	 * children. Do not hold n_vclocks_mux while waiting for sysfs callbacks.
+	 */
+	ptp_vclock_remove_sysfs(ptp);
 	if (ptp_vclock_in_use(ptp)) {
 		device_for_each_child(&ptp->dev, NULL, unregister_vclock);
 	}
drivers/ptp/ptp_private.h +1 -0
index db4039d642b41..ec8633126d6b8 100644
@@ -169,6 +169,7 @@ extern const struct attribute_group *ptp_groups[];
 
 int ptp_populate_pin_groups(struct ptp_clock *ptp);
 void ptp_cleanup_pin_groups(struct ptp_clock *ptp);
+void ptp_vclock_remove_sysfs(struct ptp_clock *ptp);
 
 struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock);
 void ptp_vclock_unregister(struct ptp_vclock *vclock);
drivers/ptp/ptp_sysfs.c +6 -0
index 7d09256aca724..1b4530be42a20 100644
@@ -267,6 +267,12 @@ static ssize_t n_vclocks_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(n_vclocks);
 
+void ptp_vclock_remove_sysfs(struct ptp_clock *ptp)
+{
+	if (!ptp->is_virtual_clock)
+		device_remove_file(&ptp->dev, &dev_attr_n_vclocks);
+}
+
 static ssize_t max_vclocks_show(struct device *dev,
 				struct device_attribute *attr, char *page)
 {
Signature · 1 line
2.53.0
author maintainer
#81 lore raw

PATCH 81/1005 ptp: unwind partially completed virtual clock creation

In reply to Greg Kroah-Hartman

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

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

From: James Hilliard <[email protected]>

[ Upstream commit 3dea778260e3dddf30651a6913d87a42861346a2 ]

n_vclocks_store() publishes the new clock count only after every child has been registered. If a later registration fails, it returns without unregistering the children already created by that request. Those clocks are left out of n_vclocks, and a subsequent request can overwrite their index entries without removing them.

Unregister the newly created children in reverse order and clear their index entries on failure. Leave the previously installed clocks and their count unchanged. The n_vclocks mutex serializes this rollback with other sysfs changes, and parent removal drains the store before walking the children.

This was found by code inspection while adding initial PHC sample error handling to virtual clock registration.

Fixes 73f37068d540 ("ptp: support ptp physical/virtual clocks conversion")
---
 drivers/ptp/ptp_sysfs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ptp/ptp_sysfs.c +7 -1
index 1b4530be42a20..2d46f69e8c100 100644
@@ -229,7 +229,7 @@ static ssize_t n_vclocks_store(struct device *dev,
 		for (i = 0; i < num - ptp->n_vclocks; i++) {
 			vclock = ptp_vclock_register(ptp);
 			if (!vclock)
-				goto out;
+				goto err_register;
 
 			*(ptp->vclock_index + ptp->n_vclocks + i) =
 				vclock->clock->index;
@@ -261,6 +261,12 @@ static ssize_t n_vclocks_store(struct device *dev,
 	mutex_unlock(&ptp->n_vclocks_mux);
 
 	return count;
+err_register:
+	num = i;
+	if (num)
+		device_for_each_child_reverse(dev, &num, unregister_vclock);
+	for (num = 0; num < i; num++)
+		ptp->vclock_index[ptp->n_vclocks + num] = -1;
 out:
 	mutex_unlock(&ptp->n_vclocks_mux);
 	return err;
Signature · 1 line
2.53.0
author maintainer
#82 lore raw

PATCH 82/1005 ptp: vclock: propagate physical clock sampling errors

In reply to Greg Kroah-Hartman

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

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

From: James Hilliard <[email protected]>

[ Upstream commit d1bdfdafd663dd00b01d43eb3391f87718f2a09d ]

The cyclecounter read callback cannot report errors. ptp_vclock_read() ignores the return from the physical clock and consumes its output even if the read failed. A zero sample followed by the real counter can add an extra 32-bit wrap to virtual time. This was found by code inspection of reset-time PHC access and the virtual clock callers.

Sample the parent before calling timecounter_read() or timecounter_init() and have the cyclecounter callback return the cached successful sample. On failure, leave the counter and frequency adjustment unchanged and return the PHC error to the caller.

Retry the first failed refresh after 10 ms instead of waiting another two seconds. With the existing 32-bit nanosecond mask, timecounter_cyc2time() can interpret a fresh timestamp as being in the past once the last successful refresh is about 2.147 seconds old. An isolated read failure should not deliberately defer the next attempt until that sample is four seconds old.

Double the retry delay after consecutive failures, up to the normal two-second refresh interval, and reset it after a successful refresh. Each virtual clock has its own worker, and a failed parent read can involve bus traffic and error logging. Backoff limits that repeated work during a persistent failure while retaining a prompt first retry.

Limit each retry delay to the next regular refresh deadline. Otherwise, backoff can skip the next two-second refresh opportunity and lose a full counter wrap even when the parent has recovered before that refresh was due. Advance the deadline when an attempt reaches it without resetting the backoff, so sustained failures still settle at the normal refresh interval. Keep the retry state private to each clock's auxiliary worker.

Take the initial sample and initialize the counter before publishing the clock. Return an error pointer from registration and propagate its errno through n_vclocks, including when the initial sample fails. Queue the first refresh immediately after registration so registration latency is not followed by another full refresh interval.

Keep the existing cyclecounter mask and scaling. These scheduling changes do not guarantee timely samples: prolonged read failures or worker delays can still exceed the half-wrap conversion window, and a gap of about 4.295 seconds between successful samples can lose a full counter wrap. Do not assume that getcycles64() exposes a full-width nanosecond counter.

Fixes 5d43f951b1ac ("ptp: add ptp virtual clock driver framework")
---
 drivers/ptp/ptp_private.h |  6 ++-
 drivers/ptp/ptp_sysfs.c   |  4 +-
 drivers/ptp/ptp_vclock.c  | 89 ++++++++++++++++++++++++++++++---------
 3 files changed, 76 insertions(+), 23 deletions(-)
drivers/ptp/ptp_private.h +5 -1
index ec8633126d6b8..99e7eb241336e 100644
@@ -81,7 +81,11 @@ struct ptp_vclock {
 	struct hlist_node vclock_hash_node;
 	struct cyclecounter cc;
 	struct timecounter tc;
-	struct mutex lock;	/* protects tc/cc */
+	u64 cycles;
+	struct mutex lock;	/* protects tc/cc and the cached sample */
+	/* Owned by the auxiliary worker. */
+	unsigned long retry_delay;
+	unsigned long refresh_deadline;
 };
 
 /*
drivers/ptp/ptp_sysfs.c +3 -1
index 2d46f69e8c100..8e0e0aa099815 100644
@@ -228,8 +228,10 @@ static ssize_t n_vclocks_store(struct device *dev,
 	if (num > ptp->n_vclocks) {
 		for (i = 0; i < num - ptp->n_vclocks; i++) {
 			vclock = ptp_vclock_register(ptp);
-			if (!vclock)
+			if (IS_ERR(vclock)) {
+				err = PTR_ERR(vclock);
 				goto err_register;
+			}
 
 			*(ptp->vclock_index + ptp->n_vclocks + i) =
 				vclock->clock->index;
drivers/ptp/ptp_vclock.c +68 -21

179 lines not on this page · raw message

Signature · 1 line
2.53.0
author maintainer
#83 lore raw

PATCH 83/1005 ptp: vclock: serialize extended samples with counter updates

In reply to Greg Kroah-Hartman

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

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

From: James Hilliard <[email protected]>

[ Upstream commit d3fcce5afe3bb62e8f7a2efb29e43da4fe4ae1f3 ]

The extended and cross-timestamp callbacks sample the physical clock before taking the virtual clock mutex. A concurrent frequency adjustment can advance the timecounter and change its multiplier in between, so the older sample is converted using a different frequency than the one in effect when it was taken.

Take the mutex before sampling and keep it held through the conversion. Retain timecounter_cyc2time() and its existing conversion window. A PHC sample need not advance the counter: for example, e1000e explicitly allows non-monotonic SYSTIM readings. Treating a slightly older sample as a forward delta would instead advance virtual time by nearly a full counter wrap.

This race was found by code inspection of the virtual clock sampling paths.

Fixes f0067ebfc42b ("ptp: add gettimex64() to virtual clocks.")
Fixes 21fad63084c2 ("ptp: add getcrosststamp() to virtual clocks.")
---
 drivers/ptp/ptp_vclock.c | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)
drivers/ptp/ptp_vclock.c +14 -18
index b97f3a8772602..679ae40916f7e 100644
@@ -115,20 +115,18 @@ static int ptp_vclock_gettimex(struct ptp_clock_info *ptp,
 	struct ptp_clock *pptp = vclock->pclock;
 	struct timespec64 pts;
 	int err;
-	u64 ns;
-
-	err = pptp->info->getcyclesx64(pptp->info, &pts, sts);
-	if (err)
-		return err;
 
 	if (mutex_lock_interruptible(&vclock->lock))
 		return -EINTR;
-	ns = timecounter_cyc2time(&vclock->tc, timespec64_to_ns(&pts));
-	mutex_unlock(&vclock->lock);
+	err = pptp->info->getcyclesx64(pptp->info, &pts, sts);
+	if (!err) {
+		u64 ns = timecounter_cyc2time(&vclock->tc, timespec64_to_ns(&pts));
 
-	*ts = ns_to_timespec64(ns);
+		*ts = ns_to_timespec64(ns);
+	}
+	mutex_unlock(&vclock->lock);
 
-	return 0;
+	return err;
 }
 
 static int ptp_vclock_settime(struct ptp_clock_info *ptp,
@@ -154,20 +152,18 @@ static int ptp_vclock_getcrosststamp(struct ptp_clock_info *ptp,
 	struct ptp_vclock *vclock = info_to_vclock(ptp);
 	struct ptp_clock *pptp = vclock->pclock;
 	int err;
-	u64 ns;
-
-	err = pptp->info->getcrosscycles(pptp->info, xtstamp);
-	if (err)
-		return err;
 
 	if (mutex_lock_interruptible(&vclock->lock))
 		return -EINTR;
-	ns = timecounter_cyc2time(&vclock->tc, ktime_to_ns(xtstamp->device));
-	mutex_unlock(&vclock->lock);
+	err = pptp->info->getcrosscycles(pptp->info, xtstamp);
+	if (!err) {
+		u64 ns = timecounter_cyc2time(&vclock->tc, ktime_to_ns(xtstamp->device));
 
-	xtstamp->device = ns_to_ktime(ns);
+		xtstamp->device = ns_to_ktime(ns);
+	}
+	mutex_unlock(&vclock->lock);
 
-	return 0;
+	return err;
 }
 
 static long ptp_vclock_refresh(struct ptp_clock_info *ptp)
Signature · 1 line
2.53.0
author maintainer
#84 lore raw

PATCH 84/1005 ptp: vclock: preserve missing hardware timestamps

In reply to Greg Kroah-Hartman

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

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

From: James Hilliard <[email protected]>

[ Upstream commit 63787dfd1b5ae720cc30dab5e66c8e4d81ff7391 ]

Socket timestamp delivery converts hardware timestamps to a bound virtual clock before checking whether a hardware timestamp is present. A zero timestamp means that the packet has no hardware timestamp, but timecounter_cyc2time() can turn that zero into a nonzero virtual time. The socket then reports a hardware timestamp which was never supplied.

Return zero without conversion when the input timestamp is absent. This also covers skb_get_tx_timestamp(), which checks for an absent timestamp after the same conversion.

This was identified during review of virtual clock sampling changes.

Fixes d7c088265588 ("net: socket: support hardware timestamp conversion to PHC bound")
---
 drivers/ptp/ptp_vclock.c         | 2 ++
 include/linux/ptp_clock_kernel.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/ptp/ptp_vclock.c +2 -0
index 679ae40916f7e..e9cf4da3ed8a4 100644
@@ -326,6 +326,8 @@ ktime_t ptp_convert_timestamp(const ktime_t *hwtstamp, int vclock_index)
 	u64 ns;
 
 	ns = ktime_to_ns(*hwtstamp);
+	if (!ns)
+		return 0;
 
 	srcu_idx = srcu_read_lock(&vclock_srcu);
 
include/linux/ptp_clock_kernel.h +1 -1
index 36a27a9105958..56f6ab1855d38 100644
@@ -496,7 +496,7 @@ int ptp_get_vclocks_index(int pclock_index, int **vclock_index);
  * @hwtstamp:     timestamp
  * @vclock_index: phc index of ptp vclock.
  *
- * Returns: converted timestamp, or 0 on error.
+ * Returns: converted timestamp, or 0 if @hwtstamp is zero or on error.
  */
 ktime_t ptp_convert_timestamp(const ktime_t *hwtstamp, int vclock_index);
 #else
Signature · 1 line
2.53.0
author maintainer
#85 lore raw

PATCH 85/1005 net/smc: fix limit_smc_hs sysctl on big-endian architecture

In reply to Greg Kroah-Hartman

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

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

From: Fernando Fernandez Mancera <[email protected]>

[ Upstream commit 162cf592b577cccf04515100563e819d9eba5c4a ]

net->smc.limit_smc_hs is a bool, but its sysctl entry uses proc_dointvec_minmax() with .maxlen = sizeof(int), so the handler accesses four bytes at the address of a one-byte field.

On little-endian this works with the extra bytes being written in struct padding. On big-endian (tested on s390x) the bool sits at the most significant byte of the int therefore the bool stays false and the "1" goes into padding. The sysctl reads back 1 but SMC sockets created afterwards see limit_smc_hs as disabled.

Fix this by using proc_dobool() handler and adjust the maxlen to the right value.

---
 net/smc/smc_sysctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/smc/smc_sysctl.c +2 -4
index 09dad48337f61..f58cf256f61ab 100644
@@ -160,11 +160,9 @@ static const struct ctl_table smc_table[] = {
 	{
 		.procname	= "limit_smc_hs",
 		.data		= &init_net.smc.limit_smc_hs,
-		.maxlen		= sizeof(int),
+		.maxlen		= sizeof(bool),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec_minmax,
-		.extra1		= SYSCTL_ZERO,
-		.extra2		= SYSCTL_ONE,
+		.proc_handler	= proc_dobool,
 	},
 	{
 		.procname	= "smcr_max_send_wr",
Signature · 1 line
2.53.0
author maintainer
#86 lore raw

PATCH 86/1005 scsi: mpt3sas: Use combined sense codes

In reply to Greg Kroah-Hartman

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

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

From: Damien Le Moal <[email protected]>

[ Upstream commit f2e04ffb273e60aba6d39fc0c591bd1d8f4d9018 ]

Refactor the mpt3sas driver to replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented.

No functional change intended.

Stable-dep-of: d58e6d962e5b ("scsi: mpt3sas: Register devices during SANITIZE")

---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 69 +++++++++++++++-------------
 1 file changed, 36 insertions(+), 33 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +36 -33
index 0e12009a87f62..085d4672db854 100644
@@ -5401,23 +5401,23 @@ _scsih_setup_eedp(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
 static void
 _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
 {
-	u8 ascq;
+	u16 sense_code;
 
 	switch (ioc_status) {
 	case MPI2_IOCSTATUS_EEDP_GUARD_ERROR:
-		ascq = 0x01;
+		sense_code = LOGICAL_BLOCK_GUARD_CHECK_FAILED;
 		break;
 	case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR:
-		ascq = 0x02;
+		sense_code = LOGICAL_BLOCK_APPLICATION_TAG_CHECK_FAILED;
 		break;
 	case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR:
-		ascq = 0x03;
+		sense_code = LOGICAL_BLOCK_REFERENCE_TAG_CHECK_FAILED;
 		break;
 	default:
-		ascq = 0x00;
+		sense_code = ID_CRC_OR_ECC_ERROR;
 		break;
 	}
-	scsi_build_sense(scmd, 0, ILLEGAL_REQUEST, 0x10, ascq);
+	scsi_set_sense(scmd, 0, ILLEGAL_REQUEST, sense_code);
 	set_host_byte(scmd, DID_ABORT);
 }
 
@@ -5474,7 +5474,8 @@ static enum scsi_qc_status scsih_qcmd(struct Scsi_Host *shost,
 	if (handle == MPT3SAS_INVALID_DEVICE_HANDLE || sas_device_priv_data->block) {
 		if (scsi_get_host_state(scmd->device->host) == SHOST_RECOVERY &&
 		    scmd->cmnd[0] == TEST_UNIT_READY) {
-			scsi_build_sense(scmd, 0, UNIT_ATTENTION, 0x29, 0x07);
+			scsi_set_sense(scmd, 0, UNIT_ATTENTION,
+				       I_T_NEXUS_LOSS_OCCURRED);
 			scsi_done(scmd);
 			return 0;
 		}
@@ -5986,7 +5987,7 @@ _scsih_smart_predicted_fault(struct MPT3SAS_ADAPTER *ioc, u16 handle)
 	event_data = (Mpi2EventDataSasDeviceStatusChange_t *)
 	    event_reply->EventData;
 	event_data->ReasonCode = MPI2_EVENT_SAS_DEV_STAT_RC_SMART_DATA;
-	event_data->ASC = 0x5D;
+	event_data->ASC = ASC_FAILURE_PREDICTION_THRESHOLD_EXCEEDED;
 	event_data->DevHandle = cpu_to_le16(handle);
 	event_data->SASAddress = cpu_to_le64(sas_target_priv_data->sas_address);
 	mpt3sas_ctl_add_to_event_log(ioc, event_reply);
@@ -6109,8 +6110,7 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
 		    le32_to_cpu(mpi_reply->SenseCount));
 		memcpy(scmd->sense_buffer, sense_data, sz);
 		_scsih_normalize_sense(scmd->sense_buffer, &data);
-		/* failure prediction threshold exceeded */
-		if (data.asc == 0x5D)
+		if (data.asc == ASC_FAILURE_PREDICTION_THRESHOLD_EXCEEDED)
 			_scsih_smart_predicted_fault(ioc,
 			    le16_to_cpu(mpi_reply->DevHandle));
 		mpt3sas_trigger_scsi(ioc, data.skey, data.asc, data.ascq);
@@ -6199,8 +6199,8 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply)
 		else if (!xfer_cnt && scmd->cmnd[0] == REPORT_LUNS) {
 			mpi_reply->SCSIState = MPI2_SCSI_STATE_AUTOSENSE_VALID;
 			mpi_reply->SCSIStatus = SAM_STAT_CHECK_CONDITION;
-			scsi_build_sense(scmd, 0, ILLEGAL_REQUEST,
-					 0x20, 0);
+			scsi_set_sense(scmd, 0, ILLEGAL_REQUEST,
+				       INVALID_COMMAND_OP_CODE);
 		}
 		break;
 
@@ -7691,38 +7691,41 @@ _scsih_determine_disposition(struct MPT3SAS_ADAPTER *ioc,
 
 	if (check_sense) {
 		_scsih_normalize_sense(transfer_packet->sense, &sense_info);
-		if (sense_info.skey == UNIT_ATTENTION)
+		if (sense_info.skey == UNIT_ATTENTION) {
 			rc = DEVICE_RETRY_UA;
-		else if (sense_info.skey == NOT_READY) {
-			/* medium isn't present */
-			if (sense_info.asc == 0x3a)
+		} else if (sense_info.skey == NOT_READY) {
+			if (sense_info.asc == ASC_MEDIUM_NOT_PRESENT) {
 				rc = DEVICE_READY;
-			/* LOGICAL UNIT NOT READY */
-			else if (sense_info.asc == 0x04) {
-				if (sense_info.ascq == 0x03 ||
-				   sense_info.ascq == 0x0b ||
-				   sense_info.ascq == 0x0c) {
+			} else if (sense_info.asc == ASC_LU_NOT_READY) {
+				u16 scode = scsi_sense_code(sense_info.asc,
+							    sense_info.ascq);
+
+				if (scode ==
+				    LU_NOT_READY_MANUAL_INTERVENTION_REQUIRED ||
+				    scode ==
+				    LU_NOT_ACCESSIBLE_TARGET_PORT_IN_STANDBY_STATE ||
+				    scode ==
+				    LU_NOT_ACCESSIBLE_TARGET_PORT_IN_UNAVAILABLE_STATE)
 					rc = DEVICE_ERROR;
-				} else
+				else
 					rc = DEVICE_START_UNIT;
-			}
-			/* LOGICAL UNIT HAS NOT SELF-CONFIGURED YET */
-			else if (sense_info.asc == 0x3e && !sense_info.ascq)
+			} else if (sense_info.asc ==
+				   ASC_LU_HAS_NOT_SELF_CONFIGURED_YET &&
+				   !sense_info.ascq) {
 				rc = DEVICE_START_UNIT;
+			}
 		} else if (sense_info.skey == ILLEGAL_REQUEST &&
-		    transfer_packet->cdb[0] == REPORT_LUNS) {
+			   transfer_packet->cdb[0] == REPORT_LUNS) {
 			rc = DEVICE_READY;
 		} else if (sense_info.skey == MEDIUM_ERROR) {
-
-			/* medium is corrupt, lets add the device so
-			 * users can collect some info as needed
+			/*
+			 * medium is corrupt, lets add the device so users can
+			 * collect some info as needed
 			 */
-
-			if (sense_info.asc == 0x31)
+			if (sense_info.asc == ASC_MEDIUM_FORMAT_CORRUPTED)
 				rc = DEVICE_READY;
 		} else if (sense_info.skey == HARDWARE_ERROR) {
-			/* Defect List Error, still add the device */
-			if (sense_info.asc == 0x19)
+			if (sense_info.asc == ASC_DEFECT_LIST_ERROR)
 				rc = DEVICE_READY;
 		}
 	}
Signature · 1 line
2.53.0
author maintainer
#87 lore raw

PATCH 87/1005 scsi: mpt3sas: Register devices during SANITIZE

In reply to Greg Kroah-Hartman

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

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

From: Vincent YUE <[email protected]>

[ Upstream commit d58e6d962e5b59297be24d908f41af93f20ec11f ]

A SAS disk being sanitized responds to TEST UNIT READY with NOT READY, ASC 0x04, ASCQ 0x1b. mpt3sas discovery maps this sense to DEVICE_START_UNIT and issues START UNIT repeatedly. The drive stays NOT READY until the sanitize operation completes, causing discovery to exhaust its retry budget and decline SCSI device registration.

Allow registration only for the SANITIZE IN PROGRESS sense, so sd/sg can expose the target while retaining its actual NOT READY state. All other sense dispositions are unchanged.

On an LSI SAS3008 with an HGST HUH728080AL4200, unpatched Linux 7.2.11 retried discovery 145 times without registering the device. Linux 6.18.55 registered the same sanitizing drive. With the equivalent 7.2.11 fix the disk registered as /dev/sda (0 B) and /dev/sg0 while TEST UNIT READY still reported 02/04/1b and 47.32% SANITIZE progress. Another SAS drive continued to enumerate.

This updated variant uses the named 0x041b sense constant introduced in newer kernels. It passed static review on the current SCSI for-next branch but has not been independently boot-tested there.

Fixes aee682fad6cd ("scsi: mpt3sas: Improve device discovery and readiness handling for slow devices")
Assisted-by LLM
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +3 -1
index 085d4672db854..a77bbc3d2b666 100644
@@ -7700,7 +7700,9 @@ _scsih_determine_disposition(struct MPT3SAS_ADAPTER *ioc,
 				u16 scode = scsi_sense_code(sense_info.asc,
 							    sense_info.ascq);
 
-				if (scode ==
+				if (scode == LU_NOT_READY_SANITIZE_IN_PROGRESS)
+					rc = DEVICE_READY;
+				else if (scode ==
 				    LU_NOT_READY_MANUAL_INTERVENTION_REQUIRED ||
 				    scode ==
 				    LU_NOT_ACCESSIBLE_TARGET_PORT_IN_STANDBY_STATE ||
Signature · 1 line
2.53.0
author maintainer
#88 lore raw

PATCH 88/1005 scsi: target: Validate REGISTER AND MOVE TransportID length

In reply to Greg Kroah-Hartman

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

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

From: Jia Jia <[email protected]>

[ Upstream commit 5d5913710c81eed6fa275b6a24773059d9dbfdfa ]

REGISTER AND MOVE has a 24-byte parameter-list header followed by a TransportID. A 24-byte parameter list with a zero TransportID length passes the existing tid_len + 24 check, then the handler reads buf[24] for the TransportID protocol identifier, one byte past the received parameter list.

A TransportID is at least 24 bytes. Reject shorter TransportIDs and compare the declared length with the bytes following the header before reading buf[24].

A malformed PR OUT sent through vhost-scsi triggered this read on a KASAN kernel. The command is now rejected with INVALID PARAMETER LIST before buf[24] is accessed.

Fixes c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
---
 drivers/target/target_core_pr.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/target/target_core_pr.c +5 -4
index 25b1bcacc0c8f..ca1a2802aa228 100644
@@ -3226,10 +3226,11 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
 	transport_kunmap_data_sg(cmd);
 	buf = NULL;
 
-	if ((tid_len + 24) != cmd->data_length) {
-		pr_err("SPC-3 PR: Illegal tid_len: %u + 24 byte header"
-			" does not equal CDB data_length: %u\n", tid_len,
-			cmd->data_length);
+	/* TransportID is at least 24 bytes. buf[24] is its first byte. */
+	if (tid_len < 24 ||
+	    tid_len != cmd->data_length - 24) {
+		pr_err("SPC-3 PR: Illegal tid_len: %u for data_length: %u\n",
+		       tid_len, cmd->data_length);
 		ret = TCM_INVALID_PARAMETER_LIST;
 		goto out_put_pr_reg;
 	}
Signature · 1 line
2.53.0
author maintainer
#89 lore raw

PATCH 89/1005 tipc: reject attaching bearer of different media to the same occupied device

In reply to Greg Kroah-Hartman

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

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

From: Tung Nguyen <[email protected]>

[ Upstream commit 0a0257228be902ff09608bcaf19ae7c6d58b028f ]

Currently, two bearers of different media types can be added to the same device (e.g., "eth:eth0" and "ib:eth0") via tipc command:

tipc bearer enable media eth dev eth0
tipc bearer enable media ib dev eth0

For each command execution, tipc_enable_l2_media() is called:

tipc_enable_l2_media()
dev_get_by_name()
dev_hold()

As a result, device->dev_refcnt is incremented twice, but the second bearer replaces the first one. This causes a leak in device->dev_refcnt.

Fix this by rejecting a bearer with a different media type when the device is already occupied.

---
 net/tipc/bearer.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
net/tipc/bearer.c +33 -0
index 5e7e220fa7f5a..d041a1a7c6dc4 100644
@@ -285,17 +285,50 @@ static int tipc_enable_bearer(struct net *net, const char *name,
 	bearer_id = MAX_BEARERS;
 	i = MAX_BEARERS;
 	while (i-- != 0) {
+		struct net_device *dev;
+
 		b = rtnl_dereference(tn->bearer_list[i]);
 		if (!b) {
 			bearer_id = i;
 			continue;
 		}
 		if (!strcmp(name, b->name)) {
+duplicate:
 			errstr = "already enabled";
 			NL_SET_ERR_MSG(extack, "Already enabled");
 			goto rejected;
 		}
 
+		/* udp media can be used together with any media */
+		if (b->media->type_id == TIPC_MEDIA_TYPE_UDP ||
+		    m->type_id == TIPC_MEDIA_TYPE_UDP)
+			goto priority;
+
+		dev = __dev_get_by_name(net, b_names.if_name);
+
+		if (!dev) {
+			res = -ENODEV;
+			errstr = "no device for the media";
+			NL_SET_ERR_MSG(extack, "No device for the media");
+			goto rejected;
+		}
+
+		if (rtnl_dereference(b->media_ptr) == dev) {
+			char *dev_name = strchr((const char *)b->name, ':') + 1;
+
+			/* Not allow altname of occupied device */
+			if (strcmp(dev_name, b_names.if_name) &&
+			    b->media->type_id == m->type_id)
+				goto duplicate;
+
+			/* Not allow eth and ib to attach to the same device */
+			errstr = "same dev for different media";
+			NL_SET_ERR_MSG(extack,
+				       "Same dev for different media");
+			goto rejected;
+		}
+
+priority:
 		if (b->priority == prio &&
 		    (++with_this_prio > 2)) {
 			pr_warn("Bearer <%s>: already 2 bearers with priority %u\n",
Signature · 1 line
2.53.0
author maintainer
#90 lore raw

PATCH 90/1005 net: ipa: Fix double free of the interrupt structure on config error

In reply to Greg Kroah-Hartman

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

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

From: Thomas Fourier <[email protected]>

[ Upstream commit cb284914e749388eef402938bdb3115fe1f6d337 ]

Since ipa_interrupt_init() allocates struct ipa_interrupt in ipa_probe(), the structure is owned by ipa_probe() and released with ipa_interrupt_exit() on its error paths and in ipa_remove(). The error path of ipa_interrupt_config() still frees it with kfree(). If ipa_interrupt_config() fails (called from ipa_config() via ipa_setup()), ipa_probe() unwinds through err_interrupt_exit, which frees the same structure again.

Drop the kfree() from ipa_interrupt_config(); it should only undo what it set up itself. Drop the leftover initialization and cleanup of ipa->interrupt now managed in ipa_proble() and ipa_remove() of ipa_main.c.

---
 drivers/net/ipa/ipa_interrupt.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/net/ipa/ipa_interrupt.c +2 -10
index 131b9cc942014..766b094eb0694 100644
@@ -260,10 +260,8 @@ int ipa_interrupt_config(struct ipa *ipa)
 	interrupt->enabled = 0;
 	interrupt->suspend_enabled = bitmap_zalloc(ipa->endpoint_count,
 						   GFP_KERNEL);
-	if (!interrupt->suspend_enabled) {
-		ret = -ENOMEM;
-		goto err_kfree;
-	}
+	if (!interrupt->suspend_enabled)
+		return -ENOMEM;
 
 	/* Disable IPA interrupt types */
 	reg = ipa_reg(ipa, IPA_IRQ_EN);
@@ -289,8 +287,6 @@ int ipa_interrupt_config(struct ipa *ipa)
 		goto err_disable_wakeup;
 	}
 
-	ipa->interrupt = interrupt;
-
 	return 0;
 
 err_disable_wakeup:
@@ -299,8 +295,6 @@ int ipa_interrupt_config(struct ipa *ipa)
 	free_irq(interrupt->irq, interrupt);
 err_free_bitmap:
 	bitmap_free(interrupt->suspend_enabled);
-err_kfree:
-	kfree(interrupt);
 
 	return ret;
 }
@@ -311,8 +305,6 @@ void ipa_interrupt_deconfig(struct ipa *ipa)
 	struct ipa_interrupt *interrupt = ipa->interrupt;
 	struct device *dev = ipa->dev;
 
-	ipa->interrupt = NULL;
-
 	dev_pm_clear_wake_irq(dev);
 	(void)device_init_wakeup(dev, false);
 	free_irq(interrupt->irq, interrupt);
Signature · 1 line
2.53.0
author maintainer
#91 lore raw

PATCH 91/1005 ALSA: memalloc: Free the new pages when WC DMA mapping fails

In reply to Greg Kroah-Hartman

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

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

[ Upstream commit 016fe9695e6dc1322ddfe8c7dbc7b973483b4a24 ]

snd_dma_wc_alloc() keeps the newly allocated pages in a local variable, and snd_dma_alloc_dir_pages() stores them in dmab->area only after ->alloc() returns. If dma_map_single() fails, the error path passes dmab->area to do_free_pages() instead, and that is still NULL at this point for the usual callers.

The pages are then leaked with their write-combining attribute still set, set_memory_wb() warns about the zero address, and for buffers larger than a page free_pages_exact() goes on to free the struct pages of the bogus addresses 4096, 8192 and so on. With CONFIG_DEBUG_VM that hits the VM_BUG_ON() in free_pages():

kernel BUG at mm/page_alloc.c:5600!

  RIP: 0010:free_pages_exact+0xcb/0xd0
  Call Trace:
   snd_dma_wc_alloc+0x14f/0x160 [snd_pcm]
   snd_dma_alloc_dir_pages+0x4f/0x80 [snd_pcm]

This was reproduced on an x86 guest without swiotlb by allocating SNDRV_DMA_TYPE_DEV_WC buffers for a device with a 24-bit streaming DMA mask, so that dma_map_single() fails.

Free the pages that were just allocated.

Fixes c880a5146642 ("ALSA: memalloc: Use proper DMA mapping API for x86 WC buffer allocations")
---
 sound/core/memalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/memalloc.c +1 -1
index 5bc7e586b430f..3118bb14231ce 100644
@@ -506,7 +506,7 @@ static void *snd_dma_wc_alloc(struct snd_dma_buffer *dmab, size_t size)
 		return NULL;
 	dmab->addr = dma_map_single(dmab->dev.dev, p, size, DMA_BIDIRECTIONAL);
 	if (dma_mapping_error(dmab->dev.dev, dmab->addr)) {
-		do_free_pages(dmab->area, size, true);
+		do_free_pages(p, size, true);
 		return NULL;
 	}
 	return p;
Signature · 1 line
2.53.0
author maintainer
#92 lore raw

PATCH 92/1005 ALSA: hda/core: Fix double free on stream page allocation failure

In reply to Greg Kroah-Hartman

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

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

[ Upstream commit 1886b8132cd37edbc28b55f30a885011aa0bbe8a ]

Since commit f16eaa38ea64 ("ALSA: hda/core: add cleanup in snd_hdac_bus_alloc_stream_pages()"), snd_hdac_bus_alloc_stream_pages() frees the BDL and position buffers it has already allocated when a later allocation fails. snd_dma_free_pages() doesn't clear dmab->area, so the freed buffers still look allocated to snd_hdac_bus_free_stream_pages(), which the HDA controller drivers call from their destructors, and they are freed a second time when the device is removed.

With fault injection failing the CORB/RIRB buffer allocation of snd-hda-intel on a QEMU ich9-intel-hda, unbinding the device then crashes:

  page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
  kernel BUG at include/linux/mm.h:1986!
  Call Trace:
   ___free_pages+0x9b/0xa0
   free_pages_exact+0xa5/0xd0
   snd_hdac_bus_free_stream_pages+0x43/0xb0 [snd_hda_core]
   azx_free+0xb3/0x1b0 [snd_hda_intel]
   azx_dev_free+0xd/0x20 [snd_hda_intel]

Clear the buffer pointers after freeing them in the error path.

Fixes f16eaa38ea64 ("ALSA: hda/core: add cleanup in snd_hdac_bus_alloc_stream_pages()")
---
 sound/hda/core/controller.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/hda/core/controller.c +4 -1
index 78855ac357c60..d1d85511a9dba 100644
@@ -745,10 +745,13 @@ int snd_hdac_bus_alloc_stream_pages(struct hdac_bus *bus)
 
 error_posbuf:
 	snd_dma_free_pages(&bus->posbuf);
+	bus->posbuf.area = NULL;
 error_bdl:
 	list_for_each_entry(s, &bus->stream_list, list) {
-		if (s->bdl.area)
+		if (s->bdl.area) {
 			snd_dma_free_pages(&s->bdl);
+			s->bdl.area = NULL;
+		}
 	}
 	return -ENOMEM;
 }
Signature · 1 line
2.53.0
author maintainer
#93 lore raw

PATCH 93/1005 bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet

In reply to Greg Kroah-Hartman

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

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

From: Ayushman Rout <[email protected]>

[ Upstream commit 696f0954e3b6280aa87ea4a6196153e506b0ab9c ]

When both dynptrs point into the same packet and the ranges overlap, bpf_dynptr_copy() can copy wrong data in two ways.

If one range fits into a segment and the other one does not, the slice of the first range is used as the buffer for __bpf_dynptr_read() or __bpf_dynptr_write(). The range that crosses into a frag is copied piece by piece, and an earlier piece can overwrite bytes that a later piece has yet to read.

If neither range fits into a segment, the chunks are copied from the start to the end through a 256 byte stack buffer. When the destination is above the source, a chunk written to the destination overwrites source bytes that later chunks have yet to read. For a copy of 1200 bytes with the destination 100 bytes above the source, the first chunk writes source bytes 100..355 and the second chunk then reads bytes 256..355 after they were overwritten.

Do not use a slice as the buffer when both dynptrs share the same data, and copy the chunks from the end to the start when the destination is above the source, like memmove() does.

The selftests added later in this series pass with this change.

---
 kernel/bpf/helpers.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
kernel/bpf/helpers.c +12 -4
index 7c2e6f0e74091..9100283e2935e 100644
@@ -3255,8 +3255,10 @@ __bpf_kfunc int bpf_dynptr_copy(const struct bpf_dynptr *dst_ptr, u64 dst_off,
 {
 	const struct bpf_dynptr_kern *dst = (struct bpf_dynptr_kern *)dst_ptr;
 	const struct bpf_dynptr_kern *src = (struct bpf_dynptr_kern *)src_ptr;
+	bool same = src->data == dst->data;
 	void *src_slice, *dst_slice;
 	char buf[256];
+	bool rev;
 	u64 off;
 
 	src_slice = bpf_dynptr_slice(src_ptr, src_off, NULL, size);
@@ -3267,25 +3269,31 @@ __bpf_kfunc int bpf_dynptr_copy(const struct bpf_dynptr *dst_ptr, u64 dst_off,
 		return 0;
 	}
 
-	if (src_slice)
+	/* The other range is copied piece by piece. A slice of the same packet
+	 * may overlap with it, so it cannot be the buffer for that.
+	 */
+	if (src_slice && !same)
 		return __bpf_dynptr_write(dst, dst_off, src_slice, size, 0);
 
-	if (dst_slice)
+	if (dst_slice && !same)
 		return __bpf_dynptr_read(dst_slice, size, src, src_off, 0);
 
 	if (bpf_dynptr_check_off_len(dst, dst_off, size) ||
 	    bpf_dynptr_check_off_len(src, src_off, size))
 		return -E2BIG;
 
+	/* like memmove(): from the end if the destination is above the source */
+	rev = same && dst->offset + dst_off > src->offset + src_off;
 	off = 0;
 	while (off < size) {
 		u64 chunk_sz = min_t(u64, sizeof(buf), size - off);
+		u64 pos = rev ? size - off - chunk_sz : off;
 		int err;
 
-		err = __bpf_dynptr_read(buf, chunk_sz, src, src_off + off, 0);
+		err = __bpf_dynptr_read(buf, chunk_sz, src, src_off + pos, 0);
 		if (err)
 			return err;
-		err = __bpf_dynptr_write(dst, dst_off + off, buf, chunk_sz, 0);
+		err = __bpf_dynptr_write(dst, dst_off + pos, buf, chunk_sz, 0);
 		if (err)
 			return err;
 
Signature · 1 line
2.53.0
author maintainer
#94 lore raw

PATCH 94/1005 netfilter: nft_reject: prevent unbounded recursion in output hooks

In reply to Greg Kroah-Hartman

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

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

From: Fernando Fernandez Mancera <[email protected]>

[ Upstream commit d6c18cadfc6c7a88e9e07e0a1b5ead37c0ddf866 ]

nftables payload-mangling rules can rewrite packet contents (such as TCP flags) before they are evaluated by reject targets. This defeats the content-based loop guards, allowing unbounded hook recursion that leads to kernel stack exhaustion and panics.

Fix this by extracting the per-CPU xmit recursion limit previously used by the netdev duplication/forwarding paths into a shared header, and apply it to the inet and inet6 reject transmit functions. It disables BH while transmitting the skb to address a possible migration to different CPU leading to imbalanced decrementation of the recursion counters.

Note that the dev_queue_xmit() path used when CONFIG_BRIDGE_NETFILTER is enabled does not require this recursion guard. In that scenario, the generated reset packet is transmitted directly at Layer 2. Because the packet egresses from a different hook, it cannot synchronously loop. In addition nf_send_unreach() and nf_send_unreach6() are safe as the ICMP transmit functions are protected against recursion by the icmp_xmit_lock() and icmpv6_xmit_lock() guards.

---
 include/linux/netdevice_xmit.h        |  4 +--
 include/net/netfilter/nf_dup_netdev.h | 35 ----------------------
 include/net/netfilter/nf_recursion.h  | 42 +++++++++++++++++++++++++++
 net/ipv4/netfilter/nf_reject_ipv4.c   | 12 ++++++++
 net/ipv6/netfilter/nf_reject_ipv6.c   | 13 +++++++++
 net/netfilter/nf_dup_netdev.c         |  1 +
 net/netfilter/nft_fwd_netdev.c        |  1 +
 7 files changed, 71 insertions(+), 37 deletions(-)
 create mode 100644 include/net/netfilter/nf_recursion.h
include/linux/netdevice_xmit.h +2 -2
index cc232508e695e..286ae5a6101e8 100644
@@ -18,8 +18,8 @@ struct netdev_xmit {
 	u8			sched_mirred_nest;
 	struct net_device	*sched_mirred_dev[MIRRED_NEST_LIMIT];
 #endif
-#if IS_ENABLED(CONFIG_NF_DUP_NETDEV)
-	u8 nf_dup_skb_recursion;
+#if IS_ENABLED(CONFIG_NETFILTER)
+	u8 nf_xmit_skb_recursion;
 #endif
 };
 
include/net/netfilter/nf_dup_netdev.h +0 -35
index f6b05bd80c3fe..a394112646144 100644
@@ -9,41 +9,6 @@
 void nf_dup_netdev_egress(const struct nft_pktinfo *pkt, int oif);
 void nf_fwd_netdev_egress(const struct nft_pktinfo *pkt, int oif);
 
-#define NF_RECURSION_LIMIT	2
-
-#ifndef CONFIG_PREEMPT_RT
-static inline bool nf_dev_xmit_recursion(void)
-{
-	return unlikely(__this_cpu_read(softnet_data.xmit.nf_dup_skb_recursion) >
-			NF_RECURSION_LIMIT);
-}
-
-static inline void nf_dev_xmit_recursion_inc(void)
-{
-	__this_cpu_inc(softnet_data.xmit.nf_dup_skb_recursion);
-}
-
-static inline void nf_dev_xmit_recursion_dec(void)
-{
-	__this_cpu_dec(softnet_data.xmit.nf_dup_skb_recursion);
-}
-#else
-static inline bool nf_dev_xmit_recursion(void)
-{
-	return unlikely(current->net_xmit.nf_dup_skb_recursion > NF_RECURSION_LIMIT);
-}
-
-static inline void nf_dev_xmit_recursion_inc(void)
-{
-	current->net_xmit.nf_dup_skb_recursion++;
-}
-
-static inline void nf_dev_xmit_recursion_dec(void)
-{
-	current->net_xmit.nf_dup_skb_recursion--;
-}
-#endif
-
 struct nft_offload_ctx;
 struct nft_flow_rule;
 
include/net/netfilter/nf_recursion.h new file +42 -0

42 lines not on this page · raw message

net/ipv4/netfilter/nf_reject_ipv4.c +12 -0
index 7cb33af671e26..4082fa184af8b 100644
@@ -10,6 +10,7 @@
 #include <net/dst.h>
 #include <net/dst_metadata.h>
 #include <net/netfilter/ipv4/nf_reject.h>
+#include <net/netfilter/nf_recursion.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter_bridge.h>
 
@@ -336,7 +337,18 @@ void nf_send_reset(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 		dev_queue_xmit(nskb);
 	} else
 #endif
+	{
+		local_bh_disable();
+		if (nf_dev_xmit_recursion()) {
+			local_bh_enable();
+			goto free_nskb;
+		}
+
+		nf_dev_xmit_recursion_inc();
 		ip_local_out(net, nskb->sk, nskb);
+		nf_dev_xmit_recursion_dec();
+		local_bh_enable();
+	}
 
 	return;
 
net/ipv6/netfilter/nf_reject_ipv6.c +13 -0
index 5e08d8529cc88..7c94641845175 100644
@@ -10,6 +10,7 @@
 #include <net/ip6_checksum.h>
 #include <net/dst_metadata.h>
 #include <net/netfilter/ipv6/nf_reject.h>
+#include <net/netfilter/nf_recursion.h>
 #include <linux/netfilter_ipv6.h>
 #include <linux/netfilter_bridge.h>
 
@@ -409,7 +410,19 @@ void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 		dev_queue_xmit(nskb);
 	} else
 #endif
+	{
+		local_bh_disable();
+		if (nf_dev_xmit_recursion()) {
+			local_bh_enable();
+			kfree_skb(nskb);
+			return;
+		}
+
+		nf_dev_xmit_recursion_inc();
 		ip6_local_out(net, sk, nskb);
+		nf_dev_xmit_recursion_dec();
+		local_bh_enable();
+	}
 }
 EXPORT_SYMBOL_GPL(nf_send_reset6);
 
net/netfilter/nf_dup_netdev.c +1 -0
index c6bd5c29bed66..918716629c155 100644
@@ -12,6 +12,7 @@
 #include <net/netfilter/nf_tables.h>
 #include <net/netfilter/nf_tables_offload.h>
 #include <net/netfilter/nf_dup_netdev.h>
+#include <net/netfilter/nf_recursion.h>
 
 static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev,
 				enum nf_dev_hooks hook)
net/netfilter/nft_fwd_netdev.c +1 -0
index a48c2f765bbaa..7447da931a957 100644
@@ -14,6 +14,7 @@
 #include <net/netfilter/nf_tables.h>
 #include <net/netfilter/nf_tables_offload.h>
 #include <net/netfilter/nf_dup_netdev.h>
+#include <net/netfilter/nf_recursion.h>
 #include <net/neighbour.h>
 #include <net/ip.h>
 
Signature · 1 line
2.53.0
author maintainer
#95 lore raw

PATCH 95/1005 ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable

In reply to Greg Kroah-Hartman

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

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

From: Tang Bin <[email protected]>

[ Upstream commit e2df0223ba6dbdf028c45b4a018e6b15642a39af ]

swclk_gate_enable() calls pm_runtime_resume_and_get() (incrementing the PM usage counter and, via of_pm_clk_add_clks, enabling mclk) before rx_macro_mclk_enable(). On rx_macro_mclk_enable() failure it called clk_disable_unprepare(rx->mclk) and returned, leaking the PM usage counter and potentially unbalancing the clock that the PM clock domain also manages. The sibling tx-macro/va-macro drivers call pm_runtime_put_autosuspend() here; do the same.

Fixes e38cbb75248a ("ASoC: codecs: lpass-rx-macro: Propagate regcache_sync() errors")
---
 sound/soc/codecs/lpass-rx-macro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/lpass-rx-macro.c +1 -1
index 282a6aaa99865..1737d525ca86d 100644
@@ -3681,7 +3681,7 @@ static int swclk_gate_enable(struct clk_hw *hw)
 
 	ret = rx_macro_mclk_enable(rx, true);
 	if (ret) {
-		clk_disable_unprepare(rx->mclk);
+		pm_runtime_put_autosuspend(rx->dev);
 		return ret;
 	}
 
Signature · 1 line
2.53.0
author maintainer
#96 lore raw

PATCH 96/1005 bpf, x86: Fix bpf_throw() in a prog with a private stack

In reply to Greg Kroah-Hartman

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

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

From: Alexei Starovoitov <[email protected]>

[ Upstream commit 91068ed2d3ee0713d7566c7977b995f8a0936bea ]

When the main prog has a private stack and the prog calls bpf_throw(), it returns to the kernel with wrong values in r12, rbx, r13, r14 and r15. The kernel crashes soon after that, for example:

  BUG: kernel NULL pointer dereference, address: 0000000000000010
  RIP: 0010:__bpf_prog_test_run_raw_tp+0x125/0x380

The main prog of a prog that can throw saves these five registers at its entry. bpf_throw() walks the stack to the frame of the main prog and gives the stack pointer of that frame to the exception callback, which pops the registers from there. In a function with a private stack r9 is the frame pointer, and the JIT emits 'push r9' in front of every call and 'pop r9' after it. So the stack pointer that bpf_throw() finds is 8 bytes too low:

r12
rbx
r13
r14
r15 <- the callback has to pop from here
r9 <- rsp of the main prog at the call

r15 gets the address of the private stack and every other register gets the value of its neighbour.

This happens in tracepoint, raw_tp, perf_event and tracing progs, except iterators, and in struct_ops progs that ask for a private stack, when the main prog has more than 48 bytes of stack. The throw can be in the main prog or in a subprog.

aux->stack_arg_sp_adjust already moves the stack pointer from the outgoing stack arguments up to the saved registers. Add the 8 bytes of r9 to it when the main prog has a private stack.

A constant is enough. Calls of helpers, kfuncs and subprogs and callx all have the push. A prog with tail calls has no private stack, and a callback cannot throw. Only the frame of the main prog matters: the frames of subprogs are dropped, with or without a private stack. On x86-64 a function with stack arguments has no private stack, hence only one of the two parts is not zero.

The JITed code does not change.

Fixes 7d1cd70d4b16 ("bpf, x86: Support private stack in jit")
---
 arch/x86/net/bpf_jit_comp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/net/bpf_jit_comp.c +6 -1
index 10f68ee7c9e68..1b56cb973d79e 100644
@@ -1838,8 +1838,13 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 	 * Arg 6 goes into r9 register, not on stack.
 	 */
 	outgoing_rsp = out_stack_arg_cnt > 1 ? (out_stack_arg_cnt - 1) * 8 : 0;
+	/*
+	 * bpf_throw() sees rsp of this frame as it is at a call. The callee-saved
+	 * regs are above the outgoing args, or above r9, which is pushed around
+	 * every call when the stack is private.
+	 */
 	if (bpf_prog->aux->exception_boundary)
-		bpf_prog->aux->stack_arg_sp_adjust = outgoing_rsp;
+		bpf_prog->aux->stack_arg_sp_adjust = outgoing_rsp + (priv_frame_ptr ? 8 : 0);
 	emit_sub_rsp(&prog, outgoing_rsp);
 
 	if (arena_vm_start)
Signature · 1 line
2.53.0
author maintainer
#97 lore raw

PATCH 97/1005 spi: pic32-sqi: fail transfer when the BD ring is exhausted

In reply to Greg Kroah-Hartman

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

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

From: Hongjian Dai <[email protected]>

[ Upstream commit 2066970324a1439e5a2e08c4599098367f8f82cc ]

pic32_sqi_one_transfer() silently stopped programming buffer descriptors when ring_desc_get() returned NULL and still returned success. The caller then marked the last programmed descriptor as the end of the list and started the DMA engine, so the hardware transferred only a prefix of the requested data while the message completed with status 0.

The ring holds PESQI_BD_COUNT (256) descriptors of at most PESQI_BD_BUF_LEN_MAX (256) bytes each, so messages larger than 64 KiB (or with enough SG entries) can exhaust it. Since the driver sets no max_message_size/max_transfer_size, the SPI core does not prevent this.

Return -ENOMEM instead, and set msg->status so the failure reaches the caller rather than being silently truncated.

---
 drivers/spi/spi-pic32-sqi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spi/spi-pic32-sqi.c +2 -1
index 5d3921e29461c..35f0c60a31d64 100644
@@ -297,7 +297,7 @@ static int pic32_sqi_one_transfer(struct pic32_sqi *sqi,
 		/* get ring descriptor */
 		rdesc = ring_desc_get(sqi);
 		if (!rdesc)
-			break;
+			return -ENOMEM;
 
 		bd = rdesc->bd;
 
@@ -387,6 +387,7 @@ static int pic32_sqi_one_message(struct spi_controller *host,
 		ret = pic32_sqi_one_transfer(sqi, msg, xfer);
 		if (ret) {
 			dev_err(&spi->dev, "xfer %p err\n", xfer);
+			msg->status = ret;
 			goto xfer_out;
 		}
 	}
Signature · 1 line
2.53.0
author maintainer
#98 lore raw

PATCH 98/1005 bpf: Clamp the trace length in __bpf_get_stack() again

In reply to Greg Kroah-Hartman

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

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

From: Josef Bacik <[email protected]>

[ Upstream commit 007fd460798be9af7d4874734f934afa47742f29 ]

get_perf_callchain() and get_callchain_entry_for_task() store a trace in a per-CPU entry, one per context. They release the entry before they return it. Thus a second user in the same context can write to the entry while the first user reads it. preempt_disable() stops only other tasks.

__bpf_get_stack() requests at most max_depth frames. This is skip plus the frames that fit in the buffer, but not more than perf_event_max_stack. Since the commit below, it copies 'trace->nr - skip' frames with no limit. But a second user can store a longer trace. The unwinders of PowerPC add context markers that max_depth does not limit. In both cases the copy writes after the end of the buffer.

Read trace->nr one time. Clamp the value to max_depth before the skip test, as __bpf_get_stack_pe() does. Thus when max_depth is less than skip, the helper returns -EFAULT, and 'trace_nr - skip' does not underflow. The copied frames can still be those of the second user.

Fixes e17d62fedd10 ("bpf: Refactor stack map trace depth calculation into helper function")
---
 kernel/bpf/stackmap.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
kernel/bpf/stackmap.c +17 -7
index d09d4c3fe547c..84ccfa9df4637 100644
@@ -827,14 +827,20 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 					   crosstask, false, 0);
 	}
 
-	if (unlikely(!trace) || trace->nr < skip) {
-		if (may_fault)
-			rcu_read_unlock();
-		preempt_enable();
-		goto err_fault;
-	}
+	if (unlikely(!trace))
+		goto err_unlock;
+
+	/*
+	 * trace->nr can be above max_depth. The per-CPU entry is released
+	 * already: a tracing program or an NMI which takes a callchain in the
+	 * same context before the copy below reuses it. And the unwinders of
+	 * PowerPC store context markers on top of max_depth.
+	 */
+	trace_nr = min_t(u32, READ_ONCE(trace->nr), max_depth);
+	if (trace_nr < skip)
+		goto err_unlock;
 
-	trace_nr = callchain_store(trace, trace->nr, buf, elem_size, flags);
+	trace_nr = callchain_store(trace, trace_nr, buf, elem_size, flags);
 
 	/* trace should not be dereferenced after this point */
 	if (may_fault)
@@ -843,6 +849,10 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 
 	return callchain_finalize(buf, size, trace_nr, elem_size, flags, may_fault);
 
+err_unlock:
+	if (may_fault)
+		rcu_read_unlock();
+	preempt_enable();
 err_fault:
 	err = -EFAULT;
 clear:
Signature · 1 line
2.53.0
author maintainer
#99 lore raw

PATCH 99/1005 bpf: Clamp the trace length before the skip test in stackid_init()

In reply to Greg Kroah-Hartman

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

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

From: Alexei Starovoitov <[email protected]>

[ Upstream commit a08ba2ab79dffd92c32d3f2dadfc7eba03625a2b ]

stackid_init() gives a bucket of the stack map
min(trace_nr - skip, max_depth - skip) trace entries. Here max_depth is the size of a bucket plus skip, but at most perf_event_max_stack. Context markers can make trace_nr larger than that, so the skip test can pass when max_depth < skip. Then 'max_depth - skip' wraps, and the kernel can write after the bucket.

Clamp trace_nr to max_depth before the skip test, as __bpf_get_stack_pe() does. The result changes only when skip >= max_depth. Then it is -EFAULT. Until now skip == max_depth could give the id of an empty trace.

get_perf_callchain() releases the trace, so an NMI can change trace->nr. Use READ_ONCE() in bpf_get_stackid(), so the compiler reads it one time.

Fixes 23f852daa4ba ("bpf: Fix stackmap overflow check in __bpf_get_stackid()")
---
 kernel/bpf/stackmap.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
kernel/bpf/stackmap.c +6 -3
index 84ccfa9df4637..118fec76b9c24 100644
@@ -527,12 +527,14 @@ static int stackid_init(struct stackid *stackid, struct bpf_map *map,
 	u32 skip = flags & BPF_F_SKIP_FIELD_MASK;
 	u32 max_depth;
 
+	max_depth = stack_map_calculate_max_depth(map->value_size, stack_map_data_size(map), flags);
+	/* trace_nr can be above max_depth and max_depth below skip: clamp first */
+	trace_nr = min_t(u32, trace_nr, max_depth);
 	if (trace_nr <= skip)
 		/* skipping more than usable stack trace */
 		return -EFAULT;
 
-	max_depth = stack_map_calculate_max_depth(map->value_size, stack_map_data_size(map), flags);
-	stackid->nr = min_t(u32, trace_nr - skip, max_depth - skip);
+	stackid->nr = trace_nr - skip;
 	stackid->len = stackid->nr * sizeof(u64);
 	stackid->ips = trace->ip + skip;
 	stackid->hash = jhash2((const u32 *)stackid->ips, stackid->len / sizeof(u32), 0);
@@ -647,7 +649,8 @@ BPF_CALL_3(bpf_get_stackid, struct pt_regs *, regs, struct bpf_map *, map,
 			/* couldn't fetch the stack trace */
 			return -EFAULT;
 
-		err = stackid_fastpath(&stackid, map, trace, trace->nr, flags);
+		/* the entry is released already, an NMI can change trace->nr */
+		err = stackid_fastpath(&stackid, map, trace, READ_ONCE(trace->nr), flags);
 		if (err != -ENOENT)
 			return err;
 
Signature · 1 line
2.53.0
author maintainer
#100 lore raw

PATCH 100/1005 bpf: Refuse to map an arena at address 0

In reply to Greg Kroah-Hartman

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

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

From: Alexei Starovoitov <[email protected]>

[ Upstream commit ca580b034380fa9a69cc973637d1859ec4f5b344 ]

The first mmap() of an arena sets user_vm_start and user_vm_end. Each subsequent mmap() must use the same range. The value 0 in user_vm_start means that the range is not set, but a mapping can start at address 0. Then arena_map_mmap() does not check vm_start and sets user_vm_start again. The range tree counts pages from user_vm_start. With a new user_vm_start it reports allocated pages as free, and apply_range_set_cb() fails with -EBUSY.

An arena at address 0 is not useful, because the verifier rejects all progs that refer to it. Return -EINVAL from arena_get_unmapped_area(). It runs before mmap() removes the old mappings in the range.

Fixes 317460317a02 ("bpf: Introduce bpf_arena.")
---
 kernel/bpf/arena.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/bpf/arena.c +3 -0
index 868589f073301..a10981be21fe6 100644
@@ -650,6 +650,9 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad
 	ret = mm_get_unmapped_area(filp, addr, len * 2, 0, flags);
 	if (IS_ERR_VALUE(ret))
 		return ret;
+	if (!ret)
+		/* user_vm_start == 0 means that the user range is not set yet */
+		return -EINVAL;
 	if ((ret >> 32) == ((ret + len - 1) >> 32))
 		return ret;
 	if (WARN_ON_ONCE(arena->user_vm_start))
Signature · 1 line
2.53.0
author maintainer
#101 lore raw

PATCH 101/1005 bpf: Dont let bpf_arena_free_pages() see a half-set user range

In reply to Greg Kroah-Hartman

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

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

From: Alexei Starovoitov <[email protected]>

[ Upstream commit 52498f14c2d26d67a9bf06998b797900827a06ad ]

If map_extra is 0, the first arena_map_mmap() sets user_vm_start and user_vm_end. It holds arena->lock, but bpf_arena_free_pages() reads both fields without this mutex. The kfunc relies on the verifier, which rejects a prog if user_vm_start of its arena is 0. But this check covers only the maps in used_maps. The kfunc accepts any trusted pointer to struct bpf_map.

Thus the kfunc can run during arena_map_mmap() and read user_vm_start as 0 and user_vm_end as vma->vm_end. Then min() does not limit page_cnt to the arena. arena_free_range() unmaps and frees pages of other vmalloc areas.

Read user_vm_start one time and return if it is 0. This value means that no range is set, because arena_get_unmapped_area() rejects address 0. If only user_vm_end is still 0, uaddr_end is 0 and the kfunc returns, as today.

Fixes 317460317a02 ("bpf: Introduce bpf_arena.")
---
 kernel/bpf/arena.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/bpf/arena.c +4 -2
index a10981be21fe6..607768ef4bb5f 100644
@@ -990,6 +990,8 @@ static int arena_free_range(struct bpf_arena *arena, long uaddr, long page_cnt)
 
 static void arena_free_pages(struct bpf_arena *arena, long uaddr, long page_cnt, bool sleepable)
 {
+	/* The first mmap() may be setting the user range right now */
+	u64 user_vm_start = READ_ONCE(arena->user_vm_start);
 	struct mem_cgroup *new_memcg, *old_memcg;
 	u64 full_uaddr, uaddr_end;
 	struct arena_free_span *s;
@@ -997,8 +999,8 @@ static void arena_free_pages(struct bpf_arena *arena, long uaddr, long page_cnt,
 	/* only aligned lower 32-bit are relevant */
 	uaddr = (u32)uaddr;
 	uaddr &= PAGE_MASK;
-	full_uaddr = clear_lo32(arena->user_vm_start) + uaddr;
-	if (full_uaddr < arena->user_vm_start)
+	full_uaddr = clear_lo32(user_vm_start) + uaddr;
+	if (!user_vm_start || full_uaddr < user_vm_start)
 		return;
 	uaddr_end = min(arena->user_vm_end, full_uaddr + (page_cnt << PAGE_SHIFT));
 	if (full_uaddr >= uaddr_end)
Signature · 1 line
2.53.0
author maintainer
#102 lore raw

PATCH 102/1005 bpf: Refuse an arena mmap() longer than max_entries pages

In reply to Greg Kroah-Hartman

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

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

From: Alexei Starovoitov <[email protected]>

[ Upstream commit 1e01345b87f13c354687360cb81ed2a521ff2b13 ]

arena_map_alloc() puts max_entries free pages in the range tree of an arena. But the arena kfuncs check their arguments against user_vm_start and user_vm_end. Without map_extra, arena_map_mmap() takes both from the first vma. This vma can be up to 4 GiB long. Then arena_free_pages() also marks pages as free that were never in the range tree. Thus max_entries does not limit the memory of the arena, but these pages are inside kern_vm.

Refuse an mmap() longer than max_entries pages with -E2BIG. With map_extra this limit exists already. libbpf always maps max_entries pages. Replace both SZ_4G checks with this limit, because it is at most 4 GiB.

Fixes 317460317a02 ("bpf: Introduce bpf_arena.")
---
 kernel/bpf/arena.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/bpf/arena.c +2 -2
index 607768ef4bb5f..8b0892e19b198 100644
@@ -634,7 +634,7 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad
 
 	if (pgoff)
 		return -EINVAL;
-	if (len > SZ_4G)
+	if (len > (u64)map->max_entries * PAGE_SIZE)
 		return -E2BIG;
 
 	/* if user_vm_start was specified at arena creation time */
@@ -682,7 +682,7 @@ static int arena_map_mmap(struct bpf_map *map, struct vm_area_struct *vma)
 		return -EBUSY;
 
 	/* Earlier checks should prevent this */
-	if (WARN_ON_ONCE(vma->vm_end - vma->vm_start > SZ_4G || vma->vm_pgoff))
+	if (WARN_ON_ONCE(vma_pages(vma) > map->max_entries || vma->vm_pgoff))
 		return -EFAULT;
 
 	if (remember_vma(arena, vma))
Signature · 1 line
2.53.0
author maintainer
#103 lore raw

PATCH 103/1005 bpf: Remove the WARN from arena_get_unmapped_area()

In reply to Greg Kroah-Hartman

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

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

From: Alexei Starovoitov <[email protected]>

[ Upstream commit 15dedd4b259289bffb8a5485b81722fdaebac71a ]

The user range of an arena must not cross a 4 GiB boundary. Thus arena_get_unmapped_area() asks the mm for 2 * len bytes and rounds the result up if necessary. If user_vm_start is not 0, addr must be equal to it. A WARN_ON_ONCE() assumes that the mm returns addr. But addr is only a hint without MAP_FIXED, and the mm can return a different range that crosses a boundary. This is not a kernel bug.

Remove the WARN_ON_ONCE() and its -EFAULT. arena_map_mmap() already compares vm_start with user_vm_start under arena->lock. If the rounded result is user_vm_start, mmap() succeeds. If not, it returns -EBUSY.

Fixes 317460317a02 ("bpf: Introduce bpf_arena.")
---
 kernel/bpf/arena.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/bpf/arena.c +0 -3
index 8b0892e19b198..8e1f7bfd2b4f7 100644
@@ -655,9 +655,6 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad
 		return -EINVAL;
 	if ((ret >> 32) == ((ret + len - 1) >> 32))
 		return ret;
-	if (WARN_ON_ONCE(arena->user_vm_start))
-		/* checks at map creation time should prevent this */
-		return -EFAULT;
 	return round_up(ret, SZ_4G);
 }
 
Signature · 1 line
2.53.0
author maintainer
#104 lore raw

PATCH 104/1005 bpf: Require prog fd or capability for cgroup detach

In reply to Greg Kroah-Hartman

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

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

From: Chris Mason <[email protected]>

[ Upstream commit 2962329f7c86fc51c177d4049c0f15a95ebd270c ]

Since the commit below a cgroup prog detach does not require CAP_NET_ADMIN. The fd of the attached prog gives the permission instead. But the detach requires this fd only with BPF_F_ALLOW_MULTI. Without this flag a cgroup has only one prog per attach type. Then find_detach_entry() returns this prog and does not compare it with the prog of the caller. Thus the kernel detaches this prog for a caller with neither the fd nor a capability.

Compare the two progs. If they are different, require CAP_NET_ADMIN or CAP_SYS_ADMIN in the initial user namespace. The error is -EPERM. A detach from tcx or netkit without a prog fd already requires these capabilities. With BPF_F_ALLOW_MULTI nothing changes.

Without these capabilities, a caller of bpf_prog_detach() of libbpf must now use bpf_prog_detach2() with the fd of the attached prog.

---
 kernel/bpf/cgroup.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
kernel/bpf/cgroup.c +7 -2
index 149672c76c49c..84a3d9cc52b76 100644
@@ -1125,9 +1125,14 @@ static struct bpf_prog_list *find_detach_entry(struct hlist_head *progs,
 			return ERR_PTR(-ENOENT);
 
 		/* to maintain backward compatibility NONE and OVERRIDE cgroups
-		 * allow detaching with invalid FD (prog==NULL) in legacy mode
+		 * allow detaching with invalid FD (prog==NULL) in legacy mode.
+		 * Without the FD of the attached program the caller needs
+		 * CAP_NET_ADMIN or CAP_SYS_ADMIN in the initial user namespace.
 		 */
-		return hlist_entry(progs->first, typeof(*pl), node);
+		pl = hlist_entry(progs->first, typeof(*pl), node);
+		if (pl->prog != prog && !bpf_net_capable())
+			return ERR_PTR(-EPERM);
+		return pl;
 	}
 
 	if (!prog && !link)
Signature · 1 line
2.53.0
author maintainer
#105 lore raw

PATCH 105/1005 bpf, cgroup: Keep the skb network offset signed

In reply to Greg Kroah-Hartman

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

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

From: Chris Mason <[email protected]>

[ Upstream commit 3f9780d62dd1112ca15b5ae73568d29d42ccc950 ]

cgroup_skb progs see a packet from its network header. While they run, __cgroup_bpf_run_filter_skb() moves skb->data there. It assumes that the network header is not after skb->data. It negates skb_network_offset(skb) and pushes skb->data by this offset. The offset is an unsigned int.

But ip6mr_cache_report() and bpf_lwt_xmit_reroute() can pass an skb that has data before the network header. Then the offset wraps. On a 64-bit kernel skb->data is then far below skb->head.

skb->len has 32 bits and wraps to the correct value, thus only skb->data is wrong. A read of packet data faults or gets other memory.

Keep the offset in an int. Pull skb->data when the network header is after it. Otherwise push it, as today.

Fixes 3007098494be ("cgroup: add support for eBPF programs")
---
 kernel/bpf/cgroup.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
kernel/bpf/cgroup.c +14 -3
index 84a3d9cc52b76..59326938a01ea 100644
@@ -1630,7 +1630,7 @@ int __cgroup_bpf_run_filter_skb(struct sock *sk,
 				struct sk_buff *skb,
 				enum cgroup_bpf_attach_type atype)
 {
-	unsigned int offset = -skb_network_offset(skb);
+	int offset = skb_network_offset(skb);
 	struct sock *save_sk;
 	void *saved_data_end;
 	struct cgroup *cgrp;
@@ -1642,7 +1642,15 @@ int __cgroup_bpf_run_filter_skb(struct sock *sk,
 	cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data);
 	save_sk = skb->sk;
 	skb->sk = sk;
-	__skb_push(skb, offset);
+
+	/*
+	 * The program sees the packet from its network header on, on
+	 * whichever side of skb->data that header lies.
+	 */
+	if (offset > 0)
+		__skb_pull(skb, offset);
+	else
+		__skb_push(skb, -offset);
 
 	/* compute pointers for the bpf prog */
 	bpf_compute_and_save_data_end(skb, &saved_data_end);
@@ -1684,7 +1692,10 @@ int __cgroup_bpf_run_filter_skb(struct sock *sk,
 			ret = -EFAULT;
 	}
 	bpf_restore_data_end(skb, saved_data_end);
-	__skb_pull(skb, offset);
+	if (offset > 0)
+		__skb_push(skb, offset);
+	else
+		__skb_pull(skb, -offset);
 	skb->sk = save_sk;
 
 	return ret;
Signature · 1 line
2.53.0