Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 7.3 0000/1005] 7.3.7-rc1 review
@ 2026-11-25 14:22 Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0001/1005] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
                   ` (373 more replies)
  0 siblings, 374 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
	shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr

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 <gregkh@linuxfoundation.org>
    Linux 7.3.7-rc1

Kuniyuki Iwashima <kuniyu@google.com>
    tcp: Set unhashed_state in inet_twsk_hashdance_schedule().

Luiz Capitulino (Red Hat) <luiz.capitulino@linux.dev>
    powerpc/watchdog: disable watchdog when watchdog_thresh=0

Thomas Lamprecht <t.lamprecht@proxmox.com>
    drm/amd/display: Don't warn about links without an HPD GPIO

Hyunwoo Kim <imv4bel@gmail.com>
    tcp: fix NULL pointer dereference when restarting a Fast Open listener

Mani Tofigh <mt4022@columbia.edu>
    nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem()

Henry Martin <bsdhenrymartin@gmail.com>
    sctp: fix skb_over_panic when adding addresses with a pending delete of another family

Karol Wachowski <karol.wachowski@linux.intel.com>
    accel/ivpu: Defer recovery until probe completes

Hyunjung Ko <hj351016@gmail.com>
    gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes

Mani Tofigh <mt4022@columbia.edu>
    blk-mq: take quiesce_lock when removing a queue from the tag set

Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
    fou: reserve headroom before pushing the encap header

Karl Mehltretter <kmehltretter@gmail.com>
    iio: trigger: Return an error when the trigger has no free irq

Changyul Lee <lcy8047@gmail.com>
    iio: trigger: free the trigger ID after device_del()

Salah Triki <salah.triki@gmail.com>
    iio: temperature: mlx90614: Fix dual channel probe condition check

Christopher Hoover <ch@murgatroid.com>
    iio: temperature: hid-sensor-temperature: Use per-instance callbacks

Arnav Kapoor <kapoorarnav43@gmail.com>
    iio: proximity: sx9500: ignore event config writes that don't change state

Arnav Kapoor <kapoorarnav43@gmail.com>
    iio: proximity: sx9360: fix sampling frequency write and available range

Arnav Kapoor <kapoorarnav43@gmail.com>
    iio: proximity: sx9324: fix out-of-bounds read of scan period table

Myeonghun Pak <mhun512@gmail.com>
    iio: proximity: hx9023s: Allocate trigger before requesting IRQ

Viral Patel <viral8854@gmail.com>
    iio: magnetometer: tlv493d: fix magnetic field scale

Shashank Mohan Jain <jain.sm@gmail.com>
    iio: magnetometer: mmc5633: leave cache-only mode before the cache sync

Shashank Mohan Jain <jain.sm@gmail.com>
    iio: magnetometer: mmc35240: leave cache-only mode before the cache sync

Alexander Sarmanow <as@discnull.de>
    iio: light: vcnl4035: Fix reversed ALS mode bit

Jan Remes <jan.remes@mycroftmind.com>
    iio: light: tsl2591: don't divide by zero

Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
    iio: inv_sensors: prevent timestamps going back in time in transitions

Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
    iio: inv_sensors: do not compute period estimation when updating odr

Jiale Yao <yaojiale02@163.com>
    iio: imu: kmx61: reject duplicate event disable

Arnav Kapoor <kapoorarnav43@gmail.com>
    iio: imu: inv_mpu6050: fix swapped accel and gyro startup times

Arnav Kapoor <kapoorarnav43@gmail.com>
    iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes

Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
    iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change

Christopher Hoover <ch@murgatroid.com>
    iio: humidity: hid-sensor-humidity: Use per-instance callbacks

Vidhu Sarwal <vidhu.linux@gmail.com>
    iio: humidity: am2315: fix negative temperature decoding

Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    iio: hid-sensors: fix fractional part for unit exponents -7 and -8

Maximilian Czirr <maxx-cz@web.de>
    iio: hid-sensor: Fix scale for magnetic north heading

Jiale Yao <yaojiale02@163.com>
    iio: gyro: bmg160: reject duplicate event disable

Baek Kyu, Kim <pocj8ur4in@gmail.com>
    iio: dac: mcp4725: Update the cached DAC value only on success

Arnav Kapoor <kapoorarnav43@gmail.com>
    iio: common: scmi_sensors: fix truncating 64-bit divisions

Nikhil Gautam <nikhilgtr@gmail.com>
    iio: atlas-ezo: Fix humidity channel read support

Andrea Amer <and.amer@gmail.com>
    iio: afe: rescale: expose offset if rescaler or source has one

Billy Tsai <billy_tsai@aspeedtech.com>
    iio: adc: aspeed: Use syscon phandle for trimming data when available

Yu-Hsiang Tseng <asas1asas200@gmail.com>
    iio: acpi: Accept comma separated values in ROTM strings

Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
    iio: accel: kxsd9: Fix potential use-after-free on removal

Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
    iio: accel: adxl313: add missing buffer selections in Kconfig

Billy Tsai <billy_tsai@aspeedtech.com>
    dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs

Johan Hovold <johan@kernel.org>
    USB: serial: io_edgeport: serialise MCR accesses

Johan Hovold <johan@kernel.org>
    USB: serial: io_edgeport: fix potential use-after-free on disconnect

Johan Hovold <johan@kernel.org>
    USB: serial: io_edgeport: fix potential fifo corruption

Johan Hovold <johan@kernel.org>
    USB: serial: io_edgeport: move initial termios update to open()

Johan Hovold <johan@kernel.org>
    USB: serial: io_edgeport: fix potential NULL-deref at open

Johan Hovold <johan@kernel.org>
    USB: serial: io_edgeport: fix potential close() use-after-free

Johan Hovold <johan@kernel.org>
    USB: serial: io_edgeport: fix NULL-deref on early status

Johan Hovold <johan@kernel.org>
    USB: serial: upd78f0730: fix NULL-deref on hangup

Tristan Madani <tristan@talencesecurity.com>
    USB: serial: sierra: validate URB length in instat callback

Hui Peng <benquike@gmail.com>
    USB: serial: garmin_gps: validate packet data length in nat_receive()

Jesse Zhang <Jesse.Zhang@amd.com>
    drm/amdgpu: fix the error handling of amdgpu_vm_init_entities()

Jesse Zhang <Jesse.Zhang@amd.com>
    drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings

Josef Bacik <josef@toxicpanda.com>
    w1: w1_therm: leave the slaves of other families alone

Josef Bacik <josef@toxicpanda.com>
    w1: use the bus mutex for the "rw" file

Josef Bacik <josef@toxicpanda.com>
    w1: remove the master's files before taking its locks

Josef Bacik <josef@toxicpanda.com>
    w1: netlink: drop the slave after the bus is unlocked

Josef Bacik <josef@toxicpanda.com>
    w1: ds28e04: use the bus mutex to talk on the bus

Josef Bacik <josef@toxicpanda.com>
    w1: ds2805: use the bus mutex to talk on the bus

Josef Bacik <josef@toxicpanda.com>
    w1: ds2482: set the strong pull-up with its byte

Josef Bacik <josef@toxicpanda.com>
    w1: don't hold list_mutex while a slave is torn down

Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove

Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths

Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    usb: dwc3: xilinx: fix system suspend and resume PHY handling

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Wait for End Transfer completion on ep disable

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Track a timed out End Transfer

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Reset endpoint flags on controller start

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Reject requests to a disabled endpoint

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Recover from End Transfer timeout

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: gadget: Clear delayed stop on End Transfer completion

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    usb: dwc3: trace: Restore request name assignment

Krystian Kaniewski <krystianmkaniewski@gmail.com>
    usb: gadget: u_serial: pin ports while TTYs are installed

Brian Ellis <brianellis@gotenna.com>
    usb: gadget: u_serial: fix NULL deref in gs_close() after failed open

Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
    usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty

Sonali Pradhan <sonalipradhan@google.com>
    usb: gadget: f_midi: fix UAF race during IN request handling

Yu Zhang <yuz08559@gmail.com>
    usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF

Niklas Neronin <niklas.neronin@linux.intel.com>
    usb: xhci: clear stale bandwidth data after hibernation

Xu Rao <raoxu@uniontech.com>
    usb: xhci: disable the correct slot on alloc_dev failure

Uttkarsh Aggarwal <uttkarsh.aggarwal@oss.qualcomm.com>
    usb: typec: ucsi: Set ucsi->connector before enabling notifications

Ali Ahmet Memiş <aliamemis@disroot.org>
    usb: typec: ucsi: debugfs: Fix GET commands on UCSI < 2.0

Ihor Urazov <z0rc3r@gmail.com>
    usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14

YuanZhe Liu <25031212351@stu.xidian.edu.cn>
    usb: usbtest: prevent divide by zero in simple_io() with zero length

Olivier Kaloudoff <olivier.kaloudoff@gmail.com>
    usb: uas: ignore UAS for ASMT135x bridges (174c:55aa)

Chaz Bailey <charles.s.bailey@gmail.com>
    usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove

Joonhoe Kim <26rote@gmail.com>
    usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes

Josef Bacik <josef@toxicpanda.com>
    USB: serial: oti6858: fix the teardown order in close

Johan Hovold <johan@kernel.org>
    USB: serial: garmin_gps: fix deadlock on reset request

Rishabh Jain <rishabh.jain1198@gmail.com>
    usb: pci-quirks: always assert xHCI OS ownership

Johan Hovold <johan@kernel.org>
    USB: cdc-acm: fix NULL-deref on hangup

Jiri Slaby (SUSE) <jirislaby@kernel.org>
    tty: fix misapplied compat_ptr() in tty_compat_ioctl()

Josef Bacik <josef@toxicpanda.com>
    thunderbolt: stream: Undo more if the start fails

Josef Bacik <josef@toxicpanda.com>
    serial: samsung: put the previous baud clock

Josef Bacik <josef@toxicpanda.com>
    serial: samsung: don't leak the tty on an RX IRQ

Josef Bacik <josef@toxicpanda.com>
    serial: rda: free the interrupt on shutdown

Josef Bacik <josef@toxicpanda.com>
    serial: imx: fix the tty reference of the wakeup event

Josef Bacik <josef@toxicpanda.com>
    serial: fsl_lpuart: fix tty ref of wakeup event

Josef Bacik <josef@toxicpanda.com>
    serial: core: respect runtime PM when sending x_char

Josef Bacik <josef@toxicpanda.com>
    serial: 8250_mxpcie: handle hangup during break

Josef Bacik <josef@toxicpanda.com>
    serial: 8250_lpss: don't divide by 0 above 6.25 Mbaud

Jiri Slaby (SUSE) <jirislaby@kernel.org>
    serial: 8250_exar: check priv->gpio properly

Josef Bacik <josef@toxicpanda.com>
    misc: vmw_vmci: wait for callbacks in event unsubscribe

Jiale Yao <yaojiale02@163.com>
    misc: ibmvmc: initialize HMC state before device registration

Guangshuo Li <lgs201920130244@gmail.com>
    misc: bcm-vk: fix DMA allocation memory leak

Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
    mei: me: add ice lake point LP iTouch DID

Josef Bacik <josef@toxicpanda.com>
    mei: lb: read the MTU once

Josef Bacik <josef@toxicpanda.com>
    iio: sx9310: use the data of the I2C table

Josef Bacik <josef@toxicpanda.com>
    iio: hid-sensors: fix a division by zero

Josef Bacik <josef@toxicpanda.com>
    iio: addac: ad74413r: fix the values of set_multiple

Josef Bacik <josef@toxicpanda.com>
    iio: adc: check the result of ad_sd_init()

Josef Bacik <josef@toxicpanda.com>
    iio: adc: ad7923: add the AD7927 to the SPI ID table

Josef Bacik <josef@toxicpanda.com>
    iio: accel: adxl380: don't stay in standby on -EINVAL

Josef Bacik <josef@toxicpanda.com>
    comedi: vmk80xx: report failed transfers of the K8061

Josef Bacik <josef@toxicpanda.com>
    comedi: ni_tio: Fix overflow of the clock period

Josef Bacik <josef@toxicpanda.com>
    comedi: ni_660x: don't poll without a DMA channel

Josef Bacik <josef@toxicpanda.com>
    comedi: fix endless recursion in comedi_event()

Josef Bacik <josef@toxicpanda.com>
    comedi: addi_apci_1500: fix clearing of the gate enable

Chris Mason <mason@kernel.org>
    vt: serialise the producers of the flip buffer

Mikulas Patocka <mpatocka@redhat.com>
    dm-thin: fix parsing of feature arguments

Mikulas Patocka <mpatocka@redhat.com>
    dm-thin: fix leak if __set_snapshot_details fails

Mikulas Patocka <mpatocka@redhat.com>
    dm-thin: fix data corruption if discard races with regular I/O

Li Youhong <liyouhong@kylinos.cn>
    dm-raid: fix use-after-free in raid_dtr()

Jay Vadayath <jay@artiphishell.com>
    dm-raid: bound array_position before indexing failed_devices

Mikulas Patocka <mpatocka@redhat.com>
    dm-integrity: don't attempt to commit journal on disabled device

Sinan Polat <sinan86polat@gmail.com>
    dm-integrity: don't recalculate with HMAC because of a dirty bitmap

Josef Schlehofer <pepe.schlehofer@gmail.com>
    dm-crypt: defer async write submission to write thread

xietangxin <xietangxin@h-partners.com>
    dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers

Mikulas Patocka <mpatocka@redhat.com>
    dm-cache: fix ending a cursor that never began

Mikulas Patocka <mpatocka@redhat.com>
    dm-cache: fix NULL pointer dereference on open failure

Kyrylo Biryuk <illofspeed@gmail.com>
    dm zoned: do not reclaim a random zone into another random zone

Kyrylo Biryuk <illofspeed@gmail.com>
    dm zoned: back off when reclaim cannot make progress

Chen Cheng <chencheng@fnnas.com>
    dm snapshot: fix discard writing into the next COW chunk

Chen Cheng <chencheng@fnnas.com>
    dm snapshot: split discards on chunk boundaries

wuyuehong <wuyuehong@cmss.chinamobile.com>
    dm snapshot: fix discard_granularity unit in snapshot_io_hints

Mikulas Patocka <mpatocka@redhat.com>
    dm persistent data: don't leak bufio buffer if find_leaf fails

Mikulas Patocka <mpatocka@redhat.com>
    dm persistent data: don't ignore writeback errors

Mikulas Patocka <mpatocka@redhat.com>
    dm persistent data: test return value of node_copy

Weijiang Zhou <weijiang.zhou@unisoc.com>
    dm-verity: don't restart or panic on errors during system shutdown

Mikulas Patocka <mpatocka@redhat.com>
    dm-sysfs: fix misbehavior if kobject_init_and_add fails

guolingxing <guolingxing@tju.edu.cn>
    dm-pcache: do not advance dirty_tail after backing flush failure

Yingjie Wang <1075151112@qq.com>
    dm thin: avoid wrapping no_space_timeout

Yingjie Wang <x-professor@outlook.com>
    dm mpath: cap queue_if_no_path_timeout_secs

shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
    dm mpath: fix buffer overflow in parse_hw_handler()

Zhao Feng <zhaofeng2@cmss.chinamobile.com>
    dm crypt: fix use of uninitialized percpu_counter in ctr error path

Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
    dm cache: validate the discard block size before narrowing

Edward Adam Davis <eadavis@sina.com>
    dm cache: reject kcopyd client destory if it setup failed

Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
    dm: Reject table setup after queue or disk teardown

Ming-Hung Tsai <mtsai@redhat.com>
    dm: fix use-after-free when dm_get_device() widens the open mode

Mark Bundschuh <mkbund@amazon.com>
    dm: fix infinite loop in dm_blk_do_report_zones()

Daejun Park <daejun7.park@samsung.com>
    dm: fail a REQ_PREFLUSH bio with data when its preflush fails

Yaohan Li <shunsheng1218@gmail.com>
    dm: avoid double-dropping the zone reset submission reference

shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
    dm log userspace: drop the device reference on error

Paulo Alcantara <pc@manguebit.org>
    smb: client: don't write back through O_DIRECT handles

Paulo Alcantara <pc@manguebit.org>
    smb: client: don't spend read retries on reads cut short by a reconnect

Paulo Alcantara <pc@manguebit.org>
    smb: client: don't retry failed writes forever regardless of mount options

Paulo Alcantara <pc@manguebit.org>
    smb: client: don't give up writeback on the first replayable error

liuyong <pkfxxxing@gmail.com>
    smb: client: validate descriptor headers before query result allocation

Joseph Qi <joseph.qi@linux.alibaba.com>
    smb: client: skip NULL channel in __cifs_put_smb_ses()

Paulo Alcantara <pc@manguebit.org>
    smb: client: retry writes that couldn't be issued due to a reconnect

Paulo Alcantara <pc@manguebit.org>
    smb: client: retry writeback on interrupts and allocation failures

Paulo Alcantara <pc@manguebit.org>
    smb: client: let umount -f abort retried reads and writes

Paulo Alcantara <pc@manguebit.org>
    smb: client: issue writes from a worker if the task is dying

Joseph Qi <joseph.qi@linux.alibaba.com>
    smb: client: hold the inode across cifs_oplock_break()

Joseph Qi <joseph.qi@linux.alibaba.com>
    smb: client: hold server ref while queueing reconnect work

Paulo Alcantara <pc@manguebit.org>
    smb: client: flush deferred handles of other names before a hard link open

Fredric Cover <fredric.cover.lkernel@gmail.com>
    smb: client: fix out-of-bounds read in dfs_parse_target_referral()

Andrey Misiurov <andrey.misyrov@gmail.com>
    smb: client: fix OOB write when compounding SMB2_IOCTL with encryption

Fredric Cover <fredric.cover.lkernel@gmail.com>
    smb: client: fix double conversion of DFS path in setup_dfs_ref()

Paulo Alcantara <pc@manguebit.org>
    smb: client: don't block dying tasks waiting for writeback on fsync

Paulo Alcantara <pc@manguebit.org>
    smb: client: don't block dying tasks waiting for writeback on close

liuyong <pkfxxxing@gmail.com>
    smb: client: compare owner and group SIDs using their encoded lengths

Yifan Zhang <yfzhang23@stu.pku.edu.cn>
    smb: client: bound invalid NTLMSSP signature diagnostic

Giuseppe Scrivano <giuseppe@scrivano.org>
    ovl: follow lower to lowerdata redirects from any lower layer

Amir Goldstein <amir73il@gmail.com>
    ovl: do not check the deferred lowerdata redirect on index lookup

Amir Goldstein <amir73il@gmail.com>
    ovl: do not allow nfs_export with data-only layers

Daejun Park <daejun7.park@samsung.com>
    ovl: bump the impure dir version when linking a file with origin

Giuseppe Scrivano <giuseppe@scrivano.org>
    ovl: return EIO if the lowerdata is missing

Amir Goldstein <amir73il@gmail.com>
    ovl: report the requested redirect_dir mode in conflicting options

Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
    ovl: reject different lower idmaps on the same fs

Amir Goldstein <amir73il@gmail.com>
    ovl: fix leak of lowerdata redirect on ovl_get_inode() failure

Amir Goldstein <amir73il@gmail.com>
    ovl: do not read the flags of a put upper dentry in lookup

Giuseppe Scrivano <giuseppe@scrivano.org>
    ovl: do not always clear absolute_redirect

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    gpiolib: synchronize updates of descriptor labels

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    gpiolib: fix stack out-of-bounds access in gpiochip_add_hog()

Yu Zhang <yuz08559@gmail.com>
    gpio: virtuser: remove the debugfs files before freeing the line data

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    gpio: virtuser: fix interrupt leak and UAF

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    gpio: sodaville: fix use-after-free bug when registering the irqchip

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    gpio: shared: fix a race in shared desc release path

Dmitry Torokhov <dmitry.torokhov@gmail.com>
    gpio: sa1100: defer GPIO chip registration to postcore_initcall

Cunhao Lu <1579567540@qq.com>
    gpio: rockchip: Fix debounce arithmetic for GPIO v2

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    gpio: of: fix potential misconfiguration of hogged lines

Wentao Liang <vulab@iscas.ac.cn>
    gpio: keep the chip reference when deferred setup fails

Guangshuo Li <lgs201920130244@gmail.com>
    gpio: brcmstb: fix UAF after IRQ domain setup failure

Billy Tsai <billy_tsai@aspeedtech.com>
    gpio: aspeed: Preserve the pending G7 interrupt status on control writes

Billy Tsai <billy_tsai@aspeedtech.com>
    gpio: aspeed: Clear only the acked line's G4 interrupt status

Ian Bridges <icb@fastmail.org>
    ksmbd: evaluate the DACL in order for explicit access requests

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: bound pending OCB station allocations

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: bound pending IBSS station allocations

Johannes Berg <johannes.berg@intel.com>
    wifi: mac80211: fix use-after-free on TTLM disconnect

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: restore dormant links when link updates fail

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: reject invalid EHT guard intervals in airtime estimates

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: recheck the OCB station limit before insertion

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: recheck the IBSS station limit before insertion

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: recheck injected headers after removing FCS

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: drain link readers before stopping removed links

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211: fix use-after-free when MLO link setup is rolled back

Wahid Khan <wahidzk0091@gmail.com>
    wifi: cfg80211: don't truncate the merged MBSSID profile length

Zhao Li <enderaoelyther@gmail.com>
    wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers

Zhao Li <enderaoelyther@gmail.com>
    wifi: cfg80211: release rejected nontransmitted BSS reference

Tristan Madani <tristmd@gmail.com>
    wifi: nxpwifi: validate scan response TLV sizes before indexed access

Zhao Li <enderaoelyther@gmail.com>
    wifi: mac80211_hwsim: ignore non-generic netlink releases

Mehmet Fide <mehmet.fide@screeningeagle.com>
    wifi: ath9k_htc: do not start ANI before the first channel is set

Benoit Masson <yahoo@perenite.com>
    wifi: ath12k: assign device id from the WSI index

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/probes: Reject array count on non-dereference string sources

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/probes: Fix user-space dereference string array store type

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/probes: Fix missing BTF kind checks in char pointer/array helpers

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/probes: Enable newly appended probe when target event is enabled

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/probes: Check enabled and busy state before unlinking sibling probes

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/eprobe: Disallow attaching eprobes to fprobe events

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create()

Paolo Bertinetti <paolobertinetti200f4@proton.me>
    tracing/perf: Clear stop state in perf_trace_add()

Tao Cui <cuitao@kylinos.cn>
    LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT

Tao Cui <cuitao@kylinos.cn>
    LoongArch: KVM: Propagate real error code in kvm_pch_pic_create()

Tao Cui <cuitao@kylinos.cn>
    LoongArch: KVM: Clear device pointer in irqchip destroy callbacks

Mike Rapoport (Microsoft) <rppt@kernel.org>
    LoongArch: Restore KFENCE pages through DMW on resume

Jinjie Ruan <ruanjinjie@huawei.com>
    LoongArch: kexec_file: Fix elf_headers memory leak in retry loop

Jinjie Ruan <ruanjinjie@huawei.com>
    LoongArch: kexec_file: Fix a modified cmdline leak

Tiezhu Yang <yangtiezhu@loongson.cn>
    LoongArch: BPF: Make use of beqz and bnez for trampoline branches

Tiezhu Yang <yangtiezhu@loongson.cn>
    LoongArch: BPF: Make arena support depend on 128-bit cmpxchg

Michail Andreas Michalopoulos <mike.michalo@gmail.com>
    ksmbd: refuse reauthentication of an expired session as another user

Ian Bridges <icb@fastmail.org>
    ksmbd: keep group denials when a POSIX ACL entry decides access

Ian Bridges <icb@fastmail.org>
    ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow

Weiming Shi <bestswngs@gmail.com>
    sctp: reset stored flag for each association

Tim Budding <tim.budding@gmail.com>
    sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED

Tim Budding <tim.budding@gmail.com>
    sctp: fix I-FORWARD-TSN handling of fragments on other streams

Andrey Misiurov <andrey.misyrov@gmail.com>
    sctp: fix ASCONF address change on single-homed hosts

Kyle Zeng <kylebot@openai.com>
    sctp: avoid requeueing pending control chunks

Tim Budding <tim.budding@gmail.com>
    sctp: abort unordered partial delivery when its message is skipped

Kuba Piecuch <jpiecuch@google.com>
    sched_ext: Read exit_kind before flushing in scx_flush_disable_work()

Tejun Heo <tj@kernel.org>
    sched_ext: Factor out drain_offline_rq()

Tejun Heo <tj@kernel.org>
    sched_ext: Fix stale pick when the donor changes during dispatch

Seiji Nishikawa <snishika@redhat.com>
    sched/core: Do not touch SMT siblings that have not joined the core yet

Andrea Parri <parri.andrea@gmail.com>
    sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler()

Andrea Parri <parri.andrea@gmail.com>
    sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE

Andrea Parri <parri.andrea@gmail.com>
    sched/deadline: Fix spurious -EPERM for migration-disabled tasks

Stefan Haberland <sth@linux.ibm.com>
    s390/dasd: Don't trust userspace-supplied result field in format check

Stefan Haberland <sth@linux.ibm.com>
    s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path

Stanislav Aleksandrov <lightofmysoul@gmail.com>
    hwmon: (max31760) Report 0 RPM before the first fan speed measurement

Stanislav Aleksandrov <lightofmysoul@gmail.com>
    hwmon: (max31760) Leave standby mode at probe

Stanislav Aleksandrov <lightofmysoul@gmail.com>
    hwmon: (max31760) Fix the local temperature limit registers

Sudeep Holla <sudeep.holla@kernel.org>
    hwmon: (scmi) Configure sensors before exposing channels

Xu Rao <raoxu@uniontech.com>
    hwmon: (scmi) Enable temperature sensors using their sensor IDs

Sudeep Holla <sudeep.holla@kernel.org>
    hwmon: (scmi) Check channel config allocation

Pablo Mazzini <pmazzini@gmail.com>
    hwmon: (sy7636a) fix negative temperatures

Felix Radensky <fradensky@nvidia.com>
    hwmon: (pmbus/mp2975) Get vout fault limits dynamically

Guenter Roeck <linux@roeck-us.net>
    hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown

Rupesh Majhi <zoone.rupert@gmail.com>
    hwmon: (aht10) Fix update_interval overflow on 64-bit

Miguel Ojeda <ojeda@kernel.org>
    kbuild: rust: support stabilized flag `-Cprofile-sample-use` for Rust >= 1.100

Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    xen/pvcalls: destroy the per-socket workqueue on release

Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    xen/pvcalls: unwind pvcalls_new_active_socket() step by step

Qihang <q.h.hack.winter@gmail.com>
    xen/privcmd: fix double free when an irqfd is shut down twice

Andrey Misiurov <andrey.misyrov@gmail.com>
    xen/gntdev: fix deadlock between map ioctl and mmap

Hengyu Liang <hengyul@cs.unc.edu>
    x86/video: Preserve the default VGA fallback for legacy modes

Dave Hansen <dave.hansen@linux.intel.com>
    x86/mm: Ensure write visibility during LDT installation

Jason Andryuk <jason.andryuk@amd.com>
    x86/CPU/AMD: Don't print reset reason in VMs

Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    watchdog: rzv2h: Drop runtime PM handling from WDTDCR init

Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    watchdog: rzv2h: Use pm_runtime_put_sync()

Zhao Feng <zhaofeng2@cmss.chinamobile.com>
    watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog

Stanislav Aleksandrov <lightofmysoul@gmail.com>
    watchdog: gunyah_wdt: Re-enable the watchdog on resume

Vishwaroop A <va@nvidia.com>
    spi: tegra210-quad: Unmap DMA buffers on transfer timeout

Vishwaroop A <va@nvidia.com>
    spi: tegra210-quad: Track DMA mapping state

Kees Cook <kees@kernel.org>
    spi: axi-spi-engine: Start the program length at zero

Hyunjung Ko <hj351016@gmail.com>
    tpm: flush timeout work outside buffer_mutex to avoid deadlock

Guanglei Zhu <zhugl3@xiaopeng.com>
    tpm: eventlog: check the payload size before reading tag events

Eric Biggers <ebiggers@kernel.org>
    tpm: Check return value of crypto_kpp_set_secret()

Takashi Iwai <tiwai@suse.de>
    tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path

Avi Weiss <thnkslprpt@gmail.com>
    timekeeping: Refresh auxiliary base before offset validation

Avi Weiss <thnkslprpt@gmail.com>
    timekeeping: Reject cross timestamps for invalid AUX clocks

Hungyu Lin <dennylin0707@gmail.com>
    timekeeping: Read getboottime64() offsets under the sequence counter

Avi Weiss <thnkslprpt@gmail.com>
    SUNRPC: Fix TCP-with-TLS transport class identification

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    software node: only let the owner release a managed node

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    cpufreq: Fix updates of cached resolved frequency and index

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    cpufreq: Cache post-resolution target frequency in __resolve_freq()

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    cpufreq: Force passing target frequency to driver during resume

Li Zhaoxin <lizhaoxin04@baidu.com>
    cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    cpufreq: intel_pstate: Clear last written P-state value on suspend

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    cpufreq: Improve suspend-resume synchronization

Li RongQing <lirongqing@baidu.com>
    cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()

Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
    arm64: suspend: Only track cpuidle context for idle tasks

Mark Brown <broonie@kernel.org>
    arm64: suspend: Save GCS state over suspend

Mark Brown <broonie@kernel.org>
    arm64: suspend: Save POR_EL0 over suspend

Zhao Gongyi <zhaogongyi@bytedance.com>
    arm64: ptrace: don't warn on missing siginfo in a group-stop

Jinjie Ruan <ruanjinjie@huawei.com>
    arm64: kexec_file: Do not use CMA for images with a non-zero text_offset

Chris Down <chris@chrisdown.name>
    arm64: hugetlb: Prevent write fault livelocks on stale TLB entries

Beata Michalska <beata.michalska@arm.com>
    arm64: errata: Add Cortex-A715/A720 AMU core counter workaround

Beata Michalska <beata.michalska@arm.com>
    arm64: errata: Extend the workaround for broken AMEVCNTR01 counter

Mark Brown <broonie@kernel.org>
    arm64/gcs: Ignore attempts to change GCS mode during signal return

Christian Brauner <brauner@kernel.org>
    fs: don't strand I_METADATA_WRITEBACK inodes outside the LRU

Cheng Yongkang <teel4res@gmail.com>
    fs/splice: clamp an over-reported write_iter result

Cheng Yongkang <teel4res@gmail.com>
    fs/proc: fix the write length returned by proc_sys_call_handler()

HyeongJun An <sammiee5311@gmail.com>
    fs/adfs: bound directory entry name length in adfs_fplus_getnext()

Christian Brauner <brauner@kernel.org>
    ext4: don't read the inode block in ext4_sync_inode_metadata()

Christian Brauner <brauner@kernel.org>
    ext4: use sb_find_get_block_nonatomic() in ext4_get_inode_loc_noio()

Christian Brauner <brauner@kernel.org>
    ext2: don't read the inode block in ext2_sync_inode_metadata()

Christian Brauner <brauner@kernel.org>
    ext2: add ext2_inode_block() helper

Josef Bacik <josef@toxicpanda.com>
    dcache: let umount find a disconnected ex-mountpoint

Josef Bacik <josef@toxicpanda.com>
    dcache: wait for a racing eviction of a secondary root

Christian Brauner <brauner@kernel.org>
    dcache: let d_invalidate() wait for a d_set_mounted() in flight

Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
    crypto: essiv - fix use-after-free in AEAD path

Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
    crypto: caam - reject overlong RSA CRT parameters

Mani Tofigh <mt4022@columbia.edu>
    cgroup: arm the notify timer only while the file exists

Tejun Heo <tj@kernel.org>
    cgroup/freezer: Fix exiting tasks left frozen forever after rmdir

Mani Tofigh <mt4022@columbia.edu>
    cgroup/freezer: walk exiting tasks in the v1 freezer

Ridong Chen <chenridong@xiaomi.com>
    cgroup/cpuset: Don't revive invalid partition without active CPU on hotplug

Waiman Long <longman@redhat.com>
    cgroup/cpuset: Correctly set isolated_cpus when switching partition state

Zhao Li <enderaoelyther@gmail.com>
    Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel

YuanZhe Liu <25031212351@stu.xidian.edu.cn>
    Bluetooth: hci_qca: fix use-after-free in ibs debugfs files

YuanZhe Liu <25031212351@stu.xidian.edu.cn>
    Bluetooth: btusb: fix use-after-free in force_poll_sync

Baoli Zhang <baoli.zhang@linux.intel.com>
    ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup

Michael McAllister <me@michaelmcallister.org>
    ASoC: qcom: q6asm: Reset PCM positions when preparing a stream

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    power: sequencing: pcie-m2: fix serdev controller reference leak

Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    power: sequencing: pcie-m2: fix use-after-free in pwrseq_pcie_m2_vregs_enable()

Dennis Chen <dechen@redhat.com>
    Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask"

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    PM: runtime: Update last_busy in rpm_resume() for active devices

Paolo Bertinetti <paolobertinetti200f4@proton.me>
    perf/hw_breakpoint: Clear stop state in hw_breakpoint_add()

Phat Dinh <phatdt1116@gmail.com>
    perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit

Joas Antonio dos Santos <joasantonio108@gmail.com>
    openvswitch: advance by the real header length in get_ipv6_ext_hdrs()

Wahid Khan <wahidzk0091@gmail.com>
    ntfs: open the index allocation before reading or writing an index block

Wahid Khan <wahidzk0091@gmail.com>
    ntfs: do not read an index block outside $INDEX_ALLOCATION

Wahid Khan <wahidzk0091@gmail.com>
    ntfs: check the file name against the key length of an index entry

Tim Menninger <tmenninger@everpuredata.com>
    NFSv4: Prevent indefinite waits for out-of-order OPEN stateids

Christian Brauner <brauner@kernel.org>
    minix: don't read the inode block in minix_sync_inode_metadata()

Christian Brauner <brauner@kernel.org>
    minix: add minix_inode_block() helper

Eric Dumazet <edumazet@kernel.org>
    net: wait for in-flight device unregistrations before netns dismantle

Jamal Hadi Salim <jhs@mojatatu.com>
    net/sched: act_ife: require a full Ethernet header on egress

Jamal Hadi Salim <jhs@mojatatu.com>
    net/sched: act_ife: encode configured zero metadata values

Jamal Hadi Salim <jhs@mojatatu.com>
    net/sched: sch_teql: reject qdiscs from another network namespace

Paulo Alcantara <pc@manguebit.org>
    netfs: don't hang a read whose retry is abandoned

Paulo Alcantara <pc@manguebit.org>
    netfs: keep the prepare_read errno when abandoning read retries

Iván Ezequiel Rodriguez <ivanrwcm25@gmail.com>
    netfs: preserve prepare_write errno on reissue

Michail Andreas Michalopoulos <mike.michalo@gmail.com>
    netfilter: flowtable: extend ct timeout of offloaded GRE flows

Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
    netfilter: xt_recent: do not call remove_proc_entry() under recent_lock

Zihan Xi <zihanx@nebusec.ai>
    netfilter: nf_dup: preserve guard across NFQUEUE reinjection

Eric Dumazet <edumazet@kernel.org>
    net: gro: invalidate frag0 after a pull

Eric Dumazet <edumazet@kernel.org>
    net: gro: do not undo remote checksum offload on merged packets

Kyle Zeng <kylebot@openai.com>
    net: gro: avoid parsing headers from shared fragments

Andrea Parri <parri.andrea@gmail.com>
    hv_sock: Report no unread data before a channel is available

Erni Sri Satya Vennela <ernis@linux.microsoft.com>
    hv_netvsc: Stop PPI parsing on invalid metadata

Joas Antonio dos Santos <joasantonio108@gmail.com>
    gtp: free the skb after handling an echo response

Chengfeng Ye <nicoyip.dev@gmail.com>
    ipvs: fix protocol data lifetime during namespace teardown

Chengfeng Ye <nicoyip.dev@gmail.com>
    ipvs: Defer application parent freeing until after RCU readers

Yingjie Wang <1075151112@qq.com>
    ipv6: reject routes without an inet6_dev

Xia Yan <yanxia@cmss.chinamobile.com>
    ipv6: fix cached route reuse for control messages

Daniël Trujillo <datrujillo@nvidia.com>
    ipv4: fib_trie: prevent speculative out-of-bounds child access

Kyle Zeng <kylebot@openai.com>
    ipv4: keep XFRM headers out of corked skb lengths

Kyle Zeng <kylebot@openai.com>
    mptcp: reject DATA_ACKs against a reversed send interval

Zixuan Chai <petalzu987@gmail.com>
    seg6: validate state in netfilter continuations

Hyunwoo Kim <imv4bel@gmail.com>
    tcp: fix request_sock use-after-free during Fast Open accept()

Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
    tcp: fix authentication bypass via unsupported TCP auth options

Hyunwoo Kim <imv4bel@gmail.com>
    tcp: do not coalesce segments after FIN

Yingjie Wang <x-professor@outlook.com>
    tcp: free saved_syn after an RCU grace period

Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
    tools/bootconfig: Close only opened braces in compact output

Rishikesh Jethwani <rjethwani@purestorage.com>
    tls: only install push_pending_record for a TX context

Hungyu Lin <dennylin0707@gmail.com>
    tsacct: Keep task begin times stable across suspend

Jerome Mohm <jrmmhm.kernel@eldare.de>
    vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore

Ian Rogers <irogers@google.com>
    vdso: Add VDSO_UNALIGNED_PACKED config option

Christian Brauner <brauner@kernel.org>
    udf: don't allocate the inode block in udf_sync_inode_metadata()

Rongzheng Wang <testwrzwrz@gmail.com>
    xsk: defer software checksum until the skb is complete

Tim Menninger <tmenninger@everpuredata.com>
    xprtrdma: serialize unmap_sync with xprt_disconnect

YuanZhe Liu <25031212351@stu.xidian.edu.cn>
    net: usb: lan78xx: let unregister_netdev() stop phylink

James Clark <jjc@jclark.com>
    net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl

Zhao Gongyi <zhaogongyi@bytedance.com>
    net: netns: fix INT_MAX nsid cleanup

Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
    net: mana: report RX checksum offload for IPv6

Jens Axboe <axboe@kernel.dk>
    net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls

Tapio Reijonen <tapio.reijonen@vaisala.com>
    net: dsa: microchip: initialize the IRQ access mutex

Jun Yang <junvyyang@tencent.com>
    net: bridge: use one headroom snapshot for ND replies

Mahanta Jambigi <mjambigi@linux.ibm.com>
    net/smc: fix link group ownership in handshake abort

Mahanta Jambigi <mjambigi@linux.ibm.com>
    net/smc: fix lgr/lnk lifetime vs diag reader race

Kyle Zeng <kylebot@openai.com>
    net/rds: Do not unpin a page after a failed atomic pin

Jiabin Deng <dengjiabin2023@gmail.com>
    net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported

Breno Leitao <leitao@debian.org>
    net/mlx5e: Fix queue stats access to queues without stats

Davidlohr Bueso <dave@stgolabs.net>
    mctp: accept MSG_CMSG_COMPAT in recvmsg

Kyle Zeng <kylebot@openai.com>
    macsec: reject frames that decapsulate into runt Ethernet frames

Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
    liveupdate: check for duplicate session before growing block set

Jean-Paul Sergent <jpsergent@gmail.com>
    net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp

Florian Bezdeka <florian.bezdeka@siemens.com>
    entry: Fix return type of syscall_trace_enter()

Florian Bezdeka <florian.bezdeka@siemens.com>
    entry: Complete syscall_enter_from_user_mode_work() to bool migration

Hungyu Lin <dennylin0707@gmail.com>
    coda: honor the append state of each write

Cheng Yongkang <teel4res@gmail.com>
    btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT

Mani Tofigh <mt4022@columbia.edu>
    btrfs: fix bio counter and bioc leak when async checksumming fails

Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
    bootconfig: Trim unquoted values at end of file

Breno Leitao <leitao@debian.org>
    ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr()

Vlastimil Babka (SUSE) <vbabka@kernel.org>
    mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()

Josef Bacik <josef@toxicpanda.com>
    mm/page_alloc: clear ->private of deferred free pages

Gregory Price (Meta) <gourry@gourry.net>
    mm/page_alloc: snapshot the preferred zone against shrink rebuilds

Gregory Price (Meta) <gourry@gourry.net>
    mm/page_alloc: detect zonelist rebuilds from memory hot-add

Josef Bacik <josef@toxicpanda.com>
    mm/page_alloc: keep the pagesets of an empty zone

Gregory Price (Meta) <gourry@gourry.net>
    mm/page_alloc: reset can_retry_reserves when the slowpath restarts

Gregory Price (Meta) <gourry@gourry.net>
    mm/page_alloc: don't undo another isolation in alloc_contig_range

Josef Bacik <josef@toxicpanda.com>
    mm: page_isolation: do not take slab pages for free

Josef Bacik <josef@toxicpanda.com>
    mm/memory_hotplug: resize zones under their seqlock

Gregory Price (Meta) <gourry@gourry.net>
    mm/mmzone: read each zoneref slot once when filtering by nodemask

Gregory Price (Meta) <gourry@gourry.net>
    mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()

Josef Bacik <josef@toxicpanda.com>
    mm: page_frag: refill the cache for large fragments

Gregory Price (Meta) <gourry@gourry.net>
    mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt

Josef Bacik <josef@toxicpanda.com>
    mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone

Gregory Price (Meta) <gourry@gourry.net>
    mm/mmzone: read the zoneref slot once in zonelist_zone()

Christian Brauner <brauner@kernel.org>
    libfs: make i_rwsem the lock of the offset tree

Avi Weiss <thnkslprpt@gmail.com>
    splice, net: avoid MSG_MORE when the bvec array fills

Christian Brauner <brauner@kernel.org>
    fs: fix the SEEK_CUR f_lock condition

Christian Brauner <brauner@kernel.org>
    aio: don't let exit_aio() return before complete() is done

Mani Tofigh <mt4022@columbia.edu>
    eventpoll: wake the next waiter when a woken waiter is killed

Chen Linxuan <me@black-desk.cn>
    pidfd: restrict task access ioctls to the caller's pid namespace

Chris Mason <mason@kernel.org>
    backing-file: pass RWF_NOAPPEND to synchronous writes

Shashank Mohan Jain <jain.sm@gmail.com>
    errseq: don't let errseq_check_and_advance() hide later errors

Joshua Mulloy <joshuamulloy@gmail.com>
    memstick: core: don't clear dev->driver in memstick_device_remove()

Igor Velkov <iav@iav.lv>
    mmc: meson-gx: name the limit of the CMD_CFG timeout field

Igor Velkov <iav@iav.lv>
    mmc: meson-gx: report the longest busy wait the controller can do

Igor Velkov <iav@iav.lv>
    mmc: meson-gx: honour the busy timeout for R1b commands

Igor Velkov <iav@iav.lv>
    mmc: meson-gx: report busy from DAT0 alone

Ian Ray <ian.ray@gehealthcare.com>
    mmc: sdhci-esdhc-imx: map unsupported driver type to Type B

Runyu Xiao <runyu.xiao@seu.edu.cn>
    mmc: omap: synchronize clock timer before disabling fclk

Anfernee Cao <anferneemelokc5@gmail.com>
    mmc: mmci: fix DMA channel leak when mmc_add_host() fails

Anfernee Cao <anferneemelokc5@gmail.com>
    mmc: sunxi: fix clock and runtime PM leaks on probe failure

Karl Mehltretter <kmehltretter@gmail.com>
    mmc: sdhci-brcmstb: don't log an error for missing BOOT registers

Olivier Louvignes <olivier@mgcrea.io>
    mmc: jz4740: Remove the host before resetting the controller

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    kprobes: Validate re-registration earlier in register_kretprobe()

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    kprobes: Fix double free and NULL deref in unregister_kretprobes()

Masami Hiramatsu (Google) <mhiramat@kernel.org>
    kprobes: Fix error return and slot leak in __register_kprobe()

Steven Rostedt <rostedt@goodmis.org>
    tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc

Jaewon Jung <jaewon8868@gmail.com>
    selftests/ftrace: Add missing spaces after ! in probe syntax tests

Andrew Davison <andy@dvsn.net>
    ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set

Gichoon Han <gichoon.han@samsung.com>
    ALSA: usb-audio: Drop capture packets with bogus actual_length

Angel J <iamanaws@httpd.dev>
    ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone

Takashi Iwai <tiwai@suse.de>
    Revert "ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2"

Sergei Nizovtsev <snizovtsev@cloudlinux.com>
    ALSA: caiaq: Kill EP1 URB before unregistering the input device

Zhiqi Zhang <zhiqizhangg@gmail.com>
    bootconfig: Allow keys with the maximum supported depth

Yuansheng Yang <0xbeac@gmail.com>
    KEYS: Protect pkey method checks against type removal

Jarkko Sakkinen <jarkko@kernel.org>
    KEYS: Verify the key identity in __key_unlink_begin

Jarkko Sakkinen <jarkko@kernel.org>
    KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE

Jarkko Sakkinen <jarkko@kernel.org>
    KEYS: Expand key->{datalen,quotalen} to unsigned int

David Carlier <devnexen@gmail.com>
    tracing/eprobe: Install the trigger for every instance that enables the eprobe

Ridong Chen <chenridong@xiaomi.com>
    cpuset: generalize the validate_partition() interface

Jan Beulich <jbeulich@suse.com>
    Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()

Jude Gyimah <jude.gyimah87@gmail.com>
    ALSA: aw2-alsa: select SND_PCM

Guixiong Wei <weiguixiong@bytedance.com>
    KEYS: do not let an unmatched key decide the search result

Manuel Ebner <manuelebnerli@mailbox.org>
    docs, kprobes: Fix bracket

Wenwen Fu <wenwfu@qti.qualcomm.com>
    tracing: skip boot kprobe setup when no events were requested

Eric Dumazet <edumazet@kernel.org>
    nsh: limit recursion in nsh_gso_segment()

Chuck Lever <cel@kernel.org>
    selftests: tls: Skip the zero_len tests when TLS is unavailable

Chuck Lever <cel@kernel.org>
    tls: Consume empty data records in tls_sw_splice_read()

Jakub Kicinski <kuba@kernel.org>
    tls: Break the connection after a burst of empty data records

Iustin Stolniceanu <iustin.stolniceanu@analog.com>
    net: phy: c45: select BASE-T1 type for the forced speed

Alexei Lazar <alazar@nvidia.com>
    net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure

Alexei Lazar <alazar@nvidia.com>
    net/mlx5e: Rename state_destroy to rx_mode_active in flow steering

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: IPsec, don't match upper proto selectors in crypto offload TX

Jiahao Xu <xujiahao@cmss.chinamobile.com>
    net: usb: cdc_ncm: don't underflow the NDP room check

Wenbo Sun <sunwenbo@cmss.chinamobile.com>
    amt: use ipv6_hdr() in amt_mldv1_leave_handler()

Wenbo Sun <sunwenbo@cmss.chinamobile.com>
    af_unix: Inherit SO_INQ in unix_stream_connect()

Kuniyuki Iwashima <kuniyu@google.com>
    tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().

Eric Dumazet <edumazet@kernel.org>
    net: virtio: fix UDP tunnel GSO header of VLAN tagged packets

Uri Dar <udar@nvidia.com>
    net/mlx5: Lag, Return error when enabling MPESW without LAG support

Antonio Quartulli <antonio@mandelbit.com>
    udp_tunnel: don't treat IPv4 sockets bound to an address as wildcard

Xuanqiang Luo <luoxuanqiang@kylinos.cn>
    net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload

Ivan Vecera <ivecera@redhat.com>
    ice: dpll: set the SyncE divider only for the port driving the output

Ivan Vecera <ivecera@redhat.com>
    ice: dpll: serialize changes of the SyncE CGU registers

Tao Cui <cuitao@kylinos.cn>
    sched_ext: Reject DSQ iterator kfuncs in tracing programs

Wei Wang <weiwan@google.com>
    net: Make PSP skb extension survive packet scrubbing

Junyoung Jang <graypanda.inzag@gmail.com>
    igmp: use the joined device when leaving a multicast group

Fa-Iz Faadhillah Ibrahim <faiz.faadhillah@gmail.com>
    ALSA: hda/realtek: Update quirk for Acer Predator PHN16-72

Kailang Yang <kailang@realtek.com>
    ALSA: hda/realtek - remove headphone MIC support for Dell Pro QC1255

Gustavo Sousa <gustavo.sousa@intel.com>
    drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule

Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
    drm/xe/pf: Program LMTT directory pointer from each GT's init path

Varun Gupta <varun.gupta@intel.com>
    drm/xe/guc: Demote uncorrectable local error log on CRI

Daniel Charles <daniel.charles@intel.com>
    drm/xe/pm: Apply tile workarounds after PCODE initialization

Alexandre Cassen <acassen@corp.free.fr>
    net/mlx5: HWS, fix flow meter release on FTE update

Ofri Zangi <ofriz@xsightlabs.com>
    tls: fix async encryption race on weakly ordered architectures

Kalpesh Solanki <skalpesh942@gmail.com>
    tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK

Avi Weiss <thnkslprpt@gmail.com>
    net: ena: avoid RX copybreak for multi-descriptor packets

Breno Leitao <leitao@debian.org>
    net: ena: Keep the RX buffer mapped if skb allocation fails

Omar Ramadan <omar@blockcast.net>
    amt: tear down every amt device on an unregistering lower

Chris Mason <mason@kernel.org>
    tcp: Drop any segments if DEFER_CONNECT is set.

Kuniyuki Iwashima <kuniyu@google.com>
    tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort().

Zhan Xusheng <zhanxusheng@xiaomi.com>
    erofs: reset buf->off in erofs_init_metabuf()

LiangCheng Wang <zaq14760@gmail.com>
    ASoC: max98090: keep the MIC boost across mic input power-up

Kavitha Daula <kavi@edera.dev>
    xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()

Pengpeng Hou <hppiscas@163.com>
    drm/bridge: sii902x: validate I2S data lane values

Kyle Zeng <kylebot@openai.com>
    udp: check frag_list IP family before using skb_segment_list()

Jouni Högander <jouni.hogander@intel.com>
    drm/i915/psr: Flush on cursor update also when not using Selective Fetch

Janne Grunau <j@jannau.net>
    ASoC: apple: mca: Fix clock selection for clock consumer FEs

Anandu Padinhare <Anandu.Padinhare@electrifex.com>
    net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path

Eric Dumazet <edumazet@kernel.org>
    net: gro: compare skb->protocol in gro_list_prepare()

Eric Dumazet <edumazet@kernel.org>
    udp: do not use a cross-family sk_rx_dst in early demux

Eric Dumazet <edumazet@kernel.org>
    tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF

Kuniyuki Iwashima <kuniyu@google.com>
    tcp: Do not allow buggy transitions between ehash and lhash2.

Eric Dumazet <edumazet@kernel.org>
    fou: gue: check IP version of held packets for direct IP encapsulation

Kuniyuki Iwashima <kuniyu@google.com>
    net: Fix memory_allocated leak in __sk_mem_raise_allocated().

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Serialize TC and IPsec offload exclusion counters

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Block E-Switch mode changes during IPsec state creation

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Block E-Switch mode changes during IPsec policy creation

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Fix ipsec core device access during profile changes

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Fix E-Switch races in uplink unbind

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Take HCA devcom lock before esw->mode_lock

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Serialize ipsec encap reservations with eswitch operations

Cosmin Ratiu <cratiu@nvidia.com>
    net/mlx5e: Release IPsec root table reference on RX setup failure

Chris Mason <mason@kernel.org>
    net: skbuff: uncharge trimmed zerocopy frags on error

Yuho Choi <oss.patchbox@gmail.com>
    ptp: kvm: x86: Leak clock_pair page if changing its encryption fails

Chase Hiltz <me@chasehil.tz>
    ipv4: route: don't blackhole in-use routes when retiring fnhe routes

Ivan Vecera <ivecera@redhat.com>
    dpll: notify about a reference sync pair only if it was added

Changyul Lee <lcy8047@gmail.com>
    net/mlx5: macsec: Don't remove fs_id when adding a rule fails

Shay Drory <shayd@nvidia.com>
    net/mlx5: E-switch, Restore host PF enable for ECPF that isn't E-switch manager

Tim Menninger <tmenninger@everpuredata.com>
    NFSv4/flexfiles: limit transport disconnects when cancelling I/O

Tim Menninger <tmenninger@everpuredata.com>
    SUNRPC: add request-scoped disconnects when cancelling tasks

Benjamin Coddington <ben.coddington@hammerspace.com>
    NFSv4/flexfiles: Make the pinned device node pointer RCU-managed

Benjamin Coddington <ben.coddington@hammerspace.com>
    NFSv4/flexfiles: Hold a device node reference for layoutstats encoding

Benjamin Coddington <ben.coddington@hammerspace.com>
    NFSv4/flexfiles: Reference the device node across DS setup

Alexander Duyck <alexanderduyck@fb.com>
    net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist

Alexander Duyck <alexanderduyck@fb.com>
    fbnic: Wait for the outbound flush to complete on mailbox teardown

Alexander Duyck <alexanderduyck@fb.com>
    fbnic: Suspend phylink after taking the datapath down in ndo_stop

Alexander Duyck <alexanderduyck@fb.com>
    fbnic: Disable PTP completions during the Tx force-flush

Alexander Duyck <alexanderduyck@fb.com>
    fbnic: Fix service task races with ndo_stop and PM suspend

Umang Pokhriyal <umangpokhriyall@gmail.com>
    tun: delete the flow entries of the moved queue on detach

Kang Chen <k.chen@smail.nju.edu.cn>
    sched_ext: make DSQ iterator stay drained after NULL

Tejun Heo <tj@kernel.org>
    sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration

Olga Kornievskaia <okorniev@redhat.com>
    NFSv4: remember that the server may send CB_NOTIFY_LOCK

Olga Kornievskaia <okorniev@redhat.com>
    NFSv4: wake blocking lock waiters when a delegated lock is released

Jeff Layton <jlayton@kernel.org>
    NFS: stamp after the server's ctime following a CLONE

Jeff Layton <jlayton@kernel.org>
    NFS: stamp after the server's ctime when truncating under delegated times

Jeff Layton <jlayton@kernel.org>
    NFS: don't let delegated c/mtime stamps go backward

Waiman Long <longman@redhat.com>
    cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork()

Zhang Qiao <zhangqiao22@huawei.com>
    sched_ext: Fix partial-SMT core counting in calc_shard_layout()

Eric Dumazet <edumazet@kernel.org>
    bonding: fix slave_cnt leak on XDP enslave failure

Orgad Shaneh <orgads@gmail.com>
    net: mana: fix XDP_REDIRECT of pre-allocated RX buffers

Denis V. Lunev <den@openvz.org>
    ovl: release the upperdir/workdir in-use locks before the umount sync

Tianyi Gao <tianyi@cloudflare.com>
    net: fix mac_len of skbs copied by generic XDP

Mehmet Fide <mehmet.fide@screeningeagle.com>
    wifi: mac80211: abort chanswitch when leaving an IBSS

Johannes Berg <johannes.berg@intel.com>
    wifi: mac80211: mesh: don't linearize SKBs unnecessarily

Loïc Kassel <loic.kassel@gmail.com>
    wifi: mac80211_hwsim: use CLOCK_BOOTTIME for the beacon timer

Kyle Zeng <kylebot@openai.com>
    ipvlan: make outbound skb headers writable

Kyle Zeng <kylebot@openai.com>
    net: require a full socket in sock_confirm_neigh()

Kyle Zeng <kylebot@openai.com>
    net: protect negative destination advice with RCU

Mark Bloch <mbloch@nvidia.com>
    net/mlx5: Lag, free steering resources on LAG destroy failure

Carolina Jubran <cjubran@nvidia.com>
    net/mlx5: Use only loaded devices for PTP clock operations

Arnd Bergmann <arnd@arndb.de>
    net: octeontx2: fix building without DEBUGFS

Li RongQing <lirongqing@baidu.com>
    team: fix promisc/allmulti leak in team_port_add error path

Yaroslav Dudkov <aroslavdudkov622@gmail.com>
    ipv6: ignore link state in gateway check

Gal Pressman <gal@nvidia.com>
    net/mlx5: Bridge, fix bogus MDB offload errors

Kuniyuki Iwashima <kuniyu@google.com>
    af_unix: Remove gc_in_progress check in unix_peek_fpl().

Kuniyuki Iwashima <kuniyu@google.com>
    af_unix: Convert unsigned long to u64 for GC.

Francesco Valla <francesco@valla.it>
    spi: virtio: move teardown to .remove()

Jiayuan Chen <jiayuan.chen@linux.dev>
    net: raw: fix ICMP unreachable sent when receive queue is full

Stefano Munari <stefanomunari.sm@gmail.com>
    net: usb: lan78xx: resume phylink on non-reset USB resume

Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    idpf: free stashed XSk Rx frame when releasing the queue

Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    ice: xsk: free stashed Rx frame when cleaning the ring

Chenguang Zhao <zhaochenguang@kylinos.cn>
    i40e: xsk: fix multi-buffer XDP_PASS skb construction

Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    libeth: xsk: do not free in-flight frags on XDP_TX completion

Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    ice: xsk: do not free in-flight frags on XDP_TX completion

Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    ice: xsk: fix leaking Rx buffers in multi-buffer path

Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    i40e: xsk: fix xsk_buff_add_frag() error handling in Rx

Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    xsk: fix list corruption in xsk_buff_add_frag()

Kyle Zeng <kylebot@openai.com>
    net: skbuff: preserve fclone lifetime when freeing stolen heads

Mark Korenberg <socketpair@gmail.com>
    ublk: publish a new device by its id only once it is set up

Mike Snitzer <snitzer@kernel.org>
    NFS/localio: hold the client across an asynchronous LOCALIO probe

Avi Weiss <thnkslprpt@gmail.com>
    SUNRPC: Balance queue accounting when relocating a task

Avi Weiss <thnkslprpt@gmail.com>
    SUNRPC: Balance switch queue length on transport removal

Avi Weiss <thnkslprpt@gmail.com>
    SUNRPC: preserve transport security policy when cloning clients

Avi Weiss <thnkslprpt@gmail.com>
    SUNRPC: preserve timeout policy when cloning clients

Avi Weiss <thnkslprpt@gmail.com>
    SUNRPC: preserve fatal network errors during RPC binding

Avi Weiss <thnkslprpt@gmail.com>
    sunrpc: instantiate rpc_pipefs dentry before publishing it

Avi Weiss <thnkslprpt@gmail.com>
    SUNRPC: wake poll waiters when an empty pipe is unlinked

Avi Weiss <thnkslprpt@gmail.com>
    NFS: restore directory index when resuming readdir

Avi Weiss <thnkslprpt@gmail.com>
    NFS: Fix inverted cross-directory rename check

Avi Weiss <thnkslprpt@gmail.com>
    NFS: update ctime for atime-only UTIME_NOW requests

Avi Weiss <thnkslprpt@gmail.com>
    NFS: honor UTIME_NOW atime with explicit mtime

Avi Weiss <thnkslprpt@gmail.com>
    NFSv4.1: retain MDS I/O until both thresholds are met

Zachary Huang <zuzhenhuang365@gmail.com>
    ASoC: es9356: fix the capture gain dB scale

Eric Dumazet <edumazet@kernel.org>
    tcp: rate limit receive queue collapsing

Cheng Yongkang <teel4res@gmail.com>
    btrfs: handle zero num_stripes in btrfs_chunk_item_size()

Filipe Manana <fdmanana@suse.com>
    btrfs: zstd: prevent leak of workspace below maximum level

Johannes Thumshirn <johannes.thumshirn@wdc.com>
    btrfs: zoned: fix lockdep splat on mount

Johannes Thumshirn <johannes.thumshirn@wdc.com>
    btrfs: zoned: don't wait for ordered extents in do_zone_finish()

Johannes Thumshirn <johannes.thumshirn@wdc.com>
    btrfs: zoned: requeue block group if zone reset bails out

Johannes Thumshirn <johannes.thumshirn@wdc.com>
    btrfs: zoned: fix possible UAF in wait_eb_writebacks()

Johannes Thumshirn <johannes.thumshirn@wdc.com>
    btrfs: zoned: only change active zone counter on successful (de)activation

Samuel Leyva <samuelslg03idk@gmail.com>
    ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output

Ridong Chen <chenridong@xiaomi.com>
    cgroup/cpuset: Reset partition data when an invalid partition stays invalid

Vijendar Mukunda <Vijendar.Mukunda@amd.com>
    ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler

Vijendar Mukunda <Vijendar.Mukunda@amd.com>
    ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler

Boris Brezillon <boris.brezillon@collabora.com>
    drm/panfrost: Enable cycle counting when perfcnt is enabled

Tyler Baker <tyler.baker@oss.qualcomm.com>
    ASoC: qcom: x1e80100: recreate the headset jack on card rebind

Hongyang Zhao <hongyang.zhao@thundersoft.com>
    ASoC: qcom: common: Add generic headset jack helpers

Tyler Baker <tyler.baker@oss.qualcomm.com>
    ASoC: soc-core: copy the DAI link names into the card

Dmitry Torokhov <dmitry.torokhov@gmail.com>
    gpiolib: of: return -ENOENT from of_gpio_count() stub

Dmitry Torokhov <dmitry.torokhov@gmail.com>
    gpiolib: fix fast-path cancellation in gpiod_get_array()

Dmitry Torokhov <dmitry.torokhov@gmail.com>
    gpiolib: fix GPIO descriptor leak in gpiod_get_array()

Jagmeet Randhawa <jagmeet.randhawa@intel.com>
    drm/xe/guc: Do not attribute a TDR disable to a pending suspend

Jagmeet Randhawa <jagmeet.randhawa@intel.com>
    drm/xe/guc: Fix race around q->guc->suspend_pending access

Arvind Yadav <arvind.yadav@intel.com>
    drm/xe/svm: Preserve default PAT index when resetting VMA attributes

Badal Nilawar <badal.nilawar@intel.com>
    drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry

Vinay Belgaumkar <vinay.belgaumkar@intel.com>
    drm/xe: Access GT MMIO after pcode init

Vinay Belgaumkar <vinay.belgaumkar@intel.com>
    drm/xe: Toggle the D3Cold enable flag at runtime resume

Arvind Yadav <arvind.yadav@intel.com>
    drm/xe: Rebind BOs evicted before the first LR queue

Raag Jadav <raag.jadav@intel.com>
    drm/xe/pci_error: Flush GT wedge worker before bus reset

Raag Jadav <raag.jadav@intel.com>
    drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early()

Raag Jadav <raag.jadav@intel.com>
    drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM

Raag Jadav <raag.jadav@intel.com>
    drm/xe/gt: Use GT ordered workqueue for wedging

Rodrigo Vivi <rodrigo.vivi@intel.com>
    drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m

Helen Koike <koike@igalia.com>
    drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2

Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
    drm/xe/gsc: Fix NVL-S GSC compatibility number

Nitin Gote <nitin.r.gote@intel.com>
    drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines

Karthik Poosa <karthik.poosa@intel.com>
    drm/xe/hwmon: Handle unavailable memory controller sensors

Karthik Poosa <karthik.poosa@intel.com>
    drm/xe/hwmon: Add helpers to validate thermal sensor readings

Karthik Poosa <karthik.poosa@intel.com>
    drm/xe/hwmon: Fix thermal sensor data handling

Karthik Poosa <karthik.poosa@intel.com>
    drm/xe/hwmon: Decode mailbox temperature as sign-magnitude

Karthik Poosa <karthik.poosa@intel.com>
    drm/xe/hwmon: Fix pcode power limit handling

Karthik Poosa <karthik.poosa@intel.com>
    drm/xe/hwmon: Use shared pcode default timeout for power limit write

Karthik Poosa <karthik.poosa@intel.com>
    drm/xe/pcode: Increase default pcode mailbox timeout to 10ms

Michał Grzelak <michal.grzelak@intel.com>
    drm/xe/pcode: match argument naming with PCODE_DATAx

Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
    drm/xe/gt: Disable GT reset worker before engine teardown

Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
    drm/xe/guc: Protect timeout handling from device unplug

Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
    drm/xe: Prevent VF memory IRQ from accessing a torn-down engine

Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
    drm/xe/pat: Return error from xe_pat_init_early() on unknown platform

Alan Previn <alan.previn.teres.alexis@intel.com>
    drm/xe/gsc: Define GSC for NVL-S

Badal Nilawar <badal.nilawar@intel.com>
    drm/xe/cri: Expose device UID through sysfs

Greg Thelen <gthelen@google.com>
    kho: check fdt_phys in is_kho_boot()

Yifan Zhang <yfzhang23@stu.pku.edu.cn>
    tracing/probes: bound symstr stores to reserved length

Shao Mingyin <shao.mingyin@zte.com.cn>
    ata: libata-scsi: set the field pointer when rejecting CDL

Niklas Cassel <cassel@kernel.org>
    ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers

Niklas Cassel <cassel@kernel.org>
    ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length

Niklas Cassel <cassel@kernel.org>
    ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages

Niklas Cassel <cassel@kernel.org>
    ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit

Niklas Cassel <cassel@kernel.org>
    ata: libata-scsi: do not accept subpage code FFh in MODE SELECT

Niklas Cassel <cassel@kernel.org>
    ata: libata-scsi: fix MODE SELECT handling of data after the mode page

Alexei Starovoitov <ast@kernel.org>
    ipv6: Check the Home Address option again before its address is used

Eric Dumazet <edumazet@kernel.org>
    calipso: do not charge request socket options to the listener

Or Har-Toov <ohartoov@nvidia.com>
    net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum

Jesper L. Nielsen <jln@pascal-audio.com>
    net: ethernet: ti: am65-cpts: keep port and direction when matching PTPv1 TX timestamps

Anil Kaushik <anilkaushikwireless@gmail.com>
    netlink: Do not call the unbind callback with the table locked

Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
    net/mlx5e: IPoIB, Fix QPN lookup race

Kyle Pepper <cochcoder@proton.me>
    Bluetooth: reject invalid LE supervision timeout relationships

Rahad Bhuiya <rahadbhuiya2021@gmail.com>
    sched_ext: Reset task fields on exit of an SCX_TASK_READY task

Christian Loehle <christian.loehle@arm.com>
    cpufreq: Serialize global boost updates

Christian Loehle <christian.loehle@arm.com>
    cpufreq: Preserve global boost state on failed updates

Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
    iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails

Benjamin Segall <bsegall@google.com>
    perf: Fix racy update of cpc->hrtimer_interval

Sandipan Das <sandipan.das@amd.com>
    perf/x86/amd/uncore: Avoid context migration from non-owners

Peter Zijlstra <peterz@infradead.org>
    locking/osq: Fix unlink queue corruption

Peter Zijlstra <peterz@infradead.org>
    locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering

Zhuangzhuang Wang <3050681779@qq.com>
    locking/lockdep: Fix inverted "on"/"last" CPU label in lockdep_print_held_locks()

Thomas Fourier <fourier.thomas@gmail.com>
    net/mlx5e: TC, Fix double free of branch in failure

Ridge Lomont <cyridge@proton.me>
    x86/kcfi: Don't emit KCFI_REFERENCE() in modules

Isaac Adjei <code@isaacadjei.me>
    gpio: mpfs: reject unsupported interrupt types

Eric Dumazet <edumazet@kernel.org>
    tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND

Kayra Cizmeci <kayracizmeci@gmail.com>
    sched/cache: Ignore non-fair current in alb_break_llc()

Hui Su <sh_def@163.com>
    sched/topology: Balance cluster static-key updates

Hui Su <sh_def@163.com>
    sched/pelt: Fix u32 truncation of the PELT period count

Christian Loehle <christian.loehle@arm.com>
    sched/core: Account I/O waits independently of delayed dequeue

Nickolai Zeldovich <nickolai@csail.mit.edu>
    sched/deadline: Fix this_bw on class change of a dying task

Ravi Bangoria <ravi.bangoria@amd.com>
    perf/amd/ibs: Simplify event state handling with IBS_CAPS_DIS

Ravi Bangoria <ravi.bangoria@amd.com>
    perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR

Kan Liang <kan.liang@linux.intel.com>
    perf: Add sampling support for SIMD registers

Kan Liang <kan.liang@linux.intel.com>
    perf: Move and enhance has_extended_regs() for arch-specific use

Dapeng Mi <dapeng1.mi@linux.intel.com>
    perf: Eliminate duplicate arch-specific function definitions

Ravi Bangoria <ravi.bangoria@amd.com>
    perf/amd/ibs: Reset CPU0 IBS state on syscore resume

Ian Rogers <irogers@google.com>
    perf/core: Clamp deferred callchain entry count to fit u16 header.size

Ian Rogers <irogers@google.com>
    perf/core: Include perf_event_attr::defer_output in is_sb_event() check

Siddharth Chintamaneni <sidchintamaneni@gmail.com>
    fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()

Jeff Layton <jlayton@kernel.org>
    statx: don't leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask

Hungyu Lin <dennylin0707@gmail.com>
    vfs: preserve subsecond timestamps at filesystem time limits

Andrea Parri <parri.andrea@gmail.com>
    iov_iter: take an unsigned long segment count in import_iovec()

Abbott Liu <liuwenliang@huawei.com>
    initrd: flush deferred fput() before mounting root

Christian Brauner <brauner@kernel.org>
    libfs: end offset readdir at positions past DIR_OFFSET_EOD

Christian Brauner <brauner@kernel.org>
    libfs: walk offset directories in offset order

Florian Fainelli <f.fainelli@gmail.com>
    MIPS: SB1250: Validate and update IRQ affinity

Florian Fainelli <f.fainelli@gmail.com>
    MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window

Florian Fainelli <f.fainelli@gmail.com>
    MIPS: Alchemy: Save the Ethernet address before reusing PROM memory

Florian Fainelli <f.fainelli@gmail.com>
    MIPS: Alchemy: Register interrupt chips with the IRQ core

Imre Kaloz <kaloz@kernel.org>
    MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC

Rosen Penev <rosenp@gmail.com>
    MIPS: Avoid dead code/data elimination when using recordmcount

Imre Kaloz <kaloz@kernel.org>
    MIPS: SGI-IP27: print the NMI dump on an nbcon console

Eric Dumazet <edumazet@kernel.org>
    tcp: ipv6: free ireq->ipv6_opt after an RCU grace period

Long Zhao <longzhao@ambarella.com>
    gpio: regmap: free the irqchip if adding the irq domain fails

Florian Westphal <fw@strlen.de>
    netfilter: nat: zero newrange before filling it in

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload

Joas Antonio dos Santos <joasantonio108@gmail.com>
    netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport()

Fernando Fernandez Mancera <fmancera@suse.de>
    netfilter: x_tables: check target name before accessing verdict

Laveesh Bansal <laveeshb@laveeshbansal.com>
    netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()

Xingyuan Mo <hdthky0@gmail.com>
    netfilter: nft_set_rbtree: check catchall_sync return before queue_done

Qingfang Deng <qingfang.deng@linux.dev>
    tcp: initialize send sequence numbers before deferring TFO

Cheng Yongkang <teel4res@gmail.com>
    net: bridge: disable MRP ports before the FDB flush in del_nbp()

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: set XDP metadata length on the page_pool RX path

Timur Stukan <timur.stukan.linux@gmail.com>
    bonding: fix missing down path on speed/duplex failure after FAIL->UP

Kyle Zeng <kylebot@openai.com>
    ip6mr: Serialize multicast router socket ownership

Timur Stukan <timur.stukan.linux@gmail.com>
    bonding: 3ad: don't set BOND_LINK_FAIL on a slave that is not up

Colton Pawielski <colton.pawielski@gmail.com>
    net: 8139cp: keep Rx masked while NAPI is scheduled

Jinseob Kim <kimjinseob88@gmail.com>
    gpiolib: reset lookup flags for each hogged line

Chris Chiu <chris.chiu@canonical.com>
    ALSA: hda/realtek: Use inverted mute LED quirk for HP ZBook 8 G2a

Richard Fitzgerald <rf@opensource.cirrus.com>
    ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()

Richard Fitzgerald <rf@opensource.cirrus.com>
    ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load()

Michał Kopeć <michal.kopec@3mdeb.com>
    ALSA: hda/core: Stop capability walk on empty capability header

Takashi Sakamoto <o-takashi@sakamocchi.jp>
    ALSA: firewire: fix inverted streaming speed between tx and rx streams

Shivam Madlani <shivammadlani5@gmail.com>
    ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP OmniBook 7

Munique Feitoza <muniquefeitoz4@gmail.com>
    drm/nouveau: Fix CE channel creation on pre-Kepler GPUs

Rosen Penev <rosenp@gmail.com>
    drm/nouveau/fifo: map Kepler video engine contexts non-privileged

Frederic Konrad <fkonrad@amd.com>
    spi: cadence-quadspi: Fix race between DMA completion and transfer start

Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Bluetooth: Fix not updating of hdev->commands[] after reset

Florian Fainelli <florian.fainelli@broadcom.com>
    net: dsa: b53: restore the NSP IMP port 2 Gbps mode

Florian Fainelli <florian.fainelli@broadcom.com>
    net: ethernet: bgmac: preserve forced 2.5 Gbps link speed

Stanislavs Nilovs <valorcool@gmail.com>
    Bluetooth: qca: Disable SoC debug logging for WCN3950

Zhao Li <enderaoelyther@gmail.com>
    Bluetooth: L2CAP: Clear request identifiers on incoming LE connections

Zijun Hu <zijun.hu@oss.qualcomm.com>
    Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path

Richard Fitzgerald <rf@opensource.cirrus.com>
    ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add()

Sasha Levin <sashal@kernel.org>
    ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online()

Sasha Levin <sashal@kernel.org>
    ACPI: scan: Print the offline failure message in acpi_bus_offline()

Richard Fitzgerald <rf@opensource.cirrus.com>
    firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path

Stanley Jhu <stanleyjhu@google.com>
    PM: runtime: Update runtime_pm.rst for non-fatal resume errors

Brian Norris <briannorris@chromium.org>
    PM: runtime: Clarify ->runtime_idle() callback return value handling

Brian Norris <briannorris@chromium.org>
    PM: runtime: Add "Section" hyperlinks

Brian Norris <briannorris@chromium.org>
    PM: runtime: Misc improvements to runtime_pm.rst

Mario Limonciello <mario.limonciello@amd.com>
    drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence

Eric Dumazet <edumazet@kernel.org>
    tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()

Kuniyuki Iwashima <kuniyu@google.com>
    ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow().

Kuniyuki Iwashima <kuniyu@google.com>
    ipv6: Flush rt->from in rt6_uncached_list_flush_dev().

Kuniyuki Iwashima <kuniyu@google.com>
    ipv6: Batch rt6_uncached_list_flush_dev() in netdev_run_todo().

Kuniyuki Iwashima <kuniyu@google.com>
    ipv4: Batch rt_flush_dev() in netdev_run_todo().

Kuniyuki Iwashima <kuniyu@google.com>
    ipv6: Flush exception route while replacing nexthop.

Zhou Minqiang <zhouminqiang2@huawei.com>
    PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove

Avi Weiss <thnkslprpt@gmail.com>
    net: skbuff: reject zero MPLS TTL before decrementing

Christian Loehle <christian.loehle@arm.com>
    cpufreq: Hold the policy write lock when changing boost state

Guillaume Nault <gnault@redhat.com>
    tcp: Fix dup-ack detection on non-SACK bidirectional data transfer.

Hungyu Lin <dennylin0707@gmail.com>
    isofs: handle Rock Ridge long-form dates before 1900

Daejun Park <daejun7.park@samsung.com>
    erofs: treat files shared by inode_share as stacked

Joseph Kain <jkain@nuro.ai>
    net: stop defer_count outliving the deferred-free list

James Clark <jjc@jclark.com>
    net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes

Jude Gyimah <jude.gyimah87@gmail.com>
    ASoC: rockchip_spdif: select REGMAP_MMIO

Jude Gyimah <jude.gyimah87@gmail.com>
    ASoC: rockchip_sai: select REGMAP_MMIO

Jude Gyimah <jude.gyimah87@gmail.com>
    ASoC: rockchip_pdm: select REGMAP_MMIO

Jude Gyimah <jude.gyimah87@gmail.com>
    ASoC: rockchip_i2s_tdm: select REGMAP_MMIO

Jude Gyimah <jude.gyimah87@gmail.com>
    ASoC: rockchip_i2s: select REGMAP_MMIO

Chris Mason <mason@kernel.org>
    nvmet-rdma: disconnect a queue on device removal

Chris Mason <mason@kernel.org>
    nvmet-rdma: queue the release work under the mutex

Chris Mason <mason@kernel.org>
    nvmet-rdma: take a device off the list last

Josef Bacik <josef@toxicpanda.com>
    nvmet-tcp: limit the connections accepted per work run

Chris Mason <mason@kernel.org>
    nvmet-rdma: disconnect only established queues

Josef Bacik <josef@toxicpanda.com>
    nvmet-auth: keep the old keys if the new ones fail

Josef Bacik <josef@toxicpanda.com>
    nvmet-tcp: ask for the TLS record type on every receive

Josef Bacik <josef@toxicpanda.com>
    nvme-loop: delete the controller if a reset fails

Eric Dumazet <edumazet@kernel.org>
    ipmr, ip6mr: queue netlink route queries out of band

Alexander Goodkind <alex@goodkind.io>
    net: ethernet: mediatek: preserve sibling PPE bindings

Florian Fainelli <florian.fainelli@broadcom.com>
    net: dsa: b53: Enable IGMP and MLD control packet CPU copies

ChunYuZhiQiang <chunyuzhiqiang@yinhe.ht>
    can: dev: can_tdc_fill_info(): don't read automatic TDCV if interface is down

Cunhao Lu <1579567540@qq.com>
    can: skb: make CAN skb allocation failure paths IRQ-safe

James Fantin-Hardesty <james.fantin-hardesty@seagate.com>
    nvmet: fix arbitration burst field mask

Kyle Zeng <kylebot@openai.com>
    tcp: wait for TIME_WAIT teardown before freeing per-netns ehash

Niklas Cassel <cassel@kernel.org>
    null_blk: don't finish zones to set them read-only or offline

Niklas Cassel <cassel@kernel.org>
    null_blk: fix opening closed zones at the active zone limit

Nguyen Dinh Phi <phind.uet@gmail.com>
    vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT

Yunye Zhao <yunye.zhao@linux.alibaba.com>
    virtio_blk: freeze the virtqueue layout at probe time

Shao Mingyin <shao.mingyin@zte.com.cn>
    zloop: reject mismatched conventional zone files on restore

Shao Mingyin <shao.mingyin@zte.com.cn>
    zloop: fix the error code in the blk_mq_alloc_disk message

Avi Weiss <thnkslprpt@gmail.com>
    block: report the correct discard alignment in sysfs

Zizhi Wo <wozizhi@huawei.com>
    block: partitions: reject GPT entries with starting_lba > ending_lba

Shao Mingyin <shao.mingyin@zte.com.cn>
    virtio-blk: Fix zone append sector reporting in batched completion

Jianan Huang <jnhuang95@gmail.com>
    blk-mq: reset queue state on scheduler teardown

John Ogness <john.ogness@linutronix.de>
    printk: Avoid multiple unregistration in unregister_console_locked()

Josef Bacik <josef@toxicpanda.com>
    ext2: only flush DIRSYNC directories on every change

Jia Jia <physicalmtea@gmail.com>
    vhost-scsi: fix page reference leak in misaligned I/O fallback

Mingbing Zhai <zhaimingbing@cmss.chinamobile.com>
    virtio_balloon: initialize wakeup_lock before virtqueues are set up

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vhost-vdpa: initialize state before publishing cdev

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vhost: reject backend enable without a kick file

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vhost-scsi: reject delayed virtqueue setup

sungbyeongchan <tjdqudcks0424@naver.com>
    virtio_ring: use shadow flags when detaching split descriptors

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vhost-scsi: validate event queue descriptor direction

Shuai Zhang <shuai.zhang@oss.qualcomm.com>
    power: sequencing: qcom-wcn: increase WCN7850 power-up delay

Eric Dumazet <edumazet@kernel.org>
    xfrm: iptfs: fix skb leak on error in __input_process_payload()

Jia Jia <physicalmtea@gmail.com>
    vhost-scsi: do not count PI bytes in the data length

Eric Dumazet <edumazet@kernel.org>
    soreuseport: annotate data-races around reuse->socks[] and num_socks

Yifan Zhang <yfzhang23@stu.pku.edu.cn>
    ksmbd: require NUL-terminated EA names

Bart Van Assche <bvanassche@acm.org>
    mctp i3c: Fix locking in an error path

Ville Syrjälä <ville.syrjala@linux.intel.com>
    drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start()

Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response

Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset

Yehyeong Lee <yhlee@isslab.korea.ac.kr>
    wifi: nxpwifi: guard the 11ax response handlers against a detached command buffer

Danish Khateeb <danishkhateeb03@gmail.com>
    selftests/mm: merge: keep the far mremap() targets in the carveout

Xu Yunxiang <xyx2021@mail.ustc.edu.cn>
    bpf: Propagate scalar precision through stack arguments

Alexei Starovoitov <ast@kernel.org>
    bpf: Emit timed may_goto for JITed progs only

Kevin Dewald <kevin@simpleble.org>
    Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery

Yifan Zhang <yfzhang23@stu.pku.edu.cn>
    Bluetooth: validate retained LE Set CIG Parameters command length

Yifan Zhang <yfzhang23@stu.pku.edu.cn>
    Bluetooth: validate retained LE Create CIS command length

Cen Zhang <zzzccc427@gmail.com>
    Bluetooth: hci_core: Initialize advertising RPA work only once

Kevin Dewald <kevin@simpleble.org>
    Bluetooth: MGMT: Clear disabled connection parameters when loading none

Cen Zhang <zzzccc427@gmail.com>
    Bluetooth: hci_sync: Copy the resolving-list IRK under RCU

Cen Zhang <zzzccc427@gmail.com>
    Bluetooth: SMP: Protect LTK encryption with RCU

Cen Zhang <zzzccc427@gmail.com>
    Bluetooth: SMP: Protect link keys during LTK derivation

Cen Zhang <zzzccc427@gmail.com>
    Bluetooth: hci_core: Keep link-key filtering inside RCU

Ismail Tarim <ismailtarim7@gmail.com>
    Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init()

Tobias Wilken <tooangel@tooangel.de>
    Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller

Shuai Zhang <shuai.zhang@oss.qualcomm.com>
    Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping

Cen Zhang <zzzccc427@gmail.com>
    Bluetooth: hci_sync: Protect resolving-list lookups

Cen Zhang <zzzccc427@gmail.com>
    Bluetooth: hci_sync: Copy the LE accept list under hdev->lock

Chris Lu <chris.lu@mediatek.com>
    Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD

Chris Lu <chris.lu@mediatek.com>
    Bluetooth: btmtk: bound the ISO payload length by the controller's MTU

Chris Lu <chris.lu@mediatek.com>
    Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding

Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Bluetooth: hci_sync: Update the CIS host feature when enabling LE

Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Bluetooth: L2CAP: Hold incoming data until encryption key size is known

Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Bluetooth: hci_core: Convert hci_conn flags to a bitmap

Frédéric Danis <frederic.danis@collabora.com>
    Bluetooth: MGMT: Add management security level changed event

Peng Fan <peng.fan@nxp.com>
    Bluetooth: use assign_bit() where applicable

Kevin Dewald <kevin@simpleble.org>
    Bluetooth: hci_event: Clear explicit connect state on LE connection

Catherine L <catherine.l@intel.com>
    Bluetooth: btintel: fix buffer over-read in fw payload

Akhil Arul <akhilarul324@gmail.com>
    Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained

Binbin Deng <18983559317@163.com>
    Bluetooth: hci_core: Initialize LTK before publication

Binbin Deng <18983559317@163.com>
    Bluetooth: hci_core: Initialize link key before publication

Binbin Deng <18983559317@163.com>
    Bluetooth: hci_core: Initialize IRK before publication

Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Bluetooth: hci_sync: Fix invalid Supervision_Timeout in LE Set Default Rate

Alexandre Mergnat <amergnat@baylibre.com>
    regulator: mt6363: Fix VEMC voltage selection

Alexandre Mergnat <amergnat@baylibre.com>
    regulator: mt6363: Use 8-bit register values

GIBEOM LEE (이기범) <rtx4060@gmail.com>
    regulator: mt6363: Fix the registers of the VSRAM CPU and APU LDOs

Alexei Starovoitov <ast@kernel.org>
    bpf: Don't trust pointers spilled in slots that a callee can write

Alexei Starovoitov <ast@kernel.org>
    bpf: Prepare static analysis passes for callx instruction

Yonghong Song <yonghong.song@linux.dev>
    bpf: Rename bpf_call_summary::num_params to arg_slot_cnt

Alexei Starovoitov <ast@kernel.org>
    bpf: Fix the join of fp+0 with a value that is not a pointer to stack

Jerome Brunet <jbrunet@baylibre.com>
    ASoC: meson: axg-fifo: request the irq with the clock enabled

Shubhang Kaushik (Ampere) <sh@gentwo.org>
    sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs

Alexei Starovoitov <ast@kernel.org>
    bpf: Don't move a MAP_FIXED address in arena_get_unmapped_area()

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: pass the desired EST enable state to est_configure()

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: initialize est_lock at probe time

James Clark <jjc@jclark.com>
    net: stmmac: ptp: switch to gettimex64() interface

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume()

Baochen Qiang <baochen.qiang@oss.qualcomm.com>
    wifi: ath12k: don't advertise EHT-MCS15 to firmware unless we support it

Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
    net: phy: don't require RTNL to detach a PHY from an unregistered netdev

Markus Stockhausen <markus.stockhausen@gmx.de>
    net: phy: add phy_detach_internal() helper

Bryam Vargas <hexlabsecurity@proton.me>
    net/iucv: take a private, writable frame before rewriting it in place

Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
    gpio: mpc8xxx: Fix potential use-after-free of IRQ domain

Daniel Machon <daniel.machon@microchip.com>
    net: sparx5/lan969x: release the in-flight slot of a stale TX skb

Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
    regulator: qcom_spmi: don't take a sleeping lock in the SAW IPI

Yuho Choi <oss.patchbox@gmail.com>
    virtio_blk: Reset device on probe error paths after DRIVER_OK

Jia Jia <physicalmtea@gmail.com>
    vduse: avoid infinite loop when no affinity CPU is online

Sergii Ushakov <sergiiushakov@google.com>
    virtio-blk: clamp max_segments to virtqueue ring size

Yu Zhang <yuz08559@gmail.com>
    vhost-vdpa: drop the parent's vq callback before the call fd is released

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vhost: reject invalid IOTLB update permissions

Xiang Mei <xmei5@asu.edu>
    vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit()

Maoxia <2312891301@qq.com>
    virtio_pci: add missing newline to the pmcsr error message

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vhost: fix dirty logging for in-order used ring entries

Jia Jia <physicalmtea@gmail.com>
    vhost-scsi: do not relock event vq mutex on send_evt fallback

Jia Jia <physicalmtea@gmail.com>
    vhost-scsi: preserve event ordering

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vdpa: invalidate DMA mappings before releasing memory

Linfeng Sun <linfeng.sun.dev@gmail.com>
    vdpa_sim: serialize IOTLB updates with dataplane access

Li RongQing <lirongqing@baidu.com>
    virtio_ring: reset IN_ORDER state in virtqueue_init()

Karl Mehltretter <kmehltretter@gmail.com>
    virtio-spi: Fix virtio_spi_config kernel-doc

Alex Austin <alex.austin@amd.com>
    sfc: ptp: avoid racing PPS timestamp updates

Alex Austin <alex.austin@amd.com>
    sfc: ptp: serialize host and MC synchronization transactions

Alex Austin <alex.austin@amd.com>
    sfc: ptp: drop the stale frequency reset in efx_ptp_start()

Namjae Jeon <linkinjeon@kernel.org>
    ntfs: don't allow resident values to overlap the attribute header

Vladimir Zapolskiy <vz@kernel.org>
    drm/panel: visionox-r66451: Wait longer after the panel reset

Vladimir Zapolskiy <vz@kernel.org>
    drm/panel: visionox-r66451: Send the brightness value MSB first

Daejun Park <daejun7.park@samsung.com>
    erofs: apply the stacked fs check to extra file-backed devices

Daniel Machon <daniel.machon@microchip.com>
    net: lan966x: don't free XDP buffers in fdma tx clear with budget 0

Giuseppe Piscitelli <ooonea@gmail.com>
    ata: libata-core: Check device support before querying power state

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: fix XDP RX buffer DMA sync length

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: fix VLAN tag stripping on short and non-linear RX frames

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: copy XDP metadata in AF_XDP zero-copy RX

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: drop multi-buffer frames in XDP mode

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    net: stmmac: drop split frames on AF_XDP zero-copy RX

James Hilliard <james.hilliard1@gmail.com>
    net: stmmac: take ownership of saved RX state at poll entry

Niklas Cassel <cassel@kernel.org>
    ata: libata-eh: Retry non-NCQ commands when their sense data asks for it

Igor Pylypiv <ipylypiv@google.com>
    ata: libata-sata: allow re-enabling NCQ with the same queue_depth

Eric Dumazet <edumazet@kernel.org>
    tcp: do not let tcp_collapse() drive sk_forward_alloc negative

Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
    ipv6: fix fib6 walker UAF on NLM_F_REPLACE

Shawn Guo <shengchao.guo@oss.qualcomm.com>
    gpio: shared-proxy: Drop the vote when switching to input

Shawn Guo <shengchao.guo@oss.qualcomm.com>
    gpio: shared-proxy: Drive the default value when no votes are cast

Shawn Guo <shengchao.guo@oss.qualcomm.com>
    gpio: shared-proxy: Drop the vote of a released proxy on write failure

Shawn Guo <shengchao.guo@oss.qualcomm.com>
    gpio: shared-proxy: Fix race between concurrent first users

Vlad Poenaru <vlad.wing@gmail.com>
    bnxt_en: Don't keep MSI-X vectors added before FW reserves them

Joas Antonio dos Santos <joasantonio108@gmail.com>
    net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period

Animesh Manna <animesh.manna@intel.com>
    drm/i915/cmtg: Disable CMTG after encoder disable in hsw_crtc_disable()

Suraj Kandpal <suraj.kandpal@intel.com>
    drm/i915/display: Limit NVL TRANS_VTOTAL.Vtotal skip to A-step

Yuqiang Sun <izaiahsun@gmail.com>
    bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom

Michał Kopeć <michal@nozomi.space>
    firmware: coreboot: Don't skip CBMEM entries outside of known memory

Rosen Penev <rosenp@gmail.com>
    spi: acpi: only look up the IRQ of confirmed SPI devices

Alban Bedel <alban.bedel@lht.dlh.de>
    spi: Fix ACPI SPI resources using relative path

James Calligeros <jcalligeros99@gmail.com>
    ASoC: tas2770: Configure transmit clock edge when setting DAI format

Chris Mason <mason@kernel.org>
    bpf: Check the offset in bpf_skb_generic_{push,pop}()

Chris Mason <mason@kernel.org>
    bpf: Use the inner transport header after a decap

Chris Mason <mason@kernel.org>
    bpf: Move the transport header with the moved headers

Alexei Starovoitov <ast@kernel.org>
    bpf: Don't let lwt_in progs call into IPv6 when it is disabled

Alexei Starovoitov <ast@kernel.org>
    bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol

Alexei Starovoitov <ast@kernel.org>
    bpf: Reset skb->cb after an lwt prog pushes an IP header

Alexei Starovoitov <ast@kernel.org>
    bpf: Don't leave a stale MAC header in bpf_lwt_push_ip_encap()

Chris Mason <mason@kernel.org>
    bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()

Alexei Starovoitov <ast@kernel.org>
    bpf: Don't look for the SRH again in the End.BPF helpers

Chris Mason <mason@kernel.org>
    bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh()

Alexei Starovoitov <ast@kernel.org>
    bpf: Set a dst for test runs of lwt_in progs

Chris Mason <mason@kernel.org>
    bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6

Alexei Starovoitov <ast@kernel.org>
    bpf: Don't let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS

Chris Mason <mason@kernel.org>
    bpf, cgroup: Keep the skb network offset signed

Chris Mason <mason@kernel.org>
    bpf: Require prog fd or capability for cgroup detach

Alexei Starovoitov <ast@kernel.org>
    bpf: Remove the WARN from arena_get_unmapped_area()

Alexei Starovoitov <ast@kernel.org>
    bpf: Refuse an arena mmap() longer than max_entries pages

Alexei Starovoitov <ast@kernel.org>
    bpf: Don't let bpf_arena_free_pages() see a half-set user range

Alexei Starovoitov <ast@kernel.org>
    bpf: Refuse to map an arena at address 0

Alexei Starovoitov <ast@kernel.org>
    bpf: Clamp the trace length before the skip test in stackid_init()

Josef Bacik <josef@toxicpanda.com>
    bpf: Clamp the trace length in __bpf_get_stack() again

Hongjian Dai <daihongjian@kylinsec.com.cn>
    spi: pic32-sqi: fail transfer when the BD ring is exhausted

Alexei Starovoitov <ast@kernel.org>
    bpf, x86: Fix bpf_throw() in a prog with a private stack

Tang Bin <tangbin@cmss.chinamobile.com>
    ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable

Fernando Fernandez Mancera <fmancera@suse.de>
    netfilter: nft_reject: prevent unbounded recursion in output hooks

Ayushman Rout <ayushmanrout27@gmail.com>
    bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet

Sasha Levin <sashal@kernel.org>
    ALSA: hda/core: Fix double free on stream page allocation failure

Sasha Levin <sashal@kernel.org>
    ALSA: memalloc: Free the new pages when WC DMA mapping fails

Thomas Fourier <fourier.thomas@gmail.com>
    net: ipa: Fix double free of the interrupt structure on config error

Tung Nguyen <tung.quang.nguyen@est.tech>
    tipc: reject attaching bearer of different media to the same occupied device

Jia Jia <physicalmtea@gmail.com>
    scsi: target: Validate REGISTER AND MOVE TransportID length

Vincent YUE <vince@palmit.com.au>
    scsi: mpt3sas: Register devices during SANITIZE

Damien Le Moal <dlemoal@kernel.org>
    scsi: mpt3sas: Use combined sense codes

Fernando Fernandez Mancera <fmancera@suse.de>
    net/smc: fix limit_smc_hs sysctl on big-endian architecture

James Hilliard <james.hilliard1@gmail.com>
    ptp: vclock: preserve missing hardware timestamps

James Hilliard <james.hilliard1@gmail.com>
    ptp: vclock: serialize extended samples with counter updates

James Hilliard <james.hilliard1@gmail.com>
    ptp: vclock: propagate physical clock sampling errors

James Hilliard <james.hilliard1@gmail.com>
    ptp: unwind partially completed virtual clock creation

James Hilliard <james.hilliard1@gmail.com>
    ptp: drain virtual clock sysfs operations before unregistering children

Zhi-Jun You <hujy652@gmail.com>
    net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986

Zhi-Jun You <hujy652@gmail.com>
    net: ethernet: mtk_wed: free up rings during detach

Zhi-Jun You <hujy652@gmail.com>
    net: ethernet: mtk_wed: fix reset condition for rx wdma

Zhi-Jun You <hujy652@gmail.com>
    net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3

Puranjay Mohan <puranjay@kernel.org>
    bpf: Drop percpu_counter from the htab element count

Thomas Fourier <fourier.thomas@gmail.com>
    btrfs: zoned: fix double free of bitmaps on clone failure

Filipe Manana <fdmanana@suse.com>
    btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing

Filipe Manana <fdmanana@suse.com>
    btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe

Filipe Manana <fdmanana@suse.com>
    btrfs: fix fiemap merging compressed extents

guolingxing <guolingxing@tju.edu.cn>
    btrfs: verity: propagate orphan insertion errors when enabling verity

Tejun Heo <tj@kernel.org>
    sched_ext: Call ops.sub_attach() only while the cgroup is online

Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
    bpf: Fix jited line info off by the CFI preamble

Daniel Borkmann <daniel@iogearbox.net>
    x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address

Avi Weiss <thnkslprpt@gmail.com>
    gpio: omap: Propagate runtime PM failures in probe and request

Michal Wilczynski <m.wilczynski@samsung.com>
    drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes

Andrea Mayer <andrea.mayer@uniroma2.it>
    seg6: fix transport header for inner IPv4 with IP options

Kang Yang <kang.yang@oss.qualcomm.com>
    wifi: ath12k: set MSDU payload correctly

P Praneesh <praneesh.p@oss.qualcomm.com>
    wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler

Filippo Falezza <effeffe99@gmail.com>
    wifi: ath10k: Stop unanswered temperature reads

Hyunchul Lee <hyc.lee@gmail.com>
    ntfs: avoid overflow when limiting attribute read length

Hyunchul Lee <hyc.lee@gmail.com>
    ntfs: initialize VCN when inserting index entries

Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
    9p: do not store the create fid on special files

Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
    9p: fall back to the normal open path for non-regular files

Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
    9p: fix kernel-doc warning for enum p9_session_flags

Barret Rhoden <brho@google.com>
    9p: treat read return values of 0 as EOF

Matthew Whitehead <tedheadster@gmail.com>
    scsi: aha1542: Remove unneeded scsi_dma_unmap() call

Giuseppe Piscitelli <ooonea@gmail.com>
    scsi: core: Balance the pseudo target reap reference

Giuseppe Piscitelli <ooonea@gmail.com>
    scsi: scsi_debug: Drain target cleanup before module exit

Imre Kaloz <kaloz@kernel.org>
    scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts

Davidlohr Bueso <dave@stgolabs.net>
    dma-buf: validate the attachment before asserting its reservation lock

Karl Mehltretter <kmehltretter@gmail.com>
    dma-buf: keep the DMA flags in the DMABUF_DEBUG copy

Leon Romanovsky <leon@kernel.org>
    dma-buf: Restore the scatterlist entry count before freeing

Wang Wensheng <wsw9603@163.com>
    printk_ringbuffer: Fix space_used() when blk_lpos->next overflows

Bart Van Assche <bvanassche@acm.org>
    ntfs: Fix error handling in __ntfs_create()

Mehmet Fide <mehmet.fide@screeningeagle.com>
    wifi: ath9k_htc: start ANI when an AP interface begins to beacon

Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
    wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect

Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
    wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers

Avi Weiss <thnkslprpt@gmail.com>
    fsnotify: preserve 64-bit pre-content ranges

Cosmin Ratiu <cratiu@nvidia.com>
    wifi: wext: Limit notifier event flushes to the device's netns

Devin Wittmayer <lucid_duck@justthetip.ca>
    drm/panic: Accept a trailing newline in panic_screen

Antony Antony <antony.antony@secunet.com>
    docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple

Antony Antony <antony.antony@secunet.com>
    xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state()

Antony Antony <antony.antony@secunet.com>
    xfrm: include mark in MIGRATE_STATE SA collision check

Antony Antony <antony.antony@secunet.com>
    xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path

Antony Antony <antony.antony@secunet.com>
    xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state()

Antony Antony <antony.antony@secunet.com>
    xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups

Deepanshu Kartikey <kartikey406@gmail.com>
    batman-adv: avoid WARN_ON for orig_ifinfo allocation failure

Shubham Antil <shubham@octane.security>
    xfrm: zero-initialise km_event in the replay-notify path

Haobin Wu <853555@gmail.com>
    9p: skip intermediate directory entry name copy in p9dirent_read()

Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx

Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    net/9p/usbg: fix descriptor cleanup use-after-free

Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    9p: use fc->net_ns for network namespace in RDMA and socket transports

Nick Venenga <nick@venenga.com>
    wifi: rtw89: 8922au: add ASUS BE93

Nick Venenga <nick@venenga.com>
    wifi: rtw89: 8922au: Add support for TP-Link TBE400U

Bitterblue Smith <rtl8821cerfe2@gmail.com>
    wifi: rtw89: usb: Avoid crash with dynamically added device ID

Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Input: destroy force-feedback device on input unregistration

Bryan Cochrane <bcochrane@google.com>
    bnxt_en: Take RTNL before netif_close() when aborting FW reset

Mikhail Malyshev <mike.malyshev@gmail.com>
    io_uring/io-wq: apply the current cpuset to new workers

Siddharth Chintamaneni <sidchintamaneni@gmail.com>
    io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()

Cheng Yongkang <teel4res@gmail.com>
    io_uring/rsrc: keep the old file when a file update fails

Cheng Yongkang <teel4res@gmail.com>
    io_uring/timeout: don't rearm a multishot timeout on cancel

Jens Axboe <axboe@kernel.dk>
    io_uring/io-wq: show stuck workers rather than WARN on a slow exit

Yang Xiuwei <yangxiuwei@kylinos.cn>
    io_uring/rw: fail soft links on IOPOLL short or error IO

Yang Xiuwei <yangxiuwei@kylinos.cn>
    io_uring/futex: fail soft links when cancelling a wait

Yang Xiuwei <yangxiuwei@kylinos.cn>
    io_uring: fail soft links on negative IOU_COMPLETE results

Cinq Prairie <notprairie@gmail.com>
    io_uring/napi: don't end the single NAPI busy poll early on need_resched()

Hui Peng <benquike@gmail.com>
    udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()

Sasha Levin <sashal@kernel.org>
    Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"

Vladimir Petrzhikovskii <vladimir@dfb.sh>
    virtio_net: check RX buffer length before DMA sync

Antheas Kapenekakis <lkml@antheas.dev>
    ALSA: hda/tas2781: Prevent throwing away custom calibration addresses

Krittikun Wongnin <krittikunwongnin@gmail.com>
    ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]

Hakan Abay <hakan.abay84@gmail.com>
    ACPI: PM: Add unused power resource quirk for Casper Excalibur G900

Matthias Dittrich <dittrich.m@gmx.net>
    ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250)

Hao Li <hao.li@linux.dev>
    mm/slub: refill prefilled sheaves from the barn

Sergey Lebedev <lsa.uz@pm.me>
    soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel)

Charles Keepax <ckeepax@opensource.cirrus.com>
    soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9

Sataporn Saijai <excursively@gmail.com>
    soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11

Eric Dumazet <edumazet@kernel.org>
    net: virtio: validate outer protocol of UDP tunnel GSO packets

Eric Dumazet <edumazet@kernel.org>
    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(-)



^ permalink raw reply	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0001/1005] tun: clear stale skb->protocol of NAPI frags skbs
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0002/1005] net: virtio: validate outer protocol of UDP tunnel GSO packets Greg Kroah-Hartman
                   ` (372 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Willem de Bruijn,
	Eric Dumazet, Jakub Kicinski, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ 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.

Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179386753589.488856.11455181721004759454@kernel.org/
Suggested-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261110213628.3476051-3-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/tun.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 2ed348b953159..8a5ffd6904891 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0002/1005] net: virtio: validate outer protocol of UDP tunnel GSO packets
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0001/1005] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0003/1005] soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11 Greg Kroah-Hartman
                   ` (371 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hassan Sultan, Willem de Bruijn,
	Michael S. Tsirkin, Eric Dumazet, Jakub Kicinski, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ 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.

Fixes: a2fb4bc4e2a6 ("net: implement virtio helpers to handle UDP GSO tunneling.")
Reported-by: Hassan Sultan <hassansultan@google.com>
Suggested-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/netdev/93d0e37c99711bebdf60c120af03010455c2f2e2.1793276116.git.mst@redhat.com/
Co-developed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261110213628.3476051-4-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 8a5ffd6904891..dfdc4b5bd27f8 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -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;
diff --git a/drivers/net/tun_vnet.h b/drivers/net/tun_vnet.h
index f4c652b1fa44d..3364e08dd6e08 100644
--- a/drivers/net/tun_vnet.h
+++ b/drivers/net/tun_vnet.h
@@ -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));
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 584bc05c577c7..9d92d318e2fae 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -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",
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index d6466f96cdd00..b7b6b542f4763 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -5,7 +5,10 @@
 #include <linux/if_vlan.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
+#include <linux/netdevice.h>
 #include <linux/udp.h>
+#include <net/ip.h>
+#include <net/ipv6.h>
 #include <net/tcp.h>
 #include <uapi/linux/tcp.h>
 #include <uapi/linux/virtio_net.h>
@@ -48,6 +51,145 @@ static inline int virtio_net_hdr_set_proto(struct sk_buff *skb,
 	return 0;
 }
 
+/* TODO: nothing virtio specific here, move to ip.h */
+
+/*
+ * Pull and minimally validate the IPv4 header at @nhoff.
+ * Returns the header and stores the transport header offset in
+ * @thoff, or NULL if truncated or malformed.  The whole header,
+ * options included, is guaranteed linear on return.
+ */
+static inline struct iphdr *virtio_net_ip4_parse(struct sk_buff *skb,
+						  unsigned int nhoff,
+						  unsigned int *thoff)
+{
+	unsigned int ihl;
+	struct iphdr *iph;
+
+	if (!pskb_may_pull(skb, nhoff + sizeof(struct iphdr)))
+		return NULL;
+
+	iph = (struct iphdr *)(skb->data + nhoff);
+	if (iph->version != 4 ||
+	    iph->ihl < sizeof(struct iphdr) / sizeof(u32))
+		return NULL;
+
+	ihl = iph->ihl * sizeof(u32);
+	*thoff = nhoff + ihl;
+	/* Pull the options as well: the transport header offset
+	 * returned above must be within the linear data.  iph goes
+	 * stale across the pull.
+	 */
+	if (!pskb_may_pull(skb, nhoff + ihl))
+		return NULL;
+
+	return (struct iphdr *)(skb->data + nhoff);
+}
+
+/* Where does the L3 header start, and what protocol is it?
+ * With @has_eth, the frame starts with an Ethernet header, possibly
+ * followed by VLAN tags. Otherwise the L3 header starts at the network
+ * header offset the caller set up.
+ *
+ * The caller knows how the frame will be parsed later: the device
+ * type does not tell, as tun can change it with TUNSETLINK.
+ */
+static inline bool
+virtio_net_l3_start(struct sk_buff *skb, bool has_eth, int *nhoff,
+		    __be16 *proto)
+{
+	if (has_eth) {
+		__be16 h_proto;
+
+		if (!pskb_may_pull(skb, ETH_HLEN))
+			return false;
+		h_proto = eth_hdr(skb)->h_proto;
+		/* skb->protocol is a sender claim, and parts of the
+		 * stack parse the packet per it: when it disagrees with
+		 * the frame we do not know which view the packet will
+		 * be parsed as, so do not validate.
+		 */
+		if (skb->protocol && skb->protocol != h_proto)
+			return false;
+		*nhoff = ETH_HLEN;
+		*proto = h_proto;
+		if (eth_type_vlan(*proto)) {
+			*proto = __vlan_get_protocol(skb, *proto, nhoff);
+			if (!*proto)
+				return false;
+		}
+	} else {
+		const struct iphdr *iph;
+
+		*nhoff = skb_network_offset(skb);
+		/* An unset network header shows up as an offset
+		 * outside of the packet.
+		 */
+		if (*nhoff < 0 || (unsigned int)*nhoff >= skb->len)
+			return false;
+		/* No L2 header to cross-check with: take the protocol
+		 * from the IP version at the network header.
+		 */
+		if (!pskb_may_pull(skb, *nhoff + 1))
+			return false;
+		iph = (const struct iphdr *)(skb->data + *nhoff);
+		if (iph->version == 4)
+			*proto = htons(ETH_P_IP);
+		else if (iph->version == 6)
+			*proto = htons(ETH_P_IPV6);
+		else
+			return false;
+		if (skb->protocol && skb->protocol != *proto)
+			return false;
+	}
+	return true;
+}
+
+/* Walk the L3 header at @nhoff: where does its transport header
+ * start, and which protocol is it?  Returns false if the header
+ * is truncated, malformed or fragmented.
+ */
+static inline bool
+virtio_net_l4_start(struct sk_buff *skb, unsigned int nhoff, __be16 proto,
+		    unsigned int *thoff, int *ip_proto)
+{
+	if (proto == htons(ETH_P_IP)) {
+		const struct iphdr *iph = virtio_net_ip4_parse(skb, nhoff, thoff);
+
+		if (!iph || ip_is_fragment(iph))
+			return false;
+		*ip_proto = iph->protocol;
+		return true;
+	}
+
+	if (proto == htons(ETH_P_IPV6)) {
+		const struct ipv6hdr *iph;
+		int flags = IP6_FH_F_AUTH;
+
+		if (!pskb_may_pull(skb, nhoff + sizeof(*iph)))
+			return false;
+		iph = (const void *)(skb->data + nhoff);
+		if (iph->version != 6)
+			return false;
+		*thoff = nhoff + sizeof(*iph);
+		*ip_proto = iph->nexthdr;
+		if (*ip_proto != IPPROTO_TCP && *ip_proto != IPPROTO_UDP) {
+			*thoff = nhoff;
+			/* Find the transport header behind any
+			 * extension headers. IP6_FH_F_AUTH stops
+			 * the walk at AH, so frames with AH are rejected.
+			 */
+			*ip_proto = ipv6_find_hdr(skb, thoff, -1, NULL,
+						  &flags);
+			if (*ip_proto < 0 || flags & IP6_FH_F_FRAG)
+				return false;
+		}
+		return true;
+	}
+
+	return false;
+}
+
 static inline int __virtio_net_hdr_to_skb(struct sk_buff *skb,
 					  const struct virtio_net_hdr *hdr,
 					  bool little_endian, u8 hdr_gso_type)
@@ -282,9 +424,33 @@ static inline unsigned int virtio_l3min(bool is_ipv6)
 	return is_ipv6 ? sizeof(struct ipv6hdr) : sizeof(struct iphdr);
 }
 
+/* Do the tunnel offsets match the outer headers in the frame?
+ * The L3 header the tunnel claims must be the one the frame
+ * carries, with UDP following it at @outer_th.
+ */
+static inline bool
+virtio_net_tnl_offsets_ok(struct sk_buff *skb, bool has_eth, bool outer_isv6,
+			  unsigned int outer_th)
+{
+	int nhoff;
+	__be16 proto;
+	unsigned int thoff;
+	int ip_proto;
+
+	if (!virtio_net_l3_start(skb, has_eth, &nhoff, &proto))
+		return false;
+	if (outer_isv6 != (proto == htons(ETH_P_IPV6)))
+		return false;
+	if (!virtio_net_l4_start(skb, nhoff, proto, &thoff, &ip_proto))
+		return false;
+
+	return ip_proto == IPPROTO_UDP && outer_th == thoff;
+}
+
 static inline int
 virtio_net_hdr_tnl_to_skb(struct sk_buff *skb,
 			  const struct virtio_net_hdr_v1_hash_tunnel *vhdr,
+			  bool has_eth,
 			  bool tnl_hdr_negotiated,
 			  bool tnl_csum_negotiated,
 			  bool little_endian)
@@ -338,6 +504,9 @@ virtio_net_hdr_tnl_to_skb(struct sk_buff *skb,
 	if (ret)
 		return ret;
 
+	if (!virtio_net_tnl_offsets_ok(skb, has_eth, outer_isv6, outer_th))
+		return -EINVAL;
+
 	/* In case of USO, the inner protocol is still unknown and
 	 * `inner_isv6` is just a guess, additional parsing is needed.
 	 * The previous validation ensures that accessing an ipv4 inner
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0003/1005] soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0001/1005] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0002/1005] net: virtio: validate outer protocol of UDP tunnel GSO packets Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0004/1005] soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9 Greg Kroah-Hartman
                   ` (370 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sataporn Saijai, Bard Liao,
	Vinod Koul, Sasha Levin

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

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

From: Sataporn Saijai <excursively@gmail.com>

[ 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.

Signed-off-by: Sataporn Saijai <excursively@gmail.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260818182020.143096-1-excursively@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soundwire/dmi-quirks.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c
index 62fa64b224123..8140f9b9db0a7 100644
--- a/drivers/soundwire/dmi-quirks.c
+++ b/drivers/soundwire/dmi-quirks.c
@@ -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"),
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0004/1005] soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0003/1005] soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11 Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0005/1005] soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel) Greg Kroah-Hartman
                   ` (369 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Charles Keepax, Vinod Koul,
	Sasha Levin

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

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

From: Charles Keepax <ckeepax@opensource.cirrus.com>

[ 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.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260903102743.3782541-1-ckeepax@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soundwire/dmi-quirks.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c
index 8140f9b9db0a7..197b754068920 100644
--- a/drivers/soundwire/dmi-quirks.c
+++ b/drivers/soundwire/dmi-quirks.c
@@ -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,
+	},
 	{}
 };
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0005/1005] soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel)
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0004/1005] soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9 Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0006/1005] mm/slub: refill prefilled sheaves from the barn Greg Kroah-Hartman
                   ` (368 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Pierre-Louis Bossart, Bard Liao,
	Sergey Lebedev, German Pablo Lindo, Vinod Koul, Sasha Levin

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

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

From: Sergey Lebedev <lsa.uz@pm.me>

[ 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.

Link: https://lore.kernel.org/linux-sound/20260830151516.44629-1-lsa.uz@pm.me/
Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Suggested-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Sergey Lebedev <lsa.uz@pm.me>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Tested-by: German Pablo Lindo <germanpapulindez@gmail.com>
Link: https://patch.msgid.link/20260913210849.6446-1-lsa.uz@pm.me
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soundwire/dmi-quirks.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c
index 197b754068920..0daa877cd9055 100644
--- a/drivers/soundwire/dmi-quirks.c
+++ b/drivers/soundwire/dmi-quirks.c
@@ -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,
+	},
 	{}
 };
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0006/1005] mm/slub: refill prefilled sheaves from the barn
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0005/1005] soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel) Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0007/1005] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250) Greg Kroah-Hartman
                   ` (367 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hao Li, Harry Yoo (Meta),
	Vlastimil Babka (SUSE), Suren Baghdasaryan, Sasha Levin

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

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

From: Hao Li <hao.li@linux.dev>

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.

Link: https://lore.kernel.org/linux-mm/aqPlMzUIw-4g2iOX@fedora/ [1]
Link: https://lore.kernel.org/linux-mm/aq0ylDidEHa2kg4X@thinkstation/ [2]
Signed-off-by: Hao Li <hao.li@linux.dev>
Reviewed-by: Harry Yoo (Meta) <harry@kernel.org>
Link: https://patch.msgid.link/20260921094521.141665-1-hao.li@linux.dev
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Harry Yoo (Meta) <harry@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 mm/slub.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index 6bb75db087a2d..41a66fc15edf8 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0007/1005] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250)
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0006/1005] mm/slub: refill prefilled sheaves from the barn Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0008/1005] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 Greg Kroah-Hartman
                   ` (366 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Matthias Dittrich, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Matthias Dittrich <dittrich.m@gmx.net>

[ 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.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221087
Signed-off-by: Matthias Dittrich <dittrich.m@gmx.net>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/power.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 23a4e207a01eb..c6955d1ad29db 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -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"),
+		}
+
 	},
 	{}
 };
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0008/1005] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0007/1005] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250) Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0009/1005] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] Greg Kroah-Hartman
                   ` (365 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hakan Abay, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Hakan Abay <hakan.abay84@gmail.com>

[ 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.

Link: https://bugs.kali.org/view.php?id=9891
Signed-off-by: Hakan Abay <hakan.abay84@gmail.com>
Link: https://patch.msgid.link/20261005174939.53873-1-hakan.abay84@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/power.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index c6955d1ad29db..34b73f320b184 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -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"),
+		},
+	},
 	{}
 };
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0009/1005] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0008/1005] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0010/1005] ALSA: hda/tas2781: Prevent throwing away custom calibration addresses Greg Kroah-Hartman
                   ` (364 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Krittikun Wongnin, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Krittikun Wongnin <krittikunwongnin@gmail.com>

[ 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.

Link: https://lore.kernel.org/r/CADS-TgDQ1G8vrTQLJeQ3RTBVFTyMe0C+5p2=UBKS=EFCDFuaxw@mail.gmail.com/
Signed-off-by: Krittikun Wongnin <krittikunwongnin@gmail.com>
[ rjw: Subject and changelog tweaks ]
Link: https://patch.msgid.link/20261013074245.4327-1-krittikunwongnin@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/power.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 34b73f320b184..c77342a584f0c 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -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"),
+		},
+	},
 	{}
 };
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0010/1005] ALSA: hda/tas2781: Prevent throwing away custom calibration addresses
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0009/1005] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0011/1005] virtio_net: check RX buffer length before DMA sync Greg Kroah-Hartman
                   ` (363 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Matthew Schwartz,
	Antheas Kapenekakis, Takashi Iwai, Sasha Levin

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

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

From: Antheas Kapenekakis <lkml@antheas.dev>

[ 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.

Closes: https://lore.kernel.org/all/179122346529.6.9250312386131579603.1671009695@8alias.com/
Co-developed-by: Matthew Schwartz <matthew.schwartz@linux.dev>
Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Link: https://patch.msgid.link/20261102174052.1216670-1-lkml@antheas.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/hda/codecs/side-codecs/tas2781_hda.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/hda/codecs/side-codecs/tas2781_hda.c b/sound/hda/codecs/side-codecs/tas2781_hda.c
index 9162173ccb105..b9b6e44f8791a 100644
--- a/sound/hda/codecs/side-codecs/tas2781_hda.c
+++ b/sound/hda/codecs/side-codecs/tas2781_hda.c
@@ -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];
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0011/1005] virtio_net: check RX buffer length before DMA sync
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0010/1005] ALSA: hda/tas2781: Prevent throwing away custom calibration addresses Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0012/1005] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts" Greg Kroah-Hartman
                   ` (362 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikolai Kalinin,
	Vladimir Petrzhikovskii, Jakub Kicinski, Sasha Levin

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

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

From: Vladimir Petrzhikovskii <vladimir@dfb.sh>

[ 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.

Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers")
Cc: stable@vger.kernel.org
Co-developed-by: Nikolai Kalinin <nikolai@kalinidze.me>
Signed-off-by: Nikolai Kalinin <nikolai@kalinidze.me>
Signed-off-by: Vladimir Petrzhikovskii <vladimir@dfb.sh>
Link: https://patch.msgid.link/20261110-b4-virtionet-rxlen-v2-1-6ec5aa0edf9f@dfb.sh
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/virtio_net.c | 63 +++++++++++++++++++++++++++-------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9d92d318e2fae..3a34a1376752d 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0012/1005] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0011/1005] virtio_net: check RX buffer length before DMA sync Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0013/1005] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
                   ` (361 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin

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

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

This reverts commit 992f7f5f34f803144c9cac31d49ff853d8e861a9.

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../drm/nouveau/nvkm/subdev/devinit/gf100.c   | 20 -------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
index 186e09ea0cb10..5368e705e7fd6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
@@ -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
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0013/1005] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0012/1005] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts" Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0014/1005] io_uring/napi: dont end the single NAPI busy poll early on need_resched() Greg Kroah-Hartman
                   ` (360 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Hui Peng, Jan Kara, Sasha Levin

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

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

From: Hui Peng <benquike@gmail.com>

[ 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.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://patch.msgid.link/20260919222600.3793513-1-benquike@gmail.com
Signed-off-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/udf/super.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/udf/super.c b/fs/udf/super.c
index 7570506ff2dde..a81a8509524a9 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0014/1005] io_uring/napi: dont end the single NAPI busy poll early on need_resched()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0013/1005] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0015/1005] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
                   ` (359 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Cinq Prairie, Jens Axboe,
	Sasha Levin

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

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

From: Cinq Prairie <notprairie@gmail.com>

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")
Cc: stable@vger.kernel.org
Signed-off-by: Cinq Prairie <notprairie@gmail.com>
Link: https://patch.msgid.link/20261027204840.7823-1-notprairie@gmail.com
[axboe: trim comments, drop __always_unused]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/io_uring.h |  1 +
 io_uring/napi.c     | 31 ++++++++++++++-----------------
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 2d6b2158605ad..0cb053aabe4b0 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -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
 };
diff --git a/io_uring/napi.c b/io_uring/napi.c
index 7e698720cd51a..54c1b328a89d3 100644
--- a/io_uring/napi.c
+++ b/io_uring/napi.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0015/1005] io_uring: fail soft links on negative IOU_COMPLETE results
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0014/1005] io_uring/napi: dont end the single NAPI busy poll early on need_resched() Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0016/1005] io_uring/futex: fail soft links when cancelling a wait Greg Kroah-Hartman
                   ` (358 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin

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

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

From: Yang Xiuwei <yangxiuwei@kylinos.cn>

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")
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Link: https://patch.msgid.link/20261114041123.109163-1-yangxiuwei@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/io_uring.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 41a03979cb8bb..c6bd17cca45f2 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -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
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0016/1005] io_uring/futex: fail soft links when cancelling a wait
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0015/1005] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0017/1005] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
                   ` (357 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin

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

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

From: Yang Xiuwei <yangxiuwei@kylinos.cn>

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")
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Link: https://patch.msgid.link/20261114072246.741950-2-yangxiuwei@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/futex.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/io_uring/futex.c b/io_uring/futex.c
index 9203998654ffb..8a85ae20964b3 100644
--- a/io_uring/futex.c
+++ b/io_uring/futex.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0017/1005] io_uring/rw: fail soft links on IOPOLL short or error IO
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0016/1005] io_uring/futex: fail soft links when cancelling a wait Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0018/1005] io_uring/io-wq: show stuck workers rather than WARN on a slow exit Greg Kroah-Hartman
                   ` (356 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin

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

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

From: Yang Xiuwei <yangxiuwei@kylinos.cn>

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")
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Link: https://patch.msgid.link/20261114072246.741950-3-yangxiuwei@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/rw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/io_uring/rw.c b/io_uring/rw.c
index b21daa3cfa5c2..0426c27f3c4c9 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0018/1005] io_uring/io-wq: show stuck workers rather than WARN on a slow exit
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0017/1005] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0019/1005] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
                   ` (355 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+b0d54b9e81de55179e47,
	Jens Axboe, Sasha Levin

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

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

From: Jens Axboe <axboe@kernel.dk>

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.

Reported-by: syzbot+b0d54b9e81de55179e47@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/io-wq.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 6b93950602621..358f32888a853 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0019/1005] io_uring/timeout: dont rearm a multishot timeout on cancel
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0018/1005] io_uring/io-wq: show stuck workers rather than WARN on a slow exit Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0020/1005] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
                   ` (354 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Cheng Yongkang, Jens Axboe,
	Sasha Levin

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

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

From: Cheng Yongkang <teel4res@gmail.com>

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")
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/20261116044519.281756-1-teel4res@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/timeout.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/io_uring/timeout.c b/io_uring/timeout.c
index 8e7a4bd7e5141..b46a50b395177 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0020/1005] io_uring/rsrc: keep the old file when a file update fails
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0019/1005] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0021/1005] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Greg Kroah-Hartman
                   ` (353 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Cheng Yongkang, Jens Axboe,
	Sasha Levin

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

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

From: Cheng Yongkang <teel4res@gmail.com>

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")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/20261116044531.281978-1-teel4res@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/rsrc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index c1ab760c4591c..d1ba00390c58d 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0021/1005] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0020/1005] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0022/1005] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
                   ` (352 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Siddharth Chintamaneni, Jens Axboe,
	Sasha Levin

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

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

From: Siddharth Chintamaneni <sidchintamaneni@gmail.com>

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")
Signed-off-by: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
Link: https://patch.msgid.link/20261116193146.65315-1-sidchintamaneni@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/kbuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index abf44f5dba26a..873d66a06b360 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -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:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0022/1005] io_uring/io-wq: apply the current cpuset to new workers
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0021/1005] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0023/1005] bnxt_en: Take RTNL before netif_close() when aborting FW reset Greg Kroah-Hartman
                   ` (351 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mikhail Malyshev, Jens Axboe,
	Sasha Levin

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

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

From: Mikhail Malyshev <mike.malyshev@gmail.com>

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")
Cc: stable@vger.kernel.org
Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
Link: https://patch.msgid.link/20261111162705.1150983-1-mike.malyshev@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/io-wq.c | 44 +++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 39 insertions(+), 5 deletions(-)

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 358f32888a853..d2ef08d65ec89 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -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();
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0023/1005] bnxt_en: Take RTNL before netif_close() when aborting FW reset
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0022/1005] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0024/1005] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
                   ` (350 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bryan Cochrane, Jakub Kicinski,
	Sasha Levin

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

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

From: Bryan Cochrane <bcochrane@google.com>

[ 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")
Cc: stable@vger.kernel.org
Signed-off-by: Bryan Cochrane <bcochrane@google.com>
Link: https://patch.msgid.link/20261110044235.204386-1-bcochrane@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 1fd6a676085b5..94d764230e47d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0024/1005] Input: destroy force-feedback device on input unregistration
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0023/1005] bnxt_en: Take RTNL before netif_close() when aborting FW reset Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0025/1005] wifi: rtw89: usb: Avoid crash with dynamically added device ID Greg Kroah-Hartman
                   ` (349 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Gideon Heinz, Dmitry Torokhov,
	Sasha Levin

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

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

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

[ 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.

Fixes: 509ca1a93836 ("Input: implement new force feedback interface")
Reported-by: Gideon Heinz <gideonheinz02@gmail.com>
Closes: https://lore.kernel.org/r/CAPb1+K2BxnfQ7VUQ15td5f9pVhn-ARSM9EjfOU8WuW72o+cvPg@mail.gmail.com
Tested-by: Gideon Heinz <gideonheinz02@gmail.com>
Link: https://patch.msgid.link/2f722967b6db0692d4dd4164aff39b62@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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(-)

diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 0e5d1d1ceb460..133b4622dc49a 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -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)
 {
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index d1fefd1dfc0de..3069436148ec1 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -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)) {
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 6c45a158047f2..2f0fa8ebee857 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -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)
diff --git a/include/linux/input.h b/include/linux/input.h
index 3381608127f72..02047cc45d04c 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -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;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0025/1005] wifi: rtw89: usb: Avoid crash with dynamically added device ID
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0024/1005] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0026/1005] wifi: rtw89: 8922au: Add support for TP-Link TBE400U Greg Kroah-Hartman
                   ` (348 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bitterblue Smith, Ping-Ke Shih,
	Sasha Levin

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

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

From: Bitterblue Smith <rtl8821cerfe2@gmail.com>

[ 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.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/7a537b2e-67d2-40fb-8ef2-fcbc7bbc93af@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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(-)

diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851bu.c b/drivers/net/wireless/realtek/rtw89/rtw8851bu.c
index 1e827205f2540..6672ebe68f172 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8851bu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8851bu.c
@@ -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);
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852au.c b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
index 065f4e5b17afa..1a2e5dfbaab3c 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
@@ -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);
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852bu.c b/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
index de79a19a2824d..550fc4ac7a21f 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
@@ -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);
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852cu.c b/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
index 2dec9b8454815..6f852f4a713e1 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
@@ -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);
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922au.c b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
index 56c79b1ec865f..2cd2b76d19acf 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
@@ -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);
diff --git a/drivers/net/wireless/realtek/rtw89/usb.c b/drivers/net/wireless/realtek/rtw89/usb.c
index 22a1a988f3073..8dc2c93e502ee 100644
--- a/drivers/net/wireless/realtek/rtw89/usb.c
+++ b/drivers/net/wireless/realtek/rtw89/usb.c
@@ -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);
diff --git a/drivers/net/wireless/realtek/rtw89/usb.h b/drivers/net/wireless/realtek/rtw89/usb.h
index bdf3125597438..d2af29d068f19 100644
--- a/drivers/net/wireless/realtek/rtw89/usb.h
+++ b/drivers/net/wireless/realtek/rtw89/usb.h
@@ -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
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0026/1005] wifi: rtw89: 8922au: Add support for TP-Link TBE400U
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0025/1005] wifi: rtw89: usb: Avoid crash with dynamically added device ID Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0027/1005] wifi: rtw89: 8922au: add ASUS BE93 Greg Kroah-Hartman
                   ` (347 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Nick Venenga, Ping-Ke Shih,
	Sasha Levin

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

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

From: Nick Venenga <nick@venenga.com>

[ 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

Signed-off-by: Nick Venenga <nick@venenga.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/010f01a04e02d70c-a52abf35-2e60-47a5-99f5-b064b344ac19-000000@us-east-2.amazonses.com
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtw89/rtw8922au.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922au.c b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
index 2cd2b76d19acf..7854e6aca749d 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
@@ -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),
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0027/1005] wifi: rtw89: 8922au: add ASUS BE93
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0026/1005] wifi: rtw89: 8922au: Add support for TP-Link TBE400U Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0028/1005] 9p: use fc->net_ns for network namespace in RDMA and socket transports Greg Kroah-Hartman
                   ` (346 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Ping-Ke Shih, Nick Venenga,
	Sasha Levin

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

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

From: Nick Venenga <nick@venenga.com>

[ Upstream commit 475539db19530b7e134f58555e1afcae21d419f3 ]

ASUS USB-BE93 Mini USB-C adapter
Originally added and tested here https://github.com/morrownr/rtw89/pull/121

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Nick Venenga <nick@venenga.com>
Link: https://patch.msgid.link/010f01a05fa084ba-80349068-cd1f-4e4e-99f5-8cf6f4c03216-000000@us-east-2.amazonses.com
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtw89/rtw8922au.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922au.c b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
index 7854e6aca749d..b146bd79c675e 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
@@ -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),
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0028/1005] 9p: use fc->net_ns for network namespace in RDMA and socket transports
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0027/1005] wifi: rtw89: 8922au: add ASUS BE93 Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0029/1005] net/9p/usbg: fix descriptor cleanup use-after-free Greg Kroah-Hartman
                   ` (345 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yizhou Zhao, Yuxiang Yang, Ao Wang,
	Xuewei Feng, Qi Li, Ke Xu, Dominique Martinet, Sasha Levin

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

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

From: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>

[ 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")
Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Reported-by: Ao Wang <wangao@seu.edu.cn>
Reported-by: Xuewei Feng <fengxw06@126.com>
Reported-by: Qi Li <qli01@tsinghua.edu.cn>
Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
Suggested-by: Dominique Martinet <asmadeus@codewreck.org>
Assisted-by: GLM:GLM-5.1
Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Message-ID: <20260529090625.78761-1-zhaoyz24@mails.tsinghua.edu.cn>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/9p/trans_fd.c   | 11 +++++------
 net/9p/trans_rdma.c |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index eb685b52aeb26..dce963332a046 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -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));
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index b4274f10fa448..f4450e779a791 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0029/1005] net/9p/usbg: fix descriptor cleanup use-after-free
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0028/1005] 9p: use fc->net_ns for network namespace in RDMA and socket transports Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0030/1005] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx Greg Kroah-Hartman
                   ` (344 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yizhou Zhao, Yuxiang Yang, Ao Wang,
	Xuewei Feng, Qi Li, Ke Xu, Chengfeng Ye, Michael Grzeschik,
	Dominique Martinet, Sasha Levin

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

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

From: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>

[ 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")
Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Reported-by: Ao Wang <wangao@seu.edu.cn>
Reported-by: Xuewei Feng <fengxw06@126.com>
Reported-by: Qi Li <qli01@tsinghua.edu.cn>
Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
Assisted-by: GLM:GLM-5.1
Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Co-developed-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Acked-by: Michael Grzeschik <mgr@kernel.org>
Message-ID: <20260529081817.77898-1-zhaoyz24@mails.tsinghua.edu.cn>
Message-ID: <20260731150414.3135662-1-nicoyip.dev@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/9p/trans_usbg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/9p/trans_usbg.c b/net/9p/trans_usbg.c
index 7d600e1288a30..6bc7de04bd514 100644
--- a/net/9p/trans_usbg.c
+++ b/net/9p/trans_usbg.c
@@ -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,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0030/1005] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0029/1005] net/9p/usbg: fix descriptor cleanup use-after-free Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0031/1005] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
                   ` (343 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yizhou Zhao, Yuxiang Yang, Ao Wang,
	Xuewei Feng, Qi Li, Ke Xu, Michael Grzeschik, Dominique Martinet,
	Sasha Levin

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

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

From: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>

[ 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")
Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Reported-by: Ao Wang <wangao@seu.edu.cn>
Reported-by: Xuewei Feng <fengxw06@126.com>
Reported-by: Qi Li <qli01@tsinghua.edu.cn>
Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
Assisted-by: GLM:GLM-5.1
Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Message-ID: <20260529081026.77732-1-zhaoyz24@mails.tsinghua.edu.cn>
Acked-by: Michael Grzeschik <mgr@kernel.org>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/9p/trans_usbg.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/9p/trans_usbg.c b/net/9p/trans_usbg.c
index 6bc7de04bd514..45b0ea594211c 100644
--- a/net/9p/trans_usbg.c
+++ b/net/9p/trans_usbg.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0031/1005] 9p: skip intermediate directory entry name copy in p9dirent_read()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0030/1005] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0032/1005] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
                   ` (342 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Haobin Wu, Christian Schoenebeck,
	Dominique Martinet, Sasha Levin

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

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

From: Haobin Wu <853555@gmail.com>

[ 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")
Closes: https://github.com/microsoft/WSL/issues/41192
Signed-off-by: Haobin Wu <853555@gmail.com>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Message-ID: <20260918024851.51229-2-853555@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/9p/vfs_dir.c         |  6 +++++-
 include/net/9p/client.h |  2 +-
 net/9p/protocol.c       | 12 ++----------
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 323f85352f6a4..733ec42258bc6 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -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;
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 55c6cb54bd254..0a1de81c8cd8b 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -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;
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 67b0586d807f9..d4335884e0c08 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -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;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0032/1005] xfrm: zero-initialise km_event in the replay-notify path
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0031/1005] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0033/1005] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
                   ` (341 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Giovanni Vignone, Shubham Antil,
	Steffen Klassert, Sasha Levin

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

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

From: Shubham Antil <shubham@octane.security>

[ 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")
Reported-by: Giovanni Vignone <gio@octane.security>
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Shubham Antil <shubham@octane.security>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/xfrm/xfrm_replay.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index dbdf8a39dffee..9394953247ab9 100644
--- a/net/xfrm/xfrm_replay.c
+++ b/net/xfrm/xfrm_replay.c
@@ -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;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0033/1005] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0032/1005] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0034/1005] xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups Greg Kroah-Hartman
                   ` (340 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+a079f084653164a652d1,
	Deepanshu Kartikey, Sven Eckelmann, Sasha Levin

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

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

From: Deepanshu Kartikey <kartikey406@gmail.com>

[ 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: syzbot+a079f084653164a652d1@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a079f084653164a652d1
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/batman-adv/bat_iv_ogm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 1c2ab79adabc2..084970404d3e5 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -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;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0034/1005] xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (32 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0033/1005] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0035/1005] xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state() Greg Kroah-Hartman
                   ` (339 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Antony Antony, Steffen Klassert,
	Sasha Levin

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

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

From: Antony Antony <antony.antony@secunet.com>

[ 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")
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/xfrm.h    |  3 +++
 net/xfrm/xfrm_state.c | 56 +++++++++++++++++++++++++++++++++++--------
 net/xfrm/xfrm_user.c  | 29 +++++++++++-----------
 3 files changed, 64 insertions(+), 24 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 298ca9bb00835..1cc76a0d73224 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -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);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index e45aa1ed5b965..7c5724fab4894 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1177,11 +1177,19 @@ static struct xfrm_state *__xfrm_state_lookup_all(const struct xfrm_hash_state_p
 	return NULL;
 }
 
-static struct xfrm_state *__xfrm_state_lookup(const struct xfrm_hash_state_ptrs *state_ptrs,
-					      u32 mark,
-					      const xfrm_address_t *daddr,
-					      __be32 spi, u8 proto,
-					      unsigned short family)
+static bool xfrm_state_mark_matches(const struct xfrm_state *x, u32 mark, u32 mask, bool exact)
+{
+	if (exact)
+		return x->mark.v == mark && x->mark.m == mask;
+	return (mark & x->mark.m) == x->mark.v;
+}
+
+static struct xfrm_state *
+__xfrm_state_lookup(const struct xfrm_hash_state_ptrs *state_ptrs,
+		    u32 mark, u32 mask, bool exact,
+		    const xfrm_address_t *daddr,
+		    __be32 spi, u8 proto,
+		    unsigned short family)
 {
 	unsigned int h = __xfrm_spi_hash(daddr, spi, proto, family, state_ptrs->hmask);
 	struct xfrm_state *x;
@@ -1193,7 +1201,7 @@ static struct xfrm_state *__xfrm_state_lookup(const struct xfrm_hash_state_ptrs
 		    !xfrm_addr_equal(&x->id.daddr, daddr, family))
 			continue;
 
-		if ((mark & x->mark.m) != x->mark.v)
+		if (!xfrm_state_mark_matches(x, mark, mask, exact))
 			continue;
 		if (!xfrm_state_hold_rcu(x))
 			continue;
@@ -1203,6 +1211,17 @@ static struct xfrm_state *__xfrm_state_lookup(const struct xfrm_hash_state_ptrs
 	return NULL;
 }
 
+static struct xfrm_state *
+__xfrm_state_lookup_exact(const struct xfrm_hash_state_ptrs *state_ptrs,
+			  const struct xfrm_mark *mark,
+			  const xfrm_address_t *daddr,
+			  __be32 spi, u8 proto,
+			  unsigned short family)
+{
+	return __xfrm_state_lookup(state_ptrs, mark->v, mark->m, true,
+				   daddr, spi, proto, family);
+}
+
 struct xfrm_state *xfrm_input_state_lookup(struct net *net, u32 mark,
 					   const xfrm_address_t *daddr,
 					   __be32 spi, u8 proto,
@@ -1233,7 +1252,7 @@ struct xfrm_state *xfrm_input_state_lookup(struct net *net, u32 mark,
 
 	xfrm_hash_ptrs_get(net, &state_ptrs);
 
-	x = __xfrm_state_lookup(&state_ptrs, mark, daddr, spi, proto, family);
+	x = __xfrm_state_lookup(&state_ptrs, mark, 0, false, daddr, spi, proto, family);
 	if (x) {
 		spin_lock(&net->xfrm.xfrm_state_lock);
 		if (x->km.state != XFRM_STATE_VALID) {
@@ -1283,7 +1302,7 @@ static struct xfrm_state *__xfrm_state_lookup_byaddr(const struct xfrm_hash_stat
 	return NULL;
 }
 
-static inline struct xfrm_state *
+static struct xfrm_state *
 __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family)
 {
 	struct xfrm_hash_state_ptrs state_ptrs;
@@ -1293,7 +1312,7 @@ __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family)
 	xfrm_hash_ptrs_get(net, &state_ptrs);
 
 	if (use_spi)
-		return __xfrm_state_lookup(&state_ptrs, mark, &x->id.daddr,
+		return __xfrm_state_lookup(&state_ptrs, mark, 0, false, &x->id.daddr,
 					   x->id.spi, x->id.proto, family);
 	else
 		return __xfrm_state_lookup_byaddr(&state_ptrs, mark,
@@ -2383,7 +2402,7 @@ xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32
 	rcu_read_lock();
 	xfrm_hash_ptrs_get(net, &state_ptrs);
 
-	x = __xfrm_state_lookup(&state_ptrs, mark, daddr, spi, proto, family);
+	x = __xfrm_state_lookup(&state_ptrs, mark, 0, false, daddr, spi, proto, family);
 	rcu_read_unlock();
 	return x;
 }
@@ -2407,6 +2426,23 @@ xfrm_state_lookup_byaddr(struct net *net, u32 mark,
 }
 EXPORT_SYMBOL(xfrm_state_lookup_byaddr);
 
+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)
+{
+	struct xfrm_hash_state_ptrs state_ptrs;
+	struct xfrm_state *x;
+
+	rcu_read_lock();
+	xfrm_hash_ptrs_get(net, &state_ptrs);
+
+	x = __xfrm_state_lookup_exact(&state_ptrs, mark, daddr, spi, proto, family);
+	rcu_read_unlock();
+	return x;
+}
+EXPORT_SYMBOL(xfrm_state_lookup_exact);
+
 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,
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index a2587c7e796b4..fffce22389e88 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0035/1005] xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (33 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0034/1005] xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0036/1005] xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path Greg Kroah-Hartman
                   ` (338 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Antony Antony,
	Steffen Klassert, Sasha Levin

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

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

From: Antony Antony <antony.antony@secunet.com>

[ 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")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/xfrm/xfrm_user.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index fffce22389e88..48b8a0af95e25 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0036/1005] xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (34 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0035/1005] xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state() Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0037/1005] xfrm: include mark in MIGRATE_STATE SA collision check Greg Kroah-Hartman
                   ` (337 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Antony Antony,
	Steffen Klassert, Sasha Levin

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

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

From: Antony Antony <antony.antony@secunet.com>

[ 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")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/xfrm/xfrm_user.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 48b8a0af95e25..aac12991d2ca8 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0037/1005] xfrm: include mark in MIGRATE_STATE SA collision check
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (35 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0036/1005] xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0038/1005] xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state() Greg Kroah-Hartman
                   ` (336 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Antony Antony,
	Steffen Klassert, Sasha Levin

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

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

From: Antony Antony <antony.antony@secunet.com>

[ 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")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/xfrm.h    |  4 ++++
 net/xfrm/xfrm_state.c | 40 +++++++++++++++++++++++++++++++++++++---
 net/xfrm/xfrm_user.c  | 17 ++++++++---------
 3 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 1cc76a0d73224..445223a8dc6f1 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -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);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 7c5724fab4894..d340dc9d73461 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -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,
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index aac12991d2ca8..f8c2b17c6f2b7 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0038/1005] xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (36 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0037/1005] xfrm: include mark in MIGRATE_STATE SA collision check Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0039/1005] docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple Greg Kroah-Hartman
                   ` (335 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Antony Antony, Steffen Klassert,
	Sasha Levin

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

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

From: Antony Antony <antony.antony@secunet.com>

[ 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")
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/xfrm/xfrm_state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index d340dc9d73461..5b241dfcae62b 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -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;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0039/1005] docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (37 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0038/1005] xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state() Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0040/1005] drm/panic: Accept a trailing newline in panic_screen Greg Kroah-Hartman
                   ` (334 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Antony Antony, Steffen Klassert,
	Sasha Levin

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

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

From: Antony Antony <antony.antony@secunet.com>

[ 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")
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../networking/xfrm/xfrm_migrate_state.rst    | 25 +++++++++++++------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/Documentation/networking/xfrm/xfrm_migrate_state.rst b/Documentation/networking/xfrm/xfrm_migrate_state.rst
index 9d53cb22b0075..ca2c9e5aaf33a 100644
--- a/Documentation/networking/xfrm/xfrm_migrate_state.rst
+++ b/Documentation/networking/xfrm/xfrm_migrate_state.rst
@@ -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.
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0040/1005] drm/panic: Accept a trailing newline in panic_screen
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (38 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0039/1005] docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:22 ` [PATCH 7.3 0041/1005] wifi: wext: Limit notifier event flushes to the devices netns Greg Kroah-Hartman
                   ` (333 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Jocelyn Falempe,
	Tvrtko Ursulin, Sasha Levin

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

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

From: Devin Wittmayer <lucid_duck@justthetip.ca>

[ 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.

Fixes: e85e9ccf3f84 ("drm/panic: Report invalid or unsupported panic modes")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://patch.msgid.link/20261016052722.60051-2-lucid_duck@justthetip.ca
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/drm_panic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index fef47625c5268..1dca0b05e9240 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -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;
 		}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0041/1005] wifi: wext: Limit notifier event flushes to the devices netns
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (39 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0040/1005] drm/panic: Accept a trailing newline in panic_screen Greg Kroah-Hartman
@ 2026-11-25 14:22 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0042/1005] fsnotify: preserve 64-bit pre-content ranges Greg Kroah-Hartman
                   ` (332 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Johannes Berg,
	Sasha Levin

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

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

From: Cosmin Ratiu <cratiu@nvidia.com>

[ 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")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Link: https://patch.msgid.link/20261021144111.611840-1-cratiu@nvidia.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/iw_handler.h |  8 +++++---
 net/wireless/core.c      |  2 +-
 net/wireless/wext-core.c | 33 +++++++++++++++++----------------
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index b80e474cb0aa9..632618d9ff937 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -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.
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 3ac3b2a67a9c9..625cb2c2a05a5 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -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;
 }
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
index db77912b3994b..f09c589ff94cd 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0042/1005] fsnotify: preserve 64-bit pre-content ranges
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (40 preceding siblings ...)
  2026-11-25 14:22 ` [PATCH 7.3 0041/1005] wifi: wext: Limit notifier event flushes to the devices netns Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0043/1005] wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers Greg Kroah-Hartman
                   ` (331 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Jan Kara, Sasha Levin

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

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

From: Avi Weiss <thnkslprpt@gmail.com>

[ 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")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20261015175701.3674449-1-thnkslprpt@gmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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(-)

diff --git a/fs/notify/fanotify/fanotify.h b/fs/notify/fanotify/fanotify.h
index 87ba788574bff..c25cf5c1fc70f 100644
--- a/fs/notify/fanotify/fanotify.h
+++ b/fs/notify/fanotify/fanotify.h
@@ -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? */
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 7e2f330fd2837..8657bb94dfa8b 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -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;
 
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index bda798bc67bc5..a4a29b3650080 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -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;
 }
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index a6d5c1a89cffa..faf21564380d9 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -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;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0043/1005] wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (41 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0042/1005] fsnotify: preserve 64-bit pre-content ranges Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0044/1005] wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect Greg Kroah-Hartman
                   ` (330 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vasanthakumar Thiagarajan,
	Baochen Qiang, Lorenzo Bianconi, Jeff Johnson, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ 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

Fixes: e8a1e49c6328 ("wifi: ath12k: Add new infra for the rx path")
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261015-ath12k-fix-descap-multiple-rx-buf-v2-1-4cde055677ed@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../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(-)

diff --git a/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c b/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c
index 7cf00fda996f3..7ea7559e882c2 100644
--- a/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c
+++ b/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c
@@ -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)
diff --git a/drivers/net/wireless/ath/ath12k/wifi7/hal_qcn9274.c b/drivers/net/wireless/ath/ath12k/wifi7/hal_qcn9274.c
index 052b59265af85..355cf50d2785f 100644
--- a/drivers/net/wireless/ath/ath12k/wifi7/hal_qcn9274.c
+++ b/drivers/net/wireless/ath/ath12k/wifi7/hal_qcn9274.c
@@ -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)
diff --git a/drivers/net/wireless/ath/ath12k/wifi7/hal_wcn7850.c b/drivers/net/wireless/ath/ath12k/wifi7/hal_wcn7850.c
index 61be8443e46ee..abe982faeb2b7 100644
--- a/drivers/net/wireless/ath/ath12k/wifi7/hal_wcn7850.c
+++ b/drivers/net/wireless/ath/ath12k/wifi7/hal_wcn7850.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0044/1005] wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (42 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0043/1005] wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0045/1005] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
                   ` (329 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Miaoqing Pan, Rameshkumar Sundaram,
	Baochen Qiang, Jeff Johnson, Sasha Levin

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

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

From: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>

[ 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")
Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915080053.918500-1-miaoqing.pan@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/ath12k/mac.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 56578321e88c6..b5c3519065a2a 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -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:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0045/1005] wifi: ath9k_htc: start ANI when an AP interface begins to beacon
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (43 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0044/1005] wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0046/1005] ntfs: Fix error handling in __ntfs_create() Greg Kroah-Hartman
                   ` (328 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mehmet Fide,
	Toke Høiland-Jørgensen, Jeff Johnson, Sasha Levin

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

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

From: Mehmet Fide <mehmet.fide@screeningeagle.com>

[ 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.

Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode")
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20261005072209.4101009-3-mehmet.fide@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 0d6272ac0dac8..611d17202eba2 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -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) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0046/1005] ntfs: Fix error handling in __ntfs_create()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (44 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0045/1005] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0047/1005] printk_ringbuffer: Fix space_used() when blk_lpos->next overflows Greg Kroah-Hartman
                   ` (327 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bart Van Assche, Hyunchul Lee,
	Namjae Jeon, Sasha Levin

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

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

From: Bart Van Assche <bvanassche@acm.org>

[ 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")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ntfs/namei.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index 3e0adb9a0ea42..850555bc22b22 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -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
 	{
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0047/1005] printk_ringbuffer: Fix space_used() when blk_lpos->next overflows
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (45 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0046/1005] ntfs: Fix error handling in __ntfs_create() Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0048/1005] dma-buf: Restore the scatterlist entry count before freeing Greg Kroah-Hartman
                   ` (326 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Wang Wensheng, John Ogness,
	Petr Mladek, Sasha Levin

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

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

From: Wang Wensheng <wsw9603@163.com>

[ 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")
Signed-off-by: Wang Wensheng <wsw9603@163.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://patch.msgid.link/20261004075755.363989-1-wsw9603@163.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/printk/printk_ringbuffer.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/printk/printk_ringbuffer.c b/kernel/printk/printk_ringbuffer.c
index 85c0c854b3ce2..1b0198317a2fc 100644
--- a/kernel/printk/printk_ringbuffer.c
+++ b/kernel/printk/printk_ringbuffer.c
@@ -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
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0048/1005] dma-buf: Restore the scatterlist entry count before freeing
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (46 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0047/1005] printk_ringbuffer: Fix space_used() when blk_lpos->next overflows Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0049/1005] dma-buf: keep the DMA flags in the DMABUF_DEBUG copy Greg Kroah-Hartman
                   ` (325 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Leon Romanovsky, Jason Gunthorpe,
	Christian König, Sasha Levin

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

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

From: Leon Romanovsky <leonro@nvidia.com>

[ 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")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20261013-dma-buf-fixes-v1-1-0e2d9ca41f3a@nvidia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/dma-buf/dma-buf-mapping.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma-buf/dma-buf-mapping.c b/drivers/dma-buf/dma-buf-mapping.c
index ef0f22854d018..e1e9c93127b51 100644
--- a/drivers/dma-buf/dma-buf-mapping.c
+++ b/drivers/dma-buf/dma-buf-mapping.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0049/1005] dma-buf: keep the DMA flags in the DMABUF_DEBUG copy
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (47 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0048/1005] dma-buf: Restore the scatterlist entry count before freeing Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0050/1005] dma-buf: validate the attachment before asserting its reservation lock Greg Kroah-Hartman
                   ` (324 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Karl Mehltretter,
	Christian König, Sasha Levin

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

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

From: Karl Mehltretter <kmehltretter@gmail.com>

[ 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")
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20261005064133.7305-2-kmehltretter@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/dma-buf/dma-buf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 4c9add51f9ef5..b3d311acb8838 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -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);
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0050/1005] dma-buf: validate the attachment before asserting its reservation lock
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (48 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0049/1005] dma-buf: keep the DMA flags in the DMABUF_DEBUG copy Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0051/1005] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
                   ` (323 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, T.J. Mercier, Christian König,
	Davidlohr Bueso, Sasha Levin

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

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

From: Davidlohr Bueso <dave@stgolabs.net>

[ 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")
Reviewed-by: T.J. Mercier <tjmercier@google.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20260928195850.1982569-2-dave@stgolabs.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/dma-buf/dma-buf-mapping.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma-buf/dma-buf-mapping.c b/drivers/dma-buf/dma-buf-mapping.c
index e1e9c93127b51..5167cda7ea216 100644
--- a/drivers/dma-buf/dma-buf-mapping.c
+++ b/drivers/dma-buf/dma-buf-mapping.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0051/1005] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (49 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0050/1005] dma-buf: validate the attachment before asserting its reservation lock Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0052/1005] scsi: scsi_debug: Drain target cleanup before module exit Greg Kroah-Hartman
                   ` (322 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Imre Kaloz,
	Martin K. Petersen (Oracle), Sasha Levin

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

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

From: Imre Kaloz <kaloz@kernel.org>

[ 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.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
Link: https://patch.msgid.link/20261013094253.2956-1-kaloz@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 8ad82171e925d..af6115bfb2808 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -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;
 
 			/*
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0052/1005] scsi: scsi_debug: Drain target cleanup before module exit
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (50 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0051/1005] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0053/1005] scsi: core: Balance the pseudo target reap reference Greg Kroah-Hartman
                   ` (321 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli,
	Martin K. Petersen (Oracle), Sasha Levin

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

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

From: Giuseppe Piscitelli <ooonea@gmail.com>

[ 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")
Signed-off-by: Giuseppe Piscitelli <ooonea@gmail.com>
Link: https://patch.msgid.link/20261026202342.668361-1-ooonea@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/scsi_debug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 8290feadc212b..232b4eccd5a11 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -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);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0053/1005] scsi: core: Balance the pseudo target reap reference
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (51 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0052/1005] scsi: scsi_debug: Drain target cleanup before module exit Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0054/1005] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
                   ` (320 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli, Bart Van Assche,
	Martin K. Petersen (Oracle), Sasha Levin

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

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

From: Giuseppe Piscitelli <ooonea@gmail.com>

[ 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.

Fixes: d630fbf6fc8c ("scsi: core: Support allocating a pseudo SCSI device")
Signed-off-by: Giuseppe Piscitelli <ooonea@gmail.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20261027100859.1031135-1-ooonea@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/scsi_scan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 6cd77b0592e45..53a0af2104ef0 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -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);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0054/1005] scsi: aha1542: Remove unneeded scsi_dma_unmap() call
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (52 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0053/1005] scsi: core: Balance the pseudo target reap reference Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0055/1005] 9p: treat read return values of 0 as EOF Greg Kroah-Hartman
                   ` (319 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Laurence Oberman, Matthew Whitehead,
	Martin K. Petersen (Oracle), Sasha Levin

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

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

From: Matthew Whitehead <tedheadster@gmail.com>

[ 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.

Fixes: 2f2fef022c3e ("aha1542: use a local bounce buffer")
Suggested-by: Laurence Oberman <loberman@redhat.com>
Assisted-by: LLM
Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Link: https://patch.msgid.link/20260929144528.7061-1-tedheadster@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/aha1542.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 93dab19c1cb95..1cd85da47cc9c 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0055/1005] 9p: treat read return values of 0 as EOF
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (53 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0054/1005] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0056/1005] 9p: fix kernel-doc warning for enum p9_session_flags Greg Kroah-Hartman
                   ` (318 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Barret Rhoden, Dominique Martinet,
	Sasha Levin

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

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

From: Barret Rhoden <brho@google.com>

[ 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:
	git@github.com: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")
Signed-off-by: Barret Rhoden <brho@google.com>
Message-ID: <20260702090941.1298188-1-brho@google.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/9p/vfs_addr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 13cf87a5f90cb..a48cc34b9a23a 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0056/1005] 9p: fix kernel-doc warning for enum p9_session_flags
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (54 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0055/1005] 9p: treat read return values of 0 as EOF Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0057/1005] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
                   ` (317 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Omokefe Emmanuel Onanaroghene,
	Dominique Martinet, Sasha Levin

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

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

From: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>

[ 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
Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
Message-ID: <20261002035837.39703-1-emmaonana18@gmail.com>
[Dominique: slight reword, also fixed typo in Doc/ for access=client]
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Documentation/filesystems/9p.rst |  2 +-
 fs/9p/v9fs.h                     | 26 ++++++++++++++++++--------
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/Documentation/filesystems/9p.rst b/Documentation/filesystems/9p.rst
index 3f65db648db06..dc1f5f9632d8d 100644
--- a/Documentation/filesystems/9p.rst
+++ b/Documentation/filesystems/9p.rst
@@ -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
 
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h
index 2ac863dc8446c..9a730d2d9d87d 100644
--- a/fs/9p/v9fs.h
+++ b/fs/9p/v9fs.h
@@ -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
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0057/1005] 9p: fall back to the normal open path for non-regular files
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (55 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0056/1005] 9p: fix kernel-doc warning for enum p9_session_flags Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0058/1005] 9p: do not store the create fid on special files Greg Kroah-Hartman
                   ` (316 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yuanfu Xie, Dominique Martinet,
	Sasha Levin

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

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

From: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>

[ 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")
Signed-off-by: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
Message-ID: <908FC420-EC1F-46FC-8526-698F646961A8@stu.pku.edu.cn>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/9p/vfs_inode.c      | 10 ++++++++++
 fs/9p/vfs_inode_dotl.c | 12 ++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 2d7e0c1a5353a..347739b81513f 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -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);
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 116b29e95f21e..1431549b1f4d8 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0058/1005] 9p: do not store the create fid on special files
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (56 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0057/1005] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0059/1005] ntfs: initialize VCN when inserting index entries Greg Kroah-Hartman
                   ` (315 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yuanfu Xie, Dominique Martinet,
	Sasha Levin

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

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

From: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>

[ 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")
Signed-off-by: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
Message-ID: <92377346-29E9-46D3-96F5-AABA8A64CD57@stu.pku.edu.cn>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/9p/vfs_inode_dotl.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 1431549b1f4d8..d9156b2509aca 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0059/1005] ntfs: initialize VCN when inserting index entries
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (57 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0058/1005] 9p: do not store the create fid on special files Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0060/1005] ntfs: avoid overflow when limiting attribute read length Greg Kroah-Hartman
                   ` (314 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Hyunchul Lee, Namjae Jeon,
	Sasha Levin

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

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

From: Hyunchul Lee <hyc.lee@gmail.com>

[ 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")
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ntfs/index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c
index 9a23d0786959b..9309e617451e1 100644
--- a/fs/ntfs/index.c
+++ b/fs/ntfs/index.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0060/1005] ntfs: avoid overflow when limiting attribute read length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (58 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0059/1005] ntfs: initialize VCN when inserting index entries Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0061/1005] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
                   ` (313 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hyunchul Lee, Baolin Liu,
	Namjae Jeon, Sasha Levin

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

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

From: Hyunchul Lee <hyc.lee@gmail.com>

[ 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")
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ntfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index 64c415edc398c..907fe8ecb2a30 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -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)) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0061/1005] wifi: ath10k: Stop unanswered temperature reads
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (59 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0060/1005] ntfs: avoid overflow when limiting attribute read length Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0062/1005] wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler Greg Kroah-Hartman
                   ` (312 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Filippo Falezza, Loic Poulain,
	Jeff Johnson, Sasha Levin

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

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

From: Filippo Falezza <effeffe99@gmail.com>

[ 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")
Signed-off-by: Filippo Falezza <effeffe99@gmail.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-ath10k-temperature-v2-1-0793e80d73bc@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 7c2939cbde5f0..a749ae582b0a4 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -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)) {
diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index 9bb486f8e9207..9ff7de0abd129 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -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;
 	}
diff --git a/drivers/net/wireless/ath/ath10k/thermal.h b/drivers/net/wireless/ath/ath10k/thermal.h
index 1f4de9fbf2b30..d1fb5b958c37c 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.h
+++ b/drivers/net/wireless/ath/ath10k/thermal.h
@@ -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
 	 */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0062/1005] wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (60 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0061/1005] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0063/1005] wifi: ath12k: set MSDU payload correctly Greg Kroah-Hartman
                   ` (311 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, P Praneesh, Karthikeyan Periyasamy,
	Baochen Qiang, Jeff Johnson, Sasha Levin

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

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

From: P Praneesh <praneesh.p@oss.qualcomm.com>

[ 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

Fixes: 6cee30f0da75 ("wifi: ath12k: add AHB driver support for IPQ5332")
Signed-off-by: P Praneesh <praneesh.p@oss.qualcomm.com>
Reviewed-by: Karthikeyan Periyasamy <karthikeyan.periyasamy@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20261015084445.3045925-1-praneesh.p@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/ath12k/ahb.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
index df79f15c1ccae..31009313e07b8 100644
--- a/drivers/net/wireless/ath/ath12k/ahb.c
+++ b/drivers/net/wireless/ath/ath12k/ahb.c
@@ -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;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0063/1005] wifi: ath12k: set MSDU payload correctly
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (61 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0062/1005] wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0064/1005] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
                   ` (310 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kang Yang, Baochen Qiang,
	Vasanthakumar Thiagarajan, Jeff Johnson, Sasha Levin

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

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

From: Kang Yang <kang.yang@oss.qualcomm.com>

[ 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

Fixes: 1cf514fdc790 ("wifi: ath12k: use different packet offset for WCN7850")
Signed-off-by: Kang Yang <kang.yang@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20261020-msdupayload-v1-1-1ca9a5936727@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/ath12k/dp_mon.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index db20d27b63338..fdbdad72a3c9f 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0064/1005] seg6: fix transport header for inner IPv4 with IP options
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (62 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0063/1005] wifi: ath12k: set MSDU payload correctly Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0065/1005] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes Greg Kroah-Hartman
                   ` (309 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hazley Samsudin, David Ahern,
	Hangbin Liu, Andrea Mayer, Jakub Kicinski, Sasha Levin

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

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

From: Andrea Mayer <andrea.mayer@uniroma2.it>

[ 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")
Reported-by: Hazley Samsudin <hazleycryilis@gmail.com>
Closes: https://lore.kernel.org/netdev/20260809221915.2ffc1ecd0f445fcb70270e31@uniroma2.it/
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Link: https://patch.msgid.link/20261028171511.35-1-andrea.mayer@uniroma2.it
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/seg6_local.c | 69 +++++++++++++++++++++++++++++++++----------
 1 file changed, 53 insertions(+), 16 deletions(-)

diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 0c3d1be7f1299..0d952514d095b 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -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 */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0065/1005] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (63 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0064/1005] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0066/1005] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
                   ` (308 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, kernel test robot, Matt Coster,
	Luigi Santivetti, Michal Wilczynski, Alessio Belle, Sasha Levin

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

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

From: Michal Wilczynski <m.wilczynski@samsung.com>

[ 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.

Fixes: a26f067feac1 ("drm/imagination: Add FWIF headers")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512131851.1WNXk3BC-lkp@intel.com/
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20261029-fix_imagination-v4-1-689745dd52ef@samsung.com
Signed-off-by: Alessio Belle <alessio.belle@imgtec.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/imagination/pvr_rogue_fwif.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imagination/pvr_rogue_fwif.h b/drivers/gpu/drm/imagination/pvr_rogue_fwif.h
index 5d590c4c25663..2f8daa93c9e68 100644
--- a/drivers/gpu/drm/imagination/pvr_rogue_fwif.h
+++ b/drivers/gpu/drm/imagination/pvr_rogue_fwif.h
@@ -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);
 
 /*
  ******************************************************************************
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0066/1005] gpio: omap: Propagate runtime PM failures in probe and request
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (64 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0065/1005] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0067/1005] x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address Greg Kroah-Hartman
                   ` (307 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Avi Weiss, Bartosz Golaszewski,
	Sasha Levin

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

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

From: Avi Weiss <thnkslprpt@gmail.com>

[ 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")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20261029103626.1527919-2-thnkslprpt@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-omap.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 005420baecf4d..98a88dfda1954 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0067/1005] x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (65 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0066/1005] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0068/1005] bpf: Fix jited line info off by the CFI preamble Greg Kroah-Hartman
                   ` (306 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Steven Rostedt, Daniel Borkmann,
	Alexei Starovoitov, Jiri Olsa, Sasha Levin

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

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

From: Daniel Borkmann <daniel@iogearbox.net>

[ 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.

Fixes: 0c3772a8db1f ("x86/ftrace: Implement DYNAMIC_FTRACE_WITH_JMP")
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Link: https://patch.msgid.link/20261028202345.1215859-1-daniel@iogearbox.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/kernel/ftrace_64.S | 6 +++---
 include/linux/ftrace.h      | 8 +++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S
index 62c1c93aa1c6a..4b20673a33959 100644
--- a/arch/x86/kernel/ftrace_64.S
+++ b/arch/x86/kernel/ftrace_64.S
@@ -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 */
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index b041d9142d2b8..1c2056a1a68b3 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0068/1005] bpf: Fix jited line info off by the CFI preamble
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (66 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0067/1005] x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0069/1005] sched_ext: Call ops.sub_attach() only while the cgroup is online Greg Kroah-Hartman
                   ` (305 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Alexei Starovoitov,
	Jose Fernandez (Anthropic), Sasha Levin

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

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

From: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>

[ 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")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Reported-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261030-b4-arm64-bpf-linfo-cfi-v2-1-4eac83435d4b@linux.dev
Closes: https://lore.kernel.org/all/20260904014748.C04AA1F000E9@smtp.kernel.org/
Closes: https://lore.kernel.org/all/DLNXZ2WK7TPD.2RZBUNRS4FA4L@gmail.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/s390/net/bpf_jit_comp.c | 2 --
 kernel/bpf/core.c            | 8 +++++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 1b2566012b63a..cddea4580843b 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -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);
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index f4682bcaea9d0..37f6cbfac5113 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -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];
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0069/1005] sched_ext: Call ops.sub_attach() only while the cgroup is online
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (67 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0068/1005] bpf: Fix jited line info off by the CFI preamble Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0070/1005] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
                   ` (304 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Andrea Righi, Sasha Levin

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

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

From: Tejun Heo <tj@kernel.org>

[ 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")
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/ext/internal.h |  4 ++++
 kernel/sched/ext/sub.c      | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/kernel/sched/ext/internal.h b/kernel/sched/ext/internal.h
index 68703b10d8998..2f35b98adb72b 100644
--- a/kernel/sched/ext/internal.h
+++ b/kernel/sched/ext/internal.h
@@ -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);
diff --git a/kernel/sched/ext/sub.c b/kernel/sched/ext/sub.c
index cb75d1912a7b8..4dc3bb12aca3a 100644
--- a/kernel/sched/ext/sub.c
+++ b/kernel/sched/ext/sub.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0070/1005] btrfs: verity: propagate orphan insertion errors when enabling verity
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (68 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0069/1005] sched_ext: Call ops.sub_attach() only while the cgroup is online Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0071/1005] btrfs: fix fiemap merging compressed extents Greg Kroah-Hartman
                   ` (303 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, guolingxing, Qu Wenruo, David Sterba,
	Sasha Levin

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

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

From: guolingxing <guolingxing@tju.edu.cn>

[ 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")
Signed-off-by: guolingxing <guolingxing@tju.edu.cn>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/btrfs/verity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/verity.c b/fs/btrfs/verity.c
index c29d92c3bbc3e..87722e5d41868 100644
--- a/fs/btrfs/verity.c
+++ b/fs/btrfs/verity.c
@@ -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;
 }
 
 /*
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0071/1005] btrfs: fix fiemap merging compressed extents
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (69 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0070/1005] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0072/1005] btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe Greg Kroah-Hartman
                   ` (302 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Filipe Manana,
	David Sterba, Sasha Levin

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

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

From: Filipe Manana <fdmanana@suse.com>

[ 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")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/btrfs/fiemap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/fiemap.c b/fs/btrfs/fiemap.c
index 7a2a971800993..817171028413c 100644
--- a/fs/btrfs/fiemap.c
+++ b/fs/btrfs/fiemap.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0072/1005] btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (70 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0071/1005] btrfs: fix fiemap merging compressed extents Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0073/1005] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
                   ` (301 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Filipe Manana,
	David Sterba, Sasha Levin

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

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

From: Filipe Manana <fdmanana@suse.com>

[ 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")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/btrfs/scrub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 479c0e037015a..ba2e27cc53519 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0073/1005] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (71 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0072/1005] btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0074/1005] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
                   ` (300 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Filipe Manana,
	David Sterba, Sasha Levin

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

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

From: Filipe Manana <fdmanana@suse.com>

[ 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")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/btrfs/scrub.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index ba2e27cc53519..91e441d0ff3cb 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -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);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0074/1005] btrfs: zoned: fix double free of bitmaps on clone failure
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (72 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0073/1005] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0075/1005] bpf: Drop percpu_counter from the htab element count Greg Kroah-Hartman
                   ` (299 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Johannes Thumshirn, Thomas Fourier,
	David Sterba, Sasha Levin

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

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

From: Thomas Fourier <fourier.thomas@gmail.com>

[ 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")
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/btrfs/zoned.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 3b41e964d2096..a64af9d5d2376 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0075/1005] bpf: Drop percpu_counter from the htab element count
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (73 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0074/1005] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0076/1005] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3 Greg Kroah-Hartman
                   ` (298 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Puranjay Mohan,
	Sasha Levin

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

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

From: Puranjay Mohan <puranjay@kernel.org>

[ 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.")
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261021185117.650403-1-puranjay@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/bpf.h  |  2 ++
 kernel/bpf/hashtab.c | 64 ++++++++++++++++++--------------------------
 2 files changed, 28 insertions(+), 38 deletions(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index a628f182bb64c..c4d1053bfe2bf 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -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);
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index b2b27f87d8f55..d41fe658ae847 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -94,10 +94,10 @@ struct bpf_htab {
 		struct bpf_lru lru;
 	};
 	struct htab_elem *__percpu *extra_elems;
-	/* number of elements in non-preallocated hashtable are kept
-	 * in either pcount or count
+	/* number of elements in non-preallocated hashtable. With
+	 * use_percpu_counter it only follows map.elem_count in steps of
+	 * PERCPU_COUNTER_BATCH, see is_map_full()
 	 */
-	struct percpu_counter pcount;
 	atomic_t count;
 	bool use_percpu_counter;
 	u32 n_buckets;	/* number of hash buckets */
@@ -630,29 +630,20 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr)
 
 	htab_init_buckets(htab);
 
-/* compute_batch_value() computes batch value as num_online_cpus() * 2
- * and __percpu_counter_compare() needs
- * htab->max_entries - cur_number_of_elems to be more than batch * num_online_cpus()
- * for percpu_counter to be faster than atomic_t. In practice the average bpf
- * hash map size is 10k, which means that a system with 64 cpus will fill
- * hashmap to 20% of 10k before percpu_counter becomes ineffective. Therefore
- * define our own batch count as 32 then 10k hash map can be filled up to 80%:
+/* is_map_full() needs htab->max_entries - cur_number_of_elems to be more than
+ * batch * nr_cpu_ids for the percpu counter to be faster than atomic_t. In
+ * practice the average bpf hash map size is 10k. With batch count of 32 a 10k
+ * hash map on a system with 64 cpus can be filled up to 80%:
  * 10k - 8k > 32 _batch_ * 64 _cpus_
- * and __percpu_counter_compare() will still be fast. At that point hash map
+ * and is_map_full() will still be fast. At that point hash map
  * collisions will dominate its performance anyway. Assume that hash map filled
  * to 50+% isn't going to be O(1) and use the following formula to choose
- * between percpu_counter and atomic_t.
+ * between the percpu counter and atomic_t. The batch has to be a power of 2.
  */
 #define PERCPU_COUNTER_BATCH 32
-	if (attr->max_entries / 2 > num_online_cpus() * PERCPU_COUNTER_BATCH)
+	if (attr->max_entries / 2 > nr_cpu_ids * PERCPU_COUNTER_BATCH)
 		htab->use_percpu_counter = true;
 
-	if (htab->use_percpu_counter) {
-		err = percpu_counter_init(&htab->pcount, 0, GFP_KERNEL);
-		if (err)
-			goto free_map_locked;
-	}
-
 	if (prealloc) {
 		err = prealloc_init(htab);
 		if (err)
@@ -680,8 +671,6 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr)
 free_prealloc:
 	prealloc_destroy(htab);
 free_map_locked:
-	if (htab->use_percpu_counter)
-		percpu_counter_destroy(&htab->pcount);
 	bpf_map_area_free(htab->buckets);
 	bpf_mem_alloc_destroy(&htab->pcpu_ma);
 	bpf_mem_alloc_destroy(&htab->ma);
@@ -990,30 +979,33 @@ static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l)
 
 static bool is_map_full(struct bpf_htab *htab)
 {
-	if (htab->use_percpu_counter)
-		return __percpu_counter_compare(&htab->pcount, htab->map.max_entries,
-						PERCPU_COUNTER_BATCH) >= 0;
-	return atomic_read(&htab->count) >= htab->map.max_entries;
+	s64 count = atomic_read(&htab->count);
+
+	/* each cpu's elem_count is ahead of count by less than the batch */
+	if (htab->use_percpu_counter &&
+	    count + nr_cpu_ids * PERCPU_COUNTER_BATCH >= htab->map.max_entries)
+		count = bpf_map_sum_elem_count(&htab->map);
+	return count >= htab->map.max_entries;
 }
 
 static void inc_elem_count(struct bpf_htab *htab)
 {
-	bpf_map_inc_elem_count(&htab->map);
+	s64 cnt = this_cpu_inc_return(*htab->map.elem_count);
 
-	if (htab->use_percpu_counter)
-		percpu_counter_add_batch(&htab->pcount, 1, PERCPU_COUNTER_BATCH);
-	else
+	if (!htab->use_percpu_counter)
 		atomic_inc(&htab->count);
+	else if (!(cnt & (PERCPU_COUNTER_BATCH - 1)))
+		atomic_add(PERCPU_COUNTER_BATCH, &htab->count);
 }
 
 static void dec_elem_count(struct bpf_htab *htab)
 {
-	bpf_map_dec_elem_count(&htab->map);
+	s64 cnt = this_cpu_dec_return(*htab->map.elem_count);
 
-	if (htab->use_percpu_counter)
-		percpu_counter_add_batch(&htab->pcount, -1, PERCPU_COUNTER_BATCH);
-	else
+	if (!htab->use_percpu_counter)
 		atomic_dec(&htab->count);
+	else if (!((cnt + 1) & (PERCPU_COUNTER_BATCH - 1)))
+		atomic_sub(PERCPU_COUNTER_BATCH, &htab->count);
 }
 
 static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)
@@ -1682,8 +1674,6 @@ static void htab_map_free(struct bpf_map *map)
 	bpf_map_area_free(htab->buckets);
 	bpf_mem_alloc_destroy(&htab->pcpu_ma);
 	bpf_mem_alloc_destroy(&htab->ma);
-	if (htab->use_percpu_counter)
-		percpu_counter_destroy(&htab->pcount);
 	bpf_map_area_free(htab);
 }
 
@@ -2393,9 +2383,7 @@ static u64 htab_map_mem_usage(const struct bpf_map *map)
 	} else {
 #define LLIST_NODE_SZ sizeof(struct llist_node)
 
-		num_entries = htab->use_percpu_counter ?
-					  percpu_counter_sum(&htab->pcount) :
-					  atomic_read(&htab->count);
+		num_entries = bpf_map_sum_elem_count(map);
 		usage += (htab->elem_size + LLIST_NODE_SZ) * num_entries;
 		if (percpu) {
 			usage += (LLIST_NODE_SZ + sizeof(void *)) * num_entries;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0076/1005] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (74 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0075/1005] bpf: Drop percpu_counter from the htab element count Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0077/1005] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
                   ` (297 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
	Sasha Levin

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

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

From: Zhi-Jun You <hujy652@gmail.com>

[ 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.

Fixes: e2f64db13aa1 ("net: ethernet: mtk_wed: introduce WED support for MT7988")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260711112128.971-1-hujy652@gmail.com?part=1
Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
Link: https://patch.msgid.link/20261026-wedfix-v6-1-a52f6b15d2fc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mediatek/mtk_wed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 53d3b7e00e1cd..d55042ccaff16 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -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)  {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0077/1005] net: ethernet: mtk_wed: fix reset condition for rx wdma
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (75 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0076/1005] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3 Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0078/1005] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
                   ` (296 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
	Sasha Levin

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

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

From: Zhi-Jun You <hujy652@gmail.com>

[ 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.

Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260724172040.1653-1-hujy652%40gmail.com
Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
Link: https://patch.msgid.link/20261026-wedfix-v6-2-a52f6b15d2fc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mediatek/mtk_wed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index d55042ccaff16..3f0be70c3f145 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -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,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0078/1005] net: ethernet: mtk_wed: free up rings during detach
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (76 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0077/1005] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0079/1005] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
                   ` (295 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
	Sasha Levin

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

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

From: Zhi-Jun You <hujy652@gmail.com>

[ 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.

Link: https://github.com/mediatek/mtk-openwrt-feeds/blob/main/25.12/files/target/linux/mediatek/patches-6.12/999-wed-04-Fix-reinsert-wifi-module-cause-memory-leak-issue.patch
Fixes: 4c5de09eb0d0 ("net: ethernet: mtk_wed: add configure wed wo support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/message/179000700034.2160803.10594281691384015089%40kernel.org
Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
Link: https://patch.msgid.link/20261026-wedfix-v6-3-a52f6b15d2fc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mediatek/mtk_wed.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 3f0be70c3f145..3044a7a8ea03e 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -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);
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0079/1005] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (77 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0078/1005] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0080/1005] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
                   ` (294 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhi-Jun You, Jakub Kicinski,
	Sasha Levin

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

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

From: Zhi-Jun You <hujy652@gmail.com>

[ 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")
Signed-off-by: Zhi-Jun You <hujy652@gmail.com>
Link: https://patch.msgid.link/20261026-wedfix-v6-4-a52f6b15d2fc@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mediatek/mtk_wed.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 3044a7a8ea03e..f40ac5794341c 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -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++) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0080/1005] ptp: drain virtual clock sysfs operations before unregistering children
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (78 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0079/1005] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0081/1005] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
                   ` (293 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vadim Fedorenko, James Hilliard,
	Jakub Kicinski, Sasha Levin

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

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

From: James Hilliard <james.hilliard1@gmail.com>

[ 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.")
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-1-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ptp/ptp_clock.c   | 5 +++++
 drivers/ptp/ptp_private.h | 1 +
 drivers/ptp/ptp_sysfs.c   | 6 ++++++
 3 files changed, 12 insertions(+)

diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index 4111342d64f03..47ffc773065a3 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -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);
 	}
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index db4039d642b41..ec8633126d6b8 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -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);
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 7d09256aca724..1b4530be42a20 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -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)
 {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0081/1005] ptp: unwind partially completed virtual clock creation
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (79 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0080/1005] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0082/1005] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
                   ` (292 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
	Sasha Levin

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

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

From: James Hilliard <james.hilliard1@gmail.com>

[ 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")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-2-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ptp/ptp_sysfs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 1b4530be42a20..2d46f69e8c100 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0082/1005] ptp: vclock: propagate physical clock sampling errors
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (80 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0081/1005] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0083/1005] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
                   ` (291 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
	Sasha Levin

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

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

From: James Hilliard <james.hilliard1@gmail.com>

[ 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")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-3-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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(-)

diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index ec8633126d6b8..99e7eb241336e 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -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;
 };
 
 /*
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 2d46f69e8c100..8e0e0aa099815 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -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;
diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c
index 84cb527f59ccc..b97f3a8772602 100644
--- a/drivers/ptp/ptp_vclock.c
+++ b/drivers/ptp/ptp_vclock.c
@@ -4,6 +4,7 @@
  *
  * Copyright 2021 NXP
  */
+#include <linux/jiffies.h>
 #include <linux/slab.h>
 #include <linux/hashtable.h>
 #include "ptp_private.h"
@@ -13,6 +14,7 @@
 #define PTP_VCLOCK_FADJ_SHIFT		9
 #define PTP_VCLOCK_FADJ_DENOMINATOR	15625ULL
 #define PTP_VCLOCK_REFRESH_INTERVAL	(HZ * 2)
+#define PTP_VCLOCK_RETRY_INTERVAL		msecs_to_jiffies(10)
 
 /* protects vclock_hash addition/deletion */
 static DEFINE_SPINLOCK(vclock_hash_lock);
@@ -42,21 +44,39 @@ static void ptp_vclock_hash_del(struct ptp_vclock *vclock)
 	synchronize_srcu(&vclock_srcu);
 }
 
+/* The caller holds vclock->lock, or has not published the clock yet. */
+static int ptp_vclock_sample(struct ptp_vclock *vclock)
+{
+	struct ptp_clock *ptp = vclock->pclock;
+	struct timespec64 ts;
+	int err;
+
+	err = ptp->info->getcycles64(ptp->info, &ts);
+	if (!err)
+		vclock->cycles = timespec64_to_ns(&ts);
+
+	return err;
+}
+
 static int ptp_vclock_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 {
 	struct ptp_vclock *vclock = info_to_vclock(ptp);
 	s64 adj;
+	int err;
 
 	adj = (s64)scaled_ppm << PTP_VCLOCK_FADJ_SHIFT;
 	adj = div_s64(adj, PTP_VCLOCK_FADJ_DENOMINATOR);
 
 	if (mutex_lock_interruptible(&vclock->lock))
 		return -EINTR;
-	timecounter_read(&vclock->tc);
-	vclock->cc.mult = PTP_VCLOCK_CC_MULT + adj;
+	err = ptp_vclock_sample(vclock);
+	if (!err) {
+		timecounter_read(&vclock->tc);
+		vclock->cc.mult = PTP_VCLOCK_CC_MULT + adj;
+	}
 	mutex_unlock(&vclock->lock);
 
-	return 0;
+	return err;
 }
 
 static int ptp_vclock_adjtime(struct ptp_clock_info *ptp, s64 delta)
@@ -75,15 +95,16 @@ static int ptp_vclock_gettime(struct ptp_clock_info *ptp,
 			      struct timespec64 *ts)
 {
 	struct ptp_vclock *vclock = info_to_vclock(ptp);
-	u64 ns;
+	int err;
 
 	if (mutex_lock_interruptible(&vclock->lock))
 		return -EINTR;
-	ns = timecounter_read(&vclock->tc);
+	err = ptp_vclock_sample(vclock);
+	if (!err)
+		*ts = ns_to_timespec64(timecounter_read(&vclock->tc));
 	mutex_unlock(&vclock->lock);
-	*ts = ns_to_timespec64(ns);
 
-	return 0;
+	return err;
 }
 
 static int ptp_vclock_gettimex(struct ptp_clock_info *ptp,
@@ -115,13 +136,16 @@ static int ptp_vclock_settime(struct ptp_clock_info *ptp,
 {
 	struct ptp_vclock *vclock = info_to_vclock(ptp);
 	u64 ns = timespec64_to_ns(ts);
+	int err;
 
 	if (mutex_lock_interruptible(&vclock->lock))
 		return -EINTR;
-	timecounter_init(&vclock->tc, &vclock->cc, ns);
+	err = ptp_vclock_sample(vclock);
+	if (!err)
+		timecounter_init(&vclock->tc, &vclock->cc, ns);
 	mutex_unlock(&vclock->lock);
 
-	return 0;
+	return err;
 }
 
 static int ptp_vclock_getcrosststamp(struct ptp_clock_info *ptp,
@@ -151,8 +175,24 @@ static long ptp_vclock_refresh(struct ptp_clock_info *ptp)
 	struct ptp_vclock *vclock = info_to_vclock(ptp);
 	struct timespec64 ts;
 
-	ptp_vclock_gettime(&vclock->info, &ts);
+	/* Retry transient failures promptly, but back off during long outages. */
+	if (ptp_vclock_gettime(&vclock->info, &ts)) {
+		unsigned long now = jiffies;
+
+		/* Retries must not postpone the next regular refresh attempt. */
+		if (!vclock->retry_delay || time_after_eq(now, vclock->refresh_deadline))
+			vclock->refresh_deadline = now + PTP_VCLOCK_REFRESH_INTERVAL;
+
+		if (!vclock->retry_delay)
+			vclock->retry_delay = PTP_VCLOCK_RETRY_INTERVAL;
+		else
+			vclock->retry_delay = min_t(unsigned long,
+						    vclock->retry_delay * 2,
+						    PTP_VCLOCK_REFRESH_INTERVAL);
+		return min(vclock->retry_delay, vclock->refresh_deadline - now);
+	}
 
+	vclock->retry_delay = 0;
 	return PTP_VCLOCK_REFRESH_INTERVAL;
 }
 
@@ -174,12 +214,9 @@ static const struct ptp_clock_info ptp_vclock_info = {
 static u64 ptp_vclock_read(struct cyclecounter *cc)
 {
 	struct ptp_vclock *vclock = cc_to_vclock(cc);
-	struct ptp_clock *ptp = vclock->pclock;
-	struct timespec64 ts = {};
-
-	ptp->info->getcycles64(ptp->info, &ts);
 
-	return timespec64_to_ns(&ts);
+	/* The cyclecounter callback cannot report a failed PHC read. */
+	return vclock->cycles;
 }
 
 static const struct cyclecounter ptp_vclock_cc = {
@@ -192,10 +229,11 @@ static const struct cyclecounter ptp_vclock_cc = {
 struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock)
 {
 	struct ptp_vclock *vclock;
+	int err;
 
 	vclock = kzalloc_obj(*vclock);
 	if (!vclock)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	vclock->pclock = pclock;
 	vclock->info = ptp_vclock_info;
@@ -214,20 +252,29 @@ struct ptp_vclock *ptp_vclock_register(struct ptp_clock *pclock)
 
 	mutex_init(&vclock->lock);
 
+	err = ptp_vclock_sample(vclock);
+	if (err)
+		goto free_vclock;
+	timecounter_init(&vclock->tc, &vclock->cc, 0);
+
 	vclock->clock = ptp_clock_register(&vclock->info, &pclock->dev);
-	if (IS_ERR_OR_NULL(vclock->clock)) {
-		kfree(vclock);
-		return NULL;
+	if (IS_ERR(vclock->clock)) {
+		err = PTR_ERR(vclock->clock);
+		goto free_vclock;
 	}
 
 	ptp_vclock_set_subclass(vclock->clock);
 
-	timecounter_init(&vclock->tc, &vclock->cc, 0);
-	ptp_schedule_worker(vclock->clock, PTP_VCLOCK_REFRESH_INTERVAL);
+	/* The initial sample predates registration; refresh without more delay. */
+	ptp_schedule_worker(vclock->clock, 0);
 
 	ptp_vclock_hash_add(vclock);
 
 	return vclock;
+
+free_vclock:
+	kfree(vclock);
+	return ERR_PTR(err);
 }
 
 void ptp_vclock_unregister(struct ptp_vclock *vclock)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0083/1005] ptp: vclock: serialize extended samples with counter updates
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (81 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0082/1005] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0084/1005] ptp: vclock: preserve missing hardware timestamps Greg Kroah-Hartman
                   ` (290 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
	Sasha Levin

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

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

From: James Hilliard <james.hilliard1@gmail.com>

[ 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.")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-4-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ptp/ptp_vclock.c | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c
index b97f3a8772602..679ae40916f7e 100644
--- a/drivers/ptp/ptp_vclock.c
+++ b/drivers/ptp/ptp_vclock.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0084/1005] ptp: vclock: preserve missing hardware timestamps
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (82 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0083/1005] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0085/1005] net/smc: fix limit_smc_hs sysctl on big-endian architecture Greg Kroah-Hartman
                   ` (289 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vadim Fedorenko, James Hilliard,
	Jakub Kicinski, Sasha Levin

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

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

From: James Hilliard <james.hilliard1@gmail.com>

[ 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")
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Link: https://patch.msgid.link/20261026-ptp-vclock-sampling-v6-5-e705612541f1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ptp/ptp_vclock.c         | 2 ++
 include/linux/ptp_clock_kernel.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/ptp/ptp_vclock.c b/drivers/ptp/ptp_vclock.c
index 679ae40916f7e..e9cf4da3ed8a4 100644
--- a/drivers/ptp/ptp_vclock.c
+++ b/drivers/ptp/ptp_vclock.c
@@ -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);
 
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 36a27a9105958..56f6ab1855d38 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -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
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0085/1005] net/smc: fix limit_smc_hs sysctl on big-endian architecture
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (83 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0084/1005] ptp: vclock: preserve missing hardware timestamps Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0086/1005] scsi: mpt3sas: Use combined sense codes Greg Kroah-Hartman
                   ` (288 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Fernando Fernandez Mancera,
	Jakub Kicinski, Sasha Levin

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

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

From: Fernando Fernandez Mancera <fmancera@suse.de>

[ 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.

Fixes: f8406a2fd279 ("net/smc: add sysctl for smc_limit_hs")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20261028225350.3753-1-fmancera@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/smc/smc_sysctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/smc/smc_sysctl.c b/net/smc/smc_sysctl.c
index 09dad48337f61..f58cf256f61ab 100644
--- a/net/smc/smc_sysctl.c
+++ b/net/smc/smc_sysctl.c
@@ -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",
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0086/1005] scsi: mpt3sas: Use combined sense codes
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (84 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0085/1005] net/smc: fix limit_smc_hs sysctl on big-endian architecture Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0087/1005] scsi: mpt3sas: Register devices during SANITIZE Greg Kroah-Hartman
                   ` (287 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Johannes Thumshirn,
	Hannes Reinecke, Martin K. Petersen (Oracle), Sasha Levin

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

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

From: Damien Le Moal <dlemoal@kernel.org>

[ 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.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Link: https://patch.msgid.link/20260908090308.1085097-18-dlemoal@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Stable-dep-of: d58e6d962e5b ("scsi: mpt3sas: Register devices during SANITIZE")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 69 +++++++++++++++-------------
 1 file changed, 36 insertions(+), 33 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 0e12009a87f62..085d4672db854 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -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;
 		}
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0087/1005] scsi: mpt3sas: Register devices during SANITIZE
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (85 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0086/1005] scsi: mpt3sas: Use combined sense codes Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0088/1005] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
                   ` (286 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vincent YUE, Laurence Oberman,
	Martin K. Petersen (Oracle), Sasha Levin

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

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

From: Vincent YUE <vince@palmit.com.au>

[ 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
Signed-off-by: Vincent YUE <vince@palmit.com.au>
Link: https://patch.msgid.link/20261020210856.42835-1-vince@palmit.com.au
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 085d4672db854..a77bbc3d2b666 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -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 ||
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0088/1005] scsi: target: Validate REGISTER AND MOVE TransportID length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (86 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0087/1005] scsi: mpt3sas: Register devices during SANITIZE Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0089/1005] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
                   ` (285 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jia Jia, Martin K. Petersen (Oracle),
	Sasha Levin

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

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

From: Jia Jia <physicalmtea@gmail.com>

[ 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")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Link: https://patch.msgid.link/20261021094334.198599-1-physicalmtea@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/target/target_core_pr.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index 25b1bcacc0c8f..ca1a2802aa228 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -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;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0089/1005] tipc: reject attaching bearer of different media to the same occupied device
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (87 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0088/1005] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0090/1005] net: ipa: Fix double free of the interrupt structure on config error Greg Kroah-Hartman
                   ` (284 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jiakai Xu, Tung Nguyen,
	Jakub Kicinski, Sasha Levin

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

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

From: Tung Nguyen <tung.quang.nguyen@est.tech>

[ 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.

Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()")
Reported-by: Jiakai Xu <xujiakai24@mails.ucas.ac.cn>
Closes: http://lore.kernel.org/netdev/20260918013509.1853952-1-xujiakai24@mails.ucas.ac.cn/
Signed-off-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Link: https://patch.msgid.link/20261029030522.8306-1-tung.quang.nguyen@est.tech
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/tipc/bearer.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 5e7e220fa7f5a..d041a1a7c6dc4 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -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",
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0090/1005] net: ipa: Fix double free of the interrupt structure on config error
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (88 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0089/1005] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0091/1005] ALSA: memalloc: Free the new pages when WC DMA mapping fails Greg Kroah-Hartman
                   ` (283 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Thomas Fourier, Alex Elder,
	Jakub Kicinski, Sasha Levin

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

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

From: Thomas Fourier <fourier.thomas@gmail.com>

[ 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.

Fixes: ad1be80d7582 ("net: ipa: introduce ipa_interrupt_init()")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Alex Elder <elder@riscstar.com>
Link: https://patch.msgid.link/20261029082100.17722-2-fourier.thomas@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ipa/ipa_interrupt.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c
index 131b9cc942014..766b094eb0694 100644
--- a/drivers/net/ipa/ipa_interrupt.c
+++ b/drivers/net/ipa/ipa_interrupt.c
@@ -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);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0091/1005] ALSA: memalloc: Free the new pages when WC DMA mapping fails
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (89 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0090/1005] net: ipa: Fix double free of the interrupt structure on config error Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0092/1005] ALSA: hda/core: Fix double free on stream page allocation failure Greg Kroah-Hartman
                   ` (282 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Takashi Iwai

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")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261028144441.992127-1-sashal@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/core/memalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 5bc7e586b430f..3118bb14231ce 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0092/1005] ALSA: hda/core: Fix double free on stream page allocation failure
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (90 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0091/1005] ALSA: memalloc: Free the new pages when WC DMA mapping fails Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0093/1005] bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet Greg Kroah-Hartman
                   ` (281 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Takashi Iwai

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()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261028144443.992569-1-sashal@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/hda/core/controller.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/hda/core/controller.c b/sound/hda/core/controller.c
index 78855ac357c60..d1d85511a9dba 100644
--- a/sound/hda/core/controller.c
+++ b/sound/hda/core/controller.c
@@ -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;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0093/1005] bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (91 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0092/1005] ALSA: hda/core: Fix double free on stream page allocation failure Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0094/1005] netfilter: nft_reject: prevent unbounded recursion in output hooks Greg Kroah-Hartman
                   ` (280 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Ayushman Rout,
	Sasha Levin

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

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

From: Ayushman Rout <ayushmanrout27@gmail.com>

[ 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.

Fixes: daec295a7094 ("bpf/helpers: Introduce bpf_dynptr_copy kfunc")
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Ayushman Rout <ayushmanrout27@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261026162810.12862-2-ayushmanrout27@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/helpers.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 7c2e6f0e74091..9100283e2935e 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -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;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0094/1005] netfilter: nft_reject: prevent unbounded recursion in output hooks
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (92 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0093/1005] bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0095/1005] ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable Greg Kroah-Hartman
                   ` (279 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yu Junzhe,
	Fernando Fernandez Mancera, Pablo Neira Ayuso, Sasha Levin

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

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

From: Fernando Fernandez Mancera <fmancera@suse.de>

[ 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.

Reported-by: Yu Junzhe <junzheyu1@gmail.com>
Closes: https://lore.kernel.org/netfilter-devel/20260921061320.543-1-junzheyu1@gmail.com/
Fixes: bee11dc78fc8 ("netfilter: nft_reject: support for IPv6 and TCP reset")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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

diff --git a/include/linux/netdevice_xmit.h b/include/linux/netdevice_xmit.h
index cc232508e695e..286ae5a6101e8 100644
--- a/include/linux/netdevice_xmit.h
+++ b/include/linux/netdevice_xmit.h
@@ -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
 };
 
diff --git a/include/net/netfilter/nf_dup_netdev.h b/include/net/netfilter/nf_dup_netdev.h
index f6b05bd80c3fe..a394112646144 100644
--- a/include/net/netfilter/nf_dup_netdev.h
+++ b/include/net/netfilter/nf_dup_netdev.h
@@ -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;
 
diff --git a/include/net/netfilter/nf_recursion.h b/include/net/netfilter/nf_recursion.h
new file mode 100644
index 0000000000000..1ac65f7793f19
--- /dev/null
+++ b/include/net/netfilter/nf_recursion.h
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _NF_RECURSION_H_
+#define _NF_RECURSION_H_
+
+#include <linux/netdevice.h>
+
+#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_xmit_skb_recursion) >
+			NF_RECURSION_LIMIT);
+}
+
+static inline void nf_dev_xmit_recursion_inc(void)
+{
+	__this_cpu_inc(softnet_data.xmit.nf_xmit_skb_recursion);
+}
+
+static inline void nf_dev_xmit_recursion_dec(void)
+{
+	__this_cpu_dec(softnet_data.xmit.nf_xmit_skb_recursion);
+}
+#else
+static inline bool nf_dev_xmit_recursion(void)
+{
+	return unlikely(current->net_xmit.nf_xmit_skb_recursion > NF_RECURSION_LIMIT);
+}
+
+static inline void nf_dev_xmit_recursion_inc(void)
+{
+	current->net_xmit.nf_xmit_skb_recursion++;
+}
+
+static inline void nf_dev_xmit_recursion_dec(void)
+{
+	current->net_xmit.nf_xmit_skb_recursion--;
+}
+#endif
+
+#endif /* _NF_RECURSION_H_ */
diff --git a/net/ipv4/netfilter/nf_reject_ipv4.c b/net/ipv4/netfilter/nf_reject_ipv4.c
index 7cb33af671e26..4082fa184af8b 100644
--- a/net/ipv4/netfilter/nf_reject_ipv4.c
+++ b/net/ipv4/netfilter/nf_reject_ipv4.c
@@ -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;
 
diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c
index 5e08d8529cc88..7c94641845175 100644
--- a/net/ipv6/netfilter/nf_reject_ipv6.c
+++ b/net/ipv6/netfilter/nf_reject_ipv6.c
@@ -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);
 
diff --git a/net/netfilter/nf_dup_netdev.c b/net/netfilter/nf_dup_netdev.c
index c6bd5c29bed66..918716629c155 100644
--- a/net/netfilter/nf_dup_netdev.c
+++ b/net/netfilter/nf_dup_netdev.c
@@ -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)
diff --git a/net/netfilter/nft_fwd_netdev.c b/net/netfilter/nft_fwd_netdev.c
index a48c2f765bbaa..7447da931a957 100644
--- a/net/netfilter/nft_fwd_netdev.c
+++ b/net/netfilter/nft_fwd_netdev.c
@@ -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>
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0095/1005] ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (93 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0094/1005] netfilter: nft_reject: prevent unbounded recursion in output hooks Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0096/1005] bpf, x86: Fix bpf_throw() in a prog with a private stack Greg Kroah-Hartman
                   ` (278 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tang Bin, Prasad Kumpatla,
	Mark Brown, Sasha Levin

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

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

From: Tang Bin <tangbin@cmss.chinamobile.com>

[ 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")
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Reviewed-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20261028114501.2192-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/lpass-rx-macro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index 282a6aaa99865..1737d525ca86d 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -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;
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0096/1005] bpf, x86: Fix bpf_throw() in a prog with a private stack
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (94 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0095/1005] ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0097/1005] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
                   ` (277 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ 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")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261031050558.2410721-2-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/net/bpf_jit_comp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 10f68ee7c9e68..1b56cb973d79e 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0097/1005] spi: pic32-sqi: fail transfer when the BD ring is exhausted
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (95 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0096/1005] bpf, x86: Fix bpf_throw() in a prog with a private stack Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0098/1005] bpf: Clamp the trace length in __bpf_get_stack() again Greg Kroah-Hartman
                   ` (276 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Hongjian Dai, Mark Brown,
	Sasha Levin

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

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

From: Hongjian Dai <daihongjian@kylinsec.com.cn>

[ 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.

Fixes: 3270ac230f66 ("spi: pic32-sqi: add SPI driver for PIC32 SQI controller.")
Signed-off-by: Hongjian Dai <daihongjian@kylinsec.com.cn>
Link: https://patch.msgid.link/F5276982A630220B+20261017075545.95854-1-daihongjian@kylinsec.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-pic32-sqi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c
index 5d3921e29461c..35f0c60a31d64 100644
--- a/drivers/spi/spi-pic32-sqi.c
+++ b/drivers/spi/spi-pic32-sqi.c
@@ -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;
 		}
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0098/1005] bpf: Clamp the trace length in __bpf_get_stack() again
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (96 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0097/1005] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0099/1005] bpf: Clamp the trace length before the skip test in stackid_init() Greg Kroah-Hartman
                   ` (275 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
	Sasha Levin

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

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

From: Josef Bacik <josef@toxicpanda.com>

[ 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")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-2-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/stackmap.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index d09d4c3fe547c..84ccfa9df4637 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -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:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0099/1005] bpf: Clamp the trace length before the skip test in stackid_init()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (97 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0098/1005] bpf: Clamp the trace length in __bpf_get_stack() again Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0100/1005] bpf: Refuse to map an arena at address 0 Greg Kroah-Hartman
                   ` (274 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ 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()")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-3-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/stackmap.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index 84ccfa9df4637..118fec76b9c24 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -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;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0100/1005] bpf: Refuse to map an arena at address 0
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (98 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0099/1005] bpf: Clamp the trace length before the skip test in stackid_init() Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:23 ` [PATCH 7.3 0101/1005] bpf: Dont let bpf_arena_free_pages() see a half-set user range Greg Kroah-Hartman
                   ` (273 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ 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.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-4-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/arena.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index 868589f073301..a10981be21fe6 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -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))
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0101/1005] bpf: Dont let bpf_arena_free_pages() see a half-set user range
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (99 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0100/1005] bpf: Refuse to map an arena at address 0 Greg Kroah-Hartman
@ 2026-11-25 14:23 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0102/1005] bpf: Refuse an arena mmap() longer than max_entries pages Greg Kroah-Hartman
                   ` (272 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:23 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ 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.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-5-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/arena.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index a10981be21fe6..607768ef4bb5f 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0102/1005] bpf: Refuse an arena mmap() longer than max_entries pages
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (100 preceding siblings ...)
  2026-11-25 14:23 ` [PATCH 7.3 0101/1005] bpf: Dont let bpf_arena_free_pages() see a half-set user range Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0103/1005] bpf: Remove the WARN from arena_get_unmapped_area() Greg Kroah-Hartman
                   ` (271 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ 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.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-6-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/arena.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index 607768ef4bb5f..8b0892e19b198 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -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))
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0103/1005] bpf: Remove the WARN from arena_get_unmapped_area()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (101 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0102/1005] bpf: Refuse an arena mmap() longer than max_entries pages Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0104/1005] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
                   ` (270 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ 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.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-7-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/arena.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index 8b0892e19b198..8e1f7bfd2b4f7 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -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);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0104/1005] bpf: Require prog fd or capability for cgroup detach
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (102 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0103/1005] bpf: Remove the WARN from arena_get_unmapped_area() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0105/1005] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
                   ` (269 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ 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.

Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-14-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/cgroup.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 149672c76c49c..84a3d9cc52b76 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -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)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0105/1005] bpf, cgroup: Keep the skb network offset signed
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (103 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0104/1005] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0106/1005] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
                   ` (268 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ 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")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-15-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/cgroup.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 84a3d9cc52b76..59326938a01ea 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -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;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0106/1005] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (104 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0105/1005] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0107/1005] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
                   ` (267 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 6d8118937ba477e03fa2e94e9bd9abac7291a2a2 ]

When bpf_skb_adjust_room() shrinks a TCP GSO skb, it adds the number of
removed bytes to gso_size. gso_size has 16 bits, and nothing checks the
sum. Thus gso_size can wrap to 0 or to a small size, or it can be
GSO_BY_FRAGS. GSO_BY_FRAGS is not a size. It tells skb_segment() to read
the length of each segment from the frag_list. If the TCP GSO skb has no
frag_list, skb_segment() dereferences a NULL pointer.

Return -ENOTSUPP and do not change the skb if the sum is GSO_BY_FRAGS or
larger. With BPF_F_ADJ_ROOM_FIXED_GSO the helper does not change gso_size,
so it shrinks the skb as before.

Fixes: 2be7e212d541 ("bpf: add bpf_skb_adjust_room helper")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-16-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/core/filter.c b/net/core/filter.c
index 0ad1507759ded..3f268e3aac56b 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3762,6 +3762,14 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
 			return -ENOTSUPP;
 	}
 
+	/*
+	 * The MSS is raised by len_diff. It has 16 bits, and GSO_BY_FRAGS is
+	 * not a size.
+	 */
+	if (skb_is_gso(skb) && !(flags & BPF_F_ADJ_ROOM_FIXED_GSO) &&
+	    skb_shinfo(skb)->gso_size + len_diff >= GSO_BY_FRAGS)
+		return -ENOTSUPP;
+
 	ret = skb_unclone(skb, GFP_ATOMIC);
 	if (unlikely(ret < 0))
 		return ret;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0107/1005] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (105 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0106/1005] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0108/1005] bpf: Set a dst for test runs of lwt_in progs Greg Kroah-Hartman
                   ` (266 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit 58e39f8d58b141b96c030008a20dde9d625ec997 ]

The mode BPF_LWT_ENCAP_SEG6 of bpf_lwt_push_encap() pushes an IPv6 header
and an SRH, and it replaces the dst. The SRH says that IPv6 follows, and
skb->protocol does not change. Thus the mode assumes an IPv6 packet, but an
lwt_in prog also runs for IPv4 packets. After the prog, bpf_input() calls
orig_input() of the old dst. This IPv4 handler reads the pushed headers as
IPv4. It can write after the packet data, and the kernel crashes.

                 after the push         orig_input() expects
                 ---------------------  --------------------
  skb->protocol  ETH_P_IP               ETH_P_IP
  dst            rt6_info               rtable
  packet         | IPv6 | SRH | IPv4 |  | IPv4 |

The mode BPF_LWT_ENCAP_SEG6_INLINE returns -EBADMSG for non-IPv6 packets.
Apply this check to both modes. End.BPF does not change, because
seg6_local_input() drops non-IPv6 packets.

Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-17-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 3f268e3aac56b..c2d08dfad40e3 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6927,11 +6927,15 @@ static int bpf_push_seg6_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len
 	if (!seg6_validate_srh(srh, len, false))
 		return -EINVAL;
 
+	/*
+	 * The encap mode names IPv6 as the inner protocol, and neither mode
+	 * updates skb->protocol.
+	 */
+	if (skb->protocol != htons(ETH_P_IPV6))
+		return -EBADMSG;
+
 	switch (type) {
 	case BPF_LWT_ENCAP_SEG6_INLINE:
-		if (skb->protocol != htons(ETH_P_IPV6))
-			return -EBADMSG;
-
 		err = seg6_do_srh_inline(skb, srh);
 		break;
 	case BPF_LWT_ENCAP_SEG6:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0108/1005] bpf: Set a dst for test runs of lwt_in progs
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (106 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0107/1005] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0109/1005] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
                   ` (265 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit c1ca06e48e8848743fd876a1dc6b0f57bc76d23e ]

When an lwt prog runs on a route, the skb always has a dst. To push an SRH,
bpf_lwt_push_encap() reads the device from this dst. But
bpf_prog_test_run_skb() sets a dst for lwt_xmit progs only. Thus the helper
dereferences a NULL dst in a test run of an lwt_in prog.

Set the same dst, ip6_null_entry, for lwt_in progs. When IPv6 is disabled
or not built, their test run now fails with -EOPNOTSUPP too. An lwt_out
prog cannot call this helper.

Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-18-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bpf/test_run.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 3043a7393c29c..d6c9dc62182ee 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -1210,7 +1210,8 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
 		skb->ip_summed = CHECKSUM_COMPLETE;
 	}
 
-	if (prog->type == BPF_PROG_TYPE_LWT_XMIT) {
+	if (prog->type == BPF_PROG_TYPE_LWT_IN ||
+	    prog->type == BPF_PROG_TYPE_LWT_XMIT) {
 		if (!ipv6_mod_enabled()) {
 			pr_warn_once("Please test this program with IPv6 enabled kernel\n");
 			ret = -EOPNOTSUPP;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0109/1005] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (107 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0108/1005] bpf: Set a dst for test runs of lwt_in progs Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0110/1005] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
                   ` (264 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit ac159f39b252971141c49b68a27de0b637debfad ]

bpf_lwt_seg6_adjust_srh() lets an End.BPF prog change the size of the TLVs
in the SRH. The helper keeps the SRH length in srh_state->hdrlen, in bytes
and without the first 8 bytes. Later seg6_bpf_has_valid_srh() writes it to
srh->hdrlen, an 8-bit field in units of 8 bytes. But srh_state->hdrlen has
no upper limit, and the cast to u8 can truncate it. After that,
seg6_validate_srh() gets the SRH length from srh->hdrlen, and thus it can
accept the SRH. Then srh->hdrlen is too small, and a parser reads TLVs as
the subsequent header.

Return -EFAULT when the new srh_state->hdrlen is larger than 2040, the
largest length that srh->hdrlen can hold. To replace a TLV in the largest
SRH, a prog can no longer add bytes first. It must remove bytes first.

Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-19-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/core/filter.c b/net/core/filter.c
index c2d08dfad40e3..0cc65aff822aa 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7179,6 +7179,9 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
 		return -EFAULT;
 	if (unlikely(len < 0 && (void *)((char *)ptr - len) > srh_end))
 		return -EFAULT;
+	/* The length field of the SRH has 8 bits, in units of 8 bytes. */
+	if (unlikely(len > (U8_MAX << 3) - srh_state->hdrlen))
+		return -EFAULT;
 
 	if (len > 0) {
 		ret = skb_cow_head(skb, len);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0110/1005] bpf: Dont look for the SRH again in the End.BPF helpers
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (108 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0109/1005] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0111/1005] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
                   ` (263 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 45bcc58d576705d2c001332766e10313f1c55bad ]

A packet can have two SRHs. Thus input_action_end_bpf() uses
IP6_FH_F_SKIP_RH to skip routing headers with segments_left 0. The helpers
bpf_lwt_seg6_store_bytes() and bpf_lwt_seg6_adjust_srh() can reallocate the
head of the skb. Thus they look for the SRH again, but without this flag.

  +------------------------+ <- the helpers: srh_state->srh
  | SRH 1, segments_left 0 |
  +------------------------+ <- input_action_end_bpf(): srh_state->srh
  | SRH 2                  |    and srh_state->hdrlen
  +------------------------+

Then the helpers check offset against the wrong limits. If a helper changes
TLVs, seg6_bpf_has_valid_srh() writes the length of SRH 2 to SRH 1.

Neither helper changes the offset of the SRH from skb->data. Calculate the
new address from this offset. To add IP6_FH_F_SKIP_RH is not sufficient,
because advance_nextseg() can set segments_left of SRH 2 to 0. The helper
bpf_lwt_seg6_action() can change the headers and still looks for the SRH.

Fixes: fbbc5bc2ab8c ("seg6: ignore routing header with segments left equal to 0")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-20-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 0cc65aff822aa..2d64d661c0bef 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7024,12 +7024,13 @@ BPF_CALL_4(bpf_lwt_seg6_store_bytes, struct sk_buff *, skb, u32, offset,
 		this_cpu_ptr(&seg6_bpf_srh_states);
 	struct ipv6_sr_hdr *srh = srh_state->srh;
 	void *srh_tlvs, *srh_end, *ptr;
-	int srhoff = 0;
+	int srhoff;
 
 	lockdep_assert_held(&srh_state->bh_lock);
 	if (srh == NULL)
 		return -EINVAL;
 
+	srhoff = (unsigned char *)srh - skb->data;
 	srh_tlvs = (void *)((char *)srh + ((srh->first_segment + 1) << 4));
 	srh_end = (void *)((char *)srh + sizeof(*srh) + srh_state->hdrlen);
 
@@ -7042,8 +7043,7 @@ BPF_CALL_4(bpf_lwt_seg6_store_bytes, struct sk_buff *, skb, u32, offset,
 
 	if (unlikely(bpf_try_make_writable(skb, offset + len)))
 		return -EFAULT;
-	if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
-		return -EINVAL;
+	/* The head may have moved. */
 	srh_state->srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
 
 	memcpy(skb->data + offset, from, len);
@@ -7162,13 +7162,14 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
 	struct ipv6_sr_hdr *srh = srh_state->srh;
 	void *srh_end, *srh_tlvs, *ptr;
 	struct ipv6hdr *hdr;
-	int srhoff = 0;
+	int srhoff;
 	int ret;
 
 	lockdep_assert_held(&srh_state->bh_lock);
 	if (unlikely(srh == NULL))
 		return -EINVAL;
 
+	srhoff = (unsigned char *)srh - skb->data;
 	srh_tlvs = (void *)((unsigned char *)srh + sizeof(*srh) +
 			((srh->first_segment + 1) << 4));
 	srh_end = (void *)((unsigned char *)srh + sizeof(*srh) +
@@ -7200,8 +7201,7 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
 	hdr = (struct ipv6hdr *)skb->data;
 	hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
 
-	if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
-		return -EINVAL;
+	/* The bytes in front of offset have moved together with skb->data. */
 	srh_state->srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
 	srh_state->hdrlen += len;
 	srh_state->valid = false;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0111/1005] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (109 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0110/1005] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0112/1005] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
                   ` (262 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit 0fcb3f11a93d740e7f9ae1aeb48fe4d25838be18 ]

bpf_skb_net_hdr_push() and bpf_skb_net_hdr_pop() change skb->data and
skb->mac_header by len. That is correct in a tc prog, where skb->data is
the MAC header. But bpf_lwt_seg6_adjust_srh() calls them in an End.BPF
prog, where skb->data is the network header. The MAC header does not move:

  before push  |       free       | MAC header   | IPv6 | SRH | payload
               ^ head             ^ mac_header   ^ data
  today        |       free       | MAC h| IPv6 | SRH   + len | payload
               ^ head     ^ mac_header   ^ data
  this patch   |   free   | MAC header   | IPv6 | SRH   + len | payload
               ^ head     ^ mac_header   ^ data

Users of skb_mac_header() get incorrect bytes until __dev_queue_xmit() sets
skb->mac_header again. skb_cow_head() reserves only len bytes. Thus the
16-bit offset skb->mac_header can wrap. A push also changes the "not set"
value. In both cases skb_mac_header() points after the skb.

Move the MAC header too. Pass len + skb->mac_len to skb_cow_head(). Keep
the "not set" value. The second Fixes tag is for this case. Since that
commit an End.BPF prog can get an skb with skb->mac_header not set.

Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Fixes: 20a081b7984c ("seg6: add VRF support for SRv6 End.DT6 behavior")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-21-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 2d64d661c0bef..f5931e8964232 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7159,6 +7159,7 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
 {
 	struct seg6_bpf_srh_state *srh_state =
 		this_cpu_ptr(&seg6_bpf_srh_states);
+	bool mac_set = skb_mac_header_was_set(skb);
 	struct ipv6_sr_hdr *srh = srh_state->srh;
 	void *srh_end, *srh_tlvs, *ptr;
 	struct ipv6hdr *hdr;
@@ -7184,20 +7185,38 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
 	if (unlikely(len > (U8_MAX << 3) - srh_state->hdrlen))
 		return -EFAULT;
 
+	/*
+	 * skb->data is the network header here. The MAC header is in front of
+	 * it, so bpf_skb_net_hdr_push() and bpf_skb_net_hdr_pop() do not move
+	 * it with the other headers.
+	 */
 	if (len > 0) {
-		ret = skb_cow_head(skb, len);
+		ret = skb_cow_head(skb, len + skb->mac_len);
 		if (unlikely(ret < 0))
 			return ret;
 
+		/* The push can write over the MAC header, so move it first. */
+		if (mac_set)
+			memmove(skb->data - len - skb->mac_len,
+				skb_mac_header(skb), skb->mac_len);
 		ret = bpf_skb_net_hdr_push(skb, offset, len);
 	} else {
 		ret = bpf_skb_net_hdr_pop(skb, offset, -1 * len);
+		/* The pop has added -len to skb->mac_header. */
+		if (likely(!ret) && mac_set)
+			memmove(skb->data - skb->mac_len,
+				skb_mac_header(skb) + len, skb->mac_len);
 	}
 
 	bpf_compute_data_pointers(skb);
 	if (unlikely(ret < 0))
 		return ret;
 
+	if (mac_set)
+		skb_set_mac_header(skb, -skb->mac_len);
+	else
+		skb_unset_mac_header(skb);
+
 	hdr = (struct ipv6hdr *)skb->data;
 	hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0112/1005] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (110 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0111/1005] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0113/1005] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
                   ` (261 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 701ffd202b9e32942c8cfc065c9fe76ceaccc302 ]

With BPF_LWT_ENCAP_IP, bpf_lwt_push_encap() pushes a new IP header. The new
header overwrites the MAC header of a received skb. But skb->mac_header
continues to point to the same bytes. Code that reads the MAC header after
the push, for example netfilter, gets bytes of the new header.

  before the push                        | MAC header  | old IP | payload
                                         ^ mac_header  ^ network_header
  today                            | new header        | old IP | payload
                    network_header ^     ^ mac_header
  this patch, lwt_in | MAC header  | new header        | old IP | payload
                     ^ mac_header  ^ network_header
  this patch, lwt_xmit             | new header        | old IP | payload
                    network_header ^     mac_header is not set

For lwt_in, move the MAC header in front of the new header before the
memcpy(), as __seg6_do_srh_encap() does. skb_cow_head() already reserves
len + skb->mac_len bytes.

For lwt_xmit, the output path makes a new MAC header. Thus mark
skb->mac_header as not set. This is the state of a locally generated skb.

Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-22-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/lwt_bpf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index da49364ec63de..b9270a08cc6d1 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -649,6 +649,14 @@ int bpf_lwt_push_ip_encap(struct sk_buff *skb, void *hdr, u32 len, bool ingress)
 	if (ingress)
 		skb_postpush_rcsum(skb, iph, len);
 	skb_reset_network_header(skb);
+	/*
+	 * The new header goes over the MAC header. On ingress move it first.
+	 * On egress the packet gets a new one, so forget the old one.
+	 */
+	if (ingress)
+		skb_mac_header_rebuild(skb);
+	else
+		skb_unset_mac_header(skb);
 	if (is_udp_tunnel) {
 		size_t iph_sz = ipv4 ? iph->ihl * 4 : sizeof(struct ipv6hdr);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0113/1005] bpf: Reset skb->cb after an lwt prog pushes an IP header
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (111 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0112/1005] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0114/1005] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
                   ` (260 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Xiang Mei, Daniel Borkmann,
	Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit b3ad42f6183286ab376389a5d26edf7ee3bdba27 ]

IPCB(skb)->opt holds the offsets from the network header to the IPv4
options. But bpf_lwt_push_ip_encap() moves the network header and does not
change IPCB(skb). Then ip_forward_options() and __ip_options_echo() use the
old offsets on the pushed header. Thus the kernel corrupts the skb and the
stack. If the family changes, the kernel also reads IP6CB(skb) as
IPCB(skb), or the reverse. With CONFIG_IPV6_MIP6, it reads IPSKB_FORWARDED
as frag_max_size and adds a needless fragment header.

Reset skb->cb after the prog. bpf_lwt_push_ip_encap() cannot do it, because
bpf_prog_run_save_cb() can restore skb->cb. For IPv4 in IPv4, clear
IPCB(skb)->opt as ip_tunnel_xmit() does. If the family changes, clear the
cb of the new family but keep iif, because ip6_forward() gets the input
device from it. Behind a VRF, skb->skb_iif is the VRF device and cannot
replace iif. Do nothing for IPv6 in IPv6, as in seg6_do_srh_encap().

Do the reset in bpf_input() only after a push. Without a push,
ip_forward_options() needs the offsets. Do it in bpf_xmit() before each
reroute, because an lwt_xmit prog can also change the options. Thus after a
reroute without a push, ip_options_fragment() leaves the options in all
fragments, and ICMP errors echo none. After BPF_OK or BPF_REDIRECT the skb
goes to a device, thus bpf_xmit() does no reset. The inner IPv4 checksum
can still be wrong after ip_rcv_options() changes an option.

Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap")
Reported-by: Xiang Mei <xmei5@asu.edu>
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-23-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/lwt_bpf.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index b9270a08cc6d1..3a946e8709b16 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -85,6 +85,32 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,
 	return ret;
 }
 
+/*
+ * skb->cb still describes the IP header that was the first one before the
+ * prog ran. The option offsets in IPCB(skb)->opt are wrong for a pushed
+ * header, and a header of the other family needs the other layout. iif
+ * stays: behind a VRF skb->skb_iif is the L3 master and not the port.
+ * bpf_lwt_push_encap() cannot do this, because bpf_prog_run_save_cb() can
+ * restore skb->cb after the prog.
+ */
+static void bpf_lwt_reset_cb(struct sk_buff *skb, __be16 proto)
+{
+	int iif;
+
+	if (skb->protocol == proto) {
+		if (proto == htons(ETH_P_IP))
+			memset(&IPCB(skb)->opt, 0, sizeof(IPCB(skb)->opt));
+	} else if (skb->protocol == htons(ETH_P_IP)) {
+		iif = IP6CB(skb)->iif;
+		memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
+		IPCB(skb)->iif = iif;
+	} else {
+		iif = IPCB(skb)->iif;
+		memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
+		IP6CB(skb)->iif = iif;
+	}
+}
+
 static int bpf_lwt_input_reroute(struct sk_buff *skb)
 {
 	enum skb_drop_reason reason;
@@ -124,6 +150,8 @@ static int bpf_lwt_input_reroute(struct sk_buff *skb)
 static int bpf_input(struct sk_buff *skb)
 {
 	struct dst_entry *dst = skb_dst(skb);
+	__be16 proto = skb->protocol;
+	unsigned int len = skb->len;
 	struct bpf_lwt *bpf;
 	int ret;
 
@@ -132,6 +160,9 @@ static int bpf_input(struct sk_buff *skb)
 		ret = run_lwt_bpf(skb, &bpf->in, dst, NO_REDIRECT);
 		if (ret < 0)
 			return ret;
+		/* An lwt_in prog can change the length only with a push. */
+		if (skb->len != len)
+			bpf_lwt_reset_cb(skb, proto);
 		if (ret == BPF_LWT_REROUTE)
 			return bpf_lwt_input_reroute(skb);
 	}
@@ -311,6 +342,8 @@ static int bpf_xmit(struct sk_buff *skb)
 		case BPF_REDIRECT:
 			return LWTUNNEL_XMIT_DONE;
 		case BPF_LWT_REROUTE:
+			/* An lwt_xmit prog can also write to the options. */
+			bpf_lwt_reset_cb(skb, proto);
 			return bpf_lwt_xmit_reroute(skb);
 		default:
 			return ret;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0114/1005] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (112 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0113/1005] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0115/1005] bpf: Dont let lwt_in progs call into IPv6 when it is disabled Greg Kroah-Hartman
                   ` (259 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit d9618a6196953718f7470de5d2e84121bed063f7 ]

When an lwt_in prog returns BPF_OK, bpf_input() calls orig_input(), the
input handler of the route. This handler is for one IP version and needs a
dst of the same family. But BPF_LWT_ENCAP_IP lets the prog push a header of
the other IP version and thus change skb->protocol. Then the handler reads
and changes a header of the other IP version. The push of an SRH also
replaces the dst, because seg6_lookup_nexthop() puts an rt6_info into the
skb. Then ip_forward() uses the rt6_info as a struct rtable.

Drop the skb with -EINVAL when skb->protocol changes, as bpf_xmit() does.
Drop it also when the family of the dst changes, because skb->protocol does
not always show this change. Today no such skb leaves as the prog made it.
A prog works as before if it returns BPF_LWT_REROUTE, or if it pushes an
SRH on an IPv6 route.

The commit in the first Fixes tag lets a prog change skb->protocol. The
commit in the second tag adds the check to bpf_xmit() only.

Fixes: 52f278774e79 ("bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap")
Fixes: 3bd0b15281af ("bpf: add handling of BPF_LWT_REROUTE to lwt_bpf.c")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-24-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/lwt_bpf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 3a946e8709b16..60f4eda7dae9a 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -165,6 +165,16 @@ static int bpf_input(struct sk_buff *skb)
 			bpf_lwt_reset_cb(skb, proto);
 		if (ret == BPF_LWT_REROUTE)
 			return bpf_lwt_input_reroute(skb);
+		/*
+		 * orig_input() is for the old protocol only, see bpf_xmit().
+		 * It also needs a dst of the old family. BPF_LWT_ENCAP_SEG6
+		 * puts an IPv6 dst into the skb.
+		 */
+		if (skb->protocol != proto ||
+		    skb_dst(skb)->ops->family != dst->ops->family) {
+			kfree_skb(skb);
+			return -EINVAL;
+		}
 	}
 
 	if (unlikely(!dst->lwtstate->orig_input)) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0115/1005] bpf: Dont let lwt_in progs call into IPv6 when it is disabled
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (113 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0114/1005] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0116/1005] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
                   ` (258 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 95f1d5e4abb79fe85a54f7a46b41f297ce533c31 ]

With ipv6.disable=1, inet6_init() returns before it registers any pernet
subsystem. Thus net->ipv6.devconf_all and net->ipv6.seg6_data stay NULL.
IS_ENABLED(CONFIG_IPV6) only says that the code is built in.
bpf_lwt_input_reroute() and bpf_push_seg6_encap() call into IPv6, but do
not test ipv6_mod_enabled(). An lwt_in prog also runs with ipv6.disable=1,
and skb->protocol == htons(ETH_P_IPV6) does not prove that IPv6 is enabled.
Thus the kernel dereferences NULL and crashes.

Return -EAFNOSUPPORT before these calls if ipv6_mod_enabled() is false.
BPF_LWT_REROUTE then drops an IPv6 skb. With IPv6 enabled nothing changes.

The first Fixes tag is for bpf_push_seg6_encap(), which never had this
test. The second tag is for bpf_lwt_input_reroute(). Until that commit it
used ipv6_stub, which returned -EAFNOSUPPORT with ipv6.disable=1.

Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Fixes: ad84b1eefe28 ("bpf: remove ipv6_bpf_stub completely and use direct function calls")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-25-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c  | 4 ++++
 net/core/lwt_bpf.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index f5931e8964232..2d539860684f5 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6924,6 +6924,10 @@ static int bpf_push_seg6_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len
 	int err;
 	struct ipv6_sr_hdr *srh = (struct ipv6_sr_hdr *)hdr;
 
+	/* With ipv6.disable=1 the netns has no seg6 data and no IPv6 tables. */
+	if (!ipv6_mod_enabled())
+		return -EAFNOSUPPORT;
+
 	if (!seg6_validate_srh(srh, len, false))
 		return -EINVAL;
 
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 60f4eda7dae9a..774fad4e9fbf7 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -128,7 +128,7 @@ static int bpf_lwt_input_reroute(struct sk_buff *skb)
 		dev_put(dev);
 	} else if (skb->protocol == htons(ETH_P_IPV6)) {
 		skb_dst_drop(skb);
-		if (IS_ENABLED(CONFIG_IPV6)) {
+		if (ipv6_mod_enabled()) {
 			ip6_route_input(skb);
 			err = skb_dst(skb)->error;
 		} else {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0116/1005] bpf: Move the transport header with the moved headers
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (114 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0115/1005] bpf: Dont let lwt_in progs call into IPv6 when it is disabled Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0117/1005] bpf: Use the inner transport header after a decap Greg Kroah-Hartman
                   ` (257 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit a9d08fe60fa728ce0e3a99085241e8e790fb14c6 ]

bpf_skb_net_hdr_pop() removes len bytes at offset off.
bpf_skb_net_hdr_push() does the opposite.

           skb->data       off
  before   | A             | removed | B            |
  after              | A             | B            |
                     skb->data       off

mac_header and network_header move with A. transport_header moves only when
it is equal to network_header. inner_transport_header never moves. This is
correct only for a header in B. In bpf_lwt_seg6_adjust_srh()
transport_header is in A. bpf_skb_adjust_room() can remove both transport
headers. With an incorrect header offset, the stack can drop the skb or
read outside of it.

Also move transport_header with A when it is in A. Set it to offset off
when it is in the removed bytes. In BPF_ADJ_ROOM_MAC mode it is then equal
to network_header. Do not unset it, because skb_gso_validate_mac_len() uses
it without a check. After a removal, set inner_transport_header to off when
it is not in B and skb->encapsulation is set. A has only outer headers.

Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers")
Fixes: 868d523535c2 ("bpf: add bpf_skb_adjust_room encap flags")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-26-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 37 +++++++++++++++++++++++++++++++------
 1 file changed, 31 insertions(+), 6 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 2d539860684f5..475c9e06cf06b 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3402,9 +3402,25 @@ static int bpf_skb_generic_pop(struct sk_buff *skb, u32 off, u32 len)
 	return 0;
 }
 
+/*
+ * bpf_skb_net_hdr_push() inserts bytes at @off, bpf_skb_net_hdr_pop() removes
+ * bytes at @off. Both move the bytes in front of @off together with skb->data,
+ * and leave the rest of the packet where it is. Return true if the transport
+ * header is in the part that moves. A transport header that is equal to the
+ * network header stays equal to it.
+ */
+static bool bpf_skb_trans_hdr_moves(const struct sk_buff *skb, u32 off)
+{
+	if (skb->transport_header == skb->network_header)
+		return true;
+
+	return skb_transport_header_was_set(skb) &&
+	       (u32)skb_transport_offset(skb) < off;
+}
+
 static int bpf_skb_net_hdr_push(struct sk_buff *skb, u32 off, u32 len)
 {
-	bool trans_same = skb->transport_header == skb->network_header;
+	bool trans_moves = bpf_skb_trans_hdr_moves(skb, off);
 	int ret;
 
 	/* There's no need for __skb_push()/__skb_pull() pair to
@@ -3415,8 +3431,8 @@ static int bpf_skb_net_hdr_push(struct sk_buff *skb, u32 off, u32 len)
 	if (likely(!ret)) {
 		skb->mac_header -= len;
 		skb->network_header -= len;
-		if (trans_same)
-			skb->transport_header = skb->network_header;
+		if (trans_moves)
+			skb->transport_header -= len;
 	}
 
 	return ret;
@@ -3424,7 +3440,7 @@ static int bpf_skb_net_hdr_push(struct sk_buff *skb, u32 off, u32 len)
 
 static int bpf_skb_net_hdr_pop(struct sk_buff *skb, u32 off, u32 len)
 {
-	bool trans_same = skb->transport_header == skb->network_header;
+	bool trans_moves = bpf_skb_trans_hdr_moves(skb, off);
 	int ret;
 
 	/* Same here, __skb_push()/__skb_pull() pair not needed. */
@@ -3432,8 +3448,17 @@ static int bpf_skb_net_hdr_pop(struct sk_buff *skb, u32 off, u32 len)
 	if (likely(!ret)) {
 		skb->mac_header += len;
 		skb->network_header += len;
-		if (trans_same)
-			skb->transport_header = skb->network_header;
+		if (trans_moves) {
+			skb->transport_header += len;
+		} else if (skb_transport_header_was_set(skb) &&
+			   skb_transport_offset(skb) < (int)off) {
+			/* It was in the removed bytes or before skb->data. */
+			skb_set_transport_header(skb, off);
+		}
+		/* Do not leave the inner transport header in front of @off. */
+		if (skb->encapsulation &&
+		    skb_inner_transport_offset(skb) < (int)off)
+			skb_set_inner_transport_header(skb, off);
 	}
 
 	return ret;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0117/1005] bpf: Use the inner transport header after a decap
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (115 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0116/1005] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0118/1005] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
                   ` (256 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit 33be492c2e239de8c525254e593357ae5e80852d ]

If skb->encapsulation is set, qdisc_pkt_len_segs_init() reads the TCP
header of a GSO packet at skb->inner_transport_header. Otherwise it uses
skb->transport_header. A decap with BPF_F_ADJ_ROOM_DECAP_L4_{GRE,UDP}
removes the outer transport header. It clears skb->encapsulation if no
tunnel flag remains in gso_type. The result in BPF_ADJ_ROOM_MAC mode is:

  before  | MAC | outer IP | GRE | inner IP | TCP | payload
          transport_header ^                ^ inner_transport_header
  after                    | MAC | inner IP | TCP | payload
                transport_header ^          ^ inner_transport_header

Then qdisc_pkt_len_segs_init() reads the inner IP header as a TCP header.
Thus the kernel can drop a valid packet with SKB_DROP_REASON_SKB_BAD_GSO.

Copy skb->inner_transport_header to skb->transport_header when a decap
clears skb->encapsulation. Keep skb->transport_header if it is larger. This
occurs if nothing sets the inner field. At tc ingress nothing changes for
IPIP or GRO packets. Both fields are at the TCP header there.

Fixes: ec20dee2f2c4 ("bpf: Clear decap state on skb_adjust_room shrink path")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-27-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index 475c9e06cf06b..d27e73647a8df 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3769,6 +3769,25 @@ static int bpf_skb_net_grow(struct sk_buff *skb, u32 off, u32 len_diff,
 	return 0;
 }
 
+/*
+ * Code that went by the inner transport header while skb->encapsulation was set
+ * goes by the transport header from now on. So take the inner one over, unless
+ * it is the smaller one, as it is if nobody has set it. Do not leave the result
+ * in front of @off, where the bytes were removed.
+ */
+static void bpf_skb_clear_encap(struct sk_buff *skb, u32 off)
+{
+	int thoff;
+
+	if (!skb->encapsulation)
+		return;
+
+	thoff = max(skb->inner_transport_header, skb->transport_header) -
+		skb_headroom(skb);
+	skb_set_transport_header(skb, max_t(int, thoff, off));
+	skb->encapsulation = 0;
+}
+
 static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
 			      u64 flags)
 {
@@ -3850,8 +3869,7 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
 						  SKB_GSO_IPXIP4 |
 						  SKB_GSO_IPXIP6 |
 						  SKB_GSO_ESP)))
-				if (skb->encapsulation)
-					skb->encapsulation = 0;
+				bpf_skb_clear_encap(skb, off);
 		}
 
 		/* Header must be checked, and gso_segs recomputed. */
@@ -3859,10 +3877,9 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
 		shinfo->gso_segs = 0;
 	} else {
 		/* For non-GSO packets, clear encapsulation if decap flags are set */
-		if ((flags & (BPF_F_ADJ_ROOM_DECAP_L4_MASK |
-			      BPF_F_ADJ_ROOM_DECAP_IPXIP_MASK)) &&
-		    skb->encapsulation)
-			skb->encapsulation = 0;
+		if (flags & (BPF_F_ADJ_ROOM_DECAP_L4_MASK |
+			     BPF_F_ADJ_ROOM_DECAP_IPXIP_MASK))
+			bpf_skb_clear_encap(skb, off);
 	}
 
 	return 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0118/1005] bpf: Check the offset in bpf_skb_generic_{push,pop}()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (116 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0117/1005] bpf: Use the inner transport header after a decap Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0119/1005] ASoC: tas2770: Configure transmit clock edge when setting DAI format Greg Kroah-Hartman
                   ` (255 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit ee36c9aa44ef300cd651074bd97552b229337f85 ]

To make room for len bytes at offset off, bpf_skb_generic_push() moves the
first off bytes and clears len bytes after them. It assumes that the first
off bytes are in the linear part. But in bpf_skb_adjust_room() off can be
the end of the IP header, and this header can be in a frag. Then the
function reads and writes after skb->tail, and can damage skb_shared_info.

bpf_skb_generic_pop() checks off + len, but this u32 sum can wrap to a
small value. bpf_skb_adjust_room() and bpf_skb_change_proto() calculate off
from skb_mac_header_len(). This length is a very large u32 when
network_header < mac_header. Then the check can pass, and memmove() reads
and writes far outside the skb.

Return -ENOMEM from both functions, like the present check, when
off > skb->len. Thus the sum cannot wrap. In bpf_skb_generic_push() also
pull the first off bytes into the linear part. Now bpf_skb_adjust_room()
fails when a prog grows an skb that ends before off. network_header stays
wrong.

Fixes: 6578171a7ff0 ("bpf: add bpf_skb_change_proto helper")
Fixes: 2be7e212d541 ("bpf: add bpf_skb_adjust_room helper")
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101190535.1454146-28-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/filter.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index d27e73647a8df..7129e7c920a64 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3369,6 +3369,10 @@ static const struct bpf_func_proto bpf_skb_vlan_pop_proto = {
 
 static int bpf_skb_generic_push(struct sk_buff *skb, u32 off, u32 len)
 {
+	/* The bytes in front of @off are moved with skb->data. */
+	if (unlikely(off > skb->len || !pskb_may_pull(skb, off)))
+		return -ENOMEM;
+
 	/* Caller already did skb_cow() with meta_len+len as headroom,
 	 * so no need to do it here.
 	 */
@@ -3389,9 +3393,10 @@ static int bpf_skb_generic_pop(struct sk_buff *skb, u32 off, u32 len)
 	void *old_data;
 
 	/* skb_ensure_writable() is not needed here, as we're
-	 * already working on an uncloned skb.
+	 * already working on an uncloned skb. The first test
+	 * keeps off + len from wrapping.
 	 */
-	if (unlikely(!pskb_may_pull(skb, off + len)))
+	if (unlikely(off > skb->len || !pskb_may_pull(skb, off + len)))
 		return -ENOMEM;
 
 	old_data = skb->data;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0119/1005] ASoC: tas2770: Configure transmit clock edge when setting DAI format
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (117 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0118/1005] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0120/1005] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
                   ` (254 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, James Calligeros, Mark Brown,
	Sasha Levin

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

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

From: James Calligeros <jcalligeros99@gmail.com>

[ Upstream commit 72da22e9cc380ecda175983d2a17b4494a4b9d15 ]

On reset, TAS2770 is configured to transmit on the falling edge
of the I2S clock. If BCLK is inverted, we are also receiving on the
falling edge. This can cause data leaving the codec to be corrupted.
Transmit should happen on the rising edge of the clock when receiving
on the falling edge, and vice versa.

Fix up tas2770_set_fmt to take into account the BLCK polarity and
always transmit on the correct edge of the clock. This fixes
corrupted VISENSE data on Apple Silicon platforms at sample rates
above 48 kHz.

Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Link: https://patch.msgid.link/20261031-tas2770-sdout-clkedge-v2-1-afeeba781cbb@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/tas2770.c | 9 +++++++++
 sound/soc/codecs/tas2770.h | 4 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index 355fcbfd01c79..a77ca55d5cf0c 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -353,6 +353,7 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	struct tas2770_priv *tas2770 =
 			snd_soc_component_get_drvdata(component);
 	u8 tdm_rx_start_slot = 0, invert_fpol = 0, fpol_preinv = 0, asi_cfg_1 = 0;
+	u8 tx_edge;
 	int ret;
 
 	switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
@@ -369,12 +370,14 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 		fallthrough;
 	case SND_SOC_DAIFMT_NB_NF:
 		asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_RSING;
+		tx_edge = TAS2770_TDM_CFG_REG4_TX_FALING;
 		break;
 	case SND_SOC_DAIFMT_IB_IF:
 		invert_fpol = 1;
 		fallthrough;
 	case SND_SOC_DAIFMT_IB_NF:
 		asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_FALING;
+		tx_edge = TAS2770_TDM_CFG_REG4_TX_RISING;
 		break;
 	default:
 		dev_err(tas2770->dev, "ASI format Inverse is not found\n");
@@ -387,6 +390,12 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	if (ret < 0)
 		return ret;
 
+	ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4,
+					    TAS2770_TDM_CFG_REG4_TX_EDGE,
+					    tx_edge);
+	if (ret < 0)
+		return ret;
+
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
 		tdm_rx_start_slot = 1;
diff --git a/sound/soc/codecs/tas2770.h b/sound/soc/codecs/tas2770.h
index 102040b6bdf8a..666a9631c65d1 100644
--- a/sound/soc/codecs/tas2770.h
+++ b/sound/soc/codecs/tas2770.h
@@ -74,7 +74,9 @@
 #define TAS2770_TDM_CFG_REG4_TX_KEEPER BIT(5)
 #define TAS2770_TDM_CFG_REG4_TX_FILL BIT(4)
 #define TAS2770_TDM_CFG_REG4_TX_OFFSET_MASK GENMASK(3, 1)
-#define TAS2770_TDM_CFG_REG4_TX_EDGE_FALLING BIT(0)
+#define TAS2770_TDM_CFG_REG4_TX_EDGE	BIT(0)
+#define TAS2770_TDM_CFG_REG4_TX_RISING	0x0
+#define TAS2770_TDM_CFG_REG4_TX_FALING	0x1
     /* TDM Configuration Reg5 */
 #define TAS2770_TDM_CFG_REG5  TAS2770_REG(0X0, 0x0F)
 #define TAS2770_TDM_CFG_REG5_VSNS_MASK  BIT(6)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0120/1005] spi: Fix ACPI SPI resources using relative path
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (118 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0119/1005] ASoC: tas2770: Configure transmit clock edge when setting DAI format Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0121/1005] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
                   ` (253 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alban Bedel, Mark Brown, Sasha Levin

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

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

From: Alban Bedel <alban.bedel@lht.dlh.de>

[ Upstream commit 4825287f6d2346e9273f35a928d1ef40e68bc58b ]

ACPI resources can use relative path when pointing to other
resources. This didn't work with SPISerialBus resources because the
device defining the resource was not passed to acpi_get_handle().

Pass the ACPI device handle through the lookup context to also allow
for relative paths.

Signed-off-by: Alban Bedel <alban.bedel@lht.dlh.de>
Link: https://patch.msgid.link/20261001153507.2011806-1-alban.bedel@lht.dlh.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 2d0953ab69d3 ("spi: acpi: only look up the IRQ of confirmed SPI devices")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 172141650b648..e5ef3ca769d53 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2983,6 +2983,7 @@ EXPORT_SYMBOL_GPL(devm_spi_new_ancillary_device);
 #ifdef CONFIG_ACPI
 struct acpi_spi_lookup {
 	struct spi_controller 	*ctlr;
+	acpi_handle		device_handle;
 	u32			max_speed_hz;
 	u32			mode;
 	int			irq;
@@ -3077,7 +3078,7 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
 			if (lookup->index != -1 && lookup->n++ != lookup->index)
 				return 1;
 
-			status = acpi_get_handle(NULL,
+			status = acpi_get_handle(lookup->device_handle,
 						 sb->resource_source.string_ptr,
 						 &parent_handle);
 
@@ -3169,6 +3170,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
 		return ERR_PTR(-EINVAL);
 
 	lookup.ctlr		= ctlr;
+	lookup.device_handle	= acpi_device_handle(adev);
 	lookup.irq		= -1;
 	lookup.index		= index;
 	lookup.n		= 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0121/1005] spi: acpi: only look up the IRQ of confirmed SPI devices
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (119 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0120/1005] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0122/1005] firmware: coreboot: Dont skip CBMEM entries outside of known memory Greg Kroah-Hartman
                   ` (252 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Rosen Penev, Mark Brown, Sasha Levin

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

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

From: Rosen Penev <rosenp@gmail.com>

[ Upstream commit 2d0953ab69d316589624b0517fdce01f8e630bf0 ]

When an SPI controller is registered, acpi_register_spi_device() is
called for every present ACPI device in the namespace and
acpi_spi_device_alloc() walks each device's _CRS. While doing so,
acpi_spi_add_resource() converts the first interrupt resource it finds,
even for devices that have no SpiSerialBus resource at all and are
discarded right afterwards. Converting an interrupt resource registers
its GSI, so this maps IRQs for arbitrary unrelated ACPI devices.

On a Dell Precision M4800 (Lynx Point, 24-pin IOAPIC) the DSDT reports
Haswell-ULT LPSS child devices (\_SB.PCI0.I2C0.ACD0 and
\_SB.PCI0.SDHC.WI01) as present with interrupts on GSI 37 and 38.
Registering the intel-spi controller then results in:

  ERROR: Unable to locate IOAPIC for GSI 37
  ERROR: Unable to locate IOAPIC for GSI 38

Do what the I2C core does and only parse the interrupt resource once the
device has been identified as an SPI device on this controller.

Fixes: 4c3c59544f33 ("spi/acpi: enumerate all SPI slaves in the namespace")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20261101200155.15740-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi.c | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index e5ef3ca769d53..b201165279236 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2986,7 +2986,6 @@ struct acpi_spi_lookup {
 	acpi_handle		device_handle;
 	u32			max_speed_hz;
 	u32			mode;
-	int			irq;
 	u8			bits_per_word;
 	u8			chip_select;
 	int			n;
@@ -3129,17 +3128,25 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
 			if (sb->device_polarity == ACPI_SPI_ACTIVE_HIGH)
 				lookup->mode |= SPI_CS_HIGH;
 		}
-	} else if (lookup->irq < 0) {
-		struct resource r;
-
-		if (acpi_dev_resource_interrupt(ares, 0, &r))
-			lookup->irq = r.start;
 	}
 
 	/* Always tell the ACPI core to skip this resource */
 	return 1;
 }
 
+static int acpi_spi_add_irq_resource(struct acpi_resource *ares, void *data)
+{
+	int *irq = data;
+	struct resource r;
+
+	if (*irq < 0 && ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS &&
+	    acpi_dev_resource_interrupt(ares, 0, &r))
+		*irq = r.start;
+
+	/* Always tell the ACPI core to skip this resource */
+	return 1;
+}
+
 /**
  * acpi_spi_device_alloc - Allocate a spi device, and fill it in with ACPI information
  * @ctlr: controller to which the spi device belongs
@@ -3164,6 +3171,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
 	struct list_head resource_list;
 	struct acpi_spi_lookup lookup = {};
 	struct spi_device *spi;
+	int irq = -1;
 	int ret;
 
 	if (!ctlr && index == -1)
@@ -3171,7 +3179,6 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
 
 	lookup.ctlr		= ctlr;
 	lookup.device_handle	= acpi_device_handle(adev);
-	lookup.irq		= -1;
 	lookup.index		= index;
 	lookup.n		= 0;
 
@@ -3194,6 +3201,19 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
 	if (!lookup.max_speed_hz)
 		return ERR_PTR(-ENODEV);
 
+	/*
+	 * Only look up the IRQ once we know this is an SPI device for us.
+	 * Parsing an interrupt resource maps its GSI, which must not be done
+	 * for every unrelated ACPI device walked during enumeration.
+	 */
+	INIT_LIST_HEAD(&resource_list);
+	ret = acpi_dev_get_resources(adev, &resource_list,
+				     acpi_spi_add_irq_resource, &irq);
+	if (ret < 0)
+		return ERR_PTR(ret);
+
+	acpi_dev_free_resource_list(&resource_list);
+
 	spi = spi_alloc_device(lookup.ctlr);
 	if (!spi) {
 		dev_err(&lookup.ctlr->dev, "failed to allocate SPI device for %s\n",
@@ -3206,7 +3226,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
 	ACPI_COMPANION_SET(&spi->dev, adev);
 	spi->max_speed_hz	= lookup.max_speed_hz;
 	spi->mode		|= lookup.mode;
-	spi->irq		= lookup.irq;
+	spi->irq		= irq;
 	spi->bits_per_word	= lookup.bits_per_word;
 	/*
 	 * By default spi->chip_select[0] will hold the physical CS number,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0122/1005] firmware: coreboot: Dont skip CBMEM entries outside of known memory
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (120 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0121/1005] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0123/1005] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
                   ` (251 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Michał Kopeć,
	Tzung-Bi Shih, Sasha Levin

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

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

From: Michał Kopeć <michal@nozomi.space>

[ Upstream commit e094fd05defaf0b05774ea1c65fc2d0ab798c809 ]

coreboot leaves CBMEM out of the /memory node of the device tree that it
passes to FIT payloads, e.g. LinuxBoot on arm64 Chromebooks, and only
lists it in the memory reservation block. The kernel has no resource for
that memory, so region_intersects() reports it as neither System RAM nor
Reserved memory, and since commit e31ecda9e3af ("firmware: coreboot:
Skip no-map CBMEM entries") all CBMEM entries are skipped on such boards.
That loses the coreboot log, the TPM event log and everything else that
CBMEM devices expose.

Also accept entries that don't intersect any memory resource. No-map
regions are still skipped, as they are IORESOURCE_MEM resources, as are
device regions.

Fixes: e31ecda9e3af ("firmware: coreboot: Skip no-map CBMEM entries")
Signed-off-by: Michał Kopeć <michal@nozomi.space>
Link: https://lore.kernel.org/r/20261017090351.1266064-1-michal@nozomi.space
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/firmware/google/coreboot_table.c | 42 ++++++++++++++----------
 1 file changed, 25 insertions(+), 17 deletions(-)

diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
index 25ee8cf534290..6b2ea781ddf77 100644
--- a/drivers/firmware/google/coreboot_table.c
+++ b/drivers/firmware/google/coreboot_table.c
@@ -114,6 +114,30 @@ void coreboot_driver_unregister(struct coreboot_driver *driver)
 }
 EXPORT_SYMBOL(coreboot_driver_unregister);
 
+/*
+ * Whether the memory of a CBMEM entry may be mapped: it must be exclusively
+ * System RAM, or exclusively Reserved memory, as CBMEM often is on x86, or
+ * memory that the kernel doesn't know about at all. coreboot leaves CBMEM out
+ * of the /memory node of the device tree that it passes to FIT payloads, e.g.
+ * on arm64, and only lists it in the memory reservation block.
+ *
+ * Anything else, such as no-map regions on arm64, which are IORESOURCE_MEM
+ * (see request_standard_resources() in arch/arm64/kernel/setup.c), must not
+ * be mapped.
+ */
+static bool cbmem_entry_is_mappable(const struct lb_cbmem_entry *entry)
+{
+	resource_size_t start = entry->address;
+	size_t size = entry->entry_size;
+
+	return region_intersects(start, size, IORESOURCE_SYSTEM_RAM,
+				 IORES_DESC_NONE) == REGION_INTERSECTS ||
+	       region_intersects(start, size, IORESOURCE_MEM,
+				 IORES_DESC_RESERVED) == REGION_INTERSECTS ||
+	       region_intersects(start, size, IORESOURCE_MEM,
+				 IORES_DESC_NONE) == REGION_DISJOINT;
+}
+
 static int coreboot_table_populate(struct device *dev, void *ptr, resource_size_t len)
 {
 	int i, ret;
@@ -149,23 +173,7 @@ static int coreboot_table_populate(struct device *dev, void *ptr, resource_size_
 
 		switch (device->entry.tag) {
 		case LB_TAG_CBMEM_ENTRY:
-			/*
-			 * Skip entries that are not exclusively System RAM or
-			 * Reserved memory.
-			 * On ARM64, no-map regions are filtered out as they are
-			 * IORESOURCE_MEM (see request_standard_resources() in
-			 * arch/arm64/kernel/setup.c).
-			 * On x86, CBMEM often resides in standard reserved regions
-			 * (IORES_DESC_RESERVED).
-			 */
-			if (region_intersects(device->cbmem_entry.address,
-					      device->cbmem_entry.entry_size,
-					      IORESOURCE_SYSTEM_RAM,
-					      IORES_DESC_NONE) != REGION_INTERSECTS &&
-			    region_intersects(device->cbmem_entry.address,
-					      device->cbmem_entry.entry_size,
-					      IORESOURCE_MEM,
-					      IORES_DESC_RESERVED) != REGION_INTERSECTS) {
+			if (!cbmem_entry_is_mappable(&device->cbmem_entry)) {
 				kfree(device);
 				continue;
 			}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0123/1005] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (121 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0122/1005] firmware: coreboot: Dont skip CBMEM entries outside of known memory Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0124/1005] drm/i915/display: Limit NVL TRANS_VTOTAL.Vtotal skip to A-step Greg Kroah-Hartman
                   ` (250 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yuqiang Sun, Alexei Starovoitov,
	Sasha Levin

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

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

From: Yuqiang Sun <izaiahsun@gmail.com>

[ Upstream commit 5e96760b25fdedbbf9312827f1f237d6b18b03e8 ]

When an LWT xmit program returns BPF_OK, bpf_xmit() makes sure that
the skb still has room for the link layer header. If
pskb_expand_head() fails there, bpf_xmit() returns -ENOMEM without
freeing the skb. Its callers, lwtunnel_xmit() and then
ip_finish_output2() or ip6_finish_output2(), take any return value
other than LWTUNNEL_XMIT_CONTINUE to mean that the skb has been
consumed, so nothing frees it.

Each such failure leaks the skb, together with what it holds: its dst
and its charge to the sending socket, so the socket is never freed
either. The other error paths of bpf_xmit() (BPF_DROP, an illegal
return code, a changed protocol, a failed reroute) all free the skb.

Free it here too.

The leak was found with kbound, a static analysis prototype for
ownership mismatches at kernel interfaces, on v7.2.12; it is present in
mainline.

Build-tested with x86_64 and arm64 allmodconfig (W=1, sparse): no new
warnings. Run-tested on QEMU (x86_64, KVM) with KASAN: a route through a
dummy device with an LWT xmit program that pushes one byte with
bpf_skb_change_head(), so the headroom check has to expand the head, and
failslab limited to allocations under bpf_xmit(). Each of 10 pings then
fails with ENOMEM. Without this patch each leaves a raw socket behind
(RAW slab objects 6 -> 16); with it none does (6 -> 6), and nothing else
is reported. Without injection both kernels go from 6 to 6.

Fixes: 3a0af8fd61f9 ("bpf: BPF for lightweight tunnel infrastructure")
Signed-off-by: Yuqiang Sun <izaiahsun@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261101182343.17991-1-izaiahsun@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/lwt_bpf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 774fad4e9fbf7..72c86ff2a8472 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -345,8 +345,10 @@ static int bpf_xmit(struct sk_buff *skb)
 			 * made before LWT xmit.
 			 */
 			ret = xmit_check_headroom(skb, hroom);
-			if (unlikely(ret))
+			if (unlikely(ret)) {
+				kfree_skb(skb);
 				return ret;
+			}
 
 			return LWTUNNEL_XMIT_CONTINUE;
 		case BPF_REDIRECT:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0124/1005] drm/i915/display: Limit NVL TRANS_VTOTAL.Vtotal skip to A-step
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (122 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0123/1005] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0125/1005] drm/i915/cmtg: Disable CMTG after encoder disable in hsw_crtc_disable() Greg Kroah-Hartman
                   ` (249 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Suraj Kandpal, Mitul Golani,
	Joonas Lahtinen, Sasha Levin

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

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

From: Suraj Kandpal <suraj.kandpal@intel.com>

[ Upstream commit f704594d36809780cf41fb201729dc1ac352c5d4 ]

The hardware issue which required us to keep vtotal as 0 has since been
fixed on B0 well, so applying the workaround there is no longer correct
and causes issues on B-stepping.
Restrict the workaround to A-step only, in both transcoder timing paths
and in the crtc_vtotal readout fixup in intel_vrr_get_config().

Fixes: a78d11e7859b ("drm/i915/display: Skip TRANS_VTOTAL.Vtotal write on NVL pre-C0")
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Mitul Golani<mitulkumar.ajitkumar.golani@intel.com>
Link: https://patch.msgid.link/20261022040528.1403569-1-suraj.kandpal@intel.com
(cherry picked from commit b749007b1ed67bc5482d15d3a1f6fe74555a81df)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/i915/display/intel_display.c | 4 ++--
 drivers/gpu/drm/i915/display/intel_vrr.c     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 9dfd095f325f7..10235c728db43 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2779,7 +2779,7 @@ void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state,
 		       HSYNC_END(adjusted_mode->crtc_hsync_end - 1));
 
 	if (display->platform.novalake &&
-	    IS_DISPLAY_STEP(display, STEP_A0, STEP_C0))
+	    IS_DISPLAY_STEP(display, STEP_A0, STEP_B0))
 		crtc_vtotal = 1;
 
 	intel_de_write(display, TRANS_VTOTAL(display, transcoder),
@@ -2876,7 +2876,7 @@ void intel_set_transcoder_timings_lrr(const struct intel_crtc_state *crtc_state,
 	 * is the transcoder's undelayed vblank.
 	 */
 	if (display->platform.novalake &&
-	    IS_DISPLAY_STEP(display, STEP_A0, STEP_C0))
+	    IS_DISPLAY_STEP(display, STEP_A0, STEP_B0))
 		crtc_vtotal = 1;
 
 	intel_de_write(display, TRANS_VTOTAL(display, transcoder),
diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index cfc0cfbff017a..6e03122743967 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -1110,7 +1110,7 @@ void intel_vrr_get_config(struct intel_crtc_state *crtc_state)
 		}
 
 		if (display->platform.novalake &&
-		    IS_DISPLAY_STEP(display, STEP_A0, STEP_C0))
+		    IS_DISPLAY_STEP(display, STEP_A0, STEP_B0))
 			crtc_state->hw.adjusted_mode.crtc_vtotal =
 				intel_vrr_vmin_vtotal(crtc_state);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0125/1005] drm/i915/cmtg: Disable CMTG after encoder disable in hsw_crtc_disable()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (123 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0124/1005] drm/i915/display: Limit NVL TRANS_VTOTAL.Vtotal skip to A-step Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0126/1005] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
                   ` (248 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Animesh Manna,
	Dibin Moolakadan Subrahmanian, Joonas Lahtinen, Sasha Levin

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

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

From: Animesh Manna <animesh.manna@intel.com>

[ Upstream commit 0a5bad4cd8b87b8d575e3efccaa06c02158db32f ]

hsw_crtc_disable() disables CMTG at the very start of the CRTC disable
sequence, before intel_encoders_disable(). With this ordering, the wait
for CMTG_STATE to clear after CMTG_ENABLE is cleared intermittently
times out:

  xe 0000:00:02.0: [drm] CMTG: A disable timeout
  WARNING: drivers/gpu/drm/i915/display/intel_cmtg.c:205 intel_cmtg_disable+0x331/0x3d0 [xe]

This is seen with igt@kms_hdr@bpc-switch-suspend, which repeatedly
disables and re-enables the eDP across modesets and suspend/resume.

Move the CMTG disable after intel_encoders_disable(), so the eDP-side
teardown (panel unprepare, ALPM disable, backlight off) has completed,
but keep it before intel_encoders_post_disable() and
intel_dpll_disable(). The transcoder timing generator, DDI buffer and
port PLL are therefore still running while CMTG_STATE is polled, and
the requirement to disable CMTG before the transcoder and the port PLL
feeding it are turned off is preserved.

v2:
- Modify commit description regarding PSR exit. [Dibin]
- Add fixes tag. [Jani, Dibin]
v3:
- Add a cover letter with links to v1 and v2 for the review
  history. [Dibin]

Fixes: c588a324183b ("drm/i915/cmtg: Add trigger to enable/disable cmtg")
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Reviewed-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Link: https://patch.msgid.link/20261026082906.802048-2-animesh.manna@intel.com
(cherry picked from commit f85fb6e8fd6cf7802285ccd2dbcb631efca8303f)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/i915/display/intel_display.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 10235c728db43..8210dbd6c438d 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1791,15 +1791,22 @@ static void hsw_crtc_disable(struct intel_atomic_state *state,
 		intel_atomic_get_old_crtc_state(state, crtc);
 	struct intel_crtc *pipe_crtc;
 
-	if (crtc->cmtg.enabled && intel_cmtg_is_allowed(old_crtc_state)) {
-		intel_cmtg_set_clk_select(old_crtc_state);
-		intel_cmtg_disable(old_crtc_state);
-	}
 	/*
 	 * FIXME collapse everything to one hook.
 	 * Need care with mst->ddi interactions.
 	 */
 	intel_encoders_disable(state, crtc);
+
+	/*
+	 * Disable CMTG after the encoders are disabled, but before the
+	 * transcoder and port PLL are torn down in
+	 * intel_encoders_post_disable()/intel_dpll_disable().
+	 */
+	if (crtc->cmtg.enabled && intel_cmtg_is_allowed(old_crtc_state)) {
+		intel_cmtg_set_clk_select(old_crtc_state);
+		intel_cmtg_disable(old_crtc_state);
+	}
+
 	intel_encoders_post_disable(state, crtc);
 
 	intel_dpll_disable(old_crtc_state);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0126/1005] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (124 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0125/1005] drm/i915/cmtg: Disable CMTG after encoder disable in hsw_crtc_disable() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0127/1005] bnxt_en: Dont keep MSI-X vectors added before FW reserves them Greg Kroah-Hartman
                   ` (247 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
	Simon Horman, Dave Miller, Sasha Levin

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

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

From: Joas Antonio dos Santos <joasantonio108@gmail.com>

[ Upstream commit 902407bc588575af0ceae5de4f635fe1e024f258 ]

macsec_fs_id_del() removes a struct mlx5_fs_id from its rhashtable with
rhashtable_remove_fast() and then frees it with kfree() right away.

The TX (SCI) table is read locklessly from the transmit path:
mlx5e_macsec_handle_tx_skb() and mlx5e_macsec_tx_build_eseg() call
mlx5_macsec_fs_get_fs_id_from_hashtable(), which does
rhashtable_lookup() under rcu_read_lock() and then reads
mlx5_fs_id->id. A transmit that looked the entry up just before it was
removed reads freed memory.

Before commit d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec
device inside macsec steering") the SCI table held struct
mlx5e_macsec_sa directly, and mlx5e_macsec_del_txsa() freed it with
kfree_rcu_mightsleep(). That commit moved the table into macsec_fs.c
with the new struct mlx5_fs_id, but frees it with a plain kfree().

Add an rcu_head to struct mlx5_fs_id and free it with kfree_rcu().

The same issue was flagged by the Sashiko AI review as a pre-existing
problem while reviewing the HW-GRO for PSP series.

Fixes: d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering")
Link: https://lore.kernel.org/all/20260909065542.4B80D1F00ACA@smtp.kernel.org/
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Assisted-by: Yaga Agent HackerSec Claude:claude-opus-5-5
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
index efc5167493c12..7d785c937d43d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -94,6 +94,7 @@ struct mlx5_fs_id {
 	refcount_t refcnt;
 	sci_t sci;
 	struct rhash_head hash;
+	struct rcu_head rcu;
 };
 
 struct mlx5_macsec_device {
@@ -684,7 +685,7 @@ static void macsec_fs_id_del(struct list_head *macsec_devices_list, u32 fs_id,
 
 	xa_erase(fs_id_xa, fs_id);
 
-	kfree(fs_id_found);
+	kfree_rcu(fs_id_found, rcu);
 
 	if (macsec_fs_is_macsec_device_empty(macsec_device)) {
 		list_del(&macsec_device->macsec_devices_list_entry);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0127/1005] bnxt_en: Dont keep MSI-X vectors added before FW reserves them
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (125 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0126/1005] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0128/1005] gpio: shared-proxy: Fix race between concurrent first users Greg Kroah-Hartman
                   ` (246 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Andrew Preece, Vlad Poenaru,
	Michael Chan, Dave Miller, Sasha Levin

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

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

From: Vlad Poenaru <vlad.wing@gmail.com>

[ Upstream commit af449230bd8de936d6e4f759240e787b9aad7cc0 ]

When dynamic MSI-X is supported, bnxt_check_rings() grows the MSI-X
vectors with bnxt_change_msix() once FW says the new rings would fit,
and keeps them.  FW only reserves the extra IRQs later, when
bnxt_reserve_rings() calls __bnxt_reserve_rings().  The MSI-X table
entries beyond the function's reserved IRQs are not backed until then:
the MSI message written when the new vectors are activated is lost, and
the entries read back as zero.  After FW reserves them they are live but
still zero, so the NQ rings bound to them signal address 0 and every
completion on those rings is lost.  The next ring change (for example
ethtool -G) then times out freeing each of those rings and the TX
watchdog fires:

  bnxt_en 0002:01:00.0 eth0: Resp cmpl intr err msg: 0x51
  bnxt_en 0002:01:00.0 eth0: hwrm_ring_free type 1 failed. rc:fffffff0 err:0
  ...
  bnxt_en 0002:01:00.0 eth0: NETDEV WATCHDOG: CPU: 17: transmit queue 18 timed out 5716 ms

On x86 this is hidden: GENERIC_IRQ_RESERVATION_MODE makes the PCI MSI
domains MSI_FLAG_MUST_REACTIVATE, so the message is composed and written
again when the IRQ is requested, after FW has reserved the vector.
Since commit 0d6a7c417983 ("irqchip/gic-v3-its: Enable dynamic MSI-X
allocation"), arm64 GICv3 systems take the dynamic path as well, but
write the message only once, at allocation.  On an NVIDIA Grace system
with a BCM57508, raising the channel count from 18 to 32 left MSI-X
entries 18-31 all zero, and the 14 rings using them lost their
interrupts.

Keep the allocation in bnxt_check_rings() as a check that enough vectors
are available, but free the new vectors again right away when FW manages
IRQ reservations (BNXT_NEW_RM).  bnxt_reserve_rings() then allocates
them after __bnxt_reserve_rings() has reserved them.  Without
BNXT_NEW_RM there is no IRQ reservation and bnxt_reserve_rings() does
not grow the vectors, so keep the current behaviour there.

In bnxt_reserve_rings(), size that allocation from the rings FW actually
reserved (bnxt_get_num_msix()) instead of the count computed before the
reservation, so that a partial grant does not activate unreserved
entries either, at least while no RoCE driver is registered.

The allocation can now fail after FW has committed the reservation.  A
later open would then find nothing to reserve and return before growing
the vectors, and bnxt_request_irq() would use irq_tbl[] entries past
bp->total_irqs, which still hold the freed virqs.  Grow the vectors in
that case as well, and clear irq_tbl[].vector when trimming.

Fixes: 2d51eb0bd81c ("bnxt_en: Add MSIX check in bnxt_check_rings()")
Reported-by: Andrew Preece <apreece@meta.com>
Closes: https://lore.kernel.org/all/20261022193620.2152038-1-vlad.wing@gmail.com/
Signed-off-by: Vlad Poenaru <vlad.wing@gmail.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 34 ++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 94d764230e47d..ab932f7d0d76a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11544,6 +11544,7 @@ static int bnxt_change_msix(struct bnxt *bp, int total)
 		map.index = i - 1;
 		map.virq = bp->irq_tbl[i - 1].vector;
 		pci_msix_free_irq(bp->pdev, map);
+		bp->irq_tbl[i - 1].vector = 0;
 		bp->total_irqs--;
 	}
 	return bp->total_irqs;
@@ -11721,8 +11722,23 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
 	int irqs_required;
 	int rc;
 
-	if (!bnxt_need_reserve_rings(bp))
+	if (!bnxt_need_reserve_rings(bp)) {
+		/* FW may already hold the reservation from an earlier
+		 * reservation that was not followed by growing the dynamic
+		 * MSI-X vectors, e.g. because the allocation failed.
+		 */
+		if (irq_re_init && BNXT_NEW_RM(bp) && bp->irq_tbl &&
+		    pci_msix_can_alloc_dyn(bp->pdev)) {
+			irqs_required = bnxt_get_num_msix(bp);
+			if (irqs_required > bp->total_irqs &&
+			    bnxt_change_msix(bp, irqs_required) != irqs_required) {
+				netdev_err(bp->dev, "Unable to allocate %d MSIX vectors, maximum available %d\n",
+					   irqs_required, bp->total_irqs);
+				return -ENOSPC;
+			}
+		}
 		return 0;
+	}
 
 	if (BNXT_NEW_RM(bp) && !bnxt_ulp_registered(edev)) {
 		int ulp_msix = bnxt_get_avail_msix(bp, bp->ulp_num_msix_want);
@@ -11748,6 +11764,10 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
 			rc = bnxt_init_int_mode(bp);
 		bnxt_ulp_irq_restart(bp, rc);
 	} else if (irq_change && !rc) {
+		/* Size the vectors from what FW actually reserved, which
+		 * can be less than what was requested.
+		 */
+		irqs_required = bnxt_get_num_msix(bp);
 		if (bnxt_change_msix(bp, irqs_required) != irqs_required)
 			rc = -ENOSPC;
 	}
@@ -15107,6 +15127,7 @@ int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs,
 			hwr.cp = min_t(int, hwr.cp, bnxt_get_max_func_irqs(bp));
 		}
 		if (hwr.cp > bp->total_irqs) {
+			int old_total = bp->total_irqs;
 			int total_msix = bnxt_change_msix(bp, hwr.cp);
 
 			if (total_msix < hwr.cp) {
@@ -15114,6 +15135,17 @@ int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs,
 					    hwr.cp, total_msix);
 				rc = -ENOSPC;
 			}
+			/* FW has not reserved the new vectors yet, and writes to
+			 * MSI-X table entries beyond the reserved IRQs don't
+			 * stick (seen on BCM57508).  Free them again;
+			 * bnxt_reserve_rings() allocates them after
+			 * __bnxt_reserve_rings().  Without the new resource
+			 * manager there is no IRQ reservation and
+			 * bnxt_reserve_rings() does not grow the vectors, so
+			 * keep them.
+			 */
+			if (BNXT_NEW_RM(bp))
+				bnxt_change_msix(bp, old_total);
 		}
 	}
 	return rc;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0128/1005] gpio: shared-proxy: Fix race between concurrent first users
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (126 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0127/1005] bnxt_en: Dont keep MSI-X vectors added before FW reserves them Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0129/1005] gpio: shared-proxy: Drop the vote of a released proxy on write failure Greg Kroah-Hartman
                   ` (245 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shawn Guo, Marek Szyprowski,
	Bartosz Golaszewski, Sasha Levin

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

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

From: Shawn Guo <shengchao.guo@oss.qualcomm.com>

[ Upstream commit eb70d2419e79b6720fd465b905a2dddd751f2a48 ]

The proxy lets a consumer set the line direction and reset the
default value and vote tally only when usecnt == 1, i.e. when it is
the sole requester. But request() and direction_output() take the
descriptor mutex separately. When two consumers probe concurrently,
both request the line before either configures it, both see
usecnt == 2, both fall into the shared path, read back the still
unconfigured direction (input) and fail with -EPERM.

On Nord RRD the two DAC supplies are reg-fixed-voltage regulators
sharing tlmm GPIO 41. They probe asynchronously and intermittently
both fail, leaving the codecs without supplies:

  reg-fixed-voltage regulator-3p3-dac: setup of GPIO (default) failed: -1
  reg-fixed-voltage regulator-5p0-dac: setup of GPIO (default) failed: -1

Requesting the line is not evidence that a consumer has claimed it.
Instead, count proxies that have actually configured the line (set its
direction or voted for a value) in a new cfgcnt, with a per-proxy
configured flag, and allow (re)initialization only while no other
proxy has done so. A consumer obtained with GPIOD_ASIS that votes via
gpiod_set_value() without ever setting the direction counts as
configured, so a later user can never reset def_val/votecnt behind its
vote. The count is dropped when the proxy frees the line.

Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver")
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://patch.msgid.link/20261028123448.510401-2-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-shared-proxy.c | 78 ++++++++++++++++++++++++++++----
 drivers/gpio/gpiolib-shared.h    |  1 +
 2 files changed, 70 insertions(+), 9 deletions(-)

diff --git a/drivers/gpio/gpio-shared-proxy.c b/drivers/gpio/gpio-shared-proxy.c
index bc69b8729d196..2e9ccd8a8d835 100644
--- a/drivers/gpio/gpio-shared-proxy.c
+++ b/drivers/gpio/gpio-shared-proxy.c
@@ -21,9 +21,37 @@ struct gpio_shared_proxy_data {
 	struct gpio_chip gc;
 	struct gpio_shared_desc *shared_desc;
 	struct device *dev;
+	bool configured;
 	bool voted_change;
 };
 
+/*
+ * A proxy may (re)initialize the line - set its direction and reset the
+ * default value and the vote tally - only while no other proxy has set the
+ * direction or voted for a value. Requesting the line is not enough: consumers
+ * may request concurrently, so counting requests lets every one of them
+ * conclude that it is not first.
+ */
+static bool gpio_shared_proxy_may_init(struct gpio_shared_proxy_data *proxy)
+{
+	unsigned int cfgcnt = proxy->shared_desc->cfgcnt;
+
+	lockdep_assert_held(&proxy->shared_desc->mutex);
+
+	return !cfgcnt || (cfgcnt == 1 && proxy->configured);
+}
+
+static void gpio_shared_proxy_mark_configured(struct gpio_shared_proxy_data *proxy)
+{
+	lockdep_assert_held(&proxy->shared_desc->mutex);
+
+	if (proxy->configured)
+		return;
+
+	proxy->configured = true;
+	proxy->shared_desc->cfgcnt++;
+}
+
 static int
 gpio_shared_proxy_set_unlocked(struct gpio_shared_proxy_data *proxy, int value)
 {
@@ -117,6 +145,11 @@ static void gpio_shared_proxy_free(struct gpio_chip *gc, unsigned int offset)
 
 	proxy->shared_desc->usecnt--;
 
+	if (proxy->configured) {
+		proxy->configured = false;
+		shared_desc->cfgcnt--;
+	}
+
 	dev_dbg(proxy->dev, "Shared GPIO freed, number of users: %u\n",
 		proxy->shared_desc->usecnt);
 }
@@ -131,7 +164,7 @@ static int gpio_shared_proxy_set_config(struct gpio_chip *gc,
 
 	guard(mutex)(&shared_desc->mutex);
 
-	if (shared_desc->usecnt > 1) {
+	if (!gpio_shared_proxy_may_init(proxy)) {
 		if (shared_desc->cfg != cfg) {
 			dev_dbg(proxy->dev,
 				"Shared GPIO's configuration already set, accepting changes but users may conflict!!\n");
@@ -155,15 +188,21 @@ static int gpio_shared_proxy_direction_input(struct gpio_chip *gc,
 	struct gpio_shared_proxy_data *proxy = gpiochip_get_data(gc);
 	struct gpio_shared_desc *shared_desc = proxy->shared_desc;
 	struct gpio_desc *desc = shared_desc->desc;
-	int dir;
+	int ret, dir;
 
 	guard(mutex)(&shared_desc->mutex);
 
-	if (shared_desc->usecnt == 1) {
+	if (gpio_shared_proxy_may_init(proxy)) {
 		dev_dbg(proxy->dev,
-			"Only one user of this shared GPIO, allowing to set direction to input\n");
+			"No other user configured this shared GPIO, allowing to set direction to input\n");
+
+		ret = gpiod_direction_input(desc);
+		if (ret)
+			return ret;
 
-		return gpiod_direction_input(desc);
+		gpio_shared_proxy_mark_configured(proxy);
+
+		return 0;
 	}
 
 	dir = gpiod_get_direction(desc);
@@ -176,6 +215,8 @@ static int gpio_shared_proxy_direction_input(struct gpio_chip *gc,
 		return -EPERM;
 	}
 
+	gpio_shared_proxy_mark_configured(proxy);
+
 	return 0;
 }
 
@@ -189,18 +230,20 @@ static int gpio_shared_proxy_direction_output(struct gpio_chip *gc,
 
 	guard(mutex)(&shared_desc->mutex);
 
-	if (shared_desc->usecnt == 1) {
+	if (gpio_shared_proxy_may_init(proxy)) {
 		dev_dbg(proxy->dev,
-			"Only one user of this shared GPIO, allowing to set direction to output with value '%s'\n",
+			"No other user configured this shared GPIO, allowing to set direction to output with value '%s'\n",
 			str_high_low(value));
 
 		ret = gpiod_direction_output(desc, value);
 		if (ret)
 			return ret;
 
+		/* Only this proxy can have voted, so the tally is ours to reset */
 		shared_desc->def_val = value;
 		shared_desc->votecnt = 0;
 		proxy->voted_change = false;
+		gpio_shared_proxy_mark_configured(proxy);
 
 		return 0;
 	}
@@ -215,7 +258,13 @@ static int gpio_shared_proxy_direction_output(struct gpio_chip *gc,
 		return -EPERM;
 	}
 
-	return gpio_shared_proxy_set_unlocked(proxy, value);
+	ret = gpio_shared_proxy_set_unlocked(proxy, value);
+	if (ret)
+		return ret;
+
+	gpio_shared_proxy_mark_configured(proxy);
+
+	return 0;
 }
 
 static int gpio_shared_proxy_get_cansleep(struct gpio_chip *gc,
@@ -230,10 +279,21 @@ static int gpio_shared_proxy_set_cansleep(struct gpio_chip *gc,
 					  unsigned int offset, int value)
 {
 	struct gpio_shared_proxy_data *proxy = gpiochip_get_data(gc);
+	int ret;
 
 	guard(mutex)(&proxy->shared_desc->mutex);
 
-	return gpio_shared_proxy_set_unlocked(proxy, value);
+	/*
+	 * A GPIOD_ASIS consumer may vote without ever setting the direction;
+	 * count it as configured so a later user can't reset its vote.
+	 */
+	ret = gpio_shared_proxy_set_unlocked(proxy, value);
+	if (ret)
+		return ret;
+
+	gpio_shared_proxy_mark_configured(proxy);
+
+	return 0;
 }
 
 static int gpio_shared_proxy_get_direction(struct gpio_chip *gc,
diff --git a/drivers/gpio/gpiolib-shared.h b/drivers/gpio/gpiolib-shared.h
index 618756f6c6aaf..ae10506b7029f 100644
--- a/drivers/gpio/gpiolib-shared.h
+++ b/drivers/gpio/gpiolib-shared.h
@@ -41,6 +41,7 @@ struct gpio_shared_desc {
 	struct gpio_desc *desc;
 	unsigned long cfg;
 	unsigned int usecnt;
+	unsigned int cfgcnt;
 	unsigned int votecnt;
 	int def_val;
 	struct mutex mutex; /* serializes all proxy operations on this descriptor */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0129/1005] gpio: shared-proxy: Drop the vote of a released proxy on write failure
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (127 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0128/1005] gpio: shared-proxy: Fix race between concurrent first users Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0130/1005] gpio: shared-proxy: Drive the default value when no votes are cast Greg Kroah-Hartman
                   ` (244 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shawn Guo, Bartosz Golaszewski,
	Sasha Levin

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

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

From: Shawn Guo <shengchao.guo@oss.qualcomm.com>

[ Upstream commit 53b7b1201964f6f147fa0fa2f61194403a65cdf0 ]

When a proxy that voted for a value change frees the line, it calls
gpio_shared_proxy_set_unlocked() to withdraw its vote. If it is the
last voter and restoring the default value fails, that function
returns early, leaving votecnt incremented and voted_change set.

The consumer is gone, but its vote is not. The line is held at the
non-default value for all remaining users, since votecnt can never
drop to zero again. And the proxy data outlives the request, so
voted_change is still set when the line is requested again. If
another user has reinitialized the line in between, resetting
votecnt to 0, the stale proxy's next vote for the default value
decrements votecnt from 0 and underflows it.

Drop the vote unconditionally on release, after reporting the
failure, since the consumer is going away regardless.

Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver")
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20261028123448.510401-3-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-shared-proxy.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-shared-proxy.c b/drivers/gpio/gpio-shared-proxy.c
index 2e9ccd8a8d835..4eae3c9a5168e 100644
--- a/drivers/gpio/gpio-shared-proxy.c
+++ b/drivers/gpio/gpio-shared-proxy.c
@@ -138,9 +138,13 @@ static void gpio_shared_proxy_free(struct gpio_chip *gc, unsigned int offset)
 
 	if (proxy->voted_change) {
 		ret = gpio_shared_proxy_set_unlocked(proxy, shared_desc->def_val);
-		if (ret)
+		if (ret) {
 			dev_err(proxy->dev,
 				"Failed to unset the shared GPIO value on release: %d\n", ret);
+			/* The consumer is going away regardless, drop its vote */
+			shared_desc->votecnt--;
+			proxy->voted_change = false;
+		}
 	}
 
 	proxy->shared_desc->usecnt--;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0130/1005] gpio: shared-proxy: Drive the default value when no votes are cast
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (128 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0129/1005] gpio: shared-proxy: Drop the vote of a released proxy on write failure Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0131/1005] gpio: shared-proxy: Drop the vote when switching to input Greg Kroah-Hartman
                   ` (243 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shawn Guo, Bartosz Golaszewski,
	Sasha Levin

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

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

From: Shawn Guo <shengchao.guo@oss.qualcomm.com>

[ Upstream commit 0bc45604403176722e634e670f5e38de0aa42a9b ]

A consumer that requests a shared line with GPIOD_ASIS never calls
direction_output(), so def_val keeps its initial value of 0. If the
line was left high, for instance by the bootloader, a later
gpiod_set_value(0) from that consumer matches def_val and the proxy
treats it as withdrawing a vote it never cast. It returns success
without writing the hardware, and the line stays high.

The consumer has no way to tell. Its request to drive the line low is
silently ignored until it first votes for high and then withdraws
that vote.

When the requested value is the default and no votes are
outstanding, write it to the hardware instead of returning early.
With votes outstanding the request remains a no-op, as the line must
stay at the voted value.

Do this for all lines, not only GPIOD_ASIS ones. A line configured via
direction_output() can be left at the non-default value as well: when
a proxy releases the line and restoring the default fails, its vote is
dropped regardless, leaving votecnt at 0 with the line at the voted
value. The write lets any remaining user bring it back to the default.
In the common case it is a redundant write of the value the line
already has, and it only happens when a proxy that has not voted sets
the default.

Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver")
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20261028123448.510401-4-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-shared-proxy.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-shared-proxy.c b/drivers/gpio/gpio-shared-proxy.c
index 4eae3c9a5168e..75d0d617941f2 100644
--- a/drivers/gpio/gpio-shared-proxy.c
+++ b/drivers/gpio/gpio-shared-proxy.c
@@ -85,9 +85,16 @@ gpio_shared_proxy_set_unlocked(struct gpio_shared_proxy_data *proxy, int value)
 	}
 
 	/* Desired value is the default. */
-	if (!proxy->voted_change)
-		/* We didn't vote for change previously, nothing to do. */
+	if (!proxy->voted_change) {
+		/*
+		 * With no votes outstanding the line should be at the
+		 * default, but a GPIOD_ASIS line may have been left at the
+		 * opposite value. Drive it there.
+		 */
+		if (!shared_desc->votecnt)
+			ret = gpiod_set_value_cansleep(desc, shared_desc->def_val);
 		goto out;
+	}
 
 	/* We previously voted for change. */
 	if (shared_desc->votecnt == 1) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0131/1005] gpio: shared-proxy: Drop the vote when switching to input
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (129 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0130/1005] gpio: shared-proxy: Drive the default value when no votes are cast Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0132/1005] ipv6: fix fib6 walker UAF on NLM_F_REPLACE Greg Kroah-Hartman
                   ` (242 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shawn Guo, Bartosz Golaszewski,
	Sasha Levin

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

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

From: Shawn Guo <shengchao.guo@oss.qualcomm.com>

[ Upstream commit 925409db963dbae4628d522bc6b14985e749c08b ]

A proxy that is the only one to have configured a shared line may
reinitialize it. When it sets the direction to output, the proxy
resets the vote tally, but when it sets the direction to input, it
leaves any vote it cast in place, although an input line carries no
value.

That vote outlives its meaning. When the consumer releases the line,
gpio_shared_proxy_free() tries to withdraw it by writing the default
value, which gpiolib refuses on an input line:

  Failed to unset the shared GPIO value on release: -1

This happens, for instance, when a consumer votes for a change with
gpiod_set_value() after setting the line to output and then switches
it to input.

Clear the vote when the proxy reinitializes the line as input, as
the output path already does. No other proxy can hold a vote at that
point: voting marks a proxy configured, and a proxy that frees the
line drops its vote.

Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver")
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20261028123448.510401-5-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-shared-proxy.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/gpio-shared-proxy.c b/drivers/gpio/gpio-shared-proxy.c
index 75d0d617941f2..b2f2301e9e64c 100644
--- a/drivers/gpio/gpio-shared-proxy.c
+++ b/drivers/gpio/gpio-shared-proxy.c
@@ -211,6 +211,9 @@ static int gpio_shared_proxy_direction_input(struct gpio_chip *gc,
 		if (ret)
 			return ret;
 
+		/* An input carries no value, drop any vote this proxy cast */
+		shared_desc->votecnt = 0;
+		proxy->voted_change = false;
 		gpio_shared_proxy_mark_configured(proxy);
 
 		return 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0132/1005] ipv6: fix fib6 walker UAF on NLM_F_REPLACE
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (130 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0131/1005] gpio: shared-proxy: Drop the vote when switching to input Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0133/1005] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
                   ` (241 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
	Cen Zhang (Microsoft), Ido Schimmel, Dave Miller, Sasha Levin

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

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

From: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>

[ Upstream commit 23fec4bd76904e9df7a8cc0a81ceb14c36971da4 ]

fib6_walker uses w->leaf to remember the next fib6_info to dump, so an
RTM_GETROUTE dump can continue there on the next recvmsg().  This
assumes that whoever removes a route from the tree also updates the
walkers pointing at it.  fib6_del_route() does: it moves w->leaf to
the next route.  The NLM_F_REPLACE branch of fib6_add_rt2node() does
not: it removes the old route, fib6_add() frees it, and w->leaf keeps
pointing at the freed object.

The fn_sernum version check in fib6_dump_table() normally protects
against resuming on a stale w->leaf, but it can be bypassed:
ip6_link_failure() resets fn_sernum to -1 when the default route
fails, which an unprivileged user in a user+net namespace can cause:

  1) link failure            fn_sernum = -1
  2) dump pauses on route R
  3) replace R               fn_sernum changed, R freed
  4) link failure            fn_sernum = -1
  5) dump resumes            -1 == -1, reads freed R  <- UAF

  BUG: KASAN: slab-use-after-free in rt6_fill_node+0x1c22/0x2cd0
  Read of size 4 at addr ff11000011fa0064 by task poc/101
   rt6_fill_node <- rt6_dump_route

Fix by adjusting walkers separately for replacement and deletion.
For replacement, add fib6_walkers_replace_leaf() points w->leaf
at the new route. For deletion and ECMP sibling removal,
fib6_walkers_skip_rt() calls fib6_walkers_replace_leaf() with the
next route. Reset w->skip_in_node when updating w->leaf, and set
w->state to FWS_U when no next route remains.

Fixes: 4a287eba2de3 ("IPv6 routing, NLM_F_* flag support: REPLACE and EXCL flags support, warn about missing CREATE flag")
Cc: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/ip6_fib.c | 50 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index ef65dd9870ea3..2e1d8ab25f778 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -89,6 +89,40 @@ static void fib6_walker_unlink(struct net *net, struct fib6_walker *w)
 	write_unlock_bh(&net->ipv6.fib6_walker_lock);
 }
 
+/* @old is leaving the tree.  Walkers resting on it continue from @new, or
+ * climb to the parent node when there is no @new.  Called with tb6_lock
+ * held.
+ */
+static void fib6_walkers_replace_leaf(struct net *net, struct fib6_info *old,
+				      struct fib6_info *new)
+{
+	struct fib6_walker *w;
+
+	read_lock(&net->ipv6.fib6_walker_lock);
+	FOR_WALKERS(net, w) {
+		if (w->state == FWS_C && w->leaf == old) {
+			pr_debug("walker %p adjusted by unlink of %p\n", w, old);
+			w->leaf = new;
+			w->skip_in_node = 0;
+			if (!new)
+				w->state = FWS_U;
+		}
+	}
+	read_unlock(&net->ipv6.fib6_walker_lock);
+}
+
+/* @rt is removed from its node: walkers resting on it continue from the
+ * next route of the node.
+ */
+static void fib6_walkers_skip_rt(struct net *net, struct fib6_info *rt)
+{
+	struct fib6_info *next;
+
+	next = rcu_dereference_protected(rt->fib6_next,
+					 lockdep_is_held(&rt->fib6_table->tb6_lock));
+	fib6_walkers_replace_leaf(net, rt, next);
+}
+
 static int fib6_new_sernum(struct net *net)
 {
 	int new, old = atomic_read(&net->ipv6.fib6_sernum);
@@ -1312,6 +1346,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
 		rcu_assign_pointer(rt->fib6_node, fn);
 		rt->fib6_next = iter->fib6_next;
 		rcu_assign_pointer(*ins, rt);
+		fib6_walkers_replace_leaf(info->nl_net, iter, rt);
 		if (!info->skip_notify)
 			inet6_rt_notify(RTM_NEWROUTE, rt, info, NLM_F_REPLACE);
 		if (!(fn->fn_flags & RTN_RTINFO)) {
@@ -1333,6 +1368,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct fib6_info *rt,
 				if (iter->fib6_metric > rt->fib6_metric)
 					break;
 				if (rt6_qualify_for_ecmp(iter)) {
+					fib6_walkers_skip_rt(info->nl_net, iter);
 					*ins = iter->fib6_next;
 					iter->fib6_node = NULL;
 					list_add(&iter->purge_link, purge_list);
@@ -1967,7 +2003,6 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
 			   enum rt_del_reason del_reason)
 {
 	struct fib6_info *leaf, *replace_rt = NULL;
-	struct fib6_walker *w;
 	struct fib6_info *rt = rcu_dereference_protected(*rtp,
 				    lockdep_is_held(&table->tb6_lock));
 	struct net *net = info->nl_net;
@@ -2018,18 +2053,7 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
 		rt6_multipath_rebalance(next_sibling);
 	}
 
-	/* Adjust walkers */
-	read_lock(&net->ipv6.fib6_walker_lock);
-	FOR_WALKERS(net, w) {
-		if (w->state == FWS_C && w->leaf == rt) {
-			pr_debug("walker %p adjusted by delroute\n", w);
-			w->leaf = rcu_dereference_protected(rt->fib6_next,
-					    lockdep_is_held(&table->tb6_lock));
-			if (!w->leaf)
-				w->state = FWS_U;
-		}
-	}
-	read_unlock(&net->ipv6.fib6_walker_lock);
+	fib6_walkers_skip_rt(net, rt);
 
 	/* If it was last route, call fib6_repair_tree() to:
 	 * 1. For root node, put back null_entry as how the table was created.
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0133/1005] tcp: do not let tcp_collapse() drive sk_forward_alloc negative
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (131 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0132/1005] ipv6: fix fib6 walker UAF on NLM_F_REPLACE Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0134/1005] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
                   ` (240 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
	Octavian Purdila, Dave Miller, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit 031c403d13e5046750e2abebd4e770631e7c4627 ]

tcp_collapse() charges each newly allocated skb with skb_set_owner_r()
before the skbs it replaces are freed, without scheduling memory first.

Since sk_mem_uncharge() reclaims eagerly, sk->sk_forward_alloc has no
cushion and can become negative. This can be durable when the collapsed
skbs had a high payload/truesize ratio or were partially read, because
the new skbs can have a bigger total truesize than the old ones.

A negative sk_forward_alloc then confuses tcp_wmem_schedule(), which
can return a negative length to tcp_sendmsg_locked(), triggering
a WARN_ON_ONCE(bytes > INT_MAX) in check_copy_size().

Call sk_forced_mem_schedule() before charging nskb.

Fixes: 4890b686f408 ("net: keep sk->sk_forward_alloc as small as possible")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Octavian Purdila <tavip@google.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/tcp_input.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 3583867487d7f..8efa1cf5a67cd 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5846,6 +5846,10 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list, struct rb_root *root,
 			__skb_queue_before(list, skb, nskb);
 		else
 			__skb_queue_tail(&tmp, nskb); /* defer rbtree insertion */
+		/* nskb is charged before the skbs it replaces are freed.
+		 * Make sure sk->sk_forward_alloc can not become negative.
+		 */
+		sk_forced_mem_schedule(sk, nskb->truesize);
 		skb_set_owner_r(nskb, sk);
 		mptcp_skb_ext_move(nskb, skb);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0134/1005] ata: libata-sata: allow re-enabling NCQ with the same queue_depth
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (132 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0133/1005] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0135/1005] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
                   ` (239 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Igor Pylypiv, Niklas Cassel,
	Sasha Levin

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

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

From: Igor Pylypiv <ipylypiv@google.com>

[ Upstream commit d7c5cc8cc21c1264cce07feb4a51be158688280e ]

When ata_eh_speed_down() disables NCQ due to excessive errors, it sets
ATA_DFLAG_NCQ_OFF without changing sdev->queue_depth. Userspace can
re-enable NCQ by writing a queue depth > 1 to the sysfs queue_depth
attribute, which invokes ata_change_queue_depth() to clear
ATA_DFLAG_NCQ_OFF.

However, ata_change_queue_depth() returns early if the requested
queue_depth is equal to sdev->queue_depth before clearing
ATA_DFLAG_NCQ_OFF. As a result, writing a different queue depth > 1
re-enables NCQ, whereas writing the current sdev->queue_depth value
leaves ATA_DFLAG_NCQ_OFF set.

Since ata_change_queue_depth() already checks whether queue_depth equals
sdev->queue_depth before calling scsi_change_queue_depth(), remove the
early check so that writing the current queue_depth > 1 clears
ATA_DFLAG_NCQ_OFF and re-enables NCQ.

Fixes: 45623d33bfc0 ("ata: libata-sata: Improve ata_change_queue_depth()")
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20261029184445.1615717-1-ipylypiv@google.com
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-sata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
index ad40f516c6d43..7078f168def80 100644
--- a/drivers/ata/libata-sata.c
+++ b/drivers/ata/libata-sata.c
@@ -1287,7 +1287,7 @@ int ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
 	spin_lock_irqsave(ap->lock, flags);
 
 	dev = ata_scsi_find_dev(ap, sdev);
-	if (!dev || queue_depth < 1 || queue_depth == sdev->queue_depth) {
+	if (!dev || queue_depth < 1) {
 		spin_unlock_irqrestore(ap->lock, flags);
 		return sdev->queue_depth;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0135/1005] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (133 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0134/1005] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0136/1005] net: stmmac: take ownership of saved RX state at poll entry Greg Kroah-Hartman
                   ` (238 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Igor Pylypiv, Niklas Cassel,
	Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 597be4104c4045d73979c05307fa5fc778d1dbde ]

When a failed command has valid sense data, ata_eh_analyze_tf() asks
scsi_check_sense() whether the command should be retried, and sets
ATA_QCFLAG_RETRY if it should. ata_eh_link_autopsy() then clears
AC_ERR_DEV and AC_ERR_OTHER from qc->err_mask, relying on that decision.

For an NCQ command, qc->err_mask still has AC_ERR_NCQ, so
ata_eh_finish() honors ATA_QCFLAG_RETRY. For a non-NCQ command, whose
sense data comes from REQUEST SENSE DATA EXT, qc->err_mask is now zero,
and ata_eh_finish() completes the command with scmd->retries set to
scmd->allowed, without looking at ATA_QCFLAG_RETRY. Such a command is
thus never retried, even when its sense data asks for a retry, e.g. a
transient error reported as ABORTED COMMAND.

Make ata_eh_finish() honor ATA_QCFLAG_RETRY for commands with valid
sense data. ata_eh_qc_retry() cannot be used for this: as qc->err_mask
is zero, it increments scmd->allowed, so every retry would allow one
more, and a persistent error would be retried forever. Instead,
complete the command without touching scmd->allowed or scmd->retries,
so that the SCSI midlayer retries it at most scmd->allowed times, like
any other failed command.

Fixes: 3852e3738266 ("libata: evaluate SCSI sense code")
Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
Link: https://lore.kernel.org/r/20261030090047.407906-2-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-eh.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index c93c24b22d9ca..fd7ce2abfbcfd 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -4077,8 +4077,20 @@ void ata_eh_finish(struct ata_port *ap)
 				ata_eh_qc_complete(qc);
 			}
 		} else {
-			if (qc->flags & ATA_QCFLAG_SENSE_VALID ||
-			    qc->flags & ATA_QCFLAG_EH_SUCCESS_CMD) {
+			if (qc->flags & ATA_QCFLAG_SENSE_VALID &&
+			    qc->flags & ATA_QCFLAG_RETRY) {
+				/*
+				 * The sense data asks for a retry, see
+				 * ata_eh_analyze_tf(). ata_eh_link_autopsy()
+				 * cleared qc->err_mask, so ata_eh_qc_retry()
+				 * would increment scmd->allowed. Leave
+				 * scmd->allowed alone, so that upper layer
+				 * only retries the command if it has not
+				 * already been retried too many times.
+				 */
+				__ata_eh_qc_complete(qc);
+			} else if (qc->flags & ATA_QCFLAG_SENSE_VALID ||
+				   qc->flags & ATA_QCFLAG_EH_SUCCESS_CMD) {
 				ata_eh_qc_complete(qc);
 			} else {
 				/* feed zero TF to sense generation */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0136/1005] net: stmmac: take ownership of saved RX state at poll entry
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (134 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0135/1005] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0137/1005] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
                   ` (237 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, James Hilliard, Nicolai Buchwitz,
	Lorenzo Bianconi, Paolo Abeni, Sasha Levin

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

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

From: James Hilliard <james.hilliard1@gmail.com>

[ Upstream commit 26219e9402c22181f021034f127a8e278d40545f ]

When a saved partial packet completes with a poll budget of one, the
old loop can leave state_saved and state.skb pointing at an skb that
has already been delivered or freed. The next poll then reuses that
pointer, causing a use-after-free or double free.

Take the saved state at poll entry and clear the stored ownership
immediately. Save it again only if the packet remains incomplete,
including when the next descriptor is still DMA-owned.

Track the frame-in-progress flag independently of the status read from
the next descriptor. The old code keyed the save on the status of the
last descriptor looked at, so a loop stopped at a DMA-owned descriptor
(rx status not yet valid) could drop the saved error/length bookkeeping
in stmmac_rx_zc().

Drop the saved state both when the queue parameters are reset and when
the ring is destroyed. stmmac_reset_rx_queue() is reached from
__stmmac_open(), stmmac_xdp_open(), stmmac_resume() and
stmmac_enable_rx_queue(); without draining it there, a partial frame
saved before suspend (or before a queue is disabled and re-enabled)
survives while cur_rx and dirty_rx are rewound to zero. On the resume
path the ring is only re-armed in place: stmmac_clear_descriptors()
sets the ownership bits and stmmac_init_dma_engine() restores the tail
pointer, but the RX buffer addresses are not reprogrammed. The first
poll would then resume the stale skb against a ring position that no
longer matches the descriptors it was built from.
__free_dma_rx_desc_resources() releases it on teardown.

Apply the same state handling to stmmac_rx_zc(), which also leaves
state_saved set when a saved frame finishes at the budget boundary.
That path saves only error and length bookkeeping, not an skb pointer.

Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support")
Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Co-developed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-1-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 72 +++++++++++--------
 1 file changed, 42 insertions(+), 30 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8a8e9f71e6f98..c637305fdb36d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2151,6 +2151,9 @@ static void __free_dma_rx_desc_resources(struct stmmac_priv *priv,
 	else
 		dma_free_rx_skbufs(priv, dma_conf, queue);
 
+	dev_kfree_skb_any(rx_q->state.skb);
+	rx_q->state.skb = NULL;
+	rx_q->state_saved = false;
 	rx_q->buf_alloc_num = 0;
 	rx_q->xsk_pool = NULL;
 
@@ -5536,12 +5539,12 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
 	unsigned int count = 0, error = 0, len = 0;
 	int dirty = stmmac_rx_dirty(priv, queue);
 	unsigned int next_entry = rx_q->cur_rx;
+	bool in_progress = rx_q->state_saved;
 	u32 rx_errors = 0, rx_dropped = 0;
 	unsigned int desc_size;
 	struct bpf_prog *prog;
 	bool failure = false;
 	int xdp_status = 0;
-	int status = 0;
 
 	if (netif_msg_rx_status(priv)) {
 		void *rx_head = stmmac_get_rx_desc(priv, rx_q, 0);
@@ -5552,23 +5555,25 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
 		stmmac_display_ring(priv, rx_head, priv->dma_conf.dma_rx_size, true,
 				    rx_q->dma_rx_phy, desc_size);
 	}
+
+	if (rx_q->state_saved) {
+		error = rx_q->state.error;
+		len = rx_q->state.len;
+		rx_q->state_saved = false;
+	}
+
 	while (count < limit) {
 		struct stmmac_rx_buffer *buf;
 		struct stmmac_xdp_buff *ctx;
 		unsigned int buf1_len = 0;
 		struct dma_desc *np, *p;
-		int entry;
+		int entry, status;
 		int res;
 
-		if (!count && rx_q->state_saved) {
-			error = rx_q->state.error;
-			len = rx_q->state.len;
-		} else {
-			rx_q->state_saved = false;
+		if (!in_progress) {
 			error = 0;
 			len = 0;
 		}
-
 read_again:
 		if (count >= limit)
 			break;
@@ -5607,6 +5612,8 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
 		if (!buf->xdp)
 			break;
 
+		in_progress = status & rx_not_ls;
+
 		if (priv->extend_desc) {
 			/* Read the extended status after the own bit */
 			dma_rmb();
@@ -5683,7 +5690,7 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
 		count++;
 	}
 
-	if (status & rx_not_ls) {
+	if (in_progress) {
 		rx_q->state_saved = true;
 		rx_q->state.error = error;
 		rx_q->state.len = len;
@@ -5725,9 +5732,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 	struct stmmac_rx_queue *rx_q = &priv->dma_conf.rx_queue[queue];
 	struct stmmac_channel *ch = &priv->channel[queue];
 	unsigned int count = 0, error = 0, len = 0;
-	int status = 0, coe = priv->hw->rx_csum;
 	unsigned int next_entry = rx_q->cur_rx;
+	bool in_progress = rx_q->state_saved;
 	enum dma_data_direction dma_dir;
+	int coe = priv->hw->rx_csum;
 	unsigned int desc_size;
 	struct sk_buff *skb = NULL;
 	struct stmmac_xdp_buff ctx;
@@ -5747,25 +5755,28 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 		stmmac_display_ring(priv, rx_head, priv->dma_conf.dma_rx_size, true,
 				    rx_q->dma_rx_phy, desc_size);
 	}
+
+	if (rx_q->state_saved) {
+		skb = rx_q->state.skb;
+		error = rx_q->state.error;
+		len = rx_q->state.len;
+		rx_q->state.skb = NULL;
+		rx_q->state_saved = false;
+	}
+
 	while (count < limit) {
 		unsigned int buf1_len = 0, buf2_len = 0;
 		enum pkt_hash_types hash_type;
 		struct stmmac_rx_buffer *buf;
 		struct dma_desc *np, *p;
-		int entry;
+		int entry, status;
 		u32 hash;
 
-		if (!count && rx_q->state_saved) {
-			skb = rx_q->state.skb;
-			error = rx_q->state.error;
-			len = rx_q->state.len;
-		} else {
-			rx_q->state_saved = false;
+		if (!in_progress) {
 			skb = NULL;
 			error = 0;
 			len = 0;
 		}
-
 read_again:
 		if (count >= limit)
 			break;
@@ -5794,6 +5805,8 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 
 		prefetch(np);
 
+		in_progress = status & rx_not_ls;
+
 		if (priv->extend_desc) {
 			/* Read the extended status after the own bit */
 			dma_rmb();
@@ -5811,11 +5824,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 
 		if (unlikely(error && (status & rx_not_ls)))
 			goto read_again;
+
 		if (unlikely(error)) {
 			dev_kfree_skb(skb);
-			skb = NULL;
-			count++;
-			continue;
+			goto next;
 		}
 
 		/* Buffer is good. Go on. */
@@ -5889,9 +5901,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 						      STMMAC_XDP_REDIRECT)) {
 					xdp_status |= xdp_res;
 					buf->page = NULL;
-					skb = NULL;
-					count++;
-					continue;
+					goto next;
 				}
 			}
 		}
@@ -5948,10 +5958,8 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 		/* Remove FCS if needed */
 		if (!fcs_stripped && pskb_trim(skb, len)) {
 			dev_kfree_skb_any(skb);
-			skb = NULL;
 			rx_dropped++;
-			count++;
-			continue;
+			goto next;
 		}
 
 		stmmac_get_rx_hwtstamp(priv, p, np, skb);
@@ -5976,14 +5984,15 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 
 		skb_record_rx_queue(skb, queue);
 		napi_gro_receive(&ch->rx_napi, skb);
-		skb = NULL;
-
 		rx_packets++;
 		rx_bytes += len;
+next:
+		in_progress = false;
+		skb = NULL;
 		count++;
 	}
 
-	if (status & rx_not_ls || skb) {
+	if (in_progress || skb) {
 		rx_q->state_saved = true;
 		rx_q->state.skb = skb;
 		rx_q->state.error = error;
@@ -8295,6 +8304,9 @@ static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
 {
 	struct stmmac_rx_queue *rx_q = &priv->dma_conf.rx_queue[queue];
 
+	dev_kfree_skb_any(rx_q->state.skb);
+	rx_q->state.skb = NULL;
+	rx_q->state_saved = false;
 	rx_q->cur_rx = 0;
 	rx_q->dirty_rx = 0;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0137/1005] net: stmmac: drop split frames on AF_XDP zero-copy RX
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (135 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0136/1005] net: stmmac: take ownership of saved RX state at poll entry Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0138/1005] net: stmmac: drop multi-buffer frames in XDP mode Greg Kroah-Hartman
                   ` (236 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, Lorenzo Bianconi,
	Paolo Abeni, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 834ec95308320cbd8c162d86788ab95cc3fd6bf8 ]

stmmac_rx_zc() assumes a 1:1 mapping between a received frame and an
XSK pool buffer and drops any frame that spans more than one RX
descriptor:

        /* XSK pool expects RX frame 1:1 mapped to XSK buffer */
        if (likely(status & rx_not_ls)) {
                xsk_buff_free(buf->xdp);
                buf->xdp = NULL;
                dirty++;
                count++;
                goto read_again;
        }

The non-last descriptors are freed and dropped, but the frame is not
marked as errored. When the poll reaches the last descriptor of the
same frame, error is still 0, so the fragment is handled as a complete
frame: it is passed to the XDP program, copied into an skb on XDP_PASS,
or converted for XDP_TX. The tail starts in the middle of the original
payload at a predictable offset and, parsed as a fresh frame (len == 0),
stmmac_rx_buf1_len() reports the full dma_buf_sz length for it even
though the DMA engine only wrote the tail remainder into that buffer, so
the reads extend past the received bytes and can reach beyond the end of
the XSK pool buffer. GMAC4 always enables jumbo frames (GMAC_CONFIG_JE
in GMAC_CORE_INIT), so an on-link peer can trigger such a split even
when the interface MTU is left at 1500.

Set error when the 1:1 mapping check drops a descriptor, so the
remaining descriptors of the frame - including the last one - are
drained and released with xsk_buff_free() instead of being processed as
a new frame. Account every freed buffer with dirty and count the
dropped frame once in the poll budget / rx_pkt_n. The direct 1:1
mapping drop also increments rx_dropped.

Use a bit test instead of an equality test for discard_frame.
Commit 644b8437ccef9e ("net: stmmac: dwmac4: report Rx checksum errors
in status") made dwmac4_wrback_get_rx_status() set discard_frame on
RDES3_ERROR_SUMMARY and OR in csum_none on RDES1_IP_HDR_ERROR or
RDES1_IP_PAYLOAD_ERROR, so it can return discard_frame | csum_none.
The old "status == discard_frame" test missed that value and delivered
frames with CRC, overflow, watchdog or giant errors to the stack in
stmmac_rx() - or to XDP/XSK in stmmac_rx_zc() - when they also failed
the IP checksum. The change therefore affects the regular RX path, not
only zero-copy. The bit test is also required for the
discard_frame | rx_not_ls value returned for non-last legacy
descriptors below.

Normalize the legacy normal and enhanced descriptor callbacks to report
rx_not_ls together with discard_frame for non-last descriptors. This
allows both stmmac_rx_zc() and stmmac_rx() to drain split frames on
dwmac100 and dwmac1000 instead of reparsing the final fragment as a new
packet.

Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy")
Fixes: 644b8437ccef9e ("net: stmmac: dwmac4: report Rx checksum errors in status")
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-2-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/ethernet/stmicro/stmmac/enh_desc.c    |  2 +-
 .../net/ethernet/stmicro/stmmac/norm_desc.c   |  2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 21 ++++++++++++-------
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
index 023b54b72478f..7ece8d4157a86 100644
--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
@@ -205,7 +205,7 @@ static int enh_desc_get_rx_status(struct stmmac_extra_stats *x,
 
 	if (unlikely(!(rdes0 & RDES0_LAST_DESCRIPTOR))) {
 		x->rx_length++;
-		return discard_frame;
+		return discard_frame | rx_not_ls;
 	}
 
 	if (unlikely(rdes0 & RDES0_ERROR_SUMMARY)) {
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index c4b613564f87c..d19bf7ca4db38 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -70,7 +70,7 @@ static int ndesc_get_rx_status(struct stmmac_extra_stats *x,
 
 	if (unlikely(!(rdes0 & RDES0_LAST_DESCRIPTOR))) {
 		x->rx_length++;
-		return discard_frame;
+		return discard_frame | rx_not_ls;
 	}
 
 	if (unlikely(rdes0 & RDES0_ERROR_SUMMARY)) {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c637305fdb36d..0d5215860b6d5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5621,18 +5621,21 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
 							   &rx_q->dma_erx[entry],
 							   status);
 		}
-		if (unlikely(status == discard_frame)) {
-			xsk_buff_free(buf->xdp);
-			buf->xdp = NULL;
-			dirty++;
+
+		if (unlikely(!error && (status & discard_frame))) {
 			error = 1;
 			if (!priv->hwts_rx_en)
 				rx_errors++;
 		}
 
-		if (unlikely(error && (status & rx_not_ls)))
-			goto read_again;
 		if (unlikely(error)) {
+			xsk_buff_free(buf->xdp);
+			buf->xdp = NULL;
+			dirty++;
+
+			if (status & rx_not_ls)
+				goto read_again;
+
 			count++;
 			continue;
 		}
@@ -5641,8 +5644,9 @@ static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
 		if (likely(status & rx_not_ls)) {
 			xsk_buff_free(buf->xdp);
 			buf->xdp = NULL;
+			rx_dropped++;
+			error = 1;
 			dirty++;
-			count++;
 			goto read_again;
 		}
 
@@ -5814,7 +5818,8 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 							   &rx_q->dma_erx[entry],
 							   status);
 		}
-		if (unlikely(status == discard_frame)) {
+
+		if (unlikely(status & discard_frame)) {
 			page_pool_put_page(rx_q->page_pool, buf->page, 0, true);
 			buf->page = NULL;
 			error = 1;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0138/1005] net: stmmac: drop multi-buffer frames in XDP mode
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (136 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0137/1005] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0139/1005] net: stmmac: copy XDP metadata in AF_XDP zero-copy RX Greg Kroah-Hartman
                   ` (235 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, Lorenzo Bianconi,
	Paolo Abeni, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 52ffd771e0029c5ad0504b1b4a8b7f932b65eea3 ]

stmmac_rx() runs the XDP program once per descriptor buffer and uses
skb == NULL as the only marker for the start of a frame. A frame larger
than one buffer is split by the hardware across several descriptors;
GMAC4 enables jumbo frames unconditionally (GMAC_CONFIG_JE in
GMAC_CORE_INIT), so an on-link peer can deliver such a frame even when
the interface MTU is left at 1500.

When an XDP verdict ends a non-last descriptor, skb is cleared and the
next descriptor of the same hardware frame is parsed as a new frame.
For XDP_CONSUMED this happens via read_again with len preserved, so
stmmac_rx_buf1_len() then returns min(dma_buf_sz, plen - len) for the
last descriptor, which can be as small as 0-3 bytes. buf1_len -=
ETH_FCS_LEN underflows and xdp_prepare_buff() puts data_end far past
data; on XDP_PASS this produces an skb whose length is close to 4G that
reaches the network stack (skb->tail and skb->len are 32-bit and wrap
below skb->end, so skb_over_panic() does not fire). A 4+ byte tail is
instead offered to the XDP program and delivered as a standalone
mid-payload Ethernet frame on XDP_PASS. XDP_TX/XDP_REDIRECT instead
falls through to the next iteration, resetting the running length, so
the tail is re-parsed as a full-size new frame.

The same fault exists when a single descriptor uses its second buffer:
buffer2 is now handed to the hardware for non-SPH frames on GMAC4/XGMAC,
so a frame up to 2 * dma_buf_sz can land on a single descriptor while the
XDP program still only sees the first buffer. XDP_TX then transmits a
truncated frame, and XDP_PASS appends the second buffer only after the
program has already run over the first one.

XDP does not support scatter-gather frames until the multi-buffer
rework, so drop the whole frame instead. When a non-last descriptor is
seen while an XDP program is attached, mark the frame as errored and
drain the remaining descriptors, including the last. A descriptor that
uses its second buffer is dropped directly before the program runs as
well; in XDP mode it is necessarily the last descriptor of the frame,
so it does not need the error marker. Removing the re-parse lets both
XDP verdict branches simply complete the packet via next.

The buffers consumed by the discard path are no longer returned to the
page pool, and the new SG and second-buffer drops do not return them
either. They stay in rx_q->buf_pool[] and stmmac_rx_refill() reuses them
in place, allocating only when a slot is empty. This is safe because the
drop checks run before the buffer is synced for CPU access or
prefetched. The discard-path change and the in-place reuse apply with or
without an XDP program attached.

The !error guard on the discard check also changes the accounting for
errored multi-descriptor frames on dwmac100/dwmac1000: rx_errors is
incremented once per frame instead of once per descriptor. This too is
independent of XDP mode.

Note: the subsequent "net: stmmac: rework stmmac_rx to support XDP rx
multi-buff" accumulates the whole frame into a single xdp_buff and
supersedes this patch; the fix is kept so the net portion of the series
stands on its own.

Fixes: 5fabb01207a2 ("net: stmmac: Add initial XDP support")
Fixes: 88095728511e ("net: stmmac: fix rx Scatter-Gather support")
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-3-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 35 ++++++++++---------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 0d5215860b6d5..519b166b58c37 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5819,18 +5819,23 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 							   status);
 		}
 
-		if (unlikely(status & discard_frame)) {
-			page_pool_put_page(rx_q->page_pool, buf->page, 0, true);
-			buf->page = NULL;
+		if (unlikely(!error && (status & discard_frame))) {
 			error = 1;
 			if (!priv->hwts_rx_en)
 				rx_errors++;
 		}
 
-		if (unlikely(error && (status & rx_not_ls)))
-			goto read_again;
+		/* We do not support SG in XDP mode */
+		if (unlikely(!error && (status & rx_not_ls) &&
+			     stmmac_xdp_is_enabled(priv))) {
+			rx_dropped++;
+			error = 1;
+		}
 
 		if (unlikely(error)) {
+			if (status & rx_not_ls)
+				goto read_again;
+
 			dev_kfree_skb(skb);
 			goto next;
 		}
@@ -5842,6 +5847,14 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 		buf2_len = stmmac_rx_buf2_len(priv, p, status, len);
 		len += buf2_len;
 
+		/* Drop the packet if it is split over buf1 and buf2 on a
+		 * single descriptor if the interface is running in XDP mode.
+		 */
+		if (unlikely(stmmac_xdp_is_enabled(priv) && buf2_len)) {
+			rx_dropped++;
+			goto next;
+		}
+
 		/* ACS is disabled; strip manually. */
 		if (likely(!(status & rx_not_ls)))
 			len -= ETH_FCS_LEN;
@@ -5891,17 +5904,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 							   sync_len, true);
 					buf->page = NULL;
 					rx_dropped++;
-
-					/* Clear skb as it was set as
-					 * status by XDP program.
-					 */
-					skb = NULL;
-
-					if (unlikely((status & rx_not_ls)))
-						goto read_again;
-
-					count++;
-					continue;
+					goto next;
 				} else if (xdp_res & (STMMAC_XDP_TX |
 						      STMMAC_XDP_REDIRECT)) {
 					xdp_status |= xdp_res;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0139/1005] net: stmmac: copy XDP metadata in AF_XDP zero-copy RX
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (137 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0138/1005] net: stmmac: drop multi-buffer frames in XDP mode Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0140/1005] net: stmmac: fix VLAN tag stripping on short and non-linear RX frames Greg Kroah-Hartman
                   ` (234 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Paolo Abeni,
	Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 41d78e9ac0984f0e9577e5312e62400b5a6760c8 ]

stmmac_construct_skb_zc() reserves headroom for the XDP metadata and
records the length reported by the XDP program, but only copies the
packet data starting at xdp->data. The bytes in
[xdp->data_meta, xdp->data) are never copied into the new skb, so the
skb advertises metadata that is not there: after eth_type_trans()
anchors mac_header, data_meta points at uninitialized headroom instead
of what the program wrote.

Copy the metadata together with the packet data starting at
xdp->data_meta, leaving skb->data at the start of the frame and the
metadata immediately before it, and record its length. This keeps
data_meta valid for the stack and TC BPF after eth_type_trans() anchors
mac_header.

Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-4-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 519b166b58c37..c115ddfad5892 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5418,7 +5418,8 @@ static struct sk_buff *stmmac_construct_skb_zc(struct stmmac_channel *ch,
 		return NULL;
 
 	skb_reserve(skb, xdp->data - xdp->data_hard_start);
-	memcpy(__skb_put(skb, datasize), xdp->data, datasize);
+	__skb_put(skb, datasize);
+	memcpy(skb->data - metasize, xdp->data_meta, datasize + metasize);
 	if (metasize)
 		skb_metadata_set(skb, metasize);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0140/1005] net: stmmac: fix VLAN tag stripping on short and non-linear RX frames
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (138 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0139/1005] net: stmmac: copy XDP metadata in AF_XDP zero-copy RX Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0141/1005] net: stmmac: fix XDP RX buffer DMA sync length Greg Kroah-Hartman
                   ` (233 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, Lorenzo Bianconi,
	Paolo Abeni, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 68bdbffcae08699af5c16f7a2ec61a5489b78dbe ]

stmmac_rx_vlan() reads the VLAN header straight from skb->data and
removes it with skb_pull(), assuming the header is fully present in the
linear part of the skb. XDP can change the frame length and head layout
before the tag is stripped.

An XDP program can use bpf_xdp_adjust_tail() to shrink a frame to as
little as ETH_HLEN while bytes 12-13 still contain a VLAN ethertype. The
driver then reads h_vlan_TCI past skb->len and pops the tag, leaving less
than ETH_HLEN in the skb. eth_type_trans() cannot pull the MAC header, so
a malformed skb is passed up. The TCI is also read from the wrong place
when the tag is not fully in the linear head, e.g. when it spans into a
frag.

Read h_vlan_proto after pulling ETH_HLEN into the linear part, and check
it together with the device features. Only if the tag is actually going
to be popped, pull VLAN_ETH_HLEN and re-derive the header pointer
afterwards, as pskb_may_pull() may reallocate the skb head. Return an
error so the callers can drop a frame that claims a VLAN tag but cannot
provide the full header. This also drops and counts frames shorter than
ETH_HLEN in rx_dropped, even when VLAN RX offload is disabled;
bpf_xdp_adjust_head() and bpf_xdp_adjust_tail() cannot produce such a
frame, so it only affects a runt that reaches the driver, and dropping it
is safer than handing it to eth_type_trans().

Also move the XDP metadata written with bpf_xdp_adjust_meta() together
with the MAC header when the tag is popped, so data_meta still points at
the metadata after eth_type_trans() anchors mac_header, instead of at the
first bytes of the destination MAC.

Fixes: 5fabb01207a2 ("net: stmmac: Add initial XDP support")
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-5-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 48 +++++++++++++------
 1 file changed, 33 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c115ddfad5892..896ec37961a94 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5063,22 +5063,35 @@ static netdev_features_t stmmac_features_check(struct sk_buff *skb,
 	return vlan_features_check(skb, features);
 }
 
-static void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
+static int stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
 {
-	struct vlan_ethhdr *veth = skb_vlan_eth_hdr(skb);
-	__be16 vlan_proto = veth->h_vlan_proto;
-	u16 vlanid;
+	struct vlan_ethhdr *veth;
 
-	if ((vlan_proto == htons(ETH_P_8021Q) &&
+	if (!pskb_may_pull(skb, ETH_HLEN))
+		return -EINVAL;
+
+	veth = skb_vlan_eth_hdr(skb);
+	if ((veth->h_vlan_proto == htons(ETH_P_8021Q) &&
 	     dev->features & NETIF_F_HW_VLAN_CTAG_RX) ||
-	    (vlan_proto == htons(ETH_P_8021AD) &&
+	    (veth->h_vlan_proto == htons(ETH_P_8021AD) &&
 	     dev->features & NETIF_F_HW_VLAN_STAG_RX)) {
+		__be16 vlan_proto = veth->h_vlan_proto;
+		u8 meta_len = skb_metadata_len(skb);
+		u16 vlanid;
+
 		/* pop the vlan tag */
+		if (!pskb_may_pull(skb, VLAN_ETH_HLEN))
+			return -EINVAL;
+
+		veth = skb_vlan_eth_hdr(skb);
 		vlanid = ntohs(veth->h_vlan_TCI);
-		memmove(skb->data + VLAN_HLEN, veth, ETH_ALEN * 2);
+		memmove(skb->data - meta_len + VLAN_HLEN,
+			skb->data - meta_len, meta_len + ETH_ALEN * 2);
 		skb_pull(skb, VLAN_HLEN);
 		__vlan_hwaccel_put_tag(skb, vlan_proto, vlanid);
 	}
+
+	return 0;
 }
 
 /**
@@ -5445,12 +5458,15 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue,
 	}
 
 	stmmac_get_rx_hwtstamp(priv, p, np, skb);
-	if (priv->hw->hw_vlan_en)
+	if (priv->hw->hw_vlan_en) {
 		/* MAC level stripping. */
 		stmmac_rx_hw_vlan(priv, priv->hw, p, skb);
-	else
-		/* Driver level stripping. */
-		stmmac_rx_vlan(priv->dev, skb);
+	} else if (stmmac_rx_vlan(priv->dev, skb)) {
+		dev_kfree_skb_any(skb);
+		priv->xstats.rx_dropped++;
+		return;
+	}
+
 	skb->protocol = eth_type_trans(skb, priv->dev);
 
 	if (unlikely(!coe) || !stmmac_has_ip_ethertype(skb))
@@ -5973,12 +5989,14 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 
 		stmmac_get_rx_hwtstamp(priv, p, np, skb);
 
-		if (priv->hw->hw_vlan_en)
+		if (priv->hw->hw_vlan_en) {
 			/* MAC level stripping. */
 			stmmac_rx_hw_vlan(priv, priv->hw, p, skb);
-		else
-			/* Driver level stripping. */
-			stmmac_rx_vlan(priv->dev, skb);
+		} else if (stmmac_rx_vlan(priv->dev, skb)) {
+			dev_kfree_skb_any(skb);
+			rx_dropped++;
+			goto next;
+		}
 
 		skb->protocol = eth_type_trans(skb, priv->dev);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0141/1005] net: stmmac: fix XDP RX buffer DMA sync length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (139 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0140/1005] net: stmmac: fix VLAN tag stripping on short and non-linear RX frames Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0142/1005] ata: libata-core: Check device support before querying power state Greg Kroah-Hartman
                   ` (232 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Paolo Abeni,
	Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 363ff816277d4c7064514b160e655bed1dfb3ed8 ]

stmmac_rx() bounded the DMA sync length by the largest data_end seen
before and after the XDP program and passed it to page_pool_put_page()
on the XDP_CONSUMED path. bpf_xdp_adjust_tail() zeroes the grown area,
which dirties the CPU cache, but a later negative adjust only moves
data_end back. If the program grows and then shrinks the tail, both
endpoints miss the zeroed range, so those dirty cache lines are not
written back before the page is reused.

The length was also wrong since commit 88095728511e ("net: stmmac: fix
rx Scatter-Gather support") moved the page_pool DMA window to offset 0
and set max_len to dma_buf_sz + page_offset: the driver still
subtracted buf->page_offset, so it synced [base, data_end - page_offset)
instead of [base, data_end).

On a non-coherent platform those dirty lines can be evicted after the
device has DMA'd the next frame into the recycled page and corrupt it.

Sync the whole page_pool DMA window on the XDP_CONSUMED path with
page_pool_recycle_direct(), as the PASS path and page_pool allocation
already do. The device only writes [page_offset, page_offset +
dma_buf_sz), so syncing [base, base + max_len) covers every cache line
it can touch, regardless of how the program adjusted the packet.

Fixes: be8b38a722e6 ("net: stmmac: Add support for XDP_TX action")
Fixes: 88095728511e ("net: stmmac: fix rx Scatter-Gather support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-stmmac-xdp-fixes-v2-6-10eae8a093a8@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c   | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 896ec37961a94..7149b14bdad48 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5877,8 +5877,6 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 			len -= ETH_FCS_LEN;
 
 		if (!skb) {
-			unsigned int pre_len, sync_len;
-
 			/* Each frame starts here: reset the FCS handling */
 			fcs_stripped = false;
 
@@ -5896,29 +5894,18 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 			xdp_prepare_buff(&ctx.xdp, page_address(buf->page),
 					 buf->page_offset, buf1_len, true);
 
-			pre_len = ctx.xdp.data_end - ctx.xdp.data_hard_start -
-				  buf->page_offset;
-
 			ctx.priv = priv;
 			ctx.desc = p;
 			ctx.ndesc = np;
 
 			skb = stmmac_xdp_run_prog(priv, &ctx.xdp);
-			/* Due xdp_adjust_tail: DMA sync for_device
-			 * cover max len CPU touch
-			 */
-			sync_len = ctx.xdp.data_end - ctx.xdp.data_hard_start -
-				   buf->page_offset;
-			sync_len = max(sync_len, pre_len);
-
 			/* For Not XDP_PASS verdict */
 			if (IS_ERR(skb)) {
 				unsigned int xdp_res = -PTR_ERR(skb);
 
 				if (xdp_res & STMMAC_XDP_CONSUMED) {
-					page_pool_put_page(rx_q->page_pool,
-							   virt_to_head_page(ctx.xdp.data),
-							   sync_len, true);
+					page_pool_recycle_direct(rx_q->page_pool,
+								 virt_to_head_page(ctx.xdp.data));
 					buf->page = NULL;
 					rx_dropped++;
 					goto next;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0142/1005] ata: libata-core: Check device support before querying power state
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (140 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0141/1005] net: stmmac: fix XDP RX buffer DMA sync length Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0143/1005] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
                   ` (231 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli, Niklas Cassel,
	Sasha Levin

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

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

From: Giuseppe Piscitelli <ooonea@gmail.com>

[ Upstream commit ec585ac78742527f80495dd8f451dcda7e9e7f59 ]

The standby path queries the power state before checking whether the
device accepts ATA power-management commands. This sends CHECK POWER MODE
to ATAPI devices, including the QEMU DVD-ROM, which rejects it.

Run the existing taskfile initialization and device-class check first,
as the active-power path already does.

Fixes: 9cec467d0502 ("ata: libata-core: Do not call ata_dev_power_set_standby() twice")
Signed-off-by: Giuseppe Piscitelli <ooonea@gmail.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20261026202513.669084-1-ooonea@gmail.com
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 30572ca510de9..e61bc880dc4e4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2059,6 +2059,10 @@ void ata_dev_power_set_standby(struct ata_device *dev)
 	struct ata_taskfile tf;
 	unsigned int err_mask;
 
+	/* Issue STANDBY IMMEDIATE command only if supported by the device */
+	if (!ata_dev_power_init_tf(dev, &tf, false))
+		return;
+
 	/* If the device is already sleeping or in standby, do nothing. */
 	if ((dev->flags & ATA_DFLAG_SLEEPING) ||
 	    !ata_dev_power_is_active(dev))
@@ -2077,10 +2081,6 @@ void ata_dev_power_set_standby(struct ata_device *dev)
 	    system_entering_hibernation())
 		return;
 
-	/* Issue STANDBY IMMEDIATE command only if supported by the device */
-	if (!ata_dev_power_init_tf(dev, &tf, false))
-		return;
-
 	ata_dev_notice(dev, "Entering standby power mode\n");
 
 	err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0143/1005] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (141 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0142/1005] ata: libata-core: Check device support before querying power state Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0144/1005] erofs: apply the stacked fs check to extra file-backed devices Greg Kroah-Hartman
                   ` (230 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Daniel Machon, Simon Horman,
	Paolo Abeni, Sasha Levin

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

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

From: Daniel Machon <daniel.machon@microchip.com>

[ Upstream commit 263a5514cb9535380734b5e300b298f82570eb57 ]

lan966x_fdma_tx_clear_buf() runs from the NAPI poll and frees the
buffers of completed tx DCBs with napi_consume_skb(),
page_pool_recycle_direct() and xdp_return_frame_bulk().

netpoll calls the NAPI poll with a budget of 0 and hardirqs disabled.
With a budget of 0, a driver cannot call any XDP or page pool API.

Before this patch, the XDP_TX pages and ndo_xdp_xmit frames are freed
regardless of the budget. With netconsole on the port that owns the
FDMA NAPI, such a buffer is freed with hardirqs disabled, and
__page_pool_put_page() warns via lockdep_assert_no_hardirq().

Leave the XDP buffers of completed DCBs in place when the budget is 0,
and free them in the next NAPI poll. napi_consume_skb() already handles
a budget of 0, so skbs are still freed.

Found by an AI code review agent. Reproduced on a lan9668 board with a
modified kernel that runs the NAPI poll with a budget of 0 and hardirqs
disabled. With the fix the warning is gone.

Fixes: 19c6f534f636 ("net: lan966x: Add support for XDP_TX")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029-lan966x-fdma-tx-clear-budget-v1-1-38c52d7aab8c@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
index 5cc9b2321dad5..7bd1338477232 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
@@ -354,6 +354,12 @@ static void lan966x_fdma_tx_clear_buf(struct lan966x *lan966x, int weight)
 		if (!fdma_db_is_done(db))
 			continue;
 
+		/* XDP and page pool APIs can't be used with a budget of 0.
+		 * Leave these buffers for the next NAPI poll.
+		 */
+		if (!weight && !dcb_buf->use_skb)
+			continue;
+
 		dcb_buf->dev->stats.tx_packets++;
 		dcb_buf->dev->stats.tx_bytes += dcb_buf->len;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0144/1005] erofs: apply the stacked fs check to extra file-backed devices
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (142 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0143/1005] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0145/1005] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
                   ` (229 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Daejun Park, Gao Xiang, Sasha Levin

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

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

From: Daejun Park <daejun7.park@samsung.com>

[ Upstream commit e9aeaa63fd94b0d2bb9b303be5774b33ca9c01cf ]

erofs_fc_fill_super() rejects a file-backed mount whose image is on a
file-backed EROFS or on a filesystem with s_stack_depth set. This
bounds the nesting of reads. Extra devices given by device= are not
checked. File-backed mounts can still nest through them without limit.

Apply the same check to extra devices.

Fixes: fb176750266a ("erofs: add file-backed mount support")
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Gao Xiang <xiang@kernel.org>
Signed-off-by: Gao Xiang (Docker) <xiang@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/erofs/super.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index ce05557bd9983..ee01a5ef85931 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -122,6 +122,14 @@ void *erofs_read_metadata(struct super_block *sb, struct erofs_buf *buf,
 	return buffer;
 }
 
+/* see the comment in erofs_fc_fill_super() */
+static bool erofs_is_stacked_file(struct file *file)
+{
+	struct super_block *sb = file_inode(file)->i_sb;
+
+	return (sb->s_op == &erofs_sops && !sb->s_bdev) || sb->s_stack_depth;
+}
+
 static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
 			     struct erofs_device_info *dif, erofs_off_t *pos)
 {
@@ -161,6 +169,11 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
 		} else if (!S_ISREG(file_inode(file)->i_mode)) {
 			fput(file);
 			return -EINVAL;
+		} else if (erofs_is_stacked_file(file)) {
+			erofs_err(sb, "%s: file-backed devices cannot be on stacked fses",
+				  dif->path);
+			fput(file);
+			return -EINVAL;
 		}
 		if (!dif->dax_dev && test_opt(&sbi->opt, DAX_ALWAYS)) {
 			erofs_info(sb, "DAX unsupported by %s. Turning off DAX.",
@@ -701,9 +714,7 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
 		 * It MUST change if another fs plans to support them, which
 		 * may also require adjusting FILESYSTEM_MAX_STACK_DEPTH.
 		 */
-		inode = file_inode(sbi->dif0.file);
-		if ((inode->i_sb->s_op == &erofs_sops &&
-		     !inode->i_sb->s_bdev) || inode->i_sb->s_stack_depth) {
+		if (erofs_is_stacked_file(sbi->dif0.file)) {
 			erofs_err(sb, "file-backed mounts cannot be applied to stacked fses");
 			return -ENOTBLK;
 		}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0145/1005] drm/panel: visionox-r66451: Send the brightness value MSB first
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (143 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0144/1005] erofs: apply the stacked fs check to extra file-backed devices Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0146/1005] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
                   ` (228 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vladimir Zapolskiy, Neil Armstrong,
	Sasha Levin

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

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

From: Vladimir Zapolskiy <vz@kernel.org>

[ Upstream commit 00fe6be187ffde738fdb71ea7deb671fc939e583 ]

The panel expects to get two bytes of the DCS Set Display Brightness
command with the most significant byte first, and it uses the lower
12 bits of the value, use mipi_dsi_dcs_set_display_brightness_large()
to correct the programmed brightness values.

Tested on the SM8350-HDK display card, the display brightness increases
gradually with:

  for v in $(seq 16 16 4095); do sleep 0.1; \
    echo $v > /sys/class/backlight/ae94000.dsi.0/brightness; \
  done

while without the change the display is dark during all writes.

Fixes: a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel")
Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20261101212458.2431191-2-vz@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-visionox-r66451.c b/drivers/gpu/drm/panel/panel-visionox-r66451.c
index 690cccedd438f..0ce5c670dbb9b 100644
--- a/drivers/gpu/drm/panel/panel-visionox-r66451.c
+++ b/drivers/gpu/drm/panel/panel-visionox-r66451.c
@@ -227,7 +227,7 @@ static int visionox_r66451_bl_update_status(struct backlight_device *bl)
 	struct mipi_dsi_device *dsi = bl_get_data(bl);
 	u16 brightness = backlight_get_brightness(bl);
 
-	return mipi_dsi_dcs_set_display_brightness(dsi, brightness);
+	return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
 }
 
 static const struct backlight_ops visionox_r66451_bl_ops = {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0146/1005] drm/panel: visionox-r66451: Wait longer after the panel reset
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (144 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0145/1005] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0147/1005] ntfs: dont allow resident values to overlap the attribute header Greg Kroah-Hartman
                   ` (227 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vladimir Zapolskiy, Neil Armstrong,
	Sasha Levin

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

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

From: Vladimir Zapolskiy <vz@kernel.org>

[ Upstream commit b4b2778d5e175b166e4a27e5df5d61da468ad004 ]

The initialization sequence is sent 10ms after the panel reset is
deasserted, however on the SM8350-HDK display card the panel does not
answer a DCS read at that time, as a result the panel initialization
commands are lost, and the panel does not exit sleep mode and the display
stays black. With the first command sent about 15ms after the reset
the panel comes up reliably, so wait 20ms after deasserting the reset.

Fixes: a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel")
Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20261101212458.2431191-3-vz@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-visionox-r66451.c b/drivers/gpu/drm/panel/panel-visionox-r66451.c
index 0ce5c670dbb9b..d2cbc60af1179 100644
--- a/drivers/gpu/drm/panel/panel-visionox-r66451.c
+++ b/drivers/gpu/drm/panel/panel-visionox-r66451.c
@@ -36,7 +36,7 @@ static void visionox_r66451_reset(struct visionox_r66451 *ctx)
 	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
 	usleep_range(10000, 10100);
 	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
-	usleep_range(10000, 10100);
+	usleep_range(20000, 21000);
 }
 
 static int visionox_r66451_on(struct visionox_r66451 *ctx)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0147/1005] ntfs: dont allow resident values to overlap the attribute header
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (145 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0146/1005] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0148/1005] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
                   ` (226 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Robert Morris, Namjae Jeon,
	Sasha Levin

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

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

From: Namjae Jeon <linkinjeon@kernel.org>

[ Upstream commit 99afbf38a5c571157526b7b1c6d8dd7ad1a234d5 ]

The resident value bounds check allows value_offset to point inside the
attribute header. The reported image has an unnamed $DATA attribute with
a value_offset of zero and a value_length of two, which passes lookup.

Appending to this file makes ntfs_resident_attr_value_resize() shrink the
attribute record to eight bytes. Moving the following attributes then
overwrites the resident header fields, so the subsequent memset() uses a
corrupted value_offset and writes outside the MFT record buffer.

Require the resident value to start after the complete resident header.
Both lookup paths then return -EIO for the corrupt record, before callers
can resize or access its value.

Fixes: 495e90fa3348 ("ntfs: update attrib operations")
Reported-by: Robert Morris <rtm@mit.edu>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ntfs/attrib.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index ee54ebdeb7c71..0bd4b20132df9 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -704,17 +704,20 @@ static bool ntfs_resident_attr_value_get(const struct attr_record *a,
 					 struct ntfs_resident_attr_value *value)
 {
 	u32 attr_len;
+	u32 min_len;
 	u16 value_offset;
 
 	attr_len = le32_to_cpu(a->length);
-	if (attr_len < offsetof(struct attr_record, data.resident.reserved) +
-			sizeof(a->data.resident.reserved))
+	min_len = offsetof(struct attr_record, data.resident.reserved) +
+		  sizeof(a->data.resident.reserved);
+	if (attr_len < min_len)
 		return false;
 
 	value->len = le32_to_cpu(a->data.resident.value_length);
 	value_offset = le16_to_cpu(a->data.resident.value_offset);
 
-	if (value->len > attr_len || value_offset > attr_len - value->len)
+	if (value_offset < min_len || value->len > attr_len ||
+	    value_offset > attr_len - value->len)
 		return false;
 
 	value->data = (const u8 *)a + value_offset;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0148/1005] sfc: ptp: drop the stale frequency reset in efx_ptp_start()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (146 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0147/1005] ntfs: dont allow resident values to overlap the attribute header Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0149/1005] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
                   ` (225 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Austin, Paolo Abeni,
	Sasha Levin

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

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

From: Alex Austin <alex.austin@amd.com>

[ Upstream commit 21d4917cfc8b6837c44d8aa186941a6a16ec17a0 ]

FW does not touch the clock frequency state on MC_CMD_PTP_OP_DISABLE or
MC_CMD_PTP_OP_ENABLE, so the driver doesn't need to either. Doing so
just desyncs the driver's cached current_adjfreq from what FW still has
programmed.

Resetting current_adjfreq to 0 here means the first efx_phc_adjtime()
call after efx_ptp_start() reprograms the NIC's clock frequency to 0,
since efx_phc_adjtime() always sends current_adjfreq to FW alongside
the time step. efx_ptp_start() runs on every SIOCSHWTSTAMP mode change,
on ifup, and on the reset_required path in efx_ptp_worker(), so each of
those silently drops any frequency correction the PTP servo had already
applied.

efx_ptp_start() is also reached from reset recovery, but that is fine:
on an FLR or PCIe reset FW does not touch the NIC clock, and on a full
MC reboot the clock is reset to 1970, so a stale current_adjfreq from
before the reset is hardly consequential - especially as it is bound to
MAX_PPB, 1000000 ppb.

Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
Signed-off-by: Alex Austin <alex.austin@amd.com>
Link: https://patch.msgid.link/20261026123023.3566549-2-alex.austin@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/sfc/ptp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 6ca9a75af01d8..2247e5e3e25a8 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1446,7 +1446,6 @@ static int efx_ptp_start(struct efx_nic *efx)
 		goto fail;
 
 	ptp->evt_frag_idx = 0;
-	ptp->current_adjfreq = 0;
 
 	return 0;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0149/1005] sfc: ptp: serialize host and MC synchronization transactions
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (147 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0148/1005] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0150/1005] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
                   ` (224 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alex Austin, Alejandro Lucero,
	Pieter Jansen van Vuuren, Edward Cree, Paolo Abeni, Sasha Levin

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

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

From: Alex Austin <alex.austin@amd.com>

[ Upstream commit f707347b33feebdd67633bccea52f96807c18d6e ]

efx_ptp_synchronize() clears the MC-ready DMA flag before
efx_mcdi_rpc_start() acquires the MCDI interface, and processes results
into ptp->timeset[] after efx_mcdi_rpc_finish() has released it. The PPS
worker and the hwtstamp enable path can therefore clobber each other's
handshake flag and timesets.

Hold a PHC mutex across the whole transaction and over the clock
operations, so efx_phc_settime() reads and adjusts atomically and
current_adjfreq is consistently read and written under one lock. Also
bail out when efx_mcdi_rpc_start() fails rather than finishing an RPC
that was never acquired.

Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
Signed-off-by: Alex Austin <alex.austin@amd.com>
Reviewed-by: Alejandro Lucero <alucerop@amd.com>
Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20261026123023.3566549-3-alex.austin@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/sfc/ptp.c | 81 +++++++++++++++++++++++-----------
 1 file changed, 55 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 2247e5e3e25a8..eedab53e308af 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -36,6 +36,7 @@
 #include <linux/errno.h>
 #include <linux/ktime.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/pps_kernel.h>
 #include <linux/ptp_clock_kernel.h>
 #include "net_driver.h"
@@ -272,6 +273,8 @@ struct efx_ptp_rxfilter {
  * frequency adjustment into a fixed point fractional nanosecond format.
  * @current_adjfreq: Current ppb adjustment.
  * @phc_clock: Pointer to registered phc device (if primary function)
+ * @phc_lock: Serializes PHC commands and synchronization, and protects
+ *	      @current_adjfreq
  * @phc_clock_info: Registration structure for phc device
  * @pps_work: pps work task for handling pps events
  * @pps_workwq: pps work queue
@@ -331,6 +334,7 @@ struct efx_ptp_data {
 	unsigned int adjfreq_ppb_shift;
 	s64 current_adjfreq;
 	struct ptp_clock *phc_clock;
+	struct mutex phc_lock;
 	struct ptp_clock_info phc_clock_info;
 	struct work_struct pps_work;
 	struct workqueue_struct *pps_workwq;
@@ -1008,7 +1012,14 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
 	return 0;
 }
 
-/* Synchronize times between the host and the MC */
+/* Synchronize times between the host and the MC.
+ *
+ * The MC serializes PTP requests, so MC_CMD_PTP_OP_ADJUST cannot be applied
+ * while MC_CMD_PTP_OP_SYNCHRONIZE is collecting timesets. This holds across
+ * functions of a controller, which share the clock but adjust it only through
+ * the function that registered it, so a secondary function can capture here
+ * without serializing against the primary.
+ */
 static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
 {
 	struct efx_ptp_data *ptp = efx->ptp_data;
@@ -1027,11 +1038,14 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
 	MCDI_SET_QWORD(synch_buf, PTP_IN_SYNCHRONIZE_START_ADDR,
 		       ptp->start.dma_addr);
 
+	mutex_lock(&ptp->phc_lock);
+
 	/* Clear flag that signals MC ready */
 	WRITE_ONCE(*start, 0);
 	rc = efx_mcdi_rpc_start(efx, MC_CMD_PTP, synch_buf,
 				MC_CMD_PTP_IN_SYNCHRONIZE_LEN);
-	EFX_WARN_ON_ONCE_PARANOID(rc);
+	if (rc)
+		goto out;
 
 	/* Wait for start from MCDI (or timeout) */
 	timeout = jiffies + msecs_to_jiffies(MAX_SYNCHRONISE_WAIT_MS);
@@ -1062,11 +1076,13 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
 			++ptp->no_time_syncs;
 	}
 
+out:
 	/* Increment the bad syncs counter if the synchronize fails, whatever
 	 * the reason.
 	 */
 	if (rc != 0)
 		++ptp->bad_syncs;
+	mutex_unlock(&ptp->phc_lock);
 
 	return rc;
 }
@@ -1569,6 +1585,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
 	if (!efx->ptp_data)
 		return -ENOMEM;
 
+	mutex_init(&ptp->phc_lock);
 	ptp->efx = efx;
 	ptp->channel = channel;
 
@@ -1640,6 +1657,7 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
 	efx_nic_free_buffer(efx, &ptp->start);
 
 fail1:
+	mutex_destroy(&ptp->phc_lock);
 	kfree(efx->ptp_data);
 	efx->ptp_data = NULL;
 
@@ -1694,6 +1712,7 @@ void efx_ptp_remove(struct efx_nic *efx)
 	destroy_workqueue(efx->ptp_data->workwq);
 
 	efx_nic_free_buffer(efx, &efx->ptp_data->start);
+	mutex_destroy(&efx->ptp_data->phc_lock);
 	kfree(efx->ptp_data);
 	efx->ptp_data = NULL;
 }
@@ -2105,23 +2124,23 @@ static int efx_phc_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 	MCDI_SET_QWORD(inadj, PTP_IN_ADJUST_FREQ, adjustment_ns);
 	MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_SECONDS, 0);
 	MCDI_SET_DWORD(inadj, PTP_IN_ADJUST_NANOSECONDS, 0);
+	mutex_lock(&ptp_data->phc_lock);
 	rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inadj, sizeof(inadj),
 			  NULL, 0, NULL);
-	if (rc != 0)
-		return rc;
-
-	ptp_data->current_adjfreq = adjustment_ns;
-	return 0;
+	if (!rc)
+		ptp_data->current_adjfreq = adjustment_ns;
+	mutex_unlock(&ptp_data->phc_lock);
+	return rc;
 }
 
-static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
+static int _efx_phc_adjtime(struct efx_ptp_data *ptp_data, s64 delta)
+	__must_hold(&ptp_data->phc_lock)
 {
-	u32 nic_major, nic_minor;
-	struct efx_ptp_data *ptp_data = container_of(ptp,
-						     struct efx_ptp_data,
-						     phc_clock_info);
-	struct efx_nic *efx = ptp_data->efx;
 	MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_ADJUST_LEN);
+	struct efx_nic *efx = ptp_data->efx;
+	u32 nic_major, nic_minor;
+
+	lockdep_assert_held(&ptp_data->phc_lock);
 
 	efx->ptp_data->ns_to_nic_time(delta, &nic_major, &nic_minor);
 
@@ -2134,6 +2153,18 @@ static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
 			    NULL, 0, NULL);
 }
 
+static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
+{
+	struct efx_ptp_data *ptp_data = container_of(ptp, struct efx_ptp_data,
+						  phc_clock_info);
+	int rc;
+
+	mutex_lock(&ptp_data->phc_lock);
+	rc = _efx_phc_adjtime(ptp_data, delta);
+	mutex_unlock(&ptp_data->phc_lock);
+	return rc;
+}
+
 static int efx_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct efx_ptp_data *ptp_data = container_of(ptp,
@@ -2165,23 +2196,21 @@ static int efx_phc_settime(struct ptp_clock_info *ptp,
 {
 	/* Get the current NIC time, efx_phc_gettime.
 	 * Subtract from the desired time to get the offset
-	 * call efx_phc_adjtime with the offset
+	 * call _efx_phc_adjtime with the offset
 	 */
+	struct efx_ptp_data *ptp_data = container_of(ptp, struct efx_ptp_data,
+						  phc_clock_info);
+	struct timespec64 time_now, delta;
 	int rc;
-	struct timespec64 time_now;
-	struct timespec64 delta;
 
+	mutex_lock(&ptp_data->phc_lock);
 	rc = efx_phc_gettime(ptp, &time_now);
-	if (rc != 0)
-		return rc;
-
-	delta = timespec64_sub(*e_ts, time_now);
-
-	rc = efx_phc_adjtime(ptp, timespec64_to_ns(&delta));
-	if (rc != 0)
-		return rc;
-
-	return 0;
+	if (!rc) {
+		delta = timespec64_sub(*e_ts, time_now);
+		rc = _efx_phc_adjtime(ptp_data, timespec64_to_ns(&delta));
+	}
+	mutex_unlock(&ptp_data->phc_lock);
+	return rc;
 }
 
 static int efx_phc_enable(struct ptp_clock_info *ptp,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0150/1005] sfc: ptp: avoid racing PPS timestamp updates
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (148 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0149/1005] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0151/1005] virtio-spi: Fix virtio_spi_config kernel-doc Greg Kroah-Hartman
                   ` (223 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alex Austin, Alejandro Lucero,
	Pieter Jansen van Vuuren, Paolo Abeni, Sasha Levin

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

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

From: Alex Austin <alex.austin@amd.com>

[ Upstream commit 23d23e6c6517d0fea4f64340a23e33c89f82c03c ]

efx_ptp_pps_worker() can race with SIOCHWTSTAMP via
efx_ptp_change_mode(). After the worker completes synchronization, the
ioctl can start another synchronization and update host_time_pps while
the worker copies it into the PPS event. This can report a partially
updated timestamp. Serializing synchronization transactions alone does
not protect this copy, which happens after phc_lock is released.

Return the timestamp through the caller's own pps_event_time rather
than the shared field in efx_ptp_data, so the worker reads storage no
one else can write.

Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP")
Signed-off-by: Alex Austin <alex.austin@amd.com>
Reviewed-by: Alejandro Lucero <alucerop@amd.com>
Reviewed-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Link: https://patch.msgid.link/20261026123023.3566549-4-alex.austin@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/sfc/ptp.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index eedab53e308af..3c6a85b979cee 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -268,7 +268,6 @@ struct efx_ptp_rxfilter {
  * @evt_frag_idx: Current fragment number
  * @evt_code: Last event code
  * @start: Address at which MC indicates ready for synchronisation
- * @host_time_pps: Host time at last PPS
  * @adjfreq_ppb_shift: Shift required to convert scaled parts-per-billion
  * frequency adjustment into a fixed point fractional nanosecond format.
  * @current_adjfreq: Current ppb adjustment.
@@ -330,7 +329,6 @@ struct efx_ptp_data {
 	int evt_frag_idx;
 	int evt_code;
 	struct efx_buffer start;
-	struct pps_event_time host_time_pps;
 	unsigned int adjfreq_ppb_shift;
 	s64 current_adjfreq;
 	struct ptp_clock *phc_clock;
@@ -912,7 +910,8 @@ static void efx_ptp_read_timeset(MCDI_DECLARE_STRUCT_PTR(data),
 static int
 efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
 		      size_t response_length,
-		      const struct pps_event_time *last_time)
+		      const struct pps_event_time *last_time,
+		      struct pps_event_time *host_time_pps)
 {
 	unsigned number_readings =
 		MCDI_VAR_ARRAY_LEN(response_length,
@@ -990,6 +989,10 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
 			   "PTP bad synchronisation seconds\n");
 		return -EAGAIN;
 	}
+
+	if (!host_time_pps)
+		return 0;
+
 	delta.tv_sec = (last_sec - start_sec) & 1;
 	delta.tv_nsec =
 		last_time->ts_real.tv_nsec -
@@ -1006,8 +1009,8 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
 	delta.tv_nsec += ktime_to_timespec64(mc_time).tv_nsec;
 
 	/* Set PPS timestamp to match NIC top of second */
-	ptp->host_time_pps = *last_time;
-	pps_sub_ts(&ptp->host_time_pps, delta);
+	*host_time_pps = *last_time;
+	pps_sub_ts(host_time_pps, delta);
 
 	return 0;
 }
@@ -1020,7 +1023,8 @@ efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf),
  * the function that registered it, so a secondary function can capture here
  * without serializing against the primary.
  */
-static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
+static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings,
+			       struct pps_event_time *host_time_pps)
 {
 	struct efx_ptp_data *ptp = efx->ptp_data;
 	MCDI_DECLARE_BUF(synch_buf, MC_CMD_PTP_OUT_SYNCHRONIZE_LENMAX);
@@ -1069,7 +1073,7 @@ static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings)
 				 &response_length);
 	if (rc == 0) {
 		rc = efx_ptp_process_times(efx, synch_buf, response_length,
-					   &last_time);
+					   &last_time, host_time_pps);
 		if (rc == 0)
 			++ptp->good_syncs;
 		else
@@ -1501,14 +1505,15 @@ static void efx_ptp_pps_worker(struct work_struct *work)
 {
 	struct efx_ptp_data *ptp =
 		container_of(work, struct efx_ptp_data, pps_work);
+	struct pps_event_time host_time_pps = {};
 	struct efx_nic *efx = ptp->efx;
 	struct ptp_clock_event ptp_evt;
 
-	if (efx_ptp_synchronize(efx, PTP_SYNC_ATTEMPTS))
+	if (efx_ptp_synchronize(efx, PTP_SYNC_ATTEMPTS, &host_time_pps))
 		return;
 
 	ptp_evt.type = PTP_CLOCK_PPSUSR;
-	ptp_evt.pps_times = ptp->host_time_pps;
+	ptp_evt.pps_times = host_time_pps;
 	ptp_clock_event(ptp->phc_clock, &ptp_evt);
 }
 
@@ -1844,7 +1849,8 @@ int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
 				rc = efx_ptp_start(efx);
 			if (rc == 0) {
 				rc = efx_ptp_synchronize(efx,
-							 PTP_SYNC_ATTEMPTS * 2);
+							 PTP_SYNC_ATTEMPTS * 2,
+							 NULL);
 				if (rc != 0)
 					efx_ptp_stop(efx);
 			}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0151/1005] virtio-spi: Fix virtio_spi_config kernel-doc
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (149 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0150/1005] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0152/1005] virtio_ring: reset IN_ORDER state in virtqueue_init() Greg Kroah-Hartman
                   ` (222 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Karl Mehltretter <kmehltretter@gmail.com>

[ Upstream commit 62b0a9b11e94a4bc7f67c89348d0619cba82b54b ]

struct virtio_spi_config contains max_cs_inactive_ns, but its
kernel-doc describes max_cs_incative_ns. This leaves the real member
undescribed and adds a nonexistent member to the generated
documentation.

Correct the spelling.

Fixes: 6a1f3390fafe ("virtio-spi: Add virtio-spi.h")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260909064938.90995-1-kmehltretter@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/uapi/linux/virtio_spi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/virtio_spi.h b/include/uapi/linux/virtio_spi.h
index 8ab3c970cdd31..459c2276c938c 100644
--- a/include/uapi/linux/virtio_spi.h
+++ b/include/uapi/linux/virtio_spi.h
@@ -73,7 +73,7 @@
  * @max_cs_hold_ns: the maximum delay supported before chipselect is deasserted,
  *   in ns unit, 0 means delay is not supported to introduce before chipselect
  *   is deasserted.
- * @max_cs_incative_ns: maximum delay supported after chipselect is deasserted,
+ * @max_cs_inactive_ns: maximum delay supported after chipselect is deasserted,
  *   in ns unit, 0 means delay is not supported to introduce after chipselect is
  *   deasserted.
  */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0152/1005] virtio_ring: reset IN_ORDER state in virtqueue_init()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (150 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0151/1005] virtio-spi: Fix virtio_spi_config kernel-doc Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0153/1005] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
                   ` (221 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Li RongQing, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Li RongQing <lirongqing@baidu.com>

[ Upstream commit d7825623a9d4452f97da7ea0d84b2967d507ccf9 ]

The IN_ORDER feature uses additional software state to track the next
available descriptor and in-flight descriptor batches.

virtqueue_init() resets the common virtqueue state, but free_head and
batch_last.id are initialized only when the virtqueue is created. When
an IN_ORDER virtqueue is reset, these fields can retain state from the
previous queue instance.

Reset free_head and invalidate batch_last when initializing an IN_ORDER
virtqueue. Keep this in virtqueue_init() so the state is initialized
consistently for both newly created and reset virtqueues.

Fixes: f6a15d854986 ("virtio_ring: add in order support")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260910123903.1717-1-lirongqing@baidu.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/virtio/virtio_ring.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index db678f5a80e03..d0dc4645b5b37 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -559,6 +559,11 @@ static void virtqueue_init(struct vring_virtqueue *vq, u32 num)
 	vq->in_use = false;
 	vq->last_add_time_valid = false;
 #endif
+
+	if (virtqueue_is_in_order(vq)) {
+		vq->free_head = 0;
+		vq->batch_last.id = UINT_MAX;
+	}
 }
 
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0153/1005] vdpa_sim: serialize IOTLB updates with dataplane access
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (151 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0152/1005] virtio_ring: reset IN_ORDER state in virtqueue_init() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0154/1005] vdpa: invalidate DMA mappings before releasing memory Greg Kroah-Hartman
                   ` (220 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit 8517ed4429a2eefd002dce00ea46e23e6714350b ]

The simulator translates IOTLB entries into iovecs or bvecs under
iommu_lock, then drops the lock before copying data. A concurrent DMA
unmap can delete the mapping and release its pinned backing pages while
the copy is still in progress, leading to a UAF in _copy_from_iter().

Use the existing simulator mutex to serialize DMA map changes with the
full backend work function. Also make vhost-vdpa stop device access before
unpinning the backing pages. Otherwise, waiting in the simulator DMA unmap
callback happens after the pages have already been released and cannot
protect their lifetime.

Keep iommu_lock for the IOTLB table itself and avoid adding a second
long-lived lock to the simulator.

I found this bug myself, though the patch was written with AI assistance.

Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator")
Assisted-by: OpenAI-Codex:GPT-5
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Message-ID: <20260911-fix-vdpa-iotlb-lifetime-v3-1-8766d371748e@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vdpa/vdpa_sim/vdpa_sim.c | 4 ++++
 drivers/vhost/vdpa.c             | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index cfa88a60a38fd..017366cb6684c 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -713,6 +713,7 @@ static int vdpasim_dma_map(struct vdpa_device *vdpa, unsigned int asid,
 	if (asid >= vdpasim->dev_attr.nas)
 		return -EINVAL;
 
+	mutex_lock(&vdpasim->mutex);
 	spin_lock(&vdpasim->iommu_lock);
 	if (vdpasim->iommu_pt[asid]) {
 		vhost_iotlb_reset(&vdpasim->iommu[asid]);
@@ -721,6 +722,7 @@ static int vdpasim_dma_map(struct vdpa_device *vdpa, unsigned int asid,
 	ret = vhost_iotlb_add_range_ctx(&vdpasim->iommu[asid], iova,
 					iova + size - 1, pa, perm, opaque);
 	spin_unlock(&vdpasim->iommu_lock);
+	mutex_unlock(&vdpasim->mutex);
 
 	return ret;
 }
@@ -733,6 +735,7 @@ static int vdpasim_dma_unmap(struct vdpa_device *vdpa, unsigned int asid,
 	if (asid >= vdpasim->dev_attr.nas)
 		return -EINVAL;
 
+	mutex_lock(&vdpasim->mutex);
 	spin_lock(&vdpasim->iommu_lock);
 	if (vdpasim->iommu_pt[asid]) {
 		vhost_iotlb_reset(&vdpasim->iommu[asid]);
@@ -740,6 +743,7 @@ static int vdpasim_dma_unmap(struct vdpa_device *vdpa, unsigned int asid,
 	}
 	vhost_iotlb_del_range(&vdpasim->iommu[asid], iova, iova + size - 1);
 	spin_unlock(&vdpasim->iommu_lock);
+	mutex_unlock(&vdpasim->mutex);
 
 	return 0;
 }
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index c7a9702c2447b..6eb48cd5ac79e 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -976,6 +976,8 @@ static void vhost_vdpa_pa_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
 	unsigned long pfn, pinned;
 
 	while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) {
+		/* Stop device access before releasing the pinned pages. */
+		vhost_vdpa_general_unmap(v, map, asid);
 		pinned = PFN_DOWN(map->size);
 		for (pfn = PFN_DOWN(map->addr);
 		     pinned > 0; pfn++, pinned--) {
@@ -985,7 +987,6 @@ static void vhost_vdpa_pa_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
 			unpin_user_page(page);
 		}
 		atomic64_sub(PFN_DOWN(map->size), &dev->mm->pinned_vm);
-		vhost_vdpa_general_unmap(v, map, asid);
 		vhost_iotlb_map_free(iotlb, map);
 	}
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0154/1005] vdpa: invalidate DMA mappings before releasing memory
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (152 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0153/1005] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0155/1005] vhost-scsi: preserve event ordering Greg Kroah-Hartman
                   ` (219 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit acbf36deb53d9e14e4768bf58883795a8232aa5b ]

vdpa can release pinned pages and file references before the device stops
using the corresponding mappings, allowing stale DMA to corrupt memory.

Invalidate mappings before dropping their backing references. For set_map
backends, publish an IOTLB without the invalidated range and keep the old
references if that fails. Do this immediately even within a batch.

Serialize vdpa_sim set_map updates with its worker so publishing a new map
cannot race an active transfer. Abort mlx5 map replacement when resumable
virtqueues cannot be suspended, since changing the memory region while
those queues remain active would preserve the same stale DMA window. Reject
zero-sized and wrapping invalidations before calculating their inclusive
range end.

I found this bug myself, though the patch was written with AI assistance.

Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")
Assisted-by: OpenAI-Codex:GPT-5
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Message-ID: <20260911-fix-vdpa-iotlb-lifetime-v3-2-8766d371748e@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +++++++-
 drivers/vdpa/vdpa_sim/vdpa_sim.c  |  3 +++
 drivers/vhost/vdpa.c              | 40 ++++++++++++++++++++++++-------
 3 files changed, 43 insertions(+), 10 deletions(-)

diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 8563fec2855d5..0fcb18b5f30ac 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -3059,7 +3059,15 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev,
 	bool teardown = !is_resumable(ndev);
 	int err;
 
-	suspend_vqs(ndev, 0, ndev->cur_num_vqs);
+	if ((mvdev->status & VIRTIO_CONFIG_S_DRIVER_OK) && !mvdev->suspended) {
+		err = suspend_vqs(ndev, 0, ndev->cur_num_vqs);
+		if (err && !teardown) {
+			for (int i = 0; i < ndev->cur_num_vqs; i++)
+				resume_vqs(ndev, i, 1);
+			mlx5_vdpa_put_mr(mvdev, new_mr);
+			return err;
+		}
+	}
 	if (teardown) {
 		err = save_channels_info(ndev);
 		if (err) {
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index 017366cb6684c..97d437d89524a 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -638,6 +638,7 @@ static int vdpasim_set_map(struct vdpa_device *vdpa, unsigned int asid,
 	if (asid >= vdpasim->dev_attr.nas)
 		return -EINVAL;
 
+	mutex_lock(&vdpasim->mutex);
 	spin_lock(&vdpasim->iommu_lock);
 
 	iommu = &vdpasim->iommu[asid];
@@ -652,11 +653,13 @@ static int vdpasim_set_map(struct vdpa_device *vdpa, unsigned int asid,
 			goto err;
 	}
 	spin_unlock(&vdpasim->iommu_lock);
+	mutex_unlock(&vdpasim->mutex);
 	return 0;
 
 err:
 	vhost_iotlb_reset(iommu);
 	spin_unlock(&vdpasim->iommu_lock);
+	mutex_unlock(&vdpasim->mutex);
 	return ret;
 }
 
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 6eb48cd5ac79e..5a8216f601ef1 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -998,10 +998,10 @@ static void vhost_vdpa_va_unmap(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
 	struct vdpa_map_file *map_file;
 
 	while ((map = vhost_iotlb_itree_first(iotlb, start, last)) != NULL) {
+		vhost_vdpa_general_unmap(v, map, asid);
 		map_file = (struct vdpa_map_file *)map->opaque;
 		fput(map_file->file);
 		kfree(map_file);
-		vhost_vdpa_general_unmap(v, map, asid);
 		vhost_iotlb_map_free(iotlb, map);
 	}
 }
@@ -1075,21 +1075,39 @@ static int vhost_vdpa_map(struct vhost_vdpa *v, struct vhost_iotlb *iotlb,
 	return 0;
 }
 
-static void vhost_vdpa_unmap(struct vhost_vdpa *v,
-			     struct vhost_iotlb *iotlb,
-			     u64 iova, u64 size)
+static int vhost_vdpa_unmap(struct vhost_vdpa *v,
+			    struct vhost_iotlb *iotlb,
+			    u64 iova, u64 size)
 {
 	struct vdpa_device *vdpa = v->vdpa;
 	const struct vdpa_config_ops *ops = vdpa->config;
+	struct vhost_iotlb_map *map;
+	struct vhost_iotlb new_iotlb;
 	u32 asid = iotlb_to_asid(iotlb);
+	u64 last = iova + size - 1;
+	int ret;
 
-	vhost_vdpa_iotlb_unmap(v, iotlb, iova, iova + size - 1, asid);
+	if (ops->set_map && !ops->dma_map) {
+		vhost_iotlb_init(&new_iotlb, iotlb->limit, iotlb->flags);
+		list_for_each_entry(map, &iotlb->list, link) {
+			if (map->start <= last && map->last >= iova)
+				continue;
+			ret = vhost_iotlb_add_range_ctx(&new_iotlb, map->start,
+							map->last, map->addr,
+							map->perm, map->opaque);
+			if (ret)
+				goto reset;
+		}
 
-	if (ops->set_map) {
-		if (!v->in_batch)
-			ops->set_map(vdpa, asid, iotlb);
+		ret = ops->set_map(vdpa, asid, &new_iotlb);
+reset:
+		vhost_iotlb_reset(&new_iotlb);
+		if (ret)
+			return ret;
 	}
 
+	vhost_vdpa_iotlb_unmap(v, iotlb, iova, last, asid);
+	return 0;
 }
 
 static int vhost_vdpa_va_map(struct vhost_vdpa *v,
@@ -1339,7 +1357,11 @@ static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, u32 asid,
 		r = vhost_vdpa_process_iotlb_update(v, iotlb, msg);
 		break;
 	case VHOST_IOTLB_INVALIDATE:
-		vhost_vdpa_unmap(v, iotlb, msg->iova, msg->size);
+		if (!msg->size || msg->iova > U64_MAX - msg->size + 1) {
+			r = -EINVAL;
+			break;
+		}
+		r = vhost_vdpa_unmap(v, iotlb, msg->iova, msg->size);
 		break;
 	case VHOST_IOTLB_BATCH_BEGIN:
 		v->batch_asid = asid;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0155/1005] vhost-scsi: preserve event ordering
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (153 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0154/1005] vdpa: invalidate DMA mappings before releasing memory Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0156/1005] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
                   ` (218 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jia Jia, Mike Christie,
	Michael S. Tsirkin, Sasha Levin

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

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

From: Jia Jia <physicalmtea@gmail.com>

[ Upstream commit a9a428115b7d8aa45e12e41899f90f60551bfa82 ]

vhost_scsi_send_evt() uses llist_add(), so pending events are LIFO.
vhost_scsi_complete_events() walks the detached list directly.
This can deliver a later hotplug or hotunplug event before an earlier
one.

Reverse the detached list before processing it.
This keeps delivery in enqueue order.

Fixes: a6c9af87363c ("tcm_vhost: Add hotplug/hotunplug support")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260915094244.7900-2-physicalmtea@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index ddc9bea190ded..738db166cb5db 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -667,7 +667,7 @@ static void vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
 	struct llist_node *llnode;
 
 	mutex_lock(&vq->mutex);
-	llnode = llist_del_all(&vs->vs_event_list);
+	llnode = llist_reverse_order(llist_del_all(&vs->vs_event_list));
 	llist_for_each_entry_safe(evt, t, llnode, list) {
 		if (!drop)
 			vhost_scsi_do_evt_work(vs, evt);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0156/1005] vhost-scsi: do not relock event vq mutex on send_evt fallback
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (154 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0155/1005] vhost-scsi: preserve event ordering Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0157/1005] vhost: fix dirty logging for in-order used ring entries Greg Kroah-Hartman
                   ` (217 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jia Jia, Mike Christie,
	Michael S. Tsirkin, Sasha Levin

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

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

From: Jia Jia <physicalmtea@gmail.com>

[ Upstream commit a016d03a9cfe29aeeba438f32f8e8f63291e3275 ]

vhost_scsi_send_evt() is called with the event virtqueue mutex held.
If the worker is gone, the fallback currently calls
vhost_scsi_complete_events(), which tries to acquire the same mutex again
and deadlocks the caller.

Split event completion into a helper for callers that already hold the
mutex and a locking wrapper for the event worker. Use the helper on the
fallback path.

Link: https://lore.kernel.org/all/20260905005352.1E5B01F00A3D@smtp.kernel.org/
Fixes: b1b2ce58ed23 ("vhost-scsi: Handle vhost_vq_work_queue failures for events")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260915094244.7900-3-physicalmtea@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/scsi.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 738db166cb5db..8f57a789814f5 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -660,19 +660,26 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
 	vhost_scsi_log_write(vq, vq_log, log_num);
 }
 
-static void vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
+/* Caller must hold the event virtqueue mutex. */
+static void __vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
 {
-	struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq;
 	struct vhost_scsi_evt *evt, *t;
 	struct llist_node *llnode;
 
-	mutex_lock(&vq->mutex);
 	llnode = llist_reverse_order(llist_del_all(&vs->vs_event_list));
 	llist_for_each_entry_safe(evt, t, llnode, list) {
 		if (!drop)
 			vhost_scsi_do_evt_work(vs, evt);
 		vhost_scsi_free_evt(vs, evt);
 	}
+}
+
+static void vhost_scsi_complete_events(struct vhost_scsi *vs, bool drop)
+{
+	struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq;
+
+	mutex_lock(&vq->mutex);
+	__vhost_scsi_complete_events(vs, drop);
 	mutex_unlock(&vq->mutex);
 }
 
@@ -1864,7 +1871,7 @@ vhost_scsi_send_evt(struct vhost_scsi *vs, struct vhost_virtqueue *vq,
 
 	llist_add(&evt->list, &vs->vs_event_list);
 	if (!vhost_vq_work_queue(vq, &vs->vs_event_work))
-		vhost_scsi_complete_events(vs, true);
+		__vhost_scsi_complete_events(vs, true);
 }
 
 static void vhost_scsi_evt_handle_kick(struct vhost_work *work)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0157/1005] vhost: fix dirty logging for in-order used ring entries
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (155 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0156/1005] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0158/1005] virtio_pci: add missing newline to the pmcsr error message Greg Kroah-Hartman
                   ` (216 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit bfcde6b64769bc168037b8bd882de4def4b2b3f4 ]

With VIRTIO_F_IN_ORDER, one used ring element can represent multiple
buffers, so vhost_add_used_n_in_order() can write consecutive elements to
nonadjacent slots. Dirty logging combines the initial slot with a length
based on the final position, which can miss written elements or log past
the end of the ring.

Replay nheads[] after the write barrier and log the written slots,
coalescing adjacent elements and splitting at gaps and wraps.

Fixes: 67a873df0c41 ("vhost: basic in order support")
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Message-ID: <20260912-fix-log_write-v1-1-72c23db01268@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/vhost.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 0226c4c597093..86126e2ea8cbc 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -3163,7 +3163,6 @@ static int vhost_add_used_n_in_order(struct vhost_virtqueue *vq,
 		return -EINVAL;
 
 	start = vq->last_used_idx & (vq->num - 1);
-	used = vq->used->ring + start;
 
 	for (i = 0; i < count; i++) {
 		if (vhost_put_used(vq, &heads[i], start, 1)) {
@@ -3176,14 +3175,31 @@ static int vhost_add_used_n_in_order(struct vhost_virtqueue *vq,
 	}
 
 	if (unlikely(vq->log_used)) {
+		unsigned int log_count = 0;
+		int log_start = 0, next;
+
 		/* Make sure data is seen before log. */
 		smp_wmb();
-		/* Log used ring entry write. */
-		log_used(vq, ((void __user *)used - (void __user *)vq->used),
-			 (vq->num - start) * sizeof *used);
-		if (start + count > vq->num)
-			log_used(vq, 0,
-				 (start + count - vq->num) * sizeof *used);
+		/* Log contiguous runs of used ring entries that were written. */
+		start = vq->last_used_idx & (vq->num - 1);
+		for (i = 0; i < count; i++) {
+			if (!log_count)
+				log_start = start;
+			log_count++;
+
+			next = start + nheads[i];
+			if (next >= vq->num)
+				next -= vq->num;
+			if (i + 1 == count || next != start + 1) {
+				used = vq->used->ring + log_start;
+				log_used(vq,
+					 ((void __user *)used -
+					  (void __user *)vq->used),
+					 log_count * sizeof(*used));
+				log_count = 0;
+			}
+			start = next;
+		}
 	}
 
 	old = vq->last_used_idx;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0158/1005] virtio_pci: add missing newline to the pmcsr error message
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (156 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0157/1005] vhost: fix dirty logging for in-order used ring entries Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0159/1005] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
                   ` (215 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Maoxia, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Maoxia <2312891301@qq.com>

[ Upstream commit 104d58a6d2592898fbb6989732600b07d543a8e5 ]

The error message emitted when the PCI power management control
register cannot be read is not newline-terminated, so the next kernel
message is appended to it on the same line.

Add the missing '\n'.

Fixes: dff4fa0e5785 ("virtio: Add support for no-reset virtio PCI PM")
Signed-off-by: Maoxia <2312891301@qq.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <tencent_031B923A83E0DEE884BD05D49030890C0406@qq.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/virtio/virtio_pci_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index b90c174450b20..24af84b0c6adf 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -633,7 +633,7 @@ static bool vp_supports_pm_no_reset(struct device *dev)
 
 	pci_read_config_word(pci_dev, pci_dev->pm_cap + PCI_PM_CTRL, &pmcsr);
 	if (PCI_POSSIBLE_ERROR(pmcsr)) {
-		dev_err(dev, "Unable to query pmcsr");
+		dev_err(dev, "Unable to query pmcsr\n");
 		return false;
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0159/1005] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (157 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0158/1005] virtio_pci: add missing newline to the pmcsr error message Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0160/1005] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
                   ` (214 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, co+6dcbccedc9ec6452, Xiang Mei,
	Michael S. Tsirkin, Paul Moses, Sasha Levin

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

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

From: Xiang Mei <xmei5@asu.edu>

[ Upstream commit 1f8824fe7f6eaaf2355404db08d3cd05a28aa576 ]

genlmsg_reply() consumes the reply skb on every outcome: netlink_unicast()
frees it whether it queues it, drops it, or bails out early.
vdpa_nl_cmd_dev_config_get_doit() lets its return value fall through to the
shared error label, which calls nlmsg_free(msg) again and double-frees the
sk_buff on any reply failure. The failure is reachable unprivileged:
VDPA_CMD_DEV_CONFIG_GET carries no GENL_ADMIN_PERM, so batching several
requests into one sendto() on a socket with a shrunken SO_RCVBUF fills the
receive queue, and netlink_attachskb() then takes its MSG_DONTWAIT path,
freeing the skb and returning -EAGAIN.

Set msg to NULL once genlmsg_reply() has consumed it so the shared exit
path frees the skb only on the early error gotos that still own it;
nlmsg_free(NULL) is a no-op.

  BUG: KASAN: slab-use-after-free in sk_skb_reason_drop (net/core/skbuff.c:1220)
  Read of size 4 at addr ffff88800d99d49c by task exploit/147
  Call Trace:
   sk_skb_reason_drop (net/core/skbuff.c:1220)
   vdpa_nl_cmd_dev_config_get_doit (drivers/vdpa/vdpa.c:1324)
   genl_family_rcv_msg_doit (net/netlink/genetlink.c:1114)
   genl_rcv_msg (net/netlink/genetlink.c:1194)
   netlink_rcv_skb (net/netlink/af_netlink.c:2556)
   genl_rcv (net/netlink/genetlink.c:1218)
   netlink_unicast (net/netlink/af_netlink.c:1345)
   netlink_sendmsg (net/netlink/af_netlink.c:1900)
   __sys_sendto (net/socket.c:2281)
   __x64_sys_sendto (net/socket.c:2284)
   entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)

  The buggy address belongs to the object at ffff88800d99d3c0
   which belongs to the cache skbuff_head_cache of size 232
  The buggy address is located 220 bytes inside of
   freed 232-byte region [ffff88800d99d3c0, ffff88800d99d4a8)

Fixes: ad69dd0bf26b ("vdpa: Introduce query of device config layout")
Reported-by: co+6dcbccedc9ec6452@bugs.sh
Closes: https://lore.kernel.org/all/ILTHcT8oe1HP47sY25JVxssvKmkCTjYlX9Hs%40bugs.sh/
Assisted-by: Claude:claude-opus-5
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reported-by: Paul Moses <p@1g4.org>
Message-ID: <20260912215401.126194-1-xmei5@asu.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vdpa/vdpa.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
index 47c6c3d23f5c7..6455f837dd263 100644
--- a/drivers/vdpa/vdpa.c
+++ b/drivers/vdpa/vdpa.c
@@ -1313,15 +1313,16 @@ static int vdpa_nl_cmd_dev_config_get_doit(struct sk_buff *skb, struct genl_info
 	}
 	err = vdpa_dev_config_fill(vdev, msg, info->snd_portid, info->snd_seq,
 				   0, info->extack);
-	if (!err)
+	if (!err) {
 		err = genlmsg_reply(msg, info);
+		msg = NULL;
+	}
 
 mdev_err:
 	put_device(dev);
 dev_err:
 	up_read(&vdpa_dev_lock);
-	if (err)
-		nlmsg_free(msg);
+	nlmsg_free(msg);
 	return err;
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0160/1005] vhost: reject invalid IOTLB update permissions
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (158 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0159/1005] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:24 ` [PATCH 7.3 0161/1005] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
                   ` (213 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit b179f21d2d8a60ede29a00472bffdefb0284ef39 ]

vhost_chr_write_iter() validates the type and size of an IOTLB update, but
does not validate its permission field. An invalid permission can therefore
reach perm_to_iommu_flags() and trigger its warning in vhost_vdpa_map().

Reject IOTLB UPDATE messages whose permission field is empty or contains
bits outside VHOST_ACCESS_RW before dispatching them to a backend.

Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260913-fix-vhost_chr_write_iter-v1-1-76bf1f436cfe@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/vhost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 86126e2ea8cbc..8afdd43d313c1 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1750,7 +1750,8 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
 		goto done;
 	}
 
-	if (msg.type == VHOST_IOTLB_UPDATE && msg.size == 0) {
+	if (msg.type == VHOST_IOTLB_UPDATE &&
+	    (!msg.size || !msg.perm || (msg.perm & ~VHOST_ACCESS_RW))) {
 		ret = -EINVAL;
 		goto done;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0161/1005] vhost-vdpa: drop the parents vq callback before the call fd is released
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (159 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0160/1005] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
@ 2026-11-25 14:24 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0162/1005] virtio-blk: clamp max_segments to virtqueue ring size Greg Kroah-Hartman
                   ` (212 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:24 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yu Zhang, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Yu Zhang <yuz08559@gmail.com>

[ Upstream commit c9c1c1b7b31fc8b9a5d6c04f5f0ae647d081a39d ]

VHOST_SET_VRING_CALL releases the previous call eventfd inside
vhost_vring_ioctl() -- it swaps the new context into vq->call_ctx.ctx
and then eventfd_ctx_put()s the old one, which is a synchronous
kfree(). The parent vdpa device is only told about the change
afterwards, when vhost_vdpa_vring_ioctl() reaches ops->set_vq_cb().

Parent drivers cache the pointer handed to them in
vdpa_callback::trigger and do not take a reference on it, so
throughout that window the parent holds a dangling eventfd_ctx and may
signal it. The documentation added with the field describes what
signalling it means but says nothing about how long it stays valid.

This is the same hazard that "vhost_vdpa: assign irq bypass producer
token correctly" addressed for the irq bypass producer token, by
moving vhost_vdpa_unsetup_vq_irq() ahead of the vhost_vring_ioctl()
call. The producer token was only one of the two consumers of that
pointer; the one the parent keeps via ->set_vq_cb() was left behind
the free.

With VDUSE the window is directly reachable from userspace, because
the device emulation daemon can inject an interrupt at any time from a
different fd, and neither side shares a lock with the other: VDUSE
takes vq->irq_lock, vhost takes vhost_dev.mutex + vq->mutex.

  BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x76/0xe0
  Write of size 4 at addr ffff8881084e8788 by task vduse_uaf/2987

  _raw_spin_lock_irqsave+0x76/0xe0
  eventfd_signal_mask+0x69/0x120
  vduse_dev_ioctl+0x337/0x1a60     <- vduse_vq_signal_irqfd(), inlined
  __x64_sys_ioctl+0x120/0x170      <- VDUSE_VQ_INJECT_IRQ

  Allocated by task 2986:
   do_eventfd+0x50/0x200
   __x64_sys_eventfd2+0x2e/0x40

  kmalloc-64, freed 64-byte region [ffff8881084e8780, ffff8881084e87c0)

One thread loops VHOST_SET_VRING_CALL on /dev/vhost-vdpa-N with a
fresh eventfd and then unbinds it, while another loops
VDUSE_VQ_INJECT_IRQ on /dev/vduse/<name>. This reproduces in 5 out of
5 ten-second runs on v7.1.6 and 3 out of 3 on v7.2-rc6. With the patch
there are no reports in 3 out of 3 runs on either, while the same
workload still gets ~30000 interrupts per run delivered into live
eventfds, so the path is still being exercised.

Tell the parent to drop the callback before vhost_vring_ioctl() can
free the eventfd, mirroring what is already done for the bypass
producer, and restore it if the ioctl fails -- on failure the swap
never happened, the old context is still installed, and leaving the
parent without a callback would silently drop that vq's interrupts.

Clearing the callback only stops a parent from starting to use the
context; a handler that already loaded it can still be running. For
parents with a real interrupt, wait for it with synchronize_irq() on
the vq's irq. VDUSE does not implement get_vq_irq, so that case stays
covered by the teardown above.

Fixes: 5e68470f4e80 ("vdpa: Add eventfd for the vdpa callback")
Signed-off-by: Yu Zhang <yuz08559@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260918040436.47982-1-yuz08559@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/vdpa.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 5a8216f601ef1..81a6fbab8c0d6 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -767,13 +767,46 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
 			if (ops->get_status(vdpa) &
 			    VIRTIO_CONFIG_S_DRIVER_OK)
 				vhost_vdpa_unsetup_vq_irq(v, idx);
+			/*
+			 * The parent caches call_ctx.ctx in cb.trigger without
+			 * holding a reference, so it has to stop using it
+			 * before vhost_vring_ioctl() drops the last one.
+			 */
+			cb.callback = NULL;
+			cb.private = NULL;
+			cb.trigger = NULL;
+			ops->set_vq_cb(vdpa, idx, &cb);
+
+			/*
+			 * A parent interrupt handler that loaded the callback
+			 * before that store can still be running, so wait for
+			 * it to finish with the context too.
+			 */
+			if (ops->get_vq_irq) {
+				int irq = ops->get_vq_irq(vdpa, idx);
+
+				if (irq >= 0)
+					synchronize_irq(irq);
+			}
 		}
 		break;
 	}
 
 	r = vhost_vring_ioctl(&v->vdev, cmd, argp);
-	if (r)
+	if (r) {
+		/*
+		 * A failure here means the swap never happened and the old
+		 * context is still installed, so give the parent back the
+		 * callback that was torn down above.
+		 */
+		if (cmd == VHOST_SET_VRING_CALL && vq->call_ctx.ctx) {
+			cb.callback = vhost_vdpa_virtqueue_cb;
+			cb.private = vq;
+			cb.trigger = vq->call_ctx.ctx;
+			ops->set_vq_cb(vdpa, idx, &cb);
+		}
 		return r;
+	}
 
 	switch (cmd) {
 	case VHOST_SET_VRING_ADDR:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0162/1005] virtio-blk: clamp max_segments to virtqueue ring size
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (160 preceding siblings ...)
  2026-11-25 14:24 ` [PATCH 7.3 0161/1005] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0163/1005] vduse: avoid infinite loop when no affinity CPU is online Greg Kroah-Hartman
                   ` (211 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Stjepan Poljak, Sergii Ushakov,
	Michael S. Tsirkin, Sasha Levin

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

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

From: Sergii Ushakov <sergiiushakov@google.com>

[ Upstream commit 434d2bc41bd0c0ac576d4d259bd9f2ab49071174 ]

In virtblk_add_req(), each request consumes 2 extra descriptors (out_hdr
and in_hdr) in addition to the data scatter-gather segments.

When a hypervisor (e.g. QNX Hypervisor) advertises VIRTIO_BLK_F_SEG_MAX
with seg_max = 1024 alongside a 1024-entry split ring (vring.num = 1024)
and VIRTIO_RING_F_INDIRECT_DESC disabled, lim->max_segments is set to
1024. When the block layer submits requests with 1023 or 1024 data
segments, total_sg reaches 1025 or 1026. This exceeds vring.num (1024),
causing virtqueue_add_split() to return -ENOSPC and permanently wedge
the blk-mq queue.

Furthermore, the Virtio specification (2.7.5.3.1) requires that a
descriptor chain never exceed the Queue Size, and virtqueue_add_split()
falls back to direct descriptors if indirect table allocation fails.

Fix this by:
1. Rejecting queues with ring_size < 3 at probe, or
   ring_size < (queue_max_segments + 2) during resume/reset recovery in
   init_vq().
2. Unconditionally clamping sg_elems to (ring_size - 2) across all
   virtqueues in virtblk_read_limits().

Reported-by: Stjepan Poljak <stjepan.poljak@gmail.com>
Fixes: 0864b79a1533 ("virtio: block: dynamic maximum segments")
Signed-off-by: Sergii Ushakov <sergiiushakov@google.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260918135120.1261150-1-sergiiushakov@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/virtio_blk.c | 44 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 10ba8b0b863b8..cb694afde3e5d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1022,6 +1022,30 @@ static int init_vq(struct virtio_blk *vblk)
 		goto out;
 
 	for (i = 0; i < num_vqs; i++) {
+		unsigned int ring_size = virtqueue_get_vring_size(vqs[i]);
+		/*
+		 * Each request consumes 2 extra descriptors (out_hdr and
+		 * in_hdr) in addition to the data segments.
+		 *
+		 * At initial probe (!vblk->disk), each virtqueue must fit at
+		 * least 1 data segment + 2 header descriptors (3).
+		 * On resume/recovery (vblk->disk), each virtqueue must fit the
+		 * existing queue_max_segments() + 2 header descriptors.
+		 */
+		unsigned int min_ring_size = 3;
+
+		if (vblk->disk)
+			min_ring_size = queue_max_segments(vblk->disk->queue) + 2;
+
+		if (ring_size < min_ring_size) {
+			dev_err(&vdev->dev,
+				"virtqueue %u ring size %u is smaller than minimum %u\n",
+				i, ring_size, min_ring_size);
+			vdev->config->del_vqs(vdev);
+			err = -EINVAL;
+			goto out;
+		}
+
 		spin_lock_init(&vblk->vqs[i].lock);
 		vblk->vqs[i].vq = vqs[i];
 	}
@@ -1254,7 +1278,7 @@ static int virtblk_read_limits(struct virtio_blk *vblk,
 	u16 min_io_size;
 	u8 physical_block_exp, alignment_offset;
 	size_t max_dma_size;
-	int err;
+	int err, i;
 
 	/* We need to know how many segments before we allocate. */
 	err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SEG_MAX,
@@ -1268,6 +1292,23 @@ static int virtblk_read_limits(struct virtio_blk *vblk,
 	/* Prevent integer overflows and honor max vq size */
 	sg_elems = min_t(u32, sg_elems, VIRTIO_BLK_MAX_SG_ELEMS - 2);
 
+	/*
+	 * virtblk_add_req() uses separate outgoing and incoming header
+	 * descriptors (out_hdr and in_hdr), consuming 2 extra descriptors
+	 * per request in addition to the data segments.
+	 *
+	 * Per virtio specification (2.7.5.3.1), a driver MUST NOT create a
+	 * descriptor chain longer than the Queue Size of the device.
+	 *
+	 * Clamp max_segments to (ring_size - 2) across all virtqueues so
+	 * that a request never exceeds the ring size of any queue.
+	 */
+	for (i = 0; i < vblk->num_vqs; i++) {
+		u32 ring_size = virtqueue_get_vring_size(vblk->vqs[i].vq);
+
+		sg_elems = min_t(u32, sg_elems, ring_size - 2);
+	}
+
 	/* We can handle whatever the host told us to handle. */
 	lim->max_segments = sg_elems;
 
@@ -1467,6 +1508,7 @@ static int virtblk_probe(struct virtio_device *vdev)
 	mutex_init(&vblk->vdev_mutex);
 
 	vblk->vdev = vdev;
+	vblk->disk = NULL;
 
 	INIT_WORK(&vblk->config_work, virtblk_config_changed_work);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0163/1005] vduse: avoid infinite loop when no affinity CPU is online
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (161 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0162/1005] virtio-blk: clamp max_segments to virtqueue ring size Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0164/1005] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
                   ` (210 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jia Jia, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Jia Jia <physicalmtea@gmail.com>

[ Upstream commit cf0a5805d43236e308f14188f9737ddcf83fb53a ]

If all CPUs in vq->irq_affinity are offline, cpumask_next() walks to the
end of the mask, and the loop then resets the cursor to IRQ_UNBOUND and
restarts the scan. When VDUSE_VQ_INJECT_IRQ is issued, the intersection of
vq->irq_affinity and cpu_online_mask is empty, so the caller busy-loops in
kernel context on its current CPU (e.g. CPU2).

Replace the while loop in vduse_vq_update_effective_cpu() with
cpumask_next_and_wrap() to find the intersection of vq->irq_affinity and
cpu_online_mask in a single wrapped scan. If the intersection is empty, set
curr_cpu to IRQ_UNBOUND and let the existing unbound workqueue handle
injection, avoiding repeated rescans when all CPUs in the affinity are
offline. Use cpus_read_lock()/cpus_read_unlock() to keep the selected CPU
online.

Fixes: 28f6288eb63d ("vduse: Support set_vq_affinity callback")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260919083933.104437-1-physicalmtea@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vdpa/vdpa_user/vduse_dev.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c
index 49a231bdf9489..f953353b50b4a 100644
--- a/drivers/vdpa/vdpa_user/vduse_dev.c
+++ b/drivers/vdpa/vdpa_user/vduse_dev.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/cdev.h>
 #include <linux/device.h>
+#include <linux/cpu.h>
 #include <linux/eventfd.h>
 #include <linux/slab.h>
 #include <linux/wait.h>
@@ -1430,14 +1431,10 @@ static void vduse_vq_update_effective_cpu(struct vduse_virtqueue *vq)
 {
 	int curr_cpu = vq->irq_effective_cpu;
 
-	while (true) {
-		curr_cpu = cpumask_next(curr_cpu, &vq->irq_affinity);
-		if (cpu_online(curr_cpu))
-			break;
-
-		if (curr_cpu >= nr_cpu_ids)
-			curr_cpu = IRQ_UNBOUND;
-	}
+	curr_cpu = cpumask_next_and_wrap(curr_cpu, &vq->irq_affinity,
+					 cpu_online_mask);
+	if (curr_cpu >= nr_cpu_ids)
+		curr_cpu = IRQ_UNBOUND;
 
 	vq->irq_effective_cpu = curr_cpu;
 }
@@ -1672,10 +1669,12 @@ static long vduse_dev_ioctl(struct file *file, unsigned int cmd,
 		ret = 0;
 		index = array_index_nospec(index, dev->vq_num);
 		if (!vduse_vq_signal_irqfd(dev->vqs[index])) {
+			cpus_read_lock();
 			vduse_vq_update_effective_cpu(dev->vqs[index]);
 			ret = vduse_dev_queue_irq_work(dev,
 						&dev->vqs[index]->inject,
 						dev->vqs[index]->irq_effective_cpu);
+			cpus_read_unlock();
 		}
 		break;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0164/1005] virtio_blk: Reset device on probe error paths after DRIVER_OK
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (162 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0163/1005] vduse: avoid infinite loop when no affinity CPU is online Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0165/1005] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
                   ` (209 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yuho Choi, Stefan Hajnoczi,
	Michael S. Tsirkin, Sasha Levin

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

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

From: Yuho Choi <oss.patchbox@gmail.com>

[ Upstream commit f4f6e9a9cb349003d333f0776de94f12ac95b8d2 ]

virtblk_probe() marks the device ready before revalidating zones and
adding the disk, and either of those can fail.  The out_cleanup_disk path
they take goes on to delete the virtqueues, but nothing tells the device
to stop first, so it is still live when the rings are freed.

Reset the device at out_cleanup_disk, which is only reachable after
virtio_device_ready().  virtblk_remove() and virtblk_freeze_priv() both
reset before deleting the virtqueues for the same reason.

Fixes: dbb301f91fc8 ("virtio_blk: add error handling support for add_disk()")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260922211207.523999-1-oss.patchbox@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/virtio_blk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index cb694afde3e5d..f97799b5154f2 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1590,6 +1590,7 @@ static int virtblk_probe(struct virtio_device *vdev)
 	return 0;
 
 out_cleanup_disk:
+	virtio_reset_device(vdev);
 	put_disk(vblk->disk);
 out_free_tags:
 	blk_mq_free_tag_set(&vblk->tag_set);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0165/1005] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (163 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0164/1005] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0166/1005] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
                   ` (208 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Konrad Dybcio,
	Mark Brown, Sasha Levin

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

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

From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

[ Upstream commit 053c50a7052549aab0d310ad505947db3e211592 ]

The SAW voltage change runs on CPU 0 from an IPI, but it reaches the SAW
registers through the syscon regmap, which is protected by a spinlock_t.
That is a sleeping lock on PREEMPT_RT, and lockdep complains as soon as
VDD_APCC actually changes voltage:

  BUG: Invalid wait context
  ...
  regmap_lock_spinlock+0x18/0x30
  regmap_read+0x3c/0x78
  spmi_saw_set_vdd+0x50/0x1ac
  __flush_smp_call_function_queue+0x1ac/0x334

Map the SAW with a regmap of our own that uses a raw spinlock, and fail
the probe when that cannot be done instead of carrying an error pointer
around as the SAW regmap.

Fixes: 0caecaa87202 ("regulator: qcom_spmi: Add support for SAW")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20261019-fix-qcom-saw-v1-3-9c7ba3fc2493@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/regulator/Kconfig               |  1 +
 drivers/regulator/qcom_spmi-regulator.c | 35 +++++++++++++++++++------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 89789ac7a786c..9e4d3b859ed1b 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -1191,6 +1191,7 @@ config REGULATOR_QCOM_SMD_RPM
 config REGULATOR_QCOM_SPMI
 	tristate "Qualcomm SPMI regulator driver"
 	depends on SPMI || COMPILE_TEST
+	select REGMAP_MMIO
 	help
 	  If you say yes to this option, support will be included for the
 	  regulators found in Qualcomm SPMI PMICs.
diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index c1a41ce70b363..a04ddb1eac940 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -12,13 +12,13 @@
 #include <linux/bitops.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/ktime.h>
 #include <linux/regulator/driver.h>
 #include <linux/regmap.h>
 #include <linux/list.h>
-#include <linux/mfd/syscon.h>
 #include <linux/io.h>
 
 /* Pin control enable input pins. */
@@ -1335,6 +1335,14 @@ static irqreturn_t spmi_regulator_vs_ocp_isr(int irq, void *data)
 
 static struct regmap *saw_regmap;
 
+static const struct regmap_config saw_regmap_config = {
+	.name = "saw",
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = 4,
+	.use_raw_spinlock = true,
+};
+
 static void spmi_saw_set_vdd(void *data)
 {
 	u32 vctl, data3, avs_ctl, pmic_sts;
@@ -2504,7 +2512,8 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
 	const char *name;
 	struct device *dev = &pdev->dev;
 	struct device_node *node = pdev->dev.of_node;
-	struct device_node *syscon, *reg_node;
+	struct device_node *saw, *reg_node;
+	void __iomem *saw_base;
 	struct property *reg_prop;
 	int ret, lenp;
 	struct list_head *vreg_list;
@@ -2523,12 +2532,22 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
 	if (!reg)
 		return -ENODEV;
 
-	syscon = of_parse_phandle(node, "qcom,saw-reg", 0);
-	if (syscon) {
-		saw_regmap = syscon_node_to_regmap(syscon);
-		of_node_put(syscon);
-		if (IS_ERR(saw_regmap))
-			dev_err(dev, "ERROR reading SAW regmap\n");
+	saw = of_parse_phandle(node, "qcom,saw-reg", 0);
+	if (saw) {
+		saw_base = devm_of_iomap(dev, saw, 0, NULL);
+		of_node_put(saw);
+		if (IS_ERR(saw_base))
+			return dev_err_probe(dev, PTR_ERR(saw_base),
+					     "failed to map the SAW\n");
+
+		saw_regmap = devm_regmap_init_mmio(dev, saw_base,
+						   &saw_regmap_config);
+		if (IS_ERR(saw_regmap)) {
+			ret = PTR_ERR(saw_regmap);
+			saw_regmap = NULL;
+			return dev_err_probe(dev, ret,
+					     "failed to set the SAW regmap up\n");
+		}
 	}
 
 	for (; reg->name; reg++) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0166/1005] net: sparx5/lan969x: release the in-flight slot of a stale TX skb
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (164 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0165/1005] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0167/1005] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
                   ` (207 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Daniel Machon, Simon Horman,
	Paolo Abeni, Sasha Levin

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

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

From: Daniel Machon <daniel.machon@microchip.com>

[ Upstream commit 873363ac591a1774aa3ced84f7ea3d93a3eb9b07 ]

sparx5_ptp_txtstamp_request() counts every two step TX skb waiting for
its timestamp in sparx5->ptp_skbs, and refuses new ones once
SPARX5_MAX_PTP_ID are in flight. sparx5_ptp_txtstamp_old_release()
frees the skbs that have waited longer than SPARX5_PTP_TIMEOUT.

Before this patch, old_release() does not decrement ptp_skbs, so every
skb whose timestamp never arrives, for example because the switch
discarded the frame, keeps its slot forever. Once SPARX5_MAX_PTP_ID
slots are lost, two step frames fail to transmit on every port of the
switch.

Return the number of released skbs from old_release() and subtract it
from ptp_skbs in txtstamp_request(), under the ptp_ts_id_lock it already
takes.

This fixes the accounting only. A port's stale skbs are still aged out
only when that port sends a two step frame, so a port that stops sending
them keeps its stale skbs, and their slots, until it sends one again.
That behaviour is unchanged by this patch.

Found by an AI code review agent. Reproduced on a lan9696 board with a
modified kernel that drops the TX timestamps of two step frames, after
which two step timestamping stopped working on the port. With the fix,
timestamping keeps working on that board and on a sparx5 PCB135 board.

Fixes: 70dfe25cd866 ("net: sparx5: Update extraction/injection for timestamping")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029-sparx5-ptp-stale-tx-slot-v1-1-ec15f391bbb7@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c b/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
index 2826e48af1033..9f61692b243b7 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
@@ -204,9 +204,10 @@ static void sparx5_ptp_classify(struct sparx5_port *port, struct sk_buff *skb,
 	*rew_op = IFH_REW_OP_TWO_STEP_PTP;
 }
 
-static void sparx5_ptp_txtstamp_old_release(struct sparx5_port *port)
+static unsigned int sparx5_ptp_txtstamp_old_release(struct sparx5_port *port)
 {
 	struct sk_buff *skb, *skb_tmp;
+	unsigned int purged = 0;
 	unsigned long flags;
 
 	spin_lock_irqsave(&port->tx_skbs.lock, flags);
@@ -217,8 +218,11 @@ static void sparx5_ptp_txtstamp_old_release(struct sparx5_port *port)
 
 		__skb_unlink(skb, &port->tx_skbs);
 		dev_kfree_skb_any(skb);
+		purged++;
 	}
 	spin_unlock_irqrestore(&port->tx_skbs.lock, flags);
+
+	return purged;
 }
 
 int sparx5_ptp_txtstamp_request(struct sparx5_port *port,
@@ -226,6 +230,7 @@ int sparx5_ptp_txtstamp_request(struct sparx5_port *port,
 {
 	struct sparx5 *sparx5 = port->sparx5;
 	u8 rew_op, pdu_type, pdu_w16_offset;
+	unsigned int purged;
 	unsigned long flags;
 
 	sparx5_ptp_classify(port, skb, &rew_op, &pdu_type, &pdu_w16_offset);
@@ -236,9 +241,10 @@ int sparx5_ptp_txtstamp_request(struct sparx5_port *port,
 	if (rew_op != IFH_REW_OP_TWO_STEP_PTP)
 		return 0;
 
-	sparx5_ptp_txtstamp_old_release(port);
+	purged = sparx5_ptp_txtstamp_old_release(port);
 
 	spin_lock_irqsave(&sparx5->ptp_ts_id_lock, flags);
+	sparx5->ptp_skbs -= purged;
 	if (sparx5->ptp_skbs == SPARX5_MAX_PTP_ID) {
 		spin_unlock_irqrestore(&sparx5->ptp_ts_id_lock, flags);
 		return -EBUSY;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0167/1005] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (165 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0166/1005] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0168/1005] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
                   ` (206 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Bartosz Golaszewski,
	Sasha Levin

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

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

From: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>

[ Upstream commit 9e4b35c95fede87bad36f68b7ff1eae94ea6b910 ]

GPIO chip cleanup can call the to_irq callback while releasing requested
GPIOs. Removing the IRQ domain first leaves that callback using a freed
domain, both on removal and after an IRQ request failure.

Register domain cleanup before GPIO chip registration so devres removes
the chip before freeing the domain.

This issue was found by our static analysis tool under development.

Fixes: 257e10752c13 ("gpio: mpc8xxx: Use of_mm_gpiochip_remove")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
Link: https://patch.msgid.link/a4fec7fe970d6fc9135b488f57ba7e145b809359.1793377433.git.liguangshuo@mail.sdu.edu.cn
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-mpc8xxx.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index a6868f6738315..605393d3c9920 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -319,6 +319,14 @@ static const struct of_device_id mpc8xxx_gpio_ids[] = {
 	{}
 };
 
+static void mpc8xxx_irq_domain_remove(void *data)
+{
+	struct mpc8xxx_gpio_chip *mpc8xxx_gc = data;
+
+	if (mpc8xxx_gc->irq)
+		irq_domain_remove(mpc8xxx_gc->irq);
+}
+
 static int mpc8xxx_probe(struct platform_device *pdev)
 {
 	const struct mpc8xxx_gpio_devtype *devtype = NULL;
@@ -405,6 +413,11 @@ static int mpc8xxx_probe(struct platform_device *pdev)
 						       mpc8xxx_gc->regs + GPIO_DIR);
 	}
 
+	/* GPIO chip cleanup still needs the IRQ domain. */
+	ret = devm_add_action_or_reset(dev, mpc8xxx_irq_domain_remove, mpc8xxx_gc);
+	if (ret)
+		return ret;
+
 	ret = devm_gpiochip_add_data(dev, gc, mpc8xxx_gc);
 	if (ret) {
 		dev_err(dev,
@@ -437,7 +450,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
 	if (ret) {
 		dev_err(dev, "failed to devm_request_irq(%d), ret = %d\n",
 			mpc8xxx_gc->irqn, ret);
-		goto err;
+		return ret;
 	}
 
 	ret = devm_device_init_wakeup(dev);
@@ -445,19 +458,14 @@ static int mpc8xxx_probe(struct platform_device *pdev)
 		return dev_err_probe(dev, ret, "Failed to init wakeup\n");
 
 	return 0;
-err:
-	irq_domain_remove(mpc8xxx_gc->irq);
-	return ret;
 }
 
 static void mpc8xxx_remove(struct platform_device *pdev)
 {
 	struct mpc8xxx_gpio_chip *mpc8xxx_gc = platform_get_drvdata(pdev);
 
-	if (mpc8xxx_gc->irq) {
+	if (mpc8xxx_gc->irq)
 		irq_set_chained_handler_and_data(mpc8xxx_gc->irqn, NULL, NULL);
-		irq_domain_remove(mpc8xxx_gc->irq);
-	}
 }
 
 static int mpc8xxx_suspend(struct device *dev)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0168/1005] net/iucv: take a private, writable frame before rewriting it in place
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (166 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0167/1005] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0169/1005] net: phy: add phy_detach_internal() helper Greg Kroah-Hartman
                   ` (205 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bryam Vargas, Simon Horman,
	Paolo Abeni, Sasha Levin

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

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

From: Bryam Vargas <hexlabsecurity@proton.me>

[ Upstream commit f38bce9af9e2a3cced7d303a1476f21c1f42bcb7 ]

afiucv_hs_rcv() rewrites the frame in place -- EBCASC() on four name
fields, then afiucv_swap_src_dest() swaps them and pushes an Ethernet
header -- and can hand the same skb to dev_queue_xmit(), without making
it private first, so a packet socket that also gets the frame reads the
rewritten names. An ETH_P_ALL tap runs first and leaves af_iucv a
cloned skb; a socket opened for ETH_P_AF_IUCV sits on a ptype_specific
list, walked after ptype_base[], so deliver_skb() takes a reference and
af_iucv runs on an skb that is shared but not cloned.

Unshare, then cow, in that order: skb_cow() can reach
pskb_expand_head(), which has BUG_ON(skb_shared()). skb_cow() tests
skb_cloned(), which is what a rewrite of the data needs; skb_cow_head()
tests only the header. Asking for ETH_HLEN also covers the unchecked
push in afiucv_swap_src_dest(); on the ordinary path eth_type_trans()
has already pulled that much, so it only compares.

Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
Closes: https://sashiko.dev/#/patchset/20260813-b4-disp-60433a46-v1-1-509e1200533e@proton.me?part=1
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261028-b4-disp-1edbbc34-v3-1-13495411f5b9@proton.me
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/iucv/af_iucv.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index db261ecd19af1..b02c865c71fa5 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -2072,11 +2072,20 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev,
 	int err = NET_RX_SUCCESS;
 	char nullstring[8];
 
+	skb = skb_share_check(skb, GFP_ATOMIC);
+	if (!skb)
+		return NET_RX_SUCCESS;
+
 	if (!pskb_may_pull(skb, sizeof(*trans_hdr))) {
 		kfree_skb(skb);
 		return NET_RX_SUCCESS;
 	}
 
+	if (skb_cow(skb, ETH_HLEN)) {
+		kfree_skb(skb);
+		return NET_RX_SUCCESS;
+	}
+
 	trans_hdr = iucv_trans_hdr(skb);
 	EBCASC(trans_hdr->destAppName, sizeof(trans_hdr->destAppName));
 	EBCASC(trans_hdr->destUserID, sizeof(trans_hdr->destUserID));
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0169/1005] net: phy: add phy_detach_internal() helper
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (167 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0168/1005] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0170/1005] net: phy: dont require RTNL to detach a PHY from an unregistered netdev Greg Kroah-Hartman
                   ` (204 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Markus Stockhausen, Andrew Lunn,
	Jakub Kicinski, Sasha Levin

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

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

From: Markus Stockhausen <markus.stockhausen@gmx.de>

[ Upstream commit 2df76677c1c08f622cc577a49f0645a5976d7c91 ]

For the upcoming MDIO bus notification enhancements the PHY detach path
needs to inform the bus about these actions. Until now phy_detach() is
used for the regular detach path as well as from the phy_attach_direct()
error paths So in the future there must be a clear indication if a
notification is needed (normal path) or not (cleanup path).

Carve out the phy_detach() code into a new helper phy_detach_internal()
and make phy_detach() a short stub that calls the new helper.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260831143439.2404484-5-markus.stockhausen@gmx.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: d1cf56164dc2 ("net: phy: don't require RTNL to detach a PHY from an unregistered netdev")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/phy/phy_device.c | 172 +++++++++++++++++++----------------
 1 file changed, 92 insertions(+), 80 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 94b2e85e00a37..2827d2226d6a9 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1734,6 +1734,98 @@ static bool phy_drv_supports_irq(const struct phy_driver *phydrv)
 	return phydrv->config_intr && phydrv->handle_interrupt;
 }
 
+/**
+ * phy_detach_internal - detach a PHY device from its network device
+ * @phydev: target phy_device struct
+ *
+ * This detaches the phy device from its network device and the phy
+ * driver, and drops the reference count taken in phy_attach_direct().
+ */
+static void phy_detach_internal(struct phy_device *phydev)
+{
+	struct net_device *dev = phydev->attached_dev;
+	struct module *ndev_owner = NULL;
+	struct mii_bus *bus;
+
+	if (phydev->devlink) {
+		device_link_del(phydev->devlink);
+		phydev->devlink = NULL;
+	}
+
+	if (phydev->sysfs_links) {
+		if (dev)
+			sysfs_remove_link(&dev->dev.kobj, "phydev");
+		sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev");
+	}
+
+	if (!phydev->attached_dev)
+		sysfs_remove_file(&phydev->mdio.dev.kobj,
+				  &dev_attr_phy_standalone.attr);
+
+	phy_suspend(phydev);
+	if (dev) {
+		struct hwtstamp_provider *hwprov;
+
+		/* hwprov may technically be protected by ops lock but
+		 * not for devices with a phydev, see phy_link_topo_add_phy()
+		 */
+		hwprov = rtnl_dereference(dev->hwprov);
+		/* Disable timestamp if it is the one selected */
+		if (hwprov && hwprov->phydev == phydev) {
+			rcu_assign_pointer(dev->hwprov, NULL);
+			kfree_rcu(hwprov, rcu_head);
+		}
+
+		phydev->attached_dev->phydev = NULL;
+		phydev->attached_dev = NULL;
+		phy_link_topo_del_phy(dev, phydev);
+	}
+
+	phydev->phy_link_change = NULL;
+	phydev->phylink = NULL;
+
+	if (phydev->mdio.dev.driver)
+		module_put(phydev->mdio.dev.driver->owner);
+
+	/* If the device had no specific driver before (i.e. - it
+	 * was using the generic driver), we unbind the device
+	 * from the generic driver so that there's a chance a
+	 * real driver could be loaded
+	 */
+	if (phydev->is_genphy_driven) {
+		device_release_driver(&phydev->mdio.dev);
+		phydev->is_genphy_driven = 0;
+	}
+
+	/* Assert the reset signal */
+	phy_device_reset(phydev, 1);
+
+	/*
+	 * The phydev might go away on the put_device() below, so avoid
+	 * a use-after-free bug by reading the underlying bus first.
+	 */
+	bus = phydev->mdio.bus;
+
+	put_device(&phydev->mdio.dev);
+	if (dev)
+		ndev_owner = dev->dev.parent->driver->owner;
+	if (ndev_owner != bus->owner)
+		module_put(bus->owner);
+}
+
+/**
+ * phy_detach - detach a PHY device from its network device
+ * @phydev: target phy_device struct
+ *
+ * This detaches the phy device from its network device and the phy
+ * driver, and drops the reference count taken in phy_attach_direct().
+ */
+void phy_detach(struct phy_device *phydev)
+{
+	phy_detach_internal(phydev);
+}
+EXPORT_SYMBOL(phy_detach);
+
 /**
  * phy_attach_direct - attach a network device to a given PHY device pointer
  * @dev: network device to attach
@@ -1906,86 +1998,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 }
 EXPORT_SYMBOL(phy_attach_direct);
 
-/**
- * phy_detach - detach a PHY device from its network device
- * @phydev: target phy_device struct
- *
- * This detaches the phy device from its network device and the phy
- * driver, and drops the reference count taken in phy_attach_direct().
- */
-void phy_detach(struct phy_device *phydev)
-{
-	struct net_device *dev = phydev->attached_dev;
-	struct module *ndev_owner = NULL;
-	struct mii_bus *bus;
-
-	if (phydev->devlink) {
-		device_link_del(phydev->devlink);
-		phydev->devlink = NULL;
-	}
-
-	if (phydev->sysfs_links) {
-		if (dev)
-			sysfs_remove_link(&dev->dev.kobj, "phydev");
-		sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev");
-	}
-
-	if (!phydev->attached_dev)
-		sysfs_remove_file(&phydev->mdio.dev.kobj,
-				  &dev_attr_phy_standalone.attr);
-
-	phy_suspend(phydev);
-	if (dev) {
-		struct hwtstamp_provider *hwprov;
-
-		/* hwprov may technically be protected by ops lock but
-		 * not for devices with a phydev, see phy_link_topo_add_phy()
-		 */
-		hwprov = rtnl_dereference(dev->hwprov);
-		/* Disable timestamp if it is the one selected */
-		if (hwprov && hwprov->phydev == phydev) {
-			rcu_assign_pointer(dev->hwprov, NULL);
-			kfree_rcu(hwprov, rcu_head);
-		}
-
-		phydev->attached_dev->phydev = NULL;
-		phydev->attached_dev = NULL;
-		phy_link_topo_del_phy(dev, phydev);
-	}
-
-	phydev->phy_link_change = NULL;
-	phydev->phylink = NULL;
-
-	if (phydev->mdio.dev.driver)
-		module_put(phydev->mdio.dev.driver->owner);
-
-	/* If the device had no specific driver before (i.e. - it
-	 * was using the generic driver), we unbind the device
-	 * from the generic driver so that there's a chance a
-	 * real driver could be loaded
-	 */
-	if (phydev->is_genphy_driven) {
-		device_release_driver(&phydev->mdio.dev);
-		phydev->is_genphy_driven = 0;
-	}
-
-	/* Assert the reset signal */
-	phy_device_reset(phydev, 1);
-
-	/*
-	 * The phydev might go away on the put_device() below, so avoid
-	 * a use-after-free bug by reading the underlying bus first.
-	 */
-	bus = phydev->mdio.bus;
-
-	put_device(&phydev->mdio.dev);
-	if (dev)
-		ndev_owner = dev->dev.parent->driver->owner;
-	if (ndev_owner != bus->owner)
-		module_put(bus->owner);
-}
-EXPORT_SYMBOL(phy_detach);
-
 int phy_suspend(struct phy_device *phydev)
 {
 	struct net_device *netdev = phydev->attached_dev;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0170/1005] net: phy: dont require RTNL to detach a PHY from an unregistered netdev
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (168 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0169/1005] net: phy: add phy_detach_internal() helper Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0171/1005] wifi: ath12k: dont advertise EHT-MCS15 to firmware unless we support it Greg Kroah-Hartman
                   ` (203 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+583f42a41879bb60de32,
	Nguyen Ngoc Thang, Kory Maincent, Paolo Abeni, Sasha Levin

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

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

From: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>

[ Upstream commit d1cf56164dc25c2c54853b23eab42369f53c8329 ]

phy_detach_internal() reads dev->hwprov with rtnl_dereference(), but
MAC drivers commonly attach and detach PHYs while their net_device is
not registered, without holding RTNL. Before register_netdev(), a failed
phylink_connect_phy() or phy_attach_direct() unwinds through
phy_detach_internal(). After unregister_netdev(), a driver's remove path
may call phy_disconnect(). Both trip lockdep:

  WARNING: suspicious RCU usage
  drivers/net/phy/phy_device.c:1831 suspicious rcu_dereference_protected() usage!
   phy_detach_internal+0x6a5/0x830 drivers/net/phy/phy_device.c:1831
   phylink_connect_phy+0x22e/0x2b0 drivers/net/phy/phylink.c:2452
   ax88772_bind+0xbb1/0x1520 drivers/net/usb/asix_devices.c:925
   usbnet_probe+0xbb3/0x27e0 drivers/net/usb/usbnet.c:1812

syzbot hits this with an emulated asix device. phy_eee_rx_clock_stop()
fails on a USB MDIO error, so phylink_bringup_phy() fails and the PHY is
detached from inside usbnet_probe(), before the netdev is registered.

hwprov is only set through ethtool, under RTNL, on a registered device.
reg_state also changes only under RTNL. So if the device is not
registered, no one else can reach hwprov, and RTNL is not needed. Tell
lockdep that. A detach from a registered device without RTNL still
warns.

Fixes: 35f7cad1743e ("net: Add the possibility to support a selected hwtstamp in netdevice")
Reported-by: syzbot+583f42a41879bb60de32@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=583f42a41879bb60de32
Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20261029142423.93573-1-ngocthang2710.1999@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/phy/phy_device.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 2827d2226d6a9..5ec2bfdb23370 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1767,9 +1767,13 @@ static void phy_detach_internal(struct phy_device *phydev)
 		struct hwtstamp_provider *hwprov;
 
 		/* hwprov may technically be protected by ops lock but
-		 * not for devices with a phydev, see phy_link_topo_add_phy()
+		 * not for devices with a phydev, see phy_link_topo_add_phy().
+		 * Drivers may detach without RTNL while dev is unregistered,
+		 * but then nothing else can reach hwprov.
 		 */
-		hwprov = rtnl_dereference(dev->hwprov);
+		hwprov = rcu_dereference_protected(dev->hwprov,
+						   lockdep_rtnl_is_held() ||
+						   dev->reg_state != NETREG_REGISTERED);
 		/* Disable timestamp if it is the one selected */
 		if (hwprov && hwprov->phydev == phydev) {
 			rcu_assign_pointer(dev->hwprov, NULL);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0171/1005] wifi: ath12k: dont advertise EHT-MCS15 to firmware unless we support it
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (169 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0170/1005] net: phy: dont require RTNL to detach a PHY from an unregistered netdev Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0172/1005] net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume() Greg Kroah-Hartman
                   ` (202 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vladimir Petrzhikovskii,
	Baochen Qiang, Vasanthakumar Thiagarajan, Jeff Johnson,
	Sasha Levin

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

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

From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>

[ Upstream commit 83d689bbe8f90ce39961bcc3a64f2ca2ec184019 ]

ath12k_peer_assoc_h_eht() copies the peer's EHT PHY capabilities into
the WMI peer assoc command as is, including the EHT-MCS15 support bits.
Firmware rate control enables EHT-MCS15 for TX whenever those bits are
set, without checking whether the local PHY supports MCS15.

Currently WCN7850 firmware does not support EHT-MCS15 for TX and does
not advertise it in its own EHT PHY capabilities. When connected to an
AP that advertises MCS15 support, rate control may still select
EHT-MCS15, and every PPDU at that rate is aborted by the PHY before it
goes on the air. TX then stops for minutes while the association stays
up, and frames sit in the queue until the firmware releases them as aged.

Keep only the peer's MCS15 support bits that we also support ourselves
to fix it. Chips that support MCS15 are not affected.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Fixes: 17bbb8aa74fd ("wifi: ath12k: prepare EHT peer assoc parameters")
Reported-by: Vladimir Petrzhikovskii <vladimir@dfb.sh>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222136
Tested-by: Vladimir Petrzhikovskii <vladimir@dfb.sh>
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20261029-ath12k-mcs15-v1-1-3bcfab101f00@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/ath12k/mac.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index b5c3519065a2a..beccf11eb8aad 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -3366,6 +3366,7 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
 	u32 *rx_mcs, *tx_mcs;
 	u16 *eht_mcs_mask;
 	u8 max_nss = 0;
+	u8 mcs15;
 
 	lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
 
@@ -3416,6 +3417,16 @@ static void ath12k_peer_assoc_h_eht(struct ath12k *ar,
 	memcpy(arg->peer_eht_cap_phy, eht_cap->eht_cap_elem.phy_cap_info,
 	       sizeof(eht_cap->eht_cap_elem.phy_cap_info));
 
+	/*
+	 * Firmware rate control enables EHT-MCS15 based only on the peer's
+	 * MCS15 support bits, so keep only the ones we support ourselves.
+	 */
+	mcs15 = u8_get_bits(eht_cap->eht_cap_elem.phy_cap_info[6] &
+			    own_eht_cap->eht_cap_elem.phy_cap_info[6],
+			    IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK);
+	u8p_replace_bits(&((u8 *)arg->peer_eht_cap_phy)[6], mcs15,
+			 IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK);
+
 	rx_mcs = arg->peer_eht_rx_mcs_set;
 	tx_mcs = arg->peer_eht_tx_mcs_set;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0172/1005] net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (170 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0171/1005] wifi: ath12k: dont advertise EHT-MCS15 to firmware unless we support it Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0173/1005] net: stmmac: ptp: switch to gettimex64() interface Greg Kroah-Hartman
                   ` (201 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maxime Chevallier, Lorenzo Bianconi,
	Jakub Kicinski, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 8181678a92f0143ad3dafcc2e811afa44ecb4fd6 ]

stmmac_setup_ptp() returns void and swallows both PTP setup errors:
the PTP reference clock enable and stmmac_init_timestamping()
failures are logged but never propagated. When they fail, the MAC
system time counter is left in its post-reset, non-running state,
while the driver keeps operating as if timestamping were up.
This matters for TAPRIO/EST qdisc offloading, which derives the EST
base time from the hardware timestamp counter: arming the gate list
against a non-advancing time base would leave the schedule permanently
stuck.

Make stmmac_setup_ptp() return an error code and propagate the
failure in __stmmac_open(), stopping the DMA engines when PTP setup
fails. In stmmac_resume(), re-initialise timestamping only when the
PTP clock was registered before suspend, re-apply the platform clock
rate configuration, and stop the DMA engines if re-initialisation
fails.

While at it, factor the hardware timestamping capability check into a
stmmac_check_timestamp_cap() helper and apply it to the hwtstamp get
path and the ethtool ts_info path. stmmac_setup_ptp() now enables the
PTP reference clock and runs the platform ptp_clk_freq_config()
callback before validating the resulting clock rate; if no valid rate
is available, it disables the clock and returns success without
registering the PTP clock. This keeps the interface operational on
platforms with PTP-capable silicon but an unconfigured PTP clock,
where timestamping cannot be enabled: instead of failing, the driver
proceeds without setting up timestamping. Extend the timestamping gate
on the set path (which keeps testing the core's basic/advanced
timestamping capability) and the devlink registration with the PTP
reference clock rate requirement.

Gate the PTP reference clock enable/disable in the platform noirq
suspend/resume callbacks on priv->ptp_enabled, keeping the clock
reference balanced against the new early return in
stmmac_release_ptp().

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260914-stmmac-ptp-error-propagate-v5-1-81149897e65d@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |   7 ++
 .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |   3 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 114 +++++++++++++-----
 .../ethernet/stmicro/stmmac/stmmac_platform.c |   6 +-
 4 files changed, 95 insertions(+), 35 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 9cdad84308568..e782323df61ec 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -336,6 +336,8 @@ struct stmmac_priv {
 	struct kernel_hwtstamp_config tstamp_config;
 	struct ptp_clock *ptp_clock;
 	struct ptp_clock_info ptp_clock_ops;
+	bool ptp_enabled;
+
 	unsigned int default_addend;
 	u32 sub_second_inc;
 	u32 systime_flags;
@@ -426,6 +428,11 @@ int stmmac_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
 
 struct plat_stmmacenet_data *stmmac_plat_dat_alloc(struct device *dev);
 
+static inline bool stmmac_check_timestamp_cap(struct stmmac_priv *priv)
+{
+	return priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp;
+}
+
 static inline bool stmmac_xdp_is_enabled(struct stmmac_priv *priv)
 {
 	return !!priv->xdp_prog;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index e2c5b69505104..30e0d499326d8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -1008,8 +1008,7 @@ static int stmmac_get_ts_info(struct net_device *dev,
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
 
-	if ((priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) {
-
+	if (stmmac_check_timestamp_cap(priv)) {
 		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
 					SOF_TIMESTAMPING_TX_HARDWARE |
 					SOF_TIMESTAMPING_RX_HARDWARE |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 7149b14bdad48..f6400d439b9b1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -653,7 +653,8 @@ static int stmmac_hwtstamp_set(struct net_device *dev,
 	u32 ts_master_en = 0;
 	u32 ts_event_en = 0;
 
-	if (!(priv->dma_cap.time_stamp || priv->adv_ts)) {
+	if (!priv->plat->clk_ptp_rate ||
+	    !(priv->dma_cap.time_stamp || priv->adv_ts)) {
 		NL_SET_ERR_MSG_MOD(extack, "No support for HW time stamping");
 		priv->hwts_tx_en = 0;
 		priv->hwts_rx_en = 0;
@@ -843,7 +844,7 @@ static int stmmac_hwtstamp_get(struct net_device *dev,
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
 
-	if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
+	if (!stmmac_check_timestamp_cap(priv))
 		return -EOPNOTSUPP;
 
 	*config = priv->tstamp_config;
@@ -866,11 +867,6 @@ static int stmmac_init_tstamp_counter(struct stmmac_priv *priv,
 {
 	struct timespec64 now;
 
-	if (!priv->plat->clk_ptp_rate) {
-		netdev_err(priv->dev, "Invalid PTP clock rate");
-		return -EINVAL;
-	}
-
 	stmmac_config_hw_tstamping(priv, priv->ptpaddr, systime_flags);
 	priv->systime_flags = systime_flags;
 
@@ -885,26 +881,37 @@ static int stmmac_init_tstamp_counter(struct stmmac_priv *priv,
 	return 0;
 }
 
+static int stmmac_init_ptp_clk_freq(struct stmmac_priv *priv)
+{
+	if (priv->plat->ptp_clk_freq_config)
+		priv->plat->ptp_clk_freq_config(priv);
+
+	if (!priv->plat->clk_ptp_rate) {
+		netdev_info(priv->dev, "PTP clock rate not configured\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 /**
  * stmmac_init_timestamping - initialise timestamping
  * @priv: driver private structure
- * Description: this is to verify if the HW supports the PTPv1 or PTPv2.
- * This is done by looking at the HW cap. register.
- * This function also registers the ptp driver.
+ *
+ * Description: initialise the hardware timestamping counter, reset the
+ * timestamping configuration and derive the advanced timestamping flags from
+ * the HW capabilities. The caller must have ensured a valid PTP reference
+ * clock rate (see stmmac_init_ptp_clk_freq()); the configured state is valid
+ * as long as the interface is open and not suspended, and this function is
+ * re-run on resume.
+ *
+ * Return: 0 on success, a negative errno otherwise.
  */
 static int stmmac_init_timestamping(struct stmmac_priv *priv)
 {
 	bool xmac = dwmac_is_xmac(priv->plat->core_type);
 	int ret;
 
-	if (priv->plat->ptp_clk_freq_config)
-		priv->plat->ptp_clk_freq_config(priv);
-
-	if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) {
-		netdev_info(priv->dev, "PTP not supported by HW\n");
-		return -EOPNOTSUPP;
-	}
-
 	ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE |
 					       PTP_TCR_TSCFUPDT);
 	if (ret) {
@@ -937,24 +944,48 @@ static int stmmac_init_timestamping(struct stmmac_priv *priv)
 	return 0;
 }
 
-static void stmmac_setup_ptp(struct stmmac_priv *priv)
+static int stmmac_setup_ptp(struct stmmac_priv *priv)
 {
 	int ret;
 
+	if (!stmmac_check_timestamp_cap(priv)) {
+		netdev_info(priv->dev, "PTP not supported\n");
+		return 0;
+	}
+
 	ret = clk_prepare_enable(priv->plat->clk_ptp_ref);
-	if (ret < 0)
+	if (ret < 0) {
 		netdev_warn(priv->dev,
 			    "failed to enable PTP reference clock: %pe\n",
 			    ERR_PTR(ret));
+		return ret;
+	}
 
-	if (stmmac_init_timestamping(priv) == 0)
-		stmmac_ptp_register(priv);
+	if (stmmac_init_ptp_clk_freq(priv)) {
+		clk_disable_unprepare(priv->plat->clk_ptp_ref);
+		return 0;
+	}
+
+	ret = stmmac_init_timestamping(priv);
+	if (ret) {
+		clk_disable_unprepare(priv->plat->clk_ptp_ref);
+		return ret;
+	}
+
+	stmmac_ptp_register(priv);
+	priv->ptp_enabled = true;
+
+	return 0;
 }
 
 static void stmmac_release_ptp(struct stmmac_priv *priv)
 {
+	if (!priv->ptp_enabled)
+		return;
+
 	stmmac_ptp_unregister(priv);
 	clk_disable_unprepare(priv->plat->clk_ptp_ref);
+	priv->ptp_enabled = false;
 }
 
 static void stmmac_legacy_serdes_power_down(struct stmmac_priv *priv)
@@ -4175,10 +4206,12 @@ static int __stmmac_open(struct net_device *dev,
 	ret = stmmac_hw_setup(dev);
 	if (ret < 0) {
 		netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
-		goto init_error;
+		return ret;
 	}
 
-	stmmac_setup_ptp(priv);
+	ret = stmmac_setup_ptp(priv);
+	if (ret)
+		goto ptp_error;
 
 	stmmac_init_coalesce(priv);
 
@@ -4203,7 +4236,10 @@ static int __stmmac_open(struct net_device *dev,
 		hrtimer_cancel(&priv->dma_conf.tx_queue[chan].txtimer);
 
 	stmmac_release_ptp(priv);
-init_error:
+ptp_error:
+	stmmac_stop_all_dma(priv);
+	stmmac_mac_set(priv, priv->ioaddr, false);
+
 	return ret;
 }
 
@@ -7796,8 +7832,7 @@ static int stmmac_register_devlink(struct stmmac_priv *priv)
 	/* For now, what is exposed over devlink is only relevant when
 	 * timestamping is available and we have a valid ptp clock rate
 	 */
-	if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp) ||
-	    !priv->plat->clk_ptp_rate)
+	if (!stmmac_check_timestamp_cap(priv) || !priv->plat->clk_ptp_rate)
 		return 0;
 
 	priv->devlink = devlink_alloc(&stmmac_devlink_ops, sizeof(*dl_priv),
@@ -8415,14 +8450,19 @@ int stmmac_resume(struct device *dev)
 	ret = stmmac_hw_setup(ndev);
 	if (ret < 0) {
 		netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
-		stmmac_legacy_serdes_power_down(priv);
-		mutex_unlock(&priv->lock);
-		rtnl_unlock();
-		return ret;
+		goto error_unlock;
 	}
 
-	stmmac_init_timestamping(priv);
+	if (priv->ptp_enabled) {
+		if (stmmac_init_ptp_clk_freq(priv))
+			goto init_coalesce;
 
+		ret = stmmac_init_timestamping(priv);
+		if (ret)
+			goto error_stop_dma;
+	}
+
+init_coalesce:
 	stmmac_init_coalesce(priv);
 	phylink_rx_clk_stop_block(priv->phylink);
 	stmmac_set_rx_mode(ndev);
@@ -8445,6 +8485,16 @@ int stmmac_resume(struct device *dev)
 	netif_device_attach(ndev);
 
 	return 0;
+
+error_stop_dma:
+	stmmac_stop_all_dma(priv);
+	stmmac_mac_set(priv, priv->ioaddr, false);
+error_unlock:
+	stmmac_legacy_serdes_power_down(priv);
+	mutex_unlock(&priv->lock);
+	rtnl_unlock();
+
+	return ret;
 }
 EXPORT_SYMBOL_GPL(stmmac_resume);
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 6128ed1bd521a..19d4815544990 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -959,7 +959,8 @@ static int __maybe_unused stmmac_pltfr_noirq_suspend(struct device *dev)
 
 	if (!priv->wolopts) {
 		/* Disable clock in case of PWM is off */
-		clk_disable_unprepare(priv->plat->clk_ptp_ref);
+		if (priv->ptp_enabled)
+			clk_disable_unprepare(priv->plat->clk_ptp_ref);
 
 		ret = pm_runtime_force_suspend(dev);
 		if (ret)
@@ -984,6 +985,9 @@ static int __maybe_unused stmmac_pltfr_noirq_resume(struct device *dev)
 		if (ret)
 			return ret;
 
+		if (!priv->ptp_enabled)
+			return 0;
+
 		ret = clk_prepare_enable(priv->plat->clk_ptp_ref);
 		if (ret < 0) {
 			netdev_warn(priv->dev,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0173/1005] net: stmmac: ptp: switch to gettimex64() interface
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (171 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0172/1005] net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume() Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0174/1005] net: stmmac: initialize est_lock at probe time Greg Kroah-Hartman
                   ` (200 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, James Clark,
	Vadim Fedorenko, Paolo Abeni, Sasha Levin

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

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

From: James Clark <jjc@jclark.com>

[ Upstream commit d7804253678eb18d2be950e0542364b50be096a9 ]

The stmmac PTP support currently implements the gettime64 callback to
retrieve the hardware clock time. Update the implementation to provide
the gettimex64 callback instead, adding support for the
PTP_SYS_OFFSET_EXTENDED ioctl.

The system clock readings are taken around the read of the nanoseconds
register in get_systime(), so get_systime() gains a ptp_system_timestamp
argument.

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Assisted-by: LLM
Signed-off-by: James Clark <jjc@jclark.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20261008103809.1848255-1-jjc@jclark.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/hwif.h    |  5 ++++-
 .../ethernet/stmicro/stmmac/stmmac_hwtstamp.c |  7 +++++--
 .../net/ethernet/stmicro/stmmac/stmmac_ptp.c  | 21 ++++++++++---------
 .../stmicro/stmmac/stmmac_selftests.c         |  4 ++--
 .../net/ethernet/stmicro/stmmac/stmmac_tc.c   |  3 ++-
 5 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
index 9925b789bcc9f..bfcc930fd831f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
@@ -496,6 +496,8 @@ struct stmmac_ops {
 #define stmmac_fpe_map_preemption_class(__priv, __args...) \
 	stmmac_do_callback(__priv, mac, fpe_map_preemption_class, __args)
 
+struct ptp_system_timestamp;
+
 /* PTP and HW Timer helpers */
 struct stmmac_hwtimestamp {
 	void (*config_hw_tstamping) (void __iomem *ioaddr, u32 data);
@@ -505,7 +507,8 @@ struct stmmac_hwtimestamp {
 	int (*config_addend) (void __iomem *ioaddr, u32 addend);
 	int (*adjust_systime) (void __iomem *ioaddr, u32 sec, u32 nsec,
 			       int add_sub, int gmac4);
-	void (*get_systime) (void __iomem *ioaddr, u64 *systime);
+	void (*get_systime)(void __iomem *ioaddr, u64 *systime,
+			    struct ptp_system_timestamp *sts);
 	void (*get_ptptime)(void __iomem *ioaddr, u64 *ptp_time);
 	void (*timestamp_interrupt)(struct stmmac_priv *priv);
 	void (*hwtstamp_correct_latency)(struct stmmac_priv *priv);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
index b9a985fa772c9..870c740b4a506 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
@@ -183,7 +183,8 @@ static int adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec,
 					 10, 100000);
 }
 
-static void get_systime(void __iomem *ioaddr, u64 *systime)
+static void get_systime(void __iomem *ioaddr, u64 *systime,
+			struct ptp_system_timestamp *sts)
 {
 	u64 ns, sec0, sec1;
 
@@ -191,8 +192,10 @@ static void get_systime(void __iomem *ioaddr, u64 *systime)
 	sec1 = readl_relaxed(ioaddr + PTP_STSR);
 	do {
 		sec0 = sec1;
+		ptp_read_system_prets(sts);
 		/* Get the TSSS value */
-		ns = readl_relaxed(ioaddr + PTP_STNSR);
+		ns = readl(ioaddr + PTP_STNSR);
+		ptp_read_system_postts(sts);
 		/* Get the TSS value */
 		sec1 = readl_relaxed(ioaddr + PTP_STSR);
 	} while (sec0 != sec1);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 3bfcc9760dce7..e54a3c8878265 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -89,7 +89,8 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
 		u64 cycle_time;
 
 		mutex_lock(&priv->est_lock);
-		priv->ptp_clock_ops.gettime64(&priv->ptp_clock_ops, &current_time);
+		priv->ptp_clock_ops.gettimex64(&priv->ptp_clock_ops,
+					       &current_time, NULL);
 		current_time_ns = timespec64_to_ktime(current_time);
 		time.tv_nsec = priv->est->btr_reserve[0];
 		time.tv_sec = priv->est->btr_reserve[1];
@@ -114,15 +115,15 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
 }
 
 /**
- * stmmac_get_time
- *
+ * stmmac_get_timex - read the PTP clock, with system timestamps if requested
  * @ptp: pointer to ptp_clock_info structure
  * @ts: pointer to hold time/result
+ * @sts: pointer to hold system timestamps around the read, or NULL
  *
- * Description: this function will read the current time from the
- * hardware clock and store it in @ts.
+ * Return: 0
  */
-static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64 *ts)
+static int stmmac_get_timex(struct ptp_clock_info *ptp, struct timespec64 *ts,
+			    struct ptp_system_timestamp *sts)
 {
 	struct stmmac_priv *priv =
 	    container_of(ptp, struct stmmac_priv, ptp_clock_ops);
@@ -130,7 +131,7 @@ static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64 *ts)
 	u64 ns = 0;
 
 	read_lock_irqsave(&priv->ptp_lock, flags);
-	stmmac_get_systime(priv, priv->ptpaddr, &ns);
+	stmmac_get_systime(priv, priv->ptpaddr, &ns, sts);
 	read_unlock_irqrestore(&priv->ptp_lock, flags);
 
 	*ts = ns_to_timespec64(ns);
@@ -200,7 +201,7 @@ static int stmmac_enable(struct ptp_clock_info *ptp,
 
 		target_ns = cfg->start.tv_nsec + ((u64)cfg->start.tv_sec * NSEC_PER_SEC);
 
-		stmmac_get_systime(priv, priv->ptpaddr, &ns);
+		stmmac_get_systime(priv, priv->ptpaddr, &ns, NULL);
 		if (ns > TIME64_MAX - PTP_SAFE_TIME_OFFSET_NS)
 			return -EINVAL;
 
@@ -304,7 +305,7 @@ const struct ptp_clock_info stmmac_ptp_clock_ops = {
 	.pps = 0,
 	.adjfine = stmmac_adjust_freq,
 	.adjtime = stmmac_adjust_time,
-	.gettime64 = stmmac_get_time,
+	.gettimex64 = stmmac_get_timex,
 	.settime64 = stmmac_set_time,
 	.enable = stmmac_enable,
 };
@@ -321,7 +322,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
 	.pps = 0,
 	.adjfine = stmmac_adjust_freq,
 	.adjtime = stmmac_adjust_time,
-	.gettime64 = stmmac_get_time,
+	.gettimex64 = stmmac_get_timex,
 	.settime64 = stmmac_set_time,
 	.enable = dwmac1000_ptp_enable,
 };
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
index 6c01fdb6667e6..57aedf5228081 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
@@ -1887,7 +1887,7 @@ static int stmmac_test_tbs(struct stmmac_priv *priv)
 		return ret;
 
 	read_lock_irqsave(&priv->ptp_lock, flags);
-	stmmac_get_systime(priv, priv->ptpaddr, &curr_time);
+	stmmac_get_systime(priv, priv->ptpaddr, &curr_time, NULL);
 	read_unlock_irqrestore(&priv->ptp_lock, flags);
 
 	if (!curr_time) {
@@ -1909,7 +1909,7 @@ static int stmmac_test_tbs(struct stmmac_priv *priv)
 
 	/* Check if expected time has elapsed */
 	read_lock_irqsave(&priv->ptp_lock, flags);
-	stmmac_get_systime(priv, priv->ptpaddr, &curr_time);
+	stmmac_get_systime(priv, priv->ptpaddr, &curr_time, NULL);
 	read_unlock_irqrestore(&priv->ptp_lock, flags);
 
 	if ((curr_time - start_time) < STMMAC_TBS_LT_OFFSET)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index a7721b2eee968..399d5cb427005 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -1070,7 +1070,8 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 
 	mutex_lock(&priv->est_lock);
 	/* Adjust for real system time */
-	priv->ptp_clock_ops.gettime64(&priv->ptp_clock_ops, &current_time);
+	priv->ptp_clock_ops.gettimex64(&priv->ptp_clock_ops, &current_time,
+				       NULL);
 	current_time_ns = timespec64_to_ktime(current_time);
 	time = stmmac_calc_tas_basetime(qopt->base_time, current_time_ns,
 					qopt->cycle_time);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0174/1005] net: stmmac: initialize est_lock at probe time
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (172 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0173/1005] net: stmmac: ptp: switch to gettimex64() interface Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0175/1005] net: stmmac: pass the desired EST enable state to est_configure() Greg Kroah-Hartman
                   ` (199 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maxime Chevallier, Lorenzo Bianconi,
	Paolo Abeni, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 98caed39c1db002b2c34b8040ab765c5fa9c6675 ]

priv->est is allocated with devm_kzalloc() on the first TAPRIO REPLACE
and priv->est_lock is initialized in the same place, which ties the
validity of the lock to whether TAPRIO has ever been configured. The
lock is also never destroyed.

Initialize priv->est_lock in __stmmac_dvr_probe() next to priv->lock
and destroy it in stmmac_dvr_remove(). This keeps the lock valid for
the entire lifetime of the device, independent of the TAPRIO state,
and removes the lazy initialization from the TAPRIO configuration
path.

No functional change intended.

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261029-stmmac-est-fixes-v5-1-85b830a795a9@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
 drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c   | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f6400d439b9b1..c74dcc2d37dbe 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -8145,6 +8145,7 @@ static int __stmmac_dvr_probe(struct device *device,
 	stmmac_napi_add(ndev);
 
 	mutex_init(&priv->lock);
+	mutex_init(&priv->est_lock);
 	rwlock_init(&priv->ptp_lock);
 
 	stmmac_fpe_init(priv);
@@ -8278,6 +8279,7 @@ void stmmac_dvr_remove(struct device *dev)
 
 	destroy_workqueue(priv->wq);
 	mutex_destroy(&priv->lock);
+	mutex_destroy(&priv->est_lock);
 	bitmap_free(priv->af_xdp_zc_qps);
 
 	pm_runtime_disable(dev);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index 399d5cb427005..fc6ec39f2108b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -1028,8 +1028,6 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 					 GFP_KERNEL);
 		if (!priv->est)
 			return -ENOMEM;
-
-		mutex_init(&priv->est_lock);
 	} else {
 		mutex_lock(&priv->est_lock);
 		memset(priv->est, 0, sizeof(*priv->est));
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0175/1005] net: stmmac: pass the desired EST enable state to est_configure()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (173 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0174/1005] net: stmmac: initialize est_lock at probe time Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0176/1005] net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume() Greg Kroah-Hartman
                   ` (198 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maxime Chevallier, Lorenzo Bianconi,
	Paolo Abeni, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit e4f5b46dfb8ac27a822fa0b411bd4526abf5ba97 ]

Pass the desired EST enable state explicitly to est_configure() instead
of having it derive from cfg->enable. This decouples the hardware
programming state from the priv->est->enable flag, which records whether
the taprio offload is attached.

No functional change intended: the callers keep toggling
priv->est->enable around the EST programming, as before.

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261029-stmmac-est-fixes-v5-2-85b830a795a9@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 23d96de472f7 ("net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/hwif.h       | 2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_est.c | 6 +++---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 4 ++--
 drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c  | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
index bfcc930fd831f..4c2d7b156ac0e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
@@ -623,7 +623,7 @@ struct stmmac_mmc_ops {
 
 struct stmmac_est_ops {
 	int (*configure)(struct stmmac_priv *priv, struct stmmac_est *cfg,
-			 unsigned int ptp_rate);
+			 unsigned int ptp_rate, bool enable);
 	void (*irq_status)(struct stmmac_priv *priv, struct net_device *dev,
 			   struct stmmac_extra_stats *x, u32 txqcnt);
 };
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c
index afc516059b897..f15d4d046aa74 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c
@@ -26,7 +26,7 @@ static int est_write(void __iomem *est_addr, u32 reg, u32 val, bool gcl)
 }
 
 static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg,
-			 unsigned int ptp_rate)
+			 unsigned int ptp_rate, bool enable)
 {
 	void __iomem *est_addr = priv->estaddr;
 	int i, ret = 0;
@@ -62,7 +62,7 @@ static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg,
 		ctrl |= ((NSEC_PER_SEC / ptp_rate) * EST_GMAC5_PTOV_MUL) <<
 			 EST_GMAC5_PTOV_SHIFT;
 	}
-	if (cfg->enable)
+	if (enable)
 		ctrl |= EST_EEST | EST_SSWL | EST_DFBS;
 	else
 		ctrl &= ~EST_EEST;
@@ -70,7 +70,7 @@ static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg,
 	writel(ctrl, est_addr + EST_CONTROL);
 
 	/* Configure EST interrupt */
-	if (cfg->enable)
+	if (enable)
 		ctrl = EST_IECGCE | EST_IEHS | EST_IEHF | EST_IEBE | EST_IECC;
 	else
 		ctrl = 0;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index e54a3c8878265..9a32af00d7d2d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -74,7 +74,7 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
 		mutex_lock(&priv->est_lock);
 		priv->est->enable = false;
 		stmmac_est_configure(priv, priv, priv->est,
-				     priv->plat->clk_ptp_rate);
+				     priv->plat->clk_ptp_rate, false);
 		mutex_unlock(&priv->est_lock);
 	}
 
@@ -105,7 +105,7 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
 		priv->est->btr[1] = (u32)time.tv_sec;
 		priv->est->enable = true;
 		ret = stmmac_est_configure(priv, priv, priv->est,
-					   priv->plat->clk_ptp_rate);
+					   priv->plat->clk_ptp_rate, true);
 		mutex_unlock(&priv->est_lock);
 		if (ret)
 			netdev_err(priv->dev, "failed to configure EST\n");
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index fc6ec39f2108b..c4daf014e885e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -1090,7 +1090,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 	tc_taprio_map_maxsdu_txq(priv, qopt);
 
 	ret = stmmac_est_configure(priv, priv, priv->est,
-				   priv->plat->clk_ptp_rate);
+				   priv->plat->clk_ptp_rate, true);
 	mutex_unlock(&priv->est_lock);
 	if (ret) {
 		netdev_err(priv->dev, "failed to configure EST\n");
@@ -1109,7 +1109,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 		mutex_lock(&priv->est_lock);
 		priv->est->enable = false;
 		stmmac_est_configure(priv, priv, priv->est,
-				     priv->plat->clk_ptp_rate);
+				     priv->plat->clk_ptp_rate, false);
 		/* Reset taprio status */
 		for (i = 0; i < priv->plat->tx_queues_to_use; i++) {
 			priv->xstats.max_sdu_txq_drop[i] = 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0176/1005] net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (174 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0175/1005] net: stmmac: pass the desired EST enable state to est_configure() Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0177/1005] bpf: Dont move a MAP_FIXED address in arena_get_unmapped_area() Greg Kroah-Hartman
                   ` (197 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Maxime Chevallier,
	Paolo Abeni, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 23d96de472f735858a7dd227c77aebff21ea09f5 ]

The core soft reset issued by stmmac_init_dma_engine(), called from
stmmac_hw_setup(), clears the MTL_EST registers. Nothing re-applies the
taprio offload afterwards, so priv->est->enable stays true while the
hardware EST block is left disabled: taprio keeps being reported as
offloaded, the TX/XDP paths keep dropping frames larger than
priv->est->max_sdu[], and the programmed base time is stale.

Re-apply the offload from __stmmac_open() and stmmac_resume() after PTP
has been brought up. The base time is recomputed from the reserved base
time and the current PTP time, because the timestamp counter has been
re-initialised and the previously programmed base time cannot be reused.

Factor the recompute-and-program sequence into __stmmac_setup_est(),
which must be called with est_lock held, and into stmmac_setup_est(),
which takes the lock and re-applies the offload only when it is
currently enabled and PTP has been brought up. Use the same helper in
stmmac_adjust_time() so the PTP adjust path shares the base time
computation.

Only tc_taprio_configure() updates priv->est->enable: it is set when a
REPLACE succeeds and cleared on DESTROY or a programming failure. The
re-apply helpers leave it untouched, so the flag records that an offload
is installed rather than the current hardware programming state.
__stmmac_setup_est() only reprograms the EST block, and
stmmac_setup_est() replays the FPE mapping afterwards. On a failed
re-apply the open and resume callers abort, while stmmac_adjust_time()
keeps the offload configured.

The same reset also discards the FPE preemption programming, and on XGMAC
stmmac_dma_tx_mode() overwrites the queue-to-traffic-class map. Save the
preemptible traffic class mask in priv->est->pclass when a REPLACE
succeeds and replay the FPE mapping from stmmac_setup_est() as well.

Re-applying the offload is best-effort with respect to PTP:
stmmac_setup_est() does nothing when PTP was not enabled (for example
when clk_ptp_rate is 0), so a missing PTP reference clock does not by
itself fail ndo_open(). If re-applying the EST or FPE programming fails
while restoring the interface, the failure is fatal to the caller:
__stmmac_open() aborts the open, and stmmac_resume() takes the same error
path already used for a failed timestamp counter restore.

Since __stmmac_open() and stmmac_resume() now trust priv->est->enable,
also make tc_taprio_configure() consistent: hold est_lock across the
whole validate-and-program sequence, build the gate list in a temporary
buffer, and only commit it and enable EST after validation and hardware
programming succeed. A REPLACE rejected during validation then leaves the
currently installed schedule intact in both software and hardware, while
a hardware or FPE mapping failure disables EST instead of leaving a stale
enable flag behind. Reject cycle times whose seconds field would not fit
in priv->est->ctr[1].

Fixes: b60189e0392f ("net: stmmac: Integrate EST with TAPRIO scheduler API")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261029-stmmac-est-fixes-v5-3-85b830a795a9@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |  1 +
 .../net/ethernet/stmicro/stmmac/stmmac_est.c  | 55 ++++++++++++
 .../net/ethernet/stmicro/stmmac/stmmac_est.h  |  8 ++
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 11 ++-
 .../net/ethernet/stmicro/stmmac/stmmac_ptp.c  | 44 ++--------
 .../net/ethernet/stmicro/stmmac/stmmac_tc.c   | 88 ++++++++++++-------
 6 files changed, 139 insertions(+), 68 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index e782323df61ec..6f34cae04f19c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -239,6 +239,7 @@ struct stmmac_est {
 	u32 gcl[EST_GCL];
 	u32 gcl_size;
 	u32 max_sdu[MTL_MAX_TX_QUEUES];
+	u32 pclass;
 };
 
 struct stmmac_msi {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c
index f15d4d046aa74..59e9a54e864d6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c
@@ -80,6 +80,61 @@ static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg,
 	return 0;
 }
 
+int __stmmac_setup_est(struct stmmac_priv *priv)
+{
+	struct timespec64 current_time, time;
+	ktime_t current_time_ns, basetime;
+	u64 cycle_time;
+	int err;
+
+	lockdep_assert_held(&priv->est_lock);
+
+	priv->ptp_clock_ops.gettimex64(&priv->ptp_clock_ops, &current_time,
+				       NULL);
+	current_time_ns = timespec64_to_ktime(current_time);
+
+	time.tv_nsec = priv->est->btr_reserve[0];
+	time.tv_sec = priv->est->btr_reserve[1];
+	basetime = timespec64_to_ktime(time);
+
+	cycle_time = (u64)priv->est->ctr[1] * NSEC_PER_SEC + priv->est->ctr[0];
+
+	time = stmmac_calc_tas_basetime(basetime, current_time_ns, cycle_time);
+	priv->est->btr[0] = (u32)time.tv_nsec;
+	priv->est->btr[1] = (u32)time.tv_sec;
+
+	err = stmmac_est_configure(priv, priv, priv->est,
+				   priv->plat->clk_ptp_rate, true);
+	if (err) {
+		netdev_err(priv->dev, "failed to re-configure EST\n");
+		return err;
+	}
+
+	return 0;
+}
+
+int stmmac_setup_est(struct stmmac_priv *priv)
+{
+	int ret = 0;
+
+	if (!priv->ptp_enabled)
+		return 0;
+
+	mutex_lock(&priv->est_lock);
+	if (priv->est && priv->est->enable) {
+		ret = __stmmac_setup_est(priv);
+		if (ret)
+			goto unlock;
+
+		ret = stmmac_fpe_map_preemption_class(priv, priv->dev, NULL,
+						      priv->est->pclass);
+	}
+unlock:
+	mutex_unlock(&priv->est_lock);
+
+	return ret;
+}
+
 static void est_irq_status(struct stmmac_priv *priv, struct net_device *dev,
 			   struct stmmac_extra_stats *x, u32 txqcnt)
 {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.h
index f70221c9c84af..5e07b84957f35 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.h
@@ -4,6 +4,9 @@
  * stmmac EST(802.3 Qbv) handling
  */
 
+#ifndef __STMMAC_EST_H__
+#define __STMMAC_EST_H__
+
 #define EST_GMAC4_OFFSET		0x00000c50
 #define EST_XGMAC_OFFSET		0x00001050
 
@@ -65,3 +68,8 @@
 #define EST_GCL_DATA			0x00000034
 
 extern const struct stmmac_est_ops dwmac510_est_ops;
+
+int __stmmac_setup_est(struct stmmac_priv *priv);
+int stmmac_setup_est(struct stmmac_priv *priv);
+
+#endif /* __STMMAC_EST_H__ */
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c74dcc2d37dbe..bd495ab5cd260 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -48,6 +48,7 @@
 #include "stmmac_ptp.h"
 #include "stmmac_fpe.h"
 #include "stmmac.h"
+#include "stmmac_est.h"
 #include "stmmac_pcs.h"
 #include "stmmac_xdp.h"
 #include <linux/reset.h>
@@ -4213,6 +4214,10 @@ static int __stmmac_open(struct net_device *dev,
 	if (ret)
 		goto ptp_error;
 
+	ret = stmmac_setup_est(priv);
+	if (ret)
+		goto est_error;
+
 	stmmac_init_coalesce(priv);
 
 	phylink_start(priv->phylink);
@@ -4234,7 +4239,7 @@ static int __stmmac_open(struct net_device *dev,
 
 	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
 		hrtimer_cancel(&priv->dma_conf.tx_queue[chan].txtimer);
-
+est_error:
 	stmmac_release_ptp(priv);
 ptp_error:
 	stmmac_stop_all_dma(priv);
@@ -8462,6 +8467,10 @@ int stmmac_resume(struct device *dev)
 		ret = stmmac_init_timestamping(priv);
 		if (ret)
 			goto error_stop_dma;
+
+		ret = stmmac_setup_est(priv);
+		if (ret)
+			goto error_stop_dma;
 	}
 
 init_coalesce:
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 9a32af00d7d2d..a37405534bebf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -8,6 +8,7 @@
   Author: Rayagond Kokatanur <rayagond@vayavyalabs.com>
 *******************************************************************************/
 #include "stmmac.h"
+#include "stmmac_est.h"
 #include "stmmac_ptp.h"
 
 #define PTP_SAFE_TIME_OFFSET_NS	500000
@@ -54,8 +55,7 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
 	u32 sec, nsec;
 	u32 quotient, reminder;
 	int neg_adj = 0;
-	bool xmac, est_rst = false;
-	int ret;
+	bool xmac;
 
 	xmac = dwmac_is_xmac(priv->plat->core_type);
 
@@ -69,47 +69,21 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
 	nsec = reminder;
 
 	/* If EST is enabled, disabled it before adjust ptp time. */
-	if (priv->est && priv->est->enable) {
-		est_rst = true;
-		mutex_lock(&priv->est_lock);
-		priv->est->enable = false;
+	mutex_lock(&priv->est_lock);
+	if (priv->est && priv->est->enable)
 		stmmac_est_configure(priv, priv, priv->est,
 				     priv->plat->clk_ptp_rate, false);
-		mutex_unlock(&priv->est_lock);
-	}
+	mutex_unlock(&priv->est_lock);
 
 	write_lock_irqsave(&priv->ptp_lock, flags);
 	stmmac_adjust_systime(priv, priv->ptpaddr, sec, nsec, neg_adj, xmac);
 	write_unlock_irqrestore(&priv->ptp_lock, flags);
 
 	/* Calculate new basetime and re-configured EST after PTP time adjust. */
-	if (est_rst) {
-		struct timespec64 current_time, time;
-		ktime_t current_time_ns, basetime;
-		u64 cycle_time;
-
-		mutex_lock(&priv->est_lock);
-		priv->ptp_clock_ops.gettimex64(&priv->ptp_clock_ops,
-					       &current_time, NULL);
-		current_time_ns = timespec64_to_ktime(current_time);
-		time.tv_nsec = priv->est->btr_reserve[0];
-		time.tv_sec = priv->est->btr_reserve[1];
-		basetime = timespec64_to_ktime(time);
-		cycle_time = (u64)priv->est->ctr[1] * NSEC_PER_SEC +
-			     priv->est->ctr[0];
-		time = stmmac_calc_tas_basetime(basetime,
-						current_time_ns,
-						cycle_time);
-
-		priv->est->btr[0] = (u32)time.tv_nsec;
-		priv->est->btr[1] = (u32)time.tv_sec;
-		priv->est->enable = true;
-		ret = stmmac_est_configure(priv, priv, priv->est,
-					   priv->plat->clk_ptp_rate, true);
-		mutex_unlock(&priv->est_lock);
-		if (ret)
-			netdev_err(priv->dev, "failed to configure EST\n");
-	}
+	mutex_lock(&priv->est_lock);
+	if (priv->est && priv->est->enable)
+		__stmmac_setup_est(priv);
+	mutex_unlock(&priv->est_lock);
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index c4daf014e885e..dab79d8a3bc2a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -966,11 +966,12 @@ static void tc_taprio_map_maxsdu_txq(struct stmmac_priv *priv,
 static int tc_taprio_configure(struct stmmac_priv *priv,
 			       struct tc_taprio_qopt_offload *qopt)
 {
-	u32 size, wid = priv->dma_cap.estwid, dep = priv->dma_cap.estdep;
+	u32 wid = priv->dma_cap.estwid, dep = priv->dma_cap.estdep;
 	struct netlink_ext_ack *extack = qopt->mqprio.extack;
 	struct timespec64 time, current_time, qopt_time;
 	ktime_t current_time_ns;
 	int err, i, ret = 0;
+	u32 *gcl = NULL;
 	u64 ctr;
 
 	if (qopt->base_time < 0)
@@ -1013,42 +1014,46 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 		return -EOPNOTSUPP;
 	}
 
+	mutex_lock(&priv->est_lock);
+
 	if (qopt->cmd == TAPRIO_CMD_DESTROY)
 		goto disable;
 
-	if (qopt->num_entries > dep)
-		return -EINVAL;
-	if (!qopt->cycle_time)
-		return -ERANGE;
-	if (qopt->cycle_time_extension >= BIT(wid + 7))
-		return -ERANGE;
+	if (qopt->num_entries > dep) {
+		ret = -EINVAL;
+		goto error_unlock;
+	}
 
-	if (!priv->est) {
-		priv->est = devm_kzalloc(priv->device, sizeof(*priv->est),
-					 GFP_KERNEL);
-		if (!priv->est)
-			return -ENOMEM;
-	} else {
-		mutex_lock(&priv->est_lock);
-		memset(priv->est, 0, sizeof(*priv->est));
-		mutex_unlock(&priv->est_lock);
+	if (!qopt->cycle_time ||
+	    qopt->cycle_time > (u64)U32_MAX * NSEC_PER_SEC) {
+		ret = -ERANGE;
+		goto error_unlock;
 	}
 
-	size = qopt->num_entries;
+	if (qopt->cycle_time_extension >= BIT(wid + 7)) {
+		ret = -ERANGE;
+		goto error_unlock;
+	}
 
-	mutex_lock(&priv->est_lock);
-	priv->est->gcl_size = size;
-	priv->est->enable = qopt->cmd == TAPRIO_CMD_REPLACE;
-	mutex_unlock(&priv->est_lock);
+	gcl = kcalloc(qopt->num_entries, sizeof(*gcl), GFP_KERNEL);
+	if (!gcl) {
+		ret = -ENOMEM;
+		goto error_unlock;
+	}
 
-	for (i = 0; i < size; i++) {
+	for (i = 0; i < qopt->num_entries; i++) {
 		s64 delta_ns = qopt->entries[i].interval;
 		u32 gates = qopt->entries[i].gate_mask;
 
-		if (delta_ns > GENMASK(wid - 1, 0))
-			return -ERANGE;
-		if (gates > GENMASK(31 - wid, 0))
-			return -ERANGE;
+		if (delta_ns > GENMASK(wid - 1, 0)) {
+			ret = -ERANGE;
+			goto error_unlock;
+		}
+
+		if (gates > GENMASK(31 - wid, 0)) {
+			ret = -ERANGE;
+			goto error_unlock;
+		}
 
 		switch (qopt->entries[i].command) {
 		case TC_TAPRIO_CMD_SET_GATES:
@@ -1060,13 +1065,26 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 			gates &= ~BIT(0);
 			break;
 		default:
-			return -EOPNOTSUPP;
+			ret = -EOPNOTSUPP;
+			goto error_unlock;
 		}
 
-		priv->est->gcl[i] = delta_ns | (gates << wid);
+		gcl[i] = delta_ns | (gates << wid);
 	}
 
-	mutex_lock(&priv->est_lock);
+	if (!priv->est) {
+		priv->est = devm_kzalloc(priv->device, sizeof(*priv->est),
+					 GFP_KERNEL);
+		if (!priv->est) {
+			ret = -ENOMEM;
+			goto error_unlock;
+		}
+	} else {
+		memset(priv->est, 0, sizeof(*priv->est));
+	}
+	memcpy(priv->est->gcl, gcl, sizeof(*gcl) * qopt->num_entries);
+	priv->est->gcl_size = qopt->num_entries;
+
 	/* Adjust for real system time */
 	priv->ptp_clock_ops.gettimex64(&priv->ptp_clock_ops, &current_time,
 				       NULL);
@@ -1091,7 +1109,6 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 
 	ret = stmmac_est_configure(priv, priv, priv->est,
 				   priv->plat->clk_ptp_rate, true);
-	mutex_unlock(&priv->est_lock);
 	if (ret) {
 		netdev_err(priv->dev, "failed to configure EST\n");
 		goto disable;
@@ -1102,11 +1119,16 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 	if (ret)
 		goto disable;
 
+	priv->est->pclass = qopt->mqprio.preemptible_tcs;
+	priv->est->enable = true;
+
+	mutex_unlock(&priv->est_lock);
+	kfree(gcl);
+
 	return 0;
 
 disable:
 	if (priv->est) {
-		mutex_lock(&priv->est_lock);
 		priv->est->enable = false;
 		stmmac_est_configure(priv, priv, priv->est,
 				     priv->plat->clk_ptp_rate, false);
@@ -1116,10 +1138,12 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
 			priv->xstats.mtl_est_txq_hlbf[i] = 0;
 			priv->xstats.mtl_est_txq_hlbs[i] = 0;
 		}
-		mutex_unlock(&priv->est_lock);
 	}
 
 	err = stmmac_fpe_map_preemption_class(priv, priv->dev, extack, 0);
+error_unlock:
+	mutex_unlock(&priv->est_lock);
+	kfree(gcl);
 
 	return qopt->cmd == TAPRIO_CMD_DESTROY ? err : ret;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0177/1005] bpf: Dont move a MAP_FIXED address in arena_get_unmapped_area()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (175 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0176/1005] net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume() Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0178/1005] sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs Greg Kroah-Hartman
                   ` (196 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 92b5ce3ca5b7c641e2678f92419aa7833951bc9d ]

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. This is correct only if the mm finds a free range.
With MAP_FIXED the mm does no search and returns addr. For
MAP_FIXED_NOREPLACE, do_mmap() also sets MAP_FIXED.

With MAP_FIXED the arena is not at addr after round_up(). Thus mmap()
removes mappings outside the range from addr to addr + len. It keeps a part
of those in this range. Also, round_up() can wrap to address 0, and the
test for address 0 is before it.

The arch code gets twice the length of the mapping. Thus it can refuse a
valid MAP_FIXED range. On s390 the arch code also grows the page table for
the range. With the double length it can omit this step for a valid range.

The test for a crossing is not exact. Because ret is a long, ret >> 32
extends the sign, but the other side is unsigned. The sides are never equal
for an address with bit 63 set, and round_up() always runs. Such user
addresses exist on s390. arena_map_alloc() does the same test with a u64.

With MAP_FIXED, pass len to the mm. Return -EINVAL if the range crosses a
boundary, as for address 0. Make ret unsigned, so that only these ranges
get the error. On x86-64, if round_up() gives address 0 today, mmap() now
fails with -EINVAL or with -ENOMEM from the mm. Today mmap() can also fail
for the address after round_up(), for example with -ENOMEM, -EEXIST, -EPERM
or -EBUSY.

Without MAP_FIXED the mm must still find a free range of 2 * len bytes
inside the address space of the task. The range after round_up() is inside
it, and round_up() cannot wrap. An address with bit 63 set now moves only
if its range crosses a boundary.

For an arena, libbpf uses MAP_FIXED only with map_extra, and
arena_map_alloc() refuses a map_extra range that crosses a boundary. A
subsequent mmap() must use the range of the first mmap(). For mmap() of the
map fd, this range comes from arena_get_unmapped_area(), thus it crosses no
boundary. arena_map_alloc() still accepts a map_extra above TASK_SIZE, and
mmap() of such an arena fails.

Fixes: 317460317a02 ("bpf: Introduce bpf_arena.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261102064231.2153879-2-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/arena.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index 8e1f7bfd2b4f7..5b65ffefbebd6 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -7,6 +7,7 @@
 #include <linux/irq_work.h>
 #include "linux/filter.h"
 #include <linux/llist.h>
+#include <linux/mman.h>
 #include <linux/btf_ids.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
@@ -630,7 +631,7 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad
 {
 	struct bpf_map *map = filp->private_data;
 	struct bpf_arena *arena = container_of(map, struct bpf_arena, map);
-	long ret;
+	unsigned long ret;
 
 	if (pgoff)
 		return -EINVAL;
@@ -647,7 +648,13 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad
 			return -EINVAL;
 	}
 
-	ret = mm_get_unmapped_area(filp, addr, len * 2, 0, flags);
+	/*
+	 * Without MAP_FIXED the mm finds a free range. Ask for twice the
+	 * length, so that there is room for round_up(). With MAP_FIXED the mm
+	 * does no search, and the caller wants this address. Thus the range
+	 * cannot move.
+	 */
+	ret = mm_get_unmapped_area(filp, addr, flags & MAP_FIXED ? len : len * 2, 0, flags);
 	if (IS_ERR_VALUE(ret))
 		return ret;
 	if (!ret)
@@ -655,6 +662,8 @@ 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 (flags & MAP_FIXED)
+		return -EINVAL;
 	return round_up(ret, SZ_4G);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0178/1005] sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (176 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0177/1005] bpf: Dont move a MAP_FIXED address in arena_get_unmapped_area() Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0179/1005] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
                   ` (195 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shubhang Kaushik (Ampere), Tejun Heo,
	Sasha Levin

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

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

From: Shubhang Kaushik (Ampere) <sh@gentwo.org>

[ Upstream commit 4c2e0751d5e6d181a5b9b2a8ada869b5bee66a83 ]

scx_bpf_destroy_dsq() takes the target user DSQ's raw spinlock. However,
it is in scx_kfunc_ids_any, which is also registered for
BPF_PROG_TYPE_TRACING.

For an active root scheduler without ops.sub_attach, the compatibility
path in scx_prog_sched() lets an unassociated tracing program resolve to
that scheduler. The tracing program can then call
scx_bpf_destroy_dsq() while the target DSQ lock is already held.

For example, a scheduler which mixes FIFO and priority-queue insertions
into a user DSQ triggers scx_error() from scx_dispatch_enqueue() while
holding that DSQ's lock. scx_claim_exit() emits sched_ext_exit before
the lock is released:

  scx_dispatch_enqueue()
    raw_spin_lock(&dsq->lock)
    scx_error()
      scx_claim_exit()
        trace_sched_ext_exit()
          tracing BPF program
            scx_bpf_destroy_dsq(dsq_id)
              destroy_dsq()
                raw_spin_lock_irqsave(&dsq->lock)

The tracing program recursively acquires the same raw spinlock and locks
up the CPU. Because the tracepoint runs before scx_finish_exit(),
disable_irq_work is not queued and the scheduler cannot enter its normal
disable path.

Reject scx_bpf_destroy_dsq() from tracing programs at verification time.
The kfunc remains available to SCX struct_ops and syscall programs.

Fixes: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class")
Signed-off-by: Shubhang Kaushik (Ampere) <sh@gentwo.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/ext/ext.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index 4b04ed0441fc9..50d5185bcd548 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -11226,6 +11226,9 @@ static const struct btf_kfunc_id_set scx_kfunc_set_any = {
  * when scx_locked_rq() returns NULL. Taking it while the context already holds
  * an rq lock, the same one or another cpu's, can deadlock.
  *
+ * scx_bpf_destroy_dsq() takes a user DSQ lock. A tracing program can run while
+ * that lock is already held and recursively acquire it.
+ *
  * Before returning, scx_bpf_sub_grant() and scx_bpf_sub_revoke() invoke
  * ops.sub_caps_updated() of the sub-schedulers whose caps changed, so those ops
  * run in the tracing program's context. No SCX op expects to run from an
@@ -11240,6 +11243,7 @@ BTF_ID_FLAGS(func, scx_bpf_cpuperf_set, KF_IMPLICIT_ARGS)
 BTF_ID_FLAGS(func, scx_bpf_cidperf_set, KF_IMPLICIT_ARGS)
 BTF_ID_FLAGS(func, scx_bpf_sub_grant, KF_IMPLICIT_ARGS)
 BTF_ID_FLAGS(func, scx_bpf_sub_revoke, KF_IMPLICIT_ARGS)
+BTF_ID_FLAGS(func, scx_bpf_destroy_dsq, KF_IMPLICIT_ARGS)
 BTF_KFUNCS_END(scx_kfunc_ids_no_tracing)
 
 /*
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0179/1005] ASoC: meson: axg-fifo: request the irq with the clock enabled
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (177 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0178/1005] sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0180/1005] bpf: Fix the join of fp+0 with a value that is not a pointer to stack Greg Kroah-Hartman
                   ` (194 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Jerome Brunet, Mark Brown,
	Sasha Levin

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

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

From: Jerome Brunet <jbrunet@baylibre.com>

[ Upstream commit 82fa7bfab6b961a03d6575348334e0ec15fdc712 ]

The fifo irq handler accesses registers which need pclk, but the irq is
requested before pclk is enabled on open and freed after it is disabled
on close.

Request the irq after enabling pclk and masking the fifo irqs.
Free it before disabling pclk.

Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-30e88a8a-f33a-40f0-92aa-9ea62c5b7299
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://patch.msgid.link/20261030-asoc-axg-fifo-irq-clock-v1-1-f8c170ac8b0d@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/meson/axg-fifo.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
index 75909196b7698..edf43b7fb5cf5 100644
--- a/sound/soc/meson/axg-fifo.c
+++ b/sound/soc/meson/axg-fifo.c
@@ -244,17 +244,10 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
 	if (ret)
 		return ret;
 
-	/* Use the threaded irq handler only with non-atomic links */
-	ret = request_threaded_irq(fifo->irq, NULL,
-				   axg_fifo_pcm_irq_block,
-				   IRQF_ONESHOT, dev_name(dev), ss);
-	if (ret)
-		return ret;
-
 	/* Enable pclk to access registers and clock the fifo ip */
 	ret = clk_prepare_enable(fifo->pclk);
 	if (ret)
-		goto free_irq;
+		return ret;
 
 	/* Setup status2 so it reports the memory pointer */
 	regmap_update_bits(fifo->map, FIFO_CTRL1,
@@ -271,17 +264,24 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
 	/* Clear any pending interrupt */
 	axg_fifo_ack_irq(fifo, FIFO_INT_MASK);
 
+	/* Use the threaded irq handler only with non-atomic links */
+	ret = request_threaded_irq(fifo->irq, NULL,
+				   axg_fifo_pcm_irq_block,
+				   IRQF_ONESHOT, dev_name(dev), ss);
+	if (ret)
+		goto free_clk;
+
 	/* Take memory arbitror out of reset */
 	ret = reset_control_deassert(fifo->arb);
 	if (ret)
-		goto free_clk;
+		goto free_irq;
 
 	return 0;
 
-free_clk:
-	clk_disable_unprepare(fifo->pclk);
 free_irq:
 	free_irq(fifo->irq, ss);
+free_clk:
+	clk_disable_unprepare(fifo->pclk);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(axg_fifo_pcm_open);
@@ -295,12 +295,12 @@ int axg_fifo_pcm_close(struct snd_soc_component *component,
 	/* Put the memory arbitror back in reset */
 	ret = reset_control_assert(fifo->arb);
 
-	/* Disable fifo ip and register access */
-	clk_disable_unprepare(fifo->pclk);
-
 	/* remove IRQ */
 	free_irq(fifo->irq, ss);
 
+	/* Disable fifo ip and register access */
+	clk_disable_unprepare(fifo->pclk);
+
 	return ret;
 }
 EXPORT_SYMBOL_GPL(axg_fifo_pcm_close);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0180/1005] bpf: Fix the join of fp+0 with a value that is not a pointer to stack
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (178 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0179/1005] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0181/1005] bpf: Rename bpf_call_summary::num_params to arg_slot_cnt Greg Kroah-Hartman
                   ` (193 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 6185d4fc6e64439cad415d9bf527f8ffb3fa3db4 ]

arg_track follows pointers to the stack through registers and spills.
Scalar evolution and the removal of dead slots rely on it to know which
slots an insn reads and writes.

Where two paths meet, a register can be fp-N on one path and not a pointer
to the stack on the other path. There is no value for that. The join adds
a fake second offset, fp+0: with two offsets no store through the register
is a certain write. But for fp+0 the fake offset is the offset itself:

  join(fp-8, none) = {fp-8, fp+0}    two offsets
  join(fp+0, none) = {fp+0}          one offset: "exactly fp+0"

Then a store counts as a certain write to the stack, but at run time it can
go to other memory:

  r7 = r10, or r7 = map_value + 8 ; arg_track: exactly fp+0
  *(u64 *)(r10 - 8) = fp-24
  *(u64 *)(r7 - 8) = map_value    ; arg_track: fp-8 is overwritten
  r8 = *(u64 *)(r10 - 8)          ; fp-24 or map_value. arg_track: none
  loop:
    r1 = *(u64 *)(r10 - 24)       ; the counter of the loop
    ...
    *(u64 *)(r8 + 0) = 4096       ; arg_track: not a write to fp-24

Scalar evolution does not see the last store. It gives the counter the
range of a loop that only increments it. The prog loads, and it accesses
a map value out of bounds.

Valid progs are rejected as well. The store through r7 makes fp-8 dead, and
a later read of fp-8 fails with "slot poisoned by dead code elimination".

When the single offset is 0, drop the offsets. The result is a pointer to
an unknown slot of the frame, and all updates through it are weak.

Veristat sees no difference in selftests, Cilium and sched_ext.

Fixes: bf0c571f7feb ("bpf: introduce forward arg-tracking dataflow analysis")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261102055913.3598414-2-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/liveness.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c
index acee6f86f8474..e1340e73cbeda 100644
--- a/kernel/bpf/liveness.c
+++ b/kernel/bpf/liveness.c
@@ -872,6 +872,19 @@ static struct arg_track arg_join_imprecise(struct arg_track a, struct arg_track
 	return (struct arg_track){ .mask = m, .frame = ARG_IMPRECISE };
 }
 
+/*
+ * 'a' or a value that is not a pointer to stack. A single fp-N gets a fake fp+0,
+ * to keep stack_use and prevent stack_def. fp+0 itself would stay a single offset.
+ */
+static struct arg_track arg_or_none(struct arg_track a)
+{
+	if (a.off_cnt != 1)
+		return a;
+	if (!a.off[0])
+		return (struct arg_track){ .frame = a.frame };
+	return arg_merge_offsets(a, arg_single(a.frame, 0));
+}
+
 /* Join two arg_track values at merge points */
 static struct arg_track __arg_track_join(struct arg_track a, struct arg_track b)
 {
@@ -896,20 +909,10 @@ static struct arg_track __arg_track_join(struct arg_track a, struct arg_track b)
 	 */
 	if (a.frame == ARG_NONE && b.frame == ARG_NONE)
 		return a;
-	if (a.frame >= 0 && b.frame == ARG_NONE) {
-		/*
-		 * When joining single fp-N add fake fp+0 to
-		 * keep stack_use and prevent stack_def
-		 */
-		if (a.off_cnt == 1)
-			return arg_merge_offsets(a, arg_single(a.frame, 0));
-		return a;
-	}
-	if (b.frame >= 0 && a.frame == ARG_NONE) {
-		if (b.off_cnt == 1)
-			return arg_merge_offsets(b, arg_single(b.frame, 0));
-		return b;
-	}
+	if (a.frame >= 0 && b.frame == ARG_NONE)
+		return arg_or_none(a);
+	if (b.frame >= 0 && a.frame == ARG_NONE)
+		return arg_or_none(b);
 
 	return arg_join_imprecise(a, b);
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0181/1005] bpf: Rename bpf_call_summary::num_params to arg_slot_cnt
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (179 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0180/1005] bpf: Fix the join of fp+0 with a value that is not a pointer to stack Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0182/1005] bpf: Prepare static analysis passes for callx instruction Greg Kroah-Hartman
                   ` (192 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yonghong Song, Alexei Starovoitov,
	Sasha Levin

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

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

From: Yonghong Song <yonghong.song@linux.dev>

[ Upstream commit c6ff4e06033fede2fd1d41232ae942add649b759 ]

The field 'num_params' counts the argument registers and outgoing
stack slots a helper or kfunc call takes. The next patch gives a
16-byte parameter two slots, so the name stops describing what the
field holds.

Rename 'num_params' to 'arg_slot_cnt'. No functional change.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20260912195232.988528-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: cdefba74b53f ("bpf: Don't trust pointers spilled in slots that a callee can write")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/bpf_verifier.h |  2 +-
 kernel/bpf/liveness.c        | 10 +++++-----
 kernel/bpf/verifier.c        |  8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index 0eda96e1162f3..baf390c86406c 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -1053,7 +1053,7 @@ static inline struct bpf_subprog_info *subprog_info(struct bpf_verifier_env *env
 }
 
 struct bpf_call_summary {
-	u8 num_params;
+	u8 arg_slot_cnt;
 	bool is_void;
 	bool fastcall;
 };
diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c
index e1340e73cbeda..c7aa5c8fc34cf 100644
--- a/kernel/bpf/liveness.c
+++ b/kernel/bpf/liveness.c
@@ -1596,21 +1596,21 @@ static int record_call_access(struct bpf_verifier_env *env,
 {
 	struct bpf_insn *insn = &env->prog->insnsi[insn_idx];
 	struct bpf_call_summary cs;
-	int r, err, num_params = 5;
+	int r, err, arg_slot_cnt = 5;
 
 	if (bpf_pseudo_call(insn))
 		return 0;
 
 	if (bpf_get_call_summary(env, insn, &cs))
-		num_params = cs.num_params;
+		arg_slot_cnt = cs.arg_slot_cnt;
 
-	for (r = BPF_REG_1; r < BPF_REG_1 + min(num_params, MAX_BPF_FUNC_REG_ARGS); r++) {
+	for (r = BPF_REG_1; r < BPF_REG_1 + min(arg_slot_cnt, MAX_BPF_FUNC_REG_ARGS); r++) {
 		err = record_arg_access(env, instance, insn, &at[r], r - 1, insn_idx);
 		if (err)
 			return err;
 	}
 
-	for (r = 0; r < MAX_STACK_ARG_SLOTS && r < num_params - MAX_BPF_FUNC_REG_ARGS; r++) {
+	for (r = 0; r < MAX_STACK_ARG_SLOTS && r < arg_slot_cnt - MAX_BPF_FUNC_REG_ARGS; r++) {
 		err = record_arg_access(env, instance, insn, &at[MAX_BPF_REG + r],
 					r + MAX_BPF_FUNC_REG_ARGS, insn_idx);
 		if (err)
@@ -2386,7 +2386,7 @@ static void compute_insn_live_regs(struct bpf_verifier_env *env,
 			def = ALL_CALLER_SAVED_REGS;
 			use = def & ~BIT(BPF_REG_0);
 			if (bpf_get_call_summary(env, insn, &cs))
-				use = GENMASK(min_t(u8, cs.num_params, MAX_BPF_FUNC_REG_ARGS), 1);
+				use = GENMASK(min_t(u8, cs.arg_slot_cnt, MAX_BPF_FUNC_REG_ARGS), 1);
 			def = mask_widen(def);
 			use = mask_widen(use);
 			break;
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 2ed356a03a57b..4bb0f362f44a8 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -17985,11 +17985,11 @@ bool bpf_get_call_summary(struct bpf_verifier_env *env, struct bpf_insn *call,
 			       (bpf_verifier_inlines_helper_call(env, call->imm) ||
 				bpf_jit_inlines_helper_call(call->imm));
 		cs->is_void = fn->ret_type == RET_VOID;
-		cs->num_params = 0;
+		cs->arg_slot_cnt = 0;
 		for (i = 0; i < ARRAY_SIZE(fn->arg_type); ++i) {
 			if (fn->arg_type[i] == ARG_DONTCARE)
 				break;
-			cs->num_params++;
+			cs->arg_slot_cnt++;
 		}
 		return true;
 	}
@@ -18001,7 +18001,7 @@ bool bpf_get_call_summary(struct bpf_verifier_env *env, struct bpf_insn *call,
 		if (err < 0)
 			/* error would be reported later */
 			return false;
-		cs->num_params = btf_type_vlen(meta.func_proto);
+		cs->arg_slot_cnt = btf_type_vlen(meta.func_proto);
 		cs->fastcall = meta.kfunc_flags & KF_FASTCALL;
 		cs->is_void = btf_type_is_void(btf_type_by_id(meta.btf, meta.func_proto->type));
 		return true;
@@ -18110,7 +18110,7 @@ static void mark_fastcall_pattern_for_call(struct bpf_verifier_env *env,
 	 * - includes R1-R5 if corresponding parameter has is described
 	 *   in the function prototype.
 	 */
-	clobbered_regs_mask = GENMASK(cs.num_params, cs.is_void ? 1 : 0);
+	clobbered_regs_mask = GENMASK(cs.arg_slot_cnt, cs.is_void ? 1 : 0);
 	/* e.g. if helper call clobbers r{0,1}, expect r{2,3,4,5} in the pattern */
 	expected_regs_mask = ~clobbered_regs_mask & ALL_CALLER_SAVED_REGS;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0182/1005] bpf: Prepare static analysis passes for callx instruction
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (180 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0181/1005] bpf: Rename bpf_call_summary::num_params to arg_slot_cnt Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0183/1005] bpf: Dont trust pointers spilled in slots that a callee can write Greg Kroah-Hartman
                   ` (191 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Eduard Zingerman,
	Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 373e3fd0bff0e276fd76c86c830cdb16a3457776 ]

BPF_JMP | BPF_CALL | BPF_X (callx) will be an indirect call of static
subprog with address in dst_reg. The passes that run before the main
verifier pass don't know which subprog callx calls.
Teach them to treat callx as a call with unknown callee:

- const_fold: callx clobbers R0-R5 like any other call. Otherwise
  bpf_prune_dead_branches() could rewrite a live conditional jump.

- live regs: callx uses R1-R5 and dst_reg, defines R0-R5.

- stack liveness: func instances are keyed by (callsite, depth) and
  cannot describe a callsite with multiple callees. Don't create
  instances for callees of callx. If any callx argument is derived
  from fp mark stack of all frames as read at callx insn and keep slots
  of outer frames alive 'before' the callsite while the callee is
  verified. Same as for callbacks that are not known statically.
  The callee is analyzed as standalone instance.

- backtracking: treat callx as a call of static subprog, same as
  BPF_PSEUDO_CALL.

callx is still rejected as unknown opcode. No functional change.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://patch.msgid.link/20260924031042.1690890-5-alexei.starovoitov@gmail.com
Stable-dep-of: cdefba74b53f ("bpf: Don't trust pointers spilled in slots that a callee can write")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/bpf_verifier.h |  6 ++++++
 kernel/bpf/backtrack.c       | 20 +++++++++++--------
 kernel/bpf/const_fold.c      |  3 ++-
 kernel/bpf/liveness.c        | 38 +++++++++++++++++++++++++++++++-----
 4 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index baf390c86406c..a253ca2c6e5d3 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -1076,6 +1076,12 @@ static inline bool bpf_pseudo_kfunc_call(const struct bpf_insn *insn)
 	       insn->src_reg == BPF_PSEUDO_KFUNC_CALL;
 }
 
+/* callx: indirect call of a bpf subprog whose address is in insn->dst_reg */
+static inline bool bpf_is_callx(const struct bpf_insn *insn)
+{
+	return insn->code == (BPF_JMP | BPF_CALL | BPF_X);
+}
+
 __printf(2, 0) void bpf_verifier_vlog(struct bpf_verifier_log *log,
 				      const char *fmt, va_list args);
 __printf(2, 3) void bpf_verifier_log_write(struct bpf_verifier_env *env,
diff --git a/kernel/bpf/backtrack.c b/kernel/bpf/backtrack.c
index 44d107fd96c4d..50c66115ab45e 100644
--- a/kernel/bpf/backtrack.c
+++ b/kernel/bpf/backtrack.c
@@ -406,15 +406,18 @@ static int backtrack_insn(struct bpf_verifier_env *env, int idx, int subseq_idx,
 		if (class == BPF_STX)
 			bt_set_reg(bt, sreg);
 	} else if (class == BPF_JMP || class == BPF_JMP32) {
-		if (bpf_pseudo_call(insn)) {
-			int subprog_insn_idx, subprog;
+		if (bpf_pseudo_call(insn) || bpf_is_callx(insn)) {
+			int subprog_insn_idx, subprog = -1;
 
-			subprog_insn_idx = idx + insn->imm + 1;
-			subprog = bpf_find_subprog(env, subprog_insn_idx);
-			if (subprog < 0)
-				return -EFAULT;
+			if (bpf_pseudo_call(insn)) {
+				subprog_insn_idx = idx + insn->imm + 1;
+				subprog = bpf_find_subprog(env, subprog_insn_idx);
+				if (subprog < 0)
+					return -EFAULT;
+			}
 
-			if (bpf_subprog_is_global(env, subprog)) {
+			/* callx calls static subprogs only */
+			if (subprog >= 0 && bpf_subprog_is_global(env, subprog)) {
 				/* check that jump history doesn't have any
 				 * extra instructions from subprog; the next
 				 * instruction after call to global subprog
@@ -531,7 +534,8 @@ static int backtrack_insn(struct bpf_verifier_env *env, int idx, int subseq_idx,
 			 * necessary. In the former we never do that.
 			 */
 			from_subprog_call = subseq_idx - 1 >= 0 &&
-					    bpf_pseudo_call(&env->prog->insnsi[subseq_idx - 1]);
+					    (bpf_pseudo_call(&env->prog->insnsi[subseq_idx - 1]) ||
+					     bpf_is_callx(&env->prog->insnsi[subseq_idx - 1]));
 
 			r0_precise = from_subprog_call && bt_is_reg_set(bt, BPF_REG_0);
 
diff --git a/kernel/bpf/const_fold.c b/kernel/bpf/const_fold.c
index d8d2d00380aef..e090f368e9256 100644
--- a/kernel/bpf/const_fold.c
+++ b/kernel/bpf/const_fold.c
@@ -191,7 +191,8 @@ static void const_reg_xfer(struct bpf_verifier_env *env, struct const_arg_info *
 		dst->val = val;
 		break;
 	case BPF_JMP:
-		if (opcode != BPF_CALL)
+		/* both 'call imm' and 'callx reg' clobber caller saved registers */
+		if (BPF_OP(insn->code) != BPF_CALL)
 			break;
 process_call:
 		for (r = BPF_REG_0; r <= BPF_REG_5; r++)
diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c
index c7aa5c8fc34cf..b01cdabaf3bf5 100644
--- a/kernel/bpf/liveness.c
+++ b/kernel/bpf/liveness.c
@@ -464,12 +464,29 @@ int bpf_live_stack_query_init(struct bpf_verifier_env *env, struct bpf_verifier_
 	return 0;
 }
 
+/*
+ * Stack slots of outer frames that the callee may read are accounted as read
+ * by the @callsite insn itself, i.e. they are live before @callsite and may be
+ * dead after it, when:
+ * - @callsite calls a callback, which may be called several times;
+ * - @callsite is callx. Its callee is not known when stack liveness is
+ *   computed, so there is no func instance for it at @callsite. While
+ *   the verifier is in the callee lookup_instance() finds its standalone
+ *   instance that knows nothing about outer frames. What the callee may read
+ *   there is recorded by record_call_access().
+ */
+static bool callee_stack_access_at_callsite(struct bpf_verifier_env *env, u32 callsite)
+{
+	return bpf_calls_callback(env, callsite) ||
+	       bpf_is_callx(&env->prog->insnsi[callsite]);
+}
+
 bool bpf_stack_slot_alive(struct bpf_verifier_env *env, u32 frameno, u32 half_spi)
 {
 	/*
 	 * Slot is alive if it is read before q->insn_idx in current func instance,
 	 * or if for some outer func instance:
-	 * - alive before callsite if callsite calls callback, otherwise
+	 * - alive before callsite if callsite calls callback or is callx, otherwise
 	 * - alive after callsite
 	 */
 	struct live_stack_query *q = &env->liveness->live_stack_query;
@@ -502,7 +519,7 @@ bool bpf_stack_slot_alive(struct bpf_verifier_env *env, u32 frameno, u32 half_sp
 		/* Get callsite from verifier state, not from instance callchain */
 		callsite = q->callsites[i];
 
-		alive = bpf_calls_callback(env, callsite)
+		alive = callee_stack_access_at_callsite(env, callsite)
 			? is_live_before(instance, callsite, rel, half_spi)
 			: is_live_before(instance, callsite + 1, rel, half_spi);
 		if (alive)
@@ -1601,7 +1618,15 @@ static int record_call_access(struct bpf_verifier_env *env,
 	if (bpf_pseudo_call(insn))
 		return 0;
 
-	if (bpf_get_call_summary(env, insn, &cs))
+	if (bpf_is_callx(insn))
+		/*
+		 * The callee is not known statically. Assume that all arg
+		 * slots are passed and let record_arg_access() conservatively
+		 * mark the stack of all frames as read if any of them is
+		 * derived from a frame pointer.
+		 */
+		arg_slot_cnt = MAX_BPF_FUNC_REG_ARGS + MAX_STACK_ARG_SLOTS;
+	else if (bpf_get_call_summary(env, insn, &cs))
 		arg_slot_cnt = cs.arg_slot_cnt;
 
 	for (r = BPF_REG_1; r < BPF_REG_1 + min(arg_slot_cnt, MAX_BPF_FUNC_REG_ARGS); r++) {
@@ -1695,7 +1720,7 @@ static void print_subprog_arg_access(struct bpf_verifier_env *env,
 		bool has_extra = false;
 		u8 cls = BPF_CLASS(insns[idx].code);
 		bool is_ldx_stx_call = cls == BPF_LDX || cls == BPF_STX ||
-				       insns[idx].code == (BPF_JMP | BPF_CALL);
+				       (cls == BPF_JMP && BPF_OP(insns[idx].code) == BPF_CALL);
 
 		verbose(env, "%3d: ", idx);
 		bpf_verbose_insn(env, &insns[idx]);
@@ -1887,7 +1912,7 @@ static int compute_subprog_args(struct bpf_verifier_env *env,
 		if (err)
 			goto err_free;
 
-		if (insn->code == (BPF_JMP | BPF_CALL)) {
+		if (BPF_CLASS(insn->code) == BPF_JMP && BPF_OP(insn->code) == BPF_CALL) {
 			err = record_call_access(env, instance, at_in[i], idx);
 			if (err)
 				goto err_free;
@@ -2389,6 +2414,9 @@ static void compute_insn_live_regs(struct bpf_verifier_env *env,
 				use = GENMASK(min_t(u8, cs.arg_slot_cnt, MAX_BPF_FUNC_REG_ARGS), 1);
 			def = mask_widen(def);
 			use = mask_widen(use);
+			/* callx reads the address of the callee from dst_reg */
+			if (bpf_is_callx(insn))
+				use |= dst;
 			break;
 		default:
 			def = 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0183/1005] bpf: Dont trust pointers spilled in slots that a callee can write
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (181 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0182/1005] bpf: Prepare static analysis passes for callx instruction Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0184/1005] regulator: mt6363: Fix the registers of the VSRAM CPU and APU LDOs Greg Kroah-Hartman
                   ` (190 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit cdefba74b53fb9b482355ebde1654800aea45dae ]

arg_track follows pointers to the stack through registers and spills.
Scalar evolution and the removal of dead slots rely on it to know which
slots an insn reads and writes.

arg_track assumes that a call does not change the pointers that are spilled
in the frame of the caller. But a static subprog or a callback can store
a pointer to other memory there, and the caller can use it:

  *(u64 *)(r10 - 16) = fp-8
  r1 = fp-16, r2 = map_value
  call sub                        ; *(u64 *)(r1 + 0) = r2
  r7 = *(u64 *)(r10 - 16)         ; verifier: map_value. arg_track: fp-8
  *(u64 *)(r10 - 8) = fp-24
  *(u64 *)(r7 + 0) = 0            ; arg_track: fp-8 is overwritten
  r8 = *(u64 *)(r10 - 8)          ; verifier: fp-24. arg_track: none
  loop:
    r1 = *(u64 *)(r10 - 24)       ; the counter of the loop
    ...
    *(u64 *)(r8 + 0) = 4096       ; arg_track: not a write to fp-24

Scalar evolution does not see the last store. It gives the counter the
range of a loop that only increments it. The prog loads, and it accesses
a map value out of bounds.

Valid progs are rejected as well. The store through r7 makes fp-8 dead, and
a later read of fp-8 fails with "slot poisoned by dead code elimination".

When a static subprog or a callback can get a pointer to the frame of its
caller, join every slot of that frame with "not a pointer to the stack".
Reads and possible writes through a filled pointer are still seen, but no
store through it is a certain write. It has to be every slot: the callee
reaches the whole frame from one pointer, and callees are analyzed after
the caller. The price is precision: an 8-byte load through a filled
pointer gives a value that can point to any frame.

For a spilled copy of r10 this needs "bpf: Fix the join of fp+0 with
a value that is not a pointer to stack".

In selftests, Cilium and sched_ext the stack marks change in 4 of 12522
progs. Verdicts, insns and states do not change in any prog.

one_fp_clear_stack_threshold and two_fp_clear_stack_threshold expect the
fake offset fp+0 in the log now.

Fixes: bf0c571f7feb ("bpf: introduce forward arg-tracking dataflow analysis")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261102055913.3598414-4-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/liveness.c                         | 52 ++++++++++++++-----
 .../selftests/bpf/progs/verifier_live_stack.c | 12 +++--
 2 files changed, 47 insertions(+), 17 deletions(-)

diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c
index b01cdabaf3bf5..8980e2aa25738 100644
--- a/kernel/bpf/liveness.c
+++ b/kernel/bpf/liveness.c
@@ -1282,6 +1282,31 @@ static struct arg_track arg_track_deref(struct bpf_verifier_env *env, struct bpf
 	return (struct arg_track){ .frame = ARG_NONE };
 }
 
+/*
+ * True if the call at @insn_idx can pass a pointer to the frame at @depth to a static subprog
+ * or to a callback. They use it as a pointer to stack, a global subprog gets plain memory.
+ * It errs on the safe side: it looks at all argument registers and stack args, also at those
+ * that this callee doesn't take.
+ */
+static bool subprog_gets_local_fp(struct bpf_verifier_env *env, struct bpf_insn *insn, int insn_idx,
+				  struct arg_track *at, int depth)
+{
+	int r;
+
+	if (bpf_pseudo_call(insn)) {
+		r = bpf_find_subprog(env, insn_idx + insn->imm + 1);
+		if (r >= 0 && bpf_subprog_is_global(env, r))
+			return false;
+	} else if (!bpf_is_callx(insn) && !bpf_calls_callback(env, insn_idx)) {
+		return false;
+	}
+	/* R1-R5 and stack args */
+	for (r = BPF_REG_1; r < MAX_AT_TRACK_REGS; r++)
+		if ((r <= BPF_REG_5 || r >= MAX_BPF_REG) && can_be_local_fp(depth, r, &at[r]))
+			return true;
+	return false;
+}
+
 /*
  * Pure dataflow transfer function for arg_track state.
  * Updates at_out[] based on how the instruction modifies registers.
@@ -1345,21 +1370,22 @@ static void arg_track_xfer(struct bpf_verifier_env *env, struct bpf_insn *insn,
 		*dst = none;
 	} else if (class == BPF_JMP && code == BPF_CALL) {
 		/*
-		 * at_stack_out[slot] is not cleared by the helper and subprog calls.
-		 * The fill_from_stack() may return the stale spill — which is an FP-derived arg_track
-		 * (the value that was originally spilled there). The loaded register then carries
-		 * a phantom FP-derived identity that doesn't correspond to what's actually in the slot.
-		 * This phantom FP pointer propagates forward, and wherever it's subsequently used
-		 * (as a helper argument, another store, etc.), it sets stack liveness bits.
-		 * Those bits correspond to stack accesses that don't actually happen.
-		 * So the effect is over-reporting stack liveness — marking slots as live that aren't
-		 * actually accessed. The verifier preserves more state than necessary across calls,
-		 * which is conservative.
+		 * Helpers, kfuncs and global subprogs can scratch stack slots. The verifier reads
+		 * a scalar from a scratched slot, but at_stack_out[slot] is not cleared, and
+		 * fill_from_stack() returns the stale spill: an FP-derived arg_track for a scalar.
+		 * A scalar can't be dereferenced, so the stale value can only set liveness bits
+		 * for stack accesses that don't happen. That is conservative.
 		 *
-		 * helpers can scratch stack slots, but they won't make a valid pointer out of it.
-		 * subprogs are allowed to write into parent slots, but they cannot write
-		 * _any_ FP-derived pointer into it (either their own or parent's FP).
+		 * Static subprogs and callbacks can't store an FP-derived pointer into the frame of
+		 * the caller, but they can store any other pointer there. The caller can fill it
+		 * and store through it. With the stale spill that store would be a definite write
+		 * to a stack slot, and it doesn't touch the stack. Callees are analyzed after the
+		 * caller, and they reach the whole frame from one pointer to it. So after the call
+		 * every slot holds what it held before or a value that is not FP-derived.
 		 */
+		if (subprog_gets_local_fp(env, insn, insn_idx, at_out, depth))
+			for (slot = 0; slot < nslots; slot++)
+				at_stack_out[slot] = __arg_track_join(at_stack_out[slot], none);
 		for (r = BPF_REG_0; r <= BPF_REG_5; r++)
 			at_out[r] = none;
 	} else if (class == BPF_LDX) {
diff --git a/tools/testing/selftests/bpf/progs/verifier_live_stack.c b/tools/testing/selftests/bpf/progs/verifier_live_stack.c
index 401152b2b64fc..ec2f25df3d4da 100644
--- a/tools/testing/selftests/bpf/progs/verifier_live_stack.c
+++ b/tools/testing/selftests/bpf/progs/verifier_live_stack.c
@@ -1763,11 +1763,15 @@ static __used __naked void grandchild_deref(void)
 	::: __clobber_all);
 }
 
+/*
+ * The callee gets a pointer to the frame that holds the spills. It can store a pointer
+ * that is not FP-derived over them: after the call each of them is "fp-N or not FP-derived".
+ */
 SEC("socket")
 __log_level(2)
 __success
-__msg("14: (79) r1 = *(u64 *)(r10 -8) // r6=fp0-8 r7=fp1-16 fp-8=fp1-16 fp-16=fp0-8")
-__msg("15: (79) r0 = *(u64 *)(r1 +0) // r1=fp1-16 r6=fp0-8 r7=fp1-16 fp-8=fp1-16 fp-16=fp0-8")
+__msg("14: (79) r1 = *(u64 *)(r10 -8) // r6=fp0-8 r7=fp1-16 fp-8=fp1-16|fp1+0 fp-16=fp0-8|fp0+0")
+__msg("15: (79) r0 = *(u64 *)(r1 +0) // r1=fp1-16|fp1+0 r6=fp0-8 r7=fp1-16 fp-8=fp1-16|fp1+0")
 __msg("stack use/def subprog#1 mid_two_fp_threshold (d1,cs2):")
 __msg("14: (79) r1 = *(u64 *)(r10 -8)        ; use: fp1-8")
 __msg("15: (79) r0 = *(u64 *)(r1 +0)         ; use: fp1-16")
@@ -1812,8 +1816,8 @@ static __used __naked void inner_nop_fptest(void)
 SEC("socket")
 __log_level(2)
 __success
-__msg("13: (79) r1 = *(u64 *)(r10 -8) // r6=fp0-8 r7=fp1-16 fp-8=fp1-16 fp-16=fp0-8")
-__msg("14: (79) r0 = *(u64 *)(r1 +0) // r1=fp1-16 r6=fp0-8 r7=fp1-16 fp-8=fp1-16 fp-16=fp0-8")
+__msg("13: (79) r1 = *(u64 *)(r10 -8) // r6=fp0-8 r7=fp1-16 fp-8=fp1-16|fp1+0 fp-16=fp0-8|fp0+0")
+__msg("14: (79) r0 = *(u64 *)(r1 +0) // r1=fp1-16|fp1+0 r6=fp0-8 r7=fp1-16 fp-8=fp1-16|fp1+0")
 __msg("stack use/def subprog#1 mid_one_fp_threshold (d1,cs2):")
 __msg("13: (79) r1 = *(u64 *)(r10 -8)        ; use: fp1-8")
 __msg("14: (79) r0 = *(u64 *)(r1 +0)         ; use: fp1-16")
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0184/1005] regulator: mt6363: Fix the registers of the VSRAM CPU and APU LDOs
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (182 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0183/1005] bpf: Dont trust pointers spilled in slots that a callee can write Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0185/1005] regulator: mt6363: Use 8-bit register values Greg Kroah-Hartman
                   ` (189 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, GIBEOM LEE  , Alexandre Mergnat,
	Mark Brown, Sasha Levin

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

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

From: GIBEOM LEE (이기범) <rtx4060@gmail.com>

[ Upstream commit 8aed8b66751e006589b6a9474af757d1ba04a857 ]

VSRAM_CPUB, VSRAM_CPUM, VSRAM_CPUL and VSRAM_APU have a register of their
own for the enable (bit 0) and low power (bit 1) bits, which the header
defines as MT6363_RG_LDO_VSRAM_*_ADDR. The driver does not use it:
MT6363_LDO_L() takes the registers of the BUCK1 group, which is right only
for the VSRAM_{DIGRF,MDFE,MODEM} LDOs of MT6363_LDO_L_SC().

Bit 0 of the BUCK1 enable register is VS1 and bit 1 of the BUCK1 low power
register is VS3. So disabling one of these LDOs disables VS1, their state
is the state of VS1, and asking for their low power mode puts VS3 in it.
The LDOs themselves are never switched.

Use the register of the LDO, as MediaTek's driver does.

Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: GIBEOM LEE (이기범) <rtx4060@gmail.com>
Tested-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20261101164405.1743177-3-rtx4060@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/regulator/mt6363-regulator.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/mt6363-regulator.c b/drivers/regulator/mt6363-regulator.c
index aa6a8eb7ac4b4..e56a2f0dd7778 100644
--- a/drivers/regulator/mt6363-regulator.c
+++ b/drivers/regulator/mt6363-regulator.c
@@ -147,7 +147,7 @@ struct mt6363_regulator_info {
 }
 
 #define MT6363_LDO_LINEAR_OPS(match, vreg, in_sup, vops, min, max,	\
-			      step, buck_reg, ocp_intn)			\
+			      step, en_reg, lp_reg, ocp_intn)		\
 [MT6363_ID_##vreg] = {							\
 	.desc = {							\
 		.name = match,						\
@@ -160,13 +160,13 @@ struct mt6363_regulator_info {
 		.n_voltages = (max - min) / step + 1,			\
 		.min_uV = min,						\
 		.uV_step = step,					\
-		.enable_reg = MT6363_RG_##buck_reg##_EN_ADDR,		\
+		.enable_reg = en_reg,					\
 		.enable_mask = BIT(MT6363_RG_LDO_##vreg##_EN_BIT),	\
 		.vsel_reg = MT6363_RG_LDO_##vreg##_VOSEL_ADDR,		\
 		.vsel_mask = MT6363_RG_LDO_##vreg##_VOSEL_MASK,		\
 		.of_map_mode = mt6363_map_mode,				\
 	},								\
-	.lp_mode_reg = MT6363_RG_##buck_reg##_LP_ADDR,			\
+	.lp_mode_reg = lp_reg,						\
 	.lp_mode_mask = BIT(MT6363_RG_LDO_##vreg##_LP_BIT),		\
 	.hw_lp_mode_reg = MT6363_LDO_##vreg##_HW_LP_MODE,		\
 	.hw_lp_mode_mask = 0x4,						\
@@ -176,12 +176,15 @@ struct mt6363_regulator_info {
 #define MT6363_LDO_L_SC(match, vreg, inp, min, max, step, buck_reg,	\
 			ocp_intn)					\
 	MT6363_LDO_LINEAR_OPS(match, vreg, inp, mt6363_vreg_setclr_ops,	\
-			      min, max, step, buck_reg, ocp_intn)
+			      min, max, step,				\
+			      MT6363_RG_##buck_reg##_EN_ADDR,		\
+			      MT6363_RG_##buck_reg##_LP_ADDR, ocp_intn)
 
-#define MT6363_LDO_L(match, vreg, inp, min, max, step, buck_reg,	\
-		     ocp_intn)						\
+#define MT6363_LDO_L(match, vreg, inp, min, max, step, ocp_intn)	\
 	MT6363_LDO_LINEAR_OPS(match, vreg, inp, mt6363_ldo_linear_ops,	\
-			      min, max, step, buck_reg, ocp_intn)
+			      min, max, step,				\
+			      MT6363_RG_LDO_##vreg##_ADDR,		\
+			      MT6363_RG_LDO_##vreg##_ADDR, ocp_intn)
 
 #define MT6363_LDO_LINEAR_CAL_OPS(match, vreg, in_sup, vops, vrnum,	\
 				  ocp_intn)				\
@@ -754,10 +757,10 @@ static struct mt6363_regulator_info mt6363_regulators[] = {
 	MT6363_LDO_VT("vio0p75", VIO075, "vs1-ldo1", 5, 36),
 	MT6363_LDO_VT("vio18", VIO18, "vs1-ldo2", 3, 35),
 	MT6363_LDO_VT("vm18", VM18, "vs1-ldo1", 4, 40),
-	MT6363_LDO_L("vsram-apu", VSRAM_APU, "vs3-ldo1", 400000, 1193750, 6250, BUCK1, 30),
-	MT6363_LDO_L("vsram-cpub", VSRAM_CPUB, "vs2-ldo1", 400000, 1193750, 6250, BUCK1, 27),
-	MT6363_LDO_L("vsram-cpum", VSRAM_CPUM, "vs2-ldo1", 400000, 1193750, 6250, BUCK1, 28),
-	MT6363_LDO_L("vsram-cpul", VSRAM_CPUL, "vs2-ldo2", 400000, 1193750, 6250, BUCK1, 29),
+	MT6363_LDO_L("vsram-apu", VSRAM_APU, "vs3-ldo1", 400000, 1193750, 6250, 30),
+	MT6363_LDO_L("vsram-cpub", VSRAM_CPUB, "vs2-ldo1", 400000, 1193750, 6250, 27),
+	MT6363_LDO_L("vsram-cpum", VSRAM_CPUM, "vs2-ldo1", 400000, 1193750, 6250, 28),
+	MT6363_LDO_L("vsram-cpul", VSRAM_CPUL, "vs2-ldo2", 400000, 1193750, 6250, 29),
 	MT6363_LDO_L_SC("vsram-digrf", VSRAM_DIGRF, "vs3-ldo1", 400000, 1193750, 6250, BUCK1, 23),
 	MT6363_LDO_L_SC("vsram-mdfe", VSRAM_MDFE, "vs3-ldo1", 400000, 1193750, 6250, BUCK1, 24),
 	MT6363_LDO_L_SC("vsram-modem", VSRAM_MODEM, "vs3-ldo2", 400000, 1193750, 6250, BUCK1, 25),
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0185/1005] regulator: mt6363: Use 8-bit register values
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (183 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0184/1005] regulator: mt6363: Fix the registers of the VSRAM CPU and APU LDOs Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0186/1005] regulator: mt6363: Fix VEMC voltage selection Greg Kroah-Hartman
                   ` (188 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandre Mergnat, Mark Brown,
	Sasha Levin

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

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

From: Alexandre Mergnat <amergnat@baylibre.com>

[ Upstream commit 7318d3833067e4edb7c2a9bc244e8818b1597ff2 ]

The registers are 8 bits wide, but the regulator regmap uses 16-bit
values, so every access also covers the next register. On little-endian
CPUs, each regmap_write() also writes zero to the next register:
disabling VS2 or a VBUCK rail through its clear register 0x212 also
clears the enable bits of VS1, VS3 and three VSRAM rails in 0x213.

Change the regmap values to 8 bits. Store the BUCK and TMA keys as
__le16 so that the low byte goes to the first key register on any CPU,
as it did on little-endian CPUs.

Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators")
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20261102-rgp-67-mt6363-regulator-fixes-v1-1-420789a3113e@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/regulator/mt6363-regulator.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/mt6363-regulator.c b/drivers/regulator/mt6363-regulator.c
index e56a2f0dd7778..52220117ce249 100644
--- a/drivers/regulator/mt6363-regulator.c
+++ b/drivers/regulator/mt6363-regulator.c
@@ -384,7 +384,7 @@ static unsigned int mt6363_regulator_get_mode(struct regulator_dev *rdev)
 
 static int mt6363_buck_unlock(struct regmap *map, bool unlock)
 {
-	u16 buf = unlock ? MT6363_BUCK_TOP_UNLOCK_VALUE : 0;
+	__le16 buf = cpu_to_le16(unlock ? MT6363_BUCK_TOP_UNLOCK_VALUE : 0);
 
 	return regmap_bulk_write(map, MT6363_BUCK_TOP_KEY_PROT_LO, &buf, sizeof(buf));
 }
@@ -485,7 +485,8 @@ static int mt6363_regulator_set_load(struct regulator_dev *rdev, int load_uA)
 
 static int mt6363_vemc_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
 {
-	const u16 tma_unlock_key = MT6363_TMA_UNLOCK_VALUE;
+	const __le16 tma_unlock_key = cpu_to_le16(MT6363_TMA_UNLOCK_VALUE);
+	const __le16 tma_lock_key = cpu_to_le16(0);
 	const struct regulator_desc *rdesc = rdev->desc;
 	struct regmap *regmap = rdev->regmap;
 	unsigned int range, val;
@@ -542,8 +543,8 @@ static int mt6363_vemc_set_voltage_sel(struct regulator_dev *rdev, unsigned int
 
 lock_tma:
 	/* Unconditionally re-lock TMA */
-	val = 0;
-	regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L, &val, 2);
+	regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L,
+			  &tma_lock_key, sizeof(tma_lock_key));
 
 	return ret;
 }
@@ -814,7 +815,7 @@ static struct regmap *mt6363_spmi_register_regmap(struct device *dev)
 {
 	struct regmap_config mt6363_regmap_config = {
 		.reg_bits = 16,
-		.val_bits = 16,
+		.val_bits = 8,
 		.max_register = 0x1f90,
 		.fast_io = true,
 	};
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0186/1005] regulator: mt6363: Fix VEMC voltage selection
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (184 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0185/1005] regulator: mt6363: Use 8-bit register values Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0187/1005] Bluetooth: hci_sync: Fix invalid Supervision_Timeout in LE Set Default Rate Greg Kroah-Hartman
                   ` (187 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandre Mergnat, Mark Brown,
	Sasha Levin

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

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

From: Alexandre Mergnat <amergnat@baylibre.com>

[ Upstream commit a8d72f246edb9323f6e0ae8283676a323b7847eb ]

VEMC encodes its voltage as a range and a trim value. The custom
getter looks up the range with

	if (rdesc->linear_range_selectors_bitfield[range] != calsel)

so it stops at the first non-matching range and the reported voltage is
wrong for every range setting. With hardware trap 1, the custom getter
and setter apply MT6363_RG_VEMC_VOSEL_1_MASK, the trap 1 range field,
to the trap 0 trim register and keep the trap 0 range field. Voltage
changes are then not applied and the reported voltage does not reflect
the trap 1 settings.

Apart from the trap handling, both callbacks reimplement the regulator
core pickable regmap helpers, which work for VEMC once the descriptor
holds the range field and trim register of the hardware trap. Select
that field and register at probe and use the helpers instead of
fixing the copies. Keep the setter as a wrapper for the TMA unlock
and relock around the write, which the helper does not do. A trap
value other than 0 or 1, or a failed trap read, now fails the probe
instead of the VEMC voltage get and set.

Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators")
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://patch.msgid.link/20261102-rgp-67-mt6363-regulator-fixes-v1-2-420789a3113e@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/regulator/mt6363-regulator.c       | 120 ++++++---------------
 include/linux/regulator/mt6363-regulator.h |   1 +
 2 files changed, 33 insertions(+), 88 deletions(-)

diff --git a/drivers/regulator/mt6363-regulator.c b/drivers/regulator/mt6363-regulator.c
index 52220117ce249..e6c4bd851fef5 100644
--- a/drivers/regulator/mt6363-regulator.c
+++ b/drivers/regulator/mt6363-regulator.c
@@ -4,7 +4,6 @@
 // Copyright (c) 2025 Collabora Ltd
 //                    AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
 
-#include <linux/bitfield.h>
 #include <linux/delay.h>
 #include <linux/devm-helpers.h>
 #include <linux/err.h>
@@ -487,30 +486,7 @@ static int mt6363_vemc_set_voltage_sel(struct regulator_dev *rdev, unsigned int
 {
 	const __le16 tma_unlock_key = cpu_to_le16(MT6363_TMA_UNLOCK_VALUE);
 	const __le16 tma_lock_key = cpu_to_le16(0);
-	const struct regulator_desc *rdesc = rdev->desc;
-	struct regmap *regmap = rdev->regmap;
-	unsigned int range, val;
-	int i, ret;
-	u16 mask;
-
-	for (i = 0; i < rdesc->n_linear_ranges; i++) {
-		const struct linear_range *r = &rdesc->linear_ranges[i];
-		unsigned int voltages_in_range = linear_range_values_in_range(r);
-
-		if (sel < voltages_in_range)
-			break;
-		sel -= voltages_in_range;
-	}
-
-	if (i == rdesc->n_linear_ranges)
-		return -EINVAL;
-
-	ret = regmap_read(rdev->regmap, MT6363_TOP_TRAP, &val);
-	if (ret)
-		return ret;
-
-	if (val > 1)
-		return -EINVAL;
+	int ret;
 
 	/* Unlock TMA for writing */
 	ret = regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L,
@@ -518,30 +494,8 @@ static int mt6363_vemc_set_voltage_sel(struct regulator_dev *rdev, unsigned int
 	if (ret)
 		return ret;
 
-	/* If HW trapping value is 1, use VEMC_VOSEL_1 instead of VEMC_VOSEL_0 */
-	if (val == 1) {
-		mask = MT6363_RG_VEMC_VOSEL_1_MASK;
-		sel = FIELD_PREP(MT6363_RG_VEMC_VOSEL_1_MASK, sel);
-	} else {
-		mask = rdesc->vsel_mask;
-	}
-
-	sel <<= ffs(rdesc->vsel_mask) - 1;
-	sel += rdesc->linear_ranges[i].min_sel;
-
-	range = rdesc->linear_range_selectors_bitfield[i];
-	range <<= ffs(rdesc->vsel_range_mask) - 1;
-
-	/* Write to the vreg calibration register for voltage finetuning */
-	ret = regmap_update_bits(regmap, rdesc->vsel_range_reg,
-				 rdesc->vsel_range_mask, range);
-	if (ret)
-		goto lock_tma;
-
-	/* Function must return the result of this write operation */
-	ret = regmap_update_bits(regmap, rdesc->vsel_reg, mask, sel);
+	ret = regulator_set_voltage_sel_pickable_regmap(rdev, sel);
 
-lock_tma:
 	/* Unconditionally re-lock TMA */
 	regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L,
 			  &tma_lock_key, sizeof(tma_lock_key));
@@ -549,45 +503,6 @@ static int mt6363_vemc_set_voltage_sel(struct regulator_dev *rdev, unsigned int
 	return ret;
 }
 
-static int mt6363_vemc_get_voltage_sel(struct regulator_dev *rdev)
-{
-	const struct regulator_desc *rdesc = rdev->desc;
-	unsigned int vosel, trap, calsel;
-	int vcal, vsel, range, ret;
-
-	ret = regmap_read(rdev->regmap, rdesc->vsel_reg, &vosel);
-	if (ret)
-		return ret;
-
-	ret = regmap_read(rdev->regmap, rdesc->vsel_range_reg, &calsel);
-	if (ret)
-		return ret;
-
-	calsel &= rdesc->vsel_range_mask;
-	for (range = 0; range < rdesc->n_linear_ranges; range++)
-		if (rdesc->linear_range_selectors_bitfield[range] != calsel)
-			break;
-
-	if (range == rdesc->n_linear_ranges)
-		return -EINVAL;
-
-	ret = regmap_read(rdev->regmap, MT6363_TOP_TRAP, &trap);
-	if (ret)
-		return ret;
-
-	/* If HW trapping value is 1, use VEMC_VOSEL_1 instead of VEMC_VOSEL_0 */
-	if (trap > 1)
-		return -EINVAL;
-	else if (trap == 1)
-		vsel = FIELD_GET(MT6363_RG_VEMC_VOSEL_1_MASK, vosel);
-	else
-		vsel = vosel & rdesc->vsel_mask;
-
-	vcal = linear_range_values_in_range_array(rdesc->linear_ranges, range);
-
-	return vsel + vcal;
-}
-
 static int mt6363_va15_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
 {
 	struct regmap *regmap = rdev->regmap;
@@ -700,7 +615,7 @@ static const struct regulator_ops mt6363_ldo_vemc_ops = {
 	.list_voltage = regulator_list_voltage_pickable_linear_range,
 	.map_voltage = regulator_map_voltage_pickable_linear_range,
 	.set_voltage_sel = mt6363_vemc_set_voltage_sel,
-	.get_voltage_sel = mt6363_vemc_get_voltage_sel,
+	.get_voltage_sel = regulator_get_voltage_sel_pickable_regmap,
 	.set_voltage_time_sel = regulator_set_voltage_time_sel,
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
@@ -797,6 +712,30 @@ static int mt6363_backup_op_setting(struct regmap *map, struct mt6363_regulator_
 	return 0;
 }
 
+static int mt6363_vemc_select_bank(struct regmap *map, struct regulator_desc *desc)
+{
+	unsigned int trap;
+	int ret;
+
+	ret = regmap_read(map, MT6363_TOP_TRAP, &trap);
+	if (ret)
+		return ret;
+
+	/* The hardware trap value selects which VEMC voltage controls are used */
+	switch (trap) {
+	case 0:
+		desc->vsel_reg = MT6363_RG_VEMC_VOCAL_ADDR;
+		desc->vsel_range_mask = MT6363_RG_VEMC_VOSEL_MASK;
+		return 0;
+	case 1:
+		desc->vsel_reg = MT6363_RG_VEMC_VOCAL_1_ADDR;
+		desc->vsel_range_mask = MT6363_RG_VEMC_VOSEL_1_MASK;
+		return 0;
+	default:
+		return -EINVAL;
+	}
+}
+
 static void mt6363_irq_remove(void *data)
 {
 	int *virq = data;
@@ -881,6 +820,11 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
 	 */
 	regmap_read(config.regmap, MT6363_TOP_TRAP, &val);
 
+	ret = mt6363_vemc_select_bank(config.regmap,
+				      &mt6363_regulators[MT6363_ID_VEMC].desc);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to select VEMC bank\n");
+
 	interrupt_parent = of_irq_find_parent(dev->of_node);
 	if (!interrupt_parent)
 		return dev_err_probe(dev, -EINVAL, "Cannot find IRQ parent\n");
diff --git a/include/linux/regulator/mt6363-regulator.h b/include/linux/regulator/mt6363-regulator.h
index 60761f01d3ad8..e0d2c01827a7a 100644
--- a/include/linux/regulator/mt6363-regulator.h
+++ b/include/linux/regulator/mt6363-regulator.h
@@ -138,6 +138,7 @@
 #define MT6363_RG_LDO_VSRAM_APU_VOSEL_ADDR	0x1b17
 #define MT6363_RG_LDO_VSRAM_APU_VOSEL_MASK	GENMASK(6, 0)
 #define MT6363_RG_VEMC_VOCAL_ADDR		0x1b1b
+#define MT6363_RG_VEMC_VOCAL_1_ADDR		0x1b1c
 #define MT6363_RG_VEMC_VOCAL_MASK		GENMASK(3, 0)
 #define MT6363_RG_LDO_VCN15_ADDR		0x1b57
 #define MT6363_RG_LDO_VCN15_EN_BIT		0
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0187/1005] Bluetooth: hci_sync: Fix invalid Supervision_Timeout in LE Set Default Rate
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (185 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0186/1005] regulator: mt6363: Fix VEMC voltage selection Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0188/1005] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
                   ` (186 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin

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

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

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

[ Upstream commit fb1baa000d7a0b597ab9eb29b179b03e70e5f6ee ]

The LE Set Default Rate Parameters command is rejected with Invalid HCI
Command Parameters (0x12) because the Supervision_Timeout of 120 ms is
exactly the minimum recommended by HOGP v1.2:

  Greater than or equal to (1 + Peripheral Latency) x Subrate max x
  Connection Interval max x 2

But the Core spec treats the equality as invalid:

BLUETOOTH CORE SPECIFICATION Version 6.3 | Vol 4, Part E
7.8.158. LE Set Default Rate Parameters command

  If Connection_Interval_Max x Subrate_Max x (Max_Latency + 1) is
  greater than or equal to Supervision_Timeout x 40, the Controller
  shall return the error code Invalid HCI Command Parameters (0x12).

With the current values 0x78 x 4 x 1 = 480 >= 0x0c x 40 = 480.

Fix this by using 2 s as the default Supervision_Timeout, which is 10x
lower than the 20 s used for non-SCI connections while still well above
the minimum required, and make sure it remains above the minimum in
case interval_max is raised to match the controller's minimum supported
connection interval.

Fixes: 2f8784cfe8a9 ("Bluetooth: Add support for Shorter Connection Interval (SCI) feature")
Assisted-by: OpenCode:claude-opus-5.5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_sync.c | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 4e5c47872c30b..b86f67ea5fddc 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4834,6 +4834,9 @@ static int hci_le_set_def_rate_sync(struct hci_dev *hdev)
 	struct hci_cp_le_set_def_rate cp;
 	u16 interval_min = 0x000a;	/* 1.25 ms */
 	u16 interval_max = 0x0078;	/* 15 ms */
+	u16 subrate_max = 0x0004;
+	u16 max_latency = 0x0000;
+	u32 supv_timeout;
 
 	if (!le_sci_capable(hdev))
 		return 0;
@@ -4858,10 +4861,31 @@ static int hci_le_set_def_rate_sync(struct hci_dev *hdev)
 	cp.interval_min = cpu_to_le16(interval_min);
 	cp.interval_max = cpu_to_le16(interval_max);
 	cp.subrate_min = cpu_to_le16(0x0001);
-	cp.subrate_max = cpu_to_le16(0x0004);
-	cp.max_latency = cpu_to_le16(0x0000);
+	cp.subrate_max = cpu_to_le16(subrate_max);
+	cp.max_latency = cpu_to_le16(max_latency);
 	cp.cont_num = cpu_to_le16(0x0001);
-	cp.supv_timeout = cpu_to_le16(0x000c);	/* 120 ms */
+
+	/* HOGP v1.2 recommends a Supervision_Timeout greater than or equal to
+	 * (1 + Max_Latency) x Subrate_Max x Connection_Interval_Max x 2, but
+	 * the Core spec treats the equality as invalid:
+	 *
+	 * BLUETOOTH CORE SPECIFICATION Version 6.3 | Vol 4, Part E
+	 * 7.8.158. LE Set Default Rate Parameters command
+	 *
+	 * If Connection_Interval_Max x Subrate_Max x (Max_Latency + 1) is
+	 * greater than or equal to Supervision_Timeout x 40, the Controller
+	 * shall return the error code Invalid HCI Command Parameters (0x12).
+	 *
+	 * So default to 2 s, 10x lower than the 20 s used for non-SCI
+	 * connections while still well above the minimum required, but make
+	 * sure it stays strictly above the minimum in case interval_max has
+	 * been raised.
+	 */
+	supv_timeout = (u32)interval_max * subrate_max * (max_latency + 1);
+	supv_timeout = supv_timeout / 40 + 1;
+	supv_timeout = clamp_t(u32, max_t(u32, supv_timeout, 0x00c8),
+			       0x000a, 0x0c80);
+	cp.supv_timeout = cpu_to_le16(supv_timeout);
 
 	/* The connection event length recommended in requests by a Peripheral
 	 * uses units of 125 us with a valid range of 0x0001 to 0x7CFF
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0188/1005] Bluetooth: hci_core: Initialize IRK before publication
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (186 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0187/1005] Bluetooth: hci_sync: Fix invalid Supervision_Timeout in LE Set Default Rate Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0189/1005] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
                   ` (185 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Binbin Deng <18983559317@163.com>

[ Upstream commit f0cf5a24cefeb629876bd15d668ff062c8655e28 ]

hci_add_irk() initializes the identity address and address type of a newly
allocated IRK, publishes it on hdev->identity_resolving_keys, and only then
initializes its value and RPA.  RCU readers such as hci_find_irk_by_rpa()
and the debugfs identity_resolving_keys_show() can traverse the new entry
during that window and see a zero or partially initialized IRK.

The race is reachable by racing an IRK addition with another CPU resolving
or dumping IRKs.  In particular, userspace can issue MGMT_OP_LOAD_IRKS
while another process reads the corresponding debugfs file or triggers RPA
resolution.

Initialize the IRK value and RPA before publishing a newly allocated IRK.
Existing IRKs remain published and continue to be updated in place.

Found during a static-analysis-assisted audit: candidate sites were
surfaced by a Coccinelle rule, and the reader/writer paths were
confirmed by LLM-assisted (GLM-5.3) code inspection.  The issue was
not observed at runtime; it is identified by code inspection only.

Fixes: adae20cb2d20 ("Bluetooth: Convert IRK list to RCU")
Assisted-by: GLM-5.3 coccinelle
Signed-off-by: Binbin Deng <18983559317@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index becac4a223dfd..99caed1aeb185 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1315,9 +1315,10 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
 struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr,
 			    u8 addr_type, u8 val[16], bdaddr_t *rpa)
 {
-	struct smp_irk *irk;
+	struct smp_irk *irk, *old_irk;
 
-	irk = hci_find_irk_by_addr(hdev, bdaddr, addr_type);
+	old_irk = hci_find_irk_by_addr(hdev, bdaddr, addr_type);
+	irk = old_irk;
 	if (!irk) {
 		irk = kzalloc_obj(*irk);
 		if (!irk)
@@ -1326,12 +1327,14 @@ struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr,
 		bacpy(&irk->bdaddr, bdaddr);
 		irk->addr_type = addr_type;
 
-		list_add_rcu(&irk->list, &hdev->identity_resolving_keys);
 	}
 
 	memcpy(irk->val, val, 16);
 	bacpy(&irk->rpa, rpa);
 
+	if (!old_irk)
+		list_add_rcu(&irk->list, &hdev->identity_resolving_keys);
+
 	return irk;
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0189/1005] Bluetooth: hci_core: Initialize link key before publication
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (187 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0188/1005] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0190/1005] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
                   ` (184 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Binbin Deng <18983559317@163.com>

[ Upstream commit ae9c8df1ffb84560ac01cbdc26cfb19027f4d25f ]

hci_add_link_key() allocates a new link key with kzalloc(), inserts it into
hdev->link_keys with list_add_rcu(), and only then initializes its address,
value, type, and PIN length.  RCU readers such as hci_find_link_key()
and the debugfs link_keys_show() do not take hci_dev_lock, so they can
traverse the new entry during that initialization window and observe
a zero or partially initialized key.

This can be triggered by racing a link-key update with another CPU looking
up or dumping keys.  In particular, userspace can issue
MGMT_OP_LOAD_LINK_KEYS while another process reads the corresponding
debugfs file.

Complete all fields of a newly allocated key before publishing it with
list_add_rcu().  Existing keys remain visible and keep their current
in-place update behavior.

Found during a static-analysis-assisted audit: candidate sites were
surfaced by a Coccinelle rule, and the reader/writer paths were
confirmed by LLM-assisted (GLM-5.3) code inspection.  The issue was
not observed at runtime; it is identified by code inspection only.

Fixes: 0378b5977013 ("Bluetooth: Convert link keys list to use RCU")
Signed-off-by: Binbin Deng <18983559317@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 99caed1aeb185..b285db239e6fe 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1252,7 +1252,6 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
 		key = kzalloc_obj(*key);
 		if (!key)
 			return NULL;
-		list_add_rcu(&key->list, &hdev->link_keys);
 	}
 
 	BT_DBG("%s key for %pMR type %u", hdev->name, bdaddr, type);
@@ -1276,6 +1275,9 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
 	else
 		key->type = type;
 
+	if (!old_key)
+		list_add_rcu(&key->list, &hdev->link_keys);
+
 	if (persistent)
 		*persistent = hci_persistent_key(hdev, conn, type,
 						 old_key_type);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0190/1005] Bluetooth: hci_core: Initialize LTK before publication
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (188 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0189/1005] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0191/1005] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
                   ` (183 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Binbin Deng <18983559317@163.com>

[ Upstream commit 4335849380aa1081ee9a1c2b934cbdda0961fa57 ]

hci_add_ltk() publishes a newly allocated LTK on hdev->long_term_keys
before initializing its address, type, value, authentication state,
encryption size, EDIV, and random value.  hci_find_ltk() and the debugfs
long_term_keys_show() traverse this list under RCU and can therefore see
a zero or partially initialized key before those stores complete.

The race is reachable by racing an LTK addition with another CPU looking
up or dumping long-term keys.  For example, userspace can issue
MGMT_OP_LOAD_LONG_TERM_KEYS while another process reads the corresponding
debugfs file.

Initialize all fields of a new LTK before list_add_rcu() makes it visible
to RCU readers.  Existing LTKs remain published and continue to be updated
in place.

Found during a static-analysis-assisted audit: candidate sites were
surfaced by a Coccinelle rule, and the reader/writer paths were
confirmed by LLM-assisted (GLM-5.3) code inspection.  The issue was
not observed at runtime; it is identified by code inspection only.

Fixes: 970d0f1b2803 ("Bluetooth: Convert LTK list to RCU")
Assisted-by: GLM-5.3 coccinelle
Signed-off-by: Binbin Deng <18983559317@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index b285db239e6fe..a162877d1144c 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1299,7 +1299,6 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
 		key = kzalloc_obj(*key);
 		if (!key)
 			return NULL;
-		list_add_rcu(&key->list, &hdev->long_term_keys);
 	}
 
 	bacpy(&key->bdaddr, bdaddr);
@@ -1311,6 +1310,9 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
 	key->enc_size = enc_size;
 	key->type = type;
 
+	if (!old_key)
+		list_add_rcu(&key->list, &hdev->long_term_keys);
+
 	return key;
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0191/1005] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (189 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0190/1005] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0192/1005] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
                   ` (182 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+2344fb8002f3ef5b1712,
	Akhil Arul, Luiz Augusto von Dentz, Sasha Levin

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

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

From: Akhil Arul <akhilarul324@gmail.com>

[ Upstream commit 19b4e5701712f74d005cc66a36374559e8dfd281 ]

hci_recv_frame() drops a frame unless HCI_UP or HCI_INIT is set, but the
check is not synchronized with hci_dev_close_sync().  A driver can pass
the check, then close clears HCI_UP, flushes rx_work and starts
drain_workqueue(), and the late queue_work() of rx_work hits the
draining workqueue:

  workqueue: cannot queue hci_rx_work on wq hci0
  WARNING: kernel/workqueue.c:2352 at __queue_work+0x2c0/0x780
  Call Trace:
   queue_work_on+0xb2/0xc0
   hci_recv_frame+0x18f/0x330
   vhci_write+0x174/0x240
   vfs_write+0x271/0x680
   ksys_write+0x7c/0x110

Skipping the queue_work() while HCI_CMD_DRAIN_WORKQUEUE is set, as done
for tx_work, does not work for rx_work: the flag covers the whole close,
and events still have to be received in that window, for the commands
sent by hdev->shutdown() and for the reset done with
HCI_QUIRK_RESET_ON_CLOSE.

Run hci_recv_frame() under rcu_read_lock() and wait with
synchronize_rcu() once HCI_UP has been cleared, so that every caller
which still saw HCI_UP has queued its work before the workqueue is
drained, and later callers drop the frame.

HCI_INIT does not reopen that window.  Apart from the
HCI_QUIRK_RESET_ON_CLOSE reset, which runs after drain_workqueue() has
returned, it is only set by hci_dev_init_sync() during open, and open
and close are serialized by hci_req_sync_lock.  So once the grace period
has ended, nothing can pass the check and queue rx_work until the drain
is over.

Tested in qemu with the syzbot C reproducer, one run per boot: the
warning showed up on 12 of 30 boots before and on none of 42 boots after.
Bringing a vhci controller up and down 50 times behaves the same with
and without this change.

Fixes: 76727c02c1e1 ("Bluetooth: Call drain_workqueue() before resetting state")
Reported-by: syzbot+2344fb8002f3ef5b1712@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2344fb8002f3ef5b1712
Signed-off-by: Akhil Arul <akhilarul324@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_core.c | 9 +++++++++
 net/bluetooth/hci_sync.c | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index a162877d1144c..edd2304639a1b 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2904,8 +2904,14 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
 {
 	u8 dev_pkt_type;
 
+	/* Pairs with synchronize_rcu() in hci_dev_close_sync(), so rx_work is
+	 * not queued once the workqueue is being drained.
+	 */
+	rcu_read_lock();
+
 	if (!hdev || (!test_bit(HCI_UP, &hdev->flags)
 		      && !test_bit(HCI_INIT, &hdev->flags))) {
+		rcu_read_unlock();
 		kfree_skb(skb);
 		return -ENXIO;
 	}
@@ -2939,6 +2945,7 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
 	case HCI_DRV_PKT:
 		break;
 	default:
+		rcu_read_unlock();
 		kfree_skb(skb);
 		return -EINVAL;
 	}
@@ -2952,6 +2959,8 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
 	skb_queue_tail(&hdev->rx_q, skb);
 	queue_work(hdev->workqueue, &hdev->rx_work);
 
+	rcu_read_unlock();
+
 	return 0;
 }
 EXPORT_SYMBOL(hci_recv_frame);
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index b86f67ea5fddc..fa7f1765edeed 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -5659,6 +5659,11 @@ int hci_dev_close_sync(struct hci_dev *hdev)
 		return err;
 	}
 
+	/* Wait for hci_recv_frame() callers that still saw HCI_UP, so that
+	 * none of them queues rx_work while the workqueue is drained below.
+	 */
+	synchronize_rcu();
+
 	hci_leds_update_powered(hdev, false);
 
 	/* Flush RX and TX works */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0192/1005] Bluetooth: btintel: fix buffer over-read in fw payload
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (190 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0191/1005] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0193/1005] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
                   ` (181 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Catherine L, Kiran K,
	Luiz Augusto von Dentz, Sasha Levin

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

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

From: Catherine L <catherine.l@intel.com>

[ Upstream commit f92b7bca985205082c86140d0bd7c86c5be00efc ]

The firmware decoder cast fw_ptr + frag_len to struct
hci_command_hdr and read cmd->plen before confirming the
header and payload still fit in the remaining firmware
buffer.

Add explicit bounds checks before each dereference:
1. Reject if the command header is not fully contained
   in remain.
2. Reject if the full command including payload exceeds
   remain.
3. Log the offending fragment length and remaining size
   before returning -EINVAL.

Fixes: fbbe83c52bc0d ("Bluetooth: btintel: Create common function for firmware download")
Signed-off-by: Catherine L <catherine.l@intel.com>
Tested-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btintel.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 4871a552d3aa0..85cbcfbea81a7 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -1150,7 +1150,29 @@ static int btintel_download_firmware_payload(struct hci_dev *hdev,
 	err = -EINVAL;
 
 	while (fw_ptr - fw->data < fw->size) {
-		struct hci_command_hdr *cmd = (void *)(fw_ptr + frag_len);
+		struct hci_command_hdr *cmd;
+		size_t remain = fw->size - (fw_ptr - fw->data);
+
+		/* Ensure the header fits before dereferencing */
+		if (frag_len + sizeof(*cmd) > remain) {
+			bt_dev_err(hdev,
+				   "Firmware buffer overrun at header (frag_len %u, need %zu, remain %zu)",
+				   frag_len, frag_len + sizeof(*cmd), remain);
+			err = -EINVAL;
+			goto done;
+		}
+
+		cmd = (void *)(fw_ptr + frag_len);
+
+		/* Ensure the full command (header + payload) fits before use */
+		if (frag_len + sizeof(*cmd) + cmd->plen > remain) {
+			bt_dev_err(hdev,
+				   "Firmware buffer overrun at payload (frag_len %u, plen %u, need %zu, remain %zu)",
+				   frag_len, cmd->plen,
+				   frag_len + sizeof(*cmd) + cmd->plen, remain);
+			err = -EINVAL;
+			goto done;
+		}
 
 		frag_len += sizeof(*cmd) + cmd->plen;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0193/1005] Bluetooth: hci_event: Clear explicit connect state on LE connection
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (191 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0192/1005] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0194/1005] Bluetooth: use assign_bit() where applicable Greg Kroah-Hartman
                   ` (180 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Kevin Dewald <kevin@simpleble.org>

[ Upstream commit f5cd268af1c6f87fb3847e98274e22b8c6324aa4 ]

Since commit 6cd29ec6ae5e ("Bluetooth: hci_sync: Wait for proper events
when connecting LE"), create_le_conn_complete() only runs once the LE
Connection Complete event has been handled, and le_conn_complete_evt()
has already removed the connection parameters from pend_le_conns by
then. hci_connect_le_scan_cleanup() looks the parameters up in
pend_le_conns, so after a successful connection it no longer clears
explicit_connect, nor deletes the parameters that were only created for
the explicit connect.

The parameters of every device connected through an explicit connect,
such as an L2CAP or ATT connect or MGMT Pair Device, are thus left with
explicit_connect set. MGMT Remove Device for all devices then keeps
them as HCI_AUTO_CONN_EXPLICIT instead of freeing them, and if the
device was set to auto-connect and is disconnected, they also stay on
pend_le_conns: the kernel keeps scanning for the device and connects to
it as soon as it advertises, although no one asked for it any more.

Do the cleanup in le_conn_complete_evt() instead, where the explicit
connect request is fulfilled: clear explicit_connect, delete the
parameters if they only existed for it, and put report parameters back
on pend_le_reports. Auto-connect parameters are added back to
pend_le_conns on disconnection, as before. Update the comment in
hci_explicit_conn_params_set() that names hci_connect_le_scan_cleanup()
as the only place deleting them.

Fixes: 6cd29ec6ae5e ("Bluetooth: hci_sync: Wait for proper events when connecting LE")
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Kevin Dewald <kevin@simpleble.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_conn.c  |  5 +++--
 net/bluetooth/hci_event.c | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index cf44452e0766e..8f136f28b7d68 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1586,8 +1586,9 @@ static int hci_explicit_conn_params_set(struct hci_dev *hdev,
 		if (!params)
 			return -ENOMEM;
 
-		/* If we created new params, mark them to be deleted in
-		 * hci_connect_le_scan_cleanup. It's different case than
+		/* If we created new params, mark them to be deleted once the
+		 * explicit connect is done, see le_conn_complete_evt() and
+		 * hci_connect_le_scan_cleanup(). It's different case than
 		 * existing disabled params, those will stay after cleanup.
 		 */
 		params->auto_connect = HCI_AUTO_CONN_EXPLICIT;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3288f92fe41bf..f5c2bc77397b9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5956,6 +5956,28 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
 			hci_conn_put(params->conn);
 			params->conn = NULL;
 		}
+
+		/* An explicit connect request is complete once connected, so
+		 * clean it up here: hci_connect_le_scan_cleanup() no longer
+		 * finds the params since they have just been removed from
+		 * pend_le_conns.
+		 */
+		if (params->explicit_connect) {
+			params->explicit_connect = false;
+
+			switch (params->auto_connect) {
+			case HCI_AUTO_CONN_EXPLICIT:
+				hci_conn_params_del(hdev, &conn->dst,
+						    conn->dst_type);
+				break;
+			case HCI_AUTO_CONN_REPORT:
+				hci_pend_le_list_add(params,
+						     &hdev->pend_le_reports);
+				break;
+			default:
+				break;
+			}
+		}
 	}
 
 	/* If we are central and have subrate parameters stored, queue a
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0194/1005] Bluetooth: use assign_bit() where applicable
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (192 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0193/1005] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0195/1005] Bluetooth: MGMT: Add management security level changed event Greg Kroah-Hartman
                   ` (179 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Peng Fan, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Peng Fan <peng.fan@nxp.com>

[ Upstream commit c4154fc34772134b0dbd14ab0134ba10b90c52cc ]

Convert open-coded if/else with set_bit/clear_bit the assign_bit API.

Done with Coccinelle semantic patch:
    // set_bit -> clear_bit => assign_bit

    @@
    expression cond, bit, addr;
    @@

    -if (cond)
    -        set_bit(bit, addr);
    -else
    -        clear_bit(bit, addr);
    +assign_bit(bit, addr, cond);

    @@
    expression cond, bit, addr;
    @@

    -if (cond)
    -        clear_bit(bit, addr);
    -else
    -        set_bit(bit, addr);
    +assign_bit(bit, addr, !cond);

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 5d005ded2cb1 ("Bluetooth: L2CAP: Hold incoming data until encryption key size is known")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_event.c   | 31 +++++++------------------------
 net/bluetooth/iso.c         | 15 +++------------
 net/bluetooth/l2cap_sock.c  | 22 ++++++----------------
 net/bluetooth/rfcomm/core.c |  6 ++----
 net/bluetooth/rfcomm/sock.c |  5 +----
 net/bluetooth/sco.c         | 10 ++--------
 6 files changed, 21 insertions(+), 68 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index f5c2bc77397b9..1962dccabbef1 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -404,10 +404,7 @@ static u8 hci_cc_write_auth_enable(struct hci_dev *hdev, void *data,
 	if (!rp->status) {
 		__u8 param = *((__u8 *) sent);
 
-		if (param == AUTH_ENABLED)
-			set_bit(HCI_AUTH, &hdev->flags);
-		else
-			clear_bit(HCI_AUTH, &hdev->flags);
+		assign_bit(HCI_AUTH, &hdev->flags, param == AUTH_ENABLED);
 	}
 
 	if (hci_dev_test_flag(hdev, HCI_MGMT))
@@ -436,10 +433,7 @@ static u8 hci_cc_write_encrypt_mode(struct hci_dev *hdev, void *data,
 
 	param = *((__u8 *) sent);
 
-	if (param)
-		set_bit(HCI_ENCRYPT, &hdev->flags);
-	else
-		clear_bit(HCI_ENCRYPT, &hdev->flags);
+	assign_bit(HCI_ENCRYPT, &hdev->flags, param);
 
 	return rp->status;
 }
@@ -466,15 +460,9 @@ static u8 hci_cc_write_scan_enable(struct hci_dev *hdev, void *data,
 		goto done;
 	}
 
-	if (param & SCAN_INQUIRY)
-		set_bit(HCI_ISCAN, &hdev->flags);
-	else
-		clear_bit(HCI_ISCAN, &hdev->flags);
+	assign_bit(HCI_ISCAN, &hdev->flags, param & SCAN_INQUIRY);
 
-	if (param & SCAN_PAGE)
-		set_bit(HCI_PSCAN, &hdev->flags);
-	else
-		clear_bit(HCI_PSCAN, &hdev->flags);
+	assign_bit(HCI_PSCAN, &hdev->flags, param & SCAN_PAGE);
 
 done:
 	hci_dev_unlock(hdev);
@@ -4661,10 +4649,8 @@ static void hci_mode_change_evt(struct hci_dev *hdev, void *data,
 
 		if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND,
 					&conn->flags)) {
-			if (conn->mode == HCI_CM_ACTIVE)
-				set_bit(HCI_CONN_POWER_SAVE, &conn->flags);
-			else
-				clear_bit(HCI_CONN_POWER_SAVE, &conn->flags);
+			assign_bit(HCI_CONN_POWER_SAVE, &conn->flags,
+				   conn->mode == HCI_CM_ACTIVE);
 		}
 
 		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->flags))
@@ -4864,10 +4850,7 @@ static void hci_link_key_notify_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 	}
 
-	if (persistent)
-		clear_bit(HCI_CONN_FLUSH_KEY, &conn->flags);
-	else
-		set_bit(HCI_CONN_FLUSH_KEY, &conn->flags);
+	assign_bit(HCI_CONN_FLUSH_KEY, &conn->flags, !persistent);
 
 unlock:
 	hci_dev_unlock(hdev);
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 8768d9c0cf512..c1fdd9846eeb0 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -1977,10 +1977,7 @@ static int iso_sock_setsockopt(struct socket *sock, int level, int optname,
 		if (err)
 			break;
 
-		if (opt)
-			set_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
-		else
-			clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
+		assign_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags, opt);
 		break;
 
 	case BT_PKT_STATUS:
@@ -1988,10 +1985,7 @@ static int iso_sock_setsockopt(struct socket *sock, int level, int optname,
 		if (err)
 			break;
 
-		if (opt)
-			set_bit(BT_SK_PKT_STATUS, &bt_sk(sk)->flags);
-		else
-			clear_bit(BT_SK_PKT_STATUS, &bt_sk(sk)->flags);
+		assign_bit(BT_SK_PKT_STATUS, &bt_sk(sk)->flags, opt);
 		break;
 
 	case BT_PKT_SEQNUM:
@@ -1999,10 +1993,7 @@ static int iso_sock_setsockopt(struct socket *sock, int level, int optname,
 		if (err)
 			break;
 
-		if (opt)
-			set_bit(BT_SK_PKT_SEQNUM, &bt_sk(sk)->flags);
-		else
-			clear_bit(BT_SK_PKT_SEQNUM, &bt_sk(sk)->flags);
+		assign_bit(BT_SK_PKT_SEQNUM, &bt_sk(sk)->flags, opt);
 		break;
 
 	case BT_ISO_QOS:
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 1796929f61b86..47b0f8886fd11 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -871,15 +871,11 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname,
 		if (opt & L2CAP_LM_SECURE)
 			chan->sec_level = BT_SECURITY_HIGH;
 
-		if (opt & L2CAP_LM_MASTER)
-			set_bit(FLAG_ROLE_SWITCH, &chan->flags);
-		else
-			clear_bit(FLAG_ROLE_SWITCH, &chan->flags);
+		assign_bit(FLAG_ROLE_SWITCH, &chan->flags,
+			   opt & L2CAP_LM_MASTER);
 
-		if (opt & L2CAP_LM_RELIABLE)
-			set_bit(FLAG_FORCE_RELIABLE, &chan->flags);
-		else
-			clear_bit(FLAG_FORCE_RELIABLE, &chan->flags);
+		assign_bit(FLAG_FORCE_RELIABLE, &chan->flags,
+			   opt & L2CAP_LM_RELIABLE);
 		break;
 
 	default:
@@ -1046,10 +1042,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
 			}
 		}
 
-		if (opt)
-			set_bit(FLAG_FLUSHABLE, &chan->flags);
-		else
-			clear_bit(FLAG_FLUSHABLE, &chan->flags);
+		assign_bit(FLAG_FLUSHABLE, &chan->flags, opt);
 		break;
 
 	case BT_POWER:
@@ -1065,10 +1058,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
 		if (err)
 			break;
 
-		if (pwr.force_active)
-			set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
-		else
-			clear_bit(FLAG_FORCE_ACTIVE, &chan->flags);
+		assign_bit(FLAG_FORCE_ACTIVE, &chan->flags, pwr.force_active);
 		break;
 
 	case BT_CHANNEL_POLICY:
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 54ec1136f87ea..8a4205347c4ac 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1740,10 +1740,8 @@ static int rfcomm_recv_msc(struct rfcomm_session *s, int cr, struct sk_buff *skb
 		return 0;
 
 	if (cr) {
-		if (msc->v24_sig & RFCOMM_V24_FC && !d->cfc)
-			set_bit(RFCOMM_TX_THROTTLED, &d->flags);
-		else
-			clear_bit(RFCOMM_TX_THROTTLED, &d->flags);
+		assign_bit(RFCOMM_TX_THROTTLED, &d->flags,
+			   msc->v24_sig & RFCOMM_V24_FC && !d->cfc);
 
 		rfcomm_dlc_lock(d);
 
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index b26918dc9e9e9..3fb8b54749482 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -724,10 +724,7 @@ static int rfcomm_sock_setsockopt(struct socket *sock, int level, int optname,
 		if (err)
 			break;
 
-		if (opt)
-			set_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
-		else
-			clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
+		assign_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags, opt);
 
 		break;
 
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index f4a20d7b5f9cb..8be48ca9f4c5b 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -1037,10 +1037,7 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname,
 		if (err)
 			break;
 
-		if (opt)
-			set_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
-		else
-			clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
+		assign_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags, opt);
 		break;
 
 	case BT_VOICE:
@@ -1080,10 +1077,7 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname,
 		if (err)
 			break;
 
-		if (opt)
-			set_bit(BT_SK_PKT_STATUS, &bt_sk(sk)->flags);
-		else
-			clear_bit(BT_SK_PKT_STATUS, &bt_sk(sk)->flags);
+		assign_bit(BT_SK_PKT_STATUS, &bt_sk(sk)->flags, opt);
 		break;
 
 	case BT_CODEC:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0195/1005] Bluetooth: MGMT: Add management security level changed event
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (193 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0194/1005] Bluetooth: use assign_bit() where applicable Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0196/1005] Bluetooth: hci_core: Convert hci_conn flags to a bitmap Greg Kroah-Hartman
                   ` (178 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Frédéric Danis,
	Luiz Augusto von Dentz, Sasha Levin

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

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

From: Frédéric Danis <frederic.danis@collabora.com>

[ Upstream commit 1b723bd2945df4c75d7a4a4525660704ef8f4df8 ]

Add an event on device security level or encryption type change to
let user space know which level is currently in use.
Reset security level to 0 on disconnection so further connections
will correctly report security level changes.

This will be used for BlueZ qualification automation.

Assisted-by: GPT:GPT-5.3-Codex
Assisted-by: Copilot:claude-sonnet-5
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 5d005ded2cb1 ("Bluetooth: L2CAP: Hold incoming data until encryption key size is known")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/bluetooth/hci_core.h |  18 +++--
 include/net/bluetooth/mgmt.h     |  14 ++++
 net/bluetooth/hci_conn.c         |  28 ++++++++
 net/bluetooth/hci_event.c        | 118 +++++++++++++++++++++++++++++--
 net/bluetooth/mgmt.c             |  66 ++++++++++++++++-
 5 files changed, 232 insertions(+), 12 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index fa2a367731b5e..5b71b4eac92f5 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2208,6 +2208,8 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
 		conn->security_cfm_cb(conn, status);
 }
 
+void mgmt_security_level_changed(struct hci_conn *conn);
+
 static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status)
 {
 	struct hci_cb *cb;
@@ -2230,11 +2232,19 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status)
 		encrypt = 0x01;
 
 	if (!status) {
-		if (conn->sec_level == BT_SECURITY_SDP)
+		/* Callers either set conn->sec_level = conn->pending_sec_level
+		 * unconditionally before calling this function, or never
+		 * reach here with status == 0 (e.g. conn->state == BT_CONFIG
+		 * returns early above, or status is actually an error).  So
+		 * conn->pending_sec_level is never greater than
+		 * conn->sec_level at this point; only the initial
+		 * BT_SECURITY_SDP -> BT_SECURITY_LOW bump can still happen
+		 * here.
+		 */
+		if (conn->sec_level == BT_SECURITY_SDP) {
 			conn->sec_level = BT_SECURITY_LOW;
-
-		if (conn->pending_sec_level > conn->sec_level)
-			conn->sec_level = conn->pending_sec_level;
+			mgmt_security_level_changed(conn);
+		}
 	}
 
 	mutex_lock(&hci_cb_list_lock);
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 1e22eab1081cc..b02e915bb44cd 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -1221,3 +1221,17 @@ struct mgmt_ev_conn_subrate {
 	__le16	cont_num;
 	__le16	supv_timeout;
 } __packed;
+
+#define MGMT_CONN_SEC_ENCRYPT_NONE		0x00
+#define MGMT_CONN_SEC_ENCRYPT_E0		0x01
+#define MGMT_CONN_SEC_ENCRYPT_AES_CCM		0x02
+
+#define MGMT_SEC_LEVEL_CHANGED_PARAM_LEVEL	0x0000
+#define MGMT_SEC_LEVEL_CHANGED_PARAM_ENC_TYPE	0x0001
+
+#define MGMT_EV_SECURITY_LEVEL_CHANGED		0x0034
+struct mgmt_ev_security_level_changed {
+	struct mgmt_addr_info addr;
+	__u8	tlv_length;
+	__u8	tlv_data[] __counted_by(tlv_length);
+} __packed;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 8f136f28b7d68..5de95408e6e30 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1233,6 +1233,29 @@ static void hci_conn_unlink(struct hci_conn *conn)
 	if (!conn->parent) {
 		struct hci_link *link, *t;
 
+		conn->sec_level = BT_SECURITY_SDP;
+		clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
+		clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+		/* mgmt_security_level_changed() reports the reset only if
+		 * this connection was actually reported to userspace as
+		 * connected (it checks HCI_CONN_MGMT_CONNECTED itself), so it
+		 * must be called before the flag is cleared below.
+		 * Callers that already know whether the connection was
+		 * mgmt-connected (e.g. disconnect event handlers) only peek
+		 * at the flag, so it is still set here; this is the place
+		 * actually clearing it.
+		 *
+		 * Skip the report if hdev is down: this means
+		 * hci_dev_close_sync()/hci_conn_hash_flush() is in progress
+		 * and no MGMT_EV_DEVICE_DISCONNECTED was ever sent for this
+		 * connection, so sending a security level reset here would
+		 * be a spurious, order-less event; the adapter-wide powered
+		 * off notification is enough for userspace to reset state.
+		 */
+		if (test_bit(HCI_UP, &hdev->flags))
+			mgmt_security_level_changed(conn);
+		clear_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
+
 		list_for_each_entry_safe(link, t, &conn->link_list, list) {
 			struct hci_conn *child = link->conn;
 
@@ -1543,6 +1566,11 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
 		conn->pending_sec_level = sec_level;
 	}
 
+	/* Do not report the security level here: conn->dst may still hold
+	 * the peer's RPA instead of its identity address, and the connection
+	 * is not established yet. le_conn_complete_evt() reports it once the
+	 * connection completes and the identity address has been resolved.
+	 */
 	conn->sec_level = BT_SECURITY_LOW;
 	conn->conn_timeout = conn_timeout;
 	conn->le_adv_phy = phy;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 1962dccabbef1..8230fb706ffb3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -732,6 +732,14 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data,
 		bt_dev_err(hdev, "failed to read key size for handle %u",
 			   handle);
 		conn->enc_key_size = 0;
+		clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
+		clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+		/* Downgrade to reflect the connection no longer being
+		 * encrypted, instead of advertising a stale elevated
+		 * security level alongside MGMT_CONN_SEC_ENCRYPT_NONE.
+		 */
+		if (conn->sec_level > BT_SECURITY_LOW)
+			conn->sec_level = BT_SECURITY_LOW;
 	} else {
 		u8 *key_enc_size = hci_conn_key_enc_size(conn);
 
@@ -755,6 +763,25 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data,
 			status = HCI_ERROR_AUTH_FAILURE;
 			clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
 			clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+			/* Downgrade to reflect the connection no longer being
+			 * encrypted, instead of advertising a stale elevated
+			 * security level alongside MGMT_CONN_SEC_ENCRYPT_NONE.
+			 */
+			if (conn->sec_level > BT_SECURITY_LOW)
+				conn->sec_level = BT_SECURITY_LOW;
+		} else {
+			/* Pre-apply hci_encrypt_cfm()'s own upgrade rules
+			 * here unconditionally on success, so its internal
+			 * change check below always finds nothing new: this
+			 * function remains the sole place deciding whether
+			 * and when to report the change, regardless of
+			 * whether the caller already touched conn->sec_level
+			 * (e.g. hci_encrypt_change_evt()) or not.
+			 */
+			if (conn->sec_level == BT_SECURITY_SDP)
+				conn->sec_level = BT_SECURITY_LOW;
+			if (conn->pending_sec_level > conn->sec_level)
+				conn->sec_level = conn->pending_sec_level;
 		}
 
 		/* Update the key encryption size with the connection one */
@@ -764,6 +791,13 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data,
 
 	hci_encrypt_cfm(conn, status);
 
+	/* mgmt_security_level_changed() only reports the change for
+	 * connections already announced to userspace (it checks
+	 * HCI_CONN_MGMT_CONNECTED itself); otherwise it is a no-op here and
+	 * reporting is deferred to mgmt_device_connected().
+	 */
+	mgmt_security_level_changed(conn);
+
 done:
 	hci_dev_unlock(hdev);
 
@@ -2786,7 +2820,11 @@ static void hci_cs_disconnect(struct hci_dev *hdev, u8 status)
 	if (hdev->suspended)
 		conn->state = BT_CLOSED;
 
-	mgmt_conn = test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
+	/* Only peek at the flag here: hci_conn_del() (via hci_conn_unlink())
+	 * still needs it set to know whether to report the security level
+	 * reset, so it is consumed there instead of here.
+	 */
+	mgmt_conn = test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
 
 	if (conn->type == ACL_LINK) {
 		if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, &conn->flags))
@@ -3407,6 +3445,16 @@ static void hci_conn_request_evt(struct hci_dev *hdev, void *data,
 			bt_dev_err(hdev, "connection err: %ld", PTR_ERR(conn));
 			goto unlock;
 		}
+
+		/* Unlike outgoing BR/EDR connections, conn->sec_level is not
+		 * set at connection request time for incoming connections,
+		 * so it is still at its zero-initialized value
+		 * (BT_SECURITY_SDP) here. Set it to BT_SECURITY_LOW so
+		 * mgmt_device_connected() later reports the correct initial
+		 * security level instead of a transient, never-really-in-use
+		 * SDP value.
+		 */
+		conn->sec_level = BT_SECURITY_LOW;
 	}
 
 	memcpy(conn->dev_class, ev->dev_class, 3);
@@ -3473,7 +3521,11 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,
 
 	conn->state = BT_CLOSED;
 
-	mgmt_connected = test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
+	/* Only peek at the flag here: hci_conn_del() (via hci_conn_unlink())
+	 * still needs it set to know whether to report the security level
+	 * reset, so it is consumed there instead of here.
+	 */
+	mgmt_connected = test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
 
 	if (test_bit(HCI_CONN_AUTH_FAILURE, &conn->flags))
 		reason = MGMT_DEV_DISCONN_AUTH_FAILURE;
@@ -3557,6 +3609,15 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
 	if (!ev->status) {
 		clear_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
 		set_bit(HCI_CONN_AUTH, &conn->flags);
+		/* Authentication alone does not imply encryption: for SSP
+		 * capable devices, encryption is only requested below, and
+		 * for legacy devices it is requested by a separate
+		 * HCI_OP_SET_CONN_ENCRYPT command. Do not report the new
+		 * security level yet, to avoid userspace seeing an elevated
+		 * level alongside no encryption; hci_encrypt_change_evt()
+		 * (possibly via hci_cc_read_enc_key_size() for ACL links)
+		 * reports it once encryption is actually confirmed.
+		 */
 		conn->sec_level = conn->pending_sec_level;
 	} else {
 		if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING)
@@ -3673,9 +3734,28 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
 			if ((conn->type == ACL_LINK && ev->encrypt == 0x02) ||
 			    conn->type == LE_LINK)
 				set_bit(HCI_CONN_AES_CCM, &conn->flags);
+
+			/* For ACL links the encryption key size is still
+			 * validated below via hci_read_enc_key_size(). Its
+			 * completion handler, hci_cc_read_enc_key_size(),
+			 * reports the final security level so userspace does
+			 * not see a transient "encrypted" state that a
+			 * key-size downgrade would immediately invalidate.
+			 */
+			if (conn->type != ACL_LINK)
+				mgmt_security_level_changed(conn);
 		} else {
 			clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
 			clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+			/* Elevated security levels (MEDIUM and above) require
+			 * encryption, so downgrade to reflect the connection
+			 * no longer being encrypted before reporting, instead
+			 * of advertising a stale elevated level alongside
+			 * MGMT_CONN_SEC_ENCRYPT_NONE.
+			 */
+			if (conn->sec_level > BT_SECURITY_LOW)
+				conn->sec_level = BT_SECURITY_LOW;
+			mgmt_security_level_changed(conn);
 		}
 	}
 
@@ -3708,8 +3788,14 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
 
 	/* Try reading the encryption key size for encrypted ACL links */
 	if (!ev->status && ev->encrypt && conn->type == ACL_LINK) {
-		if (hci_read_enc_key_size(hdev, conn))
+		if (hci_read_enc_key_size(hdev, conn)) {
+			/* Could not even issue the key-size read: report the
+			 * security level now since hci_cc_read_enc_key_size()
+			 * will not run to do it.
+			 */
+			mgmt_security_level_changed(conn);
 			goto notify;
+		}
 
 		goto unlock;
 	}
@@ -5275,8 +5361,14 @@ static void hci_key_refresh_complete_evt(struct hci_dev *hdev, void *data,
 	if (conn->type != LE_LINK)
 		goto unlock;
 
-	if (!ev->status)
+	if (!ev->status) {
+		bool sec_level_changed =
+				conn->sec_level != conn->pending_sec_level;
+
 		conn->sec_level = conn->pending_sec_level;
+		if (sec_level_changed)
+			mgmt_security_level_changed(conn);
+	}
 
 	clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
 
@@ -5905,9 +5997,16 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
 		goto unlock;
 	}
 
+	/* Unlike outgoing BR/EDR connections, conn->sec_level is not set at
+	 * connection request time for LE, so it is still at its
+	 * zero-initialized value (BT_SECURITY_SDP) here. Set it to
+	 * BT_SECURITY_LOW before reporting the connection so
+	 * mgmt_device_connected() reports the correct initial security level
+	 * instead of a transient, never-really-in-use SDP value.
+	 */
+	conn->sec_level = BT_SECURITY_LOW;
 	mgmt_device_connected(hdev, conn, NULL, 0);
 
-	conn->sec_level = BT_SECURITY_LOW;
 	conn->state = BT_CONFIG;
 
 	/* Store current advertising instance as connection advertising instance
@@ -7380,8 +7479,13 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data,
 						     BT_CONNECTED,
 						     HCI_ROLE_SLAVE))) {
 		if (!mgmt_conn) {
-			mgmt_conn = test_and_clear_bit(HCI_CONN_MGMT_CONNECTED,
-						       &bis->flags);
+			/* Only peek at the flag here: hci_conn_del() (via
+			 * hci_conn_unlink()) still needs it set to know
+			 * whether to report the security level reset, so
+			 * it is consumed there instead of here.
+			 */
+			mgmt_conn = test_bit(HCI_CONN_MGMT_CONNECTED,
+					     &bis->flags);
 			mgmt_device_disconnected(hdev, &bis->dst, bis->type,
 						 bis->dst_type, ev->reason,
 						 mgmt_conn);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 11f01b8d53f80..c9e93393ff826 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -177,6 +177,7 @@ static const u16 mgmt_events[] = {
 	MGMT_EV_CONTROLLER_RESUME,
 	MGMT_EV_ADV_MONITOR_DEVICE_FOUND,
 	MGMT_EV_ADV_MONITOR_DEVICE_LOST,
+	MGMT_EV_SECURITY_LEVEL_CHANGED,
 };
 
 static const u16 mgmt_untrusted_commands[] = {
@@ -10158,6 +10159,14 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
 	ev->eir_len = cpu_to_le16(eir_len);
 
 	mgmt_event_skb(skb, NULL);
+
+	/* Connections that negotiated encryption as part of setup (e.g. via
+	 * an existing link key) had their security level change suppressed
+	 * since userspace did not know about them yet, so report it now.
+	 * Unencrypted connections have no change to report.
+	 */
+	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+		mgmt_security_level_changed(conn);
 }
 
 static void unpair_device_rsp(struct mgmt_pending_cmd *cmd, void *data)
@@ -10264,7 +10273,11 @@ void mgmt_connect_failed(struct hci_dev *hdev, struct hci_conn *conn, u8 status)
 {
 	struct mgmt_ev_connect_failed ev;
 
-	if (test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
+	/* Only peek at the flag here: hci_conn_del() (via hci_conn_unlink())
+	 * still needs it set to know whether to report the security level
+	 * reset, so it is consumed there instead of here.
+	 */
+	if (test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
 		mgmt_device_disconnected(hdev, &conn->dst, conn->type,
 					 conn->dst_type,
 					 hci_to_mgmt_reason(status), true);
@@ -10898,6 +10911,57 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 	mgmt_adv_monitor_device_found(hdev, bdaddr, report_device, skb, NULL);
 }
 
+void mgmt_security_level_changed(struct hci_conn *conn)
+{
+	struct mgmt_ev_security_level_changed *ev;
+	struct mgmt_tlv *tlv;
+	u8 *tlv_data;
+	u8 tlv_len;
+
+	if (!test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
+		return;
+
+	/* Only ACL, LE and BIS links are tracked as mgmt connections, so
+	 * restrict the event to those link types. Other transports (SCO,
+	 * CIS, PA sync, ...) share the parent's address and would otherwise
+	 * report a spurious security level change for it.
+	 */
+	if (conn->type != ACL_LINK && conn->type != LE_LINK &&
+	    conn->type != BIS_LINK)
+		return;
+
+	tlv_len = 2 * (sizeof(*tlv) + sizeof(__u8));
+	ev = kzalloc_flex(*ev, tlv_data, tlv_len, GFP_KERNEL);
+	if (!ev)
+		return;
+
+	bacpy(&ev->addr.bdaddr, &conn->dst);
+	ev->addr.type = link_to_bdaddr(conn->type, conn->dst_type);
+	ev->tlv_length = tlv_len;
+
+	tlv_data = ev->tlv_data;
+	tlv = (void *)tlv_data;
+	tlv->type = cpu_to_le16(MGMT_SEC_LEVEL_CHANGED_PARAM_LEVEL);
+	tlv->length = sizeof(__u8);
+	tlv->value[0] = conn->sec_level;
+
+	tlv_data += sizeof(*tlv) + sizeof(__u8);
+	tlv = (void *)tlv_data;
+	tlv->type = cpu_to_le16(MGMT_SEC_LEVEL_CHANGED_PARAM_ENC_TYPE);
+	tlv->length = sizeof(__u8);
+	if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+		tlv->value[0] = MGMT_CONN_SEC_ENCRYPT_NONE;
+	else if (test_bit(HCI_CONN_AES_CCM, &conn->flags))
+		tlv->value[0] = MGMT_CONN_SEC_ENCRYPT_AES_CCM;
+	else
+		tlv->value[0] = MGMT_CONN_SEC_ENCRYPT_E0;
+
+	mgmt_event(MGMT_EV_SECURITY_LEVEL_CHANGED, conn->hdev, ev,
+		   struct_size(ev, tlv_data, tlv_len), NULL);
+
+	kfree(ev);
+}
+
 void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 		      u8 addr_type, s8 rssi, u8 *name, u8 name_len)
 {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0196/1005] Bluetooth: hci_core: Convert hci_conn flags to a bitmap
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (194 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0195/1005] Bluetooth: MGMT: Add management security level changed event Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0197/1005] Bluetooth: L2CAP: Hold incoming data until encryption key size is known Greg Kroah-Hartman
                   ` (177 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin

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

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

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

[ Upstream commit 1eebde8ecede18e351ccf438f17b53d3b62a75a9 ]

struct hci_conn stores its flags in a single unsigned long, but the
HCI_CONN_* enum already has 33 entries (up to HCI_CONN_PA_SYNC_FAILED
= 32), so on 32-bit architectures set_bit()/test_bit() on the highest
flags access memory past the flags field, aliasing the adjacent
conn_reason field.

Fix this by declaring flags with DECLARE_BITMAP() sized by a new
__HCI_CONN_NUM_FLAGS terminator so it can accommodate any number of
flags.

Assisted-by: OpenCode:claude-opus-5.5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 5d005ded2cb1 ("Bluetooth: L2CAP: Hold incoming data until encryption key size is known")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/bluetooth/hci_core.h | 101 ++++++++++----------
 net/bluetooth/hci_conn.c         |  87 +++++++++---------
 net/bluetooth/hci_event.c        | 152 +++++++++++++++----------------
 net/bluetooth/hci_sync.c         |  36 ++++----
 net/bluetooth/iso.c              |  20 ++--
 net/bluetooth/l2cap_core.c       |   2 +-
 net/bluetooth/mgmt.c             |  20 ++--
 net/bluetooth/smp.c              |  24 ++---
 8 files changed, 221 insertions(+), 221 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 5b71b4eac92f5..75633476266cb 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -677,6 +677,44 @@ enum conn_reasons {
 	CONN_REASON_ISO_CONNECT,
 };
 
+enum {
+	HCI_CONN_AUTH_PEND,
+	HCI_CONN_ENCRYPT_PEND,
+	HCI_CONN_RSWITCH_PEND,
+	HCI_CONN_MODE_CHANGE_PEND,
+	HCI_CONN_SCO_SETUP_PEND,
+	HCI_CONN_MGMT_CONNECTED,
+	HCI_CONN_SSP_ENABLED,
+	HCI_CONN_SC_ENABLED,
+	HCI_CONN_AES_CCM,
+	HCI_CONN_POWER_SAVE,
+	HCI_CONN_FLUSH_KEY,
+	HCI_CONN_ENCRYPT,
+	HCI_CONN_AUTH,
+	HCI_CONN_SECURE,
+	HCI_CONN_FIPS,
+	HCI_CONN_STK_ENCRYPT,
+	HCI_CONN_AUTH_INITIATOR,
+	HCI_CONN_DROP,
+	HCI_CONN_CANCEL,
+	HCI_CONN_PARAM_REMOVAL_PEND,
+	HCI_CONN_NEW_LINK_KEY,
+	HCI_CONN_SCANNING,
+	HCI_CONN_AUTH_FAILURE,
+	HCI_CONN_PER_ADV,
+	HCI_CONN_BIG_CREATED,
+	HCI_CONN_CREATE,
+	HCI_CONN_CREATE_CIS,
+	HCI_CONN_CREATE_BIG_SYNC,
+	HCI_CONN_BIG_SYNC,
+	HCI_CONN_BIG_SYNC_FAILED,
+	HCI_CONN_CREATE_PA_SYNC,
+	HCI_CONN_PA_SYNC,
+	HCI_CONN_PA_SYNC_FAILED,
+
+	__HCI_CONN_NUM_FLAGS,
+};
+
 struct hci_conn {
 	struct list_head list;
 
@@ -747,7 +785,7 @@ struct hci_conn {
 	__u8		num_bis;
 	__u8		bis[HCI_MAX_ISO_BIS];
 
-	unsigned long	flags;
+	DECLARE_BITMAP(flags, __HCI_CONN_NUM_FLAGS);
 
 	enum conn_reasons conn_reason;
 	__u8		abort_reason;
@@ -977,55 +1015,18 @@ u32 hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data,
 			     bool name_known);
 void hci_inquiry_cache_flush(struct hci_dev *hdev);
 
-/* ----- HCI Connections ----- */
-enum {
-	HCI_CONN_AUTH_PEND,
-	HCI_CONN_ENCRYPT_PEND,
-	HCI_CONN_RSWITCH_PEND,
-	HCI_CONN_MODE_CHANGE_PEND,
-	HCI_CONN_SCO_SETUP_PEND,
-	HCI_CONN_MGMT_CONNECTED,
-	HCI_CONN_SSP_ENABLED,
-	HCI_CONN_SC_ENABLED,
-	HCI_CONN_AES_CCM,
-	HCI_CONN_POWER_SAVE,
-	HCI_CONN_FLUSH_KEY,
-	HCI_CONN_ENCRYPT,
-	HCI_CONN_AUTH,
-	HCI_CONN_SECURE,
-	HCI_CONN_FIPS,
-	HCI_CONN_STK_ENCRYPT,
-	HCI_CONN_AUTH_INITIATOR,
-	HCI_CONN_DROP,
-	HCI_CONN_CANCEL,
-	HCI_CONN_PARAM_REMOVAL_PEND,
-	HCI_CONN_NEW_LINK_KEY,
-	HCI_CONN_SCANNING,
-	HCI_CONN_AUTH_FAILURE,
-	HCI_CONN_PER_ADV,
-	HCI_CONN_BIG_CREATED,
-	HCI_CONN_CREATE,
-	HCI_CONN_CREATE_CIS,
-	HCI_CONN_CREATE_BIG_SYNC,
-	HCI_CONN_BIG_SYNC,
-	HCI_CONN_BIG_SYNC_FAILED,
-	HCI_CONN_CREATE_PA_SYNC,
-	HCI_CONN_PA_SYNC,
-	HCI_CONN_PA_SYNC_FAILED,
-};
-
 static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
 {
 	struct hci_dev *hdev = conn->hdev;
 	return hci_dev_test_flag(hdev, HCI_SSP_ENABLED) &&
-	       test_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
+	       test_bit(HCI_CONN_SSP_ENABLED, conn->flags);
 }
 
 static inline bool hci_conn_sc_enabled(struct hci_conn *conn)
 {
 	struct hci_dev *hdev = conn->hdev;
 	return hci_dev_test_flag(hdev, HCI_SC_ENABLED) &&
-	       test_bit(HCI_CONN_SC_ENABLED, &conn->flags);
+	       test_bit(HCI_CONN_SC_ENABLED, conn->flags);
 }
 
 static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
@@ -1198,7 +1199,7 @@ hci_conn_hash_lookup_create_pa_sync(struct hci_dev *hdev)
 		if (c->type != PA_LINK)
 			continue;
 
-		if (!test_bit(HCI_CONN_CREATE_PA_SYNC, &c->flags))
+		if (!test_bit(HCI_CONN_CREATE_PA_SYNC, c->flags))
 			continue;
 
 		rcu_read_unlock();
@@ -1222,7 +1223,7 @@ hci_conn_hash_lookup_per_adv_bis(struct hci_dev *hdev,
 
 	list_for_each_entry_rcu(c, &h->list, list) {
 		if (bacmp(&c->dst, ba) || c->type != BIS_LINK ||
-		    !test_bit(HCI_CONN_PER_ADV, &c->flags))
+		    !test_bit(HCI_CONN_PER_ADV, c->flags))
 			continue;
 
 		if (c->iso_qos.bcast.big == big &&
@@ -1459,7 +1460,7 @@ hci_conn_hash_lookup_pa_sync_big_handle(struct hci_dev *hdev, __u8 big)
 
 	list_for_each_entry_rcu(c, &h->list, list) {
 		if (c->type != BIS_LINK ||
-		    !test_bit(HCI_CONN_PA_SYNC, &c->flags))
+		    !test_bit(HCI_CONN_PA_SYNC, c->flags))
 			continue;
 
 		if (c->iso_qos.bcast.big == big) {
@@ -1535,7 +1536,7 @@ static inline void hci_conn_hash_list_flag(struct hci_dev *hdev,
 	rcu_read_lock();
 
 	list_for_each_entry_rcu(c, &h->list, list) {
-		if (c->type == type && test_bit(flag, &c->flags))
+		if (c->type == type && test_bit(flag, c->flags))
 			func(c, data);
 	}
 
@@ -1551,7 +1552,7 @@ static inline struct hci_conn *hci_lookup_le_connect(struct hci_dev *hdev)
 
 	list_for_each_entry_rcu(c, &h->list, list) {
 		if (c->type == LE_LINK && c->state == BT_CONNECT &&
-		    !test_bit(HCI_CONN_SCANNING, &c->flags)) {
+		    !test_bit(HCI_CONN_SCANNING, c->flags)) {
 			rcu_read_unlock();
 			return c;
 		}
@@ -1572,7 +1573,7 @@ static inline bool hci_is_le_conn_scanning(struct hci_dev *hdev)
 
 	list_for_each_entry_rcu(c, &h->list, list) {
 		if (c->type == LE_LINK && c->state == BT_CONNECT &&
-		    test_bit(HCI_CONN_SCANNING, &c->flags)) {
+		    test_bit(HCI_CONN_SCANNING, c->flags)) {
 			rcu_read_unlock();
 			return true;
 		}
@@ -2192,10 +2193,10 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
 	struct hci_cb *cb;
 	__u8 encrypt;
 
-	if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags))
+	if (test_bit(HCI_CONN_ENCRYPT_PEND, conn->flags))
 		return;
 
-	encrypt = test_bit(HCI_CONN_ENCRYPT, &conn->flags) ? 0x01 : 0x00;
+	encrypt = test_bit(HCI_CONN_ENCRYPT, conn->flags) ? 0x01 : 0x00;
 
 	mutex_lock(&hci_cb_list_lock);
 	list_for_each_entry(cb, &hci_cb_list, list) {
@@ -2224,9 +2225,9 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status)
 		return;
 	}
 
-	if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+	if (!test_bit(HCI_CONN_ENCRYPT, conn->flags))
 		encrypt = 0x00;
-	else if (test_bit(HCI_CONN_AES_CCM, &conn->flags))
+	else if (test_bit(HCI_CONN_AES_CCM, conn->flags))
 		encrypt = 0x02;
 	else
 		encrypt = 0x01;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 5de95408e6e30..b007f623b2ecc 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -138,10 +138,10 @@ static void hci_conn_cleanup(struct hci_conn *conn)
 {
 	struct hci_dev *hdev = conn->hdev;
 
-	if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags))
+	if (test_bit(HCI_CONN_PARAM_REMOVAL_PEND, conn->flags))
 		hci_conn_params_del(conn->hdev, &conn->dst, conn->dst_type);
 
-	if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, &conn->flags))
+	if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, conn->flags))
 		hci_remove_link_key(hdev, &conn->dst);
 
 	hci_chan_list_flush(conn);
@@ -685,7 +685,7 @@ static void hci_conn_idle(struct work_struct *work)
 		hci_send_cmd(hdev, HCI_OP_SNIFF_SUBRATE, sizeof(cp), &cp);
 	}
 
-	if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags)) {
+	if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, conn->flags)) {
 		struct hci_cp_sniff_mode cp;
 		cp.handle       = cpu_to_le16(conn->handle);
 		cp.max_interval = cpu_to_le16(hdev->sniff_max_interval);
@@ -814,7 +814,7 @@ static int hci_le_terminate_big(struct hci_dev *hdev, struct hci_conn *conn)
 
 	d->big = conn->iso_qos.bcast.big;
 	d->bis = conn->iso_qos.bcast.bis;
-	d->big_term = test_and_clear_bit(HCI_CONN_BIG_CREATED, &conn->flags);
+	d->big_term = test_and_clear_bit(HCI_CONN_BIG_CREATED, conn->flags);
 
 	ret = hci_cmd_sync_queue(hdev, terminate_big_sync, d,
 				 terminate_big_destroy);
@@ -867,7 +867,7 @@ static int hci_le_big_terminate(struct hci_dev *hdev, struct hci_conn *conn)
 	d->sync_handle = conn->sync_handle;
 
 	if (conn->type == PA_LINK &&
-	    test_and_clear_bit(HCI_CONN_PA_SYNC, &conn->flags)) {
+	    test_and_clear_bit(HCI_CONN_PA_SYNC, conn->flags)) {
 		hci_conn_hash_list_flag(hdev, find_bis, PA_LINK,
 					HCI_CONN_PA_SYNC, d);
 
@@ -877,7 +877,7 @@ static int hci_le_big_terminate(struct hci_dev *hdev, struct hci_conn *conn)
 		d->count = 0;
 	}
 
-	if (test_and_clear_bit(HCI_CONN_BIG_SYNC, &conn->flags)) {
+	if (test_and_clear_bit(HCI_CONN_BIG_SYNC, conn->flags)) {
 		hci_conn_hash_list_flag(hdev, find_bis, BIS_LINK,
 					HCI_CONN_BIG_SYNC, d);
 
@@ -912,7 +912,7 @@ static void bis_cleanup(struct hci_conn *conn)
 	bt_dev_dbg(hdev, "conn %p", conn);
 
 	if (conn->role == HCI_ROLE_MASTER) {
-		if (!test_and_clear_bit(HCI_CONN_PER_ADV, &conn->flags))
+		if (!test_and_clear_bit(HCI_CONN_PER_ADV, conn->flags))
 			return;
 
 		/* Check if ISO connection is a BIS and terminate advertising
@@ -1087,7 +1087,7 @@ static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type,
 	conn->sync_handle = HCI_SYNC_HANDLE_INVALID;
 	conn->sid = HCI_SID_INVALID;
 
-	set_bit(HCI_CONN_POWER_SAVE, &conn->flags);
+	set_bit(HCI_CONN_POWER_SAVE, conn->flags);
 	conn->disc_timeout = HCI_DISCONN_TIMEOUT;
 
 	/* Set Default Authenticated payload timeout to 30s */
@@ -1217,8 +1217,8 @@ static void hci_conn_cleanup_child(struct hci_conn *conn, u8 reason)
 	case BIS_LINK:
 	case PA_LINK:
 		if ((conn->state != BT_CONNECTED &&
-		    !test_bit(HCI_CONN_CREATE_CIS, &conn->flags)) ||
-		    test_bit(HCI_CONN_BIG_CREATED, &conn->flags))
+		    !test_bit(HCI_CONN_CREATE_CIS, conn->flags)) ||
+		    test_bit(HCI_CONN_BIG_CREATED, conn->flags))
 			hci_conn_failed(conn, reason);
 		break;
 	}
@@ -1234,8 +1234,8 @@ static void hci_conn_unlink(struct hci_conn *conn)
 		struct hci_link *link, *t;
 
 		conn->sec_level = BT_SECURITY_SDP;
-		clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
-		clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+		clear_bit(HCI_CONN_ENCRYPT, conn->flags);
+		clear_bit(HCI_CONN_AES_CCM, conn->flags);
 		/* mgmt_security_level_changed() reports the reset only if
 		 * this connection was actually reported to userspace as
 		 * connected (it checks HCI_CONN_MGMT_CONNECTED itself), so it
@@ -1254,7 +1254,7 @@ static void hci_conn_unlink(struct hci_conn *conn)
 		 */
 		if (test_bit(HCI_UP, &hdev->flags))
 			mgmt_security_level_changed(conn);
-		clear_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
+		clear_bit(HCI_CONN_MGMT_CONNECTED, conn->flags);
 
 		list_for_each_entry_safe(link, t, &conn->link_list, list) {
 			struct hci_conn *child = link->conn;
@@ -1458,8 +1458,8 @@ void hci_conn_failed(struct hci_conn *conn, u8 status)
 	/* In case of BIG/PA sync failed, clear conn flags so that
 	 * the conns will be correctly cleaned up by ISO layer
 	 */
-	test_and_clear_bit(HCI_CONN_BIG_SYNC_FAILED, &conn->flags);
-	test_and_clear_bit(HCI_CONN_PA_SYNC_FAILED, &conn->flags);
+	test_and_clear_bit(HCI_CONN_BIG_SYNC_FAILED, conn->flags);
+	test_and_clear_bit(HCI_CONN_PA_SYNC_FAILED, conn->flags);
 
 	conn->state = BT_CLOSED;
 	hci_connect_cfm(conn, status);
@@ -1524,9 +1524,8 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
 	 * to connect.
 	 */
 	conn = hci_conn_hash_lookup_le(hdev, dst, dst_type);
-	if (conn && !test_bit(HCI_CONN_SCANNING, &conn->flags)) {
+	if (conn && !test_bit(HCI_CONN_SCANNING, conn->flags))
 		return ERR_PTR(-EBUSY);
-	}
 
 	/* Check if the destination address has been resolved by the controller
 	 * since if it did then the identity address shall be used.
@@ -1798,7 +1797,7 @@ struct hci_conn *hci_connect_le_scan(struct hci_dev *hdev, bdaddr_t *dst,
 	}
 
 	conn->state = BT_CONNECT;
-	set_bit(HCI_CONN_SCANNING, &conn->flags);
+	set_bit(HCI_CONN_SCANNING, conn->flags);
 	conn->sec_level = BT_SECURITY_LOW;
 	conn->pending_sec_level = sec_level;
 	conn->conn_timeout = conn_timeout;
@@ -1924,12 +1923,12 @@ struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
 
 	if (acl->state == BT_CONNECTED &&
 	    (sco->state == BT_OPEN || sco->state == BT_CLOSED)) {
-		set_bit(HCI_CONN_POWER_SAVE, &acl->flags);
+		set_bit(HCI_CONN_POWER_SAVE, acl->flags);
 		hci_conn_enter_active_mode(acl, BT_POWER_FORCE_ACTIVE_ON);
 
-		if (test_bit(HCI_CONN_MODE_CHANGE_PEND, &acl->flags)) {
+		if (test_bit(HCI_CONN_MODE_CHANGE_PEND, acl->flags)) {
 			/* defer SCO setup until mode change completed */
-			set_bit(HCI_CONN_SCO_SETUP_PEND, &acl->flags);
+			set_bit(HCI_CONN_SCO_SETUP_PEND, acl->flags);
 			return sco;
 		}
 
@@ -2221,7 +2220,7 @@ int hci_le_create_cis_pending(struct hci_dev *hdev)
 	rcu_read_lock();
 
 	list_for_each_entry_rcu(conn, &hdev->conn_hash.list, list) {
-		if (test_bit(HCI_CONN_CREATE_CIS, &conn->flags)) {
+		if (test_bit(HCI_CONN_CREATE_CIS, conn->flags)) {
 			rcu_read_unlock();
 			return -EBUSY;
 		}
@@ -2449,7 +2448,7 @@ static void bis_mark_per_adv(struct hci_conn *conn, void *data)
 	    d->bis != conn->iso_qos.bcast.bis)
 		return;
 
-	set_bit(HCI_CONN_PER_ADV, &conn->flags);
+	set_bit(HCI_CONN_PER_ADV, conn->flags);
 }
 
 struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
@@ -2569,7 +2568,7 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
 	 */
 	if (hci_dev_test_flag(conn->hdev, HCI_SC_ONLY)) {
 		if (!hci_conn_sc_enabled(conn) ||
-		    !test_bit(HCI_CONN_AES_CCM, &conn->flags) ||
+		    !test_bit(HCI_CONN_AES_CCM, conn->flags) ||
 		    conn->key_type != HCI_LK_AUTH_COMBINATION_P256)
 			return 0;
 	}
@@ -2585,14 +2584,14 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
 	  * not shortened)
 	  */
 	if (conn->sec_level == BT_SECURITY_FIPS &&
-	    !test_bit(HCI_CONN_AES_CCM, &conn->flags)) {
+	    !test_bit(HCI_CONN_AES_CCM, conn->flags)) {
 		bt_dev_err(conn->hdev,
 			   "Invalid security: Missing AES-CCM usage");
 		return 0;
 	}
 
 	if (hci_conn_ssp_enabled(conn) &&
-	    !test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+	    !test_bit(HCI_CONN_ENCRYPT, conn->flags))
 		return 0;
 
 	return 1;
@@ -2608,7 +2607,7 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
 
 	if (sec_level > conn->sec_level)
 		conn->pending_sec_level = sec_level;
-	else if (test_bit(HCI_CONN_AUTH, &conn->flags))
+	else if (test_bit(HCI_CONN_AUTH, conn->flags))
 		return 1;
 
 	/* Make sure we preserve an existing MITM requirement*/
@@ -2616,7 +2615,7 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
 
 	conn->auth_type = auth_type;
 
-	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
+	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, conn->flags)) {
 		struct hci_cp_auth_requested cp;
 
 		cp.handle = cpu_to_le16(conn->handle);
@@ -2626,8 +2625,8 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
 		/* Set the ENCRYPT_PEND to trigger encryption after
 		 * authentication.
 		 */
-		if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
-			set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
+		if (!test_bit(HCI_CONN_ENCRYPT, conn->flags))
+			set_bit(HCI_CONN_ENCRYPT_PEND, conn->flags);
 	}
 
 	return 0;
@@ -2638,7 +2637,7 @@ static void hci_conn_encrypt(struct hci_conn *conn)
 {
 	BT_DBG("hcon %p", conn);
 
-	if (!test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) {
+	if (!test_and_set_bit(HCI_CONN_ENCRYPT_PEND, conn->flags)) {
 		struct hci_cp_set_conn_encrypt cp;
 		cp.handle  = cpu_to_le16(conn->handle);
 		cp.encrypt = 0x01;
@@ -2666,7 +2665,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type,
 		return 1;
 
 	/* For other security levels we need the link key. */
-	if (!test_bit(HCI_CONN_AUTH, &conn->flags))
+	if (!test_bit(HCI_CONN_AUTH, conn->flags))
 		goto auth;
 
 	switch (conn->key_type) {
@@ -2706,17 +2705,17 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type,
 	}
 
 auth:
-	if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags))
+	if (test_bit(HCI_CONN_ENCRYPT_PEND, conn->flags))
 		return 0;
 
 	if (initiator)
-		set_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags);
+		set_bit(HCI_CONN_AUTH_INITIATOR, conn->flags);
 
 	if (!hci_conn_auth(conn, sec_level, auth_type))
 		return 0;
 
 encrypt:
-	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags)) {
+	if (test_bit(HCI_CONN_ENCRYPT, conn->flags)) {
 		/* Ensure that the encryption key size has been read,
 		 * otherwise stall the upper layer responses.
 		 */
@@ -2759,7 +2758,7 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8 role)
 	if (role == conn->role)
 		return 1;
 
-	if (!test_and_set_bit(HCI_CONN_RSWITCH_PEND, &conn->flags)) {
+	if (!test_and_set_bit(HCI_CONN_RSWITCH_PEND, conn->flags)) {
 		struct hci_cp_switch_role cp;
 		bacpy(&cp.bdaddr, &conn->dst);
 		cp.role = role;
@@ -2780,10 +2779,10 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
 	if (conn->mode != HCI_CM_SNIFF)
 		goto timer;
 
-	if (!test_bit(HCI_CONN_POWER_SAVE, &conn->flags) && !force_active)
+	if (!test_bit(HCI_CONN_POWER_SAVE, conn->flags) && !force_active)
 		goto timer;
 
-	if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags)) {
+	if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, conn->flags)) {
 		struct hci_cp_exit_sniff_mode cp;
 		cp.handle = cpu_to_le16(conn->handle);
 		hci_send_cmd(hdev, HCI_OP_EXIT_SNIFF_MODE, sizeof(cp), &cp);
@@ -2823,16 +2822,16 @@ static u32 get_link_mode(struct hci_conn *conn)
 	if (conn->role == HCI_ROLE_MASTER)
 		link_mode |= HCI_LM_MASTER;
 
-	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+	if (test_bit(HCI_CONN_ENCRYPT, conn->flags))
 		link_mode |= HCI_LM_ENCRYPT;
 
-	if (test_bit(HCI_CONN_AUTH, &conn->flags))
+	if (test_bit(HCI_CONN_AUTH, conn->flags))
 		link_mode |= HCI_LM_AUTH;
 
-	if (test_bit(HCI_CONN_SECURE, &conn->flags))
+	if (test_bit(HCI_CONN_SECURE, conn->flags))
 		link_mode |= HCI_LM_SECURE;
 
-	if (test_bit(HCI_CONN_FIPS, &conn->flags))
+	if (test_bit(HCI_CONN_FIPS, conn->flags))
 		link_mode |= HCI_LM_FIPS;
 
 	return link_mode;
@@ -2946,7 +2945,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn)
 
 	BT_DBG("%s hcon %p", hdev->name, conn);
 
-	if (test_bit(HCI_CONN_DROP, &conn->flags)) {
+	if (test_bit(HCI_CONN_DROP, conn->flags)) {
 		BT_DBG("Refusing to create new hci_chan");
 		return NULL;
 	}
@@ -2976,7 +2975,7 @@ void hci_chan_del(struct hci_chan *chan)
 	synchronize_rcu();
 
 	/* Prevent new hci_chan's to be created for this hci_conn */
-	set_bit(HCI_CONN_DROP, &conn->flags);
+	set_bit(HCI_CONN_DROP, conn->flags);
 
 	hci_conn_put(conn);
 
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 8230fb706ffb3..0e73f32c2682d 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -732,8 +732,8 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data,
 		bt_dev_err(hdev, "failed to read key size for handle %u",
 			   handle);
 		conn->enc_key_size = 0;
-		clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
-		clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+		clear_bit(HCI_CONN_ENCRYPT, conn->flags);
+		clear_bit(HCI_CONN_AES_CCM, conn->flags);
 		/* Downgrade to reflect the connection no longer being
 		 * encrypted, instead of advertising a stale elevated
 		 * security level alongside MGMT_CONN_SEC_ENCRYPT_NONE.
@@ -761,8 +761,8 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data,
 			 * state at a later time.
 			 */
 			status = HCI_ERROR_AUTH_FAILURE;
-			clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
-			clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+			clear_bit(HCI_CONN_ENCRYPT, conn->flags);
+			clear_bit(HCI_CONN_AES_CCM, conn->flags);
 			/* Downgrade to reflect the connection no longer being
 			 * encrypted, instead of advertising a stale elevated
 			 * security level alongside MGMT_CONN_SEC_ENCRYPT_NONE.
@@ -2595,10 +2595,10 @@ static void hci_cs_remote_name_req(struct hci_dev *hdev, __u8 status)
 	if (!hci_outgoing_auth_needed(hdev, conn))
 		goto unlock;
 
-	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
+	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, conn->flags)) {
 		struct hci_cp_auth_requested auth_cp;
 
-		set_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags);
+		set_bit(HCI_CONN_AUTH_INITIATOR, conn->flags);
 
 		auth_cp.handle = __cpu_to_le16(conn->handle);
 		hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED,
@@ -2738,9 +2738,9 @@ static void hci_cs_sniff_mode(struct hci_dev *hdev, __u8 status)
 
 	conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
 	if (conn) {
-		clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags);
+		clear_bit(HCI_CONN_MODE_CHANGE_PEND, conn->flags);
 
-		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->flags))
+		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, conn->flags))
 			hci_sco_setup(conn, status);
 	}
 
@@ -2765,9 +2765,9 @@ static void hci_cs_exit_sniff_mode(struct hci_dev *hdev, __u8 status)
 
 	conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
 	if (conn) {
-		clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags);
+		clear_bit(HCI_CONN_MODE_CHANGE_PEND, conn->flags);
 
-		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->flags))
+		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, conn->flags))
 			hci_sco_setup(conn, status);
 	}
 
@@ -2824,10 +2824,10 @@ static void hci_cs_disconnect(struct hci_dev *hdev, u8 status)
 	 * still needs it set to know whether to report the security level
 	 * reset, so it is consumed there instead of here.
 	 */
-	mgmt_conn = test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
+	mgmt_conn = test_bit(HCI_CONN_MGMT_CONNECTED, conn->flags);
 
 	if (conn->type == ACL_LINK) {
-		if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, &conn->flags))
+		if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, conn->flags))
 			hci_remove_link_key(hdev, &conn->dst);
 	}
 
@@ -3078,7 +3078,7 @@ static void hci_cs_switch_role(struct hci_dev *hdev, u8 status)
 
 	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
 	if (conn)
-		clear_bit(HCI_CONN_RSWITCH_PEND, &conn->flags);
+		clear_bit(HCI_CONN_RSWITCH_PEND, conn->flags);
 
 	hci_dev_unlock(hdev);
 }
@@ -3309,19 +3309,19 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, void *data,
 		hci_conn_add_sysfs(conn);
 
 		if (test_bit(HCI_AUTH, &hdev->flags))
-			set_bit(HCI_CONN_AUTH, &conn->flags);
+			set_bit(HCI_CONN_AUTH, conn->flags);
 
 		if (test_bit(HCI_ENCRYPT, &hdev->flags))
-			set_bit(HCI_CONN_ENCRYPT, &conn->flags);
+			set_bit(HCI_CONN_ENCRYPT, conn->flags);
 
 		/* "Link key request" completed ahead of "connect request" completes */
-		if (ev->encr_mode == 1 && !test_bit(HCI_CONN_ENCRYPT, &conn->flags) &&
+		if (ev->encr_mode == 1 && !test_bit(HCI_CONN_ENCRYPT, conn->flags) &&
 		    ev->link_type == ACL_LINK) {
 			struct link_key *key;
 
 			key = hci_find_link_key(hdev, &ev->bdaddr);
 			if (key) {
-				set_bit(HCI_CONN_ENCRYPT, &conn->flags);
+				set_bit(HCI_CONN_ENCRYPT, conn->flags);
 				hci_read_enc_key_size(hdev, conn);
 				hci_encrypt_cfm(conn, ev->status);
 			}
@@ -3525,9 +3525,9 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,
 	 * still needs it set to know whether to report the security level
 	 * reset, so it is consumed there instead of here.
 	 */
-	mgmt_connected = test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags);
+	mgmt_connected = test_bit(HCI_CONN_MGMT_CONNECTED, conn->flags);
 
-	if (test_bit(HCI_CONN_AUTH_FAILURE, &conn->flags))
+	if (test_bit(HCI_CONN_AUTH_FAILURE, conn->flags))
 		reason = MGMT_DEV_DISCONN_AUTH_FAILURE;
 	else
 		reason = hci_to_mgmt_reason(ev->reason);
@@ -3536,7 +3536,7 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,
 				reason, mgmt_connected);
 
 	if (conn->type == ACL_LINK) {
-		if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, &conn->flags))
+		if (test_and_clear_bit(HCI_CONN_FLUSH_KEY, conn->flags))
 			hci_remove_link_key(hdev, &conn->dst);
 
 		hci_update_scan(hdev);
@@ -3607,8 +3607,8 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 
 	if (!ev->status) {
-		clear_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
-		set_bit(HCI_CONN_AUTH, &conn->flags);
+		clear_bit(HCI_CONN_AUTH_FAILURE, conn->flags);
+		set_bit(HCI_CONN_AUTH, conn->flags);
 		/* Authentication alone does not imply encryption: for SSP
 		 * capable devices, encryption is only requested below, and
 		 * for legacy devices it is requested by a separate
@@ -3621,12 +3621,12 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
 		conn->sec_level = conn->pending_sec_level;
 	} else {
 		if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING)
-			set_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
+			set_bit(HCI_CONN_AUTH_FAILURE, conn->flags);
 
 		mgmt_auth_failed(conn, ev->status);
 	}
 
-	clear_bit(HCI_CONN_AUTH_PEND, &conn->flags);
+	clear_bit(HCI_CONN_AUTH_PEND, conn->flags);
 
 	if (conn->state == BT_CONFIG) {
 		if (!ev->status && hci_conn_ssp_enabled(conn)) {
@@ -3648,7 +3648,7 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
 		hci_conn_drop(conn);
 	}
 
-	if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) {
+	if (test_bit(HCI_CONN_ENCRYPT_PEND, conn->flags)) {
 		if (!ev->status) {
 			struct hci_cp_set_conn_encrypt cp;
 			cp.handle  = ev->handle;
@@ -3656,7 +3656,7 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
 			hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp),
 				     &cp);
 		} else {
-			clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
+			clear_bit(HCI_CONN_ENCRYPT_PEND, conn->flags);
 			hci_encrypt_cfm(conn, ev->status);
 		}
 	}
@@ -3693,10 +3693,10 @@ static void hci_remote_name_evt(struct hci_dev *hdev, void *data,
 	if (!hci_outgoing_auth_needed(hdev, conn))
 		goto unlock;
 
-	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
+	if (!test_and_set_bit(HCI_CONN_AUTH_PEND, conn->flags)) {
 		struct hci_cp_auth_requested cp;
 
-		set_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags);
+		set_bit(HCI_CONN_AUTH_INITIATOR, conn->flags);
 
 		cp.handle = __cpu_to_le16(conn->handle);
 		hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED, sizeof(cp), &cp);
@@ -3723,17 +3723,17 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
 	if (!ev->status) {
 		if (ev->encrypt) {
 			/* Encryption implies authentication */
-			set_bit(HCI_CONN_AUTH, &conn->flags);
-			set_bit(HCI_CONN_ENCRYPT, &conn->flags);
+			set_bit(HCI_CONN_AUTH, conn->flags);
+			set_bit(HCI_CONN_ENCRYPT, conn->flags);
 			conn->sec_level = conn->pending_sec_level;
 
 			/* P-256 authentication key implies FIPS */
 			if (conn->key_type == HCI_LK_AUTH_COMBINATION_P256)
-				set_bit(HCI_CONN_FIPS, &conn->flags);
+				set_bit(HCI_CONN_FIPS, conn->flags);
 
 			if ((conn->type == ACL_LINK && ev->encrypt == 0x02) ||
 			    conn->type == LE_LINK)
-				set_bit(HCI_CONN_AES_CCM, &conn->flags);
+				set_bit(HCI_CONN_AES_CCM, conn->flags);
 
 			/* For ACL links the encryption key size is still
 			 * validated below via hci_read_enc_key_size(). Its
@@ -3745,8 +3745,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
 			if (conn->type != ACL_LINK)
 				mgmt_security_level_changed(conn);
 		} else {
-			clear_bit(HCI_CONN_ENCRYPT, &conn->flags);
-			clear_bit(HCI_CONN_AES_CCM, &conn->flags);
+			clear_bit(HCI_CONN_ENCRYPT, conn->flags);
+			clear_bit(HCI_CONN_AES_CCM, conn->flags);
 			/* Elevated security levels (MEDIUM and above) require
 			 * encryption, so downgrade to reflect the connection
 			 * no longer being encrypted before reporting, instead
@@ -3767,7 +3767,7 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
 		hci_adv_instances_set_rpa_expired(hdev, true);
 	}
 
-	clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
+	clear_bit(HCI_CONN_ENCRYPT_PEND, conn->flags);
 
 	/* Check link security requirements are met */
 	if (!hci_conn_check_link_mode(conn))
@@ -3775,7 +3775,7 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
 
 	if (ev->status && conn->state == BT_CONNECTED) {
 		if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING)
-			set_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
+			set_bit(HCI_CONN_AUTH_FAILURE, conn->flags);
 
 		/* Notify upper layers so they can cleanup before
 		 * disconnecting.
@@ -3813,8 +3813,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data,
 	 * type can be either LE or ACL and controller must support LMP Ping.
 	 * Ensure for AES-CCM encryption as well.
 	 */
-	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags) &&
-	    test_bit(HCI_CONN_AES_CCM, &conn->flags) &&
+	if (test_bit(HCI_CONN_ENCRYPT, conn->flags) &&
+	    test_bit(HCI_CONN_AES_CCM, conn->flags) &&
 	    ((conn->type == ACL_LINK && lmp_ping_capable(hdev)) ||
 	     (conn->type == LE_LINK && (hdev->le_features[0] & HCI_LE_PING)))) {
 		struct hci_cp_write_auth_payload_to cp;
@@ -3846,9 +3846,9 @@ static void hci_change_link_key_complete_evt(struct hci_dev *hdev, void *data,
 	conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
 	if (conn) {
 		if (!ev->status)
-			set_bit(HCI_CONN_SECURE, &conn->flags);
+			set_bit(HCI_CONN_SECURE, conn->flags);
 
-		clear_bit(HCI_CONN_AUTH_PEND, &conn->flags);
+		clear_bit(HCI_CONN_AUTH_PEND, conn->flags);
 
 		hci_key_change_cfm(conn, ev->status);
 	}
@@ -4074,7 +4074,7 @@ static u8 hci_cc_le_setup_iso_path(struct hci_dev *hdev, void *data,
 		hci_connect_cfm(conn, rp->status);
 
 		/* Notify device connected in case it is a BIG Sync */
-		if (!rp->status && test_bit(HCI_CONN_BIG_SYNC, &conn->flags))
+		if (!rp->status && test_bit(HCI_CONN_BIG_SYNC, conn->flags))
 			mgmt_device_connected(hdev, conn, NULL, 0);
 
 		break;
@@ -4501,7 +4501,7 @@ static void hci_cs_le_create_cis(struct hci_dev *hdev, u8 status)
 		conn = hci_conn_hash_lookup_handle(hdev, handle);
 		if (conn) {
 			if (test_and_clear_bit(HCI_CONN_CREATE_CIS,
-					       &conn->flags))
+					       conn->flags))
 				pending = true;
 			conn->state = BT_CLOSED;
 			hci_connect_cfm(conn, status);
@@ -4622,7 +4622,7 @@ static void hci_role_change_evt(struct hci_dev *hdev, void *data,
 		if (!ev->status)
 			conn->role = ev->role;
 
-		clear_bit(HCI_CONN_RSWITCH_PEND, &conn->flags);
+		clear_bit(HCI_CONN_RSWITCH_PEND, conn->flags);
 
 		hci_role_switch_cfm(conn, ev->status, ev->role);
 	}
@@ -4734,12 +4734,12 @@ static void hci_mode_change_evt(struct hci_dev *hdev, void *data,
 		conn->mode = ev->mode;
 
 		if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND,
-					&conn->flags)) {
-			assign_bit(HCI_CONN_POWER_SAVE, &conn->flags,
+					conn->flags)) {
+			assign_bit(HCI_CONN_POWER_SAVE, conn->flags,
 				   conn->mode == HCI_CM_ACTIVE);
 		}
 
-		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->flags))
+		if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, conn->flags))
 			hci_sco_setup(conn, ev->status);
 	}
 
@@ -4767,7 +4767,7 @@ static void hci_pin_code_request_evt(struct hci_dev *hdev, void *data,
 	}
 
 	if (!hci_dev_test_flag(hdev, HCI_BONDABLE) &&
-	    !test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags)) {
+	    !test_bit(HCI_CONN_AUTH_INITIATOR, conn->flags)) {
 		hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY,
 			     sizeof(ev->bdaddr), &ev->bdaddr);
 	} else if (hci_dev_test_flag(hdev, HCI_MGMT)) {
@@ -4842,7 +4842,7 @@ static void hci_link_key_request_evt(struct hci_dev *hdev, void *data,
 
 	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
 	if (conn) {
-		clear_bit(HCI_CONN_NEW_LINK_KEY, &conn->flags);
+		clear_bit(HCI_CONN_NEW_LINK_KEY, conn->flags);
 
 		if ((key->type == HCI_LK_UNAUTH_COMBINATION_P192 ||
 		     key->type == HCI_LK_UNAUTH_COMBINATION_P256) &&
@@ -4905,7 +4905,7 @@ static void hci_link_key_notify_evt(struct hci_dev *hdev, void *data,
 	conn->disc_timeout = HCI_DISCONN_TIMEOUT;
 	hci_conn_drop(conn);
 
-	set_bit(HCI_CONN_NEW_LINK_KEY, &conn->flags);
+	set_bit(HCI_CONN_NEW_LINK_KEY, conn->flags);
 	conn_set_key(conn, ev->key_type, conn->pin_length);
 
 	if (!hci_dev_test_flag(hdev, HCI_MGMT))
@@ -4936,7 +4936,7 @@ static void hci_link_key_notify_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 	}
 
-	assign_bit(HCI_CONN_FLUSH_KEY, &conn->flags, !persistent);
+	assign_bit(HCI_CONN_FLUSH_KEY, conn->flags, !persistent);
 
 unlock:
 	hci_dev_unlock(hdev);
@@ -5114,7 +5114,7 @@ static void hci_remote_ext_features_evt(struct hci_dev *hdev, void *data,
 			ie->data.ssp_mode = (ev->features[0] & LMP_HOST_SSP);
 
 		if (ev->features[0] & LMP_HOST_SSP) {
-			set_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
+			set_bit(HCI_CONN_SSP_ENABLED, conn->flags);
 		} else {
 			/* It is mandatory by the Bluetooth specification that
 			 * Extended Inquiry Results are only used when Secure
@@ -5124,17 +5124,17 @@ static void hci_remote_ext_features_evt(struct hci_dev *hdev, void *data,
 			 * To make these devices work, the internal SSP
 			 * enabled flag needs to be cleared if the remote host
 			 * features do not indicate SSP support */
-			clear_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
+			clear_bit(HCI_CONN_SSP_ENABLED, conn->flags);
 		}
 
 		if (ev->features[0] & LMP_HOST_SC)
-			set_bit(HCI_CONN_SC_ENABLED, &conn->flags);
+			set_bit(HCI_CONN_SC_ENABLED, conn->flags);
 	}
 
 	if (conn->state != BT_CONFIG)
 		goto unlock;
 
-	if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
+	if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, conn->flags)) {
 		struct hci_cp_remote_name_req cp;
 		memset(&cp, 0, sizeof(cp));
 		bacpy(&cp.bdaddr, &conn->dst);
@@ -5370,7 +5370,7 @@ static void hci_key_refresh_complete_evt(struct hci_dev *hdev, void *data,
 			mgmt_security_level_changed(conn);
 	}
 
-	clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
+	clear_bit(HCI_CONN_ENCRYPT_PEND, conn->flags);
 
 	if (ev->status && conn->state == BT_CONNECTED) {
 		hci_disconnect(conn, HCI_ERROR_AUTH_FAILURE);
@@ -5471,7 +5471,7 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 
 	/* Assume remote supports SSP since it has triggered this event */
-	set_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
+	set_bit(HCI_CONN_SSP_ENABLED, conn->flags);
 
 	hci_conn_hold(conn);
 
@@ -5482,7 +5482,7 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, void *data,
 	 * pairing or if the remote is not requesting bonding.
 	 */
 	if (hci_dev_test_flag(hdev, HCI_BONDABLE) ||
-	    test_bit(HCI_CONN_AUTH_INITIATOR, &conn->flags) ||
+	    test_bit(HCI_CONN_AUTH_INITIATOR, conn->flags) ||
 	    (conn->remote_auth & ~0x01) == HCI_AT_NO_BONDING) {
 		struct hci_cp_io_capability_reply cp;
 
@@ -5592,7 +5592,7 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev, void *data,
 		 * local IO capability is not NoInputNoOutput, use JUST_WORKS
 		 * method (mgmt_user_confirm with confirm_hint set to 1).
 		 */
-		if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) &&
+		if (!test_bit(HCI_CONN_AUTH_PEND, conn->flags) &&
 		    conn->io_capability != HCI_IO_NO_INPUT_OUTPUT) {
 			bt_dev_dbg(hdev, "Confirming auto-accept as acceptor");
 			confirm_hint = 1;
@@ -5735,7 +5735,7 @@ static void hci_simple_pair_complete_evt(struct hci_dev *hdev, void *data,
 	 * initiated the authentication. A traditional auth_complete
 	 * event gets always produced as initiator and is also mapped to
 	 * the mgmt_auth_failed event */
-	if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && ev->status)
+	if (!test_bit(HCI_CONN_AUTH_PEND, conn->flags) && ev->status)
 		mgmt_auth_failed(conn, ev->status);
 
 	hci_conn_drop(conn);
@@ -5981,7 +5981,7 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
 		goto unlock;
 
 	/* Drop the connection if it has been aborted */
-	if (test_bit(HCI_CONN_CANCEL, &conn->flags)) {
+	if (test_bit(HCI_CONN_CANCEL, conn->flags)) {
 		hci_conn_drop(conn);
 		goto unlock;
 	}
@@ -6120,8 +6120,8 @@ static void hci_le_pa_sync_lost_evt(struct hci_dev *hdev, void *data,
 	/* Delete the pa sync connection */
 	conn = hci_conn_hash_lookup_pa_sync_handle(hdev, handle);
 	if (conn) {
-		clear_bit(HCI_CONN_BIG_SYNC, &conn->flags);
-		clear_bit(HCI_CONN_PA_SYNC, &conn->flags);
+		clear_bit(HCI_CONN_BIG_SYNC, conn->flags);
+		clear_bit(HCI_CONN_PA_SYNC, conn->flags);
 		hci_disconn_cfm(conn, HCI_ERROR_REMOTE_USER_TERM);
 		hci_conn_del(conn);
 	}
@@ -6255,7 +6255,7 @@ static void hci_le_past_received_evt(struct hci_dev *hdev, void *data,
 	pa_sync->sync_handle = le16_to_cpu(ev->sync_handle);
 
 	if (ev->status) {
-		set_bit(HCI_CONN_PA_SYNC_FAILED, &pa_sync->flags);
+		set_bit(HCI_CONN_PA_SYNC_FAILED, pa_sync->flags);
 
 		/* Notify iso layer */
 		hci_connect_cfm(pa_sync, ev->status);
@@ -6777,7 +6777,7 @@ static void hci_le_pa_sync_established_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 	}
 
-	clear_bit(HCI_CONN_CREATE_PA_SYNC, &conn->flags);
+	clear_bit(HCI_CONN_CREATE_PA_SYNC, conn->flags);
 
 	conn->sync_handle = le16_to_cpu(ev->handle);
 	conn->sid = HCI_SID_INVALID;
@@ -6802,7 +6802,7 @@ static void hci_le_pa_sync_established_evt(struct hci_dev *hdev, void *data,
 	pa_sync->sync_handle = le16_to_cpu(ev->handle);
 
 	if (ev->status) {
-		set_bit(HCI_CONN_PA_SYNC_FAILED, &pa_sync->flags);
+		set_bit(HCI_CONN_PA_SYNC_FAILED, pa_sync->flags);
 
 		/* Notify iso layer */
 		hci_connect_cfm(pa_sync, ev->status);
@@ -6846,7 +6846,7 @@ static void hci_le_per_adv_report_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 
 	if (ev->data_status == LE_PA_DATA_COMPLETE &&
-	    !test_and_set_bit(HCI_CONN_PA_SYNC, &pa_sync->flags)) {
+	    !test_and_set_bit(HCI_CONN_PA_SYNC, pa_sync->flags)) {
 		/* Notify iso layer */
 		hci_connect_cfm(pa_sync, 0);
 
@@ -6959,11 +6959,11 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, void *data,
 	 * using a distributed LTK.
 	 */
 	if (ltk->type == SMP_STK) {
-		set_bit(HCI_CONN_STK_ENCRYPT, &conn->flags);
+		set_bit(HCI_CONN_STK_ENCRYPT, conn->flags);
 		list_del_rcu(&ltk->list);
 		kfree_rcu(ltk, rcu);
 	} else {
-		clear_bit(HCI_CONN_STK_ENCRYPT, &conn->flags);
+		clear_bit(HCI_CONN_STK_ENCRYPT, conn->flags);
 	}
 
 	hci_dev_unlock(hdev);
@@ -7159,7 +7159,7 @@ static void hci_le_cis_established_evt(struct hci_dev *hdev, void *data,
 
 	qos = &conn->iso_qos;
 
-	pending = test_and_clear_bit(HCI_CONN_CREATE_CIS, &conn->flags);
+	pending = test_and_clear_bit(HCI_CONN_CREATE_CIS, conn->flags);
 
 	/* BLUETOOTH CORE SPECIFICATION Version 5.4 | Vol 6, Part G
 	 * page 3075:
@@ -7356,7 +7356,7 @@ static void hci_le_create_big_complete_evt(struct hci_dev *hdev, void *data,
 		}
 
 		conn->state = BT_CONNECTED;
-		set_bit(HCI_CONN_BIG_CREATED, &conn->flags);
+		set_bit(HCI_CONN_BIG_CREATED, conn->flags);
 		hci_debugfs_create_conn(conn);
 		hci_conn_add_sysfs(conn);
 		hci_iso_setup_path(conn);
@@ -7401,7 +7401,7 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 	}
 
-	clear_bit(HCI_CONN_CREATE_BIG_SYNC, &conn->flags);
+	clear_bit(HCI_CONN_CREATE_BIG_SYNC, conn->flags);
 
 	conn->num_bis = 0;
 	memset(conn->bis, 0, sizeof(conn->bis));
@@ -7424,7 +7424,7 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
 
 		if (ev->status != 0x42)
 			/* Mark PA sync as established */
-			set_bit(HCI_CONN_PA_SYNC, &bis->flags);
+			set_bit(HCI_CONN_PA_SYNC, bis->flags);
 
 		bis->sync_handle = conn->sync_handle;
 		bis->iso_qos.bcast.big = ev->handle;
@@ -7437,7 +7437,7 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
 
 		if (!ev->status) {
 			bis->state = BT_CONNECTED;
-			set_bit(HCI_CONN_BIG_SYNC, &bis->flags);
+			set_bit(HCI_CONN_BIG_SYNC, bis->flags);
 			hci_debugfs_create_conn(bis);
 			hci_conn_add_sysfs(bis);
 			hci_iso_setup_path(bis);
@@ -7455,7 +7455,7 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
 			if (!bis)
 				continue;
 
-			set_bit(HCI_CONN_BIG_SYNC_FAILED, &bis->flags);
+			set_bit(HCI_CONN_BIG_SYNC_FAILED, bis->flags);
 			hci_connect_cfm(bis, ev->status);
 		}
 
@@ -7485,13 +7485,13 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data,
 			 * it is consumed there instead of here.
 			 */
 			mgmt_conn = test_bit(HCI_CONN_MGMT_CONNECTED,
-					     &bis->flags);
+					     bis->flags);
 			mgmt_device_disconnected(hdev, &bis->dst, bis->type,
 						 bis->dst_type, ev->reason,
 						 mgmt_conn);
 		}
 
-		clear_bit(HCI_CONN_BIG_SYNC, &bis->flags);
+		clear_bit(HCI_CONN_BIG_SYNC, bis->flags);
 		hci_disconn_cfm(bis, ev->reason);
 		hci_conn_del(bis);
 	}
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index fa7f1765edeed..0e93dc1b47f53 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -5958,11 +5958,11 @@ static int hci_le_connect_cancel_sync(struct hci_dev *hdev,
 	/* Return reason if scanning since the connection shall probably be
 	 * cleanup directly.
 	 */
-	if (test_bit(HCI_CONN_SCANNING, &conn->flags))
+	if (test_bit(HCI_CONN_SCANNING, conn->flags))
 		return reason;
 
 	if (conn->role == HCI_ROLE_SLAVE ||
-	    test_and_set_bit(HCI_CONN_CANCEL, &conn->flags))
+	    test_and_set_bit(HCI_CONN_CANCEL, conn->flags))
 		return 0;
 
 	return __hci_cmd_sync_status(hdev, HCI_OP_LE_CREATE_CONN_CANCEL,
@@ -5984,7 +5984,7 @@ static int hci_connect_cancel_sync(struct hci_dev *hdev, struct hci_conn *conn,
 		 * then an HCI_LE_CIS_Established event shall also be sent for
 		 * this CIS with the Status Operation Cancelled by Host (0x44).
 		 */
-		if (test_bit(HCI_CONN_CREATE_CIS, &conn->flags))
+		if (test_bit(HCI_CONN_CREATE_CIS, conn->flags))
 			return hci_disconnect_sync(hdev, conn, reason);
 
 		/* CIS with no Create CIS sent have nothing to cancel */
@@ -6982,7 +6982,7 @@ static int hci_le_create_conn_sync(struct hci_dev *hdev, void *data)
 
 	bt_dev_dbg(hdev, "conn %p", conn);
 
-	clear_bit(HCI_CONN_SCANNING, &conn->flags);
+	clear_bit(HCI_CONN_SCANNING, conn->flags);
 	conn->state = BT_CONNECT;
 
 	/* If requested to connect as peripheral use directed advertising */
@@ -7049,7 +7049,7 @@ static int hci_le_create_conn_sync(struct hci_dev *hdev, void *data)
 	/* Mark create connection in flight so hci_cancel_connect_sync() can
 	 * cancel it while blocking on the connection complete event.
 	 */
-	set_bit(HCI_CONN_CREATE, &conn->flags);
+	set_bit(HCI_CONN_CREATE, conn->flags);
 
 	/* Send command LE Extended Create Connection if supported */
 	if (use_ext_conn(hdev)) {
@@ -7086,7 +7086,7 @@ static int hci_le_create_conn_sync(struct hci_dev *hdev, void *data)
 				       conn->conn_timeout, NULL);
 
 done:
-	clear_bit(HCI_CONN_CREATE, &conn->flags);
+	clear_bit(HCI_CONN_CREATE, conn->flags);
 
 	if (err == -ETIMEDOUT)
 		hci_le_connect_cancel_sync(hdev, conn, 0x00);
@@ -7133,7 +7133,7 @@ int hci_le_create_cis_sync(struct hci_dev *hdev)
 
 	/* Wait until previous Create CIS has completed */
 	list_for_each_entry_rcu(conn, &hdev->conn_hash.list, list) {
-		if (test_bit(HCI_CONN_CREATE_CIS, &conn->flags))
+		if (test_bit(HCI_CONN_CREATE_CIS, conn->flags))
 			goto done;
 	}
 
@@ -7169,7 +7169,7 @@ int hci_le_create_cis_sync(struct hci_dev *hdev)
 		    conn->iso_qos.ucast.cig != cig)
 			continue;
 
-		set_bit(HCI_CONN_CREATE_CIS, &conn->flags);
+		set_bit(HCI_CONN_CREATE_CIS, conn->flags);
 		cis->acl_handle = cpu_to_le16(conn->parent->handle);
 		cis->cis_handle = cpu_to_le16(conn->handle);
 		timeout = conn->conn_timeout;
@@ -7372,14 +7372,14 @@ static int hci_acl_create_conn_sync(struct hci_dev *hdev, void *data)
 	/* Mark create connection in flight so hci_cancel_connect_sync() can
 	 * cancel it while blocking on the connection complete event.
 	 */
-	set_bit(HCI_CONN_CREATE, &conn->flags);
+	set_bit(HCI_CONN_CREATE, conn->flags);
 
 	err = __hci_cmd_sync_status_sk(hdev, HCI_OP_CREATE_CONN,
 				       sizeof(cp), &cp,
 				       HCI_EV_CONN_COMPLETE,
 				       conn->conn_timeout, NULL);
 
-	clear_bit(HCI_CONN_CREATE, &conn->flags);
+	clear_bit(HCI_CONN_CREATE, conn->flags);
 
 	return err;
 }
@@ -7468,7 +7468,7 @@ static int hci_acl_cancel_create_conn_sync(struct hci_dev *hdev,
 	mutex_lock(&hdev->cmd_sync_work_lock);
 
 	/* In flight: this connection owns the pending request, cancel it. */
-	if (test_bit(HCI_CONN_CREATE, &conn->flags)) {
+	if (test_bit(HCI_CONN_CREATE, conn->flags)) {
 		hci_cmd_sync_cancel(hdev, ECANCELED);
 		goto unlock;
 	}
@@ -7499,7 +7499,7 @@ static int hci_le_cancel_create_conn_sync(struct hci_dev *hdev,
 	 */
 	mutex_lock(&hdev->cmd_sync_work_lock);
 
-	if (test_bit(HCI_CONN_CREATE, &conn->flags)) {
+	if (test_bit(HCI_CONN_CREATE, conn->flags)) {
 		hci_cmd_sync_cancel(hdev, ECANCELED);
 		goto unlock;
 	}
@@ -7526,7 +7526,7 @@ static int hci_cis_cancel_create_conn_sync(struct hci_dev *hdev,
 	 */
 	mutex_lock(&hdev->cmd_sync_work_lock);
 
-	if (test_bit(HCI_CONN_CREATE_CIS, &conn->flags))
+	if (test_bit(HCI_CONN_CREATE_CIS, conn->flags))
 		hci_cmd_sync_cancel(hdev, ECANCELED);
 
 	mutex_unlock(&hdev->cmd_sync_work_lock);
@@ -7663,7 +7663,7 @@ static void create_pa_complete(struct hci_dev *hdev, void *data, int err)
 	hci_dev_lock(hdev);
 
 	if (hci_conn_valid(hdev, conn))
-		clear_bit(HCI_CONN_CREATE_PA_SYNC, &conn->flags);
+		clear_bit(HCI_CONN_CREATE_PA_SYNC, conn->flags);
 
 	if (!err)
 		goto unlock;
@@ -7675,7 +7675,7 @@ static void create_pa_complete(struct hci_dev *hdev, void *data, int err)
 	if (IS_ERR(pa_sync))
 		goto unlock;
 
-	set_bit(HCI_CONN_PA_SYNC_FAILED, &pa_sync->flags);
+	set_bit(HCI_CONN_PA_SYNC_FAILED, pa_sync->flags);
 
 	/* Notify iso layer */
 	hci_connect_cfm(pa_sync, bt_status(err));
@@ -7748,7 +7748,7 @@ static int hci_le_pa_create_sync(struct hci_dev *hdev, void *data)
 	 * program the address in the allow list so PA advertisements can be
 	 * received.
 	 */
-	set_bit(HCI_CONN_CREATE_PA_SYNC, &conn->flags);
+	set_bit(HCI_CONN_CREATE_PA_SYNC, conn->flags);
 
 	hci_update_passive_scan_sync(hdev);
 
@@ -7851,7 +7851,7 @@ static void create_big_complete(struct hci_dev *hdev, void *data, int err)
 	if (err == -ECANCELED)
 		goto done;
 
-	clear_bit(HCI_CONN_CREATE_BIG_SYNC, &conn->flags);
+	clear_bit(HCI_CONN_CREATE_BIG_SYNC, conn->flags);
 
 done:
 	hci_conn_put(conn);
@@ -7868,7 +7868,7 @@ static int hci_le_big_create_sync(struct hci_dev *hdev, void *data)
 	if (!hci_conn_valid(hdev, conn))
 		return -ECANCELED;
 
-	set_bit(HCI_CONN_CREATE_BIG_SYNC, &conn->flags);
+	set_bit(HCI_CONN_CREATE_BIG_SYNC, conn->flags);
 
 	memset(cp, 0, sizeof(*cp));
 	cp->handle = qos->bcast.big;
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index c1fdd9846eeb0..06f1e7ba2cb1b 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -912,7 +912,7 @@ static void iso_sock_disconn(struct sock *sk)
 	struct sock *bis_sk;
 	struct hci_conn *hcon = iso_pi(sk)->conn->hcon;
 
-	if (test_bit(HCI_CONN_BIG_CREATED, &hcon->flags)) {
+	if (test_bit(HCI_CONN_BIG_CREATED, hcon->flags)) {
 		bis_sk = iso_get_sock_big(sk, &iso_pi(sk)->src,
 					  &iso_pi(sk)->dst,
 					  iso_pi(sk)->qos.bcast.big);
@@ -957,8 +957,8 @@ static void __iso_sock_close(struct sock *sk)
 
 	case BT_CONNECT2:
 		if (iso_pi(sk)->conn->hcon &&
-		    (test_bit(HCI_CONN_PA_SYNC, &iso_pi(sk)->conn->hcon->flags) ||
-		    test_bit(HCI_CONN_PA_SYNC_FAILED, &iso_pi(sk)->conn->hcon->flags)))
+		    (test_bit(HCI_CONN_PA_SYNC, iso_pi(sk)->conn->hcon->flags) ||
+		    test_bit(HCI_CONN_PA_SYNC_FAILED, iso_pi(sk)->conn->hcon->flags)))
 			iso_sock_disconn(sk);
 		else
 			iso_chan_del(sk, ECONNRESET);
@@ -2289,7 +2289,7 @@ static void iso_conn_ready(struct iso_conn *conn)
 
 		hdev = hcon->hdev;
 
-		if (test_bit(HCI_CONN_BIG_SYNC, &hcon->flags)) {
+		if (test_bit(HCI_CONN_BIG_SYNC, hcon->flags)) {
 			/* A BIS slave hcon is notified to the ISO layer
 			 * after the Command Complete for the LE Setup
 			 * ISO Data Path command is received. Get the
@@ -2298,7 +2298,7 @@ static void iso_conn_ready(struct iso_conn *conn)
 			parent = iso_get_sock(hdev, &hcon->src, &hcon->dst,
 					      BT_LISTEN, iso_match_big_hcon,
 					      hcon);
-		} else if (test_bit(HCI_CONN_BIG_SYNC_FAILED, &hcon->flags)) {
+		} else if (test_bit(HCI_CONN_BIG_SYNC_FAILED, hcon->flags)) {
 			ev = hci_recv_event_data(hcon->hdev,
 						 HCI_EVT_LE_BIG_SYNC_ESTABLISHED);
 
@@ -2312,7 +2312,7 @@ static void iso_conn_ready(struct iso_conn *conn)
 						      &hcon->dst,
 						      BT_LISTEN,
 						      iso_match_big, ev);
-		} else if (test_bit(HCI_CONN_PA_SYNC_FAILED, &hcon->flags)) {
+		} else if (test_bit(HCI_CONN_PA_SYNC_FAILED, hcon->flags)) {
 			ev2 = hci_recv_event_data(hcon->hdev,
 						  HCI_EV_LE_PA_SYNC_ESTABLISHED);
 			if (ev2)
@@ -2320,7 +2320,7 @@ static void iso_conn_ready(struct iso_conn *conn)
 						      &hcon->dst,
 						      BT_LISTEN,
 						      iso_match_sid, ev2);
-		} else if (test_bit(HCI_CONN_PA_SYNC, &hcon->flags)) {
+		} else if (test_bit(HCI_CONN_PA_SYNC, hcon->flags)) {
 			ev3 = hci_recv_event_data(hcon->hdev,
 						  HCI_EV_LE_PER_ADV_REPORT);
 			if (ev3)
@@ -2376,7 +2376,7 @@ static void iso_conn_ready(struct iso_conn *conn)
 			hcon->dst_type = le_addr_type(iso_pi(parent)->dst_type);
 		}
 
-		if (test_bit(HCI_CONN_PA_SYNC, &hcon->flags)) {
+		if (test_bit(HCI_CONN_PA_SYNC, hcon->flags)) {
 			iso_pi(sk)->qos = iso_pi(parent)->qos;
 			hcon->iso_qos = iso_pi(sk)->qos;
 			iso_pi(sk)->bc_sid = iso_pi(parent)->bc_sid;
@@ -2676,8 +2676,8 @@ static void iso_connect_cfm(struct hci_conn *hcon, __u8 status)
 	 * into the accept queue of the listening socket and wake up
 	 * userspace, to inform the user about the event.
 	 */
-	if (!status || test_bit(HCI_CONN_BIG_SYNC_FAILED, &hcon->flags) ||
-	    test_bit(HCI_CONN_PA_SYNC_FAILED, &hcon->flags)) {
+	if (!status || test_bit(HCI_CONN_BIG_SYNC_FAILED, hcon->flags) ||
+	    test_bit(HCI_CONN_PA_SYNC_FAILED, hcon->flags)) {
 		struct iso_conn *conn;
 
 		conn = iso_conn_add(hcon);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 443392cb1748f..daf3ea47fae4b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1556,7 +1556,7 @@ static bool l2cap_check_enc_key_size(struct hci_conn *hcon,
 	if (chan->sec_level == BT_SECURITY_FIPS)
 		min_key_size = 16;
 
-	return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) ||
+	return (!test_bit(HCI_CONN_ENCRYPT, hcon->flags) ||
 		hcon->enc_key_size >= min_key_size);
 }
 
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index c9e93393ff826..4d5c6f3c2c3be 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3239,7 +3239,7 @@ static int unpair_device(struct sock *sk, struct hci_dev *hdev, void *data,
 	/* Defer clearing up the connection parameters until closing to
 	 * give a chance of keeping them if a repairing happens.
 	 */
-	set_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags);
+	set_bit(HCI_CONN_PARAM_REMOVAL_PEND, conn->flags);
 
 	/* Disable auto-connection parameters if present */
 	params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr, addr_type);
@@ -3414,7 +3414,7 @@ static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	i = 0;
 	list_for_each_entry(c, &hdev->conn_hash.list, list) {
-		if (test_bit(HCI_CONN_MGMT_CONNECTED, &c->flags))
+		if (test_bit(HCI_CONN_MGMT_CONNECTED, c->flags))
 			i++;
 	}
 
@@ -3426,7 +3426,7 @@ static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	i = 0;
 	list_for_each_entry(c, &hdev->conn_hash.list, list) {
-		if (!test_bit(HCI_CONN_MGMT_CONNECTED, &c->flags))
+		if (!test_bit(HCI_CONN_MGMT_CONNECTED, c->flags))
 			continue;
 		bacpy(&rp->addr[i].bdaddr, &c->dst);
 		rp->addr[i].type = link_to_bdaddr(c->type, c->dst_type);
@@ -3626,7 +3626,7 @@ static int pairing_complete(struct mgmt_pending_cmd *cmd, u8 status)
 	/* The device is paired so there is no need to remove
 	 * its connection parameters anymore.
 	 */
-	clear_bit(HCI_CONN_PARAM_REMOVAL_PEND, &conn->flags);
+	clear_bit(HCI_CONN_PARAM_REMOVAL_PEND, conn->flags);
 
 	hci_conn_put(conn);
 
@@ -10116,7 +10116,7 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
 	u16 eir_len = 0;
 	u32 flags = 0;
 
-	if (test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
+	if (test_and_set_bit(HCI_CONN_MGMT_CONNECTED, conn->flags))
 		return;
 
 	/* allocate buff for LE or BR/EDR adv */
@@ -10165,7 +10165,7 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
 	 * since userspace did not know about them yet, so report it now.
 	 * Unencrypted connections have no change to report.
 	 */
-	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+	if (test_bit(HCI_CONN_ENCRYPT, conn->flags))
 		mgmt_security_level_changed(conn);
 }
 
@@ -10277,7 +10277,7 @@ void mgmt_connect_failed(struct hci_dev *hdev, struct hci_conn *conn, u8 status)
 	 * still needs it set to know whether to report the security level
 	 * reset, so it is consumed there instead of here.
 	 */
-	if (test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
+	if (test_bit(HCI_CONN_MGMT_CONNECTED, conn->flags)) {
 		mgmt_device_disconnected(hdev, &conn->dst, conn->type,
 					 conn->dst_type,
 					 hci_to_mgmt_reason(status), true);
@@ -10918,7 +10918,7 @@ void mgmt_security_level_changed(struct hci_conn *conn)
 	u8 *tlv_data;
 	u8 tlv_len;
 
-	if (!test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
+	if (!test_bit(HCI_CONN_MGMT_CONNECTED, conn->flags))
 		return;
 
 	/* Only ACL, LE and BIS links are tracked as mgmt connections, so
@@ -10949,9 +10949,9 @@ void mgmt_security_level_changed(struct hci_conn *conn)
 	tlv = (void *)tlv_data;
 	tlv->type = cpu_to_le16(MGMT_SEC_LEVEL_CHANGED_PARAM_ENC_TYPE);
 	tlv->length = sizeof(__u8);
-	if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+	if (!test_bit(HCI_CONN_ENCRYPT, conn->flags))
 		tlv->value[0] = MGMT_CONN_SEC_ENCRYPT_NONE;
-	else if (test_bit(HCI_CONN_AES_CCM, &conn->flags))
+	else if (test_bit(HCI_CONN_AES_CCM, conn->flags))
 		tlv->value[0] = MGMT_CONN_SEC_ENCRYPT_AES_CCM;
 	else
 		tlv->value[0] = MGMT_CONN_SEC_ENCRYPT_E0;
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 81d255525fe07..0e6f3adb0bf26 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -982,12 +982,12 @@ static u8 smp_random(struct smp_chan *smp)
 
 		smp_s1(smp->tk, smp->rrnd, smp->prnd, stk);
 
-		if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags))
+		if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, hcon->flags))
 			return SMP_UNSPECIFIED;
 
 		hci_le_start_enc(hcon, ediv, rand, stk, smp->enc_key_size);
 		hcon->enc_key_size = smp->enc_key_size;
-		set_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags);
+		set_bit(HCI_CONN_STK_ENCRYPT, hcon->flags);
 	} else {
 		u8 stk[16], auth;
 		__le64 rand = 0;
@@ -1026,7 +1026,7 @@ static void smp_notify_keys(struct l2cap_conn *conn)
 			persistent = false;
 		else
 			persistent = !test_bit(HCI_CONN_FLUSH_KEY,
-					       &hcon->flags);
+					       hcon->flags);
 	} else {
 		/* The LTKs, IRKs and CSRKs should be persistent only if
 		 * both sides had the bonding bit set in their
@@ -1751,7 +1751,7 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb)
 	/* SMP over BR/EDR requires special treatment */
 	if (conn->hcon->type == ACL_LINK) {
 		/* We must have a BR/EDR SC link */
-		if (!test_bit(HCI_CONN_AES_CCM, &conn->hcon->flags) &&
+		if (!test_bit(HCI_CONN_AES_CCM, conn->hcon->flags) &&
 		    !hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP))
 			return SMP_CROSS_TRANSP_NOT_ALLOWED;
 
@@ -2208,14 +2208,14 @@ static bool smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
 	if (smp_ltk_sec_level(key) < sec_level)
 		return false;
 
-	if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags))
+	if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, hcon->flags))
 		return true;
 
 	hci_le_start_enc(hcon, key->ediv, key->rand, key->val, key->enc_size);
 	hcon->enc_key_size = key->enc_size;
 
 	/* We never store STKs for initiator role, so clear this flag */
-	clear_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags);
+	clear_bit(HCI_CONN_STK_ENCRYPT, hcon->flags);
 
 	return true;
 }
@@ -2233,7 +2233,7 @@ bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level,
 	 * don't have an LTK (e.g. because of key distribution bits).
 	 */
 	if (key_pref == SMP_USE_LTK &&
-	    test_bit(HCI_CONN_STK_ENCRYPT, &hcon->flags) &&
+	    test_bit(HCI_CONN_STK_ENCRYPT, hcon->flags) &&
 	    hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hcon->role))
 		return false;
 
@@ -3082,11 +3082,11 @@ static void bredr_pairing(struct l2cap_chan *chan)
 	bt_dev_dbg(hdev, "chan %p", chan);
 
 	/* Only new pairings are interesting */
-	if (!test_bit(HCI_CONN_NEW_LINK_KEY, &hcon->flags))
+	if (!test_bit(HCI_CONN_NEW_LINK_KEY, hcon->flags))
 		return;
 
 	/* Don't bother if we're not encrypted */
-	if (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
+	if (!test_bit(HCI_CONN_ENCRYPT, hcon->flags))
 		return;
 
 	/* Only initiator may initiate SMP over BR/EDR */
@@ -3098,7 +3098,7 @@ static void bredr_pairing(struct l2cap_chan *chan)
 		return;
 
 	/* BR/EDR must use Secure Connections for SMP */
-	if (!test_bit(HCI_CONN_AES_CCM, &hcon->flags) &&
+	if (!test_bit(HCI_CONN_AES_CCM, hcon->flags) &&
 	    !hci_dev_test_flag(hdev, HCI_FORCE_BREDR_SMP))
 		return;
 
@@ -3147,7 +3147,7 @@ static void smp_resume_cb(struct l2cap_chan *chan)
 	if (!smp)
 		return;
 
-	if (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
+	if (!test_bit(HCI_CONN_ENCRYPT, hcon->flags))
 		return;
 
 	cancel_delayed_work(&smp->security_timer);
@@ -3170,7 +3170,7 @@ static void smp_ready_cb(struct l2cap_chan *chan)
 	 */
 	conn->smp = chan;
 
-	if (hcon->type == ACL_LINK && test_bit(HCI_CONN_ENCRYPT, &hcon->flags))
+	if (hcon->type == ACL_LINK && test_bit(HCI_CONN_ENCRYPT, hcon->flags))
 		bredr_pairing(chan);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0197/1005] Bluetooth: L2CAP: Hold incoming data until encryption key size is known
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (195 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0196/1005] Bluetooth: hci_core: Convert hci_conn flags to a bitmap Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0198/1005] Bluetooth: hci_sync: Update the CIS host feature when enabling LE Greg Kroah-Hartman
                   ` (176 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin

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

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

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

[ Upstream commit 5d005ded2cb14531c4d4ab5d02383407c75dbee6 ]

Once encryption is enabled on an ACL link, the encryption key size is
read from the controller, using hdev->min_enc_key_size in the meantime.
Data received before the reply is processed with that key size, so a
peer starting SMP over BR/EDR right after encryption, which it may do,
gets its Pairing Request rejected with "Encryption Key Size" whenever
the pending security level is FIPS, as that requires a 16 octet key:

  > HCI Event: Encryption Change (0x08) plen 4
  > ACL Data RX: Handle 1 flags 0x02 dlen 11
        BR/EDR SMP: Pairing Request (0x01) len 6
  @ MGMT Event: Authentication Failed (0x0011) plen 8
        Status: Authentication Failed (0x05)
  < HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2
  > HCI Event: Command Complete (0x0e) plen 7
        Key size: 16
  < ACL Data TX: Handle 1 flags 0x00 dlen 6
        BR/EDR SMP: Pairing Failed (0x05) len 1
        Reason: Encryption key size (0x06)

Mark the connection with HCI_CONN_ENC_KEY_SIZE_PEND while the key size
is read and hold incoming L2CAP data back in pending_rx meanwhile,
processing it once the reply is handled.

Found with mgmt-tester "Pairing Acceptor - SMP over BR/EDR 2" under User
Mode Linux time travel, where the emulated peer always replies before
the key size is read.

Fixes: e3f6a257a73d ("Bluetooth: Use actual encryption key size for SMP over BR/EDR")
Assisted-by: OpenCode:claude-opus-5.5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/bluetooth/hci_core.h |  1 +
 net/bluetooth/hci_event.c        | 12 +++++++++++-
 net/bluetooth/l2cap_core.c       | 16 ++++++++++++++--
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 75633476266cb..19870576bd90b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -711,6 +711,7 @@ enum {
 	HCI_CONN_CREATE_PA_SYNC,
 	HCI_CONN_PA_SYNC,
 	HCI_CONN_PA_SYNC_FAILED,
+	HCI_CONN_ENC_KEY_SIZE_PEND,
 
 	__HCI_CONN_NUM_FLAGS,
 };
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 0e73f32c2682d..33d89319db0c3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -724,6 +724,8 @@ static u8 hci_cc_read_enc_key_size(struct hci_dev *hdev, void *data,
 		goto done;
 	}
 
+	clear_bit(HCI_CONN_ENC_KEY_SIZE_PEND, conn->flags);
+
 	/* While unexpected, the read_enc_key_size command may fail. The most
 	 * secure approach is to then assume the key size is 0 to force a
 	 * disconnection.
@@ -3190,6 +3192,7 @@ static int hci_read_enc_key_size(struct hci_dev *hdev, struct hci_conn *conn)
 {
 	struct hci_cp_read_enc_key_size cp;
 	u8 *key_enc_size = hci_conn_key_enc_size(conn);
+	int err;
 
 	if (!read_key_size_capable(hdev)) {
 		conn->enc_key_size = HCI_LINK_KEY_SIZE;
@@ -3211,7 +3214,14 @@ static int hci_read_enc_key_size(struct hci_dev *hdev, struct hci_conn *conn)
 	else
 		conn->enc_key_size = hdev->min_enc_key_size;
 
-	return hci_send_cmd(hdev, HCI_OP_READ_ENC_KEY_SIZE, sizeof(cp), &cp);
+	/* L2CAP holds incoming data back until the key size is known */
+	set_bit(HCI_CONN_ENC_KEY_SIZE_PEND, conn->flags);
+
+	err = hci_send_cmd(hdev, HCI_OP_READ_ENC_KEY_SIZE, sizeof(cp), &cp);
+	if (err)
+		clear_bit(HCI_CONN_ENC_KEY_SIZE_PEND, conn->flags);
+
+	return err;
 }
 
 static void hci_conn_complete_evt(struct hci_dev *hdev, void *data,
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index daf3ea47fae4b..01d3fa02c7502 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -7253,7 +7253,11 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
 	u16 cid, len;
 	__le16 psm;
 
-	if (hcon->state != BT_CONNECTED) {
+	/* Also hold data back while the encryption key size is read, as
+	 * the security of the link, e.g. for SMP over BR/EDR, depends on it.
+	 */
+	if (hcon->state != BT_CONNECTED ||
+	    test_bit(HCI_CONN_ENC_KEY_SIZE_PEND, hcon->flags)) {
 		BT_DBG("queueing pending rx skb");
 		skb_queue_tail(&conn->pending_rx, skb);
 		return;
@@ -7316,7 +7320,11 @@ static void process_pending_rx(struct work_struct *work)
 
 	mutex_lock(&conn->lock);
 
-	while ((skb = skb_dequeue(&conn->pending_rx)))
+	/* l2cap_recv_frame() would queue it all again while the encryption
+	 * key size is read, l2cap_security_cfm() schedules this once known.
+	 */
+	while (!test_bit(HCI_CONN_ENC_KEY_SIZE_PEND, conn->hcon->flags) &&
+	       (skb = skb_dequeue(&conn->pending_rx)))
 		l2cap_recv_frame(conn, skb);
 
 	mutex_unlock(&conn->lock);
@@ -7899,6 +7907,10 @@ static void l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
 	}
 
 	mutex_unlock(&conn->lock);
+
+	/* Process data held back while the encryption key size was read */
+	if (!skb_queue_empty(&conn->pending_rx))
+		queue_work(hcon->hdev->workqueue, &conn->pending_rx_work);
 }
 
 /* Append fragment into frame respecting the maximum len of rx_skb */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0198/1005] Bluetooth: hci_sync: Update the CIS host feature when enabling LE
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (196 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0197/1005] Bluetooth: L2CAP: Hold incoming data until encryption key size is known Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0199/1005] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding Greg Kroah-Hartman
                   ` (175 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin

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

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

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

[ Upstream commit e24bfbc5e20711dafa0cdc2b3325c69de1cff068 ]

The Connected Isochronous Stream (Host Support) feature bit is only set
during init, based on LE being enabled at that time. If LE is enabled
afterwards without the init being repeated, as happens when the
controller is still auto powered on after registration, the bit stays
cleared and controllers enforcing it reject LE Create CIS with Command
Disallowed.

Update the bit whenever LE Host Supported is written, so it follows the
LE state.

Fixes: 709788b154ca ("Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings")
Assisted-by: OpenCode:claude-opus-5.5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_sync.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 0e93dc1b47f53..b0536742a48ee 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3511,9 +3511,13 @@ int hci_write_ssp_mode_sync(struct hci_dev *hdev, u8 mode)
 	return hci_write_sc_support_sync(hdev, 0x01);
 }
 
+static int hci_le_set_host_feature_sync(struct hci_dev *hdev, u16 bit,
+					u8 value);
+
 int hci_write_le_host_supported_sync(struct hci_dev *hdev, u8 le, u8 simul)
 {
 	struct hci_cp_write_le_host_supported cp;
+	int err;
 
 	if (!hci_dev_test_flag(hdev, HCI_LE_ENABLED) ||
 	    !lmp_bredr_capable(hdev))
@@ -3531,8 +3535,16 @@ int hci_write_le_host_supported_sync(struct hci_dev *hdev, u8 le, u8 simul)
 	cp.le = le;
 	cp.simul = simul;
 
-	return __hci_cmd_sync_status(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED,
-				     sizeof(cp), &cp, HCI_CMD_TIMEOUT);
+	err = __hci_cmd_sync_status(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED,
+				    sizeof(cp), &cp, HCI_CMD_TIMEOUT);
+	if (err || !cis_capable(hdev))
+		return err;
+
+	/* The CIS host feature is set during init based on LE being enabled,
+	 * which is not repeated when LE is enabled afterwards, e.g. while the
+	 * controller is still auto powered on, so update it here.
+	 */
+	return hci_le_set_host_feature_sync(hdev, 32, iso_enabled(hdev));
 }
 
 static int hci_powered_update_adv_sync(struct hci_dev *hdev)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0199/1005] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (197 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0198/1005] Bluetooth: hci_sync: Update the CIS host feature when enabling LE Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0200/1005] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU Greg Kroah-Hartman
                   ` (174 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hao Qin, Wenlong Tian, Chris Lu,
	Luiz Augusto von Dentz, Sasha Levin

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

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

From: Chris Lu <chris.lu@mediatek.com>

[ Upstream commit 8524c3588fbb9d5c1b876e6f908c42926845650d ]

The ISO interrupt IN endpoint delivers a fixed-size transfer that holds
one HCI ISO packet and zero-fills the remainder. That padding belongs to
the transfer rather than to the stream, so it has to be dropped instead of
reported to the host.

btmtk_recv_isopkt() keeps parsing it: the zero bytes read as an ISO header
with handle 0 and a Data_Total_Length of zero, and each one is passed to
hci_recv_frame() as a complete frame. A single transfer yields a long run
of them, which is what fills the HCI log with malformed ISO packets, and
iso_recv() drops the SDU it is reassembling whenever handle 0 belongs to a
live CIS/BIS.

A zero Data_Total_Length carries no ISO Data Load, so such a packet is
never part of the stream. Check for the zero-filled remainder before
starting to parse the next frame, rather than after assembling a 4-byte
header: a remainder shorter than HCI_ISO_HDR_SIZE would otherwise be held
across calls as a partial header, corrupting the next transfer's framing.
This also means a fully zero-filled remainder no longer costs an skb
allocation that gets immediately freed. Reaching a zero Data_Total_Length
any other way is then a genuine error, not padding.

This was observed on MT7925, but btmtk_recv_isopkt() is shared by every
MediaTek USB controller that supports ISO data.

Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Co-developed-by: Hao Qin <hao.qin@mediatek.com>
Signed-off-by: Hao Qin <hao.qin@mediatek.com>
Co-developed-by: Wenlong Tian <ot_wenlong.tian@mediatek.com>
Signed-off-by: Wenlong Tian <ot_wenlong.tian@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btmtk.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 56296d142187b..1745e0421ca6b 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -7,6 +7,7 @@
 #include <linux/usb.h>
 #include <linux/iopoll.h>
 #include <linux/overflow.h>
+#include <linux/string.h>
 #include <linux/unaligned.h>
 
 #include <net/bluetooth/bluetooth.h>
@@ -1170,6 +1171,14 @@ static int btmtk_recv_isopkt(struct hci_dev *hdev, void *buffer, int count)
 		int len;
 
 		if (!skb) {
+			/* Drop the endpoint's zero-filled padding before
+			 * allocating an skb for it; a zero Data_Total_Length
+			 * check below would miss a padding remainder
+			 * shorter than an ISO header.
+			 */
+			if (mem_is_zero(buffer, count))
+				break;
+
 			skb = bt_skb_alloc(HCI_MAX_ISO_SIZE, GFP_ATOMIC);
 			if (!skb) {
 				err = -ENOMEM;
@@ -1193,6 +1202,17 @@ static int btmtk_recv_isopkt(struct hci_dev *hdev, void *buffer, int count)
 			/* Complete ISO header */
 			hci_skb_expect(skb) = __le16_to_cpu(dlen);
 
+			if (!hci_skb_expect(skb)) {
+				/* Zero padding was ruled out above, so a
+				 * zero Data_Total_Length here is invalid.
+				 */
+				kfree_skb(skb);
+				skb = NULL;
+
+				err = -EILSEQ;
+				break;
+			}
+
 			if (skb_tailroom(skb) < hci_skb_expect(skb)) {
 				kfree_skb(skb);
 				skb = NULL;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0200/1005] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (198 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0199/1005] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0201/1005] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD Greg Kroah-Hartman
                   ` (173 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hao Qin, Wenlong Tian, Chris Lu,
	Luiz Augusto von Dentz, Sasha Levin

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

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

From: Chris Lu <chris.lu@mediatek.com>

[ Upstream commit d015faf684129a276f2137ad2e11c6c985294648 ]

btmtk_recv_isopkt() bounds the Data_Total_Length reported by the
controller with skb_tailroom(skb) < hci_skb_expect(skb). That keeps the
reassembly inside the skb, but it enforces no protocol limit: the head
allocation is rounded up to the next kmalloc bucket and skb_tailroom()
reports what the bucket can hold rather than what was requested, which is
several hundred bytes more. An oversized length therefore passes, and the
parser keeps pulling bytes out of the following transfers to fill it,
swallowing the real ISO packets they carry until the frame is handed to
hci_recv_frame().

The controller reports the largest ISO_Data_Packet_Length it will send in
LE Read Buffer Size [v2], which hci_cc_le_read_buffer_size_v2() keeps in
hdev->iso_mtu. Once that is available, bound the length by it and size the
receive skb to hold that much plus the 4-byte header. HCI_MAX_ISO_SIZE is
kept only as a fallback for the window before the command completes.

Keep the skb_tailroom() test as well, because a fragment started before
hdev->iso_mtu was populated sits in an skb sized for the fallback.

Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Co-developed-by: Hao Qin <hao.qin@mediatek.com>
Signed-off-by: Hao Qin <hao.qin@mediatek.com>
Co-developed-by: Wenlong Tian <ot_wenlong.tian@mediatek.com>
Signed-off-by: Wenlong Tian <ot_wenlong.tian@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btmtk.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 1745e0421ca6b..a81ed47c2fd1f 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -1162,8 +1162,15 @@ static int btmtk_recv_isopkt(struct hci_dev *hdev, void *buffer, int count)
 	struct btmtk_data *btmtk_data = hci_get_priv(hdev);
 	struct sk_buff *skb;
 	unsigned long flags;
+	unsigned int iso_mtu;
 	int err = 0;
 
+	/* The controller reports the largest Data_Total_Length it will send in
+	 * LE Read Buffer Size [v2]. Fall back to HCI_MAX_ISO_SIZE while that
+	 * command has not completed yet.
+	 */
+	iso_mtu = hdev->iso_mtu ? hdev->iso_mtu : HCI_MAX_ISO_SIZE;
+
 	spin_lock_irqsave(&btmtk_data->isorxlock, flags);
 	skb = btmtk_data->isopkt_skb;
 
@@ -1179,7 +1186,8 @@ static int btmtk_recv_isopkt(struct hci_dev *hdev, void *buffer, int count)
 			if (mem_is_zero(buffer, count))
 				break;
 
-			skb = bt_skb_alloc(HCI_MAX_ISO_SIZE, GFP_ATOMIC);
+			skb = bt_skb_alloc(HCI_ISO_HDR_SIZE + iso_mtu,
+					   GFP_ATOMIC);
 			if (!skb) {
 				err = -ENOMEM;
 				break;
@@ -1213,7 +1221,13 @@ static int btmtk_recv_isopkt(struct hci_dev *hdev, void *buffer, int count)
 				break;
 			}
 
-			if (skb_tailroom(skb) < hci_skb_expect(skb)) {
+			/* Reject a length the controller said it would never
+			 * send. The skb_tailroom() test is kept because a
+			 * fragment started before hdev->iso_mtu was populated
+			 * sits in a smaller skb than iso_mtu now allows.
+			 */
+			if (hci_skb_expect(skb) > iso_mtu ||
+			    skb_tailroom(skb) < hci_skb_expect(skb)) {
 				kfree_skb(skb);
 				skb = NULL;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0201/1005] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (199 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0200/1005] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0202/1005] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock Greg Kroah-Hartman
                   ` (172 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Lu, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Chris Lu <chris.lu@mediatek.com>

[ Upstream commit 855c9a54608f1e94f4c52afe3790def30534155a ]

The ISO data transfer size is spelled out twice: as a raw byte pair in the
vendor command sent by btmtk_usb_isointf_init(), and as MTK_ISO_THRESHOLD
for the padding in btmtk_isopkt_pad(). Build the command payload from the
macro so the size is stated once, and update the setting for current
MediaTek controllers.

Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btmtk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index a81ed47c2fd1f..18d9e26add2ae 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -25,7 +25,7 @@
 #define MTK_SEC_MAP_NEED_SEND_SIZE	52
 
 /* It is for mt79xx iso data transmission setting */
-#define MTK_ISO_THRESHOLD	264
+#define MTK_ISO_THRESHOLD	342
 
 struct btmtk_patch_header {
 	u8 datetime[16];
@@ -1346,7 +1346,7 @@ static int btmtk_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
 static int btmtk_usb_isointf_init(struct hci_dev *hdev)
 {
 	struct btmtk_data *btmtk_data = hci_get_priv(hdev);
-	u8 iso_param[2] = { 0x08, 0x01 };
+	__le16 iso_param = cpu_to_le16(MTK_ISO_THRESHOLD);
 	struct sk_buff *skb;
 	int err;
 
@@ -1361,7 +1361,7 @@ static int btmtk_usb_isointf_init(struct hci_dev *hdev)
 		return err;
 	}
 
-	skb = __hci_cmd_sync(hdev, 0xfd98, sizeof(iso_param), iso_param,
+	skb = __hci_cmd_sync(hdev, 0xfd98, sizeof(iso_param), &iso_param,
 			     HCI_INIT_TIMEOUT);
 	if (IS_ERR(skb)) {
 		bt_dev_err(hdev, "Failed to apply iso setting (%ld)", PTR_ERR(skb));
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0202/1005] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (200 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0201/1005] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0203/1005] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
                   ` (171 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Cen Zhang <zzzccc427@gmail.com>

[ Upstream commit 674006912777747170ad70d7727804ad4f2d047f ]

The LE accept-list mirror consists of bdaddr_list entries that are
added, removed and freed under hdev->lock. The ordinary branch of
hci_update_accept_list_sync() traverses this list without that lock.
The request worker's req_lock does not serialize raw HCI completions,
and the RCU sections protect connection and pending-action lookups,
not the accept-list nodes.

Changing connectability can reach this iterator through
set_connectable_sync(), hci_update_connectable_sync(),
hci_update_passive_scan_sync() and hci_passive_scan_sync(). With a
populated mirror, a privileged raw HCI sender can issue
HCI_OP_LE_CLEAR_ACCEPT_LIST while request work is reconciling it:

  Request work                    HCI event work
  select b and successor t
                                  hci_cc_le_clear_accept_list()
                                    hci_dev_lock(hdev)
                                    hci_bdaddr_list_clear()
                                      unlink nodes and kfree(b)
                                    hci_dev_unlock(hdev)
  read b->bdaddr_type

The clear completion can therefore free the selected node before its
field read, or the saved successor before the iterator advances.
KASAN reported a one-byte read of bdaddr_type from the freed node.

Copy each entry's address and type under hdev->lock and reconcile the
private array instead. Release the mutex before issuing synchronous
commands, since their completion handlers also acquire it. Free the
copy after iteration and use the existing error path to disable
accept-list filtering if allocation fails.

This change has not been runtime-tested.

KASAN report as below:

    ==================================================================
    BUG: KASAN: slab-use-after-free in hci_passive_scan_sync+0x1cc4/0x1f80
    Read of size 1 at addr ffff888105ee6c56 by task kworker/u17:1/499

    Workqueue: hci0 hci_cmd_sync_work
    Call Trace:
     <TASK>
     dump_stack_lvl+0x93/0xd0
     print_report+0xce/0x630
     ? hci_passive_scan_sync+0x1cc4/0x1f80
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __virt_addr_valid+0x20d/0x410
     ? hci_passive_scan_sync+0x1cc4/0x1f80
     kasan_report+0xe0/0x110
     ? hci_passive_scan_sync+0x1cc4/0x1f80
     hci_passive_scan_sync+0x1cc4/0x1f80
     ? pmbd_gate_site_armed+0x31/0x1c0
     ? __pfx_hci_passive_scan_sync+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? pmbd_probe_hit_cookie+0x10/0x1c0
     ? __pfx_pmbd_probe_hit_cookie+0x10/0x10
     ? hci_update_passive_scan_sync+0x43f/0x9e0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_release+0xc8/0x280
     hci_update_passive_scan_sync+0x473/0x9e0
     hci_update_connectable_sync+0x13c/0x250
     set_connectable_sync+0x39/0xb0
     hci_cmd_sync_work+0x1b3/0x450
     ? srso_alias_return_thunk+0x5/0xfbef5
     process_one_work+0x908/0x19c0
     ? __pfx_process_one_work+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_is_held_type+0x8f/0x100
     ? srso_alias_return_thunk+0x5/0xfbef5
     worker_thread+0x65c/0xe40
     ? __pfx_worker_thread+0x10/0x10
     kthread+0x34f/0x460
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __pfx_kthread+0x10/0x10
     ret_from_fork+0x659/0x940
     ? __pfx_ret_from_fork+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __switch_to+0x74f/0xf80
     ? __pfx_kthread+0x10/0x10
     ret_from_fork_asm+0x1a/0x30
     </TASK>

    Allocated by task 511:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     __kasan_kmalloc+0xaa/0xb0
     __kmalloc_cache_noprof+0x251/0x610
     hci_bdaddr_list_add+0x179/0x390
     hci_cc_le_add_to_accept_list+0x189/0x2d0
     hci_cmd_complete_evt+0x373/0xab0
     hci_event_packet+0x4e8/0xc70
     hci_rx_work+0x367/0xf00
     process_one_work+0x908/0x19c0
     worker_thread+0x65c/0xe40
     kthread+0x34f/0x460
     ret_from_fork+0x659/0x940
     ret_from_fork_asm+0x1a/0x30

    Freed by task 511:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     kasan_save_free_info+0x3b/0x60
     __kasan_slab_free+0x5f/0x80
     kfree+0x307/0x580
     hci_bdaddr_list_clear+0x134/0x230
     hci_cc_le_clear_accept_list+0x80/0x1f0
     hci_cmd_complete_evt+0x373/0xab0
     hci_event_packet+0x4e8/0xc70
     hci_rx_work+0x367/0xf00
     process_one_work+0x908/0x19c0
     worker_thread+0x65c/0xe40
     kthread+0x34f/0x460
     ret_from_fork+0x659/0x940
     ret_from_fork_asm+0x1a/0x30

    The buggy address belongs to the object at ffff888105ee6c40
                                                                which
                                belongs to the cache kmalloc-32 of size 32
    The buggy address is located 22 bytes inside of
                                                                freed
                                32-byte region [ffff888105ee6c40,
                                ffff888105ee6c60)

    The buggy address belongs to the physical page:
        page: refcount:0 mapcount:0 mapping:0000000000000000
    index:0xffff888105ee69c0 pfn:0x105ee6
    flags: 0x200000000000200(workingset|node=0|zone=2)
    page_type: f5(slab)
        raw: 0200000000000200 ffff888100042780 ffffea0004187150
    ffffea00042534d0
        raw: ffff888105ee69c0 000000000040003f 00000000f5000000
    0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
     ffff888105ee6b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
     ffff888105ee6b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
    >ffff888105ee6c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
                                                     ^
     ffff888105ee6c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
     ffff888105ee6d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
    ==================================================================

Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_sync.c | 53 ++++++++++++++++++++++++++++++++--------
 1 file changed, 43 insertions(+), 10 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index b0536742a48ee..f7edd55b92e2b 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2885,6 +2885,31 @@ static struct conn_params *conn_params_copy(struct list_head *list, size_t *n)
 	return p;
 }
 
+static struct conn_params *le_accept_list_copy(struct hci_dev *hdev,
+					       size_t *n)
+{
+	struct bdaddr_list *entry;
+	struct conn_params *params;
+	size_t i = 0;
+
+	hci_dev_lock(hdev);
+
+	*n = list_count_nodes(&hdev->le_accept_list);
+	params = kvzalloc_objs(struct conn_params, *n);
+	if (!params)
+		goto unlock;
+
+	list_for_each_entry(entry, &hdev->le_accept_list, list) {
+		bacpy(&params[i].addr, &entry->bdaddr);
+		params[i].addr_type = entry->bdaddr_type;
+		i++;
+	}
+
+unlock:
+	hci_dev_unlock(hdev);
+	return params;
+}
+
 /* Clear LE Accept List */
 static int hci_le_clear_accept_list_sync(struct hci_dev *hdev)
 {
@@ -2915,7 +2940,6 @@ static int hci_le_clear_accept_list_sync(struct hci_dev *hdev)
 static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 {
 	struct conn_params *params;
-	struct bdaddr_list *b, *t;
 	u8 num_entries = 0;
 	bool pend_conn, pend_report;
 	u8 filter_policy;
@@ -2980,20 +3004,27 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 	 * report. If not present in either list, then remove it from
 	 * the controller.
 	 */
-	list_for_each_entry_safe(b, t, &hdev->le_accept_list, list) {
+	params = le_accept_list_copy(hdev, &n);
+	if (!params) {
+		err = -ENOMEM;
+		goto done;
+	}
+
+	for (i = 0; i < n; i++) {
 		rcu_read_lock();
 
-		if (hci_conn_hash_lookup_le(hdev, &b->bdaddr, b->bdaddr_type)) {
+		if (hci_conn_hash_lookup_le(hdev, &params[i].addr,
+					    params[i].addr_type)) {
 			rcu_read_unlock();
 			continue;
 		}
 
 		pend_conn = hci_pend_le_action_lookup(&hdev->pend_le_conns,
-						      &b->bdaddr,
-						      b->bdaddr_type);
-		pend_report = hci_pend_le_action_lookup(&hdev->pend_le_reports,
-							&b->bdaddr,
-							b->bdaddr_type);
+						      &params[i].addr,
+						      params[i].addr_type);
+		pend_report = hci_pend_le_action_lookup(
+			&hdev->pend_le_reports, &params[i].addr,
+			params[i].addr_type);
 
 		rcu_read_unlock();
 
@@ -3001,14 +3032,16 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 		 * remove it from the acceptlist.
 		 */
 		if (!pend_conn && !pend_report) {
-			hci_le_del_accept_list_sync(hdev, &b->bdaddr,
-						    b->bdaddr_type);
+			hci_le_del_accept_list_sync(hdev, &params[i].addr,
+						    params[i].addr_type);
 			continue;
 		}
 
 		num_entries++;
 	}
 
+	kvfree(params);
+
 	/* Since all no longer valid accept list entries have been
 	 * removed, walk through the list of pending connections
 	 * and ensure that any new device gets programmed into
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0203/1005] Bluetooth: hci_sync: Protect resolving-list lookups
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (201 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0202/1005] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0204/1005] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
                   ` (170 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Cen Zhang <zzzccc427@gmail.com>

[ Upstream commit f05bd61a3213613de7848c8df2865492d5225023 ]

The host resolving list is updated under hdev->lock, and each
bdaddr_list_with_irk entry must remain alive throughout a lookup.
hci_le_del_resolve_list_sync() and hci_le_add_resolve_list_sync()
traverse that list without taking the lock.

On an LE privacy-capable controller with a programmed entry, passive
scan reconciliation can reach hci_le_del_resolve_list_sync() while a
privileged HCI_RAW client sends LE Clear Resolving List. The raw
command does not take req_lock, and its successful completion runs
on the controller workqueue independently of request work:

  Request work                     Raw HCI / event work
  hci_le_del_resolve_list_sync()
    lookup loads a list node
                                   hci_sock_sendmsg()
                                     queue LE Clear Resolving List
                                   hci_cc_le_clear_resolv_list()
                                     take hdev->lock
                                     unlink and free the node
                                     release hdev->lock
    read the node's address/type

The clear can free the node after the lookup loads it and before its
address/type read, causing a use-after-free. The report below shows
this access with the delete helper on the faulting stack. The add
helper uses the same unprotected lookup.

Take hdev->lock around each resolving-list membership lookup and
retain only a boolean result. This serializes traversal with clear
completion and keeps entry pointers inside the protected section.
Release the lock before issuing a synchronous HCI command, whose
completion also needs the lock.

KASAN report as below:

    ==================================================================
    BUG: KASAN: slab-use-after-free in
    hci_bdaddr_list_lookup_with_irk+0x106/0x120
    Read of size 1 at addr ffff88810b036e16 by task kworker/u17:0/495

    CPU: 2 UID: 0 PID: 495 Comm: kworker/u17:0 Not tainted
    7.2.0-rc6-pmb-bt-functional-v1+ #3 PREEMPT(lazy)
    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix,
    1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    Workqueue: hci0 hci_cmd_sync_work
    Call Trace:
     <TASK>
     dump_stack_lvl+0x93/0xd0
     print_report+0xce/0x630
     ? hci_bdaddr_list_lookup_with_irk+0x106/0x120
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __virt_addr_valid+0x20d/0x410
     ? hci_bdaddr_list_lookup_with_irk+0x106/0x120
     kasan_report+0xe0/0x110
     ? hci_bdaddr_list_lookup_with_irk+0x106/0x120
     hci_bdaddr_list_lookup_with_irk+0x106/0x120
     hci_le_del_resolve_list_sync.isra.0+0xd6/0x3f0
     ? __pfx_hci_le_del_resolve_list_sync.isra.0+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     hci_le_del_accept_list_sync.isra.0+0x11c/0x290
     ? __pfx_hci_le_del_accept_list_sync.isra.0+0x10/0x10
     ? hci_passive_scan_sync+0x551/0x1e80
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_release+0xc8/0x280
     hci_passive_scan_sync+0x71c/0x1e80
     ? __pfx_hci_passive_scan_sync+0x10/0x10
     ? find_held_lock+0x2b/0x80
     ? hci_lookup_le_connect+0xe1/0x3c0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? find_held_lock+0x2b/0x80
     ? hci_update_passive_scan_sync+0x437/0x950
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_release+0xc8/0x280
     hci_update_passive_scan_sync+0x461/0x950
     hci_cmd_sync_work+0x1b3/0x450
     ? srso_alias_return_thunk+0x5/0xfbef5
     process_one_work+0x908/0x19c0
     ? __pfx_process_one_work+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_is_held_type+0x8f/0x100
     ? srso_alias_return_thunk+0x5/0xfbef5
     worker_thread+0x65c/0xe40
     ? __pfx_worker_thread+0x10/0x10
     kthread+0x34f/0x460
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __pfx_kthread+0x10/0x10
     ret_from_fork+0x659/0x940
     ? __pfx_ret_from_fork+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __switch_to+0x74f/0xf80
     ? __pfx_kthread+0x10/0x10
     ret_from_fork_asm+0x1a/0x30
     </TASK>

    Allocated by task 495:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     __kasan_kmalloc+0xaa/0xb0
     __kmalloc_cache_noprof+0x251/0x610
     hci_bdaddr_list_add_with_irk+0x183/0x3e0
     hci_cc_le_add_to_resolv_list+0x18c/0x240
     hci_cmd_complete_evt+0x373/0xab0
     hci_event_packet+0x4e8/0xc70
     hci_rx_work+0x367/0xf00
     process_one_work+0x908/0x19c0
     worker_thread+0x65c/0xe40
     kthread+0x34f/0x460
     ret_from_fork+0x659/0x940
     ret_from_fork_asm+0x1a/0x30

    Freed by task 497:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     kasan_save_free_info+0x3b/0x60
     __kasan_slab_free+0x5f/0x80
     kfree+0x307/0x580
     hci_bdaddr_list_clear+0x134/0x230
     hci_cc_le_clear_resolv_list+0x13d/0x240
     hci_cmd_complete_evt+0x373/0xab0
     hci_event_packet+0x4e8/0xc70
     hci_rx_work+0x367/0xf00
     process_one_work+0x908/0x19c0
     worker_thread+0x65c/0xe40
     kthread+0x34f/0x460
     ret_from_fork+0x659/0x940
     ret_from_fork_asm+0x1a/0x30

    The buggy address belongs to the object at ffff88810b036e00
    which belongs to the cache kmalloc-64 of size 64
    The buggy address is located 22 bytes inside of
    freed 64-byte region [ffff88810b036e00, ffff88810b036e40)

    The buggy address belongs to the physical page:
    page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
    pfn:0x10b036
    flags: 0x200000000000000(node=0|zone=2)
    page_type: f5(slab)
    raw: 0200000000000000 ffff8881000428c0 dead000000000100
    dead000000000122
    raw: 0000000000000000 0000000000200020 00000000f5000000
    0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
     ffff88810b036d00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
     ffff88810b036d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
    >ffff88810b036e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                             ^
     ffff88810b036e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
     ffff88810b036f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
    ==================================================================
    Disabling lock debugging due to kernel taint

Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_sync.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index f7edd55b92e2b..baa42e06900d3 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2448,15 +2448,17 @@ static int hci_le_del_resolve_list_sync(struct hci_dev *hdev,
 					bdaddr_t *bdaddr, u8 bdaddr_type)
 {
 	struct hci_cp_le_del_from_resolv_list cp;
-	struct bdaddr_list_with_irk *entry;
+	bool exists;
 
 	if (!ll_privacy_capable(hdev))
 		return 0;
 
 	/* Check if the IRK has been programmed */
-	entry = hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list, bdaddr,
-						bdaddr_type);
-	if (!entry)
+	hci_dev_lock(hdev);
+	exists = hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list,
+						 bdaddr, bdaddr_type);
+	hci_dev_unlock(hdev);
+	if (!exists)
 		return 0;
 
 	cp.bdaddr_type = bdaddr_type;
@@ -2512,8 +2514,8 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
 {
 	struct hci_cp_le_add_to_resolv_list cp;
 	struct smp_irk *irk;
-	struct bdaddr_list_with_irk *entry;
 	struct hci_conn_params *p;
+	bool exists;
 
 	if (!ll_privacy_capable(hdev))
 		return 0;
@@ -2536,10 +2538,11 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
 		return 0;
 
 	/* Check if the IK has _not_ been programmed yet. */
-	entry = hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list,
-						&params->addr,
-						params->addr_type);
-	if (entry)
+	hci_dev_lock(hdev);
+	exists = hci_bdaddr_list_lookup_with_irk(
+		&hdev->le_resolv_list, &params->addr, params->addr_type);
+	hci_dev_unlock(hdev);
+	if (exists)
 		return 0;
 
 	cp.bdaddr_type = params->addr_type;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0204/1005] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (202 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0203/1005] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0205/1005] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
                   ` (169 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shuai Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Shuai Zhang <shuai.zhang@oss.qualcomm.com>

[ Upstream commit c0bb764fc082672678d371c375597a6a9f614cf9 ]

The kernel sets HCI_AUTO_OFF when a controller is first registered and
starts a 2-second timer. On slower boots bluetoothd and the HCI_AUTO_OFF
timer can race: hci_power_off() is already queued while bluetoothd is
still in the middle of its adapter setup sequence. hci_cmd_sync_clear()
then cancels any pending mgmt commands with -ECANCELED, including the
MGMT_OP_REMOVE_ADV_MONITOR sent by reset_adv_monitors() early in the
setup sequence.

When auto_off=1, hci_dev_close_sync() skips __mgmt_power_off() entirely,
so there is no fallback path to reply to the cancelled commands.
mgmt_remove_adv_monitor_complete() silently returns on -ECANCELED, leaving
the command with no reply. Since bluez's mgmt queue is strictly serialised,
this stalls all subsequent commands indefinitely, leaving bluetoothd unable
to register the adapter.

Fix by mapping -ECANCELED to MGMT_STATUS_CANCELLED in mgmt_errno_status()
and replying to the cancelled command in mgmt_remove_adv_monitor_complete()
instead of returning early.

Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 7eac80614300 ("Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/mgmt.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4d5c6f3c2c3be..e88d60acee5ab 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -302,6 +302,8 @@ static u8 mgmt_errno_status(int err)
 		return MGMT_STATUS_ALREADY_CONNECTED;
 	case -ENOTCONN:
 		return MGMT_STATUS_DISCONNECTED;
+	case -ECANCELED:
+		return MGMT_STATUS_CANCELLED;
 	}
 
 	return MGMT_STATUS_FAILED;
@@ -5690,8 +5692,18 @@ static void mgmt_remove_adv_monitor_complete(struct hci_dev *hdev,
 	struct mgmt_pending_cmd *cmd = data;
 	struct mgmt_cp_remove_adv_monitor *cp;
 
-	if (status == -ECANCELED)
+	/* Reply to a cancelled command so bluetoothd's serialised mgmt queue
+	 * is not blocked.
+	 */
+	if (status == -ECANCELED) {
+		cp = cmd->param;
+		rp.monitor_handle = cp->monitor_handle;
+
+		mgmt_cmd_complete(cmd->sk, cmd->hdev->id, cmd->opcode,
+				  mgmt_status(status), &rp, sizeof(rp));
+		mgmt_pending_free(cmd);
 		return;
+	}
 
 	hci_dev_lock(hdev);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0205/1005] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (203 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0204/1005] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0206/1005] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init() Greg Kroah-Hartman
                   ` (168 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tobias Wilken,
	Luiz Augusto von Dentz, Sasha Levin

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

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

From: Tobias Wilken <tooangel@tooangel.de>

[ Upstream commit 7eac80614300563470cffabf4df2b63616787ee7 ]

Since MGMT_OP_SET_POWERED runs through hci_cmd_sync, powering on a
controller that is blocked by rfkill fails with -ERFKILL from
hci_dev_open_sync(), and mgmt_set_powered_complete() reports it with
mgmt_status(err). mgmt_errno_status() has no case for -ERFKILL, so
userspace gets MGMT_STATUS_FAILED instead of MGMT_STATUS_RFKILLED.

Before that conversion, power on went through hci_power_on(), whose
error path mgmt_set_powered_failed() still maps -ERFKILL to
MGMT_STATUS_RFKILLED. bluetoothd relies on that status: for
RFKILLED it sets the adapter PowerState to "off-blocked" and returns
org.bluez.Error.Blocked for the Powered property, for any other status
it returns org.bluez.Error.Failed.

With the controller soft blocked, "bluetoothctl power on" printed
"Failed to set power on: org.bluez.Error.Failed" and btmon showed
"Set Powered (0x0005) Status: Failed (0x03)". With this change it
prints org.bluez.Error.Blocked and btmon shows "Status: RFKilled
(0x12)".

Map -ERFKILL to MGMT_STATUS_RFKILLED in mgmt_errno_status().

Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED")
Assisted-by: LLM
Signed-off-by: Tobias Wilken <tooangel@tooangel.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/mgmt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index e88d60acee5ab..b964382a01977 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -304,6 +304,8 @@ static u8 mgmt_errno_status(int err)
 		return MGMT_STATUS_DISCONNECTED;
 	case -ECANCELED:
 		return MGMT_STATUS_CANCELLED;
+	case -ERFKILL:
+		return MGMT_STATUS_RFKILLED;
 	}
 
 	return MGMT_STATUS_FAILED;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0206/1005] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (204 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0205/1005] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0207/1005] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
                   ` (167 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ismail Tarim, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Ismail Tarim <ismailtarim7@gmail.com>

[ Upstream commit 3b70dd827b27bfadd89e7b1a2d422b04da38797c ]

btmtk_usb_isointf_init() submits the ISO interrupt IN URB and then
sends the vendor command 0xfd98. If that command fails, the function
returns an error without killing the URB it has just submitted. The
caller then leaves BTMTK_ISOPKT_RUNNING clear, so the driver treats the
ISO path as inactive while its RX URB is still in flight, and
btmtk_usb_suspend() skips killing it. Kill the anchored URBs on this
path, as the URB submission failure path already does.

The return value of __set_mtk_intr_interface() is also ignored: a
failure to select the ISO alternate setting or to find its endpoints
is logged, but the function goes on to submit the URB. Return the
error instead.

Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Signed-off-by: Ismail Tarim <ismailtarim7@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btmtk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
index 18d9e26add2ae..ed53e1d8902ca 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -1352,7 +1352,9 @@ static int btmtk_usb_isointf_init(struct hci_dev *hdev)
 
 	spin_lock_init(&btmtk_data->isorxlock);
 
-	__set_mtk_intr_interface(hdev);
+	err = __set_mtk_intr_interface(hdev);
+	if (err < 0)
+		return err;
 
 	err = btmtk_submit_intr_urb(hdev, GFP_KERNEL);
 	if (err < 0) {
@@ -1364,6 +1366,7 @@ static int btmtk_usb_isointf_init(struct hci_dev *hdev)
 	skb = __hci_cmd_sync(hdev, 0xfd98, sizeof(iso_param), &iso_param,
 			     HCI_INIT_TIMEOUT);
 	if (IS_ERR(skb)) {
+		usb_kill_anchored_urbs(&btmtk_data->isopkt_anchor);
 		bt_dev_err(hdev, "Failed to apply iso setting (%ld)", PTR_ERR(skb));
 		return PTR_ERR(skb);
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0207/1005] Bluetooth: hci_core: Keep link-key filtering inside RCU
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (205 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0206/1005] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init() Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0208/1005] Bluetooth: SMP: Protect link keys during LTK derivation Greg Kroah-Hartman
                   ` (166 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Cen Zhang <zzzccc427@gmail.com>

[ Upstream commit 281ddc4e01ab54cab07995f2a1b72cf81bf90eb5 ]

hci_find_link_key() must keep the matching link key allocated while it
checks the key against the blocked-key list. It currently leaves the
key-list RCU read-side section before passing k->val to
hci_is_blocked_key(). That helper's own RCU section protects the
blocked-key list, but it cannot keep an unlinked link key from being
reclaimed.

The SMP receive path calls the finder without hdev->lock: Secure
Connections key distribution over BR/EDR reaches it through
smp_distribute_keys() and sc_generate_ltk(). With a stored peer link
key and a link-key entry in the blocked-key list,
MGMT_OP_LOAD_LINK_KEYS can free the selected key before the comparison:

  HCI RX worker (SMP)              Management / RCU reclamation
  hci_find_link_key()
    rcu_read_lock()
    select k
    rcu_read_unlock()
                                   load_link_keys()
                                     hci_dev_lock(hdev)
                                     hci_link_keys_clear(hdev)
                                       list_del_rcu(), kfree_rcu()
                                     hci_dev_unlock(hdev)
                                   grace period ends, k is freed
    hci_is_blocked_key(hdev, ..., k->val)
      memcmp() reads the freed key

Keep the RCU read-side section active through the blocked-key
comparison and the warning that prints k->bdaddr, and release it before
returning on both matched-key paths. hci_find_ltk() already handles its
blocked-key check this way.

KASAN reported this on a test kernel whose scheduling hook paused the
receive worker after the lookup until the key had been freed.

KASAN report as below:

    ==================================================================
    BUG: KASAN: slab-use-after-free in hci_is_blocked_key+0x2db/0x300
    Read of size 1 at addr ffff88810b5f89a7 by task kworker/u17:0/502

    CPU: 1 UID: 0 PID: 502 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #5 PREEMPT(lazy)
    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    Workqueue: hci1 hci_rx_work
    Call Trace:
     <TASK>
     dump_stack_lvl+0x93/0xd0
     print_report+0xce/0x630
     ? hci_is_blocked_key+0x2db/0x300
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __virt_addr_valid+0x20d/0x410
     ? hci_is_blocked_key+0x2db/0x300
     kasan_report+0xe0/0x110
     ? hci_is_blocked_key+0x2db/0x300
     hci_is_blocked_key+0x2db/0x300
     hci_find_link_key+0x12e/0x400
     smp_distribute_keys+0x1830/0x2950
     ? trace_hardirqs_on+0x18/0x160
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? queue_delayed_work_on+0xb3/0xf0
     ? __pfx_smp_distribute_keys+0x10/0x10
     ? __pfx_smp_send_cmd.isra.0+0x10/0x10
     ? __cancel_work+0x1b0/0x290
     ? __entry_text_end+0x1020f7/0x1020f9
     ? lockdep_hardirqs_on_prepare+0xea/0x1a0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __asan_memset+0x23/0x50
     ? smp_recv_cb+0x12c7/0x8d80
     ? srso_alias_return_thunk+0x5/0xfbef5
     smp_recv_cb+0x12c7/0x8d80
     ? __pfx_smp_recv_cb+0x10/0x10
     ? __pfx___might_resched+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? stack_depot_save_flags+0x29/0x9a0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __mutex_lock+0x182c/0x2590
     ? kasan_save_stack+0x42/0x60
     ? l2cap_recv_frame+0x9ef/0x8830
     ? __kasan_slab_free+0x5f/0x80
     ? kmem_cache_free+0x242/0x580
     ? kfree_skbmem+0x15e/0x1d0
     ? sk_skb_reason_drop+0x12f/0x490
     ? hci_event_packet+0x556/0xc70
     ? hci_rx_work+0x367/0xf00
     ? process_one_work+0x908/0x19c0
     ? worker_thread+0x65c/0xe40
     ? __pfx___mutex_lock+0x10/0x10
     ? __lock_acquire+0x466/0x2260
     ? __pfx_l2cap_chan_hold_unless_zero+0x10/0x10
     ? l2cap_recv_frame+0x13cc/0x8830
     ? __pfx_smp_recv_cb+0x10/0x10
     l2cap_recv_frame+0x13cc/0x8830
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __mutex_lock+0x182c/0x2590
     ? __pfx_l2cap_recv_frame+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? find_held_lock+0x2b/0x80
     ? l2cap_recv_acldata+0x1eb/0x10e0
     ? __pfx___mutex_lock+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __mutex_unlock_slowpath+0x147/0x920
     ? __pfx_l2cap_conn_hold_unless_zero+0x10/0x10
     ? __pfx_hci_conn_enter_active_mode+0x10/0x10
     ? l2cap_recv_acldata+0x13d/0x10e0
     ? srso_alias_return_thunk+0x5/0xfbef5
     l2cap_recv_acldata+0xe9f/0x10e0
     ? srso_alias_return_thunk+0x5/0xfbef5
     hci_rx_work+0x5a6/0xf00
     ? srso_alias_return_thunk+0x5/0xfbef5
     process_one_work+0x908/0x19c0
     ? __pfx_process_one_work+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_is_held_type+0x8f/0x100
     ? srso_alias_return_thunk+0x5/0xfbef5
     worker_thread+0x65c/0xe40
     ? __pfx_worker_thread+0x10/0x10
     kthread+0x34f/0x460
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __pfx_kthread+0x10/0x10
     ret_from_fork+0x659/0x940
     ? __pfx_ret_from_fork+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __switch_to+0x74f/0xf80
     ? __pfx_kthread+0x10/0x10
     ret_from_fork_asm+0x1a/0x30
     </TASK>

    Allocated by task 504:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     __kasan_kmalloc+0xaa/0xb0
     __kmalloc_cache_noprof+0x251/0x610
     hci_add_link_key+0x474/0x840
     hci_link_key_notify_evt+0x492/0xce0
     hci_event_packet+0x894/0xc70
     hci_rx_work+0x367/0xf00
     process_one_work+0x908/0x19c0
     worker_thread+0x65c/0xe40
     kthread+0x34f/0x460
     ret_from_fork+0x659/0x940
     ret_from_fork_asm+0x1a/0x30

    Freed by task 29:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     kasan_save_free_info+0x3b/0x60
     __kasan_slab_free+0x5f/0x80
     __rcu_free_sheaf_prepare+0x65/0x2a0
     rcu_free_sheaf_nobarn+0x1d/0x50
     rcu_core+0x661/0x1d10
     handle_softirqs+0x201/0x930
     run_ksoftirqd+0x33/0x60
     smpboot_thread_fn+0x3bd/0x9a0
     kthread+0x34f/0x460
     ret_from_fork+0x659/0x940
     ret_from_fork_asm+0x1a/0x30

    The buggy address belongs to the object at ffff88810b5f8980
     which belongs to the cache kmalloc-64 of size 64
    The buggy address is located 39 bytes inside of
     freed 64-byte region [ffff88810b5f8980, ffff88810b5f89c0)

    The buggy address belongs to the physical page:
    page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10b5f8
    flags: 0x200000000000000(node=0|zone=2)
    page_type: f5(slab)
    raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122
    raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
     ffff88810b5f8880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
     ffff88810b5f8900: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
    >ffff88810b5f8980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                                   ^
     ffff88810b5f8a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
     ffff88810b5f8a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
    ==================================================================

Fixes: 600a87490ff9 ("Bluetooth: Implementation of MGMT_OP_SET_BLOCKED_KEYS.")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index edd2304639a1b..6778a97386c89 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1075,17 +1075,16 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr)
 	rcu_read_lock();
 	list_for_each_entry_rcu(k, &hdev->link_keys, list) {
 		if (bacmp(bdaddr, &k->bdaddr) == 0) {
-			rcu_read_unlock();
-
 			if (hci_is_blocked_key(hdev,
 					       HCI_BLOCKED_KEY_TYPE_LINKKEY,
 					       k->val)) {
 				bt_dev_warn_ratelimited(hdev,
 							"Link key blocked for %pMR",
 							&k->bdaddr);
-				return NULL;
+				k = NULL;
 			}
 
+			rcu_read_unlock();
 			return k;
 		}
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0208/1005] Bluetooth: SMP: Protect link keys during LTK derivation
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (206 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0207/1005] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0209/1005] Bluetooth: SMP: Protect LTK encryption with RCU Greg Kroah-Hartman
                   ` (165 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Cen Zhang <zzzccc427@gmail.com>

[ Upstream commit ebc4f217c1fbe8364b5ef2ad8e3a8e9a1b2701a7 ]

sc_generate_ltk() reads the type and value of the peer link key after
hci_find_link_key() has returned. The finder ends its RCU read-side
section before returning the borrowed entry, and the SMP receive path
does not hold hdev->lock: l2cap_recv_acldata() releases it before the
PDU is dispatched. The L2CAP connection and channel locks held by SMP
do not serialize with management link-key removal.

When BR/EDR Secure Connections pairing derives an LTK from the stored
link key, MGMT_OP_LOAD_LINK_KEYS can free that key mid-derivation:

  HCI RX worker (SMP)              Management / RCU reclamation
  sc_generate_ltk()
    key = hci_find_link_key()
                                   load_link_keys()
                                     hci_dev_lock(hdev)
                                     hci_link_keys_clear(hdev)
                                       list_del_rcu(), kfree_rcu()
                                     hci_dev_unlock(hdev)
                                   grace period ends, key is freed
    read key->type
    smp_h6() or smp_h7() reads key->val

Hold an RCU read-side section from the lookup until the type and value
have been consumed. smp_h6() and smp_h7() only run the synchronous
AES-CMAC library code, which neither sleeps nor allocates. Release the
section before sc_add_ltk(), which allocates with GFP_KERNEL.

KASAN reported this on a test kernel whose scheduling hook paused the
receive worker after the lookup; the hook frames appear in the trace.

KASAN report as below:

    ==================================================================
    BUG: KASAN: slab-use-after-free in smp_distribute_keys+0x2983/0x2b70
    Read of size 1 at addr ffff88810618e9a6 by task kworker/u17:0/500

    CPU: 0 UID: 0 PID: 500 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #1 PREEMPT(lazy)
    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    Workqueue: hci1 hci_rx_work
    Call Trace:
     <TASK>
     dump_stack_lvl+0x93/0xd0
     print_report+0xce/0x630
     ? smp_distribute_keys+0x2983/0x2b70
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __virt_addr_valid+0x20d/0x410
     ? smp_distribute_keys+0x2983/0x2b70
     kasan_report+0xe0/0x110
     ? smp_distribute_keys+0x2983/0x2b70
     smp_distribute_keys+0x2983/0x2b70
     ? __pfx_smp_distribute_keys+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? pmbd_gate_maybe+0x47/0x60
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? pmbd_probe_hit_cookie+0xe7/0x1c0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? pmbd_probe_hit_cookie+0xee/0x1c0
     ? __pfx_pmbd_probe_hit_cookie+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __asan_memset+0x23/0x50
     ? smp_recv_cb+0x12e2/0x8f30
     ? srso_alias_return_thunk+0x5/0xfbef5
     smp_recv_cb+0x12e2/0x8f30
     ? __pfx_smp_recv_cb+0x10/0x10
     ? __pfx___might_resched+0x10/0x10
     ? __pfx_sched_balance_find_src_group+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __mutex_lock+0x182c/0x2590
     ? l2cap_recv_frame+0x9ef/0x8830
     ? __pfx___mutex_lock+0x10/0x10
     ? __lock_acquire+0x466/0x2260
     ? __pfx_l2cap_chan_hold_unless_zero+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? l2cap_recv_frame+0x13cc/0x8830
     ? __pfx_smp_recv_cb+0x10/0x10
     l2cap_recv_frame+0x13cc/0x8830
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __mutex_lock+0x182c/0x2590
     ? __pfx_l2cap_recv_frame+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? find_held_lock+0x2b/0x80
     ? l2cap_recv_acldata+0x1eb/0x10e0
     ? __pfx___mutex_lock+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __mutex_unlock_slowpath+0x147/0x920
     ? __pfx_l2cap_conn_hold_unless_zero+0x10/0x10
     ? __pfx_hci_conn_enter_active_mode+0x10/0x10
     ? l2cap_recv_acldata+0x13d/0x10e0
     ? srso_alias_return_thunk+0x5/0xfbef5
     l2cap_recv_acldata+0xe9f/0x10e0
     ? srso_alias_return_thunk+0x5/0xfbef5
     hci_rx_work+0x5a6/0xf00
     ? srso_alias_return_thunk+0x5/0xfbef5
     process_one_work+0x908/0x19c0
     ? __pfx_process_one_work+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_is_held_type+0x8f/0x100
     ? srso_alias_return_thunk+0x5/0xfbef5
     worker_thread+0x65c/0xe40
     ? __pfx_worker_thread+0x10/0x10
     kthread+0x34f/0x460
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __pfx_kthread+0x10/0x10
     ret_from_fork+0x659/0x940
     ? __pfx_ret_from_fork+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __switch_to+0x74f/0xf80
     ? __pfx_kthread+0x10/0x10
     ret_from_fork_asm+0x1a/0x30
     </TASK>

    Allocated by task 500:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     __kasan_kmalloc+0xaa/0xb0
     __kmalloc_cache_noprof+0x251/0x610
     hci_add_link_key+0x474/0x840
     hci_link_key_notify_evt+0x492/0xce0
     hci_event_packet+0x894/0xc70
     hci_rx_work+0x367/0xf00
     process_one_work+0x908/0x19c0
     worker_thread+0x65c/0xe40
     kthread+0x34f/0x460
     ret_from_fork+0x659/0x940
     ret_from_fork_asm+0x1a/0x30

    Freed by task 0:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     kasan_save_free_info+0x3b/0x60
     __kasan_slab_free+0x5f/0x80
     __rcu_free_sheaf_prepare+0x65/0x2a0
     rcu_free_sheaf+0x1f/0xe0
     rcu_core+0x661/0x1d10
     handle_softirqs+0x201/0x930
     __irq_exit_rcu+0x110/0x1e0
     irq_exit_rcu+0xe/0x20
     sysvec_apic_timer_interrupt+0x6c/0x80
     asm_sysvec_apic_timer_interrupt+0x1a/0x20

    The buggy address belongs to the object at ffff88810618e980
     which belongs to the cache kmalloc-64 of size 64
    The buggy address is located 38 bytes inside of
     freed 64-byte region [ffff88810618e980, ffff88810618e9c0)

    The buggy address belongs to the physical page:
    page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10618e
    flags: 0x200000000000000(node=0|zone=2)
    page_type: f5(slab)
    raw: 0200000000000000 ffff8881000428c0 dead000000000122 0000000000000000
    raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
     ffff88810618e880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
     ffff88810618e900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
    >ffff88810618e980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                                   ^
     ffff88810618ea00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
     ffff88810618ea80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
    ==================================================================

Fixes: b5ae344d4c0f ("Bluetooth: Add full SMP BR/EDR support")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/smp.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 0e6f3adb0bf26..d783126076ee7 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1184,9 +1184,13 @@ static void sc_generate_ltk(struct smp_chan *smp)
 	struct hci_conn *hcon = smp->conn->hcon;
 	struct hci_dev *hdev = hcon->hdev;
 	struct link_key *key;
+	int err;
+
+	rcu_read_lock();
 
 	key = hci_find_link_key(hdev, &hcon->dst);
 	if (!key) {
+		rcu_read_unlock();
 		bt_dev_err(hdev, "no Link Key found to generate LTK");
 		return;
 	}
@@ -1198,16 +1202,19 @@ static void sc_generate_ltk(struct smp_chan *smp)
 		/* SALT = 0x000000000000000000000000746D7032 */
 		const u8 salt[16] = { 0x32, 0x70, 0x6d, 0x74 };
 
-		if (smp_h7(key->val, salt, smp->tk))
-			return;
+		err = smp_h7(key->val, salt, smp->tk);
 	} else {
 		/* From core spec. Spells out in ASCII as 'tmp2'. */
 		const u8 tmp2[4] = { 0x32, 0x70, 0x6d, 0x74 };
 
-		if (smp_h6(key->val, tmp2, smp->tk))
-			return;
+		err = smp_h6(key->val, tmp2, smp->tk);
 	}
 
+	rcu_read_unlock();
+
+	if (err)
+		return;
+
 	if (smp_h6(smp->tk, brle, smp->tk))
 		return;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0209/1005] Bluetooth: SMP: Protect LTK encryption with RCU
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (207 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0208/1005] Bluetooth: SMP: Protect link keys during LTK derivation Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0210/1005] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
                   ` (164 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Cen Zhang <zzzccc427@gmail.com>

[ Upstream commit add463a65802bb117e4a17b8c00d747fa70399fc ]

smp_ltk_encrypt() checks the security level of the LTK returned by
hci_find_ltk() and then starts encryption with its EDIV, Rand, value
and key size. The finder ends its RCU read-side section before
returning the borrowed entry, and neither caller holds hdev->lock: the
SMP Security Request handler runs from the receive path, and
setsockopt(BT_SECURITY) reaches smp_conn_security() with only the
socket and channel locks held.

MGMT_OP_LOAD_LONG_TERM_KEYS can therefore free the LTK in between:

  Socket security request          Management / RCU reclamation
  smp_ltk_encrypt()
    key = hci_find_ltk()
                                   load_long_term_keys()
                                     hci_dev_lock(hdev)
                                     hci_smp_ltks_clear(hdev)
                                       list_del_rcu(), kfree_rcu()
                                     hci_dev_unlock(hdev)
                                   grace period ends, key is freed
    smp_ltk_sec_level(key)
    hci_le_start_enc(hcon, key->ediv, key->rand, key->val, ...)

Keep an RCU read-side section across the lookup and every use of the
key. hci_le_start_enc() copies the key into the command and queues it
with a GFP_ATOMIC allocation, so the whole sequence can stay inside the
section.

KFENCE reported this on a test kernel where the socket thread was
paused after the lookup until the RCU callback had freed the key.

KFENCE report as below:

    ==================================================================
    BUG: KFENCE: use-after-free read in smp_ltk_encrypt.isra.0+0xf3/0x370

    Use-after-free read at 0x00000000c45332eb (in kfence-#128):
     smp_ltk_encrypt.isra.0+0xf3/0x370
     smp_conn_security+0x489/0x9d0
     l2cap_sock_setsockopt+0x1bbe/0x2300
     do_sock_setsockopt+0x1fb/0x430
     __sys_setsockopt+0x106/0x180
     __x64_sys_setsockopt+0xc2/0x160
     do_syscall_64+0x115/0x6a0
     entry_SYSCALL_64_after_hwframe+0x77/0x7f

    kfence-#128: 0x00000000d45af9b0-0x0000000053c1365e, size=72, cache=kmalloc-96

    allocated by task 533 on cpu 0 at 50.484258s (0.449177s ago):
     hci_add_ltk+0x1f5/0x3a0
     load_long_term_keys+0x6ea/0x930
     hci_sock_sendmsg+0x128b/0x22e0
     sock_write_iter+0x4c0/0x550
     vfs_write+0x637/0x1010
     ksys_write+0x1b7/0x200
     do_syscall_64+0x115/0x6a0
     entry_SYSCALL_64_after_hwframe+0x77/0x7f

    freed by task 0 on cpu 0 at 50.846944s (0.093664s ago):
     __rcu_free_sheaf_prepare+0x261/0x2a0
     rcu_free_sheaf_nobarn+0x1d/0x50
     rcu_core+0x661/0x1d10
     handle_softirqs+0x201/0x930
     __irq_exit_rcu+0x110/0x1e0
     irq_exit_rcu+0xe/0x20
     sysvec_apic_timer_interrupt+0x6c/0x80
     asm_sysvec_apic_timer_interrupt+0x1a/0x20
     pv_native_safe_halt+0xf/0x20
     default_idle+0x9/0x10
     default_idle_call+0x6c/0xb0
     do_idle+0x3a7/0x650
     cpu_startup_entry+0x54/0x60
     rest_init+0x15e/0x2b0
     start_kernel+0x412/0x4b0
     x86_64_start_reservations+0x18/0x30
     x86_64_start_kernel+0x111/0x120
     common_startup_64+0x13e/0x158

    CPU: 2 UID: 0 PID: 534 Comm: l2cap-ltk-actor Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #5 PREEMPT(lazy)
    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    ==================================================================

Fixes: 988c5997d320 ("Bluetooth: Use the LTK after receiving a LE Security Request")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/smp.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index d783126076ee7..4af7fa7f4a8e1 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2207,16 +2207,20 @@ static bool smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
 {
 	struct smp_ltk *key;
 	struct hci_conn *hcon = conn->hcon;
+	bool ret = false;
+
+	rcu_read_lock();
 
 	key = hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hcon->role);
 	if (!key)
-		return false;
+		goto unlock;
 
 	if (smp_ltk_sec_level(key) < sec_level)
-		return false;
+		goto unlock;
 
+	ret = true;
 	if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, hcon->flags))
-		return true;
+		goto unlock;
 
 	hci_le_start_enc(hcon, key->ediv, key->rand, key->val, key->enc_size);
 	hcon->enc_key_size = key->enc_size;
@@ -2224,7 +2228,9 @@ static bool smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
 	/* We never store STKs for initiator role, so clear this flag */
 	clear_bit(HCI_CONN_STK_ENCRYPT, hcon->flags);
 
-	return true;
+unlock:
+	rcu_read_unlock();
+	return ret;
 }
 
 bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0210/1005] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (208 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0209/1005] Bluetooth: SMP: Protect LTK encryption with RCU Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0211/1005] Bluetooth: MGMT: Clear disabled connection parameters when loading none Greg Kroah-Hartman
                   ` (163 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Cen Zhang <zzzccc427@gmail.com>

[ Upstream commit 9ff737119177a6c1ce6083ef8c0fc06355f11869 ]

hci_le_add_resolve_list_sync() copies the peer IRK into the LE Add
Device To Resolving List command after hci_find_irk_by_addr() has
returned. The finder ends its RCU read-side section before returning
the borrowed entry, and neither the request worker nor
interleave_scan_work() holds hdev->lock here. The resolving-list
membership check between the lookup and the copy takes hdev->lock and
may sleep on it, which widens the window.

When LL privacy programs a peer with address resolution enabled,
MGMT_OP_LOAD_IRKS can free its IRK before the copy:

  Request worker                   Management / RCU reclamation
  hci_le_add_resolve_list_sync()
    irk = hci_find_irk_by_addr()
                                   load_irks()
                                     hci_dev_lock(hdev)
                                     hci_smp_irks_clear(hdev)
                                       list_del_rcu(), kfree_rcu()
                                     hci_dev_unlock(hdev)
                                   grace period ends, irk is freed
    resolving-list membership check
    memcpy(cp.peer_irk, irk->val, 16)

Copy the IRK value in an RCU read-side section right after the lookup,
as hci_le_set_privacy_mode_sync() does for the identity address. The
section ends before hdev->lock is taken and before the synchronous HCI
command is sent.

KASAN reported this on a test kernel with scheduling hooks, whose
frames appear in the trace. The report predates the hdev->lock taken
by the membership check.

KASAN report as below:

    ==================================================================
    BUG: KASAN: slab-use-after-free in hci_le_add_resolve_list_sync+0x8d9/0x910
    Read of size 16 at addr ffff88810d21452d by task kworker/u17:0/504

    CPU: 2 UID: 0 PID: 504 Comm: kworker/u17:0 Not tainted 7.2.0-rc6-pmb-bt-functional-v1+ #2 PREEMPT(lazy)
    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    Workqueue: hci0 interleave_scan_work
    Call Trace:
     <TASK>
     dump_stack_lvl+0x93/0xd0
     print_report+0xce/0x630
     ? hci_le_add_resolve_list_sync+0x8d9/0x910
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __virt_addr_valid+0x20d/0x410
     ? hci_le_add_resolve_list_sync+0x8d9/0x910
     kasan_report+0xe0/0x110
     ? hci_le_add_resolve_list_sync+0x8d9/0x910
     hci_le_add_resolve_list_sync+0x8d9/0x910
     ? __pfx_hci_le_add_resolve_list_sync+0x10/0x10
     ? pmbd_probe_hit_cookie+0xe7/0x1c0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? pmbd_probe_hit_cookie+0xee/0x1c0
     ? __pfx_pmbd_probe_hit_cookie+0x10/0x10
     hci_le_add_accept_list_sync+0x18e/0x820
     ? conn_params_copy+0x36e/0x650
     ? __pfx_hci_le_add_accept_list_sync+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? conn_params_copy+0x3a0/0x650
     hci_passive_scan_sync+0x95f/0x1f10
     ? __pfx_hci_passive_scan_sync+0x10/0x10
     ? debug_object_deactivate+0x2f8/0x3c0
     ? pwq_dec_nr_in_flight+0x880/0xdf0
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_acquire+0x17b/0x2f0
     ? process_one_work+0x895/0x19c0
     interleave_scan_work+0x11b/0x470
     process_one_work+0x908/0x19c0
     ? __pfx_process_one_work+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? lock_is_held_type+0x8f/0x100
     ? srso_alias_return_thunk+0x5/0xfbef5
     worker_thread+0x65c/0xe40
     ? __pfx_worker_thread+0x10/0x10
     kthread+0x34f/0x460
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __pfx_kthread+0x10/0x10
     ret_from_fork+0x659/0x940
     ? __pfx_ret_from_fork+0x10/0x10
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __switch_to+0x74f/0xf80
     ? __pfx_kthread+0x10/0x10
     ret_from_fork_asm+0x1a/0x30
     </TASK>

    Allocated by task 535:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     __kasan_kmalloc+0xaa/0xb0
     __kmalloc_cache_noprof+0x251/0x610
     hci_add_irk+0xb6/0x220
     load_irks+0x5f9/0x840
     hci_sock_sendmsg+0x128b/0x22e0
     __sys_sendto+0x425/0x470
     __x64_sys_sendto+0xe5/0x1c0
     do_syscall_64+0x115/0x6a0
     entry_SYSCALL_64_after_hwframe+0x77/0x7f

    Freed by task 0:
     kasan_save_stack+0x33/0x60
     kasan_save_track+0x14/0x30
     kasan_save_free_info+0x3b/0x60
     __kasan_slab_free+0x5f/0x80
     __rcu_free_sheaf_prepare+0x65/0x2a0
     rcu_free_sheaf+0x1f/0xe0
     rcu_core+0x661/0x1d10
     handle_softirqs+0x201/0x930
     __irq_exit_rcu+0x110/0x1e0
     irq_exit_rcu+0xe/0x20
     sysvec_apic_timer_interrupt+0x6c/0x80
     asm_sysvec_apic_timer_interrupt+0x1a/0x20

    The buggy address belongs to the object at ffff88810d214500
     which belongs to the cache kmalloc-64 of size 64
    The buggy address is located 45 bytes inside of
     freed 64-byte region [ffff88810d214500, ffff88810d214540)

    The buggy address belongs to the physical page:
    page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d214
    flags: 0x200000000000000(node=0|zone=2)
    page_type: f5(slab)
    raw: 0200000000000000 ffff8881000428c0 dead000000000100 dead000000000122
    raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
     ffff88810d214400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
     ffff88810d214480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
    >ffff88810d214500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                                      ^
     ffff88810d214580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
     ffff88810d214600: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
    ==================================================================

Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3")
Assisted-by: LLM
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_sync.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index baa42e06900d3..22d32b9c59780 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2533,9 +2533,17 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
 	} else if (!(params->flags & HCI_CONN_FLAG_ADDRESS_RESOLUTION))
 		return 0;
 
+	rcu_read_lock();
+
 	irk = hci_find_irk_by_addr(hdev, &params->addr, params->addr_type);
-	if (!irk)
+	if (!irk) {
+		rcu_read_unlock();
 		return 0;
+	}
+
+	memcpy(cp.peer_irk, irk->val, 16);
+
+	rcu_read_unlock();
 
 	/* Check if the IK has _not_ been programmed yet. */
 	hci_dev_lock(hdev);
@@ -2547,7 +2555,6 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
 
 	cp.bdaddr_type = params->addr_type;
 	bacpy(&cp.bdaddr, &params->addr);
-	memcpy(cp.peer_irk, irk->val, 16);
 
 	/* Default privacy mode is always Network */
 	params->privacy_mode = HCI_NETWORK_PRIVACY;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0211/1005] Bluetooth: MGMT: Clear disabled connection parameters when loading none
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (209 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0210/1005] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0212/1005] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
                   ` (162 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Kevin Dewald <kevin@simpleble.org>

[ Upstream commit d90f24dc389b9a7524aaac109021d1530fa180f0 ]

Load Connection Parameters only clears the disabled connection
parameters when it loads more than one entry, so that loading a single
entry can update the parameters of one device without dropping the
others. Loading no entries does not clear them either, though, which is
what bluetoothd does when it starts without stored connection
parameters.

Pair Device adds disabled connection parameters for the device it pairs
with, so these now survive bluetoothd restarts, and new connections to
the device keep using the parameters they were created with instead of
the defaults set since, e.g. the connection interval from main.conf.

Clear the disabled connection parameters unless a single entry is
loaded, as was done for any number of entries before.

Fixes: 0ece498c27d8 ("Bluetooth: MGMT: Make MGMT_OP_LOAD_CONN_PARAM update existing connection")
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Kevin Dewald <kevin@simpleble.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/mgmt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index b964382a01977..90d73ce442f42 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -8175,7 +8175,11 @@ static int load_conn_param(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	hci_dev_lock(hdev);
 
-	if (param_count > 1)
+	/* A single entry may be an update for one device, so keep the other
+	 * disabled parameters then, but clear them otherwise, including when
+	 * no entries are loaded.
+	 */
+	if (param_count != 1)
 		hci_conn_params_clear_disabled(hdev);
 
 	for (i = 0; i < param_count; i++) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0212/1005] Bluetooth: hci_core: Initialize advertising RPA work only once
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (210 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0211/1005] Bluetooth: MGMT: Clear disabled connection parameters when loading none Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0213/1005] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
                   ` (161 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Cen Zhang <zzzccc427@gmail.com>

[ Upstream commit a7c5c18b7cc30dcd2a9ae5a0fb38378d3998417e ]

hci_add_adv_instance() also updates existing instances and calls
INIT_DELAYED_WORK() on their rpa_expired_cb every time, even when the
work is pending or running. cancel_delayed_work_sync() then no longer
finds the work, so hci_remove_adv_instance() can free the instance
under it:

  hdev->workqueue                 MGMT_OP_ADD_EXT_ADV_PARAMS
  adv_instance_rpa_expired()
                                  hci_dev_lock(hdev)
                                  hci_add_adv_instance()
                                    INIT_DELAYED_WORK()
                                  mgmt_pending_new() fails
                                  hci_remove_adv_instance()
                                    cancel_delayed_work_sync()
                                      returns without waiting
                                    kfree(adv)
                                  hci_dev_unlock(hdev)
    adv->rpa_expired = true

The work has been initialized on every update since it was added.
Initialize it only when the instance is allocated.

KASAN report as below:

    BUG: KASAN: slab-use-after-free in adv_instance_rpa_expired+0x139/0x160
    Write of size 1 at addr ffff888108d84b2e by task kworker/u17:0/504

    Workqueue: hci0 adv_instance_rpa_expired
    Call Trace:
     adv_instance_rpa_expired+0x139/0x160

    Allocated by task 560:
     hci_add_adv_instance+0x68d/0x9d0
     add_ext_adv_params+0x4d4/0xb60
     hci_sock_sendmsg+0x128b/0x22e0

    Freed by task 594:
     kfree+0x307/0x580
     hci_remove_adv_instance+0x230/0x540
     add_ext_adv_params+0xa43/0xb60
     hci_sock_sendmsg+0x128b/0x22e0

    Last potentially related work creation:
     insert_work+0x37/0x210
     __queue_work+0xaba/0x1270
     call_timer_fn+0x171/0x500

    The buggy address belongs to the object at ffff888108d84800
     which belongs to the cache kmalloc-1k of size 1024
    The buggy address is located 814 bytes inside of
     freed 1024-byte region [ffff888108d84800, ffff888108d84c00)

Fixes: a73c046a2869 ("Bluetooth: Implement Set ADV set random address")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 6778a97386c89..cfc6d3db32bb6 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1700,6 +1700,9 @@ struct adv_info *hci_add_adv_instance(struct hci_dev *hdev, u8 instance,
 		if (!adv)
 			return ERR_PTR(-ENOMEM);
 
+		INIT_DELAYED_WORK(&adv->rpa_expired_cb,
+				  adv_instance_rpa_expired);
+
 		adv->pending = true;
 		adv->instance = instance;
 
@@ -1736,8 +1739,6 @@ struct adv_info *hci_add_adv_instance(struct hci_dev *hdev, u8 instance,
 	else
 		adv->duration = duration;
 
-	INIT_DELAYED_WORK(&adv->rpa_expired_cb, adv_instance_rpa_expired);
-
 	BT_DBG("%s for %dMR", hdev->name, instance);
 
 	return adv;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0213/1005] Bluetooth: validate retained LE Create CIS command length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (211 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0212/1005] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0214/1005] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
                   ` (160 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yifan Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>

[ Upstream commit 1eb52f35fc8fb06ab7f2973fff29cba81f96b947 ]

hci_cs_le_create_cis() retrieves the parameters of the previously sent
command without their length.  It then trusts num_cis and walks the
flexible cis[] array when a controller reports a failed command.

A five-byte HCI command containing only num_cis can therefore make the
handler read beyond the command skb.  KASAN reports:

  BUG: KASAN: slab-out-of-bounds in hci_cs_le_create_cis
  Read of size 2
  hci_cs_le_create_cis
  hci_cmd_status_evt
  hci_event_packet

Add a length-returning saved-command helper and require the fixed header
and complete CIS array before walking it.

The reproducer no longer triggers a KASAN report with this change.

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Closes: https://lore.kernel.org/linux-bluetooth/179317462624.87574.6271582002629080499@stu.pku.edu.cn/
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/bluetooth/hci_core.h |  2 ++
 net/bluetooth/hci_core.c         | 18 ++++++++++++++----
 net/bluetooth/hci_event.c        |  7 ++++++-
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 19870576bd90b..cac282584c616 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2379,6 +2379,8 @@ void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
 void hci_send_iso(struct hci_conn *conn, struct sk_buff *skb);
 
 void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);
+void *hci_sent_cmd_data_len(struct hci_dev *hdev, __u16 opcode,
+			    size_t *len);
 void *hci_recv_event_data(struct hci_dev *hdev, __u8 event);
 
 u32 hci_conn_get_phy(struct hci_conn *conn);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index cfc6d3db32bb6..8784c28297ac2 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3138,7 +3138,8 @@ int __hci_cmd_send(struct hci_dev *hdev, u16 opcode, u32 plen,
 EXPORT_SYMBOL(__hci_cmd_send);
 
 /* Get data from the previously sent command */
-static void *hci_cmd_data(struct sk_buff *skb, __u16 opcode)
+static void *hci_cmd_data(struct sk_buff *skb, __u16 opcode,
+			  size_t *len)
 {
 	struct hci_command_hdr *hdr;
 
@@ -3150,23 +3151,32 @@ static void *hci_cmd_data(struct sk_buff *skb, __u16 opcode)
 	if (hdr->opcode != cpu_to_le16(opcode))
 		return NULL;
 
+	if (len)
+		*len = skb->len - HCI_COMMAND_HDR_SIZE;
+
 	return skb->data + HCI_COMMAND_HDR_SIZE;
 }
 
 /* Get data from the previously sent command */
-void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode)
+void *hci_sent_cmd_data_len(struct hci_dev *hdev, __u16 opcode, size_t *len)
 {
 	void *data;
 
 	/* Check if opcode matches last sent command */
-	data = hci_cmd_data(hdev->sent_cmd, opcode);
+	data = hci_cmd_data(hdev->sent_cmd, opcode, len);
 	if (!data)
 		/* Check if opcode matches last request */
-		data = hci_cmd_data(hdev->req_skb, opcode);
+		data = hci_cmd_data(hdev->req_skb, opcode, len);
 
 	return data;
 }
 
+/* Get data from the previously sent command */
+void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode)
+{
+	return hci_sent_cmd_data_len(hdev, opcode, NULL);
+}
+
 /* Get data from last received event */
 void *hci_recv_event_data(struct hci_dev *hdev, __u8 event)
 {
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 33d89319db0c3..64db225a9f109 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4488,6 +4488,7 @@ static void hci_cs_le_create_cis(struct hci_dev *hdev, u8 status)
 {
 	struct hci_cp_le_create_cis *cp;
 	bool pending = false;
+	size_t len;
 	int i;
 
 	bt_dev_dbg(hdev, "status 0x%2.2x", status);
@@ -4495,10 +4496,14 @@ static void hci_cs_le_create_cis(struct hci_dev *hdev, u8 status)
 	if (!status)
 		return;
 
-	cp = hci_sent_cmd_data(hdev, HCI_OP_LE_CREATE_CIS);
+	cp = hci_sent_cmd_data_len(hdev, HCI_OP_LE_CREATE_CIS, &len);
 	if (!cp)
 		return;
 
+	if (len < sizeof(*cp) ||
+	    len < struct_size(cp, cis, cp->num_cis))
+		return;
+
 	hci_dev_lock(hdev);
 
 	/* Remove connection if command failed */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0214/1005] Bluetooth: validate retained LE Set CIG Parameters command length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (212 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0213/1005] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0215/1005] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery Greg Kroah-Hartman
                   ` (159 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yifan Zhang, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>

[ Upstream commit ed4d302af778b9e2ead28134a2196c09a4ad248a ]

hci_cc_le_set_cig_params() validates the controller response but not the
parameters of the previously sent command.  A short command can claim a
large num_cis without containing the corresponding cis[] array.  A
complete successful response then makes the handler read beyond the
command skb while looking up each CIS ID.

KASAN reports:

  BUG: KASAN: slab-out-of-bounds in hci_cc_le_set_cig_params
  Read of size 1
  hci_cc_le_set_cig_params
  hci_cmd_complete_evt
  hci_event_packet

Obtain the retained parameter length and require both the fixed header and
the complete CIS array before using the command data.

The reproducer no longer triggers a KASAN report with this change.

Fixes: 71e9588435c3 ("Bluetooth: ISO: use correct CIS order in Set CIG Parameters event")
Closes: https://lore.kernel.org/linux-bluetooth/179317463153.87610.8996555110609321376@stu.pku.edu.cn/
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_event.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 64db225a9f109..cb7abdc5546f9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3985,13 +3985,16 @@ static u8 hci_cc_le_set_cig_params(struct hci_dev *hdev, void *data,
 	struct hci_conn *conn;
 	u8 status = rp->status;
 	bool pending = false;
+	size_t len;
 	int i;
 
 	bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
 
-	cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_CIG_PARAMS);
+	cp = hci_sent_cmd_data_len(hdev, HCI_OP_LE_SET_CIG_PARAMS, &len);
 	if (!rp->status &&
-	    (!cp || rp->num_handles != cp->num_cis ||
+	    (!cp || len < sizeof(*cp) ||
+	     len < struct_size(cp, cis, cp->num_cis) ||
+	     rp->num_handles != cp->num_cis ||
 	     rp->cig_id != cp->cig_id ||
 	     skb->len < array_size(rp->num_handles, sizeof(*rp->handle)))) {
 		bt_dev_err(hdev, "unexpected Set CIG Parameters response data");
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0215/1005] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (213 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0214/1005] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0216/1005] bpf: Emit timed may_goto for JITed progs only Greg Kroah-Hartman
                   ` (158 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Kevin Dewald <kevin@simpleble.org>

[ Upstream commit 60b10121db602a43ada3dbc39792bbf93d25991b ]

Stop Discovery moves the discovery to DISCOVERY_STOPPING, and
stop_discovery_complete() only moves it on to DISCOVERY_STOPPED when
stopping succeeded. When it fails, for example because LE Set Scan
Enable times out, nothing moves the discovery out of
DISCOVERY_STOPPING: Stop Discovery is rejected, as the discovery is not
active anymore, and the LE scan timeout was cancelled before the scan
was disabled. Until the controller is powered off, every Start
Discovery then fails with Busy, and hci_update_passive_scan_sync()
skips background scanning, so devices set to auto-connect are not
connected anymore.

Move the discovery back to DISCOVERY_FINDING when stopping it failed
while its inquiry or active LE scan is still running, so that it can be
stopped again. Only change the state while the discovery is still
stopping, as Inquiry Cancel may already have stopped it, for example
when only the passive scan could not be disabled, and a new Start
Discovery may have followed. Do this under hci_dev_lock(), like the
command completions that change these flags, and before replying, so
that a client acting on the reply sees the new state. Only cancel the
LE scan timeout once the scan is disabled, so that the discovery still
ends on its own, except when suspending, where it is still cancelled
first.

A timed out LE Set Scan Enable can still complete afterwards, which
cancels the timeout as well, so also stop the discovery when its scan
is disabled while the timeout is pending, or while the timeout work
waits for the lock.

Fixes: 0e05bba6f6f8 ("Bluetooth: Update stop_discovery to use HCI request")
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Kevin Dewald <kevin@simpleble.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_event.c | 12 +++++++++++-
 net/bluetooth/hci_sync.c  | 26 +++++++++++++++++++++++---
 net/bluetooth/mgmt.c      | 23 ++++++++++++++++++++---
 3 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index cb7abdc5546f9..d1f142e6ea5b5 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1819,6 +1819,8 @@ static void store_pending_adv_report(struct hci_dev *hdev, bdaddr_t *bdaddr,
 
 static void le_set_scan_enable_complete(struct hci_dev *hdev, u8 enable)
 {
+	bool timeout_pending;
+
 	hci_dev_lock(hdev);
 
 	switch (enable) {
@@ -1848,10 +1850,18 @@ static void le_set_scan_enable_complete(struct hci_dev *hdev, u8 enable)
 		/* Cancel this timer so that we don't try to disable scanning
 		 * when it's already disabled.
 		 */
-		cancel_delayed_work(&hdev->le_scan_disable);
+		timeout_pending = cancel_delayed_work(&hdev->le_scan_disable);
 
 		hci_dev_clear_flag(hdev, HCI_LE_SCAN);
 
+		/* The scan of a discovery was disabled before its timeout,
+		 * for example by a Stop Discovery that timed out and still
+		 * completed, so nothing else would end the discovery.
+		 */
+		if (timeout_pending &&
+		    hdev->discovery.state == DISCOVERY_FINDING)
+			hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+
 		if (hdev->discovery.type == DISCOV_TYPE_INTERLEAVED &&
 		    hci_test_quirk(hdev, HCI_QUIRK_SIMULTANEOUS_DISCOVERY) &&
 		    !test_bit(HCI_INQUIRY, &hdev->flags) &&
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 22d32b9c59780..8f90e5ffebd47 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -376,8 +376,18 @@ static void le_scan_disable(struct work_struct *work)
 	bt_dev_dbg(hdev, "");
 	hci_dev_lock(hdev);
 
-	if (!hci_dev_test_flag(hdev, HCI_LE_SCAN))
+	if (!hci_dev_test_flag(hdev, HCI_LE_SCAN)) {
+		/* The scan of a discovery can be disabled while this work
+		 * waits for the lock, for example by a Stop Discovery that
+		 * timed out and still completed, so end the discovery as
+		 * le_set_scan_enable_complete() does when it cancels this
+		 * work.
+		 */
+		if (hdev->discovery.state == DISCOVERY_FINDING)
+			goto discov_stopped;
+
 		goto _return;
+	}
 
 	status = hci_cmd_sync_queue(hdev, scan_disable_sync, NULL, NULL);
 	if (status) {
@@ -5930,11 +5940,15 @@ int hci_stop_discovery_sync(struct hci_dev *hdev)
 		}
 
 		if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) {
-			cancel_delayed_work(&hdev->le_scan_disable);
-
 			err = hci_scan_disable_sync(hdev);
 			if (err)
 				return err;
+
+			/* Only cancel the LE scan timeout once the scan is
+			 * disabled, so that the discovery still ends if
+			 * stopping it failed.
+			 */
+			cancel_delayed_work(&hdev->le_scan_disable);
 		}
 
 	} else {
@@ -6569,6 +6583,12 @@ static int hci_pause_discovery_sync(struct hci_dev *hdev)
 		return 0;
 
 	hci_discovery_set_state(hdev, DISCOVERY_STOPPING);
+
+	/* Cancel the LE scan timeout first, so that it does not run while
+	 * suspended if the scan cannot be disabled.
+	 */
+	cancel_delayed_work(&hdev->le_scan_disable);
+
 	err = hci_stop_discovery_sync(hdev);
 	if (err)
 		return err;
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 90d73ce442f42..a287dd4bb26e3 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6318,12 +6318,29 @@ static void stop_discovery_complete(struct hci_dev *hdev, void *data, int err)
 
 	bt_dev_dbg(hdev, "err %d", err);
 
+	hci_dev_lock(hdev);
+
+	/* Change the state before replying, so that a client acting on the
+	 * reply sees it, and only while the discovery is still stopping, as
+	 * Inquiry Cancel may already have stopped it and a new Start Discovery
+	 * may have followed. Go back to DISCOVERY_FINDING when stopping failed
+	 * while the inquiry or the active LE scan of the discovery is still
+	 * running, so that it can be stopped again.
+	 */
+	if (hdev->discovery.state == DISCOVERY_STOPPING) {
+		if (err && (test_bit(HCI_INQUIRY, &hdev->flags) ||
+			    (hci_dev_test_flag(hdev, HCI_LE_SCAN) &&
+			     hdev->le_scan_type == LE_SCAN_ACTIVE)))
+			hci_discovery_set_state(hdev, DISCOVERY_FINDING);
+		else
+			hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+	}
+
+	hci_dev_unlock(hdev);
+
 	mgmt_cmd_complete(cmd->sk, cmd->hdev->id, cmd->opcode, mgmt_status(err),
 			  cmd->param, 1);
 	mgmt_pending_free(cmd);
-
-	if (!err)
-		hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
 }
 
 static int stop_discovery_sync(struct hci_dev *hdev, void *data)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0216/1005] bpf: Emit timed may_goto for JITed progs only
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (214 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0215/1005] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0217/1005] bpf: Propagate scalar precision through stack arguments Greg Kroah-Hartman
                   ` (157 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 1ddffb57b36239e84b8224b12e34b87f6031b29c ]

The timed form of may_goto calls arch_bpf_timed_may_goto(). This function
takes its argument and returns its result in BPF_REG_AX, in a register of
the cpu. Only JITed code can call it.

The verifier emits the timed form when the arch has a JIT that supports it.
It does not look at the prog. With CONFIG_BPF_JIT_ALWAYS_ON=n the
interpreter can run such a prog: the JIT is off, or it fails. The
interpreter calls the function like a helper. The function takes what the C
code left in that register for a pointer, and bpf_check_timed_may_goto()
reads and writes through it.

Emit the timed form only when the prog asks for a JIT, and make the JIT
mandatory for such a prog. All other progs get the form that counts down
from BPF_MAX_LOOPS.

One test of verifier_may_goto_1 shows the insns of the timed form. Load it
only when progs are JITed.

Fixes: e723608bf428 ("bpf: Add verifier support for timed may_goto")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261031215543.682284-2-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/fixups.c                                     | 9 ++++++---
 tools/testing/selftests/bpf/progs/verifier_may_goto_1.c | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/fixups.c b/kernel/bpf/fixups.c
index 5a5f7ec21f2dc..524e6d3de0776 100644
--- a/kernel/bpf/fixups.c
+++ b/kernel/bpf/fixups.c
@@ -1621,6 +1621,8 @@ int bpf_do_misc_fixups(struct bpf_verifier_env *env)
 	struct bpf_subprog_info *subprogs = env->subprog_info;
 	u16 stack_depth = subprogs[cur_subprog].stack_depth;
 	u16 stack_depth_extra = 0;
+	/* arch_bpf_timed_may_goto() takes and returns AX in a cpu register: for JITs only */
+	bool timed_may_goto = prog->jit_requested && bpf_jit_supports_timed_may_goto();
 
 	if (env->seen_exception && !env->exception_callback_subprog) {
 		struct bpf_insn *patch = insn_buf;
@@ -1876,7 +1878,7 @@ int bpf_do_misc_fixups(struct bpf_verifier_env *env)
 			goto next_insn;
 		}
 
-		if (bpf_is_may_goto_insn(insn) && bpf_jit_supports_timed_may_goto()) {
+		if (bpf_is_may_goto_insn(insn) && timed_may_goto) {
 			int stack_off_cnt = -stack_depth - 16;
 			/*
 			 * AX is used as an argument to pass in stack_off_cnt
@@ -1906,6 +1908,7 @@ int bpf_do_misc_fixups(struct bpf_verifier_env *env)
 			 * after subtraction, rinse and repeat.
 			 */
 			stack_depth_extra = 16;
+			prog->jit_required = 1;
 			cnt = may_goto_expand(insn_buf, insn->off, stack_off_cnt,
 					      tail, ARRAY_SIZE(tail));
 
@@ -2527,7 +2530,7 @@ int bpf_do_misc_fixups(struct bpf_verifier_env *env)
 
 	env->prog->aux->stack_depth = subprogs[0].stack_depth;
 	for (i = 0; i < env->subprog_cnt; i++) {
-		int delta = bpf_jit_supports_timed_may_goto() ? 2 : 1;
+		int delta = timed_may_goto ? 2 : 1;
 		int subprog_start = subprogs[i].start;
 		int stack_slots = subprogs[i].stack_extra / 8;
 		int slots = delta, cnt = 0;
@@ -2541,7 +2544,7 @@ int bpf_do_misc_fixups(struct bpf_verifier_env *env)
 		}
 
 		stack_depth = subprogs[i].stack_depth;
-		if (bpf_jit_supports_timed_may_goto()) {
+		if (timed_may_goto) {
 			insn_buf[cnt++] = BPF_ST_MEM(BPF_DW, BPF_REG_FP, -stack_depth,
 						     BPF_MAX_TIMED_LOOPS);
 			insn_buf[cnt++] = BPF_ST_MEM(BPF_DW, BPF_REG_FP, -stack_depth + 8, 0);
diff --git a/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c b/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c
index db7e30da234f1..a95735d98c7cf 100644
--- a/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c
+++ b/tools/testing/selftests/bpf/progs/verifier_may_goto_1.c
@@ -82,6 +82,7 @@ __naked void may_goto_batch_1(void)
 
 SEC("raw_tp")
 __description("may_goto batch with offsets 2/0")
+__load_if_JITed()
 __arch_x86_64
 __arch_s390x
 __arch_arm64
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0217/1005] bpf: Propagate scalar precision through stack arguments
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (215 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0216/1005] bpf: Emit timed may_goto for JITed progs only Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0218/1005] selftests/mm: merge: keep the far mremap() targets in the carveout Greg Kroah-Hartman
                   ` (156 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Xu Yunxiang, Alexei Starovoitov,
	Sasha Levin

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

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

From: Xu Yunxiang <xyx2021@mail.ustc.edu.cn>

[ Upstream commit d537252cc8a53b6ed6a3e7d0d895cb1cdd3ba42c ]

Outgoing stack arguments retain scalar verifier state separately from
registers and ordinary spills. State comparison uses their precision
marks, but propagate_precision() does not carry those dependencies from
a reused state to the current path's ancestors. A path can consequently
reuse a state without making earlier checkpoints distinguish scalar
values that will later be used as memory offsets.

Seed the existing backtracking batch with precise scalar argument slots
from every frame. Incoming arguments live in the caller's outgoing
slots, so include caller frames as well as the current frame.

Also cover scalar argument slots in bpf_mark_all_scalars_precise(), so
conservative fallback preserves the same invariant. Keep its existing
ancestor-only traversal and leave pointer and uninitialized slots alone.

AI assistance was used in preparing this patch.

Fixes: 0f6bd5e7a804 ("bpf: Support stack arguments for bpf functions")
Signed-off-by: Xu Yunxiang <xyx2021@mail.ustc.edu.cn>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261102190350.788433-2-xyx2021@mail.ustc.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/backtrack.c | 11 +++++++++++
 kernel/bpf/states.c    | 14 ++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/kernel/bpf/backtrack.c b/kernel/bpf/backtrack.c
index 50c66115ab45e..cdf96ef68f7e4 100644
--- a/kernel/bpf/backtrack.c
+++ b/kernel/bpf/backtrack.c
@@ -711,6 +711,17 @@ void bpf_mark_all_scalars_precise(struct bpf_verifier_env *env,
 						i, -(j + 1) * 8);
 				}
 			}
+			for (j = 0; j < func->out_stack_arg_cnt; j++) {
+				reg = &func->stack_arg_regs[j];
+				if (reg->type != SCALAR_VALUE || reg->precise)
+					continue;
+				reg->precise = true;
+				if (env->log.level & BPF_LOG_LEVEL2) {
+					verbose(env,
+						"force_precise: frame%d: forcing r11%d to be precise\n",
+						i, -(j + 1) * BPF_REG_SIZE);
+				}
+			}
 		}
 	}
 }
diff --git a/kernel/bpf/states.c b/kernel/bpf/states.c
index f28b11c189085..4b407b629c995 100644
--- a/kernel/bpf/states.c
+++ b/kernel/bpf/states.c
@@ -1066,6 +1066,20 @@ static int propagate_precision(struct bpf_verifier_env *env,
 			bpf_bt_set_frame_slot(&env->bt, fr, i);
 			first = false;
 		}
+		for (i = 0; i < state->out_stack_arg_cnt; i++) {
+			state_reg = &state->stack_arg_regs[i];
+			if (state_reg->type != SCALAR_VALUE || !state_reg->precise)
+				continue;
+			if (env->log.level & BPF_LOG_LEVEL2) {
+				if (first)
+					verbose(env, "frame %d: propagating r11%d",
+						fr, -(i + 1) * BPF_REG_SIZE);
+				else
+					verbose(env, ",r11%d", -(i + 1) * BPF_REG_SIZE);
+			}
+			bt_set_frame_stack_arg_slot(&env->bt, fr, i);
+			first = false;
+		}
 		if (!first && (env->log.level & BPF_LOG_LEVEL2))
 			verbose(env, "\n");
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0218/1005] selftests/mm: merge: keep the far mremap() targets in the carveout
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (216 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0217/1005] bpf: Propagate scalar precision through stack arguments Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0219/1005] wifi: nxpwifi: guard the 11ax response handlers against a detached command buffer Greg Kroah-Hartman
                   ` (155 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Danish Khateeb, Andrew Morton,
	Lorenzo Stoakes (ARM), Gregory Price (Meta), Liam R. Howlett,
	Vlastimil Babka, Jann Horn, Pedro Falcato, David Hildenbrand,
	Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Shuah Khan,
	Sasha Levin

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

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

From: Danish Khateeb <danishkhateeb03@gmail.com>

[ Upstream commit 332c1bd17422c1aa59e18513042e56ea5aac4051 ]

The merge tests map their areas at fixed addresses within a 30-page
PROT_NONE carveout. Several mremap() tests move an area 1000 or 2000
pages away to separate it from the others, but those targets are outside
the carveout, and MREMAP_FIXED unmaps whatever is mapped there.

Under virtme-ng, the shared libraries are packed right above the
carveout and the dynamic linker starts about 4 MiB above it. The moves
then replace part of its text with an anonymous mapping, and the test
crashes in its next lazily bound call:

  merge[6980]: segfault at 7f7ebb3c1e60 ip 00007f7ebb3c1e60 sp 00007ffd35fbaec8 error 14

Two to four of the mremap() tests then fail with "Test terminated
unexpectedly by signal 11", depending on the exact layout. On a host
where libc is mapped at a 2 MiB aligned address, the targets happen to
land above the dynamic linker and the tests pass.

Since the areas are all within the first 30 pages, moving one by 30
pages is enough to keep it apart from the others. Add FAR_PAGES for
that distance, move areas by FAR_PAGES or 2 * FAR_PAGES pages, and make
the carveout 3 * FAR_PAGES pages so that it covers every target.

Link: https://lore.kernel.org/20261022121837.28723-1-danishkhateeb03@gmail.com
Fixes: 4e25f85b9f85 ("tools/testing/selftests: add mremap() unfaulted/faulted test cases")
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: David Hildenbrand <david@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/mm/merge.c | 33 ++++++++++++++++--------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/tools/testing/selftests/mm/merge.c b/tools/testing/selftests/mm/merge.c
index 52b8727b6628e..395502aa27947 100644
--- a/tools/testing/selftests/mm/merge.c
+++ b/tools/testing/selftests/mm/merge.c
@@ -22,9 +22,12 @@ FIXTURE(merge)
 	struct procmap_fd procmap;
 };
 
+#define FAR_PAGES	30
+#define CARVEOUT_PAGES	(3 * FAR_PAGES)
+
 static char *map_carveout(unsigned int page_size)
 {
-	return mmap(NULL, 30 * page_size, PROT_NONE,
+	return mmap(NULL, CARVEOUT_PAGES * page_size, PROT_NONE,
 		    MAP_ANON | MAP_PRIVATE, -1, 0);
 }
 
@@ -73,7 +76,7 @@ FIXTURE_SETUP(merge)
 
 FIXTURE_TEARDOWN(merge)
 {
-	ASSERT_EQ(munmap(self->carveout, 30 * self->page_size), 0);
+	ASSERT_EQ(munmap(self->carveout, CARVEOUT_PAGES * self->page_size), 0);
 	/* May fail for parent of forked process. */
 	close_procmap(&self->procmap);
 	/*
@@ -115,7 +118,7 @@ FIXTURE_SETUP(merge_with_fork)
 
 FIXTURE_TEARDOWN(merge_with_fork)
 {
-	ASSERT_EQ(munmap(self->carveout, 30 * self->page_size), 0);
+	ASSERT_EQ(munmap(self->carveout, CARVEOUT_PAGES * self->page_size), 0);
 	ASSERT_EQ(close_procmap(&self->procmap), 0);
 	/* See above. */
 	prctl(PR_SET_MEMORY_MERGE, 0, 0, 0, 0);
@@ -660,7 +663,7 @@ TEST_F(merge, mremap_unfaulted_to_faulted)
 
 	/* Offset ptr2 further away. */
 	ptr2 = sys_mremap(ptr2, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + page_size * 1000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + FAR_PAGES * page_size);
 	ASSERT_NE(ptr2, MAP_FAILED);
 
 	/*
@@ -721,7 +724,7 @@ TEST_F(merge, mremap_unfaulted_behind_faulted)
 
 	/* Offset ptr2 further away. */
 	ptr2 = sys_mremap(ptr2, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + page_size * 1000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + FAR_PAGES * page_size);
 	ASSERT_NE(ptr2, MAP_FAILED);
 
 	/*
@@ -785,12 +788,12 @@ TEST_F(merge, mremap_unfaulted_between_faulted)
 
 	/* Offset ptr3 further away. */
 	ptr3 = sys_mremap(ptr3, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + page_size * 2000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + 2 * FAR_PAGES * page_size);
 	ASSERT_NE(ptr3, MAP_FAILED);
 
 	/* Offset ptr2 further away. */
 	ptr2 = sys_mremap(ptr2, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + page_size * 1000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + FAR_PAGES * page_size);
 	ASSERT_NE(ptr2, MAP_FAILED);
 
 	/*
@@ -870,13 +873,13 @@ TEST_F(merge, mremap_unfaulted_between_faulted_unfaulted)
 
 	/* Offset ptr3 further away. */
 	ptr3 = sys_mremap(ptr3, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + page_size * 2000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + 2 * FAR_PAGES * page_size);
 	ASSERT_NE(ptr3, MAP_FAILED);
 
 
 	/* Offset ptr2 further away. */
 	ptr2 = sys_mremap(ptr2, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + page_size * 1000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + FAR_PAGES * page_size);
 	ASSERT_NE(ptr2, MAP_FAILED);
 
 	/*
@@ -1035,11 +1038,11 @@ TEST_F(merge, mremap_correct_placed_faulted)
 	 */
 	ptr3 = &ptr[10 * page_size];
 	ptr3 = sys_mremap(ptr3, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + page_size * 2000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + 2 * FAR_PAGES * page_size);
 	ASSERT_NE(ptr3, MAP_FAILED);
 	ptr2 = &ptr[5 * page_size];
 	ptr2 = sys_mremap(ptr2, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + page_size * 1000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + FAR_PAGES * page_size);
 	ASSERT_NE(ptr2, MAP_FAILED);
 
 	/*
@@ -1075,7 +1078,7 @@ TEST_F(merge, mremap_correct_placed_faulted)
 	 *                  ptr2      \       ptr       \       ptr3
 	 */
 	ptr = sys_mremap(ptr, 5 * page_size, 5 * page_size,
-			 MREMAP_MAYMOVE | MREMAP_FIXED, ptr + page_size * 1000);
+			 MREMAP_MAYMOVE | MREMAP_FIXED, ptr + FAR_PAGES * page_size);
 	ASSERT_NE(ptr, MAP_FAILED);
 
 	/*
@@ -1110,7 +1113,7 @@ TEST_F(merge, mremap_correct_placed_faulted)
 	 *                  ptr2      \       ptr       \       ptr3
 	 */
 	ptr = sys_mremap(ptr, 5 * page_size, 5 * page_size,
-			 MREMAP_MAYMOVE | MREMAP_FIXED, ptr + page_size * 1000);
+			 MREMAP_MAYMOVE | MREMAP_FIXED, ptr + FAR_PAGES * page_size);
 	ASSERT_NE(ptr, MAP_FAILED);
 
 	/*
@@ -1168,7 +1171,7 @@ TEST_F(merge, mremap_correct_placed_faulted)
 	 *      ptr                     ptr3      \       ptr2
 	 */
 	ptr2 = sys_mremap(ptr2, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + page_size * 1000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr2 + FAR_PAGES * page_size);
 	ASSERT_NE(ptr2, MAP_FAILED);
 
 	/*
@@ -1203,7 +1206,7 @@ TEST_F(merge, mremap_correct_placed_faulted)
 	 *            ptr                         \       ptr3
 	 */
 	ptr3 = sys_mremap(ptr3, 5 * page_size, 5 * page_size,
-			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + page_size * 1000);
+			  MREMAP_MAYMOVE | MREMAP_FIXED, ptr3 + FAR_PAGES * page_size);
 	ASSERT_NE(ptr3, MAP_FAILED);
 
 	/*
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0219/1005] wifi: nxpwifi: guard the 11ax response handlers against a detached command buffer
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (217 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0218/1005] selftests/mm: merge: keep the far mremap() targets in the carveout Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0220/1005] wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset Greg Kroah-Hartman
                   ` (154 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yehyeong Lee, Jeff Chen, Sasha Levin

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

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

From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>

[ Upstream commit 6a5cf549f4dcbd502db8cd00c5f49d20a2b9648f ]

nxpwifi_wait_queue_complete() clears curr_cmd->data_buf when a
synchronous command is interrupted, but nxpwifi_process_cmdresp() still
hands that field to the response handler. The three handlers in 11ax.c
store through it without checking, so a late response oopses.

Check the buffer first and return 0 when it is NULL, as the sta_cmd.c
handlers that commit 068986fd6f2a5 ("wifi: nxpwifi: detach sync command
buffer on interrupted wait") covers already do.

This is a local denial of service: it needs an interrupted synchronous
command and a late response, both on the local host.

Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Cc: stable@vger.kernel.org
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Reviewed-by: Jeff Chen <jeff.chen_1@nxp.com>
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
Stable-dep-of: f17e2eda1630 ("wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/nxp/nxpwifi/11ax.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/nxp/nxpwifi/11ax.c b/drivers/net/wireless/nxp/nxpwifi/11ax.c
index dc1e747383eca..7e9127ae2f421 100644
--- a/drivers/net/wireless/nxp/nxpwifi/11ax.c
+++ b/drivers/net/wireless/nxp/nxpwifi/11ax.c
@@ -205,9 +205,13 @@ int nxpwifi_ret_11ax_cfg(struct nxpwifi_private *priv,
 	struct host_cmd_11ax_cfg *he_cfg = &resp->params.ax_cfg;
 	struct nxpwifi_ie_types_header *header;
 	u16 left_len, tlv_type, tlv_len;
+	struct nxpwifi_11ax_he_cap_cfg *he_cap;
 	u8 ext_id;
-	struct nxpwifi_11ax_he_cap_cfg *he_cap = &ax_cfg->he_cap_cfg;
 
+	if (!ax_cfg)
+		return 0;
+
+	he_cap = &ax_cfg->he_cap_cfg;
 	left_len = le16_to_cpu(resp->size) - sizeof(*he_cfg) - S_DS_GEN;
 	header = (struct nxpwifi_ie_types_header *)he_cfg->tlv;
 
@@ -346,6 +350,9 @@ int nxpwifi_ret_11ax_cmd(struct nxpwifi_private *priv,
 	struct host_cmd_11ax_cmd *he_cmd = &resp->params.ax_cmd;
 	struct nxpwifi_ie_types_data *tlv;
 
+	if (!ax_cmd)
+		return 0;
+
 	ax_cmd->sub_id = le16_to_cpu(he_cmd->sub_id);
 
 	switch (ax_cmd->sub_command) {
@@ -584,6 +591,9 @@ int nxpwifi_ret_twt_cfg(struct nxpwifi_private *priv,
 	struct host_cmd_twt_cfg *twt_cfg_cmd = &resp->params.twt_cfg;
 	u16 action;
 
+	if (!twt_cfg)
+		return 0;
+
 	action = le16_to_cpu(twt_cfg_cmd->action);
 	twt_cfg->sub_id = le16_to_cpu(twt_cfg_cmd->sub_id);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0220/1005] wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (218 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0219/1005] wifi: nxpwifi: guard the 11ax response handlers against a detached command buffer Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:25 ` [PATCH 7.3 0221/1005] wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response Greg Kroah-Hartman
                   ` (153 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yehyeong Lee, Jeff Chen, Sasha Levin

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

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

From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>

[ Upstream commit 1cb78390d1c6c7908ab9838238a702799e0f7e9f ]

The send side writes the extension ID as the first payload byte of the
TLV in nxpwifi_cmd_11ax_cfg(), but nxpwifi_ret_11ax_cfg() reads it one
byte later and copies the HE capability from the same wrong offset. The
capability test runs on the wrong byte and the copy reads one byte past
the declared payload.

Read the extension ID and copy the capability from the first payload
byte. A zero-length extension TLV has no payload to read an extension ID
out of, so skip it.

Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Cc: stable@vger.kernel.org
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Reviewed-by: Jeff Chen <jeff.chen_1@nxp.com>
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
Stable-dep-of: f17e2eda1630 ("wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/nxp/nxpwifi/11ax.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/nxp/nxpwifi/11ax.c b/drivers/net/wireless/nxp/nxpwifi/11ax.c
index 7e9127ae2f421..16bda167fa66b 100644
--- a/drivers/net/wireless/nxp/nxpwifi/11ax.c
+++ b/drivers/net/wireless/nxp/nxpwifi/11ax.c
@@ -219,13 +219,13 @@ int nxpwifi_ret_11ax_cfg(struct nxpwifi_private *priv,
 		tlv_type = le16_to_cpu(header->type);
 		tlv_len = le16_to_cpu(header->len);
 
-		if (tlv_type == TLV_TYPE_EXTENSION_ID) {
-			ext_id = *((u8 *)header + sizeof(*header) + 1);
+		if (tlv_type == TLV_TYPE_EXTENSION_ID && tlv_len >= 1) {
+			ext_id = *((u8 *)header + sizeof(*header));
 			if (ext_id == WLAN_EID_EXT_HE_CAPABILITY) {
 				he_cap->id = tlv_type;
 				he_cap->len = tlv_len;
 				memcpy((u8 *)&he_cap->ext_id,
-				       (u8 *)header + sizeof(*header) + 1,
+				       (u8 *)header + sizeof(*header),
 				       tlv_len);
 				if (he_cfg->band_config & BIT(1)) {
 					memcpy(priv->user_he_cap,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0221/1005] wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (219 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0220/1005] wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0222/1005] drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start() Greg Kroah-Hartman
                   ` (152 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yehyeong Lee, Jeff Chen, Sasha Levin

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

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

From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>

[ Upstream commit f17e2eda1630ab375ac71a91252694a485addef7 ]

nxpwifi_ret_11ax_cfg() walks the TLVs the firmware returns and copies an
HE capability into fixed-size buffers without bounding any length. A
response shorter than the fixed part wraps the u16 walk length, and
header->len is used as a memcpy length without being checked against the
destination.

Reject a response too short for the fixed part, reject a TLV longer than
the bytes left, and reject an HE capability that does not fit its
destination. Select the destination buffer first, by band, then validate
and copy that one.

The lengths come from device firmware, so this is not a demonstrated
out-of-bounds write. The driver has not appeared in a released kernel,
so there is no stable tag.

Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Reviewed-by: Jeff Chen <jeff.chen_1@nxp.com>
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/nxp/nxpwifi/11ax.c | 49 +++++++++++++++++--------
 1 file changed, 34 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/nxp/nxpwifi/11ax.c b/drivers/net/wireless/nxp/nxpwifi/11ax.c
index 16bda167fa66b..be38a034be325 100644
--- a/drivers/net/wireless/nxp/nxpwifi/11ax.c
+++ b/drivers/net/wireless/nxp/nxpwifi/11ax.c
@@ -204,7 +204,7 @@ int nxpwifi_ret_11ax_cfg(struct nxpwifi_private *priv,
 {
 	struct host_cmd_11ax_cfg *he_cfg = &resp->params.ax_cfg;
 	struct nxpwifi_ie_types_header *header;
-	u16 left_len, tlv_type, tlv_len;
+	u16 resp_size, left_len, tlv_type, tlv_len;
 	struct nxpwifi_11ax_he_cap_cfg *he_cap;
 	u8 ext_id;
 
@@ -212,34 +212,53 @@ int nxpwifi_ret_11ax_cfg(struct nxpwifi_private *priv,
 		return 0;
 
 	he_cap = &ax_cfg->he_cap_cfg;
-	left_len = le16_to_cpu(resp->size) - sizeof(*he_cfg) - S_DS_GEN;
+	resp_size = le16_to_cpu(resp->size);
+	if (resp_size < S_DS_GEN + sizeof(*he_cfg))
+		return -EINVAL;
+
+	left_len = resp_size - S_DS_GEN - sizeof(*he_cfg);
 	header = (struct nxpwifi_ie_types_header *)he_cfg->tlv;
 
 	while (left_len > sizeof(*header)) {
 		tlv_type = le16_to_cpu(header->type);
 		tlv_len = le16_to_cpu(header->len);
 
+		if (sizeof(*header) + tlv_len > left_len)
+			return -EINVAL;
+
 		if (tlv_type == TLV_TYPE_EXTENSION_ID && tlv_len >= 1) {
 			ext_id = *((u8 *)header + sizeof(*header));
 			if (ext_id == WLAN_EID_EXT_HE_CAPABILITY) {
+				u8 *user_cap, *user_cap_len;
+				size_t user_cap_size;
+
+				if (he_cfg->band_config & BIT(1)) {
+					user_cap = priv->user_he_cap;
+					user_cap_len = &priv->user_he_cap_len;
+					user_cap_size =
+						sizeof(priv->user_he_cap);
+				} else {
+					user_cap = priv->user_2g_he_cap;
+					user_cap_len =
+						&priv->user_2g_he_cap_len;
+					user_cap_size =
+						sizeof(priv->user_2g_he_cap);
+				}
+
+				if (tlv_len > sizeof(*he_cap) -
+				    offsetof(struct nxpwifi_11ax_he_cap_cfg,
+					     ext_id) ||
+				    sizeof(*header) + tlv_len > user_cap_size)
+					return -EINVAL;
+
 				he_cap->id = tlv_type;
 				he_cap->len = tlv_len;
 				memcpy((u8 *)&he_cap->ext_id,
 				       (u8 *)header + sizeof(*header),
 				       tlv_len);
-				if (he_cfg->band_config & BIT(1)) {
-					memcpy(priv->user_he_cap,
-					       (u8 *)header,
-					       sizeof(*header) + tlv_len);
-					priv->user_he_cap_len =
-						sizeof(*header) + tlv_len;
-				} else {
-					memcpy(priv->user_2g_he_cap,
-					       (u8 *)header,
-					       sizeof(*header) + tlv_len);
-					priv->user_2g_he_cap_len =
-						sizeof(*header) + tlv_len;
-				}
+				memcpy(user_cap, (u8 *)header,
+				       sizeof(*header) + tlv_len);
+				*user_cap_len = sizeof(*header) + tlv_len;
 			}
 		}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0222/1005] drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (220 preceding siblings ...)
  2026-11-25 14:25 ` [PATCH 7.3 0221/1005] wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0223/1005] mctp i3c: Fix locking in an error path Greg Kroah-Hartman
                   ` (151 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ville Syrjälä, Jani Nikula,
	Joonas Lahtinen, Sasha Levin

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

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

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

[ Upstream commit 01aa63eade529680cb28fce40f2357bf392a249f ]

intel_vrr_dcb_vmin_vblank_start() may evaluate
intel_vrr_dcb_vmin_vblank_start_next() twice, and given that
this is doing hardware access under the hood isn't really
desired.

Even worse, the double evaluation might even cause
intel_vrr_dcb_vmin_vblank_start() itself to finally
return -EINVAL (if we race against the DMC hard enough),
which we definitely never want to do.

Eliminate the double evaluation, guaranteeing a sane
final return value at the same time.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20261023165803.31016-2-ville.syrjala@linux.intel.com
Fixes: c4aba65c26fd ("drm/i915/display: Wait for VRR PUSH status update")
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit 9defa95510abce51f68d926b445567784a0a6701)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/i915/display/intel_vrr.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index 6e03122743967..d415915e09f07 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -1170,9 +1170,13 @@ int intel_vrr_safe_window_start(const struct intel_crtc_state *crtc_state)
 static int
 intel_vrr_dcb_vmin_vblank_start(const struct intel_crtc_state *crtc_state)
 {
-	return (intel_vrr_dcb_vmin_vblank_start_next(crtc_state) < 0) ?
-		intel_vrr_dcb_vmin_vblank_start_final(crtc_state) :
-		intel_vrr_dcb_vmin_vblank_start_next(crtc_state);
+	int vblank_start;
+
+	vblank_start = intel_vrr_dcb_vmin_vblank_start_next(crtc_state);
+	if (vblank_start < 0)
+		vblank_start = intel_vrr_dcb_vmin_vblank_start_final(crtc_state);
+
+	return vblank_start;
 }
 
 int intel_vrr_vmin_safe_window_end(const struct intel_crtc_state *crtc_state)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0223/1005] mctp i3c: Fix locking in an error path
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (221 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0222/1005] drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0224/1005] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
                   ` (150 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Leo Yang, Paolo Abeni, Jeremy Kerr,
	Matt Johnston, netdev, Bart Van Assche, Sasha Levin

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

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

From: Bart Van Assche <bvanassche@acm.org>

[ Upstream commit 750eb5ab457e62e221a9c8521e2274f14c85b387 ]

If netdev_alloc_skb() fails, mctp_i3c_read() jumps to a label that
unlocks mi->lock although that mutex has not been locked yet. Fix this
by returning -ENOMEM directly. This bug has been detected by the Clang
thread-safety analyzer.

Cc: Leo Yang <Leo-Yang@quantatw.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Jeremy Kerr <jk@codeconstruct.com.au>
Cc: Matt Johnston <matt@codeconstruct.com.au>
Cc: netdev@vger.kernel.org
Fixes: 2d2d4f60ed26 ("mctp i3c: fix MCTP I3C driver multi-thread issue")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Matt Johnston <matt@codeconstruct.com.au>
Link: https://patch.msgid.link/71e0a880ffe7a83237e501b07884bf54343e76ca.1793296780.git.bvanassche@acm.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/mctp/mctp-i3c.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/mctp/mctp-i3c.c b/drivers/net/mctp/mctp-i3c.c
index 4e857dd5df642..5f225999d715e 100644
--- a/drivers/net/mctp/mctp-i3c.c
+++ b/drivers/net/mctp/mctp-i3c.c
@@ -111,8 +111,7 @@ static int mctp_i3c_read(struct mctp_i3c_device *mi)
 			       mi->mrl + sizeof(struct mctp_i3c_internal_hdr));
 	if (!skb) {
 		stats->rx_dropped++;
-		rc = -ENOMEM;
-		goto err;
+		return -ENOMEM;
 	}
 
 	skb->protocol = htons(ETH_P_MCTP);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0224/1005] ksmbd: require NUL-terminated EA names
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (222 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0223/1005] mctp i3c: Fix locking in an error path Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0225/1005] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
                   ` (149 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Yifan Zhang,
	Sasha Levin

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

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

From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>

[ Upstream commit e49296d51ccbf2ad0ed0484db1382f1d7217bd6e ]

smb2_set_ea() verifies that the byte reserved for the declared EA-name
terminator lies inside the request, but it does not verify that the byte is
zero. With SMB debug logging enabled, the name is passed to %s and the
diagnostic reads beyond the request allocation.

KASAN reports:

  BUG: KASAN: slab-out-of-bounds in string
  Read of size 1
  string
  vsnprintf
  _printk
  smb2_set_ea
  smb2_set_info

Reject an EA entry whose declared terminator byte is nonzero. Return
-EBADMSG for the malformed buffer, and map that error to
STATUS_EA_LIST_INCONSISTENT for both SET_INFO and CREATE.

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Suggested-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/smb/server/smb2pdu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 828e2cf1dda54..b64458247b160 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -3439,6 +3439,11 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
 		if (!eabuf->EaNameLength)
 			goto next;
 
+		if (eabuf->name[eabuf->EaNameLength]) {
+			rc = -EBADMSG;
+			break;
+		}
+
 		ksmbd_debug(SMB,
 			    "name : <%s>, name_len : %u, value_len : %u, next : %u\n",
 			    eabuf->name, eabuf->EaNameLength,
@@ -5622,6 +5627,8 @@ int smb2_open(struct ksmbd_work *work)
 	if (rc) {
 		if (rc == -EINVAL)
 			rsp->hdr.Status = STATUS_INVALID_PARAMETER;
+		else if (rc == -EBADMSG)
+			rsp->hdr.Status = STATUS_EA_LIST_INCONSISTENT;
 		else if (rc == -EOPNOTSUPP)
 			rsp->hdr.Status = STATUS_NOT_SUPPORTED;
 		else if ((rc == -EACCES || rc == -ESTALE || rc == -EXDEV) &&
@@ -8974,6 +8981,8 @@ int smb2_set_info(struct ksmbd_work *work)
 	}
 	else if (rc == -EINVAL)
 		rsp->hdr.Status = STATUS_INVALID_PARAMETER;
+	else if (rc == -EBADMSG)
+		rsp->hdr.Status = STATUS_EA_LIST_INCONSISTENT;
 	else if (rc == -EMSGSIZE)
 		rsp->hdr.Status = STATUS_INFO_LENGTH_MISMATCH;
 	else if (rc == -ENOSPC || rc == -EFBIG)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0225/1005] soreuseport: annotate data-races around reuse->socks[] and num_socks
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (223 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0224/1005] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0226/1005] vhost-scsi: do not count PI bytes in the data length Greg Kroah-Hartman
                   ` (148 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kuniyuki Iwashima, Eric Dumazet,
	Jiayuan Chen, Paolo Abeni, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit 213d491308b99d026514c93980cf8dd572226b1b ]

reuseport_select_sock() and reuseport_migrate_sock() read
reuse->num_socks and reuse->socks[] locklessly under RCU, while
writers holding reuseport_lock can change them.

Readers snapshot num_socks once, then index socks[] with it.
Meanwhile, writers can perform several operations, storing into
slots below the reader's stale count:

- __reuseport_detach_sock() moves the last socket into slot i.
- __reuseport_add_sock() then writes the new socket at the
  (now smaller) num_socks index.
- reuseport_stop_listen_sock() calls __reuseport_detach_sock()
  then __reuseport_add_closed_sock(), which writes slot
  max_socks - num_closed_socks - 1. This can be the slot a reader
  still considers part of the listener region when the array is full.
- __reuseport_detach_closed_sock() can then rewrite that slot.

All pointers stored in socks[] remain valid for the RCU grace period,
but without annotations the compiler is allowed to tear or reload
these accesses. For instance, reuseport_select_sock_by_hash() could
reload reuse->socks[i] between the sk_state/sk_incoming_cpu checks
and the return, returning a socket that did not pass them.

Use WRITE_ONCE() for all socks[] stores done while the array is
visible to readers, and for num_socks updates (readers already use
READ_ONCE()). Use READ_ONCE() in the two lockless readers.

Fixes: ef456144da8e ("soreuseport: define reuseport groups")
Link: https://lore.kernel.org/netdev/20260902071900.395567-1-ruanjinjie@huawei.com/
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20261030120956.3026324-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/sock_reuseport.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c
index 29948cb44b7d1..fccbdd0430b05 100644
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -124,10 +124,10 @@ static int reuseport_sock_index(struct sock *sk,
 static void __reuseport_add_sock(struct sock *sk,
 				 struct sock_reuseport *reuse)
 {
-	reuse->socks[reuse->num_socks] = sk;
+	WRITE_ONCE(reuse->socks[reuse->num_socks], sk);
 	/* paired with smp_rmb() in reuseport_(select|migrate)_sock() */
 	smp_wmb();
-	reuse->num_socks++;
+	WRITE_ONCE(reuse->num_socks, reuse->num_socks + 1);
 	reuseport_get_incoming_cpu(sk, reuse);
 }
 
@@ -139,8 +139,8 @@ static bool __reuseport_detach_sock(struct sock *sk,
 	if (i == -1)
 		return false;
 
-	reuse->socks[i] = reuse->socks[reuse->num_socks - 1];
-	reuse->num_socks--;
+	WRITE_ONCE(reuse->socks[i], reuse->socks[reuse->num_socks - 1]);
+	WRITE_ONCE(reuse->num_socks, reuse->num_socks - 1);
 	reuseport_put_incoming_cpu(sk, reuse);
 
 	return true;
@@ -149,7 +149,7 @@ static bool __reuseport_detach_sock(struct sock *sk,
 static void __reuseport_add_closed_sock(struct sock *sk,
 					struct sock_reuseport *reuse)
 {
-	reuse->socks[reuse->max_socks - reuse->num_closed_socks - 1] = sk;
+	WRITE_ONCE(reuse->socks[reuse->max_socks - reuse->num_closed_socks - 1], sk);
 	/* paired with READ_ONCE() in inet_csk_bind_conflict() */
 	WRITE_ONCE(reuse->num_closed_socks, reuse->num_closed_socks + 1);
 	reuseport_get_incoming_cpu(sk, reuse);
@@ -163,7 +163,8 @@ static bool __reuseport_detach_closed_sock(struct sock *sk,
 	if (i == -1)
 		return false;
 
-	reuse->socks[i] = reuse->socks[reuse->max_socks - reuse->num_closed_socks];
+	WRITE_ONCE(reuse->socks[i],
+		   reuse->socks[reuse->max_socks - reuse->num_closed_socks]);
 	/* paired with READ_ONCE() in inet_csk_bind_conflict() */
 	WRITE_ONCE(reuse->num_closed_socks, reuse->num_closed_socks - 1);
 	reuseport_put_incoming_cpu(sk, reuse);
@@ -521,7 +522,7 @@ static struct sock *run_bpf_filter(struct sock_reuseport *reuse, u16 socks,
 	if (index >= socks)
 		return NULL;
 
-	return reuse->socks[index];
+	return READ_ONCE(reuse->socks[index]);
 }
 
 static struct sock *reuseport_select_sock_by_hash(struct sock_reuseport *reuse,
@@ -532,7 +533,7 @@ static struct sock *reuseport_select_sock_by_hash(struct sock_reuseport *reuse,
 
 	i = j = reciprocal_scale(hash, num_socks);
 	do {
-		struct sock *sk = reuse->socks[i];
+		struct sock *sk = READ_ONCE(reuse->socks[i]);
 
 		if (sk->sk_state != TCP_ESTABLISHED) {
 			/* Paired with WRITE_ONCE() in __reuseport_(get|put)_incoming_cpu(). */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0226/1005] vhost-scsi: do not count PI bytes in the data length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (224 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0225/1005] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0227/1005] xfrm: iptfs: fix skb leak on error in __input_process_payload() Greg Kroah-Hartman
                   ` (147 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jia Jia, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Jia Jia <physicalmtea@gmail.com>

[ Upstream commit 1f5bc40e33d8b3e5e3b89047956099b0c19f1d3d ]

vhost_scsi_handle_vq() moves pi_bytesout or pi_bytesin into the
protection sgl and subtracts those bytes from exp_data_len.  The length
passed to TCM is still exp_data_len + prot_bytes.

prot_bytes comes from virtio_scsi_cmd_req_pi.  With
VIRTIO_SCSI_F_T10_PI negotiated, vhost reads that header and does not
check that the CDB is a READ or WRITE.  sbc_check_prot() replaces
data_length from the CDB only when the protect field is non-zero.
target_cmd_size_check() leaves a write's data_length unchanged when the
CDB size is smaller, so a command that does not get that replacement
keeps a data_length larger than the data sgl.

The KASAN report is a MODE SELECT whose header had pi_bytesout set.
The data sgl held only the parameter list.  spc_emulate_modeselect()
walked data_length and read the next physical page.

Pass the data sgl length.  Protected READ and WRITE still take their
length from the CDB in sbc_check_prot().

KASAN reports:

  BUG: KASAN: use-after-free in spc_emulate_modeselect+0x145/0x380 [target_core_mod]
  Read of size 1

  spc_emulate_modeselect
  __target_execute_cmd
  target_execute_cmd
  vhost_scsi_write_pending
  transport_generic_new_cmd
  __target_submit
  target_queued_submit_work
  process_one_work
  worker_thread
  kthread
  ret_from_fork
  ret_from_fork_asm

Fixes: 9f977ef7b671 ("vhost-scsi: Include prot_bytes into expected data transfer length")
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261012103954.136698-1-physicalmtea@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/scsi.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 8f57a789814f5..886a9700351bb 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1546,9 +1546,17 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
 		 * vhost_scsi_queue_data_in() and vhost_scsi_queue_status()
 		 */
 		cmd->tvc_vq_desc = vc.head;
+		/*
+		 * vhost_scsi_mapal() maps the PI bytes into cmd->prot_table.
+		 * It maps the remaining exp_data_len bytes into cmd->table,
+		 * which is the data SGL passed to the target core.  Its
+		 * expected length must therefore exclude prot_bytes.
+		 *
+		 * sbc_check_prot() derives the data length for protected READ
+		 * and WRITE commands from the CDB.
+		 */
 		vhost_scsi_target_queue_cmd(nexus, cmd, cdb, lun, task_attr,
-					    data_direction,
-					    exp_data_len + prot_bytes);
+					    data_direction, exp_data_len);
 		ret = 0;
 err:
 		/*
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0227/1005] xfrm: iptfs: fix skb leak on error in __input_process_payload()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (225 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0226/1005] vhost-scsi: do not count PI bytes in the data length Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0228/1005] power: sequencing: qcom-wcn: increase WCN7850 power-up delay Greg Kroah-Hartman
                   ` (146 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+a3f21220cbbb6e14ee2e,
	Eric Dumazet, Steffen Klassert, Paolo Abeni, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit 64e45ed926cdd017c9816c8006d9117a7194c7e9 ]

syzbot reported a memory leak of the received skb (and its sec_path
extension) in the IP-TFS receive path.

__input_process_payload() parses the inner packets of an IP-TFS payload
and queues them on @sublist, which is only sent after the parsing loop.
Three error paths inside the loop (skb_copy_seq_read() failure, invalid
inner IPv4 header length, unknown IP version) jump to the "done" label,
which is placed after the code sending @sublist.

Any skb already queued on @sublist is then neither delivered nor freed.
This includes skbs added by iptfs_reassem_cont() before the call, newly
allocated inner packets, and, since the received skb can be reused for
the first inner packet, the received skb itself.

Move the "done" label before the trim/send code, so that inner packets
parsed before the error are delivered as on the normal exit path. The
received skb is then still freed (or consumed) as before when it was
not reused.

Fixes: 6c82d2433671 ("xfrm: iptfs: add basic receive packet (tunnel egress) handling")
Reported-by: syzbot+a3f21220cbbb6e14ee2e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6ae4102e.9c6421ad.36baac.0005.GAE@google.com/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Link: https://patch.msgid.link/20261030083358.2653599-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/xfrm/xfrm_iptfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c
index 6920940a35b49..71bdc8d61015d 100644
--- a/net/xfrm/xfrm_iptfs.c
+++ b/net/xfrm/xfrm_iptfs.c
@@ -1183,6 +1183,7 @@ static bool __input_process_payload(struct xfrm_state *x, u32 data,
 		/* this should not happen from the above code */
 		XFRM_INC_STATS(net, LINUX_MIB_XFRMINIPTFSERROR);
 
+done:
 	if (first_skb && first_iplen && !defer && !first_skb_partial) {
 		/* first_skb is queued b/c !defer and not partial */
 		if (pskb_trim(first_skb, first_iplen)) {
@@ -1199,7 +1200,7 @@ static bool __input_process_payload(struct xfrm_state *x, u32 data,
 		if (xfrm_input(skb, 0, 0, -2))
 			kfree_skb(skb);
 	}
-done:
+
 	skb = skbseq->root_skb;
 	skb_abort_seq_read(skbseq);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0228/1005] power: sequencing: qcom-wcn: increase WCN7850 power-up delay
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (226 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0227/1005] xfrm: iptfs: fix skb leak on error in __input_process_payload() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0229/1005] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
                   ` (145 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cheng Jiang, Shuai Zhang,
	Dmitry Baryshkov, Bartosz Golaszewski, Sasha Levin

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

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

From: Shuai Zhang <shuai.zhang@oss.qualcomm.com>

[ Upstream commit bd60a639b621453fe37b780df4b6d3a13f981f13 ]

When the WCN7850 is powered up from the Bluetooth side first, i.e.
BT_EN is asserted while WLAN_EN is still low, the chip starts from a
cold state and is not ready to accept the first HCI command 50 ms after
BT_EN goes high. The first command (0xfc00, read QCA version) is lost,
hci_qca does not resend it and fails after the 2 s command timeout:

  Bluetooth: hci0: Reading QCA version information failed (-110)

When WLAN is powered first, 50 ms is sufficient, so the failure only
shows up in the BT-first ordering. Measured on the affected board by
which enable pin rose first:

  pwup_delay_ms   BT-first boots   with -110
  50              9                9
  75              23               0
  100             21               0
  300             20               0

Raise the power-up delay of WCN7850 to 100 ms. The delay is shared by
the Bluetooth and WLAN targets, so WLAN power-up also waits 50 ms
longer.

Fixes: 2f1630f437df ("power: pwrseq: add a driver for the PMU module on the QCom WCN chipsets")
Signed-off-by: Cheng Jiang <cheng.jiang@oss.qualcomm.com>
Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20261102094800.3225454-1-shuai.zhang@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/power/sequencing/pwrseq-qcom-wcn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/sequencing/pwrseq-qcom-wcn.c b/drivers/power/sequencing/pwrseq-qcom-wcn.c
index 34146d6372f39..1e893565bf596 100644
--- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
+++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
@@ -397,7 +397,7 @@ static const char *const pwrseq_wcn7850_vregs[] = {
 static const struct pwrseq_qcom_wcn_pdata pwrseq_wcn7850_of_data = {
 	.vregs = pwrseq_wcn7850_vregs,
 	.num_vregs = ARRAY_SIZE(pwrseq_wcn7850_vregs),
-	.pwup_delay_ms = 50,
+	.pwup_delay_ms = 100,
 	.targets = pwrseq_qcom_wcn_targets,
 };
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0229/1005] vhost-scsi: validate event queue descriptor direction
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (227 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0228/1005] power: sequencing: qcom-wcn: increase WCN7850 power-up delay Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0230/1005] virtio_ring: use shadow flags when detaching split descriptors Greg Kroah-Hartman
                   ` (144 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jia Jia, Linfeng Sun,
	Michael S. Tsirkin, Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit 3d8c5b714c186d08c8fe8c8cfd1f9b89525ab067 ]

vhost_get_vq_desc() returns the number of device readable (output) and
device writable (input) iovec segments. A guest can submit an eventq
descriptor chain that fills vq->iov with output segments, setting out
to ARRAY_SIZE(vq->iov) and in to zero.

When the host later queues a vhost-scsi event, vhost_scsi_do_evt_work()
uses out as the index of the first input segment. This accesses one element
beyond vq->iov and triggers an array-index-out-of-bounds report. With
panic_on_warn enabled, the report panics the host.

The event queue accepts device writable buffers only. Reject chains that
contain output segments or lack an input segment before using out as an
index. The input check prevents the out-of-bounds access, while the output
check validates the eventq descriptor direction.

I found the descriptor direction issue myself, though the patch was
written with AI assistance.  The out-of-bounds read with an
output-only chain was separately reported by Jia Jia.

Fixes: a6c9af87363c ("tcm_vhost: Add hotplug/hotunplug support")
Reported-by: Jia Jia <physicalmtea@gmail.com>
Assisted-by: OpenAI-Codex:GPT-5
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Message-ID: <20261009-fix-arrary-index-out-of-bounds-in-vhost_scsi_complete_events-v2-1-1f7689a54735@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/scsi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 886a9700351bb..8a32687f7424b 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -638,6 +638,16 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
 		return;
 	}
 
+	/*
+	 * Eventq buffers are device-writable only. A nonzero in count
+	 * guarantees that out is within the bounds of vq->iov.
+	 */
+	if (unlikely(out || !in)) {
+		vq_err(vq, "Invalid event buffer: out %u, in %u\n", out, in);
+		vs->vs_events_missed = true;
+		return;
+	}
+
 	if ((vq->iov[out].iov_len != sizeof(struct virtio_scsi_event))) {
 		vq_err(vq, "Expecting virtio_scsi_event, got %zu bytes\n",
 				vq->iov[out].iov_len);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0230/1005] virtio_ring: use shadow flags when detaching split descriptors
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (228 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0229/1005] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0231/1005] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
                   ` (143 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Michael S. Tsirkin, sungbyeongchan,
	Sasha Levin

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

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

From: sungbyeongchan <tjdqudcks0424@naver.com>

[ Upstream commit e498eb93f961db1a1dfdabd373500f0d4019c9a4 ]

Split virtqueues save descriptor flags and next indexes in desc_extra
before publishing descriptors to the device. The detach path uses the
shadow next index, but decides whether to continue by rereading the NEXT
flag from the shared descriptor.

Use the shadow flags for the continuation decision as well. This keeps
all detach metadata in the same driver-owned snapshot and avoids an
unnecessary shared-ring read.

Fixes: 72b5e8958738 ("virtio-ring: store DMA metadata in desc_extra for split virtqueue")
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Assisted-by: LLM
Signed-off-by: sungbyeongchan <tjdqudcks0424@naver.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261008050423.32221-1-tjdqudcks0424@naver.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/virtio/virtio_ring.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index d0dc4645b5b37..bec008123ce89 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -910,7 +910,6 @@ static unsigned detach_buf_split_in_order(struct vring_virtqueue *vq,
 {
 	struct vring_desc_extra *extra;
 	unsigned int i;
-	__virtio16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT);
 
 	/* Clear data ptr. */
 	vq->split.desc_state[head].data = NULL;
@@ -920,7 +919,7 @@ static unsigned detach_buf_split_in_order(struct vring_virtqueue *vq,
 	/* Put back on free list: unmap first-level descriptors and find end */
 	i = head;
 
-	while (vq->split.vring.desc[i].flags & nextflag) {
+	while (extra[i].flags & VRING_DESC_F_NEXT) {
 		i = vring_unmap_one_split(vq, &extra[i]);
 		vq->vq.num_free++;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0231/1005] vhost-scsi: reject delayed virtqueue setup
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (229 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0230/1005] virtio_ring: use shadow flags when detaching split descriptors Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0232/1005] vhost: reject backend enable without a kick file Greg Kroah-Hartman
                   ` (142 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit a543346b96a174fcee6812ac2764acc8dc993358 ]

vhost_scsi_set_endpoint() allocates command pools only for I/O
virtqueues that are already set up, but publishes the backend for every
virtqueue. Userspace can complete a skipped queue after attaching the
endpoint, then kick it with scsi_tags uninitialized and trigger the
alloc_hint warning in sbitmap_get().

Delayed virtqueue setup is not supported. Leave skipped I/O virtqueues
inactive and reject changes to the vring size or addresses while an
endpoint is attached. Userspace must clear the endpoint before changing
the vring configuration.

I found this bug myself, though the patch was written with AI assistance.

Fixes: 25b98b64e284 ("vhost scsi: alloc cmds per vq instead of session")
Assisted-by: OpenAI-Codex:GPT-5.6
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261010-fix-warning-in-sbitmap_get-v3-1-33de562d1359@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/scsi.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 8a32687f7424b..1274e7734747e 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -2135,6 +2135,9 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
 
 		for (i = 0; i < vs->dev.nvqs; i++) {
 			vq = &vs->vqs[i].vq;
+			if (i >= VHOST_SCSI_VQ_IO && !vs->vqs[i].scsi_cmds)
+				continue;
+
 			mutex_lock(&vq->mutex);
 			vhost_vq_set_backend(vq, vs_tpg);
 			vhost_vq_init_access(vq);
@@ -2496,10 +2499,16 @@ vhost_scsi_ioctl(struct file *f,
 	default:
 		mutex_lock(&vs->dev.mutex);
 		r = vhost_dev_ioctl(&vs->dev, ioctl, argp);
-		if (r == -ENOIOCTLCMD)
-			r = vhost_vring_ioctl(&vs->dev, ioctl, argp);
-		else
+		if (r == -ENOIOCTLCMD) {
+			if (vs->vs_tpg &&
+			    (ioctl == VHOST_SET_VRING_NUM ||
+			     ioctl == VHOST_SET_VRING_ADDR))
+				r = -EBUSY;
+			else
+				r = vhost_vring_ioctl(&vs->dev, ioctl, argp);
+		} else {
 			vhost_scsi_flush(vs);
+		}
 		mutex_unlock(&vs->dev.mutex);
 		return r;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0232/1005] vhost: reject backend enable without a kick file
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (230 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0231/1005] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0233/1005] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
                   ` (141 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit 509f6bd229e94fc39506e01be692c4aa22338b49 ]

Enabling a backend without VHOST_SET_VRING_KICK dereferences a NULL
vq->kick in vhost_poll_start(). Reject the request with -EINVAL.

Fixes: 264ee5aa81ec ("tools/virtio: Add --reset")
Assisted-by: OpenAI-Codex:GPT-5.6
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261011-fix-null-pointer-in-vhost_test_set_backend-v1-1-60b2f12d64c6@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c
index 24514c8fdee49..15b19e07f811f 100644
--- a/drivers/vhost/test.c
+++ b/drivers/vhost/test.c
@@ -287,6 +287,10 @@ static long vhost_test_set_backend(struct vhost_test *n, unsigned index, int fd)
 		r = -EFAULT;
 		goto err_vq;
 	}
+	if (enable && !vq->kick) {
+		r = -EINVAL;
+		goto err_vq;
+	}
 	if (!enable) {
 		vhost_poll_stop(&vq->poll);
 		backend = vhost_vq_get_backend(vq);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0233/1005] vhost-vdpa: initialize state before publishing cdev
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (231 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0232/1005] vhost: reject backend enable without a kick file Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0234/1005] virtio_balloon: initialize wakeup_lock before virtqueues are set up Greg Kroah-Hartman
                   ` (140 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
	Sasha Levin

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

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

From: Linfeng Sun <linfeng.sun.dev@gmail.com>

[ Upstream commit 4b03d1e7f13613af708441a061556de99891a516 ]

Initialize the completion and as hash buckets before cdev_device_add()
makes the device accessible.

Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")
Assisted-by: OpenAI-Codex:GPT-5.6
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261011-fix-null-pointer-in-vhost_vdpa_release-v2-1-66ba929971ce@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/vdpa.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 81a6fbab8c0d6..ad5d1dfd104d0 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -1707,7 +1707,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
 		return minor;
 	}
 
-	atomic_set(&v->opened, 0);
+	atomic_set(&v->opened, 1);
 	spin_lock_init(&v->config_lock);
 	v->minor = minor;
 	v->vdpa = vdpa;
@@ -1730,16 +1730,17 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
 
 	cdev_init(&v->cdev, &vhost_vdpa_fops);
 	v->cdev.owner = THIS_MODULE;
+	init_completion(&v->completion);
+	for (i = 0; i < VHOST_VDPA_IOTLB_BUCKETS; i++)
+		INIT_HLIST_HEAD(&v->as[i]);
 
 	r = cdev_device_add(&v->cdev, &v->dev);
 	if (r)
 		goto err;
 
-	init_completion(&v->completion);
 	vdpa_set_drvdata(vdpa, v);
 
-	for (i = 0; i < VHOST_VDPA_IOTLB_BUCKETS; i++)
-		INIT_HLIST_HEAD(&v->as[i]);
+	atomic_set_release(&v->opened, 0);
 
 	return 0;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0234/1005] virtio_balloon: initialize wakeup_lock before virtqueues are set up
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (232 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0233/1005] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0235/1005] vhost-scsi: fix page reference leak in misaligned I/O fallback Greg Kroah-Hartman
                   ` (139 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+13df72e0dc4be5c62215,
	Mingbing Zhai, Michael S. Tsirkin, Sasha Levin

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

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

From: Mingbing Zhai <zhaimingbing@cmss.chinamobile.com>

[ Upstream commit 161aa708b02cc997a51701c342f3cebade0b5164 ]

Since c578123e63da ("virtio_balloon: Treat stats requests as wakeup
events") the stats_request() virtqueue callback takes vb->wakeup_lock
via start_wakeup_event().  init_vqs() registers that callback and even
primes and kicks the stats queue, so the lock is reachable from irq
context as soon as init_vqs() returns, long before the driver sets
DRIVER_OK: vring_interrupt() dispatches to the callback without any
DRIVER_OK check unless CONFIG_VIRTIO_HARDEN_NOTIFICATION is set, and
that option depends on BROKEN.  syzbot hit it from a threaded irq:

  INFO: trying to register non-static key in stats_request
  ...
  assign_lock_key
  register_lock_class
  lock_acquire
  rt_spin_lock
  start_wakeup_event drivers/virtio/virtio_balloon.c:150 [inline]
  stats_request drivers/virtio/virtio_balloon.c:435

The lock is only initialized near the end of virtballoon_probe(),
after init_vqs() and several steps that can still fail and unwind
through del_vqs(), where a racing interrupt still finds the callback
registered.  Until then it is whatever kzalloc() left in vb: lockdep
complains about the unregistered lock class, and wakeup_signal_mask
and processing_wakeup_event get updated from irq context while probe
is still running.

The rt_spin_lock() in the report is just spin_lock() on PREEMPT_RT;
any PROVE_LOCKING build takes the same path.

stop_update_lock(), which the same callback also acquires, is already
initialized before init_vqs(); do the same for wakeup_lock.

Fixes: c578123e63da ("virtio_balloon: Treat stats requests as wakeup events")
Reported-by: syzbot+13df72e0dc4be5c62215@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=13df72e0dc4be5c62215
Signed-off-by: Mingbing Zhai <zhaimingbing@cmss.chinamobile.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261016025429.901-1-zhaimingbing@cmss.chinamobile.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/virtio/virtio_balloon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index ab3e3d887e00f..8c1b47ec17a29 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -942,6 +942,7 @@ static int virtballoon_probe(struct virtio_device *vdev)
 	INIT_WORK(&vb->update_balloon_stats_work, update_balloon_stats_func);
 	INIT_WORK(&vb->update_balloon_size_work, update_balloon_size_func);
 	spin_lock_init(&vb->stop_update_lock);
+	spin_lock_init(&vb->wakeup_lock);
 	mutex_init(&vb->balloon_lock);
 	init_waitqueue_head(&vb->acked);
 	vb->vdev = vdev;
@@ -1049,8 +1050,6 @@ static int virtballoon_probe(struct virtio_device *vdev)
 			goto out_unregister_oom;
 	}
 
-	spin_lock_init(&vb->wakeup_lock);
-
 	/*
 	 * The virtio balloon itself can't wake up the device, but it is
 	 * responsible for processing wakeup events passed up from the transport
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0235/1005] vhost-scsi: fix page reference leak in misaligned I/O fallback
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (233 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0234/1005] virtio_balloon: initialize wakeup_lock before virtqueues are set up Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0236/1005] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
                   ` (138 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mike Christie, Jia Jia,
	Michael S. Tsirkin, Sasha Levin

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

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

From: Jia Jia <physicalmtea@gmail.com>

[ Upstream commit 058fc59326af3350c6e830858e56d2aeecabe0a2 ]

iov_iter_get_pages2() returns a byte count that excludes the offset into
the first page, but also returns a reference to that page in pages[].

On the misaligned-I/O fallback, vhost_scsi_revert_map_iov_to_sgl() puts
pages already added to the SG list. The cleanup loop starts at
pages[npages], but accounts for its first page as PAGE_SIZE bytes
rather than PAGE_SIZE - offset. If the remaining data starts at a
non-zero offset, it can finish one page early and leave a page reference
behind.

Use PAGE_SIZE - offset for the first remaining page and clear offset for
later pages, as in the mapping loop. Without this, each affected request
leaks one page reference.

Fixes: bca939d5bcd0 ("vhost-scsi: Dynamically allocate scatterlists")
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Jia Jia <physicalmtea@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261023104035.6686-1-physicalmtea@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/scsi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 1274e7734747e..6bf1ab773d54e 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -900,11 +900,16 @@ vhost_scsi_map_to_sgl(struct vhost_scsi_cmd *cmd,
 	vhost_scsi_revert_map_iov_to_sgl(iter, *sgl, sg);
 
 	iov_iter_revert(iter, bytes);
+	/*
+	 * pages[npages] is the first page not added to the SG list.
+	 * The remaining data starts at offset in that page.
+	 */
 	while (bytes) {
-		n = min_t(unsigned int, PAGE_SIZE, bytes);
+		n = min_t(unsigned int, PAGE_SIZE - offset, bytes);
 
 		put_page(pages[npages++]);
 		bytes -= n;
+		offset = 0;
 	}
 
 	return -EINVAL;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0236/1005] ext2: only flush DIRSYNC directories on every change
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (234 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0235/1005] vhost-scsi: fix page reference leak in misaligned I/O fallback Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0237/1005] printk: Avoid multiple unregistration in unregister_console_locked() Greg Kroah-Hartman
                   ` (137 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Bacik, Jan Kara, Sasha Levin

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

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

From: Josef Bacik <josef@toxicpanda.com>

[ Upstream commit 3f57fc2c49ed05ccfc56e4dc9eda41be95925bbd ]

Every change of an ext2 directory is written to disk before the system call
returns, whether the directory is DIRSYNC or not: its pages with
filemap_write_and_wait() and its inode with sync_inode_metadata().

Writes which reach the device for 2000 files, and 200 directories, in a
directory without DIRSYNC, with the flusher turned off:

            create   rename   unlink   mkdir
    before    4000     8000     4000     800
    after        0        0        0       0

In a directory with chattr +D the numbers are those of "before", before and
after.

commit bc943f4872a7 ("ext2: Don't flush page immediately for DIRSYNC
directories") moved the flush from ext2_commit_chunk() to the new
ext2_handle_dirsync().  The IS_DIRSYNC() check which was around it didn't
move along.

Fix by putting the check into ext2_handle_dirsync().

Fixes: bc943f4872a7 ("ext2: Don't flush page immediately for DIRSYNC directories")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-b4-ext2-dirsync-v1-1-3dcd012d518d@toxicpanda.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ext2/dir.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index e17bbc7598c14..5de32c221a83b 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -442,6 +442,9 @@ static int ext2_handle_dirsync(struct inode *dir)
 {
 	int err;
 
+	if (!IS_DIRSYNC(dir))
+		return 0;
+
 	err = filemap_write_and_wait(dir->i_mapping);
 	if (!err)
 		err = sync_inode_metadata(dir, 1);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0237/1005] printk: Avoid multiple unregistration in unregister_console_locked()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (235 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0236/1005] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0238/1005] blk-mq: reset queue state on scheduler teardown Greg Kroah-Hartman
                   ` (136 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, John Ogness, Petr Mladek,
	Derek Barbosa, Sasha Levin

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

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

From: John Ogness <john.ogness@linutronix.de>

[ Upstream commit 8a7f26aa072a4e63bc3b1adfe649546709db722e ]

unregister_console_locked() is called from within
hlist_for_each_entry_safe(console_list) loops. This would be safe if
unregister_console_locked() only unregistered the specified console. After
all, that is what the _safe variant is for.

However, unregister_console_locked() calls printk_kthreads_check_locked(),
which can unregister _multiple_ consoles if kthreads fail to start. This
could lead to hlist_for_each_entry_safe() use-after-free scenarios because
not only was the list entry removed, but possibly the following entry as
well (the @n temporary storage of the next entry).

Move the call to printk_kthreads_check_locked() outside of
unregister_console_locked(). Add comments to both functions to clarify
if they are safe to be used in hlist_for_each_entry_safe(console_list)
loops.

Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/lkml/87ik31iz4x.fsf@jogness.linutronix.de
Fixes: 76f258bf3f2a ("printk: nbcon: Introduce printer kthreads")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Derek Barbosa <debarbos@redhat.com>
Link: https://patch.msgid.link/20261030135802.663893-1-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/printk/printk.c | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index bc3b9f6e404bc..a14ab648ee9bc 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3790,6 +3790,13 @@ static struct syscore printk_syscore = {
  * If appropriate, start nbcon kthreads and set @printk_kthreads_running.
  * If any kthreads fail to start, those consoles are unregistered.
  *
+ * Called after consoles are registered or unregistered.
+ *
+ * This MUST NOT be called within an hlist_for_each_entry_safe(console_list)
+ * loop because it can unregister multiple consoles if any kthreads fail to
+ * start. That would lead to use-after-free scenarios within the
+ * hlist_for_each_entry_safe(console_list) loop of the caller.
+ *
  * Must be called under console_list_lock().
  */
 static void printk_kthreads_check_locked(void)
@@ -4228,7 +4235,20 @@ void register_console(struct console *newcon)
 }
 EXPORT_SYMBOL(register_console);
 
-/* Must be called under console_list_lock(). */
+/*
+ * Unregister the specified console.
+ *
+ * This can be called safely from within an
+ * hlist_for_each_entry_safe(console_list) loop because it unregisters
+ * _only_ the specified console.
+ *
+ * Afterwards the caller should call printk_kthreads_check_locked() since
+ * unregistering a console may require printer threads to start/stop. Note
+ * that printk_kthreads_check_locked() cannot be called safely from within
+ * an hlist_for_each_entry_safe(console_list) loop.
+ *
+ * Must be called under console_list_lock().
+ */
 static int unregister_console_locked(struct console *console)
 {
 	bool use_device_lock = (console->flags & CON_NBCON) && console->write_atomic;
@@ -4320,9 +4340,6 @@ static int unregister_console_locked(struct console *console)
 	if (console->exit)
 		res = console->exit(console);
 
-	/* Changed console list, may require printer threads to start/stop. */
-	printk_kthreads_check_locked();
-
 	return res;
 }
 
@@ -4331,7 +4348,12 @@ int unregister_console(struct console *console)
 	int res;
 
 	console_list_lock();
+
 	res = unregister_console_locked(console);
+
+	/* Changed console list, may require printer threads to start/stop. */
+	printk_kthreads_check_locked();
+
 	console_list_unlock();
 	return res;
 }
@@ -4455,6 +4477,10 @@ static int __init printk_late_init(void)
 			unregister_console_locked(con);
 		}
 	}
+
+	/* Changed console list, may require printer threads to start/stop. */
+	printk_kthreads_check_locked();
+
 	console_list_unlock();
 
 	ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0238/1005] blk-mq: reset queue state on scheduler teardown
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (236 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0237/1005] printk: Avoid multiple unregistration in unregister_console_locked() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0239/1005] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
                   ` (135 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jianan Huang, Christoph Hellwig,
	Jens Axboe, Sasha Levin

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

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

From: Jianan Huang <jnhuang95@gmail.com>

[ Upstream commit 3a9892bca4dd0182db61702e131cad569b1d71e6 ]

We observed I/O timeouts with requests stalled in per-CPU software
queues.

The affected queue had no elevator, but QUEUE_FLAG_SQ_SCHED remained
set. A failed elevator switch can leave this state when falling back to
none without clearing the flag. With empty hctx dispatch lists, a
queue-wide restart on CPU4 would skip requests pending in ctx5/ctx7:

CPU4: blk_mq_run_hw_queues(q)
  sq_hctx = hctx4
  hctx4: no pending requests   -> selected
  hctx5: 9 reads in ctx5       -> skipped
  hctx7: 3 writes in ctx7      -> skipped

The pending requests may remain undispatched until another event runs
their hardware queues.

Clear the flag and restore nr_requests and async_depth to the driver
queue depth in the common scheduler teardown path, covering both
scheduler exit and failed initialization.

Fixes: 4d337cebcb1c ("blk-mq: avoid to touch q->elevator without any protection")
Assisted-by: LLM
Signed-off-by: Jianan Huang <jnhuang95@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20261023092611.116795-1-jnhuang95@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/blk-mq-sched.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 0a00f5a76f5a8..d7b45778732b8 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -374,7 +374,7 @@ bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq,
 }
 EXPORT_SYMBOL_GPL(blk_mq_sched_try_insert_merge);
 
-/* called in queue's release handler, tagset has gone away */
+/* Clear scheduler tags and reset queue state. */
 static void blk_mq_sched_tags_teardown(struct request_queue *q, unsigned int flags)
 {
 	struct blk_mq_hw_ctx *hctx;
@@ -385,6 +385,10 @@ static void blk_mq_sched_tags_teardown(struct request_queue *q, unsigned int fla
 
 	if (blk_mq_is_shared_tags(flags))
 		q->sched_shared_tags = NULL;
+
+	blk_queue_flag_clear(QUEUE_FLAG_SQ_SCHED, q);
+	q->nr_requests = q->tag_set->queue_depth;
+	q->async_depth = q->tag_set->queue_depth;
 }
 
 void blk_mq_sched_reg_debugfs(struct request_queue *q)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0239/1005] virtio-blk: Fix zone append sector reporting in batched completion
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (237 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0238/1005] blk-mq: reset queue state on scheduler teardown Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0240/1005] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
                   ` (134 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Michael S. Tsirkin,
	Stefan Hajnoczi, Christoph Hellwig, Jens Axboe, Sasha Levin

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

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

From: Shao Mingyin <shao.mingyin@zte.com.cn>

[ Upstream commit 08a6572441a4e646c96c2b8d8ead9eea0e458332 ]

For zone append, the block layer copies req->__sector back into the
bio in blk_zone_append_update_request_bio(), so the driver must update
req->__sector with the sector reported by the device.
virtblk_request_done() does that, but the batched completion path used
by virtblk_poll() only unmaps and cleans up the requests before calling
blk_mq_end_request_batch().

A zone append completed through polling therefore keeps the sector that
was assigned at submission time, and the file system or application sees
the wrong LBA for the written data.

Move the sector update into a helper and call it from both completion
paths.

Fixes: 95bfec41bd3d ("virtio-blk: add support for zoned block devices")
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/202610261955196384aSLGuy3_0MiTvlYXVdiC@zte.com.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/virtio_blk.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index f97799b5154f2..1efc1ca38928a 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -331,18 +331,25 @@ static inline u8 virtblk_vbr_status(struct virtblk_req *vbr)
 	return *((u8 *)&vbr->in_hdr + vbr->in_hdr_len - 1);
 }
 
+static inline void virtblk_update_zone_append_sector(struct request *req,
+						     struct virtblk_req *vbr)
+{
+	struct virtio_blk *vblk = req->mq_hctx->queue->queuedata;
+
+	if (req_op(req) == REQ_OP_ZONE_APPEND)
+		req->__sector = virtio64_to_cpu(vblk->vdev,
+						vbr->in_hdr.zone_append.sector);
+}
+
 static inline void virtblk_request_done(struct request *req)
 {
 	struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
 	blk_status_t status = virtblk_result(virtblk_vbr_status(vbr));
-	struct virtio_blk *vblk = req->mq_hctx->queue->queuedata;
 
 	virtblk_unmap_data(req, vbr);
 	virtblk_cleanup_cmd(req);
 
-	if (req_op(req) == REQ_OP_ZONE_APPEND)
-		req->__sector = virtio64_to_cpu(vblk->vdev,
-						vbr->in_hdr.zone_append.sector);
+	virtblk_update_zone_append_sector(req, vbr);
 
 	blk_mq_end_request(req, status);
 }
@@ -1220,8 +1227,11 @@ static void virtblk_complete_batch(struct io_comp_batch *iob)
 	struct request *req;
 
 	rq_list_for_each(&iob->req_list, req) {
-		virtblk_unmap_data(req, blk_mq_rq_to_pdu(req));
+		struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
+
+		virtblk_unmap_data(req, vbr);
 		virtblk_cleanup_cmd(req);
+		virtblk_update_zone_append_sector(req, vbr);
 	}
 	blk_mq_end_request_batch(iob);
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0240/1005] block: partitions: reject GPT entries with starting_lba > ending_lba
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (238 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0239/1005] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0241/1005] block: report the correct discard alignment in sysfs Greg Kroah-Hartman
                   ` (133 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zizhi Wo, Christoph Hellwig,
	Jens Axboe, Sasha Levin

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

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

From: Zizhi Wo <wozizhi@huawei.com>

[ Upstream commit 7e3801d12ebabaa3db6e2685ccc80b6e6f6d1ff7 ]

A GPT entry whose starting_lba is greater than its ending_lba is accepted,
and the kernel creates a partition with a bogus size. The bogus sector
count defeats the end-of-device check, so I/O through that partition is not
confined to it and can access sectors outside the partition on the same
disk.

is_pte_valid() only rejects an entry when its type is NULL or when
starting_lba or ending_lba is greater than lastlba; it never checks that
starting_lba <= ending_lba. For a reversed entry both field checks still
pass, but efi_partition() computes size = ending_lba - starting_lba + 1 in
u64, which underflows to a huge value. That value also wraps in the
end-of-device check in blk_add_partition() (from + size) and does not fit
the signed i_size, which turns negative.

Reject entries with starting_lba > ending_lba in is_pte_valid(), matching
the head-level check against last_usable_lba < first_usable_lba.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20261102080442.3775061-1-wozizhi@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/partitions/efi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index 9865d59093fac..b31227a13db0b 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -460,6 +460,7 @@ static inline int
 is_pte_valid(const gpt_entry *pte, const u64 lastlba)
 {
 	if ((!efi_guidcmp(pte->partition_type_guid, NULL_GUID)) ||
+	    le64_to_cpu(pte->starting_lba) > le64_to_cpu(pte->ending_lba) ||
 	    le64_to_cpu(pte->starting_lba) > lastlba         ||
 	    le64_to_cpu(pte->ending_lba)   > lastlba)
 		return 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0241/1005] block: report the correct discard alignment in sysfs
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (239 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0240/1005] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0242/1005] zloop: fix the error code in the blk_mq_alloc_disk message Greg Kroah-Hartman
                   ` (132 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Avi Weiss, Christoph Hellwig,
	Jens Axboe, Sasha Levin

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

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

From: Avi Weiss <thnkslprpt@gmail.com>

[ Upstream commit 2516f0413f8704a7370ef8a2eeae26c9bc438978 ]

disk_discard_alignment_show() reports the physical I/O alignment offset
instead of the discard alignment. Devices can specify these offsets
independently, so the discard_alignment sysfs attribute can report the
wrong value.

Use bdev_discard_alignment() for the whole-disk attribute, as is already
done for partitions.

Fixes: 4e1462ffe899 ("block: remove queue_discard_alignment")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20261031102023.3644494-2-thnkslprpt@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/genhd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/genhd.c b/block/genhd.c
index 10ca8b4d6eea7..69204d44adae1 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1146,7 +1146,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
 {
 	struct gendisk *disk = dev_to_disk(dev);
 
-	return sysfs_emit(buf, "%d\n", bdev_alignment_offset(disk->part0));
+	return sysfs_emit(buf, "%u\n", bdev_discard_alignment(disk->part0));
 }
 
 static ssize_t diskseq_show(struct device *dev,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0242/1005] zloop: fix the error code in the blk_mq_alloc_disk message
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (240 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0241/1005] block: report the correct discard alignment in sysfs Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0243/1005] zloop: reject mismatched conventional zone files on restore Greg Kroah-Hartman
                   ` (131 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Christoph Hellwig,
	Damien Le Moal, Jens Axboe, Sasha Levin

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

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

From: Shao Mingyin <shao.mingyin@zte.com.cn>

[ Upstream commit 703f6aee8d8d1cb6227af56169be6b1dc4d3c4d5 ]

When blk_mq_alloc_disk() fails, "ret" still holds the zero returned by the
preceding blk_mq_alloc_tag_set() call, so the error message always reports
"err=0".  Save PTR_ERR(zlo->disk) in "ret" before printing it, like the
blk_mq_alloc_tag_set() and add_disk() failure paths do.

Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/20261031221737569WQ3bg8y80Ht7JdTCWwlkL@zte.com.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/zloop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index e02a5249ae604..8884fa63c23a4 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -1329,8 +1329,8 @@ static int zloop_ctl_add(struct zloop_options *opts)
 
 	zlo->disk = blk_mq_alloc_disk(&zlo->tag_set, &lim, zlo);
 	if (IS_ERR(zlo->disk)) {
-		pr_err("blk_mq_alloc_disk failed (err=%d)\n", ret);
 		ret = PTR_ERR(zlo->disk);
+		pr_err("blk_mq_alloc_disk failed (err=%d)\n", ret);
 		goto out_cleanup_tags;
 	}
 	zlo->disk->flags = GENHD_FL_NO_PART;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0243/1005] zloop: reject mismatched conventional zone files on restore
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (241 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0242/1005] zloop: fix the error code in the blk_mq_alloc_disk message Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0244/1005] virtio_blk: freeze the virtqueue layout at probe time Greg Kroah-Hartman
                   ` (130 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Christoph Hellwig,
	Damien Le Moal, Jens Axboe, Sasha Levin

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

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

From: Shao Mingyin <shao.mingyin@zte.com.cn>

[ Upstream commit 09c2e203e0ea8b68e7c9500401fa0ab60baf1a9d ]

When restoring a zloop device, zloop_init_zone() checks that the size of
each conventional zone file matches the configured zone size.  The check
prints an error and then jumps to out_fput, which releases the zone file
and returns the value left in "ret" by the preceding vfs_getattr() call,
that is, zero.  zloop_ctl_add() therefore treats the zone as initialized
and continues with a zone->file pointer that was already released; any
I/O to that zone then dereferences it.

Return -EINVAL, like the sequential zone path does for the same kind of
inconsistency.

While at it, print the zone size that is actually compared instead of the
zone capacity, which may be smaller and only made the message confusing.

Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/20261031221610676B5VoVcwMgkoDNVZH2bVDO@zte.com.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/zloop.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index 8884fa63c23a4..5e3eb2c7004f4 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -1151,7 +1151,8 @@ static int zloop_init_zone(struct zloop_device *zlo, struct zloop_options *opts,
 
 		if (restore && file_sectors != zlo->zone_size) {
 			pr_err("Invalid conventional zone %u file size (%llu sectors != %llu)\n",
-			       zone_no, file_sectors, zlo->zone_capacity);
+			       zone_no, file_sectors, zlo->zone_size);
+			ret = -EINVAL;
 			goto out_fput;
 		}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0244/1005] virtio_blk: freeze the virtqueue layout at probe time
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (242 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0243/1005] zloop: reject mismatched conventional zone files on restore Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0245/1005] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
                   ` (129 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yunye Zhao, Stefan Hajnoczi,
	Jens Axboe, Sasha Levin

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

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

From: Yunye Zhao <yunye.zhao@linux.alibaba.com>

[ Upstream commit d53c1a12ff1cfdb12770ddcfdf5603915d0ba0d8 ]

init_vq() reads the writable num_request_queues and poll_queues module
parameters both at probe and when recreating virtqueues after suspend
or reset. However, virtio-blk does not update the blk-mq hardware queue
count or queue maps on restore.

Increasing poll_queues can therefore remove the completion callback
from a virtqueue still used for interrupt-driven I/O, leaving requests
uncompleted. Reducing the effective request queue count through
num_request_queues can instead leave existing hardware contexts
indexing beyond the reallocated vblk->vqs array.

Determine the virtqueue count and the split between interrupt-driven
and polling queues once at probe, and reuse this layout when
recreating the virtqueues. Changes to these module parameters then
affect only subsequently probed devices.

Fixes: 0989c41bed96 ("virtio-blk: add num_request_queues module parameter")
Signed-off-by: Yunye Zhao <yunye.zhao@linux.alibaba.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://patch.msgid.link/20261102133740.88919-1-yunye.zhao@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/virtio_blk.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 1efc1ca38928a..2b462005cdb68 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -965,16 +965,13 @@ static void virtblk_config_changed(struct virtio_device *vdev)
 	queue_work(virtblk_wq, &vblk->config_work);
 }
 
-static int init_vq(struct virtio_blk *vblk)
+/* Keep the queue layout unchanged for the lifetime of the tag set. */
+static int virtblk_init_queue_layout(struct virtio_blk *vblk)
 {
-	int err;
-	unsigned short i;
-	struct virtqueue_info *vqs_info;
-	struct virtqueue **vqs;
+	struct virtio_device *vdev = vblk->vdev;
 	unsigned short num_vqs;
 	unsigned short num_poll_vqs;
-	struct virtio_device *vdev = vblk->vdev;
-	struct irq_affinity desc = { 0, };
+	int err;
 
 	err = virtio_cread_feature(vdev, VIRTIO_BLK_F_MQ,
 				   struct virtio_blk_config, num_queues,
@@ -992,6 +989,7 @@ static int init_vq(struct virtio_blk *vblk)
 
 	num_poll_vqs = min_t(unsigned int, poll_queues, num_vqs - 1);
 
+	vblk->num_vqs = num_vqs;
 	vblk->io_queues[HCTX_TYPE_DEFAULT] = num_vqs - num_poll_vqs;
 	vblk->io_queues[HCTX_TYPE_READ] = 0;
 	vblk->io_queues[HCTX_TYPE_POLL] = num_poll_vqs;
@@ -1001,6 +999,20 @@ static int init_vq(struct virtio_blk *vblk)
 				vblk->io_queues[HCTX_TYPE_READ],
 				vblk->io_queues[HCTX_TYPE_POLL]);
 
+	return 0;
+}
+
+static int init_vq(struct virtio_blk *vblk)
+{
+	int err;
+	unsigned short i;
+	struct virtqueue_info *vqs_info;
+	struct virtqueue **vqs;
+	unsigned short num_vqs = vblk->num_vqs;
+	unsigned short num_poll_vqs = vblk->io_queues[HCTX_TYPE_POLL];
+	struct virtio_device *vdev = vblk->vdev;
+	struct irq_affinity desc = { 0, };
+
 	vblk->vqs = kmalloc_objs(*vblk->vqs, num_vqs);
 	if (!vblk->vqs)
 		return -ENOMEM;
@@ -1056,7 +1068,6 @@ static int init_vq(struct virtio_blk *vblk)
 		spin_lock_init(&vblk->vqs[i].lock);
 		vblk->vqs[i].vq = vqs[i];
 	}
-	vblk->num_vqs = num_vqs;
 
 out:
 	kfree(vqs);
@@ -1522,6 +1533,10 @@ static int virtblk_probe(struct virtio_device *vdev)
 
 	INIT_WORK(&vblk->config_work, virtblk_config_changed_work);
 
+	err = virtblk_init_queue_layout(vblk);
+	if (err)
+		goto out_free_vblk;
+
 	err = init_vq(vblk);
 	if (err)
 		goto out_free_vblk;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0245/1005] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (243 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0244/1005] virtio_blk: freeze the virtqueue layout at probe time Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0246/1005] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
                   ` (128 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nguyen Dinh Phi, Stefano Garzarella,
	Bobby Eshleman, Paolo Abeni, Sasha Levin

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

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

From: Nguyen Dinh Phi <phind.uet@gmail.com>

[ Upstream commit c0ef6144b4d60afb90bc6d8db3ffdac043cd6ffc ]

The timeval validation checks tv_usec < USEC_PER_SEC but not
tv_usec >= 0, so a negative tv_usec makes the timeout computation
wrap into a bogus value, later tripping "schedule_timeout: wrong
timeout value" instead of being rejected.

Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20261030064428.73930-1-phind.uet@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/vmw_vsock/af_vsock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 6ba8c85dc1613..9f9b02d1e0508 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -2101,7 +2101,8 @@ static int vsock_connectible_setsockopt(struct socket *sock,
 					     optname == SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD);
 		if (err)
 			break;
-		if (tv.tv_sec >= 0 && tv.tv_usec < USEC_PER_SEC &&
+		if (tv.tv_sec >= 0 && tv.tv_usec >= 0 &&
+		    tv.tv_usec < USEC_PER_SEC &&
 		    tv.tv_sec < (MAX_SCHEDULE_TIMEOUT / HZ - 1)) {
 			vsk->connect_timeout = tv.tv_sec * HZ +
 				DIV_ROUND_UP((unsigned long)tv.tv_usec, (USEC_PER_SEC / HZ));
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0246/1005] null_blk: fix opening closed zones at the active zone limit
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (244 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0245/1005] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0247/1005] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
                   ` (127 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
	Jens Axboe, Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 6f2b59737bf9cf3623719857ac149f0d431db109 ]

When the open zone limit is reached, null_check_open() closes an
implicitly open zone only if the active zone limit is not reached.

Closing an implicitly open zone does not change the number of active
zones, so this check is wrong. For an empty zone, the active zone limit
was already checked by null_check_zone_resources(). For a closed zone,
the check makes writing to, opening or finishing the zone fail with
BLK_STS_ZONE_OPEN_RESOURCE at the active zone limit, whereas ZBC-3
(4.5.3.2.7.2) and NVMe ZNS (2.1.1.4.1) require closing an implicitly
open zone instead.

Remove the check, and update the comment above
null_check_zone_resources() accordingly.

Fixes: dc4d137ee3b7 ("null_blk: add support for max open/active zone limit for zoned devices")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20261022092158.2248831-6-cassel@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/null_blk/zoned.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c
index 7e9b5ffb9e841..ecdc8d68ca2a9 100644
--- a/drivers/block/null_blk/zoned.c
+++ b/drivers/block/null_blk/zoned.c
@@ -311,10 +311,8 @@ static blk_status_t null_check_open(struct nullb_device *dev)
 		return BLK_STS_OK;
 
 	if (dev->nr_zones_imp_open) {
-		if (null_check_active(dev) == BLK_STS_OK) {
-			null_close_imp_open_zone(dev);
-			return BLK_STS_OK;
-		}
+		null_close_imp_open_zone(dev);
+		return BLK_STS_OK;
 	}
 
 	return BLK_STS_ZONE_OPEN_RESOURCE;
@@ -330,8 +328,11 @@ static blk_status_t null_check_open(struct nullb_device *dev)
  *
  * ZBC states that an implicit open zone shall be closed only if there is not
  * room within the open limit. However, with the addition of an active limit,
- * it is not certain that closing an implicit open zone will allow a new zone
- * to be opened, since we might already be at the active limit capacity.
+ * it is not certain that closing an implicit open zone will allow an empty
+ * zone to be opened, since we might already be at the active limit capacity.
+ * Therefore, the active limit is checked first for an empty zone. A closed
+ * zone already holds an active zone resource, so only the open limit has to
+ * be checked for a closed zone.
  */
 static blk_status_t null_check_zone_resources(struct nullb_device *dev,
 					      struct nullb_zone *zone)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0247/1005] null_blk: dont finish zones to set them read-only or offline
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (245 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0246/1005] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0248/1005] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
                   ` (126 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
	Jens Axboe, Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 973bf587d79f061beffdd392e77012a07f25fcd6 ]

null_set_zone_cond() calls null_finish_zone() to release the zone
resources held by a zone before setting it read-only or offline.

For an empty or closed zone, null_finish_zone() first runs the zone
resource checks, which can close an unrelated implicitly open zone, or
fail. As the error is ignored, a failure for a closed zone leaks
nr_zones_closed, permanently lowering the effective active zone limit.

Setting a zone read-only or offline requires no zone resources, so
release the zone resources held by the zone directly instead, using a
new helper, null_release_zone_resources().

Fixes: d3a5738849e0 ("null_blk: support read-only and offline zone conditions")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20261022092158.2248831-7-cassel@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/null_blk/zoned.c | 35 +++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c
index ecdc8d68ca2a9..015f5d304c7ce 100644
--- a/drivers/block/null_blk/zoned.c
+++ b/drivers/block/null_blk/zoned.c
@@ -743,6 +743,33 @@ blk_status_t null_process_zoned_cmd(struct nullb_cmd *cmd, enum req_op op,
 	}
 }
 
+/*
+ * Release the zone resources held by a zone, before changing the condition of
+ * the zone to a condition that does not hold any zone resources.
+ */
+static void null_release_zone_resources(struct nullb_device *dev,
+					struct nullb_zone *zone)
+{
+	if (!dev->need_zone_res_mgmt)
+		return;
+
+	spin_lock(&dev->zone_res_lock);
+	switch (zone->cond) {
+	case BLK_ZONE_COND_IMP_OPEN:
+		dev->nr_zones_imp_open--;
+		break;
+	case BLK_ZONE_COND_EXP_OPEN:
+		dev->nr_zones_exp_open--;
+		break;
+	case BLK_ZONE_COND_CLOSED:
+		dev->nr_zones_closed--;
+		break;
+	default:
+		break;
+	}
+	spin_unlock(&dev->zone_res_lock);
+}
+
 /*
  * Set a zone in the read-only or offline condition.
  */
@@ -759,8 +786,8 @@ static void null_set_zone_cond(struct nullb_device *dev,
 	 * If the read-only condition is requested again to zones already in
 	 * read-only condition, restore back normal empty condition. Do the same
 	 * if the offline condition is requested for offline zones. Otherwise,
-	 * set the specified zone condition to the zones. Finish the zones
-	 * beforehand to free up zone resources.
+	 * set the specified zone condition to the zones. Release the zone
+	 * resources held by the zones beforehand.
 	 */
 	if (zone->cond == cond) {
 		zone->cond = BLK_ZONE_COND_EMPTY;
@@ -768,9 +795,7 @@ static void null_set_zone_cond(struct nullb_device *dev,
 		if (dev->memory_backed)
 			null_handle_discard(dev, zone->start, zone->len);
 	} else {
-		if (zone->cond != BLK_ZONE_COND_READONLY &&
-		    zone->cond != BLK_ZONE_COND_OFFLINE)
-			null_finish_zone(dev, zone);
+		null_release_zone_resources(dev, zone);
 		zone->cond = cond;
 		zone->wp = NULL_ZONE_INVALID_WP;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0248/1005] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (246 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0247/1005] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0249/1005] nvmet: fix arbitration burst field mask Greg Kroah-Hartman
                   ` (125 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
	Jiayuan Chen, Kuniyuki Iwashima, Paolo Abeni, Sasha Levin

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

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

From: Kyle Zeng <kylebot@openai.com>

[ Upstream commit 647b81ddefc6364290e67bf33c89d54971f8995e ]

inet_twsk_kill() removes a TIME_WAIT socket from the established hash
before it finishes using the ehash lock, hashinfo and bind tables, and
before it drops the death-row reference. A running timer can therefore
unhash its socket before inet_twsk_purge() reaches it. The purge cannot
synchronize with that timer, and tcp_sk_exit_batch() can free the
private ehash and hashinfo while inet_twsk_kill() is still using them.

An unprivileged reproducer using user and network namespaces, a private
TCP ehash and a FIN_WAIT2 timer triggers a KASAN slab-use-after-free in
inet_twsk_kill(). The allocation and free stacks point to
inet_pernet_hashinfo_alloc() and inet_pernet_hashinfo_free().

Wait for an RCU grace period after purging the whole batch, if one
netns in the batch uses a private ehash. TIME_WAIT removal runs with
bottom halves disabled, so this also waits for removers that were
already invisible to the purge. Keep the wait under
tcp_exit_batch_mutex, before freeing any private hashinfo.

The same window exists with the shared tcp_hashinfo. There, the
hashinfo memory stays valid, but tcp_sk_exit_batch() can decrement
tcp_death_row.tw_refcount from 2 to 1 before inet_twsk_kill() drops its
own reference. This triggers the WARN_ON_ONCE() in tcp_sk_exit_batch(),
then a refcount_t "decrement hit 0" warning from inet_twsk_kill().

Adding a grace period for the shared case would be costly on busy
hosts. It is not needed: struct net is freed by a later cleanup_net(),
after the synchronize_rcu() in ops_undo_list(), so inet_twsk_kill()
can safely drop the last tw_refcount reference itself.
Use refcount_dec_if_one() and only warn if tw_refcount is not 1
after a grace period.

Fixes: d1e5e6408b30 ("tcp: Introduce optional per-netns ehash.")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
[edumazet: only call synchronize_net() if one netns in the batch uses a private ehash,
 use refcount_dec_if_one() to avoid a false WARN with the shared ehash]
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261030075843.2567707-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/tcp_ipv4.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index b414313381020..df2763f31dde6 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -3550,6 +3550,7 @@ static int __net_init tcp_sk_init(struct net *net)
 
 static void __net_exit tcp_sk_exit_batch(struct list_head *net_exit_list)
 {
+	bool synced = false;
 	struct net *net;
 
 	/* make sure concurrent calls to tcp_sk_exit_batch from net_cleanup_work
@@ -3564,9 +3565,27 @@ static void __net_exit tcp_sk_exit_batch(struct list_head *net_exit_list)
 
 	tcp_twsk_purge(net_exit_list);
 
+	/* inet_twsk_kill() unhashes a twsk before it is done with ehash
+	 * and bhash, and before it drops its tw_refcount reference,
+	 * so tcp_twsk_purge() can miss it. Such callers run with BH
+	 * disabled: wait for them before freeing a private ehash.
+	 */
+	list_for_each_entry(net, net_exit_list, exit_list) {
+		if (net->ipv4.tcp_death_row.hashinfo->pernet) {
+			synchronize_net();
+			synced = true;
+			break;
+		}
+	}
+
 	list_for_each_entry(net, net_exit_list, exit_list) {
 		inet_pernet_hashinfo_free(net->ipv4.tcp_death_row.hashinfo);
-		WARN_ON_ONCE(!refcount_dec_and_test(&net->ipv4.tcp_death_row.tw_refcount));
+		/* Without a grace period, a concurrent inet_twsk_kill() might
+		 * still hold a tw_refcount reference. Let it drop it: struct net
+		 * is freed by a later cleanup_net(), after an RCU grace period.
+		 */
+		if (!refcount_dec_if_one(&net->ipv4.tcp_death_row.tw_refcount))
+			WARN_ON_ONCE(synced);
 		tcp_fastopen_ctx_destroy(net);
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0249/1005] nvmet: fix arbitration burst field mask
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (247 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0248/1005] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0250/1005] can: skb: make CAN skb allocation failure paths IRQ-safe Greg Kroah-Hartman
                   ` (124 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Damien Le Moal,
	James Fantin-Hardesty, Keith Busch, Sasha Levin

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

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

From: James Fantin-Hardesty <james.fantin-hardesty@seagate.com>

[ Upstream commit 6976a9b8dc71bb3b6e5dd563e35510461bea29d4 ]

The Arbitration Burst (AB) field of the Arbitration feature is
CDW11 bits 2:0 (NVMe Base Specification 2.1, Feature 01h), but
nvmet incorrectly masks it with 0x3. Use 0x7 for both set and get.

Fixes: a0ed77d4c9a7 ("nvmet: Implement arbitration feature support")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: James Fantin-Hardesty <james.fantin-hardesty@seagate.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/admin-cmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 3704493dbec97..266a3618d81ab 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -1338,7 +1338,7 @@ static u16 nvmet_set_feat_arbitration(struct nvmet_req *req)
 		.hpw = (cdw11 >> 24) & 0xff,
 		.mpw = (cdw11 >> 16) & 0xff,
 		.lpw = (cdw11 >> 8) & 0xff,
-		.ab = cdw11 & 0x3,
+		.ab = cdw11 & 0x7,
 	};
 
 	if (!ctrl->ops->set_feature) {
@@ -1493,7 +1493,7 @@ static u16 nvmet_get_feat_arbitration(struct nvmet_req *req)
 			 ((u32)arb.hpw << 24) |
 			 ((u32)arb.mpw << 16) |
 			 ((u32)arb.lpw << 8) |
-			 (arb.ab & 0x3));
+			 (arb.ab & 0x7));
 
 	return NVME_SC_SUCCESS;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0250/1005] can: skb: make CAN skb allocation failure paths IRQ-safe
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (248 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0249/1005] nvmet: fix arbitration burst field mask Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0251/1005] can: dev: can_tdc_fill_info(): dont read automatic TDCV if interface is down Greg Kroah-Hartman
                   ` (123 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cunhao Lu, Marc Kleine-Budde,
	Sasha Levin

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

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

From: Cunhao Lu <1579567540@qq.com>

[ Upstream commit d4b616a38118e81cfb206babd052db260d7abf6c ]

The CAN skb allocation helpers are used from hardware interrupt receive
handlers. If can_skb_ext_add() fails, they release the newly allocated skb
with kfree_skb(), which is not safe in hardware interrupt context.

Use dev_kfree_skb_any() for the allocation failure paths in
alloc_can_skb(), alloc_canfd_skb(), and alloc_canxl_skb().

Fixes: 96ea3a1e2d31 ("can: add CAN skb extension infrastructure")
Signed-off-by: Cunhao Lu <1579567540@qq.com>
Link: https://patch.msgid.link/tencent_C825C17D442F801351CE2FBC4984064B4605@qq.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/can/dev/skb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/dev/skb.c b/drivers/net/can/dev/skb.c
index 9e274147ffe56..738d5968dfa68 100644
--- a/drivers/net/can/dev/skb.c
+++ b/drivers/net/can/dev/skb.c
@@ -229,7 +229,7 @@ struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf)
 
 	csx = can_skb_ext_add(skb);
 	if (!csx) {
-		kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		goto out_error_cc;
 	}
 
@@ -260,7 +260,7 @@ struct sk_buff *alloc_canfd_skb(struct net_device *dev,
 
 	csx = can_skb_ext_add(skb);
 	if (!csx) {
-		kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		goto out_error_fd;
 	}
 
@@ -298,7 +298,7 @@ struct sk_buff *alloc_canxl_skb(struct net_device *dev,
 
 	csx = can_skb_ext_add(skb);
 	if (!csx) {
-		kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		goto out_error_xl;
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0251/1005] can: dev: can_tdc_fill_info(): dont read automatic TDCV if interface is down
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (249 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0250/1005] can: skb: make CAN skb allocation failure paths IRQ-safe Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0252/1005] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
                   ` (122 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, ChunYuZhiQiang, Vincent Mailhol,
	Marc Kleine-Budde, Sasha Levin

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

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

From: ChunYuZhiQiang <chunyuzhiqiang@yinhe.ht>

[ Upstream commit f5128a76726105f398d7ee70ee523dd4f68d62f4 ]

The automatic TDCV readback calls into the driver via do_get_auto_tdcv().
Some drivers, such as xcan_get_auto_tdcv(), read controller registers
without taking a runtime PM reference, so calling this while the
interface is down can touch registers whose clocks are gated.

Gate do_get_auto_tdcv() on netif_running() in can_tdc_fill_info() and
adjust can_tdc_get_size() and can_data_bittiming_get_size() so that only
the automatic TDCV size is skipped when the interface is down. The other
TDC parameters are still reported, as they are meaningful while the
interface is down.

This is a defensive hardening based on code inspection; the automatic
TDCV path has not been triggered on hardware.

Signed-off-by: ChunYuZhiQiang <chunyuzhiqiang@yinhe.ht>
Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
Fixes: e8060f08cd69 ("can: netlink: add can_priv::do_get_auto_tdcv() to retrieve tdcv from device")
Link: https://patch.msgid.link/20261027065012.191348-2-chunyuzhiqiang@yinhe.ht
[mkl: fix open parenthesis alignment]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/can/dev/netlink.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c
index b958c04d53db6..081dfddda0008 100644
--- a/drivers/net/can/dev/netlink.c
+++ b/drivers/net/can/dev/netlink.c
@@ -720,7 +720,8 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
 	return 0;
 }
 
-static size_t can_tdc_get_size(struct data_bittiming_params *dbt_params,
+static size_t can_tdc_get_size(const struct net_device *dev,
+			       struct data_bittiming_params *dbt_params,
 			       u32 tdc_flags)
 {
 	bool tdc_manual = tdc_flags & CAN_CTRLMODE_TDC_MANUAL_MASK;
@@ -742,7 +743,8 @@ static size_t can_tdc_get_size(struct data_bittiming_params *dbt_params,
 	}
 
 	if (tdc_flags) {
-		if (tdc_manual || dbt_params->do_get_auto_tdcv)
+		if (tdc_manual ||
+		    (dbt_params->do_get_auto_tdcv && netif_running(dev)))
 			size += nla_total_size(sizeof(u32));	/* IFLA_CAN_TDCV */
 		size += nla_total_size(sizeof(u32));		/* IFLA_CAN_TDCO */
 		if (dbt_params->tdc_const->tdcf_max)
@@ -752,7 +754,8 @@ static size_t can_tdc_get_size(struct data_bittiming_params *dbt_params,
 	return size;
 }
 
-static size_t can_data_bittiming_get_size(struct data_bittiming_params *dbt_params,
+static size_t can_data_bittiming_get_size(const struct net_device *dev,
+					  struct data_bittiming_params *dbt_params,
 					  u32 tdc_flags)
 {
 	size_t size = 0;
@@ -764,7 +767,7 @@ static size_t can_data_bittiming_get_size(struct data_bittiming_params *dbt_para
 	if (dbt_params->data_bitrate_const)		/* IFLA_CAN_{,XL}_DATA_BITRATE_CONST */
 		size += nla_total_size(sizeof(*dbt_params->data_bitrate_const) *
 				       dbt_params->data_bitrate_const_cnt);
-	size += can_tdc_get_size(dbt_params, tdc_flags);/* IFLA_CAN_{,XL}_TDC */
+	size += can_tdc_get_size(dev, dbt_params, tdc_flags);/* IFLA_CAN_{,XL}_TDC */
 
 	return size;
 }
@@ -825,10 +828,10 @@ static size_t can_get_size(const struct net_device *dev)
 	size += sizeof(priv->bitrate_max);			/* IFLA_CAN_BITRATE_MAX */
 	size += can_ctrlmode_ext_get_size();			/* IFLA_CAN_CTRLMODE_EXT */
 
-	size += can_data_bittiming_get_size(&priv->fd,
+	size += can_data_bittiming_get_size(dev, &priv->fd,
 					    priv->ctrlmode & CAN_CTRLMODE_FD_TDC_MASK);
 
-	size += can_data_bittiming_get_size(&priv->xl,
+	size += can_data_bittiming_get_size(dev, &priv->xl,
 					    priv->ctrlmode & CAN_CTRLMODE_XL_TDC_MASK);
 	size += can_pwm_get_size(priv->xl.pwm_const,		/* IFLA_CAN_XL_PWM */
 				 priv->ctrlmode & CAN_CTRLMODE_XL_TMS);
@@ -910,7 +913,7 @@ static int can_tdc_fill_info(struct sk_buff *skb, const struct net_device *dev,
 		if (tdc_manual) {
 			tdcv = tdc->tdcv;
 			err = 0;
-		} else if (dbt_params->do_get_auto_tdcv) {
+		} else if (dbt_params->do_get_auto_tdcv && netif_running(dev)) {
 			err = dbt_params->do_get_auto_tdcv(dev, &tdcv);
 		}
 		if (!err && nla_put_u32(skb, IFLA_CAN_TDC_TDCV, tdcv))
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0252/1005] net: dsa: b53: Enable IGMP and MLD control packet CPU copies
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (250 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0251/1005] can: dev: can_tdc_fill_info(): dont read automatic TDCV if interface is down Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0253/1005] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
                   ` (121 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Paolo Abeni,
	Sasha Levin

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

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

From: Florian Fainelli <florian.fainelli@broadcom.com>

[ Upstream commit 3362cb822ea750399a15b741713181fd8560bd17 ]

IGMPv2 reports and MLDv1 reports are addressed to the multicast group
itself. Once the first listener is installed in the ARL table, subsequent
reports can follow that entry without reaching the CPU. The bridge then
fails to learn additional listeners, although static MDB forwarding works.

Enable the high-level protocol classifiers so that IGMP and MLD control
packets are copied to the CPU independently of the multicast ARL lookup.
Retain normal L2 forwarding by clearing the CPU-only forwarding modes,
and preserve unrelated protocol-control fields.

Handle the BCM5395's 16-bit register and different classifier fields
separately from the 32-bit layout on the BCM531xx, BCM5301x and newer
integrated RoboSwitch families, including BCM7445, BCM7278 and BCM4908.
Export the helper and call it from bcm_sf2_sw_setup() as well, since SF2
uses its own setup operation instead of b53_setup(). This also restores
the classifiers after the switch reset on resume. Leave older devices
with different IGMP controls untouched, and propagate register access
failures during setup.

The SF2 setup integration and BCM4908 chip gate were updated with
assistance from OpenAI Codex in response to review feedback.

Fixes: 5d65b64a3d97 ("net: dsa: b53: Add support for MDB")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261028235100.3892374-2-florian.fainelli@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/dsa/b53/b53_common.c | 57 ++++++++++++++++++++++++++++++++
 drivers/net/dsa/b53/b53_priv.h   |  1 +
 drivers/net/dsa/b53/b53_regs.h   | 17 ++++++++++
 drivers/net/dsa/bcm_sf2.c        |  5 +++
 4 files changed, 80 insertions(+)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 0880310c9ce3f..e54f6d4d1f7bb 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -836,6 +836,59 @@ void b53_brcm_hdr_setup(struct dsa_switch *ds, int port)
 }
 EXPORT_SYMBOL(b53_brcm_hdr_setup);
 
+int b53_enable_mcast_snooping(struct b53_device *dev)
+{
+	u16 val16;
+	u32 val;
+	int ret;
+
+	/* Older switches use different IGMP controls, not HL_PRTC_CTRL. */
+	if (is5325(dev) || is5365(dev) || dev->chip_id == BCM5389_DEVICE_ID ||
+	    is5397_98(dev) || is63xx(dev))
+		return 0;
+
+	/* IGMPv2 and MLDv1 reports use the group's destination MAC. Once
+	 * the first listener is offloaded, ordinary multicast forwarding
+	 * can keep subsequent reports from reaching the bridge CPU.
+	 */
+
+	/* BCM5395 has a narrower register and a single IGMP classifier.
+	 * Its ICMPv6 classifier also covers MLD.
+	 */
+	if (dev->chip_id == BCM5395_DEVICE_ID) {
+		ret = b53_read16(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL, &val16);
+		if (ret)
+			return ret;
+
+		val16 |= HL_PRTC_IGMP_IP_EN_5395 | HL_PRTC_ICMPV6_EN;
+		/* Zero forwarding modes copy control traffic to the CPU
+		 * independently of the ARL lookup, retaining L2 forwarding.
+		 */
+		val16 &= ~(HL_PRTC_IGMP_FWD_MODE_5395 |
+			   HL_PRTC_ICMPV6_FWD_MODE);
+
+		return b53_write16(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL,
+				   val16);
+	}
+
+	ret = b53_read32(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL, &val);
+	if (ret)
+		return ret;
+
+	val |= HL_PRTC_IGMP_RPTLVE_EN | HL_PRTC_IGMP_QRY_EN |
+	       HL_PRTC_IGMP_UKN_EN | HL_PRTC_MLD_RPTDONE_EN |
+	       HL_PRTC_MLD_QRY_EN;
+	/* Zero forwarding modes copy control traffic to the CPU
+	 * independently of the ARL lookup, retaining L2 forwarding.
+	 */
+	val &= ~(HL_PRTC_IGMP_RPTLVE_FWD_MODE | HL_PRTC_IGMP_QRY_FWD_MODE |
+		 HL_PRTC_IGMP_UKN_FWD_MODE | HL_PRTC_MLD_RPTDONE_FWD_MODE |
+		 HL_PRTC_MLD_QRY_FWD_MODE);
+
+	return b53_write32(dev, B53_MGMT_PAGE, B53_HL_PRTC_CTRL, val);
+}
+EXPORT_SYMBOL(b53_enable_mcast_snooping);
+
 static void b53_enable_cpu_port(struct b53_device *dev, int port)
 {
 	u8 port_ctrl;
@@ -1334,6 +1387,10 @@ static int b53_setup(struct dsa_switch *ds)
 			b53_disable_port(ds, port);
 	}
 
+	ret = b53_enable_mcast_snooping(dev);
+	if (ret)
+		return ret;
+
 	return b53_setup_devlink_resources(ds);
 }
 
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 29cca7945df71..c4d2a41c714f6 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -504,6 +504,7 @@ static inline struct gpio_desc *b53_switch_get_reset_gpio(struct b53_device *dev
 /* Exported functions towards other drivers */
 void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port);
 int b53_configure_vlan(struct dsa_switch *ds);
+int b53_enable_mcast_snooping(struct b53_device *dev);
 void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset,
 		     uint8_t *data);
 void b53_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data);
diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h
index 54a278db67c9f..cfdb5ed383260 100644
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -274,6 +274,23 @@
 /* Revision ID register (8 bit) */
 #define B53_REV_ID			0x40
 
+/* High-level protocol control (16 bit on BCM5395, otherwise 32 bit) */
+#define B53_HL_PRTC_CTRL			0x50
+#define   HL_PRTC_ICMPV6_EN		BIT(4)
+#define   HL_PRTC_ICMPV6_FWD_MODE		BIT(5)
+#define   HL_PRTC_IGMP_IP_EN_5395		BIT(6)
+#define   HL_PRTC_IGMP_FWD_MODE_5395	BIT(8)
+#define   HL_PRTC_IGMP_RPTLVE_EN		BIT(9)
+#define   HL_PRTC_IGMP_RPTLVE_FWD_MODE	BIT(10)
+#define   HL_PRTC_IGMP_QRY_EN		BIT(11)
+#define   HL_PRTC_IGMP_QRY_FWD_MODE	BIT(12)
+#define   HL_PRTC_IGMP_UKN_EN		BIT(13)
+#define   HL_PRTC_IGMP_UKN_FWD_MODE	BIT(14)
+#define   HL_PRTC_MLD_RPTDONE_EN		BIT(15)
+#define   HL_PRTC_MLD_RPTDONE_FWD_MODE	BIT(16)
+#define   HL_PRTC_MLD_QRY_EN		BIT(17)
+#define   HL_PRTC_MLD_QRY_FWD_MODE		BIT(18)
+
 /* Broadcom header RX control (16 bit) */
 #define B53_BRCM_HDR_RX_DIS		0x60
 
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index de3efa3ce9a75..f3b56ea87b07b 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -1059,6 +1059,7 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
 {
 	struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
 	unsigned int port;
+	int ret;
 
 	/* Enable all valid ports and disable those unused */
 	for (port = 0; port < priv->hw_params.num_ports; port++) {
@@ -1074,6 +1075,10 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
 	b53_configure_vlan(ds);
 	bcm_sf2_enable_acb(ds);
 
+	ret = b53_enable_mcast_snooping(priv->dev);
+	if (ret)
+		return ret;
+
 	return b53_setup_devlink_resources(ds);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0253/1005] net: ethernet: mediatek: preserve sibling PPE bindings
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (251 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0252/1005] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0254/1005] ipmr, ip6mr: queue netlink route queries out of band Greg Kroah-Hartman
                   ` (120 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexander Goodkind, Simon Horman,
	Paolo Abeni, Sasha Levin

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

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

From: Alexander Goodkind <alex@goodkind.io>

[ Upstream commit 34cc22a9ce6ae0228dcd09a57df23aea62e22b04 ]

__mtk_ppe_check_skb() clears entry->hash for flows bound to other
hardware slots in the same software hash bucket. mtk_flow_offload_stats()
then skips their hardware counter updates. L2 cleanup also frees sibling
subflows without invalidating their hardware rules.

Restrict both cleanup paths to entries assigned to the inspected slot.

Two UDP trials reproduced the counter failure on a GL-MT3000/MT7981
running unmodified OpenWrt 25.12.5 with Linux 6.12.94:

1. Start a UDP connection.
2. Add a control connection in a different hash bucket.
3. Add a connection in the first connection's hash bucket.

AI code review of the original patch identified the cleanup problem
in L2 subflows.

Full ARM64 builds with allmodconfig and allyesconfig passed before
and after the patch using GCC 14.2.0 and W=1, without new warnings.
The builds used CONFIG_WERROR=n because the unmodified ARM64 kernel
already emits warnings. Hardware testing has not run for this revision.

Fixes: c4f033d9e03e ("net: ethernet: mtk_eth_soc: rework hardware flow table management")
Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries")
Link: https://github.com/openwrt/openwrt/pull/26107
Signed-off-by: Alexander Goodkind <alex@goodkind.io>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261030010517.45639-1-alex@goodkind.io
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mediatek/mtk_ppe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c
index 8451dc3fd00aa..d8fa1f2b43244 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -754,8 +754,7 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
 
 	hlist_for_each_entry_safe(entry, n, head, list) {
 		if (entry->type == MTK_FLOW_TYPE_L2_SUBFLOW) {
-			if (unlikely(FIELD_GET(MTK_FOE_IB1_STATE, hwe->ib1) ==
-				     MTK_FOE_STATE_BIND))
+			if (entry->hash != hash)
 				continue;
 
 			entry->hash = 0xffff;
@@ -764,7 +763,7 @@ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
 		}
 
 		if (found || !mtk_flow_entry_match(ppe->eth, entry, hwe)) {
-			if (entry->hash != 0xffff)
+			if (entry->hash == hash)
 				entry->hash = 0xffff;
 			continue;
 		}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0254/1005] ipmr, ip6mr: queue netlink route queries out of band
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (252 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0253/1005] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0255/1005] nvme-loop: delete the controller if a reset fails Greg Kroah-Hartman
                   ` (119 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Katherine Leaver, Eric Dumazet,
	Ido Schimmel, Paolo Abeni, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit 787268686c64be60023743b527645a907e38ccca ]

ipmr_get_route() and ip6mr_get_route() queue synthetic skbs on the
unresolved MFC entry to answer RTM_GETROUTE requests once the route
is resolved. These skbs carry a fake IP header with version 0, and
ipmr_cache_resolve(), ipmr_destroy_unres(), ip6mr_cache_resolve()
and ip6mr_destroy_unres() rely on this in-band tag to tell them
apart from regular packets queued by the input and output paths.

The IP version is only validated once, in ip_rcv_core() and
ip6_rcv_core(). A netfilter hook running later, for instance an
nftables payload statement in a PREROUTING chain owned by an
unprivileged user namespace, can rewrite the first header byte to
zero. The SRv6 End.DX6 action also passes the decapsulated packet
to ip6_mr_input() without checking that the inner header version
is 6. If no MFC entry exists, the packet is queued and later handled
as a netlink request: its payload is treated as an nlmsghdr and
written to, mr_fill_mroute() may call skb_put() on a nonlinear skb
(hitting SKB_LINEAR_ASSERT()), and the skb is unicast to a netlink
portid taken from stale IPCB/IP6CB bytes in skb->cb[].

ipmr_cache_report() also relies on the same tag since
commit 94a6736bb5ab ("ipmr: only copy pktinfo to cache reports").

Stop trusting packet contents: queue route queries on a dedicated
nl_queries list in the unresolved MFC entry, and pass an explicit
nl_query flag from the callers.

The per-entry limit of four queued skbs now applies to both lists
combined, as before. The synthetic header keeps version 0, since it
is copied into the NOCACHE report delivered to the mroute socket.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Fixes: 7bc570c8b4f7 ("[IPV6] MROUTE: Support multicast forwarding.")
Reported-by: Katherine Leaver <kleaver@janestreet.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261030092303.2749386-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/mroute_base.h |   2 +
 net/ipv4/ipmr.c             | 104 +++++++++++++++++++-----------------
 net/ipv6/ip6mr.c            |  76 +++++++++++++-------------
 3 files changed, 94 insertions(+), 88 deletions(-)

diff --git a/include/linux/mroute_base.h b/include/linux/mroute_base.h
index 4d55827e97053..2d506966357b2 100644
--- a/include/linux/mroute_base.h
+++ b/include/linux/mroute_base.h
@@ -119,6 +119,7 @@ enum {
  * @mfc_flags: entry flags
  * @expires: unresolved entry expire time
  * @unresolved: unresolved cached skbs
+ * @nl_queries: queued RTM_GETROUTE requests waiting for resolution
  * @last_assert: time of last assert
  * @minvif: minimum VIF id
  * @maxvif: maximum VIF id
@@ -141,6 +142,7 @@ struct mr_mfc {
 		struct {
 			unsigned long expires;
 			struct sk_buff_head unresolved;
+			struct sk_buff_head nl_queries;
 		} unres;
 		struct {
 			unsigned long last_assert;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 5bfbb8d88bf4c..365cf1cf39f38 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -109,7 +109,8 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 			  struct net_device *dev, struct sk_buff *skb,
 			  struct mfc_cache *cache, int local);
 static int ipmr_cache_report(const struct mr_table *mrt,
-			     struct sk_buff *pkt, vifi_t vifi, int assert);
+			     struct sk_buff *pkt, vifi_t vifi, int assert,
+			     bool nl_query);
 static void mroute_netlink_event(struct mr_table *mrt, struct mfc_cache *mfc,
 				 int cmd);
 static void igmpmsg_netlink_event(const struct mr_table *mrt, struct sk_buff *pkt);
@@ -561,7 +562,7 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	/* Pairs with WRITE_ONCE() in vif_add() and vif_delete() */
 	ipmr_cache_report(mrt, skb, READ_ONCE(mrt->mroute_reg_vif_num),
-			  IGMPMSG_WHOLEPKT);
+			  IGMPMSG_WHOLEPKT, false);
 
 	rcu_read_unlock();
 	kfree_skb(skb);
@@ -775,23 +776,21 @@ static void ipmr_destroy_unres(struct mr_table *mrt, struct mfc_cache *c)
 	WRITE_ONCE(mrt->cache_resolve_queue_len,
 		   mrt->cache_resolve_queue_len - 1);
 
-	while ((skb = skb_dequeue(&c->_c.mfc_un.unres.unresolved))) {
-		if (ip_hdr(skb)->version == 0) {
-			struct nlmsghdr *nlh = skb_pull(skb,
-							sizeof(struct iphdr));
-			nlh->nlmsg_type = NLMSG_ERROR;
-			nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
-			skb_trim(skb, nlh->nlmsg_len);
-			e = nlmsg_data(nlh);
-			e->error = -ETIMEDOUT;
-			memset(&e->msg, 0, sizeof(e->msg));
+	while ((skb = skb_dequeue(&c->_c.mfc_un.unres.nl_queries))) {
+		struct nlmsghdr *nlh = skb_pull(skb, sizeof(struct iphdr));
 
-			rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
-		} else {
-			kfree_skb(skb);
-		}
+		nlh->nlmsg_type = NLMSG_ERROR;
+		nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
+		skb_trim(skb, nlh->nlmsg_len);
+		e = nlmsg_data(nlh);
+		e->error = -ETIMEDOUT;
+		memset(&e->msg, 0, sizeof(e->msg));
+
+		rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
 	}
 
+	skb_queue_purge(&c->_c.mfc_un.unres.unresolved);
+
 	ipmr_cache_free(c);
 }
 
@@ -1021,6 +1020,7 @@ static struct mfc_cache *ipmr_cache_alloc_unres(void)
 
 	if (c) {
 		skb_queue_head_init(&c->_c.mfc_un.unres.unresolved);
+		skb_queue_head_init(&c->_c.mfc_un.unres.nl_queries);
 		c->_c.mfc_un.unres.expires = jiffies + 10 * HZ;
 	}
 	return c;
@@ -1033,31 +1033,29 @@ static void ipmr_cache_resolve(struct net *net, struct mr_table *mrt,
 	struct sk_buff *skb;
 	struct nlmsgerr *e;
 
-	/* Play the pending entries through our router */
-	while ((skb = __skb_dequeue(&uc->_c.mfc_un.unres.unresolved))) {
-		if (ip_hdr(skb)->version == 0) {
-			struct nlmsghdr *nlh = skb_pull(skb,
-							sizeof(struct iphdr));
-
-			if (mr_fill_mroute(mrt, skb, &c->_c,
-					   nlmsg_data(nlh)) > 0) {
-				nlh->nlmsg_len = skb_tail_pointer(skb) -
-						 (u8 *)nlh;
-			} else {
-				nlh->nlmsg_type = NLMSG_ERROR;
-				nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
-				skb_trim(skb, nlh->nlmsg_len);
-				e = nlmsg_data(nlh);
-				e->error = -EMSGSIZE;
-				memset(&e->msg, 0, sizeof(e->msg));
-			}
+	/* Answer the pending netlink route queries */
+	while ((skb = __skb_dequeue(&uc->_c.mfc_un.unres.nl_queries))) {
+		struct nlmsghdr *nlh = skb_pull(skb, sizeof(struct iphdr));
 
-			rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+		if (mr_fill_mroute(mrt, skb, &c->_c, nlmsg_data(nlh)) > 0) {
+			nlh->nlmsg_len = skb_tail_pointer(skb) - (u8 *)nlh;
 		} else {
-			rcu_read_lock();
-			ip_mr_forward(net, mrt, skb->dev, skb, c, 0);
-			rcu_read_unlock();
+			nlh->nlmsg_type = NLMSG_ERROR;
+			nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
+			skb_trim(skb, nlh->nlmsg_len);
+			e = nlmsg_data(nlh);
+			e->error = -EMSGSIZE;
+			memset(&e->msg, 0, sizeof(e->msg));
 		}
+
+		rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+	}
+
+	/* Play the pending packets through our router */
+	while ((skb = __skb_dequeue(&uc->_c.mfc_un.unres.unresolved))) {
+		rcu_read_lock();
+		ip_mr_forward(net, mrt, skb->dev, skb, c, 0);
+		rcu_read_unlock();
 	}
 }
 
@@ -1066,7 +1064,8 @@ static void ipmr_cache_resolve(struct net *net, struct mr_table *mrt,
  * Called under rcu_read_lock().
  */
 static int ipmr_cache_report(const struct mr_table *mrt,
-			     struct sk_buff *pkt, vifi_t vifi, int assert)
+			     struct sk_buff *pkt, vifi_t vifi, int assert,
+			     bool nl_query)
 {
 	unsigned char pkt_cb[sizeof(pkt->cb)];
 	const int ihl = ip_hdrlen(pkt);
@@ -1136,7 +1135,7 @@ static int ipmr_cache_report(const struct mr_table *mrt,
 
 	memset(skb->cb, 0, sizeof(skb->cb));
 	/* Route queries from ipmr_get_route() carry NETLINK_CB, not IPCB. */
-	if (ip_hdr(pkt)->version) {
+	if (!nl_query) {
 		memcpy(pkt_cb, pkt->cb, sizeof(pkt_cb));
 		ipv4_pktinfo_prepare(mroute_sk, pkt, false);
 		*PKTINFO_SKB_CB(skb) = *PKTINFO_SKB_CB(pkt);
@@ -1159,7 +1158,8 @@ static int ipmr_cache_report(const struct mr_table *mrt,
 /* Queue a packet for resolution. It gets locked cache entry! */
 /* Called under rcu_read_lock() */
 static int ipmr_cache_unresolved(struct mr_table *mrt, vifi_t vifi,
-				 struct sk_buff *skb, struct net_device *dev)
+				 struct sk_buff *skb, struct net_device *dev,
+				 bool nl_query)
 {
 	struct net *net = read_pnet(&mrt->net);
 	const struct iphdr *iph = ip_hdr(skb);
@@ -1196,7 +1196,8 @@ static int ipmr_cache_unresolved(struct mr_table *mrt, vifi_t vifi,
 		c->mfc_mcastgrp	= iph->daddr;
 
 		/* Reflect first query at mrouted. */
-		err = ipmr_cache_report(mrt, skb, vifi, IGMPMSG_NOCACHE);
+		err = ipmr_cache_report(mrt, skb, vifi, IGMPMSG_NOCACHE,
+					nl_query);
 		if (err < 0)
 			goto err;
 
@@ -1211,7 +1212,8 @@ static int ipmr_cache_unresolved(struct mr_table *mrt, vifi_t vifi,
 	}
 
 	/* See if we can append the packet */
-	if (c->_c.mfc_un.unres.unresolved.qlen > 3) {
+	if (skb_queue_len(&c->_c.mfc_un.unres.unresolved) +
+	    skb_queue_len(&c->_c.mfc_un.unres.nl_queries) > 3) {
 		c = NULL;
 		err = -ENOBUFS;
 		goto err;
@@ -1222,7 +1224,8 @@ static int ipmr_cache_unresolved(struct mr_table *mrt, vifi_t vifi,
 		skb->skb_iif = dev->ifindex;
 	}
 
-	skb_queue_tail(&c->_c.mfc_un.unres.unresolved, skb);
+	skb_queue_tail(nl_query ? &c->_c.mfc_un.unres.nl_queries :
+				  &c->_c.mfc_un.unres.unresolved, skb);
 
 	spin_unlock_bh(&mfc_unres_lock);
 	return 0;
@@ -1937,7 +1940,7 @@ static int ipmr_prepare_xmit(struct net *net, struct mr_table *mrt,
 		WRITE_ONCE(vif->bytes_out, vif->bytes_out + skb->len);
 		DEV_STATS_ADD(vif_dev, tx_bytes, skb->len);
 		DEV_STATS_INC(vif_dev, tx_packets);
-		ipmr_cache_report(mrt, skb, vifi, IGMPMSG_WHOLEPKT);
+		ipmr_cache_report(mrt, skb, vifi, IGMPMSG_WHOLEPKT, false);
 		return -1;
 	}
 
@@ -2114,10 +2117,11 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 			       c->_c.mfc_un.res.last_assert +
 			       MFC_ASSERT_THRESH)) {
 			c->_c.mfc_un.res.last_assert = jiffies;
-			ipmr_cache_report(mrt, skb, true_vifi, IGMPMSG_WRONGVIF);
+			ipmr_cache_report(mrt, skb, true_vifi, IGMPMSG_WRONGVIF,
+					  false);
 			if (READ_ONCE(mrt->mroute_do_wrvifwhole))
 				ipmr_cache_report(mrt, skb, true_vifi,
-						  IGMPMSG_WRVIFWHOLE);
+						  IGMPMSG_WRVIFWHOLE, false);
 		}
 		goto dont_forward;
 	}
@@ -2287,7 +2291,7 @@ int ip_mr_input(struct sk_buff *skb)
 
 		vif = ipmr_find_vif(mrt, dev);
 		if (vif >= 0)
-			return ipmr_cache_unresolved(mrt, vif, skb, dev);
+			return ipmr_cache_unresolved(mrt, vif, skb, dev, false);
 		kfree_skb(skb);
 		return -ENODEV;
 	}
@@ -2395,7 +2399,7 @@ int ip_mr_output(struct net *net, struct sock *sk, struct sk_buff *skb)
 	if (!cache) {
 		vif = ipmr_find_vif(mrt, dev);
 		if (vif >= 0)
-			return ipmr_cache_unresolved(mrt, vif, skb, dev);
+			return ipmr_cache_unresolved(mrt, vif, skb, dev, false);
 		goto mc_output;
 	}
 
@@ -2517,7 +2521,7 @@ int ipmr_get_route(struct net *net, struct sk_buff *skb,
 		iph->saddr = saddr;
 		iph->daddr = daddr;
 		iph->version = 0;
-		err = ipmr_cache_unresolved(mrt, vif, skb2, dev);
+		err = ipmr_cache_unresolved(mrt, vif, skb2, dev, true);
 		rcu_read_unlock();
 		return err;
 	}
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 8e647213ade1b..6465ed11a0b53 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -826,19 +826,18 @@ static void ip6mr_destroy_unres(struct mr_table *mrt, struct mfc6_cache *c)
 	WRITE_ONCE(mrt->cache_resolve_queue_len,
 		   mrt->cache_resolve_queue_len - 1);
 
-	while ((skb = skb_dequeue(&c->_c.mfc_un.unres.unresolved)) != NULL) {
-		if (ipv6_hdr(skb)->version == 0) {
-			struct nlmsghdr *nlh = skb_pull(skb,
-							sizeof(struct ipv6hdr));
-			nlh->nlmsg_type = NLMSG_ERROR;
-			nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
-			skb_trim(skb, nlh->nlmsg_len);
-			((struct nlmsgerr *)nlmsg_data(nlh))->error = -ETIMEDOUT;
-			rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
-		} else
-			kfree_skb(skb);
+	while ((skb = skb_dequeue(&c->_c.mfc_un.unres.nl_queries))) {
+		struct nlmsghdr *nlh = skb_pull(skb, sizeof(struct ipv6hdr));
+
+		nlh->nlmsg_type = NLMSG_ERROR;
+		nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
+		skb_trim(skb, nlh->nlmsg_len);
+		((struct nlmsgerr *)nlmsg_data(nlh))->error = -ETIMEDOUT;
+		rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
 	}
 
+	skb_queue_purge(&c->_c.mfc_un.unres.unresolved);
+
 	ip6mr_cache_free(c);
 }
 
@@ -1046,6 +1045,7 @@ static struct mfc6_cache *ip6mr_cache_alloc_unres(void)
 	if (!c)
 		return NULL;
 	skb_queue_head_init(&c->_c.mfc_un.unres.unresolved);
+	skb_queue_head_init(&c->_c.mfc_un.unres.nl_queries);
 	c->_c.mfc_un.unres.expires = jiffies + 10 * HZ;
 	return c;
 }
@@ -1059,30 +1059,26 @@ static void ip6mr_cache_resolve(struct net *net, struct mr_table *mrt,
 {
 	struct sk_buff *skb;
 
-	/*
-	 *	Play the pending entries through our router
-	 */
+	/* Answer the pending netlink route queries */
+	while ((skb = __skb_dequeue(&uc->_c.mfc_un.unres.nl_queries))) {
+		struct nlmsghdr *nlh = skb_pull(skb, sizeof(struct ipv6hdr));
 
-	while ((skb = __skb_dequeue(&uc->_c.mfc_un.unres.unresolved))) {
-		if (ipv6_hdr(skb)->version == 0) {
-			struct nlmsghdr *nlh = skb_pull(skb,
-							sizeof(struct ipv6hdr));
-
-			if (mr_fill_mroute(mrt, skb, &c->_c,
-					   nlmsg_data(nlh)) > 0) {
-				nlh->nlmsg_len = skb_tail_pointer(skb) - (u8 *)nlh;
-			} else {
-				nlh->nlmsg_type = NLMSG_ERROR;
-				nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
-				skb_trim(skb, nlh->nlmsg_len);
-				((struct nlmsgerr *)nlmsg_data(nlh))->error = -EMSGSIZE;
-			}
-			rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+		if (mr_fill_mroute(mrt, skb, &c->_c, nlmsg_data(nlh)) > 0) {
+			nlh->nlmsg_len = skb_tail_pointer(skb) - (u8 *)nlh;
 		} else {
-			rcu_read_lock();
-			ip6_mr_forward(net, mrt, skb->dev, skb, c);
-			rcu_read_unlock();
+			nlh->nlmsg_type = NLMSG_ERROR;
+			nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr));
+			skb_trim(skb, nlh->nlmsg_len);
+			((struct nlmsgerr *)nlmsg_data(nlh))->error = -EMSGSIZE;
 		}
+		rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
+	}
+
+	/* Play the pending packets through our router */
+	while ((skb = __skb_dequeue(&uc->_c.mfc_un.unres.unresolved))) {
+		rcu_read_lock();
+		ip6_mr_forward(net, mrt, skb->dev, skb, c);
+		rcu_read_unlock();
 	}
 }
 
@@ -1187,7 +1183,8 @@ static int ip6mr_cache_report(const struct mr_table *mrt, struct sk_buff *pkt,
 
 /* Queue a packet for resolution. It gets locked cache entry! */
 static int ip6mr_cache_unresolved(struct mr_table *mrt, mifi_t mifi,
-				  struct sk_buff *skb, struct net_device *dev)
+				  struct sk_buff *skb, struct net_device *dev,
+				  bool nl_query)
 {
 	struct net *net = read_pnet(&mrt->net);
 	struct mfc6_cache *c = NULL;
@@ -1241,7 +1238,8 @@ static int ip6mr_cache_unresolved(struct mr_table *mrt, mifi_t mifi,
 	}
 
 	/* See if we can append the packet */
-	if (c->_c.mfc_un.unres.unresolved.qlen > 3) {
+	if (skb_queue_len(&c->_c.mfc_un.unres.unresolved) +
+	    skb_queue_len(&c->_c.mfc_un.unres.nl_queries) > 3) {
 		c = NULL;
 		err = -ENOBUFS;
 		goto err;
@@ -1253,7 +1251,8 @@ static int ip6mr_cache_unresolved(struct mr_table *mrt, mifi_t mifi,
 	}
 
 	skb_dst_drop(skb);
-	skb_queue_tail(&c->_c.mfc_un.unres.unresolved, skb);
+	skb_queue_tail(nl_query ? &c->_c.mfc_un.unres.nl_queries :
+				  &c->_c.mfc_un.unres.unresolved, skb);
 
 	spin_unlock_bh(&mfc_unres_lock);
 	return 0;
@@ -2398,7 +2397,8 @@ int ip6_mr_input(struct sk_buff *skb)
 
 		vif = ip6mr_find_vif(mrt, dev);
 		if (vif >= 0) {
-			int err = ip6mr_cache_unresolved(mrt, vif, skb, dev);
+			int err = ip6mr_cache_unresolved(mrt, vif, skb, dev,
+							 false);
 
 			return err;
 		}
@@ -2450,7 +2450,7 @@ int ip6_mr_output(struct net *net, struct sock *sk, struct sk_buff *skb)
 	if (!cache) {
 		vif = ip6mr_find_vif(mrt, dev);
 		if (vif >= 0)
-			return ip6mr_cache_unresolved(mrt, vif, skb, dev);
+			return ip6mr_cache_unresolved(mrt, vif, skb, dev, false);
 		goto ip6_output;
 	}
 
@@ -2527,7 +2527,7 @@ int ip6mr_get_route(struct net *net, struct sk_buff *skb, struct rtmsg *rtm,
 		iph->saddr = rt->rt6i_src.addr;
 		iph->daddr = rt->rt6i_dst.addr;
 
-		err = ip6mr_cache_unresolved(mrt, vif, skb2, dev);
+		err = ip6mr_cache_unresolved(mrt, vif, skb2, dev, true);
 		rcu_read_unlock();
 
 		return err;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0255/1005] nvme-loop: delete the controller if a reset fails
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (253 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0254/1005] ipmr, ip6mr: queue netlink route queries out of band Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0256/1005] nvmet-tcp: ask for the TLS record type on every receive Greg Kroah-Hartman
                   ` (118 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Josef Bacik, Jens Axboe, Keith Busch,
	Sasha Levin

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

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

From: Josef Bacik <josef@toxicpanda.com>

[ Upstream commit bc2170d365861d29dce20f982093873baad09804 ]

If the reconnect of a reset fails, nvme_loop_reset_ctrl_work() tears the
controller down by hand with nvme_uninit_ctrl(). Since that was split
from nvme_stop_ctrl() it no longer removes the namespaces, which hold
references to the controller. A reset while the target no longer accepts
the host (allow_any_host 0) is enough to get there: a sysfs reset hangs
in kernfs_drain(), an ioctl reset leaves a controller stuck in
CONNECTING with its block devices, the cntlid can't be reused, and
module unload deletes the controller a second time and hits a
use-after-free.

Do what the other fabrics drivers do and call nvme_delete_ctrl(). The
delete path quiesces the admin queue and only unquiesces it if the queue
is live, which it isn't after a failed reset, so unquiesce it
unconditionally before destroying it so a stuck request can't block the
freeze.

Fixes: d09f2b45f346 ("nvme: split nvme_uninit_ctrl into stop and uninit")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/loop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index e579a307798b9..80b67608eb155 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -420,6 +420,8 @@ static void nvme_loop_shutdown_ctrl(struct nvme_loop_ctrl *ctrl)
 static void nvme_loop_delete_ctrl_host(struct nvme_ctrl *ctrl)
 {
 	nvme_loop_shutdown_ctrl(to_loop_ctrl(ctrl));
+	/* Left quiesced if a failed reset has left no admin queue behind */
+	nvme_unquiesce_admin_queue(ctrl);
 	nvme_remove_admin_tag_set(ctrl);
 }
 
@@ -483,9 +485,8 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work)
 	nvme_cancel_admin_tagset(&ctrl->ctrl);
 	nvme_loop_destroy_admin_queue(ctrl);
 out_disable:
-	nvme_remove_admin_tag_set(&ctrl->ctrl);
 	dev_warn(ctrl->ctrl.device, "Removing after reset failure\n");
-	nvme_uninit_ctrl(&ctrl->ctrl);
+	nvme_delete_ctrl(&ctrl->ctrl);
 }
 
 static const struct nvme_ctrl_ops nvme_loop_ctrl_ops = {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0256/1005] nvmet-tcp: ask for the TLS record type on every receive
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (254 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0255/1005] nvme-loop: delete the controller if a reset fails Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0257/1005] nvmet-auth: keep the old keys if the new ones fail Greg Kroah-Hartman
                   ` (117 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Hannes Reinecke, Josef Bacik, Jens Axboe,
	Keith Busch, Sasha Levin

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

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

From: Josef Bacik <josef@toxicpanda.com>

[ Upstream commit 77f72de389e3774dc95d7cd03a98a73e47013abd ]

nvmet_tcp_alloc_cmd() points recv_msg.msg_control at recv_cbuf once.
The first receive that stores a record type there advances msg_control
and leaves msg_controllen at 0 for the lifetime of the command. From
then on nvmet_tcp_try_recv_data() sees the record type of that first
receive: if it was an alert, all later data is dropped as alerts and the
queue stalls, if it was data, a later alert can't be reported and
tls_sw_recvmsg() fails with -EIO.

Set up the control buffer before each receive, like the other receive
paths do.

Fixes: a1c5dd8355b1 ("nvmet-tcp: control messages for recvmsg()")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/tcp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 85a10679d0a93..8287f19741e80 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -1302,6 +1302,11 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue)
 	int len, ret;
 
 	while (msg_data_left(&cmd->recv_msg)) {
+		if (queue->tls_pskid) {
+			/* The last receive has used it up */
+			cmd->recv_msg.msg_control = cmd->recv_cbuf;
+			cmd->recv_msg.msg_controllen = sizeof(cmd->recv_cbuf);
+		}
 		len = sock_recvmsg(cmd->queue->sock, &cmd->recv_msg,
 			cmd->recv_msg.msg_flags);
 		if (len <= 0)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0257/1005] nvmet-auth: keep the old keys if the new ones fail
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (255 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0256/1005] nvmet-tcp: ask for the TLS record type on every receive Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0258/1005] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
                   ` (116 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hannes Reinecke, Christoph Hellwig,
	Sagi Grimberg, Chaitanya Kulkarni, Hannes Reinecke, Josef Bacik,
	Jens Axboe, Keith Busch, Sasha Levin

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

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

From: Josef Bacik <josef@toxicpanda.com>

[ Upstream commit 41ad4af45ac90259c652135b24539a08a92a7491 ]

AUTH_Negotiate on the admin queue has nvmet_setup_auth() reload the
host's keys, and it frees the old host key first. If decoding the new
secret fails, or an allocation does, the controller is left without a
host key, which means no authentication at all: nvmet_check_auth_status()
passes everything and I/O queue Connects no longer ask for it. configfs
accepts any string starting with "DHHC-1:" and a digit, so one typo
while changing a secret opens the namespaces to any connected admin
queue.

Decode the new keys first and only then replace the old ones.

Fixes: db1312dd9548 ("nvmet: implement basic In-Band Authentication")
Cc: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/auth.c | 69 ++++++++++++++++----------------------
 1 file changed, 28 insertions(+), 41 deletions(-)

diff --git a/drivers/nvme/target/auth.c b/drivers/nvme/target/auth.c
index 574025730834c..ccba84b1344e0 100644
--- a/drivers/nvme/target/auth.c
+++ b/drivers/nvme/target/auth.c
@@ -135,6 +135,7 @@ u8 nvmet_setup_auth(struct nvmet_ctrl *ctrl, struct nvmet_sq *sq, bool reset)
 	int ret = 0;
 	struct nvmet_host_link *p;
 	struct nvmet_host *host = NULL;
+	struct nvme_dhchap_key *host_key, *ctrl_key = NULL;
 
 	down_read(&nvmet_config_sem);
 	if (nvmet_is_disc_subsys(ctrl->subsys))
@@ -172,55 +173,41 @@ u8 nvmet_setup_auth(struct nvmet_ctrl *ctrl, struct nvmet_sq *sq, bool reset)
 		goto out_unlock;
 	}
 
-	if (host->dhchap_hash_id == ctrl->shash_id) {
-		pr_debug("Re-use existing hash ID %d\n",
-			 ctrl->shash_id);
-	} else {
-		ctrl->shash_id = host->dhchap_hash_id;
-	}
-
-	/* Skip the 'DHHC-1:XX:' prefix */
-	nvme_auth_free_key(ctrl->host_key);
-	ctrl->host_key = nvme_auth_extract_key(host->dhchap_secret + 10,
-					       host->dhchap_key_hash);
-	if (IS_ERR(ctrl->host_key)) {
+	/*
+	 * Skip the 'DHHC-1:XX:' prefix. Keep the old keys until the new ones
+	 * are there: a controller without a host key needs no authentication.
+	 */
+	host_key = nvme_auth_extract_key(host->dhchap_secret + 10,
+					 host->dhchap_key_hash);
+	if (IS_ERR(host_key)) {
 		ret = NVME_AUTH_DHCHAP_FAILURE_NOT_USABLE;
-		ctrl->host_key = NULL;
-		goto out_free_hash;
+		goto out_unlock;
 	}
+	if (host->dhchap_ctrl_secret) {
+		ctrl_key = nvme_auth_extract_key(host->dhchap_ctrl_secret + 10,
+						 host->dhchap_ctrl_key_hash);
+		if (IS_ERR(ctrl_key)) {
+			nvme_auth_free_key(host_key);
+			ret = NVME_AUTH_DHCHAP_FAILURE_NOT_USABLE;
+			goto out_unlock;
+		}
+	}
+	nvme_auth_free_key(ctrl->host_key);
+	ctrl->host_key = host_key;
+	nvme_auth_free_key(ctrl->ctrl_key);
+	ctrl->ctrl_key = ctrl_key;
+	ctrl->shash_id = host->dhchap_hash_id;
 #ifdef CONFIG_NVME_TARGET_AUTH_DEBUG
 	pr_debug("%s: using hash %s key %*ph\n", __func__,
 		 ctrl->host_key->hash > 0 ?
 		 nvme_auth_hmac_name(ctrl->host_key->hash) : "none",
 		 (int)ctrl->host_key->len, ctrl->host_key->key);
+	if (ctrl->ctrl_key)
+		pr_debug("%s: using ctrl hash %s key %*ph\n", __func__,
+			 ctrl->ctrl_key->hash > 0 ?
+			 nvme_auth_hmac_name(ctrl->ctrl_key->hash) : "none",
+			 (int)ctrl->ctrl_key->len, ctrl->ctrl_key->key);
 #endif
-	nvme_auth_free_key(ctrl->ctrl_key);
-	if (!host->dhchap_ctrl_secret) {
-		ctrl->ctrl_key = NULL;
-		goto out_unlock;
-	}
-
-	ctrl->ctrl_key = nvme_auth_extract_key(host->dhchap_ctrl_secret + 10,
-					       host->dhchap_ctrl_key_hash);
-	if (IS_ERR(ctrl->ctrl_key)) {
-		ret = NVME_AUTH_DHCHAP_FAILURE_NOT_USABLE;
-		ctrl->ctrl_key = NULL;
-		goto out_free_hash;
-	}
-#ifdef CONFIG_NVME_TARGET_AUTH_DEBUG
-	pr_debug("%s: using ctrl hash %s key %*ph\n", __func__,
-		 ctrl->ctrl_key->hash > 0 ?
-		 nvme_auth_hmac_name(ctrl->ctrl_key->hash) : "none",
-		 (int)ctrl->ctrl_key->len, ctrl->ctrl_key->key);
-#endif
-out_free_hash:
-	if (ret) {
-		if (ctrl->host_key) {
-			nvme_auth_free_key(ctrl->host_key);
-			ctrl->host_key = NULL;
-		}
-		ctrl->shash_id = 0;
-	}
 out_unlock:
 	up_read(&nvmet_config_sem);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0258/1005] nvmet-rdma: disconnect only established queues
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (256 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0257/1005] nvmet-auth: keep the old keys if the new ones fail Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0259/1005] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
                   ` (115 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit 000a9f4492abad6008682b55571ddc31941963e3 ]

Over iWARP, rdma_disconnect() sleeps in iw_cm_disconnect() until the
ESTABLISHED event of the connection has been handled, and iw_cm handles
all events of all connections one at a time on iw_cm_wq.
nvmet_rdma_destroy_port_queues(), nvmet_rdma_remove_one() and
nvmet_rdma_delete_ctrl() walk the queue list with
nvmet_rdma_queue_mutex held and call rdma_disconnect() for each, while
nvmet_rdma_cm_handler() takes the same mutex. If the walk sleeps on a
queue whose ESTABLISHED is queued behind another queue's event, both
are stuck and iWARP connection handling is dead until reboot. A peer
sets that up by connecting in a loop, or over siw by asking for MPA
peer-to-peer mode and then staying silent, which delays ESTABLISHED
indefinitely.

Only call rdma_disconnect() for a queue in NVMET_RDMA_Q_LIVE, which the
handler sets when it gets ESTABLISHED. A queue that never got there is
left to the release work: ib_drain_qp() moves the QP to the error
state, which ends the connection, and rdma_destroy_id() tells the peer.
Over IB and RoCE the skipped call did nothing more than that.

Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal")
Fixes: fcf73a804c7d ("nvmet-rdma: fix use-after-free when a port is removed")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/rdma.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index b9e39d1657d29..aab43d2aa0485 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1694,7 +1694,7 @@ static void nvmet_rdma_queue_established(struct nvmet_rdma_queue *queue)
 
 static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
 {
-	bool disconnect = false;
+	bool disconnect = false, live = false;
 	unsigned long flags;
 
 	pr_debug("cm_id= %p queue->state= %d\n", queue->cm_id, queue->state);
@@ -1713,6 +1713,7 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
 		}
 		fallthrough;
 	case NVMET_RDMA_Q_LIVE:
+		live = queue->state == NVMET_RDMA_Q_LIVE;
 		queue->state = NVMET_RDMA_Q_DISCONNECTING;
 		disconnect = true;
 		break;
@@ -1722,7 +1723,17 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
 	spin_unlock_irqrestore(&queue->state_lock, flags);
 
 	if (disconnect) {
-		rdma_disconnect(queue->cm_id);
+		/*
+		 * Over iWARP rdma_disconnect() sleeps until the CM has handled
+		 * the ESTABLISHED event of this connection. The CM handles the
+		 * events of all connections one at a time, and our handler
+		 * takes nvmet_rdma_queue_mutex, which callers of this function
+		 * hold. So a queue that has not seen the event is left to the
+		 * release work: ib_drain_qp() moves the queue pair to the error
+		 * state, which ends the connection.
+		 */
+		if (live)
+			rdma_disconnect(queue->cm_id);
 		queue_work(nvmet_wq, &queue->release_work);
 	}
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0259/1005] nvmet-tcp: limit the connections accepted per work run
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (257 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0258/1005] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0260/1005] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
                   ` (114 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Hannes Reinecke, Josef Bacik, Jens Axboe,
	Keith Busch, Sasha Levin

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

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

From: Josef Bacik <josef@toxicpanda.com>

[ Upstream commit a029f1b2fb13e6ac6e1c2f27fba1d80b6e7cac51 ]

nvmet_tcp_accept_work() loops until there's nothing left to accept, and
anyone opening and closing connections fast enough keeps it running
indefinitely, since tearing down a dead connection takes long enough for
more to arrive. Whoever flushes nvmet_wq waits for it: removing any
other port of the target does in nvmet_port_release(), and so does
unloading the rdma and fc modules.

Accept a bounded number of connections per run and requeue the work. A
flush doesn't wait for work queued behind it.

Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/tcp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 8287f19741e80..8788cfd813b8f 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -102,6 +102,7 @@ MODULE_PARM_DESC(tls_handshake_timeout,
 #define NVMET_TCP_RECV_BUDGET		8
 #define NVMET_TCP_SEND_BUDGET		8
 #define NVMET_TCP_IO_WORK_BUDGET	64
+#define NVMET_TCP_ACCEPT_BUDGET		16
 
 enum nvmet_tcp_send_state {
 	NVMET_TCP_SEND_DATA_PDU,
@@ -2073,9 +2074,9 @@ static void nvmet_tcp_accept_work(struct work_struct *w)
 	struct nvmet_tcp_port *port =
 		container_of(w, struct nvmet_tcp_port, accept_work);
 	struct socket *newsock;
-	int ret;
+	int ret, i;
 
-	while (true) {
+	for (i = 0; i < NVMET_TCP_ACCEPT_BUDGET; i++) {
 		ret = kernel_accept(port->sock, &newsock, O_NONBLOCK);
 		if (ret < 0) {
 			if (ret != -EAGAIN)
@@ -2084,6 +2085,9 @@ static void nvmet_tcp_accept_work(struct work_struct *w)
 		}
 		nvmet_tcp_alloc_queue(port, newsock);
 	}
+
+	/* There may be more. Come to an end for those who flush nvmet_wq. */
+	queue_work(nvmet_wq, &port->accept_work);
 }
 
 static void nvmet_tcp_listen_data_ready(struct sock *sk)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0260/1005] nvmet-rdma: take a device off the list last
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (258 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0259/1005] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0261/1005] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
                   ` (113 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit 86ae3841aea4e29d7ac08d5614ca3823dc8dfbc9 ]

nvmet_rdma_remove_one() disconnects the queues of a device and flushes
nvmet-wq, but since commit a3dd7d0022c3 it returns right away if the
device isn't on device_list. nvmet_rdma_free_dev(), run by the release
work of the last queue, takes the device off that list first and frees
the SRQs and the PD afterwards. A device removal in between finds
nothing on the list, returns, and the RDMA core frees the device under
ib_dealloc_pd().

Free the SRQs and the PD first and unlist the device last, so the
remove callback finds it and its flush waits for the release work.

Fixes: a3dd7d0022c3 ("nvmet-rdma: Don't flush system_wq by default during remove_one")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/rdma.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index aab43d2aa0485..a1914f9a1b30f 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1197,13 +1197,18 @@ static void nvmet_rdma_free_dev(struct kref *ref)
 	struct nvmet_rdma_device *ndev =
 		container_of(ref, struct nvmet_rdma_device, ref);
 
+	nvmet_rdma_destroy_srqs(ndev);
+	ib_dealloc_pd(ndev->pd);
+
+	/*
+	 * Only delete from the device list once all RDMA resources are torn
+	 * down because nvmet_rdma_remove_one waits for the release work only
+	 * if the device still is on the list.
+	 */
 	mutex_lock(&device_list_mutex);
 	list_del(&ndev->entry);
 	mutex_unlock(&device_list_mutex);
 
-	nvmet_rdma_destroy_srqs(ndev);
-	ib_dealloc_pd(ndev->pd);
-
 	kfree(ndev);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0261/1005] nvmet-rdma: queue the release work under the mutex
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (259 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0260/1005] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0262/1005] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
                   ` (112 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit 80095787f776967361cca76357f19e5445e0cd75 ]

nvmet_rdma_remove_one() takes the queue mutex, unlists each queue of
the device and queues its release work, then flushes nvmet-wq. So a
queue that still holds objects on the device must either be on the
list or have its release work queued. nvmet_rdma_queue_disconnect()
breaks that: it unlists the queue under the mutex, drops it, and only
then calls __nvmet_rdma_queue_disconnect() to queue the work. A device
removal in that window finds nothing to wait for, and the release work
then destroys the QP and CQ share on a freed device.

Queue the work before dropping the mutex, as nvmet_rdma_remove_one()
itself does. That's safe now that rdma_disconnect() no longer sleeps on
an iWARP event that needs the same mutex.

Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/rdma.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index a1914f9a1b30f..e7dbfa383c57d 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1745,17 +1745,17 @@ static void __nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
 
 static void nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue)
 {
-	bool disconnect = false;
-
+	/*
+	 * Queue the release work with &nvmet_rdma_queue_mutex held, so that
+	 * nvmet_rdma_remove_one() either finds the queue on the list or the
+	 * work has already been queued.
+	 */
 	mutex_lock(&nvmet_rdma_queue_mutex);
 	if (!list_empty(&queue->queue_list)) {
 		list_del_init(&queue->queue_list);
-		disconnect = true;
+		__nvmet_rdma_queue_disconnect(queue);
 	}
 	mutex_unlock(&nvmet_rdma_queue_mutex);
-
-	if (disconnect)
-		__nvmet_rdma_queue_disconnect(queue);
 }
 
 static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0262/1005] nvmet-rdma: disconnect a queue on device removal
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (260 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0261/1005] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0263/1005] ASoC: rockchip_i2s: select REGMAP_MMIO Greg Kroah-Hartman
                   ` (111 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
	Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
	Sasha Levin

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

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

From: Chris Mason <mason@kernel.org>

[ Upstream commit a4387799d4228866dc1746b466cd17e1c638d050 ]

cma_remove_one() sends DEVICE_REMOVAL to the owner of every cm_id on
the device and then waits, without timeout, until they're all
destroyed. nvmet_rdma_device_removal() does nothing for a queue cm_id
and leaves the queues to nvmet_rdma_remove_one(), which only works if
that runs first. As a module it does, nvmet-rdma registers after
rdma_cm. Built in, both register at the same initcall level and
drivers/Makefile lists nvme/ ahead of infiniband/, so cma_remove_one()
runs first and waits for cm_ids that only the later callback would
destroy. Since the RDMA CM drops all later events for a cm_id once it
has sent DEVICE_REMOVAL, a peer closing its connection doesn't help
either. One connection from anyone who can reach the port hangs "rdma
link delete" until something else ends the queue.

Call nvmet_rdma_queue_disconnect() for the queue. It unlists the queue
and queues the release work, which destroys the cm_id. Don't wait for
it, rdma_destroy_id() waits for the handler to return, which was the
deadlock before commit f1d4ef7d8883.

Fixes: f1d4ef7d8883 ("nvmet-rdma: register ib_client to not deadlock in device removal")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/rdma.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index e7dbfa383c57d..ff387fc47885d 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1782,10 +1782,13 @@ static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
  * queue cm_id and/or a device bound listener cm_id (where in this
  * case queue will be null).
  *
- * We registered an ib_client to handle device removal for queues,
- * so we only need to handle the listening port cm_ids. In this case
- * we nullify the priv to prevent double cm_id destruction and destroying
- * the cm_id implicitly by returning a non-zero rc to the callout.
+ * The RDMA CM waits until each cm_id of the device is destroyed, so a queue
+ * has to go now. Our ib_client also removes the queues, but it cannot be
+ * relied on here: built in, it is called after the RDMA CM's client.
+ *
+ * For a listening port cm_id we nullify the priv to prevent double cm_id
+ * destruction and destroying the cm_id implicitly by returning a non-zero
+ * rc to the callout.
  */
 static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
 		struct nvmet_rdma_queue *queue)
@@ -1793,11 +1796,7 @@ static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
 	struct nvmet_rdma_port *port;
 
 	if (queue) {
-		/*
-		 * This is a queue cm_id. we have registered
-		 * an ib_client to handle queues removal
-		 * so don't interfere and just return.
-		 */
+		nvmet_rdma_queue_disconnect(queue);
 		return 0;
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0263/1005] ASoC: rockchip_i2s: select REGMAP_MMIO
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (261 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0262/1005] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0264/1005] ASoC: rockchip_i2s_tdm: " Greg Kroah-Hartman
                   ` (110 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jude Gyimah, Mark Brown, Sasha Levin

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

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

From: Jude Gyimah <jude.gyimah87@gmail.com>

[ Upstream commit 1c57404bf9bad3e05d5686d91c208bf4e2b733d8 ]

rockchip_i2s calls __devm_regmap_init_mmio_clk, which
drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO.

  rockchip_i2s.c:(.text+0x418): undefined reference to
    `__devm_regmap_init_mmio_clk'

The driver can be built into vmlinux while REGMAP_MMIO is a module, in
which case the symbol is not there at link time.

Select rather than depend on: REGMAP_MMIO has no prompt of its own and is
only ever enabled by a select, so a depends on would leave
SND_SOC_ROCKCHIP_I2S unselectable.

Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_I2S=y and
CONFIG_REGMAP_MMIO=m.

Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.

Fixes: 4495c89fcf26 ("ASoC: add driver for Rockchip RK3xxx I2S controller")
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
Link: https://patch.msgid.link/20261103132537.3717496-2-jude.gyimah87@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/rockchip/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index 391ce2225fde0..d7ec1fbe17a57 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -5,6 +5,7 @@ menu "Rockchip"
 
 config SND_SOC_ROCKCHIP_I2S
 	tristate "Rockchip I2S Device Driver"
+	select REGMAP_MMIO
 	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
 	  Say Y or M if you want to add support for I2S driver for
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0264/1005] ASoC: rockchip_i2s_tdm: select REGMAP_MMIO
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (262 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0263/1005] ASoC: rockchip_i2s: select REGMAP_MMIO Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0265/1005] ASoC: rockchip_pdm: " Greg Kroah-Hartman
                   ` (109 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jude Gyimah, Mark Brown, Sasha Levin

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

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

From: Jude Gyimah <jude.gyimah87@gmail.com>

[ Upstream commit b8284f2b73f8de157be52b48d9968645f4ad6f7c ]

rockchip_i2s_tdm calls __devm_regmap_init_mmio_clk, which
drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO.

  rockchip_i2s_tdm.c:1304:(.text+0x14b1b6): undefined reference to
    `__devm_regmap_init_mmio_clk'

The driver can be built into vmlinux while REGMAP_MMIO is a module, in
which case the symbol is not there at link time.

Select rather than depend on: REGMAP_MMIO has no prompt of its own and is
only ever enabled by a select, so a depends on would leave
SND_SOC_ROCKCHIP_I2S_TDM unselectable.

Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_I2S_TDM=y and
CONFIG_REGMAP_MMIO=m.

Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.

Fixes: 081068fd6414 ("ASoC: rockchip: add support for i2s-tdm controller")
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
Link: https://patch.msgid.link/20261103132537.3717496-3-jude.gyimah87@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/rockchip/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index d7ec1fbe17a57..0f8ef68683568 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -14,6 +14,7 @@ config SND_SOC_ROCKCHIP_I2S
 
 config SND_SOC_ROCKCHIP_I2S_TDM
 	tristate "Rockchip I2S/TDM Device Driver"
+	select REGMAP_MMIO
 	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
 	  Say Y or M if you want to add support for the I2S/TDM driver for
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0265/1005] ASoC: rockchip_pdm: select REGMAP_MMIO
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (263 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0264/1005] ASoC: rockchip_i2s_tdm: " Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0266/1005] ASoC: rockchip_sai: " Greg Kroah-Hartman
                   ` (108 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jude Gyimah, Mark Brown, Sasha Levin

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

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

From: Jude Gyimah <jude.gyimah87@gmail.com>

[ Upstream commit 420c7918a61b97b8cd99e402e7e5a857edb097ee ]

rockchip_pdm calls __devm_regmap_init_mmio_clk, which
drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO.

  rockchip_pdm.c:(.text+0xef4): undefined reference to
    `__devm_regmap_init_mmio_clk'

The driver can be built into vmlinux while REGMAP_MMIO is a module, in
which case the symbol is not there at link time.

Select rather than depend on: REGMAP_MMIO has no prompt of its own and is
only ever enabled by a select, so a depends on would leave
SND_SOC_ROCKCHIP_PDM unselectable.

Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_PDM=y and
CONFIG_REGMAP_MMIO=m.

Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.

Fixes: fc05a5b22253 ("ASoC: rockchip: add support for pdm controller")
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
Link: https://patch.msgid.link/20261103132537.3717496-4-jude.gyimah87@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/rockchip/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index 0f8ef68683568..e0ded1fa4da5d 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -25,6 +25,7 @@ config SND_SOC_ROCKCHIP_I2S_TDM
 
 config SND_SOC_ROCKCHIP_PDM
 	tristate "Rockchip PDM Controller Driver"
+	select REGMAP_MMIO
 	select SND_SOC_GENERIC_DMAENGINE_PCM
 	select RATIONAL
 	help
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0266/1005] ASoC: rockchip_sai: select REGMAP_MMIO
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (264 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0265/1005] ASoC: rockchip_pdm: " Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0267/1005] ASoC: rockchip_spdif: " Greg Kroah-Hartman
                   ` (107 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jude Gyimah, Mark Brown, Sasha Levin

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

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

From: Jude Gyimah <jude.gyimah87@gmail.com>

[ Upstream commit 829904994e7a54fa89cf550e50dbcd58a09602eb ]

rockchip_sai calls __devm_regmap_init_mmio_clk, which
drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO.

  rockchip_sai.c:1424:(.text+0x153060): undefined reference to
    `__devm_regmap_init_mmio_clk'

The driver can be built into vmlinux while REGMAP_MMIO is a module, in
which case the symbol is not there at link time.

Select rather than depend on: REGMAP_MMIO has no prompt of its own and is
only ever enabled by a select, so a depends on would leave
SND_SOC_ROCKCHIP_SAI unselectable.

Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_SAI=y and
CONFIG_REGMAP_MMIO=m.

Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.

Fixes: cc78d1eaabad ("ASoC: rockchip: add Serial Audio Interface (SAI) driver")
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
Link: https://patch.msgid.link/20261103132537.3717496-5-jude.gyimah87@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/rockchip/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index e0ded1fa4da5d..aba9a518d3b26 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -35,6 +35,7 @@ config SND_SOC_ROCKCHIP_PDM
 
 config SND_SOC_ROCKCHIP_SAI
 	tristate "Rockchip SAI Controller Driver"
+	select REGMAP_MMIO
 	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
 	  Say Y or M if you want to add support for the Rockchip Serial Audio
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0267/1005] ASoC: rockchip_spdif: select REGMAP_MMIO
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (265 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0266/1005] ASoC: rockchip_sai: " Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0268/1005] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
                   ` (106 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jude Gyimah, Mark Brown, Sasha Levin

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

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

From: Jude Gyimah <jude.gyimah87@gmail.com>

[ Upstream commit 67a7e2073909e948c3cbd86c28d17e86c2958dd6 ]

rockchip_spdif calls __devm_regmap_init_mmio_clk, which
drivers/base/regmap/regmap-mmio.c provides under REGMAP_MMIO.

  rockchip_spdif.c:(.text+0xf67): undefined reference to
    `__devm_regmap_init_mmio_clk'

The driver can be built into vmlinux while REGMAP_MMIO is a module, in
which case the symbol is not there at link time.

Select rather than depend on: REGMAP_MMIO has no prompt of its own and is
only ever enabled by a select, so a depends on would leave
SND_SOC_ROCKCHIP_SPDIF unselectable.

Reproduced on v7.3, x86_64, with CONFIG_SND_SOC_ROCKCHIP_SPDIF=y and
CONFIG_REGMAP_MMIO=m.

Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.

Fixes: f874b80e1571 ("ASoC: rockchip: Add rockchip SPDIF transceiver driver")
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
Link: https://patch.msgid.link/20261103132537.3717496-6-jude.gyimah87@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/rockchip/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index aba9a518d3b26..0e5110125c140 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -45,6 +45,7 @@ config SND_SOC_ROCKCHIP_SAI
 
 config SND_SOC_ROCKCHIP_SPDIF
 	tristate "Rockchip SPDIF Device Driver"
+	select REGMAP_MMIO
 	select SND_PCM_IEC958
 	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0268/1005] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (266 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0267/1005] ASoC: rockchip_spdif: " Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0269/1005] net: stop defer_count outliving the deferred-free list Greg Kroah-Hartman
                   ` (105 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, James Clark, Jacob Keller,
	Dave Miller, Sasha Levin

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

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

From: James Clark <jjc@jclark.com>

[ Upstream commit 3f1054a0cb09552dd54db024694f74747f9f1d49 ]

A periodic output requested by PTP_PEROUT_REQUEST2 drifts away from
the PHC as soon as the PHC frequency is adjusted, for example by ptp4l
or ts2phc: at +10 ppm each edge is 10 us later than the one before.

The GenF that generates the output counts its period in ref_clk
cycles, which the PPM correction of the CPTS clock does not reach;
each GenF has its own PPM registers. am65_cpts_ptp_adjfine() programs
them only for the GenF used for PPS, and am65_cpts_perout_enable_hw()
starts every GenF with them cleared, so a GenF used for a periodic
output is never corrected.

Commit eb9233ce6751 ("net: ethernet: ti: am65-cpts: adjust pps following
ptp changes") added the correction for the PPS GenF, and
commit 7849c42da2ca ("net: ethernet: ti: am65-cpts: adjust estf following
ptp changes") passed the same values to the ESTFs.

In am65_cpts_ptp_adjfine(), update every enabled GenF the way the PPS
GenF was updated: read its control register, set or clear the PPM
direction bit and write it back with the PPM value. The PPS GenF and the
ESTFs get exactly the values they got before. In
am65_cpts_perout_enable_hw(), start a GenF with the current correction
instead of none; this applies to the PPS GenF too.

Tested on a BeagleY-AI (J722S) with the GENF0 output looped back to
the HW1_TS_PUSH input (EXTTS 0). With the PHC frequency adjusted by
+10 ppm before the periodic output is started, the edges drift 10 us
per second against the PHC without this patch (290 us after 29 s);
with it, they stay 20 to 23 ns after the PHC second. This also works
if the frequency is adjusted after the periodic output has started.

Fixes: f6bd59526ca5 ("net: ethernet: ti: introduce am654 common platform time sync driver")
Signed-off-by: James Clark <jjc@jclark.com>
Reviewed-by: Jacob Keller <Jacob.e.keller@intel.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/ti/am65-cpts.c | 67 +++++++++++++++++++----------
 1 file changed, 45 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c
index df5659ead72f6..0d71147f3c291 100644
--- a/drivers/net/ethernet/ti/am65-cpts.c
+++ b/drivers/net/ethernet/ti/am65-cpts.c
@@ -176,6 +176,9 @@ struct am65_cpts {
 	struct mutex ptp_clk_lock; /* PHC access sync */
 	u64 timestamp;
 	u32 genf_enable;
+	bool genf_neg_adj;
+	u32 genf_ppm_hi;
+	u32 genf_ppm_low;
 	u32 hw_ts_enable;
 	u32 estf_enable;
 	struct sk_buff_head txq;
@@ -436,9 +439,11 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 {
 	struct am65_cpts *cpts = container_of(ptp, struct am65_cpts, ptp_info);
 	u32 estf_ctrl_val = 0, estf_ppm_hi = 0, estf_ppm_low = 0;
+	u32 genf_ctrl_val[AM65_CPTS_GENF_MAX_NUM];
+	u32 genf_ppm_hi, genf_ppm_low;
 	s32 ppb = scaled_ppm_to_ppb(scaled_ppm);
 	int pps_index = cpts->pps_genf_idx;
-	u64 adj_period, pps_adj_period;
+	u64 adj_period, genf_adj_period;
 	u32 ctrl_val, ppm_hi, ppm_low;
 	unsigned long flags;
 	int neg_adj = 0, i;
@@ -470,20 +475,33 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 	ppm_hi = upper_32_bits(adj_period) & 0x3FF;
 	ppm_low = lower_32_bits(adj_period);
 
+	/* GenF PPM will do correction using cpts refclk tick which is
+	 * (cpts->ts_add_val + 1) ns, so GenF length PPM adj period
+	 * need to be corrected.
+	 */
+	genf_adj_period = adj_period * (cpts->ts_add_val + 1);
+	genf_ppm_hi = upper_32_bits(genf_adj_period) & 0x3FF;
+	genf_ppm_low = lower_32_bits(genf_adj_period);
+	cpts->genf_neg_adj = neg_adj;
+	cpts->genf_ppm_hi = genf_ppm_hi;
+	cpts->genf_ppm_low = genf_ppm_low;
+
+	for (i = 0; i < AM65_CPTS_GENF_MAX_NUM; i++) {
+		if (cpts->genf_enable & BIT(i)) {
+			genf_ctrl_val[i] = am65_cpts_read32(cpts,
+							    genf[i].control);
+			if (neg_adj)
+				genf_ctrl_val[i] &= ~BIT(1);
+			else
+				genf_ctrl_val[i] |= BIT(1);
+		}
+	}
+
 	if (cpts->pps_enabled) {
-		estf_ctrl_val = am65_cpts_read32(cpts, genf[pps_index].control);
-		if (neg_adj)
-			estf_ctrl_val &= ~BIT(1);
-		else
-			estf_ctrl_val |= BIT(1);
-
-		/* GenF PPM will do correction using cpts refclk tick which is
-		 * (cpts->ts_add_val + 1) ns, so GenF length PPM adj period
-		 * need to be corrected.
-		 */
-		pps_adj_period = adj_period * (cpts->ts_add_val + 1);
-		estf_ppm_hi = upper_32_bits(pps_adj_period) & 0x3FF;
-		estf_ppm_low = lower_32_bits(pps_adj_period);
+		/* am65_cpts_perout_enable_hw() sets pps_index in genf_enable */
+		estf_ctrl_val = genf_ctrl_val[pps_index];
+		estf_ppm_hi = genf_ppm_hi;
+		estf_ppm_low = genf_ppm_low;
 	}
 
 	spin_lock_irqsave(&cpts->lock, flags);
@@ -500,10 +518,13 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 	am65_cpts_write32(cpts, ppm_hi, ts_ppm_hi);
 	am65_cpts_write32(cpts, ppm_low, ts_ppm_low);
 
-	if (cpts->pps_enabled) {
-		am65_cpts_write32(cpts, estf_ctrl_val, genf[pps_index].control);
-		am65_cpts_write32(cpts, estf_ppm_hi, genf[pps_index].ppm_hi);
-		am65_cpts_write32(cpts, estf_ppm_low, genf[pps_index].ppm_low);
+	for (i = 0; i < AM65_CPTS_GENF_MAX_NUM; i++) {
+		if (cpts->genf_enable & BIT(i)) {
+			am65_cpts_write32(cpts, genf_ctrl_val[i],
+					  genf[i].control);
+			am65_cpts_write32(cpts, genf_ppm_hi, genf[i].ppm_hi);
+			am65_cpts_write32(cpts, genf_ppm_low, genf[i].ppm_low);
+		}
 	}
 
 	for (i = 0; i < AM65_CPTS_ESTF_MAX_NUM; i++) {
@@ -513,7 +534,6 @@ static int am65_cpts_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 			am65_cpts_write32(cpts, estf_ppm_low, estf[i].ppm_low);
 		}
 	}
-	/* All GenF/EstF can be updated here the same way */
 	spin_unlock_irqrestore(&cpts->lock, flags);
 
 	mutex_unlock(&cpts->ptp_clk_lock);
@@ -679,9 +699,12 @@ static void am65_cpts_perout_enable_hw(struct am65_cpts *cpts,
 		val = lower_32_bits(cycles);
 		am65_cpts_write32(cpts, val, genf[req->index].length);
 
-		am65_cpts_write32(cpts, 0, genf[req->index].control);
-		am65_cpts_write32(cpts, 0, genf[req->index].ppm_hi);
-		am65_cpts_write32(cpts, 0, genf[req->index].ppm_low);
+		am65_cpts_write32(cpts, cpts->genf_neg_adj ? 0 : BIT(1),
+				  genf[req->index].control);
+		am65_cpts_write32(cpts, cpts->genf_ppm_hi,
+				  genf[req->index].ppm_hi);
+		am65_cpts_write32(cpts, cpts->genf_ppm_low,
+				  genf[req->index].ppm_low);
 
 		cpts->genf_enable |= BIT(req->index);
 	} else {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0269/1005] net: stop defer_count outliving the deferred-free list
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (267 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0268/1005] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0270/1005] erofs: treat files shared by inode_share as stacked Greg Kroah-Hartman
                   ` (104 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Kain, Dave Miller,
	Sasha Levin

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

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

From: Joseph Kain <jkain@nuro.ai>

[ Upstream commit 241dec6f9ab74d8c3ef246764f3611666b96b9e1 ]

After the llist conversion, rejected frees retain their counter
increments. A producer racing the counter reset and list detach can
also leave a count for an skb already drained. Deferred freeing can
then remain disabled while the list is empty.

Undo rejected reservations and subtract only the number of skbs
drained. Allow admission up to the configured limit. Retain the
halfway notification and also notify when the reserved count reaches
the limit, covering reservations published after an earlier purge.

Fixes: 844c9db7f7f5 ("net: use llist for sd->defer_list")
Signed-off-by: Joseph Kain <jkain@nuro.ai>
Assisted-by: LLM
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/dev.c    |  8 +++++++-
 net/core/skbuff.c | 17 ++++++++++++++---
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 6ebba16aff1c8..cc95d271a3ec8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6967,16 +6967,22 @@ static void __skb_defer_free_flush(struct skb_defer_node *sdn, int budget)
 {
 	struct llist_node *free_list;
 	struct sk_buff *skb, *next;
+	long n = 0;
 
 	if (llist_empty(&sdn->defer_list))
 		return;
-	atomic_long_set(&sdn->defer_count, 0);
 	free_list = llist_del_all(&sdn->defer_list);
 
 	llist_for_each_entry_safe(skb, next, free_list, ll_node) {
 		prefetch(next);
 		napi_consume_skb(skb, budget);
+		n++;
 	}
+	/* Subtract exactly what was drained. Never store an absolute value:
+	 * mixing one with the relative updates in skb_attempt_defer_free()
+	 * lets the counter go negative, and it is read as unsigned there.
+	 */
+	atomic_long_sub(n, &sdn->defer_count);
 }
 
 void skb_defer_node_flush(struct skb_defer_node *sdn)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 512eddc0fc3d6..54a76d6723fb7 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -7408,8 +7408,14 @@ nodefer:	kfree_skb_napi_cache(skb);
 	defer_max = READ_ONCE(net_hotdata.sysctl_skb_defer_max);
 	defer_count = atomic_long_inc_return(&sdn->defer_count);
 
-	if (defer_count >= defer_max)
+	if (defer_count > defer_max) {
+		/* Undo the reservation. An llist_add() does not release one --
+		 * the skb stays charged until a flush subtracts the batch that
+		 * contains it -- so a rejected free must undo its own.
+		 */
+		atomic_long_dec(&sdn->defer_count);
 		goto nodefer;
+	}
 
 	llist_add(&skb->ll_node, &sdn->defer_list);
 
@@ -7418,8 +7424,13 @@ nodefer:	kfree_skb_napi_cache(skb);
 		return;
 	}
 
-	/* Send an IPI every time queue reaches half capacity. */
-	kick = (defer_count - 1) == (defer_max >> 1);
+	/* Half capacity, plus the skb that fills the queue. Equality alone can
+	 * be consumed early -- if the producer holding the kick value publishes
+	 * first, its purge drains only that skb and the reservations published
+	 * after it match nothing -- which would leave a full queue with nothing
+	 * pending.
+	 */
+	kick = (defer_count - 1) == (defer_max >> 1) || defer_count == defer_max;
 
 	/* Make sure to trigger NET_RX_SOFTIRQ on the remote CPU
 	 * if we are unlucky enough (this seems very unlikely).
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0270/1005] erofs: treat files shared by inode_share as stacked
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (268 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0269/1005] net: stop defer_count outliving the deferred-free list Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0271/1005] isofs: handle Rock Ridge long-form dates before 1900 Greg Kroah-Hartman
                   ` (103 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Daejun Park, Gao Xiang,
	Sasha Levin

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

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

From: Daejun Park <daejun7.park@samsung.com>

[ Upstream commit 7c26dc33ea7bb677db294bfb4e58d4207477c9e3 ]

A file-backed mount whose image or extra device is on a block-backed
EROFS passes erofs_is_stacked_file(). If inode_share shares that file,
erofs_real_inode() may pick an inode of a file-backed EROFS in the same
domain to read it. File-backed reads then nest in the same task.

Treat files that use erofs_ishare_fops as stacked.

Fixes: 34096ba919fd ("erofs: support unencoded inodes for page cache share")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20261030-erofs-fileio-bioset-v1-1-caf47adbb3a3@samsung.com
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Gao Xiang <xiang@kernel.org>
Signed-off-by: Gao Xiang (Docker) <xiang@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/erofs/super.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index ee01a5ef85931..e92a7fa90ae34 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -125,9 +125,12 @@ void *erofs_read_metadata(struct super_block *sb, struct erofs_buf *buf,
 /* see the comment in erofs_fc_fill_super() */
 static bool erofs_is_stacked_file(struct file *file)
 {
-	struct super_block *sb = file_inode(file)->i_sb;
+	struct inode *inode = file_inode(file);
+	struct super_block *sb = inode->i_sb;
 
-	return (sb->s_op == &erofs_sops && !sb->s_bdev) || sb->s_stack_depth;
+	return (sb->s_op == &erofs_sops && !sb->s_bdev) || sb->s_stack_depth ||
+	       (IS_ENABLED(CONFIG_EROFS_FS_PAGE_CACHE_SHARE) &&
+		inode->i_fop == &erofs_ishare_fops);
 }
 
 static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb,
@@ -713,6 +716,9 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
 		 * EROFS is the only fs supporting file-backed mounts for now.
 		 * It MUST change if another fs plans to support them, which
 		 * may also require adjusting FILESYSTEM_MAX_STACK_DEPTH.
+		 * Files shared by inode_share may be read through a
+		 * file-backed EROFS in the same domain, so treat them as
+		 * stacked too.
 		 */
 		if (erofs_is_stacked_file(sbi->dif0.file)) {
 			erofs_err(sb, "file-backed mounts cannot be applied to stacked fses");
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0271/1005] isofs: handle Rock Ridge long-form dates before 1900
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (269 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0270/1005] erofs: treat files shared by inode_share as stacked Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0272/1005] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
                   ` (102 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Jan Kara, Sasha Levin

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

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

From: Hungyu Lin <dennylin0707@gmail.com>

[ Upstream commit 0cbfc16fe49629f5c1fc3628405661c2b938ec61 ]

iso_date() stores the year relative to 1900 and rejects negative values.
Rock Ridge LONG_FORM timestamps encode calendar years from 1 to 9999,
so valid years before 1900 are returned as seconds since the Unix epoch
equal to zero instead of their recorded dates. For example, an 1899
timestamp on an image produced by xorriso is reported as 1970 by stat,
and cp -p preserves that incorrect time.

Use the calendar year for both timestamp formats and pass it directly
to mktime64(). Keep the epoch fallback for year zero, while allowing
valid long-form years before 1900. Short-form dates are unchanged.

Fixes: 5ea45f54c8d6 ("isofs: fix Y2038 and Y2156 issues in Rock Ridge TF entry")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20261029004902.76944-1-dennylin0707@gmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/isofs/util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/isofs/util.c b/fs/isofs/util.c
index 42f479da0b282..6f9a90e58a890 100644
--- a/fs/isofs/util.c
+++ b/fs/isofs/util.c
@@ -25,7 +25,7 @@ struct timespec64 iso_date(u8 *p, int flags)
 		year = (p[0] - '0') * 1000 +
 		       (p[1] - '0') * 100 +
 		       (p[2] - '0') * 10 +
-		       (p[3] - '0') - 1900;
+		       (p[3] - '0');
 		month = ((p[4] - '0') * 10 + (p[5] - '0'));
 		day = ((p[6] - '0') * 10 + (p[7] - '0'));
 		hour = ((p[8] - '0') * 10 + (p[9] - '0'));
@@ -34,7 +34,7 @@ struct timespec64 iso_date(u8 *p, int flags)
 		ts.tv_nsec = ((p[14] - '0') * 10 + (p[15] - '0')) * 10000000;
 		tz = p[16];
 	} else {
-		year = p[0];
+		year = p[0] + 1900;
 		month = p[1];
 		day = p[2];
 		hour = p[3];
@@ -45,10 +45,10 @@ struct timespec64 iso_date(u8 *p, int flags)
 		tz = flags & ISO_DATE_HIGH_SIERRA ? 0 : p[6];
 	}
 
-	if (year < 0) {
+	if (year < 1) {
 		ts.tv_sec = 0;
 	} else {
-		ts.tv_sec = mktime64(year+1900, month, day, hour, minute, second);
+		ts.tv_sec = mktime64(year, month, day, hour, minute, second);
 
 		/* sign extend */
 		if (tz & 0x80)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0272/1005] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer.
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (270 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0271/1005] isofs: handle Rock Ridge long-form dates before 1900 Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0273/1005] cpufreq: Hold the policy write lock when changing boost state Greg Kroah-Hartman
                   ` (101 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tom Williams, Guillaume Nault,
	Kuniyuki Iwashima, Neal Cardwell, Eric Dumazet, Paolo Abeni,
	Sasha Levin

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

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

From: Guillaume Nault <gnault@redhat.com>

[ Upstream commit 11140c51df12e594d6bf2c8d2af5dec63b0219ac ]

When receiving a pure ack from a peer that also sends data, we can
have SEG.SEQ > SND.WL1, even though the segment contains no data. This
makes tcp_may_update_window() return true (because of the
"after(ack_seq, tp->snd_wl1)" condition), and tcp_ack_update_window()
then adds FLAG_WIN_UPDATE to the segment set of flags, even when
there's no window update.

Since FLAG_WIN_UPDATE prevents the segment from being considered as
dup-ack (as it's part of FLAG_NOT_DUP), this can inhibit fast
retransmit on non-SACK connections, making recovery very slow as it
now entirely relies on RTO.

The "DUPLICATE ACKNOWLEDGMENT" definition of RFC 5681, section 2,
says that lack of window update is a necessary condition for a dup ack:
"(e) the advertised window in the incoming acknowledgment equals the
advertised window in the last incoming acknowledgment.". Spurious
window updates can thus prevent dup ack detection and, in the end, fast
retransmit.

Avoid this scenario by setting FLAG_WIN_UPDATE only when a window
update actually occurs. Pure acks with SEG.SEQ > SND.WL1 can now
be detected as dup-ack and trigger fast retransmission.

Also, stop setting FLAG_WIN_UPDATE in tcp_ack()'s header prediction
path. One of the conditions for header prediction to happen is that
received segments don't trigger a window update. This flag update was
thus wrong to begin with. Now that tcp_ack_update_window() sets
FLAG_WIN_UPDATE only if a window update actually occurred, we need the
header prediction path to stop reporting spurious window updates too.
Otherwise BPF programs would get inconsistent window update information
(CA_ACK_WIN_UPDATE) between fast an slow paths.

Finally, add FLAG_SND_UNA_ADVANCED to the definition of FLAG_NOT_DUP.
This is necessary for the case where an incoming segment acknowledges
less than a full segment of the retransmit queue. Such segments were
not considered dubious by tcp_ack_is_dubious() because of the spurious
FLAG_WIN_UPDATE flag, which prevented the segment from being seen as a
duplicate ack. Now that FLAG_WIN_UPDATE doesn't cover this scenario
anymore, we need another way to mark these acks as non-duplicate.
Adding FLAG_SND_UNA_ADVANCED to FLAG_NOT_DUP is the natural way of
doing this, since, by definition, a segment advancing SND.UNA, even by
a small amount, cannot be a duplicate ack.

A side effect of this patch is that repeated zero window acks received
from peer can now be considered duplicate acks (because of the the
"|| !win" condition in tcp_may_update_window()). Therefore, they can
now trigger fast retransmission and fast recovery, including congestion
window reduction, when the peer is stalled. This is RFC compliant and
shouldn't have any negative effect.

Add packetdrill selftest. Before this patch, the 1001:2001 segment was
retransmitted upon RTO, now it's sent right after reception of the
third duplicate ack.

Thanks to Tom Williams for the investigation help and initial
reproducer.

Reported-by: Tom Williams <Tom.D.Williams@MorganStanley.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/6426d558e45fc6ab724c40af62e4a8793215dd8a.1793219189.git.gnault@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/tcp_input.c                          |  6 +--
 .../tcp_bidir_fast_retransmit_nosack.pkt      | 42 +++++++++++++++++++
 2 files changed, 45 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8efa1cf5a67cd..6453815b03b4a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -107,7 +107,8 @@ int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
 #define FLAG_TS_PROGRESS	0x40000 /* Positive timestamp delta */
 
 #define FLAG_ACKED		(FLAG_DATA_ACKED|FLAG_SYN_ACKED)
-#define FLAG_NOT_DUP		(FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
+#define FLAG_NOT_DUP		(FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED|	\
+				 FLAG_SND_UNA_ADVANCED)
 #define FLAG_CA_ALERT		(FLAG_DATA_SACKED|FLAG_ECE|FLAG_DSACKING_ACK)
 #define FLAG_FORWARD_PROGRESS	(FLAG_ACKED|FLAG_DATA_SACKED)
 
@@ -3959,11 +3960,11 @@ static int tcp_ack_update_window(struct sock *sk, const struct sk_buff *skb, u32
 		nwin <<= tp->rx_opt.snd_wscale;
 
 	if (tcp_may_update_window(tp, ack, ack_seq, nwin)) {
-		flag |= FLAG_WIN_UPDATE;
 		tcp_update_wl(tp, ack_seq);
 
 		if (tp->snd_wnd != nwin) {
 			tp->snd_wnd = nwin;
+			flag |= FLAG_WIN_UPDATE;
 
 			/* Note, it is the only place, where
 			 * fast path is recovered for sending TCP.
@@ -4354,7 +4355,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 		 */
 		tcp_update_wl(tp, ack_seq);
 		tcp_snd_una_update(tp, ack);
-		flag |= FLAG_WIN_UPDATE;
 
 		NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPHPACKS);
 	} else {
diff --git a/tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt b/tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt
new file mode 100644
index 0000000000000..5c66b7171d229
--- /dev/null
+++ b/tools/testing/selftests/net/packetdrill/tcp_bidir_fast_retransmit_nosack.pkt
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Verify that non-SACK connections properly detect duplicate acks when mixed
+// with other data segments from peer.
+
+`./defaults.sh`
+
+    0     socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
+   +0...0 connect(4, ..., ...) = 0
+
+   // Three-way handshake, SACK not supported by peer
+   +0 > S  0:0(0) <mss 1460,sackOK,TS val 0 ecr 0,nop,wscale 8>
+   +0 < S. 0:0(0) ack 1 win 65535 <mss 1000>
+   +0 > .  1:1(0) ack 1
+
+   // Send 1000 bytes, peer acks everything
+   +0 send(4, ..., 1000, 0) = 1000
+   +0 > P. 1:1001(1000) ack 1
+   +0 < .  1:1(0) ack 1001 win 65535
+
+   // Send 4000 more bytes
+   +0 send(4, ..., 4000, 0) = 4000
+   +0 > P. 1001:5001(4000) ack 1
+
+   // Receive first dup-ack (considering segment 1001-2001 was lost)
+   +0 < .  1:1(0) ack 1001 win 65535
+
+   // Receive unrelated data segment from peer and ack it
+   +0 < P. 1:11(10) ack 1001 win 65535
+   +0 > .  5001:5001(0) ack 11
+
+   // Receive second dup-ack
+   +0 < .  11:11(0) ack 1001 win 65535
+
+   // Receive another data segment from peer and ack it
+   +0 < P. 11:21(10) ack 1001 win 65535
+   +0 > .  5001:5001(0) ack 21
+
+   // Receive third dup-ack, which should trigger fast retransmit (without
+   // waiting for RTO)
+   +0 < .  21:21(0) ack 1001 win 65535
+   +0 > .  1001:2001(1000) ack 21
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0273/1005] cpufreq: Hold the policy write lock when changing boost state
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (271 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0272/1005] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0274/1005] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
                   ` (100 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christian Loehle, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Christian Loehle <christian.loehle@arm.com>

[ Upstream commit e6f50e602e373583423654ec000cad8b8d08f7bc ]

The per-policy boost sysfs handler calls policy_set_boost() under
policy->rwsem, but the global boost handler and cpufreq_online() do not.
Consequently, global and per-policy boost changes can concurrently
update policy->boost_enabled, invoke the driver callback and update the
boost frequency QoS request. The driver callbacks also access policy
state, e.g. CPPC updates cpuinfo.max_freq that assumes policy->rw_sem
held.

Take policy->rwsem around policy_set_boost() in both unlocked
callers. Keep locking at the call sites because the per-policy sysfs
handler already holds the lock.

Fixes: 218a06a79d9a ("cpufreq: Support per-policy performance boost")
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/be3739f8-e668-4711-912c-91459d77ed35@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/cpufreq/cpufreq.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 54dde8419bdc4..015962e6c1fe4 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -576,6 +576,8 @@ static int policy_set_boost(struct cpufreq_policy *policy, bool enable)
 {
 	int ret;
 
+	lockdep_assert_held_write(&policy->rwsem);
+
 	if (policy->boost_enabled == enable)
 		return 0;
 
@@ -1629,6 +1631,8 @@ static int cpufreq_online(unsigned int cpu)
 	 */
 	if (cpufreq_driver->set_boost && policy->boost_supported &&
 	    (new_policy || !cpufreq_boost_enabled())) {
+		guard(cpufreq_policy_write)(policy);
+
 		ret = policy_set_boost(policy, cpufreq_boost_enabled());
 		if (ret) {
 			/* If the set_boost fails, the online operation is not affected */
@@ -2830,6 +2834,8 @@ static int cpufreq_boost_trigger_state(int state)
 		if (!policy->boost_supported)
 			continue;
 
+		guard(cpufreq_policy_write)(policy);
+
 		ret = policy_set_boost(policy, state);
 		if (unlikely(ret))
 			break;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0274/1005] net: skbuff: reject zero MPLS TTL before decrementing
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (272 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0273/1005] cpufreq: Hold the policy write lock when changing boost state Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0275/1005] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
                   ` (99 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Avi Weiss, Xia Yan, Simon Horman,
	Paolo Abeni, Sasha Levin

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

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

From: Avi Weiss <thnkslprpt@gmail.com>

[ Upstream commit 24614e72df484ad50ecba98aaa88c7df2448c122 ]

skb_mpls_dec_ttl() decrements the u8 TTL before checking whether it
expired. An incoming TTL of zero wraps to 255, causing the TC MPLS
dec_ttl action to pass an expired packet instead of dropping it.

Reject a zero TTL before the decrement while preserving the existing
behavior for TTL one and valid TTL values.

Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Xia Yan <yanxia@cmss.chinamobile.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261031114135.3784868-2-thnkslprpt@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/core/skbuff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 54a76d6723fb7..0cd5f30ff9bbf 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6779,7 +6779,7 @@ int skb_mpls_dec_ttl(struct sk_buff *skb)
 
 	lse = be32_to_cpu(mpls_hdr(skb)->label_stack_entry);
 	ttl = (lse & MPLS_LS_TTL_MASK) >> MPLS_LS_TTL_SHIFT;
-	if (!--ttl)
+	if (!ttl || !--ttl)
 		return -EINVAL;
 
 	lse &= ~MPLS_LS_TTL_MASK;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0275/1005] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (273 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0274/1005] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0276/1005] ipv6: Flush exception route while replacing nexthop Greg Kroah-Hartman
                   ` (98 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhou Minqiang, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Zhou Minqiang <zhouminqiang2@huawei.com>

[ Upstream commit 1f65b45f0f16e1c80a68a5757c9556f78bb39f19 ]

When a WQ_MEM_RECLAIM workqueue (e.g. iscsi_ctrl) triggers device removal
via device_del -> pm_runtime_remove, the unconditional flush_work inside
pm_runtime_remove can trigger a check_flush_dependency warning:

  CPU1: pm_wq worker                 CPU2: iscsi_ctrl wq
  --------                           --------

  pm_runtime_work(starget)           pm_runtime_remove(starget)
    spin_lock_irq(&starget->lock)      __pm_runtime_disable(starget, false)
    request_pending = false              spin_lock_irq(&starget->lock)
                                         (blocked, CPU1 holds the lock)

    rpm_suspend(starget, RPM_NOWAIT)
      status = RPM_SUSPENDING
      rpm_callback(cb, starget)
        spin_unlock_irq(&starget->lock)
                                         (acquires lock)
                                         disable_depth 0→1
                                         __pm_runtime_barrier():
                                           request_pending == false
                                             → skip cancel_work_sync
                                           status == RPM_SUSPENDING
                                             → enter wait_queue, sleep
                                           spin_unlock_irq(&starget->lock)
        cb(starget) → 0
        spin_lock_irq(&starget->lock)
      status = RPM_SUSPENDED
      wake_up_all(&wait_queue)
                                           (woken up, waiting for lock)
      spin_unlock(&starget->lock)          spin_lock_irq(&starget->lock)
                                             status == RPM_SUSPENDED
      spin_lock(&parent->lock)                → exit wait_queue
      rpm_idle(parent, RPM_ASYNC)        barrier returns
      spin_unlock(&parent->lock)       flush_work(&starget->work)
      spin_lock(&starget->lock)          __flush_work(from_cancel=false)
      spin_unlock_irq(&starget->lock)      check_flush_dependency()
                                            ← WARNING!

Replace flush_work with cancel_work_sync in pm_runtime_remove.
cancel_work_sync internally calls __flush_work with from_cancel=true,
which causes check_flush_dependency to return early before the warning.
This preserves the use-after-free fix from commit 29ab76827761
("PM: runtime: Fix a race condition related to device removal")
without the warning.

Fixes: 29ab76827761 ("PM: runtime: Fix a race condition related to device removal")
Signed-off-by: Zhou Minqiang <zhouminqiang2@huawei.com>
Link: https://patch.msgid.link/20261104115641.2682786-1-zhouminqiang2@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/base/power/runtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index f18d99c8d052b..7a62cb2b3f7ce 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1899,7 +1899,7 @@ void pm_runtime_reinit(struct device *dev)
 void pm_runtime_remove(struct device *dev)
 {
 	__pm_runtime_disable(dev, false);
-	flush_work(&dev->power.work);
+	cancel_work_sync(&dev->power.work);
 	pm_runtime_reinit(dev);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0276/1005] ipv6: Flush exception route while replacing nexthop.
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (274 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0275/1005] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0277/1005] ipv4: Batch rt_flush_dev() in netdev_run_todo() Greg Kroah-Hartman
                   ` (97 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jason Zhang, Kuniyuki Iwashima,
	Ido Schimmel, Paolo Abeni, Sasha Levin

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

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

From: Kuniyuki Iwashima <kuniyu@google.com>

[ Upstream commit 9401b428b5d4dfe1fd5752973fd02b4e9cd05536 ]

The following creates a cyclic reference between IPv6 route
and nexthop:

  1. create a nexthop A
  2. create a nexthop group w/ A
  3. create an IPv6 route with the nexthop group
  4. create an exception route w/ A
  5. replace A with a new nexthop B in the nexthop group
  6. remove the IPv6 route
  7. replace B with A in the nexthop group
  8. remove the nexthop group

Then, removing a device tied to the route gets stuck and
triggers the splat below. [0]

At 5., fib6_nh_release_dsts() is called, but it does not
flush exception routes, so the nexthop A continues to grab
the IPv6 route reference.

  nh_A->rt6i_exception_bucket[] -> rt6_ex->rt6i->from

At 6., fib6_purge_rt() calls rt6_flush_exceptions(), but it
only purges exceptions tied to nexthop B.  Also, the route is
unlinked from the nexthop group by list_del_init(&rt->nh_list).

  -> f6i->nh -> nhg->nh_entries[]

At 8., __remove_nexthop_fib() cannot find the IPv6 route, and
remove_nexthop_group() calls list_del_init(&nhge->nh_list) to
unlink the group from the nexthop A's nhe->grp_list.

  nhg->nh_entries[] -> nh_A -> ... -> f6i

Here, the nexthop A is reachable from net->nexthop.devhash[],
but remove_nexthop_from_groups() cannot find the nexthop group,
leaking the whole chain.

Let's call fib6_nh_flush_exceptions() in fib6_nh_release_dsts().

[0]:
unregister_netdevice: waiting for gre6 to become free. Usage count = 4
ref_tracker: netdev@000000009652f190 has 1/3 users at
     dst_alloc+0x14b/0x490
     ip6_rt_cache_alloc+0x27b/0x670
     __ip6_rt_update_pmtu+0x572/0x850
     ip6_tnl_xmit+0x8c5/0x1b70
     __gre6_xmit+0x7af/0xaa0
     ip6gre_tunnel_xmit+0x685/0xdc0
     dev_hard_start_xmit+0x204/0x5a0
     __dev_queue_xmit+0xe8a/0x2550
     ip6_finish_output+0x232/0x570
     ip6_output+0x226/0x3b0
     ip6_send_skb+0x133/0x250
     rawv6_push_pending_frames+0x503/0x6f0
     rawv6_sendmsg+0xdf0/0x1310
     sock_sendmsg_nosec+0xde/0x130
     __sys_sendto+0x27f/0x320
     __x64_sys_sendto+0xd9/0xf0

Fixes: 7bf4796dd099 ("nexthops: add support for replace")
Reported-by: Jason Zhang <jdz@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261101064418.2055158-2-kuniyu@google.com
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/route.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b8f51cabca3c9..256b77ac1e6a1 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3738,9 +3738,10 @@ void fib6_nh_release(struct fib6_nh *fib6_nh)
 {
 	struct rt6_exception_bucket *bucket;
 
+	fib6_nh_release_dsts(fib6_nh);
+
 	rcu_read_lock();
 
-	fib6_nh_flush_exceptions(fib6_nh, NULL);
 	bucket = fib6_nh_get_excptn_bucket(fib6_nh, NULL);
 	if (bucket) {
 		rcu_assign_pointer(fib6_nh->rt6i_exception_bucket, NULL);
@@ -3749,7 +3750,6 @@ void fib6_nh_release(struct fib6_nh *fib6_nh)
 
 	rcu_read_unlock();
 
-	fib6_nh_release_dsts(fib6_nh);
 	free_percpu(fib6_nh->rt6i_pcpu);
 
 	fib_nh_common_release(&fib6_nh->nh_common);
@@ -3759,6 +3759,8 @@ void fib6_nh_release_dsts(struct fib6_nh *fib6_nh)
 {
 	int cpu;
 
+	fib6_nh_flush_exceptions(fib6_nh, NULL);
+
 	if (!fib6_nh->rt6i_pcpu)
 		return;
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0277/1005] ipv4: Batch rt_flush_dev() in netdev_run_todo().
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (275 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0276/1005] ipv6: Flush exception route while replacing nexthop Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0278/1005] ipv6: Batch rt6_uncached_list_flush_dev() " Greg Kroah-Hartman
                   ` (96 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris J Arges, Kuniyuki Iwashima,
	Ido Schimmel, Jakub Kicinski, Sasha Levin

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

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

From: Kuniyuki Iwashima <kuniyu@google.com>

[ Upstream commit ca6854799069778fef446d307935f764cc3d3afb ]

IPv4 uncached routes are linked to the global per-cpu lists,
rt_uncached_list.

When unregistering a netdev, rt_flush_dev() iterates over the
potentially long lists to find uncached routes tied to the device
and swap it with blackhole_netdev.

Since it is called for every device in dying netns under RTNL,
it adds O(N_dev x (N_cpu + N_route)) costs to any batched device
unregistration.

Let's call it once per batched device unregistration without RTNL.

Note that rt_flush_dev() must be called after setting dev->reg_state
to NETREG_UNREGISTERED.  Otherwise, because rt_flush_dev(NULL) runs
without RTNL, it could race with unregister_netdevice_many_notify()
and prematurely purge routes for NETREG_UNREGISTERING dev, for
which flush_all_backlogs() has not been called yet.

Reported-by: Chris J Arges <carges@cloudflare.com>
Closes: https://lore.kernel.org/netdev/20260917-hash-bucket-route-lists-v3-0-30493a37b6eb@cloudflare.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Chris J Arges <carges@cloudflare.com>
Link: https://patch.msgid.link/20261001204752.2572265-6-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: a0fe1a3f390a ("ipv6: Flush rt->from in rt6_uncached_list_flush_dev().")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/route.h |  6 ++++++
 net/core/dev.c      |  4 ++++
 net/ipv4/route.c    | 11 +++++++++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/include/net/route.h b/include/net/route.h
index 45290177a33c4..b4dfa2dcfd6cc 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -129,7 +129,13 @@ struct in_device;
 
 int ip_rt_init(void);
 void rt_cache_flush(struct net *net);
+#ifdef CONFIG_INET
 void rt_flush_dev(struct net_device *dev);
+#else
+static inline void rt_flush_dev(struct net_device *dev)
+{
+}
+#endif
 
 static inline void inet_sk_init_flowi4(const struct inet_sock *inet,
 				       struct flowi4 *fl4)
diff --git a/net/core/dev.c b/net/core/dev.c
index cc95d271a3ec8..270adccbdcff5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -129,6 +129,7 @@
 #include <linux/ip.h>
 #include <net/ip.h>
 #include <net/mpls.h>
+#include <net/route.h>
 #include <linux/ipv6.h>
 #include <linux/in.h>
 #include <linux/jhash.h>
@@ -11885,6 +11886,9 @@ void netdev_run_todo(void)
 		linkwatch_sync_dev(dev);
 	}
 
+	if (!list_empty(&list))
+		rt_flush_dev(NULL);
+
 	cnt = 0;
 	while (!list_empty(&list)) {
 		dev = netdev_wait_allrefs_any(&list);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1d8fcd19eaf65..67c4fae2384b3 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1589,6 +1589,9 @@ void rt_flush_dev(struct net_device *dev)
 	struct rtable *rt, *safe;
 	int cpu;
 
+	if (dev && dev->dismantle)
+		return;
+
 	for_each_possible_cpu(cpu) {
 		struct uncached_list *ul = &per_cpu(rt_uncached_list, cpu);
 
@@ -1597,10 +1600,14 @@ void rt_flush_dev(struct net_device *dev)
 
 		spin_lock_bh(&ul->lock);
 		list_for_each_entry_safe(rt, safe, &ul->head, dst.rt_uncached) {
-			if (rt->dst.dev != dev)
+			struct net_device *rt_dev = rt->dst.dev;
+
+			if (dev ? rt_dev != dev :
+			    READ_ONCE(rt_dev->reg_state) != NETREG_UNREGISTERED)
 				continue;
+
 			rcu_assign_pointer(rt->dst.dev_rcu, blackhole_netdev);
-			netdev_ref_replace(dev, blackhole_netdev,
+			netdev_ref_replace(rt_dev, blackhole_netdev,
 					   &rt->dst.dev_tracker, GFP_ATOMIC);
 			list_del_init(&rt->dst.rt_uncached);
 		}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0278/1005] ipv6: Batch rt6_uncached_list_flush_dev() in netdev_run_todo().
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (276 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0277/1005] ipv4: Batch rt_flush_dev() in netdev_run_todo() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0279/1005] ipv6: Flush rt->from in rt6_uncached_list_flush_dev() Greg Kroah-Hartman
                   ` (95 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris J Arges, Kuniyuki Iwashima,
	Ido Schimmel, Jakub Kicinski, Sasha Levin

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

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

From: Kuniyuki Iwashima <kuniyu@google.com>

[ Upstream commit f12d2907992db7ba91cc4a1796dce3cffb01318c ]

IPv6 uncached routes are linked to the global per-cpu lists,
rt6_uncached_list.

When unregistering a netdev, rt6_uncached_list_flush_dev() iterates
over the potentially long lists to find uncached routes tied to
the device and swap it with blackhole_netdev.

Since it is called for every device in dying netns under RTNL,
it adds O(N_dev x (N_cpu + N_route)) costs to any batched device
unregistration.

Let's call it once per batched device unregistration without RTNL.

Because it now runs without RTNL, rt->dst.dev and rt->rt6i_idev->dev
may transition to NETREG_UNREGISTERED at different times.  Thus, we
must check that both devices are blackhole_netdev before unlinking
the route; otherwise, the remaining device reference would not be
flushed when the other device is unregistered.

In addition, since netdev_run_todo() runs even when IPv6 is disabled,
rt6_uncached_list_flush_dev() must check ipv6_mod_enabled() before
touching rt6_uncached_list.

Note also that netdev_run_todo() cannot be called before
rt6_uncached_list is initialised because:

  1. unregister_netdevice_many_notify() panics when
     dev_boot_phase == 1 (net_dev_init() is subsys_initcall()).

  2. the only device registered before fs_initcall_sync() is
     loopback and loopback_net_init() panics in case of failure.

Reported-by: Chris J Arges <carges@cloudflare.com>
Closes: https://lore.kernel.org/netdev/20260917-hash-bucket-route-lists-v3-0-30493a37b6eb@cloudflare.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Chris J Arges <carges@cloudflare.com>
Link: https://patch.msgid.link/20261001204752.2572265-7-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: a0fe1a3f390a ("ipv6: Flush rt->from in rt6_uncached_list_flush_dev().")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/ip6_route.h |  7 +++++++
 net/core/dev.c          |  5 ++++-
 net/ipv6/route.c        | 24 ++++++++++++++++--------
 3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 5fd0c0e4beac0..cf75208bfaa91 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -231,6 +231,13 @@ void rt6_multipath_rebalance(struct fib6_info *f6i);
 
 void rt6_uncached_list_add(struct rt6_info *rt);
 void rt6_uncached_list_del(struct rt6_info *rt);
+#ifdef CONFIG_IPV6
+void rt6_uncached_list_flush_dev(struct net_device *dev);
+#else
+static inline void rt6_uncached_list_flush_dev(struct net_device *dev)
+{
+}
+#endif
 
 static inline const struct rt6_info *skb_rt6_info(const struct sk_buff *skb)
 {
diff --git a/net/core/dev.c b/net/core/dev.c
index 270adccbdcff5..80d37066bf2bf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -131,6 +131,7 @@
 #include <net/mpls.h>
 #include <net/route.h>
 #include <linux/ipv6.h>
+#include <net/ip6_route.h>
 #include <linux/in.h>
 #include <linux/jhash.h>
 #include <linux/random.h>
@@ -11886,8 +11887,10 @@ void netdev_run_todo(void)
 		linkwatch_sync_dev(dev);
 	}
 
-	if (!list_empty(&list))
+	if (!list_empty(&list)) {
 		rt_flush_dev(NULL);
+		rt6_uncached_list_flush_dev(NULL);
+	}
 
 	cnt = 0;
 	while (!list_empty(&list)) {
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 256b77ac1e6a1..94273e6476885 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -158,10 +158,16 @@ void rt6_uncached_list_del(struct rt6_info *rt)
 	}
 }
 
-static void rt6_uncached_list_flush_dev(struct net_device *dev)
+void rt6_uncached_list_flush_dev(struct net_device *dev)
 {
 	int cpu;
 
+	if (!ipv6_mod_enabled())
+		return;
+
+	if (dev && dev->dismantle)
+		return;
+
 	for_each_possible_cpu(cpu) {
 		struct uncached_list *ul = per_cpu_ptr(&rt6_uncached_list, cpu);
 		struct rt6_info *rt, *safe;
@@ -173,22 +179,24 @@ static void rt6_uncached_list_flush_dev(struct net_device *dev)
 		list_for_each_entry_safe(rt, safe, &ul->head, dst.rt_uncached) {
 			struct inet6_dev *rt_idev = rt->rt6i_idev;
 			struct net_device *rt_dev = rt->dst.dev;
-			bool handled = false;
 
-			if (rt_idev && rt_idev->dev == dev) {
+			if (rt_idev &&
+			    (dev ? rt_idev->dev == dev :
+			     READ_ONCE(rt_idev->dev->reg_state) == NETREG_UNREGISTERED)) {
 				rt->rt6i_idev = in6_dev_get(blackhole_netdev);
 				in6_dev_put(rt_idev);
-				handled = true;
 			}
 
-			if (rt_dev == dev) {
-				rt->dst.dev = blackhole_netdev;
+			if (dev ? rt_dev == dev :
+			    READ_ONCE(rt_dev->reg_state) == NETREG_UNREGISTERED) {
+				rcu_assign_pointer(rt->dst.dev_rcu, blackhole_netdev);
 				netdev_ref_replace(rt_dev, blackhole_netdev,
 						   &rt->dst.dev_tracker,
 						   GFP_ATOMIC);
-				handled = true;
 			}
-			if (handled)
+
+			if (rt->dst.dev == blackhole_netdev &&
+			    (!rt->rt6i_idev || rt->rt6i_idev->dev == blackhole_netdev))
 				list_del_init(&rt->dst.rt_uncached);
 		}
 		spin_unlock_bh(&ul->lock);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0279/1005] ipv6: Flush rt->from in rt6_uncached_list_flush_dev().
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (277 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0278/1005] ipv6: Batch rt6_uncached_list_flush_dev() " Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0280/1005] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
                   ` (94 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jason Zhang, Kuniyuki Iwashima,
	Ido Schimmel, Paolo Abeni, Sasha Levin

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

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

From: Kuniyuki Iwashima <kuniyu@google.com>

[ Upstream commit a0fe1a3f390a75152c7395fdf63fc39da77d7838 ]

When a device is unregistered, rt6_uncached_list_flush_dev()
iterates over uncached routes and switches the dying dev
with blackhole_netdev.

However, rt->from could be cached via sk->sk_rx_dst and
hold the device reference.

Then, unregister_netdevice() gets stuck with the splat
below. [0]

Let's release rt->from in rt6_uncached_list_flush_dev().

Note that ip6_rt_copy_init() could set rt->from even if
in6_dev_get() returns NULL (e.g. mtu < IPV6_MIN_MTU is
set concurrently).

Also, rt->from->nh could be replaced with another device
than rt_dev and rt_idev->dev, and in such a case,
nexthop_flush_dev() sets fib6_destroying before
rt6_uncached_list_flush_dev().

[0]:
unregister_netdevice: waiting for dummy2 to become free. Usage count = 2
ref_tracker: netdev@000000006fb9da8c has 1/1 users at
     netdev_get_by_index+0x14c/0x170
     fib6_nh_init+0x1ae/0x1950
     ip6_route_info_create_nh+0x15d/0x780
     ip6_route_add+0x55/0x150
     inet6_rtm_newroute+0x15d/0x1360
     rtnetlink_rcv_msg+0x606/0x710
     netlink_rcv_skb+0x14f/0x2f0
     netlink_unicast+0x71b/0x940
     netlink_sendmsg+0x595/0x840
     __sock_sendmsg+0x119/0x150
     ____sys_sendmsg+0x3e9/0x5c0
     ___sys_sendmsg+0x157/0x1a0
     __x64_sys_sendmsg+0x119/0x170
     do_syscall_64+0x109/0x330
     entry_SYSCALL_64_after_hwframe+0x77/0x7f

Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes")
Reported-by: Jason Zhang <jdz@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261101064418.2055158-3-kuniyu@google.com
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/route.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 94273e6476885..1ec9fd20b07d8 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -179,12 +179,20 @@ void rt6_uncached_list_flush_dev(struct net_device *dev)
 		list_for_each_entry_safe(rt, safe, &ul->head, dst.rt_uncached) {
 			struct inet6_dev *rt_idev = rt->rt6i_idev;
 			struct net_device *rt_dev = rt->dst.dev;
+			struct fib6_info *from;
+			bool release_fib;
+
+			rcu_read_lock();
+			from = rcu_dereference(rt->from);
+			release_fib = from && from->fib6_destroying;
+			rcu_read_unlock();
 
 			if (rt_idev &&
 			    (dev ? rt_idev->dev == dev :
 			     READ_ONCE(rt_idev->dev->reg_state) == NETREG_UNREGISTERED)) {
 				rt->rt6i_idev = in6_dev_get(blackhole_netdev);
 				in6_dev_put(rt_idev);
+				release_fib = true;
 			}
 
 			if (dev ? rt_dev == dev :
@@ -193,6 +201,12 @@ void rt6_uncached_list_flush_dev(struct net_device *dev)
 				netdev_ref_replace(rt_dev, blackhole_netdev,
 						   &rt->dst.dev_tracker,
 						   GFP_ATOMIC);
+				release_fib = true;
+			}
+
+			if (release_fib) {
+				from = unrcu_pointer(xchg(&rt->from, NULL));
+				fib6_info_release(from);
 			}
 
 			if (rt->dst.dev == blackhole_netdev &&
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0280/1005] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow().
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (278 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0279/1005] ipv6: Flush rt->from in rt6_uncached_list_flush_dev() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:26 ` [PATCH 7.3 0281/1005] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() Greg Kroah-Hartman
                   ` (93 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jason Zhang, Kuniyuki Iwashima,
	Ido Schimmel, Paolo Abeni, Sasha Levin

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

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

From: Kuniyuki Iwashima <kuniyu@google.com>

[ Upstream commit 4019af3afd72864ec6abbfde2d76e416a64456c2 ]

Since the cited commit, ip_route_input_slow() could call
rt_dst_alloc() with vrf in the local_input: path.

If res->fi != NULL and one of the following is true,

  - a non-zero itag from fib_validate_source_reason()
    (realms/classid)
  - RTN_BROADCAST with BC_FORWARDING enabled

do_cache is set to false.

Then, the route is not added to rt_uncached_list, so the
route cannot be removed from rt_flush_dev().

If the route is cached in sk->sk_rx_dst, removing the
vrf device gets stuck. [0]

Let's call rt_add_uncached_list() if !do_cache in
ip_route_input_slow().

[0]:
unregister_netdevice: waiting for vrf0 to become free. Usage count = 2
ref_tracker: netdev@000000008b304ac4 has 1/1 users at
     dst_alloc+0x14b/0x490
     ip_route_input_rcu+0x1540/0x2530
     ip_route_input_noref+0x5a/0x90
     ip_rcv_finish_core+0x4b0/0x1140
     ip_rcv_finish+0xe6/0x190
     ip_rcv+0x6c/0x130
     __netif_receive_skb+0x121/0x300
     process_backlog+0x2df/0x5e0
     __napi_poll+0x8c/0x380
     net_rx_action+0x43c/0xab0
     handle_softirqs+0x19f/0x520
     do_softirq+0x46/0x60
     __local_bh_enable_ip+0x79/0x80
     __dev_queue_xmit+0x1b0e/0x24c0
     ip_finish_output2+0x8b2/0xcd0
     ip_output+0xf2/0x1e0

Fixes: f5a0aab84b74 ("net: ipv4: dst for local input routes should use l3mdev if relevant")
Reported-by: Jason Zhang <jdz@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261101064418.2055158-4-kuniyu@google.com
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/route.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 67c4fae2384b3..1720323d9f025 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2494,6 +2494,8 @@ ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
 
 		if (unlikely(!rt_cache_route(nhc, rth)))
 			rt_add_uncached_list(rth);
+	} else {
+		rt_add_uncached_list(rth);
 	}
 	skb_dst_set(skb, &rth->dst);
 	reason = SKB_NOT_DROPPED_YET;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0281/1005] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (279 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0280/1005] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0282/1005] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
                   ` (92 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Anvik Loitongbam, Yingjie Wang,
	Eric Dumazet, Jiayuan Chen, Neal Cardwell, Kuniyuki Iwashima,
	Paolo Abeni, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit 8e069fd3fd396b89af417e50b359bc9892dd41cd ]

When IPV6_FL_F_REFLECT is set on a listener, or the
net.ipv6.flowlabel_reflect sysctl has FLOWLABEL_REFLECT_ESTABLISHED,
tcp_v6_send_synack() reflects the flowlabel of the SYN packet,
reading it from the skb stored in ireq->pktopts.

Since commit 079096f103fa ("tcp/dccp: install syn_recv requests
into ehash table"), request sockets are processed without holding
the listener lock. A cpu can then process a retransmitted SYN for a
request socket, and send a SYNACK from tcp_check_req(), while another
cpu receives the ACK completing the 3WHS. tcp_v6_syn_recv_sock()
consumes ireq->pktopts when it wins the hashdance, and the first cpu
reads a freed skb:

  BUG: KASAN: slab-use-after-free in tcp_v6_send_synack (include/linux/skbuff.h:3152 include/linux/ipv6.h:110 net/ipv6/tcp_ipv6.c:582)
  Read of size 8 at addr ffff88802b08b608 by task poc-ipv6-pktopt/5076

  Call Trace:
   <IRQ>
   tcp_v6_send_synack (include/linux/skbuff.h:3152 include/linux/ipv6.h:110 net/ipv6/tcp_ipv6.c:582)
   tcp_rtx_synack (net/ipv4/tcp_output.c:4719)
   tcp_check_req (net/ipv4/tcp_minisocks.c:762)
   tcp_v6_rcv (net/ipv6/tcp_ipv6.c:1826)
   ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:479)
   ip6_input_finish (net/ipv6/ip6_input.c:534)
   ip6_input (include/linux/netfilter.h:325 include/linux/netfilter.h:319 net/ipv6/ip6_input.c:545)
   ipv6_rcv (include/net/dst.h:481 net/ipv6/ip6_input.c:119 include/linux/netfilter.h:325 include/linux/netfilter.h:319 net/ipv6/ip6_input.c:351)

  Freed by task 5074 on cpu 0 at 15.412249s:
   kmem_cache_free (include/linux/kasan.h:235 mm/slub.c:2780 mm/slub.c:6630 mm/slub.c:6757)
   tcp_v6_syn_recv_sock (net/ipv6/tcp_ipv6.c:1528)
   tcp_check_req (net/ipv4/tcp_minisocks.c:934)
   tcp_v6_rcv (net/ipv6/tcp_ipv6.c:1826)
   ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:479)
   ip6_input_finish (net/ipv6/ip6_input.c:534)

Request socket migration has the same issue: reqsk_migrate_reset()
transfers ireq->pktopts to the clone, which can be freed while
another cpu holding a reference on the old request socket is still
sending a SYNACK.

The SYNACK timer itself is not an issue, because
inet_csk_reqsk_queue_drop() calls timer_delete_sync().

Save the flowlabel of the SYN in the request socket instead, so that
tcp_v6_send_synack() no longer needs ireq->pktopts.

As a side effect, the flowlabel is also reflected for SYN packets
reusing a TIME_WAIT socket, as ireq->pktopts is not set in this case.

Fixes: e994b2f0fb92 ("tcp: do not lock listener to process SYN packets")
Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table")
Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.")
Reported-by: Anvik Loitongbam <permissiontogallop@gmail.com>
Reported-by: Yingjie Wang <x-professor@outlook.com>
Closes: https://lore.kernel.org/netdev/82c31e4d5043f3dbd11b44177cfba779d335aae3.1793599929.git.x-professor@outlook.com/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261102075441.3771550-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/tcp.h | 3 +++
 net/ipv6/tcp_ipv6.c | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 6a8c77719322f..647b585e1cf94 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -179,6 +179,9 @@ struct tcp_request_sock {
 	u8				ao_rcv_next;
 	bool				used_tcp_ao;
 #endif
+#if IS_ENABLED(CONFIG_IPV6)
+	__be32				syn_flowlabel;
+#endif
 };
 
 #define tcp_rsk(ptr) container_of_const(ptr, struct tcp_request_sock, req.req)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index be50b2fe12742..40025284b9110 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -578,8 +578,8 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
 				    &ireq->ir_v6_rmt_addr);
 
 		fl6->daddr = ireq->ir_v6_rmt_addr;
-		if (inet6_test_bit(REPFLOW, sk) && ireq->pktopts)
-			fl6->flowlabel = ip6_flowlabel(ipv6_hdr(ireq->pktopts));
+		if (inet6_test_bit(REPFLOW, sk))
+			fl6->flowlabel = tcp_rsk(req)->syn_flowlabel;
 
 		tclass = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos) ?
 				(tcp_rsk(req)->syn_tos & ~INET_ECN_MASK) |
@@ -789,6 +789,7 @@ static void tcp_v6_init_req(struct request_sock *req,
 	ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
 	ireq->ir_rmt_addr = LOOPBACK4_IPV6;
 	ireq->ir_loc_addr = LOOPBACK4_IPV6;
+	tcp_rsk(req)->syn_flowlabel = ip6_flowlabel(ipv6_hdr(skb));
 
 	/* So that link locals have meaning */
 	if ((!sk_listener->sk_bound_dev_if || l3_slave) &&
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0282/1005] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (280 preceding siblings ...)
  2026-11-25 14:26 ` [PATCH 7.3 0281/1005] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0283/1005] PM: runtime: Misc improvements to runtime_pm.rst Greg Kroah-Hartman
                   ` (91 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nathan Blomquist, Alex Deucher,
	Mario Limonciello, Sasha Levin

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

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

From: Mario Limonciello <mario.limonciello@amd.com>

[ Upstream commit a26ec190925733dd205507493e936e59dbcd2b19 ]

On Navi1x/Sienna Cichlid with runtime PM, when the audio function is
enabled, BACO entry and exit are delegated to PMFW by sending
SMU_MSG_ArmD3 instead of going through smu_v11_0_baco_set_state().
Unlike the v13/v14/v15 helpers, smu_v11_0_baco_set_armd3_sequence()
does not update smu_baco->state, so the driver keeps reporting
SMU_BACO_STATE_EXIT while the ASIC is armed for / sitting in BACO.

At runtime resume amdgpu_device_baco_exit() checks
amdgpu_device_supports_baco(), which ends up in
smu_v11_0_get_bamaco_support().  Since the state never reads ENTER, the
"already in BACO" shortcut is skipped and the live BACO feature bit is
consulted instead.  PMFW clears that bit once ArmD3(BACO) is armed, so
the check reports "supported but not enabled", the exit fails with
-ENOTSUPP and the ULPS ArmD3 message is never sent.  The runtime resume
caller ignores the error, and a later secondary bus reset leaves the
device unreachable.  This shows up on a Navi 23 being handed from amdgpu
to vfio-pci:

  baco_enter: in_runpm=1 audio_enabled=1 armd3=1 baco_state=1 ret=0
  bamaco: state=1 ... feat supported=1 enabled=0 in_runpm=1
  baco_exit: supports=0 ...
  runtime resume: baco_exit ret=-524

Update smu_baco->state in the helper, mirroring the v13 implementation,
so the capability check short-circuits while in BACO.

Reported-by: Nathan Blomquist <nblomquist@gmail.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/6076
Tested-by: Nathan Blomquist <nblomquist@gmail.com>
Fixes: 13d75eadfa1a ("drm/amd/pm: correct the runpm handling for BACO supported ASIC")
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20261103141457.2558235-1-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d515b2694eab5b35533c7fb7af5bddff53ff60d3)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c    | 20 ++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index f0b2e7da67b1b..d2dfa2bb50a52 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -1421,7 +1421,25 @@ int smu_v11_0_get_max_sustainable_clocks_by_dc(struct smu_context *smu,
 int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu,
 				      enum smu_baco_seq baco_seq)
 {
-	return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL);
+	struct smu_baco_context *smu_baco = &smu->smu_baco;
+	int ret;
+
+	ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL);
+	if (ret)
+		return ret;
+
+	/*
+	 * PMFW owns the BACO transition once armed, so keep the driver's view
+	 * in sync.  Otherwise smu_v11_0_get_bamaco_support() falls back to the
+	 * live BACO feature bit, which PMFW clears when armed, and the runtime
+	 * resume wrongly concludes BACO is unsupported and skips the exit.
+	 */
+	if (baco_seq == BACO_SEQ_BAMACO || baco_seq == BACO_SEQ_BACO)
+		smu_baco->state = SMU_BACO_STATE_ENTER;
+	else
+		smu_baco->state = SMU_BACO_STATE_EXIT;
+
+	return 0;
 }
 
 int smu_v11_0_get_bamaco_support(struct smu_context *smu)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0283/1005] PM: runtime: Misc improvements to runtime_pm.rst
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (281 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0282/1005] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0284/1005] PM: runtime: Add "Section" hyperlinks Greg Kroah-Hartman
                   ` (90 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Brian Norris <briannorris@chromium.org>

[ Upstream commit 437b4ed6cb5848027fe9b9c8d0da495eef7f8de3 ]

There are several small errors and omissions, as well as new updates
(pm_runtime_resume_and_get(), devm_pm_runtime_enable()) we should
incorporate.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260929194956.v3.3.I383681b22c12d7caee976cb91aa90d1a94d4a591@changeid
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 7a93f7e30a3f ("PM: runtime: Update runtime_pm.rst for non-fatal resume errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Documentation/power/runtime_pm.rst | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst
index a53ab09c37d53..2498e4495daf8 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -529,6 +529,8 @@ It is safe to execute the following helper functions from interrupt context:
 - pm_request_resume()
 - pm_runtime_get_noresume()
 - pm_runtime_get()
+- pm_runtime_get_if_active()
+- pm_runtime_get_if_in_use()
 - pm_runtime_put_noidle()
 - pm_runtime_put()
 - pm_runtime_put_autosuspend()
@@ -538,6 +540,9 @@ It is safe to execute the following helper functions from interrupt context:
 - pm_runtime_set_active()
 - pm_runtime_set_suspended()
 - pm_runtime_suspended()
+- pm_runtime_active()
+- pm_runtime_status_suspended()
+- pm_runtime_enabled()
 - pm_runtime_mark_last_busy()
 - pm_runtime_autosuspend_expiration()
 
@@ -549,6 +554,7 @@ functions may also be used in interrupt context:
 - pm_runtime_autosuspend()
 - pm_runtime_resume()
 - pm_runtime_get_sync()
+- pm_runtime_resume_and_get()
 - pm_runtime_put_sync()
 - pm_runtime_put_sync_suspend()
 - pm_runtime_put_sync_autosuspend()
@@ -558,7 +564,7 @@ functions may also be used in interrupt context:
 
 Initially, the runtime PM is disabled for all devices, which means that the
 majority of the runtime PM helper functions described in Section 4 will return
--EAGAIN until pm_runtime_enable() is called for the device.
+-EACCES until pm_runtime_enable() is called for the device.
 
 In addition to that, the initial runtime PM status of all devices is
 'suspended', but it need not reflect the actual physical state of the device.
@@ -587,7 +593,7 @@ enabled earlier by calling pm_runtime_enable().
 
 Note, if the device may execute pm_runtime calls during the probe (such as
 if it is registered with a subsystem that may call back in) then the
-pm_runtime_get_sync() call paired with a pm_runtime_put() call will be
+pm_runtime_resume_and_get() call paired with a pm_runtime_put() call will be
 appropriate to ensure that the device is not put back to sleep during the
 probe. This can happen with systems such as the network device layer.
 
@@ -615,7 +621,10 @@ removal of their drivers.
 
 Drivers in ->remove() callback should undo the runtime PM changes done
 in ->probe(). Usually this means calling pm_runtime_disable(),
-pm_runtime_dont_use_autosuspend() etc.
+pm_runtime_dont_use_autosuspend() etc. Alternatively, drivers can use
+devm_pm_runtime_enable() during probe, which automatically takes care of
+calling pm_runtime_disable() and pm_runtime_dont_use_autosuspend() upon driver
+detachment.
 
 The user space can effectively disallow the driver of the device to power manage
 it at run time by changing the value of its /sys/devices/.../power/control
@@ -726,7 +735,7 @@ out the following operations:
 
 Subsystems may wish to conserve code space by using the set of generic power
 management callbacks provided by the PM core, defined in
-driver/base/power/generic_ops.c:
+drivers/base/power/generic_ops.c:
 
   `int pm_generic_runtime_suspend(struct device *dev);`
     - invoke the ->runtime_suspend() callback provided by the driver of this
@@ -800,8 +809,8 @@ subsystem-level dev_pm_ops structure.
 Device drivers that wish to use the same function as a system suspend, freeze,
 poweroff and runtime suspend callback, and similarly for system resume, thaw,
 restore, and runtime resume, can achieve similar behaviour with the help of the
-DEFINE_RUNTIME_DEV_PM_OPS() defined in include/linux/pm_runtime.h (possibly setting its
-last argument to NULL).
+DEFINE_RUNTIME_DEV_PM_OPS() macro defined in include/linux/pm_runtime.h
+(possibly setting its last argument to NULL).
 
 8. "No-Callback" Devices
 ========================
@@ -864,7 +873,7 @@ registration the length should be controlled by user space, using the
 
 In order to use autosuspend, subsystems or drivers must call
 pm_runtime_use_autosuspend() (preferably before registering the device), and
-thereafter they should use the various `*_autosuspend()` helper functions
+thereafter they should use the various \*_autosuspend() helper functions
 instead of the non-autosuspend counterparts::
 
 	Instead of: pm_runtime_suspend    use: pm_runtime_autosuspend;
@@ -874,7 +883,7 @@ instead of the non-autosuspend counterparts::
 
 Drivers may also continue to use the non-autosuspend helper functions; they
 will behave normally, which means sometimes taking the autosuspend delay into
-account (see pm_runtime_idle). The autosuspend variants of the functions also
+account (see pm_runtime_idle()). The autosuspend variants of the functions also
 call pm_runtime_mark_last_busy().
 
 Under some circumstances a driver or subsystem may want to prevent a device
@@ -917,7 +926,7 @@ Here is a schematic pseudo-code example::
 
 	int foo_runtime_suspend(struct device *dev)
 	{
-		struct foo_priv foo = container_of(dev, ...);
+		struct foo_priv *foo = container_of(dev, ...);
 		int ret = 0;
 
 		lock(&foo->private_lock);
@@ -933,7 +942,7 @@ Here is a schematic pseudo-code example::
 
 	int foo_runtime_resume(struct device *dev)
 	{
-		struct foo_priv foo = container_of(dev, ...);
+		struct foo_priv *foo = container_of(dev, ...);
 
 		lock(&foo->private_lock);
 		/* ... resume the device ... */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0284/1005] PM: runtime: Add "Section" hyperlinks
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (282 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0283/1005] PM: runtime: Misc improvements to runtime_pm.rst Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0285/1005] PM: runtime: Clarify ->runtime_idle() callback return value handling Greg Kroah-Hartman
                   ` (89 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Brian Norris <briannorris@chromium.org>

[ Upstream commit 86122467eea539ac13d40b6938abd1fbb40fb640 ]

Add reStructuredText targets for each section, and use them throughout
to make the generated HTML more navigable.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260929194956.v3.4.I7666a5802ea59359afce4ff7d0b1af668e5f5292@changeid
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 7a93f7e30a3f ("PM: runtime: Update runtime_pm.rst for non-fatal resume errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Documentation/power/runtime_pm.rst | 48 ++++++++++++++++++++----------
 1 file changed, 33 insertions(+), 15 deletions(-)

diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst
index 2498e4495daf8..b0741412d3bc2 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -8,6 +8,8 @@ Runtime Power Management Framework for I/O Devices
 
 (C) 2014 Intel Corp., Rafael J. Wysocki <rafael.j.wysocki@intel.com>
 
+.. _Section 1:
+
 1. Introduction
 ===============
 
@@ -37,6 +39,8 @@ The runtime PM callbacks present in 'struct dev_pm_ops', the device runtime PM
 fields of 'struct dev_pm_info' and the core helper functions provided for
 runtime PM are described below.
 
+.. _Section 2:
+
 2. Device Runtime PM Callbacks
 ==============================
 
@@ -80,8 +84,8 @@ the PM core that it is safe to run the ->runtime_suspend(), ->runtime_resume()
 and ->runtime_idle() callbacks for the given device in atomic context with
 interrupts disabled.  This implies that the callback routines in question must
 not block or sleep, but it also means that the synchronous helper functions
-listed at the end of Section 4 may be used for that device within an interrupt
-handler or generally in an atomic context.
+listed at the end of `Section 4`_ may be used for that device within an
+interrupt handler or generally in an atomic context.
 
 The subsystem-level suspend callback, if present, is _entirely_ _responsible_
 for handling the suspend of the device as appropriate, which may, but need not
@@ -105,9 +109,9 @@ knows what to do to handle the device).
 
   * If the suspend callback returns an error code different from -EBUSY and
     -EAGAIN, the PM core regards this as a fatal error and will refuse to run
-    the helper functions described in Section 4 for the device until its status
-    is directly set to  either 'active', or 'suspended' (the PM core provides
-    special helper functions for this purpose).
+    the helper functions described in `Section 4`_ for the device until its
+    status is directly set to  either 'active', or 'suspended' (the PM core
+    provides special helper functions for this purpose).
 
 In particular, if the driver requires remote wakeup capability (i.e. hardware
 mechanism allowing the device to request a change of its power state, such as
@@ -132,10 +136,10 @@ what to do to handle the device).
     'active'.
 
   * If the resume callback returns an error code, the PM core regards this as a
-    fatal error and will refuse to run the helper functions described in Section
-    4 for the device, until its status is directly set to either 'active', or
-    'suspended' (by means of special helper functions provided by the PM core
-    for this purpose).
+    fatal error and will refuse to run the helper functions described in
+    `Section 4`_ for the device, until its status is directly set to either
+    'active', or 'suspended' (by means of special helper functions provided by
+    the PM core for this purpose).
 
 The idle callback (a subsystem-level one, if present, or the driver one) is
 executed by the PM core whenever the device appears to be idle, which is
@@ -158,9 +162,9 @@ call to pm_runtime_autosuspend(). To prevent this (for example, if the callback
 routine has started a delayed suspend), the routine must return a non-zero
 value.  Negative error return codes are ignored by the PM core.
 
-The helper functions provided by the PM core, described in Section 4, guarantee
-that the following constraints are met with respect to runtime PM callbacks for
-one device:
+The helper functions provided by the PM core, described in `Section 4`_,
+guarantee that the following constraints are met with respect to runtime PM
+callbacks for one device:
 
 (1) The callbacks are mutually exclusive (e.g. it is forbidden to execute
     ->runtime_suspend() in parallel with ->runtime_resume() or with another
@@ -200,6 +204,8 @@ rules:
     scheduled requests to execute the other callbacks for the same device,
     except for scheduled autosuspends.
 
+.. _Section 3:
+
 3. Runtime PM Device Fields
 ===========================
 
@@ -301,6 +307,8 @@ defined in include/linux/pm.h:
 
 All of the above fields are members of the 'power' member of 'struct device'.
 
+.. _Section 4:
+
 4. Runtime PM Device Helper Functions
 =====================================
 
@@ -559,12 +567,14 @@ functions may also be used in interrupt context:
 - pm_runtime_put_sync_suspend()
 - pm_runtime_put_sync_autosuspend()
 
+.. _Section 5:
+
 5. Runtime PM Initialization, Device Probing and Removal
 ========================================================
 
 Initially, the runtime PM is disabled for all devices, which means that the
-majority of the runtime PM helper functions described in Section 4 will return
--EACCES until pm_runtime_enable() is called for the device.
+majority of the runtime PM helper functions described in `Section 4`_ will
+return -EACCES until pm_runtime_enable() is called for the device.
 
 In addition to that, the initial runtime PM status of all devices is
 'suspended', but it need not reflect the actual physical state of the device.
@@ -587,7 +597,7 @@ pm_runtime_set_suspended().
 If the default initial runtime PM status of the device (i.e. 'suspended')
 reflects the actual state of the device, its bus type's or its driver's
 ->probe() callback will likely need to wake it up using one of the PM core's
-helper functions described in Section 4.  In that case, pm_runtime_resume()
+helper functions described in `Section 4`_.  In that case, pm_runtime_resume()
 should be used.  Of course, for this purpose the device's runtime PM has to be
 enabled earlier by calling pm_runtime_enable().
 
@@ -638,6 +648,8 @@ value of /sys/devices/.../power/control to "auto" to allow the driver to power
 manage the device at run time, the driver may confuse it by using
 pm_runtime_forbid() this way.
 
+.. _Section 6:
+
 6. Runtime PM and System Sleep
 ==============================
 
@@ -730,6 +742,8 @@ out the following operations:
     callback and right after executing the subsystem-level .complete() callback
     for it, respectively.
 
+.. _Section 7:
+
 7. Generic subsystem callbacks
 ==============================
 
@@ -812,6 +826,8 @@ restore, and runtime resume, can achieve similar behaviour with the help of the
 DEFINE_RUNTIME_DEV_PM_OPS() macro defined in include/linux/pm_runtime.h
 (possibly setting its last argument to NULL).
 
+.. _Section 8:
+
 8. "No-Callback" Devices
 ========================
 
@@ -848,6 +864,8 @@ in subsystems/drivers, the PM core allows runtime PM callbacks to be
 unassigned. More precisely, if a callback pointer is NULL, the PM core will act
 as though there was a callback and it returned 0.
 
+.. _Section 9:
+
 9. Autosuspend, or automatically-delayed suspends
 =================================================
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0285/1005] PM: runtime: Clarify ->runtime_idle() callback return value handling
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (283 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0284/1005] PM: runtime: Add "Section" hyperlinks Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0286/1005] PM: runtime: Update runtime_pm.rst for non-fatal resume errors Greg Kroah-Hartman
                   ` (88 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
	Sasha Levin

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

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

From: Brian Norris <briannorris@chromium.org>

[ Upstream commit aedc51762a0d3d4a50d1542b59aafcd6060c4b39 ]

This doc says "Negative error return codes are ignored by the PM core"
for ->runtime_idle(). This is misleading: any non-zero return value
(including negative error codes such as -EBUSY or -EAGAIN) tells the PM
core to abort automatic suspension of the device, which is commonly used
by subsystems to prevent immediate runtime suspend.

Clarify that unlike ->runtime_suspend() and ->runtime_resume(), the PM core
does not treat negative return values from ->runtime_idle() as a fatal
device error, and that any non-zero value stops the PM core from
suspending the device.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260929194956.v3.5.If6e26acac7770c65446dd0b81f891948abb38973@changeid
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 7a93f7e30a3f ("PM: runtime: Update runtime_pm.rst for non-fatal resume errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Documentation/power/runtime_pm.rst | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst
index b0741412d3bc2..2f8d38e417995 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -158,9 +158,14 @@ suspending the device are satisfied) and to queue up a suspend request for the
 device in that case.  If there is no idle callback, or if the callback returns
 0, then the PM core will attempt to carry out a runtime suspend of the device,
 also respecting devices configured for autosuspend.  In essence this means a
-call to pm_runtime_autosuspend(). To prevent this (for example, if the callback
-routine has started a delayed suspend), the routine must return a non-zero
-value.  Negative error return codes are ignored by the PM core.
+call to pm_runtime_autosuspend().
+
+To prevent this suspension (for example, if the callback routine has scheduled
+a delayed suspend or determined the device cannot be idle), the routine must
+return a non-zero value (typically -EBUSY or -EAGAIN).  Unlike
+->runtime_suspend() and ->runtime_resume(), the PM core does not treat negative
+return codes from ->runtime_idle() as a fatal device error; any non-zero value
+simply stops the PM core from suspending the device.
 
 The helper functions provided by the PM core, described in `Section 4`_,
 guarantee that the following constraints are met with respect to runtime PM
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0286/1005] PM: runtime: Update runtime_pm.rst for non-fatal resume errors
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (284 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0285/1005] PM: runtime: Clarify ->runtime_idle() callback return value handling Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0287/1005] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
                   ` (87 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Stanley Jhu, Brian Norris,
	Bart Van Assche, Rafael J. Wysocki, Sasha Levin

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

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

From: Stanley Jhu <stanleyjhu@google.com>

[ Upstream commit 7a93f7e30a3f7c8dd4f5fe4cde54d01c8018e2bc ]

Since commit eef1d74bf88f ("PM: runtime: Only set runtime_error on
suspend callback failures"), rpm_callback() no longer sets
dev->power.runtime_error when ->runtime_resume() returns an error.
However, Documentation/power/runtime_pm.rst still states in both the
resume callback rules and the ->runtime_idle() comparison that the PM
core treats ->runtime_resume() errors as fatal device errors and blocks
runtime PM helper functions until the status is manually reset.

Update the resume callback semantics bullet to state that on error the
PM core resets the runtime PM status to 'suspended', returns the error
code from synchronous resume helpers, and unlike with the suspend
callback never treats resume failures as fatal, leaving the Section 4
runtime PM helpers unblocked so a subsequent resume request can run
->runtime_resume() again. Also drop ->runtime_resume() from the
->runtime_idle() fatal-error comparison.

Fixes: eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend callback failures")
Fixes: aedc51762a0d ("PM: runtime: Clarify ->runtime_idle() callback return value handling")
Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
[ rjw: Adjustment of the resume callback errors bullet point ]
Link: https://patch.msgid.link/20261104151651.3035537-1-stanleyjhu@google.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Documentation/power/runtime_pm.rst | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst
index 2f8d38e417995..92281f70c9d3a 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -135,11 +135,12 @@ what to do to handle the device).
     I/O operations as needed.  The runtime PM status of the device is then
     'active'.
 
-  * If the resume callback returns an error code, the PM core regards this as a
-    fatal error and will refuse to run the helper functions described in
-    `Section 4`_ for the device, until its status is directly set to either
-    'active', or 'suspended' (by means of special helper functions provided by
-    the PM core for this purpose).
+  * If the resume callback returns an error code, the PM core sets the
+    device's runtime PM status back to 'suspended' and returns the error
+    code from synchronous resume helpers.  Unlike most suspend callback
+    errors, failures in the resume callback are never considered fatal,
+    so the helper functions described in `Section 4`_ are not blocked and
+    a subsequent resume request can run the resume callback again.
 
 The idle callback (a subsystem-level one, if present, or the driver one) is
 executed by the PM core whenever the device appears to be idle, which is
@@ -163,9 +164,9 @@ call to pm_runtime_autosuspend().
 To prevent this suspension (for example, if the callback routine has scheduled
 a delayed suspend or determined the device cannot be idle), the routine must
 return a non-zero value (typically -EBUSY or -EAGAIN).  Unlike
-->runtime_suspend() and ->runtime_resume(), the PM core does not treat negative
-return codes from ->runtime_idle() as a fatal device error; any non-zero value
-simply stops the PM core from suspending the device.
+->runtime_suspend(), the PM core does not treat negative return codes from
+->runtime_idle() as a fatal device error, and any non-zero value simply stops
+the PM core from suspending the device.
 
 The helper functions provided by the PM core, described in `Section 4`_,
 guarantee that the following constraints are met with respect to runtime PM
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0287/1005] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (285 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0286/1005] PM: runtime: Update runtime_pm.rst for non-fatal resume errors Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0288/1005] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
                   ` (86 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Mark Brown,
	Sasha Levin

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

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

From: Richard Fitzgerald <rf@opensource.cirrus.com>

[ Upstream commit 39d31f76ad1b12f1b5e6ef4c15f89e6b3c3f603a ]

If cs_dsp_power_up() fails on or after cs_dsp_load() mark the controls
disabled and free the alg regions.

Fixes: f6bc909e7673c ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20261104152402.1153795-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/firmware/cirrus/cs_dsp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 838fece8dc01a..413fb997be2bf 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -2793,6 +2793,7 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
 		    const struct firmware *coeff_firmware, const char *coeff_filename,
 		    const char *fw_name)
 {
+	struct cs_dsp_coeff_ctl *ctl;
 	int ret;
 
 	mutex_lock(&dsp->pwr_lock);
@@ -2838,6 +2839,11 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
 
 	return 0;
 err_ena:
+	list_for_each_entry(ctl, &dsp->ctl_list, list)
+		ctl->enabled = 0;
+
+	cs_dsp_free_alg_regions(dsp);
+
 	if (dsp->ops->disable_core)
 		dsp->ops->disable_core(dsp);
 err_mem:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0288/1005] ACPI: scan: Print the offline failure message in acpi_bus_offline()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (286 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0287/1005] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0289/1005] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
                   ` (85 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin,
	Rafael J. Wysocki

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

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

[ Upstream commit b9ea1e921c2721546f53270cffdc6866e20576dd ]

When a physical node of an ACPI device being hot-removed cannot be
offlined, acpi_bus_offline() passes the physical device back to
acpi_scan_try_to_offline() through ret_p and the latter prints
"Offline failed." for it after the namespace walk.  By then
physical_node_lock is not held anymore, so the device may have been
unbound from its ACPI companion and freed in the meantime.

Print the message in acpi_bus_offline() when device_offline() fails in
the second pass, while physical_node_lock keeps the device bound to its
ACPI companion and so the reference taken by acpi_bind_one() is still
held.  acpi_scan_try_to_offline() only needs to know that something
could not be offlined, so pass the ACPI device back through ret_p
instead, like in the "Offline disabled." case.

Fixes: 303bfdb1a14d ("ACPI / scan: Add second pass of companion offlining to hot-remove code")
Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261029034507.2721580-2-sashal@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/scan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e8189849eaa60..c90734a48583e 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -165,8 +165,9 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
 		if (ret >= 0) {
 			pn->put_online = !ret;
 		} else {
-			*ret_p = pn->dev;
+			*ret_p = &device->dev;
 			if (second_pass) {
+				dev_warn(pn->dev, "Offline failed.\n");
 				status = AE_ERROR;
 				break;
 			}
@@ -235,7 +236,6 @@ static int acpi_scan_try_to_offline(struct acpi_device *device)
 					 (void **)&errdev);
 
 		if (errdev) {
-			dev_warn(errdev, "Offline failed.\n");
 			acpi_bus_online(handle, 0, NULL, NULL);
 			acpi_walk_namespace(ACPI_TYPE_ANY, handle,
 					    ACPI_UINT32_MAX, acpi_bus_online,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0289/1005] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (287 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0288/1005] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0290/1005] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
                   ` (84 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+cea7285bc17b76ffe39f,
	syzbot+a265816368571f78ab88, Sasha Levin, Rafael J. Wysocki

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

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

[ Upstream commit 17654aa629cba9a70e31cc1b7226a4fc1a1c801a ]

acpi_bus_offline() and acpi_bus_online() hold the physical_node_lock of
the ACPI device being hot-removed while they call device_offline() and
device_online() for its physical nodes.  Offlining a CPU this way takes
cpu_add_remove_lock and the CPU hotplug lock under physical_node_lock,
and lockdep connects that to the uevent attribute of platform devices,
whose store method takes physical_node_lock in
acpi_primary_dev_companion():

  physical_node_lock (acpi_bus_offline())
    -> cpu_add_remove_lock -> cpu_hotplug_lock
    -> cpuhp_state-down (mce_cpu_pre_down() unregistering a device)
    -> device_links_lock (device_links_purge())
    -> kn->active of a uevent attribute (device link unregistration)
    -> physical_node_lock (uevent_store() -> acpi_companion_match())

syzbot has reported this cycle twice.  The uevent attribute waited for in
the link unregistration is the device link's, not a platform device's,
and the physical_node_lock taken at the end is that of the platform
device's ACPI companion, not of the processor being ejected, so lockdep
only connects them because they share lock classes and this is unlikely
to deadlock.  However, lockdep turns itself off after reporting it.

It can be reproduced in a QEMU guest by writing to the uevent attribute
of an ACPI-enumerated platform device, reading the uevent attribute of a
device link while the link is removed, offlining a CPU and ejecting one
through sysfs.

physical_node_lock protects the list of physical nodes.  Since
acpi_unbind_one() blocks on it, holding it also keeps device_offline()
and device_online() from running in parallel with whatever happens to a
device after it has been unbound from its ACPI companion, but that is not
necessary: a reference to each device is held while the lock is dropped,
and the removal of the devices that can actually be taken offline here
(CPUs, memory blocks and containers) is serialized by the device hotplug
lock or acpi_scan_lock, both of which acpi_device_hotplug() holds
throughout.

So drop physical_node_lock around device_offline() and device_online().
Mark the nodes to offline with a new offline_pending flag, hold a
reference to each device while the lock is dropped, and look its node up
again afterwards to record whether it needs to be put back online,
because it may have been unbound in the meantime.  Physical nodes added
while the lock is not held are not offlined by the current pass, which is
no different from adding them right after it.

Since acpi_container_offline() no longer runs under the container's
physical_node_lock, the nesting annotation added to
acpi_scan_is_offline() by commit 4c533c801d1c ("ACPI / scan: Annotate
physical_node_lock in acpi_scan_is_offline()") is not needed anymore, so
drop it.

Fixes: 683058e315f0 ("ACPI / hotplug: Use device offline/online for graceful hot-removal")
Reported-by: syzbot+cea7285bc17b76ffe39f@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/6ae18ed0.6200f071.51519.0f60.GAE@google.com
Reported-by: syzbot+a265816368571f78ab88@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/6adf293a.67317f00.38c4bc.00af.GAE@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261029034507.2721580-3-sashal@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/scan.c     | 106 +++++++++++++++++++++++++++++++++-------
 include/acpi/acpi_bus.h |   1 +
 2 files changed, 88 insertions(+), 19 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index c90734a48583e..ba2f03854591f 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -114,11 +114,7 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
 	bool offline = true;
 	char *envp[] = { "EVENT=offline", NULL };
 
-	/*
-	 * acpi_container_offline() calls this for all of the container's
-	 * children under the container's physical_node_lock lock.
-	 */
-	mutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING);
+	mutex_lock(&adev->physical_node_lock);
 
 	list_for_each_entry(pn, &adev->physical_node_list, node)
 		if (device_supports_offline(pn->dev) && !dev_offline(pn->dev)) {
@@ -133,6 +129,59 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)
 	return offline;
 }
 
+static struct acpi_device_physical_node *
+acpi_find_physical_node(struct acpi_device *adev, struct device *dev)
+{
+	struct acpi_device_physical_node *pn;
+
+	lockdep_assert_held(&adev->physical_node_lock);
+
+	list_for_each_entry(pn, &adev->physical_node_list, node)
+		if (pn->dev == dev)
+			return pn;
+
+	return NULL;
+}
+
+static struct device *acpi_next_offline_pending(struct acpi_device *adev)
+{
+	struct acpi_device_physical_node *pn;
+
+	lockdep_assert_held(&adev->physical_node_lock);
+
+	/*
+	 * Find the first physical node that is still to be offlined, clear its
+	 * offline_pending flag and return its device with a reference held.
+	 */
+	list_for_each_entry(pn, &adev->physical_node_list, node)
+		if (pn->offline_pending) {
+			pn->offline_pending = false;
+			return get_device(pn->dev);
+		}
+
+	return NULL;
+}
+
+static struct device *acpi_next_put_online(struct acpi_device *adev)
+{
+	struct acpi_device_physical_node *pn;
+
+	lockdep_assert_held(&adev->physical_node_lock);
+
+	/*
+	 * Find the first physical node that has been offlined by
+	 * acpi_bus_offline(), clear its put_online flag and return its device
+	 * with a reference held.
+	 */
+	list_for_each_entry(pn, &adev->physical_node_list, node)
+		if (pn->put_online) {
+			pn->put_online = false;
+			return get_device(pn->dev);
+		}
+
+	return NULL;
+}
+
 static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
 				    void **ret_p)
 {
@@ -140,6 +189,7 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
 	struct acpi_device_physical_node *pn;
 	bool second_pass = (bool)data;
 	acpi_status status = AE_OK;
+	struct device *dev;
 
 	if (!device)
 		return AE_OK;
@@ -152,26 +202,43 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data,
 	mutex_lock(&device->physical_node_lock);
 
 	list_for_each_entry(pn, &device->physical_node_list, node) {
-		int ret;
-
 		if (second_pass) {
 			/* Skip devices offlined by the first pass. */
-			if (pn->put_online)
-				continue;
+			pn->offline_pending = !pn->put_online;
 		} else {
+			pn->offline_pending = true;
 			pn->put_online = false;
 		}
-		ret = device_offline(pn->dev);
+	}
+
+	/*
+	 * Drop physical_node_lock around device_offline(), because the latter
+	 * acquires locks, like the CPU hotplug ones, that must not nest under
+	 * it.
+	 */
+	while ((dev = acpi_next_offline_pending(device))) {
+		int ret;
+
+		mutex_unlock(&device->physical_node_lock);
+		ret = device_offline(dev);
+		mutex_lock(&device->physical_node_lock);
+
 		if (ret >= 0) {
-			pn->put_online = !ret;
+			/* The device may have been unbound in the meantime. */
+			pn = acpi_find_physical_node(device, dev);
+			if (pn)
+				pn->put_online = !ret;
 		} else {
 			*ret_p = &device->dev;
 			if (second_pass) {
-				dev_warn(pn->dev, "Offline failed.\n");
+				dev_warn(dev, "Offline failed.\n");
 				status = AE_ERROR;
-				break;
 			}
 		}
+
+		put_device(dev);
+		if (ACPI_FAILURE(status))
+			break;
 	}
 
 	mutex_unlock(&device->physical_node_lock);
@@ -183,18 +250,19 @@ static acpi_status acpi_bus_online(acpi_handle handle, u32 lvl, void *data,
 				   void **ret_p)
 {
 	struct acpi_device *device = acpi_fetch_acpi_dev(handle);
-	struct acpi_device_physical_node *pn;
+	struct device *dev;
 
 	if (!device)
 		return AE_OK;
 
 	mutex_lock(&device->physical_node_lock);
 
-	list_for_each_entry(pn, &device->physical_node_list, node)
-		if (pn->put_online) {
-			device_online(pn->dev);
-			pn->put_online = false;
-		}
+	while ((dev = acpi_next_put_online(device))) {
+		mutex_unlock(&device->physical_node_lock);
+		device_online(dev);
+		mutex_lock(&device->physical_node_lock);
+		put_device(dev);
+	}
 
 	mutex_unlock(&device->physical_node_lock);
 
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 40df037804a5d..57145e2aec21a 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -329,6 +329,7 @@ struct acpi_device_physical_node {
 	struct device *dev;
 	unsigned int node_id;
 	bool put_online:1;
+	bool offline_pending:1;
 };
 
 struct acpi_device_properties {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0290/1005] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (288 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0289/1005] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0291/1005] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
                   ` (83 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Mark Brown,
	Sasha Levin

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

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

From: Richard Fitzgerald <rf@opensource.cirrus.com>

[ Upstream commit 4d07af76ca41cc1a03240cd3b5f44dc428856214 ]

Check that avail does not become < 1 in wm_adsp_control_add(). This
prevents overflows during subsequent operations.

The main aim is to trap a negative value in avail, but a zero length
would mean that the control ends up without a name, so 1 is the smallest
valid value.

Fixes: b7ede5af62ab6 ("ASoC: wm_adsp: Take prefix into account in control name length")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20261104133322.1085061-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/wm_adsp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index b8f3035af3ba1..7740a9c8ced32 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -46,6 +46,9 @@
 #define adsp_dbg(_dsp, fmt, ...) \
 	dev_dbg(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
 
+#define adsp_warn_once(_dsp, fmt, ...) \
+	dev_warn_once(_dsp->cs_dsp.dev, "%s: " fmt, _dsp->cs_dsp.name, ##__VA_ARGS__)
+
 #define compr_err(_obj, fmt, ...) \
 	adsp_err(_obj->dsp, "%s: " fmt, _obj->name ? _obj->name : "legacy", \
 		 ##__VA_ARGS__)
@@ -625,6 +628,13 @@ int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl)
 		if (dsp->component->name_prefix)
 			avail -= strlen(dsp->component->name_prefix) + 1;
 
+		if (avail < 1) {
+			adsp_warn_once(dsp,
+				       "%.*s: ALSA prefix too long: control not created\n",
+				       cs_ctl->subname_len, cs_ctl->subname);
+			return -EINVAL;
+		}
+
 		/* Truncate the subname from the start if it is too long */
 		if (cs_ctl->subname_len > avail)
 			skip = cs_ctl->subname_len - avail;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0291/1005] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (289 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0290/1005] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0292/1005] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
                   ` (82 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zijun Hu, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Zijun Hu <zijun.hu@oss.qualcomm.com>

[ Upstream commit 3efdadae3a252b14ca1f62b16e31a9aa7c5d30cf ]

Correct (Input|Output)_Transport_Unit_Size based on Core spec v6.3,
Vol 4, Part E, 7.1.45:

  "The Host shall set the Input_Transport_Unit_Size and
   Output_Transport_Unit_Size to be equal. For HCI Host transport
   the Host shall set them to 0."

Fixes: b2af264ad3af ("Bluetooth: Add support for HCI_Enhanced_Setup_Synchronous_Connection command")
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_conn.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index b007f623b2ecc..eebd73988bf66 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -327,8 +327,10 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
 		cp.out_pcm_sample_payload_msb_pos = 0;
 		cp.in_data_path = conn->codec.data_path;
 		cp.out_data_path = conn->codec.data_path;
-		cp.in_transport_unit_size = 1;
-		cp.out_transport_unit_size = 1;
+		if (conn->codec.data_path) {
+			cp.in_transport_unit_size = 1;
+			cp.out_transport_unit_size = 1;
+		}
 		break;
 
 	case BT_CODEC_TRANSPARENT:
@@ -353,8 +355,10 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
 		cp.out_pcm_sample_payload_msb_pos = 0;
 		cp.in_data_path = conn->codec.data_path;
 		cp.out_data_path = conn->codec.data_path;
-		cp.in_transport_unit_size = 1;
-		cp.out_transport_unit_size = 1;
+		if (conn->codec.data_path) {
+			cp.in_transport_unit_size = 1;
+			cp.out_transport_unit_size = 1;
+		}
 		break;
 
 	case BT_CODEC_CVSD:
@@ -384,8 +388,10 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
 		cp.out_pcm_sample_payload_msb_pos = 0;
 		cp.in_data_path = conn->codec.data_path;
 		cp.out_data_path = conn->codec.data_path;
-		cp.in_transport_unit_size = 16;
-		cp.out_transport_unit_size = 16;
+		if (conn->codec.data_path) {
+			cp.in_transport_unit_size = 16;
+			cp.out_transport_unit_size = 16;
+		}
 		break;
 	default:
 		goto unlock;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0292/1005] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (290 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0291/1005] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0293/1005] Bluetooth: qca: Disable SoC debug logging for WCN3950 Greg Kroah-Hartman
                   ` (81 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhao Li, Luiz Augusto von Dentz,
	Sasha Levin

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

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

From: Zhao Li <enderaoelyther@gmail.com>

[ Upstream commit 15a80cc8263abd50132a05d1b06824de8e28abcb ]

Incoming LE and ECRED channels retain the peer's request identifier
after an immediate response. The deferred LE response also leaves the
identifier set, unlike the deferred ECRED response.

A later ECRED request can reuse that identifier and include an unrelated
channel in its shared-response handling. That walk matches on the
identifier alone, so an LE channel is selected too. If the old channel is
closing, the checks can refuse the new connection. The check at request
receipt rejects it with L2CAP_CR_LE_INVALID_PARAMS; the check before a
deferred response returns L2CAP_CR_LE_AUTHORIZATION.

Store the identifier only when deferring the response, and clear it
after sending the deferred LE response. Keep deferred ECRED identifiers
until the shared response is sent, since a partially accepted group
still needs them.

AI assistance was used.

Fixes: 27e2d4c8d28b ("Bluetooth: Add basic LE L2CAP connect request receiving support")
Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/l2cap_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 01d3fa02c7502..fdf92a3d57455 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3958,6 +3958,7 @@ void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan)
 
 	l2cap_send_cmd(conn, chan->ident, L2CAP_LE_CONN_RSP, sizeof(rsp),
 		       &rsp);
+	chan->ident = 0;
 }
 
 static void l2cap_ecred_list_defer(struct l2cap_chan *chan, void *data)
@@ -5207,10 +5208,10 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
 
 	__set_chan_timer(chan, chan->ops->get_sndtimeo(chan));
 
-	chan->ident = cmd->ident;
 	chan->mode = L2CAP_MODE_LE_FLOWCTL;
 
 	if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) {
+		chan->ident = cmd->ident;
 		l2cap_state_change(chan, BT_CONNECT2);
 		/* The following result value is actually not defined
 		 * for LE CoC but we use it to let the function know
@@ -5442,10 +5443,10 @@ static inline int l2cap_ecred_conn_req(struct l2cap_conn *conn,
 
 		__set_chan_timer(chan, chan->ops->get_sndtimeo(chan));
 
-		chan->ident = cmd->ident;
 		chan->mode = L2CAP_MODE_EXT_FLOWCTL;
 
 		if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) {
+			chan->ident = cmd->ident;
 			l2cap_state_change(chan, BT_CONNECT2);
 			defer = true;
 			chan->ops->defer(chan);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0293/1005] Bluetooth: qca: Disable SoC debug logging for WCN3950
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (291 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0292/1005] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0294/1005] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
                   ` (80 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Stanislavs Nilovs,
	Bartosz Golaszewski, Luiz Augusto von Dentz, Sasha Levin

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

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

From: Stanislavs Nilovs <valorcool@gmail.com>

[ Upstream commit d97b618b6675516d63d55b8f31ee6cb3b164bd6b ]

Added WCN3950 module to the switch-case to disable SoC debug packets.

Fixes: 590deccf4c06 ("Bluetooth: hci_qca: Disable SoC debug logging for WCN3991")
Signed-off-by: Stanislavs Nilovs <valorcool@gmail.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btqca.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 002307000d3cd..60735b70d89ad 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -943,6 +943,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 	switch (soc_type) {
 	case QCA_QCA2066:
 	case QCA_QCA6390:
+	case QCA_WCN3950:
 	case QCA_WCN3991:
 	case QCA_WCN6750:
 	case QCA_WCN6855:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0294/1005] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (292 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0293/1005] Bluetooth: qca: Disable SoC debug logging for WCN3950 Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0295/1005] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
                   ` (79 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Simon Horman,
	Paolo Abeni, Sasha Levin

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

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

From: Florian Fainelli <florian.fainelli@broadcom.com>

[ Upstream commit d4f3d2c04624854d27aa948cd7bfc9d946faaac5 ]

Northstar and Northstar Plus use a 2.5 Gbps internal link between the
AMAC and the switch.  BGMAC_FEAT_FORCE_SPEED_2500 makes bgmac_miiconfig()
configure that speed, but bgmac_adjust_link() subsequently replaces it
with the synthetic fixed PHY's 1 Gbps speed.

Use the forced speed when processing link changes so the MAC remains at
2.5 Gbps.  Together with configuring the switch IMP port for its 2 Gbps
mode, this eliminates the output queue discards that caused approximately
1000 TCP retransmissions per second during an iperf3 transmit test.

Restrict the platform forced-speed flag to Northstar Plus using the SoC
compatible, since Hurricane2 shares the AMAC compatible. Other platform
AMACs without a phy-handle must continue following the fixed PHY speed.
The BCMA path already selects the flag only for the Northstar family.

Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029211540.4123250-2-florian.fainelli@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/broadcom/bgmac-platform.c | 3 ++-
 drivers/net/ethernet/broadcom/bgmac.c          | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac-platform.c b/drivers/net/ethernet/broadcom/bgmac-platform.c
index 4e266ce41180b..4880b18904812 100644
--- a/drivers/net/ethernet/broadcom/bgmac-platform.c
+++ b/drivers/net/ethernet/broadcom/bgmac-platform.c
@@ -243,7 +243,8 @@ static int bgmac_probe(struct platform_device *pdev)
 		bgmac->phy_connect = platform_phy_connect;
 	} else {
 		bgmac->phy_connect = bgmac_phy_connect_direct;
-		bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;
+		if (of_machine_is_compatible("brcm,nsp"))
+			bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;
 	}
 
 	return bgmac_enet_probe(bgmac);
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index b3f0ecc583fd5..409155fe8df0d 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1428,11 +1428,15 @@ void bgmac_adjust_link(struct net_device *net_dev)
 {
 	struct bgmac *bgmac = netdev_priv(net_dev);
 	struct phy_device *phy_dev = net_dev->phydev;
+	int speed = phy_dev->speed;
 	bool update = false;
 
+	if (bgmac->feature_flags & BGMAC_FEAT_FORCE_SPEED_2500)
+		speed = SPEED_2500;
+
 	if (phy_dev->link) {
-		if (phy_dev->speed != bgmac->mac_speed) {
-			bgmac->mac_speed = phy_dev->speed;
+		if (speed != bgmac->mac_speed) {
+			bgmac->mac_speed = speed;
 			update = true;
 		}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0295/1005] net: dsa: b53: restore the NSP IMP port 2 Gbps mode
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (293 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0294/1005] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0296/1005] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
                   ` (78 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Simon Horman,
	Paolo Abeni, Sasha Levin

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

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

From: Florian Fainelli <florian.fainelli@broadcom.com>

[ Upstream commit 41af38324341df9d769641d6485abb67fd5209ed ]

The Northstar Plus IMP port uses the switch's proprietary 2 Gbps mode for
its internal link to the AMAC.  Its fixed-link description reports 1 Gbps,
so applying that speed clears PORT_OVERRIDE_SPEED_2000M and leaves the two
ends of the internal link configured at different speeds.

Force the 2 Gbps mode and flow control for BCM5301x and NSP CPU ports.  The
mismatch caused switch output queue discards on both copper and SerDes
ports, with one discard for every TCP retransmission.  With both ends
restored to their high-speed modes, iperf3 reports no retransmissions.

Fixes: b6a8a5477fe9 ("net: dsa: b53: fix resetting speed and pause on forced link")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261029211540.4123250-3-florian.fainelli@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/dsa/b53/b53_common.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index e54f6d4d1f7bb..a2a5754c413c6 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1720,9 +1720,15 @@ static void b53_phylink_mac_link_up(struct phylink_config *config,
 	}
 
 	if (mode == MLO_AN_FIXED) {
-		/* Force flow control on BCM5301x's CPU port */
-		if (is5301x(dev) && dsa_is_cpu_port(ds, port))
-			tx_pause = rx_pause = true;
+		/* Force flow control and 2Gbits/sec on BCM5301x and NSP CPU
+		 * ports
+		 */
+		if ((is5301x(dev) || dev->chip_id == BCM58XX_DEVICE_ID) &&
+		    dsa_is_cpu_port(ds, port)) {
+			tx_pause = true;
+			rx_pause = true;
+			speed = 2000;
+		}
 
 		b53_force_port_config(dev, port, speed, duplex,
 				      tx_pause, rx_pause);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0296/1005] Bluetooth: Fix not updating of hdev->commands[] after reset
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (294 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0295/1005] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0297/1005] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
                   ` (77 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin

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

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

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

[ Upstream commit e00aa1a33f81a5e25b510f569ab9cb9f97eb41b9 ]

Read Local Supported Commands was only read once during the INIT/SETUP
flow, but the supported commands bits may change at runtime, for
example after a firmware change applied with vendor commands, so update
hdev->commands[] every time the response is received.

Fixes: 6a070e6e81ad ("Bluetooth: Store supported commands only during setup procedure")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/hci_event.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d1f142e6ea5b5..fd5c185bb10bf 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -816,9 +816,7 @@ static u8 hci_cc_read_local_commands(struct hci_dev *hdev, void *data,
 	if (rp->status)
 		return rp->status;
 
-	if (hci_dev_test_flag(hdev, HCI_SETUP) ||
-	    hci_dev_test_flag(hdev, HCI_CONFIG))
-		memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));
+	memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));
 
 	return rp->status;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0297/1005] spi: cadence-quadspi: Fix race between DMA completion and transfer start
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (295 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0296/1005] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0298/1005] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
                   ` (76 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Frederic Konrad, Srikanth Boyapally,
	Radhey Shyam Pandey, Mark Brown, Sasha Levin

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

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

From: Frederic Konrad <fkonrad@amd.com>

[ Upstream commit 059518f775baecc9803fc97787bd0b17558f8047 ]

In cqspi_versal_indirect_read_dma(), the DMA transfer is started by
writing CQSPI_REG_INDIRECTRD_START_MASK to the indirect read control
register. Under certain timing conditions, the DMA completion interrupt
may be triggered and complete the transfer before the completion
structure is reinitialized.

This creates a race where the completion event is lost, causing
wait_for_completion_timeout() to time out even though the transfer has
already completed, resulting in errors such as:

  spi-nor spi0.0: CS0: operation failed with -110

Fix this by reinitializing the completion structure before starting the
DMA transfer, ensuring that any completion event generated after the
transfer begins is correctly observed.

Fixes: 1a6f854f7daa ("spi: cadence-quadspi: Add Xilinx Versal external DMA support")
Signed-off-by: Frederic Konrad <fkonrad@amd.com>
Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://patch.msgid.link/20261104071958.2405117-1-radhey.shyam.pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-cadence-quadspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 5a5f1a852cbe8..c31e225f240a8 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -955,11 +955,11 @@ static int cqspi_versal_indirect_read_dma(struct cqspi_flash_pdata *f_pdata,
 	writel(CQSPI_REG_VERSAL_DMA_DST_CTRL_VAL,
 	       reg_base + CQSPI_REG_VERSAL_DMA_DST_CTRL);
 
+	reinit_completion(&cqspi->transfer_complete);
+
 	writel(CQSPI_REG_INDIRECTRD_START_MASK,
 	       reg_base + CQSPI_REG_INDIRECTRD);
 
-	reinit_completion(&cqspi->transfer_complete);
-
 	if (!wait_for_completion_timeout(&cqspi->transfer_complete,
 					 msecs_to_jiffies(max_t(size_t, bytes_to_dma, 500)))) {
 		ret = -ETIMEDOUT;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0298/1005] drm/nouveau/fifo: map Kepler video engine contexts non-privileged
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (296 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0297/1005] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0299/1005] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
                   ` (75 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Rosen Penev, Dave Airlie,
	Sasha Levin

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

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

From: Rosen Penev <rosenp@gmail.com>

[ Upstream commit 0820004c342af7ca1b01d0b21e0d5d99ad5c10eb ]

Since the engine context rework, gk104_ectx_ctor() maps every engine
context into the channel's VMM as a privileged page.  The MSVLD,
MSPDEC and MSPPP falcons on Kepler fetch their context with
non-privileged requests, so the first method sent to any of them
faults and the channel is killed:

  fifo: fault 00 [READ] at 0000000001050000 engine 10 [MSVLD] client 0d [HUB/MSVLD] reason 05 [PRIV_VIOLATION] on channel 9
  fifo: fault 00 [READ] at 0000000001051000 engine 14 [MSPDEC] client 0b [HUB/MSPDEC] reason 05 [PRIV_VIOLATION] on channel 10
  fifo: fault 00 [READ] at 0000000001052000 engine 11 [MSPPP] client 0c [HUB/MSPPP] reason 05 [PRIV_VIOLATION] on channel 11

Before the rework, gk104_fifo_gpfifo_engine_ctor() mapped engine
contexts without the privileged bit.  Restore that for the three video
engines, and keep the privileged mapping for everything else.

Fixes: 8ab849d6dd4c ("drm/nouveau/fifo: add new engine context handling")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20261103221529.585436-1-rosenp@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
index 5655eda52a7b5..912eb6c3a13d4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
@@ -180,6 +180,19 @@ gk104_ectx_ctor(struct nvkm_engn *engn, struct nvkm_vctx *vctx)
 	struct gf100_vmm_map_v0 args = { .priv = 1 };
 	int ret;
 
+	/* The video falcons access their context with non-privileged
+	 * requests, and fault with PRIV_VIOLATION on a privileged mapping.
+	 */
+	switch (engn->engine->subdev.type) {
+	case NVKM_ENGINE_MSVLD:
+	case NVKM_ENGINE_MSPDEC:
+	case NVKM_ENGINE_MSPPP:
+		args.priv = 0;
+		break;
+	default:
+		break;
+	}
+
 	ret = nvkm_vmm_get(vctx->vmm, 12, vctx->inst->size, &vctx->vma);
 	if (ret)
 		return ret;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0299/1005] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (297 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0298/1005] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0300/1005] ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP OmniBook 7 Greg Kroah-Hartman
                   ` (74 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Munique Feitoza, Dave Airlie,
	Sasha Levin

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

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

From: Munique Feitoza <muniquefeitoz4@gmail.com>

[ Upstream commit a2b7b707d75e605d31fb3d85a6b27f8bb2a01413 ]

Commit 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine
channel") changed nouveau_accel_ce_init() to unconditionally request a
privileged channel (priv = true) when calling nouveau_channel_new().

However, privileged channels (func->ramfc->priv) are only supported on
Kepler (gk104_chan_ramfc) and newer FIFO implementations. On pre-Kepler
GPUs that expose a Copy Engine runlist, func->ramfc->priv is false,
which causes nvkm_chan_new_() to reject the channel creation with
-EINVAL:

  nouveau 0000:01:00.0: DRM: failed to create ce channel, -22

Only request a privileged CE channel when device->info.family >=
NV_DEVICE_INFO_V0_KEPLER.

Fixes: 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine channel")
Signed-off-by: Munique Feitoza <muniquefeitoz4@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20261030202809.28723-1-muniquefeitoz4@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 2c7077a49888d..6424d0fa1f39b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -337,6 +337,7 @@ static void
 nouveau_accel_ce_init(struct nouveau_drm *drm)
 {
 	struct nvif_device *device = &drm->client.device;
+	bool priv;
 	u64 runm;
 	int ret = 0;
 
@@ -349,7 +350,11 @@ nouveau_accel_ce_init(struct nouveau_drm *drm)
 		return;
 	}
 
-	ret = nouveau_channel_new(&drm->client, true, runm, NvDmaFB, NvDmaTT, &drm->cechan);
+	/* priv copy engine only works on kepler and newer. */
+	priv = device->info.family >= NV_DEVICE_INFO_V0_KEPLER;
+
+	ret = nouveau_channel_new(&drm->client, priv, runm, NvDmaFB, NvDmaTT,
+				  &drm->cechan);
 	if (ret)
 		NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0300/1005] ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP OmniBook 7
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (298 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0299/1005] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0301/1005] ALSA: firewire: fix inverted streaming speed between tx and rx streams Greg Kroah-Hartman
                   ` (73 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shivam Madlani, Takashi Iwai,
	Sasha Levin

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

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

From: Shivam Madlani <shivammadlani5@gmail.com>

[ Upstream commit 5cdee541b37c6d29a6e05cb2a875a365cfbcf520 ]

The HP OmniBook 7 Laptop 14-fr0xxx (PCI SSID 103c:8e3b) uses an ALC245
codec with CS35L41 amplifiers. The existing quirk
ALC287_FIXUP_CS35L41_I2C_2 does not configure the speaker mute or
mic-mute LEDs, leaving them non-functional.

Switch to ALC245_FIXUP_CS35L41_I2C_2_MUTE_MICMUTE_LED, which controls
the speaker mute LED via COEF index 0x0b, the mic-mute LED via GPIO
0x04, and chains to the CS35L41 amplifier setup. Also update the model
name from the internal board codename ("HP Agusta") to the retail
product name.

Fixes: 7150d57c370f ("ALSA: hda/realtek: Add support for HP Agusta using CS35L41 HDA")
Signed-off-by: Shivam Madlani <shivammadlani5@gmail.com>
Link: https://patch.msgid.link/20261101143818.17714-1-shivammadlani5@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/hda/codecs/realtek/alc269.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 350003d406e79..2c12ab2f8d206 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -7896,7 +7896,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x8e36, "HP 14 Enstrom OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x103c, 0x8e37, "HP 16 Piston OmniBook X", ALC287_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x103c, 0x8e3a, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
-	SND_PCI_QUIRK(0x103c, 0x8e3b, "HP Agusta", ALC287_FIXUP_CS35L41_I2C_2),
+	SND_PCI_QUIRK(0x103c, 0x8e3b, "HP OmniBook 7", ALC245_FIXUP_CS35L41_I2C_2_MUTE_MICMUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x8e43, "HP Laptop 15-fd2xxx", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO),
 	SND_PCI_QUIRK(0x103c, 0x8e60, "HP OmniBook 7 Laptop 16-bh0xxx", ALC245_FIXUP_CS35L41_I2C_2_MUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x8e61, "HP Trekker ", ALC287_FIXUP_CS35L41_I2C_2),
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0301/1005] ALSA: firewire: fix inverted streaming speed between tx and rx streams
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (299 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0300/1005] ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP OmniBook 7 Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0302/1005] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
                   ` (72 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Takashi Sakamoto, Takashi Iwai,
	Sasha Levin

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

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

From: Takashi Sakamoto <o-takashi@sakamocchi.jp>

[ Upstream commit 64d3a2c8e7bc0d3cf144d71ee2fb357c15b6c71f ]

ALSA firewire-tascam driver uses inverted streaming speed when reserving
isochronous resources between tx and rx streams.

Correct the streaming speeds. This has no impact on existing
functionality, as both streams are always reserved together when handling
PCM substreams.

Fixes: dbd0cf204fe6 ("ALSA: firewire-tascam: reserve resources for transferred isochronous packets at S400")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/20261102033652.1184893-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/firewire/tascam/tascam-stream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/firewire/tascam/tascam-stream.c b/sound/firewire/tascam/tascam-stream.c
index 4ecd151a46c19..462766946e94e 100644
--- a/sound/firewire/tascam/tascam-stream.c
+++ b/sound/firewire/tascam/tascam-stream.c
@@ -287,10 +287,10 @@ static int keep_resources(struct snd_tscm *tscm, unsigned int rate,
 
 	if (stream == &tscm->tx_stream) {
 		resources = &tscm->tx_resources;
-		speed = fw_parent_device(tscm->unit)->max_speed;
+		speed = SCODE_400;
 	} else {
 		resources = &tscm->rx_resources;
-		speed = SCODE_400;
+		speed = fw_parent_device(tscm->unit)->max_speed;
 	}
 
 	err = amdtp_tscm_set_parameters(stream, rate);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0302/1005] ALSA: hda/core: Stop capability walk on empty capability header
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (300 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0301/1005] ALSA: firewire: fix inverted streaming speed between tx and rx streams Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0303/1005] ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load() Greg Kroah-Hartman
                   ` (71 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Michał Kopeć, Takashi Iwai,
	Sasha Levin

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

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

From: Michał Kopeć <michal.kopec@3mdeb.com>

[ Upstream commit f65c917397c77daeb7e6d0893ebe89107ddd5692 ]

snd_hdac_bus_parse_capabilities() walks the controller's linked
capability list starting at LLCH. On some platforms one of the entries
reads back as all zeros. Such a header does not describe a capability,
but the walk still treats it as one: it falls into the default case and
reports an error, printing the raw register value instead of the
capability ID:

  snd_hda_intel 0000:00:1f.3: Unknown capability 0

The walk then stops anyway, because the next pointer of a zero header
is 0, so the message is only noise.

Treat an all-zero header as the end of the list, the same way a failed
read (-1) is already handled, and log it at debug level only. Also
print the capability ID in hex for a genuinely unknown capability,
instead of the full header value.

Fixes: 0b00a5615dc4 ("ALSA: hdac_ext: add hdac extended controller")
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Link: https://patch.msgid.link/20261102114939.2182131-1-michal.kopec@3mdeb.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/hda/core/controller.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sound/hda/core/controller.c b/sound/hda/core/controller.c
index d1d85511a9dba..b37ae60621581 100644
--- a/sound/hda/core/controller.c
+++ b/sound/hda/core/controller.c
@@ -426,6 +426,13 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 		}
 
+		/* An all-zero header means no capability is present here */
+		if (!cur_cap) {
+			dev_dbg(bus->dev, "Empty capability header at offset 0x%x\n",
+				offset);
+			break;
+		}
+
 		switch ((cur_cap & AZX_CAP_HDR_ID_MASK) >> AZX_CAP_HDR_ID_OFF) {
 		case AZX_ML_CAP_ID:
 			dev_dbg(bus->dev, "Found ML capability\n");
@@ -456,7 +463,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 
 		default:
-			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
+			dev_err(bus->dev, "Unknown capability ID 0x%x\n",
+				(cur_cap & AZX_CAP_HDR_ID_MASK) >> AZX_CAP_HDR_ID_OFF);
 			cur_cap = 0;
 			break;
 		}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0303/1005] ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (301 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0302/1005] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0304/1005] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
                   ` (70 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Takashi Iwai,
	Sasha Levin

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

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

From: Richard Fitzgerald <rf@opensource.cirrus.com>

[ Upstream commit d2895945d37e3426191894a010f94db31c206e10 ]

Remove the gotos from cs35l56_hda_fw_load() to prevent mixing
auto-cleanup and goto-cleanup in the same function. Replace them with
returns and remove the goto cleanup code, as there's no need to "undo"
a cs_dsp_power_up() with a cs_dsp_power_down() here.

Two previous commits added auto-cleanup to cs35l56_hda_fw_load() but
didn't remove the goto, which leaves mixed cleanup and goto.

commit 0ff22680e51f4 ("ALSA: hda/cs35l56: Clean up with
PM_RUNTIME_ACQUIRE*() macros")

commit 185841c94accc ("ALSA: hda: cs35l56: Use auto-cleanup for firmware
loading")

There's actually no need to call cs_dsp_power_down() here. On the
CS35L54/56/57 amps it doesn't control the DSP subsystem power (that is all
managed by the firmware), so it's perfectly safe to just return if there
are any errors after a successful cs_dsp_power_up(). As cs_dsp_power_up()
was successful it is valid to leave cs_dsp in this state, which matches
the state of the hardware.

The two places that cs_dsp_power_down() is called conditionally have been
changed to check the cs_dsp.booted flag, now the fw_patched flag is not
a guaranteed proxy. The booted flag is directly indicating that there has
been a successful cs_dsp_power_up() so this is more correct anyway.

Fixes: 0ff22680e51f4 ("ALSA: hda/cs35l56: Clean up with PM_RUNTIME_ACQUIRE*() macros")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20261104111121.1054077-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/hda/codecs/side-codecs/cs35l56_hda.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/sound/hda/codecs/side-codecs/cs35l56_hda.c b/sound/hda/codecs/side-codecs/cs35l56_hda.c
index bc207ab5b020a..148d760987fdd 100644
--- a/sound/hda/codecs/side-codecs/cs35l56_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l56_hda.c
@@ -562,7 +562,7 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
 	 * downloaded previously then it needs to be powered down so that it
 	 * can be updated.
 	 */
-	if (cs35l56->base.fw_patched)
+	if (cs35l56->cs_dsp.booted)
 		cs_dsp_power_down(&cs35l56->cs_dsp);
 
 	cs35l56->base.fw_patched = false;
@@ -634,7 +634,7 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
 		regcache_mark_dirty(cs35l56->base.regmap);
 		ret = cs35l56_wait_for_firmware_boot(&cs35l56->base);
 		if (ret)
-			goto err_powered_up;
+			return;
 
 		regcache_cache_only(cs35l56->base.regmap, false);
 	}
@@ -642,7 +642,7 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
 	/* Disable auto-hibernate so that runtime_pm has control */
 	ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_PREVENT_AUTO_HIBERNATE);
 	if (ret)
-		goto err_powered_up;
+		return;
 
 	regcache_sync(cs35l56->base.regmap);
 
@@ -663,10 +663,6 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
 		cs_dsp_stop(&cs35l56->cs_dsp);
 
 	cs35l56_log_tuning(&cs35l56->base, &cs35l56->cs_dsp);
-
-err_powered_up:
-	if (!cs35l56->base.fw_patched)
-		cs_dsp_power_down(&cs35l56->cs_dsp);
 }
 
 static void cs35l56_hda_dsp_work(struct work_struct *work)
@@ -814,7 +810,7 @@ static void cs35l56_hda_unbind(struct device *dev, struct device *master, void *
 	debugfs_remove_recursive(cs35l56->debugfs_root);
 #endif
 
-	if (cs35l56->base.fw_patched)
+	if (cs35l56->cs_dsp.booted)
 		cs_dsp_power_down(&cs35l56->cs_dsp);
 
 	comp = hda_component_from_index(parent, cs35l56->index);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0304/1005] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (302 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0303/1005] ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0305/1005] ALSA: hda/realtek: Use inverted mute LED quirk for HP ZBook 8 G2a Greg Kroah-Hartman
                   ` (69 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Takashi Iwai,
	Sasha Levin

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

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

From: Richard Fitzgerald <rf@opensource.cirrus.com>

[ Upstream commit 8c63987ac7fe605c337edbf9052cf97e2a415558 ]

In cs35l56_hda_unbind() call cs_dsp_stop() before cs_dsp_power_down()
if cs_dsp is in a running state.

cs35l56_hda_runtime_resume() calls cs_dsp_run() if cs_dsp_power_up() has
previously run successfully. If cs35l56_hda_unbind() is then called while
in this runtime-resumed state cs_dsp will be running. The code wasn't
checking for this and was calling cs_dsp_power_down() while still in a
running state, which is illegal. This is currently fairly harmless for
the cs35l56 driver. But it doesn't comply with the API, so potentially
could break with any future changes that expect the correct API use.

Fixes: fb78d73dde2d4 ("ALSA: hda/cs35l56: Call cs_dsp_power_down() before calling cs_dsp_remove()")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20261104122337.1072468-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/hda/codecs/side-codecs/cs35l56_hda.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/hda/codecs/side-codecs/cs35l56_hda.c b/sound/hda/codecs/side-codecs/cs35l56_hda.c
index 148d760987fdd..5982eebae1525 100644
--- a/sound/hda/codecs/side-codecs/cs35l56_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l56_hda.c
@@ -809,6 +809,8 @@ static void cs35l56_hda_unbind(struct device *dev, struct device *master, void *
 	cs_dsp_cleanup_debugfs(&cs35l56->cs_dsp);
 	debugfs_remove_recursive(cs35l56->debugfs_root);
 #endif
+	if (cs35l56->cs_dsp.running)
+		cs_dsp_stop(&cs35l56->cs_dsp);
 
 	if (cs35l56->cs_dsp.booted)
 		cs_dsp_power_down(&cs35l56->cs_dsp);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0305/1005] ALSA: hda/realtek: Use inverted mute LED quirk for HP ZBook 8 G2a
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (303 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0304/1005] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0306/1005] gpiolib: reset lookup flags for each hogged line Greg Kroah-Hartman
                   ` (68 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Chris Chiu, Takashi Iwai,
	Sasha Levin

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

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

From: Chris Chiu <chris.chiu@canonical.com>

[ Upstream commit 022e9f8f094279ecd632b3846968790fad7d8ad6 ]

HP ZBook 8 G2a (SSIDs 0x103c:0x8f40, 0x103c:0x8f41, 0x103c:0x8f42,
0x103c:0x8f62) use the Realtek ALC245 codec with a TAS2781 amplifier
via I2C. They share the same hardware configuration as the related
0x103c:0x8f94 / 0x103c:0x8f95 models but were left on
ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED, which drives the speaker mute
LED backwards: off when muted and on when unmuted.

Reassign these SSIDs to ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED
so the LED follows mute state correctly.

Fixes: 9afbbf490322 ("ALSA: hda/realtek - Enable Mute LED and Tas2781 for HP platform")
Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Link: https://patch.msgid.link/20261105025647.1116662-1-chris.chiu@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/hda/codecs/realtek/alc269.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 2c12ab2f8d206..a54cd3ebaa5cd 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -7934,11 +7934,11 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x8f3a, "HP EliteBook 6 G2i", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8f3c, "HP EliteBook 6 G2a", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
 	SND_PCI_QUIRK(0x103c, 0x8f3d, "HP EliteBook 6 G2a", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
-	SND_PCI_QUIRK(0x103c, 0x8f40, "HP ZBook 8 G2a 14", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED),
-	SND_PCI_QUIRK(0x103c, 0x8f41, "HP ZBook 8 G2a 16", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED),
-	SND_PCI_QUIRK(0x103c, 0x8f42, "HP ZBook 8 G2a 14W", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED),
+	SND_PCI_QUIRK(0x103c, 0x8f40, "HP ZBook 8 G2a 14", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED),
+	SND_PCI_QUIRK(0x103c, 0x8f41, "HP ZBook 8 G2a 16", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED),
+	SND_PCI_QUIRK(0x103c, 0x8f42, "HP ZBook 8 G2a 14W", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED),
 	SND_PCI_QUIRK(0x103c, 0x8f57, "HP Trekker G7JC", ALC287_FIXUP_CS35L41_I2C_2),
-	SND_PCI_QUIRK(0x103c, 0x8f62, "HP ZBook 8 G2a 16W", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED),
+	SND_PCI_QUIRK(0x103c, 0x8f62, "HP ZBook 8 G2a 16W", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED),
 	SND_PCI_QUIRK(0x103c, 0x8f7e, "HP Messi", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x8f94, "HP ZBook 8 G2a 14", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED),
 	SND_PCI_QUIRK(0x103c, 0x8f95, "HP ZBook 8 G2a 16", ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED_INVERTED),
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0306/1005] gpiolib: reset lookup flags for each hogged line
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (304 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0305/1005] ALSA: hda/realtek: Use inverted mute LED quirk for HP ZBook 8 G2a Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0307/1005] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
                   ` (67 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jinseob Kim, Bartosz Golaszewski,
	Sasha Levin

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

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

From: Jinseob Kim <kimjinseob88@gmail.com>

[ Upstream commit c20464a78162cf8b3a1c9dc7e0d764e535bfe582 ]

gpiochip_add_hog() initializes lflags once before iterating over the GPIO
specifiers. In the non-OF path, an active-low line sets GPIO_ACTIVE_LOW,
but a later active-high line does not clear it. A single firmware hog
with mixed polarities therefore configures later active-high lines as
active-low, including inverting their initial output value.

Initialize the lookup flags for each line before translating its flags.
The OF helper already overwrites the flags for each specifier; the
non-OF path must also start with a fresh value.

Codex assisted with identifying the issue and developing the fix.

Fixes: 802c51a83e9a ("gpiolib: fix hogs with multiple lines")
Signed-off-by: Jinseob Kim <kimjinseob88@gmail.com>
Link: https://patch.msgid.link/20261104115938.226-1-kimjinseob88@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpiolib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 90731a547ed63..b16d6d727ac35 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -975,7 +975,6 @@ int gpiochip_add_hog(struct gpio_chip *gc, struct fwnode_handle *fwnode)
 	 */
 	u32 cells = 2;
 
-	lflags = GPIO_LOOKUP_FLAGS_DEFAULT;
 	dflags = GPIOD_ASIS;
 	name = NULL;
 
@@ -1014,6 +1013,8 @@ int gpiochip_add_hog(struct gpio_chip *gc, struct fwnode_handle *fwnode)
 	fwnode_property_read_string(fwnode, "line-name", &name);
 
 	for (unsigned int i = 0; i < num_hogs; i++) {
+		lflags = GPIO_LOOKUP_FLAGS_DEFAULT;
+
 		if (is_of_node(fwnode)) {
 			/*
 			 * OF-nodes need some additional special handling for
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0307/1005] net: 8139cp: keep Rx masked while NAPI is scheduled
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (305 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0306/1005] gpiolib: reset lookup flags for each hogged line Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0308/1005] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
                   ` (66 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Colton Pawielski, Daniel Machon,
	Paolo Abeni, Sasha Levin

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

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

From: Colton Pawielski <colton.pawielski@gmail.com>

[ Upstream commit 547b1ae5ec50b7d81b05b4219e0db7e56279d65f ]

cp_rx_poll() calls napi_complete_done() and only then takes cp->lock
with interrupts disabled to unmask the Rx interrupts. An interrupt
that is not masked while polling (TxOK, TxErr, ...) can arrive in
between. cp_interrupt() then sees the Rx status bits, which are still
set, finds NAPI no longer scheduled, masks Rx and schedules NAPI again.
cp_rx_poll() then carries on and unmasks Rx anyway.

>From that point Rx interrupts are enabled while NAPI is scheduled:
cp_interrupt() leaves the Rx bits for the poll routine, does not mask
them because napi_schedule_prep() fails, and the level-triggered
interrupt fires again as soon as it returns. On an SH7751 LANDISK
under combined Tx/Rx load this interrupt storm was captured with a RAM
trace right before the board locked up hard.

Mask Rx in cp_interrupt() whenever Rx status is pending, not only when
NAPI gets scheduled. If the race leaves Rx unmasked, the next interrupt
masks it again, and the pending poll unmasks it when it completes.

Fixes: ab1e7e1d2666 ("8139cp: use napi_complete_done()")
Signed-off-by: Colton Pawielski <colton.pawielski@gmail.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261031-b4-8139cp-napi-v2-1-5824797c0fe6@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/realtek/8139cp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 9016527e229ac..8f81dc7deef1e 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -600,11 +600,11 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance)
 		goto out_unlock;
 	}
 
-	if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr))
-		if (napi_schedule_prep(&cp->napi)) {
-			cpw16_f(IntrMask, cp_norx_intr_mask);
+	if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) {
+		cpw16_f(IntrMask, cp_norx_intr_mask);
+		if (napi_schedule_prep(&cp->napi))
 			__napi_schedule(&cp->napi);
-		}
+	}
 
 	if (status & (TxOK | TxErr | TxEmpty | SWInt))
 		cp_tx(cp);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0308/1005] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (306 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0307/1005] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0309/1005] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
                   ` (65 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Timur Stukan, Hangbin Liu,
	Paolo Abeni, Sasha Levin

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

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

From: Timur Stukan <timur.stukan.linux@gmail.com>

[ Upstream commit 9a65b9c2a97594bcaaf393329807653eff895bbf ]

In 802.3ad mode, when bond_update_speed_duplex() fails on NETDEV_UP or
NETDEV_CHANGE, bond_slave_netdev_event() sets the slave link to FAIL if
the slave has ever been up (last_link_up != 0), and to DOWN otherwise,
so that miimon can set it right once speed/duplex are valid.

last_link_up is never cleared, so a slave that is currently DOWN but
was up before is set to FAIL as well. miimon then treats it as a slave
that is still in use and takes it through the full down path again:
the link failure count is incremented, "link status definitely down"
is logged and the 802.3ad port is disabled a second time, although the
slave has not been up since it went down.

Reproduced in 802.3ad mode with miimon=100 by setting a slave down and
up again. On NETDEV_UP the speed is still unknown, so the notifier sets
FAIL, and the next miimon pass sees no carrier and proposes DOWN:

	ip link add bond0 type bond mode 802.3ad miimon 100 lacp_rate 1
	ip link set enp0s3 down
	ip link set enp0s4 down
	ip link set enp0s3 master bond0
	ip link set enp0s4 master bond0
	ip link set enp0s3 up
	ip link set enp0s4 up
	ip link set bond0 up
	# wait for LACP to settle
	ip link set enp0s3 down
	ip link set enp0s3 up

procfs then shows "Link Failure Count: 2" in enp0s3 slave part. Also in
dmesg wrote twice: "link status definitely down, disabling slave".

Fix this by setting FAIL only for a slave that is currently UP and
leaving other states alone. An up slave that loses speed/duplex still
goes through FAIL as before, and DOWN/BACK slaves are left to miimon,
as in the other modes.

Fixes: ea53abfab960 ("bonding/802.3ad: fix link_failure_count tracking")
Signed-off-by: Timur Stukan <timur.stukan.linux@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Link: https://patch.msgid.link/20261101145653.63648-1-timur.stukan.linux@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/bonding/bond_main.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7019e5d8fdc8e..8212d406f3bc9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3973,18 +3973,13 @@ static int bond_slave_netdev_event(unsigned long event,
 	case NETDEV_CHANGE:
 		/* For 802.3ad mode only:
 		 * Getting invalid Speed/Duplex values here will put slave
-		 * in weird state. Mark it as link-fail if the link was
-		 * previously up or link-down if it hasn't yet come up, and
-		 * let link-monitoring (miimon) set it right when correct
-		 * speeds/duplex are available.
+		 * in weird state. Mark an up slave as link-fail and let
+		 * miimon set it right when correct speed/duplex are available.
 		 */
 		if (bond_update_speed_duplex(slave) &&
-		    BOND_MODE(bond) == BOND_MODE_8023AD) {
-			if (slave->last_link_up)
-				slave->link = BOND_LINK_FAIL;
-			else
-				slave->link = BOND_LINK_DOWN;
-		}
+		    BOND_MODE(bond) == BOND_MODE_8023AD &&
+		    slave->link == BOND_LINK_UP)
+			slave->link = BOND_LINK_FAIL;
 
 		if (BOND_MODE(bond) == BOND_MODE_8023AD)
 			bond_3ad_adapter_speed_duplex_changed(slave);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0309/1005] ip6mr: Serialize multicast router socket ownership
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (307 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0308/1005] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0310/1005] bonding: fix missing down path on speed/duplex failure after FAIL->UP Greg Kroah-Hartman
                   ` (64 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Ido Schimmel, Paolo Abeni,
	Sasha Levin

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

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

From: Kyle Zeng <kylebot@openai.com>

[ Upstream commit c6b41de4dd9f2d6856d8d8d292348f7961034152 ]

MRT6_TABLE checks whether the socket owns its current table before
acquiring RTNL. MRT6_INIT also looks up its table before taking RTNL.
Consequently, concurrent TABLE and INIT calls can initialize the old
table and then change the socket's selected table. Another INIT can
register the same socket in the new table.

rawv6_close() calls ip6mr_sk_done(), which clears only the first table
owned by the socket. After the socket's RCU-delayed free, the other
table retains a dangling mroute_sk pointer. A subsequent multicast cache
report passes that pointer to sock_queue_rcv_skb_reason(). This produces
a KASAN slab-use-after-free in sk_filter_trim_cap().

Look up the selected table in ip6mr_sk_init() after acquiring RTNL.
Likewise, re-read the current table and check its owner under RTNL in
MRT6_TABLE before updating the selection. This preserves the single-table
ownership invariant shared with ip6mr_sk_done(), without changing the
locking of the other multicast socket options.

Fixes: d1db275dd3f6 ("ipv6: ip6mr: support multiple tables")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261030042221.73996-1-kylebot@openai.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/ip6mr.c | 36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 6465ed11a0b53..fff0a16ad11f6 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1621,12 +1621,20 @@ static void mroute_clean_tables(struct mr_table *mrt, int flags,
 	}
 }
 
-static int ip6mr_sk_init(struct mr_table *mrt, struct sock *sk)
+static int ip6mr_sk_init(struct sock *sk)
 {
-	int err = 0;
 	struct net *net = sock_net(sk);
+	struct mr_table *mrt;
+	int err = 0;
 
 	rtnl_lock();
+	mrt = __ip6mr_get_table(net,
+				raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT);
+	if (!mrt) {
+		err = -ENOENT;
+		goto out_unlock;
+	}
+
 	spin_lock(&mrt_lock);
 	if (rtnl_dereference(mrt->mroute_sk)) {
 		err = -EADDRINUSE;
@@ -1642,6 +1650,7 @@ static int ip6mr_sk_init(struct mr_table *mrt, struct sock *sk)
 					     NETCONFA_MC_FORWARDING,
 					     NETCONFA_IFINDEX_ALL,
 					     net->ipv6.devconf_all);
+out_unlock:
 	rtnl_unlock();
 
 	return err;
@@ -1743,7 +1752,7 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 		if (optlen < sizeof(int))
 			return -EINVAL;
 
-		return ip6mr_sk_init(mrt, sk);
+		return ip6mr_sk_init(sk);
 
 	case MRT6_DONE:
 		return ip6mr_sk_done(sk);
@@ -1870,16 +1879,21 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 		/* "pim6reg%u" should not exceed 16 bytes (IFNAMSIZ) */
 		if (v != RT_TABLE_DEFAULT && v >= 100000000)
 			return -EINVAL;
-		if (sk == rcu_access_pointer(mrt->mroute_sk))
-			return -EBUSY;
-
 		rtnl_lock();
 		ret = 0;
-		mrt = ip6mr_new_table(net, v);
-		if (IS_ERR(mrt))
-			ret = PTR_ERR(mrt);
-		else
-			raw6_sk(sk)->ip6mr_table = v;
+		mrt = __ip6mr_get_table(net,
+					raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT);
+		if (!mrt) {
+			ret = -ENOENT;
+		} else if (sk == rtnl_dereference(mrt->mroute_sk)) {
+			ret = -EBUSY;
+		} else {
+			mrt = ip6mr_new_table(net, v);
+			if (IS_ERR(mrt))
+				ret = PTR_ERR(mrt);
+			else
+				raw6_sk(sk)->ip6mr_table = v;
+		}
 		rtnl_unlock();
 		return ret;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0310/1005] bonding: fix missing down path on speed/duplex failure after FAIL->UP
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (308 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0309/1005] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0311/1005] net: stmmac: set XDP metadata length on the page_pool RX path Greg Kroah-Hartman
                   ` (63 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Timur Stukan, Hangbin Liu,
	Paolo Abeni, Sasha Levin

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

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

From: Timur Stukan <timur.stukan.linux@gmail.com>

[ Upstream commit a76ab5e733b41dede6f238a691eefb4374f99f79 ]

In bond_miimon_commit(), when a slave is proposed as BOND_LINK_UP but
bond_update_speed_duplex() fails in bonding mode that needs speed/duplex
(802.3ad, tlb, alb), the slave is set to BOND_LINK_DOWN directly. This
bypasses bond_set_slave_link_state(), bond_miimon_link_change() and
failover.

This is fine for slave that coming from BOND_LINK_BACK, which was never
brought up and is not in use. But since commit 1899bb325149 ("bonding:
fix state transition issue in link monitoring") the commit phase also
handles BOND_LINK_FAIL -> BOND_LINK_UP which means a slave that is still
in use and may be curr_active_slave.

If the link recovers within downdelay and goes down again before the
commit phase reads speed/duplex, the slave is silently marked down while
remaining the active slave in worst cases. In alb/tlb the bond MAC stays
on the dead port, no failover happens and TLB/RLB state is not cleaned,
so the bond stops passing traffic until that link comes back even though
other slaves are up. A non-active slave is affected too, in alb, RLB
clients assigned to it are not reassigned and become unreachable.

Reproduced in tlb and alb mode with miimon=100 and downdelay=10000 by
flapping a slave within downdelay and dropping it again before commit
(a longer delay was added between inspect and commit to make window
wider and easier to test):
  bond0: (slave enp0s3): link status down for interface, disabling it in 10000 ms
  bond0: (slave enp0s3): link status up again after 3400 ms
  bond0: (slave enp0s3): failed to get link speed/duplex

procfs then shows the active slave with "MII Status: down" and "Link
Failure Count: 0", and all traffic is lost.

Fix this by dropping the loop in bond_mii_monitor() that applied all
proposed link states before bond_miimon_commit(). bond_miimon_commit()
now applies each state itself: UP after the speed/duplex check, as it
already did, DOWN in the down path, and FAIL/BACK directly. So when the
speed/duplex check runs, slave->link still holds the previous state. If
the check fails for a slave that is FAIL or UP, take it through the
regular down path, including failover. DOWN and BACK slaves were
never brought up and are still just reverted to DOWN. The down path is
moved into bond_miimon_slave_down() so both callers share it.

After the fix:
  bond0: (slave enp0s3): failed to get link speed/duplex
  bond0: (slave enp0s3): link status definitely down, disabling slave
  bond0: (slave enp0s4): making interface the new active one

Fixes: 1899bb325149 ("bonding: fix state transition issue in link monitoring")
Signed-off-by: Timur Stukan <timur.stukan.linux@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Link: https://patch.msgid.link/20261101150240.66292-1-timur.stukan.linux@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/bonding/bond_main.c | 63 +++++++++++++++++++--------------
 1 file changed, 37 insertions(+), 26 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8212d406f3bc9..a1c156c145b2d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2779,6 +2779,27 @@ static void bond_miimon_link_change(struct bonding *bond,
 	}
 }
 
+static bool bond_miimon_slave_down(struct bonding *bond,
+				   struct slave *slave)
+{
+	if (slave->link_failure_count < UINT_MAX)
+		slave->link_failure_count++;
+
+	bond_set_slave_link_state(slave, BOND_LINK_DOWN,
+				  BOND_SLAVE_NOTIFY_NOW);
+
+	if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP ||
+	    BOND_MODE(bond) == BOND_MODE_8023AD)
+		bond_set_slave_inactive_flags(slave,
+					      BOND_SLAVE_NOTIFY_NOW);
+
+	slave_info(bond->dev, slave->dev, "link status definitely down, disabling slave\n");
+
+	bond_miimon_link_change(bond, slave, BOND_LINK_DOWN);
+
+	return slave == rcu_access_pointer(bond->curr_active_slave);
+}
+
 static void bond_miimon_commit(struct bonding *bond)
 {
 	struct slave *slave, *primary, *active;
@@ -2807,10 +2828,22 @@ static void bond_miimon_commit(struct bonding *bond)
 			err = bond_update_speed_duplex(slave);
 			netdev_unlock_ops(slave->dev);
 			if (err && bond_needs_speed_duplex(bond)) {
-				slave->link = BOND_LINK_DOWN;
 				if (net_ratelimit())
 					slave_warn(bond->dev, slave->dev,
 						   "failed to get link speed/duplex\n");
+				/* Coming from FAIL/UP, the slave may still be
+				 * in use and may be curr_active_slave, so take
+				 * it through the full down path. Coming from
+				 * DOWN/BACK, it was never brought up, so just
+				 * revert it to DOWN.
+				 */
+				if (slave->link == BOND_LINK_FAIL ||
+				    slave->link == BOND_LINK_UP) {
+					if (bond_miimon_slave_down(bond, slave))
+						do_failover = true;
+					continue;
+				}
+				slave->link = BOND_LINK_DOWN;
 				continue;
 			}
 			bond_set_slave_link_state(slave, BOND_LINK_UP,
@@ -2839,28 +2872,13 @@ static void bond_miimon_commit(struct bonding *bond)
 			continue;
 
 		case BOND_LINK_DOWN:
-			if (slave->link_failure_count < UINT_MAX)
-				slave->link_failure_count++;
-
-			bond_set_slave_link_state(slave, BOND_LINK_DOWN,
-						  BOND_SLAVE_NOTIFY_NOW);
-
-			if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP ||
-			    BOND_MODE(bond) == BOND_MODE_8023AD)
-				bond_set_slave_inactive_flags(slave,
-							      BOND_SLAVE_NOTIFY_NOW);
-
-			slave_info(bond->dev, slave->dev, "link status definitely down, disabling slave\n");
-
-			bond_miimon_link_change(bond, slave, BOND_LINK_DOWN);
-
-			if (slave == rcu_access_pointer(bond->curr_active_slave))
+			if (bond_miimon_slave_down(bond, slave))
 				do_failover = true;
-
 			continue;
 
 		case BOND_LINK_FAIL:
 		case BOND_LINK_BACK:
+			bond_commit_link_state(slave, BOND_SLAVE_NOTIFY_LATER);
 			slave_dbg(bond->dev, slave->dev, "link_new_state %d on slave\n",
 				  slave->link_new_state);
 			continue;
@@ -2894,8 +2912,6 @@ static void bond_mii_monitor(struct work_struct *work)
 {
 	struct bonding *bond = container_of(work, struct bonding,
 					    mii_work.work);
-	struct list_head *iter;
-	struct slave *slave;
 	unsigned long delay;
 	bool commit;
 
@@ -2917,13 +2933,8 @@ static void bond_mii_monitor(struct work_struct *work)
 			goto re_arm;
 		}
 
-		if (commit) {
-			bond_for_each_slave(bond, slave, iter) {
-				bond_commit_link_state(slave,
-						       BOND_SLAVE_NOTIFY_LATER);
-			}
+		if (commit)
 			bond_miimon_commit(bond);
-		}
 
 		if (bond->send_peer_notif)
 			bond_peer_notify_may_events(bond, true);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0311/1005] net: stmmac: set XDP metadata length on the page_pool RX path
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (309 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0310/1005] bonding: fix missing down path on speed/duplex failure after FAIL->UP Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0312/1005] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
                   ` (62 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Daniel Machon,
	Nicolai Buchwitz, Maxime Chevallier, Paolo Abeni, Sasha Levin

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

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

From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

[ Upstream commit 6d9b7c85af57305ec2bd5907124478867edcc60b ]

stmmac_rx() initializes the XDP buffer with the metadata area valid, so
an XDP program can reserve metadata with bpf_xdp_adjust_meta() and write
it in [xdp->data_meta, xdp->data), for example to export the RX hardware
timestamp obtained from the metadata kfunc. When such a frame is passed
to the stack, the skb is built in place around the same page with
napi_build_skb(), but skb_metadata_set() is never called.

napi_build_skb() clears skb_shared_info up to dataref, which includes
meta_len, so skb_metadata_len() stays zero. The stack and TC BPF then see
an empty metadata range even though the bytes are present in the skb
headroom. The AF_XDP zero-copy path already records the length in
stmmac_construct_skb_zc().

Record the metadata length after reserving the headroom and adding the
frame data. No copy is needed because the skb is built over the buffer the
XDP program wrote to. With the length recorded, the software VLAN
stripping path can move the metadata together with the MAC header, as it
already does for zero-copy frames.

Fixes: e3f9c3e34840 ("net: stmmac: add Rx HWTS metadata to XDP receive pkt")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261102-stmmac_meatada_pp_path-v1-1-d93cc4f9a864@oss.qualcomm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index bd495ab5cd260..9ff7aecefca22 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5960,7 +5960,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 		}
 
 		if (!skb) {
-			unsigned int head_pad_len;
+			unsigned int metasize;
 
 			/* XDP program may expand or reduce tail */
 			buf1_len = ctx.xdp.data_end - ctx.xdp.data;
@@ -5977,10 +5977,14 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 			}
 
 			/* XDP program may adjust header */
-			head_pad_len = ctx.xdp.data - ctx.xdp.data_hard_start;
-			skb_reserve(skb, head_pad_len);
+			skb_reserve(skb,
+				    ctx.xdp.data - ctx.xdp.data_hard_start);
 			skb_put(skb, buf1_len);
 			skb_mark_for_recycle(skb);
+
+			metasize = ctx.xdp.data - ctx.xdp.data_meta;
+			if (metasize)
+				skb_metadata_set(skb, metasize);
 			buf->page = NULL;
 		} else if (buf1_len) {
 			dma_sync_single_for_cpu(priv->device, buf->addr,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0312/1005] net: bridge: disable MRP ports before the FDB flush in del_nbp()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (310 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0311/1005] net: stmmac: set XDP metadata length on the page_pool RX path Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0313/1005] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
                   ` (61 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ido Schimmel, Cheng Yongkang,
	Paolo Abeni, Sasha Levin

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

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

From: Cheng Yongkang <teel4res@gmail.com>

[ Upstream commit 37dfd0efbfffc20a57e41c2eb349ac49b1ca1ff8 ]

del_nbp() flushes the port's FDB entries before it unregisters the RX
handler. For a normal port, br_stp_disable_port() moves the port to
BR_STATE_DISABLED before this cleanup.

That does not hold for an MRP ring port. br_set_state() ignores state
changes while BR_MRP_AWARE_BIT is set, so br_stp_disable_port() leaves
the port state alone. br_mrp_port_del() then restores forwarding when
the bridge is up before clearing the bit. A frame received between
br_fdb_cleanup_by_dst() and netdev_rx_handler_unregister() can therefore
create a new FDB entry referencing the dying port. Nothing removes that
entry before destroy_nbp_rcu() frees the port, so a later frame to the
learned MAC can be forwarded through the freed port.

Remove the MRP and CFM instances before disabling the port, so that
br_stp_disable_port() actually transitions it to BR_STATE_DISABLED.
With CONFIG_BRIDGE_VLAN_FILTERING=y, synchronize_net() in
nbp_vlan_group_unpublish() also drains receive paths that could still
learn with the old state before the final FDB cleanup.

Found through an LLM-assisted source code analysis workflow and
reproduced on net with KASAN and CONFIG_BRIDGE_VLAN_FILTERING=y in QEMU.
A diagnostic switchdev module accepts MRP objects and delays the
NETDEV_CHANGEUPPER callback for 1.5 s, holding del_nbp() after the FDB
cleanup and before RX handler removal. The reproducer floods the MRP
port with rotating source MACs, waits for the port's RCU callback
through the module's rcu_barrier(), then sends frames to those MACs
from another port. The unpatched kernel reports:

  BUG: KASAN: slab-use-after-free in br_forward+0xb1/0x820
  Call Trace:
   <IRQ>
   br_forward+0xb1/0x820
   br_handle_frame_finish+0x148b/0x1e50
   br_handle_frame+0x90a/0x15c0

With this patch, three runs of six cycles each reach the delay without
a KASAN report.

Fixes: 6536993371fa ("bridge: mrp: Integrate MRP into the bridge")
Suggested-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/netdev/20261012123051.GA714215@shredder/
Closes: https://lore.kernel.org/netdev/20261022090431.3641707-1-teel4res@gmail.com/
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261101044840.1595584-1-1020691186@qq.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bridge/br_if.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index c52613431f886..45642b6a58666 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -340,13 +340,13 @@ static void del_nbp(struct net_bridge_port *p)
 
 	nbp_delete_promisc(p);
 
+	br_mrp_port_del(br, p);
+	br_cfm_port_del(br, p);
+
 	spin_lock_bh(&br->lock);
 	br_stp_disable_port(p);
 	spin_unlock_bh(&br->lock);
 
-	br_mrp_port_del(br, p);
-	br_cfm_port_del(br, p);
-
 	br_ifinfo_notify(RTM_DELLINK, NULL, p);
 
 	list_del_rcu(&p->list);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0313/1005] tcp: initialize send sequence numbers before deferring TFO
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (311 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0312/1005] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0314/1005] netfilter: nft_set_rbtree: check catchall_sync return before queue_done Greg Kroah-Hartman
                   ` (60 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Qingfang Deng, Eric Dumazet,
	Kuniyuki Iwashima, Neal Cardwell, Paolo Abeni, Sasha Levin

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

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

From: Qingfang Deng <qingfang.deng@linux.dev>

[ Upstream commit 57889a8f6d49fc153aa0017d13086ab736567f8a ]

TCP_FASTOPEN_CONNECT can return from connect() before tcp_connect_init()
when a cached cookie or cookieless Fast Open allows deferring the SYN.
At this point write_seq contains the initial sequence number, while
snd_una and snd_nxt have not been initialized to that sequence number.

Consequently, inet_diag and /proc/net/tcp{,6} report the initial
sequence number as the send queue length despite no SYN or payload being
queued.

Initialize snd_una and snd_nxt to write_seq before marking the
connection as deferred. Both sequence-based queue lengths then remain
zero until the first write starts the connection and runs
tcp_connect_init().

Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20261102035943.9700-1-qingfang.deng@linux.dev
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/tcp_fastopen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
index e40477b6b5549..b621c48a52314 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -543,6 +543,8 @@ bool tcp_fastopen_defer_connect(struct sock *sk, int *err)
 
 	if (tp->fastopen_connect && !tp->fastopen_req) {
 		if (tcp_fastopen_cookie_check(sk, &mss, &cookie)) {
+			WRITE_ONCE(tp->snd_una, tp->write_seq);
+			WRITE_ONCE(tp->snd_nxt, tp->write_seq);
 			inet_set_bit(DEFER_CONNECT, sk);
 			return true;
 		}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0314/1005] netfilter: nft_set_rbtree: check catchall_sync return before queue_done
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (312 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0313/1005] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0315/1005] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
                   ` (59 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Xingyuan Mo, Pablo Neira Ayuso,
	Sasha Levin

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

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

From: Xingyuan Mo <hdthky0@gmail.com>

[ Upstream commit 1cec19d70bc282a8e7f7c42697d44046f60dc506 ]

nft_rbtree_gc_queue() passes the result of nft_trans_gc_catchall_sync()
straight to nft_trans_gc_queue_sync_done(). When the catchall path flushes
a full GC batch and nft_trans_gc_alloc() fails, catchall_sync returns
NULL and queue_sync_done dereferences trans->net (NULL+0x10). Guard the
call like the pipapo GC path already does.

Fixes: 7d259f021aaa ("netfilter: nft_set_rbtree: prefer sync gc to async worker")
Assisted-by: opencode:deepseek-v4
Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nft_set_rbtree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
index fbe1750f1ca23..9d685899da701 100644
--- a/net/netfilter/nft_set_rbtree.c
+++ b/net/netfilter/nft_set_rbtree.c
@@ -953,7 +953,8 @@ static void nft_rbtree_gc_queue(struct nft_set *set)
 	}
 
 	gc = nft_trans_gc_catchall_sync(gc);
-	nft_trans_gc_queue_sync_done(gc);
+	if (gc)
+		nft_trans_gc_queue_sync_done(gc);
 }
 
 static u64 nft_rbtree_privsize(const struct nlattr * const nla[],
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0315/1005] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (313 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0314/1005] netfilter: nft_set_rbtree: check catchall_sync return before queue_done Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0316/1005] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
                   ` (58 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Laveesh Bansal, Pablo Neira Ayuso,
	Sasha Levin

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

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

From: Laveesh Bansal <laveeshb@laveeshbansal.com>

[ Upstream commit 683ff28ab18accb25268741a724645eee839d41a ]

nf_ct_bridge_refrag() warns when skb->protocol is neither IPv4 nor IPv6.
A vlan filtering bridge can get there with a vlan ethertype: if the
protocol of the tag of a frame differs from the vlan_protocol of the
bridge, br_allowed_ingress() moves the tag back into the packet after
NF_BR_PRE_ROUTING, where bridge conntrack has already defragmented it.

Anyone who can send fragments into a port of such a bridge can trigger the
warning, which takes the machine down with panic_on_warn. The packet is
dropped either way, so only warn on kernels built with CONFIG_DEBUG_NET.

This only avoids the warning. Such fragmented packets are still dropped.
syzbot reported the warning. It keeps triggering on CONFIG_DEBUG_NET
kernels until the vlan tag is handled, which is left for a follow-up:

  https://syzkaller.appspot.com/bug?extid=a8ba738fe2db6b4bb27f

Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system")
Assisted-by: LLM
Signed-off-by: Laveesh Bansal <laveeshb@laveeshbansal.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index b5444335b86f2..8c83dc05114ba 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -358,7 +358,7 @@ nf_ct_bridge_refrag(struct sk_buff *skb, const struct nf_hook_state *state,
 		nf_br_ip6_fragment(state->net, state->sk, skb, &data, output);
 		break;
 	default:
-		WARN_ON_ONCE(1);
+		DEBUG_NET_WARN_ON_ONCE(1);
 		return NF_DROP;
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0316/1005] netfilter: x_tables: check target name before accessing verdict
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (314 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0315/1005] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0317/1005] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
                   ` (57 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, VEGA, Fernando Fernandez Mancera,
	Pablo Neira Ayuso, Sasha Levin

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

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

From: Fernando Fernandez Mancera <fmancera@suse.de>

[ Upstream commit 364b200285bb2cc518e3c5efe6591951c05b8e01 ]

Non-standard targets may contain only struct xt_entry_target.
mark_source_chains() nevertheless reads the target as an
xt_standard_target before checking its name, potentially reading four
bytes beyond a header-only target.

Check that the target is standard before reading its verdict.
Non-standard targets remain handled as fallthrough rules.

See the following KASAN trace:

BUG: KASAN: slab-out-of-bounds in translate_table+0x1660/0x1a40 [ip6_tables]
Read of size 4 at addr ffff88800ed56ff8 by task rep/432

Call Trace:
 kasan_report+0xfa/0x120
 translate_table+0x1660/0x1a40 [ip6_tables]
 do_ip6t_set_ctl+0x667/0xa76 [ip6_tables]
 nf_setsockopt+0x77/0xd0
 do_sock_setsockopt+0x118/0x490
 __sys_setsockopt+0xe4/0x160
 __x64_sys_setsockopt+0xbd/0x190
 do_syscall_64+0xde/0x4f0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Allocated by task 432:
 kasan_save_stack+0x2f/0x50
 __kasan_kmalloc+0x7f/0x90
 __kvmalloc_node_noprof+0x1b1/0x5c0
 xt_alloc_table_info+0x3c/0xa0
 do_ip6t_set_ctl+0x5ee/0xa76 [ip6_tables]
 nf_setsockopt+0x77/0xd0
 do_sock_setsockopt+0x118/0x490
 __sys_setsockopt+0xe4/0x160
 __x64_sys_setsockopt+0xbd/0x190
 do_syscall_64+0xde/0x4f0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: VEGA <vega@nebusec.ai>
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/netfilter/arp_tables.c | 5 +++--
 net/ipv4/netfilter/ip_tables.c  | 5 +++--
 net/ipv6/netfilter/ip6_tables.c | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index db307fa49f3f6..8c5f7cf15045e 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -371,11 +371,12 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
 				e->counters.pcnt = pos;
 				pos += size;
 			} else {
-				int newpos = t->verdict;
+				int newpos;
 
 				if (strcmp(t->target.u.user.name,
 					   XT_STANDARD_TARGET) == 0 &&
-				    newpos >= 0) {
+				    t->verdict >= 0) {
+					newpos = t->verdict;
 					/* This a jump; chase it. */
 					if (!xt_find_jump_offset(offsets, newpos,
 								 newinfo->number))
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 809441cedcedc..b302bd77180a7 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -422,11 +422,12 @@ mark_source_chains(const struct xt_table_info *newinfo,
 				e->counters.pcnt = pos;
 				pos += size;
 			} else {
-				int newpos = t->verdict;
+				int newpos;
 
 				if (strcmp(t->target.u.user.name,
 					   XT_STANDARD_TARGET) == 0 &&
-				    newpos >= 0) {
+				    t->verdict >= 0) {
+					newpos = t->verdict;
 					/* This a jump; chase it. */
 					if (!xt_find_jump_offset(offsets, newpos,
 								 newinfo->number))
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 313c4aac377aa..010baaa606657 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -440,11 +440,12 @@ mark_source_chains(const struct xt_table_info *newinfo,
 				e->counters.pcnt = pos;
 				pos += size;
 			} else {
-				int newpos = t->verdict;
+				int newpos;
 
 				if (strcmp(t->target.u.user.name,
 					   XT_STANDARD_TARGET) == 0 &&
-				    newpos >= 0) {
+				    t->verdict >= 0) {
+					newpos = t->verdict;
 					/* This a jump; chase it. */
 					if (!xt_find_jump_offset(offsets, newpos,
 								 newinfo->number))
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0317/1005] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (315 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0316/1005] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0318/1005] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
                   ` (56 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
	Fernando Fernandez Mancera, Pablo Neira Ayuso, Sasha Levin

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

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

From: Joas Antonio dos Santos <joasantonio108@gmail.com>

[ Upstream commit 7af52bda65c0bbbf40894aa3df36ac1bb5697984 ]

ct_sip_parse_transport() compares the value of the "transport=" header
parameter against "TCP"/"UDP" with strncasecmp(..., 3), but it never
checks that the parsed value is at least 3 bytes long.

ct_sip_parse_param() returns matchlen = end - start, where end is the
next ';' or, when there is no ';', the end of the payload buffer
(limit = dptr + datalen).  If the "transport=" value is only 1 or 2
bytes long and runs exactly to the end of the payload (e.g. a REGISTER
request whose Contact header ends in ";transport=T" with no trailing
CRLF), matchlen is less than 3 while strncasecmp() still reads up to 3
bytes, reading 1-2 bytes past the end of the linearized skb data.

Add a matchlen check before the comparison, mirroring the
sdp_media_type() pattern a few lines below, so short values cannot reach
strncasecmp().

The bug was found by LLM-assisted manual review of the SIP helper's
parsers and confirmed with a userspace ASan harness built from the
verbatim parser functions, which reports a heap-buffer-overflow read of
size 2 in strncasecmp() called from ct_sip_parse_transport().

Fixes: ea45f12a2766d ("[NETFILTER]: nf_conntrack_sip: parse SIP headers properly")
Link: https://patch.msgid.link/20260815133104.50369-1-joasantonio108@gmail.com/
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_conntrack_sip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 64bc440b1181f..b05dc8858d094 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -701,9 +701,9 @@ static int ct_sip_parse_transport(struct nf_conn *ct, const char *dptr,
 
 	if (ct_sip_parse_param(ct, dptr, dataoff, datalen, "transport=",
 			       &matchoff, &matchlen)) {
-		if (!strncasecmp(dptr + matchoff, "TCP", strlen("TCP")))
+		if (matchlen >= 3 && !strncasecmp(dptr + matchoff, "TCP", 3))
 			*proto = IPPROTO_TCP;
-		else if (!strncasecmp(dptr + matchoff, "UDP", strlen("UDP")))
+		else if (matchlen >= 3 && !strncasecmp(dptr + matchoff, "UDP", 3))
 			*proto = IPPROTO_UDP;
 		else
 			return 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0318/1005] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (316 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0317/1005] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0319/1005] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
                   ` (55 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Xingyuan Mo, Pablo Neira Ayuso,
	Sasha Levin

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

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

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit e95b3be75ae0652d40a48a210f0cf5197b3b3783 ]

Allocate flow rule object after transaction has been allocation and rule
deactivation has been performed, otherwise memleak is possible.  Let the
transaction unwind the existing rule deactivation from the abort path,
this needs to update nft_flow_rule_destroy() to skip release if
flow_rule is null.

While at this, remove check for non-null flow_rule in newrule error path
now that nft_flow_rule_destroy() is skipped if flow_rule is null.

Fixes: 63b48c73ff56 ("netfilter: nf_tables_offload: undo updates if transaction fails")
Reported-by: Xingyuan Mo <hdthky0@gmail.com>
Link: https://patch.msgid.link/20261028062204.1079089-1-hdthky0@gmail.com/
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_tables_api.c     | 21 +++++++++------------
 net/netfilter/nf_tables_offload.c |  3 +++
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index b59628e6240c1..1322f37b96359 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -760,16 +760,6 @@ static int nft_delrule(struct nft_ctx *ctx, struct nft_rule *rule)
 	if (trans == NULL)
 		return -ENOMEM;
 
-	if (ctx->chain->flags & NFT_CHAIN_HW_OFFLOAD) {
-		flow = nft_flow_rule_create(ctx->net, rule);
-		if (IS_ERR(flow)) {
-			nft_trans_destroy(trans);
-			return PTR_ERR(flow);
-		}
-
-		nft_trans_flow_rule(trans) = flow;
-	}
-
 	err = nf_tables_delrule_deactivate(ctx, rule);
 	if (err < 0) {
 		nft_trans_destroy(trans);
@@ -777,6 +767,14 @@ static int nft_delrule(struct nft_ctx *ctx, struct nft_rule *rule)
 	}
 	nft_rule_expr_deactivate(ctx, rule, NFT_TRANS_PREPARE);
 
+	if (ctx->chain->flags & NFT_CHAIN_HW_OFFLOAD) {
+		flow = nft_flow_rule_create(ctx->net, rule);
+		if (IS_ERR(flow))
+			return PTR_ERR(flow);
+
+		nft_trans_flow_rule(trans) = flow;
+	}
+
 	return 0;
 }
 
@@ -4536,8 +4534,7 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info,
 err_destroy_flow_rule:
 	nft_use_dec_restore(&chain->use);
 err_destroy_flow:
-	if (flow)
-		nft_flow_rule_destroy(flow);
+	nft_flow_rule_destroy(flow);
 err_release_rule:
 	nft_rule_expr_deactivate(&ctx, rule, NFT_TRANS_PREPARE_ERROR);
 	nf_tables_rule_destroy(&ctx, rule);
diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
index 0ac3c26dfb3d1..48b9e58e0c44f 100644
--- a/net/netfilter/nf_tables_offload.c
+++ b/net/netfilter/nf_tables_offload.c
@@ -148,6 +148,9 @@ void nft_flow_rule_destroy(struct nft_flow_rule *flow)
 	struct flow_action_entry *entry;
 	int i;
 
+	if (!flow)
+		return;
+
 	flow_action_for_each(i, entry, &flow->rule->action) {
 		switch (entry->id) {
 		case FLOW_ACTION_REDIRECT:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0319/1005] netfilter: nat: zero newrange before filling it in
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (317 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0318/1005] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0320/1005] gpio: regmap: free the irqchip if adding the irq domain fails Greg Kroah-Hartman
                   ` (54 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Westphal, Pablo Neira Ayuso,
	Sasha Levin

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

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

From: Florian Westphal <fw@strlen.de>

[ Upstream commit d1bb235aa409a4e5aeba6c748d953d948625b1e9 ]

nf_nat_masquerade_ipv4(), nf_nat_masquerade_ipv6(), netmap_tg4() and
netmap_tg6() each build a stack-local struct nf_nat_range2 from the
caller-supplied range, inheriting range->flags unmodified. Two of them
only memset() the min_addr/max_addr members, the other two don't
memset() anything at all, so newrange.base_proto is left as stack
garbage.

If the inherited flags include NF_NAT_RANGE_PROTO_OFFSET,
nf_nat_l4proto_unique_tuple() reads range->base_proto.all to compute
the NAT port offset. Neither the NETMAP nor the MASQUERADE targets
mask the flags field in their checkentry callback, so this
uninitialized stack value can end up feeding the NAT port selection.

The per-member memset()s are not enough: they have to enumerate every
field that must be cleared, and base_proto was missed when
NF_NAT_RANGE_PROTO_OFFSET/base_proto was added to the struct. memset()
the whole struct instead, so every member is covered regardless of
which ones get explicitly assigned afterwards.

There are other places that miss this, but those hardcode .flags so
nat core won't read from the uninitialized fields.

C99 initializers would be preferrable, but this is a more intrusive
change.  Lets followup in nf-next and convert others as well.

This is an LLM finding.

Fixes: 2eb0f624b709 ("netfilter: add NAT support for shifted portmap ranges")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_nat_masquerade.c | 4 ++--
 net/netfilter/xt_NETMAP.c         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nf_nat_masquerade.c b/net/netfilter/nf_nat_masquerade.c
index 4de6e0a517015..c2a85bd84af13 100644
--- a/net/netfilter/nf_nat_masquerade.c
+++ b/net/netfilter/nf_nat_masquerade.c
@@ -62,8 +62,7 @@ nf_nat_masquerade_ipv4(struct sk_buff *skb, unsigned int hooknum,
 		nat->masq_index = out->ifindex;
 
 	/* Transfer from original range. */
-	memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
-	memset(&newrange.max_addr, 0, sizeof(newrange.max_addr));
+	memset(&newrange, 0, sizeof(newrange));
 	newrange.flags       = range->flags | NF_NAT_RANGE_MAP_IPS;
 	newrange.min_addr.ip = newsrc;
 	newrange.max_addr.ip = newsrc;
@@ -242,6 +241,7 @@ nf_nat_masquerade_ipv6(struct sk_buff *skb, const struct nf_nat_range2 *range,
 	if (nat)
 		nat->masq_index = out->ifindex;
 
+	memset(&newrange, 0, sizeof(newrange));
 	newrange.flags		= range->flags | NF_NAT_RANGE_MAP_IPS;
 	newrange.min_addr.in6	= src;
 	newrange.max_addr.in6	= src;
diff --git a/net/netfilter/xt_NETMAP.c b/net/netfilter/xt_NETMAP.c
index 7da065a472e0e..8bcb3f716d68a 100644
--- a/net/netfilter/xt_NETMAP.c
+++ b/net/netfilter/xt_NETMAP.c
@@ -44,6 +44,7 @@ netmap_tg6(struct sk_buff *skb, const struct xt_action_param *par)
 				   netmask.ip6[i];
 	}
 
+	memset(&newrange, 0, sizeof(newrange));
 	newrange.flags	= range->flags | NF_NAT_RANGE_MAP_IPS;
 	newrange.min_addr	= new_addr;
 	newrange.max_addr	= new_addr;
@@ -91,8 +92,7 @@ netmap_tg4(struct sk_buff *skb, const struct xt_action_param *par)
 		new_ip = ip_hdr(skb)->saddr & ~netmask;
 	new_ip |= mr->range[0].min_ip & netmask;
 
-	memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
-	memset(&newrange.max_addr, 0, sizeof(newrange.max_addr));
+	memset(&newrange, 0, sizeof(newrange));
 	newrange.flags	     = mr->range[0].flags | NF_NAT_RANGE_MAP_IPS;
 	newrange.min_addr.ip = new_ip;
 	newrange.max_addr.ip = new_ip;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0320/1005] gpio: regmap: free the irqchip if adding the irq domain fails
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (318 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0319/1005] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0321/1005] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
                   ` (53 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Michael Walle, Long Zhao,
	Linus Walleij, Bartosz Golaszewski, Sasha Levin

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

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

From: Long Zhao <longzhao@ambarella.com>

[ Upstream commit 80415a6ff295b03dab98ef55598c72be66945d82 ]

gpio_regmap_register() creates a regmap irqchip and then calls
gpiochip_irqchip_add_domain(). If that call fails, the error path
only removes the gpiochip, so the irqchip and its domain leak.

Free the irqchip there when this function allocated it. An external
irq domain is not affected: irq_chip_data stays NULL and the caller
owns that domain.

Fixes: 553b75d4bfe9 ("gpio: regmap: Allow to allocate regmap-irq device")
Cc: Michael Walle <mwalle@kernel.org>
Signed-off-by: Long Zhao <longzhao@ambarella.com>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261103-gpio-regmap-irqchip-leak-v1-1-d038a20840f7@ambarella.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-regmap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index fb21396e1d024..3b9ce1ac55564 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -504,6 +504,11 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
 
 err_remove_gpiochip:
 	gpiochip_remove(chip);
+
+#ifdef CONFIG_REGMAP_IRQ
+	if (gpio->irq_chip_data)
+		regmap_del_irq_chip(gpio->regmap_irq_line, gpio->irq_chip_data);
+#endif
 err_free_bitmap_output:
 	bitmap_free(gpio->fixed_direction_output);
 err_free_bitmap_dirmask:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0321/1005] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (319 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0320/1005] gpio: regmap: free the irqchip if adding the irq domain fails Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0322/1005] MIPS: SGI-IP27: print the NMI dump on an nbcon console Greg Kroah-Hartman
                   ` (52 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Eric Dumazet, Hangbin Liu,
	Jiayuan Chen, Kuniyuki Iwashima, Linkui Xiao, Paolo Abeni,
	Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit fafbc4051123d5459ea6950899cec08ed946e278 ]

ireq->ipv6_opt is only set by calipso_req_setattr(), when a CALIPSO
NetLabel mapping is configured.

Request socket migration (net.ipv4.tcp_migrate_req=1, or a
BPF_SK_REUSEPORT_SELECT_OR_MIGRATE program) clones the request
socket with inet_reqsk_clone(), so that the old request socket and
its clone share the same ipv6_opt, then reqsk_migrate_reset() clears
the pointer in the old one.

Another cpu holding a reference on the old request socket can still
be using these options, sending a SYNACK from tcp_v6_send_synack()
or creating a child in tcp_v6_syn_recv_sock(), when the clone
is freed. tcp_v6_reqsk_destructor() frees ipv6_opt with a plain
kfree(), leading to a use-after-free.

Both readers already run under RCU, like their IPv4 counterparts.
Use kfree_rcu() in tcp_v6_reqsk_destructor(), as commit e3f33b0a1d89
("ipv4: free inet_opt and ireq_opt after an RCU grace period") did
for ireq_opt.

Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179369559062.488856.15441115725436277776@kernel.org/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Tested-by: Linkui Xiao <xiaolinkui@kylinos.cn>
Link: https://patch.msgid.link/20261103090011.4128420-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/tcp_ipv6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 40025284b9110..ff2a7ce78073e 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -607,7 +607,7 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
 
 static void tcp_v6_reqsk_destructor(struct request_sock *req)
 {
-	kfree(inet_rsk(req)->ipv6_opt);
+	kfree_rcu(inet_rsk(req)->ipv6_opt, rcu);
 	consume_skb(inet_rsk(req)->pktopts);
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0322/1005] MIPS: SGI-IP27: print the NMI dump on an nbcon console
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (320 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0321/1005] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0323/1005] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
                   ` (51 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Imre Kaloz, John Ogness, Petr Mladek,
	Thomas Bogendoerfer, Sasha Levin

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

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

From: Imre Kaloz <kaloz@kernel.org>

[ Upstream commit b79147fb33c3b5713c005e763b00239ea14b552a ]

Since the 8250 console became nbcon, printk() in nmi_dump() only queues
records for a printer thread that never runs, as no CPU leaves the NMI
handler. Print from an emergency section and flush pending records
before the hub reset.

Fixes: d3539347022a ("serial: 8250: Switch to nbcon console, take 2")
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/sgi-ip27/ip27-nmi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
index fc2816398d0cf..c502982621e6b 100644
--- a/arch/mips/sgi-ip27/ip27-nmi.c
+++ b/arch/mips/sgi-ip27/ip27-nmi.c
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <linux/console.h>
 #include <linux/kernel.h>
 #include <linux/mmzone.h>
 #include <linux/nodemask.h>
@@ -183,6 +184,12 @@ static void nmi_dump(void)
 	 */
 	arch_spin_lock(&nmi_lock);
 
+	/*
+	 * No CPU leaves the NMI handler before the hub reset below, so an
+	 * nbcon console's printer thread would never print the dump.
+	 */
+	nbcon_cpu_emergency_enter();
+
 #ifdef REAL_NMI_SIGNAL
 	/*
 	 * Wait up to 15 seconds for the other cpus to respond to the NMI.
@@ -227,5 +234,6 @@ static void nmi_dump(void)
 	 * Save the nmi cpu registers for all cpu in the eframe format.
 	 */
 	nmi_eframes_save();
+	printk_trigger_flush();
 	LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET);
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0323/1005] MIPS: Avoid dead code/data elimination when using recordmcount
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (321 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0322/1005] MIPS: SGI-IP27: print the NMI dump on an nbcon console Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0324/1005] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC Greg Kroah-Hartman
                   ` (50 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Rosen Penev, Thomas Bogendoerfer,
	Sasha Levin

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

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

From: Rosen Penev <rosenp@gmail.com>

[ Upstream commit 255d9dbd936f7db8b963e82429f6e57cd9d48999 ]

CONFIG_LD_DEAD_CODE_DATA_ELIMINATION builds with -ffunction-sections,
placing every function in its own section. recordmcount refuses to use
weak symbols as section bases, as a strong definition could override
them, so a weak function alone in its section, such as the generic
pcibios_fixup_bus() stub, breaks the build:

  Cannot find symbol for section 88: .text.pcibios_fixup_bus.
  drivers/pci/probe.o: failed

MIPS always records mcount locations with recordmcount, so this hits
any config with the function tracer and dead code elimination enabled,
e.g. malta_defconfig built with LLVM=1.

Only offer dead code elimination when recordmcount is not used, as
powerpc does since commit f8b2336f15f3 ("powerpc: Avoid dead code/data
elimination when using recordmcount"). In practice this makes it
unavailable together with the function tracer on MIPS.

Fixes: c0436b503591 ("MIPS: Enable dead code elimination")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d7c67cebe065f..5538c8ef82250 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -79,7 +79,7 @@ config MIPS
 	select HAVE_IRQ_TIME_ACCOUNTING
 	select HAVE_KPROBES
 	select HAVE_KRETPROBES
-	select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
+	select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !FTRACE_MCOUNT_USE_RECORDMCOUNT
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI
 	select HAVE_PAGE_SIZE_4KB if !CPU_LOONGSON2EF && !CPU_LOONGSON64
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0324/1005] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (322 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0323/1005] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0325/1005] MIPS: Alchemy: Register interrupt chips with the IRQ core Greg Kroah-Hartman
                   ` (49 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Imre Kaloz, Thomas Bogendoerfer,
	Sasha Levin

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

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

From: Imre Kaloz <kaloz@kernel.org>

[ Upstream commit c9c0d267002029a5bf97ee50e6b11b4d16808aca ]

The Bridge probe reads its part number from the 1-wire PROM and defers
until the SGI 1-wire master and DS250x slave are present, so without
them there is no PCI bus and no serial console.

The IP30 RTC is a DS1685-family part, but the defconfig, derived from
ip27_defconfig, has the M48T35 driver, so there is no RTC.

Enable the 1-wire drivers and select the DS1685 family.

Also drop four lines that savedefconfig removes, as CRYPTO_CAMELLIA,
CRYPTO_CTS and CRYPTO_HMAC are selected built-in and IPV6_SIT=m is the
default.

Fixes: bb2d63500b5c ("MIPS: config: Add ip30_defconfig")
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/configs/ip30_defconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/mips/configs/ip30_defconfig b/arch/mips/configs/ip30_defconfig
index 93eb90efe06ea..a8b1a492f20c9 100644
--- a/arch/mips/configs/ip30_defconfig
+++ b/arch/mips/configs/ip30_defconfig
@@ -40,7 +40,6 @@ CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_MIP6=m
-CONFIG_IPV6_SIT=m
 CONFIG_IPV6_SIT_6RD=y
 CONFIG_IPV6_TUNNEL=m
 CONFIG_IPV6_MULTIPLE_TABLES=y
@@ -129,11 +128,14 @@ CONFIG_SERIAL_8250_IOC3=y
 CONFIG_NOZOMI=m
 CONFIG_HW_RANDOM_TIMERIOMEM=m
 # CONFIG_PTP_1588_CLOCK is not set
+CONFIG_W1=y
+CONFIG_W1_MASTER_SGI=y
+CONFIG_W1_SLAVE_DS250X=y
 # CONFIG_HWMON is not set
 CONFIG_THERMAL=y
 CONFIG_SGI_MFD_IOC3=y
 CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_M48T35=y
+CONFIG_RTC_DRV_DS1685_FAMILY=y
 CONFIG_UIO=y
 CONFIG_UIO_AEC=m
 CONFIG_UIO_SERCOS3=m
@@ -162,15 +164,12 @@ CONFIG_NFS_FS=y
 CONFIG_SECURITYFS=y
 CONFIG_CRYPTO_CRYPTD=m
 CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_CAMELLIA=m
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_CTS=m
 CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_WP512=m
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0325/1005] MIPS: Alchemy: Register interrupt chips with the IRQ core
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (323 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0324/1005] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0326/1005] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
                   ` (48 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Dmitry Ilvokhin,
	Thomas Bogendoerfer, Sasha Levin

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

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

From: Florian Fainelli <f.fainelli@gmail.com>

[ Upstream commit dd722e605bd6b5ac593475ad2ed76cd9d27cb2ef ]

Alchemy initializes its interrupt chips through the set-type callbacks,
which use irq_set_chip_handler_name_locked() to assign the chip and flow
handler. This bypasses irq_set_chip() and its descriptor registration.

Since /proc/interrupts switched to iterating the IRQ descriptor maple tree,
the statically allocated Alchemy descriptors are no longer found. On an
MTX-1, the file contains only the CPU header and ERR counter even though
the timer, serial, Ethernet and PCI wireless interrupts work.

Register each IC0/IC1 interrupt chip through irq_set_chip() before setting
the initial trigger type. Do the same for the Au1300 GPIC. Keep the locked
set-type callbacks for later trigger changes.

Fixes: 171cc0d9eed1 ("genirq/proc: Speed up /proc/interrupts iteration")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Dmitry Ilvokhin <d@ilvokhin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/alchemy/common/irq.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/mips/alchemy/common/irq.c b/arch/mips/alchemy/common/irq.c
index 2403afcd2fb95..d2fa8731fb3c0 100644
--- a/arch/mips/alchemy/common/irq.c
+++ b/arch/mips/alchemy/common/irq.c
@@ -892,15 +892,21 @@ static void __init au1000_init_irq(struct alchemy_irqmap *map)
 	mips_cpu_irq_init();
 
 	/* register all 64 possible IC0+IC1 irq sources as type "none".
+	 * Register each chip with the IRQ core before setting its type so
+	 * the descriptors are included in interrupt enumeration.
 	 * Use set_irq_type() to set edge/level behaviour at runtime.
 	 */
 	for (irq_nr = AU1000_INTC0_INT_BASE;
-	     (irq_nr < AU1000_INTC0_INT_BASE + 32); irq_nr++)
+	     (irq_nr < AU1000_INTC0_INT_BASE + 32); irq_nr++) {
+		irq_set_chip(irq_nr, &au1x_ic0_chip);
 		au1x_ic_settype(irq_get_irq_data(irq_nr), IRQ_TYPE_NONE);
+	}
 
 	for (irq_nr = AU1000_INTC1_INT_BASE;
-	     (irq_nr < AU1000_INTC1_INT_BASE + 32); irq_nr++)
+	     (irq_nr < AU1000_INTC1_INT_BASE + 32); irq_nr++) {
+		irq_set_chip(irq_nr, &au1x_ic1_chip);
 		au1x_ic_settype(irq_get_irq_data(irq_nr), IRQ_TYPE_NONE);
+	}
 
 	/*
 	 * Initialize IC0, which is fixed per processor.
@@ -947,6 +953,7 @@ static void __init alchemy_gpic_init_irq(const struct alchemy_irqmap *dints)
 
 	/* register an irq_chip for them, with 2nd highest priority */
 	for (i = ALCHEMY_GPIC_INT_BASE; i <= ALCHEMY_GPIC_INT_LAST; i++) {
+		irq_set_chip(i, &au1300_gpic);
 		au1300_set_irq_priority(i, 1);
 		au1300_gpic_settype(irq_get_irq_data(i), IRQ_TYPE_NONE);
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0326/1005] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (324 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0325/1005] MIPS: Alchemy: Register interrupt chips with the IRQ core Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0327/1005] MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window Greg Kroah-Hartman
                   ` (47 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Fainelli,
	Thomas Bogendoerfer, Sasha Levin

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

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

From: Florian Fainelli <f.fainelli@gmail.com>

[ Upstream commit 792ac17faa0503448f3ef85b49f16456ac54ab84 ]

Alchemy keeps pointers into the firmware environment and looks up ethaddr
when initializing the Ethernet devices. By that point, memory allocation
can have overwritten the environment, causing prom_getenv() to pass an
invalid pointer to strchr() and panic during boot.

On the MTX-1, the struct page layout change in 9ddb3c14afba reduces struct
page from 40 to 32 bytes and exposes this unreserved firmware memory.
Bisection and boot tests confirmed that the parent boots while the change
reproduces the panic.

Parse the Ethernet address during prom_init(), before registering RAM
with memblock, and keep the six bytes in kernel-owned init data. Return
the saved address during device initialization, preserving the existing
YAMON formats and command-line fallback without reserving a fixed
low-memory region.

Fixes: b93ddc4f9156 ("mips: Reserve memory for the kernel image resources")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/alchemy/common/prom.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/mips/alchemy/common/prom.c b/arch/mips/alchemy/common/prom.c
index 20d30f6265cdc..c4aefeb788715 100644
--- a/arch/mips/alchemy/common/prom.c
+++ b/arch/mips/alchemy/common/prom.c
@@ -46,6 +46,11 @@ int prom_argc;
 char **prom_argv;
 char **prom_envp;
 
+static char prom_ethaddr[6] __initdata;
+static bool prom_ethaddr_valid __initdata;
+
+static void __init prom_init_ethernet_addr(void);
+
 void __init prom_init_cmdline(void)
 {
 	int i;
@@ -95,6 +100,9 @@ void __init prom_init(void)
 	if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
 		memsize = SZ_64M; /* minimum memsize is 64MB RAM */
 
+	/* Save the MAC before the allocator can reuse the PROM environment. */
+	prom_init_ethernet_addr();
+
 	memblock_add(0, memsize);
 }
 
@@ -125,7 +133,7 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str)
 	}
 }
 
-int __init prom_get_ethernet_addr(char *ethernet_addr)
+static void __init prom_init_ethernet_addr(void)
 {
 	char *ethaddr_str;
 
@@ -135,12 +143,21 @@ int __init prom_get_ethernet_addr(char *ethernet_addr)
 		/* Check command line */
 		ethaddr_str = strstr(arcs_cmdline, "ethaddr=");
 		if (!ethaddr_str)
-			return -1;
+			return;
 
 		ethaddr_str += strlen("ethaddr=");
 	}
 
-	str2eaddr(ethernet_addr, ethaddr_str);
+	str2eaddr(prom_ethaddr, ethaddr_str);
+	prom_ethaddr_valid = true;
+}
+
+int __init prom_get_ethernet_addr(char *ethernet_addr)
+{
+	if (!prom_ethaddr_valid)
+		return -1;
+
+	memcpy(ethernet_addr, prom_ethaddr, sizeof(prom_ethaddr));
 
 	return 0;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0327/1005] MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (325 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0326/1005] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0328/1005] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
                   ` (46 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Maciej W. Rozycki,
	Thomas Bogendoerfer, Sasha Levin

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

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

From: Florian Fainelli <f.fainelli@gmail.com>

[ Upstream commit ff209a7294988aac52b2522b1d0d7349da4541ec ]

The Cobalt PCI I/O window starts at 0x1000, excluding the VIA IDE
controller's fixed compatibility-mode ports at 0x170, 0x1f0, 0x376 and
0x3f6. Since pcibios_enable_device() was converted to
pci_enable_resources(), these unclaimed resources cause pata_via to
fail to probe with -EINVAL.

Start the PCI I/O window at zero to cover the southbridge legacy ports,
retaining 0x1000 as the allocation minimum via PCIBIOS_MIN_IO. Register
the PCI controller from plat_mem_setup(), before the VIA reservations
and i8259 initialization, so the legacy resources do not conflict with
the host bridge window and prevent PCI bus scanning.

Keep the VIA resource reservations in plat_mem_setup() after the PCI
controller registration and use insert_resource() to nest them beneath
the PCI window. The i8259 and RTC resources are also claimed beneath it.

Boot-tested on a Qube2 with a MIPS64 kernel. All seven PCI functions
enumerate, both tulip devices bind, and pata_via initializes both ATA
hosts and detects the ST380012A 80 GB disk. All 18 boot checks pass,
including a read-only disk test and Ethernet ping.

Fixes: ae81aad5c2e1 ("MIPS: PCI: Use pci_enable_resources()")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/cobalt/pci.c                     | 11 +++++------
 arch/mips/cobalt/setup.c                   |  4 +++-
 arch/mips/include/asm/mach-cobalt/cobalt.h |  1 +
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/mips/cobalt/pci.c b/arch/mips/cobalt/pci.c
index 85ec9cc31d666..29fd052766b2a 100644
--- a/arch/mips/cobalt/pci.c
+++ b/arch/mips/cobalt/pci.c
@@ -14,6 +14,8 @@
 
 #include <asm/gt64120.h>
 
+#include <cobalt.h>
+
 extern struct pci_ops gt64xxx_pci0_ops;
 
 static struct resource cobalt_mem_resource = {
@@ -24,7 +26,7 @@ static struct resource cobalt_mem_resource = {
 };
 
 static struct resource cobalt_io_resource = {
-	.start	= 0x1000,
+	.start	= 0,
 	.end	= 0xffffffUL,
 	.name	= "PCI I/O",
 	.flags	= IORESOURCE_IO,
@@ -38,11 +40,8 @@ static struct pci_controller cobalt_pci_controller = {
 	.io_map_base	= CKSEG1ADDR(GT_DEF_PCI0_IO_BASE),
 };
 
-static int __init cobalt_pci_init(void)
+void __init cobalt_pci_init(void)
 {
+	PCIBIOS_MIN_IO = 0x1000;
 	register_pci_controller(&cobalt_pci_controller);
-
-	return 0;
 }
-
-arch_initcall(cobalt_pci_init);
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index 9a266bf783399..502acc92969b8 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -83,9 +83,11 @@ void __init plat_mem_setup(void)
 	/* I/O port resource */
 	ioport_resource.end = 0x01ffffff;
 
+	cobalt_pci_init();
+
 	/* These resources have been reserved by VIA SuperI/O chip. */
 	for (i = 0; i < ARRAY_SIZE(cobalt_reserved_resources); i++)
-		request_resource(&ioport_resource, cobalt_reserved_resources + i);
+		insert_resource(&ioport_resource, cobalt_reserved_resources + i);
 }
 
 /*
diff --git a/arch/mips/include/asm/mach-cobalt/cobalt.h b/arch/mips/include/asm/mach-cobalt/cobalt.h
index 97f9d5e9446d2..c7a8607cd651a 100644
--- a/arch/mips/include/asm/mach-cobalt/cobalt.h
+++ b/arch/mips/include/asm/mach-cobalt/cobalt.h
@@ -19,6 +19,7 @@ extern int cobalt_board_id;
 #define COBALT_BRD_ID_QUBE2    0x5
 #define COBALT_BRD_ID_RAQ2     0x6
 
+void cobalt_pci_init(void);
 void cobalt_machine_halt(void);
 void cobalt_machine_restart(char *command);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0328/1005] MIPS: SB1250: Validate and update IRQ affinity
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (326 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0327/1005] MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0329/1005] libfs: walk offset directories in offset order Greg Kroah-Hartman
                   ` (45 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Fainelli,
	Thomas Bogendoerfer, Sasha Levin

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

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

From: Florian Fainelli <f.fainelli@gmail.com>

[ Upstream commit 456c965ca46c59a4a241c755e6565fd883a522f4 ]

sb1250_set_affinity() selects the first online CPU in the requested
affinity mask without checking whether such a CPU exists. If the
intersection is empty, the resulting CPU index is invalid and must
not be passed to cpu_logical_map().

Reject affinity masks containing no online CPU with -EINVAL before
accessing the CPU mapping or interrupt mapper registers.

Also update the effective affinity mask to reflect the single logical
CPU selected as the interrupt target.

Fixes: 421d1563c662 ("mips: Validate online cpus in irq_set_affinity() callbacks")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/sibyte/sb1250/irq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 2f08ad267a11e..d7a656cd7ec0c 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -76,6 +76,8 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask,
 	unsigned long flags;
 
 	i = cpumask_first_and(mask, cpu_online_mask);
+	if (i >= nr_cpu_ids)
+		return -EINVAL;
 
 	/* Convert logical CPU to physical CPU */
 	cpu = cpu_logical_map(i);
@@ -103,6 +105,7 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask,
 		____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) +
 					R_IMR_INTERRUPT_MASK));
 	}
+	irq_data_update_effective_affinity(d, cpumask_of(i));
 	raw_spin_unlock_irqrestore(&sb1250_imr_lock, flags);
 
 	return 0;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0329/1005] libfs: walk offset directories in offset order
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (327 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0328/1005] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0330/1005] libfs: end offset readdir at positions past DIR_OFFSET_EOD Greg Kroah-Hartman
                   ` (44 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nickolai Zeldovich, Chuck Lever,
	Christian Brauner (Amutable), Sasha Levin

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

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

From: Christian Brauner <brauner@kernel.org>

[ Upstream commit 309f7a5585aeaf77d3d7c27304ac97e515447dac ]

offset_iterate_dir() walks d_children from the head and only uses the
maple tree to map ctx->pos back to a dentry when a getdents64() call
resumes. offset_dir_lookup() finds the entry at ctx->pos, or the one
with the next lower offset if it is gone, and the list walk continues
from there.

That only works if list order and offset order agree and quite often
they don't. A rename over an existing name gives the moved dentry the
offset of the name it replaced but __d_move() puts it at the head of
d_children. RENAME_EXCHANGE does the same to both dentries. And once
the cyclic offset allocator wraps new entries get low offsets at the
head of the list.

So if the entry at ctx->pos is unlinked between two getdents64() calls
we resume at the entry with the next lower offset and that one can sit
anywhere in the list:

(1) If it sits further down the list everything in between is skipped.
    Create y, t, a, b and rename b over t. The list is now t(4) a(5)
    y(3). Stop the listing at t and unlink t. The next call resumes at
    y and a is never returned although nobody touched it.

(2) If there is no lower entry we restart at the head and return the
    whole directory again. Nickolai reported this for the simple case
    of unlinking the oldest entry while a listing is about to reach it.
    Ending the walk there instead turns this into (1): create a, b, c,
    rename c over a, stop the listing at the renamed entry, unlink it,
    and b is lost.

Instead of the list let's walk the maple tree itself in descending
offset order. Then ctx->pos really means that everything above it has
been emitted and resuming at the highest offset at or below it is right
no matter where the dentry sits in d_children. Entries created or
renamed to a new name after the listing started get an offset above
ctx->pos and aren't returned, same as with the list walk which never
went back to the head. So a readdir loop that renames or creates an
entry for each one it reads still terminates.

The maple tree can't change under us as all modifications happen with
the directory's i_rwsem held exclusive and offset_readdir() holds it
shared. That also covers the dentries in the tree. They are all
persistent and only unlink, rmdir and rename remove or rename them. And
since the previous patch i_rwsem is the lock of the tree. So keep a
single ma_state across the walk and emit directly from the dentry
without taking rcu_read_lock(), a reference or d_lock.

This also makes the walk cheaper than the list walk was. With a million
entries on tmpfs a getdents64() listing goes from 146ms to 114ms. With
four processes listing the directory at the same time it goes from
470ms to 113ms per listing as they don't bounce the parent's d_lock and
the dentries' lockrefs between them anymore.

                                                base     v2       this
      1M entries, getdents64 32k buffer (ms)    146      127      114
      1M entries, getdents64 1k buffer (ms)     184      156      141
      1M entries, getdents64 128b buffer (ms)   429      364      335
      1M entries, ls -f (s)                     0.259    0.239    0.228
      1M entries, LC_ALL=C ls (s)               0.482    0.467    0.455
      1M entries, 4 parallel listers (ms)       470      125      113
      18 entries, rewind and list (ns)          4107     3594     3323
      250k of 1M left, getdents64 32k (ms)      58.8     57.8     53.8
      250k of 1M left, getdents64 128b (ms)     128      114      108

Fixes: b9b588f22a0c ("libfs: Use d_children list to iterate simple_offset directories")
Fixes: f70681e9e606 ("libfs: Fix duplicate directory entry in offset_dir_lookup")
Reported-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Link: https://patch.msgid.link/20261018024549.798968-1-nickolai@csail.mit.edu
Link: https://patch.msgid.link/20261101-work-libfs-offset_readdir-v2-2-c621125b56d1@kernel.org
Reviewed-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/libfs.c | 85 ++++++++++++++----------------------------------------
 1 file changed, 22 insertions(+), 63 deletions(-)

diff --git a/fs/libfs.c b/fs/libfs.c
index 27d7dc16fcb0a..fa6cb2b012046 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -282,6 +282,12 @@ void simple_offset_init(struct offset_ctx *octx)
  * @octx: directory offset ctx to be updated
  * @dentry: new dentry being added
  *
+ * The offset map holds no reference to @dentry. Once positive, @dentry
+ * must be pinned with d_make_persistent() for as long as it is in the
+ * map, and entries may only be added, removed or renamed with the
+ * directory's i_rwsem held exclusive: offset_readdir() emits straight
+ * from the map under the shared lock.
+ *
  * Returns zero on success. @octx and the dentry's offset are updated.
  * Otherwise, a negative errno value is returned.
  */
@@ -446,51 +452,6 @@ static loff_t offset_dir_llseek(struct file *file, loff_t offset, int whence)
 	return vfs_setpos(file, offset, LONG_MAX);
 }
 
-static struct dentry *find_positive_dentry(struct dentry *parent,
-					   struct dentry *dentry,
-					   bool next)
-{
-	struct dentry *found = NULL;
-
-	spin_lock(&parent->d_lock);
-	if (next)
-		dentry = d_next_sibling(dentry);
-	else if (!dentry)
-		dentry = d_first_child(parent);
-	hlist_for_each_entry_from(dentry, d_sib) {
-		if (!simple_positive(dentry))
-			continue;
-		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
-		if (simple_positive(dentry))
-			found = dget_dlock(dentry);
-		spin_unlock(&dentry->d_lock);
-		if (likely(found))
-			break;
-	}
-	spin_unlock(&parent->d_lock);
-	return found;
-}
-
-static noinline_for_stack struct dentry *
-offset_dir_lookup(struct dentry *parent, loff_t offset)
-{
-	struct inode *inode = d_inode(parent);
-	struct offset_ctx *octx = inode->i_op->get_offset_ctx(inode);
-	struct dentry *child, *found = NULL;
-
-	MA_STATE(mas, &octx->mt, offset, offset);
-
-	if (offset == DIR_OFFSET_FIRST)
-		found = find_positive_dentry(parent, NULL, false);
-	else {
-		rcu_read_lock();
-		child = mas_find_rev(&mas, DIR_OFFSET_MIN);
-		found = find_positive_dentry(parent, child, false);
-		rcu_read_unlock();
-	}
-	return found;
-}
-
 static bool offset_dir_emit(struct dir_context *ctx, struct dentry *dentry)
 {
 	struct inode *inode = d_inode(dentry);
@@ -499,32 +460,30 @@ static bool offset_dir_emit(struct dir_context *ctx, struct dentry *dentry)
 			inode->i_ino, fs_umode_to_dtype(inode->i_mode));
 }
 
+/*
+ * Emit entries in descending offset order. The directory's i_rwsem is the
+ * lock of the offset tree and the persistent dentries in it only change
+ * with it held exclusive. We hold it shared, so @mas stays valid across
+ * dir_emit() and the dentries need no references.
+ */
 static void offset_iterate_dir(struct file *file, struct dir_context *ctx)
 {
-	struct dentry *dir = file->f_path.dentry;
+	struct inode *inode = file_inode(file);
+	struct offset_ctx *octx = inode->i_op->get_offset_ctx(inode);
+	loff_t start = ctx->pos == DIR_OFFSET_FIRST ? DIR_OFFSET_MAX : ctx->pos;
 	struct dentry *dentry;
 
-	dentry = offset_dir_lookup(dir, ctx->pos);
-	if (!dentry)
-		goto out_eod;
-	while (true) {
-		struct dentry *next;
+	MA_STATE(mas, &octx->mt, start, start);
 
+	for (;;) {
+		dentry = mas_find_rev(&mas, DIR_OFFSET_MIN);
+		if (!dentry)
+			break;
+		VFS_WARN_ON_ONCE(!(dentry->d_flags & DCACHE_PERSISTENT));
 		ctx->pos = dentry2offset(dentry);
 		if (!offset_dir_emit(ctx, dentry))
-			break;
-
-		next = find_positive_dentry(dir, dentry, true);
-		dput(dentry);
-
-		if (!next)
-			goto out_eod;
-		dentry = next;
+			return;
 	}
-	dput(dentry);
-	return;
-
-out_eod:
 	ctx->pos = DIR_OFFSET_EOD;
 }
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0330/1005] libfs: end offset readdir at positions past DIR_OFFSET_EOD
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (328 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0329/1005] libfs: walk offset directories in offset order Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0331/1005] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
                   ` (43 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chuck Lever,
	Christian Brauner (Amutable), Sasha Levin

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

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

From: Christian Brauner <brauner@kernel.org>

[ Upstream commit 45eb9737058fa78a73f17a5da55c8cb482c6d5bb ]

offset_dir_llseek() takes any position up to LONG_MAX but
offset_readdir() only skips the walk for DIR_OFFSET_EOD itself. For a
position past it mas_find_rev() starts the walk at the highest offset
in the directory. So an lseek() past the end makes the next
getdents64() return the whole directory again.

Before commit b9b588f22a0c ("libfs: Use d_children list to iterate
simple_offset directories") the walk went up from the position and
found nothing past the end, and dcache_readdir() returns nothing there
either. So only walk for positions below DIR_OFFSET_EOD.

Fixes: b9b588f22a0c ("libfs: Use d_children list to iterate simple_offset directories")
Link: https://patch.msgid.link/20261101-work-libfs-offset_readdir-v2-3-c621125b56d1@kernel.org
Reviewed-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/libfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/libfs.c b/fs/libfs.c
index fa6cb2b012046..b88a27815a85d 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -518,7 +518,7 @@ static int offset_readdir(struct file *file, struct dir_context *ctx)
 
 	if (!dir_emit_dots(file, ctx))
 		return 0;
-	if (ctx->pos != DIR_OFFSET_EOD)
+	if (ctx->pos < DIR_OFFSET_EOD)
 		offset_iterate_dir(file, ctx);
 	return 0;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0331/1005] initrd: flush deferred fput() before mounting root
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (329 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0330/1005] libfs: end offset readdir at positions past DIR_OFFSET_EOD Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0332/1005] iov_iter: take an unsigned long segment count in import_iovec() Greg Kroah-Hartman
                   ` (42 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Abbott Liu,
	Christian Brauner (Amutable), Sasha Levin

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

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

From: Abbott Liu <liuwenliang@huawei.com>

[ Upstream commit 807c1d7125a2b3ca5705a803aa2e19f9d53d1ea3 ]

Booting an old-style initrd, i.e. a filesystem image instead of a cpio
archive, with "root=/dev/ram rootfstype=squashfs" can fail to mount the
root filesystem:

    RAMDISK: squashfs filesystem found at block 0
    RAMDISK: Loading 68449KiB [1 disk] into ram disk... done.
    No filesystem could mount root, tried:
     squashfs
    Kernel panic - not syncing: VFS: Unable to mount root fs on
    "/dev/ram" or unknown-block(1,0)

rd_load_image() copies the image into /dev/ram with kernel_write() and
then drops the file with fput(). The data only reaches the ramdisk once
the final __fput() releases the block device and bdev_release() calls
sync_blockdev(). But that __fput() is deferred. Since commit
343f4c49f243 ("kthread: Don't allocate kthread_struct for init and
umh") init is a user mode task, so the __fput() is queued as task work
and only runs once init returns to userspace, i.e. long after
mount_root(). Before that it ran as delayed fput work at least a jiffy
later, which doesn't help either.

Whether the mount survives this depends on the block size. Squashfs
calls sb_min_blocksize() first and set_blocksize() syncs and drops the
page cache when the requested block size differs from the current one.
That hides the problem for most configurations. With
CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y and 4K pages both block sizes are 4K
because set_init_blocksize() gives a page-aligned ramdisk a PAGE_SIZE
block size on the first open. So set_blocksize() does nothing and
squashfs reads the superblock with bios that bypass the page cache. brd
has no page for that range yet and returns zeroes, so the magic check
fails and the mount returns -EINVAL. With rootfstype= naming a single
filesystem there is nothing left to retry and mount_root_generic()
panics.

Fixing this in squashfs would be the wrong end. Most block-backed
filesystems read their superblock or their file data with bios that
bypass the block device page cache, so they are exposed to the same
race, just less loudly.

So flush the deferred fput() in rd_load_image() right after dropping the
ramdisk file, the same way mount_root_generic() already does before it
retries with another filesystem type. All deferred closes at this point
belong to files the boot itself created.

Verified on arm64 QEMU with an openEuler Embedded rootfs image packed as
squashfs.

Fixes: 93e72b3c612a ("squashfs: migrate from ll_rw_block usage to BIO")
Signed-off-by: Abbott Liu <liuwenliang@huawei.com>
Link: https://patch.msgid.link/20260930084632.2965573-1-liuwenliang@huawei.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 init/do_mounts_rd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index 48bfab2fc62f9..448a734a0f625 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -258,6 +258,11 @@ int __init rd_load_image(void)
 	fput(in_file);
 noclose_input:
 	fput(out_file);
+	/*
+	 * The image only reaches the ramdisk when the deferred __fput()
+	 * syncs the block device. Flush it before mount_root() reads it.
+	 */
+	init_flush_fput();
 out:
 	kfree(buf);
 	init_unlink("/dev/ram");
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0332/1005] iov_iter: take an unsigned long segment count in import_iovec()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (330 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0331/1005] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0333/1005] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
                   ` (41 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Andrea Parri, Jan Kara,
	Christian Brauner (Amutable), Sasha Levin

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

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

From: Andrea Parri <parri.andrea@gmail.com>

[ Upstream commit 965e5e451146a19f69523fbcbc73d07e401a3775 ]

readv(), writev() and their positional variants, process_vm_readv(),
process_vm_writev(), vmsplice(), process_madvise(), vectored aio and
the btrfs encoded I/O ioctls all take a full-width segment count, and
all of them hand it to import_iovec() or __import_iovec().  Those take
an unsigned int count, so on 64-bit kernels the upper 32 bits are
dropped before iovec_from_user() checks the count against UIO_MAXIOV.

A count of 0x100000001 is therefore imported as one segment: writev()
on a pipe writes a byte and readv() reads it back, instead of both
failing with EINVAL.  A count of 0x100000000 returns 0 as an empty
vector.

import_iovec() was added with an unsigned int count, but the helper it
wrapped, rw_copy_check_uvector(), took an unsigned long, as does
iovec_from_user() today.  Until v4.1, readv(), writev(), preadv(),
pwritev(), process_vm_readv(), process_vm_writev() and vectored aio
therefore failed these counts with EINVAL, as did vmsplice() until
v4.18.

Widen nr_segs in both import helpers so the UIO_MAXIOV check sees the
count the caller passed.  Callers with 32-bit counts are unaffected.

AI assistance was used to find the bug, develop the fix, and run the
reproducers.

Fixes: bc917be81059 ("saner iov_iter initialization primitives")
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://patch.msgid.link/20261026180619.4147910-1-parri.andrea@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/uio.h | 8 ++++----
 lib/iov_iter.c      | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/uio.h b/include/linux/uio.h
index fe2e985d74d24..529c6cd53df7a 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -362,11 +362,11 @@ struct iovec *iovec_from_user(const struct iovec __user *uvector,
 		unsigned long nr_segs, unsigned long fast_segs,
 		struct iovec *fast_iov, bool compat);
 ssize_t import_iovec(int type, const struct iovec __user *uvec,
-		 unsigned nr_segs, unsigned fast_segs, struct iovec **iovp,
-		 struct iov_iter *i);
+		 unsigned long nr_segs, unsigned int fast_segs,
+		 struct iovec **iovp, struct iov_iter *i);
 ssize_t __import_iovec(int type, const struct iovec __user *uvec,
-		 unsigned nr_segs, unsigned fast_segs, struct iovec **iovp,
-		 struct iov_iter *i, bool compat);
+		 unsigned long nr_segs, unsigned int fast_segs,
+		 struct iovec **iovp, struct iov_iter *i, bool compat);
 int import_ubuf(int type, void __user *buf, size_t len, struct iov_iter *i);
 
 static inline void iov_iter_ubuf(struct iov_iter *i, unsigned int direction,
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 56c59a2b589d3..55c0dc7e10741 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1366,8 +1366,8 @@ static ssize_t __import_iovec_ubuf(int type, const struct iovec __user *uvec,
 }
 
 ssize_t __import_iovec(int type, const struct iovec __user *uvec,
-		 unsigned nr_segs, unsigned fast_segs, struct iovec **iovp,
-		 struct iov_iter *i, bool compat)
+		 unsigned long nr_segs, unsigned int fast_segs,
+		 struct iovec **iovp, struct iov_iter *i, bool compat)
 {
 	ssize_t total_len = 0;
 	unsigned long seg;
@@ -1438,7 +1438,7 @@ ssize_t __import_iovec(int type, const struct iovec __user *uvec,
  * Return: Negative error code on error, bytes imported on success
  */
 ssize_t import_iovec(int type, const struct iovec __user *uvec,
-		 unsigned nr_segs, unsigned fast_segs,
+		 unsigned long nr_segs, unsigned int fast_segs,
 		 struct iovec **iovp, struct iov_iter *i)
 {
 	return __import_iovec(type, uvec, nr_segs, fast_segs, iovp, i,
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0333/1005] vfs: preserve subsecond timestamps at filesystem time limits
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (331 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0332/1005] iov_iter: take an unsigned long segment count in import_iovec() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0334/1005] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
                   ` (40 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Jeff Layton,
	Christian Brauner (Amutable), Sasha Levin

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

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

From: Hungyu Lin <dennylin0707@gmail.com>

[ Upstream commit 55a0c91000646b008261e3b1e15d1e774f3026e4 ]

timestamp_truncate() clears tv_nsec whenever the clamped seconds equal
either filesystem time limit. This also drops the fractional part of
timestamps whose seconds were already within the supported range.

For example, setting a JFS mtime to 0.123456789 produces 0.000000000,
although the filesystem can store the requested value. Utilities such
as touch and cp -p consequently lose valid subsecond timestamps when
preserving these endpoint values. Timestamps strictly between the
filesystem limits are unaffected.

Only clear tv_nsec when clamping actually changes tv_sec. Continue to
truncate in-range nanoseconds to the filesystem's timestamp granularity,
including when the seconds equal either endpoint.

Ben Hutchings suggested comparing clamped and original seconds in the
2019 utimes review. That caller was switched to timestamp_truncate(),
but the helper retained its endpoint equality check.

Link: https://lore.kernel.org/lkml/12c095e595836a7ff7f2c7b2a32cb5544dd29b55.camel@codethink.co.uk/
Fixes: 50e17c000c46 ("vfs: Add timestamp_truncate() api")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20261101113815.52911-1-dennylin0707@gmail.com
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/inode.c b/fs/inode.c
index bc93c1757a380..5ffe9b74acbc2 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2858,9 +2858,10 @@ struct timespec64 timestamp_truncate(struct timespec64 t, struct inode *inode)
 {
 	struct super_block *sb = inode->i_sb;
 	unsigned int gran = sb->s_time_gran;
+	time64_t seconds = t.tv_sec;
 
 	t.tv_sec = clamp(t.tv_sec, sb->s_time_min, sb->s_time_max);
-	if (unlikely(t.tv_sec == sb->s_time_max || t.tv_sec == sb->s_time_min))
+	if (unlikely(t.tv_sec != seconds))
 		t.tv_nsec = 0;
 
 	/* Avoid division in the common cases 1 ns and 1 s. */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0334/1005] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (332 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0333/1005] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0335/1005] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek() Greg Kroah-Hartman
                   ` (39 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jan Kara, Jeff Layton,
	Christoph Hellwig, Christian Brauner (Amutable), Sasha Levin

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

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

From: Jeff Layton <jlayton@kernel.org>

[ Upstream commit 925d238324c79bcb75ad0add1d1b9d31d5f48115 ]

STATX_ATTR_CHANGE_MONOTONIC is kernel-internal. cp_statx() strips it
from stx_attributes but copies attributes_mask verbatim, so it leaks to
userland on filesystems that advertise it (nfs, ceph), e.g.
stx_attributes_mask = 0x8000000000303000 on NFS.

Add a new mask constant and apply it to both fields.

Fixes: a1175d6b1bda ("vfs: plumb i_version handling into struct kstat")
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20261103-statx-v2-1-8b09aa8118ab@kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/stat.c            | 6 +++---
 include/linux/stat.h | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/stat.c b/fs/stat.c
index e03954c36b33e..689c610f36769 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -710,8 +710,7 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
 	/* STATX_CHANGE_COOKIE is kernel-only for now */
 	tmp.stx_mask = stat->result_mask & ~STATX_CHANGE_COOKIE;
 	tmp.stx_blksize = stat->blksize;
-	/* STATX_ATTR_CHANGE_MONOTONIC is kernel-only for now */
-	tmp.stx_attributes = stat->attributes & ~STATX_ATTR_CHANGE_MONOTONIC;
+	tmp.stx_attributes = stat->attributes & ~STATX_ATTR_INTERNAL_MASK;
 	tmp.stx_nlink = stat->nlink;
 	tmp.stx_uid = from_kuid_munged(current_user_ns(), stat->uid);
 	tmp.stx_gid = from_kgid_munged(current_user_ns(), stat->gid);
@@ -719,7 +718,8 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
 	tmp.stx_ino = stat->ino;
 	tmp.stx_size = stat->size;
 	tmp.stx_blocks = stat->blocks;
-	tmp.stx_attributes_mask = stat->attributes_mask;
+	tmp.stx_attributes_mask = stat->attributes_mask &
+				  ~STATX_ATTR_INTERNAL_MASK;
 	tmp.stx_atime.tv_sec = stat->atime.tv_sec;
 	tmp.stx_atime.tv_nsec = stat->atime.tv_nsec;
 	tmp.stx_btime.tv_sec = stat->btime.tv_sec;
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 9c57091328622..4f0a4af7a0671 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -69,4 +69,7 @@ struct kstat {
 /* file attribute values */
 #define STATX_ATTR_CHANGE_MONOTONIC	0x8000000000000000ULL /* version monotonically increases */
 
+/* mask of STATX_ATTR_* bits that is private to the kernel */
+#define STATX_ATTR_INTERNAL_MASK	(STATX_ATTR_CHANGE_MONOTONIC)
+
 #endif
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0335/1005] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (333 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0334/1005] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0336/1005] perf/core: Include perf_event_attr::defer_output in is_sb_event() check Greg Kroah-Hartman
                   ` (38 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Siddharth Chintamaneni, Jan Kara,
	Christian Brauner (Amutable), Sasha Levin

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

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

From: Siddharth Chintamaneni <sidchintamaneni@gmail.com>

[ Upstream commit 7a5783cfac71b3c12e7fb1c2894dd4538d57d513 ]

In default_llseek(), the range checks for SEEK_DATA and SEEK_HOLE compare
the signed loff_t offset directly against inode->i_size:

	if (offset >= inode->i_size) {
		retval = -ENXIO;
		goto out;
	}

When a negative offset is supplied to SEEK_HOLE (e.g. lseek(fd, -10,
SEEK_HOLE) on a sysctl file in /proc/sys), the signed comparison evaluates
to false and execution proceeds to:

	offset = inode->i_size;

This overwrites the negative offset with a non-negative value before the
final `if (offset >= 0 || unsigned_offsets(file))` check, causing
default_llseek() to update file->f_pos and return inode->i_size instead of
failing with -ENXIO. Similarly, for SEEK_DATA on a file with
FOP_UNSIGNED_OFFSET, a negative offset bypasses the range check and
succeeds via unsigned_offsets(file).

Read the inode size once via i_size_read(inode) after acquiring the inode
lock and compare (unsigned long long)offset >= eof for both SEEK_DATA and
SEEK_HOLE, matching must_set_pos().

Fixes: 982d816581ee ("fs: add SEEK_HOLE and SEEK_DATA flags")
Signed-off-by: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
Link: https://patch.msgid.link/20261101060049.81441-2-sidchintamaneni@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/read_write.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index ccaaa454dce02..a7043e234e2f6 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -333,13 +333,15 @@ loff_t default_llseek(struct file *file, loff_t offset, int whence)
 {
 	struct inode *inode = file_inode(file);
 	loff_t retval;
+	loff_t eof;
 
 	retval = inode_lock_killable(inode);
 	if (retval)
 		return retval;
+	eof = i_size_read(inode);
 	switch (whence) {
 		case SEEK_END:
-			offset += i_size_read(inode);
+			offset += eof;
 			break;
 		case SEEK_CUR:
 			if (offset == 0) {
@@ -354,7 +356,7 @@ loff_t default_llseek(struct file *file, loff_t offset, int whence)
 			 * long as offset isn't at the end of the file then the
 			 * offset is data.
 			 */
-			if (offset >= inode->i_size) {
+			if ((unsigned long long)offset >= eof) {
 				retval = -ENXIO;
 				goto out;
 			}
@@ -365,11 +367,11 @@ loff_t default_llseek(struct file *file, loff_t offset, int whence)
 			 * as long as offset isn't i_size or larger, return
 			 * i_size.
 			 */
-			if (offset >= inode->i_size) {
+			if ((unsigned long long)offset >= eof) {
 				retval = -ENXIO;
 				goto out;
 			}
-			offset = inode->i_size;
+			offset = eof;
 			break;
 	}
 	retval = -EINVAL;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0336/1005] perf/core: Include perf_event_attr::defer_output in is_sb_event() check
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (334 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0335/1005] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0337/1005] perf/core: Clamp deferred callchain entry count to fit u16 header.size Greg Kroah-Hartman
                   ` (37 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Peter Zijlstra (Intel),
	Ingo Molnar, Sasha Levin

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

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

From: Ian Rogers <irogers@google.com>

[ Upstream commit 772f38fc69d5cf22f13b43dec30c2bbc5bdf4eb8 ]

Events configured with attr.defer_output = 1 receive deferred callchain
sideband records (PERF_RECORD_CALLCHAIN_DEFERRED) via perf_iterate_sb().

Include attr->defer_output in is_sb_event() so that such events are
attached to the sideband event list even when no other sideband flags
(such as mmap or comm) are enabled on the event.

Fixes: c69993ecdd4d ("perf: Support deferred user unwind")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20261025215508.1237480-1-irogers@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index e8293a0e7945c..2cd3c5def0499 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5347,7 +5347,7 @@ static bool is_sb_event(struct perf_event *event)
 	    attr->comm || attr->comm_exec ||
 	    attr->task || attr->ksymbol ||
 	    attr->context_switch || attr->text_poke ||
-	    attr->bpf_event)
+	    attr->bpf_event || attr->defer_output)
 		return true;
 
 	return false;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0337/1005] perf/core: Clamp deferred callchain entry count to fit u16 header.size
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (335 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0336/1005] perf/core: Include perf_event_attr::defer_output in is_sb_event() check Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0338/1005] perf/amd/ibs: Reset CPU0 IBS state on syscore resume Greg Kroah-Hartman
                   ` (36 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Peter Zijlstra (Intel),
	Ingo Molnar, Sasha Levin

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

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

From: Ian Rogers <irogers@google.com>

[ Upstream commit 5e4d83fb3616ebf807df1ce1b0ee7a8cdcb5ff87 ]

In perf_callchain_deferred_output(), if trace->nr is large enough that
sizeof(deferred_event->event) + trace->nr * sizeof(u64) + id_header_size
exceeds U16_MAX, header.size wraps while the output loop still writes
all trace->nr entries into the ring buffer.

Clamp nr per event (accounting for event->id_header_size when
sample_id_all is enabled) so the record never overflows u16 header.size.

Fixes: c69993ecdd4d ("perf: Support deferred user unwind")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20261025215508.1237480-2-irogers@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/events/core.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2cd3c5def0499..2f1b4c6ba1cae 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10397,8 +10397,6 @@ struct perf_callchain_deferred_event {
 	struct {
 		struct perf_event_header	header;
 		u64				cookie;
-		u64				nr;
-		u64				ips[];
 	} event;
 };
 
@@ -10407,12 +10405,19 @@ static void perf_callchain_deferred_output(struct perf_event *event, void *data)
 	struct perf_callchain_deferred_event *deferred_event = data;
 	struct perf_output_handle handle;
 	struct perf_sample_data sample;
+	u64 nr = deferred_event->trace->nr;
+	u16 size, id_size, max_payload;
 	int ret;
-	u16 size = sizeof(deferred_event->event) + (deferred_event->trace->nr * sizeof(u64));
 
 	if (!event->attr.defer_output)
 		return;
 
+	id_size = event->attr.sample_id_all ? event->id_header_size : 0;
+	max_payload = round_down(U16_MAX - sizeof(deferred_event->event) -
+				 sizeof(u64) - id_size, sizeof(u64));
+	nr = min_t(u64, nr, max_payload / sizeof(u64));
+	size = sizeof(deferred_event->event) + sizeof(u64) + nr * sizeof(u64);
+
 	/* XXX do we really need sample_id_all for this ??? */
 	perf_event_header__init(&deferred_event->event.header, &sample,
 				PERF_RECORD_CALLCHAIN_DEFERRED,
@@ -10426,8 +10431,10 @@ static void perf_callchain_deferred_output(struct perf_event *event, void *data)
 		return;
 
 	perf_output_put(&handle, deferred_event->event);
-	for (int i = 0; i < deferred_event->trace->nr; i++) {
+	perf_output_put(&handle, nr);
+	for (u64 i = 0; i < nr; i++) {
 		u64 entry = deferred_event->trace->entries[i];
+
 		perf_output_put(&handle, entry);
 	}
 	perf_event__output_id_sample(event, &handle, &sample);
@@ -10442,7 +10449,6 @@ static void perf_unwind_deferred_callback(struct unwind_work *work,
 		.trace = trace,
 		.event = {
 			.cookie = cookie,
-			.nr = trace->nr,
 		},
 	};
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0338/1005] perf/amd/ibs: Reset CPU0 IBS state on syscore resume
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (336 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0337/1005] perf/core: Clamp deferred callchain entry count to fit u16 header.size Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0339/1005] perf: Eliminate duplicate arch-specific function definitions Greg Kroah-Hartman
                   ` (35 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ravi Bangoria,
	Peter Zijlstra (Intel), Ingo Molnar, Jim Mattson, Sasha Levin

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

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

From: Ravi Bangoria <ravi.bangoria@amd.com>

[ Upstream commit 2c1d35bd95b13b50b43a0cb2167305dabfb54c07 ]

During a suspend/resume cycle, all CPUs except CPU0 go through hotplug
callbacks, which sets up IBS state. CPU0 bypasses this path, leaving its
IBS state stale after resume.

Fix this bug by explicitly setting CPU0's IBS state in the
syscore ->resume() callback.

Fixes: efa5700ec0da ("perf/amd/ibs: Support IBS_{FETCH|OP}_CTL2[Dis] to eliminate RMW race")
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Jim Mattson <jmattson@google.com>
Link: https://patch.msgid.link/20261026041838.941-2-ravi.bangoria@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/events/amd/ibs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 3531f9c23b8c9..bfb51f8e184fd 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -1948,7 +1948,7 @@ static int perf_ibs_suspend(void *data)
 static void perf_ibs_resume(void *data)
 {
 	ibs_eilvt_setup();
-	setup_APIC_ibs();
+	x86_pmu_amd_ibs_starting_cpu(smp_processor_id());
 }
 
 static const struct syscore_ops perf_ibs_syscore_ops = {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0339/1005] perf: Eliminate duplicate arch-specific function definitions
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (337 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0338/1005] perf/amd/ibs: Reset CPU0 IBS state on syscore resume Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0340/1005] perf: Move and enhance has_extended_regs() for arch-specific use Greg Kroah-Hartman
                   ` (34 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dapeng Mi, Peter Zijlstra (Intel),
	Sasha Levin

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

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

From: Dapeng Mi <dapeng1.mi@linux.intel.com>

[ Upstream commit cb388bd530cc518b0e245fb4eabc40f3de538e4f ]

Define default common __weak functions for perf_reg_value(),
perf_reg_validate(), perf_reg_abi() and perf_get_regs_user(). This helps
to eliminate the duplicated arch-specific definitions.

No function changes intended.

Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260824082731.1013973-5-dapeng1.mi@linux.intel.com
Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/kernel/perf_regs.c       |  6 ------
 arch/arm64/kernel/perf_regs.c     |  6 ------
 arch/csky/kernel/perf_regs.c      |  6 ------
 arch/loongarch/kernel/perf_regs.c |  6 ------
 arch/mips/kernel/perf_regs.c      |  6 ------
 arch/parisc/kernel/perf_regs.c    |  6 ------
 arch/riscv/kernel/perf_regs.c     |  6 ------
 arch/x86/kernel/perf_regs.c       |  6 ------
 include/linux/perf_regs.h         | 32 ++++++-------------------------
 kernel/events/core.c              | 22 +++++++++++++++++++++
 10 files changed, 28 insertions(+), 74 deletions(-)

diff --git a/arch/arm/kernel/perf_regs.c b/arch/arm/kernel/perf_regs.c
index 0529f90395c94..d575a4c3ca56f 100644
--- a/arch/arm/kernel/perf_regs.c
+++ b/arch/arm/kernel/perf_regs.c
@@ -31,9 +31,3 @@ u64 perf_reg_abi(struct task_struct *task)
 	return PERF_SAMPLE_REGS_ABI_32;
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index b4eece3eb17d0..70e2f13f587f5 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -98,9 +98,3 @@ u64 perf_reg_abi(struct task_struct *task)
 		return PERF_SAMPLE_REGS_ABI_64;
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
diff --git a/arch/csky/kernel/perf_regs.c b/arch/csky/kernel/perf_regs.c
index 09b7f88a2d6ad..94601f37b596d 100644
--- a/arch/csky/kernel/perf_regs.c
+++ b/arch/csky/kernel/perf_regs.c
@@ -31,9 +31,3 @@ u64 perf_reg_abi(struct task_struct *task)
 	return PERF_SAMPLE_REGS_ABI_32;
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
diff --git a/arch/loongarch/kernel/perf_regs.c b/arch/loongarch/kernel/perf_regs.c
index 263ac4ab5af68..8dd604f017454 100644
--- a/arch/loongarch/kernel/perf_regs.c
+++ b/arch/loongarch/kernel/perf_regs.c
@@ -45,9 +45,3 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
 	return regs->regs[idx];
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
diff --git a/arch/mips/kernel/perf_regs.c b/arch/mips/kernel/perf_regs.c
index e686780d1647a..7736d3c5ebd2c 100644
--- a/arch/mips/kernel/perf_regs.c
+++ b/arch/mips/kernel/perf_regs.c
@@ -60,9 +60,3 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
 	return (s64)v; /* Sign extend if 32-bit. */
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
diff --git a/arch/parisc/kernel/perf_regs.c b/arch/parisc/kernel/perf_regs.c
index 10a1a5f06a185..b9fe1f2fcb9b1 100644
--- a/arch/parisc/kernel/perf_regs.c
+++ b/arch/parisc/kernel/perf_regs.c
@@ -53,9 +53,3 @@ u64 perf_reg_abi(struct task_struct *task)
 	return PERF_SAMPLE_REGS_ABI_64;
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
diff --git a/arch/riscv/kernel/perf_regs.c b/arch/riscv/kernel/perf_regs.c
index fd304a248de68..3bba8deababbf 100644
--- a/arch/riscv/kernel/perf_regs.c
+++ b/arch/riscv/kernel/perf_regs.c
@@ -35,9 +35,3 @@ u64 perf_reg_abi(struct task_struct *task)
 #endif
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
diff --git a/arch/x86/kernel/perf_regs.c b/arch/x86/kernel/perf_regs.c
index 624703af80a19..81204cb7f7239 100644
--- a/arch/x86/kernel/perf_regs.c
+++ b/arch/x86/kernel/perf_regs.c
@@ -100,12 +100,6 @@ u64 perf_reg_abi(struct task_struct *task)
 	return PERF_SAMPLE_REGS_ABI_32;
 }
 
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
 #else /* CONFIG_X86_64 */
 #define REG_NOSUPPORT ((1ULL << PERF_REG_X86_DS) | \
 		       (1ULL << PERF_REG_X86_ES) | \
diff --git a/include/linux/perf_regs.h b/include/linux/perf_regs.h
index f632c5725f162..144bcc3ff19fe 100644
--- a/include/linux/perf_regs.h
+++ b/include/linux/perf_regs.h
@@ -9,6 +9,12 @@ struct perf_regs {
 	struct pt_regs	*regs;
 };
 
+u64 perf_reg_value(struct pt_regs *regs, int idx);
+int perf_reg_validate(u64 mask);
+u64 perf_reg_abi(struct task_struct *task);
+void perf_get_regs_user(struct perf_regs *regs_user,
+			struct pt_regs *regs);
+
 #ifdef CONFIG_HAVE_PERF_REGS
 #include <asm/perf_regs.h>
 
@@ -16,35 +22,9 @@ struct perf_regs {
 #define PERF_REG_EXTENDED_MASK	0
 #endif
 
-u64 perf_reg_value(struct pt_regs *regs, int idx);
-int perf_reg_validate(u64 mask);
-u64 perf_reg_abi(struct task_struct *task);
-void perf_get_regs_user(struct perf_regs *regs_user,
-			struct pt_regs *regs);
 #else
 
 #define PERF_REG_EXTENDED_MASK	0
 
-static inline u64 perf_reg_value(struct pt_regs *regs, int idx)
-{
-	return 0;
-}
-
-static inline int perf_reg_validate(u64 mask)
-{
-	return mask ? -ENOSYS : 0;
-}
-
-static inline u64 perf_reg_abi(struct task_struct *task)
-{
-	return PERF_SAMPLE_REGS_ABI_NONE;
-}
-
-static inline void perf_get_regs_user(struct perf_regs *regs_user,
-				      struct pt_regs *regs)
-{
-	regs_user->regs = task_pt_regs(current);
-	regs_user->abi = perf_reg_abi(current);
-}
 #endif /* CONFIG_HAVE_PERF_REGS */
 #endif /* _LINUX_PERF_REGS_H */
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2f1b4c6ba1cae..7a01f4480881a 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7843,6 +7843,28 @@ unsigned long perf_instruction_pointer(struct perf_event *event,
 		0 : perf_arch_instruction_pointer(regs);
 }
 
+u64 __weak perf_reg_value(struct pt_regs *regs, int idx)
+{
+	return 0;
+}
+
+int __weak perf_reg_validate(u64 mask)
+{
+	return mask ? -ENOSYS : 0;
+}
+
+u64 __weak perf_reg_abi(struct task_struct *task)
+{
+	return PERF_SAMPLE_REGS_ABI_NONE;
+}
+
+void __weak perf_get_regs_user(struct perf_regs *regs_user,
+			       struct pt_regs *regs)
+{
+	regs_user->regs = task_pt_regs(current);
+	regs_user->abi = perf_reg_abi(current);
+}
+
 static void
 perf_output_sample_regs(struct perf_output_handle *handle,
 			struct pt_regs *regs, u64 mask)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0340/1005] perf: Move and enhance has_extended_regs() for arch-specific use
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (338 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0339/1005] perf: Eliminate duplicate arch-specific function definitions Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:27 ` [PATCH 7.3 0341/1005] perf: Add sampling support for SIMD registers Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kan Liang, Dapeng Mi,
	Peter Zijlstra (Intel), Sasha Levin

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

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

From: Kan Liang <kan.liang@linux.intel.com>

[ Upstream commit 05fe8825796e6b5557656c6c984486f0e66154fe ]

Move has_extended_regs() to include/linux/perf_event.h so it can be used
by arch-specific code.

While moving it, enhance the check logic and rename it to
event_has_extended_regs() to match existing perf event helper naming.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260824082731.1013973-9-dapeng1.mi@linux.intel.com
Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/perf_event.h | 10 ++++++++++
 kernel/events/core.c       |  8 +-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 2d5e7687875b0..6df5b4e33dcf4 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1518,6 +1518,16 @@ perf_event__output_id_sample(struct perf_event *event,
 extern void
 perf_log_lost_samples(struct perf_event *event, u64 lost);
 
+static inline bool event_has_extended_regs(struct perf_event *event)
+{
+	struct perf_event_attr *attr = &event->attr;
+
+	return ((attr->sample_type & PERF_SAMPLE_REGS_USER) &&
+		(attr->sample_regs_user & PERF_REG_EXTENDED_MASK)) ||
+	       ((attr->sample_type & PERF_SAMPLE_REGS_INTR) &&
+		(attr->sample_regs_intr & PERF_REG_EXTENDED_MASK));
+}
+
 static inline bool event_has_any_exclude_flag(struct perf_event *event)
 {
 	struct perf_event_attr *attr = &event->attr;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7a01f4480881a..c32450e322b98 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -13110,12 +13110,6 @@ int perf_pmu_unregister(struct pmu *pmu)
 }
 EXPORT_SYMBOL_GPL(perf_pmu_unregister);
 
-static inline bool has_extended_regs(struct perf_event *event)
-{
-	return (event->attr.sample_regs_user & PERF_REG_EXTENDED_MASK) ||
-	       (event->attr.sample_regs_intr & PERF_REG_EXTENDED_MASK);
-}
-
 static int perf_try_init_event(struct pmu *pmu, struct perf_event *event)
 {
 	struct perf_event_context *ctx = NULL;
@@ -13150,7 +13144,7 @@ static int perf_try_init_event(struct pmu *pmu, struct perf_event *event)
 		goto err_pmu;
 
 	if (!(pmu->capabilities & PERF_PMU_CAP_EXTENDED_REGS) &&
-	    has_extended_regs(event)) {
+	    event_has_extended_regs(event)) {
 		ret = -EOPNOTSUPP;
 		goto err_destroy;
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0341/1005] perf: Add sampling support for SIMD registers
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (339 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0340/1005] perf: Move and enhance has_extended_regs() for arch-specific use Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0342/1005] perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel), Kan Liang,
	Dapeng Mi, Sasha Levin

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

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

From: Kan Liang <kan.liang@linux.intel.com>

[ Upstream commit 918b7d6d1729952d51da4fa81db7b366a207de8f ]

Users may be interested in sampling SIMD registers during profiling.
The current sample_regs_* structure does not have sufficient space
for all SIMD registers.

To address this, new attribute fields sample_simd_{pred,vec}_reg_* are
added to struct perf_event_attr to represent the SIMD registers that are
expected to be sampled.

Currently, the perf/x86 code supports XMM registers in sample_regs_*.
To unify the configuration of SIMD registers and ensure a consistent
method for configuring XMM and other SIMD registers, a new event
attribute field, sample_simd_regs_enabled, is introduced. When
sample_simd_regs_enabled is set, it indicates that all SIMD registers,
including XMM, will be represented by the newly introduced
sample_simd_{pred|vec}_reg_* fields. The original XMM space in
sample_regs_* is reserved for future uses.

Since SIMD registers are wider than 64 bits, a new output format is
introduced. The number and width of SIMD registers are dumped first,
followed by the register values. The number and width are based on the
user's configuration.

A new ABI, PERF_SAMPLE_REGS_ABI_SIMD, is added to indicate the new format.
The enum perf_sample_regs_abi is now a bitmap. This change should not
impact existing tools, as the version and bitmap remain the same for
values 1 and 2.

Additionally, two new __weak functions are introduced:
- perf_simd_reg_value(): Retrieves the value of the requested SIMD
  register.
- perf_simd_reg_validate(): Validates the configuration of the SIMD
  registers.

A new flag, PERF_PMU_CAP_SIMD_REGS, is added to indicate that the PMU
supports SIMD register dumping. An error is generated if
sample_simd_{pred|vec}_reg_* is mistakenly set for a PMU that does not
support this capability.

Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Co-developed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260824082731.1013973-13-dapeng1.mi@linux.intel.com
Stable-dep-of: b61c12527223 ("perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/perf_event.h      |  12 +++
 include/linux/perf_regs.h       |   4 +
 include/uapi/linux/perf_event.h |  49 ++++++++++-
 kernel/events/core.c            | 141 +++++++++++++++++++++++++++++---
 4 files changed, 192 insertions(+), 14 deletions(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 6df5b4e33dcf4..bb2452fccd0b6 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -306,6 +306,7 @@ struct perf_event_pmu_context;
 #define PERF_PMU_CAP_AUX_PAUSE		0x0200
 #define PERF_PMU_CAP_AUX_PREFER_LARGE	0x0400
 #define PERF_PMU_CAP_MEDIATED_VPMU	0x0800
+#define PERF_PMU_CAP_SIMD_REGS		0x1000
 
 /**
  * pmu::scope
@@ -1518,6 +1519,17 @@ perf_event__output_id_sample(struct perf_event *event,
 extern void
 perf_log_lost_samples(struct perf_event *event, u64 lost);
 
+static inline bool event_has_simd_regs(struct perf_event *event)
+{
+	struct perf_event_attr *attr = &event->attr;
+
+	if (!(event->attr.sample_type &
+	      (PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER)))
+		return false;
+
+	return attr->sample_simd_regs_enabled != 0;
+}
+
 static inline bool event_has_extended_regs(struct perf_event *event)
 {
 	struct perf_event_attr *attr = &event->attr;
diff --git a/include/linux/perf_regs.h b/include/linux/perf_regs.h
index 144bcc3ff19fe..518f28c6a7d4b 100644
--- a/include/linux/perf_regs.h
+++ b/include/linux/perf_regs.h
@@ -14,6 +14,10 @@ int perf_reg_validate(u64 mask);
 u64 perf_reg_abi(struct task_struct *task);
 void perf_get_regs_user(struct perf_regs *regs_user,
 			struct pt_regs *regs);
+int perf_simd_reg_validate(u16 vec_qwords, u64 vec_mask,
+			   u16 pred_qwords, u32 pred_mask);
+u64 perf_simd_reg_value(struct pt_regs *regs, int idx,
+			u16 qwords_idx, bool pred);
 
 #ifdef CONFIG_HAVE_PERF_REGS
 #include <asm/perf_regs.h>
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index fd10aa8d697f2..c49fc76292f79 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -314,8 +314,9 @@ enum {
  */
 enum perf_sample_regs_abi {
 	PERF_SAMPLE_REGS_ABI_NONE		= 0,
-	PERF_SAMPLE_REGS_ABI_32			= 1,
-	PERF_SAMPLE_REGS_ABI_64			= 2,
+	PERF_SAMPLE_REGS_ABI_32			= (1 << 0),
+	PERF_SAMPLE_REGS_ABI_64			= (1 << 1),
+	PERF_SAMPLE_REGS_ABI_SIMD		= (1 << 2),
 };
 
 /*
@@ -383,6 +384,7 @@ enum perf_event_read_format {
 #define PERF_ATTR_SIZE_VER7			128	/* Add: sig_data */
 #define PERF_ATTR_SIZE_VER8			136	/* Add: config3 */
 #define PERF_ATTR_SIZE_VER9			144	/* add: config4 */
+#define PERF_ATTR_SIZE_VER10			176	/* Add: sample_simd_{vec|pred}_reg_* */
 
 /*
  * 'struct perf_event_attr' contains various attributes that define
@@ -547,6 +549,29 @@ struct perf_event_attr {
 
 	__u64	config3; /* extension of config2 */
 	__u64	config4; /* extension of config3 */
+
+	/*
+	 * Defines the sampling SIMD/PRED(predicate) registers bitmap and
+	 * qwords (8 bytes) length.
+	 *
+	 * sample_simd_regs_enabled != 0 indicates there are SIMD/PRED
+	 * registers to be sampled, the SIMD/PRED registers bitmap and
+	 * qwords length are represented in
+	 * sample_simd_{vec|pred}_reg_{intr|user} and
+	 * sample_simd_{vec|pred}_reg_qwords fields separately.
+	 *
+	 * sample_simd_regs_enabled == 0 indicates no SIMD/PRED registers
+	 * are sampled.
+	 */
+	__u16	sample_simd_regs_enabled;
+	__u16	sample_simd_pred_reg_qwords;
+	__u16	sample_simd_vec_reg_qwords;
+	__u16	__reserved_4;
+
+	__u32	sample_simd_pred_reg_intr;
+	__u32	sample_simd_pred_reg_user;
+	__u64	sample_simd_vec_reg_intr;
+	__u64	sample_simd_vec_reg_user;
 };
 
 /*
@@ -1020,7 +1045,15 @@ enum perf_event_type {
 	 *      } && PERF_SAMPLE_BRANCH_STACK
 	 *
 	 *	{ u64			abi; # enum perf_sample_regs_abi
-	 *	  u64			regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
+	 *	  u64			regs[weight(mask)];
+	 *	  struct {
+	 *		u64 nr_vectors;		# 0 ... weight(sample_simd_vec_reg_user)
+	 *		u64 vector_qwords;	# 0 ... sample_simd_vec_reg_qwords
+	 *		u64 nr_pred;		# 0 ... weight(sample_simd_pred_reg_user)
+	 *		u64 pred_qwords;	# 0 ... sample_simd_pred_reg_qwords
+	 *		u64 data[nr_vectors * vector_qwords + nr_pred * pred_qwords];
+	 *	  } && (abi & PERF_SAMPLE_REGS_ABI_SIMD)
+	 *	} && PERF_SAMPLE_REGS_USER
 	 *
 	 *	{ u64			size;
 	 *	  char			data[size];
@@ -1047,7 +1080,15 @@ enum perf_event_type {
 	 *	{ u64			data_src; } && PERF_SAMPLE_DATA_SRC
 	 *	{ u64			transaction; } && PERF_SAMPLE_TRANSACTION
 	 *	{ u64			abi; # enum perf_sample_regs_abi
-	 *	  u64			regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR
+	 *	  u64			regs[weight(mask)];
+	 *	  struct {
+	 *		u64 nr_vectors;		# 0 ... weight(sample_simd_vec_reg_intr)
+	 *		u64 vector_qwords;	# 0 ... sample_simd_vec_reg_qwords
+	 *		u64 nr_pred;		# 0 ... weight(sample_simd_pred_reg_intr)
+	 *		u64 pred_qwords;	# 0 ... sample_simd_pred_reg_qwords
+	 *		u64 data[nr_vectors * vector_qwords + nr_pred * pred_qwords];
+	 *	  } && (abi & PERF_SAMPLE_REGS_ABI_SIMD)
+	 *	} && PERF_SAMPLE_REGS_INTR
 	 *	{ u64			phys_addr;} && PERF_SAMPLE_PHYS_ADDR
 	 *	{ u64			cgroup;} && PERF_SAMPLE_CGROUP
 	 *	{ u64			data_page_size;} && PERF_SAMPLE_DATA_PAGE_SIZE
diff --git a/kernel/events/core.c b/kernel/events/core.c
index c32450e322b98..fa82d7625ba07 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7865,22 +7865,60 @@ void __weak perf_get_regs_user(struct perf_regs *regs_user,
 	regs_user->abi = perf_reg_abi(current);
 }
 
+#define word_for_each_set_bit(bit, val)			\
+	for (unsigned long long __v = (val);		\
+	     __v && ((bit = __builtin_ctzll(__v)), 1);	\
+	     __v &= __v - 1)
+
 static void
 perf_output_sample_regs(struct perf_output_handle *handle,
 			struct pt_regs *regs, u64 mask)
 {
 	int bit;
-	DECLARE_BITMAP(_mask, 64);
-
-	bitmap_from_u64(_mask, mask);
-	for_each_set_bit(bit, _mask, sizeof(mask) * BITS_PER_BYTE) {
-		u64 val;
 
-		val = perf_reg_value(regs, bit);
+	word_for_each_set_bit(bit, mask) {
+		u64 val = perf_reg_value(regs, bit);
 		perf_output_put(handle, val);
 	}
 }
 
+static void
+perf_output_sample_simd_regs(struct perf_output_handle *handle,
+			     struct perf_event *event,
+			     struct pt_regs *regs,
+			     u64 mask, u32 pred_mask)
+{
+	u64 pred_qwords = event->attr.sample_simd_pred_reg_qwords;
+	u64 vec_qwords = event->attr.sample_simd_vec_reg_qwords;
+	u64 nr_vectors = hweight64(mask);
+	u64 nr_pred = hweight32(pred_mask);
+	int bit;
+
+	perf_output_put(handle, nr_vectors);
+	perf_output_put(handle, vec_qwords);
+	perf_output_put(handle, nr_pred);
+	perf_output_put(handle, pred_qwords);
+
+	if (nr_vectors) {
+		word_for_each_set_bit(bit, mask) {
+			for (int i = 0; i < vec_qwords; i++) {
+				u64 val = perf_simd_reg_value(regs, bit,
+							      i, false);
+				perf_output_put(handle, val);
+			}
+		}
+	}
+	if (nr_pred) {
+		word_for_each_set_bit(bit, pred_mask) {
+			for (int i = 0; i < pred_qwords; i++) {
+				u64 val = perf_simd_reg_value(regs, bit,
+							      i, true);
+				perf_output_put(handle, val);
+			}
+		}
+	}
+}
+
 static void perf_sample_regs_user(struct perf_regs *regs_user,
 				  struct pt_regs *regs)
 {
@@ -7914,6 +7952,17 @@ static void perf_sample_regs_intr(struct perf_regs *regs_intr,
 	}
 }
 
+int __weak perf_simd_reg_validate(u16 vec_qwords, u64 vec_mask,
+				  u16 pred_qwords, u32 pred_mask)
+{
+	return -EINVAL;
+}
+
+u64 __weak perf_simd_reg_value(struct pt_regs *regs, int idx,
+			       u16 qwords_idx, bool pred)
+{
+	return 0;
+}
 
 /*
  * Get remaining task size from user stack pointer.
@@ -8449,10 +8498,17 @@ void perf_output_sample(struct perf_output_handle *handle,
 		perf_output_put(handle, abi);
 
 		if (abi) {
-			u64 mask = event->attr.sample_regs_user;
+			struct perf_event_attr *attr = &event->attr;
+			u64 mask = attr->sample_regs_user;
 			perf_output_sample_regs(handle,
 						data->regs_user.regs,
 						mask);
+			if (abi & PERF_SAMPLE_REGS_ABI_SIMD) {
+				perf_output_sample_simd_regs(handle, event,
+							     data->regs_user.regs,
+							     attr->sample_simd_vec_reg_user,
+							     attr->sample_simd_pred_reg_user);
+			}
 		}
 	}
 
@@ -8480,11 +8536,18 @@ void perf_output_sample(struct perf_output_handle *handle,
 		perf_output_put(handle, abi);
 
 		if (abi) {
-			u64 mask = event->attr.sample_regs_intr;
+			struct perf_event_attr *attr = &event->attr;
+			u64 mask = attr->sample_regs_intr;
 
 			perf_output_sample_regs(handle,
 						data->regs_intr.regs,
 						mask);
+			if (abi & PERF_SAMPLE_REGS_ABI_SIMD) {
+				perf_output_sample_simd_regs(handle, event,
+							     data->regs_intr.regs,
+							     attr->sample_simd_vec_reg_intr,
+							     attr->sample_simd_pred_reg_intr);
+			}
 		}
 	}
 
@@ -8687,6 +8750,29 @@ static __always_inline u64 __cond_set(u64 flags, u64 s, u64 d)
 	return d * !!(flags & s);
 }
 
+static u64 perf_update_xregs_size(struct perf_event *event, bool intr)
+{
+	u16 pred_qwords = event->attr.sample_simd_pred_reg_qwords;
+	u16 vec_qwords = event->attr.sample_simd_vec_reg_qwords;
+	u64 pred_mask;
+	u64 mask;
+	int size;
+
+	if (intr) {
+		mask = event->attr.sample_simd_vec_reg_intr;
+		pred_mask = event->attr.sample_simd_pred_reg_intr;
+	} else {
+		mask = event->attr.sample_simd_vec_reg_user;
+		pred_mask = event->attr.sample_simd_pred_reg_user;
+	}
+
+	size = sizeof(u64) * 4;
+	size += (hweight64(mask) * vec_qwords +
+		 hweight64(pred_mask) * pred_qwords) * sizeof(u64);
+
+	return size;
+}
+
 void perf_prepare_sample(struct perf_sample_data *data,
 			 struct perf_event *event,
 			 struct pt_regs *regs)
@@ -8749,7 +8835,12 @@ void perf_prepare_sample(struct perf_sample_data *data,
 
 		if (data->regs_user.regs) {
 			u64 mask = event->attr.sample_regs_user;
+
 			size += hweight64(mask) * sizeof(u64);
+			if (event_has_simd_regs(event)) {
+				size += perf_update_xregs_size(event, false);
+				data->regs_user.abi |= PERF_SAMPLE_REGS_ABI_SIMD;
+			}
 		}
 
 		data->dyn_size += size;
@@ -8814,6 +8905,10 @@ void perf_prepare_sample(struct perf_sample_data *data,
 			u64 mask = event->attr.sample_regs_intr;
 
 			size += hweight64(mask) * sizeof(u64);
+			if (event_has_simd_regs(event)) {
+				size += perf_update_xregs_size(event, true);
+				data->regs_intr.abi |= PERF_SAMPLE_REGS_ABI_SIMD;
+			}
 		}
 
 		data->dyn_size += size;
@@ -13143,6 +13238,12 @@ static int perf_try_init_event(struct pmu *pmu, struct perf_event *event)
 	if (ret)
 		goto err_pmu;
 
+	if (!(pmu->capabilities & PERF_PMU_CAP_SIMD_REGS) &&
+	    event_has_simd_regs(event)) {
+		ret = -EOPNOTSUPP;
+		goto err_destroy;
+	}
+
 	if (!(pmu->capabilities & PERF_PMU_CAP_EXTENDED_REGS) &&
 	    event_has_extended_regs(event)) {
 		ret = -EOPNOTSUPP;
@@ -13638,7 +13739,8 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
 
 	attr->size = size;
 
-	if (attr->__reserved_1 || attr->__reserved_2 || attr->__reserved_3)
+	if (attr->__reserved_1 || attr->__reserved_2 ||
+	    attr->__reserved_3 || attr->__reserved_4)
 		return -EINVAL;
 
 	if (attr->sample_type & ~(PERF_SAMPLE_MAX-1))
@@ -13687,6 +13789,14 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
 		ret = perf_reg_validate(attr->sample_regs_user);
 		if (ret)
 			return ret;
+		if (attr->sample_simd_regs_enabled) {
+			ret = perf_simd_reg_validate(attr->sample_simd_vec_reg_qwords,
+						     attr->sample_simd_vec_reg_user,
+						     attr->sample_simd_pred_reg_qwords,
+						     attr->sample_simd_pred_reg_user);
+			if (ret)
+				return ret;
+		}
 	}
 
 	if (attr->sample_type & PERF_SAMPLE_STACK_USER) {
@@ -13707,8 +13817,19 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
 	if (!attr->sample_max_stack)
 		attr->sample_max_stack = sysctl_perf_event_max_stack;
 
-	if (attr->sample_type & PERF_SAMPLE_REGS_INTR)
+	if (attr->sample_type & PERF_SAMPLE_REGS_INTR) {
 		ret = perf_reg_validate(attr->sample_regs_intr);
+		if (ret)
+			return ret;
+		if (attr->sample_simd_regs_enabled) {
+			ret = perf_simd_reg_validate(attr->sample_simd_vec_reg_qwords,
+						     attr->sample_simd_vec_reg_intr,
+						     attr->sample_simd_pred_reg_qwords,
+						     attr->sample_simd_pred_reg_intr);
+			if (ret)
+				return ret;
+		}
+	}
 
 #ifndef CONFIG_CGROUP_PERF
 	if (attr->sample_type & PERF_SAMPLE_CGROUP)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0342/1005] perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (340 preceding siblings ...)
  2026-11-25 14:27 ` [PATCH 7.3 0341/1005] perf: Add sampling support for SIMD registers Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0343/1005] perf/amd/ibs: Simplify event state handling with IBS_CAPS_DIS Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Gennady Kupava, Jayapal Ashwin Nair,
	Ravi Bangoria, Peter Zijlstra (Intel), Ingo Molnar, Sasha Levin

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

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

From: Ravi Bangoria <ravi.bangoria@amd.com>

[ Upstream commit b61c12527223423ab66891b2e8131da0d66537c4 ]

IBS hardware captures a sample and raises an NMI. Since the NMI can be
delivered with a delay, a privilege change may occur between sample
capture and NMI delivery. Because IBS only provides the sample RIP, the
kernel records GPRs from the NMI pt_regs, which may reflect kernel mode
if a privilege switch occurred in the interim. This can leak kernel
addresses to unprivileged users through PERF_SAMPLE_REGS_USER and/or
PERF_SAMPLE_REGS_INTR.

Fix this by using interrupt regs while preparing PERF_SAMPLE_REGS_USER
and PERF_SAMPLE_REGS_INTR. With the change, when IBS samples a user mode
instruction but the NMI is delivered in kernel mode, PERF_SAMPLE_REGS_USER
will source its register state from task_pt_regs(current) and
PERF_SAMPLE_REGS_INTR will be omitted from the data sent to userspace.

In addition to fixing the kernel address leak, this change also ensures
GPR snapshot consistency, which resolves the DWARF unwinding issue with
IBS.

Closes: https://lore.kernel.org/r/CAPu-DQqF0aF6=GS8Z6KKWeeX_V5LiXeKU_rJQZC+uGg8zuTPNw@mail.gmail.com
Fixes: d29e744c7167 ("perf/x86: Relax privilege filter restriction on AMD IBS")
Reported-by: Gennady Kupava <gennady.kupava@gmail.com>
Reported-by: Jayapal Ashwin Nair <janair@amd.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20261026041838.941-3-ravi.bangoria@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/events/amd/ibs.c  | 50 ++++++++++++++++++++++++++++++++++++++
 include/linux/perf_event.h |  6 +++++
 kernel/events/core.c       | 10 ++++----
 3 files changed, 61 insertions(+), 5 deletions(-)

diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index bfb51f8e184fd..010d14d2357bc 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -1533,6 +1533,56 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
 		throttle = perf_event_account_interrupt(event);
 		goto out;
 	}
+
+	/*
+	 * IBS captured RIP is out of sync with NMI pt_regs due to NMI
+	 * delivery latency. Use NMI pt_regs for PERF_SAMPLE_REGS_USER.
+	 *
+	 * Note: Valid user regs are required for PERF_SAMPLE_STACK_USER.
+	 */
+	if (event->attr.sample_type & (PERF_SAMPLE_REGS_USER |
+				       PERF_SAMPLE_STACK_USER)) {
+		perf_sample_regs_user(&data.regs_user, iregs);
+
+		/*
+		 * Don't update dyn_size if user has not requested for
+		 * PERF_SAMPLE_REGS_USER.
+		 */
+		if (event->attr.sample_type & PERF_SAMPLE_REGS_USER) {
+			/* regs dump ABI info */
+			int size = sizeof(u64);
+
+			if (data.regs_user.regs) {
+				u64 mask = event->attr.sample_regs_user;
+				size += hweight64(mask) * sizeof(u64);
+			}
+
+			data.dyn_size += size;
+		}
+
+		data.sample_flags |= PERF_SAMPLE_REGS_USER;
+	}
+
+	/*
+	 * IBS captured RIP is out of sync with NMI pt_regs due to NMI
+	 * delivery latency. Use NMI pt_regs for PERF_SAMPLE_REGS_INTR.
+	 */
+	if (event->attr.sample_type & PERF_SAMPLE_REGS_INTR) {
+		/* regs dump ABI info */
+		int size = sizeof(u64);
+
+		perf_sample_regs_intr(&data.regs_intr, iregs,
+				      event->attr.exclude_kernel);
+
+		if (data.regs_intr.regs) {
+			u64 mask = event->attr.sample_regs_intr;
+			size += hweight64(mask) * sizeof(u64);
+		}
+
+		data.dyn_size += size;
+		data.sample_flags |= PERF_SAMPLE_REGS_INTR;
+	}
+
 	/*
 	 * Prevent leaking physical addresses to unprivileged users. Skip
 	 * PERF_SAMPLE_PHYS_ADDR check since generic code prevents it for
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index bb2452fccd0b6..8a985486ab122 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1813,6 +1813,12 @@ extern unsigned long perf_misc_flags(struct perf_event *event, struct pt_regs *r
 extern unsigned long perf_instruction_pointer(struct perf_event *event,
 					      struct pt_regs *regs);
 
+extern void perf_sample_regs_user(struct perf_regs *regs_user,
+				  struct pt_regs *regs);
+extern void perf_sample_regs_intr(struct perf_regs *regs_intr,
+				  struct pt_regs *regs,
+				  bool exclude_kernel);
+
 #ifndef perf_arch_misc_flags
 # define perf_arch_misc_flags(regs) \
 		(user_mode(regs) ? PERF_RECORD_MISC_USER : PERF_RECORD_MISC_KERNEL)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index fa82d7625ba07..9c45f9d584d67 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7919,8 +7919,8 @@ perf_output_sample_simd_regs(struct perf_output_handle *handle,
 	}
 }
 
-static void perf_sample_regs_user(struct perf_regs *regs_user,
-				  struct pt_regs *regs)
+void perf_sample_regs_user(struct perf_regs *regs_user,
+			   struct pt_regs *regs)
 {
 	if (user_mode(regs)) {
 		regs_user->abi = perf_reg_abi(current);
@@ -7933,9 +7933,9 @@ static void perf_sample_regs_user(struct perf_regs *regs_user,
 	}
 }
 
-static void perf_sample_regs_intr(struct perf_regs *regs_intr,
-				  struct pt_regs *regs,
-				  bool exclude_kernel)
+void perf_sample_regs_intr(struct perf_regs *regs_intr,
+			   struct pt_regs *regs,
+			   bool exclude_kernel)
 {
 	/*
 	 * Hardware skid can lead to a scenario where a PMI is
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0343/1005] perf/amd/ibs: Simplify event state handling with IBS_CAPS_DIS
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (341 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0342/1005] perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0344/1005] sched/deadline: Fix this_bw on class change of a dying task Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jim Mattson, Ravi Bangoria,
	Peter Zijlstra (Intel), Ingo Molnar, Sasha Levin

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

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

From: Ravi Bangoria <ravi.bangoria@amd.com>

[ Upstream commit 927f9c5cdadbc4ac6973bcd1690107fcb392612c ]

The IBS_{FETCH|OP}_CTL2[Dis] bit allows IBS sampling to be stopped without
a RMW of IBS_{FETCH,OP}_CTL. Systems providing this bit therefore do not
require the IBS_STARTED and IBS_STOPPED states used to coordinate control
MSR updates with late NMIs.

Add a separate stop path for these systems. Preserve the Val bit while
disabling the event so that a delayed NMI can be identified and consumed,
and wait briefly for such an NMI before restarting the event.

Leave the existing handling unchanged on systems without IBS_CAPS_DIS.

Closes: https://lore.kernel.org/r/20261007234815.4026028-1-jmattson@google.com
Fixes: efa5700ec0da ("perf/amd/ibs: Support IBS_{FETCH|OP}_CTL2[Dis] to eliminate RMW race")
Reported-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20261007234815.4026028-1-jmattson@google.com
Link: https://patch.msgid.link/20261026041838.941-4-ravi.bangoria@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/events/amd/ibs.c | 145 ++++++++++++++++++++++++++++++++------
 1 file changed, 122 insertions(+), 23 deletions(-)

diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index 010d14d2357bc..66e67e27224f1 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -28,6 +28,7 @@ static u32 ibs_caps;
 #include <linux/hardirq.h>
 
 #include <asm/nmi.h>
+#include <asm/delay.h>
 #include <asm/amd/ibs.h>
 
 /* attr.config2 */
@@ -73,7 +74,12 @@ static u32 ibs_caps;
  *
  * XXX: we could probably be using !atomic bitops for all this.
  */
-
+/*
+ * NOTE: IBS_CAPS_DIS eliminates the RMW race on the IBS_{FETCH|OP}_CTL, making
+ * IBS_STARTED and IBS_STOPPED states unnecessary. We use only IBS_ENABLED and
+ * IBS_STOPPING states when IBS_CAPS_DIS is present. Semantics of IBS_STOPPING
+ * changes a bit as well.
+ */
 enum ibs_states {
 	IBS_ENABLED	= 0,
 	IBS_STARTED	= 1,
@@ -557,7 +563,9 @@ static void perf_ibs_start(struct perf_event *event, int flags)
 	struct hw_perf_event *hwc = &event->hw;
 	struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu);
 	struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu);
+	unsigned int delay = 50;
 	u64 period, config = 0;
+	u64 ctl;
 
 	if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED)))
 		return;
@@ -575,23 +583,87 @@ static void perf_ibs_start(struct perf_event *event, int flags)
 	}
 	config |= period >> 4;
 
-	/*
-	 * Reset the IBS_{FETCH|OP}_CTL MSR before updating pcpu->state.
-	 * Doing so prevents a race condition in which an NMI due to other
-	 * source might accidentally activate the event before we enable
-	 * it ourselves.
-	 */
-	perf_ibs_disable_event(perf_ibs, hwc, 0);
+	if (ibs_caps & IBS_CAPS_DIS) {
+		/*
+		 *      IBS HW                     SW
+		 *
+		 *  o Capture sample       o ->stop()
+		 *  o Set VAL bit            CTL2[Dis] = 1
+		 *  o Raise NMI --.        o ...
+		 *                 \       o ->start()
+		 *                  \        wrmsr(IBS_{FETCH|OP}_CTL, new value);
+		 *                   \       (wrmsr clears the VAL bit)
+		 *                    `--> o Receives delayed NMI
+		 *                           (Unknown NMI since VAL bit is cleared)
+		 *
+		 * Handle this with induced delay.
+		 */
+		rdmsrq(hwc->config_base, ctl);
+		while ((ctl & perf_ibs->valid_mask) && delay--) {
+			udelay(1);
+			rdmsrq(hwc->config_base, ctl);
+		}
+	} else {
+		/*
+		 * Reset the IBS_{FETCH|OP}_CTL MSR before updating pcpu->state.
+		 * Doing so prevents a race condition in which an NMI due to
+		 * other source might accidentally activate the event before we
+		 * enable it ourselves.
+		 */
+		perf_ibs_disable_event(perf_ibs, hwc, 0);
+		/*
+		 * Set STARTED before enabling the hardware, such that a
+		 * subsequent NMI must observe it.
+		 */
+		set_bit(IBS_STARTED,    pcpu->state);
+		clear_bit(IBS_STOPPING, pcpu->state);
+	}
+	perf_ibs_enable_event(perf_ibs, hwc, config);
+
+	perf_event_update_userpage(event);
+}
+
+/* ->stop() for platforms with additional CTL2[Dis] bit. */
+static void perf_ibs_stop_dis(struct perf_event *event, int flags)
+{
+	struct hw_perf_event *hwc = &event->hw;
+	struct perf_ibs *perf_ibs = container_of(event->pmu, struct perf_ibs, pmu);
+	struct cpu_perf_ibs *pcpu = this_cpu_ptr(perf_ibs->pcpu);
+	u64 config;
+	u64 ctl2;
+
+	WARN_ON_ONCE(test_bit(IBS_STOPPING, pcpu->state));
+
+	set_bit(IBS_STOPPING, pcpu->state);
+
+	rdmsrq(hwc->extra_reg.reg, ctl2);
+	if (ctl2 & perf_ibs->disable_mask)
+		goto reset_state;
+
+	wrmsrq(hwc->extra_reg.reg, perf_ibs->disable_mask);
+
+	WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED);
+	hwc->state |= PERF_HES_STOPPED;
+
+	if (hwc->state & PERF_HES_UPTODATE)
+		goto reset_state;
+
+	rdmsrq(hwc->config_base, config);
+
+	config &= ~perf_ibs->valid_mask;
 
 	/*
-	 * Set STARTED before enabling the hardware, such that a subsequent NMI
-	 * must observe it.
+	 * Clear the Val bit otherwise ->start() will unnecessarily
+	 * wait for 50us.
 	 */
-	set_bit(IBS_STARTED,    pcpu->state);
-	clear_bit(IBS_STOPPING, pcpu->state);
-	perf_ibs_enable_event(perf_ibs, hwc, config);
+	if (in_nmi())
+		wrmsrq(hwc->config_base, config);
 
-	perf_event_update_userpage(event);
+	perf_ibs_event_update(perf_ibs, event, &config);
+	hwc->state |= PERF_HES_UPTODATE;
+
+reset_state:
+	clear_bit(IBS_STOPPING, pcpu->state);
 }
 
 static void perf_ibs_stop(struct perf_event *event, int flags)
@@ -602,6 +674,9 @@ static void perf_ibs_stop(struct perf_event *event, int flags)
 	u64 config;
 	int stopping;
 
+	if (ibs_caps & IBS_CAPS_DIS)
+		return perf_ibs_stop_dis(event, flags);
+
 	if (test_and_set_bit(IBS_STOPPING, pcpu->state))
 		return;
 
@@ -1416,19 +1491,43 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
 	unsigned int msr;
 	u64 *buf, *config, period, new_config = 0;
 	int br_target_idx = -1;
+	u64 ctl2, ctl;
 
-	if (!test_bit(IBS_STARTED, pcpu->state)) {
-fail:
+	if (ibs_caps & IBS_CAPS_DIS) {
 		/*
-		 * Catch spurious interrupts after stopping IBS: After
-		 * disabling IBS there could be still incoming NMIs
-		 * with samples that even have the valid bit cleared.
-		 * Mark all this NMIs as handled.
+		 * ->stop() {
+		 *     set_bit(IBS_STOPPING);
+		 *                               <-- NMI (race 1)
+		 *     CTL2[Dis]=1;
+		 *     ...                       <-- NMI (race 2)
+		 * }
 		 */
-		if (test_and_clear_bit(IBS_STOPPED, pcpu->state))
-			return 1;
+		rdmsrq(perf_ibs->msr2, ctl2);
+		if (test_bit(IBS_STOPPING, pcpu->state) /* race 1 */ ||
+		    (ctl2 & perf_ibs->disable_mask) /* race 2 */) {
+			rdmsrq(perf_ibs->msr, ctl);
+			if (ctl & perf_ibs->valid_mask) {
+				ctl &= ~(perf_ibs->enable_mask |
+					 perf_ibs->valid_mask);
+				wrmsrq(perf_ibs->msr, ctl);
+				return 1;
+			}
+			return 0;
+		}
+	} else {
+		if (!test_bit(IBS_STARTED, pcpu->state)) {
+fail:
+			/*
+			 * Catch spurious interrupts after stopping IBS: After
+			 * disabling IBS there could be still incoming NMIs
+			 * with samples that even have the valid bit cleared.
+			 * Mark all this NMIs as handled.
+			 */
+			if (test_and_clear_bit(IBS_STOPPED, pcpu->state))
+				return 1;
 
-		return 0;
+			return 0;
+		}
 	}
 
 	if (WARN_ON_ONCE(!event))
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0344/1005] sched/deadline: Fix this_bw on class change of a dying task
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (342 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0343/1005] perf/amd/ibs: Simplify event state handling with IBS_CAPS_DIS Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0345/1005] sched/core: Account I/O waits independently of delayed dequeue Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nickolai Zeldovich,
	Peter Zijlstra (Intel), Ingo Molnar, Juri Lelli, Sasha Levin

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

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

From: Nickolai Zeldovich <nickolai@csail.mit.edu>

[ Upstream commit 0c93e25ef11a9dee43f6076bd1f09771dc2b167e ]

Moving a SCHED_DEADLINE task out of the class with sched_setscheduler(2)
after it stored TASK_DEAD in do_task_dead(), but before __schedule()
dequeued it, subtracts its bandwidth from the runqueue's this_bw twice.
this_bw then stays short until reboot: __sub_rq_bw() warns about the
underflow or about running_bw > this_bw, and GRUB reclaim for
SCHED_FLAG_RECLAIM tasks on that CPU is miscomputed.

The class change dequeues the still queued task with DEQUEUE_SAVE, which
removes its bandwidth from running_bw and this_bw. switched_from_dl()
then calls task_non_contending(), which, if the 0-lag time has passed,
removes it from this_bw again because the task is TASK_DEAD. That
removal is meant for the dying task's own DEQUEUE_SLEEP dequeue, which
has removed nothing before it.

Do the TASK_DEAD removal only on that dequeue path.

Reproduced under QEMU on x86_64 and riscv64 by moving exiting deadline
tasks to SCHED_OTHER in a loop; with this patch there is no warning.

Fixes: 8fd27231c330 ("sched/deadline: Track the "total rq utilization" too")
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Tested-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://patch.msgid.link/20261025124657.836229-1-nickolai@csail.mit.edu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 1502a45d76aaf..4d502ca884485 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -444,7 +444,7 @@ static void task_non_contending(struct sched_dl_entity *dl_se, bool dl_task)
 			if (!dl_task || READ_ONCE(p->__state) == TASK_DEAD) {
 				struct dl_bw *dl_b = dl_bw_of(task_cpu(p));
 
-				if (READ_ONCE(p->__state) == TASK_DEAD)
+				if (dl_task && READ_ONCE(p->__state) == TASK_DEAD)
 					sub_rq_bw(dl_se, &rq->dl);
 				raw_spin_lock(&dl_b->lock);
 				__dl_sub(dl_b, dl_se->dl_bw, dl_bw_cpus(task_cpu(p)));
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0345/1005] sched/core: Account I/O waits independently of delayed dequeue
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (343 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0344/1005] sched/deadline: Fix this_bw on class change of a dying task Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0346/1005] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhan Xusheng, Christian Loehle,
	Peter Zijlstra (Intel), Ingo Molnar, Kayra Cizmeci, Sasha Levin

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

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

From: Christian Loehle <christian.loehle@arm.com>

[ Upstream commit 0965587d00b84f0a3b0fc94930d4a5f8ff011eda ]

Starting blkio delay accounting and incrementing rq->nr_iowait in
__block_task() ties both to removal from the runqueue. With EEVDF delayed
dequeue, this misses the initial part of an I/O sleep, or the entire
sleep if the task wakes before it is dequeued. Such tasks are also
missing from procs_blocked while their dequeue is delayed. Final dequeue
can run in another task's context, causing delayacct_blkio_start() to
timestamp the wrong task.

Start both forms of accounting in try_to_block_task(), when the current
task commits to blocking, before delayed dequeue or proxy execution can
retain it on the runqueue. End both when clearing is_blocked, including
queued wakeups and the proxy execution paths that let the current task
continue. Checking is_blocked excludes wakeups that precede blocking.

Save the CPU charged at the start of the wait. Delayed tasks can migrate
while still queued, and proxy execution can also move blocked tasks.
Decrement the saved CPU's counter on unblock, regardless of the task's
current placement, and remove the old dequeue-based accounting.

CPU iowait continues to classify idle time using the counter on the
charged CPU; it does not accumulate the full per-task blocked duration.

Closes: https://lore.kernel.org/r/20261014081731.1068794-1-zhanxusheng@xiaomi.com
Fixes: 152e11f6df29 ("sched/fair: Implement delayed dequeue")
Reported-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Reviewed-by: Kayra Cizmeci <kayracizmeci@gmail.com>
Link: https://patch.msgid.link/fd8578a1-e60b-4993-ab51-2b5d63abcf77@arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/sched.h |  2 ++
 kernel/sched/core.c   | 33 ++++++++++++++++++++-------------
 kernel/sched/sched.h  |  5 -----
 3 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 09d90f5edd2bf..bdfd662e2c37b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -880,6 +880,8 @@ struct task_struct {
 	 */
 	int				recent_used_cpu;
 	int				wake_cpu;
+	/* CPU charged while is_blocked && in_iowait. */
+	int				iowait_cpu;
 
 	int				prio;
 	int				static_prio;
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 4a051764e7119..1a57b0733fec5 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -636,7 +636,7 @@ int task_llc(const struct task_struct *p)
  *
  * p->is_blocked <- { 0, 1 }:
  *
- *   is set by try_to_block_task() and cleared by ttwu_do_wakeup() and tracks
+ *   is set by try_to_block_task() and cleared by unblock_task() and tracks
  *   if the task is blocked. Traditionally this would mirror p->on_rq, however
  *   due things like DELAY_DEQUEUE and PROXY_EXEC, this can diverge.
  *
@@ -3740,12 +3740,22 @@ ttwu_stat(struct task_struct *p, int cpu, int wake_flags)
 		__schedstat_inc(p->stats.nr_wakeups_sync);
 }
 
+static inline void unblock_task(struct task_struct *p)
+{
+	if (p->is_blocked && p->in_iowait) {
+		delayacct_blkio_end(p);
+		atomic_dec(&cpu_rq(p->iowait_cpu)->nr_iowait);
+	}
+
+	p->is_blocked = 0;
+}
+
 /*
  * Mark the task runnable.
  */
 static inline void ttwu_do_wakeup(struct task_struct *p)
 {
-	p->is_blocked = 0;
+	unblock_task(p);
 	WRITE_ONCE(p->__state, TASK_RUNNING);
 	trace_sched_wakeup(p);
 }
@@ -3843,10 +3853,6 @@ ttwu_do_activate(struct rq *rq, struct task_struct *p, int wake_flags,
 		en_flags |= ENQUEUE_RQ_SELECTED;
 	if (wake_flags & WF_MIGRATED)
 		en_flags |= ENQUEUE_MIGRATED;
-	else if (p->in_iowait) {
-		delayacct_blkio_end(p);
-		atomic_dec(&task_rq(p)->nr_iowait);
-	}
 
 	activate_task(rq, p, en_flags);
 	wakeup_preempt(rq, p, wake_flags);
@@ -4419,11 +4425,6 @@ int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
 
 		cpu = select_task_rq(p, p->wake_cpu, &wake_flags);
 		if (task_cpu(p) != cpu) {
-			if (p->in_iowait) {
-				delayacct_blkio_end(p);
-				atomic_dec(&task_rq(p)->nr_iowait);
-			}
-
 			wake_flags |= WF_MIGRATED;
 			psi_ttwu_dequeue(p);
 			set_task_cpu(p, cpu);
@@ -6766,6 +6767,12 @@ static bool try_to_block_task(struct rq *rq, struct task_struct *p,
 
 	p->is_blocked = 1;
 
+	if (p->in_iowait) {
+		p->iowait_cpu = cpu_of(rq);
+		atomic_inc(&rq->nr_iowait);
+		delayacct_blkio_start();
+	}
+
 	/*
 	 * We check should_block after signal_pending because we
 	 * will want to wake the task in that case. But if
@@ -6938,7 +6945,7 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
 		if (!mutex) {
 			clear_task_blocked_on(p, mutex);
 			if (task_current(rq, p)) {
-				p->is_blocked = 0;
+				unblock_task(p);
 				return p;
 			}
 			goto deactivate;
@@ -6974,7 +6981,7 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
 			 */
 			__clear_task_blocked_on(p, NULL);
 			if (task_current(rq, p)) {
-				p->is_blocked = 0;
+				unblock_task(p);
 				return p;
 			}
 			goto deactivate;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 8d805aa7c85dc..d798bc63dfa5b 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -3082,11 +3082,6 @@ static inline void __block_task(struct rq *rq, struct task_struct *p)
 	if (p->sched_contributes_to_load)
 		rq->nr_uninterruptible++;
 
-	if (p->in_iowait) {
-		atomic_inc(&rq->nr_iowait);
-		delayacct_blkio_start();
-	}
-
 	ASSERT_EXCLUSIVE_WRITER(p->on_rq);
 
 	/*
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0346/1005] sched/pelt: Fix u32 truncation of the PELT period count
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (344 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0345/1005] sched/core: Account I/O waits independently of delayed dequeue Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0347/1005] sched/topology: Balance cluster static-key updates Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hui Su, Peter Zijlstra (Intel),
	Ingo Molnar, Vincent Guittot, Kayra Cizmeci, Sasha Levin

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

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

From: Hui Su <sh_def@163.com>

[ Upstream commit a0c755e574e37fddb59edf175f27dc3877e7fe23 ]

accumulate_sum() computes the number of elapsed PELT periods in a
u64 but returns u32. When the count is a multiple of 2^32, it is
truncated to zero even though the PELT sums have been updated.

The caller interprets zero as no period boundary crossed and skips
recomputing the averages, leaving *_avg stale relative to *_sum.

Return the period count as u64 so the caller can test it without
truncation.

Fixes: a481db34b9be ("sched/fair: Optimize ___update_sched_avg()")
Signed-off-by: Hui Su <sh_def@163.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Kayra Cizmeci <kayracizmeci@gmail.com>
Link: https://patch.msgid.link/20261023025207.2967903-1-sh_def@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/pelt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
index 779eb58a42614..d10d57b6b8ec7 100644
--- a/kernel/sched/pelt.c
+++ b/kernel/sched/pelt.c
@@ -99,7 +99,7 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3)
  *      d1 y^p + 1024 \Sum y^n + d3 y^0		(Step 2)
  *                     n=1
  */
-static __always_inline u32
+static __always_inline u64
 accumulate_sum(u64 delta, struct sched_avg *sa,
 	       unsigned long load, unsigned long runnable, int running)
 {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0347/1005] sched/topology: Balance cluster static-key updates
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (345 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0346/1005] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0348/1005] sched/cache: Ignore non-fair current in alb_break_llc() Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hui Su, Peter Zijlstra (Intel),
	Ingo Molnar, K Prateek Nayak, Kayra Cizmeci, Sasha Levin

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

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

From: Hui Su <sh_def@163.com>

[ Upstream commit 5ebdfe12ab96368d0339593129d4ce0bc2bd06f5 ]

build_sched_domains() increments sched_cluster_active once per newly
built partition that contains an SD_CLUSTER domain.
detach_destroy_domains() instead tested the global static key before
decrementing it, so destroying a cluster-less partition could drop a
reference owned by another partition and disable cluster-aware
scheduling while SD_CLUSTER domains remained installed.

Check the installed domains before detaching them, only while the key is
enabled, and decrement only when the removed partition contains an
SD_CLUSTER domain.

With two cluster-bearing partitions installed, removing a singleton
partition left the baseline count at 1 where 2 partitions still
carried SD_CLUSTER; the fixed kernel correctly reports 2.  On an
asymmetric cluster topology where the parent partition gains no
cluster domain, the baseline count drops to 0 while a cluster
partition remains installed; the fixed kernel keeps it at 1.

Fixes: 8881e1639f1f ("sched/fair: Scan cluster before scanning LLC in wake-up path")
Signed-off-by: Hui Su <sh_def@163.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Reviewed-by: Kayra Cizmeci <kayracizmeci@gmail.com>
Link: https://patch.msgid.link/20261021043834.1140951-1-sh_def@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/topology.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 3dab0253976fb..21e3ab1af4c85 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -3314,13 +3314,25 @@ int __init sched_init_domains(const struct cpumask *cpu_map)
 static void detach_destroy_domains(const struct cpumask *cpu_map)
 {
 	unsigned int cpu = cpumask_any(cpu_map);
+	bool has_cluster = false;
 	int i;
 
 	if (rcu_access_pointer(per_cpu(sd_asym_cpucapacity, cpu)))
 		static_branch_dec_cpuslocked(&sched_asym_cpucapacity);
 
-	if (static_branch_unlikely(&sched_cluster_active))
-		static_branch_dec_cpuslocked(&sched_cluster_active);
+	if (static_branch_unlikely(&sched_cluster_active)) {
+		rcu_read_lock();
+		for_each_cpu(i, cpu_map) {
+			if (lowest_flag_domain(i, SD_CLUSTER)) {
+				has_cluster = true;
+				break;
+			}
+		}
+		rcu_read_unlock();
+
+		if (has_cluster)
+			static_branch_dec_cpuslocked(&sched_cluster_active);
+	}
 
 	rcu_read_lock();
 	for_each_cpu(i, cpu_map)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0348/1005] sched/cache: Ignore non-fair current in alb_break_llc()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (346 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0347/1005] sched/topology: Balance cluster static-key updates Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0349/1005] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kayra Cizmeci,
	Peter Zijlstra (Intel), Ingo Molnar, Tim Chen, Sasha Levin

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

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

From: Kayra Cizmeci <kayracizmeci@gmail.com>

[ Upstream commit 006991aa89974378ee579416dba87adc22cd60fd ]

Commit d6b9afab44e23 ("sched/cache: Fix
checking active load balance by only considering the CFS task")
stopped using task_util() for non-fair cur.

__active_load_balance_cpu_stop() calls detach_one_task(), that only looks
to cfs_tasks list. So if the rq->curr is not fair, doing a decision
according to it is wrong, since we only migrate tasks that is fair.

Commit f0d243a96f26 ("sched/fair: Avoid creating misfits during
cache-aware balancing") passes cur to task_misfits_asym_cpu()
without checking if the cur is in fair class or not. Fix this.

Fixes: f0d243a96f26 ("sched/fair: Avoid creating misfits during cache-aware balancing")
Signed-off-by: Kayra Cizmeci <kayracizmeci@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com>
Link: https://patch.msgid.link/20261020185402.57017-1-kayracizmeci@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/fair.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 327d5f8f45966..d1ea0e53f1657 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -11035,7 +11035,14 @@ alb_break_llc(struct lb_env *env)
 			return true;
 
 		cur = rcu_dereference_all(env->src_rq->curr);
-		if (cur && cur->sched_class == &fair_sched_class)
+		/*
+		 * Active balance only detaches CFS tasks, so a non-fair
+		 * curr is never migrated. Ignore it and avoid using its
+		 * state util in the misfit and LLC checks.
+		 */
+		if (cur && cur->sched_class != &fair_sched_class)
+			cur = NULL;
+		if (cur)
 			util = task_util(cur);
 
 		if (task_misfits_asym_cpu(env, cur) ||
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0349/1005] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (347 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0348/1005] sched/cache: Ignore non-fair current in alb_break_llc() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0350/1005] gpio: mpfs: reject unsupported interrupt types Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Mason, Eric Dumazet,
	Paolo Abeni, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit 475ff14ba558bb8857bca878f1d593784ccc4f0f ]

snd_cwnd has no practical upper bound: snd_cwnd_clamp defaults to ~0,
and RTAX_INITCWND, a locked RTAX_CWND metric, TCP_BPF_IW and
TCP_BPF_SNDCWND_CLAMP accept any positive value.

Congestion control modules do u32 arithmetic on cwnd that assumes
much smaller values. For instance, ssthresh() handlers compute:

  CUBIC, BIC, ROCCET:  cwnd * (BICTCP_BETA_SCALE + beta), up to 2047
  DCTCP:               cwnd * dctcp_alpha, up to 1024
  CDG, NV, CUBIC, ...: cwnd * beta, below 1024

With a large initcwnd route or TCP_BPF_IW, cwnd is set directly to
such values, and the next RTO or recovery calls ->ssthresh() with it.
The product then wraps: DCTCP with cwnd = 2^24 and alpha = 1024 gets
ssthresh == cwnd, and CUBIC computes a wrong ssthresh and Wmax.
CUBIC bictcp_update() also expects cwnd below about one million packets.

The paths that can grow cwnd by large amounts (tcp_slow_start(),
tcp_cong_avoid_ai(), bbr_set_cwnd() and tcp_init_cwnd()) already
bound it by snd_cwnd_clamp, so give snd_cwnd_clamp a finite default
of 2^20 packets, and cap the metric and BPF paths that set it or set
cwnd directly.

2^20 packets do not limit real flows: with the maximum window scale
of 14, a peer can not advertise more than 65535 << 14 bytes (~1GB),
which is less than 2^20 packets for any MSS of 1024 bytes or more.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Chris Mason <mason@kernel.org>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261030111528.2850082-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/tcp.h      | 9 +++++++++
 net/core/filter.c      | 3 ++-
 net/ipv4/tcp.c         | 2 +-
 net/ipv4/tcp_metrics.c | 3 ++-
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4416cdf9bf30e..00c2bcd5cac2d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1514,6 +1514,15 @@ static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
 
 #define TCP_INFINITE_SSTHRESH	0x7fffffff
 
+/* Default and maximum snd_cwnd_clamp, in packets.
+ * A peer can not advertise more than 65535 << 14 bytes, so a larger
+ * cwnd is useless with any MSS of 1024 bytes or more.
+ * Congestion control modules multiply cwnd by u32 factors up to 2047
+ * (cwnd * (BICTCP_BETA_SCALE + beta) in CUBIC), and CUBIC's
+ * bictcp_update() expects cwnd to stay below about one million packets.
+ */
+#define TCP_MAX_SND_CWND	(1U << 20)
+
 static inline u32 tcp_snd_cwnd(const struct tcp_sock *tp)
 {
 	return tp->snd_cwnd;
diff --git a/net/core/filter.c b/net/core/filter.c
index 7129e7c920a64..3cce0ddd3192e 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -5652,11 +5652,12 @@ static int bpf_sol_tcp_setsockopt(struct sock *sk, int optname,
 	case TCP_BPF_IW:
 		if (val <= 0 || tp->data_segs_out > tp->syn_data)
 			return -EINVAL;
-		tcp_snd_cwnd_set(tp, val);
+		tcp_snd_cwnd_set(tp, min_t(u32, val, tp->snd_cwnd_clamp));
 		break;
 	case TCP_BPF_SNDCWND_CLAMP:
 		if (val <= 0)
 			return -EINVAL;
+		val = min_t(u32, val, TCP_MAX_SND_CWND);
 		tp->snd_cwnd_clamp = val;
 		WRITE_ONCE(tp->snd_ssthresh, val);
 		break;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 73d5b7c8e3c78..49eccd16776f8 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -455,7 +455,7 @@ void tcp_init_sock(struct sock *sk)
 	 * initialization of these values.
 	 */
 	tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
-	tp->snd_cwnd_clamp = ~0;
+	tp->snd_cwnd_clamp = TCP_MAX_SND_CWND;
 	tp->mss_cache = TCP_MSS_DEFAULT;
 
 	tp->reordering = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reordering);
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index d58f99c67d4dc..ae551546422fe 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -495,7 +495,8 @@ void tcp_init_metrics(struct sock *sk)
 	}
 
 	if (tcp_metric_locked(tm, TCP_METRIC_CWND))
-		tp->snd_cwnd_clamp = tcp_metric_get(tm, TCP_METRIC_CWND);
+		tp->snd_cwnd_clamp = min(tcp_metric_get(tm, TCP_METRIC_CWND),
+					 TCP_MAX_SND_CWND);
 
 	val = READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) ?
 	      0 : tcp_metric_get(tm, TCP_METRIC_SSTHRESH);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0350/1005] gpio: mpfs: reject unsupported interrupt types
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (348 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0349/1005] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0351/1005] x86/kcfi: Dont emit KCFI_REFERENCE() in modules Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, kernel test robot, Dan Carpenter,
	Isaac Adjei, Bartosz Golaszewski, Sasha Levin

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

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

From: Isaac Adjei <code@isaacadjei.me>

[ Upstream commit cfbd01eddaf5bfdd4f53560013fe830571a186e9 ]

The switch statement in mpfs_gpio_irq_set_type() does not handle
unsupported interrupt types. For example, IRQ_TYPE_NONE is not listed.

When an unsupported type is passed, interrupt_type remains
uninitialised. Its undefined value is then written to the GPIO control
register. The function still returns 0, making the caller believe the
operation succeeded.

Add a default case to return -EINVAL for unsupported interrupt types.

Smatch reported the following warning:

  drivers/gpio/gpio-mpfs.c:144 mpfs_gpio_irq_set_type() error: uninitialized symbol 'interrupt_type'.

I built the driver with W=1 and got no warnings. I also reran Smatch
and confirmed that the warning was resolved.

This is compile-tested only. I do not have access to PolarFire SoC
hardware for runtime testing.

Fixes: e57b53f0f36a ("gpio: mpfs: Add interrupt support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202411080149.bOpayvf6-lkp@intel.com/
Signed-off-by: Isaac Adjei <code@isaacadjei.me>
Link: https://patch.msgid.link/20261105-gpio-mpfs-irq-type-v1-1-cbb2b0b2a807@isaacadjei.me
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-mpfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-mpfs.c b/drivers/gpio/gpio-mpfs.c
index 7f0751d7b1c4b..0b7a48e0ac262 100644
--- a/drivers/gpio/gpio-mpfs.c
+++ b/drivers/gpio/gpio-mpfs.c
@@ -138,6 +138,8 @@ static int mpfs_gpio_irq_set_type(struct irq_data *data, unsigned int type)
 	case IRQ_TYPE_LEVEL_LOW:
 		interrupt_type = MPFS_GPIO_TYPE_INT_LEVEL_LOW;
 		break;
+	default:
+		return -EINVAL;
 	}
 
 	regmap_update_bits(mpfs_gpio->regs, MPFS_GPIO_CTRL(gpio_index),
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0351/1005] x86/kcfi: Dont emit KCFI_REFERENCE() in modules
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (349 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0350/1005] gpio: mpfs: reject unsupported interrupt types Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0352/1005] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ridge Lomont, Peter Zijlstra (Intel),
	Ingo Molnar, Nathan Chancellor, Sasha Levin

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

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

From: Ridge Lomont <cyridge@proton.me>

[ Upstream commit fb685de78e6bf79e49854e7d149f69b125583de5 ]

KCFI_REFERENCE() takes the address of a symbol so that the compiler
emits its __kcfi_typeid_ symbol, which the SYM_TYPED_FUNC_START()
assembly implementing it needs. It is used from arch/x86 headers for
__clear_pages_unrolled(), copy_page(), __memset() and __memmove(), and
all of that assembly is built into vmlinux.

Modules include the same headers, so with CONFIG_CFI=y every module
also gets an __ADDRESSABLE() reference to each of these symbols in
.discard.addressable. This serves no purpose there, and since
__clear_pages_unrolled() is EXPORT_SYMBOL_GPL, modpost now rejects any
GPL-incompatible module that includes <linux/mm.h>:

  ERROR: modpost: GPL-incompatible module repro.ko uses GPL-only
  symbol '__clear_pages_unrolled'

even though the module never uses the symbol. This makes OpenZFS
impossible to build against CFI kernels; its configure checks fail
in the same way and are misreported as CONFIG_DEBUG_LOCK_ALLOC.

scripts/module.lds.S does not help here: modpost checks <module>.o
before the final link, and even after it the discarded section only
loses its relocations, the undefined symbols stay in .symtab, where
the module loader resolves them with the same license check.

Only emit the reference when building vmlinux.

Tested on x86_64 with clang 23.1.3 and CONFIG_CFI=y, with both
CONFIG_LTO_CLANG_FULL=y (the configuration from the Fixes: commit) and
CONFIG_LTO_CLANG_THIN=y: vmlinux links without warnings and still contains
__kcfi_typeid___clear_pages_unrolled, __kcfi_typeid_copy_page,
__kcfi_typeid___memset and __kcfi_typeid___memmove. It boots in QEMU
with no CFI failures. A minimal module with MODULE_LICENSE("Proprietary")
including <linux/mm.h> fails modpost before this change and builds and
loads after it. OpenZFS builds against a CFI kernel with this change,
and its pool, encryption, checksum and send/recv operations run
without CFI failures, in QEMU and on a desktop with CFI enforcing.

Fixes: 9b041a4b66b3 ("x86/mm: Ensure clear_page() variants always have __kcfi_typeid_ symbols")
Assisted-by: LLM
Signed-off-by: Ridge Lomont <cyridge@proton.me>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Link: https://github.com/openzfs/zfs/issues/18092
Link: https://patch.msgid.link/20261027-kcfi-reference-modules-v2-1-3a3247f15806@proton.me
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/compiler.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index cb2f6050bdf7d..a7e57ffb6126d 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -241,10 +241,13 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
 
 #endif /* __KERNEL__ */
 
-#if defined(CONFIG_CFI) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
+#if defined(CONFIG_CFI) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO) && \
+	!defined(MODULE)
 /*
  * Force a reference to the external symbol so the compiler generates
- * __kcfi_typid.
+ * __kcfi_typid. Only vmlinux needs it, as that is where the assembly
+ * using the typeid lives; in a module it would only add a reference to
+ * the symbol, which fails modpost if the symbol is GPL-only.
  */
 #define KCFI_REFERENCE(sym) __ADDRESSABLE(sym)
 #else
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0352/1005] net/mlx5e: TC, Fix double free of branch in failure
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (350 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0351/1005] x86/kcfi: Dont emit KCFI_REFERENCE() in modules Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0353/1005] locking/lockdep: Fix inverted "on"/"last" CPU label in lockdep_print_held_locks() Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Thomas Fourier, Tariq Toukan,
	Dave Miller, Sasha Levin

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

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

From: Thomas Fourier <fourier.thomas@gmail.com>

[ Upstream commit 31f9b43a3bb3d2201eadd147440252d0912dab21 ]

When allocating the false branch fails in parse_branch_ctrl(), the
already allocated true branch is freed but attr->branch_true is left
pointing to it. The caller parse_tc_actions() fails the flow, and
free_flow_post_acts(), mlx5_free_flow_attr_actions() which calls again
free_branch_attr() on attr->branch_true.

Clear the pointer after freeing it.

This bug is theoretical and was compile tested only.

Fixes: f86488cb4685 ("net/mlx5e: TC, initialize branch flow attributes")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Tested-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index b290beb4369ad..c40c7b55a54d8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -4005,6 +4005,7 @@ parse_branch_ctrl(struct flow_action_entry *act, struct mlx5e_tc_act *tc_act,
 
 err_branch_false:
 	free_branch_attr(flow, attr->branch_true);
+	attr->branch_true = NULL;
 out_err:
 	return err;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0353/1005] locking/lockdep: Fix inverted "on"/"last" CPU label in lockdep_print_held_locks()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (351 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0352/1005] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0354/1005] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhuangzhuang Wang,
	Peter Zijlstra (Intel), Ingo Molnar, Sasha Levin

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

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

From: Zhuangzhuang Wang <3050681779@qq.com>

[ Upstream commit aa63c0df79920f6abe1b66e1f8b6443ad2d62d0e ]

Commit 051f5d223dfc ("lockdep: Enable the printing of held locks of
remote running tasks and print task CPU") added the task's CPU to the
"locks held by" line. As the comment above the printk() describes, a
running task should be reported as "on CPU#N" and a task that is not
running as "last CPU#N". The ternary has the two strings swapped, so
the labels are inverted.

Swap the strings so the output matches the comment.

Fixes: 051f5d223dfc ("lockdep: Enable the printing of held locks of remote running tasks and print task CPU")
Signed-off-by: Zhuangzhuang Wang <3050681779@qq.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20261030-lockdep-fix-cpu-label-v1-1-96875c74b15b@qq.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/locking/lockdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index c3dc84a7cef26..fdae495bf918b 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -811,7 +811,7 @@ static void lockdep_print_held_locks(struct task_struct *p)
 	 */
 	printk("locks held by %s/%d: %d, %s CPU#%d%s\n",
 		p->comm, task_pid_nr(p), depth,
-		task_is_running(p) ? "last" : "on", task_cpu(p),
+		task_is_running(p) ? "on" : "last", task_cpu(p),
 		depth > 0 ? ":" : "");
 
 	for (i = 0; i < depth; i++) {
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0354/1005] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (352 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0353/1005] locking/lockdep: Fix inverted "on"/"last" CPU label in lockdep_print_held_locks() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0355/1005] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Laight, Peter Zijlstra (Intel),
	Ingo Molnar, Linus Torvalds, Waiman Long, linux-kernel,
	Sasha Levin

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

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

From: Peter Zijlstra <peterz@infradead.org>

[ Upstream commit 1b9e01fcc47aff00d2fd64693c5dcd620eff5865 ]

The atomic_cmpxchg() in osq_wait_next() removes the current CPU's node
from the tail of the queue and puts @old_cpu back.

This is very much like an 'unlock', which is RELEASE, rather than
ACQUIRE.

Additionally, on success (the only case where the ordering is
effective), this returns NULL which means both callsites will do nothing
more, there are no subsequent operations to order against.

Furthermore, the osq_lock() caller will then return false, indicating
failure to acquire -- the mutex must go block. Again, not making a case
for ACQUIRE.  Neither atomics nor locks provide ordering on failure.

Since ACQUIRE makes no sense, while RELEASE makes it more symmetric with
osq_unlock(), switch the ordering. This then makes osq_unlock()
consistently RELEASE.

Fixes: c55a6ffa6285 ("locking/osq: Relax atomic semantics")
Suggested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Waiman Long <longman@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/locking/osq_lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index b4233dc2c2b04..98b12d7b79964 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -59,7 +59,7 @@ osq_wait_next(struct optimistic_spin_queue *lock,
 
 	for (;;) {
 		if (atomic_read(&lock->tail) == curr &&
-		    atomic_cmpxchg_acquire(&lock->tail, curr, old_cpu) == curr) {
+		    atomic_cmpxchg_release(&lock->tail, curr, old_cpu) == curr) {
 			/*
 			 * We were the last queued, we moved @lock back. @prev
 			 * will now observe @lock and will complete its
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0355/1005] locking/osq: Fix unlink queue corruption
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (353 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0354/1005] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0356/1005] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Laight, Peter Zijlstra (Intel),
	Ingo Molnar, Linus Torvalds, Waiman Long, linux-kernel,
	Sasha Levin

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

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

From: Peter Zijlstra <peterz@infradead.org>

[ Upstream commit 408b129aac48b574c0c9d11137a89eefba825d5d ]

Very similar to commit 50972fe78f24 ("locking/osq_lock: Fix osq_lock
queue corruption"), make sure to order the prev->next store against
the next->prev store.

Fixes: 50972fe78f24 ("locking/osq_lock: Fix osq_lock queue corruption")
Suggested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Waiman Long <longman@redhat.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/locking/osq_lock.c | 60 +++++++++++++++++++++++++++++----------
 1 file changed, 45 insertions(+), 15 deletions(-)

diff --git a/kernel/locking/osq_lock.c b/kernel/locking/osq_lock.c
index 98b12d7b79964..2bcc148eb2ddb 100644
--- a/kernel/locking/osq_lock.c
+++ b/kernel/locking/osq_lock.c
@@ -90,6 +90,49 @@ osq_wait_next(struct optimistic_spin_queue *lock,
 	}
 }
 
+/*
+ * Set prev->next; this is the counterpart of osq_wait_next() in that
+ * by setting ->next the wait is terminated and progress is resumed.
+ */
+static inline void osq_link_next(struct optimistic_spin_node *prev,
+				 struct optimistic_spin_node *next)
+{
+	/*
+	 * Suppose:
+	 *
+	 *                   tail
+	 *                    |
+	 *                    V
+	 *   CPU1 -> CPU2 -> CPU3:
+	 *   n: 2    n: 3    n: nil
+	 *   p: nil  p: 1    p: 2
+	 *
+	 * And this is CPU2 doing the self-unqueue concurrent against CPU1s
+	 * unlock()/unqueue(). Since 'prev->next == NULL' and CPU1 will be
+	 * stuck in osq_wait_next() until the below store of 'prev->next'.
+	 *
+	 * CPU2				CPU1
+	 *
+	 * next->prev = prev;		osq_wait_next()
+	 * WMB				MB
+	 * prev->next = next;		next->prev = prev
+	 *
+	 * Without the WMB it would be possible to have conflicting stores
+	 * like:
+	 *
+	 * CPU2				CPU1
+	 *
+	 * prev->next = next // CPU1.n = 3
+	 *				next = osq_wait_next() // = 3
+	 *				next->prev = prev // CPU3.p = nil
+	 * next->prev = prev // CPU3.p = 1
+	 *
+	 * Which would result in list corruption.
+	 */
+	smp_wmb();
+	WRITE_ONCE(prev->next, next);
+}
+
 bool osq_lock(struct optimistic_spin_queue *lock)
 {
 	struct optimistic_spin_node *node = this_cpu_ptr(&osq_node);
@@ -113,20 +156,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
 
 	prev = decode_cpu(old);
 	node->prev = prev;
-
-	/*
-	 * osq_lock()			unqueue
-	 *
-	 * node->prev = prev		osq_wait_next()
-	 * WMB				MB
-	 * prev->next = node		next->prev = prev // unqueue-C
-	 *
-	 * Here 'node->prev' and 'next->prev' are the same variable and we need
-	 * to ensure these stores happen in-order to avoid corrupting the list.
-	 */
-	smp_wmb();
-
-	WRITE_ONCE(prev->next, node);
+	osq_link_next(prev, node);
 
 	/*
 	 * Normally @prev is untouchable after the above store; because at that
@@ -202,7 +232,7 @@ bool osq_lock(struct optimistic_spin_queue *lock)
 	 */
 
 	WRITE_ONCE(next->prev, prev);
-	WRITE_ONCE(prev->next, next);
+	osq_link_next(prev, next);
 
 	return false;
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0356/1005] perf/x86/amd/uncore: Avoid context migration from non-owners
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (354 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0355/1005] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0358/1005] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sandipan Das, Peter Zijlstra (Intel),
	Sasha Levin

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

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

From: Sandipan Das <sandipan.das@amd.com>

[ Upstream commit 0ae655bce1934857fa3e316ddcb4be38c30dbd38 ]

Each uncore context is owned by a single CPU that hosts all events for
the corresponding uncore domain and is advertised through the sysfs
cpumask attribute. When a CPU goes offline, the context is migrated to
an online sibling if the departing CPU is the owner.

Before commit d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore
management"), uncore_down_prepare() checked whether the CPU going
offline owned the context. The check was lost when the function was
replaced by amd_uncore_ctx_move(). Hence, when a CPU that is not the
owner goes offline, ownership is always handed over to the first online
sibling in the uncore domain irrespective of whether another sibling
already owns it. This goes unnoticed as long as the owner is the
lowest-numbered online CPU in the domain, since the first online
sibling is then the owner itself. Once ownership has moved, that no
longer holds.

For example, consider an L3 domain spanning CPUs 8-15,136-143 and owned
by CPU 8.

  $ cat /sys/bus/event_source/devices/amd_l3/cpumask
  0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120

  $ echo 0 | sudo tee /sys/devices/system/cpu/cpu8/online
  $ cat /sys/bus/event_source/devices/amd_l3/cpumask
  0,9,16,24,32,40,48,56,64,72,80,88,96,104,112,120

  $ echo 1 | sudo tee /sys/devices/system/cpu/cpu8/online
  $ cat /sys/bus/event_source/devices/amd_l3/cpumask
  0,9,16,24,32,40,48,56,64,72,80,88,96,104,112,120

  $ echo 0 | sudo tee /sys/devices/system/cpu/cpu10/online
  $ cat /sys/bus/event_source/devices/amd_l3/cpumask
  0,8-9,16,24,32,40,48,56,64,72,80,88,96,104,112,120

Offlining CPU 8 correctly moves ownership to CPU 9 and onlining it
again leaves CPU 9 as the owner. However, offlining CPU 10 then makes
CPU 8 the owner while existing events remain on CPU 9. Both CPUs are
now advertised for the same domain, so tools that open an event on
every CPU in the cpumask count the domain twice, and the context gets
modified from two CPUs without any synchronization.

Restore the ownership check that was lost during the refactor.

Fixes: d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management")
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/273135a6d33a40f442fb18e140a90689fae7cd32.1793614726.git.sandipan.das@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/events/amd/uncore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index 7181973b5b127..b58e0ada85467 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -610,7 +610,7 @@ static void amd_uncore_ctx_move(struct amd_uncore *uncore, unsigned int cpu)
 	for (i = 0; i < uncore->num_pmus; i++) {
 		pmu = &uncore->pmus[i];
 		curr = *per_cpu_ptr(pmu->ctx, cpu);
-		if (!curr)
+		if (!curr || curr->cpu != cpu)
 			continue;
 
 		/* Migrate to a shared sibling if possible */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0358/1005] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (355 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0356/1005] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0359/1005] cpufreq: Preserve global boost state on failed updates Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dheeraj Kumar Srivastava, Ankit Soni,
	Vasant Hegde, Joerg Roedel, Sasha Levin

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

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

From: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>

[ Upstream commit ec91bb159dc24eefe144ef8867937f4a055dd0e2 ]

iommu_snp_enable() checks that the IOMMU can support SNP and sets
amd_iommu_snp_en, then calls snp_rmptable_init() to map the RMP table.
If that call fails, CC_ATTR_HOST_SEV_SNP is cleared but amd_iommu_snp_en
is left set. Later IOMMU initialization uses amd_iommu_snp_en to
configure the IOMMU for SNP, on the assumption that RMP setup succeeded.

Clear amd_iommu_snp_en along with CC_ATTR_HOST_SEV_SNP.

Fixes: 409f45387c93 ("x86/sev: Fix broken SNP support with KVM module built-in")
Signed-off-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iommu/amd/init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index cfc061a4247a2..8b924d084ab72 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3493,6 +3493,7 @@ static __init void iommu_snp_enable(void)
 	return;
 
 disable_snp:
+	amd_iommu_snp_en = false;
 	cc_platform_clear(CC_ATTR_HOST_SEV_SNP);
 #endif
 }
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0359/1005] cpufreq: Preserve global boost state on failed updates
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (356 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0358/1005] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0367/1005] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christian Loehle, Pengjie Zhang,
	Zhongqiu Han, Sumit Gupta, Rafael J. Wysocki, Sasha Levin

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

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

From: Christian Loehle <christian.loehle@arm.com>

[ Upstream commit a0cde2b601bc32b76d61e50141c619790e5e2e41 ]

cpufreq_boost_trigger_state() restores the opposite of the requested
state when updating policy boost state fails. For example, a failed
write of 0 when global boost is already disabled enables the global
flag without enabling any policies.

Save the original global boost state and restore it on failure.

Fixes: 121baab7b88e ("cpufreq: Force sync policy boost with global boost on sysfs update")
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Reviewed-by: Pengjie Zhang <zhangpengjie2@huawei.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Link: https://patch.msgid.link/20261105215223.1263415-2-christian.loehle@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/cpufreq/cpufreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 015962e6c1fe4..4bf7738a81b0f 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2818,6 +2818,7 @@ static int cpufreq_boost_trigger_state(int state)
 {
 	struct cpufreq_policy *policy;
 	unsigned long flags;
+	bool boost_enabled;
 	int ret = -EOPNOTSUPP;
 
 	/*
@@ -2826,6 +2827,7 @@ static int cpufreq_boost_trigger_state(int state)
 	 */
 
 	write_lock_irqsave(&cpufreq_driver_lock, flags);
+	boost_enabled = cpufreq_driver->boost_enabled;
 	cpufreq_driver->boost_enabled = state;
 	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
 
@@ -2847,7 +2849,7 @@ static int cpufreq_boost_trigger_state(int state)
 		return 0;
 
 	write_lock_irqsave(&cpufreq_driver_lock, flags);
-	cpufreq_driver->boost_enabled = !state;
+	cpufreq_driver->boost_enabled = boost_enabled;
 	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
 
 	pr_err("%s: Cannot %s BOOST\n",
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0367/1005] calipso: do not charge request socket options to the listener
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (357 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0359/1005] cpufreq: Preserve global boost state on failed updates Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0368/1005] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sashiko, Eric Dumazet,
	Kuniyuki Iwashima, Paul Moore, Jakub Kicinski, Sasha Levin

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

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

From: Eric Dumazet <edumazet@kernel.org>

[ Upstream commit b4a2cc6d748d3056a25812dcf5f5377a59afd02f ]

calipso_req_setattr() and calipso_req_delattr() allocate ireq->ipv6_opt
with ipv6_renew_options(), which charges the listener sk_omem_alloc
through sock_kmalloc().

tcp_v6_reqsk_destructor() frees ireq->ipv6_opt without uncharging it,
so each request socket leaks its options size from the listener
budget. Once sysctl_optmem_max is reached, sock_kmalloc() fails,
calipso_req_setattr() returns -ENOBUFS, and tcp_v6_route_req() drops
all subsequent SYN packets. __sk_destruct() also reports an optmem
leakage when the listener is destroyed.

Uncharging in tcp_v6_reqsk_destructor() would not be correct: after a
migration, req->rsk_listener is no longer the socket that was charged.

These options belong to the request socket, there is no reason to
charge them to the listener. Change ipv6_renew_options() to use
kmalloc() when its sk argument is NULL, and use this from
calipso_req_setattr() and calipso_req_delattr(),
like cipso_v4_req_setattr() which uses kzalloc().

Note:

After this patch, calipso_req_setattr() and calipso_req_delattr()
no longer need the listener. Commit 10876da918fa ("calipso: Fix
null-ptr-deref in calipso_req_{set,del}attr().") could be reverted
in net-next (also removing the then unused sk variables), so that
CALIPSO works with SYN cookies.

Fixes: e1adea927080 ("calipso: Allow request sockets to be relabelled by the lsm.")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179378292255.488856.6917577451813010963@kernel.org/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Link: https://patch.msgid.link/20261104150318.1156620-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/calipso.c | 12 ++++--------
 net/ipv6/exthdrs.c |  5 +++--
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c
index e399a42e30839..4cd0ae9313b32 100644
--- a/net/ipv6/calipso.c
+++ b/net/ipv6/calipso.c
@@ -1219,7 +1219,7 @@ static int calipso_req_setattr(struct request_sock *req,
 	if (IS_ERR(new))
 		return PTR_ERR(new);
 
-	txopts = ipv6_renew_options(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
+	txopts = ipv6_renew_options(NULL, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
 
 	kfree(new);
 
@@ -1227,10 +1227,8 @@ static int calipso_req_setattr(struct request_sock *req,
 		return PTR_ERR(txopts);
 
 	txopts = xchg(&req_inet->ipv6_opt, txopts);
-	if (txopts) {
-		atomic_sub(txopts->tot_len, &sk->sk_omem_alloc);
+	if (txopts)
 		txopt_put(txopts);
-	}
 
 	return 0;
 }
@@ -1260,14 +1258,12 @@ static void calipso_req_delattr(struct request_sock *req)
 	if (calipso_opt_del(req_inet->ipv6_opt->hopopt, &new))
 		return; /* Nothing to do */
 
-	txopts = ipv6_renew_options(sk, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
+	txopts = ipv6_renew_options(NULL, req_inet->ipv6_opt, IPV6_HOPOPTS, new);
 
 	if (!IS_ERR(txopts)) {
 		txopts = xchg(&req_inet->ipv6_opt, txopts);
-		if (txopts) {
-			atomic_sub(txopts->tot_len, &sk->sk_omem_alloc);
+		if (txopts)
 			txopt_put(txopts);
-		}
 	}
 	kfree(new);
 }
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 3ef3c2635581a..b523de2e5b7a1 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -1281,7 +1281,7 @@ static void ipv6_renew_option(int renewtype,
  * not copied into the new set of options.
  *
  * The new set of options is allocated from the socket option memory
- * buffer of @sk.
+ * buffer of @sk, or with kmalloc() if @sk is NULL.
  */
 struct ipv6_txoptions *
 ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
@@ -1309,7 +1309,8 @@ ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
 		return NULL;
 
 	tot_len += sizeof(*opt2);
-	opt2 = sock_kmalloc(sk, tot_len, GFP_ATOMIC);
+	opt2 = sk ? sock_kmalloc(sk, tot_len, GFP_ATOMIC) :
+		    kmalloc(tot_len, GFP_ATOMIC);
 	if (!opt2)
 		return ERR_PTR(-ENOBUFS);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0368/1005] ipv6: Check the Home Address option again before its address is used
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (358 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0367/1005] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0369/1005] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Ido Schimmel,
	Jakub Kicinski, Sasha Levin

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

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

From: Alexei Starovoitov <ast@kernel.org>

[ Upstream commit 30c71476d842b094651bd7712f6c8ee8716147d0 ]

ipv6_dest_hao() checks the Home Address option and sets IP6CB(skb)->dsthao
to the offset of the destination options header. Later mip6_addr_swap() and
mip6_destopt_reject() call ipv6_find_tlv() with that offset and use the 16
address bytes. They assume that the same header is still there.

But the seg6 and ioam6 lwtunnels, the End.B6 actions, ipv6_rpl_srh_rcv()
and BPF lwt progs move or rewrite the IPv6 headers and keep IP6CB(skb).
Then ipv6_find_tlv() parses other bytes. It returns when the type matches,
before it checks that the option is inside the header. Nobody checks the
length of the option again. Thus mip6_addr_swap() can write after the data
of the skb. mip6_destopt_reject() can copy that memory to an xfrm report.

In ipv6_find_tlv(), check the length of an option before its type. The
returned option is then inside the header, and the header is inside the
linear data. In both callers, ignore an option with a length other than 16,
as if ipv6_find_tlv() found none. Then the ICMPv6 error goes to the source
address of the IPv6 header, and the xfrm report has no XFRMA_COADDR
attribute. Nothing changes for a header that ip6_parse_tlv() accepted and
that is still in its place. For the other callers an incomplete option is
now absent:

 - ip6_find_1stfragopt() and mip6_rthdr_offset() can return another offset
   for the fragment header or the xfrm header, also in a forwarded packet.
 - calipso_skbuff_optptr() returns NULL. netlbl_skbuff_getattr() and
   netlbl_cache_add() then see no option. calipso_skbuff_delattr() returns
   0 and the packet continues unchanged. Today it returns -EINVAL and
   SELinux drops the packet. It already returns 0 when an earlier option is
   incomplete. The receiver drops such a header in ip6_parse_tlv().

The code that moves the headers still does not reset the offset or the
other fields of IP6CB(skb). If the bytes there look like a header with a
Home Address option of length 16, both callers still use its address.

The first tag also covers ipv6_find_tlv(), because its early return did no
harm before mip6_addr_swap(). The second tag is for mip6_destopt_reject().

Fixes: 793832361fe7 ("[IPV6] MIP6: Revert address to send ICMPv6 error.")
Fixes: 70182ed23d25 ("[IPV6] MIP6: Report to user-space when home address option is rejected.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261102064922.2636027-1-alexei.starovoitov@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/exthdrs_core.c | 7 ++++---
 net/ipv6/icmp.c         | 7 ++++++-
 net/ipv6/mip6.c         | 9 ++++++++-
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
index 4a9748338cf40..764c694fb417a 100644
--- a/net/ipv6/exthdrs_core.c
+++ b/net/ipv6/exthdrs_core.c
@@ -138,9 +138,6 @@ int ipv6_find_tlv(const struct sk_buff *skb, int offset, int type)
 		int opttype = nh[offset];
 		int optlen;
 
-		if (opttype == type)
-			return offset;
-
 		switch (opttype) {
 		case IPV6_TLV_PAD1:
 			optlen = 1;
@@ -153,6 +150,10 @@ int ipv6_find_tlv(const struct sk_buff *skb, int offset, int type)
 				goto bad;
 			break;
 		}
+		/* Some callers read the option, so it must be in the header. */
+		if (opttype == type)
+			return offset;
+
 		offset += optlen;
 		len -= optlen;
 	}
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index a95b0351824f3..d8203ebad8827 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -343,7 +343,12 @@ static void mip6_addr_swap(struct sk_buff *skb, const struct inet6_skb_parm *opt
 		if (likely(off >= 0)) {
 			hao = (struct ipv6_destopt_hao *)
 					(skb_network_header(skb) + off);
-			swap(iph->saddr, hao->addr);
+			/*
+			 * The header can have moved or changed after
+			 * ipv6_dest_hao() checked the length.
+			 */
+			if (hao->length == 16)
+				swap(iph->saddr, hao->addr);
 		}
 	}
 }
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 6a16a5bd0d910..9615679724114 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -211,9 +211,16 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb,
 
 	if (likely(opt->dsthao)) {
 		offset = ipv6_find_tlv(skb, opt->dsthao, IPV6_TLV_HAO);
-		if (likely(offset >= 0))
+		if (likely(offset >= 0)) {
 			hao = (struct ipv6_destopt_hao *)
 					(skb_network_header(skb) + offset);
+			/*
+			 * The header can have moved or changed after
+			 * ipv6_dest_hao() checked the length.
+			 */
+			if (hao->length != 16)
+				hao = NULL;
+		}
 	}
 
 	stamp = skb_get_ktime(skb);
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0369/1005] ata: libata-scsi: fix MODE SELECT handling of data after the mode page
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (359 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0368/1005] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0370/1005] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
	Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 6fde0444d07ec954f3d885375e0402ff2f2e5064 ]

ata_scsi_mode_select_xlat() only supports one mode page per MODE SELECT
command, and rejects a parameter list with data after the mode page with
INVALID FIELD IN PARAMETER LIST. However:

- It does not set the field pointer, so the sense data reports 0xffff as
  the FIELD POINTER.

- It only checks for data after the mode page after the mode page
  handler has been called. ata_mselect_control_ata_feature() has then
  already updated the CDL enabled flag of the device, even though the
  command is rejected and the CDL setting of the device is not changed.

- For the control mode page, ata_mselect_control_spg0() does not need an
  ATA command, so the check is skipped, and the data after the mode page
  is silently ignored.

Check for data after the mode page before calling the mode page
handlers, and set the FIELD POINTER to the first byte after the mode
page, i.e. to the first byte of the next mode page.

The reason why only one mode page per command is supported is that a
MODE SELECT command is translated into at most one ATA command, so
update the comment accordingly.

Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-11-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-scsi.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 5be2e2597770f..3b65a086b535b 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4629,6 +4629,17 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
 	if (pg_len > len)
 		goto invalid_param_len;
 
+	/*
+	 * A MODE SELECT command is translated into at most one ATA command, so
+	 * only one mode page per command is supported. Reject any data after
+	 * the mode page before calling the mode page handlers, which may
+	 * already update the device flags.
+	 */
+	if (len > pg_len) {
+		fp = p - buffer + pg_len;
+		goto invalid_param;
+	}
+
 	switch (pg) {
 	case CACHE_MPAGE:
 		if (ata_mselect_caching(qc, p, pg_len, &fp) < 0) {
@@ -4651,13 +4662,6 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
 		goto invalid_param;
 	}
 
-	/*
-	 * Only one page has changeable data, so we only support setting one
-	 * page at a time.
-	 */
-	if (len > pg_len)
-		goto invalid_param;
-
 	return 0;
 
  invalid_fld:
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0370/1005] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (360 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0369/1005] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0371/1005] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
	Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit b29c40dc150b0b4218c4d6844770892eb6b2f6b5 ]

When the SUBPAGE CODE of the mode page in a MODE SELECT parameter list
is FFh, ata_scsi_mode_select_xlat() rejects it for the control mode
page, but accepts it for all other mode pages, i.e. for the caching
mode page, the only other mode page that it supports.

However, FFh is not the subpage code of an actual mode page: SPC-7
(7.5.2) only defines it as the MODE SENSE request code for all
subpages. SUBPAGE CODE FFh only means "all subpages" in requests, i.e.
in the MODE SENSE CDB for mode pages and in the LOG SELECT CDB for log
pages (see SPC-5, 6.8), while the SUBPAGE CODE of a mode page in a MODE
SELECT parameter list identifies a specific mode page. Also, SAT-2 and
later versions of SAT define the Caching mode page with the SPF bit set
to zero (see SAT-6, 10.4.9), i.e. without a SUBPAGE CODE field.

Remove the ALL_SUB_MPAGES case, so that SUBPAGE CODE FFh is rejected
like any other unsupported subpage.

Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-12-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-scsi.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 3b65a086b535b..26bf83188625b 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4602,19 +4602,11 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
 	}
 
 	/*
-	 * Supported subpages: all subpages and ATA feature sub-page f2h of
-	 * the control page.
+	 * The only supported subpage is the ATA feature sub-page f2h of the
+	 * control page.
 	 */
 	if (spg) {
 		switch (spg) {
-		case ALL_SUB_MPAGES:
-			/* All subpages is not supported for the control page */
-			if (pg == CONTROL_MPAGE) {
-				fp = (p[0] & 0x40) ? 1 : 0;
-				fp += hdr_len + bd_len;
-				goto invalid_param;
-			}
-			break;
 		case ATA_FEATURE_SUB_MPAGE:
 			if (qc->dev->flags & ATA_DFLAG_CDL &&
 			    pg == CONTROL_MPAGE)
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0371/1005] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (361 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0370/1005] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0372/1005] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Niklas Cassel, Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit a1eb72c477ec1320c540f27ce1e2f717d4518e62 ]

ata_scsi_mode_select_xlat() accepts the caching and control mode pages
both in page_0 format and in sub_page format with SUBPAGE CODE 00h.

However, SAT-2 and later versions of SAT define the SPF bit of the
Caching mode page and of the Control mode page as not changeable and
set to zero (see SAT-6, 10.4.9 and 10.4.6), and SPC-7 (6.12, MODE
SELECT(10) command) requires the device server to terminate a MODE
SELECT command with INVALID FIELD IN PARAMETER LIST if the application
client sets any field that is reported as not changeable to a value
other than its current value.

Reject a mode page with the SPF bit set to one and SUBPAGE CODE 00h,
with the FIELD POINTER set to the byte containing the SPF bit. The only
mode page with the SPF bit set to one that remains accepted is the ATA
Feature Control mode page (control mode page, sub-page f2h), for which
SAT-6 (12.3.4) requires the SPF bit to be set to one. The opposite case
does not need a check: a mode page in page_0 format always has subpage
code 00h, so it can never be the ATA Feature Control mode page.

This also allows the mode page handlers to rely on the format of their
mode page, which a later patch will make use of.

Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command")
Link: https://lore.kernel.org/r/20261103205448.931471-13-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-scsi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 26bf83188625b..37059d59b7ea0 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4587,7 +4587,17 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
 		if (len < 4)
 			goto invalid_param_len;
 
+		/*
+		 * Mode pages with subpage code 00h use the page_0 format: SAT
+		 * defines the SPF bit of the Caching and Control mode pages,
+		 * for subpage code 00h, as not changeable and set to zero.
+		 */
 		spg = p[1];
+		if (!spg) {
+			fp = hdr_len + bd_len;
+			goto invalid_param;
+		}
+
 		pg_len = get_unaligned_be16(&p[2]);
 		p += 4;
 		len -= 4;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0372/1005] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (362 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0371/1005] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0373/1005] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
	Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 2a4c61cf94d48ec8560473d4fd5383583ce8809c ]

When the mode page of a MODE SELECT parameter list has an unsupported
SUBPAGE CODE, ata_scsi_mode_select_xlat() sets the FIELD POINTER of the
INVALID FIELD IN PARAMETER LIST sense data to the SUBPAGE CODE byte of
the mode page header (byte 1 of the page) if the SPF bit is set, and to
the PAGE CODE byte (byte 0 of the page) otherwise.

However, the SPF bit is tested on p[0] after p has already been advanced
past the mode page header, so the test reads bit 6 of the first byte of
the mode page data instead. If the parameter list ends with the mode
page header, it even reads the byte that follows the parameter list in
buffer, which is not initialized when no data beyond the parameter list
was transferred.

The test is not needed anyway: spg can only be non-zero for a mode page
in sub_page format, i.e. with the SPF bit set, and the field in error is
the SUBPAGE CODE. Always set the FIELD POINTER to the SUBPAGE CODE byte,
which follows the mode parameter header, the block descriptors and the
PAGE CODE byte.

Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-14-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-scsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 37059d59b7ea0..71db0c4d4914a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4623,8 +4623,7 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
 				break;
 			fallthrough;
 		default:
-			fp = (p[0] & 0x40) ? 1 : 0;
-			fp += hdr_len + bd_len;
+			fp = hdr_len + bd_len + 1;
 			goto invalid_param;
 		}
 	}
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0373/1005] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (363 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0372/1005] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0374/1005] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
	Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit a3e52dcf0fbaa1a103accef3e8861cdc250ee5d6 ]

ata_scsi_mode_select_xlat() only accepts MODE SELECT parameter lists
without block descriptors or with a single 8 byte block descriptor. For
any other BLOCK DESCRIPTOR LENGTH, it terminates the command with
INVALID FIELD IN PARAMETER LIST, and the FIELD POINTER should point at
the BLOCK DESCRIPTOR LENGTH field, i.e. at byte 3 of the mode parameter
header(6) or at byte 6 of the mode parameter header(10), as SPC requires
the FIELD POINTER of a multiple-byte field to point at its first byte.

However, the mode parameter header length and the BLOCK DESCRIPTOR
LENGTH are added to the offset of the field, so the FIELD POINTER points
3 or 6 bytes after the end of the block descriptors instead. For
example, a MODE SELECT(10) with a BLOCK DESCRIPTOR LENGTH of 16 reports
byte 30 instead of byte 6.

Do not add the mode parameter header length and the BLOCK DESCRIPTOR
LENGTH to the offset of the BLOCK DESCRIPTOR LENGTH field.

Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-15-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-scsi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 71db0c4d4914a..fc3c04fd27ad7 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4572,7 +4572,6 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
 		goto invalid_param_len;
 	if (bd_len != 0 && bd_len != 8) {
 		fp = (six_byte) ? 3 : 6;
-		fp += bd_len + hdr_len;
 		goto invalid_param;
 	}
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0374/1005] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (364 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0373/1005] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0375/1005] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
	Sasha Levin

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

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

From: Niklas Cassel <cassel@kernel.org>

[ Upstream commit 0fdb8eef88a886751e33600d446a66c529384f11 ]

ata_scsi_mode_select_xlat() strips the mode page header before calling
the mode page handlers, which report the position of an invalid field
as an offset relative to the mode page data. It then converts this
offset into an offset in the parameter list by adding the length of the
mode parameter header and of the block descriptors, but not the length
of the mode page header. As a result, the FIELD POINTER of the INVALID
FIELD IN PARAMETER LIST sense data points 2 bytes (page_0 format) or 4
bytes (sub_page format) before the byte that is actually invalid. For
example, changing byte 3 of the caching mode page in a MODE SELECT(10)
parameter list without block descriptors reports byte 9 instead of
byte 11.

Pass the whole mode page, starting with its mode page header, to the
handlers instead, like the ata_msense_*() functions, which generate the
whole mode page. Offsets in buf are then the byte numbers of the mode
page, as used in the mode page definitions of SPC, SBC and SAT, the
handlers can compare buf with the mode page generated by the matching
ata_msense_*() function without adjusting offsets, and the conversion
done by ata_scsi_mode_select_xlat() becomes correct. This also allows
reporting an invalid PAGE LENGTH at the PAGE LENGTH field, which was not
part of buf before. As ata_scsi_mode_select_xlat() rejects SUBPAGE CODE
FFh and mode pages with a wrong SPF bit, each handler only gets its mode
page in a single format, so the mode page header length is known.

Document what buf, len and fp are, and the return values, in kernel-doc
comments for all the handlers.

Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-16-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-scsi.c | 133 +++++++++++++++++++++++---------------
 1 file changed, 82 insertions(+), 51 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index fc3c04fd27ad7..74273bd7d1add 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4325,14 +4325,22 @@ static unsigned int ata_scsi_zbc_out_xlat(struct ata_queued_cmd *qc)
 /**
  *	ata_mselect_caching - Simulate MODE SELECT for caching info page
  *	@qc: Storage for translated ATA taskfile
- *	@buf: input buffer
- *	@len: number of valid bytes in the input buffer
- *	@fp: out parameter for the failed field on error
+ *	@buf: Mode page, starting with the mode page header
+ *	@len: Length of the mode page, including the mode page header
+ *	@fp: Out parameter, offset in @buf of the first invalid byte on error
  *
  *	Prepare a taskfile to modify caching information for the device.
  *
+ *	The caller has stripped the mode parameter header and the block
+ *	descriptors, so @buf points at the mode page header, like the buffer
+ *	filled by the ata_msense_*() functions, and offsets in @buf, including
+ *	the one returned in @fp, are the byte numbers of the mode page.
+ *
  *	LOCKING:
  *	None.
+ *
+ *	RETURNS:
+ *	0 if a taskfile was prepared, -EINVAL if the mode page is invalid.
  */
 static int ata_mselect_caching(struct ata_queued_cmd *qc,
 			       const u8 *buf, int len, u16 *fp)
@@ -4343,26 +4351,19 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
 	u8 wce;
 	int i;
 
-	/*
-	 * The first two bytes of def_cache_mpage are a header, so offsets
-	 * in mpage are off by 2 compared to buf.  Same for len.
-	 */
-
-	if (len != CACHE_MPAGE_LEN - 2) {
-		*fp = min(len, CACHE_MPAGE_LEN - 2);
+	if (len != CACHE_MPAGE_LEN) {
+		*fp = 1;
 		return -EINVAL;
 	}
 
-	wce = buf[0] & (1 << 2);
+	wce = buf[2] & (1 << 2);
 
 	/*
 	 * Check that read-only bits are not modified.
 	 */
 	ata_msense_caching(dev->id, mpage, false);
-	for (i = 0; i < CACHE_MPAGE_LEN - 2; i++) {
-		if (i == 0)
-			continue;
-		if (mpage[i + 2] != buf[i]) {
+	for (i = 3; i < CACHE_MPAGE_LEN; i++) {
+		if (mpage[i] != buf[i]) {
 			*fp = i;
 			return -EINVAL;
 		}
@@ -4376,8 +4377,26 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
 	return 0;
 }
 
-/*
- * Simulate MODE SELECT control mode page, sub-page 0.
+/**
+ *	ata_mselect_control_spg0 - Simulate MODE SELECT for control sub-page 0
+ *	@qc: Storage for translated ATA taskfile
+ *	@buf: Mode page, starting with the mode page header
+ *	@len: Length of the mode page, including the mode page header
+ *	@fp: Out parameter, offset in @buf of the first invalid byte on error
+ *
+ *	Simulate MODE SELECT control mode page, sub-page 0.
+ *
+ *	The caller has stripped the mode parameter header and the block
+ *	descriptors, so @buf points at the mode page header, like the buffer
+ *	filled by the ata_msense_*() functions, and offsets in @buf, including
+ *	the one returned in @fp, are the byte numbers of the mode page.
+ *
+ *	LOCKING:
+ *	None.
+ *
+ *	RETURNS:
+ *	0, as no ATA command needs to be sent, or -EINVAL if the mode page is
+ *	invalid.
  */
 static int ata_mselect_control_spg0(struct ata_queued_cmd *qc,
 				    const u8 *buf, int len, u16 *fp)
@@ -4387,26 +4406,19 @@ static int ata_mselect_control_spg0(struct ata_queued_cmd *qc,
 	u8 d_sense;
 	int i;
 
-	/*
-	 * The first two bytes of def_control_mpage are a header, so offsets
-	 * in mpage are off by 2 compared to buf.  Same for len.
-	 */
-
-	if (len != CONTROL_MPAGE_LEN - 2) {
-		*fp = min(len, CONTROL_MPAGE_LEN - 2);
+	if (len != CONTROL_MPAGE_LEN) {
+		*fp = 1;
 		return -EINVAL;
 	}
 
-	d_sense = buf[0] & (1 << 2);
+	d_sense = buf[2] & (1 << 2);
 
 	/*
 	 * Check that read-only bits are not modified.
 	 */
 	ata_msense_control_spg0(dev, mpage, false);
-	for (i = 0; i < CONTROL_MPAGE_LEN - 2; i++) {
-		if (i == 0)
-			continue;
-		if (mpage[2 + i] != buf[i]) {
+	for (i = 3; i < CONTROL_MPAGE_LEN; i++) {
+		if (mpage[i] != buf[i]) {
 			*fp = i;
 			return -EINVAL;
 		}
@@ -4418,9 +4430,27 @@ static int ata_mselect_control_spg0(struct ata_queued_cmd *qc,
 	return 0;
 }
 
-/*
- * Translate MODE SELECT control mode page, sub-page f2h (ATA feature mode
- * page) into a SET FEATURES command.
+/**
+ *	ata_mselect_control_ata_feature - Translate ATA Feature Control page
+ *	@qc: Storage for translated ATA taskfile
+ *	@buf: Mode page, starting with the mode page header
+ *	@len: Length of the mode page, including the mode page header
+ *	@fp: Out parameter, offset in @buf of the first invalid byte on error
+ *
+ *	Translate MODE SELECT control mode page, sub-page f2h (ATA feature mode
+ *	page) into a SET FEATURES command.
+ *
+ *	The caller has stripped the mode parameter header and the block
+ *	descriptors, so @buf points at the mode page header, like the buffer
+ *	filled by the ata_msense_*() functions, and offsets in @buf, including
+ *	the one returned in @fp, are the byte numbers of the mode page.
+ *
+ *	LOCKING:
+ *	None.
+ *
+ *	RETURNS:
+ *	1 if a taskfile was prepared, -EINVAL if the mode page is invalid or if
+ *	CDL cannot be enabled.
  */
 static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
 					   const u8 *buf, int len, u16 *fp)
@@ -4429,17 +4459,13 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
 	struct ata_taskfile *tf = &qc->tf;
 	u8 cdl_action;
 
-	/*
-	 * The first four bytes of ATA Feature Control mode page are a header,
-	 * so offsets in mpage are off by 4 compared to buf.  Same for len.
-	 */
-	if (len != ATA_FEATURE_SUB_MPAGE_LEN - 4) {
-		*fp = min(len, ATA_FEATURE_SUB_MPAGE_LEN - 4);
+	if (len != ATA_FEATURE_SUB_MPAGE_LEN) {
+		*fp = 2;
 		return -EINVAL;
 	}
 
 	/* Check cdl_ctrl */
-	switch (buf[0] & 0x03) {
+	switch (buf[4] & 0x03) {
 	case 0:
 		/* Disable CDL */
 		ata_dev_dbg(dev, "Disabling CDL\n");
@@ -4461,7 +4487,7 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
 		dev->flags |= ATA_DFLAG_CDL_ENABLED;
 		break;
 	default:
-		*fp = 0;
+		*fp = 4;
 		return -EINVAL;
 	}
 
@@ -4477,15 +4503,24 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
 /**
  *	ata_mselect_control - Simulate MODE SELECT for control page
  *	@qc: Storage for translated ATA taskfile
- *	@spg: target sub-page of the control page
- *	@buf: input buffer
- *	@len: number of valid bytes in the input buffer
- *	@fp: out parameter for the failed field on error
+ *	@spg: Sub-page of the control page, 0 or ATA_FEATURE_SUB_MPAGE
+ *	@buf: Mode page, starting with the mode page header
+ *	@len: Length of the mode page, including the mode page header
+ *	@fp: Out parameter, offset in @buf of the first invalid byte on error
  *
- *	Prepare a taskfile to modify caching information for the device.
+ *	Call the handler of sub-page @spg of the control mode page.
+ *
+ *	The caller has stripped the mode parameter header and the block
+ *	descriptors, so @buf points at the mode page header, like the buffer
+ *	filled by the ata_msense_*() functions, and offsets in @buf, including
+ *	the one returned in @fp, are the byte numbers of the mode page.
  *
  *	LOCKING:
  *	None.
+ *
+ *	RETURNS:
+ *	0 if no ATA command needs to be sent, 1 if a taskfile was prepared,
+ *	-EINVAL if the mode page is invalid.
  */
 static int ata_mselect_control(struct ata_queued_cmd *qc, u8 spg,
 			       const u8 *buf, int len, u16 *fp)
@@ -4597,17 +4632,13 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
 			goto invalid_param;
 		}
 
-		pg_len = get_unaligned_be16(&p[2]);
-		p += 4;
-		len -= 4;
+		pg_len = get_unaligned_be16(&p[2]) + 4;
 	} else {
 		if (len < 2)
 			goto invalid_param_len;
 
 		spg = 0;
-		pg_len = p[1];
-		p += 2;
-		len -= 2;
+		pg_len = p[1] + 2;
 	}
 
 	/*
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0375/1005] ata: libata-scsi: set the field pointer when rejecting CDL
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (365 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0374/1005] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0376/1005] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Damien Le Moal,
	Niklas Cassel, Sasha Levin

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

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

From: Shao Mingyin <shao.mingyin@zte.com.cn>

[ Upstream commit 7c972e73641cbe5f77f63c336de15c7a30268d49 ]

ata_mselect_control_ata_feature() rejects enabling CDL while NCQ
priority is enabled, but unlike its other error branches it returns
without setting *fp.

ata_scsi_mode_select_xlat() initializes fp to 0xffff and, when the
handler fails, adds the offset of the mode page in the parameter list
to it, i.e. the length of the mode parameter header and of the block
descriptors. As fp is a u16, this wraps around, so the resulting sense
data reports the byte before the mode page, i.e. the last byte of the
mode parameter header or of the block descriptors, as the FIELD
POINTER, instead of the byte containing the CDL_CTRL field that
requests enabling CDL.

Set *fp to 4, i.e. to the byte containing the CDL_CTRL field, like the
branch rejecting an invalid CDL_CTRL value does.

Fixes: df60f9c64576 ("scsi: ata: libata: Add ATA feature control sub-page translation")
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
[cassel: set *fp to 4, the offset of CDL_CTRL in the mode page]
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-17-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ata/libata-scsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 74273bd7d1add..c423a91535563 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4480,6 +4480,7 @@ static int ata_mselect_control_ata_feature(struct ata_queued_cmd *qc,
 		if (dev->flags & ATA_DFLAG_NCQ_PRIO_ENABLED) {
 			ata_dev_err(dev,
 				"NCQ priority must be disabled to enable CDL\n");
+			*fp = 4;
 			return -EINVAL;
 		}
 		ata_dev_dbg(dev, "Enabling CDL\n");
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0376/1005] tracing/probes: bound symstr stores to reserved length
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (366 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0375/1005] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0377/1005] kho: check fdt_phys in is_kho_boot() Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yifan Zhang,
	Masami Hiramatsu (Google), Sasha Levin

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

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

From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>

[ Upstream commit 2fc0b3070d6d5dcecfed43cd0e62aa0fd4b4315c ]

Traceprobe calculates dynamic string sizes before storing the values.  A
probed pointer can change between those passes, so
fetch_store_symstrlen() can reserve space for a short symbol while
fetch_store_symstring() observes a longer one.  The store path then
overwrites the trace record.

Format the symbol into a temporary KSYM_SYMBOL_LEN buffer and copy only
the bytes that fit in the reserved field, including a trailing NUL.
Update __data_loc with the length actually stored so consumers do not
read beyond the truncated value.

Link: https://lore.kernel.org/all/179378621331.55520.2052332247156241151@stu.pku.edu.cn/

Fixes: b26a124cbfa8 ("tracing/probes: Add symstr type for dynamic events")
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/trace/trace_probe_tmpl.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_probe_tmpl.h b/kernel/trace/trace_probe_tmpl.h
index 8db12f758fdae..8acc0f0ebd7a6 100644
--- a/kernel/trace/trace_probe_tmpl.h
+++ b/kernel/trace/trace_probe_tmpl.h
@@ -87,15 +87,27 @@ fetch_store_symstrlen(unsigned long addr)
 static nokprobe_inline int
 fetch_store_symstring(unsigned long addr, void *dest, void *base)
 {
+	char namebuf[KSYM_SYMBOL_LEN];
 	int maxlen = get_loc_len(*(u32 *)dest);
 	void *__dest;
+	int len;
 
 	if (unlikely(!maxlen))
 		return -ENOMEM;
 
 	__dest = get_loc_data(dest, base);
+	len = sprint_symbol(namebuf, addr);
+	if (len < 0) {
+		*(u32 *)dest = make_data_loc(0, __dest - base);
+		return 0;
+	}
+
+	len = min(len, maxlen - 1);
+	memcpy(__dest, namebuf, len);
+	((char *)__dest)[len] = '\0';
+	*(u32 *)dest = make_data_loc(len + 1, __dest - base);
 
-	return sprint_symbol(__dest, addr);
+	return len + 1;
 }
 
 /* common part of process_fetch_insn*/
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0377/1005] kho: check fdt_phys in is_kho_boot()
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (367 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0376/1005] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0378/1005] drm/xe/cri: Expose device UID through sysfs Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Greg Thelen, Pratyush Yadav (Google),
	Pasha Tatashin, Sasha Levin

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

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

From: Greg Thelen <gthelen@google.com>

[ Upstream commit 58c5852ca96c58cdfdb9646870b217fc54d06a97 ]

is_kho_boot() is called early in boot before the linear memory map is
initialized, so calling phys_to_virt() via kho_get_fdt() there is
invalid.

On arm64 (and similarly in upcoming riscv64 support), this triggers
BUG_ONs in debug builds, such as:

  kernel BUG at ./arch/arm64/include/asm/memory.h:377!
  Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
  Call trace:
   is_kho_boot+0x2c/0x38 (P)
   efi_init+0x94/0xf8
   setup_arch+0xf0/0x240
   start_kernel+0x84/0x490
   __primary_switched+0x88/0x98

Use kho_in.fdt_phys in is_kho_boot() directly instead of translating it
to a virtual address.

Fixes: d6d511639185 ("kexec: introduce is_kho_boot()")
Signed-off-by: Greg Thelen <gthelen@google.com>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Link: https://patch.msgid.link/20261023054518.3258350-1-gthelen@google.com
[Pasha: massaged the changelog]
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/liveupdate/kexec_handover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
index 3c87c2a3d6f09..ab55b77119d64 100644
--- a/kernel/liveupdate/kexec_handover.c
+++ b/kernel/liveupdate/kexec_handover.c
@@ -1631,7 +1631,7 @@ EXPORT_SYMBOL_GPL(kho_restore_free);
  */
 bool is_kho_boot(void)
 {
-	return !!kho_get_fdt();
+	return !!kho_in.fdt_phys;
 }
 EXPORT_SYMBOL_GPL(is_kho_boot);
 
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0378/1005] drm/xe/cri: Expose device UID through sysfs
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (368 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0377/1005] kho: check fdt_phys in is_kho_boot() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0379/1005] drm/xe/gsc: Define GSC for NVL-S Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Badal Nilawar, Rodrigo Vivi,
	Sasha Levin

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

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

From: Badal Nilawar <badal.nilawar@intel.com>

[ Upstream commit 0acb5de8d7a9aec9419f316ef06b937dde285685 ]

Expose a read-only sysfs attribute, device_uid, that reports the
GPU SoC's unique identifier.

Bspec: 53048, 53049
Assisted-by: Claude:claude-opus-4.8
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20260929171823.3811737-2-badal.nilawar@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Stable-dep-of: 7539edbca32d ("drm/xe/pat: Return error from xe_pat_init_early() on unknown platform")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../ABI/testing/sysfs-driver-intel-xe-gpu     | 10 ++++++
 drivers/gpu/drm/xe/regs/xe_regs.h             |  2 ++
 drivers/gpu/drm/xe/xe_device.c                |  9 +++++
 drivers/gpu/drm/xe/xe_device_sysfs.c          | 36 +++++++++++++++++++
 drivers/gpu/drm/xe/xe_device_types.h          |  5 +++
 drivers/gpu/drm/xe/xe_pci.c                   |  2 ++
 drivers/gpu/drm/xe/xe_pci_types.h             |  1 +
 7 files changed, 65 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-xe-gpu

diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-gpu b/Documentation/ABI/testing/sysfs-driver-intel-xe-gpu
new file mode 100644
index 0000000000000..4dc4afc3961d9
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-gpu
@@ -0,0 +1,10 @@
+What:		/sys/bus/pci/drivers/xe/.../device_uid
+Date:		October 2026
+KernelVersion:	7.4
+Contact:	intel-xe@lists.freedesktop.org
+Description:
+		RO. Unique 64-bit identifier of the GPU SoC device, exposed as
+		hexadecimal value.
+
+		This sysfs file is present only on supported Intel Xe platforms.
+		Accessible only to users with administrative privileges.
diff --git a/drivers/gpu/drm/xe/regs/xe_regs.h b/drivers/gpu/drm/xe/regs/xe_regs.h
index ef4746b7b5d34..437485b5a0af9 100644
--- a/drivers/gpu/drm/xe/regs/xe_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_regs.h
@@ -30,6 +30,8 @@
 #define XEHP_MTCFG_ADDR				XE_REG(0x101800)
 #define   TILE_COUNT				REG_GENMASK(15, 8)
 
+#define CRI_DEVICE_UID				XE_REG(0x102008)
+
 #define GGC					XE_REG(0x108040)
 #define   GMS_MASK				REG_GENMASK(15, 8)
 #define   GGMS_MASK				REG_GENMASK(7, 6)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index ee732e5495f7d..6dc02ec55b902 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -742,6 +742,7 @@ static void vf_update_device_info(struct xe_device *xe)
 	xe->info.skip_guc_pc = 1;
 	xe->info.skip_pcode = 1;
 	xe->info.has_drm_ras = false;
+	xe->info.has_device_uid = false;
 }
 
 static int xe_device_vram_alloc(struct xe_device *xe)
@@ -942,6 +943,12 @@ static int xe_debug_page_size_alloc_ctrl_init(struct xe_device *xe)
 }
 #endif
 
+static void xe_uid_probe(struct xe_device *xe)
+{
+	if (xe->info.has_device_uid)
+		xe->device_uid = xe_mmio_read64_2x32(xe_root_tile_mmio(xe), CRI_DEVICE_UID);
+}
+
 int xe_device_probe(struct xe_device *xe)
 {
 	struct xe_tile *tile;
@@ -949,6 +956,8 @@ int xe_device_probe(struct xe_device *xe)
 	int err;
 	u8 id;
 
+	xe_uid_probe(xe);
+
 	xe_pat_init_early(xe);
 
 	err = xe_sriov_init(xe);
diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
index a73e0e957cb0b..18783a286a830 100644
--- a/drivers/gpu/drm/xe/xe_device_sysfs.c
+++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
@@ -8,6 +8,7 @@
 #include <linux/pci.h>
 #include <linux/sysfs.h>
 
+#include "regs/xe_regs.h"
 #include "xe_device.h"
 #include "xe_device_sysfs.h"
 #include "xe_mmio.h"
@@ -264,6 +265,35 @@ static const struct attribute_group auto_link_downgrade_attr_group = {
 	.attrs = auto_link_downgrade_attrs,
 };
 
+/**
+ * DOC: Device Unique ID
+ *
+ * On supported platforms, Xe driver exposes a unique 64-bit GPU SOC
+ * device identifier through the 'device_uid' sysfs entry.
+ *
+ * See Documentation/ABI/testing/sysfs-driver-intel-xe-gpu for the ABI
+ * specification.
+ */
+
+static ssize_t
+device_uid_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+	struct xe_device *xe = pdev_to_xe_device(pdev);
+
+	return sysfs_emit(buf, "0x%016llx\n", xe->device_uid);
+}
+static DEVICE_ATTR_ADMIN_RO(device_uid);
+
+static struct attribute *device_uid_attrs[] = {
+	&dev_attr_device_uid.attr,
+	NULL
+};
+
+static const struct attribute_group device_uid_attr_group = {
+	.attrs = device_uid_attrs,
+};
+
 int xe_device_sysfs_init(struct xe_device *xe)
 {
 	struct device *dev = xe->drm.dev;
@@ -285,5 +315,11 @@ int xe_device_sysfs_init(struct xe_device *xe)
 			return ret;
 	}
 
+	if (xe->info.has_device_uid) {
+		ret = devm_device_add_group(dev, &device_uid_attr_group);
+		if (ret)
+			return ret;
+	}
+
 	return 0;
 }
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 03a7bb08adf7b..e4431f27d43c5 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -171,6 +171,8 @@ struct xe_device {
 		u8 has_cached_pt:1;
 		/** @info.has_device_atomics_on_smem: Supports device atomics on SMEM */
 		u8 has_device_atomics_on_smem:1;
+		/** @info.has_device_uid: Device supports unique 64-bit GPU SOC ID */
+		u8 has_device_uid:1;
 		/** @info.has_drm_ras: Device supports drm_ras (Reliability, Availability, Serviceability) */
 		u8 has_drm_ras:1;
 		/** @info.has_fan_control: Device supports fan control */
@@ -255,6 +257,9 @@ struct xe_device {
 		bool oob_initialized;
 	} wa_active;
 
+	/** @device_uid: unique 64-bit GPU SOC identifier */
+	u64 device_uid;
+
 	/** @survivability: survivability information for device */
 	struct xe_survivability survivability;
 
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 5f2a0b19839d1..06e1062ec1705 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -470,6 +470,7 @@ static const struct xe_device_desc cri_desc = {
 	PLATFORM(CRESCENTISLAND),
 	.dma_mask_size = 52,
 	.has_display = false,
+	.has_device_uid = true,
 	.has_drm_ras = true,
 	.has_flat_ccs = false,
 	.has_gsc_nvm = 1,
@@ -791,6 +792,7 @@ static int xe_info_init_early(struct xe_device *xe,
 
 	xe->info.is_dgfx = desc->is_dgfx;
 	xe->info.has_cached_pt = desc->has_cached_pt;
+	xe->info.has_device_uid = desc->has_device_uid;
 	xe->info.has_drm_ras = desc->has_drm_ras;
 	xe->info.has_fan_control = desc->has_fan_control;
 	/* runtime fusing may force flat_ccs to disabled later */
diff --git a/drivers/gpu/drm/xe/xe_pci_types.h b/drivers/gpu/drm/xe/xe_pci_types.h
index fed509ff601e4..fe327323a0be6 100644
--- a/drivers/gpu/drm/xe/xe_pci_types.h
+++ b/drivers/gpu/drm/xe/xe_pci_types.h
@@ -40,6 +40,7 @@ struct xe_device_desc {
 
 	u8 has_cached_pt:1;
 	u8 has_display:1;
+	u8 has_device_uid:1;
 	u8 has_drm_ras:1;
 	u8 has_fan_control:1;
 	u8 has_flat_ccs:1;
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0379/1005] drm/xe/gsc: Define GSC for NVL-S
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (369 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0378/1005] drm/xe/cri: Expose device UID through sysfs Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0380/1005] drm/xe/pat: Return error from xe_pat_init_early() on unknown platform Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alan Previn, Julia Filipchuk,
	Rodrigo Vivi, Sasha Levin

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

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

From: Alan Previn <alan.previn.teres.alexis@intel.com>

[ Upstream commit 8a90f0d1098f9a9019f1a076bd1ee4b6c7da7dbd ]

NVL-S is identified by GSC major version 108.
The compatibility version is 0.0.

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Julia Filipchuk <julia.filipchuk@intel.com>
Link: https://patch.msgid.link/20260923183600.1186943-5-alan.previn.teres.alexis@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Stable-dep-of: 7539edbca32d ("drm/xe/pat: Return error from xe_pat_init_early() on unknown platform")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/xe/xe_uc_fw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/xe_uc_fw.c b/drivers/gpu/drm/xe/xe_uc_fw.c
index a8e6f18cc9b4a..f61910431cf25 100644
--- a/drivers/gpu/drm/xe/xe_uc_fw.c
+++ b/drivers/gpu/drm/xe/xe_uc_fw.c
@@ -141,6 +141,7 @@ struct fw_blobs_by_type {
 
 /* for the GSC FW we match the compatibility version and not the release one */
 #define XE_GSC_FIRMWARE_DEFS(fw_def, major_ver)		\
+	fw_def(NOVALAKE_S,	GT_TYPE_ANY,	major_ver(xe,	gsc,	nvl,	108, 0, 0))	\
 	fw_def(PANTHERLAKE,	GT_TYPE_ANY,	major_ver(xe,	gsc,	ptl,	105, 1, 0))	\
 	fw_def(LUNARLAKE,	GT_TYPE_ANY,	major_ver(xe,	gsc,	lnl,	104, 1, 0))	\
 	fw_def(METEORLAKE,	GT_TYPE_ANY,	major_ver(i915,	gsc,	mtl,	102, 1, 0))
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0380/1005] drm/xe/pat: Return error from xe_pat_init_early() on unknown platform
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (370 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0379/1005] drm/xe/gsc: Define GSC for NVL-S Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:28 ` [PATCH 7.3 0381/1005] drm/xe: Prevent VF memory IRQ from accessing a torn-down engine Greg Kroah-Hartman
  2026-11-25 14:45 ` [PATCH 7.3 0000/1005] 7.3.7-rc1 review SJ Park
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dnyaneshwar Bhadane,
	Mallesh Koujalagi, Matt Roper, Matthew Brost, Dave Airlie,
	Sasha Levin

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

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

From: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>

[ Upstream commit 7539edbca32d63ce309f5e29cb9d595b0959466a ]

xe_pat_init_early() currently only logs an error when the platform's
graphics version doesn't match any known PAT table, but continues
probing with an uninitialized pat.ops. This can lead to a NULL
pointer dereference later when pat.ops is used.

Change xe_pat_init_early() to return an int and propagate -ENODATA
to xe_device_probe() so the driver fails to load cleanly instead of
continuing in a broken state.

Fixes: 152d7f2db978 ("drm/xe/pat: Handle unicast vs MCR PAT registers")
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
Link: https://patch.msgid.link/20261012122522.2307625-8-dnyaneshwar.bhadane@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit e952337c3dbccf600ddae3bb1d38e996172ac8f8)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/xe/xe_device.c |  4 +++-
 drivers/gpu/drm/xe/xe_pat.c    | 11 ++++++++++-
 drivers/gpu/drm/xe/xe_pat.h    |  4 +++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 6dc02ec55b902..e76edcf15159e 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -958,7 +958,9 @@ int xe_device_probe(struct xe_device *xe)
 
 	xe_uid_probe(xe);
 
-	xe_pat_init_early(xe);
+	err = xe_pat_init_early(xe);
+	if (err)
+		return err;
 
 	err = xe_sriov_init(xe);
 	if (err)
diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
index a5fe1beec652d..0ac64a6a3098a 100644
--- a/drivers/gpu/drm/xe/xe_pat.c
+++ b/drivers/gpu/drm/xe/xe_pat.c
@@ -590,7 +590,13 @@ static const struct xe_pat_ops xe3p_xpc_pat_ops = {
 	.entry_dump = xe3p_xpc_pat_entry_dump,
 };
 
-void xe_pat_init_early(struct xe_device *xe)
+/**
+ * xe_pat_init_early() - Init early pat table operation.
+ * @xe: the &xe_device
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_pat_init_early(struct xe_device *xe)
 {
 	xe->pat.idx[XE_CACHE_WB_COMPRESSION] = XE_PAT_INVALID_IDX;
 	xe->pat.idx[XE_CACHE_NONE_COMPRESSION] = XE_PAT_INVALID_IDX;
@@ -688,12 +694,15 @@ void xe_pat_init_early(struct xe_device *xe)
 		 */
 		drm_err(&xe->drm, "Missing PAT table for platform with graphics version %d.%02d!\n",
 			GRAPHICS_VER(xe), GRAPHICS_VERx100(xe) % 100);
+		return -ENODATA;
 	}
 
+	xe_assert(xe, xe->pat.ops);
 	xe_assert(xe, xe->pat.ops->dump);
 	xe_assert(xe, xe->pat.ops->program_graphics);
 	xe_assert(xe, MEDIA_VER(xe) < 13 || xe->pat.ops->program_media);
 	xe_assert(xe, GRAPHICS_VER(xe) < 20 || xe->pat.ops->entry_dump);
+	return 0;
 }
 
 void xe_pat_init(struct xe_gt *gt)
diff --git a/drivers/gpu/drm/xe/xe_pat.h b/drivers/gpu/drm/xe/xe_pat.h
index 7060f66e1d638..6398c3ab48055 100644
--- a/drivers/gpu/drm/xe/xe_pat.h
+++ b/drivers/gpu/drm/xe/xe_pat.h
@@ -42,8 +42,10 @@ struct xe_pat_table_entry {
 /**
  * xe_pat_init_early - SW initialization, setting up data based on device
  * @xe: xe device
+ *
+ * Return: 0 on success or a negative error code on failure.
  */
-void xe_pat_init_early(struct xe_device *xe);
+int xe_pat_init_early(struct xe_device *xe);
 
 /**
  * xe_pat_init - Program HW PAT table
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* [PATCH 7.3 0381/1005] drm/xe: Prevent VF memory IRQ from accessing a torn-down engine
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (371 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0380/1005] drm/xe/pat: Return error from xe_pat_init_early() on unknown platform Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
  2026-11-25 14:45 ` [PATCH 7.3 0000/1005] 7.3.7-rc1 review SJ Park
  373 siblings, 0 replies; 375+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Satyanarayana K V P, Matthew Brost,
	Piotr Piórkowski, Dave Airlie, Sasha Levin

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

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

From: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>

[ Upstream commit db58638d5d0531beafafa498cffa516779876ee5 ]

The VF memory IRQ handler iterates over HW engines whose names are set.
Engine teardown clears hwe->gt but leaves hwe->name set, so the handler
can select an engine whose GT has already been invalidated. This can
cause a NULL pointer dereference in xe_hw_engine_handle_irq().

Invalidate the engine name during teardown so subsequent engine scans
skip it.

Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
Fixes: 6eb2aad402cc ("drm/xe: Move hw_engine_fini to devm managed")
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20261013152417.3189567-6-satyanarayana.k.v.p@intel.com
(cherry picked from commit f88c6f2fa88bc5892b1e842972096613086c06b2)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/xe/xe_hw_engine.c | 17 ++++++++++++++---
 drivers/gpu/drm/xe/xe_irq.c       |  3 +++
 drivers/gpu/drm/xe/xe_memirq.c    |  3 +++
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
index 9680d2a5adec7..f7d5d1101c6e0 100644
--- a/drivers/gpu/drm/xe/xe_hw_engine.c
+++ b/drivers/gpu/drm/xe/xe_hw_engine.c
@@ -275,11 +275,22 @@ static const struct engine_info engine_infos[] = {
 static void hw_engine_fini(void *arg)
 {
 	struct xe_hw_engine *hwe = arg;
+	struct xe_gt *gt = hwe->gt;
+
+	if (gt) {
+		struct xe_device *xe = gt_to_xe(gt);
+		unsigned long flags;
 
-	if (hwe->exl_port)
-		xe_execlist_port_destroy(hwe->exl_port);
+		if (hwe->exl_port)
+			xe_execlist_port_destroy(hwe->exl_port);
 
-	hwe->gt = NULL;
+		spin_lock_irqsave(&xe->irq.lock, flags);
+		hwe->name = NULL;
+		hwe->gt = NULL;
+		spin_unlock_irqrestore(&xe->irq.lock, flags);
+	} else {
+		hwe->name = NULL;
+	}
 }
 
 /**
diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
index 9e49e2241da41..b394c8edf89c9 100644
--- a/drivers/gpu/drm/xe/xe_irq.c
+++ b/drivers/gpu/drm/xe/xe_irq.c
@@ -908,6 +908,7 @@ static irqreturn_t xe_irq_msix_default_hwe_handler(int irq, void *arg)
 	struct xe_hw_engine *hwe;
 	enum xe_hw_engine_id id;
 	struct xe_tile *tile;
+	unsigned long flags;
 	struct xe_gt *gt;
 
 	if (!atomic_read(&xe->irq.enabled))
@@ -922,8 +923,10 @@ static irqreturn_t xe_irq_msix_default_hwe_handler(int irq, void *arg)
 			if (gt->tile != tile)
 				continue;
 
+			spin_lock_irqsave(&xe->irq.lock, flags);
 			for_each_hw_engine(hwe, gt, id)
 				xe_memirq_hwe_handler(memirq, hwe);
+			spin_unlock_irqrestore(&xe->irq.lock, flags);
 		}
 	}
 
diff --git a/drivers/gpu/drm/xe/xe_memirq.c b/drivers/gpu/drm/xe/xe_memirq.c
index 9dfe965cb46ec..1073132f2dede 100644
--- a/drivers/gpu/drm/xe/xe_memirq.c
+++ b/drivers/gpu/drm/xe/xe_memirq.c
@@ -555,6 +555,7 @@ void xe_memirq_handler(struct xe_memirq *memirq)
 	struct xe_hw_engine *hwe;
 	enum xe_hw_engine_id id;
 	struct iosys_map map;
+	unsigned long flags;
 	unsigned int gtid;
 	struct xe_gt *gt;
 
@@ -568,8 +569,10 @@ void xe_memirq_handler(struct xe_memirq *memirq)
 		if (gt->tile != tile)
 			continue;
 
+		spin_lock_irqsave(&xe->irq.lock, flags);
 		for_each_hw_engine(hwe, gt, id)
 			xe_memirq_hwe_handler(memirq, hwe);
+		spin_unlock_irqrestore(&xe->irq.lock, flags);
 	}
 
 	/* GuC and media GuC (if present) must be checked separately */
-- 
2.53.0




^ permalink raw reply related	[flat|nested] 375+ messages in thread

* Re: [PATCH 7.3 0000/1005] 7.3.7-rc1 review
  2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
                   ` (372 preceding siblings ...)
  2026-11-25 14:28 ` [PATCH 7.3 0381/1005] drm/xe: Prevent VF memory IRQ from accessing a torn-down engine Greg Kroah-Hartman
@ 2026-11-25 14:45 ` SJ Park
  373 siblings, 0 replies; 375+ messages in thread
From: SJ Park @ 2026-11-25 14:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: SJ Park, stable, patches, linux-kernel, torvalds, akpm, linux,
	shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr

On Wed, 25 Nov 2026 15:22:18 +0100 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> 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.

This rc kernel passes DAMON functionality test [1] on my test machine.

Tested-by: SJ Park <sj@kernel.org>

[1] https://github.com/damonitor/damon-tests/tree/next/corr


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 375+ messages in thread

end of thread, other threads:[~2026-11-25 14:59 UTC | newest]

Thread overview: 375+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0001/1005] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0002/1005] net: virtio: validate outer protocol of UDP tunnel GSO packets Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0003/1005] soundwire: dmi-quirks: add Lenovo Yoga Slim 7i 14IPH11 Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0004/1005] soundwire: dmi-quirks: Disable ghost Realtek on Lenovo Pro 9 Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0005/1005] soundwire: dmi-quirks: drop the ghost RT1320 on the Surface Pro 11 (Intel) Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0006/1005] mm/slub: refill prefilled sheaves from the barn Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0007/1005] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250) Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0008/1005] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0009/1005] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0010/1005] ALSA: hda/tas2781: Prevent throwing away custom calibration addresses Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0011/1005] virtio_net: check RX buffer length before DMA sync Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0012/1005] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts" Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0013/1005] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0014/1005] io_uring/napi: dont end the single NAPI busy poll early on need_resched() Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0015/1005] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0016/1005] io_uring/futex: fail soft links when cancelling a wait Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0017/1005] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0018/1005] io_uring/io-wq: show stuck workers rather than WARN on a slow exit Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0019/1005] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0020/1005] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0021/1005] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0022/1005] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0023/1005] bnxt_en: Take RTNL before netif_close() when aborting FW reset Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0024/1005] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0025/1005] wifi: rtw89: usb: Avoid crash with dynamically added device ID Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0026/1005] wifi: rtw89: 8922au: Add support for TP-Link TBE400U Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0027/1005] wifi: rtw89: 8922au: add ASUS BE93 Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0028/1005] 9p: use fc->net_ns for network namespace in RDMA and socket transports Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0029/1005] net/9p/usbg: fix descriptor cleanup use-after-free Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0030/1005] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0031/1005] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0032/1005] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0033/1005] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0034/1005] xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0035/1005] xfrm: fix use-after-free of migrated state in xfrm_do_migrate_state() Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0036/1005] xfrm: fix hw offload state leak on xfrm_do_migrate_state() error path Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0037/1005] xfrm: include mark in MIGRATE_STATE SA collision check Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0038/1005] xfrm: pass extack through to xfrm_init_replay() from xfrm_init_state() Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0039/1005] docs: xfrm: include mark in XFRM_MSG_MIGRATE_STATE EEXIST tuple Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0040/1005] drm/panic: Accept a trailing newline in panic_screen Greg Kroah-Hartman
2026-11-25 14:22 ` [PATCH 7.3 0041/1005] wifi: wext: Limit notifier event flushes to the devices netns Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0042/1005] fsnotify: preserve 64-bit pre-content ranges Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0043/1005] wifi: ath12k: fix decap of MSDUs spanning multiple RX buffers Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0044/1005] wifi: ath12k: Fix failure to create ath12k_dp_peer on MLO reconnect Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0045/1005] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0046/1005] ntfs: Fix error handling in __ntfs_create() Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0047/1005] printk_ringbuffer: Fix space_used() when blk_lpos->next overflows Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0048/1005] dma-buf: Restore the scatterlist entry count before freeing Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0049/1005] dma-buf: keep the DMA flags in the DMABUF_DEBUG copy Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0050/1005] dma-buf: validate the attachment before asserting its reservation lock Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0051/1005] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0052/1005] scsi: scsi_debug: Drain target cleanup before module exit Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0053/1005] scsi: core: Balance the pseudo target reap reference Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0054/1005] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0055/1005] 9p: treat read return values of 0 as EOF Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0056/1005] 9p: fix kernel-doc warning for enum p9_session_flags Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0057/1005] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0058/1005] 9p: do not store the create fid on special files Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0059/1005] ntfs: initialize VCN when inserting index entries Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0060/1005] ntfs: avoid overflow when limiting attribute read length Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0061/1005] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0062/1005] wifi: ath12k: fix IRQ disable imbalance in AHB ext interrupt handler Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0063/1005] wifi: ath12k: set MSDU payload correctly Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0064/1005] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0065/1005] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0066/1005] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0067/1005] x86/ftrace: Mark jmp mode by clearing bit 63 of trampoline address Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0068/1005] bpf: Fix jited line info off by the CFI preamble Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0069/1005] sched_ext: Call ops.sub_attach() only while the cgroup is online Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0070/1005] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0071/1005] btrfs: fix fiemap merging compressed extents Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0072/1005] btrfs: scrub: fix lost error return value when scrubbing raid56 parity stripe Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0073/1005] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0074/1005] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0075/1005] bpf: Drop percpu_counter from the htab element count Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0076/1005] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3 Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0077/1005] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0078/1005] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0079/1005] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0080/1005] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0081/1005] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0082/1005] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0083/1005] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0084/1005] ptp: vclock: preserve missing hardware timestamps Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0085/1005] net/smc: fix limit_smc_hs sysctl on big-endian architecture Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0086/1005] scsi: mpt3sas: Use combined sense codes Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0087/1005] scsi: mpt3sas: Register devices during SANITIZE Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0088/1005] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0089/1005] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0090/1005] net: ipa: Fix double free of the interrupt structure on config error Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0091/1005] ALSA: memalloc: Free the new pages when WC DMA mapping fails Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0092/1005] ALSA: hda/core: Fix double free on stream page allocation failure Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0093/1005] bpf: Fix bpf_dynptr_copy() for overlapping ranges in one packet Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0094/1005] netfilter: nft_reject: prevent unbounded recursion in output hooks Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0095/1005] ASoC: codecs: lpass-rx-macro: fix PM ref leak in swclk_gate_enable Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0096/1005] bpf, x86: Fix bpf_throw() in a prog with a private stack Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0097/1005] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0098/1005] bpf: Clamp the trace length in __bpf_get_stack() again Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0099/1005] bpf: Clamp the trace length before the skip test in stackid_init() Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0100/1005] bpf: Refuse to map an arena at address 0 Greg Kroah-Hartman
2026-11-25 14:23 ` [PATCH 7.3 0101/1005] bpf: Dont let bpf_arena_free_pages() see a half-set user range Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0102/1005] bpf: Refuse an arena mmap() longer than max_entries pages Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0103/1005] bpf: Remove the WARN from arena_get_unmapped_area() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0104/1005] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0105/1005] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0106/1005] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0107/1005] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0108/1005] bpf: Set a dst for test runs of lwt_in progs Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0109/1005] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0110/1005] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0111/1005] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0112/1005] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0113/1005] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0114/1005] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0115/1005] bpf: Dont let lwt_in progs call into IPv6 when it is disabled Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0116/1005] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0117/1005] bpf: Use the inner transport header after a decap Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0118/1005] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0119/1005] ASoC: tas2770: Configure transmit clock edge when setting DAI format Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0120/1005] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0121/1005] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0122/1005] firmware: coreboot: Dont skip CBMEM entries outside of known memory Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0123/1005] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0124/1005] drm/i915/display: Limit NVL TRANS_VTOTAL.Vtotal skip to A-step Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0125/1005] drm/i915/cmtg: Disable CMTG after encoder disable in hsw_crtc_disable() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0126/1005] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0127/1005] bnxt_en: Dont keep MSI-X vectors added before FW reserves them Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0128/1005] gpio: shared-proxy: Fix race between concurrent first users Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0129/1005] gpio: shared-proxy: Drop the vote of a released proxy on write failure Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0130/1005] gpio: shared-proxy: Drive the default value when no votes are cast Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0131/1005] gpio: shared-proxy: Drop the vote when switching to input Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0132/1005] ipv6: fix fib6 walker UAF on NLM_F_REPLACE Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0133/1005] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0134/1005] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0135/1005] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0136/1005] net: stmmac: take ownership of saved RX state at poll entry Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0137/1005] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0138/1005] net: stmmac: drop multi-buffer frames in XDP mode Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0139/1005] net: stmmac: copy XDP metadata in AF_XDP zero-copy RX Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0140/1005] net: stmmac: fix VLAN tag stripping on short and non-linear RX frames Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0141/1005] net: stmmac: fix XDP RX buffer DMA sync length Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0142/1005] ata: libata-core: Check device support before querying power state Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0143/1005] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0144/1005] erofs: apply the stacked fs check to extra file-backed devices Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0145/1005] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0146/1005] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0147/1005] ntfs: dont allow resident values to overlap the attribute header Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0148/1005] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0149/1005] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0150/1005] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0151/1005] virtio-spi: Fix virtio_spi_config kernel-doc Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0152/1005] virtio_ring: reset IN_ORDER state in virtqueue_init() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0153/1005] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0154/1005] vdpa: invalidate DMA mappings before releasing memory Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0155/1005] vhost-scsi: preserve event ordering Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0156/1005] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0157/1005] vhost: fix dirty logging for in-order used ring entries Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0158/1005] virtio_pci: add missing newline to the pmcsr error message Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0159/1005] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0160/1005] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
2026-11-25 14:24 ` [PATCH 7.3 0161/1005] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0162/1005] virtio-blk: clamp max_segments to virtqueue ring size Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0163/1005] vduse: avoid infinite loop when no affinity CPU is online Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0164/1005] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0165/1005] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0166/1005] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0167/1005] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0168/1005] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0169/1005] net: phy: add phy_detach_internal() helper Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0170/1005] net: phy: dont require RTNL to detach a PHY from an unregistered netdev Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0171/1005] wifi: ath12k: dont advertise EHT-MCS15 to firmware unless we support it Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0172/1005] net: stmmac: propagate PTP init failures in __stmmac_open() and stmmac_resume() Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0173/1005] net: stmmac: ptp: switch to gettimex64() interface Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0174/1005] net: stmmac: initialize est_lock at probe time Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0175/1005] net: stmmac: pass the desired EST enable state to est_configure() Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0176/1005] net: stmmac: re-apply taprio offload in __stmmac_open() and stmmac_resume() Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0177/1005] bpf: Dont move a MAP_FIXED address in arena_get_unmapped_area() Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0178/1005] sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0179/1005] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0180/1005] bpf: Fix the join of fp+0 with a value that is not a pointer to stack Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0181/1005] bpf: Rename bpf_call_summary::num_params to arg_slot_cnt Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0182/1005] bpf: Prepare static analysis passes for callx instruction Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0183/1005] bpf: Dont trust pointers spilled in slots that a callee can write Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0184/1005] regulator: mt6363: Fix the registers of the VSRAM CPU and APU LDOs Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0185/1005] regulator: mt6363: Use 8-bit register values Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0186/1005] regulator: mt6363: Fix VEMC voltage selection Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0187/1005] Bluetooth: hci_sync: Fix invalid Supervision_Timeout in LE Set Default Rate Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0188/1005] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0189/1005] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0190/1005] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0191/1005] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0192/1005] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0193/1005] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0194/1005] Bluetooth: use assign_bit() where applicable Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0195/1005] Bluetooth: MGMT: Add management security level changed event Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0196/1005] Bluetooth: hci_core: Convert hci_conn flags to a bitmap Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0197/1005] Bluetooth: L2CAP: Hold incoming data until encryption key size is known Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0198/1005] Bluetooth: hci_sync: Update the CIS host feature when enabling LE Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0199/1005] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0200/1005] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0201/1005] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0202/1005] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0203/1005] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0204/1005] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0205/1005] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0206/1005] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init() Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0207/1005] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0208/1005] Bluetooth: SMP: Protect link keys during LTK derivation Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0209/1005] Bluetooth: SMP: Protect LTK encryption with RCU Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0210/1005] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0211/1005] Bluetooth: MGMT: Clear disabled connection parameters when loading none Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0212/1005] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0213/1005] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0214/1005] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0215/1005] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0216/1005] bpf: Emit timed may_goto for JITed progs only Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0217/1005] bpf: Propagate scalar precision through stack arguments Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0218/1005] selftests/mm: merge: keep the far mremap() targets in the carveout Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0219/1005] wifi: nxpwifi: guard the 11ax response handlers against a detached command buffer Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0220/1005] wifi: nxpwifi: read the 11AX_CFG extension ID at the right offset Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 7.3 0221/1005] wifi: nxpwifi: bound the TLV lengths in the 11AX_CFG response Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0222/1005] drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0223/1005] mctp i3c: Fix locking in an error path Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0224/1005] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0225/1005] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0226/1005] vhost-scsi: do not count PI bytes in the data length Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0227/1005] xfrm: iptfs: fix skb leak on error in __input_process_payload() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0228/1005] power: sequencing: qcom-wcn: increase WCN7850 power-up delay Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0229/1005] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0230/1005] virtio_ring: use shadow flags when detaching split descriptors Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0231/1005] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0232/1005] vhost: reject backend enable without a kick file Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0233/1005] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0234/1005] virtio_balloon: initialize wakeup_lock before virtqueues are set up Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0235/1005] vhost-scsi: fix page reference leak in misaligned I/O fallback Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0236/1005] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0237/1005] printk: Avoid multiple unregistration in unregister_console_locked() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0238/1005] blk-mq: reset queue state on scheduler teardown Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0239/1005] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0240/1005] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0241/1005] block: report the correct discard alignment in sysfs Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0242/1005] zloop: fix the error code in the blk_mq_alloc_disk message Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0243/1005] zloop: reject mismatched conventional zone files on restore Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0244/1005] virtio_blk: freeze the virtqueue layout at probe time Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0245/1005] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0246/1005] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0247/1005] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0248/1005] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0249/1005] nvmet: fix arbitration burst field mask Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0250/1005] can: skb: make CAN skb allocation failure paths IRQ-safe Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0251/1005] can: dev: can_tdc_fill_info(): dont read automatic TDCV if interface is down Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0252/1005] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0253/1005] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0254/1005] ipmr, ip6mr: queue netlink route queries out of band Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0255/1005] nvme-loop: delete the controller if a reset fails Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0256/1005] nvmet-tcp: ask for the TLS record type on every receive Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0257/1005] nvmet-auth: keep the old keys if the new ones fail Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0258/1005] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0259/1005] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0260/1005] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0261/1005] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0262/1005] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0263/1005] ASoC: rockchip_i2s: select REGMAP_MMIO Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0264/1005] ASoC: rockchip_i2s_tdm: " Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0265/1005] ASoC: rockchip_pdm: " Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0266/1005] ASoC: rockchip_sai: " Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0267/1005] ASoC: rockchip_spdif: " Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0268/1005] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0269/1005] net: stop defer_count outliving the deferred-free list Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0270/1005] erofs: treat files shared by inode_share as stacked Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0271/1005] isofs: handle Rock Ridge long-form dates before 1900 Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0272/1005] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0273/1005] cpufreq: Hold the policy write lock when changing boost state Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0274/1005] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0275/1005] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0276/1005] ipv6: Flush exception route while replacing nexthop Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0277/1005] ipv4: Batch rt_flush_dev() in netdev_run_todo() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0278/1005] ipv6: Batch rt6_uncached_list_flush_dev() " Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0279/1005] ipv6: Flush rt->from in rt6_uncached_list_flush_dev() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0280/1005] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 7.3 0281/1005] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0282/1005] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0283/1005] PM: runtime: Misc improvements to runtime_pm.rst Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0284/1005] PM: runtime: Add "Section" hyperlinks Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0285/1005] PM: runtime: Clarify ->runtime_idle() callback return value handling Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0286/1005] PM: runtime: Update runtime_pm.rst for non-fatal resume errors Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0287/1005] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0288/1005] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0289/1005] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0290/1005] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0291/1005] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0292/1005] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0293/1005] Bluetooth: qca: Disable SoC debug logging for WCN3950 Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0294/1005] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0295/1005] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0296/1005] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0297/1005] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0298/1005] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0299/1005] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0300/1005] ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP OmniBook 7 Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0301/1005] ALSA: firewire: fix inverted streaming speed between tx and rx streams Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0302/1005] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0303/1005] ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0304/1005] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0305/1005] ALSA: hda/realtek: Use inverted mute LED quirk for HP ZBook 8 G2a Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0306/1005] gpiolib: reset lookup flags for each hogged line Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0307/1005] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0308/1005] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0309/1005] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0310/1005] bonding: fix missing down path on speed/duplex failure after FAIL->UP Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0311/1005] net: stmmac: set XDP metadata length on the page_pool RX path Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0312/1005] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0313/1005] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0314/1005] netfilter: nft_set_rbtree: check catchall_sync return before queue_done Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0315/1005] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0316/1005] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0317/1005] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0318/1005] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0319/1005] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0320/1005] gpio: regmap: free the irqchip if adding the irq domain fails Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0321/1005] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0322/1005] MIPS: SGI-IP27: print the NMI dump on an nbcon console Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0323/1005] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0324/1005] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0325/1005] MIPS: Alchemy: Register interrupt chips with the IRQ core Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0326/1005] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0327/1005] MIPS: Cobalt: Include legacy IDE ports in the PCI I/O window Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0328/1005] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0329/1005] libfs: walk offset directories in offset order Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0330/1005] libfs: end offset readdir at positions past DIR_OFFSET_EOD Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0331/1005] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0332/1005] iov_iter: take an unsigned long segment count in import_iovec() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0333/1005] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0334/1005] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0335/1005] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0336/1005] perf/core: Include perf_event_attr::defer_output in is_sb_event() check Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0337/1005] perf/core: Clamp deferred callchain entry count to fit u16 header.size Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0338/1005] perf/amd/ibs: Reset CPU0 IBS state on syscore resume Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0339/1005] perf: Eliminate duplicate arch-specific function definitions Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0340/1005] perf: Move and enhance has_extended_regs() for arch-specific use Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 7.3 0341/1005] perf: Add sampling support for SIMD registers Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0342/1005] perf/amd/ibs: Fix kernel address leak via REGS_USER and REGS_INTR Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0343/1005] perf/amd/ibs: Simplify event state handling with IBS_CAPS_DIS Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0344/1005] sched/deadline: Fix this_bw on class change of a dying task Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0345/1005] sched/core: Account I/O waits independently of delayed dequeue Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0346/1005] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0347/1005] sched/topology: Balance cluster static-key updates Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0348/1005] sched/cache: Ignore non-fair current in alb_break_llc() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0349/1005] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0350/1005] gpio: mpfs: reject unsupported interrupt types Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0351/1005] x86/kcfi: Dont emit KCFI_REFERENCE() in modules Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0352/1005] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0353/1005] locking/lockdep: Fix inverted "on"/"last" CPU label in lockdep_print_held_locks() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0354/1005] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0355/1005] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0356/1005] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0358/1005] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0359/1005] cpufreq: Preserve global boost state on failed updates Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0367/1005] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0368/1005] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0369/1005] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0370/1005] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0371/1005] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0372/1005] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0373/1005] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0374/1005] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0375/1005] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0376/1005] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0377/1005] kho: check fdt_phys in is_kho_boot() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0378/1005] drm/xe/cri: Expose device UID through sysfs Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0379/1005] drm/xe/gsc: Define GSC for NVL-S Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0380/1005] drm/xe/pat: Return error from xe_pat_init_early() on unknown platform Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0381/1005] drm/xe: Prevent VF memory IRQ from accessing a torn-down engine Greg Kroah-Hartman
2026-11-25 14:45 ` [PATCH 7.3 0000/1005] 7.3.7-rc1 review SJ Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox