* [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
` (998 more replies)
0 siblings, 999 replies; 1007+ 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] 1007+ 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
` (997 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (996 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (995 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (994 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (993 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (992 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (991 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (990 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (989 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (988 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (987 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (986 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (985 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (984 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (983 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (982 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (981 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (980 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (979 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (978 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (977 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (976 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (975 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (974 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (973 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (972 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (971 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (970 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (969 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (968 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (967 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (966 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (965 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (964 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (963 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (962 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (961 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (960 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (959 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (958 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (957 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (956 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (955 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (954 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (953 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (952 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (951 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (950 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (949 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (948 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (947 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (946 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (945 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (944 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (943 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (942 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (941 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (940 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (939 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (938 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (937 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (936 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (935 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (934 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (933 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (932 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (931 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (930 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (929 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (928 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (927 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (926 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (925 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (924 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (923 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (922 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (921 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (920 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (919 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (918 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (917 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (916 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (915 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (914 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (913 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (912 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (911 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (910 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (909 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (908 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (907 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (906 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (905 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (904 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (903 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (902 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (901 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (900 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (899 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (898 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (897 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (896 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (895 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (894 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (893 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (892 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (891 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (890 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (889 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (888 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (887 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (886 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (885 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (884 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (883 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (882 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (881 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (880 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (879 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (878 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (877 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (876 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (875 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (874 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (873 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (872 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (871 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (870 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (869 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (868 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (867 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (866 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (865 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (864 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (863 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (862 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (861 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (860 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (859 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (858 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (857 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (856 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (855 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (854 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (853 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (852 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (851 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (850 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (849 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (848 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (847 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (846 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (845 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (844 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (843 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (842 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (841 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (840 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (839 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (838 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (837 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (836 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (835 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (834 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (833 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (832 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (831 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (830 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (829 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (828 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (827 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (826 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (825 subsequent siblings)
998 siblings, 0 replies; 1007+ 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, ¤t_time);
+ priv->ptp_clock_ops.gettimex64(&priv->ptp_clock_ops,
+ ¤t_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, ¤t_time);
+ priv->ptp_clock_ops.gettimex64(&priv->ptp_clock_ops, ¤t_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] 1007+ 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
` (824 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (823 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (822 subsequent siblings)
998 siblings, 0 replies; 1007+ 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, ¤t_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,
- ¤t_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, ¤t_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] 1007+ 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
` (821 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (820 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (819 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (818 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (817 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (816 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (815 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (814 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (813 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (812 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (811 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (810 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (809 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (808 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (807 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (806 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (805 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (804 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (803 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (802 subsequent siblings)
998 siblings, 0 replies; 1007+ 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(<k->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] 1007+ 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
` (801 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (800 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (799 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (798 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (797 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (796 subsequent siblings)
998 siblings, 0 replies; 1007+ 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(¶ms[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, ¶ms[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);
+ ¶ms[i].addr,
+ params[i].addr_type);
+ pend_report = hci_pend_le_action_lookup(
+ &hdev->pend_le_reports, ¶ms[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, ¶ms[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] 1007+ 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
` (795 subsequent siblings)
998 siblings, 0 replies; 1007+ 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,
- ¶ms->addr,
- params->addr_type);
- if (entry)
+ hci_dev_lock(hdev);
+ exists = hci_bdaddr_list_lookup_with_irk(
+ &hdev->le_resolv_list, ¶ms->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] 1007+ 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
` (794 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (793 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (792 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (791 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (790 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (789 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (788 subsequent siblings)
998 siblings, 0 replies; 1007+ 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, ¶ms->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, ¶ms->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] 1007+ 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
` (787 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (786 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (785 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (784 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (783 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (782 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (781 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (780 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (779 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (778 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (777 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (776 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (775 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (774 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (773 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (772 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (771 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (770 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (769 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (768 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (767 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (766 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (765 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (764 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (763 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (762 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (761 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (760 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (759 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (758 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (757 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (756 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (755 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (754 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (753 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (752 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (751 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (750 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (749 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (748 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (747 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (746 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (745 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (744 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (743 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (742 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (741 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (740 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (739 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (738 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (737 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (736 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (735 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (734 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (733 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (732 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (731 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (730 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (729 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (728 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (727 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (726 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (725 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (724 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (723 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (722 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (721 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (720 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (719 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (718 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (717 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (716 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (715 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (714 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (713 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (712 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (711 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (710 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (709 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (708 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (707 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (706 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (705 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (704 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (703 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (702 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (701 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (700 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (699 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (698 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (697 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (696 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (695 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (694 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (693 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (692 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (691 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (690 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (689 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (688 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (687 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (686 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (685 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (684 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (683 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (682 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (681 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (680 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (679 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (678 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (677 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (676 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (675 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (674 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (673 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (672 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (671 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (670 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (669 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (668 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (667 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (666 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (665 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (664 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (663 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (662 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (661 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (660 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (659 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (658 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (657 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (656 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (655 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (654 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (653 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (652 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (651 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (650 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (649 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (648 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (647 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (646 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (645 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (644 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (643 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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 0357/1005] perf: Fix racy update of cpc->hrtimer_interval Greg Kroah-Hartman
` (642 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ messages in thread
* [PATCH 7.3 0357/1005] perf: Fix racy update of cpc->hrtimer_interval
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 0358/1005] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Greg Kroah-Hartman
` (641 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ben Segall,
Peter Zijlstra (Intel), Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Segall <bsegall@google.com>
[ Upstream commit 3bbd85b2f67aff58f2cbec9a7fb705677b94473b ]
Updates to cpc->hrtimer_interval can race with reads either in the
hrtimer itself, or other calls to perf_mux_hrtimer_restart. This is not
exactly expected to be a common config change, but it's easy enough to
fix.
Since there's already an IPI to each cpu to restart the timer, and all
reads are with irqs disabled, just move the update onto the target cpu.
Fixes: 62b856397927 ("perf: Add sysfs entry to adjust multiplexing interval per PMU")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Ben Segall <bsegall@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://sashiko.dev/#/patchset/xm265wykhyrv.fsf%40google.com
Link: https://patch.msgid.link/xm26se1ihlqb.fsf@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9c45f9d584d67..4239cc173e356 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1332,14 +1332,19 @@ static int perf_mux_hrtimer_restart(struct perf_cpu_pmu_context *cpc)
return 0;
}
-static int perf_mux_hrtimer_restart_ipi(void *arg)
+static __always_inline struct perf_cpu_pmu_context *this_cpc(struct pmu *pmu)
{
- return perf_mux_hrtimer_restart(arg);
+ return *this_cpu_ptr(pmu->cpu_pmu_context);
}
-static __always_inline struct perf_cpu_pmu_context *this_cpc(struct pmu *pmu)
+static int perf_mux_hrtimer_interval_ipi(void *arg)
{
- return *this_cpu_ptr(pmu->cpu_pmu_context);
+ struct pmu *pmu = arg;
+ struct perf_cpu_pmu_context *cpc = this_cpc(pmu);
+ int ms = pmu->hrtimer_interval_ms;
+
+ cpc->hrtimer_interval = ns_to_ktime(NSEC_PER_MSEC * ms);
+ return perf_mux_hrtimer_restart(cpc);
}
void perf_pmu_disable(struct pmu *pmu)
@@ -12770,13 +12775,8 @@ perf_event_mux_interval_ms_store(struct device *dev,
/* update all cpuctx for this PMU */
cpus_read_lock();
- for_each_online_cpu(cpu) {
- struct perf_cpu_pmu_context *cpc;
- cpc = *per_cpu_ptr(pmu->cpu_pmu_context, cpu);
- cpc->hrtimer_interval = ns_to_ktime(NSEC_PER_MSEC * timer);
-
- cpu_function_call(cpu, perf_mux_hrtimer_restart_ipi, cpc);
- }
+ for_each_online_cpu(cpu)
+ cpu_function_call(cpu, perf_mux_hrtimer_interval_ipi, pmu);
cpus_read_unlock();
mutex_unlock(&mux_interval_mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ 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
` (356 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0357/1005] perf: Fix racy update of cpc->hrtimer_interval 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
` (640 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (357 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 0360/1005] cpufreq: Serialize global boost updates Greg Kroah-Hartman
` (639 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ messages in thread
* [PATCH 7.3 0360/1005] cpufreq: Serialize global boost updates
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 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 0361/1005] sched_ext: Reset task fields on exit of an SCX_TASK_READY task Greg Kroah-Hartman
` (638 subsequent siblings)
998 siblings, 0 replies; 1007+ 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 3d5720dff09f3b90d9ab2a6707e4bb8d69542f4a ]
Concurrent global boost sysfs writes can interleave their global flag
and per-policy updates. An enabling write can set the global flag, then
a disabling write can clear it and finish before the enabling write
updates the policies. Both writes succeed, leaving boost enabled on
the policies while the global flag is disabled.
Serialize the complete global boost update, including rollback on
failure, with a mutex.
Fixes: 6f19efc0a1ca ("cpufreq: Add boost frequency support in core")
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-3-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, 4 insertions(+)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 4bf7738a81b0f..cef055a4b7d91 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2814,6 +2814,8 @@ int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state)
}
EXPORT_SYMBOL_GPL(cpufreq_boost_set_sw);
+static DEFINE_MUTEX(cpufreq_boost_mutex);
+
static int cpufreq_boost_trigger_state(int state)
{
struct cpufreq_policy *policy;
@@ -2821,6 +2823,8 @@ static int cpufreq_boost_trigger_state(int state)
bool boost_enabled;
int ret = -EOPNOTSUPP;
+ guard(mutex)(&cpufreq_boost_mutex);
+
/*
* Don't compare 'cpufreq_driver->boost_enabled' with 'state' here to
* make sure all policies are in sync with global boost flag.
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0361/1005] sched_ext: Reset task fields on exit of an SCX_TASK_READY task
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 0360/1005] cpufreq: Serialize global boost updates Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0362/1005] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
` (637 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rahad Bhuiya, Tejun Heo, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rahad Bhuiya <rahadbhuiya2021@gmail.com>
[ Upstream commit 564405c424f49d70b13debe7fe5b550234ad6b84 ]
Tasks in SCX_TASK_READY are attached to a scheduler but outside the ext
class, such as RT/DL tasks, or non-SCHED_EXT tasks under a partial switch.
The scheduler's BPF code can still update their dsq_vtime and slice (for
instance, via ops.cgroup_move() as done by scx_flatcg).
Because __scx_disable_and_exit_task() currently breaks out of the state
switch for SCX_TASK_READY without calling scx_reset_task_fields(), these
fields are not cleared when the task leaves the scheduler. If the task is
subsequently moved to another cgroup/sub-scheduler and later switches to
SCHED_NORMAL, the new scheduler's ops.enable() sees stale dsq_vtime from
the previous scheduler's clock.
Call scx_reset_task_fields() in the SCX_TASK_READY case of
__scx_disable_and_exit_task() to ensure SCX-managed fields are properly
reset when leaving the scheduler.
Fixes: 5771e79e461e ("sched_ext: Reset dsq_vtime and slice when a task leaves SCX")
Signed-off-by: Rahad Bhuiya <rahadbhuiya2021@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/ext/ext.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index 50d5185bcd548..fd9f949f3647f 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -4198,6 +4198,7 @@ void __scx_disable_and_exit_task(struct scx_sched *sch, struct task_struct *p)
args.cancelled = true;
break;
case SCX_TASK_READY:
+ scx_reset_task_fields(task_rq(p), p);
break;
case SCX_TASK_ENABLED:
scx_disable_task(sch, p);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0362/1005] Bluetooth: reject invalid LE supervision timeout relationships
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 0361/1005] sched_ext: Reset task fields on exit of an SCX_TASK_READY task Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0363/1005] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
` (636 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Pepper, Luiz Augusto von Dentz,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Pepper <cochcoder@proton.me>
[ Upstream commit c1d50a71cdee90a0c68b7a67221d8aae96d14a0c ]
The LE parameter validator calculates an unsigned maximum latency by
subtracting one from a truncated quotient. If the quotient is zero,
this wraps and accepts invalid parameters. Exact quotient boundaries
also accept equality where the supervision timeout must be greater.
Compare the products directly after checking the field bounds. The
validated interval and latency limits keep the products within int.
This enforces the strict timeout relationship without division or
unsigned subtraction.
Sashiko identified the underflow while reviewing the soft interval
preference RFC. The bug is already present in its unpatched base; keep
this common-validator fix independent of that preference policy.
Fixes: 8757825b128e ("Bluetooth: hci_check_conn_params() check proper range")
Assisted-by: LLM
Signed-off-by: Kyle Pepper <cochcoder@proton.me>
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 | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index cac282584c616..3a1169e19eb80 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2320,8 +2320,6 @@ static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
static inline int hci_check_conn_params(u16 min, u16 max, u16 latency,
u16 to_multiplier)
{
- u16 max_latency;
-
if (min > max) {
BT_WARN("min %d > max %d", min, max);
return -EINVAL;
@@ -2347,19 +2345,14 @@ static inline int hci_check_conn_params(u16 min, u16 max, u16 latency,
return -EINVAL;
}
- if (max >= to_multiplier * 8) {
- BT_WARN("max %d >= to_multiplier %d * 8", max, to_multiplier);
- return -EINVAL;
- }
-
- max_latency = (to_multiplier * 4 / max) - 1;
if (latency > 499) {
BT_WARN("latency %d > 499", latency);
return -EINVAL;
}
- if (latency > max_latency) {
- BT_WARN("latency %d > max_latency %d", latency, max_latency);
+ if ((latency + 1) * max >= to_multiplier * 4) {
+ BT_WARN("latency %d, max %d and timeout %d are incompatible",
+ latency, max, to_multiplier);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0363/1005] net/mlx5e: IPoIB, Fix QPN lookup race
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 0362/1005] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0364/1005] netlink: Do not call the unbind callback with the table locked Greg Kroah-Hartman
` (635 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Prathamesh Deshpande, Tariq Toukan,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
[ Upstream commit 29066b0fc046a2965129a74325b98d9abb4647a9 ]
The parent RX completion path can load a QPN hash entry before
mlx5i_pkey_del_qpn() unlinks and frees it, then dereference freed memory.
Use RCU hlist operations and defer freeing with kfree_rcu(). The existing
RCU read-side section in mlx5e_napi_poll() covers the lookup. Keep ht_lock
for writers and acquire it before looking up the entry to delete.
Fixes: 7e7f4780c340 ("net/mlx5e: IPoIB, Use hash-table to map between QPN to child netdev")
Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261031225749.14214-1-prathameshdeshpande7@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/mellanox/mlx5/core/ipoib/ipoib.h | 2 +-
.../mellanox/mlx5/core/ipoib/ipoib_vlan.c | 26 +++++++++++--------
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
index d67d5a72bb419..8c0039c5425e2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
@@ -82,7 +82,7 @@ void mlx5i_pkey_qpn_ht_cleanup(struct net_device *netdev);
int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn);
int mlx5i_pkey_del_qpn(struct net_device *netdev, u32 qpn);
-/* Get the net-device corresponding to the given underlay QPN */
+/* Get the net-device for a QPN. Caller must hold rcu_read_lock(). */
struct net_device *mlx5i_pkey_get_netdev(struct net_device *netdev, u32 qpn);
/* Shared ndo functions */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
index 4120afd097c36..5edc392475251 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
@@ -31,6 +31,7 @@
*/
#include <linux/hash.h>
+#include <linux/rculist.h>
#include "ipoib.h"
#define MLX5I_MAX_LOG_PKEY_SUP 7
@@ -39,11 +40,12 @@ struct qpn_to_netdev {
struct net_device *netdev;
struct hlist_node hlist;
u32 underlay_qpn;
+ struct rcu_head rcu;
};
struct mlx5i_pkey_qpn_ht {
struct hlist_head buckets[1 << MLX5I_MAX_LOG_PKEY_SUP];
- spinlock_t ht_lock; /* Synchronise with NAPI */
+ spinlock_t ht_lock; /* Serialize hash table updates */
};
int mlx5i_pkey_qpn_ht_init(struct net_device *netdev)
@@ -68,13 +70,14 @@ void mlx5i_pkey_qpn_ht_cleanup(struct net_device *netdev)
kfree(ipriv->qpn_htbl);
}
-static struct qpn_to_netdev *mlx5i_find_qpn_to_netdev_node(struct hlist_head *buckets,
- u32 qpn)
+static struct qpn_to_netdev *
+mlx5i_find_qpn_to_netdev_node(struct mlx5i_pkey_qpn_ht *ht, u32 qpn)
{
- struct hlist_head *h = &buckets[hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP)];
+ struct hlist_head *h = &ht->buckets[hash_32(qpn, MLX5I_MAX_LOG_PKEY_SUP)];
struct qpn_to_netdev *node;
- hlist_for_each_entry(node, h, hlist) {
+ hlist_for_each_entry_rcu(node, h, hlist,
+ lockdep_is_held(&ht->ht_lock)) {
if (node->underlay_qpn == qpn)
return node;
}
@@ -96,7 +99,7 @@ int mlx5i_pkey_add_qpn(struct net_device *netdev, u32 qpn)
new_node->netdev = netdev;
new_node->underlay_qpn = qpn;
spin_lock_bh(&ht->ht_lock);
- hlist_add_head(&new_node->hlist, &ht->buckets[key]);
+ hlist_add_head_rcu(&new_node->hlist, &ht->buckets[key]);
spin_unlock_bh(&ht->ht_lock);
return 0;
@@ -109,16 +112,17 @@ int mlx5i_pkey_del_qpn(struct net_device *netdev, u32 qpn)
struct mlx5i_pkey_qpn_ht *ht = ipriv->qpn_htbl;
struct qpn_to_netdev *node;
- node = mlx5i_find_qpn_to_netdev_node(ht->buckets, qpn);
+ spin_lock_bh(&ht->ht_lock);
+ node = mlx5i_find_qpn_to_netdev_node(ht, qpn);
if (!node) {
+ spin_unlock_bh(&ht->ht_lock);
mlx5_core_warn(epriv->mdev, "QPN to netdev delete from HT failed\n");
return -EINVAL;
}
- spin_lock_bh(&ht->ht_lock);
- hlist_del_init(&node->hlist);
+ hlist_del_rcu(&node->hlist);
spin_unlock_bh(&ht->ht_lock);
- kfree(node);
+ kfree_rcu(node, rcu);
return 0;
}
@@ -128,7 +132,7 @@ struct net_device *mlx5i_pkey_get_netdev(struct net_device *netdev, u32 qpn)
struct mlx5i_priv *ipriv = netdev_priv(netdev);
struct qpn_to_netdev *node;
- node = mlx5i_find_qpn_to_netdev_node(ipriv->qpn_htbl->buckets, qpn);
+ node = mlx5i_find_qpn_to_netdev_node(ipriv->qpn_htbl, qpn);
if (!node)
return NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0364/1005] netlink: Do not call the unbind callback with the table locked
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 0363/1005] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0365/1005] net: ethernet: ti: am65-cpts: keep port and direction when matching PTPv1 TX timestamps Greg Kroah-Hartman
` (634 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anil Kaushik, Simon Horman,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anil Kaushik <anilkaushikwireless@gmail.com>
[ Upstream commit a36b9e205cb3c452ab96cc783e63465d466fe615 ]
When netlink_bind() fails to insert the socket, it calls
netlink_undo_bind() with the table locked. genl_unbind() then takes
cb_lock, while genl_unregister_family() and genl_register_family() take
cb_lock for writing and then wait in netlink_table_grab() for the table
users to go away:
netlink_bind() genl_unregister_family()
netlink_lock_table() down_write(&cb_lock)
netlink_insert() fails
netlink_undo_bind() netlink_table_grab()
genl_unbind() waits for nl_table_users == 0
down_read(&cb_lock)
An unprivileged user can get here by binding to a port ID that is in
use, with nl_groups set. Lockdep does not see it, as nl_table_users is a
plain counter.
Unlock the table first, as the comment in netlink_release() asks for.
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261101101347.3910654-1-anilkaushikwireless@gmail.com
Fixes: 3de21a8990d3 ("genetlink: Add per family bind/unbind callbacks")
Signed-off-by: Anil Kaushik <anilkaushikwireless@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261102120929.4077030-1-anilkaushikwireless@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netlink/af_netlink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 510fb5ebf9ff8..4850bac3a3f81 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1050,8 +1050,9 @@ static int netlink_bind(struct socket *sock, struct sockaddr_unsized *addr,
netlink_insert(sk, nladdr->nl_pid) :
netlink_autobind(sock);
if (err) {
+ netlink_unlock_table();
netlink_undo_bind(BITS_PER_TYPE(u32), groups, sk);
- goto unlock;
+ return err;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0365/1005] net: ethernet: ti: am65-cpts: keep port and direction when matching PTPv1 TX timestamps
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 0364/1005] netlink: Do not call the unbind callback with the table locked Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0366/1005] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum Greg Kroah-Hartman
` (633 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jesper L. Nielsen,
Siddharth Vadapalli, Simon Horman, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesper L. Nielsen <jln@pascal-audio.com>
[ Upstream commit c4b75e64aa5b1adc75b4f1f251b5e3baa5b75b09 ]
The CPTS reports the message type of a timestamp event using the PTPv2
header layout, i.e. the low nibble of the first header byte. In a PTPv1
header that byte is the upper byte of versionPTP and always 0, so every
PTPv1 event is reported as message type 0, while
am65_skb_get_mtype_seqid() reads the PTPv1 message type from the control
field. To make PTPv1 match at all, commit 1b9e743e923b ("net: ethernet:
ti: am65-cpts: Fix PTPv1 message type on TX packets") overwrites the
whole value compared against the skb with the skb's own value once the
sequence ids are equal. That throws away the event type and the port
number of the event as well, so a PTPv1 skb matches any TX event with
the same sequence id on either port. For PTPv1 this defeats
commit a23c657e332f ("net: ethernet: ti: am65-cpsw: Use also port
number to identify timestamps"). The overwritten value also sticks for
the rest of the TX queue walk.
Since every PTPv1 frame reads as message type 0, the hardware timestamps
all PTPv1 frames to UDP ports 319 and 320, including Follow_Up and
Delay_Resp, for which no skb waits. With a PTPv1 master on both ports
whose sequence ids run in step (e.g. a Dante device with primary and
secondary network started at the same time), the unclaimed TX event of
Follow_Up N on one port is still on the event list when the other port
queues Sync N, and am65_cpts_find_tx_ts() tries to match before it
checks for expiry. Sync N then gets the transmit time of the other
port's Follow_Up N, and the master announces a preciseOriginTimestamp up
to one Sync interval early to every slave on that network.
For PTPv1 replace only the message type of the event with the skb's and
keep its event type, port number and sequence id, and compute the value
per skb.
Tested on AM62x with ti-linux-6.12.y and the port number commit backported:
without this patch every boot in which both ports started PTP together
(10 of 10) sent wrong Sync timestamps, with it none did (0 of 29).
The bug was tracked down, and this fix and changelog drafted, with the
help of an AI coding assistant (Claude). I reviewed and tested it on
hardware as described above.
Fixes: a23c657e332f ("net: ethernet: ti: am65-cpsw: Use also port number to identify timestamps")
Signed-off-by: Jesper L. Nielsen <jln@pascal-audio.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261103-am65-cpts-ptpv1-v2-1-e1f79ed1ba60@pascal-audio.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/am65-cpts.c | 31 +++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c
index 0d71147f3c291..ca885405fea0c 100644
--- a/drivers/net/ethernet/ti/am65-cpts.c
+++ b/drivers/net/ethernet/ti/am65-cpts.c
@@ -811,6 +811,28 @@ static struct ptp_clock_info am65_ptp_info = {
.do_aux_work = am65_cpts_ts_work,
};
+/* The CPTS decodes the message type of an event using the PTPv2 header
+ * layout. For PTPv1 that nibble is part of versionPTP and always reads 0,
+ * while am65_skb_get_mtype_seqid() takes the message type from the PTPv1
+ * control field. For PTPv1 take the message type from the skb, but keep
+ * the event type, port number and sequence id of the event so that an
+ * event only matches a packet of the same direction on the same port.
+ */
+static u32 am65_cpts_event_mtype_seqid(struct am65_cpts_event *event,
+ u32 skb_mtype_seqid,
+ unsigned int ptp_class)
+{
+ u32 mtype_seqid = event->event1;
+
+ if (ptp_class & PTP_CLASS_V1) {
+ mtype_seqid &= ~AM65_CPTS_EVENT_1_MESSAGE_TYPE_MASK;
+ mtype_seqid |= skb_mtype_seqid &
+ AM65_CPTS_EVENT_1_MESSAGE_TYPE_MASK;
+ }
+
+ return mtype_seqid;
+}
+
static bool am65_cpts_match_tx_ts(struct am65_cpts *cpts,
struct am65_cpts_event *event)
{
@@ -820,7 +842,6 @@ static bool am65_cpts_match_tx_ts(struct am65_cpts *cpts,
bool found = false;
u32 mtype_seqid;
- mtype_seqid = event->event1;
__skb_queue_head_init(&txq_list);
spin_lock_irqsave(&cpts->txq.lock, flags);
@@ -833,11 +854,9 @@ static bool am65_cpts_match_tx_ts(struct am65_cpts *cpts,
struct am65_cpts_skb_cb_data *skb_cb =
(struct am65_cpts_skb_cb_data *)skb->cb;
- if ((ptp_classify_raw(skb) & PTP_CLASS_V1) &&
- ((mtype_seqid & AM65_CPTS_EVENT_1_SEQUENCE_ID_MASK) ==
- (skb_cb->skb_mtype_seqid & AM65_CPTS_EVENT_1_SEQUENCE_ID_MASK)))
- mtype_seqid = skb_cb->skb_mtype_seqid;
-
+ mtype_seqid = am65_cpts_event_mtype_seqid(event,
+ skb_cb->skb_mtype_seqid,
+ ptp_classify_raw(skb));
if (mtype_seqid == skb_cb->skb_mtype_seqid) {
u64 ns = event->timestamp;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0366/1005] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum
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 0365/1005] net: ethernet: ti: am65-cpts: keep port and direction when matching PTPv1 TX timestamps 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
` (632 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Or Har-Toov, Maher Sanalla,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Or Har-Toov <ohartoov@nvidia.com>
[ Upstream commit 9c1adbe7fa6cbc02c25db2039532918acf846400 ]
mlx5e_rep_update_hw_counters() adds transmitted_eth_multicast.packets
to vport_rx_packets but does not add transmitted_eth_multicast.octets
to vport_rx_bytes. As a result, Ethernet multicast sent by a VF/SF is
counted in its representor's rx_packets but not in rx_bytes.
Fix by adding transmitted_eth_multicast.octets to the vport_rx_bytes
sum.
Fixes: 64b68e369649 ("net/mlx5: Refactor and expand rep vport stat group")
Signed-off-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261101065833.282261-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 88a170e40bd93..a50a42581528a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -238,6 +238,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
MLX5_GET_CTR(out, transmitted_ib_unicast.octets) +
MLX5_GET_CTR(out, transmitted_eth_unicast.octets) +
MLX5_GET_CTR(out, transmitted_ib_multicast.octets) +
+ MLX5_GET_CTR(out, transmitted_eth_multicast.octets) +
MLX5_GET_CTR(out, transmitted_eth_broadcast.octets);
rep_stats->vport_tx_bytes =
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ 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
` (365 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0366/1005] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum 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
` (631 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (366 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
` (630 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (367 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
` (629 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (368 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
` (628 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (369 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
` (627 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (370 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
` (626 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (371 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
` (625 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (372 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
` (624 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (373 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
` (623 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (374 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
` (622 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (375 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
` (621 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (376 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
` (620 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (377 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
` (619 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (378 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
` (618 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ 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
` (379 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:28 ` [PATCH 7.3 0382/1005] drm/xe/guc: Protect timeout handling from device unplug Greg Kroah-Hartman
` (617 subsequent siblings)
998 siblings, 0 replies; 1007+ 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] 1007+ messages in thread
* [PATCH 7.3 0382/1005] drm/xe/guc: Protect timeout handling from device unplug
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (380 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:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0383/1005] drm/xe/gt: Disable GT reset worker before engine teardown Greg Kroah-Hartman
` (616 subsequent siblings)
998 siblings, 0 replies; 1007+ 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 78945c8c44bb2cfd6e5d2f762535efce0cefb086 ]
The GuC scheduler timeout callback accesses device and GT state while
handling a timed-out job. Guard the callback with drm_dev_enter() and
drm_dev_exit() so device unplug waits for in-flight timeout handling.
If unplug has already started, mark the job with -ENODEV and return it
to the scheduler for cleanup.
Fixes: 6eb2aad402cc ("drm/xe: Move hw_engine_fini to devm managed")
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>
Assisted-by: LLM
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20261013152417.3189567-7-satyanarayana.k.v.p@intel.com
(cherry picked from commit 3e9a95f3df5b0f9de163c5ee4e4e287750ef9655)
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_guc_submit.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 864859bd0ccc9..bdaec10c6d197 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1505,6 +1505,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
int err = -ETIME;
pid_t pid = -1;
bool wedged = false, wedge_device = false, skip_timeout_check;
+ int idx;
xe_gt_assert(guc_to_gt(guc), !exec_queue_destroyed(q));
@@ -1520,6 +1521,11 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
vf_recovery(guc))
return DRM_GPU_SCHED_STAT_NO_HANG;
+ if (!drm_dev_enter(&xe->drm, &idx)) {
+ xe_sched_job_set_error(job, -ENODEV);
+ return DRM_GPU_SCHED_STAT_NO_HANG;
+ }
+
/* Kill the run_job entry point */
if (xe_exec_queue_is_multi_queue(q))
xe_guc_exec_queue_group_stop(q);
@@ -1683,6 +1689,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
* We want the job added back to the pending list so it gets freed; this
* is what DRM_GPU_SCHED_STAT_NO_HANG does.
*/
+ drm_dev_exit(idx);
return DRM_GPU_SCHED_STAT_NO_HANG;
rearm:
@@ -1696,6 +1703,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
else
xe_sched_submission_start(sched);
handle_vf_resume:
+ drm_dev_exit(idx);
return DRM_GPU_SCHED_STAT_NO_HANG;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0383/1005] drm/xe/gt: Disable GT reset worker before engine teardown
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (381 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0382/1005] drm/xe/guc: Protect timeout handling from device unplug Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0384/1005] drm/xe/pcode: match argument naming with PCODE_DATAx Greg Kroah-Hartman
` (615 subsequent siblings)
998 siblings, 0 replies; 1007+ 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, Balasubramani Vivekanandan, 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 31ac48502b2d2d953249c1cd1bf3d38667049a00 ]
During tear-down process, a reset queued from Guc timeout handler can
still access hwe after hwe is freed. Register a separate devm
action that disables and drains the reset worker, so it runs before
any engine is torn down.
Fixes: 09c452d1171f ("drm/xe/gt: Synchronize GT reset with device unbind")
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>
Cc: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Assisted-by: LLM
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-8-satyanarayana.k.v.p@intel.com
(cherry picked from commit 861590f69994e41c9ef1b65db8e9ba433f1d1c1c)
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_gt.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index dfdacc0f6de97..57e302604f3dc 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -621,8 +621,21 @@ static int gt_init_with_gt_forcewake(struct xe_gt *gt)
return 0;
}
+static void gt_reset_worker_disable(void *arg)
+{
+ struct xe_gt *gt = arg;
+
+ if (disable_work_sync(>->reset.worker))
+ /*
+ * If gt_reset_worker was halted from executing, take care of
+ * releasing the rpm reference here.
+ */
+ xe_pm_runtime_put(gt_to_xe(gt));
+}
+
static int gt_init_with_all_forcewake(struct xe_gt *gt)
{
+ struct xe_device *xe = gt_to_xe(gt);
int err;
CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FORCEWAKE_ALL);
@@ -689,6 +702,11 @@ static int gt_init_with_all_forcewake(struct xe_gt *gt)
if (IS_SRIOV_PF(gt_to_xe(gt)))
xe_gt_sriov_pf_init_hw(gt);
+ /* Last action registered here so devres drains resets before teardown */
+ err = devm_add_action_or_reset(xe->drm.dev, gt_reset_worker_disable, gt);
+ if (err)
+ return err;
+
return 0;
}
@@ -697,12 +715,7 @@ static void xe_gt_fini(void *arg)
struct xe_gt *gt = arg;
int i;
- if (disable_work_sync(>->reset.worker))
- /*
- * If gt_reset_worker was halted from executing, take care of
- * releasing the rpm reference here.
- */
- xe_pm_runtime_put(gt_to_xe(gt));
+ gt_reset_worker_disable(gt);
for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
xe_hw_fence_irq_finish(>->fence_irq[i]);
@@ -745,8 +758,10 @@ int xe_gt_init(struct xe_gt *gt)
xe_force_wake_init_engines(gt, gt_to_fw(gt));
err = gt_init_with_all_forcewake(gt);
- if (err)
+ if (err) {
+ gt_reset_worker_disable(gt);
return err;
+ }
xe_gt_record_user_engines(gt);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0384/1005] drm/xe/pcode: match argument naming with PCODE_DATAx
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (382 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0383/1005] drm/xe/gt: Disable GT reset worker before engine teardown Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0385/1005] drm/xe/pcode: Increase default pcode mailbox timeout to 10ms Greg Kroah-Hartman
` (614 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jani Nikula, Michał Grzelak,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michał Grzelak <michal.grzelak@intel.com>
[ Upstream commit 68b966310260924a9dc6a5a96fd91cd190edbe2a ]
Variable naming of val and val1 should match register macro naming.
For xe, register macro naming of PCODE_DATA0 and PCODE_DATA1 is already
synced with register name. Nevertheless there are still functions
declaring val and val1. Rename val into val0 in functions declaring val1
in xe.
v4->v5
- clean changelog's versioning
v3->v4
- split i915 changes from xe (Jani)
v2->v3
- resolve conflict from rebase
v1->v2
- rebase onto drm-tip (Jani)
Bspec: 19978, 19979
Suggested-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
Link: https://patch.msgid.link/20260828190956.2622350-3-michal.grzelak@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Stable-dep-of: 94099304b80e ("drm/xe/hwmon: Fix pcode power limit handling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/display/xe_display_pcode.c | 4 ++--
drivers/gpu/drm/xe/xe_pcode.c | 4 ++--
drivers/gpu/drm/xe/xe_pcode.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/xe/display/xe_display_pcode.c b/drivers/gpu/drm/xe/display/xe_display_pcode.c
index f6820ef7e666d..8dc9cbdb18ec0 100644
--- a/drivers/gpu/drm/xe/display/xe_display_pcode.c
+++ b/drivers/gpu/drm/xe/display/xe_display_pcode.c
@@ -6,12 +6,12 @@
#include "xe_device.h"
#include "xe_pcode.h"
-static int xe_display_pcode_read(struct drm_device *drm, u32 mbox, u32 *val, u32 *val1)
+static int xe_display_pcode_read(struct drm_device *drm, u32 mbox, u32 *val0, u32 *val1)
{
struct xe_device *xe = to_xe_device(drm);
struct xe_tile *tile = xe_device_get_root_tile(xe);
- return xe_pcode_read(tile, mbox, val, val1);
+ return xe_pcode_read(tile, mbox, val0, val1);
}
static int xe_display_pcode_write_timeout(struct drm_device *drm, u32 mbox, u32 val, int timeout_ms)
diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
index ccc3bdeed6bb2..ccdfc33cf5876 100644
--- a/drivers/gpu/drm/xe/xe_pcode.c
+++ b/drivers/gpu/drm/xe/xe_pcode.c
@@ -136,12 +136,12 @@ int xe_pcode_write64_timeout(struct xe_tile *tile, u32 mbox, u32 data0, u32 data
return err;
}
-int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1)
+int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val0, u32 *val1)
{
int err;
mutex_lock(&tile->pcode.lock);
- err = pcode_mailbox_rw(tile, mbox, val, val1, 1, true, false);
+ err = pcode_mailbox_rw(tile, mbox, val0, val1, 1, true, false);
mutex_unlock(&tile->pcode.lock);
return err;
diff --git a/drivers/gpu/drm/xe/xe_pcode.h b/drivers/gpu/drm/xe/xe_pcode.h
index 8fb3e4ba13a6e..ba8a1d1b21521 100644
--- a/drivers/gpu/drm/xe/xe_pcode.h
+++ b/drivers/gpu/drm/xe/xe_pcode.h
@@ -23,7 +23,7 @@ int xe_pcode_probe_early(struct xe_device *xe);
int xe_pcode_ready(struct xe_device *xe, bool locked);
int xe_pcode_init_min_freq_table(struct xe_tile *tile, u32 min_gt_freq,
u32 max_gt_freq);
-int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1);
+int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val0, u32 *val1);
int xe_pcode_write_timeout(struct xe_tile *tile, u32 mbox, u32 val,
int timeout_ms);
int xe_pcode_write64_timeout(struct xe_tile *tile, u32 mbox, u32 data0,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0385/1005] drm/xe/pcode: Increase default pcode mailbox timeout to 10ms
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (383 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0384/1005] drm/xe/pcode: match argument naming with PCODE_DATAx Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0386/1005] drm/xe/hwmon: Use shared pcode default timeout for power limit write Greg Kroah-Hartman
` (613 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Rodrigo Vivi,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <karthik.poosa@intel.com>
[ Upstream commit 8721a51d44733b8b5cb41fa1bfe7fac2cf55107b ]
The previous 1ms timeout may be insufficient for some mailbox commands,
leading to spurious -ETIMEDOUT failures under load. Increase the default
timeout to 10ms and introduce PCODE_DEFAULT_TIMEOUT_MS for a shared
timeout definition, in line with pcode mailbox specification guidance.
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Link: https://patch.msgid.link/20260907083520.192418-2-karthik.poosa@intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Stable-dep-of: 94099304b80e ("drm/xe/hwmon: Fix pcode power limit handling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_pcode.c | 2 +-
drivers/gpu/drm/xe/xe_pcode.h | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
index ccdfc33cf5876..6e41075ae9f69 100644
--- a/drivers/gpu/drm/xe/xe_pcode.c
+++ b/drivers/gpu/drm/xe/xe_pcode.c
@@ -141,7 +141,7 @@ int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val0, u32 *val1)
int err;
mutex_lock(&tile->pcode.lock);
- err = pcode_mailbox_rw(tile, mbox, val0, val1, 1, true, false);
+ err = pcode_mailbox_rw(tile, mbox, val0, val1, PCODE_DEFAULT_TIMEOUT_MS, true, false);
mutex_unlock(&tile->pcode.lock);
return err;
diff --git a/drivers/gpu/drm/xe/xe_pcode.h b/drivers/gpu/drm/xe/xe_pcode.h
index ba8a1d1b21521..7e43792b0037a 100644
--- a/drivers/gpu/drm/xe/xe_pcode.h
+++ b/drivers/gpu/drm/xe/xe_pcode.h
@@ -18,6 +18,8 @@ struct xe_pcode_version {
u32 engg;
};
+#define PCODE_DEFAULT_TIMEOUT_MS 10
+
int xe_pcode_init_early(struct xe_tile *tile);
int xe_pcode_probe_early(struct xe_device *xe);
int xe_pcode_ready(struct xe_device *xe, bool locked);
@@ -31,7 +33,7 @@ int xe_pcode_write64_timeout(struct xe_tile *tile, u32 mbox, u32 data0,
int xe_get_pcode_version(struct xe_device *xe, struct xe_pcode_version *version);
#define xe_pcode_write(tile, mbox, val) \
- xe_pcode_write_timeout(tile, mbox, val, 1)
+ xe_pcode_write_timeout(tile, mbox, val, PCODE_DEFAULT_TIMEOUT_MS)
int xe_pcode_request(struct xe_tile *tile, u32 mbox, u32 request,
u32 reply_mask, u32 reply, int timeout_ms);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0386/1005] drm/xe/hwmon: Use shared pcode default timeout for power limit write
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (384 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0385/1005] drm/xe/pcode: Increase default pcode mailbox timeout to 10ms Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0387/1005] drm/xe/hwmon: Fix pcode power limit handling Greg Kroah-Hartman
` (612 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Rodrigo Vivi,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <karthik.poosa@intel.com>
[ Upstream commit 1a925ad51847db376fc0acd21fc5b76fb9c36cde ]
Drop the local PL_WRITE_MBX_TIMEOUT_MS macro and use the common
PCODE_DEFAULT_TIMEOUT_MS for the power limit write mailbox command.
This removes a duplicate timeout definition and keeps hwmon in sync with
the pcode default (now 10ms).
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Link: https://patch.msgid.link/20260907083520.192418-3-karthik.poosa@intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Stable-dep-of: 94099304b80e ("drm/xe/hwmon: Fix pcode power limit handling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_hwmon.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index de3f2aeffc3fb..08cec511806fa 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -101,11 +101,6 @@ enum sensor_attr_power {
#define PWR_ATTR_TO_STR(attr) (((attr) == hwmon_power_max) ? "PL1" : "PL2")
-/*
- * Timeout for power limit write mailbox command.
- */
-#define PL_WRITE_MBX_TIMEOUT_MS (1)
-
/* Index of memory controller in READ_THERMAL_DATA output */
#define TEMP_INDEX_MCTRL 2
@@ -252,7 +247,7 @@ static int xe_hwmon_pcode_rmw_power_limit(const struct xe_hwmon *hwmon, u32 attr
(channel == CHANNEL_CARD) ?
WRITE_PSYSGPU_POWER_LIMIT :
WRITE_PACKAGE_POWER_LIMIT, 0),
- val0, val1, PL_WRITE_MBX_TIMEOUT_MS);
+ val0, val1, PCODE_DEFAULT_TIMEOUT_MS);
if (ret)
drm_dbg(&hwmon->xe->drm, "write failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
channel, val0, val1, ret);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0387/1005] drm/xe/hwmon: Fix pcode power limit handling
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (385 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0386/1005] drm/xe/hwmon: Use shared pcode default timeout for power limit write Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0388/1005] drm/xe/hwmon: Decode mailbox temperature as sign-magnitude Greg Kroah-Hartman
` (611 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Rodrigo Vivi,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <karthik.poosa@intel.com>
[ Upstream commit 94099304b80e8c6e842c2626f603930577938f3a ]
Return early on pcode read failure in xe_hwmon_pcode_rmw_power_limit()
and propagate errors to callers.
Replace boot_power_limit_read with per-channel
read_power_limit_from_pcode[], set on the first successful pcode write,
so reads and writes stay consistent even if the default limit write at
boot fails.
Also return PWR_LIM_EN for power label so card label visibility works.
v2: Move default power limit writes to helper
xe_hwmon_pcode_set_default_power_limits().
Fixes: 8aa7306631f0 ("drm/xe/hwmon: Fix xe_hwmon_power_max_write")
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20261015071434.1063785-2-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit c5b502e43f7cd6456663d5bae495551646a5e125)
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_hwmon.c | 84 +++++++++++++++++++++++------------
1 file changed, 55 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 08cec511806fa..74d7faf85df04 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -165,8 +165,8 @@ struct xe_hwmon {
struct xe_hwmon_energy_info ei[CHANNEL_MAX];
/** @fi: Fan info for fanN_input */
struct xe_hwmon_fan_info fi[FAN_MAX];
- /** @boot_power_limit_read: is boot power limits read */
- bool boot_power_limit_read;
+ /** @read_power_limit_from_pcode: pcode accepted power limits write for the channel */
+ bool read_power_limit_from_pcode[CHANNEL_MAX];
/** @pl1_on_boot: power limit PL1 on boot */
u32 pl1_on_boot[CHANNEL_MAX];
/** @pl2_on_boot: power limit PL2 on boot */
@@ -175,9 +175,9 @@ struct xe_hwmon {
struct xe_hwmon_thermal_info temp;
};
-static inline int prepare_power_limit_param2(const struct xe_hwmon *hwmon)
+static inline int prepare_power_limit_param2(const struct xe_hwmon *hwmon, int channel)
{
- if (hwmon->boot_power_limit_read) {
+ if (hwmon->read_power_limit_from_pcode[channel]) {
if (hwmon->xe->info.platform >= XE_CRESCENTISLAND)
return READ_PL_ACCEPTED;
else
@@ -198,7 +198,8 @@ static int xe_hwmon_pcode_read_power_limit(const struct xe_hwmon *hwmon, u32 att
(channel == CHANNEL_CARD) ?
READ_PSYSGPU_POWER_LIMIT :
READ_PACKAGE_POWER_LIMIT,
- prepare_power_limit_param2(hwmon)), &val0, &val1);
+ prepare_power_limit_param2(hwmon, channel)),
+ &val0, &val1);
if (ret) {
drm_dbg(&hwmon->xe->drm, "read failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
@@ -213,14 +214,14 @@ static int xe_hwmon_pcode_read_power_limit(const struct xe_hwmon *hwmon, u32 att
else if (attr == PL2_HWMON_ATTR)
*uval = (val1 & PWR_LIM_EN) ? val1 : 0;
else if (attr == hwmon_power_label)
- *uval = (val0 & PWR_LIM_EN) ? 1 : (val1 & PWR_LIM_EN) ? 1 : 0;
+ *uval = (val0 | val1) & PWR_LIM_EN;
else
*uval = 0;
return ret;
}
-static int xe_hwmon_pcode_rmw_power_limit(const struct xe_hwmon *hwmon, u32 attr, u8 channel,
+static int xe_hwmon_pcode_rmw_power_limit(struct xe_hwmon *hwmon, u32 attr, u8 channel,
u32 clr, u32 set)
{
struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
@@ -231,10 +232,13 @@ static int xe_hwmon_pcode_rmw_power_limit(const struct xe_hwmon *hwmon, u32 attr
(channel == CHANNEL_CARD) ?
READ_PSYSGPU_POWER_LIMIT :
READ_PACKAGE_POWER_LIMIT,
- prepare_power_limit_param2(hwmon)), &val0, &val1);
- if (ret)
- drm_dbg(&hwmon->xe->drm, "read failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
+ prepare_power_limit_param2(hwmon, channel)),
+ &val0, &val1);
+ if (ret) {
+ drm_err(&hwmon->xe->drm, "read failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
channel, val0, val1, ret);
+ return ret;
+ }
if (attr == PL1_HWMON_ATTR)
val0 = (val0 & ~clr) | set;
@@ -248,9 +252,36 @@ static int xe_hwmon_pcode_rmw_power_limit(const struct xe_hwmon *hwmon, u32 attr
WRITE_PSYSGPU_POWER_LIMIT :
WRITE_PACKAGE_POWER_LIMIT, 0),
val0, val1, PCODE_DEFAULT_TIMEOUT_MS);
- if (ret)
+ if (ret) {
drm_dbg(&hwmon->xe->drm, "write failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
channel, val0, val1, ret);
+ return ret;
+ }
+
+ /* Read from pcode once it holds a driver-written limit */
+ if (!hwmon->read_power_limit_from_pcode[channel])
+ hwmon->read_power_limit_from_pcode[channel] = true;
+
+ return 0;
+}
+
+static int xe_hwmon_pcode_set_default_power_limits(struct xe_hwmon *hwmon)
+{
+ int ret = 0;
+
+ ret |= xe_hwmon_pcode_rmw_power_limit(hwmon, PL1_HWMON_ATTR, CHANNEL_CARD,
+ PWR_LIM | PWR_LIM_TIME,
+ hwmon->pl1_on_boot[CHANNEL_CARD]);
+ ret |= xe_hwmon_pcode_rmw_power_limit(hwmon, PL1_HWMON_ATTR, CHANNEL_PKG,
+ PWR_LIM | PWR_LIM_TIME,
+ hwmon->pl1_on_boot[CHANNEL_PKG]);
+ ret |= xe_hwmon_pcode_rmw_power_limit(hwmon, PL2_HWMON_ATTR, CHANNEL_CARD,
+ PWR_LIM | PWR_LIM_TIME,
+ hwmon->pl2_on_boot[CHANNEL_CARD]);
+ ret |= xe_hwmon_pcode_rmw_power_limit(hwmon, PL2_HWMON_ATTR, CHANNEL_PKG,
+ PWR_LIM | PWR_LIM_TIME,
+ hwmon->pl2_on_boot[CHANNEL_PKG]);
+
return ret;
}
@@ -394,7 +425,9 @@ static int xe_hwmon_power_max_write(struct xe_hwmon *hwmon, u32 attr, int channe
if (hwmon->xe->info.has_mbx_power_limits) {
drm_dbg(&hwmon->xe->drm, "disabling %s on channel %d\n",
PWR_ATTR_TO_STR(attr), channel);
- xe_hwmon_pcode_rmw_power_limit(hwmon, attr, channel, PWR_LIM_EN, 0);
+ ret = xe_hwmon_pcode_rmw_power_limit(hwmon, attr, channel, PWR_LIM_EN, 0);
+ if (ret)
+ goto unlock;
xe_hwmon_pcode_read_power_limit(hwmon, attr, channel, ®_val);
} else {
reg_val = xe_mmio_rmw32(mmio, rapl_limit, PWR_LIM_EN, 0);
@@ -655,15 +688,19 @@ xe_hwmon_power_max_interval_store(struct device *dev, struct device_attribute *a
mutex_lock(&hwmon->hwmon_lock);
- if (hwmon->xe->info.has_mbx_power_limits)
- xe_hwmon_pcode_rmw_power_limit(hwmon, power_attr, channel, PWR_LIM_TIME, rxy);
- else
+ ret = count;
+ if (hwmon->xe->info.has_mbx_power_limits) {
+ ret = xe_hwmon_pcode_rmw_power_limit(hwmon, power_attr, channel, PWR_LIM_TIME, rxy);
+ if (!ret)
+ ret = count;
+ } else {
r = xe_mmio_rmw32(mmio, xe_hwmon_get_reg(hwmon, REG_PKG_RAPL_LIMIT, channel),
PWR_LIM_TIME, rxy);
+ }
mutex_unlock(&hwmon->hwmon_lock);
- return count;
+ return ret;
}
/* PSYS PL1 */
@@ -1487,22 +1524,11 @@ xe_hwmon_get_preregistration_info(struct xe_hwmon *hwmon)
} else {
drm_info(&hwmon->xe->drm, "Using mailbox commands for power limits\n");
/* Write default limits to read from pcode from now on. */
- xe_hwmon_pcode_rmw_power_limit(hwmon, PL1_HWMON_ATTR,
- CHANNEL_CARD, PWR_LIM | PWR_LIM_TIME,
- hwmon->pl1_on_boot[CHANNEL_CARD]);
- xe_hwmon_pcode_rmw_power_limit(hwmon, PL1_HWMON_ATTR,
- CHANNEL_PKG, PWR_LIM | PWR_LIM_TIME,
- hwmon->pl1_on_boot[CHANNEL_PKG]);
- xe_hwmon_pcode_rmw_power_limit(hwmon, PL2_HWMON_ATTR,
- CHANNEL_CARD, PWR_LIM | PWR_LIM_TIME,
- hwmon->pl2_on_boot[CHANNEL_CARD]);
- xe_hwmon_pcode_rmw_power_limit(hwmon, PL2_HWMON_ATTR,
- CHANNEL_PKG, PWR_LIM | PWR_LIM_TIME,
- hwmon->pl2_on_boot[CHANNEL_PKG]);
+ if (xe_hwmon_pcode_set_default_power_limits(hwmon))
+ drm_warn(&hwmon->xe->drm, "Failed to set default power limits\n");
hwmon->scl_shift_power = PWR_UNIT;
hwmon->scl_shift_energy = ENERGY_UNIT;
hwmon->scl_shift_time = TIME_UNIT;
- hwmon->boot_power_limit_read = true;
}
} else {
drm_info(&hwmon->xe->drm, "Using register for power limits\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0388/1005] drm/xe/hwmon: Decode mailbox temperature as sign-magnitude
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (386 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0387/1005] drm/xe/hwmon: Fix pcode power limit handling Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0389/1005] drm/xe/hwmon: Fix thermal sensor data handling Greg Kroah-Hartman
` (610 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Rodrigo Vivi,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <karthik.poosa@intel.com>
[ Upstream commit c9d8ef7f6835ddfca8259c322804038799be5641 ]
The mailbox temperature is an 8-bit sign-magnitude value (bit 7 sign,
bits 6:0 magnitude, range -127..127), not two's-complement. Casting the
raw byte to s8 decodes negative readings incorrectly.
Add mbx_temp_decode(), store the raw byte as u8, and use it in
get_mc_temp() and get_pcie_temp() so temperatures are decoded correctly.
Fixes: 3a0cb885e111 ("drm/xe/hwmon: Expose memory controller temperature")
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20261015071434.1063785-3-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 1bbbd7d98fa588d5ace3d79ce56d8928f18768f5)
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_hwmon.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 74d7faf85df04..123aef35aaacd 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -104,6 +104,10 @@ enum sensor_attr_power {
/* Index of memory controller in READ_THERMAL_DATA output */
#define TEMP_INDEX_MCTRL 2
+/* Mailbox temperature is sign-magnitude: bit 7 sign, bits 6:0 magnitude. */
+#define TEMP_MBX_SIGN BIT(7)
+#define TEMP_MBX_MAG GENMASK(6, 0)
+
/* Maximum characters in hwmon label name */
#define MAX_LABEL_SIZE 16
@@ -139,8 +143,8 @@ struct xe_hwmon_thermal_info {
};
/** @count: no of temperature sensors available for the platform */
u8 count;
- /** @value: signed value from each sensor */
- s8 value[U8_MAX];
+ /** @value: per-sensor raw mailbox temperature; bit7=sign, bits6:0=magnitude */
+ u8 value[U8_MAX];
/** @vram_label: vram label names */
char vram_label[MAX_VRAM_CHANNELS][MAX_LABEL_SIZE];
};
@@ -821,6 +825,14 @@ static int xe_hwmon_pcode_read_thermal_info(struct xe_hwmon *hwmon)
return ret;
}
+/* Decode an 8-bit sign-magnitude mailbox temperature to degrees Celsius. */
+static int mbx_temp_decode(u8 value)
+{
+ int temp = value & TEMP_MBX_MAG;
+
+ return (value & TEMP_MBX_SIGN) ? -temp : temp;
+}
+
static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
{
struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
@@ -837,7 +849,7 @@ static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
}
for (i = TEMP_INDEX_MCTRL; i < hwmon->temp.count - 1; i++)
- average += hwmon->temp.value[i];
+ average += mbx_temp_decode(hwmon->temp.value[i]);
average /= (hwmon->temp.count - TEMP_INDEX_MCTRL - 1);
*val = average * MILLIDEGREE_PER_DEGREE;
@@ -860,7 +872,7 @@ static int get_pcie_temp(struct xe_hwmon *hwmon, long *val)
data = REG_FIELD_GET(PCIE_SENSOR_MASK, data);
data = REG_FIELD_GET(TEMP_MASK, data);
- *val = (s8)data * MILLIDEGREE_PER_DEGREE;
+ *val = mbx_temp_decode(data) * MILLIDEGREE_PER_DEGREE;
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0389/1005] drm/xe/hwmon: Fix thermal sensor data handling
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (387 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0388/1005] drm/xe/hwmon: Decode mailbox temperature as sign-magnitude Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0390/1005] drm/xe/hwmon: Add helpers to validate thermal sensor readings Greg Kroah-Hartman
` (609 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Rodrigo Vivi,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <karthik.poosa@intel.com>
[ Upstream commit d37dcdaa99b18995d74c2381b103e308f21e2565 ]
Read all required thermal groups in get_mc_temp() and store them in a
dword-aligned buffer, avoiding unaligned pcode accesses and ensuring
correct memory controller temperature reporting.
Store the pcode thermal data and thermal limit words as little-endian,
so their per-byte views match the hardware layout on big-endian hosts.
Fixes: 3a0cb885e111 ("drm/xe/hwmon: Expose memory controller temperature")
Fixes: c332fba805d6 ("drm/xe/hwmon: Expose temperature limits")
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20261015071434.1063785-4-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit ca6e33701de8676118f1d039e0c00839d7de13c6)
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_hwmon.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 123aef35aaacd..89e4a8c842d26 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -138,13 +138,17 @@ struct xe_hwmon_thermal_info {
union {
/** @limit: temperatures limits */
u8 limit[TEMP_LIMIT_MAX];
- /** @data: temperature limits in dwords */
- u32 data[DIV_ROUND_UP(TEMP_LIMIT_MAX, sizeof(u32))];
+ /** @data: temperature limits as little-endian dwords */
+ __le32 data[DIV_ROUND_UP(TEMP_LIMIT_MAX, sizeof(u32))];
};
/** @count: no of temperature sensors available for the platform */
u8 count;
- /** @value: per-sensor raw mailbox temperature; bit7=sign, bits6:0=magnitude */
- u8 value[U8_MAX];
+ union {
+ /** @value: per-sensor raw mailbox temperature; bit7=sign, bits6:0=magnitude */
+ u8 value[U8_MAX + 1];
+ /** @dword: sensor values as little-endian dwords, u32-aligned for pcode reads */
+ __le32 dword[DIV_ROUND_UP(U8_MAX + 1, sizeof(u32))];
+ };
/** @vram_label: vram label names */
char vram_label[MAX_VRAM_CHANNELS][MAX_LABEL_SIZE];
};
@@ -803,16 +807,17 @@ static const struct hwmon_channel_info * const hwmon_info[] = {
static int xe_hwmon_pcode_read_thermal_info(struct xe_hwmon *hwmon)
{
struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
- u32 config = 0;
+ u32 config = 0, data0 = 0, data1 = 0;
int ret;
ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_LIMITS, 0),
- &hwmon->temp.data[0], &hwmon->temp.data[1]);
+ &data0, &data1);
if (ret)
return ret;
- drm_dbg(&hwmon->xe->drm, "thermal info read val 0x%x val1 0x%x\n",
- hwmon->temp.data[0], hwmon->temp.data[1]);
+ drm_dbg(&hwmon->xe->drm, "thermal info read val 0x%x val1 0x%x\n", data0, data1);
+ hwmon->temp.data[0] = cpu_to_le32(data0);
+ hwmon->temp.data[1] = cpu_to_le32(data1);
ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_CONFIG, 0),
&config, NULL);
@@ -836,16 +841,20 @@ static int mbx_temp_decode(u8 value)
static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
{
struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
- u32 *dword = (u32 *)hwmon->temp.value;
s32 average = 0;
int ret, i;
- for (i = 0; i < DIV_ROUND_UP(TEMP_LIMIT_MAX, sizeof(u32)); i++) {
+ guard(mutex)(&hwmon->hwmon_lock);
+
+ for (i = 0; i < DIV_ROUND_UP(hwmon->temp.count, sizeof(u32)); i++) {
+ u32 data = 0;
+
ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_THERMAL_INFO, READ_THERMAL_DATA, i),
- (dword + i), NULL);
+ &data, NULL);
if (ret)
return ret;
- drm_dbg(&hwmon->xe->drm, "thermal data for group %d val 0x%x\n", i, dword[i]);
+ drm_dbg(&hwmon->xe->drm, "thermal data for group %d val 0x%x\n", i, data);
+ hwmon->temp.dword[i] = cpu_to_le32(data);
}
for (i = TEMP_INDEX_MCTRL; i < hwmon->temp.count - 1; i++)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0390/1005] drm/xe/hwmon: Add helpers to validate thermal sensor readings
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (388 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0389/1005] drm/xe/hwmon: Fix thermal sensor data handling Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0391/1005] drm/xe/hwmon: Handle unavailable memory controller sensors Greg Kroah-Hartman
` (608 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Rodrigo Vivi,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <karthik.poosa@intel.com>
[ Upstream commit f2a144e9891b397aebcfc0e88906c29bc079322d ]
Add mmio_temp_valid() and mbx_temp_valid() to check whether a temperature
sensor reading is valid. An MMIO value of 0xFFFFFFFF or a mailbox value of
0xFF indicates the sensor is unavailable.
Gate these checks behind has_temp_sentinel, enabled on CRI currently.
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20261015071434.1063785-5-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Stable-dep-of: dbd199c775cb ("drm/xe/hwmon: Handle unavailable memory controller sensors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_device_types.h | 2 ++
drivers/gpu/drm/xe/xe_hwmon.c | 27 +++++++++++++++++++++++++++
drivers/gpu/drm/xe/xe_pci.c | 2 ++
drivers/gpu/drm/xe/xe_pci_types.h | 1 +
4 files changed, 32 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index e4431f27d43c5..8daccb82ded79 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -219,6 +219,8 @@ struct xe_device {
u8 has_sriov:1;
/** @info.has_sysctrl: Supports System Controller */
u8 has_sysctrl:1;
+ /** @info.has_temp_sentinel: Device has temperature-unavailable sentinels */
+ u8 has_temp_sentinel:1;
/** @info.has_usm: Device has unified shared memory support */
u8 has_usm:1;
/** @info.has_64bit_timestamp: Device supports 64-bit timestamps */
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 89e4a8c842d26..4b55a625affa2 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -104,6 +104,9 @@ enum sensor_attr_power {
/* Index of memory controller in READ_THERMAL_DATA output */
#define TEMP_INDEX_MCTRL 2
+/* Mailbox sentinel reported for an unavailable temperature sensor */
+#define TEMP_MBX_INVALID 0xFF
+
/* Mailbox temperature is sign-magnitude: bit 7 sign, bits 6:0 magnitude. */
#define TEMP_MBX_SIGN BIT(7)
#define TEMP_MBX_MAG GENMASK(6, 0)
@@ -830,6 +833,30 @@ static int xe_hwmon_pcode_read_thermal_info(struct xe_hwmon *hwmon)
return ret;
}
+static inline bool mmio_temp_valid(const struct xe_hwmon *hwmon, u32 value)
+{
+ /*
+ * On platforms lacking temperature sentinel support, a value of 0 is treated
+ * as invalid. While 0°C is theoretically possible, it is highly unlikely for
+ * a discrete GPU in normal environments, making it a reasonable fallback
+ * indicator for invalid or uninitialized temperature readings.
+ * All-ones is returned when the device is off the bus, so reject it too.
+ */
+ if (value == U32_MAX)
+ return false;
+
+ return hwmon->xe->info.has_temp_sentinel || value != 0;
+}
+
+/* Mailbox temperature is sign-magnitude (bit 7 sign, bits 6:0 magnitude). */
+static inline bool mbx_temp_valid(const struct xe_hwmon *hwmon, u8 value)
+{
+ if (value == TEMP_MBX_INVALID)
+ return false;
+
+ return hwmon->xe->info.has_temp_sentinel || value != 0;
+}
+
/* Decode an 8-bit sign-magnitude mailbox temperature to degrees Celsius. */
static int mbx_temp_decode(u8 value)
{
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 06e1062ec1705..5d7a0b403ac0d 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -483,6 +483,7 @@ static const struct xe_device_desc cri_desc = {
.has_soc_remapper_telem = true,
.has_sriov = true,
.has_sysctrl = true,
+ .has_temp_sentinel = true,
.max_gt_per_tile = 2,
MULTI_LRC_MASK,
.require_force_probe = true,
@@ -814,6 +815,7 @@ static int xe_info_init_early(struct xe_device *xe,
xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
desc->has_sriov;
xe->info.has_sysctrl = desc->has_sysctrl;
+ xe->info.has_temp_sentinel = desc->has_temp_sentinel;
xe->info.skip_guc_pc = desc->skip_guc_pc;
xe->info.skip_pcode = desc->skip_pcode;
xe->info.needs_scratch = desc->needs_scratch;
diff --git a/drivers/gpu/drm/xe/xe_pci_types.h b/drivers/gpu/drm/xe/xe_pci_types.h
index fe327323a0be6..7cb372a832941 100644
--- a/drivers/gpu/drm/xe/xe_pci_types.h
+++ b/drivers/gpu/drm/xe/xe_pci_types.h
@@ -60,6 +60,7 @@ struct xe_device_desc {
u8 has_soc_remapper_telem:1;
u8 has_sriov:1;
u8 has_sysctrl:1;
+ u8 has_temp_sentinel:1;
u8 needs_scratch:1;
u8 skip_guc_pc:1;
u8 skip_pcode:1;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0391/1005] drm/xe/hwmon: Handle unavailable memory controller sensors
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (389 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0390/1005] drm/xe/hwmon: Add helpers to validate thermal sensor readings Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0392/1005] drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines Greg Kroah-Hartman
` (607 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Rodrigo Vivi,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karthik Poosa <karthik.poosa@intel.com>
[ Upstream commit dbd199c775cbedbd1acaff96e1d7f4c398e558d9 ]
Skip memory controller sensors that report invalid readings when
computing the average temperature in get_mc_temp(). Return -ENXIO when
no valid sensor data is available, and allow the helper to be used as
an availability probe by making the output parameter optional.
Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
Fixes: 3a0cb885e111 ("drm/xe/hwmon: Expose memory controller temperature")
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20261015071434.1063785-6-karthik.poosa@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 99ceaebb888944d00932063a649ebb41bd8af1d2)
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_hwmon.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index 4b55a625affa2..b47c083e52b6c 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -868,8 +868,8 @@ static int mbx_temp_decode(u8 value)
static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
{
struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe);
+ int ret, i, count = 0;
s32 average = 0;
- int ret, i;
guard(mutex)(&hwmon->hwmon_lock);
@@ -884,11 +884,23 @@ static int get_mc_temp(struct xe_hwmon *hwmon, long *val)
hwmon->temp.dword[i] = cpu_to_le32(data);
}
- for (i = TEMP_INDEX_MCTRL; i < hwmon->temp.count - 1; i++)
+ for (i = TEMP_INDEX_MCTRL; i < hwmon->temp.count - 1; i++) {
+ if (!mbx_temp_valid(hwmon, hwmon->temp.value[i]))
+ continue;
average += mbx_temp_decode(hwmon->temp.value[i]);
+ count++;
+ }
+
+ if (!count) {
+ drm_dbg(&hwmon->xe->drm, "Memory controller temperature unavailable!\n");
+ return -ENXIO;
+ }
+
+ average /= count;
+
+ if (val)
+ *val = average * MILLIDEGREE_PER_DEGREE;
- average /= (hwmon->temp.count - TEMP_INDEX_MCTRL - 1);
- *val = average * MILLIDEGREE_PER_DEGREE;
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0392/1005] drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (390 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0391/1005] drm/xe/hwmon: Handle unavailable memory controller sensors Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0393/1005] drm/xe/gsc: Fix NVL-S GSC compatibility number Greg Kroah-Hartman
` (606 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matt Roper, Nitin Gote,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nitin Gote <nitin.r.gote@intel.com>
[ Upstream commit ddef200c67d445f978f323d947c8993570ae4756 ]
The "Disable NULL query for Anyhit Shader" tuning uses
xe_rtp_match_first_render_or_compute to program RT_CTRL once per GT.
On a GT with no render (RCS) engine, that match falls back to a
compute (CCS) engine instead, so the tuning is still written even
though RT_CTRL's ray-tracing logic has no hardware behind it there.
A CRI compute-only GT hits exactly this path, causing
igt@xe_debugfs@check-gt-reg-sr to report a save-restore mismatch:
Mismatch on 0xe530, expected 0x400 got 0x0
Restrict the rule to ENGINE_CLASS(RENDER) so it only applies where
ray-tracing hardware is actually present. Every other in-tree platform
in this version range (BMG, LNL, PTL, NVL) always has a render engine,
which xe_rtp_match_first_render_or_compute already resolves ahead of
any compute engine, so this is a no-op for them.
Assisted-by: LLM
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Nitin Gote <nitin.r.gote@intel.com>
Fixes: 8d8431298f69 ("drm/xe/xe3: Disable null query for anyhit shader")
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20261012171901.19508-6-nitin.r.gote@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 65e2e108e466a2def170797a6d1b4b7849cec3a1)
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_tuning.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_tuning.c b/drivers/gpu/drm/xe/xe_tuning.c
index bcec40ca2d35f..315221bcccb12 100644
--- a/drivers/gpu/drm/xe/xe_tuning.c
+++ b/drivers/gpu/drm/xe/xe_tuning.c
@@ -116,7 +116,7 @@ static const struct xe_rtp_table_sr engine_tunings = XE_RTP_TABLE_SR(
},
{ XE_RTP_NAME("Tuning: Disable NULL query for Anyhit Shader"),
XE_RTP_RULES(GRAPHICS_VERSION_RANGE(2000, XE_RTP_END_VERSION_UNDEFINED),
- FUNC(xe_rtp_match_first_render_or_compute)),
+ ENGINE_CLASS(RENDER)),
XE_RTP_ACTIONS(SET(RT_CTRL, DIS_NULL_QUERY))
},
{ XE_RTP_NAME("Tuning: disable HW reporting of ctx switch to GHWSP"),
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0393/1005] drm/xe/gsc: Fix NVL-S GSC compatibility number
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (391 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0392/1005] drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0394/1005] drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2 Greg Kroah-Hartman
` (605 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniele Ceraolo Spurio, Alan Previn,
Julia Filipchuk, Rodrigo Vivi, Matthew Brost, Dave Airlie,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
[ Upstream commit f8795bced27bb00d74cef9de33e8a5e939c05e02 ]
The compatibility number for the published GSC number is 1.0. The binary
is correctly named nvl_gsc_1.bin (matching the major compatibility
version number), but the driver is instead looking for compatibility 0.0
(which maps to nvl_gsc_0.bin), leading to the binary not being found.
The driver supports running without GSC so this is not fatal, but all
content protection features will not work without the GSC FW.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Fixes: 8a90f0d1098f ("drm/xe/gsc: Define GSC for NVL-S")
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: Julia Filipchuk <julia.filipchuk@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Link: https://patch.msgid.link/20261015204548.147348-1-daniele.ceraolospurio@intel.com
(cherry picked from commit 11f8678d6a702ab9d6abb2f50c45e82a56974068)
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_uc_fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_uc_fw.c b/drivers/gpu/drm/xe/xe_uc_fw.c
index f61910431cf25..78b8f104e5772 100644
--- a/drivers/gpu/drm/xe/xe_uc_fw.c
+++ b/drivers/gpu/drm/xe/xe_uc_fw.c
@@ -141,7 +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(NOVALAKE_S, GT_TYPE_ANY, major_ver(xe, gsc, nvl, 108, 1, 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] 1007+ messages in thread
* [PATCH 7.3 0394/1005] drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (392 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0393/1005] drm/xe/gsc: Fix NVL-S GSC compatibility number Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0395/1005] drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m Greg Kroah-Hartman
` (604 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tvrtko Ursulin, Helen Koike,
Matt Roper, Rodrigo Vivi, Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helen Koike <koike@igalia.com>
[ Upstream commit badac1974e098dba1a0a7f413e53f5b6ae24ab10 ]
CTX_CS_INDIRECT_CTX_OFFSET default value is not retrieved from the GPU
by inhibit+context save mechanism since it is not part of the Engine
Context. Thus, at restore, 0x0 is programmed back to the GPU, which is
an invalid value according to the PRM.
This causes sporadic hangs on Alder Lake when executing test
IntelAngleEnd2EndTestCases (error VK_DEVICE_LOST).
Fix it by partially reverting commit c9dfd66cb91e ("drm/xe/lrc: Allow
INDIRECT_CTX for more engine classes"). Re-add the programming of
CTX_CS_INDIRECT_CTX_OFFSET for pre-Xe2 (in theory it should apply to all
platforms, but we got an unexpected behaviour on Xe2 that still requires
investigation).
Fixes: c9dfd66cb91e ("drm/xe/lrc: Allow INDIRECT_CTX for more engine classes")
Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Helen Koike <koike@igalia.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20261016214112.1647202-1-koike@igalia.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit b99292acb2dce61ce50d37f54a66d84b768b8927)
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/regs/xe_lrc_layout.h | 3 +++
drivers/gpu/drm/xe/xe_lrc.c | 8 ++++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/regs/xe_lrc_layout.h b/drivers/gpu/drm/xe/regs/xe_lrc_layout.h
index 4ab86fc369fdf..e4c7c35497354 100644
--- a/drivers/gpu/drm/xe/regs/xe_lrc_layout.h
+++ b/drivers/gpu/drm/xe/regs/xe_lrc_layout.h
@@ -43,4 +43,7 @@
#define INDIRECT_CTX_RING_START_UDW (0x08 + 1)
#define INDIRECT_CTX_RING_CTL (0x0a + 1)
+#define CTX_INDIRECT_CTX_OFFSET_MASK REG_GENMASK(15, 6)
+#define CTX_INDIRECT_CTX_OFFSET_DEFAULT REG_FIELD_PREP(CTX_INDIRECT_CTX_OFFSET_MASK, 0xd)
+
#endif
diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
index e4388a9604909..2e44a7000d955 100644
--- a/drivers/gpu/drm/xe/xe_lrc.c
+++ b/drivers/gpu/drm/xe/xe_lrc.c
@@ -1461,15 +1461,15 @@ setup_indirect_ctx(struct xe_lrc *lrc, struct xe_hw_engine *hwe)
finish_bo(&state);
kfree(state.buffer);
- /*
- * Enable INDIRECT_CTX leaving INDIRECT_CTX_OFFSET at its default: it
- * varies per engine class, but the default is good enough
- */
xe_lrc_write_ctx_reg(lrc,
CTX_CS_INDIRECT_CTX,
(xe_bo_ggtt_addr(lrc->bo) + state.offset) |
/* Size in CLs. */
(state.written * sizeof(u32) / 64));
+ if (GRAPHICS_VER(lrc_to_xe(lrc)) < 20)
+ xe_lrc_write_ctx_reg(lrc,
+ CTX_CS_INDIRECT_CTX_OFFSET,
+ CTX_INDIRECT_CTX_OFFSET_DEFAULT);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0395/1005] drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (393 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0394/1005] drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2 Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0396/1005] drm/xe/gt: Use GT ordered workqueue for wedging Greg Kroah-Hartman
` (603 subsequent siblings)
998 siblings, 0 replies; 1007+ 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, Matt Roper,
Rodrigo Vivi, Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
[ Upstream commit da475c094342b6d5c8bc020b19d6900130bed047 ]
When xe is built-in but configfs is a module, xe_configfs.o is not
linked into xe, while IS_ENABLED(CONFIG_CONFIGFS_FS) in xe_configfs.h
still exposes the real declarations, leading to undefined references.
Use IS_REACHABLE() so this case falls back to the stubs, the same as
CONFIGFS_FS=n.
Fixes: 16280ded45fb ("drm/xe: Add configfs to enable survivability mode")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610160935.Qk4ZxBxY-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202610162335.FEwMdGY9-lkp@intel.com/
Suggested-by: Matt Roper <matthew.d.roper@intel.com>
Assisted-by: LLM
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20261021194555.2171344-2-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 30499cbd796117b63be3b59a1781c25ea3f4b27f)
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_configfs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_configfs.h b/drivers/gpu/drm/xe/xe_configfs.h
index 4fbbeafba4734..65b15b7483e1b 100644
--- a/drivers/gpu/drm/xe/xe_configfs.h
+++ b/drivers/gpu/drm/xe/xe_configfs.h
@@ -14,7 +14,7 @@
struct pci_dev;
-#if IS_ENABLED(CONFIG_CONFIGFS_FS)
+#if IS_REACHABLE(CONFIG_CONFIGFS_FS)
int xe_configfs_init(void);
void xe_configfs_exit(void);
void xe_configfs_check_device(struct pci_dev *pdev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0396/1005] drm/xe/gt: Use GT ordered workqueue for wedging
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (394 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0395/1005] drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0397/1005] drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM Greg Kroah-Hartman
` (602 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Raag Jadav, Matthew Brost,
Matt Roper, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raag Jadav <raag.jadav@intel.com>
[ Upstream commit 8801081e5991e4939dc2d04564c46f33c3efe18d ]
Currently, xe_gt_declare_wedged() stops GuC CT and initiates exec queue
teardown synchronously. This can result in tdr timeout in cases where
the device is declared wedged while jobs are still in-flight.
Introduce a worker for GT specific wedge handling and queue the teardown
on GT ordered workqueue, so we don't disrupt the scheduler while jobs
are still in-flight.
While at it, introduce for_each_initialized_gt() macro and use it for
wedging GT. This helps avoid races in case the device is declared wedged
in probe sequence before GT is initialized.
Fixes: c9474b726b93 ("drm/xe: Wedge the entire device")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20261022051303.282805-2-raag.jadav@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 913d394eb2be6536c66995affde44255d1e36493)
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 | 2 +-
drivers/gpu/drm/xe/xe_device.h | 4 ++++
drivers/gpu/drm/xe/xe_gt.c | 39 ++++++++++++++++++++++++--------
drivers/gpu/drm/xe/xe_gt_types.h | 9 ++++++++
drivers/gpu/drm/xe/xe_guc.c | 1 -
5 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index e76edcf15159e..f161f010d0ef4 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1482,7 +1482,7 @@ void xe_device_declare_wedged(struct xe_device *xe)
dev_name(xe->drm.dev));
}
- for_each_gt(gt, xe, id)
+ for_each_initialized_gt(gt, xe, id)
xe_gt_declare_wedged(gt);
if (xe_device_wedged(xe)) {
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 6c4cfaebc44a0..1bfd641fea278 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -139,6 +139,10 @@ static inline bool xe_device_uc_enabled(struct xe_device *xe)
for_each_gt((gt__), (tile__)->xe, (id__)) \
for_each_if((gt__)->tile == (tile__))
+#define for_each_initialized_gt(gt__, xe__, id__) \
+ for_each_gt((gt__), (xe__), (id__)) \
+ for_each_if(READ_ONCE((gt__)->initialized))
+
static inline struct xe_force_wake *gt_to_fw(struct xe_gt *gt)
{
return >->pm.fw;
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 57e302604f3dc..ca7f9b806bac9 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -172,6 +172,7 @@ static void xe_gt_enable_comp_1wcoh(struct xe_gt *gt)
}
static void gt_reset_worker(struct work_struct *w);
+static void gt_wedge_worker(struct work_struct *w);
static int emit_job_sync(struct xe_exec_queue *q, struct xe_bb *bb,
long timeout_jiffies, bool force_reset)
@@ -543,6 +544,8 @@ int xe_gt_init_early(struct xe_gt *gt)
xe_gt_mcr_init_early(gt);
xe_pat_init(gt);
+ INIT_WORK(>->reset.worker, gt_reset_worker);
+ INIT_WORK(>->wedge.worker, gt_wedge_worker);
return 0;
}
@@ -621,16 +624,21 @@ static int gt_init_with_gt_forcewake(struct xe_gt *gt)
return 0;
}
-static void gt_reset_worker_disable(void *arg)
+static void gt_worker_disable(void *arg)
{
struct xe_gt *gt = arg;
+ WRITE_ONCE(gt->initialized, false);
+
if (disable_work_sync(>->reset.worker))
/*
* If gt_reset_worker was halted from executing, take care of
* releasing the rpm reference here.
*/
xe_pm_runtime_put(gt_to_xe(gt));
+
+ if (disable_work_sync(>->wedge.worker))
+ xe_pm_runtime_put(gt_to_xe(gt));
}
static int gt_init_with_all_forcewake(struct xe_gt *gt)
@@ -703,7 +711,7 @@ static int gt_init_with_all_forcewake(struct xe_gt *gt)
xe_gt_sriov_pf_init_hw(gt);
/* Last action registered here so devres drains resets before teardown */
- err = devm_add_action_or_reset(xe->drm.dev, gt_reset_worker_disable, gt);
+ err = devm_add_action_or_reset(xe->drm.dev, gt_worker_disable, gt);
if (err)
return err;
@@ -715,7 +723,7 @@ static void xe_gt_fini(void *arg)
struct xe_gt *gt = arg;
int i;
- gt_reset_worker_disable(gt);
+ gt_worker_disable(gt);
for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
xe_hw_fence_irq_finish(>->fence_irq[i]);
@@ -728,8 +736,6 @@ int xe_gt_init(struct xe_gt *gt)
int err;
int i;
- INIT_WORK(>->reset.worker, gt_reset_worker);
-
for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i) {
gt->ring_ops[i] = xe_ring_ops_get(gt, i);
xe_hw_fence_irq_init(>->fence_irq[i]);
@@ -759,7 +765,7 @@ int xe_gt_init(struct xe_gt *gt)
err = gt_init_with_all_forcewake(gt);
if (err) {
- gt_reset_worker_disable(gt);
+ gt_worker_disable(gt);
return err;
}
@@ -775,6 +781,8 @@ int xe_gt_init(struct xe_gt *gt)
return err;
}
+ /* Must be last */
+ WRITE_ONCE(gt->initialized, true);
return 0;
}
@@ -1192,6 +1200,15 @@ struct xe_hw_engine *xe_gt_any_hw_engine(struct xe_gt *gt)
return NULL;
}
+static void gt_wedge_worker(struct work_struct *w)
+{
+ struct xe_gt *gt = container_of(w, typeof(*gt), wedge.worker);
+
+ xe_uc_declare_wedged(>->uc);
+ xe_tlb_inval_reset(>->tlb_inval);
+ xe_pm_runtime_put(gt_to_xe(gt));
+}
+
/**
* xe_gt_declare_wedged() - Declare GT wedged
* @gt: the GT object
@@ -1201,8 +1218,12 @@ struct xe_hw_engine *xe_gt_any_hw_engine(struct xe_gt *gt)
*/
void xe_gt_declare_wedged(struct xe_gt *gt)
{
- xe_gt_assert(gt, gt_to_xe(gt)->wedged.mode);
+ struct xe_device *xe = gt_to_xe(gt);
- xe_uc_declare_wedged(>->uc);
- xe_tlb_inval_reset(>->tlb_inval);
+ xe_gt_assert(gt, xe->wedged.mode);
+ xe_uc_reset_prepare(>->uc);
+
+ xe_pm_runtime_get_noresume(xe);
+ if (!queue_work(gt->ordered_wq, >->wedge.worker))
+ xe_pm_runtime_put(xe);
}
diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
index a8bbfbdf38494..5bb2d0281a0a5 100644
--- a/drivers/gpu/drm/xe/xe_gt_types.h
+++ b/drivers/gpu/drm/xe/xe_gt_types.h
@@ -213,6 +213,12 @@ struct xe_gt {
struct work_struct worker;
} reset;
+ /** @wedge: state for GT wedge */
+ struct {
+ /** @wedge.worker: worker for GT wedge to be done async */
+ struct work_struct worker;
+ } wedge;
+
/** @tlb_inval: TLB invalidation state */
struct xe_tlb_inval tlb_inval;
@@ -390,6 +396,9 @@ struct xe_gt {
/** @eu_stall: EU stall counters subsystem per gt info */
struct xe_eu_stall_gt *eu_stall;
+
+ /** @initialized: GT is initialized */
+ bool initialized;
};
#endif
diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
index c988a2a3b7bdb..944f88ee40a0b 100644
--- a/drivers/gpu/drm/xe/xe_guc.c
+++ b/drivers/gpu/drm/xe/xe_guc.c
@@ -1837,7 +1837,6 @@ void xe_guc_declare_wedged(struct xe_guc *guc)
{
xe_gt_assert(guc_to_gt(guc), guc_to_xe(guc)->wedged.mode);
- xe_guc_reset_prepare(guc);
xe_guc_ct_stop(&guc->ct);
xe_guc_submit_wedge(guc);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0397/1005] drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (395 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0396/1005] drm/xe/gt: Use GT ordered workqueue for wedging Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0398/1005] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Greg Kroah-Hartman
` (601 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Raag Jadav, Riana Tauro, Matt Roper,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raag Jadav <raag.jadav@intel.com>
[ Upstream commit a890a885b982f73e6e984e828ffda06b5121c4b6 ]
xe_device_declare_wedged() callers are expected to hold a runtime PM
reference. Fix it.
Fixes: a7df563b45b0 ("drm/xe/xe_hw_error: Handle CSC Firmware reported Hardware errors")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
Link: https://patch.msgid.link/20261022051303.282805-4-raag.jadav@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit fc8d229d76102489b6f56538a818c285a87db1e9)
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_error.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_hw_error.c b/drivers/gpu/drm/xe/xe_hw_error.c
index 5f2abc9485ff5..f726179c22e38 100644
--- a/drivers/gpu/drm/xe/xe_hw_error.c
+++ b/drivers/gpu/drm/xe/xe_hw_error.c
@@ -14,6 +14,7 @@
#include "xe_drm_ras.h"
#include "xe_hw_error.h"
#include "xe_mmio.h"
+#include "xe_pm.h"
#include "xe_survivability_mode.h"
#define GT_HW_ERROR_MAX_ERR_BITS 16
@@ -170,6 +171,7 @@ static void csc_hw_error_work(struct work_struct *work)
struct xe_tile *tile = container_of(work, typeof(*tile), csc_hw_error_work);
struct xe_device *xe = tile_to_xe(tile);
+ guard(xe_pm_runtime)(xe);
xe_survivability_mode_runtime_enable(xe);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0398/1005] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (396 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0397/1005] drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0399/1005] drm/xe/pci_error: Flush GT wedge worker before bus reset Greg Kroah-Hartman
` (600 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Raag Jadav, Rodrigo Vivi, Matt Roper,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raag Jadav <raag.jadav@intel.com>
[ Upstream commit 031cc955b33b0d171fe50c870a9e601e80f14cea ]
The device can be declared wedged while processing boot-time hardware
errors, which can result in PM reference leak if driver probe fails
before xe_device_wedged_fini() is registered.
Early register the required cleanup action and fix this.
Fixes: a7df563b45b0 ("drm/xe/xe_hw_error: Handle CSC Firmware reported Hardware errors")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20261022051303.282805-5-raag.jadav@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 6599a0eb0990cde96c4e66a4e1e2ae1b172e85d2)
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 | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index f161f010d0ef4..7ec5d301f9995 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -760,6 +760,8 @@ static int xe_device_vram_alloc(struct xe_device *xe)
return 0;
}
+static void xe_device_wedged_fini(struct drm_device *drm, void *arg);
+
/**
* xe_device_probe_early: Device early probe
* @xe: xe device instance
@@ -828,6 +830,10 @@ int xe_device_probe_early(struct xe_device *xe)
if (err)
return err;
+ err = drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe);
+ if (err)
+ return err;
+
return 0;
}
ALLOW_ERROR_INJECTION(xe_device_probe_early, ERRNO); /* See xe_pci_probe() */
@@ -1148,10 +1154,6 @@ int xe_device_probe(struct xe_device *xe)
detect_preproduction_hw(xe);
- err = drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe);
- if (err)
- goto err_unregister_display;
-
/*
* Process and log any errors detected by hardware. Possible results can
* include declaring the device as wedged, which must be done only after
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0399/1005] drm/xe/pci_error: Flush GT wedge worker before bus reset
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (397 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0398/1005] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0400/1005] drm/xe: Rebind BOs evicted before the first LR queue Greg Kroah-Hartman
` (599 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Raag Jadav, Rodrigo Vivi, Matt Roper,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raag Jadav <raag.jadav@intel.com>
[ Upstream commit 1eb526467c96ddaf87791c2b3cefa9f93ff45358 ]
With GT wedging now done async, make sure the wedge worker is flushed to
avoid side-effects during PCI bus reset.
Fixes: 13b9555ffb03 ("drm/xe/xe_pci_error: Implement PCI error recovery callbacks")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/20261022051303.282805-7-raag.jadav@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 0dbc1d0762bc89649aeaea98a63f6e5f786ea1b8)
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_pci_error.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_pci_error.c b/drivers/gpu/drm/xe/xe_pci_error.c
index e41af2ac7f23b..dc9d1be7857c2 100644
--- a/drivers/gpu/drm/xe/xe_pci_error.c
+++ b/drivers/gpu/drm/xe/xe_pci_error.c
@@ -29,8 +29,10 @@ static void prepare_device_for_reset(struct pci_dev *pdev)
xe_device_set_in_reset(xe);
- for_each_gt(gt, xe, id)
+ for_each_gt(gt, xe, id) {
xe_gt_declare_wedged(gt);
+ flush_work(>->wedge.worker);
+ }
pci_disable_device(pdev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0400/1005] drm/xe: Rebind BOs evicted before the first LR queue
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (398 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0399/1005] drm/xe/pci_error: Flush GT wedge worker before bus reset Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0401/1005] drm/xe: Toggle the D3Cold enable flag at runtime resume Greg Kroah-Hartman
` (598 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Brost, Thomas Hellström,
Himal Prasad Ghimiray, Arvind Yadav, Tejas Upadhyay, Dave Airlie,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvind Yadav <arvind.yadav@intel.com>
[ Upstream commit b52dcc698250e08eabdc4554a6fdb4d6f909133f ]
A VM bind can evict BOs before the first LR exec queue is added.
There is no preempt fence to trigger at that point.
When the queue is added later, its new preempt fence is not triggered.
The exec IOCTL does not validate or rebind BOs in preempt fence mode,
and the rebind worker skips that work because no preempt fence is
waiting. The first exec can then use stale mappings.
Trigger the new preempt fence in xe_vm_add_compute_exec_queue() when
the VM has evicted BOs or pending rebinds. This keeps the queue
suspended until the rebind worker validates the BOs and restores
their mappings.
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
Link: https://patch.msgid.link/20261015162639.3528278-1-arvind.yadav@intel.com
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
(cherry picked from commit 928ee5d4fb1f211aa361524801c15b54603fae52)
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_vm.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 99e42bd29e790..90820f5fff283 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -269,8 +269,15 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
* Check to see if a preemption on VM is in flight or userptr
* invalidation, if so trigger this preempt fence to sync state with
* other preempt fences on the VM.
+ *
+ * Also trigger it if eviction or rebinding is pending. BOs evicted
+ * before the first exec queue was added had no preempt fence to
+ * trigger. Suspend this queue until the rebind worker restores
+ * the mappings.
*/
- wait = __xe_vm_userptr_needs_repin(vm) || preempt_fences_waiting(vm);
+ wait = __xe_vm_userptr_needs_repin(vm) || preempt_fences_waiting(vm) ||
+ !list_empty(&vm->gpuvm.evict.list) ||
+ !list_empty(&vm->rebind_list);
if (wait)
dma_fence_enable_signaling(pfence);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0401/1005] drm/xe: Toggle the D3Cold enable flag at runtime resume
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (399 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0400/1005] drm/xe: Rebind BOs evicted before the first LR queue Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0402/1005] drm/xe: Access GT MMIO after pcode init Greg Kroah-Hartman
` (597 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Auld, Karthik Poosa,
Vinay Belgaumkar, Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
[ Upstream commit e42459b16cbf1cbcebfc1ab406140cca204fd831 ]
We enable this flag during runtime suspend, need to set it back to
false early during resume to maintain consistency in pci driver's
internal state. d3cold_toggle() updates the root port's ability
to go into d3cold via the dev->no_d3cold flag. With this patch, we
are ensuring this internal state remains consistent with that of
the endpoint.
v2: Clarify the commit message (Matt Auld)
v3: Add fixes (Karthik Poosa)
Fixes: f026520367be ("drm/xe: Only set PCI d3cold_allowed when we are really allowing.")
Cc: Matthew Auld <matthew.auld@intel.com>
Acked-by: Karthik Poosa <karthik.poosa@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Reviewed-by: Karthik Poosa <karthik.poosa@intel.com>
Link: https://patch.msgid.link/20261027174351.619929-6-vinay.belgaumkar@intel.com
(cherry picked from commit e994e0f1ba52e4be3607ba7f952a8d835f1f6563)
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_pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 5d7a0b403ac0d..93438a670ae44 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -1404,6 +1404,9 @@ static int xe_pci_runtime_resume(struct device *dev)
struct xe_device *xe = pdev_to_xe_device(pdev);
int err;
+ if (xe->d3cold.allowed)
+ d3cold_toggle(pdev, D3COLD_DISABLE);
+
err = pci_set_power_state(pdev, PCI_D0);
if (err)
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0402/1005] drm/xe: Access GT MMIO after pcode init
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (400 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 7.3 0401/1005] drm/xe: Toggle the D3Cold enable flag at runtime resume Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0403/1005] drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry Greg Kroah-Hartman
` (596 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karthik Poosa, Vinay Belgaumkar,
Matthew Brost, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
[ Upstream commit fc0ba46fd8278ed3e3a2c111b25036cb62dfe078 ]
Allow pcode initialization to complete before we start poking around
the GT MMIO space during resume as these accesses go through sgunit.
We do write to MMIO registers in xe_wa_apply_tile_workarounds(), but
those are in uncore space. Those accesses remain viable even during
d3cold suspend.
v2: Clarify about xe_wa_apply_tile_workarounds (Karthik Poosa)
v3: Add fixes tag (Anshuman)
Fixes: 95d0883ac810 ("drm/xe: Ensure GT is in C0 during resumes")
Cc: Karthik Poosa <karthik.poosa@intel.com>
Reviewed-by: Karthik Poosa <karthik.poosa@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://patch.msgid.link/20261027174351.619929-7-vinay.belgaumkar@intel.com
(cherry picked from commit 638d116d755ed89628ad07bde33ae7d7658db834)
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_pm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index a5289a9df8d25..06ff27641ad19 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -239,9 +239,6 @@ int xe_pm_resume(struct xe_device *xe)
drm_dbg(&xe->drm, "Resuming device\n");
trace_xe_pm_resume(xe, __builtin_return_address(0));
- for_each_gt(gt, xe, id)
- xe_gt_idle_disable_c6(gt);
-
for_each_tile(tile, xe, id)
xe_wa_apply_tile_workarounds(tile);
@@ -249,6 +246,9 @@ int xe_pm_resume(struct xe_device *xe)
if (err)
return err;
+ for_each_gt(gt, xe, id)
+ xe_gt_idle_disable_c6(gt);
+
xe_display_pm_resume_early(xe);
/*
@@ -677,13 +677,13 @@ int xe_pm_runtime_resume(struct xe_device *xe)
xe_rpm_lockmap_acquire(xe);
if (xe->d3cold.allowed) {
- for_each_gt(gt, xe, id)
- xe_gt_idle_disable_c6(gt);
-
err = xe_pcode_ready(xe, true);
if (err)
goto out;
+ for_each_gt(gt, xe, id)
+ xe_gt_idle_disable_c6(gt);
+
xe_display_pm_resume_early(xe);
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0403/1005] drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (401 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0402/1005] drm/xe: Access GT MMIO after pcode init Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0404/1005] drm/xe/svm: Preserve default PAT index when resetting VMA attributes Greg Kroah-Hartman
` (595 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniele Ceraolo Spurio,
Badal Nilawar, Matthew Brost, Dave Airlie, 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 74f1a6f03f2d46537f929a1b13f7dcd378437a4d ]
Release firmware when the "LTES" manifest entry is not found in the
firmware header.
Fixes: efa29317a553 ("drm/xe/xe_late_bind_fw: Extract and print version info")
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patch.msgid.link/20261102172527.2794537-9-badal.nilawar@intel.com
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
(cherry picked from commit 3e4b2a6349ed7258057fa95a1e58730615703dae)
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_late_bind_fw.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_late_bind_fw.c b/drivers/gpu/drm/xe/xe_late_bind_fw.c
index 768442ca7da6d..1bddfaf0fb9f0 100644
--- a/drivers/gpu/drm/xe/xe_late_bind_fw.c
+++ b/drivers/gpu/drm/xe/xe_late_bind_fw.c
@@ -335,19 +335,19 @@ static int __xe_late_bind_fw_init(struct xe_late_bind *late_bind, u32 fw_id)
if (fw->size > XE_LB_MAX_PAYLOAD_SIZE) {
drm_err(&xe->drm, "Firmware %s size %zu is larger than max pay load size %u\n",
lb_fw->blob_path, fw->size, XE_LB_MAX_PAYLOAD_SIZE);
- release_firmware(fw);
- return -ENODATA;
+ ret = -ENODATA;
+ goto release_fw;
}
ret = parse_lb_layout(lb_fw, fw->data, fw->size, "LTES");
if (ret)
- return ret;
+ goto release_fw;
lb_fw->payload_size = fw->size;
lb_fw->payload = drmm_kzalloc(&xe->drm, lb_fw->payload_size, GFP_KERNEL);
if (!lb_fw->payload) {
- release_firmware(fw);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto release_fw;
}
drm_info(&xe->drm, "Using %s firmware from %s version %u.%u.%u.%u\n",
@@ -356,10 +356,11 @@ static int __xe_late_bind_fw_init(struct xe_late_bind *late_bind, u32 fw_id)
lb_fw->version.hotfix, lb_fw->version.build);
memcpy((void *)lb_fw->payload, fw->data, lb_fw->payload_size);
- release_firmware(fw);
INIT_WORK(&lb_fw->work, xe_late_bind_work);
- return 0;
+release_fw:
+ release_firmware(fw);
+ return ret;
}
static int xe_late_bind_fw_init(struct xe_late_bind *late_bind)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0404/1005] drm/xe/svm: Preserve default PAT index when resetting VMA attributes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (402 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0403/1005] drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0405/1005] drm/xe/guc: Fix race around q->guc->suspend_pending access Greg Kroah-Hartman
` (594 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Brost, Thomas Hellström,
Himal Prasad Ghimiray, Arvind Yadav, Dave Airlie, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvind Yadav <arvind.yadav@intel.com>
[ Upstream commit e800602296e8668b4cf143fc12d7cee4b31e64aa ]
xe_vma_set_default_attributes() replaces the VMA attributes with a
default structure. It sets pat_index to the saved default PAT index,
but leaves default_pat_index zero.
When the saved default is non-zero, the two fields no longer match.
xe_vma_has_default_mem_attrs() then reports that the reset VMA has
non-default attributes, triggering a warning in xe_vm_alloc_vma()
during SVM garbage collection. A later reset also uses the incorrect
zero value.
Preserve default_pat_index when restoring the default attributes.
Fixes: 4a938d3886d6 ("drm/xe: Merge adjacent default-attribute VMAs during garbage collection")
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Signed-off-by: Arvind Yadav <arvind.yadav@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20261027085952.2882874-1-arvind.yadav@intel.com
(cherry picked from commit ce155027427a0c76be173f19f911b414d9d686bc)
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_svm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index b228a737cfd6d..281b81c28e16d 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -330,6 +330,7 @@ static void xe_vma_set_default_attributes(struct xe_vma *vma)
struct xe_vma_mem_attr default_attr = {
.preferred_loc.devmem_fd = DRM_XE_PREFERRED_LOC_DEFAULT_DEVICE,
.preferred_loc.migration_policy = DRM_XE_MIGRATE_ALL_PAGES,
+ .default_pat_index = vma->attr.default_pat_index,
.pat_index = vma->attr.default_pat_index,
.atomic_access = DRM_XE_ATOMIC_UNDEFINED,
.purgeable_state = XE_MADV_PURGEABLE_WILLNEED,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0405/1005] drm/xe/guc: Fix race around q->guc->suspend_pending access
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (403 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0404/1005] drm/xe/svm: Preserve default PAT index when resetting VMA attributes Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0406/1005] drm/xe/guc: Do not attribute a TDR disable to a pending suspend Greg Kroah-Hartman
` (593 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jagmeet Randhawa,
Niranjana Vishwanathapura, Matthew Brost, Dave Airlie,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jagmeet Randhawa <jagmeet.randhawa@intel.com>
[ Upstream commit a869bd4d65bc131082568743418b3876c46c3b7b ]
q->guc->suspend_pending is accessed without any common lock.
__suspend_fence_signal(), called from guc_exec_queue_kill() and the
suspend-timeout ban path, clears the flag asynchronously. Meanwhile
handle_sched_done(), guc_exec_queue_stop() and
__guc_exec_queue_process_msg_suspend() check the flag and then call
suspend_fence_signal(), which asserts that it is still set.
As the check and suspend_fence_signal() are not atomic, the clear can
land in between and trip the xe_gt_assert(q->guc->suspend_pending).
Rather than serializing those clears, drop them. Signalling the suspend
fence from kill or from the suspend-timeout ban completes a suspend while
the queue may still be executing on the hardware, so neither is a valid
place to do it. Split the wake up out of __suspend_fence_signal() into
suspend_wait_wake() and use that in guc_exec_queue_kill(), so a waiter
still observes the killed state immediately rather than waiting out the
full timeout - guc_exec_queue_wait_suspend_done() already breaks on
exec_queue_killed(). The suspend-timeout ban needs no wake at all, as the
waiter that timed out is its caller.
suspend_pending now stays set on a killed or banned queue until it is
torn down, so relax the !suspend_pending assert in
__guc_exec_queue_resume() to permit that state.
handle_sched_done() and guc_exec_queue_stop() can still race with each
other, so take the per-queue msg_lock, which already covers the set on
the suspend path, across their check-then-act. In handle_sched_done() the
flag is snapshotted under the lock and deregister_exec_queue() is kept
outside it. __guc_exec_queue_process_msg_suspend() is left unlocked: it
runs on the scheduler message worker, which guc_exec_queue_stop() parks
via xe_sched_submission_stop() before touching the flag.
v2: Document that sched->msg_lock also protects
guc->suspend_pending, which indicates a suspend message is in
flight, in addition to the sched->msgs list (Niranjana)
v3: Drop __suspend_fence_signal() from guc_exec_queue_kill() and
guc_exec_queue_suspend_timeout_ban() rather than serializing them
with msg_lock, keeping only the wake up in kill and guarding the
!suspend_pending assert in resume (Matthew, Niranjana)
Signed-off-by: Jagmeet Randhawa <jagmeet.randhawa@intel.com>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260902201222.30022-1-jagmeet.randhawa@intel.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
Stable-dep-of: eb1f465e9119 ("drm/xe/guc: Do not attribute a TDR disable to a pending suspend")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_gpu_scheduler_types.h | 5 +-
drivers/gpu/drm/xe/xe_guc_exec_queue_types.h | 5 +-
drivers/gpu/drm/xe/xe_guc_submit.c | 58 ++++++++++++++------
3 files changed, 49 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h b/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h
index 63d9bf92583c5..78ef2e8ded4f3 100644
--- a/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h
+++ b/drivers/gpu/drm/xe/xe_gpu_scheduler_types.h
@@ -47,7 +47,10 @@ struct xe_gpu_scheduler {
const struct xe_sched_backend_ops *ops;
/** @msgs: list of messages to be processed in @work_process_msg */
struct list_head msgs;
- /** @msg_lock: Message lock */
+ /**
+ * @msg_lock: Protects @msgs and guc->suspend_pending (indicates a
+ * suspend message is in flight) of exec queues on this scheduler.
+ */
spinlock_t msg_lock;
/** @work_process_msg: processes messages */
struct work_struct work_process_msg;
diff --git a/drivers/gpu/drm/xe/xe_guc_exec_queue_types.h b/drivers/gpu/drm/xe/xe_guc_exec_queue_types.h
index acdc24d1a6bd2..64ea57cceb6ff 100644
--- a/drivers/gpu/drm/xe/xe_guc_exec_queue_types.h
+++ b/drivers/gpu/drm/xe/xe_guc_exec_queue_types.h
@@ -52,7 +52,10 @@ struct xe_guc_exec_queue {
u16 id;
/** @suspend_wait: wait queue used to wait on pending suspends */
wait_queue_head_t suspend_wait;
- /** @suspend_pending: a suspend of the exec_queue is pending */
+ /**
+ * @suspend_pending: a suspend of the exec_queue is pending.
+ * Protected by @sched.msg_lock.
+ */
bool suspend_pending;
/**
* @suspend_count: Reference count of active suspend requests. The
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index bdaec10c6d197..e80291cdf0edc 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1854,16 +1854,11 @@ static void __guc_exec_queue_process_msg_set_sched_props(struct xe_sched_msg *ms
kfree(msg);
}
-static void __suspend_fence_signal(struct xe_exec_queue *q)
+static void suspend_wait_wake(struct xe_exec_queue *q)
{
struct xe_guc *guc = exec_queue_to_guc(q);
struct xe_device *xe = guc_to_xe(guc);
- if (!q->guc->suspend_pending)
- return;
-
- WRITE_ONCE(q->guc->suspend_pending, false);
-
/*
* We use a GuC shared wait queue for VFs because the VF resfix start
* interrupt must be able to wake all instances of suspend_wait. This
@@ -1876,6 +1871,15 @@ static void __suspend_fence_signal(struct xe_exec_queue *q)
wake_up(&q->guc->suspend_wait);
}
+static void __suspend_fence_signal(struct xe_exec_queue *q)
+{
+ if (!q->guc->suspend_pending)
+ return;
+
+ WRITE_ONCE(q->guc->suspend_pending, false);
+ suspend_wait_wake(q);
+}
+
static void suspend_fence_signal(struct xe_exec_queue *q)
{
struct xe_guc *guc = exec_queue_to_guc(q);
@@ -2096,7 +2100,13 @@ static void guc_exec_queue_kill(struct xe_exec_queue *q)
{
trace_xe_exec_queue_kill(q);
set_exec_queue_killed(q);
- __suspend_fence_signal(q);
+ /*
+ * Do not signal the suspend fence here, the queue may still be running
+ * on the hardware. Only wake any suspend waiter so it observes the
+ * killed state instead of waiting out the full timeout, suspend_pending
+ * stays set until the queue is torn down.
+ */
+ suspend_wait_wake(q);
xe_guc_exec_queue_trigger_cleanup(q);
}
@@ -2278,7 +2288,12 @@ static bool __guc_exec_queue_resume(struct xe_exec_queue *q)
bool last;
xe_sched_msg_lock(sched);
- xe_gt_assert(guc_to_gt(guc), !ge->suspend_pending);
+ /*
+ * A killed, banned or wedged queue keeps suspend_pending set until it
+ * is torn down, so only assert the flag is clear otherwise.
+ */
+ xe_gt_assert(guc_to_gt(guc), !ge->suspend_pending ||
+ exec_queue_killed_or_banned_or_wedged(q));
xe_gt_assert(guc_to_gt(guc), ge->suspend_count > 0);
last = (--ge->suspend_count == 0);
if (last) {
@@ -2348,8 +2363,10 @@ static void guc_exec_queue_suspend_timeout_ban(struct xe_exec_queue *q)
/*
* The GuC failed to respond to the suspend within the timeout. This is
* not recoverable for this context, so ban it and tear it down via
- * cleanup rather than leave it suspended forever. __suspend_fence_signal
- * clears suspend_pending and wakes any waiter.
+ * cleanup rather than leave it suspended forever. The suspend fence is
+ * not signalled here, the queue may still be running on the hardware,
+ * so suspend_pending stays set until teardown. The waiter that timed
+ * out is the caller, so no wake up is needed either.
*
* @q is the primary here; it owns the group's GuC context, so a failure
* to suspend it wedges the whole group. Ban and tear down the entire
@@ -2357,11 +2374,9 @@ static void guc_exec_queue_suspend_timeout_ban(struct xe_exec_queue *q)
*/
if (xe_exec_queue_is_multi_queue(q)) {
set_exec_queue_group_banned(q);
- __suspend_fence_signal(q);
xe_guc_exec_queue_group_trigger_cleanup(q);
} else {
set_exec_queue_banned(q);
- __suspend_fence_signal(q);
xe_guc_exec_queue_trigger_cleanup(q);
}
}
@@ -2384,9 +2399,9 @@ static int guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki
int ret;
/*
- * Likely don't need to check exec_queue_killed() as we clear
- * suspend_pending upon kill but to be paranoid but races in which
- * suspend_pending is set after kill also check kill here.
+ * A kill does not clear suspend_pending, the queue may still be running
+ * on the hardware, so exec_queue_killed() is what ends the wait in that
+ * case and the queue is torn down asynchronously.
*/
#define WAIT_COND \
(!READ_ONCE(q->guc->suspend_pending) || exec_queue_killed(q) || \
@@ -2579,10 +2594,12 @@ static void guc_exec_queue_stop(struct xe_guc *guc, struct xe_exec_queue *q)
if (exec_queue_destroyed(q))
do_destroy = true;
}
+ xe_sched_msg_lock(sched);
if (q->guc->suspend_pending) {
set_exec_queue_suspended(q);
suspend_fence_signal(q);
}
+ xe_sched_msg_unlock(sched);
atomic_and(EXEC_QUEUE_STATE_WEDGED | EXEC_QUEUE_STATE_BANNED |
EXEC_QUEUE_STATE_KILLED | EXEC_QUEUE_STATE_DESTROYED |
EXEC_QUEUE_STATE_SUSPENDED,
@@ -3106,13 +3123,20 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
smp_wmb();
wake_up_all(&guc->ct.wq);
} else {
+ bool was_pending;
+
xe_gt_assert(guc_to_gt(guc), runnable_state == 0);
xe_gt_assert(guc_to_gt(guc), exec_queue_pending_disable(q));
- if (q->guc->suspend_pending) {
+ xe_sched_msg_lock(&q->guc->sched);
+ was_pending = q->guc->suspend_pending;
+ if (was_pending) {
clear_exec_queue_pending_disable(q);
suspend_fence_signal(q);
- } else {
+ }
+ xe_sched_msg_unlock(&q->guc->sched);
+
+ if (!was_pending) {
if (exec_queue_banned(q)) {
smp_wmb();
wake_up_all(&guc->ct.wq);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0406/1005] drm/xe/guc: Do not attribute a TDR disable to a pending suspend
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (404 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0405/1005] drm/xe/guc: Fix race around q->guc->suspend_pending access Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0407/1005] gpiolib: fix GPIO descriptor leak in gpiod_get_array() Greg Kroah-Hartman
` (592 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jagmeet Randhawa,
Niranjana Vishwanathapura, Matthew Brost, Dave Airlie,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jagmeet Randhawa <jagmeet.randhawa@intel.com>
[ Upstream commit eb1f465e9119f7680458218a63bbb8d32844908e ]
handle_sched_done() treats any SCHED_DONE with runnable_state 0 as the
completion of a suspend whenever q->guc->suspend_pending is set. That is
not sufficient to tell apart the two producers of a scheduling disable.
When a queue is suspended, __guc_exec_queue_suspend() sets
suspend_pending and queues a SUSPEND message. If a job times out before
that message runs, guc_exec_queue_timedout_job() stops submission, which
traps the message, bans the queue and issues a disable of its own via
disable_scheduling(). When the GuC acknowledges that disable,
suspend_pending is still set, so handle_sched_done() misattributes the
reply to the trapped SUSPEND message.
This signals the suspend fence for a queue that was never suspended,
tripping the exec_queue_suspended() assert in suspend_fence_signal(), and
skips the wake_up_all() the TDR is waiting on, so the TDR stalls for its
full 5s timeout and then triggers an unnecessary GT reset.
The suspend path marks the queue suspended before disabling scheduling,
and a trapped SUSPEND message never does, so exec_queue_suspended()
distinguishes the two cases. Use it to qualify the attribution, the same
way the VF migration replay path already does. The trapped message is not
lost: it completes the suspend once submission restarts at the end of the
TDR.
While here, wake guc->ct.wq after clearing pending_disable rather than
before, so a waiter observes the updated state on its first re-check, and
wake unconditionally since the suspend and destroy paths have waiters too.
v2: Rebase onto drm-xe-next. The suspend_pending check moved under
sched->msg_lock in commit cf4171a20d13 ("drm/xe/guc: Fix race
around q->guc->suspend_pending access"), so the
exec_queue_suspended() qualification is folded into that locked
snapshot rather than reinstating an unlocked check. No functional
change from v1.
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Jagmeet Randhawa <jagmeet.randhawa@intel.com>
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20261020190705.20127-1-jagmeet.randhawa@intel.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_guc_submit.c | 48 ++++++++++++++++++------------
1 file changed, 29 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index e80291cdf0edc..8124f9d7b44cb 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -3128,8 +3128,17 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
xe_gt_assert(guc_to_gt(guc), runnable_state == 0);
xe_gt_assert(guc_to_gt(guc), exec_queue_pending_disable(q));
+ /*
+ * A TDR stops the scheduler, which can trap a queued SUSPEND
+ * message, and then issues a disable of its own. suspend_pending
+ * is still set in that case, so only attribute this SCHED_DONE
+ * to a suspend if the SUSPEND message actually ran, i.e. it
+ * marked the queue suspended before disabling scheduling. The
+ * trapped message completes the suspend once submission
+ * restarts.
+ */
xe_sched_msg_lock(&q->guc->sched);
- was_pending = q->guc->suspend_pending;
+ was_pending = q->guc->suspend_pending && exec_queue_suspended(q);
if (was_pending) {
clear_exec_queue_pending_disable(q);
suspend_fence_signal(q);
@@ -3137,26 +3146,27 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
xe_sched_msg_unlock(&q->guc->sched);
if (!was_pending) {
- if (exec_queue_banned(q)) {
- smp_wmb();
- wake_up_all(&guc->ct.wq);
- }
- if (exec_queue_destroyed(q)) {
- /*
- * Make sure to clear the pending_disable only
- * after sampling the destroyed state. We want
- * to ensure we don't trigger the unregister too
- * early with something intending to only
- * disable scheduling. The caller doing the
- * destroy must wait for an ongoing
- * pending_disable before marking as destroyed.
- */
- clear_exec_queue_pending_disable(q);
+ /*
+ * Make sure to clear the pending_disable only after
+ * sampling the destroyed state. We want to ensure we
+ * don't trigger the unregister too early with something
+ * intending to only disable scheduling. The caller
+ * doing the destroy must wait for an ongoing
+ * pending_disable before marking as destroyed.
+ */
+ bool destroyed = exec_queue_destroyed(q);
+
+ clear_exec_queue_pending_disable(q);
+ if (destroyed)
deregister_exec_queue(guc, q);
- } else {
- clear_exec_queue_pending_disable(q);
- }
}
+
+ /*
+ * Wake after pending_disable is cleared, not before, so waiters
+ * such as the TDR see the updated state on the first re-check.
+ */
+ smp_wmb();
+ wake_up_all(&guc->ct.wq);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0407/1005] gpiolib: fix GPIO descriptor leak in gpiod_get_array()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (405 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0406/1005] drm/xe/guc: Do not attribute a TDR disable to a pending suspend Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0408/1005] gpiolib: fix fast-path cancellation " Greg Kroah-Hartman
` (591 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko, Dmitry Torokhov,
Bartosz Golaszewski, 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 b2a161687acdc297aa91fec7fa0966b5aecf0d16 ]
In gpiod_get_array(), descs->ndescs is used as the loop induction
variable and is only incremented at the end of each iteration. When
krealloc() fails on the first iteration (when index is 0),
descs->desc[0] has already been acquired via gpiod_get_index(), but
descs->ndescs is still 0. Consequently, gpiod_put_array() frees descs
without releasing descs->desc[0], leaking the descriptor.
Fix this by using a dedicated loop induction variable and incrementing
descs->ndescs immediately upon storing the retrieved descriptor.
Additionally, since the fast-path array_info setup only executes for the
first element (index 0), simplify the bitmap_set() calls to start at bit
0 for count bits instead of calculating offsets from the loop index.
Fixes: bf9346f5d47b ("gpiolib: Identify arrays matching GPIO hardware")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20261105-b4-gpiolib-free-v3-1-bb47ad58642d@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index b16d6d727ac35..3d2b2919dfb71 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -5223,21 +5223,21 @@ struct gpio_descs *__must_check gpiod_get_array(struct device *dev,
if (!descs)
return ERR_PTR(-ENOMEM);
- for (descs->ndescs = 0; descs->ndescs < count; descs->ndescs++) {
- desc = gpiod_get_index(dev, con_id, descs->ndescs, flags);
+ for (int i = 0; i < count; i++) {
+ desc = gpiod_get_index(dev, con_id, i, flags);
if (IS_ERR(desc)) {
gpiod_put_array(descs);
return ERR_CAST(desc);
}
- descs->desc[descs->ndescs] = desc;
+ descs->desc[descs->ndescs++] = desc;
gdev = gpiod_to_gpio_device(desc);
/*
* If pin hardware number of array member 0 is also 0, select
* its chip as a candidate for fast bitmap processing path.
*/
- if (descs->ndescs == 0 && gpiod_hwgpio(desc) == 0) {
+ if (i == 0 && gpiod_hwgpio(desc) == 0) {
struct gpio_descs *array;
bitmap_size = BITS_TO_LONGS(gdev->ngpio > count ?
@@ -5262,10 +5262,8 @@ struct gpio_descs *__must_check gpiod_get_array(struct device *dev,
array_info->desc = descs->desc;
array_info->size = count;
array_info->gdev = gdev;
- bitmap_set(array_info->get_mask, descs->ndescs,
- count - descs->ndescs);
- bitmap_set(array_info->set_mask, descs->ndescs,
- count - descs->ndescs);
+ bitmap_set(array_info->get_mask, 0, count);
+ bitmap_set(array_info->set_mask, 0, count);
descs->info = array_info;
}
@@ -5275,38 +5273,34 @@ struct gpio_descs *__must_check gpiod_get_array(struct device *dev,
/* Unmark array members which don't belong to the 'fast' chip */
if (array_info->gdev != gdev) {
- __clear_bit(descs->ndescs, array_info->get_mask);
- __clear_bit(descs->ndescs, array_info->set_mask);
+ __clear_bit(i, array_info->get_mask);
+ __clear_bit(i, array_info->set_mask);
}
/*
* Detect array members which belong to the 'fast' chip
* but their pins are not in hardware order.
*/
- else if (gpiod_hwgpio(desc) != descs->ndescs) {
+ else if (gpiod_hwgpio(desc) != i) {
/*
* Don't use fast path if all array members processed so
* far belong to the same chip as this one but its pin
* hardware number is different from its array index.
*/
- if (bitmap_full(array_info->get_mask, descs->ndescs)) {
+ if (bitmap_full(array_info->get_mask, i)) {
array_info = NULL;
} else {
- __clear_bit(descs->ndescs,
- array_info->get_mask);
- __clear_bit(descs->ndescs,
- array_info->set_mask);
+ __clear_bit(i, array_info->get_mask);
+ __clear_bit(i, array_info->set_mask);
}
} else {
dflags = READ_ONCE(desc->flags);
/* Exclude open drain or open source from fast output */
if (test_bit(GPIOD_FLAG_OPEN_DRAIN, &dflags) ||
test_bit(GPIOD_FLAG_OPEN_SOURCE, &dflags))
- __clear_bit(descs->ndescs,
- array_info->set_mask);
+ __clear_bit(i, array_info->set_mask);
/* Identify 'fast' pins which require invertion */
if (gpiod_is_active_low(desc))
- __set_bit(descs->ndescs,
- array_info->invert_mask);
+ __set_bit(i, array_info->invert_mask);
}
}
if (array_info)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0408/1005] gpiolib: fix fast-path cancellation in gpiod_get_array()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (406 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0407/1005] gpiolib: fix GPIO descriptor leak in gpiod_get_array() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0409/1005] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
` (590 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko, Dmitry Torokhov,
Bartosz Golaszewski, 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 51c85306270972f672737dc5e28332e2b41b26f1 ]
In gpiod_get_array(), when a pin on the same chip is not in hardware
order and the preceding pins form a contiguous block, the fast path is
cancelled by setting array_info to NULL. However, descs->info was
already populated with the array_info pointer during the first
iteration, leaving descs->info pointing to the aborted array_info.
Consequently, subsequent array operations still use the fast path with
remaining bits set in the masks and wrong hardware pin numbers.
Clear descs->info alongside array_info when cancelling the fast path so
callers do not erroneously use the aborted array_info.
Fixes: c4c958aa64f3 ("gpiolib: Fix array members of same chip processed separately")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20261105-b4-gpiolib-free-v3-2-bb47ad58642d@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 3d2b2919dfb71..e5cf5e2a795e8 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -5287,6 +5287,7 @@ struct gpio_descs *__must_check gpiod_get_array(struct device *dev,
* hardware number is different from its array index.
*/
if (bitmap_full(array_info->get_mask, i)) {
+ descs->info = NULL;
array_info = NULL;
} else {
__clear_bit(i, array_info->get_mask);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0409/1005] gpiolib: of: return -ENOENT from of_gpio_count() stub
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (407 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0408/1005] gpiolib: fix fast-path cancellation " Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0410/1005] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
` (589 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko, Dmitry Torokhov,
Bartosz Golaszewski, 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 e20e4b8cda2b4d7dd32dbd2c0875a15d92545f04 ]
gpiod_count() and its firmware backends are expected to return either a
positive number of GPIOs or a negative error code (-ENOENT) when no
GPIOs are assigned. However, the !CONFIG_OF_GPIO stub for
of_gpio_count() returns 0 instead of -ENOENT. This causes gpiod_count()
to skip the platform_gpio_count() fallback (which triggers when
count < 0) and erroneously return 0 to callers.
Change the stub to return -ENOENT to match the real of_gpio_count()
implementation and the other error-returning stubs in gpiolib-of.h.
Fixes: f626d6dfb709 ("gpio: of: Break out OF-only code")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20261105-b4-gpiolib-free-v3-3-bb47ad58642d@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib-of.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib-of.h b/drivers/gpio/gpiolib-of.h
index 218cfe5bc4ac3..9ca540d93f93b 100644
--- a/drivers/gpio/gpiolib-of.h
+++ b/drivers/gpio/gpiolib-of.h
@@ -46,7 +46,7 @@ static inline bool of_gpiochip_instance_match(struct gpio_chip *gc,
static inline int of_gpio_count(const struct fwnode_handle *fwnode,
const char *con_id)
{
- return 0;
+ return -ENOENT;
}
static inline int of_gpiochip_get_lflags(struct gpio_chip *chip,
struct fwnode_reference_args *gpiospec,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0410/1005] ASoC: soc-core: copy the DAI link names into the card
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (408 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0409/1005] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0411/1005] ASoC: qcom: common: Add generic headset jack helpers Greg Kroah-Hartman
` (588 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tyler Baker, Mark Brown, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Baker <tyler.baker@oss.qualcomm.com>
[ Upstream commit 33a130f6ed8c75ed59b12889a417a57fb80d0abf ]
snd_soc_of_get_dai_link_codecs() and snd_soc_of_get_dai_link_cpus()
keep a DAI name owned by the component, which is freed when the
component unbinds, so the card cannot bind again afterwards.
Copy the name onto the card device, as simple-card and audio-graph-card
do since commit aa173b70d372 ("ASoC: generic: keep fallback dai_name
stable across rebind").
Fixes: e894efef9ac7 ("ASoC: core: add support to card rebind")
Fixes: 900dedd7e47c ("ASoC: Introduce snd_soc_of_get_dai_link_cpus")
Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
Link: https://patch.msgid.link/20261106054333.2748248-2-tyler.baker@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/soc-core.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b9c70268d49fe..2ba53102a6302 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3610,6 +3610,18 @@ void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link)
}
EXPORT_SYMBOL_GPL(snd_soc_of_put_dai_link_codecs);
+/* dai_name belongs to the component, which can unbind before the card. */
+static int snd_soc_of_dup_dai_name(struct device *dev,
+ struct snd_soc_dai_link_component *dlc)
+{
+ if (!dlc->dai_name)
+ return 0;
+
+ dlc->dai_name = devm_kstrdup_const(dev, dlc->dai_name, GFP_KERNEL);
+
+ return dlc->dai_name ? 0 : -ENOMEM;
+}
+
/*
* snd_soc_of_get_dai_link_codecs - Parse a list of CODECs in the devicetree
* @dev: Card device
@@ -3639,6 +3651,8 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
/* Parse the list */
for_each_link_codecs(dai_link, index, component) {
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
+ if (!ret)
+ ret = snd_soc_of_dup_dai_name(dev, component);
if (ret)
goto err;
}
@@ -3694,6 +3708,8 @@ int snd_soc_of_get_dai_link_cpus(struct device *dev,
/* Parse the list */
for_each_link_cpus(dai_link, index, component) {
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
+ if (!ret)
+ ret = snd_soc_of_dup_dai_name(dev, component);
if (ret)
goto err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0411/1005] ASoC: qcom: common: Add generic headset jack helpers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (409 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0410/1005] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0412/1005] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Greg Kroah-Hartman
` (587 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hongyang Zhao, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongyang Zhao <hongyang.zhao@thundersoft.com>
[ Upstream commit 7f8dd07370f8c17f8f98f0fa98691635828b0dac ]
qcom_snd_wcd_jack_setup() combines creation of the card-level headset
jack with the WCD-specific operation of attaching jack detection to
codecs on the TX codec DMA links. External codecs connected over MI2S
also provide component jack detection, but cannot use the WCD-specific
DAI filtering.
Factor the common jack allocation, DAPM pin registration and headset
button mappings into a private initializer. Reuse it from the existing
WCD path and add a generic setup helper which attaches the jack to every
codec component in a runtime.
Treat -ENOTSUPP as a no-op because snd_soc_component_set_jack() uses it
for components which do not provide a set_jack callback.
Add a matching cleanup helper so machine drivers can detach component
jack detection when the DAI link exits. The WCD setup behavior remains
unchanged.
Signed-off-by: Hongyang Zhao <hongyang.zhao@thundersoft.com>
Link: https://patch.msgid.link/20260904-rubikpi-next-20260605-v3-3-f49146d85af3@thundersoft.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 704251f9dad3 ("ASoC: qcom: x1e80100: recreate the headset jack on card rebind")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/qcom/common.c | 61 +++++++++++++++++++++++++++++++++++------
sound/soc/qcom/common.h | 3 ++
2 files changed, 56 insertions(+), 8 deletions(-)
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index d9f256d519733..83b745f617a86 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -339,13 +339,11 @@ static struct snd_soc_jack_pin qcom_headset_jack_pins[] = {
},
};
-int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
- struct snd_soc_jack *jack, bool *jack_setup)
+static int qcom_snd_headset_jack_init(struct snd_soc_card *card,
+ struct snd_soc_jack *jack,
+ bool *jack_setup)
{
- struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
- struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
- struct snd_soc_card *card = rtd->card;
- int rval, i;
+ int rval;
if (!*jack_setup) {
rval = snd_soc_card_jack_new_pins(card, "Headset Jack",
@@ -369,6 +367,55 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
*jack_setup = true;
}
+ return 0;
+}
+
+int qcom_snd_headset_jack_setup(struct snd_soc_pcm_runtime *rtd,
+ struct snd_soc_jack *jack, bool *jack_setup)
+{
+ struct snd_soc_dai *codec_dai;
+ struct snd_soc_card *card = rtd->card;
+ int rval, i;
+
+ rval = qcom_snd_headset_jack_init(card, jack, jack_setup);
+ if (rval)
+ return rval;
+
+ for_each_rtd_codec_dais(rtd, i, codec_dai) {
+ rval = snd_soc_component_set_jack(codec_dai->component, jack, NULL);
+ if (rval != 0 && rval != -ENOTSUPP) {
+ dev_warn(card->dev, "Failed to set jack: %d\n", rval);
+ qcom_snd_headset_jack_cleanup(rtd);
+ return rval;
+ }
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(qcom_snd_headset_jack_setup);
+
+void qcom_snd_headset_jack_cleanup(struct snd_soc_pcm_runtime *rtd)
+{
+ struct snd_soc_dai *codec_dai;
+ int i;
+
+ for_each_rtd_codec_dais(rtd, i, codec_dai)
+ snd_soc_component_set_jack(codec_dai->component, NULL, NULL);
+}
+EXPORT_SYMBOL_GPL(qcom_snd_headset_jack_cleanup);
+
+int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
+ struct snd_soc_jack *jack, bool *jack_setup)
+{
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+ struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
+ struct snd_soc_card *card = rtd->card;
+ int rval, i;
+
+ rval = qcom_snd_headset_jack_init(card, jack, jack_setup);
+ if (rval)
+ return rval;
+
switch (cpu_dai->id) {
case LPI_MI2S_RX_0:
case TX_CODEC_DMA_TX_0:
@@ -388,8 +435,6 @@ int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
default:
break;
}
-
-
return 0;
}
EXPORT_SYMBOL_GPL(qcom_snd_wcd_jack_setup);
diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h
index c1deac109f243..b6204a32bd64c 100644
--- a/sound/soc/qcom/common.h
+++ b/sound/soc/qcom/common.h
@@ -24,6 +24,9 @@ int qcom_snd_apply_dai_tdm_slots_cfg(struct snd_soc_pcm_runtime *rtd,
const struct qcom_snd_tdm_slot_cfg *cpu_cfg,
const struct qcom_snd_tdm_slot_cfg *codec_cfg);
int qcom_snd_apply_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd);
+int qcom_snd_headset_jack_setup(struct snd_soc_pcm_runtime *rtd,
+ struct snd_soc_jack *jack, bool *jack_setup);
+void qcom_snd_headset_jack_cleanup(struct snd_soc_pcm_runtime *rtd);
int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
struct snd_soc_jack *jack, bool *jack_setup);
int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0412/1005] ASoC: qcom: x1e80100: recreate the headset jack on card rebind
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (410 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0411/1005] ASoC: qcom: common: Add generic headset jack helpers Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0413/1005] drm/panfrost: Enable cycle counting when perfcnt is enabled Greg Kroah-Hartman
` (586 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tyler Baker, Mark Brown, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Baker <tyler.baker@oss.qualcomm.com>
[ Upstream commit 704251f9dad3cb5f93ef64ff2d547868d42de319 ]
The headset jack is only created while jack_setup is false and nothing
clears it, so after a card rebind it is not created again and the
codecs keep a pointer to the freed jack.
Clear it on link exit, as sc8280xp does.
Fixes: 6b9dc2da6657 ("ASoC: qcom: Add x1e80100 sound machine driver")
Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
Link: https://patch.msgid.link/20261106054333.2748248-3-tyler.baker@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/qcom/x1e80100.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c
index c81df41ace883..213d7f45198cb 100644
--- a/sound/soc/qcom/x1e80100.c
+++ b/sound/soc/qcom/x1e80100.c
@@ -68,6 +68,23 @@ static int x1e80100_snd_init(struct snd_soc_pcm_runtime *rtd)
return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup);
}
+static void x1e80100_snd_exit(struct snd_soc_pcm_runtime *rtd)
+{
+ struct x1e80100_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+
+ switch (cpu_dai->id) {
+ case DISPLAY_PORT_RX_0:
+ case DISPLAY_PORT_RX_1 ... DISPLAY_PORT_RX_7:
+ return;
+ default:
+ break;
+ }
+
+ qcom_snd_headset_jack_cleanup(rtd);
+ data->jack_setup = false;
+}
+
static int x1e80100_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params)
{
@@ -172,6 +189,7 @@ static void x1e80100_add_be_ops(struct snd_soc_card *card)
for_each_card_prelinks(card, i, link) {
if (link->no_pcm == 1) {
link->init = x1e80100_snd_init;
+ link->exit = x1e80100_snd_exit;
link->be_hw_params_fixup = x1e80100_be_hw_params_fixup;
link->ops = &x1e80100_be_ops;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0413/1005] drm/panfrost: Enable cycle counting when perfcnt is enabled
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (411 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0412/1005] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0414/1005] ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler Greg Kroah-Hartman
` (585 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Boris Brezillon, Steven Price,
Adrián Larumbe, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Brezillon <boris.brezillon@collabora.com>
[ Upstream commit 99a2e2b1690f48b074bf14a3b7d5d52f45d26ecc ]
If we don't do that, we end up with invalid timestamps in the block
headers.
We also need to skip the warning on the cycle counter reference being
other than 0 during device reset, because of perfcnt's lingering ref.
Ideally this would be dealt with by splitting the reset sequence into
pre and post stages, so that a hypothetical panfrost_perfcnt_pre_reset()
would release the cycle counter reference. In the absence thereof, we
just make do.
Fixes: 7786fd108777 ("drm/panfrost: Expose performance counters through unstable ioctls")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20261104-panfrost-reset-races-fixes-v3-1-09868a88c351@collabora.com
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panfrost/panfrost_gpu.c | 7 +++----
drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 3 +++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index 8a15ccce08e9b..5ef6897fc05ed 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -94,11 +94,10 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev)
GPU_IRQ_CLEAN_CACHES_COMPLETED);
/*
- * All in-flight jobs should have released their cycle
- * counter references upon reset, but let us make sure
+ * Even though all in-flight jobs should have released their cycle counter
+ * references upon reset, perfcnt's might still hang about.
*/
- if (drm_WARN_ON(&pfdev->base, atomic_read(&pfdev->cycle_counter.use_count) != 0))
- atomic_set(&pfdev->cycle_counter.use_count, 0);
+ atomic_set(&pfdev->cycle_counter.use_count, 0);
return 0;
}
diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
index 03a6dcd8da2f5..46b5141932ee8 100644
--- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
+++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
@@ -17,6 +17,7 @@
#include "panfrost_device.h"
#include "panfrost_features.h"
#include "panfrost_gem.h"
+#include "panfrost_gpu.h"
#include "panfrost_issues.h"
#include "panfrost_job.h"
#include "panfrost_mmu.h"
@@ -52,6 +53,7 @@ static void panfrost_perfcnt_hw_disable(struct panfrost_device *pfdev)
gpu_write(pfdev, GPU_PRFCNT_TILER_EN, 0);
if (perfcnt->owns_as_ref) {
+ panfrost_cycle_counter_put(pfdev);
panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
perfcnt->owns_as_ref = false;
}
@@ -81,6 +83,7 @@ static int panfrost_perfcnt_hw_enable(struct panfrost_device *pfdev)
return ret;
perfcnt->owns_as_ref = true;
+ panfrost_cycle_counter_get(pfdev);
as = ret;
cfg = GPU_PERFCNT_CFG_AS(as) |
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0414/1005] ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (412 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0413/1005] drm/panfrost: Enable cycle counting when perfcnt is enabled Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0415/1005] ASoC: SOF: amd: " Greg Kroah-Hartman
` (584 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit 41e06aaef9c000c1bb52d8a6f73ae66c9bd36d83 ]
The ACP external IRQ handler is registered before sdw_amd_probe() assigns
adata->sdw, so a stray interrupt in the probe window could reach the
adata->sdw->pdev[i] dereference with adata->sdw still NULL.
The same window exists on the teardown side: after sdw_amd_exit() frees
the context but before adata->sdw is cleared by the caller.
Add NULL checks for adata->sdw in acp63_irq_handler() before dereferencing
->pdev[0] and ->pdev[1], and in handle_acp70_sdw_wake_event() for the same
reason. The interrupt-status register write that acknowledges the IRQ is
kept outside the guard so the hardware bit is always cleared regardless of
whether the SoundWire context is live.
Fixes: e1cb350610ce ("ASoC: amd: ps: handle SoundWire interrupts in acp pci driver")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20261107175339.3547918-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/ps/pci-ps.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c
index b604db4942dd6..d0b66df101579 100644
--- a/sound/soc/amd/ps/pci-ps.c
+++ b/sound/soc/amd/ps/pci-ps.c
@@ -26,16 +26,20 @@ static void handle_acp70_sdw_wake_event(struct acp63_dev_data *adata)
struct amd_sdw_manager *amd_manager;
if (adata->acp70_sdw0_wake_event) {
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
- if (amd_manager)
- pm_request_resume(amd_manager->dev);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
+ if (amd_manager)
+ pm_request_resume(amd_manager->dev);
+ }
adata->acp70_sdw0_wake_event = 0;
}
if (adata->acp70_sdw1_wake_event) {
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
- if (amd_manager)
- pm_request_resume(amd_manager->dev);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
+ if (amd_manager)
+ pm_request_resume(amd_manager->dev);
+ }
adata->acp70_sdw1_wake_event = 0;
}
}
@@ -209,18 +213,22 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id)
ext_intr_stat = readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT);
if (ext_intr_stat & ACP_SDW0_STAT) {
writel(ACP_SDW0_STAT, adata->acp63_base + ACP_EXTERNAL_INTR_STAT);
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
- if (amd_manager)
- schedule_work(&amd_manager->amd_sdw_irq_thread);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
+ if (amd_manager)
+ schedule_work(&amd_manager->amd_sdw_irq_thread);
+ }
irq_flag = 1;
}
ext_intr_stat1 = readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT1);
if (ext_intr_stat1 & ACP_SDW1_STAT) {
writel(ACP_SDW1_STAT, adata->acp63_base + ACP_EXTERNAL_INTR_STAT1);
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
- if (amd_manager)
- schedule_work(&amd_manager->amd_sdw_irq_thread);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
+ if (amd_manager)
+ schedule_work(&amd_manager->amd_sdw_irq_thread);
+ }
irq_flag = 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0415/1005] ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (413 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0414/1005] ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0416/1005] cgroup/cpuset: Reset partition data when an invalid partition stays invalid Greg Kroah-Hartman
` (583 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit 34ea81a7f284a13d825279fdede36b7f793f9936 ]
The ACP external IRQ handler is registered before sdw_amd_probe() assigns
adata->sdw, so a stray interrupt in the probe window could reach the
adata->sdw->pdev[i] dereference with adata->sdw still NULL.
The same window exists on the teardown side: after sdw_amd_exit() frees
the context but before adata->sdw is cleared by the caller.
Add NULL checks for adata->sdw in acp_irq_handler() before dereferencing
->pdev[0] and ->pdev[1], and in amd_sof_handle_acp70_sdw_wake_event() for
the same reason. The interrupt-status register write that acknowledges the
IRQ is kept outside the guard so the hardware bit is always cleared
regardless of whether the SoundWire context is live.
Fixes: 96eb81851012 ("ASoC: SOF: amd: add interrupt handling for SoundWire manager devices")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Fixes: 1f41bf67bfe3 ("ASoC: SOF: amd: add soundwire wake irq handling")
Link: https://patch.msgid.link/20261107175339.3547918-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/acp.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 5570f3d1348dd..7656f9bb6f165 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -430,16 +430,20 @@ static void amd_sof_handle_acp70_sdw_wake_event(struct acp_dev_data *adata)
struct amd_sdw_manager *amd_manager;
if (adata->acp70_sdw0_wake_event) {
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
- if (amd_manager)
- pm_request_resume(amd_manager->dev);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
+ if (amd_manager)
+ pm_request_resume(amd_manager->dev);
+ }
adata->acp70_sdw0_wake_event = 0;
}
if (adata->acp70_sdw1_wake_event) {
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
- if (amd_manager)
- pm_request_resume(amd_manager->dev);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
+ if (amd_manager)
+ pm_request_resume(amd_manager->dev);
+ }
adata->acp70_sdw1_wake_event = 0;
}
}
@@ -531,10 +535,12 @@ static irqreturn_t acp_irq_handler(int irq, void *dev_id)
val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->ext_intr_stat);
if (val & ACP_SDW0_IRQ_MASK) {
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_stat, ACP_SDW0_IRQ_MASK);
- if (amd_manager)
- schedule_work(&amd_manager->amd_sdw_irq_thread);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[0]->dev);
+ if (amd_manager)
+ schedule_work(&amd_manager->amd_sdw_irq_thread);
+ }
irq_flag = 1;
}
@@ -560,11 +566,13 @@ static irqreturn_t acp_irq_handler(int irq, void *dev_id)
if (desc->ext_intr_stat1) {
val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->ext_intr_stat1);
if (val & ACP_SDW1_IRQ_MASK) {
- amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_stat1,
ACP_SDW1_IRQ_MASK);
- if (amd_manager)
- schedule_work(&amd_manager->amd_sdw_irq_thread);
+ if (adata->sdw) {
+ amd_manager = dev_get_drvdata(&adata->sdw->pdev[1]->dev);
+ if (amd_manager)
+ schedule_work(&amd_manager->amd_sdw_irq_thread);
+ }
irq_flag = 1;
}
switch (adata->pci_rev) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0416/1005] cgroup/cpuset: Reset partition data when an invalid partition stays invalid
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (414 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0415/1005] ASoC: SOF: amd: " Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0417/1005] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output Greg Kroah-Hartman
` (582 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Waiman Long, Ridong Chen,
Guopeng Zhang, Tejun Heo, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ridong Chen <chenridong@xiaomi.com>
[ Upstream commit ba4834fc81ddc0b500843c827c09d3ff95a317a9 ]
When cpuset.cpus or cpuset.cpus.exclusive of a partition root is
changed, update_cpumask() and update_exclusive_cpumask() copy the new
effective_xcpus computed for the trial cpuset into the cpuset, and call
reset_partition_data() only if the partition was valid before and is
invalid now:
if ((old_prs > 0) && !is_partition_valid(cs))
reset_partition_data(cs);
An invalid partition root (old_prs < 0) that stays invalid is not
covered. Its effective_xcpus is then left with the trial value, which
is computed from user_xcpus() and so falls back to cpuset.cpus when
cpuset.cpus.exclusive is cleared. As an invalid partition root does not
own any exclusive CPUs, and rm_siblings_excl_cpus() treats a non-empty
effective_xcpus of a sibling without cpuset.cpus.exclusive as owned,
those CPUs can then no longer be claimed by a sibling:
# A1: cpuset.cpus=2-3, cpuset.cpus.exclusive=2-3, root, with tasks
# offline CPUs 2-3 -> A1 becomes invalid
echo > A1/cpuset.cpus.exclusive
cat A1/cpuset.cpus.exclusive.effective # 2-3, expected empty
echo 3 > B1/cpuset.cpus.exclusive # -EINVAL
Reset the partition data whenever the cpuset is a partition root, valid
or not, and ends up invalid. As effective_xcpus may be cleared by that,
also force update_cpumasks_hier() to update the subtree, so that the
effective_xcpus of the descendants doesn't keep the released CPUs. Add
test cases for it.
Fixes: de9f15e21c55 ("cpuset: use parse_cpulist for setting cpus.exclusive")
Fixes: c5866c9a007d ("cpuset: refactor CPU mask buffer parsing logic")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20261101114206.2434398-1-ridong.chen%40linux.dev?part=15
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Ridong Chen <chenridong@xiaomi.com>
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 10 ++++++++--
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 6 ++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 6f336ace3033a..8f0979b73e20f 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2640,8 +2640,11 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
spin_lock_irq(&callback_lock);
cpumask_copy(cs->cpus_allowed, trialcs->cpus_allowed);
cpumask_copy(cs->effective_xcpus, trialcs->effective_xcpus);
- if ((old_prs > 0) && !is_partition_valid(cs))
+ if (old_prs && !is_partition_valid(cs)) {
reset_partition_data(cs);
+ /* effective_xcpus may be cleared, update the subtree too */
+ force = true;
+ }
spin_unlock_irq(&callback_lock);
/* effective_cpus/effective_xcpus will be updated here */
@@ -2705,8 +2708,11 @@ static int update_exclusive_cpumask(struct cpuset *cs, struct cpuset *trialcs,
spin_lock_irq(&callback_lock);
cpumask_copy(cs->exclusive_cpus, trialcs->exclusive_cpus);
cpumask_copy(cs->effective_xcpus, trialcs->effective_xcpus);
- if ((old_prs > 0) && !is_partition_valid(cs))
+ if (old_prs && !is_partition_valid(cs)) {
reset_partition_data(cs);
+ /* effective_xcpus may be cleared, update the subtree too */
+ force = true;
+ }
spin_unlock_irq(&callback_lock);
/*
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index 78ed0500e11db..7d5ca28e46c21 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -364,6 +364,12 @@ TEST_MATRIX=(
# cpuset.cpus is allowed, but those extra CPUs are ignored.
" C2-3:P1 C3:P1 . . . C2-4 . . 0 A1:|A2:2-3 A1:P1|A2:P1"
+ # Clearing cpuset.cpus.exclusive of an invalid partition releases its
+ # exclusive CPUs, including those of its descendants, so a sibling
+ # can claim them.
+ " CX2-3:P1 . . C3 T:O2=0:O3=0:X . . X3 0 XA1:|XB1:3 A1:P-1"
+ " CX2-3:P1 X3 . C3 T:O2=0:O3=0:X . . X3 0 XA1:|XA2:|XB1:3 A1:P-1"
+
# A child cannot recover until its exclusive CPUs are available again.
" CX1-4:P1 CX3-4:P1 . . X1-2 . . . 0 A1:1-2|A2:1-2|XA2: A1:P1|A2:P-1"
" CX1-4:P1 CX3-4:P1 . . X1-2:X1-4 . . . 0 A1:1-2|A2:3-4|XA2:3-4 A1:P1|A2:P1"
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0417/1005] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (415 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0416/1005] cgroup/cpuset: Reset partition data when an invalid partition stays invalid Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0418/1005] btrfs: zoned: only change active zone counter on successful (de)activation Greg Kroah-Hartman
` (581 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Samuel Leyva, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Leyva <samuelslg03idk@gmail.com>
[ Upstream commit f392763d73356760eac3e4ab7c87b0855be0d4bb ]
The speaker amplifier GPIO is driven from a SUPPLY widget. DAPM powers
supplies before the rest of the path, so the amplifier is enabled while
the ES8316 headphone driver and charge pump, which also feed the
speakers, are still powering up. This results in an audible pop every
time the speaker output is powered on.
Move the speaker GPIO handling to the Speaker endpoint widget, which
DAPM powers up last and powers down first, and give the codec output a
short time to settle before enabling the amplifier.
The headphone path is left unchanged: the Headphone endpoint widget
shares its power-up rank with the codec output drivers, so moving it
would not guarantee the same ordering, and it could not be tested.
Fixes: 54fcd9dd44b2 ("ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec")
Signed-off-by: Samuel Leyva <samuelslg03idk@gmail.com>
Link: https://patch.msgid.link/20261107232225.3838-3-samuelslg03idk@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c b/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
index eb0e9a6af6ef1..80985d044896c 100644
--- a/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
+++ b/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
@@ -18,6 +18,7 @@
#include <linux/input.h>
#include <linux/io.h>
#include <linux/acpi.h>
+#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/string_choices.h>
#include "../acp-mach.h"
@@ -60,6 +61,8 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
#define ES83xx_12288_KHZ_MCLK_FREQ (48000 * 256)
#define ES83xx_48_MHZ_MCLK_FREQ (48000 * 1000)
+#define ES83XX_AMP_ON_DELAY_MS 50
+
static int acp3x_es83xx_headphone_power_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event);
static int acp3x_es83xx_speaker_power_event(struct snd_soc_dapm_widget *w,
@@ -114,7 +117,7 @@ static struct snd_soc_jack_pin es83xx_jack_pins[] = {
};
static const struct snd_soc_dapm_widget acp3x_es83xx_widgets[] = {
- SND_SOC_DAPM_SPK("Speaker", NULL),
+ SND_SOC_DAPM_SPK("Speaker", acp3x_es83xx_speaker_power_event),
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_MIC("Internal Mic", NULL),
@@ -122,9 +125,6 @@ static const struct snd_soc_dapm_widget acp3x_es83xx_widgets[] = {
SND_SOC_DAPM_SUPPLY("Headphone Power", SND_SOC_NOPM, 0, 0,
acp3x_es83xx_headphone_power_event,
SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
- SND_SOC_DAPM_SUPPLY("Speaker Power", SND_SOC_NOPM, 0, 0,
- acp3x_es83xx_speaker_power_event,
- SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
};
static const struct snd_soc_dapm_route acp3x_es83xx_audio_map[] = {
@@ -138,7 +138,6 @@ static const struct snd_soc_dapm_route acp3x_es83xx_audio_map[] = {
*/
{"Speaker", NULL, "HPOL"},
{"Speaker", NULL, "HPOR"},
- {"Speaker", NULL, "Speaker Power"},
};
@@ -186,10 +185,13 @@ static int acp3x_es83xx_speaker_power_event(struct snd_soc_dapm_widget *w,
struct acp3x_es83xx_private *priv = get_mach_priv(card);
dev_dbg(priv->codec_dev, "speaker power event: %d\n", event);
- if (SND_SOC_DAPM_EVENT_ON(event))
+ if (SND_SOC_DAPM_EVENT_ON(event)) {
+ /* Let the codec output settle before enabling the amplifier */
+ msleep(ES83XX_AMP_ON_DELAY_MS);
priv->speaker_on = true;
- else
+ } else {
priv->speaker_on = false;
+ }
gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_on);
gpiod_set_value_cansleep(priv->gpio_headphone, priv->headphone_on);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0418/1005] btrfs: zoned: only change active zone counter on successful (de)activation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (416 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0417/1005] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0419/1005] btrfs: zoned: fix possible UAF in wait_eb_writebacks() Greg Kroah-Hartman
` (580 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Vacek, Johannes Thumshirn,
David Sterba, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
[ Upstream commit 5e79f39fbeea78703ac389c67a810406fa09bc94 ]
btrfs_zone_activate() unconditionally decrements the reserved_active_zones
counter regardless if btrfs_dev_set_active_zone() fails to set the zone
active, i.e. because it raced with another call that already set the bit
in the bitmask, or not.
This can lead to a double decrement of the counter in case the bit has
already been set.
Only decrement the counter *iff* btrfs_dev_set_active_zone() successfully
marked the zone in the bitmap.
Mirror this behaviour when clearing the bit again.
Fixes: a7e1ac7bdc5a ("btrfs: zoned: reserve zones for an active metadata/system block group")
Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index a64af9d5d2376..232892b8542cf 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1131,11 +1131,13 @@ u64 btrfs_find_allocatable_zones(struct btrfs_device *device, u64 hole_start,
return pos;
}
-static bool btrfs_dev_set_active_zone(struct btrfs_device *device, u64 pos)
+static bool btrfs_dev_set_active_zone(struct btrfs_device *device, u64 pos, bool *new)
{
struct btrfs_zoned_device_info *zone_info = device->zone_info;
unsigned int zno = (pos >> zone_info->zone_size_shift);
+ *new = false;
+
/* We can use any number of zones */
if (zone_info->max_active_zones == 0)
return true;
@@ -1147,23 +1149,29 @@ static bool btrfs_dev_set_active_zone(struct btrfs_device *device, u64 pos)
if (test_and_set_bit(zno, zone_info->active_zones)) {
/* Someone already set the bit */
atomic_inc(&zone_info->active_zones_left);
+ } else {
+ *new = true;
}
}
return true;
}
-static void btrfs_dev_clear_active_zone(struct btrfs_device *device, u64 pos)
+static bool btrfs_dev_clear_active_zone(struct btrfs_device *device, u64 pos)
{
struct btrfs_zoned_device_info *zone_info = device->zone_info;
unsigned int zno = (pos >> zone_info->zone_size_shift);
/* We can use any number of zones */
if (zone_info->max_active_zones == 0)
- return;
+ return false;
- if (test_and_clear_bit(zno, zone_info->active_zones))
+ if (test_and_clear_bit(zno, zone_info->active_zones)) {
atomic_inc(&zone_info->active_zones_left);
+ return true;
+ }
+
+ return false;
}
int btrfs_reset_device_zone(struct btrfs_device *device, u64 physical,
@@ -2416,6 +2424,7 @@ bool btrfs_zone_activate(struct btrfs_block_group *block_group)
u64 physical;
const bool is_data = (block_group->flags & BTRFS_BLOCK_GROUP_DATA);
bool ret;
+ bool new;
int i;
if (!btrfs_is_zoned(block_group->fs_info))
@@ -2469,12 +2478,12 @@ bool btrfs_zone_activate(struct btrfs_block_group *block_group)
goto out_unlock;
}
- if (!btrfs_dev_set_active_zone(device, physical)) {
+ if (!btrfs_dev_set_active_zone(device, physical, &new)) {
/* Cannot activate the zone */
ret = false;
goto out_unlock;
}
- if (!is_data)
+ if (!is_data && new)
zinfo->reserved_active_zones--;
}
@@ -2521,6 +2530,7 @@ static int call_zone_finish(struct btrfs_block_group *block_group,
struct btrfs_device *device = stripe->dev;
const u64 physical = stripe->physical;
struct btrfs_zoned_device_info *zinfo = device->zone_info;
+ bool cleared;
int ret;
if (!device->bdev)
@@ -2542,9 +2552,9 @@ static int call_zone_finish(struct btrfs_block_group *block_group,
return ret;
}
- if (!(block_group->flags & BTRFS_BLOCK_GROUP_DATA))
+ cleared = btrfs_dev_clear_active_zone(device, physical);
+ if (!(block_group->flags & BTRFS_BLOCK_GROUP_DATA) && cleared)
zinfo->reserved_active_zones++;
- btrfs_dev_clear_active_zone(device, physical);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0419/1005] btrfs: zoned: fix possible UAF in wait_eb_writebacks()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (417 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0418/1005] btrfs: zoned: only change active zone counter on successful (de)activation Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0420/1005] btrfs: zoned: requeue block group if zone reset bails out Greg Kroah-Hartman
` (579 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Vacek, Johannes Thumshirn,
David Sterba, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
[ Upstream commit 8ca411c7ad2c02ae65ae208a3f7483d6e0159c4f ]
wait_eb_writebacks() iterates the fs_info->buffer_tree xarray and waits
for the writeback of these extent-buffers. Waiting for writeback needs
to be done without the rcu_read_lock() held (because it can sleep) and
thus the loop drops the rcu_read_lock() before calling into
wait_on_extent_buffer_writeback(). But extent_buffers are freed through
RCU, so if btrfs_release_extent_buffer_rcu() is scheduled while we're
still waiting on the writeback, the extent_buffer will be freed causing
a use-after-free.
Similar to what is done in find_extent_buffer_nolock(), get a reference
to the extent_buffer before calling into
wait_on_extent_buffer_writeback() so a successful writeback does not
free the extent_buffer while we still have a reference to it.
Fixes: 2dd7e7bc0282 ("btrfs: zoned: wait for extent buffer IOs before finishing a zone")
Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 232892b8542cf..a63ae60d7ba0d 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2517,8 +2517,16 @@ static void wait_eb_writebacks(struct btrfs_block_group *block_group)
continue;
if (eb->start >= end)
break;
+ /*
+ * Skip if we can't get the refcount for the extent buffer,
+ * i.e. because it was already written back. Otherwise an eb
+ * disappering underneath us can cause a use-after-free.
+ */
+ if (!refcount_inc_not_zero(&eb->refs))
+ continue;
rcu_read_unlock();
wait_on_extent_buffer_writeback(eb);
+ free_extent_buffer(eb);
rcu_read_lock();
}
rcu_read_unlock();
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0420/1005] btrfs: zoned: requeue block group if zone reset bails out
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (418 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0419/1005] btrfs: zoned: fix possible UAF in wait_eb_writebacks() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0421/1005] btrfs: zoned: dont wait for ordered extents in do_zone_finish() Greg Kroah-Hartman
` (578 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Vacek, Johannes Thumshirn,
David Sterba, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
[ Upstream commit c5f878eefdd4f559422a68bf49b6f59e7c10e70e ]
btrfs_reset_unused_block_groups() drops the block-group from
fs_info->unused_bgs before performing the work that can actually fail,
the actual submission of a REQ_OP_ZONE_RESET.
Every failed operation after this leaves the block-group dangling,
physically reset, but the in-memory structures aren't and it is not
requeued to be reset on fs_info->unused_bgs.
Instead of bailing out, re-add this block-group to fs_info->unused_bgs
list.
Fixes: 453a73c3069a ("btrfs: zoned: reclaim unused zone by zone resetting")
Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index a63ae60d7ba0d..fbde21946a36d 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -3141,6 +3141,8 @@ int btrfs_reset_unused_block_groups(struct btrfs_space_info *space_info, u64 num
{
struct btrfs_fs_info *fs_info = space_info->fs_info;
const sector_t zone_size_sectors = fs_info->zone_size >> SECTOR_SHIFT;
+ LIST_HEAD(retry_list);
+ int ret = 0;
if (!btrfs_is_zoned(fs_info))
return 0;
@@ -3182,11 +3184,10 @@ int btrfs_reset_unused_block_groups(struct btrfs_space_info *space_info, u64 num
}
if (!found) {
spin_unlock(&fs_info->unused_bgs_lock);
- return 0;
+ goto out;
}
list_del_init(&bg->bg_list);
- btrfs_put_block_group(bg);
spin_unlock(&fs_info->unused_bgs_lock);
/*
@@ -3200,7 +3201,6 @@ int btrfs_reset_unused_block_groups(struct btrfs_space_info *space_info, u64 num
for (int i = 0; i < map->num_stripes; i++) {
struct btrfs_io_stripe *stripe = &map->stripes[i];
unsigned int nofs_flags;
- int ret;
nofs_flags = memalloc_nofs_save();
ret = blkdev_zone_mgmt(stripe->dev->bdev, REQ_OP_ZONE_RESET,
@@ -3210,7 +3210,7 @@ int btrfs_reset_unused_block_groups(struct btrfs_space_info *space_info, u64 num
if (ret) {
up_read(&fs_info->dev_replace.rwsem);
- return ret;
+ goto requeue;
}
}
up_read(&fs_info->dev_replace.rwsem);
@@ -3221,7 +3221,7 @@ int btrfs_reset_unused_block_groups(struct btrfs_space_info *space_info, u64 num
if (bg->ro) {
spin_unlock(&bg->lock);
spin_unlock(&space_info->lock);
- continue;
+ goto requeue;
}
reclaimed = bg->alloc_offset;
@@ -3250,12 +3250,28 @@ int btrfs_reset_unused_block_groups(struct btrfs_space_info *space_info, u64 num
btrfs_return_free_space(space_info, reclaimed);
spin_unlock(&space_info->lock);
+ btrfs_put_block_group(bg);
+
if (num_bytes <= reclaimed)
break;
num_bytes -= reclaimed;
+ continue;
+
+requeue:
+ list_add_tail(&bg->bg_list, &retry_list);
+
+ if (ret)
+ goto out;
}
- return 0;
+out:
+ if (!list_empty(&retry_list)) {
+ spin_lock(&fs_info->unused_bgs_lock);
+ list_splice_tail(&retry_list, &fs_info->unused_bgs);
+ spin_unlock(&fs_info->unused_bgs_lock);
+ }
+
+ return ret;
}
void btrfs_show_zoned_stats(struct btrfs_fs_info *fs_info, struct seq_file *seq)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0421/1005] btrfs: zoned: dont wait for ordered extents in do_zone_finish()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (419 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0420/1005] btrfs: zoned: requeue block group if zone reset bails out Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0422/1005] btrfs: zoned: fix lockdep splat on mount Greg Kroah-Hartman
` (577 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Naohiro Aota, Johannes Thumshirn,
David Sterba, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
[ Upstream commit bcad7df05237382237ad1517411721d839174009 ]
do_zone_finish() calls btrfs_wait_ordered_roots(), which holds
fs_info->ordered_operations_mutex while waiting for writeback. It can be
reached from writeback itself:
cow_file_range()
`-> btrfs_reserve_extent()
`-> find_free_extent()
`-> btrfs_zone_finish_one_bg()
`-> do_zone_finish()
If another task holds the mutex and waits for that writeback, this
deadlocks.
In general, we want to ensure all writes in the block group to
complete before finishing the zone, as relocation does. However, the
current callers do not need the wait (or cannot wait) in do_zone_finish():
- Relocation already waits for reservations and ordered extents itself
before calling btrfs_zone_finish().
- btrfs_delete_unused_bgs() checks that ->reserved is zero and sets the
block group read-only while holding groups_sem, so there can be no
in-flight data write.
- btrfs_zone_finish_one_bg() is called from the allocation path and
cannot wait.
Dropping the wait is still safe. Once the block group is read-only,
->reserved can only drop, and for data it only drops after the ordered
extent's I/O has completed. So if ->reserved is zero, no data write is
left in flight. If it is non-zero, do_zone_finish() returns -EAGAIN,
which all callers handle.
This makes btrfs_zone_finish_one_bg() fail with -EAGAIN when it races
with an allocation in the selected block group.
Fixes: 393f646e34c1 ("btrfs: zoned: finish least available block group on data bg allocation")
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index fbde21946a36d..a1e681d77e9a2 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2610,9 +2610,10 @@ static int do_zone_finish(struct btrfs_block_group *block_group, bool fully_writ
/* Ensure all writes in this block group finish */
btrfs_wait_block_group_reservations(block_group);
- /* No need to wait for NOCOW writers. Zoned mode does not allow that */
- btrfs_wait_ordered_roots(fs_info, U64_MAX, block_group);
- /* Wait for extent buffers to be written. */
+ /*
+ * No need to wait for NOCOW writers, as zoned mode does not
+ * allow that, only wait for extent buffers to be written.
+ */
if (is_metadata)
wait_eb_writebacks(block_group);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0422/1005] btrfs: zoned: fix lockdep splat on mount
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (420 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0421/1005] btrfs: zoned: dont wait for ordered extents in do_zone_finish() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0423/1005] btrfs: zstd: prevent leak of workspace below maximum level Greg Kroah-Hartman
` (576 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Naohiro Aota, Johannes Thumshirn,
David Sterba, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
[ Upstream commit 04df03585f0d8ef2727e043119bba2cdfac2d8d7 ]
When mounting a filesystem on a zoned drive passed into a VM via a
virtio-blk disk lockdep sporadically complains about a possible deadlock
between BTRFS' dev_replace::rwsem and virtio-blk's vdev_mutex:
======================================================
WARNING: possible circular locking dependency detected
7.3.0-rc6+ #317 Not tainted
------------------------------------------------------
mount/7418 is trying to acquire lock:
ffff888102c07860 (&vblk->vdev_mutex){+.+.}-{4:4}, at: virtblk_report_zones+0xda/0x440
but task is already holding lock:
ffff8881fd725ea8 (&fs_info->dev_replace.rwsem){++++}-{4:4}, at: btrfs_load_block_group_zone_info+0x186/0xe50
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #4 (&fs_info->dev_replace.rwsem){++++}-{4:4}:
down_read+0x42/0x170
btrfs_map_block+0x1a6/0xe70
btrfs_submit_bbio+0x1a3/0x910
submit_one_bio+0x93/0xd0
btrfs_readahead+0x1c4/0x200
read_pages+0x56/0x200
page_cache_ra_order+0x27c/0x410
filemap_get_pages+0x12f/0x4a0
filemap_read+0xed/0x400
vfs_read+0x240/0x340
ksys_read+0x61/0xd0
do_syscall_64+0xa3/0x4f0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
-> #3 (mapping.invalidate_lock#3){++++}-{4:4}:
down_read+0x42/0x170
filemap_fault+0xb0/0x1a40
__do_fault+0x34/0xc0
__handle_mm_fault+0x919/0x1db0
handle_mm_fault+0x97/0x240
do_user_addr_fault+0x21d/0x690
exc_page_fault+0x8e/0x230
asm_exc_page_fault+0x26/0x30
-> #2 (vm_lock){++++}-{0:0}:
__vma_start_exclude_readers+0x91/0x1b0
__vma_start_write+0x47/0xd0
vma_expand+0x4c/0x2a0
relocate_vma_down+0x126/0x200
setup_arg_pages+0x240/0x3e0
load_elf_binary+0x1be/0x1860
bprm_execve+0x2d2/0x7b0
kernel_execve+0x107/0x130
kernel_init+0xc2/0x130
ret_from_fork+0x1ff/0x2f0
ret_from_fork_asm+0x1a/0x30
-> #1 (&mm->mmap_lock){++++}-{4:4}:
__might_fault+0x68/0xa0
_copy_to_user+0x22/0x70
blkdev_copy_zone_to_user+0x22/0x40
virtblk_report_zones+0x297/0x440
blkdev_report_zones_ioctl+0xfd/0x130
blkdev_ioctl+0x20f/0x2c0
__x64_sys_ioctl+0x86/0xd0
do_syscall_64+0xa3/0x4f0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
-> #0 (&vblk->vdev_mutex){+.+.}-{4:4}:
__lock_acquire+0x15a8/0x2850
lock_acquire+0xea/0x2f0
__mutex_lock+0xa7/0x10d0
virtblk_report_zones+0xda/0x440
blkdev_report_zones_cached+0x162/0x190
btrfs_get_dev_zones+0xdc/0x2c0
btrfs_load_block_group_zone_info+0x2b6/0xe50
btrfs_read_block_groups+0x338/0xc80
open_ctree+0x1aca/0x24b3
btrfs_get_tree.cold+0x105/0x26c
vfs_get_tree+0x28/0xb0
__do_sys_fsconfig+0x324/0x690
do_syscall_64+0xa3/0x4f0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
other info that might help us debug this:
Chain exists of:
&vblk->vdev_mutex --> mapping.invalidate_lock#3 --> &fs_info->dev_replace.rwsem
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
rlock(&fs_info->dev_replace.rwsem);
lock(mapping.invalidate_lock#3);
lock(&fs_info->dev_replace.rwsem);
lock(&vblk->vdev_mutex);
*** DEADLOCK ***
locks held by mount/7418: 3, last CPU#0:
#0: ffff888110aa6868 (&fc->uapi_mutex){+.+.}-{4:4}, at: __do_sys_fsconfig+0x2ae/0x690
#1: ffff888112ba20e8 (&type->s_umount_key#31/1){+.+.}-{4:4}, at: sget_fc+0x148/0x8d0
#2: ffff8881fd725ea8 (&fs_info->dev_replace.rwsem){++++}-{4:4}, at: btrfs_load_block_group_zone_info+0x186/0xe50
Holding the rwsem was widened in 0090d6e1b210 ("btrfs: zoned: fix
use-after-free due to race with dev replace"), but it now also covers
calling into blkdev_report_zones_cached(). The device replace ioctl()
only works on a mounted filesystem and the only caller with setting
'new' to false is read_one_block_group() which is only called during
mount, so it is safe to drop the rwsem before calling into
blkdev_report_zones_cached().
Fixes: 0090d6e1b210 ("btrfs: zoned: fix use-after-free due to race with dev replace")
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index a1e681d77e9a2..40eb564993467 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1393,11 +1393,13 @@ static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx,
return 0;
}
+ ASSERT(!test_bit(BTRFS_FS_OPEN, &fs_info->flags));
+ up_read(&dev_replace->rwsem);
+
nofs_flag = memalloc_nofs_save();
ret = btrfs_get_dev_zone(device, info->physical, &zone);
memalloc_nofs_restore(nofs_flag);
if (ret) {
- up_read(&dev_replace->rwsem);
if (ret != -EIO && ret != -EOPNOTSUPP)
return ret;
info->alloc_offset = WP_MISSING_DEV;
@@ -1409,7 +1411,6 @@ static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx,
"zoned: unexpected conventional zone %llu on device %s (devid %llu)",
zone.start << SECTOR_SHIFT, rcu_dereference(device->name),
device->devid);
- up_read(&dev_replace->rwsem);
return -EIO;
}
@@ -1437,8 +1438,6 @@ static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx,
break;
}
- up_read(&dev_replace->rwsem);
-
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0423/1005] btrfs: zstd: prevent leak of workspace below maximum level
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (421 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0422/1005] btrfs: zoned: fix lockdep splat on mount Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0424/1005] btrfs: handle zero num_stripes in btrfs_chunk_item_size() Greg Kroah-Hartman
` (575 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 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 bb66a38f5812f2c04abd4eb6e586a12b5a95172a ]
When putting a workspace we always protect the workspace for the maximum
level from reclaim, since it can be used not just for that level but as
well for any level below it. However the logic is flawed because if we do
the put for a workspace at level 10 for example (maximum is level 15) and
there is currently no idle workspace for the maximum level because all
are currently being used, we don't add the workspace to the LRU list and
that can result in leaking it if we don't get more compression or
decompression requests for level 10 or any level below 10.
Fix this by skipping the addition to the LRU list only if the level of
the workspace matches the maximum level too (besides the list of idle
workspaces for the maximum level being empty).
Fixes: 3f93aef535c8 ("btrfs: add zstd compression level support")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zstd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c
index 58d9ff76fe07b..082f653464c8e 100644
--- a/fs/btrfs/zstd.c
+++ b/fs/btrfs/zstd.c
@@ -347,7 +347,8 @@ void zstd_put_workspace(struct btrfs_fs_info *fs_info, struct list_head *ws)
/* A node is only taken off the lru if we are the corresponding level */
if (clip_level(workspace->req_level) == workspace->level) {
/* Hide a max level workspace from reclaim */
- if (list_empty(&zwsm->idle_ws[ZSTD_BTRFS_MAX_LEVEL - 1])) {
+ if (workspace->level == ZSTD_BTRFS_MAX_LEVEL - 1 &&
+ list_empty(&zwsm->idle_ws[ZSTD_BTRFS_MAX_LEVEL - 1])) {
INIT_LIST_HEAD(&workspace->lru_list);
} else {
workspace->last_used = jiffies;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0424/1005] btrfs: handle zero num_stripes in btrfs_chunk_item_size()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (422 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0423/1005] btrfs: zstd: prevent leak of workspace below maximum level Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0425/1005] tcp: rate limit receive queue collapsing Greg Kroah-Hartman
` (574 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Cheng Yongkang,
David Sterba, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
[ Upstream commit 8416012aa6e794a6464e073ab236f4ff862935ac ]
validate_sys_chunk_array() calls btrfs_chunk_item_size() with the
on-disk num_stripes before btrfs_check_chunk_valid() has checked the
chunk. With CONFIG_BTRFS_ASSERT=y, a zero-stripe system chunk trips
ASSERT(num_stripes) instead of being rejected:
assertion failed: num_stripes, in fs/btrfs/volumes.h:714
kernel BUG at fs/btrfs/volumes.h:714!
RIP: 0010:btrfs_validate_super+0x3ce7/0x4210
Call Trace:
open_ctree
btrfs_get_tree
vfs_get_tree
do_new_mount
Drop the assertion and compute the size as the chunk header plus
num_stripes stripes. The size is unchanged for num_stripes > 0, and a
zero-stripe chunk now reaches btrfs_check_chunk_valid(), which rejects
it, so the mount fails with -EUCLEAN.
Suggested-by: Qu Wenruo <wqu@suse.com>
Link: https://lore.kernel.org/linux-btrfs/d2ee0cc1-674e-4447-88da-d346122a43a4@suse.com/
Fixes: 2a9bb78cfd36 ("btrfs: validate system chunk array at btrfs_validate_super()")
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
[ Slightly rework the commit message. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/volumes.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 0415d74cad9ba..e516c874f349a 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -711,9 +711,8 @@ static inline enum btrfs_map_op btrfs_op(const struct bio *bio)
static inline unsigned long btrfs_chunk_item_size(int num_stripes)
{
- ASSERT(num_stripes);
- return sizeof(struct btrfs_chunk) +
- sizeof(struct btrfs_stripe) * (num_stripes - 1);
+ return offsetof(struct btrfs_chunk, stripe) +
+ sizeof(struct btrfs_stripe) * num_stripes;
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0425/1005] tcp: rate limit receive queue collapsing
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (423 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0424/1005] btrfs: handle zero num_stripes in btrfs_chunk_item_size() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0426/1005] ASoC: es9356: fix the capture gain dB scale Greg Kroah-Hartman
` (573 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Eric Dumazet,
Willem de Bruijn, Kuniyuki Iwashima, Neal Cardwell,
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 c2213d9b61c1d6e99645a636630ee767c7542f78 ]
When a socket is over its receive buffer limit and its sk_rcvbuf can
not grow, every incoming segment that needs memory goes through
tcp_prune_queue(), which runs tcp_collapse_ofo_queue() and tcp_collapse()
on the receive queue. Both walk their whole queue, even when there is
nothing left to collapse.
A peer can trigger this walk per packet, without refilling memory:
1) The segment lands last in the out-of-order queue. Since commit
b0e01253a764 ("tcp: refine tcp_prune_ofo_queue() logic"),
tcp_prune_ofo_queue() drops nothing, the segment is dropped and
the queues are unchanged. The peer can send it again forever.
2) The segment lands second to last: one skb is pruned, and one small
segment fills that space again.
3) The out-of-order queue is empty and the receive queue alone is over
the limit (application not reading). Collapsing frees nothing,
the out-of-order segment is dropped, and the window is not closed.
4) Collapsing frees just one skb, enough to queue the segment. The next
segment is over the limit again.
Only allow a collapse if at least 1/8 of sk_rcvbuf of new memory was
queued in the receive queues since the previous collapse. This restores
the "12.5 % of the queue capacity" amortization of the 2018 SegmentSmack
fixes (CVE-2018-5390), using the same unit as the sk_rcvbuf limit, so
that peers sending small (bloated) segments are not penalized.
The credit is the net growth of sk_rmem_alloc in tcp_queue_rcv() and
tcp_data_queue_ofo(), so that:
- Coalescing a segment into the tailroom of the previous skb charges no
memory, and earns no credit.
- An out-of-order segment replacing or covering queued skbs only earns
the memory it adds.
- Duplicates earn nothing.
- Data moved from the out-of-order queue to the receive queue
(tcp_ofo_queue()) is not credited twice.
In-order data is credited too, so that a receive queue filled by
bloated in-order segments can still be collapsed when a hole appears.
In-order segments are rate limited as well: a peer could otherwise send
small in-order segments that each trigger a collapse freeing a single
skb, enough to queue the segment, while the out-of-order queue holds
many skbs that can not be collapsed.
The credit is tracked in a new u32 tp->rcv_collapse_credit, placed in a
hole of the tcp_sock_write_rx group: no other field moves, and tcp_sock
size is unchanged. tcp_queue_rcv() now samples sk_rmem_alloc, and
writes the credit until it saturates at sk_rcvbuf, so that the fast path
stops writing it after a full buffer of new memory. Saturating at the
goal would not work: sk_rcvbuf, and the goal with it, can grow later
(for instance in tcp_clamp_window(), just before the goal is checked),
and a socket over its limit can not earn more credit until the
application reads.
When collapsing is not allowed, tcp_prune_queue() goes directly to
tcp_prune_ofo_queue(), which is cheap in the cases above.
A regular flow can see a difference when it goes over its limit before
1/8 of sk_rcvbuf of new memory was queued since the previous collapse:
out-of-order skbs can be pruned (even for an in-order segment filling a
hole), and an in-order segment that still does not fit is dropped,
with a zero window advertised, where a collapse might have made room.
Fixes: b0e01253a764 ("tcp: refine tcp_prune_ofo_queue() logic")
Reported-by: Chris Mason <mason@kernel.org>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20261105124043.1543405-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../networking/net_cachelines/tcp_sock.rst | 1 +
include/linux/tcp.h | 1 +
net/ipv4/tcp.c | 2 +
net/ipv4/tcp_input.c | 55 +++++++++++++++----
4 files changed, 48 insertions(+), 11 deletions(-)
diff --git a/Documentation/networking/net_cachelines/tcp_sock.rst b/Documentation/networking/net_cachelines/tcp_sock.rst
index 0f6088c4ab8bb..fc3fa0b16393e 100644
--- a/Documentation/networking/net_cachelines/tcp_sock.rst
+++ b/Documentation/networking/net_cachelines/tcp_sock.rst
@@ -106,6 +106,7 @@ u32[3] received_ecn_bytes read_mostly read_w
u8:4 received_ce_pending read_mostly read_write
u32[3] delivered_ecn_bytes read_write
u16 pkts_acked_ewma read_write
+u32 rcv_collapse_credit read_write tcp_queue_rcv,tcp_data_queue_ofo,tcp_prune_queue
u8:2 syn_ect_snt write_mostly read_write
u8:2 syn_ect_rcv read_mostly read_write
u8:2 accecn_minlen write_mostly read_write
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 647b585e1cf94..cc538c71fc85b 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -356,6 +356,7 @@ struct tcp_sock {
u32 rcv_rtt_last_tsecr;
u32 delivered_ecn_bytes[3];
u16 pkts_acked_ewma;/* Pkts acked EWMA for AccECN cep heuristic */
+ u32 rcv_collapse_credit; /* memory queued since last collapse */
struct {
u32 rtt_us;
u32 seq;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 49eccd16776f8..f88548e10f2a8 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3492,6 +3492,7 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->rx_opt.dsack = 0;
tp->rx_opt.num_sacks = 0;
tp->rcv_ooopack = 0;
+ tp->rcv_collapse_credit = 0;
/* Clean up fastopen related fields */
@@ -5306,6 +5307,7 @@ static void __init tcp_struct_check(void)
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_rx, rcv_rtt_last_tsecr);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_rx, delivered_ecn_bytes);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_rx, pkts_acked_ewma);
+ CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_rx, rcv_collapse_credit);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_rx, rcv_rtt_est);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_write_rx, rcvq_space);
}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 6453815b03b4a..ce8ac1d1cd0c7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5384,6 +5384,20 @@ static int tcp_try_rmem_schedule(struct sock *sk, const struct sk_buff *skb,
return 0;
}
+/* Credit the memory added to the receive queues since @rmem was sampled
+ * toward the next allowed collapse. Saturate at sk_rcvbuf, not at the goal
+ * checked in tcp_prune_queue(): sk_rcvbuf (and the goal) can grow later,
+ * for instance in tcp_clamp_window().
+ */
+static void tcp_collapse_credit_add(struct sock *sk, int rmem)
+{
+ struct tcp_sock *tp = tcp_sk(sk);
+ int delta = atomic_read(&sk->sk_rmem_alloc) - rmem;
+
+ if (delta > 0 && tp->rcv_collapse_credit < (u32)sk->sk_rcvbuf)
+ tp->rcv_collapse_credit += delta;
+}
+
static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -5391,6 +5405,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
struct sk_buff *skb1;
u32 seq, end_seq;
bool fragstolen;
+ int rmem;
tcp_save_lrcv_flowlabel(sk, skb);
tcp_data_ecn_check(sk, skb);
@@ -5401,6 +5416,8 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
tcp_drop_reason(sk, skb, SKB_DROP_REASON_PROTO_MEM);
return;
}
+ /* Sampled after tcp_try_rmem_schedule(), which can prune. */
+ rmem = atomic_read(&sk->sk_rmem_alloc);
tcp_measure_rcv_mss(sk, skb);
/* Disable header prediction. */
@@ -5530,6 +5547,10 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
skb_condense(skb);
skb_set_owner_r(skb, sk);
}
+ /* Net growth: coalescing can charge nothing, and covered skbs
+ * were freed.
+ */
+ tcp_collapse_credit_add(sk, rmem);
/* do not grow rcvbuf for not-yet-accepted or orphaned sockets. */
if (sk->sk_socket)
tcp_rcvbuf_grow(sk, tp->rcvq_space.space);
@@ -5538,8 +5559,9 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
static int __must_check tcp_queue_rcv(struct sock *sk, struct sk_buff *skb,
bool *fragstolen)
{
- int eaten;
+ int rmem = atomic_read(&sk->sk_rmem_alloc);
struct sk_buff *tail = skb_peek_tail(&sk->sk_receive_queue);
+ int eaten;
eaten = (tail &&
tcp_try_coalesce(sk, tail,
@@ -5549,6 +5571,7 @@ static int __must_check tcp_queue_rcv(struct sock *sk, struct sk_buff *skb,
tcp_add_receive_queue(sk, skb);
skb_set_owner_r(skb, sk);
}
+ tcp_collapse_credit_add(sk, rmem);
return eaten;
}
@@ -6018,18 +6041,28 @@ static int tcp_prune_queue(struct sock *sk, const struct sk_buff *in_skb)
if (tcp_can_ingest(sk, in_skb))
return 0;
- tcp_collapse_ofo_queue(sk);
- if (!skb_queue_empty(&sk->sk_receive_queue))
- tcp_collapse(sk, &sk->sk_receive_queue, NULL,
- skb_peek(&sk->sk_receive_queue),
- NULL,
- tp->copied_seq, tp->rcv_nxt);
+ /* Collapsing walks both queues and is expensive, and can free
+ * almost nothing. Require at least 1/8 of sk_rcvbuf of new memory
+ * in the receive queues since the previous collapse, otherwise
+ * a stream of segments could trigger one collapse per packet.
+ */
+ if (tp->rcv_collapse_credit >= (u32)sk->sk_rcvbuf >> 3) {
+ tp->rcv_collapse_credit = 0;
- if (tcp_can_ingest(sk, in_skb))
- return 0;
+ tcp_collapse_ofo_queue(sk);
+ if (!skb_queue_empty(&sk->sk_receive_queue))
+ tcp_collapse(sk, &sk->sk_receive_queue, NULL,
+ skb_peek(&sk->sk_receive_queue),
+ NULL,
+ tp->copied_seq, tp->rcv_nxt);
- /* Collapsing did not help, destructive actions follow.
- * This must not ever occur. */
+ if (tcp_can_ingest(sk, in_skb))
+ return 0;
+ }
+
+ /* Collapsing did not help (or was not allowed),
+ * destructive actions follow.
+ */
tcp_prune_ofo_queue(sk, in_skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0426/1005] ASoC: es9356: fix the capture gain dB scale
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (424 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0425/1005] tcp: rate limit receive queue collapsing Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0427/1005] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
` (572 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zachary Huang, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zachary Huang <zuzhenhuang365@gmail.com>
[ Upstream commit 412a061ebf8ce0d4d49fc7352dba8d641257b3a6 ]
The two capture gain controls are declared with a TLV step of 3 (FU33,
analog mic) and 6 (FU11, DMIC). The TLV step is expressed in 0.01 dB
units, so this advertises 0.03 dB and 0.06 dB per step: with a value
range of 0..10 and 0..3 the whole controls appear to span only 0.30 dB
and 0.18 dB.
The hardware steps are 3 dB and 6 dB, i.e. 0..30 dB and 0..18 dB.
Measured on a MECHREVO WUJIE 14SAH (ES9356 on SoundWire link 0) by
recording the same signal at all four FU11 settings:
FU11=0 rms 523 (-35.9 dBFS)
FU11=1 rms 1007 (-30.3 dBFS)
FU11=2 rms 2011 (-24.2 dBFS)
FU11=3 rms 3794 (-18.7 dBFS)
That is about +6 dB per step, matching the hardware definition rather
than the advertised 0.06 dB.
Because userspace (alsamixer, PipeWire/WirePlumber) derives the volume
from this TLV, the capture gain currently looks like a control without
any usable range, which is also why the default setting seems impossible
to raise from the desktop.
Fixes: 5d9cb740cd38 ("ASoC: es9356-sdca: Add ES9356 SDCA driver")
Assisted-by: LLM
Signed-off-by: Zachary Huang <zuzhenhuang365@gmail.com>
Link: https://patch.msgid.link/179398129782.44051.2897523393297405157@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/es9356.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/es9356.c b/sound/soc/codecs/es9356.c
index 80db0f2f4aef6..02c0c34c04546 100644
--- a/sound/soc/codecs/es9356.c
+++ b/sound/soc/codecs/es9356.c
@@ -59,8 +59,8 @@ static int es9356_sdw_component_probe(struct snd_soc_component *component)
}
static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -9600, 12, 0);
-static const DECLARE_TLV_DB_SCALE(amic_gain_tlv, 0, 3, 0);
-static const DECLARE_TLV_DB_SCALE(dmic_gain_tlv, 0, 6, 0);
+static const DECLARE_TLV_DB_SCALE(amic_gain_tlv, 0, 300, 0);
+static const DECLARE_TLV_DB_SCALE(dmic_gain_tlv, 0, 600, 0);
static const struct snd_kcontrol_new es9356_sdca_controls[] = {
SDCA_SINGLE_Q78_TLV("FU41 Left Playback Volume",
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0427/1005] NFSv4.1: retain MDS I/O until both thresholds are met
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (425 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0426/1005] ASoC: es9356: fix the capture gain dB scale Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0428/1005] NFS: honor UTIME_NOW atime with explicit mtime Greg Kroah-Hartman
` (571 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit eab627dcd18a18a44a2cbee47df3058d3637ba0d ]
When both size and I/O thresholds are configured,
pnfs_within_mdsthreshold() uses size && io to decide whether to
keep I/O on the MDS. Both variables indicate an unmet threshold,
so reaching only one threshold returns false and may trigger
pNFS layout acquisition while the other threshold remains unmet.
Use logical OR instead of AND to stay with MDS I/O until both
thresholds are met, as recommended by RFC 8881 Section 5.12.6.
The new RFC contains the same threshold selection rule as RFC
5661 which is referenced in function comment.
Fixes: d23d61c8d351 ("NFSv4.1 test the mdsthreshold hint parameters")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/pnfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 0d51be32b6380..ff85b82a1e222 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2071,7 +2071,7 @@ static bool pnfs_within_mdsthreshold(struct nfs_open_context *ctx,
break;
}
if (size_set && io_set) {
- if (size && io)
+ if (size || io)
ret = true;
} else if (size || io)
ret = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0428/1005] NFS: honor UTIME_NOW atime with explicit mtime
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (426 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0427/1005] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0429/1005] NFS: update ctime for atime-only UTIME_NOW requests Greg Kroah-Hartman
` (570 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 2ffcf17d26dabef5793aeadf75a23c595a72be08 ]
When utimensat() requests UTIME_NOW for atime and an explicit mtime,
the VFS sets ATTR_ATIME but not ATTR_ATIME_SET (as it should). The
delegated explicit-mtime path calls nfs_set_timestamps_to_ts(), which
skips atime, but nfs_setattr() then clears ATTR_ATIME, allowing the
syscall to succeed without updating atime.
The delegated explicit-mtime path already updates ctime locally.
The VFS also supplies the requested atime value in ia_atime,
even when ATTR_ATIME_SET is absent.
Check ATTR_ATIME instead of ATTR_ATIME_SET to also apply the
UTIME_NOW atime value supplied by the VFS.
Fixes: aba41e90aade ("NFSv4.2: fix setattr caching of TIME_[MODIFY|ACCESS]_SET when timestamps are delegated")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 3022454f7698a..4fa6c5547ab86 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -644,7 +644,7 @@ static void nfs_set_timestamps_to_ts(struct inode *inode, struct iattr *attr)
inode_maybe_inc_iversion(inode, updated);
cache_flags |= NFS_INO_INVALID_CTIME | NFS_INO_INVALID_MTIME;
}
- if (attr->ia_valid & ATTR_ATIME_SET) {
+ if (attr->ia_valid & ATTR_ATIME) {
inode_set_atime_to_ts(inode, attr->ia_atime);
cache_flags |= NFS_INO_INVALID_ATIME;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0429/1005] NFS: update ctime for atime-only UTIME_NOW requests
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (427 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0428/1005] NFS: honor UTIME_NOW atime with explicit mtime Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0430/1005] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
` (569 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit a38d7cc8c90f0d093550487c2905b51db0be1522 ]
When an NFS client holds a timestamp delegation, utimensat()
with atime set to UTIME_NOW and mtime set to UTIME_OMIT reaches
nfs_setattr() with ATTR_TIMES_SET but without ATTR_ATIME_SET.
There may be other paths that can reach here as well.
The delegated-atime fast path treats this as an implicit atime
update, clears ATTR_ATIME and returns success without updating
ctime.
Add check for ATTR_TIMES_SET along with ATTR_ATIME_SET (OR) so
explicit timestamp requests use the normal SETATTR path while
incidental atime updates can keep using the local shortcut.
Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 4fa6c5547ab86..cb414396063d4 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -740,7 +740,7 @@ nfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
} else if (nfs_have_delegated_atime(inode) &&
attr->ia_valid & ATTR_ATIME &&
!(attr->ia_valid & ATTR_MTIME)) {
- if (!(attr->ia_valid & ATTR_ATIME_SET)) {
+ if (!(attr->ia_valid & (ATTR_ATIME_SET | ATTR_TIMES_SET))) {
nfs_update_delegated_atime(inode);
attr->ia_valid &= ~ATTR_ATIME;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0430/1005] NFS: Fix inverted cross-directory rename check
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (428 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0429/1005] NFS: update ctime for atime-only UTIME_NOW requests Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0431/1005] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
` (568 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit b9d518902ff1969f93d2b4787951d98e50ab0181 ]
nfs_rename_is_unsafe_cross_dir() returns false for cross-directory
renames, causing nfs_rename() to skip nfs_sync_inode() even when
filehandles may expire on rename. Same-directory renames may instead
trigger unnecessary synchronization.
Current condition directly contradicts the function name/comments.
Return false for same-directory renames so cross-directory renames
reach the existing filehandle-volatility check. Keep the conservative
fallback unchanged..
Fixes: dcd21b609d4ab ("NFS: Avoid flushing data while holding directory locks in nfs_rename()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 71a342e9589f2..2bf5fa015b851 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2735,7 +2735,7 @@ static bool nfs_rename_is_unsafe_cross_dir(struct dentry *old_dentry,
{
struct nfs_server *server = NFS_SB(old_dentry->d_sb);
- if (old_dentry->d_parent != new_dentry->d_parent)
+ if (old_dentry->d_parent == new_dentry->d_parent)
return false;
if (server->fh_expire_type & NFS_FH_RENAME_UNSAFE)
return !(server->fh_expire_type & NFS_FH_NOEXPIRE_WITH_OPEN);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0431/1005] NFS: restore directory index when resuming readdir
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (429 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0430/1005] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0432/1005] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
` (567 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 89b91409b2342e7629b1271eba315a0f06495247 ]
nfs_readdir() restores the cached folio index and cookie when
resuming directory iteration, but leaves current_index at zero.
In 32-bit index mode, nfs_readdir_search_for_cookie() then
reports a folio-relative offset instead of the absolute entry
position.
Restore current_index from the saved logical folio index before
searching the cache.
This solution relies on the current behavior of
nfs_readdir_seek_next_array(), where folio_index advances by
one and current_index advances by nfs_readdir_array_maxentries()
for each full, nonterminal folio.
Fixes: f648022faa68e ("NFS: Convert readdir page cache to use a cookie based index")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/dir.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 2bf5fa015b851..ea95522f9c64b 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1253,6 +1253,8 @@ static int nfs_readdir(struct file *file, struct dir_context *ctx)
spin_lock(&file->f_lock);
desc->dir_cookie = dir_ctx->dir_cookie;
desc->folio_index = dir_ctx->page_index;
+ desc->current_index = (loff_t)desc->folio_index *
+ nfs_readdir_array_maxentries();
desc->last_cookie = dir_ctx->last_cookie;
desc->attr_gencount = dir_ctx->attr_gencount;
desc->eof = dir_ctx->eof;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0432/1005] SUNRPC: wake poll waiters when an empty pipe is unlinked
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (430 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0431/1005] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0433/1005] sunrpc: instantiate rpc_pipefs dentry before publishing it Greg Kroah-Hartman
` (566 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Jeff Layton, NeilBrown,
Anna Schumaker, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 702d55edc017632a0c39c1d4bdd579bdbadfd730 ]
When an empty rpc_pipefs pipe is unlinked, rpc_purge_list() returns
without waking the pipe wait queue. An existing epoll waiter can
remain blocked even though rpc_pipe_poll() reports EPOLLHUP and
EPOLLERR for the disconnected pipe.
Wake the wait queue after clearing RPC_I(inode)->pipe so existing
poll waiters are notified regardless of whether messages were purged.
Fixes: 9842ef3557ab ("SUNRPC: rpc_timeout_upcall_queue should not sleep")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/rpc_pipe.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 9d349cfbc4831..68b4e040a77d9 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -191,6 +191,7 @@ rpc_close_pipes(struct dentry *dentry)
cancel_delayed_work_sync(&pipe->queue_timeout);
rpc_inode_setowner(inode, NULL);
RPC_I(inode)->pipe = NULL;
+ wake_up(&RPC_I(inode)->waitq);
inode_unlock(inode);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0433/1005] sunrpc: instantiate rpc_pipefs dentry before publishing it
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (431 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0432/1005] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0434/1005] SUNRPC: preserve fatal network errors during RPC binding Greg Kroah-Hartman
` (565 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 0cd6e563938a5b2f88ce0008eda32f9617c9d81f ]
rpc_mkpipe_dentry() publishes pipe->dentry before
d_make_persistent() attaches its inode. A concurrent
rpc_queue_upcall() or rpc_timeout_upcall_queue() can
conceivably dereference the dentry while d_inode() is NULL.
Attach the inode before publishing the dentry, restoring the
ordering used before the rpc_pipefs conversion refactor.
Fixes: 946e2256775e ("convert rpc_pipefs")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/rpc_pipe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 68b4e040a77d9..f14cae2952804 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -666,8 +666,8 @@ int rpc_mkpipe_dentry(struct dentry *parent, const char *name,
rpci->private = private;
rpci->pipe = pipe;
rpc_inode_setowner(inode, private);
- pipe->dentry = dentry; // borrowed
d_make_persistent(dentry, inode);
+ pipe->dentry = dentry; // borrowed
fsnotify_create(dir, dentry);
simple_done_creating(dentry);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0434/1005] SUNRPC: preserve fatal network errors during RPC binding
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (432 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0433/1005] sunrpc: instantiate rpc_pipefs dentry before publishing it Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0435/1005] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
` (564 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 30150b94c70eff4bf916d7d367ecf75de25d5337 ]
call_bind_status() initializes status to -EIO. When an unbound
transport's port lookup fails with -ENETDOWN or -ENETUNREACH
and RPC_TASK_NETUNREACH_FATAL is set, the function exits the
switch without updating status. The RPC task then reports -EIO
instead of the network error.
This can occur during NFSv3 port discovery with nconnect,
when an additional transport has not yet bound.
Preserve task->tk_status in the fatal branch. Leave the nonfatal
retry handling unchanged.
Fixes: 9827144bfb2b ("NFS: Treat ENETUNREACH errors as fatal in containers")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 6cedc824cf826..73f8469767d32 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2125,8 +2125,10 @@ call_bind_status(struct rpc_task *task)
goto retry_timeout;
case -ENETDOWN:
case -ENETUNREACH:
- if (task->tk_flags & RPC_TASK_NETUNREACH_FATAL)
+ if (task->tk_flags & RPC_TASK_NETUNREACH_FATAL) {
+ status = task->tk_status;
break;
+ }
fallthrough;
case -ECONNREFUSED: /* connection problems */
case -ECONNRESET:
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0435/1005] SUNRPC: preserve timeout policy when cloning clients
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (433 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0434/1005] SUNRPC: preserve fatal network errors during RPC binding Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0436/1005] SUNRPC: preserve transport security " Greg Kroah-Hartman
` (563 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 5b0ac1f82201c2ab2d9c31ed568cc782bac6a399 ]
rpc_clone_client() and rpc_clone_client_set_auth() leave the
timeout argument unset, causing rpc_new_client() to use the
transport defaults instead of the parent's configured
timeout. This also affects pNFS data-server clients and
changes their request timeout and initial RTT calculations.
Use the parent's cl_timeout when no timeout is specified.
Preserve explicitly supplied timeout overrides.
Fixes: 1b63a75180c6 ("SUNRPC: Refactor rpc_clone_client()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 73f8469767d32..3d9d7c930f352 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -653,6 +653,8 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
}
args->servername = xprt->servername;
args->nodename = clnt->cl_nodename;
+ if (!args->timeout)
+ args->timeout = clnt->cl_timeout;
new = rpc_new_client(args, xps, xprt, clnt);
if (IS_ERR(new))
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0436/1005] SUNRPC: preserve transport security policy when cloning clients
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (434 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0435/1005] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0437/1005] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
` (562 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 7783534ce5fee57adf1b9025745c9af2e1ce2ccd ]
RPC client cloning does not copy the parent's transport security
policy into the new client. Clones consequently lose their TLS
policy and certificate/key serials, even though the shared
transport remains protected.
When NFSv4 migration replaces a cloned client's TLS transport, the
missing security policy causes xs_setup_tcp_tls() to return -EACCES.
Copy the parent's cl_xprtsec into the clone arguments before
creating the new client.
Fixes: 500053191297 ("SUNRPC: Plumb an API for setting transport layer security")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 3d9d7c930f352..ba6fdd70414db 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -653,6 +653,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
}
args->servername = xprt->servername;
args->nodename = clnt->cl_nodename;
+ args->xprtsec = clnt->cl_xprtsec;
if (!args->timeout)
args->timeout = clnt->cl_timeout;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0437/1005] SUNRPC: Balance switch queue length on transport removal
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (435 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0436/1005] SUNRPC: preserve transport security " Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0438/1005] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
` (561 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 8acd94f02a960c8936df25a7af9c02c8ea87064d ]
When call_connect_status() moves a task off a transport marked for
removal, it decrements xprt->queuelen but leaves the switch's
xps_queuelen unchanged. The stale count persists after the task
finishes and skews multipath transport selection.
Decrement xps_queuelen alongside xprt->queuelen, matching the normal
transport release path.
Fixes: 6f081693e7b2 ("sunrpc: remove an offlined xprt using sysfs")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index ba6fdd70414db..6fc36e516c1c6 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2262,6 +2262,7 @@ call_connect_status(struct rpc_task *task)
xprt_release(task);
value = atomic_long_dec_return(&xprt->queuelen);
+ atomic_long_dec(&xps->xps_queuelen);
if (value == 0)
rpc_xprt_switch_remove_xprt(xps, saved,
true);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0438/1005] SUNRPC: Balance queue accounting when relocating a task
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (436 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0437/1005] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0439/1005] NFS/localio: hold the client across an asynchronous LOCALIO probe Greg Kroah-Hartman
` (560 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit f14b157168ac106cfac6d577e08726488b1b886c ]
When rpc_task_set_transport() relocates a movable task from an
offline transport, it releases the request and drops the
transport reference without decrementing the old transport's
queuelen or the switch's xps_queuelen. Releasing the task
later only accounts for the replacement transport.
The stale counts affect transport selection and can prevent
xprt_delete_locked() from removing an otherwise idle transport.
Use rpc_task_release_xprt() to balance the previous assignment
before selecting a replacement. Pass clnt explicitly because
rpc_task_set_client() can assign a transport before tk_client
is initialized.
Fixes: 82ee41b85cef ("SUNRPC don't resend a task on an offlined transport")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/clnt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 6fc36e516c1c6..33e64c0225f37 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1197,7 +1197,7 @@ void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt)
(task->tk_flags & RPC_TASK_MOVEABLE)))
return;
xprt_release(task);
- xprt_put(task->tk_xprt);
+ rpc_task_release_xprt(clnt, task->tk_xprt);
}
if (task->tk_flags & RPC_TASK_NO_ROUND_ROBIN)
task->tk_xprt = rpc_task_get_first_xprt(clnt);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0439/1005] NFS/localio: hold the client across an asynchronous LOCALIO probe
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (437 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0438/1005] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0440/1005] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
` (559 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Snitzer, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@kernel.org>
[ Upstream commit 000a87910213562ff09f5bc38cd366ce34fccf71 ]
nfs_local_probe_async() queues the client's own cl_local_probe_work
without a reference on the client, and nfs_free_client() does not cancel
it. The work takes a reference only once it runs. If the last
nfs_put_client() comes first, for example at umount after an NFSv3 I/O
queued a throttled probe, the client is freed with its work queued, and
the work then runs on freed memory.
Take the reference when the work is queued, and drop it when the work
has run. If the work is already queued, it already holds a reference,
and the one just taken is dropped.
Fixes: 76d4cb6345da ("nfs: probe for LOCALIO when v4 client reconnects to server")
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/localio.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c
index cdada6cbb13bf..d5859e8c2a2a8 100644
--- a/fs/nfs/localio.c
+++ b/fs/nfs/localio.c
@@ -203,15 +203,22 @@ void nfs_local_probe_async_work(struct work_struct *work)
struct nfs_client *clp =
container_of(work, struct nfs_client, cl_local_probe_work);
- if (!refcount_inc_not_zero(&clp->cl_count))
- return;
nfs_local_probe(clp);
+ /* The reference nfs_local_probe_async() took for this work */
nfs_put_client(clp);
}
+/*
+ * The work is part of the client, so it holds a reference on the client
+ * from when it is queued until it has run: the last nfs_put_client()
+ * cannot free the client under a queued probe.
+ */
void nfs_local_probe_async(struct nfs_client *clp)
{
- queue_work(nfsiod_workqueue, &clp->cl_local_probe_work);
+ if (!refcount_inc_not_zero(&clp->cl_count))
+ return;
+ if (!queue_work(nfsiod_workqueue, &clp->cl_local_probe_work))
+ nfs_put_client(clp); /* already queued, with its reference */
}
EXPORT_SYMBOL_GPL(nfs_local_probe_async);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0440/1005] ublk: publish a new device by its id only once it is set up
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (438 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0439/1005] NFS/localio: hold the client across an asynchronous LOCALIO probe Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0441/1005] net: skbuff: preserve fclone lifetime when freeing stolen heads Greg Kroah-Hartman
` (558 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Korenberg, Ming Lei, Jens Axboe,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Korenberg <socketpair@gmail.com>
[ Upstream commit e5c463e5074a940c644d54d8fc29aba06709aab0 ]
ADD_DEV stores the device in ublk_index_idr when it allocates the id,
and control commands find it there as soon as ublk_add_chdev() has
initialized its struct device, before the char device is added. If
dev_set_name() or cdev_device_add() then fails, ublk_add_chdev() drops
the initial reference to free the device. A DEL_DEV that found the
device meanwhile waits for ublk_ctl_mutex, then calls ublk_remove():
cdev_device_del() of a device that was never added, and a second put of
the initial reference, which frees the device under the callers still
holding references.
Reserve the id with a NULL entry, which idr_find() and the idr iterators
skip, and store the device once ublk_add_chdev() succeeded.
Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver")
Signed-off-by: Mark Korenberg <socketpair@gmail.com>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Link: https://patch.msgid.link/20261105-ublk-del-gendisk-hang-v1-1-913a91a4314d@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/ublk_drv.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index cc4e72fd5d4df..8d3406147b96e 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -4403,14 +4403,18 @@ static int ublk_alloc_dev_number(struct ublk_device *ub, int idx)
int i = idx;
int err;
+ /*
+ * Only reserve the id: the device is published by
+ * ublk_publish_dev_number() once it is fully set up.
+ */
spin_lock(&ublk_idr_lock);
/* allocate id, if @id >= 0, we're requesting that specific id */
if (i >= 0) {
- err = idr_alloc(&ublk_index_idr, ub, i, i + 1, GFP_NOWAIT);
+ err = idr_alloc(&ublk_index_idr, NULL, i, i + 1, GFP_NOWAIT);
if (err == -ENOSPC)
err = -EEXIST;
} else {
- err = idr_alloc(&ublk_index_idr, ub, 0, UBLK_MAX_UBLKS,
+ err = idr_alloc(&ublk_index_idr, NULL, 0, UBLK_MAX_UBLKS,
GFP_NOWAIT);
}
spin_unlock(&ublk_idr_lock);
@@ -4421,6 +4425,19 @@ static int ublk_alloc_dev_number(struct ublk_device *ub, int idx)
return err;
}
+/*
+ * Make the device visible to control commands by its id. Before its char
+ * device is added, DEL_DEV could find it and remove a char device that was
+ * never added, and drop the reference that ublk_add_chdev() drops on
+ * failure.
+ */
+static void ublk_publish_dev_number(struct ublk_device *ub)
+{
+ spin_lock(&ublk_idr_lock);
+ WARN_ON_ONCE(idr_replace(&ublk_index_idr, ub, ub->ub_number) != NULL);
+ spin_unlock(&ublk_idr_lock);
+}
+
static void ublk_free_dev_number(struct ublk_device *ub)
{
spin_lock(&ublk_idr_lock);
@@ -4971,6 +4988,8 @@ static int ublk_ctrl_add_dev(const struct ublksrv_ctrl_cmd *header)
* ublk_add_chdev() will cleanup everything if it fails.
*/
ret = ublk_add_chdev(ub);
+ if (!ret)
+ ublk_publish_dev_number(ub);
goto out_unlock;
out_deinit_queues:
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0441/1005] net: skbuff: preserve fclone lifetime when freeing stolen heads
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (439 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0440/1005] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0442/1005] xsk: fix list corruption in xsk_buff_add_frag() Greg Kroah-Hartman
` (557 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 86706ffa990ecd46a4326f8eecbccbbd60a6cb8d ]
skb_morph() can give an skb from skbuff_fclone_cache a page-fragment
head without changing its fclone tag. IPv4 reassembly can produce such
an skb, which can subsequently reach the GRO stolen-head path.
napi_skb_free_stolen_head() puts the shell into the ordinary NAPI skb
cache without dropping its fclone_ref. If the embedded companion is
still live, KASAN poisons it along with the original, and later cache
reuse or eviction can overwrite or free the allocation underneath it.
A mirrored batman-adv DAT packet retained in a plug qdisc reproduces a
KASAN use-after-free in plug_dequeue().
Use kfree_skbmem() for fclones in napi_skb_free_stolen_head(), retaining
NAPI caching for ordinary skb heads. Also use kfree_skbmem() in
kfree_skb_partial(), whose stolen-head branch has the same assumption
about the allocation cache. This releases the shell according to its
allocation kind and preserves any live companion without freeing the
data that has been transferred to the receiving skb.
Fixes: f450d539c05a ("skbuff: introduce {,__}napi_build_skb() which reuses NAPI cache heads")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Link: https://patch.msgid.link/20261030042329.74461-1-kylebot@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/skbuff.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 0cd5f30ff9bbf..ac78f28daea31 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1504,6 +1504,10 @@ void napi_skb_free_stolen_head(struct sk_buff *skb)
skb_orphan(skb);
skb->slow_gro = 0;
}
+ if (skb->fclone != SKB_FCLONE_UNAVAILABLE) {
+ kfree_skbmem(skb);
+ return;
+ }
napi_skb_cache_put(skb);
}
@@ -6192,7 +6196,7 @@ void kfree_skb_partial(struct sk_buff *skb, bool head_stolen)
{
if (head_stolen) {
skb_release_head_state(skb);
- kmem_cache_free(net_hotdata.skbuff_cache, skb);
+ kfree_skbmem(skb);
} else {
__kfree_skb(skb);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0442/1005] xsk: fix list corruption in xsk_buff_add_frag()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (440 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0441/1005] net: skbuff: preserve fclone lifetime when freeing stolen heads Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0443/1005] i40e: xsk: fix xsk_buff_add_frag() error handling in Rx Greg Kroah-Hartman
` (556 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nagato Shiratana, Maciej Fijalkowski,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
[ Upstream commit 94ae1259175f566ed5a33f37b09b6f32a1b2d8af ]
In aligned mode, a fill ring address maps straight to its pool->heads[]
entry. If user space posts the same address twice, a driver can pass
xsk_buff_add_frag() a buffer that is the head of the frame or is
already on pool->xskb_list or pool->free_list.
Re-adding a linked node corrupts the list. With buffers A, B, C, B,
xsk_rcv_zc() emits two descriptors instead of four and leaves the list
head pointing at a self-linked B. When the Rx ring later has no room
for a frame, the xsk_buff_free() cleanup follows B into pool->free_list
and passes the list head to xp_free():
BUG: kernel NULL pointer dereference, address: 00000000000000c0
RIP: 0010:xp_free+0x1a/0x50
Call Trace:
xsk_rcv_zc+0xca/0x200
The head is not on any list and needs a separate check. Adding it as
its own frag lets bpf_xdp_adjust_tail() free the in-use head and wrap
sinfo->nr_frags to 255.
Reject such buffers before adding them to the frags array, as commit
e37b2abca804 ("xsk: fix NULL pointer dereference in __xsk_rcv()") does
in the copy path. Callers already drop the frame on failure.
Unaligned mode is not affected, as each fill ring entry gets its own
xskb from pool->free_heads[].
Reproduced with a KUnit test feeding synthetic buffers to xsk_rcv_zc(),
by Nagato Shiratana.
Fixes: 24ea50127ecf ("xsk: support mbuf on ZC RX")
Reported-by: Nagato Shiratana <zuomao338@gmail.com>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-2-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/xdp_sock_drv.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/include/net/xdp_sock_drv.h b/include/net/xdp_sock_drv.h
index d94aeb506379c..29965e3695983 100644
--- a/include/net/xdp_sock_drv.h
+++ b/include/net/xdp_sock_drv.h
@@ -160,15 +160,18 @@ static inline void xsk_buff_free(struct xdp_buff *xdp)
static inline bool xsk_buff_add_frag(struct xdp_buff *head,
struct xdp_buff *xdp)
{
+ struct xdp_buff_xsk *frag = container_of(xdp, struct xdp_buff_xsk, xdp);
const void *data = xdp->data;
- struct xdp_buff_xsk *frag;
+
+ /* Duplicate fill ring entries map to the same xskb in aligned mode */
+ if (unlikely(xdp == head || !list_empty(&frag->list_node)))
+ return false;
if (!__xdp_buff_add_frag(head, virt_to_netmem(data),
offset_in_page(data), xdp->data_end - data,
xdp->frame_sz, false))
return false;
- frag = container_of(xdp, struct xdp_buff_xsk, xdp);
list_add_tail(&frag->list_node, &frag->pool->xskb_list);
return true;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0443/1005] i40e: xsk: fix xsk_buff_add_frag() error handling in Rx
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (441 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0442/1005] xsk: fix list corruption in xsk_buff_add_frag() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0444/1005] ice: xsk: fix leaking Rx buffers in multi-buffer path Greg Kroah-Hartman
` (555 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
[ Upstream commit a259b7ec09efec032d5521dc2eb751a959c11d15 ]
When xsk_buff_add_frag() fails, i40e_clean_rx_irq_zc() frees the frame
but stays on the current descriptor, so the next poll restarts from the
freed head. If the frags array was full, the retry passes on a frame
missing the freed frags, with its head already on the free list. If the
buffer is a duplicate, every poll fails the same way and the queue
stalls.
Free the current buffer along with the frame and move on to the next
descriptor, as ice does. The rest of the dropped frame is received as
a new frame. xp_free() skips a duplicate already freed with the frame.
Fixes: 1c9ba9c14658 ("i40e: xsk: add RX multi-buffer support")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-3-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
index 9f47388eaba53..624f85851a7d1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
@@ -459,16 +459,24 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)
xsk_buff_set_size(bi, size);
xsk_buff_dma_sync_for_cpu(bi);
- if (!first)
+ if (++next_to_process == count)
+ next_to_process = 0;
+
+ if (!first) {
first = bi;
- else if (!xsk_buff_add_frag(first, bi)) {
+ } else if (!xsk_buff_add_frag(first, bi)) {
+ /* Drop what has been gathered so far. xp_free() skips
+ * @bi if it duplicates a buffer that is already on a
+ * pool list. Remaining buffers of this packet, if any,
+ * will be processed as a new packet.
+ */
xsk_buff_free(first);
- break;
+ xsk_buff_free(bi);
+ next_to_clean = next_to_process;
+ first = NULL;
+ continue;
}
- if (++next_to_process == count)
- next_to_process = 0;
-
if (i40e_is_non_eop(rx_ring, rx_desc))
continue;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0444/1005] ice: xsk: fix leaking Rx buffers in multi-buffer path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (442 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0443/1005] i40e: xsk: fix xsk_buff_add_frag() error handling in Rx Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0445/1005] ice: xsk: do not free in-flight frags on XDP_TX completion Greg Kroah-Hartman
` (554 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
[ Upstream commit 8b7bd01b9c56c0d1f65d0e2ad304b775e0d709e3 ]
ice_clean_rx_irq_zc() consumes a descriptor without freeing its buffer
when a frag has zero length or when xsk_buff_add_frag() fails, which
happens if the frags array is full or the fill ring has duplicates.
Such buffers are lost to user space until the socket is closed.
Free the buffer in both cases. xp_free() skips a duplicate already
freed with the frame.
Fixes: 1bbc04de607b ("ice: xsk: add RX multi-buffer support")
Fixes: 93f53db9f9dc ("ice: switch to Page Pool")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-4-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_xsk.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index 0643017541c35..ea8ac0fcdf6ef 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -618,8 +618,11 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
if (!first) {
first = xdp;
- } else if (likely(size) && !xsk_buff_add_frag(first, xdp)) {
+ } else if (unlikely(!size)) {
+ xsk_buff_free(xdp);
+ } else if (!xsk_buff_add_frag(first, xdp)) {
xsk_buff_free(first);
+ xsk_buff_free(xdp);
first = NULL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0445/1005] ice: xsk: do not free in-flight frags on XDP_TX completion
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (443 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0444/1005] ice: xsk: fix leaking Rx buffers in multi-buffer path Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0446/1005] libeth: " Greg Kroah-Hartman
` (553 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
[ Upstream commit 5a9b5e315e101dfa02af5d8d3b27d893ba3e5566 ]
ice_xmit_xdp_tx_zc() takes the frags of a multi-buffer frame off
pool->xskb_list but leaves XDP_FLAGS_HAS_FRAGS set on the head. When
the head completes, xsk_buff_free() frees whatever is on the list at
that point, which are the frags of a frame still being received.
If ice_xmit_xdp_tx_zc() completes such a head while cleaning the ring
before sending another frame, xsk_buff_get_frag() returns NULL and
xsk_buff_xdp_get_dma() dereferences it.
Clear the flag on the head once its frags are on the ring. As
xdp_get_buff_len() then covers only the head, count Rx bytes before
running the XDP program, like libeth does.
Fixes: eeb2b5381038 ("ice: xsk: Tx multi-buffer support")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-5-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_xsk.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index ea8ac0fcdf6ef..bf14ed8f87a3b 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -493,6 +493,11 @@ static int ice_xmit_xdp_tx_zc(struct xdp_buff *xdp,
tx_desc->cmd_type_offset_bsz |=
cpu_to_le64(ICE_TX_DESC_CMD_EOP << ICE_TXD_QW1_CMD_S);
+ /* Each frag is now freed via its own Tx buffer. Completing the head
+ * must not release what is on the pool's frag list at that time.
+ */
+ xdp_buff_clear_frags_flag(head);
+
return ICE_XDP_TX;
busy:
@@ -592,6 +597,7 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
struct sk_buff *skb;
u16 stat_err_bits;
u16 vlan_tci;
+ u32 xdp_len;
rx_desc = ICE_RX_DESC(rx_ring, ntc);
@@ -634,6 +640,7 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
((struct libeth_xdp_buff *)first)->desc = rx_desc;
+ xdp_len = xdp_get_buff_len(first);
xdp_res = ice_run_xdp_zc(rx_ring, first, xdp_prog, xdp_ring,
xsk_pool);
if (likely(xdp_res & (ICE_XDP_TX | ICE_XDP_REDIR))) {
@@ -648,7 +655,7 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring,
goto construct_skb;
}
- total_rx_bytes += xdp_get_buff_len(first);
+ total_rx_bytes += xdp_len;
total_rx_packets++;
first = NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0446/1005] libeth: xsk: do not free in-flight frags on XDP_TX completion
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (444 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0445/1005] ice: xsk: do not free in-flight frags on XDP_TX completion Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0447/1005] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
` (552 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
[ Upstream commit 90e5d84086d95ac45197028b98ad9059b245fc1c ]
libeth_xsk_tx_queue_bulk() takes the frags of a multi-buffer frame off
pool->xskb_list but leaves XDP_FLAGS_HAS_FRAGS set on the head. When
the head completes, libeth_xsk_buff_free_slow() frees whatever is on
the list at that point.
The XDPSQ can be completed by a bulk flush while the frags of a frame
are being queued, or by its cleanup timer while a partial Rx frame is
stashed. Those frags are then freed while in use, and the frame being
queued is sent truncated.
Clear the flag on the head once all of its frags are queued.
Fixes: b3ad8450b4dc ("libeth: xsk: add XSk XDP_TX sending helpers")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-6-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/libeth/xsk.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/net/libeth/xsk.h b/include/net/libeth/xsk.h
index a452b7828ce4e..249b1c7407881 100644
--- a/include/net/libeth/xsk.h
+++ b/include/net/libeth/xsk.h
@@ -77,11 +77,17 @@ libeth_xsk_tx_queue_bulk(struct libeth_xdp_tx_bulk *bq,
if (!libeth_xsk_tx_queue_head(bq, xdp))
goto out;
- for (const struct libeth_xdp_buff *head = xdp; ; ) {
+ for (struct libeth_xdp_buff *head = xdp; ; ) {
xdp = container_of(xsk_buff_get_frag(&head->base),
typeof(*xdp), base);
- if (!xdp)
+ if (!xdp) {
+ /* Each frag is now freed via its own SQE. Freeing
+ * the head must not release what is on the pool's
+ * frag list at that time.
+ */
+ xdp_buff_clear_frags_flag(&head->base);
break;
+ }
if (unlikely(bq->count == LIBETH_XDP_TX_BULK) &&
unlikely(!flush_bulk(bq, LIBETH_XDP_TX_XSK))) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0447/1005] i40e: xsk: fix multi-buffer XDP_PASS skb construction
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (445 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0446/1005] libeth: " Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0448/1005] ice: xsk: free stashed Rx frame when cleaning the ring Greg Kroah-Hartman
` (551 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chenguang Zhao, Aleksandr Loktionov,
Jason Xing, Maciej Fijalkowski, Patryk Holda, Tony Nguyen,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chenguang Zhao <zhaochenguang@kylinos.cn>
[ Upstream commit 76b41e83e69ae4ab23cc3535e36b780ea17e76c2 ]
When AF_XDP ZC receives a multi-buffer frame and the XDP program
returns XDP_PASS, i40e_construct_skb_zc() copies frags into a new
skb. The copy used skb_frag_page() as the memcpy source (page
metadata instead of packet data) and passed a virtual address to
__skb_fill_page_desc_noacc(), which expects a struct page *.
Use skb_frag_address() for the copy, attach frags with
skb_add_rx_frag() so len/data_len/truesize are updated, and on
dev_alloc_page() failure free the skb via the shared out path so
xsk_buff_free() still runs and previously attached pages are
released by kfree_skb.
Fixes: 1c9ba9c14658 ("i40e: xsk: add RX multi-buffer support")
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Patryk Holda <patryk.holda@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-8-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
index 624f85851a7d1..e48fee2a4229e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
@@ -318,22 +318,19 @@ static struct sk_buff *i40e_construct_skb_zc(struct i40e_ring *rx_ring,
goto out;
for (int i = 0; i < nr_frags; i++) {
- struct skb_shared_info *skinfo = skb_shinfo(skb);
skb_frag_t *frag = &sinfo->frags[i];
+ unsigned int frag_size = skb_frag_size(frag);
struct page *page;
- void *addr;
page = dev_alloc_page();
if (!page) {
dev_kfree_skb(skb);
- return NULL;
+ skb = NULL;
+ goto out;
}
- addr = page_to_virt(page);
- memcpy(addr, skb_frag_page(frag), skb_frag_size(frag));
-
- __skb_fill_page_desc_noacc(skinfo, skinfo->nr_frags++,
- addr, 0, skb_frag_size(frag));
+ memcpy(page_to_virt(page), skb_frag_address(frag), frag_size);
+ skb_add_rx_frag(skb, i, page, 0, frag_size, PAGE_SIZE);
}
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0448/1005] ice: xsk: free stashed Rx frame when cleaning the ring
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (446 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0447/1005] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0449/1005] idpf: free stashed XSk Rx frame when releasing the queue Greg Kroah-Hartman
` (550 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
[ Upstream commit d5e7a86b7cd6c38a628635baace7eb2fdce14a43 ]
ice_clean_rx_irq_zc() stashes a partially received multi-buffer frame
in rx_ring->xsk, with its frags on pool->xskb_list. next_to_clean is
already past its buffers, so ice_xsk_clean_rx_ring(), which walks
next_to_clean..next_to_use, misses the frame, and ice_vsi_cfg_rxq()
later clears the pointer via ring->xdp.data.
The buffers are lost to user space and, as the pool outlives the ring
across ifdown/ifup or a reset, the stale frags are taken as frags of
the next frame. Before commit 93f53db9f9dc ("ice: switch to Page
Pool"), the frame was tracked by rx_ring->first_desc and leaked the
same way.
Free the stashed frame when cleaning the ring.
Fixes: 1bbc04de607b ("ice: xsk: add RX multi-buffer support")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-9-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_xsk.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index bf14ed8f87a3b..0c1ce3e86a45b 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -912,6 +912,11 @@ void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring)
if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
+ if (rx_ring->xsk) {
+ xsk_buff_free(&rx_ring->xsk->base);
+ rx_ring->xsk = NULL;
+ }
+
while (ntc != ntu) {
struct xdp_buff *xdp = *ice_xdp_buf(rx_ring, ntc);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0449/1005] idpf: free stashed XSk Rx frame when releasing the queue
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (447 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0448/1005] ice: xsk: free stashed Rx frame when cleaning the ring Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0450/1005] net: usb: lan78xx: resume phylink on non-reset USB resume Greg Kroah-Hartman
` (549 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Björn Töpel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
[ Upstream commit 3cbee39da8251098e2631a106fafcaebc7c8e66b ]
idpf_xskrq_poll() stashes a partially received multi-buffer frame in
rxq->xsk, with its frags on pool->xskb_list. Nothing frees or clears
rxq->xsk on queue release, as idpf_rx_desc_rel() only returns the page
stash sharing its storage for non-XSk queues.
On ifdown, the buffers are lost to user space and, as the pool outlives
the queue, the stale frags are taken as frags of the next frame. If the
pool is disabled on a running interface, the queue restarts in page
mode with rxq->xdp.data still pointing to an xskb of the pool, which is
freed later. The page path then takes it for a partial frame, writes
frag info through it and returns it to a page pool.
Free the stashed frame and clear the pointer when the XSk state of the
queue is cleared, while the pool is still attached.
Fixes: 9705d6552f58 ("idpf: implement Rx path for AF_XDP")
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20261102124950.958345-10-maciej.fijalkowski@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/idpf/xsk.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/intel/idpf/xsk.c b/drivers/net/ethernet/intel/idpf/xsk.c
index d95d3efdfd36f..5a0a1d8a7a866 100644
--- a/drivers/net/ethernet/intel/idpf/xsk.c
+++ b/drivers/net/ethernet/intel/idpf/xsk.c
@@ -134,6 +134,11 @@ void idpf_xsk_clear_queue(void *q, enum virtchnl2_queue_type type)
if (!idpf_queue_has_clear(XSK, rxq))
return;
+ if (rxq->xsk) {
+ libeth_xsk_buff_free_slow(rxq->xsk);
+ rxq->xsk = NULL;
+ }
+
rxq->pool = NULL;
break;
case VIRTCHNL2_QUEUE_TYPE_RX_BUFFER:
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0450/1005] net: usb: lan78xx: resume phylink on non-reset USB resume
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (448 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0449/1005] idpf: free stashed XSk Rx frame when releasing the queue Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0451/1005] net: raw: fix ICMP unreachable sent when receive queue is full Greg Kroah-Hartman
` (548 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Munari, Oleksij Rempel,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Munari <stefanomunari.sm@gmail.com>
[ Upstream commit be9587c47db16faaca5415f533637755c65a4eb0 ]
lan78xx_suspend() calls phylink_suspend(dev->phylink, false) on an open
interface, which always stops phylink and halts the PHY. The matching
phylink_resume() is only called from lan78xx_reset_resume().
When the USB device stays powered across system sleep (e.g. s2idle) and
the USB core calls .resume instead, the link stays down until the interface
is brought down and up by hand. The ifdown triggers:
WARNING: drivers/net/phy/phy.c:1670 at phy_stop+0x44/0xc8
called from state HALTED
Move phylink_resume() to the end of lan78xx_resume(), which both resume
paths go through, and call it only if the resume succeeded and the
interface was open, mirroring lan78xx_suspend(). As a side effect,
lan78xx_reset_resume() no longer starts phylink on a closed interface.
Tested on a Raspberry Pi 3B+ (LAN7515) with s2idle: the link now comes
back up on its own after resume and ifdown no longer warns.
Fixes: e110bc825897 ("net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management")
Signed-off-by: Stefano Munari <stefanomunari.sm@gmail.com>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20261102235133.23011-1-stefanomunari.sm@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/usb/lan78xx.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index af845623bf609..e170c1114d8f2 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -5370,6 +5370,12 @@ static int lan78xx_resume(struct usb_interface *intf)
out:
mutex_unlock(&dev->dev_mutex);
+ if (!ret && dev_open) {
+ rtnl_lock();
+ phylink_resume(dev->phylink);
+ rtnl_unlock();
+ }
+
return ret;
}
@@ -5384,15 +5390,7 @@ static int lan78xx_reset_resume(struct usb_interface *intf)
if (ret < 0)
return ret;
- ret = lan78xx_resume(intf);
- if (ret < 0)
- return ret;
-
- rtnl_lock();
- phylink_resume(dev->phylink);
- rtnl_unlock();
-
- return 0;
+ return lan78xx_resume(intf);
}
static const struct usb_device_id products[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0451/1005] net: raw: fix ICMP unreachable sent when receive queue is full
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (449 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0450/1005] net: usb: lan78xx: resume phylink on non-reset USB resume Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0452/1005] spi: virtio: move teardown to .remove() Greg Kroah-Hartman
` (547 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiayuan Chen, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <jiayuan.chen@linux.dev>
[ Upstream commit 45441a94d50200f1478c52857725e6df624bf2ad ]
It's found in a raw socket application. When the application doesn't
read packets in time, the client receives ICMP Protocol Unreachable,
which makes the client abort the session.
The reason is that the server hits the sk_rcvbuf limit, and
raw_v4_input() skips the socket before setting 'delivered', so it
returns 0. Then ip_protocol_deliver_rcu() sees 'raw' is 0, thinks no one
handles this protocol and calls icmp_send() to send ICMP Protocol
Unreachable.
IPv6 has the same issue, ip6_protocol_deliver_rcu() sends ICMPv6
Parameter Problem instead.
Also, we'd better run icmp_filter() and ip_mc_sf_allow() (icmpv6_filter()
for IPv6) before we check sk_rcvbuf, otherwise packets rejected by
ICMP_FILTER/ICMPV6_FILTER or the multicast filter are counted in
sk_drops. So move the check right before skb_clone().
Fixes: d721812aa875 ("ipv4: raw: check sk->sk_rcvbuf earlier")
Fixes: 026763ece881 ("ipv6: raw: check sk->sk_rcvbuf earlier")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20261104115732.322151-1-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/raw.c | 15 ++++++++-------
net/ipv6/raw.c | 15 ++++++++-------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index d756e5e31b90d..f0035f8da3cf2 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -182,18 +182,19 @@ static int raw_v4_input(struct net *net, struct sk_buff *skb,
iph->saddr, iph->daddr, dif, sdif))
continue;
- if (atomic_read(&sk->sk_rmem_alloc) >=
- READ_ONCE(sk->sk_rcvbuf)) {
- sk_drops_inc(sk);
- continue;
- }
-
delivered = 1;
if ((iph->protocol != IPPROTO_ICMP || !icmp_filter(sk, skb)) &&
ip_mc_sf_allow(sk, iph->daddr, iph->saddr,
skb->dev->ifindex, sdif)) {
- struct sk_buff *clone = skb_clone(skb, GFP_ATOMIC);
+ struct sk_buff *clone;
+
+ if (atomic_read(&sk->sk_rmem_alloc) >=
+ READ_ONCE(sk->sk_rcvbuf)) {
+ sk_drops_inc(sk);
+ continue;
+ }
+ clone = skb_clone(skb, GFP_ATOMIC);
/* Not releasing hash table! */
if (clone)
raw_rcv(sk, clone);
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index bdea825434ea7..00d832c7cdae9 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -160,12 +160,6 @@ static bool ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
inet6_iif(skb), inet6_sdif(skb)))
continue;
- if (atomic_read(&sk->sk_rmem_alloc) >=
- READ_ONCE(sk->sk_rcvbuf)) {
- sk_drops_inc(sk);
- continue;
- }
-
delivered = true;
switch (nexthdr) {
case IPPROTO_ICMPV6:
@@ -197,8 +191,15 @@ static bool ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
if (filtered < 0)
break;
if (filtered == 0) {
- struct sk_buff *clone = skb_clone(skb, GFP_ATOMIC);
+ struct sk_buff *clone;
+
+ if (atomic_read(&sk->sk_rmem_alloc) >=
+ READ_ONCE(sk->sk_rcvbuf)) {
+ sk_drops_inc(sk);
+ continue;
+ }
+ clone = skb_clone(skb, GFP_ATOMIC);
/* Not releasing hash table! */
if (clone)
rawv6_rcv(sk, clone);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0452/1005] spi: virtio: move teardown to .remove()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (450 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0451/1005] net: raw: fix ICMP unreachable sent when receive queue is full Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0453/1005] af_unix: Convert unsigned long to u64 for GC Greg Kroah-Hartman
` (546 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Francesco Valla, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Francesco Valla <francesco@valla.it>
[ Upstream commit 9060f5ba658c9b0a7332be55b3d8abfc2b08618b ]
The .remove() callback is not marked as optional for a virtio_driver,
and thus a missing one is a bug. Moreover, the virtio framework expects
a driver to reset the device it controls during teardown and explicitly
checks for this reading the device status and WARNing in case it is
still running. Any devm cleanup action gets however called after that
check, leading to the WARN_ON condition to always be true for
spi-virtio; thus, an empty remove() is not an option.
Move the cleanup actions to the .remove() callback of the driver and
adapt the surrounding code to the new behavior.
Fixes: f98cabe3f6cf ("SPI: Add virtio SPI driver")
Signed-off-by: Francesco Valla <francesco@valla.it>
Link: https://patch.msgid.link/20261108-spi_virtio_remove-v1-1-fda5f0996290@valla.it
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-virtio.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/spi/spi-virtio.c b/drivers/spi/spi-virtio.c
index 96cdaf1b3697b..bbc1edbd3b006 100644
--- a/drivers/spi/spi-virtio.c
+++ b/drivers/spi/spi-virtio.c
@@ -319,10 +319,8 @@ static int virtio_spi_find_vqs(struct virtio_spi_priv *priv)
}
/* Function must not be called before virtio_spi_find_vqs() has been run */
-static void virtio_spi_del_vq(void *data)
+static void virtio_spi_del_vq(struct virtio_device *vdev)
{
- struct virtio_device *vdev = data;
-
virtio_reset_device(vdev);
vdev->config->del_vqs(vdev);
}
@@ -351,21 +349,26 @@ static int virtio_spi_probe(struct virtio_device *vdev)
if (ret)
return dev_err_probe(&vdev->dev, ret, "Cannot setup virtqueues\n");
- /* Register cleanup for virtqueues using devm */
- ret = devm_add_action_or_reset(&vdev->dev, virtio_spi_del_vq, vdev);
- if (ret)
- return dev_err_probe(&vdev->dev, ret, "Cannot register virtqueue cleanup\n");
-
virtio_device_ready(vdev);
- /* Use devm version to register controller */
- ret = devm_spi_register_controller(&vdev->dev, ctrl);
- if (ret)
+ ret = spi_register_controller(ctrl);
+ if (ret) {
+ virtio_spi_del_vq(vdev);
return dev_err_probe(&vdev->dev, ret, "Cannot register controller\n");
+ }
return 0;
}
+static void virtio_spi_remove(struct virtio_device *vdev)
+{
+ struct spi_controller *ctrl = dev_get_drvdata(&vdev->dev);
+
+ spi_unregister_controller(ctrl);
+
+ virtio_spi_del_vq(vdev);
+}
+
static int virtio_spi_freeze(struct device *dev)
{
struct spi_controller *ctrl = dev_get_drvdata(dev);
@@ -419,6 +422,7 @@ static struct virtio_driver virtio_spi_driver = {
},
.id_table = virtio_spi_id_table,
.probe = virtio_spi_probe,
+ .remove = virtio_spi_remove,
};
module_virtio_driver(virtio_spi_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0453/1005] af_unix: Convert unsigned long to u64 for GC.
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (451 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0452/1005] spi: virtio: move teardown to .remove() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0454/1005] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
` (545 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lim Chanyoun, Kuniyuki Iwashima,
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 d5f898d4c47217ce42506698a3a98741393217b7 ]
Lim Chanyoun reported that unix_vertex_max_scc_index could
wrap around on 32-bit kernels, which confuses GC into purging
a live socket receive queue.
I apparently designed GC with u64 in mind to avoid wraparound. [0]
Let's make it true on 32-bit kernels.
Note that unix_vertex.{out_degree,index} are converted for
consistency; they are bounded by the number of allocated
objects and do not exceed UINT_MAX on 32-bit kernels.
Fixes: 4090fa373f0e ("af_unix: Replace garbage collection algorithm.")
Link: https://lore.kernel.org/netdev/20240228030508.31297-1-kuniyu@amazon.com/ #[0]
Reported-by: Lim Chanyoun <onleaf322@gmail.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261104082058.452188-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/unix/garbage.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index da774f56ca648..a0b515354e8b8 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -78,9 +78,9 @@ struct unix_vertex {
struct list_head edges;
struct list_head entry;
struct list_head scc_entry;
- unsigned long out_degree;
- unsigned long index;
- unsigned long scc_index;
+ u64 out_degree;
+ u64 index;
+ u64 scc_index;
};
struct unix_edge {
@@ -148,8 +148,8 @@ enum unix_vertex_index {
UNIX_VERTEX_INDEX_START,
};
-static unsigned long unix_vertex_unvisited_index = UNIX_VERTEX_INDEX_MARK1;
-static unsigned long unix_vertex_max_scc_index = UNIX_VERTEX_INDEX_START;
+static u64 unix_vertex_unvisited_index = UNIX_VERTEX_INDEX_MARK1;
+static u64 unix_vertex_max_scc_index = UNIX_VERTEX_INDEX_START;
static void unix_add_edge(struct scm_fp_list *fpl, struct unix_edge *edge)
{
@@ -372,7 +372,7 @@ static bool unix_vertex_dead(struct unix_vertex *vertex)
}
static LIST_HEAD(unix_visited_vertices);
-static unsigned long unix_vertex_grouped_index = UNIX_VERTEX_INDEX_MARK2;
+static u64 unix_vertex_grouped_index = UNIX_VERTEX_INDEX_MARK2;
static bool unix_scc_dead(struct list_head *scc)
{
@@ -450,14 +450,14 @@ static bool unix_scc_cyclic(struct list_head *scc)
return false;
}
-static unsigned long __unix_walk_scc(struct unix_vertex *vertex,
- unsigned long *last_index,
- struct sk_buff_head *hitlist)
+static u64 __unix_walk_scc(struct unix_vertex *vertex,
+ u64 *last_index,
+ struct sk_buff_head *hitlist)
{
- unsigned long cyclic_sccs = 0;
LIST_HEAD(vertex_stack);
struct unix_edge *edge;
LIST_HEAD(edge_stack);
+ u64 cyclic_sccs = 0;
next_vertex:
/* Push vertex to vertex_stack and mark it as on-stack
@@ -553,12 +553,12 @@ static unsigned long __unix_walk_scc(struct unix_vertex *vertex,
return cyclic_sccs;
}
-static unsigned long unix_graph_cyclic_sccs;
+static u64 unix_graph_cyclic_sccs;
static void unix_walk_scc(struct sk_buff_head *hitlist)
{
- unsigned long last_index = UNIX_VERTEX_INDEX_START;
- unsigned long cyclic_sccs = 0;
+ u64 last_index = UNIX_VERTEX_INDEX_START;
+ u64 cyclic_sccs = 0;
unix_vertex_max_scc_index = UNIX_VERTEX_INDEX_START;
@@ -582,7 +582,7 @@ static void unix_walk_scc(struct sk_buff_head *hitlist)
static void unix_walk_scc_fast(struct sk_buff_head *hitlist)
{
- unsigned long cyclic_sccs = unix_graph_cyclic_sccs;
+ u64 cyclic_sccs = unix_graph_cyclic_sccs;
while (!list_empty(&unix_unvisited_vertices)) {
struct unix_vertex *vertex;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0454/1005] af_unix: Remove gc_in_progress check in unix_peek_fpl().
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (452 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0453/1005] af_unix: Convert unsigned long to u64 for GC Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0455/1005] net/mlx5: Bridge, fix bogus MDB offload errors Greg Kroah-Hartman
` (544 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qihang Tang, Kuniyuki Iwashima,
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 0edbc945eb9edd0086f25b151a79cfe4adc0dfa8 ]
unix_vertex_dead() and unix_peek_fpl() are synchronised
with unix_peek_seq to prevent GC from purging a live
socket's recvq.
unix_peek_fpl() skips the synchronisation if gc_in_progress
is false.
However, on weakly ordered arch, GC might have already
started working while the write to gc_in_progress is
buffered.
This does not occur on x86.
This is an unlikely path that happens only when AF_UNIX
fd is peeked so not worth complicating.
Instead of adding memory barriers in unix_gc() and
unix_peek_fpl(), let's simply remove the broken short-circuit.
Fixes: e5b31d988a41 ("af_unix: Give up GC if MSG_PEEK intervened.")
Reported-by: Qihang Tang <q.h.hack.winter@gmail.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261104162858.991930-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/unix/garbage.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index a0b515354e8b8..fbeabfb0db34e 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -329,9 +329,6 @@ void unix_peek_fpl(struct scm_fp_list *fpl)
if (!fpl || !fpl->count_unix)
return;
- if (!READ_ONCE(gc_in_progress))
- return;
-
/* Invalidate the final refcnt check in unix_vertex_dead(). */
spin_lock(&unix_peek_lock);
raw_write_seqcount_barrier(&unix_peek_seq);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0455/1005] net/mlx5: Bridge, fix bogus MDB offload errors
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (453 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0454/1005] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0456/1005] ipv6: ignore link state in gateway check Greg Kroah-Hartman
` (543 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gal Pressman, Jianbo Liu,
Cosmin Ratiu, Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gal Pressman <gal@nvidia.com>
[ Upstream commit c714f324eac17b2df03419b5cd5368687efd8e27 ]
MDB add operations are queued on the switchdev deferred queue
(SWITCHDEV_F_DEFER), while vlan object deletions are handled
synchronously.
A 'bridge vlan del' can overtake an MDB add that is still queued, and
the vlan is already gone by the time the driver is called.
The two operations are independent in practice: in my test, the MDB add
is triggered by assigning the VF an IPv6 address (hence joining a
solicited-node multicast group), while another process deletes the vlan
from its representor.
Racing 'bridge mdb add' against concurrent 'bridge vlan del' could
result in:
[ 5390.967651] mlx5_core 0000:08:00.0: E-Switch: Failed to lookup bridge port vlan metadata (vport=1)
[ 5390.969120] mlx5_core 0000:08:00.1: E-Switch: Failed to lookup bridge port vlan metadata to create MDB (MAC=33:33:ff:12:00:05,vid=2204,vport=1)
[ 5390.971676] mlx5_core 0000:08:00.1 eth4: Failed to add Port Multicast Database entry (object id=2) with error: -EINVAL (-22).
Failure in updating the port's Multicast Database could lead to
multicast forwarding issues.
The error cannot reach anyone that could do anything with it, switchdev
returned success to the bridge as soon as the MDB object was queued, and
the errno only flags the entry as offload failed.
The end result is correct either way, if the MDB has been offloaded
before the vlan was deleted, mlx5_esw_bridge_port_mdb_vlan_flush() would
have removed it.
The FDB path already treats this as a harmless race,
mlx5_esw_bridge_port_vlan_lookup() reports it on 'info' logging level
and skips the offload. mlxsw did the same in [1].
Skip the MDB offload, report on 'info' logging level and return
-EOPNOTSUPP: switchdev_port_obj_add_deferred() does not log it, and
br_switchdev_mdb_complete() skips the port group flag update.
[1] Commit 17b334a876fe ("mlxsw: spectrum_switchdev: Don't warn about valid situations")
Fixes: 70f0302b3f20 ("net/mlx5: Bridge, implement mdb offload")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261104183715.771390-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/mellanox/mlx5/core/esw/bridge.c | 21 ++++++++++---------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
index b4cf3c5ac0dde..9fac6f985a866 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
@@ -1867,26 +1867,27 @@ int mlx5_esw_bridge_port_mdb_add(struct net_device *dev, u16 vport_num, u16 esw_
port = mlx5_esw_bridge_port_lookup(vport_num, esw_owner_vhca_id, br_offloads);
if (!port) {
- esw_warn(br_offloads->esw->dev,
+ /* MDB is added asynchronously from the switchdev deferred
+ * queue while port might have been deleted concurrently.
+ */
+ esw_info(br_offloads->esw->dev,
"Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n",
addr, vport_num);
- NL_SET_ERR_MSG_FMT_MOD(extack,
- "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)",
- addr, vport_num);
- return -EINVAL;
+ return -EOPNOTSUPP;
}
bridge = port->bridge;
if (bridge->flags & MLX5_ESW_BRIDGE_VLAN_FILTERING_FLAG && vid) {
vlan = mlx5_esw_bridge_vlan_lookup(vid, port);
if (!vlan) {
- esw_warn(br_offloads->esw->dev,
+ /* MDB is added asynchronously from the switchdev
+ * deferred queue while vlan might have been deleted
+ * concurrently.
+ */
+ esw_info(br_offloads->esw->dev,
"Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n",
addr, vid, vport_num);
- NL_SET_ERR_MSG_FMT_MOD(extack,
- "Failed to lookup vlan metadata for MDB (MAC=%pM,vid=%u,vport=%u)",
- addr, vid, vport_num);
- return -EINVAL;
+ return -EOPNOTSUPP;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0456/1005] ipv6: ignore link state in gateway check
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (454 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0455/1005] net/mlx5: Bridge, fix bogus MDB offload errors Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0457/1005] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
` (542 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yaroslav Dudkov, Hangbin Liu,
Ido Schimmel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
[ Upstream commit b76bcf3fff9332076d92de47a80d12fd3d5268e2 ]
IPv6 route cannot be added in table when all
following conditions are true:
- gateway is not link-local address
- ignore_routes_with_linkdown=1 on device
- nexthop has no carrier
- gateway is not present or covered by any route in table already
Also multipath routes addition is invalidated by kernel even
if only one of added nexthops satisfies all above conditions.
Reproducer:
ip netns add t
ip -n t link add va type veth peer name vb
ip -n t link set va up
ip -n t addr add fd00::1/64 dev va nodad
ip netns exec t sysctl -w \
net.ipv6.conf.va.ignore_routes_with_linkdown=1
ip -n t -6 route add 2001:db8::/64 via fd00::2 dev va
# added
ip -n t -6 route add 2001:db8::/64 table 100 via fd00::2 dev va
# RTNETLINK answers: No route to host
ip -n t -6 route show table all
ip netns del t
Route should be added because:
- RT6_LOOKUP_F_IGNORE_LINKSTATE in commit d5d32e4b7668
("net: ipv6: Do not consider link state for nexthop validation")
was added for this
- the same route is valid in main table (when no specifying table id
while adding route)
- fib6_nh_init() initializes nexthops with no carrier
- IPv4 already does this (fib_check_nh_v4_gw() ignores link state
using the FIB_LOOKUP_IGNORE_LINKSTATE flag)
Before commit b2c709cce682 ("ipv6: Convert gateway validation to
use fib6_info") rt6_lookup() was used for checking if nexthop is
valid, rt6_lookup called rt6_device_match() which does not check the
link state. After change rt6_lookup() to fib6_lookup()
find_match() under fib6_lookup() started to invalidate linkdown
devices, because RT6_LOOKUP_F_IGNORE_LINKSTATE is not passed to it.
Adding RT6_LOOKUP_F_IGNORE_LINKSTATE to flags for ip6_route_check_nh()
solves the problem. RT6_LOOKUP_F_IGNORE_LINKSTATE is already used
inside the first search ip6_nh_lookup_table() and fixes the
bug in second search fib6_lookup(). Also RT6_LOOKUP_F_IGNORE_LINKSTATE
isn't read inside fib6_select_path().
Fixes: b2c709cce682 ("ipv6: Convert gateway validation to use fib6_info")
Signed-off-by: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261104195655.1406837-2-aroslavdudkov622@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1ec9fd20b07d8..cf6f09a42c9b7 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3483,9 +3483,9 @@ static int ip6_route_check_nh(struct net *net,
netdevice_tracker *dev_tracker,
struct inet6_dev **idev)
{
+ int flags = RT6_LOOKUP_F_IFACE | RT6_LOOKUP_F_IGNORE_LINKSTATE;
const struct in6_addr *gw_addr = &cfg->fc_gateway;
struct net_device *dev = _dev ? *_dev : NULL;
- int flags = RT6_LOOKUP_F_IFACE;
struct fib6_result res = {};
int err = -EHOSTUNREACH;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0457/1005] team: fix promisc/allmulti leak in team_port_add error path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (455 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0456/1005] ipv6: ignore link state in gateway check Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0458/1005] net: octeontx2: fix building without DEBUGFS Greg Kroah-Hartman
` (541 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Hangbin Liu,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit ff618cb00a645f1e3f89068c5fbda3f3a7f4ae63 ]
team_port_add() increments the port's promiscuity and allmulti
counts before calling team_dev_type_check_change(). If the latter
fails, the error path does not undo these increments, leaving the
port in promiscuous and allmulti mode even though it was not
successfully added to the team.
Undo the promiscuity increment under err_set_slave_allmulti and the
allmulti increment under err_set_dev_type, so each error label only
reverts what was successfully applied, matching the cleanup performed
by team_port_del().
With the promiscuity rollback now living under err_set_slave_allmulti,
the inline dev_set_promiscuity(port_dev, -1) in the dev_set_allmulti()
failure branch becomes redundant: that branch already jumps to
err_set_slave_allmulti, which undoes the promiscuity increment. Drop
the inline call to avoid doing it twice.
Found by source code audit.
Fixes: 0ae9cfc454ea ("team: Move team device type change at the end of team_port_add")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Link: https://patch.msgid.link/20261104015217.2222-1-lirongqing@baidu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/team/team_core.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index 957cc7885d2fb..cfb833c307c14 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -1365,11 +1365,8 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
/* set allmulti level to new slave */
if (dev->flags & IFF_ALLMULTI) {
err = dev_set_allmulti(port_dev, 1);
- if (err) {
- if (dev->flags & IFF_PROMISC)
- dev_set_promiscuity(port_dev, -1);
+ if (err)
goto err_set_slave_allmulti;
- }
}
err = team_dev_type_check_change(dev, port_dev);
@@ -1397,7 +1394,11 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
return 0;
err_set_dev_type:
+ if (dev->flags & IFF_ALLMULTI)
+ dev_set_allmulti(port_dev, -1);
err_set_slave_allmulti:
+ if (dev->flags & IFF_PROMISC)
+ dev_set_promiscuity(port_dev, -1);
err_set_slave_promisc:
__team_option_inst_del_port(team, port);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0458/1005] net: octeontx2: fix building without DEBUGFS
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (456 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0457/1005] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0459/1005] net/mlx5: Use only loaded devices for PTP clock operations Greg Kroah-Hartman
` (540 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnd Bergmann, Ratheesh Kannoth,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <arnd@arndb.de>
[ Upstream commit 2007f7e37142ebdb341949dca8098f898cc871f7 ]
This error came up on my randconfig tests this week:
drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c: In function 'npc_cn20k_debugfs_init':
drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c:392:55: error: 'struct rvu' has no member named 'rvu_dbg'; did you mean 'rvu_dl'?
392 | debugfs_create_file("mcam_layout", 0444, rvu->rvu_dbg.npc,
The problem here is that the rvu_dbg member is hidden in an #ifdef
block, but the reference to it is not.
Remove the #ifdef and waste a few bytes in the structure in this
config. Note that the debugfs_create_file() call end up ignoring
the arguments, so the actual debugfs implementation is still
ignored here.
Fixes: 528530dff56b ("octeontx2-af: npc: cn20k: add debugfs support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ratheesh Kannoth <rkannoth@marvell.com>
Link: https://patch.msgid.link/20261105161945.1658464-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
index 094227404ef9f..f91478f656615 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
@@ -75,8 +75,6 @@ static inline int rvu_pcifunc_pf_mask(struct pci_dev *pdev)
#define RVU_AFPF 25
-#ifdef CONFIG_DEBUG_FS
-
struct dump_ctx {
int lf;
int id;
@@ -111,7 +109,6 @@ struct rvu_debugfs {
int npa_qsize_id;
int nix_qsize_id;
};
-#endif
struct rvu_work {
struct work_struct work;
@@ -648,9 +645,7 @@ struct rvu {
int mcs_blk_cnt;
int cpt_pf_num;
-#ifdef CONFIG_DEBUG_FS
struct rvu_debugfs rvu_dbg;
-#endif
struct rvu_devlink *rvu_dl;
/* RVU switch implementation over NPC with DMAC rules */
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0459/1005] net/mlx5: Use only loaded devices for PTP clock operations
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (457 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0458/1005] net: octeontx2: fix building without DEBUGFS Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0460/1005] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
` (539 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Carolina Jubran, Cosmin Ratiu,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carolina Jubran <cjubran@nvidia.com>
[ Upstream commit 908561cc4b4db4510465f02f5323e98f2dc00fad ]
The PTP periodic worker and PTP operations access PCI registers through
the function backing the PTP clock. The PTP clock remains registered
when a PCI function is suspended, so these paths can still access the
function after it has been unloaded.
To fix that, serialize clock hardware access with the clock mutex for
all clocks and fail callbacks with -EAGAIN when there is no loaded
function to service the clock. Additionally, tie the worker's lifetime
to load/unload and use the devcom lock to synchronize with peer
loads/unloads.
Since the periodic worker is stopped during unload, the free running
counter may wrap without being sampled. Reinitialize the timecounter
on load using the hardware real time clock in real time mode, or the
saved PHC time plus elapsed CLOCK_BOOTTIME in free running mode.
This provides best effort PHC continuity across unload/load. In free
running mode, elapsed time while unloaded is estimated using
CLOCK_BOOTTIME rather than the PHC's adjusted frequency.
Fixes: 8fc3e29be924 ("net/mlx5: Fix crash upon suspend/resume")
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261104183158.758314-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/mellanox/mlx5/core/lib/clock.c | 248 +++++++++++++-----
.../ethernet/mellanox/mlx5/core/lib/clock.h | 2 +
2 files changed, 185 insertions(+), 65 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
index 5df786133e4bc..c3e53d219496f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
@@ -80,6 +80,7 @@ enum {
};
struct mlx5_clock_dev_state {
+ bool loaded;
struct mlx5_core_dev *mdev;
struct mlx5_devcom_comp_dev *compdev;
struct mlx5_nb pps_nb;
@@ -89,7 +90,7 @@ struct mlx5_clock_dev_state {
struct mlx5_clock_priv {
struct mlx5_clock clock;
struct mlx5_core_dev *mdev;
- struct mutex lock; /* protect mdev and used in PTP callbacks */
+ struct mutex lock; /* protect mdev and serialize hardware callbacks */
struct mlx5_core_dev *event_mdev;
};
@@ -100,9 +101,6 @@ static struct mlx5_clock_priv *clock_priv(struct mlx5_clock *clock)
static void mlx5_clock_lockdep_assert(struct mlx5_clock *clock)
{
- if (!clock->shared)
- return;
-
lockdep_assert(lockdep_is_held(&clock_priv(clock)->lock));
}
@@ -115,20 +113,24 @@ static struct mlx5_core_dev *mlx5_clock_mdev_get(struct mlx5_clock *clock)
static void mlx5_clock_lock(struct mlx5_clock *clock)
{
- if (!clock->shared)
- return;
-
mutex_lock(&clock_priv(clock)->lock);
}
static void mlx5_clock_unlock(struct mlx5_clock *clock)
{
- if (!clock->shared)
- return;
-
mutex_unlock(&clock_priv(clock)->lock);
}
+static struct mlx5_core_dev *
+mlx5_clock_active_mdev_get(struct mlx5_clock *clock)
+{
+ struct mlx5_clock_priv *cpriv = clock_priv(clock);
+
+ mlx5_clock_lockdep_assert(clock);
+
+ return cpriv->mdev->clock_state->loaded ? cpriv->mdev : NULL;
+}
+
static bool mlx5_real_time_mode(struct mlx5_core_dev *mdev)
{
return (mlx5_is_real_time_rq(mdev) || mlx5_is_real_time_sq(mdev));
@@ -333,7 +335,11 @@ static int mlx5_ptp_getcrosststamp(struct ptp_clock_info *ptp,
int err;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
if (!mlx5_is_ptm_source_time_available(mdev)) {
err = -EBUSY;
@@ -359,7 +365,11 @@ static int mlx5_ptp_getcrosscycles(struct ptp_clock_info *ptp,
int err;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
if (!mlx5_is_ptm_source_time_available(mdev)) {
err = -EBUSY;
@@ -411,6 +421,12 @@ static u64 read_internal_timer(struct cyclecounter *cc)
return mlx5_read_time(mdev, NULL, false) & cc->mask;
}
+static void mlx5_timer_snapshot(struct mlx5_timer *timer)
+{
+ timer->saved_phc_ns = timer->tc.nsec;
+ timer->saved_boot_ns = ktime_get_boottime_ns();
+}
+
static void mlx5_update_clock_info_page(struct mlx5_core_dev *mdev)
{
struct mlx5_ib_clock_info *clock_info = mdev->clock_info;
@@ -418,6 +434,9 @@ static void mlx5_update_clock_info_page(struct mlx5_core_dev *mdev)
struct mlx5_timer *timer;
u32 sign;
+ timer = &clock->timer;
+ mlx5_timer_snapshot(timer);
+
if (!clock_info)
return;
@@ -425,7 +444,6 @@ static void mlx5_update_clock_info_page(struct mlx5_core_dev *mdev)
smp_store_mb(clock_info->sign,
sign | MLX5_IB_CLOCK_INFO_KERNEL_UPDATING);
- timer = &clock->timer;
clock_info->cycles = timer->tc.cycle_last;
clock_info->mult = timer->cycles.mult;
clock_info->nsec = timer->tc.nsec;
@@ -471,10 +489,9 @@ static long mlx5_timestamp_overflow(struct ptp_clock_info *ptp_info)
clock = container_of(ptp_info, struct mlx5_clock, ptp_info);
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
timer = &clock->timer;
-
- if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
+ if (!mdev || mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
goto out;
write_seqlock_irqsave(&clock->lock, flags);
@@ -531,8 +548,13 @@ static int mlx5_ptp_settime(struct ptp_clock_info *ptp, const struct timespec64
int err;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
err = mlx5_clock_settime(mdev, clock, ts);
+unlock:
mlx5_clock_unlock(clock);
return err;
@@ -550,26 +572,40 @@ struct timespec64 mlx5_ptp_gettimex_real_time(struct mlx5_core_dev *mdev,
return ts;
}
-static int mlx5_ptp_gettimex(struct ptp_clock_info *ptp, struct timespec64 *ts,
- struct ptp_system_timestamp *sts)
+static void mlx5_clock_gettimex(struct mlx5_core_dev *mdev,
+ struct mlx5_clock *clock, struct timespec64 *ts,
+ struct ptp_system_timestamp *sts)
{
- struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, ptp_info);
- struct mlx5_core_dev *mdev;
u64 cycles, ns;
- mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
if (mlx5_real_time_mode(mdev)) {
*ts = mlx5_ptp_gettimex_real_time(mdev, sts);
- goto out;
+ return;
}
cycles = mlx5_read_time(mdev, sts, false);
ns = mlx5_timecounter_cyc2time(clock, cycles);
*ts = ns_to_timespec64(ns);
-out:
+}
+
+static int mlx5_ptp_gettimex(struct ptp_clock_info *ptp, struct timespec64 *ts,
+ struct ptp_system_timestamp *sts)
+{
+ struct mlx5_clock *clock =
+ container_of(ptp, struct mlx5_clock, ptp_info);
+ struct mlx5_core_dev *mdev;
+ int err = 0;
+
+ mlx5_clock_lock(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
+ mlx5_clock_gettimex(mdev, clock, ts, sts);
+unlock:
mlx5_clock_unlock(clock);
- return 0;
+ return err;
}
static int mlx5_ptp_getcyclesx(struct ptp_clock_info *ptp,
@@ -580,14 +616,20 @@ static int mlx5_ptp_getcyclesx(struct ptp_clock_info *ptp,
ptp_info);
struct mlx5_core_dev *mdev;
u64 cycles;
+ int err = 0;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
cycles = mlx5_read_time(mdev, sts, false);
*ts = ns_to_timespec64(cycles);
+unlock:
mlx5_clock_unlock(clock);
- return 0;
+ return err;
}
static int mlx5_ptp_adjtime_real_time(struct mlx5_core_dev *mdev, s64 delta)
@@ -620,7 +662,11 @@ static int mlx5_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
int err = 0;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
if (mlx5_modify_mtutc_allowed(mdev)) {
err = mlx5_ptp_adjtime_real_time(mdev, delta);
@@ -630,6 +676,7 @@ static int mlx5_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
}
write_seqlock_irqsave(&clock->lock, flags);
+ timecounter_read(&timer->tc);
timecounter_adjtime(&timer->tc, delta);
mlx5_update_clock_info_page(mdev);
write_sequnlock_irqrestore(&clock->lock, flags);
@@ -646,8 +693,13 @@ static int mlx5_ptp_adjphase(struct ptp_clock_info *ptp, s32 delta)
int err;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
err = mlx5_ptp_adjtime_real_time(mdev, delta);
+unlock:
mlx5_clock_unlock(clock);
return err;
@@ -683,7 +735,11 @@ static int mlx5_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
u32 mult;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
if (mlx5_modify_mtutc_allowed(mdev)) {
err = mlx5_ptp_freq_adj_real_time(mdev, scaled_ppm);
@@ -744,7 +800,11 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp,
}
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
if (!MLX5_PPS_CAP(mdev)) {
err = -EOPNOTSUPP;
@@ -917,7 +977,11 @@ static int mlx5_perout_configure(struct ptp_clock_info *ptp,
return -EBUSY;
mlx5_clock_lock(clock);
- mdev = mlx5_clock_mdev_get(clock);
+ mdev = mlx5_clock_active_mdev_get(clock);
+ if (!mdev) {
+ err = -EAGAIN;
+ goto unlock;
+ }
rt_mode = mlx5_real_time_mode(mdev);
if (!MLX5_PPS_CAP(mdev)) {
@@ -1151,7 +1215,7 @@ static u64 perout_conf_next_event_timer(struct mlx5_core_dev *mdev,
struct timespec64 ts;
s64 target_ns;
- mlx5_ptp_gettimex(&clock->ptp_info, &ts, NULL);
+ mlx5_clock_gettimex(mdev, clock, &ts, NULL);
ts_next_sec(&ts);
target_ns = timespec64_to_ns(&ts);
@@ -1222,8 +1286,8 @@ static void mlx5_timecounter_init(struct mlx5_core_dev *mdev)
timer->nominal_c_mult = timer->cycles.mult;
timer->cycles.mask = CLOCKSOURCE_MASK(41);
- timecounter_init(&timer->tc, &timer->cycles,
- ktime_to_ns(ktime_get_real()));
+ timecounter_init(&timer->tc, &timer->cycles, ktime_get_real_ns());
+ mlx5_timer_snapshot(timer);
}
static void mlx5_init_overflow_period(struct mlx5_core_dev *mdev)
@@ -1381,9 +1445,6 @@ static void mlx5_init_clock_dev(struct mlx5_core_dev *mdev)
clock->ptp);
clock->ptp = NULL;
}
-
- if (clock->ptp)
- ptp_schedule_worker(clock->ptp, 0);
}
static void mlx5_destroy_clock_dev(struct mlx5_core_dev *mdev)
@@ -1530,22 +1591,53 @@ static void mlx5_clock_arm_pps_in_event(struct mlx5_clock *clock,
!clock->pps_info.pin_armed[i])
continue;
- if (new_mdev) {
+ if (new_mdev)
mlx5_set_mtppse(new_mdev, i, 0, MLX5_EVENT_MODE_REPETETIVE);
- cpriv->event_mdev = new_mdev;
- } else {
- cpriv->event_mdev = NULL;
- }
if (old_mdev)
mlx5_set_mtppse(old_mdev, i, 0, MLX5_EVENT_MODE_DISABLE);
}
+ cpriv->event_mdev = new_mdev;
+}
+
+static void mlx5_set_timecounter(struct mlx5_core_dev *mdev, u64 ns)
+{
+ struct mlx5_clock *clock = mdev->clock;
+ struct mlx5_timer *timer;
+ unsigned long flags;
+
+ timer = &clock->timer;
+ mlx5_clock_lockdep_assert(clock);
+
+ write_seqlock_irqsave(&clock->lock, flags);
+ timecounter_init(&timer->tc, &timer->cycles, ns);
+ mlx5_update_clock_info_page(mdev);
+ write_sequnlock_irqrestore(&clock->lock, flags);
+}
+
+static void mlx5_save_timecounter(struct mlx5_core_dev *mdev)
+{
+ struct mlx5_clock *clock = mdev->clock;
+ struct mlx5_timer *timer;
+ unsigned long flags;
+
+ timer = &clock->timer;
+ mlx5_clock_lockdep_assert(clock);
+
+ if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
+ return;
+
+ write_seqlock_irqsave(&clock->lock, flags);
+ timecounter_read(&timer->tc);
+ mlx5_update_clock_info_page(mdev);
+ write_sequnlock_irqrestore(&clock->lock, flags);
}
void mlx5_clock_load(struct mlx5_core_dev *mdev)
{
struct mlx5_clock *clock = mdev->clock;
struct mlx5_clock_priv *cpriv;
+ bool start;
if (!MLX5_CAP_GEN(mdev, device_frequency_khz))
return;
@@ -1554,18 +1646,32 @@ void mlx5_clock_load(struct mlx5_core_dev *mdev)
MLX5_NB_INIT(&mdev->clock_state->pps_nb, mlx5_pps_event, PPS_EVENT);
mlx5_eq_notifier_register(mdev, &mdev->clock_state->pps_nb);
- if (!clock->shared) {
- mlx5_clock_arm_pps_in_event(clock, mdev, NULL);
- return;
- }
-
cpriv = clock_priv(clock);
- mlx5_devcom_comp_lock(mdev->clock_state->compdev);
+ if (clock->shared)
+ mlx5_devcom_comp_lock(mdev->clock_state->compdev);
mlx5_clock_lock(clock);
- if (mdev == cpriv->mdev && mdev != cpriv->event_mdev)
+ start = !cpriv->mdev->clock_state->loaded;
+ mdev->clock_state->loaded = true;
+ if (start) {
+ struct mlx5_timer *timer = &clock->timer;
+ u64 ns;
+
+ cpriv->mdev = mdev;
+ if (mlx5_real_time_mode(mdev))
+ ns = mlx5_read_time(mdev, NULL, true);
+ else
+ ns = timer->saved_phc_ns +
+ ktime_get_boottime_ns() - timer->saved_boot_ns;
+
+ mlx5_set_timecounter(mdev, ns);
mlx5_clock_arm_pps_in_event(clock, mdev, cpriv->event_mdev);
+ }
mlx5_clock_unlock(clock);
- mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
+
+ if (start && clock->ptp)
+ ptp_schedule_worker(clock->ptp, 0);
+ if (clock->shared)
+ mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
}
void mlx5_clock_unload(struct mlx5_core_dev *mdev)
@@ -1573,30 +1679,42 @@ void mlx5_clock_unload(struct mlx5_core_dev *mdev)
struct mlx5_core_dev *peer_dev, *next = NULL;
struct mlx5_clock *clock = mdev->clock;
struct mlx5_devcom_comp_dev *pos;
+ struct mlx5_clock_priv *cpriv;
+ bool stop;
if (!MLX5_CAP_GEN(mdev, device_frequency_khz))
return;
- if (!clock->shared) {
- mlx5_clock_arm_pps_in_event(clock, NULL, mdev);
- goto out;
- }
-
- mlx5_devcom_comp_lock(mdev->clock_state->compdev);
- mlx5_devcom_for_each_peer_entry(mdev->clock_state->compdev, peer_dev, pos) {
- if (peer_dev->clock && peer_dev != mdev) {
- next = peer_dev;
- break;
+ if (clock->shared) {
+ mlx5_devcom_comp_lock(mdev->clock_state->compdev);
+ mlx5_devcom_for_each_peer_entry(mdev->clock_state->compdev,
+ peer_dev, pos) {
+ if (peer_dev->clock == clock &&
+ peer_dev->clock_state->loaded) {
+ next = peer_dev;
+ break;
+ }
}
}
mlx5_clock_lock(clock);
- if (mdev == clock_priv(clock)->event_mdev)
+ cpriv = clock_priv(clock);
+ mdev->clock_state->loaded = false;
+ if (mdev == cpriv->mdev && next)
+ cpriv->mdev = next;
+ if (mdev == cpriv->event_mdev)
mlx5_clock_arm_pps_in_event(clock, next, mdev);
+ stop = !cpriv->mdev->clock_state->loaded;
+ if (!mlx5_real_time_mode(cpriv->mdev))
+ mlx5_save_timecounter(cpriv->mdev);
mlx5_clock_unlock(clock);
- mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
-out:
+ /* Keep devcom locked to prevent a peer from restarting the worker. */
+ if (stop && clock->ptp)
+ ptp_cancel_worker_sync(clock->ptp);
+ if (clock->shared)
+ mlx5_devcom_comp_unlock(mdev->clock_state->compdev);
+
mlx5_eq_notifier_unregister(mdev, &mdev->clock_state->pps_nb);
cancel_work_sync(&mdev->clock_state->out_work);
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h
index aff3aed62c748..86ae447a23ed6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.h
@@ -50,6 +50,8 @@ struct mlx5_timer {
struct timecounter tc;
u32 nominal_c_mult;
unsigned long overflow_period;
+ u64 saved_phc_ns;
+ u64 saved_boot_ns;
};
struct mlx5_clock {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0460/1005] net/mlx5: Lag, free steering resources on LAG destroy failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (458 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0459/1005] net/mlx5: Use only loaded devices for PTP clock operations Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0461/1005] net: protect negative destination advice with RCU Greg Kroah-Hartman
` (538 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Bloch, Shay Drori, Tariq Toukan,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Bloch <mbloch@nvidia.com>
[ Upstream commit deceb70d1303105e4368a19b251a6fd94428eb11 ]
When firmware fails to destroy LAG, driver returns before releasing the
steering resources, leaking the associated software objects.
The bond is no longer eligible for offload, and the driver cannot
prevent its teardown. Release the steering resources even if LAG
destruction fails. Preserve the error logging and return the original
error after cleanup.
Fixes: da6b0bb0fc73 ("net/mlx5: Lag, use steering to select the affinity port in LAG")
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261104183947.772195-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
index 4e173b08cb37a..a8ba1c2086063 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
@@ -1096,7 +1096,6 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev)
"Failed to deactivate VF LAG; driver restart required\n"
"Make sure all VFs are unbound prior to VF LAG activation or deactivation\n");
}
- return err;
}
if (test_bit(MLX5_LAG_MODE_FLAG_HASH_BASED, &flags)) {
@@ -1106,7 +1105,7 @@ int mlx5_deactivate_lag(struct mlx5_lag *ldev)
if (mlx5_lag_has_drop_rule(ldev))
mlx5_lag_drop_rule_cleanup(ldev);
- return 0;
+ return err;
}
bool mlx5_lag_check_prereq(struct mlx5_lag *ldev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0461/1005] net: protect negative destination advice with RCU
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (459 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0460/1005] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0462/1005] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
` (537 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jiayuan Chen, Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 4b77d2792c3e482afa108c08f224ea6fa396d80b ]
SO_CNX_ADVICE calls __dst_negative_advice() while holding the socket
lock. Connected UDP sends can still invalidate or replace sk_dst_cache
without that lock. A concurrent sk_dst_check() can drop the final
destination reference and allow an RCU callback to destroy it while
__dst_negative_advice() retains only a borrowed pointer. This can cause
a use-after-free while accessing dst->ops or running the negative_advice
callback.
The writer-side ordering fixed by commit 92f1655aa2b2 ("net: fix
__dst_negative_advice() race") does not protect this reader from an
independent cache replacement.
Hold an RCU read-side critical section across the lookup and callback.
This follows the datagram release callbacks and covers IPv4, IPv6, and
XFRM advice without changing cache-reset or reference-ownership rules.
Fixes: a87cb3e48ee8 ("net: Facility to report route quality of connected sockets")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
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/20261104131744.1056562-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/sock.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 60ea55dc18854..f8038be27f003 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2214,10 +2214,13 @@ sk_dst_get(const struct sock *sk)
static inline void __dst_negative_advice(struct sock *sk)
{
- struct dst_entry *dst = __sk_dst_get(sk);
+ struct dst_entry *dst;
+ rcu_read_lock();
+ dst = __sk_dst_get(sk);
if (dst && dst->ops->negative_advice)
dst->ops->negative_advice(sk, dst);
+ rcu_read_unlock();
}
static inline void dst_negative_advice(struct sock *sk)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0462/1005] net: require a full socket in sock_confirm_neigh()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (460 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 7.3 0461/1005] net: protect negative destination advice with RCU Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0463/1005] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
` (536 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit c78b47704934e44442f4e48bfdcc99039e3b85a5 ]
An skb can retain dst_pending_confirm after its original output and
socket owner have changed. For example, a raw MSG_CONFIRM packet can
cross veth, have a TCP request socket assigned by TPROXY, and be bridged
into gretap. Neighbor output for the outer packet then calls
sock_confirm_neigh() with the request socket in skb->sk.
The helper unconditionally treats a non-NULL skb->sk as a full socket
when accessing sk_dst_pending_confirm. TCP request and TIME_WAIT sockets
do not contain that field. This produces an out-of-bounds four-byte read
and, if the word is nonzero, an out-of-bounds four-byte zero write. A
KASAN-enabled kernel reports:
BUG: KASAN: slab-out-of-bounds in ip_finish_output2+0xc9f/0xd60
Read of size 4 at addr ffff8880bdc3d880 by task tproxy_dst_conf/1771
Require sk_fullsock() before accessing the socket field, moving the
existing helper earlier in the header to make it available here. Keep
neigh_confirm() independent of the socket type so the skb's neighbor
confirmation still works, including for socketless packets. This also
covers the IPv6, VRF, and BPF neighbor-output callers.
Fixes: 4ff0620354f2 ("net: add dst_pending_confirm flag to skbuff")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261104132900.1071940-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/sock.h | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index f8038be27f003..145770c9394dd 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2283,6 +2283,14 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
+/* This helper checks if a socket is a full socket,
+ * ie _not_ a timewait or request socket.
+ */
+static inline bool sk_fullsock(const struct sock *sk)
+{
+ return (1 << sk->sk_state) & ~(TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV);
+}
+
static inline void sk_dst_confirm(struct sock *sk)
{
if (!READ_ONCE(sk->sk_dst_pending_confirm))
@@ -2294,7 +2302,8 @@ static inline void sock_confirm_neigh(struct sk_buff *skb, struct neighbour *n)
if (skb_get_dst_pending_confirm(skb)) {
struct sock *sk = skb->sk;
- if (sk && READ_ONCE(sk->sk_dst_pending_confirm))
+ if (sk && sk_fullsock(sk) &&
+ READ_ONCE(sk->sk_dst_pending_confirm))
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
neigh_confirm(n);
}
@@ -3027,14 +3036,6 @@ skb_sk_is_prefetched(struct sk_buff *skb)
#endif /* CONFIG_INET */
}
-/* This helper checks if a socket is a full socket,
- * ie _not_ a timewait or request socket.
- */
-static inline bool sk_fullsock(const struct sock *sk)
-{
- return (1 << sk->sk_state) & ~(TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV);
-}
-
static inline bool
sk_is_refcounted(struct sock *sk)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0463/1005] ipvlan: make outbound skb headers writable
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (461 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0462/1005] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0464/1005] wifi: mac80211_hwsim: use CLOCK_BOOTTIME for the beacon timer Greg Kroah-Hartman
` (535 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit a45dbf182137275f44ad7c8bc8acd23f7af6b2cf ]
In L3 and L3S modes, ipvlan_process_v4_outbound() and
ipvlan_process_v6_outbound() hand the skb to ip_local_out() and
ip6_local_out(). The IP output path assumes it owns the network header:
__ip_local_out() rewrites tot_len and the header checksum, and
transport-mode XFRM can memmove the network header into the headroom
when xfrm_skb_check_space() finds enough room, without copying.
The skb reaching ipvlan can have its header shared with another skb,
for example after an AF_PACKET tap on the ipvlan device or a tc mirred
mirror action. pskb_network_may_pull() only makes the header linear;
it does not unshare an already linear head. The writes above then
modify the other skb. If that skb is on the receive path and its IPv4
header was already validated, IPv4 option processing can use the
modified header, write past the linear data, and corrupt
skb_shared_info.
Use skb_cow_head() before taking header pointers and entering the local
IP output path, like ip_forward() does with skb_cow() before it touches
the header. Only checking skb_header_cloned() is enough here: skbs that
TCP transmits are clones of the write-queue skb, whose header area has
been released with __skb_header_release(). Their headers are private,
so they are not copied, which avoids a reallocation for every TCP
segment sent through an ipvlan slave.
If the allocation fails, the existing error accounting and drop paths
are used. L2 mode is unaffected.
[edumazet: use skb_cow_head() instead of skb_unclone() to avoid
copying every TCP segment, reword changelog]
Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261104113530.986664-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ipvlan/ipvlan_core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 7ad12dc7845c8..d2afc2ec896e0 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -438,7 +438,8 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
.flowi4_mark = skb->mark,
};
- if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
+ if (!pskb_network_may_pull(skb, sizeof(struct iphdr)) ||
+ skb_cow_head(skb, 0))
goto err;
ip4h = ip_hdr(skb);
@@ -504,7 +505,8 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
struct net_device *dev = skb->dev;
int err, ret = NET_XMIT_DROP;
- if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr))) {
+ if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr)) ||
+ skb_cow_head(skb, 0)) {
DEV_STATS_INC(dev, tx_errors);
kfree_skb(skb);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0464/1005] wifi: mac80211_hwsim: use CLOCK_BOOTTIME for the beacon timer
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (462 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0463/1005] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0465/1005] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
` (534 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Loïc Kassel, Johannes Berg,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loïc Kassel <loic.kassel@gmail.com>
[ Upstream commit 0da2be70425b21acf6e11bcf02f8a10fd55e85b0 ]
The simulated TSF is based on boottime, and the beacon timer is re-armed
with an absolute expiry derived from the TSF through
mac80211_hwsim_tsf_to_boottime(). The timer itself is however still set
up with CLOCK_MONOTONIC.
Boottime keeps running while the system is suspended, monotonic does
not. After the host has been suspended once, every beacon is therefore
scheduled too late by the total time spent in suspend, and APs
practically stop sending beacons.
Set the beacon timer up with CLOCK_BOOTTIME so that it is consistent
with the TSF.
Fixes: 933f5bec98a1 ("wifi: mac80211_hwsim: register beacon timer by calculating TBTT")
Closes: https://lore.kernel.org/linux-wireless/CAAzpgGdksHZjx4jc20zqnAG_PQ2e1ggANQjt2eiycUiWc+vPHg@mail.gmail.com/
Signed-off-by: Loïc Kassel <loic.kassel@gmail.com>
Link: https://patch.msgid.link/20261023-hwsim-beacon-clock-v1-1-9b3f3ffc099b@gmail.com
[remove useless commit message fluff]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/virtual/mac80211_hwsim_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
index b9446577ff499..203bf9a4b96e3 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
@@ -6136,7 +6136,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
for (i = 0; i < ARRAY_SIZE(data->link_data); i++) {
hrtimer_setup(&data->link_data[i].beacon_timer, mac80211_hwsim_beacon,
- CLOCK_MONOTONIC, HRTIMER_MODE_ABS_SOFT);
+ CLOCK_BOOTTIME, HRTIMER_MODE_ABS_SOFT);
data->link_data[i].link_id = i;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0465/1005] wifi: mac80211: mesh: dont linearize SKBs unnecessarily
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (463 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0464/1005] wifi: mac80211_hwsim: use CLOCK_BOOTTIME for the beacon timer Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0466/1005] wifi: mac80211: abort chanswitch when leaving an IBSS Greg Kroah-Hartman
` (533 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 6a6db144d96352967623f38692dfc4b4fb814518 ]
If mesh fast-xmit cannot be used due to aggregation not
being fully set up yet, there's no need to linearize the
SKB. Avoid that, which addresses a stale pointer issue
in the caller.
Change-Id: I6b93e6c7587faf8749f8366ed574ee2b79fd47a5
Fixes: 8b0f5cb6bc7c ("wifi: mac80211: use mesh header cache to speed up mesh forwarding")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/rx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index aa8e3e375e075..e66a8b66d6a4c 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2930,9 +2930,6 @@ ieee80211_rx_mesh_fast_forward(struct ieee80211_sub_if_data *sdata,
if (!sta)
return false;
- if (skb_linearize(skb))
- return false;
-
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
if (tid_tx) {
@@ -2943,6 +2940,10 @@ ieee80211_rx_mesh_fast_forward(struct ieee80211_sub_if_data *sdata,
tid_tx->last_tx = jiffies;
}
+ /* this function must not fail after this */
+ if (skb_linearize(skb))
+ return false;
+
ieee80211_aggr_check(sdata, sta, skb);
if (ieee80211_get_8023_tunnel_proto(skb->data + hdrlen,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0466/1005] wifi: mac80211: abort chanswitch when leaving an IBSS
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (464 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0465/1005] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0467/1005] net: fix mac_len of skbs copied by generic XDP Greg Kroah-Hartman
` (532 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luka Gejak, Mehmet Fide,
Johannes Berg, 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 12f97c692dcbce088554a5530c79c55174ccee1a ]
ieee80211_ibss_disconnect() leaves CSA active, as ieee80211_stop_mesh()
did until commit ac7472a24bd4 ("wifi: mac80211: abort chanswitch when
leaving a mesh"). An IBSS left during its countdown and joined again
refuses every new channel switch with -EBUSY.
Abort the channel switch the same way.
Fixes: cd7760e62c2a ("mac80211: add support for CSA in IBSS mode")
Reported-by: Luka Gejak <luka.gejak@linux.dev>
Closes: https://lore.kernel.org/linux-wireless/796598480d47c5bf474d11828769e864b8209558@linux.dev/
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20261025193615.1123718-1-mehmet.fide@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/ibss.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index d74b66426349a..b9ab4ceb03325 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -669,6 +669,10 @@ static void ieee80211_ibss_disconnect(struct ieee80211_sub_if_data *sdata)
ifibss->state = IEEE80211_IBSS_MLME_SEARCH;
netif_carrier_off(sdata->dev);
+
+ sdata->vif.bss_conf.csa_active = false;
+ ieee80211_vif_unblock_queues_csa(sdata);
+
if (!sta_info_flush(sdata, -1))
synchronize_net();
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0467/1005] net: fix mac_len of skbs copied by generic XDP
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (465 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0466/1005] wifi: mac80211: abort chanswitch when leaving an IBSS Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0468/1005] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
` (531 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tianyi Gao,
Toke Høiland-Jørgensen, Paolo Abeni, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianyi Gao <tianyi@cloudflare.com>
[ Upstream commit 71578e43b8a6723025579a08a707f4975a3cd567 ]
skb_pp_cow_data() copies the header fields of the old skb with
skb_copy_header(). skb_copy_header() does not copy mac_len.
Generic XDP uses skb_pp_cow_data() for programs with frags support.
After such a program, the skb can have mac_len 0.
cpu_map_generic_redirect() and tc ingress then get the position of the
Ethernet header wrong.
Copy mac_len in skb_pp_cow_data(), as dev_map_generic_redirect() does
after skb_copy().
Fixes: e6d5dbdd20aa ("xdp: add multi-buff support for xdp running in generic mode")
Signed-off-by: Tianyi Gao <tianyi@cloudflare.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20261103200036.65764-3-tianyi@cloudflare.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/skbuff.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ac78f28daea31..b24a949bd546e 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -966,6 +966,7 @@ int skb_pp_cow_data(struct page_pool *pool, struct sk_buff **pskb,
skb_reserve(nskb, headroom);
skb_copy_header(nskb, skb);
+ nskb->mac_len = skb->mac_len;
skb_mark_for_recycle(nskb);
err = skb_copy_bits(skb, 0, nskb->data, size);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0468/1005] ovl: release the upperdir/workdir in-use locks before the umount sync
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (466 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0467/1005] net: fix mac_len of skbs copied by generic XDP Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0469/1005] net: mana: fix XDP_REDIRECT of pre-allocated RX buffers Greg Kroah-Hartman
` (530 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miklos Szeredi, Amir Goldstein,
Pavel Tikhomirov, Denis V. Lunev, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis V. Lunev <den@openvz.org>
[ Upstream commit cb6c084182d4c69b7eeff0bd519dd7e018749602 ]
The in-use locks on upperdir and workdir are released by ovl_free_fs()
from ->put_super(). generic_shutdown_super() calls sync_filesystem()
before that, and ovl_sync_fs() syncs the whole upper filesystem, so the
locks stay held across a journal commit and a cache flush of the upper
fs after the overlay is gone. With index=on a new overlay that uses the
same upperdir, or uses it as a lowerdir, fails to mount in that window:
overlayfs: upperdir is in-use as upperdir/workdir of another mount,
mount with '-o index=off' to override exclusive upperdir protection.
Userspace hits this when the last reference is not dropped by umount(2)
itself. Docker with the containerd snapshotter mounts a snapshot on a
thread with a private mount namespace for docker cp and for buildkit,
and the superblock dies when that thread exits, after the reply to the
client has gone out. The next request then gets EBUSY. The window grows
with the flush latency of the upper fs and is there even if nothing was
written through the overlay, as the mount itself dirties the upper.
->kill_sb() is called once s_active drops to zero, with no mount and no
open file left. Release the locks there, before generic_shutdown_super()
runs. What the dying superblock still does to the upper fs, the sync and
dropping its references to upper dentries and inodes, does not touch the
contents of upperdir or workdir. ovl_free_fs() still releases the locks
for a failed mount, so clear the *_locked flags to keep it from
unlocking a second time and dropping the lock of a newer mount.
This takes the sync out of the window but does not close it: the final
mntput of a dying mount namespace runs from task_work, after the exiting
thread may have reported completion. Userspace that needs the
directories free should umount(2) before saying the job is done.
Fixes: 2cac0c00a6cd ("ovl: get exclusive ownership on upper/work dirs")
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/overlayfs.h | 1 +
fs/overlayfs/params.c | 5 +----
fs/overlayfs/super.c | 12 +++++++++++-
fs/overlayfs/util.c | 12 ++++++++++++
4 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index a5aa22cc79a83..5966d46e09d6a 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -580,6 +580,7 @@ static inline int ovl_set_impure_dir(struct dentry *dentry)
bool ovl_inuse_trylock(struct dentry *dentry);
void ovl_inuse_unlock(struct dentry *dentry);
bool ovl_is_inuse(struct dentry *dentry);
+void ovl_inuse_unlock_all(struct ovl_fs *ofs);
bool ovl_need_index(struct dentry *dentry);
int ovl_nlink_start(struct dentry *dentry);
void ovl_nlink_end(struct dentry *dentry);
diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c
index 5a15e5478a6b8..ad7f30177ef4c 100644
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -845,15 +845,12 @@ void ovl_free_fs(struct ovl_fs *ofs)
struct vfsmount **mounts;
unsigned i;
+ ovl_inuse_unlock_all(ofs);
iput(ofs->workbasedir_trap);
iput(ofs->workdir_trap);
dput(ofs->whiteout);
dput(ofs->workdir);
- if (ofs->workdir_locked)
- ovl_inuse_unlock(ofs->workbasedir);
dput(ofs->workbasedir);
- if (ofs->upperdir_locked)
- ovl_inuse_unlock(ovl_upper_mnt(ofs)->mnt_root);
/* Reuse ofs->config.lowerdirs as a vfsmount array before freeing it */
mounts = (struct vfsmount **) ofs->config.lowerdirs;
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index c06bfe9765e25..0a923ae126964 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1598,13 +1598,23 @@ int ovl_fill_super(struct super_block *sb, struct fs_context *fc)
return err;
}
+static void ovl_kill_sb(struct super_block *sb)
+{
+ struct ovl_fs *ofs = OVL_FS(sb);
+
+ /* Nothing can modify them now, do not hold them across the sync */
+ if (ofs)
+ ovl_inuse_unlock_all(ofs);
+ kill_anon_super(sb);
+}
+
struct file_system_type ovl_fs_type = {
.owner = THIS_MODULE,
.name = "overlay",
.init_fs_context = ovl_init_fs_context,
.parameters = ovl_parameter_spec,
.fs_flags = FS_USERNS_MOUNT | FS_ALLOW_IDMAP,
- .kill_sb = kill_anon_super,
+ .kill_sb = ovl_kill_sb,
};
MODULE_ALIAS_FS("overlay");
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 04103a6741ba0..b31b8f7d7ce0f 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -1059,6 +1059,18 @@ bool ovl_is_inuse(struct dentry *dentry)
return inuse;
}
+void ovl_inuse_unlock_all(struct ovl_fs *ofs)
+{
+ if (ofs->workdir_locked) {
+ ovl_inuse_unlock(ofs->workbasedir);
+ ofs->workdir_locked = false;
+ }
+ if (ofs->upperdir_locked) {
+ ovl_inuse_unlock(ovl_upper_mnt(ofs)->mnt_root);
+ ofs->upperdir_locked = false;
+ }
+}
+
/*
* Does this overlay dentry need to be indexed on copy up?
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0469/1005] net: mana: fix XDP_REDIRECT of pre-allocated RX buffers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (467 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0468/1005] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0470/1005] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
` (529 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Orgad Shaneh, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Orgad Shaneh <orgads@gmail.com>
[ Upstream commit 67869597fab06abaa5b977cb7004532269fc960b ]
mana_pre_alloc_rxbufs() fills the RX rings with plain pages from
dev_alloc_pages() (from_pool == false), but the rxq is registered with
MEM_TYPE_PAGE_POOL and mana_run_xdp() builds every xdp_buff with that
rxq info. mana_rx_skb() frees a !from_pool buffer correctly on
XDP_PASS, XDP_TX and XDP_DROP, but a redirected buffer is freed through
its memory model: __xdp_return() hands the plain page to
page_pool_put_full_netmem(). This triggers the WARN in
include/net/page_pool/helpers.h, breaks the page refcount, RX refills
fail and the queue stops receiving.
The pre-allocated buffers fill the whole ring of every rxq created by
an MTU change, by ethtool -L / -G and, since
commit 730ff06d3f5c ("net: mana: Use page pool fragments for RX buffers
instead of full pages to improve memory efficiency."), by every XDP
attach and detach. So on current kernels the first ring of redirected
packets after attaching an XDP program always hits this.
Reproduced on 7.2.11, and on 6.12.113 after ethtool -L, on an Azure
MANA VF: an XDP program that redirects UDP to an XSKMAP with an AF_XDP
socket in copy mode gives WARNINGs at __xdp_return+0x249 (stack
__xsk_map_redirect, xdp_do_redirect, mana_run_xdp, mana_poll), then
the queue stops.
Give each rxq a second xdp_rxq_info registered with
MEM_TYPE_PAGE_SHARED, the model these buffers had before the page pool
was added, and use it for buffers that are not from the pool. Those
buffers are already DMA-unmapped by mana_refill_rx_oob() before XDP
runs, and page_frag_free() frees them whatever their order. Allocating
the pre-allocated buffers from the page pool instead would need the
pools to exist before the rxqs and to outlive them, a much larger
change.
Found, fixed and tested with an AI coding assistant (Claude Code).
Fixes: b1d13f7a3b53 ("net: mana: Add page pool for RX buffers")
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
Link: https://patch.msgid.link/20261102064324.806414-1-orgads@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/microsoft/mana/mana_bpf.c | 9 +++++++--
drivers/net/ethernet/microsoft/mana/mana_en.c | 11 ++++++++++-
include/net/mana/mana.h | 5 ++++-
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/microsoft/mana/mana_bpf.c b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
index b27fd9b8c4f6d..3b6f756119445 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_bpf.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
@@ -78,7 +78,8 @@ int mana_xdp_xmit(struct net_device *ndev, int n, struct xdp_frame **frames,
}
u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq,
- struct xdp_buff *xdp, void *buf_va, uint pkt_len)
+ struct xdp_buff *xdp, void *buf_va, bool from_pool,
+ uint pkt_len)
{
struct mana_stats_rx *rx_stats;
struct bpf_prog *prog;
@@ -90,7 +91,11 @@ u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq,
if (!prog)
goto out;
- xdp_init_buff(xdp, PAGE_SIZE, &rxq->xdp_rxq);
+ /* A redirected buffer is freed by its memory model, so a buffer not
+ * from the page pool must not claim MEM_TYPE_PAGE_POOL.
+ */
+ xdp_init_buff(xdp, PAGE_SIZE,
+ from_pool ? &rxq->xdp_rxq : &rxq->xdp_rxq_shared);
xdp_prepare_buff(xdp, buf_va, rxq->headroom, pkt_len, true);
act = bpf_prog_run_xdp(prog, xdp);
diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 89af8bf6758b7..428e53d91f8db 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -2126,7 +2126,7 @@ static void mana_rx_skb(void *buf_va, bool from_pool,
return;
}
- act = mana_run_xdp(ndev, rxq, &xdp, buf_va, pkt_len);
+ act = mana_run_xdp(ndev, rxq, &xdp, buf_va, from_pool, pkt_len);
if (act == XDP_REDIRECT && !rxq->xdp_rc)
return;
@@ -2919,6 +2919,9 @@ static void mana_destroy_rxq(struct mana_port_context *apc,
if (xdp_rxq_info_is_reg(&rxq->xdp_rxq))
xdp_rxq_info_unreg(&rxq->xdp_rxq);
+ if (xdp_rxq_info_is_reg(&rxq->xdp_rxq_shared))
+ xdp_rxq_info_unreg(&rxq->xdp_rxq_shared);
+
if (rxq->rxobj != INVALID_MANA_HANDLE)
mana_destroy_wq_obj(apc, GDMA_RQ, rxq->rxobj);
@@ -3203,6 +3206,12 @@ static struct mana_rxq *mana_create_rxq(struct mana_port_context *apc,
WARN_ON(xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq, MEM_TYPE_PAGE_POOL,
rxq->page_pool));
+ /* The pre-allocated buffers (mana_pre_alloc_rxbufs) are plain pages */
+ WARN_ON(xdp_rxq_info_reg(&rxq->xdp_rxq_shared, ndev, rxq_idx,
+ cq->napi.napi_id));
+ WARN_ON(xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq_shared,
+ MEM_TYPE_PAGE_SHARED, NULL));
+
/* Initialize the DIM work before enabling NAPI, so that a poll
* cannot reach net_dim() with an uninitialized cq->dim.work.
*/
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index e46ba02529c29..6a761672bd5bb 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -421,6 +421,8 @@ struct mana_rxq {
struct bpf_prog __rcu *bpf_prog;
struct xdp_rxq_info xdp_rxq;
+ /* For buffers not from the page pool (from_pool == false) */
+ struct xdp_rxq_info xdp_rxq_shared;
void *xdp_save_va; /* for reusing */
bool xdp_flush;
int xdp_rc; /* XDP redirect return code */
@@ -694,7 +696,8 @@ void mana_xdp_tx(struct sk_buff *skb, struct net_device *ndev);
int mana_xdp_xmit(struct net_device *ndev, int n, struct xdp_frame **frames,
u32 flags);
u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq,
- struct xdp_buff *xdp, void *buf_va, uint pkt_len);
+ struct xdp_buff *xdp, void *buf_va, bool from_pool,
+ uint pkt_len);
struct bpf_prog *mana_xdp_get(struct mana_port_context *apc);
void mana_chn_setxdp(struct mana_port_context *apc, struct bpf_prog *prog);
int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0470/1005] bonding: fix slave_cnt leak on XDP enslave failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (468 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0469/1005] net: mana: fix XDP_REDIRECT of pre-allocated RX buffers Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0471/1005] sched_ext: Fix partial-SMT core counting in calc_shard_layout() Greg Kroah-Hartman
` (528 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, 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 a978095699641d4f83a32b499a981c419c94abca ]
bond_enslave() increments bond->slave_cnt before setting up XDP on the
new slave. If that setup fails (slave has no XDP support, already has
an XDP program, or dev_xdp_propagate() fails), the error path jumps to
err_sysfs_del, which never decrements slave_cnt.
Each failed enslave therefore leaves slave_cnt one too high:
- SIOCBONDINFOQUERY reports a wrong num_slaves,
- balance-rr picks slave ids beyond the end of the slave list, so
bond_get_slave_by_id() falls back to the first usable slave and
transmit is skewed toward it.
Reproducer:
ip link add bond0 type bond mode balance-rr
ip link set bond0 xdpdrv obj xdp_dummy.bpf.o sec xdp
for i in 0 1 2; do
ip link add d$i type dummy
ip link set d$i master bond0 # fails: Slave does not support XDP
done
num_slaves read via SIOCBONDINFOQUERY is 3 before this patch, 0 after.
Add an err_dec_slave_cnt label ahead of err_sysfs_del and use it from
the three XDP failure paths, which are the only failures after the
increment.
Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261104092851.688361-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/bonding/bond_main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a1c156c145b2d..e9f5e753f6770 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2305,7 +2305,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
SLAVE_NL_ERR(bond_dev, slave_dev, extack,
"Slave does not support XDP");
res = -EOPNOTSUPP;
- goto err_sysfs_del;
+ goto err_dec_slave_cnt;
}
} else if (bond->xdp_prog) {
struct netdev_bpf xdp = {
@@ -2319,14 +2319,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
SLAVE_NL_ERR(bond_dev, slave_dev, extack,
"Slave has XDP program loaded, please unload before enslaving");
res = -EOPNOTSUPP;
- goto err_sysfs_del;
+ goto err_dec_slave_cnt;
}
res = dev_xdp_propagate(slave_dev, &xdp);
if (res < 0) {
/* ndo_bpf() sets extack error message */
slave_dbg(bond_dev, slave_dev, "Error %d calling ndo_bpf\n", res);
- goto err_sysfs_del;
+ goto err_dec_slave_cnt;
}
if (bond->xdp_prog)
bpf_prog_inc(bond->xdp_prog);
@@ -2348,6 +2348,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
return 0;
/* Undo stages on error */
+err_dec_slave_cnt:
+ WRITE_ONCE(bond->slave_cnt, bond->slave_cnt - 1);
+
err_sysfs_del:
bond_sysfs_slave_del(new_slave);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0471/1005] sched_ext: Fix partial-SMT core counting in calc_shard_layout()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (469 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0470/1005] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0472/1005] cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork() Greg Kroah-Hartman
` (527 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhang Qiao, Tejun Heo, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Qiao <zhangqiao22@huawei.com>
[ Upstream commit 3b1ce3e0ccba4aadbf6330a5ed8bda78f0c9353a ]
calc_shard_layout() counts the cores of an LLC to spread them evenly
across shards. A core is counted when its cpu is the first cpu of
topology_sibling_cpumask(), but the cores scx_cid_init() builds are
the siblings intersected with @llc_cpus.
The sibling mask may contain cpus outside @llc_cpus - siblings which
landed in another node or LLC unit, or offlined siblings on archs
that keep them in the mask (mips, sparc64). A core whose first
sibling is such a cpu is never counted, so cores_per_shard and
nr_large come out too small and the shards end up uneven.
Count a core at its first sibling in @llc_cpus, matching the cores the
build loop constructs.
Fixes: e2c841b91bf9 ("sched_ext: Add CID sharding")
Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/ext/cid.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/ext/cid.c b/kernel/sched/ext/cid.c
index 3d0687184b448..17c86f25a59cd 100644
--- a/kernel/sched/ext/cid.c
+++ b/kernel/sched/ext/cid.c
@@ -63,7 +63,13 @@ static void calc_shard_layout(const struct cpumask *llc_cpus, u32 shard_size,
for_each_cpu(cpu, llc_cpus) {
nr_cpus++;
- if (cpumask_first(topology_sibling_cpumask(cpu)) == cpu)
+ /*
+ * scx_cid_init() forms each core from the siblings in
+ * @llc_cpus. The sibling mask may include cpus outside
+ * @llc_cpus, so count a core at its first sibling in @llc_cpus.
+ */
+ if (cpumask_first_and(topology_sibling_cpumask(cpu),
+ llc_cpus) == cpu)
nr_cores++;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0472/1005] cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (470 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0471/1005] sched_ext: Fix partial-SMT core counting in calc_shard_layout() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0473/1005] NFS: dont let delegated c/mtime stamps go backward Greg Kroah-Hartman
` (526 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Waiman Long, Ridong Chen,
Tejun Heo, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit a25cc4c75fdd8921f160bc3950665889eba7374b ]
Reading mems_allowed of the current task outside of cpuset_mutex critical
section should be protected by using mems_allowed_seq seqlock as the
nodemask can be updated concurrently leading to a torn read. Such
protection is currently not implemented in cpuset_fork() for the
!CLONE_INTO_CGROUP case. As a result, the child task may inherit an empty
or corrupted mems_allowed nodemask. This violates NUMA memory policy
constraints and causes subsequent page allocations to unconditionally
fail, potentially leading to crashes or spurious OOM killer invocations
for the child task.
Fix that by using a read_mems_allowed_begin/read_mems_allowed_retry()
loop to protect the mems_allowed read.
Fixes: 06f4e9489891 ("cpuset: make sure new tasks conform to the current config of the cpuset")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/bug/linux-601100b4-fa77-45fd-99f9-bfbd4385201f
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Ridong Chen <ridong.chen@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 8f0979b73e20f..67d79749a1444 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -3980,11 +3980,20 @@ static void cpuset_fork(struct task_struct *task)
rcu_read_unlock();
if (cs == oldcs) {
+ unsigned int seq;
+
if (cs == &top_cpuset)
return;
set_cpus_allowed_ptr(task, current->cpus_ptr);
- task->mems_allowed = current->mems_allowed;
+ /*
+ * A cpuset.mems update can update current->mems_allowed
+ * concurrently, so retry it again if it really happens.
+ */
+ do {
+ seq = read_mems_allowed_begin();
+ task->mems_allowed = current->mems_allowed;
+ } while (read_mems_allowed_retry(seq));
return;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0473/1005] NFS: dont let delegated c/mtime stamps go backward
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (471 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0472/1005] cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0474/1005] NFS: stamp after the servers ctime when truncating under delegated times Greg Kroah-Hartman
` (525 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jeff Layton, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@kernel.org>
[ Upstream commit 427d4cd8048c8e18e7d0c7d0637e7fbec9fba078 ]
With a timestamp delegation the client stamps c/mtime from its own
coarse clock. That can land before the server's fine-grained ctime the
client cached from the OPEN or SETATTR reply, e.g. on a WRITE right
after an exclusive create. The server then either rejects the times
(they don't pass dl_ctime) or can't apply the ctime, since
inode_set_ctime_deleg() never moves ctime backward. Either way the
c/mtime the client reported while holding the delegation changes
after DELEGRETURN; git t1092 over NFSv4.2 sees a stat-dirty file.
When a delegated stamp isn't after the cached ctime, use the cached
ctime + 1ns instead. Compute the stamp before storing it, so lockless
readers (getattr, CB_GETATTR) never see the trailing coarse time.
Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/inode.c | 40 ++++++++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index cb414396063d4..c07e56c313903 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -623,25 +623,33 @@ nfs_fattr_fixup_delegated(struct inode *inode, struct nfs_fattr *fattr)
}
}
+/*
+ * With delegated timestamps, the client's coarse clock can trail the
+ * server's fine-grained ctime cached from an OPEN or SETATTR reply. The
+ * server won't move ctime backward when the times are returned, so a
+ * new stamp must land after the cached ctime.
+ */
+static struct timespec64 nfs_delegated_stamp(struct inode *inode)
+{
+ struct timespec64 ctime = inode_get_ctime(inode);
+ struct timespec64 now = current_time(inode);
+
+ if (timespec64_compare(&now, &ctime) <= 0) {
+ now = ctime;
+ timespec64_add_ns(&now, 1);
+ }
+ return now;
+}
+
static void nfs_set_timestamps_to_ts(struct inode *inode, struct iattr *attr)
{
unsigned int cache_flags = 0;
if (attr->ia_valid & ATTR_MTIME_SET) {
- struct timespec64 ctime = inode_get_ctime(inode);
- struct timespec64 mtime = inode_get_mtime(inode);
- struct timespec64 now;
- bool updated = false;
-
- now = inode_set_ctime_current(inode);
- if (!timespec64_equal(&now, &ctime))
- updated = true;
-
+ /* The stamp is always after the old ctime */
+ inode_set_ctime_to_ts(inode, nfs_delegated_stamp(inode));
inode_set_mtime_to_ts(inode, attr->ia_mtime);
- if (!timespec64_equal(&now, &mtime))
- updated = true;
-
- inode_maybe_inc_iversion(inode, updated);
+ inode_maybe_inc_iversion(inode, true);
cache_flags |= NFS_INO_INVALID_CTIME | NFS_INO_INVALID_MTIME;
}
if (attr->ia_valid & ATTR_ATIME) {
@@ -659,7 +667,11 @@ static void nfs_update_atime(struct inode *inode)
static void nfs_update_mtime(struct inode *inode)
{
- inode_update_time(inode, FS_UPD_CMTIME, 0);
+ struct timespec64 now = nfs_delegated_stamp(inode);
+
+ /* Not inode_update_time(): lockless readers would see its stamp */
+ inode_set_ctime_to_ts(inode, now);
+ inode_set_mtime_to_ts(inode, now);
NFS_I(inode)->cache_validity &=
~(NFS_INO_INVALID_CTIME | NFS_INO_INVALID_MTIME);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0474/1005] NFS: stamp after the servers ctime when truncating under delegated times
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (472 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0473/1005] NFS: dont let delegated c/mtime stamps go backward Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0475/1005] NFS: stamp after the servers ctime following a CLONE Greg Kroah-Hartman
` (524 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jeff Layton, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@kernel.org>
[ Upstream commit f13110f9cfb95a09d286eee561adc96c6a02664f ]
A size-changing SETATTR always has the server stamp c/mtime
(__nfsd_setattr(), per RFC 5661 section 18.30.4). With delegated
timestamps the client discards the reply's ctime and stamps its own in
nfs_vmtruncate(), clamped only against its cached ctime. A coarse client
stamp can still land before the server's, which then won't move ctime
back when the holder returns its times, so ctime changes after
DELEGRETURN.
- Raise the cached ctime to the reply's before nfs_vmtruncate() stamps,
so the delegated stamp lands after the server's.
- Stamp before nfs_vmtruncate() drops i_lock for truncate_pagecache(),
not after. A delegation return starting in that window made the stamp
a no-op, and DELEGRETURN sent the pre-truncate mtime, which the server
could apply over its own truncate stamp.
Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/inode.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index c07e56c313903..24ad11d71ec5c 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -641,6 +641,21 @@ static struct timespec64 nfs_delegated_stamp(struct inode *inode)
return now;
}
+/*
+ * The server stamped c/mtime itself (e.g. for a size change). Raise the
+ * cached ctime to the server's so that the next delegated stamp lands
+ * after it.
+ */
+static void nfs_delegated_ctime_raise(struct inode *inode,
+ const struct nfs_fattr *fattr)
+{
+ struct timespec64 ctime = inode_get_ctime(inode);
+
+ if ((fattr->valid & NFS_ATTR_FATTR_CTIME) &&
+ timespec64_compare(&fattr->ctime, &ctime) > 0)
+ inode_set_ctime_to_ts(inode, fattr->ctime);
+}
+
static void nfs_set_timestamps_to_ts(struct inode *inode, struct iattr *attr)
{
unsigned int cache_flags = 0;
@@ -814,10 +829,14 @@ static int nfs_vmtruncate(struct inode * inode, loff_t offset)
nfs_ooo_clear(NFS_I(inode));
}
NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_SIZE;
+ /*
+ * Stamp in the same i_lock section that checked the delegation and
+ * raised ctime, before a delegation return can start.
+ */
+ nfs_update_delegated_mtime_locked(inode);
spin_unlock(&inode->i_lock);
truncate_pagecache(inode, offset);
- nfs_update_delegated_mtime_locked(inode);
spin_lock(&inode->i_lock);
out:
return err;
@@ -843,6 +862,8 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr,
if ((attr->ia_valid & ATTR_SIZE) != 0) {
if (!nfs_have_delegated_mtime(inode))
nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME);
+ else
+ nfs_delegated_ctime_raise(inode, fattr);
nfs_set_cache_invalid(inode, NFS_INO_INVALID_BLOCKS);
nfs_inc_stats(inode, NFSIOS_SETATTRTRUNC);
nfs_vmtruncate(inode, attr->ia_size);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0475/1005] NFS: stamp after the servers ctime following a CLONE
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (473 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0474/1005] NFS: stamp after the servers ctime when truncating under delegated times Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0476/1005] NFSv4: wake blocking lock waiters when a delegated lock is released Greg Kroah-Hartman
` (523 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jeff Layton, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@kernel.org>
[ Upstream commit 23b9cf773211d536147aa53ade68a88d457838ac ]
nfs42_copy_dest_done() stamps the client's own c/mtime when it holds
delegated timestamps. A server that stamps c/mtime on CLONE (as nfsd did
before "nfsd: mark the delegation written on COPY/CLONE instead of
stamping c/mtime", and as btrfs did before "btrfs: honor FMODE_NOCMTIME
when cloning") can end up with a ctime newer than the client's coarse
stamp, which it won't move back when the holder returns its times.
The stamp didn't survive anyway: nfs_post_op_update_inode() then marks
ctime invalid, so nfs_fattr_fixup_delegated() keeps the reply's ctime
and nfs_update_inode() writes it over the stamp. Against a server that
no longer stamps on CLONE, the client's ctime goes back to its old value
until DELEGRETURN.
- Pass the CLONE reply's attributes to nfs42_copy_dest_done() and raise
the cached ctime to the server's before stamping. COPY returns no
attributes, so it passes NULL.
- Stamp before dropping i_lock, so a concurrent refresh can't take the
server's times while ctime and mtime are marked invalid.
- Under delegated timestamps, apply the reply with nfs_refresh_inode(),
which doesn't mark ctime invalid.
Fixes: 6e7daa3dad29 ("NFSv4.2: fix CLONE/COPY attrs in presence of delegated attributes")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/delegation.h | 2 ++
fs/nfs/inode.c | 6 ++++--
fs/nfs/nfs42proc.c | 25 ++++++++++++++++++++-----
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/fs/nfs/delegation.h b/fs/nfs/delegation.h
index fba4699952b81..cd6142939d34d 100644
--- a/fs/nfs/delegation.h
+++ b/fs/nfs/delegation.h
@@ -95,6 +95,8 @@ void nfs4_inode_make_writeable(struct inode *inode);
void nfs_update_delegated_atime(struct inode *inode);
void nfs_update_delegated_mtime(struct inode *inode);
void nfs_update_delegated_mtime_locked(struct inode *inode);
+void nfs_delegated_ctime_raise(struct inode *inode,
+ const struct nfs_fattr *fattr);
static inline int nfs_have_read_or_write_delegation(struct inode *inode)
{
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 24ad11d71ec5c..beffa3a2968c8 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -646,8 +646,8 @@ static struct timespec64 nfs_delegated_stamp(struct inode *inode)
* cached ctime to the server's so that the next delegated stamp lands
* after it.
*/
-static void nfs_delegated_ctime_raise(struct inode *inode,
- const struct nfs_fattr *fattr)
+void nfs_delegated_ctime_raise(struct inode *inode,
+ const struct nfs_fattr *fattr)
{
struct timespec64 ctime = inode_get_ctime(inode);
@@ -655,6 +655,7 @@ static void nfs_delegated_ctime_raise(struct inode *inode,
timespec64_compare(&fattr->ctime, &ctime) > 0)
inode_set_ctime_to_ts(inode, fattr->ctime);
}
+EXPORT_SYMBOL_GPL(nfs_delegated_ctime_raise);
static void nfs_set_timestamps_to_ts(struct inode *inode, struct iattr *attr)
{
@@ -705,6 +706,7 @@ void nfs_update_delegated_mtime_locked(struct inode *inode)
nfs_have_directory_delegation(inode))
nfs_update_mtime(inode);
}
+EXPORT_SYMBOL_GPL(nfs_update_delegated_mtime_locked);
void nfs_update_delegated_mtime(struct inode *inode)
{
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index ab86246fc364f..09b4a6ecad880 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -380,6 +380,7 @@ static int process_copy_commit(struct file *dst, loff_t pos_dst,
* @pos: destination offset
* @len: copy length
* @oldsize: length of the file prior to clone/copy
+ * @fattr: destination attributes from the reply, or NULL
*
* Punch a hole in the inode page cache, so that the NFS client will
* know to retrieve new data.
@@ -387,7 +388,7 @@ static int process_copy_commit(struct file *dst, loff_t pos_dst,
* invalid cached values for change attribute, ctime, mtime and space used.
*/
static void nfs42_copy_dest_done(struct file *file, loff_t pos, loff_t len,
- loff_t oldsize)
+ loff_t oldsize, const struct nfs_fattr *fattr)
{
struct inode *inode = file_inode(file);
struct address_space *mapping = file->f_mapping;
@@ -405,8 +406,12 @@ static void nfs42_copy_dest_done(struct file *file, loff_t pos, loff_t len,
NFS_INO_INVALID_CTIME |
NFS_INO_INVALID_MTIME |
NFS_INO_INVALID_BLOCKS);
+ /* The server may have stamped c/mtime; stamp after it */
+ if (fattr && nfs_have_delegated_mtime(inode))
+ nfs_delegated_ctime_raise(inode, fattr);
+ /* Before a refresh can see the times invalid and take the server's */
+ nfs_update_delegated_mtime_locked(inode);
spin_unlock(&inode->i_lock);
- nfs_update_delegated_mtime(inode);
}
static ssize_t _nfs42_proc_copy(struct file *src,
@@ -506,7 +511,8 @@ static ssize_t _nfs42_proc_copy(struct file *src,
goto out;
}
- nfs42_copy_dest_done(dst, pos_dst, res->write_res.count, oldsize_dst);
+ nfs42_copy_dest_done(dst, pos_dst, res->write_res.count, oldsize_dst,
+ NULL);
nfs_invalidate_atime(src_inode);
status = res->write_res.count;
out:
@@ -1311,8 +1317,17 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
/* a zero-length count means clone to EOF in src */
if (count == 0 && res.dst_fattr->valid & NFS_ATTR_FATTR_SIZE)
count = nfs_size_to_loff_t(res.dst_fattr->size) - dst_offset;
- nfs42_copy_dest_done(dst_f, dst_offset, count, oldsize_dst);
- status = nfs_post_op_update_inode(dst_inode, res.dst_fattr);
+ nfs42_copy_dest_done(dst_f, dst_offset, count, oldsize_dst,
+ res.dst_fattr);
+ /*
+ * nfs_post_op_update_inode() would mark ctime invalid, so the
+ * reply's ctime would overwrite the delegated stamp.
+ */
+ if (nfs_have_delegated_mtime(dst_inode))
+ status = nfs_refresh_inode(dst_inode, res.dst_fattr);
+ else
+ status = nfs_post_op_update_inode(dst_inode,
+ res.dst_fattr);
}
kfree(res.dst_fattr);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0476/1005] NFSv4: wake blocking lock waiters when a delegated lock is released
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (474 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0475/1005] NFS: stamp after the servers ctime following a CLONE Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0477/1005] NFSv4: remember that the server may send CB_NOTIFY_LOCK Greg Kroah-Hartman
` (522 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Olga Kornievskaia, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olga Kornievskaia <okorniev@redhat.com>
[ Upstream commit e8433473eca284bc561373d0a0fff632f76aa594 ]
When the client holds a delegation, _nfs4_proc_setlk() caches POSIX
locks locally and never sends a LOCK to the server. It has to strip
FL_SLEEP to do so, since that branch runs holding
sp->so_delegreturn_mutex and nfsi->rwsem and F_SETLKW can block
indefinitely. A contending waiter is therefore never placed on the VFS
blocked-lock list, and locks_wake_up_blocks() does not reach it when the
holder releases.
The waiter blocks in nfs4_retry_setlk() on clp->cl_lock_waitq instead,
whose only waker is nfs4_callback_notify_lock(). The server never saw a
LOCK for a cached lock, so it does not know anyone is waiting and will
never send a CB_NOTIFY_LOCK; nfs4_proc_unlck() returns early without
sending LOCKU for the same reason. The waiter sleeps out the full
NFS4_LOCK_MAXTIMEOUT of 30s before retrying a lock that is long free.
Wake cl_lock_waitq when releasing a cached lock. The releasing thread
cannot tell which waiter wants the lock, so the wakeup names only the
inode; make the owner comparison in nfs4_wake_lock_waiter() conditional
on cbnl_valid so that a CB_NOTIFY_LOCK still wakes exactly the owner it
names. The inode restriction matters: without it every blocked locker
for the server is woken, and those on non-delegated state each retry
with a LOCK RPC.
Fixes: a1d617d8f134 ("nfs: allow blocking locks to be awoken by lock callbacks")
Assisted-by: Claude Opus 5
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/nfs4proc.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 028459fb6edbf..ebc431906a453 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7287,8 +7287,15 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *
if (status != 0)
goto out;
/* Is this a delegated lock? */
- if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) == 0)
+ if (test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) == 0) {
+ struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
+ struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
+
+ /* The server never saw it, so it will not notify waiters */
+ nfs_copy_fh(&cbnl.cbnl_fh, NFS_FH(inode));
+ __wake_up(&clp->cl_lock_waitq, TASK_NORMAL, 0, &cbnl);
goto out;
+ }
alloc_seqid = NFS_SERVER(inode)->nfs_client->cl_mvops->alloc_seqid;
seqid = alloc_seqid(&lsp->ls_seqid, GFP_KERNEL);
status = -ENOMEM;
@@ -7708,8 +7715,14 @@ nfs4_wake_lock_waiter(wait_queue_entry_t *wait, unsigned int mode, int flags, vo
struct nfs_lowner *lowner = &cbnl->cbnl_owner,
*wowner = &waiter->owner;
- /* Only wake if the callback was for the same owner. */
- if (lowner->id != wowner->id || lowner->s_dev != wowner->s_dev)
+ /*
+ * Only wake the owner a CB_NOTIFY_LOCK names. A lock cached
+ * under a delegation is released locally, and the releasing
+ * thread cannot tell which waiter wants it, so those wakeups
+ * (cbnl_valid false) name only the inode and wake them all.
+ */
+ if (cbnl->cbnl_valid &&
+ (lowner->id != wowner->id || lowner->s_dev != wowner->s_dev))
return 0;
/* Make sure it's for the right inode */
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0477/1005] NFSv4: remember that the server may send CB_NOTIFY_LOCK
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (475 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0476/1005] NFSv4: wake blocking lock waiters when a delegated lock is released Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0478/1005] sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration Greg Kroah-Hartman
` (521 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Olga Kornievskaia, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olga Kornievskaia <okorniev@redhat.com>
[ Upstream commit 4fdc29eb6730207b4a6f63f81575c7aa5c2a4ff1 ]
Two processes contending for a POSIX lock on one file see occasional
acquisitions of almost exactly 1, 3 or 7 seconds when the client holds a
delegation, although the holder releases within microseconds.
nfs4_retry_setlk() only parks a waiter on clp->cl_lock_waitq when
NFS_STATE_MAY_NOTIFY_LOCK is set. Otherwise it uses
nfs4_retry_setlk_simple(), which has no waitqueue at all and sleeps on a
bare timeout starting at NFS4_LOCK_MINTIMEOUT and doubling, so a waiter
that loses one poll waits a second, then two, then four.
NFS_STATE_MAY_NOTIFY_LOCK is set in _nfs4_open_and_get_state() from the
OPEN reply rflags. It describes the server, but is recorded per
nfs4_state and can only be learned from a reply. Once a delegation is
held, further opens are satisfied from it with no OPEN on the wire, so
o_res.rflags is zero and the new state starts out believing no callback
can arrive, even though the open that obtained the delegation was told
otherwise.
Record the capability on the nfs_client the first time an OPEN reply
carries it, and apply it to every state built for that client.
nfs_client is the right scope: the flag describes one server,
CB_NOTIFY_LOCK arrives on that client's backchannel, and cl_lock_waitq
is per nfs_client.
This also covers a case the per-state flag misses. After the delegation
is recalled the state has neither NFS_DELEGATED_STATE nor
NFS_STATE_MAY_NOTIFY_LOCK, so locks go to the server and the server does
send CB_NOTIFY_LOCK, but the client is in the backoff loop and ignores
it.
Fixes: a8ce377a5db8 ("nfs: track whether server sets MAY_NOTIFY_LOCK flag")
Assisted-by: Claude Opus 5
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/nfs4proc.c | 2 ++
include/linux/nfs_fs_sb.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ebc431906a453..78cae03d33289 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3093,6 +3093,8 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
if (server->caps & NFS_CAP_POSIX_LOCK)
set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);
if (opendata->o_res.rflags & NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK)
+ server->nfs_client->cl_may_notify_lock = true;
+ if (server->nfs_client->cl_may_notify_lock)
set_bit(NFS_STATE_MAY_NOTIFY_LOCK, &state->flags);
if (opendata->o_res.rflags & NFS4_OPEN_RESULT_PRESERVE_UNLINKED)
set_bit(NFS_INO_PRESERVE_UNLINKED, &NFS_I(state->inode)->flags);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 34d294774f8ce..5f9415d7059e3 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -116,6 +116,7 @@ struct nfs_client {
#define NFS_SP4_MACH_CRED_COMMIT 6 /* COMMIT */
#define NFS_SP4_MACH_CRED_PNFS_CLEANUP 7 /* LAYOUTRETURN */
wait_queue_head_t cl_lock_waitq;
+ bool cl_may_notify_lock;
#endif /* CONFIG_NFS_V4 */
/* Our own IP address, as a null-terminated string.
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0478/1005] sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (476 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0477/1005] NFSv4: remember that the server may send CB_NOTIFY_LOCK Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0479/1005] sched_ext: make DSQ iterator stay drained after NULL Greg Kroah-Hartman
` (520 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 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 b3768d058c98d4e8114a246d3267d7dae1c123fb ]
scx_bpf_dsq_reenq() re-enqueues a whole DSQ, but a scheduler that loses the
cpus serving a DSQ, such as a sub-scheduler after a cap revoke, needs only
the stranded tasks placed again.
Add scx_bpf_dsq_reenq_task(), which marks a task from a DSQ iteration. When
the iteration ends, the DSQ's deferred re-enqueue walk is scheduled once and
re-enqueues only the marked tasks. The kfunc locks the task's rq and the DSQ
like scx_bpf_dsq_move() and is callable from the same contexts. The mark is
cleared when the task leaves the DSQ, so a task consumed before the walk is
not re-enqueued.
An iteration's DSQ can be destroyed before the iteration ends, so
schedule_dsq_reenq() now skips a destroyed DSQ instead of aborting the
scheduler. scx_bpf_dsq_reenq() racing scx_bpf_destroy_dsq() takes the same
path.
Declare the kfunc for the tools and add a compat probe.
v2: Note in the kerneldoc that another iteration's re-enqueue may take a
marked task early, and that a task on another scheduler returns false
(Andrea).
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Stable-dep-of: fcbff7b56a88 ("sched_ext: make DSQ iterator stay drained after NULL")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sched/ext.h | 1 +
kernel/sched/ext/ext.c | 82 +++++++++++++++++++++++-
kernel/sched/ext/internal.h | 2 +
tools/sched_ext/include/scx/common.bpf.h | 1 +
tools/sched_ext/include/scx/compat.bpf.h | 6 ++
5 files changed, 89 insertions(+), 3 deletions(-)
diff --git a/include/linux/sched/ext.h b/include/linux/sched/ext.h
index 81a29b3c0e5d8..444e1bfdab8fd 100644
--- a/include/linux/sched/ext.h
+++ b/include/linux/sched/ext.h
@@ -155,6 +155,7 @@ enum scx_ent_flags {
/* scx_entity.dsq_flags */
enum scx_ent_dsq_flags {
SCX_TASK_DSQ_ON_PRIQ = 1 << 0, /* task is queued on the priority queue of a dsq */
+ SCX_TASK_DSQ_REENQ = 1 << 1, /* marked by scx_bpf_dsq_reenq_task() */
};
enum scx_dsq_lnode_flags {
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index fd9f949f3647f..78773d42b32df 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -492,11 +492,13 @@ enum scx_dsq_iter_flags {
/* iterate in the reverse dispatch order */
SCX_DSQ_ITER_REV = 1U << 16,
+ __SCX_DSQ_ITER_HAS_REENQ = 1U << 29,
__SCX_DSQ_ITER_HAS_SLICE = 1U << 30,
__SCX_DSQ_ITER_HAS_VTIME = 1U << 31,
__SCX_DSQ_ITER_USER_FLAGS = SCX_DSQ_ITER_REV,
__SCX_DSQ_ITER_ALL_FLAGS = __SCX_DSQ_ITER_USER_FLAGS |
+ __SCX_DSQ_ITER_HAS_REENQ |
__SCX_DSQ_ITER_HAS_SLICE |
__SCX_DSQ_ITER_HAS_VTIME,
};
@@ -1175,7 +1177,9 @@ void schedule_dsq_reenq(struct scx_sched *sch, struct scx_dispatch_q *dsq,
WRITE_ONCE(dru->flags, dru->flags | reenq_flags);
}
} else {
- scx_error(sch, "DSQ 0x%llx not allowed for reenq", dsq->id);
+ /* destroyed since the caller resolved it, nothing to reenq */
+ if (READ_ONCE(dsq->id) != SCX_DSQ_INVALID)
+ scx_error(sch, "DSQ 0x%llx not allowed for reenq", dsq->id);
return;
}
@@ -1770,6 +1774,7 @@ void scx_task_unlink_from_dsq(struct task_struct *p, struct scx_dispatch_q *dsq)
RB_CLEAR_NODE(&p->scx.dsq_priq);
p->scx.dsq_flags &= ~SCX_TASK_DSQ_ON_PRIQ;
}
+ p->scx.dsq_flags &= ~SCX_TASK_DSQ_REENQ;
list_del_init(&p->scx.dsq_list.node);
dsq_dec_nr(dsq, p);
@@ -4746,7 +4751,9 @@ static void process_deferred_reenq_locals(struct rq *rq)
static bool user_task_should_reenq(struct task_struct *p, u64 reenq_flags, u32 *reason)
{
*reason = SCX_TASK_REENQ_KFUNC;
- return reenq_flags & SCX_REENQ_ANY;
+ if (reenq_flags & SCX_REENQ_ANY)
+ return true;
+ return (reenq_flags & SCX_REENQ_MARKED) && (p->scx.dsq_flags & SCX_TASK_DSQ_REENQ);
}
static void reenq_user(struct rq *rq, struct scx_dispatch_q *dsq, u64 reenq_flags)
@@ -9771,6 +9778,8 @@ BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_slice, KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_vtime, KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_dsq_move, KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_dsq_move_vtime, KF_RCU)
+/* also in scx_kfunc_ids_unlocked, same contexts as scx_bpf_dsq_move() */
+BTF_ID_FLAGS(func, scx_bpf_dsq_reenq_task, KF_RCU)
#ifdef CONFIG_EXT_SUB_SCHED
BTF_ID_FLAGS(func, scx_bpf_sub_dispatch, KF_IMPLICIT_ARGS)
#endif
@@ -9886,6 +9895,7 @@ BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_slice, KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_vtime, KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_dsq_move, KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_dsq_move_vtime, KF_RCU)
+BTF_ID_FLAGS(func, scx_bpf_dsq_reenq_task, KF_RCU)
/* also in scx_kfunc_ids_select_cpu: also callable from ops.select_cpu()/ops.enqueue() */
BTF_ID_FLAGS(func, __scx_bpf_select_cpu_and, KF_IMPLICIT_ARGS | KF_RCU)
BTF_ID_FLAGS(func, scx_bpf_select_cpu_and, KF_RCU)
@@ -10239,7 +10249,8 @@ __bpf_kfunc struct task_struct *bpf_iter_scx_dsq_next(struct bpf_iter_scx_dsq *i
* bpf_iter_scx_dsq_destroy - Destroy a DSQ iterator
* @it: iterator to destroy
*
- * Undo bpf_iter_scx_dsq_new().
+ * Undo bpf_iter_scx_dsq_new(). If the iteration marked tasks with
+ * scx_bpf_dsq_reenq_task(), schedule their re-enqueue.
*/
__bpf_kfunc void bpf_iter_scx_dsq_destroy(struct bpf_iter_scx_dsq *it)
{
@@ -10255,6 +10266,13 @@ __bpf_kfunc void bpf_iter_scx_dsq_destroy(struct bpf_iter_scx_dsq *it)
list_del_init(&kit->cursor.node);
raw_spin_unlock_irqrestore(&kit->dsq->lock, flags);
}
+
+ if (kit->cursor.flags & __SCX_DSQ_ITER_HAS_REENQ) {
+ guard(preempt)();
+ schedule_dsq_reenq(kit->dsq->sched, kit->dsq, SCX_REENQ_MARKED,
+ scx_locked_rq());
+ }
+
kit->dsq = NULL;
}
@@ -10340,6 +10358,64 @@ __bpf_kfunc void scx_bpf_dsq_reenq(u64 dsq_id, u64 reenq_flags,
schedule_dsq_reenq(sch, dsq, reenq_flags, locked_rq);
}
+/**
+ * scx_bpf_dsq_reenq_task - Re-enqueue a task from a DSQ iteration
+ * @it__iter: DSQ iterator in progress
+ * @p: task to re-enqueue
+ *
+ * Mark @p, which is on the DSQ iterated by @it__iter and was queued before the
+ * iteration started, for re-enqueue. When the iteration ends, the DSQ's marked
+ * tasks go through ops.enqueue() with %SCX_ENQ_REENQ in DSQ order and the other
+ * tasks on the DSQ keep their positions. A marked task that leaves the DSQ in
+ * the meantime is not re-enqueued. The mark belongs to @p, so a re-enqueue
+ * scheduled by another iteration of the DSQ may re-enqueue @p before this
+ * iteration ends. @p must be on the DSQ's scheduler.
+ *
+ * Re-enqueues are performed asynchronously. Can be called from ops.dispatch()
+ * or any BPF context which doesn't hold a rq lock (e.g. BPF timers or SYSCALL
+ * programs).
+ *
+ * Return %true if @p was marked, %false if @p left the DSQ or was queued after
+ * the iteration started, @p is on another scheduler, or the iterator holds no
+ * DSQ.
+ */
+__bpf_kfunc bool scx_bpf_dsq_reenq_task(struct bpf_iter_scx_dsq *it__iter,
+ struct task_struct *p)
+{
+ struct bpf_iter_scx_dsq_kern *kit = (void *)it__iter;
+ struct scx_dispatch_q *dsq = kit->dsq;
+ struct rq *src_rq, *entry_rq;
+ unsigned long flags;
+ bool marked = false;
+
+ /* NULL after a failed bpf_iter_scx_dsq_new(), see scx_dsq_move() */
+ if (unlikely(!dsq))
+ return false;
+
+ /* the cursor check needs @p's rq locked */
+ src_rq = task_rq(p);
+ entry_rq = kf_switch_rq_lock(src_rq, &flags);
+
+ scoped_guard (raw_spinlock, &dsq->lock) {
+ if (nldsq_cursor_lost_task(&kit->cursor, src_rq, dsq, p))
+ break;
+
+ if (unlikely(!scx_task_on_sched(dsq->sched, p))) {
+ scx_error(dsq->sched, "scx_bpf_dsq_reenq_task() on %s[%d] but the task belongs to a different scheduler",
+ p->comm, p->pid);
+ break;
+ }
+
+ p->scx.dsq_flags |= SCX_TASK_DSQ_REENQ;
+ /* the walk is scheduled once, by bpf_iter_scx_dsq_destroy() */
+ kit->cursor.flags |= __SCX_DSQ_ITER_HAS_REENQ;
+ marked = true;
+ }
+
+ kf_restore_rq_lock(src_rq, entry_rq, flags);
+ return marked;
+}
+
/**
* scx_bpf_reenqueue_local___v2 - Re-enqueue tasks on a local DSQ
* @aux: implicit BPF argument to access bpf_prog_aux hidden from BPF progs
diff --git a/kernel/sched/ext/internal.h b/kernel/sched/ext/internal.h
index 2f35b98adb72b..028f1c987d4ec 100644
--- a/kernel/sched/ext/internal.h
+++ b/kernel/sched/ext/internal.h
@@ -1888,6 +1888,8 @@ enum scx_reenq_flags {
/* internal: kernel-issued on cap revoke, not accepted from BPF */
SCX_REENQ_CAP_REVOKE = 1LLU << 1,
+ /* internal: tasks marked by scx_bpf_dsq_reenq_task() */
+ SCX_REENQ_MARKED = 1LLU << 2,
__SCX_REENQ_FILTER_MASK = 0xffffLLU,
diff --git a/tools/sched_ext/include/scx/common.bpf.h b/tools/sched_ext/include/scx/common.bpf.h
index 22f24ebef8a9a..6e419fdfc779a 100644
--- a/tools/sched_ext/include/scx/common.bpf.h
+++ b/tools/sched_ext/include/scx/common.bpf.h
@@ -74,6 +74,7 @@ struct task_struct *scx_bpf_dsq_peek(u64 dsq_id) __ksym __weak;
int bpf_iter_scx_dsq_new(struct bpf_iter_scx_dsq *it, u64 dsq_id, u64 flags) __ksym __weak;
struct task_struct *bpf_iter_scx_dsq_next(struct bpf_iter_scx_dsq *it) __ksym __weak;
void bpf_iter_scx_dsq_destroy(struct bpf_iter_scx_dsq *it) __ksym __weak;
+bool scx_bpf_dsq_reenq_task(struct bpf_iter_scx_dsq *it, struct task_struct *p) __ksym __weak;
void scx_bpf_exit_bstr(s64 exit_code, char *fmt, unsigned long long *data, u32 data__sz) __ksym __weak;
void scx_bpf_error_bstr(char *fmt, unsigned long long *data, u32 data_len) __ksym;
void scx_bpf_dump_bstr(char *fmt, unsigned long long *data, u32 data_len) __ksym __weak;
diff --git a/tools/sched_ext/include/scx/compat.bpf.h b/tools/sched_ext/include/scx/compat.bpf.h
index 6944221f96cc0..bc24f6ec432fa 100644
--- a/tools/sched_ext/include/scx/compat.bpf.h
+++ b/tools/sched_ext/include/scx/compat.bpf.h
@@ -414,6 +414,12 @@ static inline bool __COMPAT_has_generic_reenq(void)
return bpf_ksym_exists(scx_bpf_dsq_reenq___compat);
}
+/* v7.4: Add scx_bpf_dsq_reenq_task(). */
+static inline bool __COMPAT_has_dsq_reenq_task(void)
+{
+ return bpf_ksym_exists(scx_bpf_dsq_reenq_task);
+}
+
/*
* v6.19: The new void variant can be called from anywhere while the older v1
* variant can only be called from ops.cpu_release(). The double ___ prefixes on
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0479/1005] sched_ext: make DSQ iterator stay drained after NULL
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (477 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0478/1005] sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0480/1005] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
` (519 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kang Chen, Tejun Heo, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kang Chen <k.chen@smail.nju.edu.cn>
[ Upstream commit fcbff7b56a881bbe041b6c5ba12831a3c1ac1bb4 ]
nldsq_cursor_next_task() unlinks the iteration cursor when it reaches the
end of the DSQ. A later call sees list_empty(&cursor->node), starts
from the DSQ head again, and returns the first task of the same
iteration.
The verifier relies on the iterator contract that once next() returns
NULL it keeps returning NULL: process_iter_next_call() marks the
iterator DRAINED and treats the result of later next() calls as the
constant zero. A restarted DSQ iteration therefore hands the BPF
program a task pointer while the verifier believes R0 == 0.
Remember the drained state in the cursor flags and return NULL on every
later next() call. The cursor has spare flag bits and the BPF-visible
iterator layout is unchanged.
Fixes: 650ba21b131e ("sched_ext: Implement DSQ iterator")
Signed-off-by: Kang Chen <k.chen@smail.nju.edu.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/ext/ext.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index 78773d42b32df..e0d3d73ef031f 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -492,12 +492,14 @@ enum scx_dsq_iter_flags {
/* iterate in the reverse dispatch order */
SCX_DSQ_ITER_REV = 1U << 16,
+ __SCX_DSQ_ITER_DRAINED = 1U << 28,
__SCX_DSQ_ITER_HAS_REENQ = 1U << 29,
__SCX_DSQ_ITER_HAS_SLICE = 1U << 30,
__SCX_DSQ_ITER_HAS_VTIME = 1U << 31,
__SCX_DSQ_ITER_USER_FLAGS = SCX_DSQ_ITER_REV,
__SCX_DSQ_ITER_ALL_FLAGS = __SCX_DSQ_ITER_USER_FLAGS |
+ __SCX_DSQ_ITER_DRAINED |
__SCX_DSQ_ITER_HAS_REENQ |
__SCX_DSQ_ITER_HAS_SLICE |
__SCX_DSQ_ITER_HAS_VTIME,
@@ -10236,13 +10238,24 @@ __bpf_kfunc int bpf_iter_scx_dsq_new(struct bpf_iter_scx_dsq *it, u64 dsq_id,
__bpf_kfunc struct task_struct *bpf_iter_scx_dsq_next(struct bpf_iter_scx_dsq *it)
{
struct bpf_iter_scx_dsq_kern *kit = (void *)it;
+ struct task_struct *p;
- if (!kit->dsq)
+ if (!kit->dsq || (kit->cursor.flags & __SCX_DSQ_ITER_DRAINED))
return NULL;
guard(raw_spinlock_irqsave)(&kit->dsq->lock);
- return nldsq_cursor_next_task(&kit->cursor, kit->dsq);
+ p = nldsq_cursor_next_task(&kit->cursor, kit->dsq);
+ /*
+ * nldsq_cursor_next_task() unlinks the cursor and starts from the DSQ
+ * head when it is called again. The verifier relies on an iterator
+ * which returned NULL to keep returning NULL (see
+ * process_iter_next_call()), so remember the drained state.
+ */
+ if (!p)
+ kit->cursor.flags |= __SCX_DSQ_ITER_DRAINED;
+
+ return p;
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0480/1005] tun: delete the flow entries of the moved queue on detach
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (478 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0479/1005] sched_ext: make DSQ iterator stay drained after NULL Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0481/1005] fbnic: Fix service task races with ndo_stop and PM suspend Greg Kroah-Hartman
` (518 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Umang Pokhriyal, Willem de Bruijn,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Umang Pokhriyal <umangpokhriyall@gmail.com>
[ Upstream commit 4cc0a3f897074cea28dae38f1cd9bb230dae5d86 ]
When a queue is detached, __tun_detach() moves the last queue into the
freed slot and decrements tun->numqueues. The flow entries that point at
the old index of the moved queue, now tun->numqueues, are meant to be
deleted, but the call passes tun->numqueues + 1, an index that never
exists, so nothing is deleted.
Until those entries are refreshed by a write on their flow or age out,
tun_automq_select_queue() returns an index past the last queue, and
netdev_core_pick_tx() sends every such flow to queue 0 and warns:
tapq0 selects TX queue 3, but real number of TX queues is 3
Found with an LLM while testing how a VMM detaches tap queues when a
guest lowers its virtio-net queue pairs. With four queues, 30 flows
learned on queue 3 and queue 1 detached, all 30 went to queue 0 with the
warning; with this patch they are spread by hash and no warning is
printed (3 runs each, in a guest booted on net).
Pass tun->numqueues.
Fixes: 96442e42429e ("tuntap: choose the txq based on rxq")
Signed-off-by: Umang Pokhriyal <umangpokhriyall@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261104174240.138491-1-umangpokhriyall@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/tun.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index dfdc4b5bd27f8..3cb2c87fa8137 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -615,7 +615,7 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
}
synchronize_net();
- tun_flow_delete_by_queue(tun, tun->numqueues + 1);
+ tun_flow_delete_by_queue(tun, tun->numqueues);
/* Drop read queue */
tun_queue_purge(tfile);
spin_lock_bh(&ntfile->tx_ring.consumer_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0481/1005] fbnic: Fix service task races with ndo_stop and PM suspend
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (479 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0480/1005] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0482/1005] fbnic: Disable PTP completions during the Tx force-flush Greg Kroah-Hartman
` (517 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Duyck, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Duyck <alexanderduyck@fb.com>
[ Upstream commit 05ec5504ff69dac8867292c0e778fe79c3dde83c ]
The service task can run after the datapath has been torn down
underneath it. ndo_stop stops the task with the cancel_delayed_work
function, which does not wait for a pass already executing. It cannot
use the cancel_delayed_work_sync function, as ndo_stop holds RTNL and
the task takes RTNL itself, so a pass blocked on RTNL while ndo_stop
runs carries on once ndo_stop returns.
By then the fbnic_down function has demoted the host MACDA and action
entries to UPDATE and disabled the host queues, and ndo_stop has handed
ownership back to firmware, which clears fw_heartbeat_enabled. The late
pass's health check reports a firmware crash that did not happen, and
the fbnic_fw_config_after_crash function reclaims ownership and writes
the host rules back to hardware. If the BMC raised
FBNIC_FW_CAP_F_BMC_TCAM_REINIT in that window, the fbnic_bmc_rpc_check
function does the same through the __fbnic_set_rx_mode function. Either
way host traffic is steered at queues that are no longer running until
the next open and close.
The fbnic_pm_suspend function, which also serves shutdown and PCIe
error recovery, has the same problem and a worse one. It calls ndo_stop
directly with the device detached but __LINK_STATE_START still set, so
a late pass there sees the interface running, restores the host state,
and keeps re-arming itself every second after the mailbox, IRQs and
MMIO are gone.
Only run the health and BMC checks, and only re-arm, while the
interface is running and the device is present. The __dev_close_many
function clears __LINK_STATE_START under RTNL before it calls ndo_stop,
and the suspend path detaches the device under RTNL, so a late pass now
leaves the host state alone and stops. The BMC flags stay raised, and
the __fbnic_open function reclaims ownership, restarts the heartbeat
and rebuilds the BMC rules on the next open. The fbnic_pm_suspend
function also cancels the task synchronously once it has dropped RTNL,
so a pass already running cannot overlap the mailbox and IRQ teardown.
On resume the __fbnic_pm_attach function called the fbnic_up function,
which schedules the next pass, before attaching the device, all without
RTNL. A pass that ran in between would now see the device detached and
stop for good. Check for an init failure first, then hold RTNL and the
instance lock across the stats reset, the fbnic_up call and the attach,
as the suspend path does, so the pass blocks until the device is
present. This also gives the fbnic_up function the instance lock it
expects for the napi_enable_locked calls and the rx mode rewrite.
A device that detaches itself on a failed register read likewise stops
re-arming the task until recovery attaches it.
The issue was found by code review. The change was tested on fbnic
hardware with firmware 26.09.14-017_h7ab84d2ef68f by cycling the
interface through DPC/AER recoveries for a day.
Fixes: 04a230b27d8f ("fbnic: Add logic to repopulate RPC TCAM if BMC enables channel")
Fixes: 6ae7da8e9e06 ("eth: fbnic: reprogram TCAMs after FW crash")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/179381515284.9644.1846335740085170889.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/meta/fbnic/fbnic_pci.c | 38 ++++++++++++++++-----
1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
index c6698e3002a13..1335310a1cc18 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
@@ -229,18 +229,25 @@ static void fbnic_service_task(struct work_struct *work)
fbnic_fw_check_heartbeat(fbd);
- fbnic_health_check(fbd);
-
- fbnic_bmc_rpc_check(fbd);
-
if (netif_carrier_ok(fbd->netdev)) {
netdev_lock(fbd->netdev);
fbnic_napi_depletion_check(fbd->netdev);
netdev_unlock(fbd->netdev);
}
- if (netif_running(netdev))
+ /* fbnic_service_task_stop() does not wait for a pass that is already
+ * blocked on RTNL, so one can run after ndo_stop. Leave host state
+ * alone in that case, and do not re-arm; __fbnic_open() reclaims and
+ * rebuilds it. The PM path calls ndo_stop with the device detached but
+ * still running; fbnic_up() starts the task again on resume.
+ */
+ if (netif_running(netdev) && netif_device_present(netdev)) {
+ fbnic_health_check(fbd);
+
+ fbnic_bmc_rpc_check(fbd);
+
schedule_delayed_work(&fbd->service_task, HZ);
+ }
rtnl_unlock();
}
@@ -455,6 +462,12 @@ static int fbnic_pm_suspend(struct device *dev)
netdev_unlock(netdev);
rtnl_unlock();
+ /* ndo_stop could not wait for a pass already blocked on RTNL. That
+ * pass no longer re-arms, but wait for it to finish before the
+ * mailbox, IRQs and MMIO go away.
+ */
+ cancel_delayed_work_sync(&fbd->service_task);
+
null_uc_addr:
fbnic_fw_log_disable(fbd);
@@ -555,19 +568,26 @@ static void __fbnic_pm_attach(struct device *dev)
struct net_device *netdev = fbd->netdev;
struct fbnic_net *fbn;
- rtnl_lock();
- fbnic_reset_hw_stats(fbd);
- rtnl_unlock();
-
if (fbnic_init_failure(fbd))
return;
fbn = netdev_priv(netdev);
+ /* Hold RTNL until the device is attached, so the service task pass
+ * fbnic_up() schedules cannot run until it will see it present.
+ */
+ rtnl_lock();
+ netdev_lock(netdev);
+
+ fbnic_reset_hw_stats(fbd);
+
if (netif_running(netdev))
fbnic_up(fbn);
netif_device_attach(netdev);
+
+ netdev_unlock(netdev);
+ rtnl_unlock();
}
static int __maybe_unused fbnic_pm_resume(struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0482/1005] fbnic: Disable PTP completions during the Tx force-flush
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (480 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0481/1005] fbnic: Fix service task races with ndo_stop and PM suspend Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0483/1005] fbnic: Suspend phylink after taking the datapath down in ndo_stop Greg Kroah-Hartman
` (516 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Duyck, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Duyck <alexanderduyck@fb.com>
[ Upstream commit 7d4568edce74ac72794cdd42767cc116bf1ca9b4 ]
When the Tx queues fail to go idle, fbnic_wait_all_queues_idle() falls
back to fbnic_tx_flush(), which sets FBNIC_TMI_DROP_CTRL_EN. That bit
only drops packets at the Tx MAC Interface start of packet protection FIFO.
The PTP completion path is governed by a separate bit in the same
register. With only the drop enable set, a timestamped frame has its
packet discarded while the matching completion is still forwarded to
the host. fbnic_clean_tsq() then walks the ring with no packet left to
match it against and reports "Tx timestamp without matching packet".
The drop does not retire the completion either, as the completion FIFO
is only drained when the completion disable is set.
Set FBNIC_TMI_DROP_CTRL_CMPL_DIS together with the drop enable so the
completions are drained rather than leaked to the host, and clear both
bits again when the flush is turned off.
Fixes: ad3d9f8bc66c ("eth: fbnic: add TX packets timestamping support")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/179381515954.9644.10831265959574467679.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/meta/fbnic/fbnic_csr.h | 1 +
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_csr.h b/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
index baba3471bf5a4..c601b64aa2646 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
@@ -459,6 +459,7 @@ enum {
#define FBNIC_TMI_SOP_PROT_CTRL 0x04400 /* 0x11000 */
#define FBNIC_TMI_DROP_CTRL 0x04401 /* 0x11004 */
#define FBNIC_TMI_DROP_CTRL_EN CSR_BIT(0)
+#define FBNIC_TMI_DROP_CTRL_CMPL_DIS CSR_BIT(1)
#define FBNIC_TMI_DROP_PKTS 0x04402 /* 0x11008 */
#define FBNIC_TMI_DROP_BYTE_L 0x04403 /* 0x1100c */
#define FBNIC_TMI_ILLEGAL_PTP_REQS 0x04409 /* 0x11024 */
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
index 69cd96a4508f3..c869b88db81ac 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -2309,15 +2309,19 @@ void fbnic_disable(struct fbnic_net *fbn)
static void fbnic_tx_flush(struct fbnic_dev *fbd)
{
+ u32 drop_ctrl = FBNIC_TMI_DROP_CTRL_EN | FBNIC_TMI_DROP_CTRL_CMPL_DIS;
+
netdev_warn(fbd->netdev, "triggering Tx flush\n");
- fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, FBNIC_TMI_DROP_CTRL_EN,
- FBNIC_TMI_DROP_CTRL_EN);
+ /* Drop packets and retire their PTP completions */
+ fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, drop_ctrl, drop_ctrl);
}
static void fbnic_tx_flush_off(struct fbnic_dev *fbd)
{
- fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, FBNIC_TMI_DROP_CTRL_EN, 0);
+ u32 drop_ctrl = FBNIC_TMI_DROP_CTRL_EN | FBNIC_TMI_DROP_CTRL_CMPL_DIS;
+
+ fbnic_rmw32(fbd, FBNIC_TMI_DROP_CTRL, drop_ctrl, 0);
}
struct fbnic_idle_regs {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0483/1005] fbnic: Suspend phylink after taking the datapath down in ndo_stop
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (481 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0482/1005] fbnic: Disable PTP completions during the Tx force-flush Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0484/1005] fbnic: Wait for the outbound flush to complete on mailbox teardown Greg Kroah-Hartman
` (515 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Duyck, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Duyck <alexanderduyck@fb.com>
[ Upstream commit b45b9c6b83e7a5ac440d36b46ed9b466788b3e5c ]
The fbnic_stop function calls the phylink_suspend function before the
fbnic_down function. With no BMC present that stops phylink, and the
fbnic_phylink_mac_link_down function disables the MAC and holds its Tx
and Rx clocks and FIFOs in reset. Only then does the fbnic_down function
stop the queues and wait for the Tx path to go idle, so anything still in
flight has to drain into a MAC that is no longer passing traffic, and the
fbnic_wait_all_queues_idle function can be left to time out and force a
flush. With a BMC present phylink leaves the link up but turns the carrier
off, which the phylink_suspend function notes assumes all packets have
already been sent.
It is also the reverse of how the interface comes up: the __fbnic_open
function resumes phylink last, and the fbnic_up function then enables the
queues and installs the host Rx filters.
Call the fbnic_down function first. The Tx path then drains with the link
still up, and Rx is still stopped first, as the fbnic_clear_rx_mode and
fbnic_clear_rules functions remove the host as a destination for its MAC
addresses in the RPC before the queues are disabled. The MAC IRQ is still
freed before phylink is suspended, so no link interrupt runs while the
link is taken down. The PM suspend path goes through ndo_stop and picks
up the same order.
Fixes: 6ede14a2c636 ("fbnic: Move phylink resume out of service_task and into open/close")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Fixes: 69684376eed5 ("eth: fbnic: Add link detection")
Link: https://patch.msgid.link/179381516644.9644.9042901965231900737.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
index 10bf99be3f244..9c205999b29a2 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
@@ -86,11 +86,11 @@ static int fbnic_stop(struct net_device *netdev)
{
struct fbnic_net *fbn = netdev_priv(netdev);
+ fbnic_down(fbn);
+
fbnic_mac_free_irq(fbn->fbd);
phylink_suspend(fbn->phylink, fbnic_bmc_present(fbn->fbd));
- fbnic_down(fbn);
-
fbnic_time_stop(fbn);
fbnic_fw_xmit_ownership_msg(fbn->fbd, false);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0484/1005] fbnic: Wait for the outbound flush to complete on mailbox teardown
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (482 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0483/1005] fbnic: Suspend phylink after taking the datapath down in ndo_stop Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0485/1005] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist Greg Kroah-Hartman
` (514 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Duyck, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Duyck <alexanderduyck@fb.com>
[ Upstream commit c5820a8cf59b03d59f2f5f9b3754ad27a6014a41 ]
The fbnic_mbx_reset_desc_ring function drops bus mastering and arms the
outbound flush for its ring: the write flush for the Rx ring and the
read flush for the Tx ring. Nothing waits for that flush to finish.
The fbnic_mbx_clean_desc_ring function goes straight on to unmap and
free the ring's buffers, so a device read of a Tx buffer, or a write to
an Rx buffer, can still be outstanding after the buffer is gone. With
an IOMMU it can also target an IOVA that has been unmapped or reused.
The PUL link reset status register reports when each direction's flush
has drained. Poll the done bit for the ring's direction after arming
the flush and before freeing its buffers. The flush only has to retire
what the outbound path already holds; the 1ms cap keeps a wedged device
from spinning.
Every caller of the fbnic_mbx_clean function runs with the datapath
already down, which matters because the read flush covers all
outstanding reads, not just the mailbox ones. A device that has lost
its link reads back as all ones, so the done bit appears set and the
poll ends on the first pass.
Fixes: 3b12f00ddd08 ("fbnic: Gate AXI read/write enabling on FW mailbox")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/179381517319.9644.1165591016149104577.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/meta/fbnic/fbnic_csr.h | 4 ++++
drivers/net/ethernet/meta/fbnic/fbnic_fw.c | 16 ++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_csr.h b/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
index c601b64aa2646..85ad53829bef8 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
@@ -974,6 +974,10 @@ enum {
/* PUL User Registers */
#define FBNIC_CSR_START_PUL_USER 0x31000 /* CSR section delimiter */
+#define FBNIC_PUL_USER_IP_LINK_RST_STATUS \
+ 0x31030 /* 0xc40c0 */
+#define FBNIC_PUL_USER_IP_LINK_RST_STATUS_AW_FLUSH_DONE CSR_BIT(7)
+#define FBNIC_PUL_USER_IP_LINK_RST_STATUS_AR_FLUSH_DONE CSR_BIT(8)
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG 0x3103d /* 0xc40f4 */
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH_MODE CSR_BIT(20)
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH CSR_BIT(19)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_fw.c b/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
index ce2a66aeb8d26..2369fcf9b350f 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
@@ -7,6 +7,7 @@
#include <linux/dev_printk.h>
#include <linux/dma-mapping.h>
#include <linux/gfp.h>
+#include <linux/iopoll.h>
#include <linux/types.h>
#include "fbnic.h"
@@ -176,10 +177,25 @@ static void fbnic_mbx_unmap_and_free_msg(struct fbnic_dev *fbd, int mbx_idx,
static void fbnic_mbx_clean_desc_ring(struct fbnic_dev *fbd, int mbx_idx)
{
+ u32 flush_done, val;
int i;
fbnic_mbx_reset_desc_ring(fbd, mbx_idx);
+ /* Arming the flush only starts it. Wait for the outbound path to
+ * retire the requests it still holds before the buffers they may
+ * target are unmapped and freed. A lost link reads back as all ones,
+ * which ends the poll on the first pass.
+ */
+ flush_done = mbx_idx == FBNIC_IPC_MBX_RX_IDX ?
+ FBNIC_PUL_USER_IP_LINK_RST_STATUS_AW_FLUSH_DONE :
+ FBNIC_PUL_USER_IP_LINK_RST_STATUS_AR_FLUSH_DONE;
+ if (read_poll_timeout_atomic(fbnic_rd32, val, val & flush_done, 2,
+ 1000, false, fbd,
+ FBNIC_PUL_USER_IP_LINK_RST_STATUS))
+ dev_warn(fbd->dev, "Outbound flush did not complete: %08x\n",
+ val);
+
for (i = FBNIC_IPC_MBX_DESC_LEN; i--;)
fbnic_mbx_unmap_and_free_msg(fbd, mbx_idx, i);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0485/1005] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (483 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0484/1005] fbnic: Wait for the outbound flush to complete on mailbox teardown Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0486/1005] NFSv4/flexfiles: Reference the device node across DS setup Greg Kroah-Hartman
` (513 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Duyck, Willem de Bruijn,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Duyck <alexanderduyck@fb.com>
[ Upstream commit fdca4b030c78fa2773a94fda3a6dc3ce5558a727 ]
The netif_needs_gso function lets a GSO skb reach the device unsegmented
when it is CHECKSUM_PARTIAL or CHECKSUM_UNNECESSARY. The second case was
added for FCoE, whose transmit path marked CRC offload that way at the
time. Commit 253aab0597d9 ("fcoe: Use CHECKSUM_PARTIAL to indicate CRC
offload") moved FCoE back to CHECKSUM_PARTIAL but left the exemption in
place, with nothing left that needed it. Fraglist GSO, added later, is
its only user today, as its segments already carry valid checksums.
A TCP GSO skb can still arrive as CHECKSUM_UNNECESSARY without being
fraglist. Hardware LRO builds its aggregates that way, for example mlx5
sets SKB_GSO_TCPV4 or SKB_GSO_TCPV6 and CHECKSUM_UNNECESSARY, without
SKB_GSO_DODGY. IP forwarding and bridging turn LRO off, but a tc mirred
redirect does not, so such an skb can be sent out another device. It
has no csum_start and its TCP checksum field is whatever the aggregate
left there. Drivers that only set up TSO for CHECKSUM_PARTIAL, such as
fbnic, i40e and ice, then send the whole skb as one oversized frame
with a bad checksum.
Have the validate_xmit_skb function mark any CHECKSUM_UNNECESSARY GSO
skb other than fraglist as CHECKSUM_NONE, which means the same on
transmit but is not exempt in the netif_needs_gso function. The
__skb_gso_segment function then unshares the header and the TCP GSO
code sets the skb up as CHECKSUM_PARTIAL, so a device with TSO segments
it in hardware. Without TSO, and for UDP, it is segmented in software.
The callers of the netif_needs_gso function that decide on segmentation
for themselves, such as tap, are left as they are.
Found by code inspection. In QEMU with an emulated fbnic, TCPv4 and
TCPv6 GSO skbs built this way each went out as a single 11 KB frame
with a bad TCP checksum. With this change they are segmented into
MSS-sized frames with valid checksums.
Fixes: 253aab0597d9 ("fcoe: Use CHECKSUM_PARTIAL to indicate CRC offload")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/179372577673.49909.11253315483074546903.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/dev.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 80d37066bf2bf..6389e360a7a24 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4105,6 +4105,18 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
if (unlikely(!skb))
goto out_null;
+ /* Only fraglist GSO, whose segments already carry valid checksums,
+ * can be handed to a device as CHECKSUM_UNNECESSARY. Any other GSO
+ * skb has no csum_start for the device to segment from. NONE means
+ * the same on transmit, but makes netif_needs_gso() send it to the
+ * GSO code, which turns TCP into CHECKSUM_PARTIAL for TSO and
+ * segments anything the device cannot offload in software.
+ */
+ if (unlikely(skb->ip_summed == CHECKSUM_UNNECESSARY &&
+ skb_is_gso(skb) &&
+ !(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST)))
+ skb->ip_summed = CHECKSUM_NONE;
+
features = netif_skb_features(skb);
skb = validate_xmit_vlan(skb, features);
if (unlikely(!skb))
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0486/1005] NFSv4/flexfiles: Reference the device node across DS setup
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (484 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0485/1005] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0487/1005] NFSv4/flexfiles: Hold a device node reference for layoutstats encoding Greg Kroah-Hartman
` (512 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Coddington, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <ben.coddington@hammerspace.com>
[ Upstream commit e85acae4cda89c075bc94520fdcf5901595fffae ]
The flexfiles I/O setup paths read the mirror's pinned per-stripe device
node (mirror->dss[dss_id].mirror_ds) repeatedly and locklessly, relying
on the mirror's lifetime pin. To prepare for re-resolving that pointer
in place on CB_NOTIFY_DEVICEID CHANGE, readers must hold their own
reference on the node they are using rather than trusting the pin.
Replace ff_layout_init_mirror_ds() with ff_layout_get_mirror_ds(), which
resolves on first use as before but returns the node with its own
reference held. Thread the referenced node through
nfs4_ff_layout_prepare_ds() and the DS selection helpers so each setup
path snapshots the node once, and drop the reference when setup is done.
No functional change: the pointer is still resolved once and pinned for
the life of the mirror. Each reference this adds is released on every
exit from the path that took it, error paths included.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 140 ++++++++++++++--------
fs/nfs/flexfilelayout/flexfilelayout.h | 16 ++-
fs/nfs/flexfilelayout/flexfilelayoutdev.c | 74 +++++++-----
3 files changed, 141 insertions(+), 89 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 989f30e7d9509..8463021511c17 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -878,7 +878,7 @@ ff_layout_mark_ds_reachable(struct pnfs_layout_segment *lseg, u32 idx, u32 dss_i
nfs4_mark_deviceid_available(devid);
}
-static struct nfs4_pnfs_ds *
+static struct nfs4_ff_layout_ds *
ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg,
u32 start_idx, u32 *best_idx,
u64 offset, u32 *dss_id,
@@ -886,7 +886,9 @@ ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg,
{
struct nfs4_ff_layout_segment *fls = FF_LAYOUT_LSEG(lseg);
struct nfs4_ff_layout_mirror *mirror;
- struct nfs4_pnfs_ds *ds = ERR_PTR(-EAGAIN);
+ struct nfs4_ff_layout_ds *mirror_ds;
+ struct nfs4_ff_layout_ds *ret = ERR_PTR(-EAGAIN);
+ struct nfs4_pnfs_ds *ds;
u32 idx;
/* mirrors are initially sorted by efficiency */
@@ -896,25 +898,32 @@ ff_layout_choose_ds_for_read(struct pnfs_layout_segment *lseg,
fls->stripe_unit,
fls->mirror_array[idx]->dss_count,
offset);
- ds = nfs4_ff_layout_prepare_ds(lseg, mirror, *dss_id, false);
- if (IS_ERR(ds))
+ mirror_ds = ff_layout_get_mirror_ds(lseg->pls_layout, mirror,
+ *dss_id);
+ ds = nfs4_ff_layout_prepare_ds(lseg, mirror, mirror_ds,
+ *dss_id, false);
+ if (IS_ERR(ds)) {
+ nfs4_ff_layout_put_deviceid(mirror_ds);
+ ret = ERR_CAST(ds);
continue;
+ }
if (check_device &&
- nfs4_test_deviceid_unavailable(&mirror->dss[*dss_id].mirror_ds->id_node)) {
+ nfs4_test_deviceid_unavailable(&mirror_ds->id_node)) {
+ nfs4_ff_layout_put_deviceid(mirror_ds);
// reinitialize the error state in case if this is the last iteration
- ds = ERR_PTR(-EINVAL);
+ ret = ERR_PTR(-EINVAL);
continue;
}
*best_idx = idx;
- break;
+ return mirror_ds;
}
- return ds;
+ return ret;
}
-static struct nfs4_pnfs_ds *
+static struct nfs4_ff_layout_ds *
ff_layout_choose_any_ds_for_read(struct pnfs_layout_segment *lseg,
u32 start_idx, u32 *best_idx,
u64 offset, u32 *dss_id)
@@ -923,7 +932,7 @@ ff_layout_choose_any_ds_for_read(struct pnfs_layout_segment *lseg,
offset, dss_id, false);
}
-static struct nfs4_pnfs_ds *
+static struct nfs4_ff_layout_ds *
ff_layout_choose_valid_ds_for_read(struct pnfs_layout_segment *lseg,
u32 start_idx, u32 *best_idx,
u64 offset, u32 *dss_id)
@@ -932,34 +941,36 @@ ff_layout_choose_valid_ds_for_read(struct pnfs_layout_segment *lseg,
offset, dss_id, true);
}
-static struct nfs4_pnfs_ds *
+static struct nfs4_ff_layout_ds *
ff_layout_choose_best_ds_for_read(struct pnfs_layout_segment *lseg,
u32 start_idx, u32 *best_idx,
u64 offset, u32 *dss_id)
{
- struct nfs4_pnfs_ds *ds;
+ struct nfs4_ff_layout_ds *mirror_ds;
- ds = ff_layout_choose_valid_ds_for_read(lseg, start_idx, best_idx,
- offset, dss_id);
- if (!IS_ERR(ds))
- return ds;
+ mirror_ds = ff_layout_choose_valid_ds_for_read(lseg, start_idx,
+ best_idx, offset,
+ dss_id);
+ if (!IS_ERR(mirror_ds))
+ return mirror_ds;
return ff_layout_choose_any_ds_for_read(lseg, start_idx, best_idx,
offset, dss_id);
}
-static struct nfs4_pnfs_ds *
+static struct nfs4_ff_layout_ds *
ff_layout_get_ds_for_read(struct nfs_pageio_descriptor *pgio,
u32 *best_idx,
u64 offset,
u32 *dss_id)
{
struct pnfs_layout_segment *lseg = pgio->pg_lseg;
- struct nfs4_pnfs_ds *ds;
+ struct nfs4_ff_layout_ds *mirror_ds;
- ds = ff_layout_choose_best_ds_for_read(lseg, pgio->pg_mirror_idx,
- best_idx, offset, dss_id);
- if (!IS_ERR(ds) || !pgio->pg_mirror_idx)
- return ds;
+ mirror_ds = ff_layout_choose_best_ds_for_read(lseg,
+ pgio->pg_mirror_idx,
+ best_idx, offset, dss_id);
+ if (!IS_ERR(mirror_ds) || !pgio->pg_mirror_idx)
+ return mirror_ds;
return ff_layout_choose_best_ds_for_read(lseg, 0, best_idx,
offset, dss_id);
}
@@ -1048,8 +1059,7 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
struct nfs_page *req)
{
struct nfs_pgio_mirror *pgm;
- struct nfs4_ff_layout_mirror *mirror;
- struct nfs4_pnfs_ds *ds;
+ struct nfs4_ff_layout_ds *mirror_ds;
u32 ds_idx, dss_id;
if (NFS_SERVER(pgio->pg_inode)->flags &
@@ -1071,9 +1081,9 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
/* Reset wb_nio, since getting layout segment was successful */
req->wb_nio = 0;
- ds = ff_layout_get_ds_for_read(pgio, &ds_idx,
- req_offset(req), &dss_id);
- if (IS_ERR(ds)) {
+ mirror_ds = ff_layout_get_ds_for_read(pgio, &ds_idx,
+ req_offset(req), &dss_id);
+ if (IS_ERR(mirror_ds)) {
if (!ff_layout_no_fallback_to_mds(pgio->pg_lseg))
goto out_mds;
pnfs_generic_pg_cleanup(pgio);
@@ -1083,9 +1093,9 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
goto retry;
}
- mirror = FF_LAYOUT_COMP(pgio->pg_lseg, ds_idx);
pgm = &pgio->pg_mirrors[0];
- pgm->pg_bsize = mirror->dss[dss_id].mirror_ds->ds_versions[0].rsize;
+ pgm->pg_bsize = mirror_ds->ds_versions[0].rsize;
+ nfs4_ff_layout_put_deviceid(mirror_ds);
pgio->pg_mirror_idx = ds_idx;
return;
@@ -1135,6 +1145,7 @@ ff_layout_pg_init_write(struct nfs_pageio_descriptor *pgio,
struct nfs_page *req)
{
struct nfs4_ff_layout_mirror *mirror;
+ struct nfs4_ff_layout_ds *mirror_ds;
struct nfs_pgio_mirror *pgm;
struct nfs4_pnfs_ds *ds;
u32 i, dss_id;
@@ -1166,9 +1177,12 @@ ff_layout_pg_init_write(struct nfs_pageio_descriptor *pgio,
FF_LAYOUT_LSEG(pgio->pg_lseg)->stripe_unit,
mirror->dss_count,
req_offset(req));
+ mirror_ds = ff_layout_get_mirror_ds(pgio->pg_lseg->pls_layout,
+ mirror, dss_id);
ds = nfs4_ff_layout_prepare_ds(pgio->pg_lseg, mirror,
- dss_id, true);
+ mirror_ds, dss_id, true);
if (IS_ERR(ds)) {
+ nfs4_ff_layout_put_deviceid(mirror_ds);
if (!ff_layout_no_fallback_to_mds(pgio->pg_lseg))
goto out_mds;
pnfs_generic_pg_cleanup(pgio);
@@ -1178,7 +1192,8 @@ ff_layout_pg_init_write(struct nfs_pageio_descriptor *pgio,
goto retry;
}
pgm = &pgio->pg_mirrors[i];
- pgm->pg_bsize = mirror->dss[dss_id].mirror_ds->ds_versions[0].wsize;
+ pgm->pg_bsize = mirror_ds->ds_versions[0].wsize;
+ nfs4_ff_layout_put_deviceid(mirror_ds);
}
if (NFS_SERVER(pgio->pg_inode)->flags &
@@ -1310,14 +1325,16 @@ static void ff_layout_resend_pnfs_read(struct nfs_pgio_header *hdr)
u32 idx = hdr->pgio_mirror_idx + 1;
u32 new_idx = 0;
u32 dss_id = 0;
- struct nfs4_pnfs_ds *ds;
+ struct nfs4_ff_layout_ds *mirror_ds;
- ds = ff_layout_choose_any_ds_for_read(hdr->lseg, idx, &new_idx,
- hdr->args.offset, &dss_id);
- if (IS_ERR(ds))
+ mirror_ds = ff_layout_choose_any_ds_for_read(hdr->lseg, idx, &new_idx,
+ hdr->args.offset, &dss_id);
+ if (IS_ERR(mirror_ds)) {
pnfs_error_mark_layout_for_return(hdr->inode, hdr->lseg);
- else
+ } else {
+ nfs4_ff_layout_put_deviceid(mirror_ds);
ff_layout_send_layouterror(hdr->lseg);
+ }
pnfs_read_resend_pnfs(hdr, new_idx);
}
@@ -2238,6 +2255,7 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr)
struct rpc_clnt *ds_clnt;
struct nfsd_file *localio;
struct nfs4_ff_layout_mirror *mirror;
+ struct nfs4_ff_layout_ds *mirror_ds;
const struct cred *ds_cred;
loff_t offset = hdr->args.offset;
u32 idx = hdr->pgio_mirror_idx;
@@ -2255,22 +2273,24 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr)
FF_LAYOUT_LSEG(lseg)->stripe_unit,
mirror->dss_count,
offset);
- ds = nfs4_ff_layout_prepare_ds(lseg, mirror, dss_id, false);
+ mirror_ds = ff_layout_get_mirror_ds(lseg->pls_layout, mirror, dss_id);
+ ds = nfs4_ff_layout_prepare_ds(lseg, mirror, mirror_ds, dss_id, false);
if (IS_ERR(ds)) {
ds_fatal_error = nfs_error_is_fatal(PTR_ERR(ds));
goto out_failed;
}
- ds_clnt = nfs4_ff_find_or_create_ds_client(mirror, ds->ds_clp,
- hdr->inode, dss_id);
+ ds_clnt = nfs4_ff_find_or_create_ds_client(mirror_ds, ds->ds_clp,
+ hdr->inode);
if (IS_ERR(ds_clnt))
goto out_failed;
- ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred, dss_id);
+ ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred,
+ mirror_ds, dss_id);
if (!ds_cred)
goto out_failed;
- vers = nfs4_ff_layout_ds_version(mirror, dss_id);
+ vers = nfs4_ff_layout_ds_version(mirror_ds);
dprintk("%s USE DS: %s cl_count %d vers %d\n", __func__,
ds->ds_remotestr, refcount_read(&ds->ds_clp->cl_count), vers);
@@ -2282,7 +2302,8 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr)
if (fh)
hdr->args.fh = fh;
- nfs4_ff_layout_select_ds_stateid(mirror, dss_id, &hdr->args.stateid);
+ nfs4_ff_layout_select_ds_stateid(mirror, mirror_ds, dss_id,
+ &hdr->args.stateid);
/*
* Note that if we ever decide to split across DSes,
@@ -2305,9 +2326,11 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr)
&ff_layout_read_call_ops_v4,
0, RPC_TASK_SOFTCONN, localio);
put_cred(ds_cred);
+ nfs4_ff_layout_put_deviceid(mirror_ds);
return PNFS_ATTEMPTED;
out_failed:
+ nfs4_ff_layout_put_deviceid(mirror_ds);
if (ff_layout_avoid_mds_available_ds(lseg) && !ds_fatal_error)
return PNFS_TRY_AGAIN;
if (ff_layout_no_fallback_to_mds(lseg)) {
@@ -2333,6 +2356,7 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
struct rpc_clnt *ds_clnt;
struct nfsd_file *localio;
struct nfs4_ff_layout_mirror *mirror;
+ struct nfs4_ff_layout_ds *mirror_ds;
const struct cred *ds_cred;
loff_t offset = hdr->args.offset;
int vers;
@@ -2346,22 +2370,24 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
FF_LAYOUT_LSEG(lseg)->stripe_unit,
mirror->dss_count,
offset);
- ds = nfs4_ff_layout_prepare_ds(lseg, mirror, dss_id, true);
+ mirror_ds = ff_layout_get_mirror_ds(lseg->pls_layout, mirror, dss_id);
+ ds = nfs4_ff_layout_prepare_ds(lseg, mirror, mirror_ds, dss_id, true);
if (IS_ERR(ds)) {
ds_fatal_error = nfs_error_is_fatal(PTR_ERR(ds));
goto out_failed;
}
- ds_clnt = nfs4_ff_find_or_create_ds_client(mirror, ds->ds_clp,
- hdr->inode, dss_id);
+ ds_clnt = nfs4_ff_find_or_create_ds_client(mirror_ds, ds->ds_clp,
+ hdr->inode);
if (IS_ERR(ds_clnt))
goto out_failed;
- ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred, dss_id);
+ ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, hdr->cred,
+ mirror_ds, dss_id);
if (!ds_cred)
goto out_failed;
- vers = nfs4_ff_layout_ds_version(mirror, dss_id);
+ vers = nfs4_ff_layout_ds_version(mirror_ds);
dprintk("%s ino %llu sync %d req %zu@%llu DS: %s cl_count %d vers %d\n",
__func__, hdr->inode->i_ino, sync, (size_t) hdr->args.count,
@@ -2376,7 +2402,8 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
if (fh)
hdr->args.fh = fh;
- nfs4_ff_layout_select_ds_stateid(mirror, dss_id, &hdr->args.stateid);
+ nfs4_ff_layout_select_ds_stateid(mirror, mirror_ds, dss_id,
+ &hdr->args.stateid);
/*
* Note that if we ever decide to split across DSes,
@@ -2398,9 +2425,11 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
&ff_layout_write_call_ops_v4,
sync, RPC_TASK_SOFTCONN, localio);
put_cred(ds_cred);
+ nfs4_ff_layout_put_deviceid(mirror_ds);
return PNFS_ATTEMPTED;
out_failed:
+ nfs4_ff_layout_put_deviceid(mirror_ds);
if (ff_layout_avoid_mds_available_ds(lseg) && !ds_fatal_error)
return PNFS_TRY_AGAIN;
if (ff_layout_no_fallback_to_mds(lseg)) {
@@ -2435,6 +2464,7 @@ static int ff_layout_initiate_commit(struct nfs_commit_data *data, int how)
struct rpc_clnt *ds_clnt;
struct nfsd_file *localio;
struct nfs4_ff_layout_mirror *mirror;
+ struct nfs4_ff_layout_ds *mirror_ds = NULL;
const struct cred *ds_cred;
u32 idx, dss_id;
int vers, ret;
@@ -2447,20 +2477,22 @@ static int ff_layout_initiate_commit(struct nfs_commit_data *data, int how)
idx = calc_mirror_idx_from_commit(lseg, data->ds_commit_index);
mirror = FF_LAYOUT_COMP(lseg, idx);
dss_id = calc_dss_id_from_commit(lseg, data->ds_commit_index);
- ds = nfs4_ff_layout_prepare_ds(lseg, mirror, dss_id, true);
+ mirror_ds = ff_layout_get_mirror_ds(lseg->pls_layout, mirror, dss_id);
+ ds = nfs4_ff_layout_prepare_ds(lseg, mirror, mirror_ds, dss_id, true);
if (IS_ERR(ds))
goto out_err;
- ds_clnt = nfs4_ff_find_or_create_ds_client(mirror, ds->ds_clp,
- data->inode, dss_id);
+ ds_clnt = nfs4_ff_find_or_create_ds_client(mirror_ds, ds->ds_clp,
+ data->inode);
if (IS_ERR(ds_clnt))
goto out_err;
- ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, data->cred, dss_id);
+ ds_cred = ff_layout_get_ds_cred(mirror, &lseg->pls_range, data->cred,
+ mirror_ds, dss_id);
if (!ds_cred)
goto out_err;
- vers = nfs4_ff_layout_ds_version(mirror, dss_id);
+ vers = nfs4_ff_layout_ds_version(mirror_ds);
dprintk("%s ino %llu, how %d cl_count %d vers %d\n", __func__,
data->inode->i_ino, how, refcount_read(&ds->ds_clp->cl_count),
@@ -2486,8 +2518,10 @@ static int ff_layout_initiate_commit(struct nfs_commit_data *data, int how)
&ff_layout_commit_call_ops_v4,
how, RPC_TASK_SOFTCONN, localio);
put_cred(ds_cred);
+ nfs4_ff_layout_put_deviceid(mirror_ds);
return ret;
out_err:
+ nfs4_ff_layout_put_deviceid(mirror_ds);
pnfs_generic_prepare_to_resend_writes(data);
pnfs_generic_commit_release(data);
return -EAGAIN;
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h
index ec69cd1c3ae96..f9e491a0347e1 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.h
+++ b/fs/nfs/flexfilelayout/flexfilelayout.h
@@ -207,9 +207,9 @@ ff_layout_no_read_on_rw(struct pnfs_layout_segment *lseg)
}
static inline int
-nfs4_ff_layout_ds_version(const struct nfs4_ff_layout_mirror *mirror, u32 dss_id)
+nfs4_ff_layout_ds_version(const struct nfs4_ff_layout_ds *mirror_ds)
{
- return mirror->dss[dss_id].mirror_ds->ds_versions[0].version;
+ return mirror_ds->ds_versions[0].version;
}
static inline u32
@@ -245,23 +245,29 @@ struct nfs_fh *
nfs4_ff_layout_select_ds_fh(struct nfs4_ff_layout_mirror *mirror, u32 dss_id);
void
nfs4_ff_layout_select_ds_stateid(const struct nfs4_ff_layout_mirror *mirror,
+ const struct nfs4_ff_layout_ds *mirror_ds,
u32 dss_id,
nfs4_stateid *stateid);
+struct nfs4_ff_layout_ds *
+ff_layout_get_mirror_ds(struct pnfs_layout_hdr *lo,
+ struct nfs4_ff_layout_mirror *mirror,
+ u32 dss_id);
struct nfs4_pnfs_ds *
nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
struct nfs4_ff_layout_mirror *mirror,
+ struct nfs4_ff_layout_ds *mirror_ds,
u32 dss_id,
bool fail_return);
struct rpc_clnt *
-nfs4_ff_find_or_create_ds_client(struct nfs4_ff_layout_mirror *mirror,
+nfs4_ff_find_or_create_ds_client(const struct nfs4_ff_layout_ds *mirror_ds,
struct nfs_client *ds_clp,
- struct inode *inode,
- u32 dss_id);
+ struct inode *inode);
const struct cred *ff_layout_get_ds_cred(struct nfs4_ff_layout_mirror *mirror,
const struct pnfs_layout_range *range,
const struct cred *mdscred,
+ const struct nfs4_ff_layout_ds *mirror_ds,
u32 dss_id);
bool ff_layout_avoid_mds_available_ds(struct pnfs_layout_segment *lseg);
bool ff_layout_avoid_read_on_rw(struct pnfs_layout_segment *lseg);
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 6cd3859d4a243..3712a47b20d08 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -304,24 +304,33 @@ nfs4_ff_layout_select_ds_fh(struct nfs4_ff_layout_mirror *mirror, u32 dss_id)
void
nfs4_ff_layout_select_ds_stateid(const struct nfs4_ff_layout_mirror *mirror,
+ const struct nfs4_ff_layout_ds *mirror_ds,
u32 dss_id,
nfs4_stateid *stateid)
{
- if (nfs4_ff_layout_ds_version(mirror, dss_id) == 4)
+ if (nfs4_ff_layout_ds_version(mirror_ds) == 4)
nfs4_stateid_copy(stateid, &mirror->dss[dss_id].stateid);
}
-static bool
-ff_layout_init_mirror_ds(struct pnfs_layout_hdr *lo,
- struct nfs4_ff_layout_mirror *mirror,
- u32 dss_id)
+/*
+ * Resolve the stripe's deviceid on first use and pin the node on the
+ * mirror. Returns a node the caller must put, or an ERR_PTR.
+ */
+struct nfs4_ff_layout_ds *
+ff_layout_get_mirror_ds(struct pnfs_layout_hdr *lo,
+ struct nfs4_ff_layout_mirror *mirror,
+ u32 dss_id)
{
+ struct nfs4_ff_layout_ds *mirror_ds;
+
if (mirror == NULL)
- goto outerr;
- if (mirror->dss[dss_id].mirror_ds == NULL) {
+ return ERR_PTR(-ENODEV);
+
+ mirror_ds = mirror->dss[dss_id].mirror_ds;
+ if (mirror_ds == NULL) {
struct nfs4_deviceid_node *node;
- struct nfs4_ff_layout_ds *mirror_ds = ERR_PTR(-ENODEV);
+ mirror_ds = ERR_PTR(-ENODEV);
node = nfs4_find_get_deviceid(NFS_SERVER(lo->plh_inode),
&mirror->dss[dss_id].devid, lo->plh_lc_cred,
GFP_KERNEL);
@@ -332,20 +341,23 @@ ff_layout_init_mirror_ds(struct pnfs_layout_hdr *lo,
if (cmpxchg(&mirror->dss[dss_id].mirror_ds, NULL, mirror_ds) &&
mirror_ds != ERR_PTR(-ENODEV))
nfs4_put_deviceid_node(node);
- }
- if (IS_ERR(mirror->dss[dss_id].mirror_ds))
- goto outerr;
+ mirror_ds = mirror->dss[dss_id].mirror_ds;
+ }
- return true;
-outerr:
- return false;
+ if (IS_ERR(mirror_ds))
+ return mirror_ds;
+ if (!atomic_inc_not_zero(&mirror_ds->id_node.ref))
+ return ERR_PTR(-ENODEV);
+ return mirror_ds;
}
/**
* nfs4_ff_layout_prepare_ds - prepare a DS connection for an RPC call
* @lseg: the layout segment we're operating on
* @mirror: layout mirror describing the DS to use
+ * @mirror_ds: referenced device node for the stripe, from
+ * ff_layout_get_mirror_ds() (may be an ERR_PTR)
* @dss_id: DS stripe id to select stripe to use
* @fail_return: return layout on connect failure?
*
@@ -363,6 +375,7 @@ ff_layout_init_mirror_ds(struct pnfs_layout_hdr *lo,
struct nfs4_pnfs_ds *
nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
struct nfs4_ff_layout_mirror *mirror,
+ struct nfs4_ff_layout_ds *mirror_ds,
u32 dss_id,
bool fail_return)
{
@@ -372,10 +385,10 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
unsigned int max_payload;
int status = -EAGAIN;
- if (!ff_layout_init_mirror_ds(lseg->pls_layout, mirror, dss_id))
+ if (IS_ERR_OR_NULL(mirror_ds))
goto noconnect;
- ds = mirror->dss[dss_id].mirror_ds->ds;
+ ds = mirror_ds->ds;
if (READ_ONCE(ds->ds_clp))
goto out;
/* matching smp_wmb() in _nfs4_pnfs_v3/4_ds_connect */
@@ -384,11 +397,11 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
/* FIXME: For now we assume the server sent only one version of NFS
* to use for the DS.
*/
- status = nfs4_pnfs_ds_connect(s, ds, &mirror->dss[dss_id].mirror_ds->id_node,
+ status = nfs4_pnfs_ds_connect(s, ds, &mirror_ds->id_node,
dataserver_timeo, dataserver_retrans,
- mirror->dss[dss_id].mirror_ds->ds_versions[0].version,
- mirror->dss[dss_id].mirror_ds->ds_versions[0].minor_version,
- mirror->dss[dss_id].mirror_ds->ds_versions[0].tightly_coupled);
+ mirror_ds->ds_versions[0].version,
+ mirror_ds->ds_versions[0].minor_version,
+ mirror_ds->ds_versions[0].tightly_coupled);
/* connect success, check rsize/wsize limit */
if (!status) {
@@ -401,10 +414,10 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg,
max_payload =
nfs_block_size(rpc_max_payload(ds->ds_clp->cl_rpcclient),
NULL);
- if (mirror->dss[dss_id].mirror_ds->ds_versions[0].rsize > max_payload)
- mirror->dss[dss_id].mirror_ds->ds_versions[0].rsize = max_payload;
- if (mirror->dss[dss_id].mirror_ds->ds_versions[0].wsize > max_payload)
- mirror->dss[dss_id].mirror_ds->ds_versions[0].wsize = max_payload;
+ if (mirror_ds->ds_versions[0].rsize > max_payload)
+ mirror_ds->ds_versions[0].rsize = max_payload;
+ if (mirror_ds->ds_versions[0].wsize > max_payload)
+ mirror_ds->ds_versions[0].wsize = max_payload;
goto out;
}
noconnect:
@@ -424,11 +437,12 @@ const struct cred *
ff_layout_get_ds_cred(struct nfs4_ff_layout_mirror *mirror,
const struct pnfs_layout_range *range,
const struct cred *mdscred,
+ const struct nfs4_ff_layout_ds *mirror_ds,
u32 dss_id)
{
const struct cred *cred;
- if (mirror && !mirror->dss[dss_id].mirror_ds->ds_versions[0].tightly_coupled) {
+ if (mirror && !mirror_ds->ds_versions[0].tightly_coupled) {
cred = ff_layout_get_mirror_cred(mirror, range->iomode, dss_id);
if (!cred)
cred = get_cred(mdscred);
@@ -440,20 +454,18 @@ ff_layout_get_ds_cred(struct nfs4_ff_layout_mirror *mirror,
/**
* nfs4_ff_find_or_create_ds_client - Find or create a DS rpc client
- * @mirror: pointer to the mirror
+ * @mirror_ds: device node for the stripe
* @ds_clp: nfs_client for the DS
* @inode: pointer to inode
- * @dss_id: DS stripe id
*
* Find or create a DS rpc client with th MDS server rpc client auth flavor
* in the nfs_client cl_ds_clients list.
*/
struct rpc_clnt *
-nfs4_ff_find_or_create_ds_client(struct nfs4_ff_layout_mirror *mirror,
- struct nfs_client *ds_clp, struct inode *inode,
- u32 dss_id)
+nfs4_ff_find_or_create_ds_client(const struct nfs4_ff_layout_ds *mirror_ds,
+ struct nfs_client *ds_clp, struct inode *inode)
{
- switch (mirror->dss[dss_id].mirror_ds->ds_versions[0].version) {
+ switch (mirror_ds->ds_versions[0].version) {
case 3:
/* For NFSv3 DS, flavor is set when creating DS connections */
return ds_clp->cl_rpcclient;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0487/1005] NFSv4/flexfiles: Hold a device node reference for layoutstats encoding
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (485 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0486/1005] NFSv4/flexfiles: Reference the device node across DS setup Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0488/1005] NFSv4/flexfiles: Make the pinned device node pointer RCU-managed Greg Kroah-Hartman
` (511 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Coddington, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <ben.coddington@hammerspace.com>
[ Upstream commit dbde656f2f7a8dced33413c83a0cb6b634bfb26e ]
ff_layout_mirror_prepare_stats() records a stripe's device under i_lock,
but the layoutstats/layoutreturn XDR encode runs later and dereferences
the mirror's pinned device node (for the DS netaddr) with no reference
of its own. Once a CHANGE notification can re-point the pinned node,
that read becomes use-after-free.
Take a node reference at prepare time and carry it with the stripe in a
per-devinfo nfs4_ff_layoutstat_priv, released in
ff_layout_free_layoutstats(). The priv entries live alongside the
devinfo array: co-allocated for LAYOUTSTATS, an additional member of
nfs4_flexfile_layoutreturn_args for LAYOUTRETURN.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 53 +++++++++++++++++---------
fs/nfs/flexfilelayout/flexfilelayout.h | 11 ++++++
2 files changed, 47 insertions(+), 17 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 8463021511c17..7105790c9ef5e 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -44,10 +44,11 @@ static void ff_layout_read_record_layoutstats_done(struct rpc_task *task,
static int
ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
struct nfs42_layoutstat_devinfo *devinfo,
+ struct nfs4_ff_layoutstat_priv *priv,
int dev_limit, enum nfs4_ff_op_type type);
static void ff_layout_encode_ff_layoutupdate(struct xdr_stream *xdr,
const struct nfs42_layoutstat_devinfo *devinfo,
- struct nfs4_ff_layout_ds_stripe *dss_info);
+ struct nfs4_ff_layoutstat_priv *priv);
static struct pnfs_layout_hdr *
ff_layout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags)
@@ -2805,7 +2806,7 @@ ff_layout_prepare_layoutreturn(struct nfs4_layoutreturn_args *args)
spin_lock(&args->inode->i_lock);
ff_args->num_dev = ff_layout_mirror_prepare_stats(
- &ff_layout->generic_hdr, &ff_args->devinfo[0],
+ &ff_layout->generic_hdr, &ff_args->devinfo[0], &ff_args->priv[0],
ARRAY_SIZE(ff_args->devinfo), NFS4_FF_OP_LAYOUTRETURN);
spin_unlock(&args->inode->i_lock);
@@ -2980,10 +2981,11 @@ ff_layout_encode_io_latency(struct xdr_stream *xdr,
static void
ff_layout_encode_ff_layoutupdate(struct xdr_stream *xdr,
const struct nfs42_layoutstat_devinfo *devinfo,
- struct nfs4_ff_layout_ds_stripe *dss_info)
+ struct nfs4_ff_layoutstat_priv *priv)
{
+ struct nfs4_ff_layout_ds_stripe *dss_info = priv->dss_info;
struct nfs4_pnfs_ds_addr *da;
- struct nfs4_pnfs_ds *ds = dss_info->mirror_ds->ds;
+ struct nfs4_pnfs_ds *ds = priv->mirror_ds->ds;
struct nfs_fh *fh = &dss_info->fh_versions[0];
__be32 *p;
@@ -3030,10 +3032,10 @@ ff_layout_encode_layoutstats(struct xdr_stream *xdr, const void *args,
static void
ff_layout_free_layoutstats(struct nfs4_xdr_opaque_data *opaque)
{
- struct nfs4_ff_layout_ds_stripe *dss_info = opaque->data;
- struct nfs4_ff_layout_mirror *mirror = dss_info->mirror;
+ struct nfs4_ff_layoutstat_priv *priv = opaque->data;
- ff_layout_put_mirror(mirror);
+ nfs4_ff_layout_put_deviceid(priv->mirror_ds);
+ ff_layout_put_mirror(priv->dss_info->mirror);
}
static const struct nfs4_xdr_opaque_ops layoutstat_ops = {
@@ -3044,12 +3046,13 @@ static const struct nfs4_xdr_opaque_ops layoutstat_ops = {
static int
ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
struct nfs42_layoutstat_devinfo *devinfo,
+ struct nfs4_ff_layoutstat_priv *priv,
int dev_limit, enum nfs4_ff_op_type type)
{
struct nfs4_flexfile_layout *ff_layout = FF_LAYOUT_FROM_HDR(lo);
struct nfs4_ff_layout_mirror *mirror;
struct nfs4_ff_layout_ds_stripe *dss_info;
- struct nfs4_deviceid_node *dev;
+ struct nfs4_ff_layout_ds *mirror_ds;
int i = 0, dss_id;
list_for_each_entry(mirror, &ff_layout->mirrors, mirrors) {
@@ -3057,7 +3060,8 @@ ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
dss_info = &mirror->dss[dss_id];
if (i >= dev_limit)
break;
- if (IS_ERR_OR_NULL(dss_info->mirror_ds))
+ mirror_ds = dss_info->mirror_ds;
+ if (IS_ERR_OR_NULL(mirror_ds))
continue;
if (!test_and_clear_bit(NFS4_FF_MIRROR_STAT_AVAIL,
&mirror->flags) &&
@@ -3066,9 +3070,14 @@ ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
/* mirror refcount put in cleanup_layoutstats */
if (!refcount_inc_not_zero(&mirror->ref))
continue;
- dev = &dss_info->mirror_ds->id_node;
+ /*
+ * The mirror's pin holds the node while we're under
+ * i_lock; take a reference for the encode, put in
+ * ff_layout_free_layoutstats().
+ */
+ atomic_inc(&mirror_ds->id_node.ref);
memcpy(&devinfo->dev_id,
- &dev->deviceid,
+ &mirror_ds->id_node.deviceid,
NFS4_DEVICEID4_SIZE);
devinfo->offset = 0;
devinfo->length = NFS4_MAX_UINT64;
@@ -3084,9 +3093,12 @@ ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
spin_unlock(&mirror->lock);
devinfo->layout_type = LAYOUT_FLEX_FILES;
devinfo->ld_private.ops = &layoutstat_ops;
- devinfo->ld_private.data = &mirror->dss[dss_id];
+ priv->dss_info = dss_info;
+ priv->mirror_ds = mirror_ds;
+ devinfo->ld_private.data = priv;
devinfo++;
+ priv++;
i++;
}
}
@@ -3097,21 +3109,28 @@ static int ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args)
{
struct pnfs_layout_hdr *lo;
struct nfs4_flexfile_layout *ff_layout;
+ struct nfs4_ff_layoutstat_priv *priv;
const int dev_count = PNFS_LAYOUTSTATS_MAXDEV;
- /* For now, send at most PNFS_LAYOUTSTATS_MAXDEV statistics */
- args->devinfo = kmalloc_objs(*args->devinfo, dev_count,
- nfs_io_gfp_mask());
+ /*
+ * For now, send at most PNFS_LAYOUTSTATS_MAXDEV statistics.
+ * The per-devinfo private entries are co-allocated after the
+ * devinfo array and freed along with it.
+ */
+ args->devinfo = kmalloc(dev_count * (sizeof(*args->devinfo) +
+ sizeof(*priv)),
+ nfs_io_gfp_mask());
if (!args->devinfo)
return -ENOMEM;
+ priv = (struct nfs4_ff_layoutstat_priv *)&args->devinfo[dev_count];
spin_lock(&args->inode->i_lock);
lo = NFS_I(args->inode)->layout;
if (lo && pnfs_layout_is_valid(lo)) {
ff_layout = FF_LAYOUT_FROM_HDR(lo);
args->num_dev = ff_layout_mirror_prepare_stats(
- &ff_layout->generic_hdr, &args->devinfo[0], dev_count,
- NFS4_FF_OP_LAYOUTSTATS);
+ &ff_layout->generic_hdr, &args->devinfo[0], priv,
+ dev_count, NFS4_FF_OP_LAYOUTSTATS);
} else
args->num_dev = 0;
spin_unlock(&args->inode->i_lock);
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h
index f9e491a0347e1..31f3c1a20d401 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.h
+++ b/fs/nfs/flexfilelayout/flexfilelayout.h
@@ -124,9 +124,20 @@ struct nfs4_flexfile_layout {
unsigned long flags;
};
+/*
+ * Per-devinfo private data for a layoutstats/layoutreturn encode: the
+ * stripe the stats describe plus a reference on its device node so the
+ * node (and its DS addresses) stay valid until the XDR encode runs.
+ */
+struct nfs4_ff_layoutstat_priv {
+ struct nfs4_ff_layout_ds_stripe *dss_info;
+ struct nfs4_ff_layout_ds *mirror_ds;
+};
+
struct nfs4_flexfile_layoutreturn_args {
struct list_head errors;
struct nfs42_layoutstat_devinfo devinfo[FF_LAYOUTSTATS_MAXDEV];
+ struct nfs4_ff_layoutstat_priv priv[FF_LAYOUTSTATS_MAXDEV];
unsigned int num_errors;
unsigned int num_dev;
struct page *pages[1];
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0488/1005] NFSv4/flexfiles: Make the pinned device node pointer RCU-managed
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (486 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0487/1005] NFSv4/flexfiles: Hold a device node reference for layoutstats encoding Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0489/1005] SUNRPC: add request-scoped disconnects when cancelling tasks Greg Kroah-Hartman
` (510 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Coddington, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <ben.coddington@hammerspace.com>
[ Upstream commit b14c22e01c5c4f8dfe9c7165c801796e1ec6ebae ]
Annotate mirror->dss[dss_id].mirror_ds as __rcu and convert the
remaining readers, completing the preparation for re-pointing the pinned
node while I/O is in flight:
- ff_layout_get_mirror_ds() takes its reference under rcu_read_lock()
with atomic_inc_not_zero(), retrying if it races a reset. The
resolve path takes the caller's reference before publishing the node
with cmpxchg(), so a concurrent reset cannot drop the last reference
under the caller: one reference is held for the installed pointer and
one for the caller, and the pointer's reference is released elsewhere
by xchg + put.
- The availability scans hold rcu_read_lock() across the walk; they
only test flags on the RCU-freed node.
- ff_layout_cancel_io() holds a reference across the cancel and
disconnect calls. Both of its callers hold i_lock and nothing on
that path sleeps, so the reference is not about blocking: it is
what keeps the node alive between the RCU-protected read and the
use of mirror_ds->ds. The final put is never reached here, because
the mirror's own pin outlives the loop -- which matters, since that
put ends in nfs_put_client() and cannot run under a spinlock.
- ff_layout_mirror_prepare_stats() reads the pointer with
rcu_dereference() under rcu_read_lock(). i_lock, which both callers
hold, is what excludes the re-pointing walk added later in this
series; it does not exclude the resolve path's cmpxchg(), which runs
from I/O submission, so the read cannot claim i_lock as its update-
side lock. A non-NULL pointer read there is stable regardless: the
resolve path only ever installs over NULL.
- ff_layout_free_mirror() tears down the last reference; no concurrency.
The pointer is still only ever set once per mirror lifetime, so there is
no behavior change; this commit makes the subsequent in-place re-resolve
on CB_NOTIFY_DEVICEID CHANGE safe to introduce.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 35 ++++---
fs/nfs/flexfilelayout/flexfilelayout.h | 2 +-
fs/nfs/flexfilelayout/flexfilelayoutdev.c | 110 ++++++++++++++--------
3 files changed, 93 insertions(+), 54 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 7105790c9ef5e..1bc6559ab660f 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -313,7 +313,9 @@ static void ff_layout_free_mirror(struct nfs4_ff_layout_mirror *mirror)
cred = rcu_access_pointer(mirror->dss[dss_id].rw_cred);
put_cred(cred);
nfs_close_local_fh(&mirror->dss[dss_id].nfl);
- nfs4_ff_layout_put_deviceid(mirror->dss[dss_id].mirror_ds);
+ /* the last reference to the mirror is gone; no concurrency */
+ nfs4_ff_layout_put_deviceid(rcu_dereference_protected(
+ mirror->dss[dss_id].mirror_ds, 1));
}
kfree(mirror->dss);
@@ -2578,22 +2580,29 @@ static void ff_layout_cancel_io(struct pnfs_layout_segment *lseg)
for (idx = 0; idx < flseg->mirror_array_cnt; idx++) {
mirror = flseg->mirror_array[idx];
for (dss_id = 0; dss_id < mirror->dss_count; dss_id++) {
- mirror_ds = mirror->dss[dss_id].mirror_ds;
- if (IS_ERR_OR_NULL(mirror_ds))
+ rcu_read_lock();
+ mirror_ds = rcu_dereference(mirror->dss[dss_id].mirror_ds);
+ if (IS_ERR_OR_NULL(mirror_ds) ||
+ !atomic_inc_not_zero(&mirror_ds->id_node.ref)) {
+ rcu_read_unlock();
continue;
- ds = mirror->dss[dss_id].mirror_ds->ds;
+ }
+ rcu_read_unlock();
+ ds = mirror_ds->ds;
if (!ds)
- continue;
+ goto next;
ds_clp = ds->ds_clp;
if (!ds_clp)
- continue;
+ goto next;
clnt = ds_clp->cl_rpcclient;
if (!clnt)
- continue;
+ goto next;
if (!rpc_cancel_tasks(clnt, -ECANCELED,
ff_layout_match_io, lseg))
- continue;
+ goto next;
rpc_clnt_disconnect(clnt);
+next:
+ nfs4_ff_layout_put_deviceid(mirror_ds);
}
}
}
@@ -3055,12 +3064,13 @@ ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
struct nfs4_ff_layout_ds *mirror_ds;
int i = 0, dss_id;
+ rcu_read_lock();
list_for_each_entry(mirror, &ff_layout->mirrors, mirrors) {
for (dss_id = 0; dss_id < mirror->dss_count; ++dss_id) {
dss_info = &mirror->dss[dss_id];
if (i >= dev_limit)
break;
- mirror_ds = dss_info->mirror_ds;
+ mirror_ds = rcu_dereference(dss_info->mirror_ds);
if (IS_ERR_OR_NULL(mirror_ds))
continue;
if (!test_and_clear_bit(NFS4_FF_MIRROR_STAT_AVAIL,
@@ -3070,10 +3080,8 @@ ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
/* mirror refcount put in cleanup_layoutstats */
if (!refcount_inc_not_zero(&mirror->ref))
continue;
- /*
- * The mirror's pin holds the node while we're under
- * i_lock; take a reference for the encode, put in
- * ff_layout_free_layoutstats().
+ /* The pin holds a reference; it is exchanged out only
+ * under i_lock. Put in ff_layout_free_layoutstats().
*/
atomic_inc(&mirror_ds->id_node.ref);
memcpy(&devinfo->dev_id,
@@ -3102,6 +3110,7 @@ ff_layout_mirror_prepare_stats(struct pnfs_layout_hdr *lo,
i++;
}
}
+ rcu_read_unlock();
return i;
}
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h
index 31f3c1a20d401..24de108af2cf8 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.h
+++ b/fs/nfs/flexfilelayout/flexfilelayout.h
@@ -79,7 +79,7 @@ struct nfs4_ff_layout_ds_stripe {
struct nfs4_ff_layout_mirror *mirror;
struct nfs4_deviceid devid;
u32 efficiency;
- struct nfs4_ff_layout_ds *mirror_ds;
+ struct nfs4_ff_layout_ds __rcu *mirror_ds;
u32 fh_versions_cnt;
struct nfs_fh *fh_versions;
nfs4_stateid stateid;
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 3712a47b20d08..3cef6a4a51a70 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -321,35 +321,54 @@ ff_layout_get_mirror_ds(struct pnfs_layout_hdr *lo,
struct nfs4_ff_layout_mirror *mirror,
u32 dss_id)
{
- struct nfs4_ff_layout_ds *mirror_ds;
+ struct nfs4_ff_layout_ds *mirror_ds, *old;
+ struct nfs4_deviceid_node *node;
if (mirror == NULL)
return ERR_PTR(-ENODEV);
- mirror_ds = mirror->dss[dss_id].mirror_ds;
- if (mirror_ds == NULL) {
- struct nfs4_deviceid_node *node;
-
+retry:
+ rcu_read_lock();
+ mirror_ds = rcu_dereference(mirror->dss[dss_id].mirror_ds);
+ if (mirror_ds && !IS_ERR(mirror_ds) &&
+ atomic_inc_not_zero(&mirror_ds->id_node.ref)) {
+ rcu_read_unlock();
+ return mirror_ds;
+ }
+ rcu_read_unlock();
+ if (IS_ERR(mirror_ds))
+ return mirror_ds;
+ if (mirror_ds != NULL)
+ /* raced with a reset; the field is being re-pointed */
+ goto retry;
+
+ node = nfs4_find_get_deviceid(NFS_SERVER(lo->plh_inode),
+ &mirror->dss[dss_id].devid, lo->plh_lc_cred,
+ GFP_KERNEL);
+ if (node) {
+ mirror_ds = FF_LAYOUT_MIRROR_DS(node);
+ /*
+ * Take the caller's reference before the pointer becomes
+ * visible below, so a concurrent reset of the installed
+ * pointer cannot drop the last reference under us.
+ */
+ atomic_inc(&node->ref);
+ } else {
mirror_ds = ERR_PTR(-ENODEV);
- node = nfs4_find_get_deviceid(NFS_SERVER(lo->plh_inode),
- &mirror->dss[dss_id].devid, lo->plh_lc_cred,
- GFP_KERNEL);
- if (node)
- mirror_ds = FF_LAYOUT_MIRROR_DS(node);
-
- /* check for race with another call to this function */
- if (cmpxchg(&mirror->dss[dss_id].mirror_ds, NULL, mirror_ds) &&
- mirror_ds != ERR_PTR(-ENODEV))
- nfs4_put_deviceid_node(node);
-
- mirror_ds = mirror->dss[dss_id].mirror_ds;
}
- if (IS_ERR(mirror_ds))
+ /* check for race with another call to this function */
+ old = unrcu_pointer(cmpxchg(&mirror->dss[dss_id].mirror_ds,
+ NULL, RCU_INITIALIZER(mirror_ds)));
+ if (old == NULL)
return mirror_ds;
- if (!atomic_inc_not_zero(&mirror_ds->id_node.ref))
- return ERR_PTR(-ENODEV);
- return mirror_ds;
+
+ /* lost the race; use the winner's node instead */
+ if (node) {
+ nfs4_put_deviceid_node(node);
+ nfs4_put_deviceid_node(node);
+ }
+ goto retry;
}
/**
@@ -570,49 +589,60 @@ unsigned int ff_layout_fetch_ds_ioerr(struct pnfs_layout_hdr *lo,
static bool ff_read_layout_has_available_ds(struct pnfs_layout_segment *lseg)
{
struct nfs4_ff_layout_mirror *mirror;
- struct nfs4_deviceid_node *devid;
+ struct nfs4_ff_layout_ds *mirror_ds;
+ bool ret = false;
u32 idx, dss_id;
+ rcu_read_lock();
for (idx = 0; idx < FF_LAYOUT_MIRROR_COUNT(lseg); idx++) {
mirror = FF_LAYOUT_COMP(lseg, idx);
if (!mirror)
continue;
for (dss_id = 0; dss_id < mirror->dss_count; dss_id++) {
- if (!mirror->dss[dss_id].mirror_ds)
- return true;
- if (IS_ERR(mirror->dss[dss_id].mirror_ds))
+ mirror_ds = rcu_dereference(mirror->dss[dss_id].mirror_ds);
+ if (!mirror_ds) {
+ ret = true;
+ goto out;
+ }
+ if (IS_ERR(mirror_ds))
continue;
- devid = &mirror->dss[dss_id].mirror_ds->id_node;
- if (!nfs4_test_deviceid_unavailable(devid))
- return true;
+ if (!nfs4_test_deviceid_unavailable(&mirror_ds->id_node)) {
+ ret = true;
+ goto out;
+ }
}
}
-
- return false;
+out:
+ rcu_read_unlock();
+ return ret;
}
static bool ff_rw_layout_has_available_ds(struct pnfs_layout_segment *lseg)
{
struct nfs4_ff_layout_mirror *mirror;
- struct nfs4_deviceid_node *devid;
+ struct nfs4_ff_layout_ds *mirror_ds;
+ bool ret = false;
u32 idx, dss_id;
+ rcu_read_lock();
for (idx = 0; idx < FF_LAYOUT_MIRROR_COUNT(lseg); idx++) {
mirror = FF_LAYOUT_COMP(lseg, idx);
if (!mirror)
- return false;
+ goto out;
for (dss_id = 0; dss_id < mirror->dss_count; dss_id++) {
- if (IS_ERR(mirror->dss[dss_id].mirror_ds))
- return false;
- if (!mirror->dss[dss_id].mirror_ds)
+ mirror_ds = rcu_dereference(mirror->dss[dss_id].mirror_ds);
+ if (IS_ERR(mirror_ds))
+ goto out;
+ if (!mirror_ds)
continue;
- devid = &mirror->dss[dss_id].mirror_ds->id_node;
- if (nfs4_test_deviceid_unavailable(devid))
- return false;
+ if (nfs4_test_deviceid_unavailable(&mirror_ds->id_node))
+ goto out;
}
}
-
- return FF_LAYOUT_MIRROR_COUNT(lseg) != 0;
+ ret = FF_LAYOUT_MIRROR_COUNT(lseg) != 0;
+out:
+ rcu_read_unlock();
+ return ret;
}
static bool ff_layout_has_available_ds(struct pnfs_layout_segment *lseg)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0489/1005] SUNRPC: add request-scoped disconnects when cancelling tasks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (487 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0488/1005] NFSv4/flexfiles: Make the pinned device node pointer RCU-managed Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0490/1005] NFSv4/flexfiles: limit transport disconnects when cancelling I/O Greg Kroah-Hartman
` (509 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tim Menninger, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Menninger <tmenninger@everpuredata.com>
[ Upstream commit 9d84719d34cb98a2f584e38679f95216c1a15d0e ]
rpc_cancel_tasks() allows callers to cancel a selected set of RPC tasks,
but callers that also need to tear down the connection currently have to
disconnect at the rpc_clnt level.
That is broader than necessary for clients with multiple transports. A
cancelled request is associated with a specific rpc_xprt and records the
connection generation on which it was transmitted in rq_connect_cookie.
Add rpc_cancel_tasks_and_disconnect() to cancel matching tasks and mark
matching requests that remain on the transport transmit or receive queues
for conditional transport disconnect when the request is released.
Store the disconnect indication in struct rpc_rqst rather than struct
rpc_task. An RPC task can release one request and later acquire another,
so task-scoped state could otherwise be consumed by a successor request
and disconnect the wrong transport generation.
After cancelling matching tasks, walk the client's transports and mark
matching requests belonging to that client that remain on the transmit
or receive queues. An rpc_xprt may be shared by multiple rpc_clnt
instances, so requests belonging to other clients are not marked.
When a marked request is released, consume the marker under the existing
transport_lock critical section. If the request was transmitted, call
xprt_conditional_disconnect_locked() with its rq_connect_cookie. The
disconnect is skipped if that cookie no longer matches the transport's
current connection generation.
This adds no lock acquisition to the normal request-release path.
Requests that were never transmitted do not trigger this additional
disconnect.
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Stable-dep-of: 788c4f628565 ("NFSv4/flexfiles: limit transport disconnects when cancelling I/O")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sunrpc/sched.h | 4 ++
include/linux/sunrpc/xprt.h | 5 ++
net/sunrpc/clnt.c | 94 ++++++++++++++++++++++++------
net/sunrpc/sunrpc.h | 8 +++
net/sunrpc/xprt.c | 107 +++++++++++++++++++++++++++++++++--
5 files changed, 195 insertions(+), 23 deletions(-)
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 0dbdf3722537f..dbaad8b5f181c 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -230,6 +230,10 @@ unsigned long rpc_cancel_tasks(struct rpc_clnt *clnt, int error,
bool (*fnmatch)(const struct rpc_task *,
const void *),
const void *data);
+unsigned long rpc_cancel_tasks_and_disconnect(struct rpc_clnt *clnt, int error,
+ bool (*fnmatch)(const struct rpc_task *,
+ const void *),
+ const void *data);
void rpc_execute(struct rpc_task *);
void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index a82045804d34e..ef120fc504227 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -112,6 +112,11 @@ struct rpc_rqst {
ktime_t rq_xtime; /* transmit time stamp */
int rq_ntrans;
+ bool rq_disconnect_on_release;
+ /*
+ * protected by rq_xprt->transport_lock
+ * while the request is active
+ */
#if defined(CONFIG_SUNRPC_BACKCHANNEL)
struct lwq_node rq_bc_list; /* Callback service list */
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 33e64c0225f37..2f076b4bfd540 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -904,29 +904,36 @@ void rpc_killall_tasks(struct rpc_clnt *clnt)
}
EXPORT_SYMBOL_GPL(rpc_killall_tasks);
-/**
- * rpc_cancel_tasks - try to cancel a set of RPC tasks
- * @clnt: Pointer to RPC client
- * @error: RPC task error value to set
- * @fnmatch: Pointer to selector function
- * @data: User data
- *
- * Uses @fnmatch to define a set of RPC tasks that are to be cancelled.
- * The argument @error must be a negative error value.
- */
-unsigned long rpc_cancel_tasks(struct rpc_clnt *clnt, int error,
- bool (*fnmatch)(const struct rpc_task *,
- const void *),
- const void *data)
+struct rpc_cancel_disconnect_ctx {
+ bool (*fnmatch)(const struct rpc_task *task, const void *data);
+ const void *data;
+};
+
+static int rpc_mark_xprt_disconnect_on_release(struct rpc_clnt *clnt,
+ struct rpc_xprt *xprt,
+ void *arg)
+{
+ struct rpc_cancel_disconnect_ctx *ctx = arg;
+
+ xprt_mark_matching_reqs_disconnect_on_release(xprt, clnt,
+ ctx->fnmatch,
+ ctx->data);
+ return 0;
+}
+
+static unsigned long
+__rpc_cancel_tasks(struct rpc_clnt *clnt, int error,
+ bool (*fnmatch)(const struct rpc_task *,
+ const void *),
+ const void *data,
+ bool disconnect)
{
struct rpc_task *task;
unsigned long count = 0;
if (list_empty(&clnt->cl_tasks))
return 0;
- /*
- * Spin lock all_tasks to prevent changes...
- */
+
spin_lock(&clnt->cl_lock);
list_for_each_entry(task, &clnt->cl_tasks, tk_task) {
if (!RPC_IS_ACTIVATED(task))
@@ -937,10 +944,63 @@ unsigned long rpc_cancel_tasks(struct rpc_clnt *clnt, int error,
count++;
}
spin_unlock(&clnt->cl_lock);
+
+ if (disconnect && count) {
+ struct rpc_cancel_disconnect_ctx ctx = {
+ .fnmatch = fnmatch,
+ .data = data,
+ };
+ rpc_clnt_iterate_for_each_xprt(clnt,
+ rpc_mark_xprt_disconnect_on_release,
+ &ctx);
+ }
return count;
}
+
+/**
+ * rpc_cancel_tasks - try to cancel a set of RPC tasks
+ * @clnt: Pointer to RPC client
+ * @error: RPC task error value to set
+ * @fnmatch: Pointer to selector function
+ * @data: User data
+ *
+ * Uses @fnmatch to define a set of RPC tasks that are to be cancelled.
+ * The argument @error must be a negative error value.
+ */
+unsigned long rpc_cancel_tasks(struct rpc_clnt *clnt, int error,
+ bool (*fnmatch)(const struct rpc_task *,
+ const void *),
+ const void *data)
+{
+ return __rpc_cancel_tasks(clnt, error, fnmatch, data, false);
+}
EXPORT_SYMBOL_GPL(rpc_cancel_tasks);
+/**
+ * rpc_cancel_tasks_and_disconnect - cancel matching RPC tasks
+ * @clnt: Pointer to RPC client
+ * @error: RPC task error value to set
+ * @fnmatch: Pointer to selector function
+ * @data: User data
+ *
+ * Like rpc_cancel_tasks(), but after cancelling matching tasks, marks
+ * matching in-flight requests so that xprt_release() conditionally
+ * disconnects the connection generation on which each request was sent.
+ *
+ * @fnmatch is called while holding spinlocks and must not sleep.
+ *
+ * Returns the number of active tasks matched by @fnmatch.
+ */
+unsigned long
+rpc_cancel_tasks_and_disconnect(struct rpc_clnt *clnt, int error,
+ bool (*fnmatch)(const struct rpc_task *,
+ const void *),
+ const void *data)
+{
+ return __rpc_cancel_tasks(clnt, error, fnmatch, data, true);
+}
+EXPORT_SYMBOL_GPL(rpc_cancel_tasks_and_disconnect);
+
static int rpc_clnt_disconnect_xprt(struct rpc_clnt *clnt,
struct rpc_xprt *xprt, void *dummy)
{
diff --git a/net/sunrpc/sunrpc.h b/net/sunrpc/sunrpc.h
index e3c6e3b63f0ba..11b9e5cead8e2 100644
--- a/net/sunrpc/sunrpc.h
+++ b/net/sunrpc/sunrpc.h
@@ -38,9 +38,17 @@ static inline int sock_is_loopback(struct sock *sk)
struct svc_serv;
struct svc_rqst;
+struct rpc_clnt;
+struct rpc_task;
+struct rpc_xprt;
int rpc_clients_notifier_register(void);
void rpc_clients_notifier_unregister(void);
void auth_domain_cleanup(void);
void svc_sock_update_bufs(struct svc_serv *serv);
enum svc_auth_status svc_authenticate(struct svc_rqst *rqstp);
+void xprt_mark_matching_reqs_disconnect_on_release(struct rpc_xprt *xprt,
+ const struct rpc_clnt *clnt,
+ bool (*fnmatch)(const struct rpc_task *,
+ const void *),
+ const void *data);
#endif /* _NET_SUNRPC_SUNRPC_H */
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 48a3618cbb29f..c110806989c5d 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -812,6 +812,17 @@ xprt_request_retransmit_after_disconnect(struct rpc_task *task)
!xprt_connected(xprt);
}
+static void xprt_conditional_disconnect_locked(struct rpc_xprt *xprt,
+ unsigned int cookie)
+ __must_hold(&xprt->transport_lock)
+{
+ if (cookie != xprt->connect_cookie)
+ return;
+ if (test_bit(XPRT_CLOSING, &xprt->state))
+ return;
+ xprt_schedule_autoclose_locked(xprt);
+}
+
/**
* xprt_conditional_disconnect - force a transport to disconnect
* @xprt: transport to disconnect
@@ -827,12 +838,7 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie)
{
/* Don't race with the test_bit() in xprt_clear_locked() */
spin_lock(&xprt->transport_lock);
- if (cookie != xprt->connect_cookie)
- goto out;
- if (test_bit(XPRT_CLOSING, &xprt->state))
- goto out;
- xprt_schedule_autoclose_locked(xprt);
-out:
+ xprt_conditional_disconnect_locked(xprt, cookie);
spin_unlock(&xprt->transport_lock);
}
@@ -1434,6 +1440,79 @@ xprt_request_dequeue_transmit(struct rpc_task *task)
spin_unlock(&xprt->queue_lock);
}
+static bool
+xprt_request_matches(const struct rpc_rqst *req,
+ const struct rpc_clnt *clnt,
+ bool (*fnmatch)(const struct rpc_task *, const void *),
+ const void *data)
+{
+ const struct rpc_task *task = req->rq_task;
+
+ return task && task->tk_client == clnt && fnmatch(task, data);
+}
+
+static void
+xprt_request_mark_disconnect_on_release(struct rpc_xprt *xprt,
+ struct rpc_rqst *req)
+ __must_hold(&xprt->queue_lock)
+{
+ spin_lock(&xprt->transport_lock);
+ req->rq_disconnect_on_release = true;
+ spin_unlock(&xprt->transport_lock);
+}
+
+/**
+ * xprt_mark_matching_reqs_disconnect_on_release - mark matching in-flight
+ * requests for connection-generation
+ * teardown at release
+ * @xprt: transport whose queues to walk
+ * @clnt: RPC client whose requests are eligible
+ * @fnmatch: selector called with the request's owning rpc_task
+ * @data: caller data forwarded to @fnmatch
+ *
+ * @fnmatch must not sleep and must be safe to call while xprt->queue_lock
+ * is held.
+ *
+ * Walks the transmit queue (including per-owner rq_xmit2 chains) and the
+ * receive tree under xprt->queue_lock and marks each matching rpc_rqst so
+ * that xprt_release() will conditionally disconnect the transport against
+ * that request's rq_connect_cookie. Requests remain eligible for marking
+ * while they are present on a transport queue. The marker is set under
+ * xprt->transport_lock, nested inside xprt->queue_lock, and xprt_release()
+ * consumes it with xprt->transport_lock held after removing queue membership.
+ *
+ * The @clnt qualification preserves the selection domain of
+ * rpc_cancel_tasks(). An rpc_xprt may be shared by multiple rpc_clnt
+ * instances, so requests belonging to other clients must not be marked.
+ */
+void
+xprt_mark_matching_reqs_disconnect_on_release(struct rpc_xprt *xprt,
+ const struct rpc_clnt *clnt,
+ bool (*fnmatch)(const struct rpc_task *,
+ const void *),
+ const void *data)
+{
+ struct rpc_rqst *req, *pos;
+ struct rb_node *n;
+
+ spin_lock(&xprt->queue_lock);
+ list_for_each_entry(req, &xprt->xmit_queue, rq_xmit) {
+ if (xprt_request_matches(req, clnt, fnmatch, data))
+ xprt_request_mark_disconnect_on_release(xprt, req);
+ list_for_each_entry(pos, &req->rq_xmit2, rq_xmit2) {
+ if (xprt_request_matches(pos, clnt, fnmatch, data))
+ xprt_request_mark_disconnect_on_release(xprt,
+ pos);
+ }
+ }
+ for (n = rb_first(&xprt->recv_queue); n; n = rb_next(n)) {
+ req = rb_entry(n, struct rpc_rqst, rq_recv);
+ if (xprt_request_matches(req, clnt, fnmatch, data))
+ xprt_request_mark_disconnect_on_release(xprt, req);
+ }
+ spin_unlock(&xprt->queue_lock);
+}
+
/**
* xprt_request_dequeue_xprt - remove a task from the transmit+receive queue
* @task: pointer to rpc_task
@@ -1915,6 +1994,7 @@ xprt_request_init(struct rpc_task *task)
req->rq_rcv_buf.bvec = NULL;
req->rq_release_snd_buf = NULL;
req->rq_seqno_count = 0;
+ req->rq_disconnect_on_release = false;
xprt_init_majortimeo(task, req, task->tk_client->cl_timeout);
trace_xprt_reserve(req);
@@ -1991,6 +2071,20 @@ void xprt_release(struct rpc_task *task)
xprt = req->rq_xprt;
xprt_request_dequeue_xprt(task);
spin_lock(&xprt->transport_lock);
+ if (unlikely(req->rq_disconnect_on_release)) {
+ req->rq_disconnect_on_release = false;
+ /*
+ * Dequeue may skip queue_lock. Pair with the fully ordered
+ * test_and_clear_bit(RPC_TASK_NEED_XMIT) in
+ * xprt_request_dequeue_transmit_locked() to order the runstate
+ * check before reading the sender's rq_ntrans and
+ * rq_connect_cookie updates.
+ */
+ smp_rmb();
+ if (req->rq_ntrans > 0)
+ xprt_conditional_disconnect_locked(xprt,
+ req->rq_connect_cookie);
+ }
xprt->ops->release_xprt(xprt, task);
if (xprt->ops->release_request)
xprt->ops->release_request(task);
@@ -2020,6 +2114,7 @@ xprt_init_bc_request(struct rpc_rqst *req, struct rpc_task *task,
task->tk_rqstp = req;
req->rq_task = task;
xprt_init_connect_cookie(req, req->rq_xprt);
+ req->rq_disconnect_on_release = false;
/*
* Set up the xdr_buf length.
* This also indicates that the buffer is XDR encoded already.
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0490/1005] NFSv4/flexfiles: limit transport disconnects when cancelling I/O
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (488 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0489/1005] SUNRPC: add request-scoped disconnects when cancelling tasks Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0491/1005] net/mlx5: E-switch, Restore host PF enable for ECPF that isnt E-switch manager Greg Kroah-Hartman
` (508 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tim Menninger, Anna Schumaker,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Menninger <tmenninger@everpuredata.com>
[ Upstream commit 788c4f628565897e7090cdf5bb2e049e74aeca96 ]
ff_layout_cancel_io() cancels RPC tasks associated with a recalled or
revoked layout segment. If any matching tasks are found, it then calls
rpc_clnt_disconnect().
rpc_clnt_disconnect() disconnects every transport attached to the RPC
client. A data server client can have multiple transports, while the
cancelled requests may have used only a subset of them. Cancelling I/O
for one layout segment can therefore disrupt unrelated I/O using other
transports belonging to the same data server client.
This is particularly disruptive with RPC/RDMA during data server
recovery, where unnecessary transport disconnects can result in repeated
reconnect activity on otherwise unaffected connections.
Use rpc_cancel_tasks_and_disconnect() instead. Matching tasks are still
cancelled, but only matching requests belonging to that client that
remain on the transport transmit or receive queues are marked for
disconnect. When such a request is released, SUNRPC conditionally
disconnects the connection generation on which that request was sent.
This preserves cancellation and draining of I/O associated with the
layout segment without disconnecting unrelated transports attached to
the same RPC client.
Fixes: b739a5bd9d9f ("NFSv4/flexfiles: Cancel I/O if the layout is recalled or revoked")
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 1bc6559ab660f..a4ccd53c79e79 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -2597,10 +2597,9 @@ static void ff_layout_cancel_io(struct pnfs_layout_segment *lseg)
clnt = ds_clp->cl_rpcclient;
if (!clnt)
goto next;
- if (!rpc_cancel_tasks(clnt, -ECANCELED,
- ff_layout_match_io, lseg))
- goto next;
- rpc_clnt_disconnect(clnt);
+ rpc_cancel_tasks_and_disconnect(clnt, -ECANCELED,
+ ff_layout_match_io,
+ lseg);
next:
nfs4_ff_layout_put_deviceid(mirror_ds);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0491/1005] net/mlx5: E-switch, Restore host PF enable for ECPF that isnt E-switch manager
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (489 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0490/1005] NFSv4/flexfiles: limit transport disconnects when cancelling I/O Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0492/1005] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
` (507 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shay Drory, Moshe Shemesh,
Mark Bloch, Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Drory <shayd@nvidia.com>
[ Upstream commit 4777203cc9af51db5ae647920c14ee9451e783d7 ]
The cited commit breaks host PF enable_hca when the ECPF isn't E-switch
manager. For example, when the link layer is infiniband, the ECPF isn't
E-switch manager, so after the cited commit enable_hca is never issued
for the host PF, it stays in initializing state and fails to probe.
Fix it by checking esw_allowed() only for vport bookkeeping
Fixes: 0e6c95c98829 ("net/mlx5: Support devlink port state for host PF")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261104184756.773910-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/mellanox/mlx5/core/eswitch.c | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index fc197d1dc9dfe..603e8ae72734c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1509,13 +1509,9 @@ int mlx5_esw_pf_enable_hca(struct mlx5_core_dev *dev, u16 vport_num)
struct mlx5_vport *vport;
int err;
- if (!mlx5_core_is_ecpf(dev) || !mlx5_esw_allowed(esw))
+ if (!mlx5_core_is_ecpf(dev))
return 0;
- vport = mlx5_eswitch_get_vport(esw, vport_num);
- if (IS_ERR(vport))
- return PTR_ERR(vport);
-
/* Once vport and representor are ready, take the PF out of
* initializing state. Enabling HCA clears the iser->initializing
* bit and PF driver loading can progress.
@@ -1524,7 +1520,11 @@ int mlx5_esw_pf_enable_hca(struct mlx5_core_dev *dev, u16 vport_num)
if (err)
return err;
- vport->pf_activated = true;
+ if (mlx5_esw_allowed(esw)) {
+ vport = mlx5_eswitch_get_vport(esw, vport_num);
+ if (!IS_ERR(vport))
+ vport->pf_activated = true;
+ }
return 0;
}
@@ -1535,18 +1535,18 @@ int mlx5_esw_pf_disable_hca(struct mlx5_core_dev *dev, u16 vport_num)
struct mlx5_vport *vport;
int err;
- if (!mlx5_core_is_ecpf(dev) || !mlx5_esw_allowed(esw))
+ if (!mlx5_core_is_ecpf(dev))
return 0;
- vport = mlx5_eswitch_get_vport(esw, vport_num);
- if (IS_ERR(vport))
- return PTR_ERR(vport);
-
err = mlx5_cmd_pf_disable_hca(dev, vport_num);
if (err)
return err;
- vport->pf_activated = false;
+ if (mlx5_esw_allowed(esw)) {
+ vport = mlx5_eswitch_get_vport(esw, vport_num);
+ if (!IS_ERR(vport))
+ vport->pf_activated = false;
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0492/1005] net/mlx5: macsec: Dont remove fs_id when adding a rule fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (490 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0491/1005] net/mlx5: E-switch, Restore host PF enable for ECPF that isnt E-switch manager Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0493/1005] dpll: notify about a reference sync pair only if it was added Greg Kroah-Hartman
` (506 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Changyul Lee, Tariq Toukan,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Changyul Lee <lcy8047@gmail.com>
[ Upstream commit 5175da73dd128520ad6d704d7fe54926ee5f658b ]
macsec_fs_tx_add_rule() and macsec_fs_rx_add_rule() clean up a failed
rule with macsec_fs_{tx,rx}_del_rule(), which also calls
macsec_fs_id_del(). The fs_id is never in the xarray at that point:
macsec_fs_id_add() is the last step of adding a rule and removes its
own entry when it fails.
macsec_fs_id_del() then dereferences NULL, through macsec_device for
the first SA of a MACsec netdev and through fs_id_found otherwise. On
RX, the SAs of one SC share an fs_id, so a failure while adding another
SA drops the reference that an existing SA holds.
Split the rule teardown from the fs_id removal and do only the teardown
on the error paths.
Fixes: d4ece08f4b1d ("net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105003419.4016283-1-lcy8047@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/lib/macsec_fs.c | 38 ++++++++++++-------
1 file changed, 24 insertions(+), 14 deletions(-)
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 7d785c937d43d..4892175ca5774 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -764,13 +764,9 @@ static int macsec_fs_id_add(struct list_head *macsec_devices_list, u32 fs_id,
return err;
}
-static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
- struct mlx5_macsec_tx_rule *tx_rule,
- void *macdev)
+static void macsec_fs_tx_free_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_tx_rule *tx_rule)
{
- macsec_fs_id_del(&macsec_fs->macsec_devices_list, tx_rule->fs_id, macdev,
- &macsec_fs->sci_hash, true);
-
if (tx_rule->rule) {
mlx5_del_flow_rules(tx_rule->rule);
tx_rule->rule = NULL;
@@ -791,6 +787,15 @@ static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
macsec_fs_tx_ft_put(macsec_fs);
}
+static void macsec_fs_tx_del_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_tx_rule *tx_rule,
+ void *macdev)
+{
+ macsec_fs_id_del(&macsec_fs->macsec_devices_list, tx_rule->fs_id, macdev,
+ &macsec_fs->sci_hash, true);
+ macsec_fs_tx_free_rule(macsec_fs, tx_rule);
+}
+
#define MLX5_REFORMAT_PARAM_ADD_MACSEC_OFFSET_4_BYTES 1
static union mlx5_macsec_rule *
@@ -883,7 +888,7 @@ macsec_fs_tx_add_rule(struct mlx5_macsec_fs *macsec_fs,
goto out_spec;
err:
- macsec_fs_tx_del_rule(macsec_fs, tx_rule, macsec_ctx->secy->netdev);
+ macsec_fs_tx_free_rule(macsec_fs, tx_rule);
macsec_rule = NULL;
out_spec:
kvfree(spec);
@@ -1648,15 +1653,11 @@ static void macsec_fs_rx_ft_put(struct mlx5_macsec_fs *macsec_fs)
macsec_fs_rx_destroy(macsec_fs);
}
-static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
- struct mlx5_macsec_rx_rule *rx_rule,
- void *macdev, u32 fs_id)
+static void macsec_fs_rx_free_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_rx_rule *rx_rule)
{
int i;
- macsec_fs_id_del(&macsec_fs->macsec_devices_list, fs_id, macdev,
- &macsec_fs->fs_id_hash, false);
-
for (i = 0; i < RX_NUM_OF_RULES_PER_SA; ++i) {
if (rx_rule->rule[i]) {
mlx5_del_flow_rules(rx_rule->rule[i]);
@@ -1674,6 +1675,15 @@ static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
macsec_fs_rx_ft_put(macsec_fs);
}
+static void macsec_fs_rx_del_rule(struct mlx5_macsec_fs *macsec_fs,
+ struct mlx5_macsec_rx_rule *rx_rule,
+ void *macdev, u32 fs_id)
+{
+ macsec_fs_id_del(&macsec_fs->macsec_devices_list, fs_id, macdev,
+ &macsec_fs->fs_id_hash, false);
+ macsec_fs_rx_free_rule(macsec_fs, rx_rule);
+}
+
static void macsec_fs_rx_setup_fte(struct mlx5_flow_spec *spec,
struct mlx5_flow_act *flow_act,
struct mlx5_macsec_rule_attrs *attrs,
@@ -1833,7 +1843,7 @@ macsec_fs_rx_add_rule(struct mlx5_macsec_fs *macsec_fs,
return macsec_rule;
err:
- macsec_fs_rx_del_rule(macsec_fs, rx_rule, macsec_ctx->secy->netdev, fs_id);
+ macsec_fs_rx_free_rule(macsec_fs, rx_rule);
macsec_rule = NULL;
out_spec:
kvfree(spec);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0493/1005] dpll: notify about a reference sync pair only if it was added
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (491 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0492/1005] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0494/1005] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
` (505 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ivan Vecera, Vadim Fedorenko,
Petr Oros, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Vecera <ivecera@redhat.com>
[ Upstream commit 7a3837929d049dac1f931620f30b100993ce2594 ]
dpll_pin_ref_sync_pair_add() sends a pin change notification even when
xa_insert() fails and nothing has changed. zl3073x gets -EBUSY when
another channel has already added the same pair and ignores it, so user
space is notified about a change that did not happen.
Send the notification only after a successful insert.
Found by code review. Reproduced on a ZL30732A board with kprobes on
dpll_pin_ref_sync_pair_add() and __dpll_pin_change_ntf(): loading the
driver adds one pair twice and the add failing with -EBUSY sends a
notification. With this patch it does not, and the successful add still
does. A test module adding one pair twice shows the same on the monitor
group.
Fixes: 58256a26bfb3 ("dpll: add reference sync get/set")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Petr Oros <poros@redhat.com>
Link: https://patch.msgid.link/20261105131145.1010406-2-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dpll/dpll_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
index 8389983f42569..277692d12d3d1 100644
--- a/drivers/dpll/dpll_core.c
+++ b/drivers/dpll/dpll_core.c
@@ -1081,7 +1081,8 @@ int dpll_pin_ref_sync_pair_add(struct dpll_pin *pin,
mutex_lock(&dpll_lock);
ret = xa_insert(&pin->ref_sync_pins, ref_sync_pin->id,
ref_sync_pin, GFP_KERNEL);
- __dpll_pin_change_ntf(pin);
+ if (!ret)
+ __dpll_pin_change_ntf(pin);
mutex_unlock(&dpll_lock);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0494/1005] ipv4: route: dont blackhole in-use routes when retiring fnhe routes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (492 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0493/1005] dpll: notify about a reference sync pair only if it was added Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0495/1005] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
` (504 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Chase Hiltz,
Ido Schimmel, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chase Hiltz <me@chasehil.tz>
[ Upstream commit ae89f2724db1afa96a1f1b661174fc41ae1e88fa ]
When a route cached in a nexthop exception (fnhe) is replaced or
flushed, rt_bind_exception() and fnhe_flush_routes() call
dst_dev_put() on it. That sets dst->dev to blackhole_netdev and
dst->input/output to dst_discard*(), but other CPUs can still be
using the route, e.g. as a noref dst taken from the fnhe under RCU.
Packets that reach dst_input() or dst_output() after that are dropped.
If dst_dev_put() runs after a forwarded packet has entered ip_output(),
ip_skb_dst_mtu() in __ip_finish_output() can return the MTU of
blackhole_netdev (68), and ip_fragment() can then drop a DF packet and
send ICMP_FRAG_NEEDED with mtu 68 to its source.
Commit 5018c59607a5 ("ipv4: fix race condition between route lookup and
invalidation") fixed the same race in rt_cache_route() by putting the
old route on the uncached list instead of calling dst_dev_put(). Do the
same for routes retired from an fnhe. rt_flush_dev() still moves them
to blackhole_netdev when their device is unregistered.
fnhe routes are also retired on fnhe expiry (ip_del_fnhe()) and
eviction (fnhe_remove_oldest()). Those paths don't bump rt_genid, so
without the obsolete marking ipv4_dst_check() could still accept the
route. Keep marking retired routes DST_OBSOLETE_DEAD, as dst_dev_put()
did, so that users that cached them, such as sockets, look up again.
In a netns reproducer that forwards IPv4 traffic over an ip6tnl device,
with an fnhe for the destination, while the FIB keeps changing, this
patch stops the mtu 68 ICMPs and the drops.
Fixes: 95c47f9cf5e0 ("ipv4: call dst_dev_put() properly")
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Chase Hiltz <me@chasehil.tz>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261105182640.2999521-1-me@chasehil.tz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/route.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 1720323d9f025..e8bd10b28eb86 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -573,6 +573,17 @@ static void ip_rt_build_flow_key(struct flowi4 *fl4, const struct sock *sk,
static DEFINE_SPINLOCK(fnhe_lock);
+/* Other CPUs may still be using @rt, so don't dst_dev_put() it.
+ * rt_flush_dev() handles it if its device is unregistered.
+ * Marking it dead makes ipv4_dst_check() fail for users that cached it.
+ */
+static void fnhe_retire_route(struct rtable *rt)
+{
+ WRITE_ONCE(rt->dst.obsolete, DST_OBSOLETE_DEAD);
+ rt_add_uncached_list(rt);
+ dst_release(&rt->dst);
+}
+
static void fnhe_flush_routes(struct fib_nh_exception *fnhe)
{
struct rtable *rt;
@@ -580,14 +591,12 @@ static void fnhe_flush_routes(struct fib_nh_exception *fnhe)
rt = rcu_dereference(fnhe->fnhe_rth_input);
if (rt) {
RCU_INIT_POINTER(fnhe->fnhe_rth_input, NULL);
- dst_dev_put(&rt->dst);
- dst_release(&rt->dst);
+ fnhe_retire_route(rt);
}
rt = rcu_dereference(fnhe->fnhe_rth_output);
if (rt) {
RCU_INIT_POINTER(fnhe->fnhe_rth_output, NULL);
- dst_dev_put(&rt->dst);
- dst_release(&rt->dst);
+ fnhe_retire_route(rt);
}
}
@@ -1505,10 +1514,8 @@ static bool rt_bind_exception(struct rtable *rt, struct fib_nh_exception *fnhe,
if (do_cache) {
dst_hold(&rt->dst);
rcu_assign_pointer(*porig, rt);
- if (orig) {
- dst_dev_put(&orig->dst);
- dst_release(&orig->dst);
- }
+ if (orig)
+ fnhe_retire_route(orig);
ret = true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0495/1005] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (493 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0494/1005] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0496/1005] net: skbuff: uncharge trimmed zerocopy frags on error Greg Kroah-Hartman
` (503 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yuho Choi, Jakub Kicinski,
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 6a01fb125ba6474cb97f14b68fe5435d3cdd08e5 ]
In a confidential guest, kvm_arch_ptp_init() shares the clock_pair page
with the host using set_memory_decrypted(), and kvm_arch_ptp_exit()
makes it private again with set_memory_encrypted() before freeing it.
The untrusted host can make either call fail and leave the page shared.
Both paths still free the page: the init error path with __free_page(),
and kvm_arch_ptp_exit() after only a WARN_ON(). The page allocator can
then hand a page the host can still access to an unrelated user.
Leak the page in both cases instead, as was done for the same situation
in commit b9fa16949d18 ("dma-direct: Leak pages on dma_set_decrypted()
failure") and commit 03f5a999adba ("Drivers: hv: vmbus: Leak pages if
set_memory_encrypted() fails").
Fixes: 6365ba64b4dbe ("ptp: kvm: Use decrypted memory in confidential guest on x86")
Signed-off-by: Yuho Choi <oss.patchbox@gmail.com>
Link: https://patch.msgid.link/20261105164324.23501-2-oss.patchbox@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ptp/ptp_kvm_x86.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/ptp/ptp_kvm_x86.c b/drivers/ptp/ptp_kvm_x86.c
index 6cea4fe39bcfe..811758bd8b0de 100644
--- a/drivers/ptp/ptp_kvm_x86.c
+++ b/drivers/ptp/ptp_kvm_x86.c
@@ -36,7 +36,7 @@ int kvm_arch_ptp_init(void)
clock_pair = page_address(p);
ret = set_memory_decrypted((unsigned long)clock_pair, 1);
if (ret) {
- __free_page(p);
+ /* The page may be left shared, so leak it. */
clock_pair = NULL;
goto nofree;
}
@@ -68,8 +68,9 @@ int kvm_arch_ptp_init(void)
void kvm_arch_ptp_exit(void)
{
if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
- WARN_ON(set_memory_encrypted((unsigned long)clock_pair, 1));
- free_page((unsigned long)clock_pair);
+ /* Leak the page if it cannot be made private again. */
+ if (!WARN_ON(set_memory_encrypted((unsigned long)clock_pair, 1)))
+ free_page((unsigned long)clock_pair);
clock_pair = NULL;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0496/1005] net: skbuff: uncharge trimmed zerocopy frags on error
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (494 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0495/1005] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0497/1005] net/mlx5e: Release IPsec root table reference on RX setup failure Greg Kroah-Hartman
` (502 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Chris Mason,
Willem de Bruijn, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 8b67debdfbf6b370312ebec5c9e0a1c39b5c7733 ]
__zerocopy_sg_from_iter() accounts for the frags that it adds even when
it returns an error: it adds the growth of skb->truesize to
sk_wmem_queued and, unless the skb is pure zerocopy, charges it to the
socket.
On error, skb_zerocopy_iter_stream() cannot free the skb, as it may hold
data from an earlier send. It trims the new frags, but leaves
skb->truesize and their accounting in place.
Repeated failed sends to the same skb accumulate this stale accounting.
This can inflate TCP memory accounting past tcp_mem, and can wrap
skb->truesize, leading to a use-after-free of the socket.
Undo the accounting after the trim. If the trim fails, the frags and
their accounting remain. The trim only fails if the skb is cloned,
which is not expected for the unsent skb at the TCP write queue tail.
The issue was found by an LLM.
Fixes: 52267790ef52 ("sock: add MSG_ZEROCOPY")
Reported-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Chris Mason <mason@kernel.org>
[willemb: revised commit message]
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261105223512.3647504-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/skbuff.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b24a949bd546e..892ab589ad396 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1922,6 +1922,7 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,
struct ubuf_info *uarg,
struct net_devmem_dmabuf_binding *binding)
{
+ unsigned int orig_truesize = skb->truesize;
int err, orig_len = skb->len;
if (uarg->ops->link_skb) {
@@ -1942,12 +1943,18 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,
err = __zerocopy_sg_from_iter(msg, sk, skb, &msg->msg_iter, len,
binding);
if (err == -EFAULT || (err == -EMSGSIZE && skb->len == orig_len)) {
+ u32 delta_truesize = skb->truesize - orig_truesize;
struct sock *save_sk = skb->sk;
/* Streams do not free skb on error. Reset to prev state. */
iov_iter_revert(&msg->msg_iter, skb->len - orig_len);
skb->sk = sk;
- ___pskb_trim(skb, orig_len);
+ if (!___pskb_trim(skb, orig_len)) {
+ skb->truesize -= delta_truesize;
+ sk_wmem_queued_add(sk, -delta_truesize);
+ if (!skb_zcopy_pure(skb))
+ sk_mem_uncharge(sk, delta_truesize);
+ }
skb->sk = save_sk;
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0497/1005] net/mlx5e: Release IPsec root table reference on RX setup failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (495 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0496/1005] net: skbuff: uncharge trimmed zerocopy frags on error Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0498/1005] net/mlx5e: Serialize ipsec encap reservations with eswitch operations Greg Kroah-Hartman
` (501 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit e8303b58108519ff103241442c0a7602fa106af5 ]
Switchdev RX setup takes a root-chain table reference before creating
its flow tables. If creation fails, rx_get() returns without
incrementing the RX reference count, so rx_destroy() never releases the
chain reference.
Extract the cleanup logic in a counter-partner to the function acquiring
the root table ref, and call it on error to properly release everything.
Also call it from the normal destroy path to reduce code duplication.
mlx5_esw_ipsec_rx_status_pass_dest_get() ignored chain table acquisition
errors, returning success with an error pointer as the destination. The
new unwind could then release a reference that was never taken.
Propagate the error so cleanup only runs after a successful get.
Discovered by Sashiko. Not triggered as it's an unlikely error path.
Fixes: 1762f132d542 ("net/mlx5e: Support IPsec packet offload for RX in switchdev mode")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-2-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 20 +++++++++++--------
.../mellanox/mlx5/core/esw/ipsec_fs.c | 15 ++++++++++++--
.../mellanox/mlx5/core/esw/ipsec_fs.h | 6 ++++++
3 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index 8ffa8068e90ac..fd9fbf3593330 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -720,6 +720,16 @@ static void ipsec_rx_sa_selector_destroy(struct mlx5_core_dev *mdev,
mlx5_destroy_flow_table(rx->ft.sa_sel);
}
+static void
+ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec,
+ struct mlx5e_ipsec_rx *rx,
+ u32 family)
+{
+ mlx5_ipsec_fs_roce_rx_destroy(ipsec->roce, family, ipsec->mdev);
+ if (rx == ipsec->rx_esw)
+ mlx5_esw_ipsec_rx_status_pass_dest_put(ipsec);
+}
+
static void rx_destroy(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
struct mlx5e_ipsec_rx *rx, u32 family)
{
@@ -739,13 +749,7 @@ static void rx_destroy(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
ipsec_rx_policy_destroy(rx);
- mlx5_ipsec_fs_roce_rx_destroy(ipsec->roce, family, mdev);
-
-#ifdef CONFIG_MLX5_ESWITCH
- if (rx == ipsec->rx_esw)
- mlx5_chains_put_table(esw_chains(ipsec->mdev->priv.eswitch),
- 0, 1, 0);
-#endif
+ ipsec_rx_status_pass_dest_put(ipsec, rx, family);
}
static void ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
@@ -1115,7 +1119,7 @@ static int rx_create(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
err_fs_ft_sa_sel:
mlx5_destroy_flow_table(rx->ft.status);
err_fs_ft_status:
- mlx5_ipsec_fs_roce_rx_destroy(ipsec->roce, family, mdev);
+ ipsec_rx_status_pass_dest_put(ipsec, rx, family);
return err;
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c
index ab50d2c734ede..f8c97954b6eaf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.c
@@ -34,12 +34,23 @@ void mlx5_esw_ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ipsec,
struct mlx5_flow_destination *dest)
{
- dest->type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
- dest->ft = mlx5_chains_get_table(esw_chains(ipsec->mdev->priv.eswitch), 0, 1, 0);
+ struct mlx5_flow_table *ft;
+
+ ft = mlx5_chains_get_table(esw_chains(ipsec->mdev->priv.eswitch),
+ 0, 1, 0);
+ if (IS_ERR(ft))
+ return PTR_ERR(ft);
+ dest->type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
+ dest->ft = ft;
return 0;
}
+void mlx5_esw_ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec)
+{
+ mlx5_chains_put_table(esw_chains(ipsec->mdev->priv.eswitch), 0, 1, 0);
+}
+
int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
struct mlx5_flow_act *flow_act)
{
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h
index 514c15258b1d1..bb6f2423078bd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h
@@ -12,6 +12,7 @@ void mlx5_esw_ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
struct mlx5e_ipsec_rx_create_attr *attr);
int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ipsec,
struct mlx5_flow_destination *dest);
+void mlx5_esw_ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec);
int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
struct mlx5_flow_act *flow_act);
void mlx5_esw_ipsec_rx_id_mapping_remove(struct mlx5e_ipsec_sa_entry *sa_entry);
@@ -32,6 +33,11 @@ static inline int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ips
return -EINVAL;
}
+static inline
+void mlx5_esw_ipsec_rx_status_pass_dest_put(struct mlx5e_ipsec *ipsec)
+{
+}
+
static inline int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
struct mlx5_flow_act *flow_act)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0498/1005] net/mlx5e: Serialize ipsec encap reservations with eswitch operations
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (496 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0497/1005] net/mlx5e: Release IPsec root table reference on RX setup failure Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0499/1005] net/mlx5e: Take HCA devcom lock before esw->mode_lock Greg Kroah-Hartman
` (500 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit b102f927c69e2d7cf849bcfb7f7b0cd6e52fc1b0 ]
mlx5_eswitch_block_encap() takes mode_lock but ignores
eswitch_operation_in_progress. mlx5_devlink_eswitch_encap_mode_set()
claims the operation and drops mode_lock while rebuilding the FDB and
updating offloads.encap, so a reservation can read a stale or
rolled-back encap value. In diagram form:
T1: first IPsec SA (NIC table) T2: encap none -> basic
mlx5_devlink_eswitch_encap_mode_set()
down_write(&esw->mode_lock)
sees num_block_encap == 0
eswitch_operation_in_progress = true
up_write(&esw->mode_lock)
esw_destroy_offloads_fdb_tables()
mlx5e_xfrm_add_state()
mlx5e_ipsec_fs_tunnel_allowed()
mlx5_eswitch_block_encap()
down_write(&esw->mode_lock)
reads encap == NONE
num_block_encap++
up_write(&esw->mode_lock)
esw->offloads.encap = BASIC
esw_create_offloads_fdb_tables()
The race happens therefore because offloads.encap is not consistently
accessed under mode_lock. There are other variations of the above race
(e.g. in rollback, or in tx_create()).
Use mlx5_esw_lock() to reject a reservation while an operation is in
progress. This implies changing mlx5e_ipsec_fs_tunnel_allowed() to
propagate the error. Note that these are not new failure modes as it
seems on first glance, because if the eswitch_operation_in_progress flag
is set, rx_get()/tx_get()->mlx5_eswitch_block_mode() already fails with
-EBUSY. The new code simply protects against an operation initiated in
the short window after mlx5_eswitch_block_mode().
This race was found by Sashiko during inspection of another patch of
this series. No attempt has been made to trigger it, as it requires very
precise timing.
Fixes: baac8351f74c ("net/mlx5e: Reduce eswitch mode_lock protection context")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/en_accel/ipsec.c | 5 ++++-
.../mellanox/mlx5/core/en_accel/ipsec.h | 2 +-
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 21 ++++++++++++-------
.../net/ethernet/mellanox/mlx5/core/eswitch.h | 6 +++---
.../mellanox/mlx5/core/eswitch_offloads.c | 20 +++++++++++-------
5 files changed, 35 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
index e6dd911475e31..a8c7f09f903fc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
@@ -812,7 +812,10 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
if (x->props.mode == XFRM_MODE_TUNNEL &&
x->xso.type == XFRM_DEV_OFFLOAD_PACKET) {
- allow_tunnel_mode = mlx5e_ipsec_fs_tunnel_allowed(sa_entry);
+ err = mlx5e_ipsec_fs_tunnel_allowed(sa_entry);
+ if (err < 0)
+ goto unblock_mode;
+ allow_tunnel_mode = err;
if (!allow_tunnel_mode) {
NL_SET_ERR_MSG_MOD(extack,
"Packet offload tunnel mode is disabled due to encap settings");
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h
index abcbd38db9dbb..f4b2d7b950c00 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h
@@ -320,7 +320,7 @@ void mlx5e_accel_ipsec_fs_del_rule(struct mlx5e_ipsec_sa_entry *sa_entry);
int mlx5e_accel_ipsec_fs_add_pol(struct mlx5e_ipsec_pol_entry *pol_entry);
void mlx5e_accel_ipsec_fs_del_pol(struct mlx5e_ipsec_pol_entry *pol_entry);
void mlx5e_accel_ipsec_fs_modify(struct mlx5e_ipsec_sa_entry *sa_entry);
-bool mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry);
+int mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry);
int mlx5_ipsec_create_sa_ctx(struct mlx5e_ipsec_sa_entry *sa_entry);
void mlx5_ipsec_free_sa_ctx(struct mlx5e_ipsec_sa_entry *sa_entry);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index fd9fbf3593330..1529d47303234 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -1072,9 +1072,12 @@ static int rx_create(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
goto err_fs_ft_sa_sel;
/* Create FT */
- if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL)
- rx->allow_tunnel_mode =
- mlx5_eswitch_block_encap(mdev, rx == ipsec->rx_esw);
+ if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL) {
+ err = mlx5_eswitch_block_encap(mdev, rx == ipsec->rx_esw);
+ if (err < 0)
+ goto err_fs_ft;
+ rx->allow_tunnel_mode = err;
+ }
if (rx->allow_tunnel_mode)
flags = MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
@@ -1315,9 +1318,12 @@ static int tx_create(struct mlx5e_ipsec *ipsec, struct mlx5e_ipsec_tx *tx,
if (err)
goto err_status_rule;
- if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL)
- tx->allow_tunnel_mode =
- mlx5_eswitch_block_encap(mdev, tx == ipsec->tx_esw);
+ if (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_TUNNEL) {
+ err = mlx5_eswitch_block_encap(mdev, tx == ipsec->tx_esw);
+ if (err < 0)
+ goto err_encap;
+ tx->allow_tunnel_mode = err;
+ }
if (tx->allow_tunnel_mode)
flags = MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
@@ -1387,6 +1393,7 @@ static int tx_create(struct mlx5e_ipsec *ipsec, struct mlx5e_ipsec_tx *tx,
err_sa_ft:
if (tx->allow_tunnel_mode)
mlx5_eswitch_unblock_encap(mdev);
+err_encap:
mlx5_del_flow_rules(tx->status.rule);
err_status_rule:
mlx5_destroy_flow_table(tx->ft.status);
@@ -2854,7 +2861,7 @@ void mlx5e_accel_ipsec_fs_modify(struct mlx5e_ipsec_sa_entry *sa_entry)
memcpy(sa_entry, &sa_entry_shadow, sizeof(*sa_entry));
}
-bool mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry)
+int mlx5e_ipsec_fs_tunnel_allowed(struct mlx5e_ipsec_sa_entry *sa_entry)
{
struct mlx5e_ipsec *ipsec = sa_entry->ipsec;
struct xfrm_state *x = sa_entry->x;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 8b1f93b13ea9c..c904860df7b3e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -967,7 +967,7 @@ void mlx5_eswitch_unload_reps(struct mlx5_eswitch *esw);
bool mlx5_eswitch_is_peer(struct mlx5_eswitch *esw,
struct mlx5_eswitch *peer_esw);
-bool mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb);
+int mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb);
void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev);
int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev);
@@ -1071,10 +1071,10 @@ mlx5_eswitch_reload_ib_reps(struct mlx5_eswitch *esw)
static inline void
mlx5_eswitch_unload_reps(struct mlx5_eswitch *esw) {}
-static inline bool
+static inline int
mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb)
{
- return true;
+ return 1;
}
static inline void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index eb74b62601682..f298e72eeec53 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -4689,25 +4689,31 @@ int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8 *mode)
return esw_inline_mode_to_devlink(esw->offloads.inline_mode, mode);
}
-bool mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb)
+/* Return 1 if allowed, 0 if disallowed by the configuration, or -EBUSY
+ * if an eswitch operation is in progress.
+ */
+int mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb)
{
struct mlx5_eswitch *esw = dev->priv.eswitch;
enum devlink_eswitch_encap_mode encap;
- bool allow_tunnel = false;
+ int ret;
if (!mlx5_esw_allowed(esw))
- return true;
+ return 1;
+
+ ret = mlx5_esw_lock(esw);
+ if (ret)
+ return ret;
- down_write(&esw->mode_lock);
encap = esw->offloads.encap;
if (esw->mode == MLX5_ESWITCH_LEGACY ||
(encap == DEVLINK_ESWITCH_ENCAP_MODE_NONE && !from_fdb)) {
- allow_tunnel = true;
+ ret = 1;
esw->offloads.num_block_encap++;
}
- up_write(&esw->mode_lock);
+ mlx5_esw_unlock(esw);
- return allow_tunnel;
+ return ret;
}
void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0499/1005] net/mlx5e: Take HCA devcom lock before esw->mode_lock
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (497 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0498/1005] net/mlx5e: Serialize ipsec encap reservations with eswitch operations Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0500/1005] net/mlx5e: Fix E-Switch races in uplink unbind Greg Kroah-Hartman
` (499 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit b7e98883eeb72b736dbdeb443e1f43e45f8e5dc1 ]
Uplink ETH driver removal waits for any eswitch operation in progress
before removing REPs. Removal through mlx5_unregister_device() or
mlx5_detach_device() does this while holding the HCA devcom lock, which
is used by peer devices in the same group.
An E-Switch mode change can therefore race with a Socket Direct
secondary device removal:
T1: primary mode set T2: SD secondary dev removal
mlx5_devlink_eswitch_mode_set()
sets operation in progress
mlx5_unregister_device()
mlx5_devcom_comp_lock(hca)
...
mlx5e_remove()
mlx5_sd_get_adev() -> T1 dev
mlx5_eswitch_safe_aux_devs_remove()
waits for T1's operation
esw_offloads_start()
esw_mode_change()
mlx5_devcom_comp_lock(hca)
waits for T2's lock
The timeout in mlx5_eswitch_safe_aux_devs_remove() makes this not a
deadlock, but representor removal is skipped in that case which is
incorrect.
This bug was found by Sashiko inspecting the next patch in the series,
which removes the timeout. It wasn't reproduced but the scenario seems
plausible, albeit unlikely. This was undetectable by lockdep because the
down_read_trylock() in mlx5_esw_hold() doesn't register as a lock edge,
and also because it can't see the wait on the flag as a lock edge.
Fix the lock order so the HCA devcom lock is taken in
mlx5_devlink_eswitch_mode_set() before esw->mode_lock and held for the
duration of the mode change.
Expanding the HCA devcom lock critical section implies new lock edges
being added, but this is safe:
- mlx5_devlink_netdev_netns_immutable_set() adds HCA devcom -> RTNL, but
there's already a HCA devcom -> RTNL dependency in
mlx5_register_device() -..-> register_netdev()
- esw_offloads_disable/enable() -> esw devcom cleanup/init: adds HCA
devcom -> esw devcom. Nothing takes the HCA devcom lock while holding
the esw devcom lock.
Fixes: 2ae8c7edea87 ("net/mlx5: Fix Unbinding uplink-netdev in switchdev mode")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-4-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index f298e72eeec53..8dd9d96d499c9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -2457,8 +2457,8 @@ void mlx5_esw_reps_unblock(struct mlx5_eswitch *esw)
static void esw_mode_change(struct mlx5_eswitch *esw, u16 mode)
{
+ mlx5_devcom_comp_assert_locked(esw->dev->priv.hca_devcom_comp);
mlx5_esw_reps_unblock(esw);
- mlx5_devcom_comp_lock(esw->dev->priv.hca_devcom_comp);
if (esw->dev->priv.flags & MLX5_PRIV_FLAGS_DISABLE_IB_ADEV ||
mlx5_core_mp_enabled(esw->dev)) {
esw->mode = mode;
@@ -2471,7 +2471,6 @@ static void esw_mode_change(struct mlx5_eswitch *esw, u16 mode)
esw->dev->priv.flags &= ~MLX5_PRIV_FLAGS_DISABLE_IB_ADEV;
out:
mlx5_rescan_drivers_locked(esw->dev);
- mlx5_devcom_comp_unlock(esw->dev->priv.hca_devcom_comp);
mlx5_esw_reps_block(esw);
}
@@ -4485,10 +4484,11 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
return 0;
mlx5_lag_disable_change(esw->dev);
+ mlx5_devcom_comp_lock(esw->dev->priv.hca_devcom_comp);
err = mlx5_esw_try_lock(esw);
if (err < 0) {
NL_SET_ERR_MSG_MOD(extack, "Can't change mode, E-Switch is busy");
- goto enable_lag;
+ goto unlock_hca;
}
cur_mlx5_mode = err;
err = 0;
@@ -4551,7 +4551,8 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
esw->eswitch_operation_in_progress = false;
unlock:
mlx5_esw_unlock(esw);
-enable_lag:
+unlock_hca:
+ mlx5_devcom_comp_unlock(esw->dev->priv.hca_devcom_comp);
mlx5_lag_enable_change(esw->dev);
/* Shared FDB activation is creating LAG which is changing reps. */
if (!err)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0500/1005] net/mlx5e: Fix E-Switch races in uplink unbind
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (498 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0499/1005] net/mlx5e: Take HCA devcom lock before esw->mode_lock Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0501/1005] net/mlx5e: Fix ipsec core device access during profile changes Greg Kroah-Hartman
` (498 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit 5eaf9931c8af41b1f0de6dc0589efa698784157c ]
Unbinding the uplink Ethernet auxiliary driver in switchdev mode with
offloaded IPsec policies deadlocks on the esw->mode_lock semaphore:
mlx5_eswitch_safe_aux_devs_remove()
mlx5_esw_hold()
down_read_trylock(&esw->mode_lock) (*)
mlx5_core_reps_aux_devs_remove()
...
mlx5e_vport_uplink_rep_unload()
unregister_netdev()
xfrm_dev_unregister()
xfrm_dev_policy_flush()
xfrm_policy_kill()
xfrm_dev_policy_delete()
mlx5e_xfrm_del_policy()
mlx5e_accel_ipsec_fs_del_pol()
rx_ft_put_policy()
rx_put()
mlx5_eswitch_unblock_mode()
down_write(&esw->mode_lock) (BOOM)
Another deadlock with IPsec states:
mlx5_eswitch_safe_aux_devs_remove()
mlx5_esw_hold()
down_read_trylock(&esw->mode_lock) (*)
mlx5_core_reps_aux_devs_remove()
...
mlx5e_vport_uplink_rep_unload()
unregister_netdev()
xfrm_dev_unregister()
xfrm_dev_state_flush()
xfrm_dev_state_free()
mlx5e_xfrm_free_state()
mlx5e_accel_ipsec_fs_del_rule()
rx_ft_put()
rx_put()
rx_destroy()
mlx5_eswitch_unblock_encap()
down_write(&esw->mode_lock) (BOOM)
To fix these, first refactor initiators of eswitch operations so they no
longer step on each other's toes.
The active/inactive toggle and setting the inline/encap mode now use the
new mlx5_esw_lock_wait(), which waits for an operation in progress to
finish. They all hold devl_lock, so the only operation they can find in
progress is an uplink unbind, which doesn't need devl_lock.
Setting the esw mode keeps using mlx5_esw_try_lock(), which also rejects
the change while eswitch users exist and bails out with -EBUSY.
mlx5_eswitch_safe_aux_devs_remove() now also waits for an operation in
progress with the same mlx5_esw_lock_wait() before initiating one,
dropping mode_lock and then removing representors.
The deadlocks are avoided.
Finishing an operation in progress now requires mlx5_esw_unlock() to
wake up any waiters instead of plain up_write(&mode_lock).
As a side effect, the timeout in mlx5_eswitch_safe_aux_devs_remove() is
gone, which fixes another scary corner case, of representor devs not
being removed on timeout but leaked instead. The timeout hid the SD
deadlock fixed in the previous patch. Now that that's gone, no reason
for the timeout to stay.
This was found by internal testing and reproduced on HW.
It was independently found by Sashiko during analysis of another patch
in this series.
Fixes: 2ae8c7edea87 ("net/mlx5: Fix Unbinding uplink-netdev in switchdev mode")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-5-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/mellanox/mlx5/core/eswitch.c | 24 +++++++++
.../net/ethernet/mellanox/mlx5/core/eswitch.h | 1 +
.../mellanox/mlx5/core/eswitch_offloads.c | 50 +++++++++----------
3 files changed, 48 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 603e8ae72734c..07bea6b0e3d68 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -3039,12 +3039,36 @@ int mlx5_esw_lock(struct mlx5_eswitch *esw)
return 0;
}
+static void esw_mode_lock(struct mlx5_eswitch *esw)
+{
+ down_write(&esw->mode_lock);
+}
+
+static void esw_mode_unlock(struct mlx5_eswitch *esw)
+{
+ up_write(&esw->mode_lock);
+}
+
+/* Lock the eswitch and wait for an operation in progress to finish. */
+void mlx5_esw_lock_wait(struct mlx5_eswitch *esw)
+{
+ down_write(&esw->mode_lock);
+ wait_var_event_any_lock(&esw->eswitch_operation_in_progress,
+ !esw->eswitch_operation_in_progress,
+ esw, esw_mode, TASK_UNINTERRUPTIBLE);
+}
+
/**
* mlx5_esw_unlock() - Release write lock on esw mode lock
* @esw: eswitch device.
+ *
+ * Also wakes up mlx5_esw_lock_wait() waiters, so it must be used to release
+ * mode_lock after clearing eswitch_operation_in_progress.
*/
void mlx5_esw_unlock(struct mlx5_eswitch *esw)
{
+ wake_up_var_locked(&esw->eswitch_operation_in_progress,
+ &esw->mode_lock);
up_write(&esw->mode_lock);
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index c904860df7b3e..c0f2af86a9342 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -948,6 +948,7 @@ void mlx5_esw_get(struct mlx5_core_dev *dev);
void mlx5_esw_put(struct mlx5_core_dev *dev);
int mlx5_esw_try_lock(struct mlx5_eswitch *esw);
int mlx5_esw_lock(struct mlx5_eswitch *esw);
+void mlx5_esw_lock_wait(struct mlx5_eswitch *esw);
void mlx5_esw_unlock(struct mlx5_eswitch *esw);
void esw_vport_change_handle_locked(struct mlx5_vport *vport);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 8dd9d96d499c9..0debb02fea268 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -4418,7 +4418,7 @@ static bool mlx5_devlink_switchdev_active_mode_change(struct mlx5_eswitch *esw,
!esw->offloads_inactive)
return false;
- down_write(&esw->mode_lock);
+ mlx5_esw_lock_wait(esw);
esw->offloads_inactive = !esw->offloads_inactive;
esw->eswitch_operation_in_progress = true;
up_write(&esw->mode_lock);
@@ -4430,34 +4430,30 @@ static bool mlx5_devlink_switchdev_active_mode_change(struct mlx5_eswitch *esw,
down_write(&esw->mode_lock);
esw->eswitch_operation_in_progress = false;
- up_write(&esw->mode_lock);
+ mlx5_esw_unlock(esw);
return true;
}
-#define MLX5_ESW_HOLD_TIMEOUT_MS 7000
-#define MLX5_ESW_HOLD_RETRY_DELAY_MS 500
-
void mlx5_eswitch_safe_aux_devs_remove(struct mlx5_core_dev *dev)
{
- unsigned long timeout;
- bool hold_esw = true;
+ struct mlx5_eswitch *esw = dev->priv.eswitch;
- /* Wait for any concurrent eswitch mode transition to complete. */
- if (!mlx5_esw_hold(dev)) {
- timeout = jiffies + msecs_to_jiffies(MLX5_ESW_HOLD_TIMEOUT_MS);
- while (!mlx5_esw_hold(dev)) {
- if (!time_before(jiffies, timeout)) {
- hold_esw = false;
- break;
- }
- msleep(MLX5_ESW_HOLD_RETRY_DELAY_MS);
- }
- }
- if (hold_esw) {
- if (mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS)
- mlx5_core_reps_aux_devs_remove(dev);
- mlx5_esw_release(dev);
- }
+ if (!mlx5_esw_allowed(esw))
+ return;
+
+ /* Wait for any concurrent eswitch mode transition to complete.
+ * Deadlock risk if ever called from within an operation in progress.
+ */
+ mlx5_esw_lock_wait(esw);
+ esw->eswitch_operation_in_progress = true;
+ up_write(&esw->mode_lock);
+
+ if (mlx5_eswitch_mode(dev) == MLX5_ESWITCH_OFFLOADS)
+ mlx5_core_reps_aux_devs_remove(dev);
+
+ down_write(&esw->mode_lock);
+ esw->eswitch_operation_in_progress = false;
+ mlx5_esw_unlock(esw);
}
int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
@@ -4633,7 +4629,7 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode,
if (IS_ERR(esw))
return PTR_ERR(esw);
- down_write(&esw->mode_lock);
+ mlx5_esw_lock_wait(esw);
switch (MLX5_CAP_ETH(dev, wqe_inline_mode)) {
case MLX5_CAP_INLINE_MODE_NOT_REQUIRED:
@@ -4671,7 +4667,7 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode,
down_write(&esw->mode_lock);
esw->eswitch_operation_in_progress = false;
- up_write(&esw->mode_lock);
+ mlx5_esw_unlock(esw);
return 0;
out:
@@ -4741,7 +4737,7 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
if (IS_ERR(esw))
return PTR_ERR(esw);
- down_write(&esw->mode_lock);
+ mlx5_esw_lock_wait(esw);
if (encap != DEVLINK_ESWITCH_ENCAP_MODE_NONE &&
(!MLX5_CAP_ESW_FLOWTABLE_FDB(dev, reformat) ||
@@ -4797,7 +4793,7 @@ int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink,
esw->eswitch_operation_in_progress = false;
unlock:
- up_write(&esw->mode_lock);
+ mlx5_esw_unlock(esw);
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0501/1005] net/mlx5e: Fix ipsec core device access during profile changes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (499 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0500/1005] net/mlx5e: Fix E-Switch races in uplink unbind Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0502/1005] net/mlx5e: Block E-Switch mode changes during IPsec policy creation Greg Kroah-Hartman
` (497 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit 5b310ae1eff7531030b123bfcb192b0176d73075 ]
Devlink E-Switch mode changes replace the netdev profile without
unregistering the netdev. XFRM state and policy creation can therefore
run while mlx5e_priv_cleanup() clears priv with memset() or
mlx5e_priv_init() initializes it again. Accesses to priv->mdev can
observe NULL or a torn pointer, and repeated loads may return different
values.
Read priv->mdev once in each add callback and use the saved pointer
throughout the callback, including error unwinding. The core device
survives the in-place profile change, so a saved non-NULL pointer
remains valid even if priv is cleared in the meantime.
A NULL priv->mdev means a profile change is in progress, which only
happens during an eswitch mode change. Return -EBUSY in that case, as
mlx5_eswitch_block_mode() does for the same mode change. -EOPNOTSUPP
would make xfrm_dev_state_add() silently fall back to software for a
crypto offload SA for its whole lifetime.
Use WRITE_ONCE() when initializing priv->mdev and when clearing it
before memset(). This makes the transition to NULL atomic; the
subsequent bulk clear only writes zero bytes over an already NULL
pointer. Annotate the READ_ONCE() snapshots with data_race() to allow
that harmless overlap with the unmarked memset() without suppressing
checks for the rest of priv.
This fixes the core-device pointer accesses. Protecting the IPsec
context itself during state and policy creation is handled separately.
This was found by Sashiko, during review of the next patches in the
series. No attempt was made at reproducing this race, the chances seem
vanishingly small.
Fixes: 7a9fb35e8c3a ("net/mlx5e: Do not reload ethernet ports when changing eswitch mode")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-6-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/en_accel/ipsec.c | 38 +++++++++++++------
.../net/ethernet/mellanox/mlx5/core/en_main.c | 4 +-
2 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
index a8c7f09f903fc..c8c103b0a879a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
@@ -773,12 +773,20 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
{
struct mlx5e_ipsec_sa_entry *sa_entry = NULL;
bool allow_tunnel_mode = false;
+ struct mlx5_core_dev *mdev;
struct mlx5e_ipsec *ipsec;
struct mlx5e_priv *priv;
gfp_t gfp;
int err;
priv = netdev_priv(dev);
+ /* Profile cleanup can memset an already NULL mdev. */
+ mdev = data_race(READ_ONCE(priv->mdev));
+ /* NULL only during a profile change, which is an eswitch operation. */
+ if (!mdev) {
+ NL_SET_ERR_MSG_MOD(extack, "Eswitch busy, can't add state");
+ return -EBUSY;
+ }
if (!priv->ipsec)
return -EOPNOTSUPP;
@@ -797,16 +805,16 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
return 0;
}
- err = mlx5e_xfrm_validate_state(priv->mdev, x, extack);
+ err = mlx5e_xfrm_validate_state(mdev, x, extack);
if (err)
goto err_xfrm;
- if (!mlx5_eswitch_block_ipsec(priv->mdev)) {
+ if (!mlx5_eswitch_block_ipsec(mdev)) {
err = -EBUSY;
goto err_xfrm;
}
- err = mlx5_eswitch_block_mode(priv->mdev);
+ err = mlx5_eswitch_block_mode(mdev);
if (err)
goto unblock_ipsec;
@@ -877,9 +885,9 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
x->xso.offload_handle = (unsigned long)sa_entry;
if (allow_tunnel_mode)
- mlx5_eswitch_unblock_encap(priv->mdev);
+ mlx5_eswitch_unblock_encap(mdev);
- mlx5_eswitch_unblock_mode(priv->mdev);
+ mlx5_eswitch_unblock_mode(mdev);
return 0;
@@ -895,11 +903,11 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
kfree(sa_entry->work);
unblock_encap:
if (allow_tunnel_mode)
- mlx5_eswitch_unblock_encap(priv->mdev);
+ mlx5_eswitch_unblock_encap(mdev);
unblock_mode:
- mlx5_eswitch_unblock_mode(priv->mdev);
+ mlx5_eswitch_unblock_mode(mdev);
unblock_ipsec:
- mlx5_eswitch_unblock_ipsec(priv->mdev);
+ mlx5_eswitch_unblock_ipsec(mdev);
err_xfrm:
kfree(sa_entry);
NL_SET_ERR_MSG_WEAK_MOD(extack, "Device failed to offload this state");
@@ -1268,16 +1276,24 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
{
struct net_device *netdev = x->xdo.dev;
struct mlx5e_ipsec_pol_entry *pol_entry;
+ struct mlx5_core_dev *mdev;
struct mlx5e_priv *priv;
int err;
priv = netdev_priv(netdev);
+ /* Profile cleanup can memset an already NULL mdev. */
+ mdev = data_race(READ_ONCE(priv->mdev));
+ if (!mdev) {
+ NL_SET_ERR_MSG_MOD(extack, "Eswitch busy, can't add policy");
+ return -EBUSY;
+ }
+
if (!priv->ipsec) {
NL_SET_ERR_MSG_MOD(extack, "Device doesn't support IPsec packet offload");
return -EOPNOTSUPP;
}
- err = mlx5e_xfrm_validate_policy(priv->mdev, x, extack);
+ err = mlx5e_xfrm_validate_policy(mdev, x, extack);
if (err)
return err;
@@ -1288,7 +1304,7 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
pol_entry->x = x;
pol_entry->ipsec = priv->ipsec;
- if (!mlx5_eswitch_block_ipsec(priv->mdev)) {
+ if (!mlx5_eswitch_block_ipsec(mdev)) {
err = -EBUSY;
goto ipsec_busy;
}
@@ -1302,7 +1318,7 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
return 0;
err_fs:
- mlx5_eswitch_unblock_ipsec(priv->mdev);
+ mlx5_eswitch_unblock_ipsec(mdev);
ipsec_busy:
kfree(pol_entry);
NL_SET_ERR_MSG_MOD(extack, "Device failed to offload this policy");
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 38ce7d0a9001e..77c54b1702a90 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -6383,7 +6383,7 @@ int mlx5e_priv_init(struct mlx5e_priv *priv,
node = dev_to_node(mlx5_core_dma_dev(mdev));
/* priv init */
- priv->mdev = mdev;
+ WRITE_ONCE(priv->mdev, mdev);
priv->netdev = netdev;
priv->max_nch = nch;
priv->max_opened_tc = 1;
@@ -6468,6 +6468,8 @@ void mlx5e_priv_cleanup(struct mlx5e_priv *priv)
mlx5e_mqprio_rl_free(priv->mqprio_rl);
}
+ /* Clear atomically before memset() for lockless XFRM readers. */
+ WRITE_ONCE(priv->mdev, NULL);
memset(priv, 0, sizeof(*priv));
if (destroying) /* restore destroying bit, to allow unload */
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0502/1005] net/mlx5e: Block E-Switch mode changes during IPsec policy creation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (500 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0501/1005] net/mlx5e: Fix ipsec core device access during profile changes Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0503/1005] net/mlx5e: Block E-Switch mode changes during IPsec state creation Greg Kroah-Hartman
` (496 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Dragos Tatulea, Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit d9e4ac08ea892da54c5aa7ae4a368f2d09db589c ]
Eswitch mode changes can tear down the IPsec context while policy
creation is accessing it. The mode-blocking reference acquired when
creating a flow table comes too late: the table lookup already accesses
the IPsec context before taking that reference.
Take a temporary mode-blocking reference before checking the IPsec
context and validating the policy. This gets dropped after successful
setup, when the flow table holds its own reference.
The temporary reservation must allow reuse of existing IPsec tables.
For example:
1. An offloaded inbound IPsec policy is added on the uplink.
2. A TC flower rule is added on a VF representor.
3. Another uplink policy is added using the same RX tables.
The third policy reuses the first policy's tables, so it must not be
rejected merely because esw->user_count is nonzero. Add a check_users
argument to mlx5_eswitch_block_mode(). Pass false for temporary policy
reservations and true when creating the first table (rx_get()/tx_get()).
Temporary reservations take mode_lock and check operation ownership
without requiring eswitch user_count to be zero.
mlx5e_xfrm_add_state() needs the same early mode reservation and is
handled in the next patch.
This was found by Sashiko, during review of the last patch in the
series. No reproduction attempted, as it seems quite a tricky race to
successfully trigger.
Fixes: a5b8ca9471d3 ("net/mlx5e: Add XFRM policy offload logic")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-7-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/en_accel/ipsec.c | 23 +++++++++++++++----
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 4 ++--
.../net/ethernet/mellanox/mlx5/core/eswitch.h | 8 +++++--
.../mellanox/mlx5/core/eswitch_offloads.c | 9 +++++---
4 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
index c8c103b0a879a..09f51f6fa8675 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
@@ -814,7 +814,7 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
goto err_xfrm;
}
- err = mlx5_eswitch_block_mode(mdev);
+ err = mlx5_eswitch_block_mode(mdev, true);
if (err)
goto unblock_ipsec;
@@ -1288,18 +1288,28 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
return -EBUSY;
}
+ /* Block esw mode changes until the policy holds its own block. */
+ err = mlx5_eswitch_block_mode(mdev, false);
+ if (err) {
+ NL_SET_ERR_MSG_MOD(extack, "Eswitch busy, can't add policy");
+ return err;
+ }
+
if (!priv->ipsec) {
NL_SET_ERR_MSG_MOD(extack, "Device doesn't support IPsec packet offload");
- return -EOPNOTSUPP;
+ err = -EOPNOTSUPP;
+ goto unblock_mode;
}
err = mlx5e_xfrm_validate_policy(mdev, x, extack);
if (err)
- return err;
+ goto unblock_mode;
pol_entry = kzalloc_obj(*pol_entry);
- if (!pol_entry)
- return -ENOMEM;
+ if (!pol_entry) {
+ err = -ENOMEM;
+ goto unblock_mode;
+ }
pol_entry->x = x;
pol_entry->ipsec = priv->ipsec;
@@ -1315,6 +1325,7 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
goto err_fs;
x->xdo.offload_handle = (unsigned long)pol_entry;
+ mlx5_eswitch_unblock_mode(mdev);
return 0;
err_fs:
@@ -1322,6 +1333,8 @@ static int mlx5e_xfrm_add_policy(struct xfrm_policy *x,
ipsec_busy:
kfree(pol_entry);
NL_SET_ERR_MSG_MOD(extack, "Device failed to offload this policy");
+unblock_mode:
+ mlx5_eswitch_unblock_mode(mdev);
return err;
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index 1529d47303234..dbe5547d7a498 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -1134,7 +1134,7 @@ static int rx_get(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
if (rx->ft.refcnt)
goto skip;
- err = mlx5_eswitch_block_mode(mdev);
+ err = mlx5_eswitch_block_mode(mdev, true);
if (err)
return err;
@@ -1427,7 +1427,7 @@ static int tx_get(struct mlx5_core_dev *mdev, struct mlx5e_ipsec *ipsec,
if (tx->ft.refcnt)
goto skip;
- err = mlx5_eswitch_block_mode(mdev);
+ err = mlx5_eswitch_block_mode(mdev, true);
if (err)
return err;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index c0f2af86a9342..176940a20b756 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -971,7 +971,7 @@ bool mlx5_eswitch_is_peer(struct mlx5_eswitch *esw,
int mlx5_eswitch_block_encap(struct mlx5_core_dev *dev, bool from_fdb);
void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev);
-int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev);
+int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev, bool check_users);
void mlx5_eswitch_unblock_mode(struct mlx5_core_dev *dev);
static inline int mlx5_eswitch_num_vfs(struct mlx5_eswitch *esw)
@@ -1082,7 +1082,11 @@ static inline void mlx5_eswitch_unblock_encap(struct mlx5_core_dev *dev)
{
}
-static inline int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev) { return 0; }
+static inline int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev,
+ bool check_users)
+{
+ return 0;
+}
static inline void mlx5_eswitch_unblock_mode(struct mlx5_core_dev *dev) {}
static inline bool mlx5_eswitch_block_ipsec(struct mlx5_core_dev *dev)
{
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 0debb02fea268..023d87f17e90b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -4342,7 +4342,7 @@ static int esw_inline_mode_to_devlink(u8 mlx5_mode, u8 *mode)
return 0;
}
-int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev)
+int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev, bool check_users)
{
struct mlx5_eswitch *esw = dev->priv.eswitch;
int err;
@@ -4350,8 +4350,11 @@ int mlx5_eswitch_block_mode(struct mlx5_core_dev *dev)
if (!mlx5_esw_allowed(esw))
return 0;
- /* Take TC into account */
- err = mlx5_esw_try_lock(esw);
+ /* Temporary reservations may reuse tables while TC users exist. */
+ if (check_users)
+ err = mlx5_esw_try_lock(esw);
+ else
+ err = mlx5_esw_lock(esw);
if (err < 0)
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0503/1005] net/mlx5e: Block E-Switch mode changes during IPsec state creation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (501 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0502/1005] net/mlx5e: Block E-Switch mode changes during IPsec policy creation Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0504/1005] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
` (495 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Dragos Tatulea,
Jianbo Liu, Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit 0d09de8e4f11391e8468219dbbc7af027e39e9b8 ]
mlx5e_xfrm_add_state() reads priv->ipsec before blocking eswitch mode
changes. A concurrent profile change can free the saved IPsec context
and cause use-after-free.
The temporary mode reservation was added in commit 22239eb258bc
("net/mlx5e: Prevent tunnel reformat when tunnel mode not allowed")
after saving priv->ipsec but the race was actually enabled by the
"Fixes" commit.
Extend the reservation to cover obtaining the context as well.
Use mlx5_eswitch_block_mode(mdev, false) for the temporary reservation,
as policy creation does, to check operation ownership under mode_lock
without rejecting existing eswitch users. This allows reusing existing
IPsec tables while TC rules exist on VF representors.
Check the context only after taking the mode reservation, so a
concurrent mode change consistently returns -EBUSY and a missing context
returns -EOPNOTSUPP, preserving software fallback for crypto offload.
Keep the atomic acquire-placeholder path exempt, since it creates no
hardware state and cannot take sleeping locks.
This was found by Sashiko, during review of the last patch in the
series. No reproduction attempted, as it seems quite a tricky race to
successfully trigger.
Fixes: 7a9fb35e8c3a ("net/mlx5e: Do not reload ethernet ports when changing eswitch mode")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-8-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/en_accel/ipsec.c | 37 ++++++++++++-------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
index 09f51f6fa8675..c1ff8f7a056e0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
@@ -771,6 +771,7 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
struct xfrm_state *x,
struct netlink_ext_ack *extack)
{
+ bool is_acq = x->xso.flags & XFRM_DEV_OFFLOAD_FLAG_ACQ;
struct mlx5e_ipsec_sa_entry *sa_entry = NULL;
bool allow_tunnel_mode = false;
struct mlx5_core_dev *mdev;
@@ -787,20 +788,31 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
NL_SET_ERR_MSG_MOD(extack, "Eswitch busy, can't add state");
return -EBUSY;
}
- if (!priv->ipsec)
- return -EOPNOTSUPP;
+
+ if (!is_acq) {
+ err = mlx5_eswitch_block_mode(mdev, false);
+ if (err)
+ return err;
+ }
ipsec = priv->ipsec;
- gfp = (x->xso.flags & XFRM_DEV_OFFLOAD_FLAG_ACQ) ? GFP_ATOMIC : GFP_KERNEL;
+ if (!ipsec) {
+ err = -EOPNOTSUPP;
+ goto unblock_mode;
+ }
+
+ gfp = is_acq ? GFP_ATOMIC : GFP_KERNEL;
sa_entry = kzalloc_obj(*sa_entry, gfp);
- if (!sa_entry)
- return -ENOMEM;
+ if (!sa_entry) {
+ err = -ENOMEM;
+ goto unblock_mode;
+ }
sa_entry->x = x;
sa_entry->dev = dev;
sa_entry->ipsec = ipsec;
/* Check if this SA is originated from acquire flow temporary SA */
- if (x->xso.flags & XFRM_DEV_OFFLOAD_FLAG_ACQ) {
+ if (is_acq) {
x->xso.offload_handle = (unsigned long)sa_entry;
return 0;
}
@@ -814,21 +826,17 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
goto err_xfrm;
}
- err = mlx5_eswitch_block_mode(mdev, true);
- if (err)
- goto unblock_ipsec;
-
if (x->props.mode == XFRM_MODE_TUNNEL &&
x->xso.type == XFRM_DEV_OFFLOAD_PACKET) {
err = mlx5e_ipsec_fs_tunnel_allowed(sa_entry);
if (err < 0)
- goto unblock_mode;
+ goto unblock_ipsec;
allow_tunnel_mode = err;
if (!allow_tunnel_mode) {
NL_SET_ERR_MSG_MOD(extack,
"Packet offload tunnel mode is disabled due to encap settings");
err = -EINVAL;
- goto unblock_mode;
+ goto unblock_ipsec;
}
}
@@ -904,13 +912,14 @@ static int mlx5e_xfrm_add_state(struct net_device *dev,
unblock_encap:
if (allow_tunnel_mode)
mlx5_eswitch_unblock_encap(mdev);
-unblock_mode:
- mlx5_eswitch_unblock_mode(mdev);
unblock_ipsec:
mlx5_eswitch_unblock_ipsec(mdev);
err_xfrm:
kfree(sa_entry);
NL_SET_ERR_MSG_WEAK_MOD(extack, "Device failed to offload this state");
+unblock_mode:
+ if (!is_acq)
+ mlx5_eswitch_unblock_mode(mdev);
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0504/1005] net/mlx5e: Serialize TC and IPsec offload exclusion counters
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (502 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0503/1005] net/mlx5e: Block E-Switch mode changes during IPsec state creation Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0505/1005] net: Fix memory_allocated leak in __sk_mem_raise_allocated() Greg Kroah-Hartman
` (494 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Dragos Tatulea, Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit 717dec565a5e7feab544da5aa77db9da71bc93fe ]
The counters enforcing TC and IPsec packet offload mutual exclusion are
not consistently serialized. IPsec admission conditionally takes
mode_lock for writing, while TC admission holds it only for read.
Neither release path takes the lock, and devices without an eswitch
cannot rely on it at all.
These are per-core-device counters, separate from the eswitch mode and
encapsulation reservations protected by mode_lock. Move them into
mdev->offload_block and protect their checks, increments and decrements
with a dedicated spinlock that is available even without an eswitch.
A spinlock is used because some of these functions are called from
atomic context and is a good fit because the critical sections are and
will stay really short.
IPsec admission then no longer needs mode_lock to update these counters.
Add warnings for unbalanced releases. Keep mlx5_esw_lock() for eswitch
operation admission and temporary mode/encapsulation reservations.
This was found by upstream Sashiko during review of [1], and spun-off
into a fix from the larger patch.
[1]
https://lore.kernel.org/netdev/178907726586.219967.4695695146458742597@kernel.org/
Fixes: c8e350e62fc5 ("net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdev")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261105211637.1083978-9-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 43 ++++++-------------
.../net/ethernet/mellanox/mlx5/core/en_tc.c | 18 +++++---
.../net/ethernet/mellanox/mlx5/core/main.c | 1 +
include/linux/mlx5/driver.h | 8 +++-
4 files changed, 31 insertions(+), 39 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index dbe5547d7a498..55de9abbd72be 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -2585,45 +2585,26 @@ void mlx5e_accel_ipsec_fs_read_stats(struct mlx5e_priv *priv, void *ipsec_stats)
}
}
-#ifdef CONFIG_MLX5_ESWITCH
static int mlx5e_ipsec_block_tc_offload(struct mlx5_core_dev *mdev)
{
- struct mlx5_eswitch *esw = mdev->priv.eswitch;
- int err = 0;
-
- if (esw) {
- err = mlx5_esw_lock(esw);
- if (err)
- return err;
- }
-
- if (mdev->num_block_ipsec) {
- err = -EBUSY;
- goto unlock;
- }
+ int ret = 0;
- mdev->num_block_tc++;
-
-unlock:
- if (esw)
- mlx5_esw_unlock(esw);
-
- return err;
-}
-#else
-static int mlx5e_ipsec_block_tc_offload(struct mlx5_core_dev *mdev)
-{
- if (mdev->num_block_ipsec)
- return -EBUSY;
+ spin_lock_bh(&mdev->offload_block.lock);
+ if (mdev->offload_block.num_block_ipsec)
+ ret = -EBUSY;
+ else
+ mdev->offload_block.num_block_tc++;
+ spin_unlock_bh(&mdev->offload_block.lock);
- mdev->num_block_tc++;
- return 0;
+ return ret;
}
-#endif
static void mlx5e_ipsec_unblock_tc_offload(struct mlx5_core_dev *mdev)
{
- mdev->num_block_tc--;
+ spin_lock_bh(&mdev->offload_block.lock);
+ if (!WARN_ON_ONCE(!mdev->offload_block.num_block_tc))
+ mdev->offload_block.num_block_tc--;
+ spin_unlock_bh(&mdev->offload_block.lock);
}
int mlx5e_accel_ipsec_fs_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index c40c7b55a54d8..38dbda82c7496 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -4834,16 +4834,19 @@ static bool is_tc_ipsec_order_check_needed(struct net_device *filter, struct mlx
static int mlx5e_tc_block_ipsec_offload(struct net_device *filter, struct mlx5e_priv *priv)
{
struct mlx5_core_dev *mdev = priv->mdev;
+ int ret = 0;
if (!is_tc_ipsec_order_check_needed(filter, priv))
return 0;
- if (mdev->num_block_tc)
- return -EBUSY;
-
- mdev->num_block_ipsec++;
+ spin_lock_bh(&mdev->offload_block.lock);
+ if (mdev->offload_block.num_block_tc)
+ ret = -EBUSY;
+ else
+ mdev->offload_block.num_block_ipsec++;
+ spin_unlock_bh(&mdev->offload_block.lock);
- return 0;
+ return ret;
}
static void mlx5e_tc_unblock_ipsec_offload(struct net_device *filter, struct mlx5e_priv *priv)
@@ -4851,7 +4854,10 @@ static void mlx5e_tc_unblock_ipsec_offload(struct net_device *filter, struct mlx
if (!is_tc_ipsec_order_check_needed(filter, priv))
return;
- priv->mdev->num_block_ipsec--;
+ spin_lock_bh(&priv->mdev->offload_block.lock);
+ if (!WARN_ON_ONCE(!priv->mdev->offload_block.num_block_ipsec))
+ priv->mdev->offload_block.num_block_ipsec--;
+ spin_unlock_bh(&priv->mdev->offload_block.lock);
}
int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 5f28d906c35b6..fe98e35d15d21 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1810,6 +1810,7 @@ int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx)
lockdep_register_key(&dev->lock_key);
mutex_init(&dev->intf_state_mutex);
lockdep_set_class(&dev->intf_state_mutex, &dev->lock_key);
+ spin_lock_init(&dev->offload_block.lock);
mutex_init(&dev->mlx5e_res.uplink_netdev_lock);
mutex_init(&dev->wc_state_lock);
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 83d0a83bbfbca..a778733fdb66f 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -788,8 +788,12 @@ struct mlx5_core_dev {
u32 vsc_addr;
struct mlx5_hv_vhca *hv_vhca;
struct mlx5_hwmon *hwmon;
- u64 num_block_tc;
- u64 num_block_ipsec;
+ struct {
+ /* Protects the fields below. */
+ spinlock_t lock;
+ u64 num_block_tc;
+ u64 num_block_ipsec;
+ } offload_block;
#ifdef CONFIG_MLX5_MACSEC
struct mlx5_macsec_fs *macsec_fs;
/* MACsec notifier chain to sync MACsec core and IB database */
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0505/1005] net: Fix memory_allocated leak in __sk_mem_raise_allocated().
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (503 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0504/1005] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0506/1005] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
` (493 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kuniyuki Iwashima, 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 8012eec76b7e6c0d9fb338fe8e3db6ca1b419da4 ]
__sk_mem_raise_allocated() calls sk_memory_allocated_add() and
reuses the return value to check if it was called.
However, sk_memory_allocated_{add,sub}() cache a value in per-cpu
counter, sk->sk_prot->per_cpu_fw_alloc, up to sysctl_mem_pcpu_rsv
before reflecting it to sk->sk_prot->memory_allocated.
Thus, sk->sk_prot->memory_allocated could have a negative value,
and proto_memory_allocated() returns 0 in such a case.
Then, if mem_cgroup_sk_charge() succeeds, sk_prot_mem_limits()
checks are bypassed, and if mem_cgroup_sk_charge() fails,
sk_memory_allocated_sub() is not called, leaking counters.
Let's use sk->sk_bypass_prot_mem instead of allocated.
Fixes: 7c268eaeec63 ("net: Allow opt-out from global protocol memory accounting.")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261105212905.3122712-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/sock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index a74be1cc93024..f93ae40ef6bd7 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3357,7 +3357,7 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind)
goto suppress_allocation;
}
- if (!allocated)
+ if (sk->sk_bypass_prot_mem)
return 1;
/* Under limit. */
@@ -3438,7 +3438,7 @@ int __sk_mem_raise_allocated(struct sock *sk, int size, int amt, int kind)
trace_sock_exceed_buf_limit(sk, prot, allocated, kind);
- if (allocated)
+ if (!sk->sk_bypass_prot_mem)
sk_memory_allocated_sub(sk, amt);
if (charged)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0506/1005] fou: gue: check IP version of held packets for direct IP encapsulation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (504 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0505/1005] net: Fix memory_allocated leak in __sk_mem_raise_allocated() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0507/1005] tcp: Do not allow buggy transitions between ehash and lhash2 Greg Kroah-Hartman
` (492 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, 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 c59f004734a2a7c0e427011db13aca524e781498 ]
For GUE version 0, gue_gro_receive() compares the base GUE header and
its optional fields with every held packet. For GUE version 1 (direct
IP encapsulation), it skips this comparison and selects the next GRO
handler only from the IP version of the incoming packet.
A held version 0 GUE packet from the same outer flow therefore stays
eligible. For example, a GUE/IPv4/UDP packet can be aggregated with a
direct IPv4/TCP packet, and inet_gro_receive() then parses the held
packet's GUE header as an IPv4 header.
Clear same_flow for held packets whose first nibble does not match the
incoming IP version. A valid version 0 GUE header always has a first
nibble between 0 and 3, so this also separates the two GUE formats.
The reverse case is already handled: the version 0 path compares the
whole base GUE header, including the version bits.
Fixes: c1e48af7960e ("gue: Implement direction IP encapsulation")
Reported-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261106195615.2498766-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/fou_core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c
index 076fdca44f518..5c3c8f55d0570 100644
--- a/net/ipv4/fou_core.c
+++ b/net/ipv4/fou_core.c
@@ -364,6 +364,18 @@ static struct sk_buff *gue_gro_receive(struct sock *sk,
default:
goto out;
}
+
+ /* Match the encapsulation format and IP version. */
+ list_for_each_entry(p, head, list) {
+ const struct iphdr *iph2;
+
+ if (!NAPI_GRO_CB(p)->same_flow)
+ continue;
+
+ iph2 = (const struct iphdr *)(p->data + off);
+ if (iph2->version != ((struct iphdr *)guehdr)->version)
+ NAPI_GRO_CB(p)->same_flow = 0;
+ }
goto next_proto;
default:
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0507/1005] tcp: Do not allow buggy transitions between ehash and lhash2.
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (505 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0506/1005] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0508/1005] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF Greg Kroah-Hartman
` (491 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Michal Luczaj,
Hyunwoo Kim, Kuniyuki Iwashima, 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 8cc3aef0cb198049805ecc061a2cc7b79b0ae43e ]
The following state transitions have long been a playground for
syzbot, and recently AI joined in, reporting a lot more bugs.
* listen() + shutdown() + connect()
* connect() + connect(AF_UNSPEC) + listen()
All the fix attempts would add more code to the fast path, which
is not worth it.
Instead of playing whack-a-mole with these edge-case bugs,
let's disallow these transitions.
Note that unhashed_state is placed in the 4-byte hole after
icsk_pmtu_cookie.
$ pahole -C inet_connection_sock vmlinux
struct inet_connection_sock {
...
__u32 icsk_pmtu_cookie; /* 1208 4 */
unsigned char unhashed_state; /* 1212 1 */
/* XXX 3 bytes hole, try to pack */
Reported-by: Kyle Zeng <kylebot@openai.com>
Closes: https://lore.kernel.org/netdev/20260731140512.566464-1-david.lee@trailofbits.com/
Reported-by: Michal Luczaj <mhal@rbox.co>
Closes: https://lore.kernel.org/netdev/20260803-sockmap-lookup-tcp-leak-v2-0-306e025bfe66@rbox.co/
Reported-by: Hyunwoo Kim <imv4bel@gmail.com>
Closes: https://lore.kernel.org/netdev/20260824033331.1084971-1-imv4bel@gmail.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260904033543.2635540-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 8c011697f76a ("tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/inet_connection_sock.h | 1 +
net/ipv4/inet_connection_sock.c | 1 +
net/ipv4/inet_hashtables.c | 11 +++++++++++
3 files changed, 13 insertions(+)
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 433c2df23076d..903499581db7e 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -94,6 +94,7 @@ struct inet_connection_sock {
u32 icsk_rto_max;
__u32 icsk_delack_max;
__u32 icsk_pmtu_cookie;
+ unsigned char unhashed_state;
const struct tcp_congestion_ops *icsk_ca_ops;
const struct inet_connection_sock_af_ops *icsk_af_ops;
const struct tcp_ulp_ops *icsk_ulp_ops;
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 71b0c344579f3..e56beec438773 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -1262,6 +1262,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
memset(&newicsk->icsk_accept_queue, 0,
sizeof(newicsk->icsk_accept_queue));
+ newicsk->unhashed_state = 0;
inet_sk_set_state(newsk, TCP_SYN_RECV);
inet_clone_ulp(req, newsk, priority);
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index 7ffa9171d6de1..860145d810ed4 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -804,6 +804,11 @@ int inet_hash(struct sock *sk)
inet_init_ehash_secret();
WARN_ON(!sk_unhashed(sk));
+
+ if (unlikely(inet_csk(sk)->unhashed_state &&
+ inet_csk(sk)->unhashed_state != TCP_LISTEN))
+ return -EINVAL;
+
ilb2 = inet_lhash2_bucket_sk(hashinfo, sk);
spin_lock(&ilb2->lock);
@@ -833,6 +838,9 @@ void inet_unhash(struct sock *sk)
return;
sock_rps_delete_flow(sk);
+
+ inet_csk(sk)->unhashed_state = sk->sk_state;
+
if (sk->sk_state == TCP_LISTEN) {
struct inet_listen_hashbucket *ilb2;
@@ -1059,6 +1067,9 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
int ret, i, low, high;
bool local_ports;
+ if (unlikely(inet_csk(sk)->unhashed_state == TCP_LISTEN))
+ return -EINVAL;
+
if (port) {
local_bh_disable();
ret = check_established(death_row, sk, port, NULL, false,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0508/1005] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (506 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0507/1005] tcp: Do not allow buggy transitions between ehash and lhash2 Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0509/1005] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
` (490 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jiayuan Chen, Kuniyuki Iwashima, 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 8c011697f76abf3b2302718a7a1c50e36d849f28 ]
After listen() + shutdown(), a TCP socket is moved to the closed
section of its reuseport group, while TCP_NEW_SYN_RECV requests
can still reference it as rsk_listener.
If SO_ATTACH_REUSEPORT_[CE]BPF is then used on this socket,
reuseport_attach_prog() calls reuseport_alloc(), which resurrects
it into the listening section of a new group, even though the
socket is still in TCP_CLOSE.
After close(), the socket stays in that group and the pending
requests keep it allocated. When the final ACK arrives,
reuseport_migrate_sock() can select this dead socket and
inet_csk_clone_lock() clones it. With a ULP like espintcp installed
while in TCP_CLOSE, the child inherits icsk_ulp_data and sk_destruct
after tcp_cleanup_ulp() cleared icsk_ulp_ops, leading to a
use-after-free in espintcp_destruct().
As done in commit 8cc3aef0cb19 ("tcp: Do not allow buggy transitions
between ehash and lhash2."), deny this transition instead of adding
checks to the fast path.
Only an unhashed former listener is affected. Applications can still
attach a reuseport prog to a socket that never listened, or to a
listener (including one that called listen() again after shutdown()).
Fixes: 333bb73f620e ("tcp: Keep TCP_CLOSE sockets in the reuseport group.")
Reported-by: Kyle Zeng <kylebot@openai.com>
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/20261106084300.2029567-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/sock_reuseport.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c
index fccbdd0430b05..b9e5648fa4c51 100644
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -6,6 +6,7 @@
* selecting the socket index from the array of available sockets.
*/
+#include <net/inet_connection_sock.h>
#include <net/ip.h>
#include <net/sock_reuseport.h>
#include <linux/bpf.h>
@@ -692,6 +693,14 @@ int reuseport_attach_prog(struct sock *sk, struct bpf_prog *prog)
if (!sk->sk_reuseport)
return -EINVAL;
+ /* Do not put a shutdown()ed TCP listener back into the
+ * listening section of a reuseport group while it is in
+ * TCP_CLOSE: requests can still migrate to it.
+ */
+ if (sk_is_tcp(sk) &&
+ inet_csk(sk)->unhashed_state == TCP_LISTEN)
+ return -EINVAL;
+
err = reuseport_alloc(sk, false);
if (err)
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0509/1005] udp: do not use a cross-family sk_rx_dst in early demux
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (507 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0508/1005] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0510/1005] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
` (489 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
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 5636e67320563be743d47706ef4914078c27edb2 ]
A dual-stack UDP socket connected to a v4-mapped address can receive
both IPv4 packets and IPv6 packets using v4-mapped addresses:
ip6_rcv_core() no longer rejects a v4-mapped source since commit
dcc32f4f183a ("ipv6: weaken the v4mapped source check"), which kept
that check only in tcp_v6_conn_request(). ipv6_portaddr_hash() hashes
v4-mapped addresses like IPv4 ones, so both early demux handlers find
the socket, and both __udp4_lib_rcv() and __udp6_lib_rcv() store their
input dst in the same sk->sk_rx_dst.
udp_v6_early_demux() validates the cached dst with dst_check(), but
ipv4_dst_check() ignores the cookie, so an IPv4 dst gets attached to
an IPv6 skb. ip6_rcv_finish_core() then skips the route lookup and
ip_local_deliver() parses the IPv6 header as an IPv4 one: the IPv6
next header and hop limit are read as a fragment offset, and the IPv4
protocol is taken from a source address byte.
The reverse direction looks possible too: per-cpu dsts of IPv6 routes
using nexthop objects have rt->sernum set, and ip6_dst_check() then
ignores the cookie, so udp_v4_early_demux() can attach an IPv6 dst to
an IPv4 skb.
Kyle Zeng reported that such a packet can reach XFRM input still
holding the prefetched, non refcounted, socket set by early demux,
which can then outlive its RCU grace period.
Only use the cached dst if its family matches the packet. Otherwise
fall back to a regular route lookup.
TCP does not have the same problem: sk_ehashfn() hashes a v4-mapped
socket with inet_ehashfn(), while IPv6 lookups use inet6_ehashfn(),
so IPv6 packets do not normally find a v4-mapped TCP socket.
Fixes: 5425077d73e0 ("net: ipv6: Add early demux handler for UDP unicast")
Fixes: c9f2c1ae123a ("udp6: fix socket leak on early demux")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261106110135.2161204-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/udp.c | 5 ++++-
net/ipv6/udp.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b090bd1f59e86..9a91e3533c15c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2849,8 +2849,11 @@ enum skb_drop_reason udp_v4_early_demux(struct sk_buff *skb)
skb->destructor = sock_pfree;
dst = rcu_dereference(sk->sk_rx_dst);
- if (dst)
+ /* A dual-stack socket can cache an IPv6 dst. */
+ if (dst && dst->ops->family == AF_INET)
dst = dst_check(dst, 0);
+ else
+ dst = NULL;
if (dst) {
u32 itag = 0;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 93478d1ad5769..471cf3fba80eb 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1255,8 +1255,11 @@ void udp_v6_early_demux(struct sk_buff *skb)
skb->destructor = sock_pfree;
dst = rcu_dereference(sk->sk_rx_dst);
- if (dst)
+ /* A dual-stack socket can cache an IPv4 dst. */
+ if (dst && dst->ops->family == AF_INET6)
dst = dst_check(dst, sk->sk_rx_dst_cookie);
+ else
+ dst = NULL;
if (dst) {
/* set noref for now.
* any place which wants to hold dst has to call
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0510/1005] net: gro: compare skb->protocol in gro_list_prepare()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (508 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0509/1005] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0511/1005] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
` (488 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, 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 511582022bfd07475d0daa209e6e6aa5a940740d ]
gro_list_prepare() checks whether a held packet may belong to the same
flow as the incoming one by comparing the device, VLAN tag, metadata
and the link-layer header, using dev->hard_header_len as its length.
On devices without a link-layer header (hard_header_len == 0), such as
L3 GRE tunnels, no compared byte carries the outer protocol:
skb->protocol comes from the tunnel header. Packets of different
protocols can then stay eligible, and the GRO handler selected from the
incoming skb->protocol parses the held packet with the wrong layout.
For example, take an IPv4/UDP packet held by UDP GRO and a
VLAN/IPv4/TCP packet received on the same ipgre device.
vlan_gro_receive() reads the first four bytes of the held IPv4 header
as a VLAN header. With crafted values, the held packet survives up to
tcp_gro_receive(), which uses its UDP header as a TCP header. With a
short linear part, the FIN/PSH update of the held packet's TCP flags
can then write into skb_shared_info.
The VLAN, GRE, IPv4 and IPv6 GRO handlers compare the next-protocol
field of their own header, so once the outer protocol matches, the
inner layers are checked too. Only the outermost protocol was not
compared.
Compare skb->protocol too. On Ethernet devices this is redundant with
compare_ether_header(), but it is cheap.
GUE direct IP encapsulation has a similar issue, but there both packets
have the same outer protocol, so it is fixed separately in
gue_gro_receive().
Fixes: 60769a5dcd87 ("ipv4: gre: add GRO capability")
Reported-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261109164540.3104392-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/gro.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/gro.c b/net/core/gro.c
index 1b033855a20db..08e4731ddb7e6 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -374,6 +374,7 @@ static void gro_list_prepare(const struct list_head *head,
}
diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
+ diffs |= p->protocol != skb->protocol;
diffs |= p->vlan_all ^ skb->vlan_all;
diffs |= skb_metadata_differs(p, skb);
if (maclen == ETH_HLEN)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0511/1005] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (509 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0510/1005] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0512/1005] ASoC: apple: mca: Fix clock selection for clock consumer FEs Greg Kroah-Hartman
` (487 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anandu Padinhare, Lorenzo Bianconi,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anandu Padinhare <Anandu.Padinhare@electrifex.com>
[ Upstream commit 070411c1590c8172eb4d86f045d99c372f22fe23 ]
In the AF_XDP zero-copy RX path, frames that the XDP program passes to
the stack are handed over by stmmac_dispatch_skb_zc(). That function
increments rx_pkt_n instead of rx_packets since
commit 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary").
stmmac_rx_zc() already adds every processed frame to rx_pkt_n, so each
XDP_PASS frame is counted twice there, and rx_packets, which
ndo_get_stats64() reports, never counts them: on a zero-copy queue
rx_bytes grows with the passed frames while rx_packets stays still.
Count the frame in rx_packets, as the regular RX path and the code
before that commit did.
Found while testing AF_XDP zero-copy on an ADSP-SC598 (adi-dwmac,
100 Mbit/s link): rx_pkt_n grew almost twice as fast as the frames the
MAC delivered, while "ip -s link" counted almost none.
Tested on that board with a 6.18-based kernel, whose zero-copy RX
accounting matches net. An AF_XDP zero-copy socket on queue 0 received
frames of one EtherType while UDP traffic was passed to the stack. In a
run with 60 s of traffic before the change, rx_pkt_n was 1.88 times the
frames that reached the driver (MAC frames minus RX FIFO overflows) and
"ip -s link" counted 55 RX packets. In the same test with the change,
rx_pkt_n equals the frames that reached the driver and rx_packets equals
the frames passed to the stack.
Fixes: 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary")
Signed-off-by: Anandu Padinhare <Anandu.Padinhare@electrifex.com>
Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/PNYPR01MB11444552E41C2B17A992492C0FD762@PNYPR01MB11444.INDPRD01.PROD.OUTLOOK.COM
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 9ff7aecefca22..fa4bd6a3a1bf8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5522,7 +5522,7 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue,
napi_gro_receive(&ch->rxtx_napi, skb);
u64_stats_update_begin(&rxq_stats->napi_syncp);
- u64_stats_inc(&rxq_stats->napi.rx_pkt_n);
+ u64_stats_inc(&rxq_stats->napi.rx_packets);
u64_stats_add(&rxq_stats->napi.rx_bytes, len);
u64_stats_update_end(&rxq_stats->napi_syncp);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0512/1005] ASoC: apple: mca: Fix clock selection for clock consumer FEs
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (510 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0511/1005] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0513/1005] drm/i915/psr: Flush on cursor update also when not using Selective Fetch Greg Kroah-Hartman
` (486 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Janne Grunau, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Janne Grunau <j@jannau.net>
[ Upstream commit d9bcb20e403908415809c37b96db4c9d651298cc ]
In commit 00309bfb1f54 ("ASoC: apple: mca: Support FEs being clock
consumers") the syncgen clock selection was misunderstood resulting in
selecting a random clock. In the capture on multiple BEs for IV sense
data use case the configuration worked partially by sheer luck. On
Macbook Pro's with 6 speakers it could result in desync IV sense data
triggered likely by sample rate changes.
When the FE is a clock consumer select the clock of first used BE as
SYNCGEN_MCLK.
Add function like macros to determine the clock index based on the FE or
BE number.
This is functionally equivalent to the state sent in v2 of "ASoC: apple:
mca: support simultaneous I2S capture on the frontend" in [1].
Link: https://lore.kernel.org/all/20260628-apple-audio-redux-v2-4-6328269c9652@gmail.com/ [1]
Fixes: 00309bfb1f54 ("ASoC: apple: mca: Support FEs being clock consumers")
Fixes: 108a14b20f95 ("ASoC: apple: mca: Support capture on multiples BEs")
Signed-off-by: Janne Grunau <j@jannau.net>
Link: https://patch.msgid.link/20261110-snd-soc-apple-mca-capture-multiple-be-v1-1-d9569a8374c5@jannau.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/apple/mca.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c
index be702b2942a53..ec3636f9dc86e 100644
--- a/sound/soc/apple/mca.c
+++ b/sound/soc/apple/mca.c
@@ -53,6 +53,8 @@
#define SYNCGEN_STATUS_EN BIT(0)
#define REG_SYNCGEN_MCLK_SEL 0x104
#define SYNCGEN_MCLK_SEL GENMASK(3, 0)
+#define SYNCGEN_MCLK_FE_CLK(n) ((n) + 1)
+#define SYNCGEN_MCLK_BE_CLK(n) ((n) + 7)
#define REG_SYNCGEN_HI_PERIOD 0x108
#define REG_SYNCGEN_LO_PERIOD 0x10c
@@ -313,7 +315,8 @@ static int mca_fe_enable_clocks(struct mca_cluster *cl)
return -EINVAL;
}
- writel_relaxed(cl->no + 1, cl->base + REG_SYNCGEN_MCLK_SEL);
+ writel_relaxed(SYNCGEN_MCLK_FE_CLK(cl->no),
+ cl->base + REG_SYNCGEN_MCLK_SEL);
mca_modify(cl, REG_SYNCGEN_STATUS, SYNCGEN_STATUS_EN,
SYNCGEN_STATUS_EN);
mca_modify(cl, REG_STATUS, STATUS_MCLK_EN, STATUS_MCLK_EN);
@@ -390,7 +393,7 @@ static int mca_fe_prepare(struct snd_pcm_substream *substream,
/* Turn on the cluster power domain if not already in use */
if (!cl->syncgen_in_use) {
- int port = ffs(mca_fe_get_portmask(substream));
+ int port = ffs(mca_fe_get_portmask(substream)) - 1;
cl->pd_link = device_link_add(mca->dev, cl->pd_dev,
DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME |
@@ -401,7 +404,8 @@ static int mca_fe_prepare(struct snd_pcm_substream *substream,
return -EINVAL;
}
- mca_modify(cl, REG_SYNCGEN_MCLK_SEL, SYNCGEN_MCLK_SEL, BIT(port));
+ mca_modify(cl, REG_SYNCGEN_MCLK_SEL, SYNCGEN_MCLK_SEL,
+ SYNCGEN_MCLK_BE_CLK(port));
mca_modify(cl, REG_SYNCGEN_STATUS, SYNCGEN_STATUS_EN,
SYNCGEN_STATUS_EN);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0513/1005] drm/i915/psr: Flush on cursor update also when not using Selective Fetch
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (511 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0512/1005] ASoC: apple: mca: Fix clock selection for clock consumer FEs Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0514/1005] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
` (485 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ankit Nautiyal, Jouni Högander,
Mika Kahola, Joonas Lahtinen, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <jouni.hogander@intel.com>
[ Upstream commit 6b3ea5a07eac0514623da3d0709b34c8c70f2827 ]
Currently we are not doing flush on cursor update if Selective Fetch is not
in use. This does not cause problems in PSR cases as enabling VBI is
triggering PSR exit which triggers sending update to panel. In case of
Panel Replay this does not happen. This causes legacy cursor update not
working if using Panel Replay without Selective Updates.
Dc3co is currently not enabled. Anyways there is no reason to differentiate
calling psr2_dc3co_flush_locked on cursor update depending on selective
fetch being enabled. So remove this dependency.
v2:
- Keep DC3CO handling for cursor updates.
Fixes: 129a4da11707 ("drm/i915/psr: Use TRANS_PUSH to trigger frame change event")
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20261102100051.272137-2-jouni.hogander@intel.com
(cherry picked from commit 043ab39fe2daad32f15fe77cf787a759f3f73512)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/i915/display/intel_psr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 01c36ea315fa6..b68859c31d175 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -3717,12 +3717,11 @@ void intel_psr_flush(struct intel_display *display,
if (intel_dp->psr.pause_counter)
goto unlock;
- if (origin == ORIGIN_FLIP ||
- (origin == ORIGIN_CURSOR_UPDATE &&
- !intel_dp->psr.psr2_sel_fetch_enabled)) {
+ if (origin == ORIGIN_FLIP || origin == ORIGIN_CURSOR_UPDATE)
psr2_dc3co_flush_locked(intel_dp, frontbuffer_bits);
+
+ if (origin == ORIGIN_FLIP)
goto unlock;
- }
if (pipe_frontbuffer_bits == 0)
goto unlock;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0514/1005] udp: check frag_list IP family before using skb_segment_list()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (512 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0513/1005] drm/i915/psr: Flush on cursor update also when not using Selective Fetch Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0515/1005] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
` (484 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Willem de Bruijn, Dave Miller, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 22b7cb932c6a0f7566d41072be6956cb6c8af4e1 ]
UDP fraglist GRO uses SKB_GSO_UDP_L4 for both IPv4 and IPv6.
__udp_gso_segment() reuses the frag_list skbs when the geometry of
the head skb was not modified. skb_segment_list() keeps the network
header of each frag_list skb as it was at GRO time and only adjusts
the transport header offset.
Nothing guarantees that the head skb still has the IP family of the
frag_list skbs: helpers like skb_mpls_pop() let the caller choose
the new protocol. In that case __udpv6_gso_segment_list_csum()
handles the 20 byte IPv4 header of each frag_list skb as a struct
ipv6hdr, and can write IPv6 addresses beyond its linear part.
Check the IP version of the first frag_list skb. All skbs in the
list belong to the same flow, so they share the same IP family.
Use the skb_segment() fallback on a mismatch. Regular fraglist GRO
traffic keeps the fast path.
Fixes: b936a9b8d4a5 ("net: ipv6: fix UDPv6 GSO segmentation with NAT")
Fixes: c3df39ac9b0e ("udp: ipv4: manipulate network header of NATed UDP GRO fraglist")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
[edumazet: simplified the fix, rewrote the comment and the changelog]
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/udp_offload.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index cf07c3c6611a2..802365b4780fd 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -514,9 +514,14 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
}
if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) {
- /* Detect modified geometry and pass those to skb_segment. */
+ /* Detect modified geometry and pass those to skb_segment.
+ * SKB_GSO_UDP_L4 is used by both IPv4 and IPv6: also make sure
+ * the frag_list skbs still have the IP family we segment for,
+ * as their network headers are not rebuilt.
+ */
if ((skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size) &&
- !(skb_shinfo(gso_skb)->gso_type & SKB_GSO_DODGY))
+ !(skb_shinfo(gso_skb)->gso_type & SKB_GSO_DODGY) &&
+ ip_hdr(skb_shinfo(gso_skb)->frag_list)->version == (is_ipv6 ? 6 : 4))
return __udp_gso_segment_list(gso_skb, features, is_ipv6);
ret = __skb_linearize(gso_skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0515/1005] drm/bridge: sii902x: validate I2S data lane values
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (513 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0514/1005] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0516/1005] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
` (483 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Luca Ceresoli,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 444b7116e7ef1fdb5f7db3bc1f74b20098d062d4 ]
The sil,i2s-data-lanes property reader bounds the number of entries, but
does not bound each entry's value. Those values index the four-entry
i2s_lane_id table when the audio FIFO sequence is built.
Reject unsupported lane values before indexing that table. Report the
property name and invalid value with dev_err_probe() so the diagnostic
identifies the faulty configuration.
The issue was found by our static-analysis tool.
Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260920034833.18874-1-hppiscas@163.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/bridge/sii902x.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index 9aac44ed5b677..48058029fdfcd 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -890,9 +890,15 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
}
codec_data.max_i2s_channels = 2 * num_lanes;
- for (i = 0; i < num_lanes; i++)
+ for (i = 0; i < num_lanes; i++) {
+ if (lanes[i] >= ARRAY_SIZE(i2s_lane_id))
+ return dev_err_probe(dev, -EINVAL,
+ "invalid sil,i2s-data-lanes value %u\n",
+ lanes[i]);
+
sii902x->audio.i2s_fifo_sequence[i] |= audio_fifo_id[i] |
i2s_lane_id[lanes[i]] | SII902X_TPI_I2S_FIFO_ENABLE;
+ }
sii902x->audio.mclk = devm_clk_get_optional(dev, "mclk");
if (IS_ERR(sii902x->audio.mclk)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0516/1005] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (514 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0515/1005] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0517/1005] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
` (482 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kavitha Daula, Juergen Gross,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kavitha Daula <kavi@edera.dev>
[ Upstream commit 704f812cdab8bbf30987653c1c76c0d2c1e135e7 ]
Both callers of gnttab_unmap_refs_sync(), free_persistent_gnts() and
xen_blkbk_unmap_purged_grants() in blkback, keep their struct
gntab_unmap_queue_data on the stack. gnttab_unmap_refs_async() sets up
the delayed work inside it with INIT_DELAYED_WORK(), so with
CONFIG_DEBUG_OBJECTS_WORK and CONFIG_DEBUG_OBJECTS_TIMERS every
persistent grant teardown warns twice, once for the work and once for
its timer:
[ 104.366085] ODEBUG: object ffffc9004020fad8 is on stack ffffc9004020c000, but NOT annotated.
[ 104.371551] WARNING: CPU: 1 PID: 48 at lib/debugobjects.c:672 lookup_object_or_alloc.part.0+0x12b/0x1f0
Call Trace:
<TASK>
__debug_object_init+0xfe/0x1a0
debug_object_init+0x38/0x50
__init_work+0x28/0x30
gnttab_unmap_refs_async+0x18/0xa0
gnttab_unmap_refs_sync+0x61/0x90
free_persistent_gnts+0x179/0x280
xen_blkbk_free_caches+0x16/0x30
xen_blkif_disconnect+0xfa/0x2d0
frontend_changed+0x90/0x680
xenbus_otherend_changed+0x80/0xb0
frontend_changed+0x14/0x20
xenwatch_thread+0x96/0x1a0
kthread+0x11d/0x250
ret_from_fork+0x29f/0x2d0
ret_from_fork_asm+0x1a/0x30
</TASK>
gnttab_unmap_refs_sync() waits for the unmap to complete before it
returns, so the work never outlives the caller's frame. Initialise it
with INIT_DELAYED_WORK_ONSTACK() when the item is on the stack and
destroy it before returning. The function is exported, so an item that
is not on the stack keeps INIT_DELAYED_WORK().
Fixes: b44166cd46e2 ("xen/grant: introduce func gnttab_unmap_refs_sync()")
Signed-off-by: Kavitha Daula <kavi@edera.dev>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261105000137.82224-1-kavithadaula@Kavithas-MacBook-Pro.local>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/xen/grant-table.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 076c1b0ab87fd..11c2ef1cc86eb 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -38,6 +38,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/slab.h>
+#include <linux/sched/task_stack.h>
#include <linux/vmalloc.h>
#include <linux/uaccess.h>
#include <linux/io.h>
@@ -1361,12 +1362,21 @@ static void unmap_refs_callback(int result,
int gnttab_unmap_refs_sync(struct gntab_unmap_queue_data *item)
{
struct unmap_refs_callback_data data;
+ bool on_stack = object_is_on_stack(item);
init_completion(&data.completion);
item->data = &data;
item->done = &unmap_refs_callback;
- gnttab_unmap_refs_async(item);
+ /* blkback keeps @item, and so its retry work, on the stack. */
+ if (on_stack)
+ INIT_DELAYED_WORK_ONSTACK(&item->gnttab_work, gnttab_unmap_work);
+ else
+ INIT_DELAYED_WORK(&item->gnttab_work, gnttab_unmap_work);
+ item->age = 0;
+ __gnttab_unmap_refs_async(item);
wait_for_completion(&data.completion);
+ if (on_stack)
+ destroy_delayed_work_on_stack(&item->gnttab_work);
return data.result;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0517/1005] ASoC: max98090: keep the MIC boost across mic input power-up
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (515 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0516/1005] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0518/1005] erofs: reset buf->off in erofs_init_metabuf() Greg Kroah-Hartman
` (481 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, LiangCheng Wang, Mark Brown,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: LiangCheng Wang <zaq14760@gmail.com>
[ Upstream commit 58d51fa6ff1d21e79c3c340bfb3155dfa3025ca3 ]
PA1EN/PA2EN select both the MIC1/MIC2 preamp enable and its gain
(0 = off, 1 = 0 dB, 2 = +20 dB, 3 = +30 dB). "MICn Boost Volume" keeps
the selected gain in max98090->pa1en/pa2en while the input is off, and
max98090_micinput_event() writes it to the field when the "MICn Input"
widget powers up.
The event handler also reads the field back to keep the stored gain in
sync ("Update for volatile"), but it does so on POST_PMU and POST_PMD.
The widget drives PA1EN/PA2EN as a single enable bit, the low bit of
the field, so at both points DAPM has just rewritten it:
- POST_PMU: DAPM has set the field to 1, so the read-back stores
0 dB and the handler then restores 0 dB.
- POST_PMD: DAPM has cleared the low bit, so a +30 dB (3) gain reads
back as +20 dB (2).
As a result every capture starts at 0 dB: a boost set while the input is
powered down, e.g. restored by alsactl or an audio HAL at boot, never
takes effect, and one changed during capture is lost at the next
power-up.
Read the field back on PRE_PMD instead, while it still holds the active
gain, and only restore the stored gain on POST_PMU.
Tested on i.MX95 with a MAX98090 headset mic on MIC1, running NXP's
6.18.38 vendor kernel (max98090_micinput_event() is the same as in
mainline): with MIC1 Boost Volume set to 2 (+30 dB) before capture,
register 0x10 reads 0x20 (0 dB) during capture without this change and
0x60 (+30 dB) with it, and a boost changed during capture is kept for
the next capture.
Fixes: 685e42154dcf ("ASoC: Replace max98090 Device Driver")
Signed-off-by: LiangCheng Wang <zaq14760@gmail.com>
Link: https://patch.msgid.link/20261111-max98090-mic-boost-v1-1-20b9bd8816db@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/max98090.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 64dc442e90663..696ea68e38f80 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -743,14 +743,6 @@ static int max98090_micinput_event(struct snd_soc_dapm_widget *w,
else
val = (val & M98090_MIC_PA2EN_MASK) >> M98090_MIC_PA2EN_SHIFT;
- if (val >= 1) {
- if (w->reg == M98090_REG_MIC1_INPUT_LEVEL) {
- max98090->pa1en = val - 1; /* Update for volatile */
- } else {
- max98090->pa2en = val - 1; /* Update for volatile */
- }
- }
-
switch (event) {
case SND_SOC_DAPM_POST_PMU:
/* If turning on, set to most recently selected volume */
@@ -759,6 +751,14 @@ static int max98090_micinput_event(struct snd_soc_dapm_widget *w,
else
val = max98090->pa2en + 1;
break;
+ case SND_SOC_DAPM_PRE_PMD:
+ if (val >= 1) {
+ if (w->reg == M98090_REG_MIC1_INPUT_LEVEL)
+ max98090->pa1en = val - 1;
+ else
+ max98090->pa2en = val - 1;
+ }
+ return 0;
case SND_SOC_DAPM_POST_PMD:
/* If turning off, turn off */
val = 0;
@@ -1121,11 +1121,13 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = {
SND_SOC_DAPM_PGA_E("MIC1 Input", M98090_REG_MIC1_INPUT_LEVEL,
M98090_MIC_PA1EN_SHIFT, 0, NULL, 0, max98090_micinput_event,
- SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD |
+ SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_PGA_E("MIC2 Input", M98090_REG_MIC2_INPUT_LEVEL,
M98090_MIC_PA2EN_SHIFT, 0, NULL, 0, max98090_micinput_event,
- SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD |
+ SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER("LINEA Mixer", SND_SOC_NOPM, 0, 0,
&max98090_linea_mixer_controls[0],
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0518/1005] erofs: reset buf->off in erofs_init_metabuf()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (516 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0517/1005] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0519/1005] tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort() Greg Kroah-Hartman
` (480 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhan Xusheng, Gao Xiang, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhan Xusheng <zhanxusheng@xiaomi.com>
[ Upstream commit 8b4ddd28ec5bdec14cefc57f8bf792cb4764d724 ]
erofs_init_metabuf() sets buf->off only for the block device and keeps
the old value when it switches to the metabox or the managed cache.
erofs_bread() adds buf->off to every offset, so the result depends on
how the buffer was last initialized.
getxattr and listxattr init the same buffer twice, for the inline and
the shared xattrs, with in_metabox taken from different places. On a
block device mount with fsoffset=, if the inode is outside the metabox
and COMPAT_SHARED_EA_IN_METABOX is set, the shared xattrs are read at
their metabox offset plus fsoffset. The same image mounted file-backed
returns the right values.
Reset buf->off on every init.
Fixes: 414091322c63 ("erofs: implement metadata compression")
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.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/data.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index a726be5e27ca6..67052e98ef44e 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -60,6 +60,7 @@ int erofs_init_metabuf(struct erofs_buf *buf, struct super_block *sb,
struct erofs_sb_info *sbi = EROFS_SB(sb);
buf->mc = false;
+ buf->off = 0;
if (in_metabox) {
if (unlikely(!sbi->metabox_inode))
return -EFSCORRUPTED;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0519/1005] tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort().
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (517 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0518/1005] erofs: reset buf->off in erofs_init_metabuf() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0520/1005] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
` (479 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kuniyuki Iwashima,
Matthieu Baerts (NGI0), 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 93723db43e5185404e7d637357d07ffbb38e8b65 ]
When TFO is enabled, tcp_v[46]_connect() sets sk->sk_state to
TCP_SYN_SENT and puts the socket into ehash without calling
tcp_connect().
Then, tcp_fastopen_defer_connect() sets DEFER_CONNECT, and
the first write()/sendmsg() will call tcp_connect() and send
SYN with data if possible.
If tcp_abort() kills a socket before the first write()/sendmsg(),
the unhashed socket can still call it and send SYN in TCP_CLOSE.
Also, DEFER_CONNECT is cleared after __inet_stream_connect().
So, blocking write()/sendmsg() can release lock_sock() in
inet_wait_for_connect() while DEFER_CONNECT is set, and
tcp_poll() could set EPOLLOUT even after SYN is sent.
Let's clear DEFER_CONNECT in tcp_abort() and right before
tcp_connect() in tcp_sendmsg_fastopen().
Note that the last argument of __inet_stream_connect() is
changed from is_sendmsg to defer_connect as DEFER_CONNECT
is already cleared when __inet_stream_connect() is called.
This change is also needed for the next patch.
Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20261107235720.3129212-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/inet_common.h | 2 +-
net/ipv4/af_inet.c | 10 ++++++----
net/ipv4/tcp.c | 9 +++++++--
net/mptcp/protocol.c | 5 +++--
4 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 3d747896be300..0f088a213c381 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -25,7 +25,7 @@ int inet_release(struct socket *sock);
int inet_stream_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
int addr_len, int flags);
int __inet_stream_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
- int addr_len, int flags, int is_sendmsg);
+ int addr_len, int flags, bool defer_connect);
int inet_dgram_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
int addr_len, int flags);
int inet_accept(struct socket *sock, struct socket *newsock,
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 14ce01092fda6..bc3bbb2366d81 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -629,7 +629,7 @@ static long inet_wait_for_connect(struct sock *sk, long timeo, int writebias)
* TCP 'magic' in here.
*/
int __inet_stream_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
- int addr_len, int flags, int is_sendmsg)
+ int addr_len, int flags, bool defer_connect)
{
struct sock *sk = sock->sk;
int err;
@@ -664,8 +664,10 @@ int __inet_stream_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
err = -EISCONN;
goto out;
case SS_CONNECTING:
- if (inet_test_bit(DEFER_CONNECT, sk))
- err = is_sendmsg ? -EINPROGRESS : -EISCONN;
+ if (defer_connect)
+ err = -EINPROGRESS;
+ else if (inet_test_bit(DEFER_CONNECT, sk))
+ err = -EISCONN;
else
err = -EALREADY;
/* Fall out of switch with err, set for this state */
@@ -752,7 +754,7 @@ int inet_stream_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
int err;
lock_sock(sock->sk);
- err = __inet_stream_connect(sock, uaddr, addr_len, flags, 0);
+ err = __inet_stream_connect(sock, uaddr, addr_len, flags, false);
release_sock(sock->sk);
return err;
}
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index f88548e10f2a8..be772a67b05d6 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1054,6 +1054,7 @@ int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, int *copied,
struct tcp_sock *tp = tcp_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct sockaddr *uaddr = msg->msg_name;
+ bool defer_connect = false;
int err, flags;
if (!(READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_fastopen) &
@@ -1073,6 +1074,9 @@ int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, int *copied,
tp->fastopen_req->uarg = uarg;
if (inet_test_bit(DEFER_CONNECT, sk)) {
+ inet_clear_bit(DEFER_CONNECT, sk);
+ defer_connect = true;
+
err = tcp_connect(sk);
/* Same failure procedure as in tcp_v4/6_connect */
if (err) {
@@ -1083,14 +1087,13 @@ int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, int *copied,
}
flags = (msg->msg_flags & MSG_DONTWAIT) ? O_NONBLOCK : 0;
err = __inet_stream_connect(sk->sk_socket, (struct sockaddr_unsized *)uaddr,
- msg->msg_namelen, flags, 1);
+ msg->msg_namelen, flags, defer_connect);
/* fastopen_req could already be freed in __inet_stream_connect
* if the connection times out or gets rst
*/
if (tp->fastopen_req) {
*copied = tp->fastopen_req->copied;
tcp_free_fastopen_req(tp);
- inet_clear_bit(DEFER_CONNECT, sk);
}
return err;
}
@@ -5151,6 +5154,8 @@ int tcp_abort(struct sock *sk, int err)
/* Don't race with userspace socket closes such as tcp_close. */
lock_sock(sk);
+ inet_clear_bit(DEFER_CONNECT, sk);
+
/* Avoid closing the same socket twice. */
if (sk->sk_state == TCP_CLOSE) {
if (!has_current_bpf_ctx())
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 05c38564e8fdf..8e08feb676f78 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1920,10 +1920,12 @@ static int mptcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg,
msg->msg_flags = saved_flags;
release_sock(ssk);
+ inet_clear_bit(DEFER_CONNECT, sk);
+
/* do the blocking bits of inet_stream_connect outside the ssk socket lock */
if (ret == -EINPROGRESS && !(msg->msg_flags & MSG_DONTWAIT)) {
ret = __inet_stream_connect(sk->sk_socket, msg->msg_name,
- msg->msg_namelen, msg->msg_flags, 1);
+ msg->msg_namelen, msg->msg_flags, true);
/* Keep the same behaviour of plain TCP: zero the copied bytes in
* case of any error, except timeout or signal
@@ -1941,7 +1943,6 @@ static int mptcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg,
sk->sk_socket->state = SS_UNCONNECTED;
}
}
- inet_clear_bit(DEFER_CONNECT, sk);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0520/1005] tcp: Drop any segments if DEFER_CONNECT is set.
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (518 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0519/1005] tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0521/1005] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
` (478 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit 44809e49177992b15708a150437d9aebc5beea9c ]
TCP Fast Open lets a client send data in its SYN. With
TCP_FASTOPEN_CONNECT and a cached Fast Open cookie, which the server
sent in the SYN-ACK of an earlier connection, the connection is set up
in two steps:
- connect() sends nothing, so that the SYN can carry the data of the
first write(). It only sets DEFER_CONNECT and inserts the socket into
the hash table in SYN_SENT.
- The first write() calls tcp_connect(), which runs tcp_connect_init()
and sends the SYN.
A socket must not accept any segment before it has sent its SYN. But
nothing on the receive path checks DEFER_CONNECT. So until the write(),
the half-initialised socket processes segments like any socket in
SYN_SENT, and a forged SYN is accepted.
Similarly, ICMP with seq matching ISN is accepted in the state.
Before commit 57889a8f6d49 ("tcp: initialize send sequence numbers
before deferring TFO"), even seq 0 message was accepted.
Drop any segments if DEFER_CONNECT is set.
Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Signed-off-by: Chris Mason <mason@kernel.org>
[kuniyu: revised DEFER_CONNECT tests and the commit message]
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261107235720.3129212-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_input.c | 9 +++++++++
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv6/tcp_ipv6.c | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index ce8ac1d1cd0c7..4465ecba26140 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -7236,6 +7236,15 @@ tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
goto discard;
case TCP_SYN_SENT:
+ /* We sent nothing yet, so no segment belongs to this connection.
+ * Send no RST: it would be built from this socket, whose TCP-AO
+ * keys are not set up either.
+ */
+ if (unlikely(inet_test_bit(DEFER_CONNECT, sk))) {
+ SKB_DR_SET(reason, NOT_SPECIFIED);
+ goto discard;
+ }
+
tp->rx_opt.saw_tstamp = 0;
tcp_mstamp_refresh(tp);
queued = tcp_rcv_synsent_state_process(sk, skb, th);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index df2763f31dde6..c5567dd8c7126 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -541,7 +541,7 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED))
__NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
}
- if (sk->sk_state == TCP_CLOSE)
+ if (sk->sk_state == TCP_CLOSE || inet_test_bit(DEFER_CONNECT, sk))
goto out;
if (static_branch_unlikely(&ip4_min_ttl)) {
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index ff2a7ce78073e..ef5928885cc6b 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -449,7 +449,7 @@ static int tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (sock_owned_by_user(sk) && type != ICMPV6_PKT_TOOBIG)
__NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
- if (sk->sk_state == TCP_CLOSE)
+ if (sk->sk_state == TCP_CLOSE || inet_test_bit(DEFER_CONNECT, sk))
goto out;
if (static_branch_unlikely(&ip6_min_hopcount)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0521/1005] amt: tear down every amt device on an unregistering lower
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (519 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0520/1005] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0522/1005] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
` (477 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Omar Ramadan, Simon Horman,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Ramadan <omar@blockcast.net>
[ Upstream commit 7262e999ebec0a10ecc97ba4739f12255b7c6da8 ]
amt_device_event() acts only on the amt device that
amt_lookup_upper_dev() returns, which is the first amt device bound to
the event's lower. Several amt devices can share one lower, for
example two gateways.
On NETDEV_UNREGISTER, only the first device is unlinked and
unregistered. The others stay upper-linked to the lower, and
unregister_netdevice_many_notify() warns, because the notifier chain
must detach every upper device. They also still hold a reference on
the lower, so each is torn down only when netdev_wait_allrefs_any(),
called from netdev_run_todo(), rebroadcasts NETDEV_UNREGISTER. By then
the lower's sysfs directory is gone, so unlinking it trips a kernfs
WARN, and unregistering it from inside the rebroadcast trips the WARN
in __rtnl_unlock(). On NETDEV_CHANGEMTU, only the first device is
resized.
Walk every amt device in the lower's netns and act on each one bound
to the lower. On NETDEV_UNREGISTER, queue them all and unregister them
in one batch. amt_dellink() unlinks each device but leaves it on the
netns device list until unregister_netdevice_many(), so the walk stays
valid under RTNL.
To reproduce:
ip link add lower0 type dummy
ip link add amtg1 type amt mode gateway local 192.0.2.1 \
discovery 192.0.2.2 dev lower0
ip link add amtg2 type amt mode gateway local 192.0.2.1 \
discovery 192.0.2.2 dev lower0
ip link del lower0
Without this patch, the last command logs:
WARNING: net/core/dev.c:12773 at unregister_netdevice_many_notify+0x13e5/0x1940, CPU#3: ip/216
kernfs: can not remove 'upper_amtg2', no directory
WARNING: fs/kernfs/dir.c:1784 at kernfs_remove_by_name_ns+0xc9/0xd0, CPU#0: ip/216
WARNING: net/core/rtnetlink.c:141 at __rtnl_unlock+0xb2/0xf0, CPU#0: ip/216
WARNING: net/core/rtnetlink.c:141 at __rtnl_unlock+0xb2/0xf0, CPU#0: ip/216
With it, the commands log nothing and remove both amt devices, and
tools/testing/selftests/net/amt.sh passes on a KASAN and lockdep
kernel.
Found by a selftest for our upcoming AMT offload RFC, which deletes a
lower carrying two amt gateways, on our 6.18-based driver. The
commands above reproduce it on net.
Fixes: b9022b53adad ("amt: add control plane of amt interface")
Signed-off-by: Omar Ramadan <omar@blockcast.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261105232302.494171-1-omar@blockcast.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/amt.c | 56 ++++++++++++++++++++---------------------------
1 file changed, 24 insertions(+), 32 deletions(-)
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index faa21015b34de..1b6759dc846d7 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -3394,22 +3394,6 @@ static struct rtnl_link_ops amt_link_ops __read_mostly = {
.fill_info = amt_fill_info,
};
-static struct net_device *amt_lookup_upper_dev(struct net_device *dev)
-{
- struct net_device *upper_dev;
- struct amt_dev *amt;
-
- for_each_netdev(dev_net(dev), upper_dev) {
- if (netif_is_amt(upper_dev)) {
- amt = netdev_priv(upper_dev);
- if (amt->stream_dev == dev)
- return upper_dev;
- }
- }
-
- return NULL;
-}
-
static int amt_device_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{
@@ -3419,26 +3403,34 @@ static int amt_device_event(struct notifier_block *unused,
LIST_HEAD(list);
int new_mtu;
- upper_dev = amt_lookup_upper_dev(dev);
- if (!upper_dev)
- return NOTIFY_DONE;
- amt = netdev_priv(upper_dev);
+ /* amt_dellink() leaves each device on the netns device list until
+ * unregister_netdevice_many(), so the walk stays valid.
+ */
+ for_each_netdev(dev_net(dev), upper_dev) {
+ if (!netif_is_amt(upper_dev))
+ continue;
+ amt = netdev_priv(upper_dev);
+ if (amt->stream_dev != dev)
+ continue;
- switch (event) {
- case NETDEV_UNREGISTER:
- amt_dellink(amt->dev, &list);
- unregister_netdevice_many(&list);
- break;
- case NETDEV_CHANGEMTU:
- if (amt->mode == AMT_MODE_RELAY)
- new_mtu = dev->mtu - AMT_RELAY_HLEN;
- else
- new_mtu = dev->mtu - AMT_GW_HLEN;
+ switch (event) {
+ case NETDEV_UNREGISTER:
+ amt_dellink(amt->dev, &list);
+ break;
+ case NETDEV_CHANGEMTU:
+ if (amt->mode == AMT_MODE_RELAY)
+ new_mtu = dev->mtu - AMT_RELAY_HLEN;
+ else
+ new_mtu = dev->mtu - AMT_GW_HLEN;
- dev_set_mtu(amt->dev, new_mtu);
- break;
+ dev_set_mtu(amt->dev, new_mtu);
+ break;
+ }
}
+ if (event == NETDEV_UNREGISTER)
+ unregister_netdevice_many(&list);
+
return NOTIFY_DONE;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0522/1005] net: ena: Keep the RX buffer mapped if skb allocation fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (520 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 7.3 0521/1005] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0523/1005] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
` (476 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
[ Upstream commit 3e8e22a1007a6337ba2400b3ea87077947005c20 ]
We are seeing the following issue in production on arm64 EC2 hosts
(m8g.metal-24xl, 64K pages, SMMUv3 in strict mode, 6.18 based kernel).
Right after a global OOM, the SMMU reports F_TRANSLATION write faults
from the ENA device, followed by a burst of:
WARNING: CPU: 48 PID: 1656834 at drivers/iommu/dma-iommu.c:1242 iommu_dma_unmap_phys+0xf4/0x108
Call trace:
iommu_dma_unmap_phys+0xf4/0x108 (P)
dma_unmap_phys+0x194/0x2a8
dma_unmap_page_attrs+0x1c/0x38
ena_io_poll+0x7bc/0x1790 [ena]
__napi_poll+0x54/0x220
net_rx_action+0x250/0x520
ena_rx_skb() unmaps the RX buffer, or takes an extra page reference to
reuse it, before napi_build_skb() allocates the skb. If the allocation
fails, it returns NULL with rx_info->page still set. ena_clean_rx_irq()
then puts the req_id back on the free list, and ena_alloc_rx_buffer()
treats the buffer as still mapped and posts its old DMA address to the
device again.
With the IOMMU in strict mode, the device then writes to an unmapped
IOVA, and the next completion of that buffer unmaps it a second time.
If the IOVA was handed to a new mapping in between, the device can
write into that buffer instead. On the reuse path, the extra page
reference is never dropped.
Allocate the skb before touching rx_info, so that a failed allocation
leaves the buffer mapped and unchanged for the refill.
Fixes: 9e5269a915a8 ("net: ena: use build_skb() in RX path")
Fixes: f7d625adeb7b ("net: ena: Add dynamic recycling mechanism for rx buffers")
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20261109-ena-rx-skb-alloc-fail-v1-1-aee2927cb51f@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 7eb6456ed0d55..15e5cfeb0abe7 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1009,6 +1009,10 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
buf_len = SKB_DATA_ALIGN(len + buf_offset + tailroom);
+ skb = ena_alloc_skb(rx_ring, buf_addr, buf_len);
+ if (unlikely(!skb))
+ return NULL;
+
/* If XDP isn't loaded try to reuse part of the RX buffer */
reuse_rx_buf_page = !is_xdp_loaded &&
ena_try_rx_buf_page_reuse(rx_info, buf_len, len, pkt_offset);
@@ -1016,10 +1020,6 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
if (!reuse_rx_buf_page)
ena_unmap_rx_buff_attrs(rx_ring, rx_info, DMA_ATTR_SKIP_CPU_SYNC);
- skb = ena_alloc_skb(rx_ring, buf_addr, buf_len);
- if (unlikely(!skb))
- return NULL;
-
/* Populate skb's linear part */
skb_reserve(skb, buf_offset);
skb_put(skb, len);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0523/1005] net: ena: avoid RX copybreak for multi-descriptor packets
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (521 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0522/1005] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0524/1005] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
` (475 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit f3c790c34d228d46c4a05fe5d001d1bbea444e2b ]
ena_rx_skb() selects the copybreak path based on the first RX
descriptor's length without checking the number of descriptors. When
a packet spans multiple descriptors, this copies only the first
buffer into the skb and fails to recycle the remaining request IDs,
while RX cleanup advances by the full descriptor count.
Restrict copybreak to single-descriptor packets and apply the same
restriction to the rx_copybreak_pkt statistic. Multi-descriptor
packets then use the existing fragment-processing path.
Discovered by comparing the in-tree ENA driver with Amazon's
standalone ENA driver.
Compiled with W=1 under x86_64 defconfig.
Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20261109141343.920187-2-thnkslprpt@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 15e5cfeb0abe7..ecc6f1d827f9c 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -986,7 +986,7 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
page_offset = rx_info->page_offset;
buf_addr = page_address(rx_info->page) + page_offset;
- if (len <= rx_ring->rx_copybreak) {
+ if (len <= rx_ring->rx_copybreak && likely(descs == 1)) {
skb = ena_alloc_skb(rx_ring, NULL, len);
if (unlikely(!skb))
return NULL;
@@ -1293,7 +1293,8 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
skb_record_rx_queue(skb, rx_ring->qid);
- if (rx_ring->ena_bufs[0].len <= rx_ring->rx_copybreak)
+ if (rx_ring->ena_bufs[0].len <= rx_ring->rx_copybreak &&
+ ena_rx_ctx.descs == 1)
rx_copybreak_pkt++;
total_len += skb->len;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0524/1005] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (522 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0523/1005] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0525/1005] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
` (474 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+9ea34da5ca6100593c90,
Kalpesh Solanki, Willem de Bruijn, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kalpesh Solanki <skalpesh942@gmail.com>
[ Upstream commit 968f2b94a5964b75d9c0da84523e42530c1891f0 ]
A userspace application can set the link type of a TUN/TAP interface
to ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR, or ARPHRD_6LOWPAN
via ioctl(fd, TUNSETLINK, arg) because tun_get_addr_len() explicitly
recognized these types.
However, TUN devices cannot function as genuine IEEE 802.15.4 or 6LoWPAN
interfaces:
1. They lack wpan_phy, channels, PAN IDs, and MLME operations, and tun
never initializes dev->ieee802154_ptr or dev->ml_priv. When an
unprivileged user creates a TUN interface in a user+net namespace,
changes its link type to ARPHRD_IEEE802154, and issues a netlink dump
request (such as IEEE802154_LLSEC_LIST_KEY),
ieee802154_llsec_dump_table() unconditionally dereferences
dev->ieee802154_ptr / ieee802154_mlme_ops(dev), triggering a supervisor
null-pointer dereference / general protection fault. Similar
dereferences occur across net/ieee802154/nl-phy.c (ieee802154_del_iface)
and net/ieee802154/socket.c.
2. Similarly, the 6LoWPAN subsystem assumes via lowpan_dev(dev) that
netdev_priv(dev) is struct lowpan_dev. On a TUN device, netdev_priv(dev)
is struct tun_struct. On netdev events (such as NETDEV_DOWN in
net/6lowpan/core.c:lowpan_device_event), it clears bits in
lowpan_dev(dev)->ctx.table flags, which corrupts private memory inside
tun_struct.
Rather than scattering checks across subsystems, fix the issue at the
source: disallow setting ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR, and
ARPHRD_6LOWPAN via TUNSETLINK by returning -EINVAL. Cast arg to unsigned
short in the comparison to prevent upper-bit truncation bypasses (e.g.
arg = ARPHRD_IEEE802154 | 0x10000).
Fixes: ff4cc3ac93e1 ("[TUNTAP]: Allow setting the linktype of the tap device from userspace")
Reported-by: syzbot+9ea34da5ca6100593c90@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9ea34da5ca6100593c90
Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261109083037.22337-1-skalpesh942@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/tun.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 3cb2c87fa8137..092adb497dc76 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -3371,6 +3371,10 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
netif_info(tun, drv, tun->dev,
"Linktype set failed because interface is up\n");
ret = -EBUSY;
+ } else if ((unsigned short)arg == ARPHRD_IEEE802154 ||
+ (unsigned short)arg == ARPHRD_IEEE802154_MONITOR ||
+ (unsigned short)arg == ARPHRD_6LOWPAN) {
+ ret = -EINVAL;
} else {
ret = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
tun->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0525/1005] tls: fix async encryption race on weakly ordered architectures
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (523 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0524/1005] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0526/1005] net/mlx5: HWS, fix flow meter release on FTE update Greg Kroah-Hartman
` (473 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ofri Zangi, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ofri Zangi <ofriz@xsightlabs.com>
[ Upstream commit a2fd526d644233d6a892c28173f07c61e21e4c93 ]
With async encryption, a record can be transmitted without its TLS
header on weakly ordered architectures such as arm64, because the
consumer may observe rec->tx_ready set while still seeing the old
scatterlist entry.
tls_encrypt_done() restores the TLS header in the scatterlist entry
(sge->offset -= prot->prepend_size, sge->length += prot->prepend_size)
and then publishes the record with smp_store_mb(rec->tx_ready, true).
On another CPU, tls_tx_records() checks rec->tx_ready with READ_ONCE()
and then reads the entry in tls_push_sg().
Nothing orders these accesses. The barrier in smp_store_mb() comes
after the tx_ready store, so it does not order the earlier scatterlist
update before it. On the reader side, READ_ONCE() does not order the
later loads of sge->offset and sge->length. The reader can therefore
see tx_ready set together with the old offset and length, and pushes
the record without its header.
Publish tx_ready with smp_store_release() in tls_encrypt_done() and read
it with smp_load_acquire() in tls_tx_records(), so that observing
tx_ready guarantees the restored scatterlist entry is visible. Keep the
full barrier that smp_store_mb() provided as an explicit smp_mb(), as
it is still needed to order the tx_ready store before the tx_list head
check.
The issue was discovered during development on an arm64 system.
A curl download test over kTLS failed with:
curl: (56) OpenSSL SSL_read: error:0A00010B:SSL routines::wrong version number, errno 0
Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption of records for performance")
Signed-off-by: Ofri Zangi <ofriz@xsightlabs.com>
Link: https://patch.msgid.link/20261108-tls-async-tx-ordering-v1-1-f9a1844ca88e@xsightlabs.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tls/tls_sw.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 79639ed79821c..47e46547108e9 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -436,7 +436,8 @@ int tls_tx_records(struct sock *sk, int flags)
/* Tx all ready records */
list_for_each_entry_safe(rec, tmp, &ctx->tx_list, list) {
- if (READ_ONCE(rec->tx_ready)) {
+ /* Pairs with smp_store_release() in tls_encrypt_done() */
+ if (smp_load_acquire(&rec->tx_ready)) {
if (flags == -1)
tx_flags = rec->tx_flags;
else
@@ -504,8 +505,14 @@ static void tls_encrypt_done(void *data, int err)
if (rec) {
struct tls_rec *first_rec;
- /* Mark the record as ready for transmission */
- smp_store_mb(rec->tx_ready, true);
+ /* Mark the record as ready for transmission. Pairs with
+ * smp_load_acquire() in tls_tx_records(): the sge
+ * offset/length update above must be visible before tx_ready.
+ */
+ smp_store_release(&rec->tx_ready, true);
+
+ /* Order the tx_ready store before the tx_list head check */
+ smp_mb();
/* If received record is at head of tx_list, schedule tx */
first_rec = list_first_entry(&ctx->tx_list,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0526/1005] net/mlx5: HWS, fix flow meter release on FTE update
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (524 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0525/1005] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0527/1005] drm/xe/pm: Apply tile workarounds after PCODE initialization Greg Kroah-Hartman
` (472 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandre Cassen, Mark Bloch,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Cassen <acassen@corp.free.fr>
[ Upstream commit 145480b28ca82e9fae789427cc4569e596515a32 ]
HWS has no duplicate match. When a flower filter is replaced in place,
its new rule waits as the pending duplicate of the old FTE. Once the
old rule goes, switch_to_pending_act_dests() copies the pending actions
over the FTE before update_fte() releases the actions of the old rule.
An HWS rule reads the base id of its meter action through a pointer to
the exe_aso of the FTE. That release takes the meter action of the new
rule instead.
When the two meters sit in different ASO objects, the old meter action
leaks. It keeps its ASO object referenced. The firmware then fails to
destroy that object and to free the PD of the meters, and its STC is
still in the pool when the context closes. The new meter action is
destroyed one release early, while a rule still points to it, and the
last release underflows its refcount:
mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2641): DESTROY_GENERAL_OBJECT(0xa03) op_mod(0x24) failed, status bad resource(0x5), syndrome (0xeeda5c), err(-22)
refcount_t: underflow; use-after-free.
WARNING: lib/refcount.c:96 at refcount_dec_not_one+0x3f/0x60, CPU#43: tc/2641
Call Trace:
<TASK>
mlx5_fs_put_hws_action.part.0+0x1a/0xa0 [mlx5_core]
mlx5_fs_destroy_fs_actions+0xa8/0x110 [mlx5_core]
mlx5_cmd_hws_delete_fte+0x49/0x90 [mlx5_core]
del_hw_fte+0x209/0x320 [mlx5_core]
mlx5_del_flow_rules+0x10b/0x260 [mlx5_core]
__mlx5_eswitch_del_rule+0x5c/0x1b0 [mlx5_core]
mlx5_eswitch_del_offloaded_rule+0x10/0x20 [mlx5_core]
mlx5e_tc_rule_unoffload+0x4b/0x100 [mlx5_core]
mlx5e_tc_unoffload_fdb_rules+0x35/0x80 [mlx5_core]
mlx5e_tc_del_fdb_flow+0x2ca/0x310 [mlx5_core]
mlx5e_tc_del_flow+0x5d/0x2d0 [mlx5_core]
mlx5e_flow_put+0x3a/0x80 [mlx5_core]
mlx5e_delete_flower+0x291/0x460 [mlx5_core]
mlx5e_setup_tc_block_cb+0xc4/0x110 [mlx5_core]
tc_setup_cb_destroy+0xcc/0x1b0
fl_hw_destroy_filter+0xa1/0xe0 [cls_flower]
__fl_delete+0x2d0/0x3d0 [cls_flower]
fl_destroy+0xbd/0x160 [cls_flower]
tcf_proto_destroy+0x3b/0x110
tcf_proto_put+0x3d/0x70
tc_del_tfilter+0x362/0x8f0
rtnetlink_rcv_msg+0x384/0x460
netlink_rcv_skb+0x61/0x120
rtnetlink_rcv+0x15/0x30
netlink_unicast+0x2a1/0x3d0
netlink_sendmsg+0x237/0x490
____sys_sendmsg+0x33b/0x360
___sys_sendmsg+0x99/0xf0
__sys_sendmsg+0x93/0x100
__x64_sys_sendmsg+0x1d/0x30
x64_sys_call+0x821/0x23d0
do_syscall_64+0xba/0x550
entry_SYSCALL_64_after_hwframe+0x76/0x7e
</TASK>
mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2642): DEALLOC_PD(0x801) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0xef0c8a), err(-22)
mlx5_core 0000:b1:00.1: mlx5hws_pool_destroy:386:(pid 2642): Attempting to destroy non-empty pool
Keep the base id in the rule action, as the sampler id is.
Discovered while stress testing a 5G UPF kernel code. Without this fix,
the reproduction below gives the trace above on a ConnectX-7 with
firmware 28.48.1000. It only uses tc and devlink, with no kernel
change. 129 meters cannot fit in one ASO object. DEV is the uplink
representor and PCI its devlink handle:
r() { echo "filter $1 dev $DEV ingress prio 1 handle $2 protocol ip flower skip_sw dst_ip 10.0.0.$2 action police index $3 rate 1mbit burst 32k conform-exceed drop/pipe action drop"; }
devlink dev param set $PCI name flow_steering_mode value hmfs cmode runtime
devlink dev eswitch set $PCI mode switchdev
tc qdisc add dev $DEV ingress
for i in $(seq 129); do r add $i $i; done | tc -b -
r replace 1 1000 | tc -b -
tc filter del dev $DEV ingress prio 1
devlink dev eswitch set $PCI mode legacy
With this fix, the reproduction runs clean on the same ConnectX-7.
It was not tested against kernel selftests.
Fixes: 82d3639ef7dc ("net/mlx5: fs, add support for flow meters HWS action")
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20261110173437.2471233-1-acassen@corp.free.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c | 8 ++++----
.../net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
index d6958ba5dcc29..4b29d7183c4ad 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
@@ -523,13 +523,13 @@ mlx5_fs_get_action_aso_meter(struct mlx5_fs_hws_context *fs_ctx,
}
static void mlx5_fs_put_action_aso_meter(struct mlx5_fs_hws_context *fs_ctx,
- struct mlx5_exe_aso *exe_aso)
+ u32 base_id)
{
struct mlx5_fs_hws_data *meter_hws_data;
struct xarray *meters_xa;
meters_xa = &fs_ctx->hws_pool.aso_meters;
- meter_hws_data = xa_load(meters_xa, exe_aso->base_id);
+ meter_hws_data = xa_load(meters_xa, base_id);
if (!meter_hws_data)
return;
return mlx5_fs_put_hws_action(meter_hws_data);
@@ -704,7 +704,7 @@ static void mlx5_fs_destroy_fs_action(struct mlx5_flow_root_namespace *ns,
mlx5_fc_put_hws_action(fs_action->counter);
break;
case MLX5HWS_ACTION_TYP_ASO_METER:
- mlx5_fs_put_action_aso_meter(fs_ctx, fs_action->exe_aso);
+ mlx5_fs_put_action_aso_meter(fs_ctx, fs_action->aso_base_id);
break;
case MLX5HWS_ACTION_TYP_SAMPLER:
mlx5_fs_put_dest_action_sampler(fs_ctx, fs_action->sampler_id);
@@ -936,7 +936,7 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
fte_action->exe_aso.flow_meter.init_color;
(*ractions)[num_actions++].action = tmp_action;
fs_actions[num_fs_actions].action = tmp_action;
- fs_actions[num_fs_actions++].exe_aso = &fte_action->exe_aso;
+ fs_actions[num_fs_actions++].aso_base_id = fte_action->exe_aso.base_id;
}
if (fte_action->action & MLX5_FLOW_CONTEXT_ACTION_DROP) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.h
index cf068fb5bdbf9..4fdeea9fdd12d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.h
@@ -57,7 +57,7 @@ struct mlx5_fs_hws_rule_action {
struct mlx5hws_action *action;
union {
struct mlx5_fc *counter;
- struct mlx5_exe_aso *exe_aso;
+ u32 aso_base_id;
u32 sampler_id;
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0527/1005] drm/xe/pm: Apply tile workarounds after PCODE initialization
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (525 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0526/1005] net/mlx5: HWS, fix flow meter release on FTE update Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0528/1005] drm/xe/guc: Demote uncorrectable local error log on CRI Greg Kroah-Hartman
` (471 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Charles, Matt Roper,
Matthew Brost, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Charles <daniel.charles@intel.com>
[ Upstream commit a17c5ed0dc715d2e39d00e33372cb094209ac8ef ]
Tile workarounds program SoC registers through MMIO. Wait for PCODE
initialization to complete before applying them during system resume,
since MMIO access may be blocked until SoC initialization completes.
Also apply tile workarounds after PCODE initialization on D3cold runtime
resume, so their register settings are restored after power loss. Keep
both paths ordered before early GT resume.
Fixes: 0d0534750f9d ("drm/xe/wa: Apply tile workarounds at probe/resume")
Signed-off-by: Daniel Charles <daniel.charles@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20261103021418.654723-2-daniel.charles@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 641ffb2132839242e49a158d2aea579a75fa2e8e)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_pm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 06ff27641ad19..45a953c0a48f5 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -239,13 +239,13 @@ int xe_pm_resume(struct xe_device *xe)
drm_dbg(&xe->drm, "Resuming device\n");
trace_xe_pm_resume(xe, __builtin_return_address(0));
- for_each_tile(tile, xe, id)
- xe_wa_apply_tile_workarounds(tile);
-
err = xe_pcode_ready(xe, true);
if (err)
return err;
+ for_each_tile(tile, xe, id)
+ xe_wa_apply_tile_workarounds(tile);
+
for_each_gt(gt, xe, id)
xe_gt_idle_disable_c6(gt);
@@ -666,6 +666,7 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
*/
int xe_pm_runtime_resume(struct xe_device *xe)
{
+ struct xe_tile *tile;
struct xe_gt *gt;
u8 id;
int err = 0;
@@ -681,6 +682,9 @@ int xe_pm_runtime_resume(struct xe_device *xe)
if (err)
goto out;
+ for_each_tile(tile, xe, id)
+ xe_wa_apply_tile_workarounds(tile);
+
for_each_gt(gt, xe, id)
xe_gt_idle_disable_c6(gt);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0528/1005] drm/xe/guc: Demote uncorrectable local error log on CRI
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (526 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0527/1005] drm/xe/pm: Apply tile workarounds after PCODE initialization Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0529/1005] drm/xe/pf: Program LMTT directory pointer from each GTs init path Greg Kroah-Hartman
` (470 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejas Upadhyay, Matt Roper,
Varun Gupta, Matthew Brost, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Varun Gupta <varun.gupta@intel.com>
[ Upstream commit f831b84713b57cbd67f228a7f10147791e5ab13d ]
The UNCORRECTABLE_LOCAL_ERROR notification sent by the GuC indicates a
local, queue-level context termination rather than a global device or
driver failure. On CRI, due to a hardware limitation, the platform cannot
distinguish GT translation faults from true RAS conditions, meaning
standard workloads routinely trigger this error.
Printing this at ERROR level is too noisy and causes false-positive
dmesg-warn failures in CI. Demote the log level to debug for CRI.
v5:
- Correct commmit message and comment (Tejas)
v4:
- Change to _dbg instead of _info. (Matt)
v3:
- Limit the demotion to CRI and add comment explaining the HW limitation
(Rodrigo)
v2:
- Also ratelimit the GUC_ID_UNKNOWN to match the CAT error handler.
(Himal)
Fixes: 4e57574fa3a3 ("drm/xe/guc: Handle GuC local uncorrectable error notifications")
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Link: https://patch.msgid.link/20261106034804.2005214-2-varun.gupta@intel.com
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
(cherry picked from commit e305536554790e06876dd4e4f854c97d1353aa79)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_guc_submit.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 8124f9d7b44cb..dc4dba70612e4 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -3368,7 +3368,7 @@ int xe_guc_uncorrectable_error_handler(struct xe_guc *guc, u32 *msg, u32 len)
guc_id = msg[0];
if (guc_id == GUC_ID_UNKNOWN) {
- xe_gt_err(gt, "GuC: Uncorrectable local error with unknown GuC id\n");
+ xe_gt_err_ratelimited(gt, "GuC: Uncorrectable local error with unknown GuC id\n");
return 0;
}
@@ -3376,9 +3376,19 @@ int xe_guc_uncorrectable_error_handler(struct xe_guc *guc, u32 *msg, u32 len)
if (unlikely(!q))
return -EPROTO;
- xe_gt_err(gt,
- "GuC: Uncorrectable local error! guc_id=%d class=%s, logical_mask=0x%x",
- guc_id, xe_hw_engine_class_to_str(q->class), q->logical_mask);
+ /*
+ * On CRI, the hardware cannot distinguish GT translation faults
+ * from true RAS conditions. Demote to debug to avoid false
+ * positive hardware error logs.
+ */
+ if (gt_to_xe(gt)->info.platform == XE_CRESCENTISLAND)
+ xe_gt_dbg(gt,
+ "GuC: Uncorrectable local error! guc_id=%d class=%s, logical_mask=0x%x",
+ guc_id, xe_hw_engine_class_to_str(q->class), q->logical_mask);
+ else
+ xe_gt_err(gt,
+ "GuC: Uncorrectable local error! guc_id=%d class=%s, logical_mask=0x%x",
+ guc_id, xe_hw_engine_class_to_str(q->class), q->logical_mask);
trace_xe_guc_uncorrectable_error(q);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0529/1005] drm/xe/pf: Program LMTT directory pointer from each GTs init path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (527 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0528/1005] drm/xe/guc: Demote uncorrectable local error log on CRI Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0530/1005] drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule Greg Kroah-Hartman
` (469 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Satyanarayana K V P,
Piotr Piórkowski, Michał Winiarski, Stuart Summers,
Matt Roper, Matthew Brost, 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 3654a4d734df960d303d2494037606c72525c0a3 ]
The LMTT directory pointer is configured on every GT of the tile only
from the primary GT's init/reset flow. On new platforms, both primary and
media GTs have their own forcewake. Primary GT's init holds only its own
forcewake, so the media GT write can be lost.
Program the LMTT directory pointer from each GT's own init and restart
path, while that GT's forcewake is held.
Also use MCR registers for primary GT and unicast registers for media GT.
Fixes: ad69d62588cd ("drm/xe/pf: Program LMTT directory pointer on all GTs within a tile")
Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20261105114923.880265-4-satyanarayana.k.v.p@intel.com
(cherry picked from commit a8653bee6a0404e9962e80894eae0afab355cbd3)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/regs/xe_gt_regs.h | 1 +
drivers/gpu/drm/xe/xe_gt.c | 14 +++----
drivers/gpu/drm/xe/xe_lmtt.c | 58 +++++++++++++++++++++-------
drivers/gpu/drm/xe/xe_lmtt.h | 5 ++-
4 files changed, 55 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
index 247a736a54aaa..f8c14a7f92747 100644
--- a/drivers/gpu/drm/xe/regs/xe_gt_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
@@ -107,6 +107,7 @@
#define GAMSTLB_CTRL2 XE_REG_MCR(0x4788)
#define STLB_SINGLE_BANK_MODE REG_BIT(11)
+#define XE2_LMEM_CFG_MCR XE_REG_MCR(0x48b0)
#define XE2_LMEM_CFG XE_REG(0x48b0)
#define XE2_GAMWALK_CTRL 0x47e4
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index ca7f9b806bac9..2176254b10f2a 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -704,11 +704,10 @@ static int gt_init_with_all_forcewake(struct xe_gt *gt)
xe_gt_apply_ccs_mode(gt);
}
- if (IS_SRIOV_PF(gt_to_xe(gt)) && xe_gt_is_main_type(gt))
- xe_lmtt_init_hw(>_to_tile(gt)->sriov.pf.lmtt);
-
- if (IS_SRIOV_PF(gt_to_xe(gt)))
+ if (IS_SRIOV_PF(gt_to_xe(gt))) {
+ xe_lmtt_init_hw(gt);
xe_gt_sriov_pf_init_hw(gt);
+ }
/* Last action registered here so devres drains resets before teardown */
err = devm_add_action_or_reset(xe->drm.dev, gt_worker_disable, gt);
@@ -905,11 +904,10 @@ static int do_gt_restart(struct xe_gt *gt)
if (err)
return err;
- if (IS_SRIOV_PF(gt_to_xe(gt)) && xe_gt_is_main_type(gt))
- xe_lmtt_init_hw(>_to_tile(gt)->sriov.pf.lmtt);
-
- if (IS_SRIOV_PF(gt_to_xe(gt)))
+ if (IS_SRIOV_PF(gt_to_xe(gt))) {
+ xe_lmtt_init_hw(gt);
xe_gt_sriov_pf_init_hw(gt);
+ }
xe_mocs_init(gt);
diff --git a/drivers/gpu/drm/xe/xe_lmtt.c b/drivers/gpu/drm/xe/xe_lmtt.c
index 0c726eda93906..8a5a434931b04 100644
--- a/drivers/gpu/drm/xe/xe_lmtt.c
+++ b/drivers/gpu/drm/xe/xe_lmtt.c
@@ -12,7 +12,8 @@
#include "xe_assert.h"
#include "xe_bo.h"
-#include "xe_tlb_inval.h"
+#include "xe_gt.h"
+#include "xe_gt_mcr.h"
#include "xe_lmtt.h"
#include "xe_map.h"
#include "xe_mert.h"
@@ -21,6 +22,7 @@
#include "xe_sriov.h"
#include "xe_tile.h"
#include "xe_tile_sriov_printk.h"
+#include "xe_tlb_inval.h"
/**
* DOC: Local Memory Translation Table
@@ -210,14 +212,43 @@ int xe_lmtt_init(struct xe_lmtt *lmtt)
return err;
}
-static void lmtt_setup_dir_ptr(struct xe_lmtt *lmtt)
+static void lmtt_setup_dir_ptr_gt(struct xe_gt *gt, u32 config)
+{
+ struct xe_device *xe = gt_to_xe(gt);
+ struct xe_reg_mcr reg_mcr;
+ struct xe_reg reg;
+ u32 val_read;
+
+ if (GRAPHICS_VER(xe) < 20) {
+ reg = LMEM_CFG;
+ xe_mmio_write32(>->mmio, reg, config);
+ return;
+ }
+
+ if (xe_gt_is_main_type(gt)) {
+ reg_mcr = XE2_LMEM_CFG_MCR;
+ xe_gt_mcr_multicast_write(gt, reg_mcr, config);
+ val_read = xe_gt_mcr_unicast_read_any(gt, reg_mcr);
+ xe_gt_assert_msg(gt, val_read == config, "LMEM_CFG_MCR: %#x != %#x\n",
+ config, val_read);
+ } else {
+ reg = XE2_LMEM_CFG;
+ xe_mmio_write32(>->mmio, reg, config);
+
+ if (MEDIA_VER(xe) >= 35) {
+ val_read = xe_mmio_read32(>->mmio, reg);
+ xe_gt_assert_msg(gt, val_read == config, "LMEM_CFG: %#x != %#x\n",
+ config, val_read);
+ }
+ }
+}
+
+static void lmtt_setup_dir_ptr(struct xe_lmtt *lmtt, struct xe_gt *gt)
{
struct xe_tile *tile = lmtt_to_tile(lmtt);
struct xe_device *xe = tile_to_xe(tile);
dma_addr_t offset = xe_bo_main_addr(lmtt->pd->bo, XE_PAGE_SIZE);
- struct xe_gt *gt;
u32 config;
- u8 id;
lmtt_debug(lmtt, "DIR offset %pad\n", &offset);
lmtt_assert(lmtt, xe_bo_is_vram(lmtt->pd->bo));
@@ -225,31 +256,32 @@ static void lmtt_setup_dir_ptr(struct xe_lmtt *lmtt)
config = LMEM_EN | REG_FIELD_PREP(LMTT_DIR_PTR, offset / SZ_64K);
- for_each_gt_on_tile(gt, tile, id)
- xe_mmio_write32(>->mmio,
- GRAPHICS_VER(xe) >= 20 ? XE2_LMEM_CFG : LMEM_CFG,
- config);
+ lmtt_setup_dir_ptr_gt(gt, config);
- if (xe_device_has_mert(xe) && xe_tile_is_root(tile))
+ if (xe_device_has_mert(xe) && xe_tile_is_root(tile) &&
+ xe_gt_is_main_type(gt))
xe_mmio_write32(&tile->mmio, MERT_LMEM_CFG, config);
}
/**
* xe_lmtt_init_hw - Perform LMTT hardware initialization.
- * @lmtt: the &xe_lmtt to initialize
+ * @gt: the &xe_gt for which lmtt is initialized
*
* This function is a second step of the LMTT initialization.
- * This function registers LMTT Root Directory prepared in xe_lmtt_init().
+ * This function registers LMTT Root Directory prepared in xe_lmtt_init()
+ * on the given GT.
*
* This function shall be called after every hardware reset.
* This function shall be called only when running as a PF driver.
*/
-void xe_lmtt_init_hw(struct xe_lmtt *lmtt)
+void xe_lmtt_init_hw(struct xe_gt *gt)
{
+ struct xe_lmtt *lmtt = >_to_tile(gt)->sriov.pf.lmtt;
+
if (!lmtt->pd)
return;
- lmtt_setup_dir_ptr(lmtt);
+ lmtt_setup_dir_ptr(lmtt, gt);
}
static int lmtt_invalidate_hw(struct xe_lmtt *lmtt)
diff --git a/drivers/gpu/drm/xe/xe_lmtt.h b/drivers/gpu/drm/xe/xe_lmtt.h
index 8fa387b38c520..5ef065dd573c0 100644
--- a/drivers/gpu/drm/xe/xe_lmtt.h
+++ b/drivers/gpu/drm/xe/xe_lmtt.h
@@ -9,12 +9,13 @@
#include <linux/types.h>
struct xe_bo;
+struct xe_gt;
struct xe_lmtt;
struct xe_lmtt_ops;
#ifdef CONFIG_PCI_IOV
int xe_lmtt_init(struct xe_lmtt *lmtt);
-void xe_lmtt_init_hw(struct xe_lmtt *lmtt);
+void xe_lmtt_init_hw(struct xe_gt *gt);
void xe_lmtt_invalidate_hw(struct xe_lmtt *lmtt);
int xe_lmtt_prepare_pages(struct xe_lmtt *lmtt, unsigned int vfid, u64 range);
int xe_lmtt_populate_pages(struct xe_lmtt *lmtt, unsigned int vfid, struct xe_bo *bo, u64 offset);
@@ -23,7 +24,7 @@ u64 xe_lmtt_estimate_pt_size(struct xe_lmtt *lmtt, u64 size);
u64 xe_lmtt_page_size(struct xe_lmtt *lmtt);
#else
static inline int xe_lmtt_init(struct xe_lmtt *lmtt) { return 0; }
-static inline void xe_lmtt_init_hw(struct xe_lmtt *lmtt) { }
+static inline void xe_lmtt_init_hw(struct xe_gt *gt) { }
#endif
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0530/1005] drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (528 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0529/1005] drm/xe/pf: Program LMTT directory pointer from each GTs init path Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0531/1005] ALSA: hda/realtek - remove headphone MIC support for Dell Pro QC1255 Greg Kroah-Hartman
` (468 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dnyaneshwar Bhadane, Matt Roper,
Shekhar Chauhan, Matt Atwood, Gustavo Sousa, Matthew Brost,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo Sousa <gustavo.sousa@intel.com>
[ Upstream commit 557c7b4343781cae9725bf26122d29c26ea12f5d ]
Wa_16023105232 was extended in xe_wa_oob.rules to match extra IP
releases while the respective entry in xe_was[] was overlooked.
Update the latter to be in sync with the former.
Also add comments in the code so that we don't forget to update both
places if new IP versions are added.
Fixes: c96e0df4e9f5 ("drm/xe/xe3: Add support for media IP version 30.02")
Fixes: 4fde66699f1c ("drm/xe/xe3: Add support for graphics IP versions 30.04 & 30.05")
Cc: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Shekhar Chauhan <shekhar.chauhan@intel.com>
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
Link: https://patch.msgid.link/20261105-wa_16031259911-v3-2-da6ec790aa29@intel.com
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
(cherry picked from commit 0cfb54f8f4d69efc847641738d25065049160aca)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_wa.c | 5 +++--
drivers/gpu/drm/xe/xe_wa_oob.rules | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_wa.c b/drivers/gpu/drm/xe/xe_wa.c
index 139434946f8f8..0c847029437c5 100644
--- a/drivers/gpu/drm/xe/xe_wa.c
+++ b/drivers/gpu/drm/xe/xe_wa.c
@@ -579,8 +579,9 @@ static const struct xe_rtp_table_sr engine_was = XE_RTP_TABLE_SR(
XE_RTP_ACTIONS(SET(TDL_CHICKEN, QID_WAIT_FOR_THREAD_NOT_RUN_DISABLE))
},
{ XE_RTP_NAME("16023105232"),
- XE_RTP_RULES(MEDIA_VERSION_RANGE(1301, 3000), OR,
- GRAPHICS_VERSION_RANGE(2001, 3001)),
+ /* IP versions need to be in sync with the respective entry in xe_wa_oob.rules. */
+ XE_RTP_RULES(MEDIA_VERSION_RANGE(1301, 3002), OR,
+ GRAPHICS_VERSION_RANGE(2001, 3005)),
XE_RTP_ACTIONS(SET(RING_PSMI_CTL(0), RC_SEMA_IDLE_MSG_DISABLE,
XE_RTP_ACTION_FLAG(ENGINE_BASE)))
},
diff --git a/drivers/gpu/drm/xe/xe_wa_oob.rules b/drivers/gpu/drm/xe/xe_wa_oob.rules
index 6662987effd73..04eac463a261a 100644
--- a/drivers/gpu/drm/xe/xe_wa_oob.rules
+++ b/drivers/gpu/drm/xe/xe_wa_oob.rules
@@ -44,6 +44,7 @@
18013179988 GRAPHICS_VERSION(1255)
GRAPHICS_VERSION_RANGE(1270, 1274)
1508761755 GRAPHICS_VERSION(1255)
+# IP versions need to be in sync with the respective entry in xe_wa.c.
16023105232 GRAPHICS_VERSION_RANGE(2001, 3005)
MEDIA_VERSION_RANGE(1301, 3002)
16026508708 GRAPHICS_VERSION_RANGE(1200, 3005)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0531/1005] ALSA: hda/realtek - remove headphone MIC support for Dell Pro QC1255
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (529 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0530/1005] drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0532/1005] ALSA: hda/realtek: Update quirk for Acer Predator PHN16-72 Greg Kroah-Hartman
` (467 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kailang Yang, Takashi Iwai,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kailang Yang <kailang@realtek.com>
[ Upstream commit 1da5e525f0526a0b8e3b6c8c3208e6fad920f126 ]
This unit don't support headphone MIC.
The popping sound will disappear when you remove it.
Fixes: 97272a5704bf ("ALSA: hda/realtek - Fixed Headphone noise issue for Dell QCM1255")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Link: https://lore.kernel.org/3c8129fbfa6d4ee2b464735f2f31dffa@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/codecs/realtek/alc269.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index a54cd3ebaa5cd..6e62886795d8d 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -4436,7 +4436,6 @@ enum {
ALC256_FIXUP_HONOR_MRB_XXX_M1020_AUDIO,
ALC245_FIXUP_HP_ENVY_X360_15_FH0XXX,
ALC287_FIXUP_ACER_MICMUTE_LED,
- ALC236_FIXUP_DELL_HP_POP_NOISE,
ALC274_FIXUP_HP_89E9_GPIO,
ALC274_FIXUP_HP_VERBS,
ALC287_FIXUP_AW88399_I2C_2,
@@ -7226,12 +7225,6 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC2XX_FIXUP_HEADSET_MIC,
},
- [ALC236_FIXUP_DELL_HP_POP_NOISE] = {
- .type = HDA_FIXUP_FUNC,
- .v.func = alc285_fixup_invalidate_dacs,
- .chained = true,
- .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
- },
[ALC274_FIXUP_HP_89E9_GPIO] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc274_fixup_hp_89e9_amp,
@@ -7469,12 +7462,12 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x0cc3, "Dell Oasis 14 Low Weight MTL-U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cc4, "Dell Oasis 16 MTL-H/U", ALC289_FIXUP_DELL_CS35L41_SPI_2),
SND_PCI_QUIRK(0x1028, 0x0cc5, "Dell Oasis 14", ALC289_FIXUP_RTK_AMP_DUAL_SPK),
- SND_PCI_QUIRK(0x1028, 0x0d56, "Dell Pro Tower QCT1255", ALC236_FIXUP_DELL_HP_POP_NOISE),
- SND_PCI_QUIRK(0x1028, 0x0d58, "Dell Pro Micro QCM1255", ALC236_FIXUP_DELL_HP_POP_NOISE),
- SND_PCI_QUIRK(0x1028, 0x0d5a, "Dell Pro Slim QCS1255", ALC236_FIXUP_DELL_HP_POP_NOISE),
- SND_PCI_QUIRK(0x1028, 0x0e6b, "Dell Pro Tower QCT1255", ALC236_FIXUP_DELL_HP_POP_NOISE),
- SND_PCI_QUIRK(0x1028, 0x0e6c, "Dell Pro Slim QCS1255", ALC236_FIXUP_DELL_HP_POP_NOISE),
- SND_PCI_QUIRK(0x1028, 0x0e6d, "Dell Pro Micro QCM1255", ALC236_FIXUP_DELL_HP_POP_NOISE),
+ SND_PCI_QUIRK(0x1028, 0x0d56, "Dell Pro Tower QCT1255", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1028, 0x0d58, "Dell Pro Micro QCM1255", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1028, 0x0d5a, "Dell Pro Slim QCS1255", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1028, 0x0e6b, "Dell Pro Tower QCT1255", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1028, 0x0e6c, "Dell Pro Slim QCS1255", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1028, 0x0e6d, "Dell Pro Micro QCM1255", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0532/1005] ALSA: hda/realtek: Update quirk for Acer Predator PHN16-72
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (530 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0531/1005] ALSA: hda/realtek - remove headphone MIC support for Dell Pro QC1255 Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0533/1005] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
` (466 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fa-Iz Faadhillah Ibrahim,
Takashi Iwai, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fa-Iz Faadhillah Ibrahim <faiz.faadhillah@gmail.com>
[ Upstream commit a2dac609bfcc395a8c2e87d3ba1fc26ac50811d0 ]
The Acer Predator PHN16-72 (1025:1731) uses the ALC245 codec, but its
mic-mute LED is not enabled by default. Replace the existing quirk with
ALC245_FIXUP_ACER_MICMUTE_LED quirk to enable the mic-mute LED chain the
existing ALC2XX_FIXUP_HEADSET_MIC quirk.
Fixes: 34e08ad3a8da ("ALSA: hda/realtek: Add quirk for Acer Predator PHN16-72")
Signed-off-by: Fa-Iz Faadhillah Ibrahim <faiz.faadhillah@gmail.com>
Link: https://patch.msgid.link/20261111172108.30011-1-faiz.faadhillah@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 6e62886795d8d..c9b75def6732c 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -7363,7 +7363,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
SND_PCI_QUIRK(0x1025, 0x171e, "Acer Nitro ANV15-51", ALC245_FIXUP_ACER_MICMUTE_LED),
SND_PCI_QUIRK(0x1025, 0x172c, "Acer Nitro ANV16-41", ALC2XX_FIXUP_HEADSET_MIC),
- SND_PCI_QUIRK(0x1025, 0x1731, "Acer Predator PHN16-72", ALC2XX_FIXUP_HEADSET_MIC),
+ SND_PCI_QUIRK(0x1025, 0x1731, "Acer Predator PHN16-72", ALC245_FIXUP_ACER_MICMUTE_LED),
SND_PCI_QUIRK(0x1025, 0x173a, "Acer Swift SFG14-73", ALC245_FIXUP_ACER_MICMUTE_LED),
SND_PCI_QUIRK(0x1025, 0x173b, "Acer Swift SFG16-72", ALC245_FIXUP_ACER_MICMUTE_LED),
SND_PCI_QUIRK(0x1025, 0x1758, "Acer Nitro ANV15-41", ALC245_FIXUP_ACER_MICMUTE_LED),
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0533/1005] igmp: use the joined device when leaving a multicast group
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (531 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0532/1005] ALSA: hda/realtek: Update quirk for Acer Predator PHN16-72 Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0534/1005] net: Make PSP skb extension survive packet scrubbing Greg Kroah-Hartman
` (465 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Junyoung Jang, Hangbin Liu,
Ido Schimmel, Paolo Abeni, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junyoung Jang <graypanda.inzag@gmail.com>
[ Upstream commit 19ec8416a76c08326fe5f814410a1b43046e63be ]
When a socket joins a multicast group, the ifindex of the device is
stored in the socket's membership entry. When leaving,
ip_mc_leave_group() resolves the device again from the request. If the
request only specifies an interface address and that address is not
assigned to any device, no device is found. The membership is still
matched by address and removed from the socket, but the group is not
released on the device it was joined on.
The group is then leaked on the device until the device is unregistered.
An unprivileged user can trigger this by joining with an ifindex and a
non-local address and leaving with the address only. It can also happen
when a socket joins and leaves with the address only and the address is
removed in between.
Fix by resolving the device from the ifindex stored in the membership,
like ip_mc_drop_socket() does.
Fixes: 4eba7bb1d72d ("ipv4: igmp: Allow removing groups from a removed interface")
Signed-off-by: Junyoung Jang <graypanda.inzag@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261109125312.2208874-1-graypanda.inzag@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/igmp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index d56355aca7977..4221f2b9c658b 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2463,6 +2463,8 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)
iml->multi.imr_address.s_addr)
continue;
+ /* The drop request may not resolve to the joined device. */
+ in_dev = inetdev_by_index(net, iml->multi.imr_ifindex);
(void) ip_mc_leave_src(sk, iml, in_dev);
*imlp = iml->next_rcu;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0534/1005] net: Make PSP skb extension survive packet scrubbing
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (532 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0533/1005] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0535/1005] sched_ext: Reject DSQ iterator kfuncs in tracing programs Greg Kroah-Hartman
` (464 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Zahka, Jakub Sitnicki,
Wei Wang, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Wang <weiwan@google.com>
[ Upstream commit b22268fc3ddc1e634daf177e53b04e96fa58c330 ]
skb_scrub_packet() drops all skb extensions unconditionally via
skb_ext_reset(). It runs on tunnel encap/decap (ip_tunnel_rcv, vxlan_rcv,
etc.) and virtual device forwarding/redirection (dev_forward_skb,
netkit_xmit, skb_do_redirect).
When a virtual device such as netkit is associated with a PSP device in
another network namespace via PSP_CMD_DEV_ASSOC, incoming PSP packets
decapsulated by psp_dev_rcv() lose their SKB_EXT_PSP extension when
scrubbed during redirection into the peer netns. Without SKB_EXT_PSP,
__psp_sk_rx_policy_check() rejects incoming TCP data segments at the
socket layer with SKB_DROP_REASON_PSP_INPUT.
Introduce a static skb_ext_scrub() helper in net/core/skbuff.c to
preserve SKB_EXT_PSP across skb_scrub_packet() while dropping all other
extensions. If SKB_EXT_PSP is not active, skb_ext_scrub() simply calls
skb_ext_reset(). If SKB_EXT_PSP is the only extension in the skb_ext
buffer, nothing needs to be scrubbed. Otherwise, save the PSP metadata,
reset the extension block, and re-add a fresh SKB_EXT_PSP extension.
Fixes: 06c2dce2d0f6 ("psp: add new netlink cmd for dev-assoc and dev-disassoc")
Link: https://lore.kernel.org/r/20260910-bpf-meta-inside-skb-ext-v2-3-0b21e42180b0@cloudflare.com
Reported-by: Daniel Zahka <daniel.zahka@gmail.com>
Closes: https://lore.kernel.org/netdev/DLODSKPY6ON6.1G6SP3CFFLCPJ@gmail.com/
Co-developed-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Wei Wang <weiwan@google.com>
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20261106182007.374660-2-weiwan@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/skbuff.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 892ab589ad396..e685964654df5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6311,6 +6311,31 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
}
EXPORT_SYMBOL(skb_try_coalesce);
+static void skb_ext_scrub(struct sk_buff *skb)
+{
+#if IS_ENABLED(CONFIG_INET_PSP)
+ struct psp_skb_ext *pse = skb_ext_find(skb, SKB_EXT_PSP);
+
+ if (pse) {
+ struct skb_ext *ext = skb->extensions;
+ struct psp_skb_ext tmp;
+
+ /* Nothing else to scrub if PSP is the only extension in ext. */
+ if (ext->chunks == SKB_EXT_CHUNKSIZEOF(*ext) +
+ skb_ext_type_len[SKB_EXT_PSP])
+ return;
+
+ tmp = *pse;
+ skb_ext_reset(skb);
+ pse = skb_ext_add(skb, SKB_EXT_PSP);
+ if (pse)
+ memcpy(pse, &tmp, sizeof(*pse));
+ return;
+ }
+#endif
+ skb_ext_reset(skb);
+}
+
/**
* skb_scrub_packet - scrub an skb
*
@@ -6322,7 +6347,8 @@ EXPORT_SYMBOL(skb_try_coalesce);
* operations.
* skb_scrub_packet can also be used to clean a skb before injecting it in
* another namespace (@xnet == true). We have to clear all information in the
- * skb that could impact namespace isolation.
+ * skb that could impact namespace isolation. Note that PSP skb extension is
+ * preserved across packet scrubbing by design.
*/
void skb_scrub_packet(struct sk_buff *skb, bool xnet)
{
@@ -6330,7 +6356,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
skb->skb_iif = 0;
skb->ignore_df = 0;
skb_dst_drop(skb);
- skb_ext_reset(skb);
+ skb_ext_scrub(skb);
nf_reset_ct(skb);
nf_reset_trace(skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0535/1005] sched_ext: Reject DSQ iterator kfuncs in tracing programs
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (533 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0534/1005] net: Make PSP skb extension survive packet scrubbing Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0536/1005] ice: dpll: serialize changes of the SyncE CGU registers Greg Kroah-Hartman
` (463 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tao Cui, Tejun Heo, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Cui <cuitao@kylinos.cn>
[ Upstream commit 700a332c3fe33014bbd5ae852d71ba679fc29e0a ]
bpf_iter_scx_dsq_next() and bpf_iter_scx_dsq_destroy() take the target
user DSQ's raw spinlock, but they are 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 the iterator kfuncs
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
bpf_iter_scx_dsq_new(dsq_id)
bpf_for_each(scx_dsq, p, dsq_id, 0)
bpf_iter_scx_dsq_next(it)
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 the two iterator kfuncs from tracing programs at verification
time. The kfuncs remain available to SCX struct_ops and syscall
programs. bpf_iter_scx_dsq_destroy() has no independent live
reproduction: its cursor only links into the DSQ after at least one
successful next(), which deadlocks in the same window first. It is
included for symmetry.
This extends the coverage of commit b07a7450f6ef ("sched_ext: Reject
rq-lock-taking kfuncs in tracing programs") and commit 4c2e0751d5e6
("sched_ext: Reject scx_bpf_destroy_dsq() in tracing programs").
Fixes: 650ba21b131e ("sched_ext: Implement DSQ iterator")
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/ext/ext.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index e0d3d73ef031f..ad782f3f37c8e 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -11316,8 +11316,10 @@ 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.
+ * scx_bpf_destroy_dsq() takes a user DSQ lock. So do
+ * bpf_iter_scx_dsq_next() and bpf_iter_scx_dsq_destroy(), the latter only
+ * after a successful next() has linked the cursor. 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
@@ -11334,6 +11336,8 @@ 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_ID_FLAGS(func, bpf_iter_scx_dsq_next, KF_ITER_NEXT | KF_RET_NULL)
+BTF_ID_FLAGS(func, bpf_iter_scx_dsq_destroy, KF_ITER_DESTROY)
BTF_KFUNCS_END(scx_kfunc_ids_no_tracing)
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0536/1005] ice: dpll: serialize changes of the SyncE CGU registers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (534 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0535/1005] sched_ext: Reject DSQ iterator kfuncs in tracing programs Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0537/1005] ice: dpll: set the SyncE divider only for the port driving the output Greg Kroah-Hartman
` (462 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ivan Vecera, Petr Oros,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Vecera <ivecera@redhat.com>
[ Upstream commit 0afbc079d87eb2ba86b396bb1be145ad679ec300 ]
All E825C PFs share the CGU registers R10 and R11. On dual complex E825
the second complex reaches the CGU of complex 0 through cgu_peer. RCLK pin
callbacks read, modify and write these registers under dpll_lock and the
pf->dplls.lock of their PF. ice_ptp_link_change() rewrites R10 under the
pf->dplls.lock of its PF only, so a link change on one PF can write back
a stale R10 and undo an RCLK pin change made by another PF.
Add a mutex to struct ice_adapter, which all E825C PFs share, and hold it
around these sequences.
Tested on GNR-D with dual complex E825, with a 2 to 4 ms delay after the
read of R10 in the link change path to widen the window. Toggling the
RCLK pin of one port while another port of the same complex went down
and up 143 times lost 120 of 86814 updates of the mux in R10 without
this patch, and none of 76992 with it.
Fixes: ad1df4f2d591 ("ice: dpll: Support E825-C SyncE and dynamic pin discovery")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Petr Oros <poros@redhat.com>
Link: https://patch.msgid.link/20261110094350.184185-2-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 | 2 ++
drivers/net/ethernet/intel/ice/ice_tspll.c | 4 ++--
6 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.c b/drivers/net/ethernet/intel/ice/ice_adapter.c
index 536923b6ae979..aa2d8addae5be 100644
--- a/drivers/net/ethernet/intel/ice/ice_adapter.c
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.c
@@ -72,6 +72,7 @@ static struct ice_adapter *ice_adapter_new(struct pci_dev *pdev)
spin_lock_init(&adapter->txq_ctx_lock);
for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
mutex_init(&adapter->cpi_phy_lock[i]);
+ mutex_init(&adapter->cgu_synce_lock);
refcount_set(&adapter->refcount, 1);
spin_lock_init(&adapter->ports.lock);
@@ -85,6 +86,7 @@ static void ice_adapter_free(struct ice_adapter *adapter)
WARN_ON(!list_empty(&adapter->ports.list));
for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
mutex_destroy(&adapter->cpi_phy_lock[i]);
+ mutex_destroy(&adapter->cgu_synce_lock);
cleanup_srcu_struct(&adapter->ports.srcu);
diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.h b/drivers/net/ethernet/intel/ice/ice_adapter.h
index c61bd645e460d..fd5585005d91b 100644
--- a/drivers/net/ethernet/intel/ice/ice_adapter.h
+++ b/drivers/net/ethernet/intel/ice/ice_adapter.h
@@ -41,6 +41,8 @@ struct ice_port_list {
* @txq_ctx_lock: Spinlock protecting access to the GLCOMM_QTX_CNTX_CTL register
* @cpi_phy_lock: Per-PHY mutex serializing CPI REQ/ACK transactions.
* Index 0 = PHY0, index 1 = PHY1. Used on E825C devices.
+ * @cgu_synce_lock: Mutex serializing changes of the CGU registers R10 and R11,
+ * which all PFs reach. Used on E825C devices.
* @ctrl_pf: Control PF of the adapter
* @ports: Ports list
* @index: 64-bit index cached for collision detection on 32bit systems
@@ -53,6 +55,8 @@ struct ice_adapter {
spinlock_t txq_ctx_lock;
/* Serialize CPI REQ/ACK transactions per PHY (E825C only) */
struct mutex cpi_phy_lock[ICE_E825_MAX_PHYS];
+ /* Serialize changes of the SyncE CGU registers (E825C only) */
+ struct mutex cgu_synce_lock;
struct ice_pf *ctrl_pf;
struct ice_port_list ports;
diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
index 85a74cd6ea1f3..bd162a0e7c305 100644
--- a/drivers/net/ethernet/intel/ice/ice_dpll.c
+++ b/drivers/net/ethernet/intel/ice/ice_dpll.c
@@ -2024,7 +2024,7 @@ ice_dpll_phase_offset_get(const struct dpll_pin *pin, void *pin_priv,
*
* DPLL subsystem callback. Set proper signals to recover clock from port.
*
- * Context: Called under pf->dplls.lock
+ * Context: Called under pf->dplls.lock, acquires adapter->cgu_synce_lock
* Return:
* * 0 - success
* * negative - error
@@ -2032,14 +2032,15 @@ ice_dpll_phase_offset_get(const struct dpll_pin *pin, void *pin_priv,
static int ice_dpll_synce_update_e825c(struct ice_hw *hw, bool ena,
u32 port_num, enum ice_synce_clk output)
{
+ struct ice_pf *pf = hw->back;
int err;
+ mutex_lock(&pf->adapter->cgu_synce_lock);
/* configure the mux to deliver proper signal to DPLL from the MUX */
err = ice_tspll_cfg_bypass_mux_e825c(hw, ena, port_num, output);
- if (err)
- return err;
-
- err = ice_tspll_cfg_synce_ethdiv_e825c(hw, output);
+ if (!err)
+ err = ice_tspll_cfg_synce_ethdiv_e825c(hw, output);
+ mutex_unlock(&pf->adapter->cgu_synce_lock);
if (err)
return err;
diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.h b/drivers/net/ethernet/intel/ice/ice_dpll.h
index 103ba3e490682..d882846f995d1 100644
--- a/drivers/net/ethernet/intel/ice/ice_dpll.h
+++ b/drivers/net/ethernet/intel/ice/ice_dpll.h
@@ -156,6 +156,7 @@ struct ice_dpll {
* txclk_notify_rwsem (read)
* -> pf->dplls.lock
* -> ctrl_pf->dplls.lock
+ * -> adapter->cgu_synce_lock
*
* - @lock serializes all DPLL state mutations on this PF. When the
* controlling PF's lock must also be taken (e.g. updating the shared
@@ -167,6 +168,9 @@ struct ice_dpll {
* dpll_*_change_ntf() calls. ice_dpll_deinit() takes the write side
* standalone (not nested under any other lock) to drain in-flight
* readers before pins and the TXC DPLL device are freed.
+ * - adapter->cgu_synce_lock serializes changes of the CGU registers R10 and
+ * R11. All E825C PFs reach one CGU, so @lock, which is per PF, does not
+ * cover them.
*/
struct ice_dplls {
struct kthread_worker *kworker;
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 2f8563eb6fb19..b15b02c03b933 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1365,7 +1365,9 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
break;
}
+ mutex_lock(&pf->adapter->cgu_synce_lock);
err = ice_tspll_cfg_synce_ethdiv_e825c(hw, clk_pin);
+ mutex_unlock(&pf->adapter->cgu_synce_lock);
if (active && err) {
dev_err_once(ice_pf_to_dev(pf),
"Failed to configure SyncE ETH divider for pin %d, err %d\n",
diff --git a/drivers/net/ethernet/intel/ice/ice_tspll.c b/drivers/net/ethernet/intel/ice/ice_tspll.c
index fd4b58eb9bc00..25227690418eb 100644
--- a/drivers/net/ethernet/intel/ice/ice_tspll.c
+++ b/drivers/net/ethernet/intel/ice/ice_tspll.c
@@ -680,7 +680,7 @@ int ice_tspll_bypass_mux_active_e825c(struct ice_hw *hw, u8 port, bool *active,
*
* Set reference clock source and output clock selection.
*
- * Context: Called under pf->dplls.lock
+ * Context: Called under pf->dplls.lock and adapter->cgu_synce_lock
* Return:
* * 0 - success
* * negative - error
@@ -786,7 +786,7 @@ static int ice_tspll_get_div_e825c(u16 link_speed, unsigned int *divider)
*
* Set the correct CGU divider for RCLKA or RCLKB.
*
- * Context: Called under pf->dplls.lock
+ * Context: Called under pf->dplls.lock and adapter->cgu_synce_lock
* Return:
* * 0 - success
* * negative - error
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0537/1005] ice: dpll: set the SyncE divider only for the port driving the output
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (535 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0536/1005] ice: dpll: serialize changes of the SyncE CGU registers Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0538/1005] net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload Greg Kroah-Hartman
` (461 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ivan Vecera, Petr Oros,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Vecera <ivecera@redhat.com>
[ Upstream commit 164721e16b822c3b2f19526ff00deaa7b47fbf46 ]
R10 holds one divider for each recovered clock output, shared by all
ports. ice_ptp_link_change() sets it from the link speed of its own port
even when another port drives the output, and checks the mux only to
decide whether an error is worth reporting. With ports running at
different speeds, a link change on one port leaves the output of another
port with a wrong divider.
Skip the outputs that the port does not drive, and check the mux under
cgu_synce_lock, so that another PF cannot select its port in between.
The check computes the mux value as port % ports_per_phy + 3, while
ice_tspll_cfg_bypass_mux_e825c() and ice_dpll_rclk_update_e825c() use
port + 3. With the skip, a port from ports_per_phy up would never update
the divider, so use port + 3 as they do.
Tested on GNR-D with dual complex E825. With the RCLK pin of one port
connected, five down and up cycles of another port of the same complex
called ice_tspll_cfg_synce_ethdiv_e825c() 20 times without this patch
and never with it. Five cycles of the port driving the output still
called it 10 times. Both ports ran at 25 Gb/s, so the divider value did
not change on this setup.
Fixes: ad1df4f2d591 ("ice: dpll: Support E825-C SyncE and dynamic pin discovery")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Petr Oros <poros@redhat.com>
Link: https://patch.msgid.link/20261110094350.184185-3-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 10 +++++++---
drivers/net/ethernet/intel/ice/ice_tspll.c | 4 ++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index b15b02c03b933..07c315f3f5a1d 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -1347,6 +1347,7 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
int pin, err;
mutex_lock(&pf->dplls.lock);
+ mutex_lock(&pf->adapter->cgu_synce_lock);
for (pin = 0; pin < ICE_SYNCE_CLK_NUM; pin++) {
enum ice_synce_clk clk_pin;
bool active;
@@ -1365,16 +1366,19 @@ void ice_ptp_link_change(struct ice_pf *pf, bool linkup)
break;
}
- mutex_lock(&pf->adapter->cgu_synce_lock);
+ /* The divider is shared, set it only for our port */
+ if (!active)
+ continue;
+
err = ice_tspll_cfg_synce_ethdiv_e825c(hw, clk_pin);
- mutex_unlock(&pf->adapter->cgu_synce_lock);
- if (active && err) {
+ if (err) {
dev_err_once(ice_pf_to_dev(pf),
"Failed to configure SyncE ETH divider for pin %d, err %d\n",
pin, err);
break;
}
}
+ mutex_unlock(&pf->adapter->cgu_synce_lock);
mutex_unlock(&pf->dplls.lock);
if (linkup)
diff --git a/drivers/net/ethernet/intel/ice/ice_tspll.c b/drivers/net/ethernet/intel/ice/ice_tspll.c
index 25227690418eb..b4773e9b64dd3 100644
--- a/drivers/net/ethernet/intel/ice/ice_tspll.c
+++ b/drivers/net/ethernet/intel/ice/ice_tspll.c
@@ -634,6 +634,7 @@ int ice_tspll_init(struct ice_hw *hw)
*
* Check if given port is selected as recovered clock source for given output.
*
+ * Context: Called under pf->dplls.lock and adapter->cgu_synce_lock
* Return:
* * 0 - success
* * negative - error
@@ -662,8 +663,7 @@ int ice_tspll_bypass_mux_active_e825c(struct ice_hw *hw, u8 port, bool *active,
return -EINVAL;
}
- if (active_clk == port % hw->ptp.ports_per_phy +
- ICE_CGU_BYPASS_MUX_OFFSET_E825C)
+ if (active_clk == port + ICE_CGU_BYPASS_MUX_OFFSET_E825C)
*active = true;
else
*active = false;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0538/1005] net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (536 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0537/1005] ice: dpll: set the SyncE divider only for the port driving the output Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0539/1005] udp_tunnel: dont treat IPv4 sockets bound to an address as wildcard Greg Kroah-Hartman
` (460 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xuanqiang Luo, Simon Horman,
Saeed Mahameed, Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
[ Upstream commit 343672bad64153e895d201ff6d3dfaf15c22682e ]
Since commit abed42f9cd80 ("net/mlx5e: Conditionally create async
ICOSQ"), the async ICOSQ is only created when an XDP program is attached
or priv->ktls_rx_was_enabled is set. When TLS RX offload is enabled for
the first time, mlx5e_ktls_set_feature_rx() sets the flag and reopens
the channels so that they get the queue, but it ignores the return value
of mlx5e_safe_reopen_channels().
If the reopen fails, mlx5e_safe_switch_params() keeps the old channels,
which have no async ICOSQ, while NETIF_F_HW_TLS_RX is still reported as
enabled. The next offloaded RX connection then dereferences the NULL
c->async_icosq in post_rx_param_wqes(). Enabling the feature again does
not help, as the flag is already set and the reopen is skipped.
Propagate the error, clear the flag and destroy the accel TCP flow
tables again, so that the feature stays disabled and the next attempt
retries the reopen.
Fixes: abed42f9cd80 ("net/mlx5e: Conditionally create async ICOSQ")
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261110101709.2589088-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
index 337201f128958..3cc1213c2f682 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
@@ -139,7 +139,11 @@ int mlx5e_ktls_set_feature_rx(struct net_device *netdev, bool enable)
err = mlx5e_accel_fs_tcp_create(priv->fs);
if (!err && !priv->ktls_rx_was_enabled) {
priv->ktls_rx_was_enabled = true;
- mlx5e_safe_reopen_channels(priv);
+ err = mlx5e_safe_reopen_channels(priv);
+ if (err) {
+ priv->ktls_rx_was_enabled = false;
+ mlx5e_accel_fs_tcp_destroy(priv->fs);
+ }
}
} else {
mlx5e_accel_fs_tcp_destroy(priv->fs);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0539/1005] udp_tunnel: dont treat IPv4 sockets bound to an address as wildcard
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (537 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0538/1005] net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0540/1005] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
` (459 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Antonio Quartulli, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antonio Quartulli <antonio@mandelbit.com>
[ Upstream commit 612b8376e8112a6f9caaedc25fa48ac42e02826d ]
With IPv6 enabled, sk_saddr_any() checks sk_v6_rcv_saddr also for
AF_INET sockets, where it is always zero. An IPv4 tunnel socket bound to
a specific address (e.g. fou or geneve with "local") ends up in the GRO
lookup fast path, although another socket may bind the same port on a
different address: GRO then hands that socket's packets to the tunnel's
gro_receive.
Check the IPv6 address only for AF_INET6 sockets.
Fixes: a36283e2b683 ("udp_tunnel: create a fastpath GRO lookup.")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261110113306.3698438-1-antonio@mandelbit.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/udp_tunnel_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/udp_tunnel_core.c b/net/ipv4/udp_tunnel_core.c
index a128fe85620d3..29581c94fdcf8 100644
--- a/net/ipv4/udp_tunnel_core.c
+++ b/net/ipv4/udp_tunnel_core.c
@@ -62,10 +62,10 @@ EXPORT_SYMBOL(udp_sock_create4);
static bool sk_saddr_any(struct sock *sk)
{
#if IS_ENABLED(CONFIG_IPV6)
- return ipv6_addr_any(&sk->sk_v6_rcv_saddr);
-#else
- return !sk->sk_rcv_saddr;
+ if (sk->sk_family == AF_INET6)
+ return ipv6_addr_any(&sk->sk_v6_rcv_saddr);
#endif
+ return !sk->sk_rcv_saddr;
}
void setup_udp_tunnel_sock(struct net *net, struct sock *sk,
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0540/1005] net/mlx5: Lag, Return error when enabling MPESW without LAG support
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (538 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0539/1005] udp_tunnel: dont treat IPv4 sockets bound to an address as wildcard Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0541/1005] net: virtio: fix UDP tunnel GSO header of VLAN tagged packets Greg Kroah-Hartman
` (458 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Uri Dar, Shay Drori, Tariq Toukan,
Daniel Machon, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uri Dar <udar@nvidia.com>
[ Upstream commit a532a7049ba23edeb2e16f7bb5929314f2e47ca0 ]
When firmware reports a function as not LAG capable (lag_master=0 or
num_lag_ports < 2), mlx5_lag_add_mdev() creates no LAG object for it.
Enabling multiport E-Switch on such a device returns 0 from
mlx5_lag_mpesw_queue_work(), so
"devlink dev param set ... esw_multiport value true" reports success
although nothing was enabled, and a following "devlink dev param show"
still reports false.
Return -EOPNOTSUPP instead. mlx5_lag_mpesw_disable() ignores the return
value, so disabling keeps its current behavior.
Fixes: a32327a3a02c ("net/mlx5: Lag, Control MultiPort E-Switch single FDB mode")
Signed-off-by: Uri Dar <udar@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261110114350.2639891-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
index abf72026c7513..549d31812c2f9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
@@ -227,7 +227,7 @@ static int mlx5_lag_mpesw_queue_work(struct mlx5_core_dev *dev,
int err = 0;
if (!ldev)
- return 0;
+ return -EOPNOTSUPP;
work = kzalloc_obj(*work);
if (!work)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0541/1005] net: virtio: fix UDP tunnel GSO header of VLAN tagged packets
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (539 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0540/1005] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0542/1005] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
` (457 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, 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 9e244f94128a4b89004f0564b66e039e58318a34 ]
virtio_net_hdr_tnl_from_skb() builds a wrong header for VLAN tagged UDP
tunnel GSO packets.
1) When the skb carries a hwaccel VLAN tag, tun_put_user() inserts the
802.1Q header in the frame it copies to user space or vhost-net, and
passes vlan_hlen = VLAN_HLEN. virtio_net_hdr_from_skb() adds
vlan_hlen to csum_start, but inner_nh_offset and outer_th_offset do
not account for it, and are 4 bytes short of the real inner L3 and
outer UDP headers in the emitted frame.
tun advertises NETIF_F_HW_VLAN_CTAG_TX and NETIF_F_HW_VLAN_STAG_TX
in hw_enc_features, and its vlan_features keep the UDP tunnel GSO
features, so this happens for example with a VLAN filtering bridge
with a tagged port, or with a vlan device on top of a tap.
2) The outer family comes from skb->protocol, which is ETH_P_8021Q or
ETH_P_8021AD when the VLAN tag is in the packet data, so a packet
with an outer IPv6 header is reported as
VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4. This happens when
__vlan_hwaccel_push_inside() inserted the tag because the device does
not offload it: virtio_net never offloads VLAN insertion but keeps
UDP tunnel GSO in its vlan_features, and tun does the same with VLAN
TX offload disabled, or with QinQ (outer tag offloaded, inner tag in
the data).
The receiver sets inner_network_header and transport_header from these
offsets, and checks them with the wrong outer family. A forwarded
packet that gets segmented again uses the wrong inner headers, and a
receiver checking the outer headers against the virtio header drops
the packet.
Add vlan_hlen to both offsets like csum_start, and take the outer
family from vlan_get_protocol(), which skips VLAN tags in the data.
Fixes: a2fb4bc4e2a6 ("net: implement virtio helpers to handle UDP GSO tunneling.")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179421814766.994134.3669228181251158303@kernel.org/
Closes: https://lore.kernel.org/netdev/179433950084.994134.15100186606737698605@kernel.org/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261110213628.3476051-2-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/virtio_net.h | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index b7b6b542f4763..fc9667176f23c 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -622,7 +622,10 @@ virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb,
if (feature_hdrlen && hdr->hdr_len)
__virtio_net_set_tnl_hdrlen(skb, hdr);
- if (skb->protocol == htons(ETH_P_IPV6))
+ /* skb->protocol is the VLAN protocol when the tag is in the
+ * packet data.
+ */
+ if (vlan_get_protocol(skb) == htons(ETH_P_IPV6))
hdr->gso_type |= VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6;
else
hdr->gso_type |= VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4;
@@ -630,8 +633,11 @@ virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb,
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL_CSUM)
hdr->flags |= VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM;
- inner_nh = skb->inner_network_header - skb_headroom(skb);
- outer_th = skb->transport_header - skb_headroom(skb);
+ /* Like csum_start, the offsets must account for a VLAN tag
+ * the caller inserts in the frame.
+ */
+ inner_nh = skb->inner_network_header - skb_headroom(skb) + vlan_hlen;
+ outer_th = skb->transport_header - skb_headroom(skb) + vlan_hlen;
vhdr->inner_nh_offset = cpu_to_le16(inner_nh);
vhdr->outer_th_offset = cpu_to_le16(outer_th);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0542/1005] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (540 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0541/1005] net: virtio: fix UDP tunnel GSO header of VLAN tagged packets Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0543/1005] af_unix: Inherit SO_INQ in unix_stream_connect() Greg Kroah-Hartman
` (456 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kuniyuki Iwashima, 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 a9782a6f2bbd0c444689725a710d8b21eab61bc5 ]
When connection migration happens in tcp_v[46]_rcv(), a new
listener is passed to tcp_check_req().
When either of the following is true,
* the new listener queue is full and
net.ipv4.tcp_abort_on_overflow is set
* the packet has RST or (not stripped) SYN
tcp_check_req() sends RST and calls inet_csk_reqsk_queue_drop().
Here, the new listener is passed, and its qlen is decremented
wrongly while reqsk is tied to the old listener.
Once qlen underflows, inet_csk_reqsk_queue_is_full() always
return true, and the new listener stops serving.
Without the patch, this script times out while waiting for SYN+ACK
since the new listener drops SYN, but with the patch, 3WHS completes.
0 `sysctl -q net.ipv4.tcp_migrate_req=1`
+0 `sysctl -q net.ipv4.tcp_syncookies=0`
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
+0 bind(3, ..., ...) = 0
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
+0 setsockopt(4, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
+0 bind(4, ..., ...) = 0
+0 listen(4, 128) = 0
+0 < S 0:0(0) win 32792 <mss 1000>
+0 > S. 0:0(0) ack 1 <...>
+0 listen(3, 128) = 0
+0 close(4) = 0
+.01 < R 1:1(0) win 0
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 5
+0 listen(5, 1) = 0
+.01 < S 0:0(0) win 32792 <mss 1000>
+0 > S. 0:0(0) ack 1 <...>
+0 < . 1:1(0) ack 1 win 32792
+0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0 accept(3, ..., ...) = 6
Let's pass req->rsk_listener instead.
Fixes: d4f2c86b2b7e ("tcp: Migrate TCP_NEW_SYN_RECV requests at receiving the final ACK.")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261111020304.1532064-2-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_minisocks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 0ddfd5af6e58f..a05bb02e204c3 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -974,7 +974,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
tcp_reset(sk, skb);
}
if (!fastopen) {
- bool unlinked = inet_csk_reqsk_queue_drop(sk, req);
+ bool unlinked = inet_csk_reqsk_queue_drop(req->rsk_listener, req);
if (unlinked)
__NET_INC_STATS(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0543/1005] af_unix: Inherit SO_INQ in unix_stream_connect()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (541 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0542/1005] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0544/1005] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
` (455 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wenbo Sun, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
[ Upstream commit 0359338fd8cf1a2dc001d0cd69c331c17decee88 ]
When SO_INQ is enabled on a listening AF_UNIX SOCK_STREAM socket,
accepted sockets created by unix_stream_connect() do not inherit
u->recvmsg_inq from the listener, unlike TCP_INQ, AF_VSOCK SO_INQ,
and AF_UNIX SO_RIGHTS_NOTRUNC. As a result, recvmsg() on the
accepted socket never puts an SCM_INQ control message unless SO_INQ
is set again after accept().
Copy otheru->recvmsg_inq to newu->recvmsg_inq in
unix_stream_connect() using READ_ONCE() to pair with the lockless
WRITE_ONCE() in unix_setsockopt().
Found during LLM-assisted code review of unix_stream_connect() while
comparing option inheritance between SO_INQ and SO_RIGHTS_NOTRUNC.
Confirmed on UML (x86_64) by enabling SO_INQ on a listening AF_UNIX
SOCK_STREAM socket before listen() and accept(), sending data from a
connected client, and observing that recvmsg() on the accepted socket
returned no SCM_INQ control message.
Tested on UML (x86_64) against the reproducer, verifying that
recvmsg() on the accepted socket now returns the expected SCM_INQ
control message, and ran the tools/testing/selftests/net/af_unix/scm_inq
selftest (all 6 test cases passed).
Fixes: df30285b3670 ("af_unix: Introduce SO_INQ.")
Signed-off-by: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261111023222.77227-1-sunwenbo@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/unix/af_unix.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 42cffeafc8c14..6be50ef557d69 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1752,6 +1752,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr_unsized *uad
newu = unix_sk(newsk);
otheru = unix_sk(other);
newu->listener = other;
+ newu->recvmsg_inq = READ_ONCE(otheru->recvmsg_inq);
newu->scm_rights_notrunc = READ_ONCE(otheru->scm_rights_notrunc);
RCU_INIT_POINTER(newsk->sk_wq, &newu->peer_wq);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0544/1005] amt: use ipv6_hdr() in amt_mldv1_leave_handler()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (542 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0543/1005] af_unix: Inherit SO_INQ in unix_stream_connect() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0545/1005] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
` (454 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wenbo Sun, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
[ Upstream commit 6730fe495c35f174a424ab58cf5fdf99ce4746e9 ]
In amt_mldv1_leave_handler(), which handles IPv6 MLDv1 Done
(ICMPV6_MGM_REDUCTION) messages, the source address is mistakenly
extracted via ip_hdr(skb)->saddr into host.ip4 instead of copying the
IPv6 source address from ipv6_hdr(skb)->saddr into host.ip6 as
amt_mldv1_report_handler() does.
Because amt_lookup_group() compares the full union amt_addr for v6
groups, looking up the group with a 32-bit IPv4 header slice fails to
match the group entry created by amt_mldv1_report_handler(). As a
result, amt_del_group() is not called when an MLDv1 listener leaves,
and the AMT relay continues forwarding multicast traffic until the
group timer expires.
Use ipv6_hdr(skb) and copy ip6h->saddr into host.ip6 so that MLDv1
Done messages properly match and delete the corresponding IPv6 group.
This issue was found via LLM-assisted code review, confirmed by
reproducing the stale group forwarding in a User-Mode Linux (ARCH=um)
environment, and verified in UML by testing that AMT relay multicast
forwarding stops immediately after receiving an MLDv1 Done message.
Fixes: b75f7095d4d4 ("amt: add mld report message handler")
Signed-off-by: Wenbo Sun <sunwenbo@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261111031147.105834-1-sunwenbo@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/amt.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 1b6759dc846d7..4e51269de3ca6 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -2137,13 +2137,12 @@ static void amt_mldv1_leave_handler(struct amt_dev *amt, struct sk_buff *skb,
struct amt_tunnel_list *tunnel)
{
struct mld_msg *mld = (struct mld_msg *)icmp6_hdr(skb);
- struct iphdr *iph = ip_hdr(skb);
+ struct ipv6hdr *ip6h = ipv6_hdr(skb);
struct amt_group_node *gnode;
union amt_addr group, host;
memcpy(&group.ip6, &mld->mld_mca, sizeof(struct in6_addr));
- memset(&host, 0, sizeof(union amt_addr));
- host.ip4 = iph->saddr;
+ memcpy(&host.ip6, &ip6h->saddr, sizeof(struct in6_addr));
gnode = amt_lookup_group(tunnel, &group, &host, true);
if (gnode) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0545/1005] net: usb: cdc_ncm: dont underflow the NDP room check
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (543 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0544/1005] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0546/1005] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
` (453 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1994e2ecf323ed90f255,
Jiahao Xu, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiahao Xu <xujiahao@cmss.chinamobile.com>
[ Upstream commit b507828c7b6135ff7a4b69eba6e33502b4839fb9 ]
cdc_ncm_ndp16() and cdc_ncm_ndp32() verify that the new NDP and the
datagram fit into the NTB with an unsigned subtraction:
if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
return NULL;
Nothing guarantees that skb->len plus the reserve stays below
tx_curr_size, and when it does not the subtraction wraps around to a
huge value, the check passes, and the skb_put_zero() of max_ndp_size
bytes that follows overruns the NTB:
skbuff: skb_over_panic: text:ffff80000db33558 len:428 put:172
head:ffff0000c2c66100 tail:0x1ac end:0x140
kernel BUG at net/core/skbuff.c:200
skb_put_zero include/linux/skbuff.h:2595 [inline]
cdc_ncm_ndp16 drivers/net/usb/cdc_ncm.c:1132 [inline]
cdc_ncm_fill_tx_frame+0xdf0/0x30e0 drivers/net/usb/cdc_ncm.c:1309
Here tx_curr_size is 0x140 = 320, skb->len is already 256 and the
skb_put_zero() wants another 172 bytes.
Two device controlled settings make this reachable:
- dwNtbOutMaxSize = 320 caps tx_max at 320. The lower bound computed
in cdc_ncm_check_tx_max() is max_datagram_size + max_ndp_size + the
NTH header, but cdc_ncm_setup() clamps tx_max before
cdc_ncm_set_dgram_size() runs, so max_datagram_size is still 0 and
the bound is only max_ndp_size + the NTH header. It does not
reserve room for one datagram plus one NDP.
- wNdpOutAlignment = 256 is accepted by cdc_ncm_fix_modulus() as long
as it is smaller than tx_max, and cdc_ncm_align_tail() then pads the
12 byte NTH header up to 256 bytes right before this check.
An NDP can also be added to an NTB that already holds datagrams through
cdc_mbim_tx_fixup(), which uses a different signature per MBIM session.
On plain cdc_ncm the chain lookup in cdc_ncm_ndp16() returns the
existing NDP for the single signature, so there the create path is
normally reached for the first datagram of each NTB.
Rewrite the test as an addition, which cannot underflow and gives the
same answer whenever the original subtraction did not wrap.
Fixes: c78b7c586657 ("net: cdc_ncm: refactoring for tx multiplexing")
Fixes: 0fa81b304a79 ("cdc_ncm: Implement the 32-bit version of NCM Transfer Block")
Reported-by: syzbot+1994e2ecf323ed90f255@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1994e2ecf323ed90f255
Signed-off-by: Jiahao Xu <xujiahao@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261111124156.637661-1-xujiahao@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/usb/cdc_ncm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 3bd7cb66f3fc3..3c6ac561fe863 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1125,7 +1125,7 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm_ndp16(struct cdc_ncm_ctx *ctx, struct s
cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_curr_size);
/* verify that there is room for the NDP and the datagram (reserve) */
- if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
+ if (skb->len + reserve + ctx->max_ndp_size > ctx->tx_curr_size)
return NULL;
/* link to it */
@@ -1180,7 +1180,7 @@ static struct usb_cdc_ncm_ndp32 *cdc_ncm_ndp32(struct cdc_ncm_ctx *ctx, struct s
cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_curr_size);
/* verify that there is room for the NDP and the datagram (reserve) */
- if ((ctx->tx_curr_size - skb->len - reserve) < ctx->max_ndp_size)
+ if (skb->len + reserve + ctx->max_ndp_size > ctx->tx_curr_size)
return NULL;
/* link to it */
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0546/1005] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (544 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0545/1005] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0547/1005] net/mlx5e: Rename state_destroy to rx_mode_active in flow steering Greg Kroah-Hartman
` (452 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Leon Romanovsky,
Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit 5ed47bd79cebee8429d06c6640aac7ac7c4805ca ]
The mentioned commit introduced support for upper protocol selectors
(protocol & ports) to mlx5 IPsec offload. In crypto offload mode this
causes offloaded TX SAs to stop matching traffic.
In tx_add_rule(), setup_fte_upper_proto_match() is called for all
offload types and programs a match on the upper protocol (TCP/UDP) and
ports. For crypto offload, setup_fte_esp() is then called and sets
ip_protocol to ESP. The resulting rule requires both ESP as the IP
protocol and TCP/UDP ports, which no packet can satisfy, so TX crypto
offload silently stops working for such SAs.
In crypto offload mode the stack builds the ESP packet and the HW only
encrypts it, so the SA rule should only match on the SPI. Move the
setup_fte_upper_proto_match() call under the XFRM_DEV_OFFLOAD_PACKET
case, where the rule matches the plaintext packet and upper protocol
selectors apply.
The other three callers are unaffected: rx_add_rule_sa_selector() is
already only invoked for packet offload, and tx_add_policy() /
rx_add_policy() are only reachable in packet offload mode, since xfrm
policy offload is exclusively of type XFRM_DEV_OFFLOAD_PACKET.
Fixes: a7385187a386 ("net/mlx5e: IPsec, support upper protocol selector field offload")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261111081337.3129580-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
index 55de9abbd72be..5c69e89b13a72 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -2194,7 +2194,6 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
}
setup_fte_no_frags(spec);
- setup_fte_upper_proto_match(spec, &attrs->upspec);
switch (attrs->type) {
case XFRM_DEV_OFFLOAD_CRYPTO:
@@ -2207,6 +2206,7 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry)
setup_fte_reg_a(spec);
break;
case XFRM_DEV_OFFLOAD_PACKET:
+ setup_fte_upper_proto_match(spec, &attrs->upspec);
setup_fte_reg_c4(spec, attrs->reqid);
err = setup_pkt_reformat(ipsec, attrs, &flow_act);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0547/1005] net/mlx5e: Rename state_destroy to rx_mode_active in flow steering
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (545 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0546/1005] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0548/1005] net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure Greg Kroah-Hartman
` (451 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Lazar, Shahar Shitrit,
Tariq Toukan, Joe Damato, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Lazar <alazar@nvidia.com>
[ Upstream commit cdcb648a97ebc247eea3a9a7d15916613f640527 ]
This flag controls the enablement of RX mode handling (promisc,
allmulti, broadcast, netdev addr sync). It acts as a safeguard
that prevents new FS (flow steering) operations during device
teardown. When the device is in destroying state it is set to
false to indicate RX mode operations are not allowed.
Its name is misleading, as it suggests a destroy-state flag
rather than RX mode activity. Rename it for clarity.
No functional change.
Signed-off-by: Alexei Lazar <alazar@nvidia.com>
Reviewed-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20261011093100.769149-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 3962ded998c1 ("net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 5 +++--
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 17 +++++++++--------
.../net/ethernet/mellanox/mlx5/core/en_main.c | 15 +++++++++------
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
index 4973fb473ff02..aa370227b7bcc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
@@ -158,7 +158,7 @@ void mlx5e_destroy_flow_steering(struct mlx5e_flow_steering *fs, bool ntuple,
struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
struct mlx5_core_dev *mdev,
- bool state_destroy,
+ bool rx_mode_active,
struct dentry *dfs_root);
void mlx5e_fs_cleanup(struct mlx5e_flow_steering *fs);
struct mlx5e_vlan_table *mlx5e_fs_get_vlan(struct mlx5e_flow_steering *fs);
@@ -198,7 +198,8 @@ void mlx5e_fs_set_udp(struct mlx5e_flow_steering *fs, struct mlx5e_fs_udp *udp);
struct mlx5e_accel_fs_tcp *mlx5e_fs_get_accel_tcp(struct mlx5e_flow_steering *fs);
void mlx5e_fs_set_accel_tcp(struct mlx5e_flow_steering *fs, struct mlx5e_accel_fs_tcp *accel_tcp);
#endif
-void mlx5e_fs_set_state_destroy(struct mlx5e_flow_steering *fs, bool state_destroy);
+void mlx5e_fs_set_rx_mode_active(struct mlx5e_flow_steering *fs,
+ bool rx_mode_active);
void mlx5e_fs_set_vlan_strip_disable(struct mlx5e_flow_steering *fs, bool vlan_strip_disable);
struct mlx5_core_dev *mlx5e_fs_get_mdev(struct mlx5e_flow_steering *fs);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index 12492c4a5d410..c19238bc821fb 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -44,7 +44,7 @@
struct mlx5e_flow_steering {
struct work_struct set_rx_mode_work;
- bool state_destroy;
+ bool rx_mode_active;
bool vlan_strip_disable;
struct mlx5_core_dev *mdev;
struct mlx5_flow_namespace *ns;
@@ -560,7 +560,7 @@ static void mlx5e_del_vlan_rules(struct mlx5e_flow_steering *fs)
for_each_set_bit(i, fs->vlan->active_svlans, VLAN_N_VID)
mlx5e_fs_del_vlan_rule(fs, MLX5E_VLAN_RULE_TYPE_MATCH_STAG_VID, i);
- WARN_ON_ONCE(fs->state_destroy);
+ WARN_ON_ONCE(fs->rx_mode_active);
mlx5e_remove_vlan_trap(fs);
@@ -743,7 +743,7 @@ static void mlx5e_handle_netdev_addr(struct mlx5e_flow_steering *fs,
mlx5e_for_each_hash_node(hn, tmp, fs->l2.netdev_mc, i)
hn->action = MLX5E_ACTION_DEL;
- if (fs->state_destroy)
+ if (fs->rx_mode_active)
mlx5e_sync_netdev_addr(fs, netdev, uc, mc);
mlx5e_apply_netdev_addr(fs);
@@ -840,7 +840,7 @@ void mlx5e_fs_set_rx_mode_work(struct mlx5e_flow_steering *fs,
goto update_vport_context;
}
- bool rx_mode_enable = fs->state_destroy;
+ bool rx_mode_enable = fs->rx_mode_active;
bool promisc_enabled = rx_mode_enable && (netdev->flags & IFF_PROMISC);
bool allmulti_enabled = rx_mode_enable && (netdev->flags & IFF_ALLMULTI);
bool broadcast_enabled = rx_mode_enable;
@@ -1479,7 +1479,7 @@ static void mlx5e_fs_debugfs_init(struct mlx5e_flow_steering *fs,
struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
struct mlx5_core_dev *mdev,
- bool state_destroy,
+ bool rx_mode_active,
struct dentry *dfs_root)
{
struct mlx5e_flow_steering *fs;
@@ -1490,7 +1490,7 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
goto err;
fs->mdev = mdev;
- fs->state_destroy = state_destroy;
+ fs->rx_mode_active = rx_mode_active;
if (mlx5e_profile_feature_cap(profile, FS_VLAN)) {
err = mlx5e_fs_vlan_alloc(fs);
if (err)
@@ -1606,9 +1606,10 @@ void mlx5e_fs_set_accel_tcp(struct mlx5e_flow_steering *fs, struct mlx5e_accel_f
}
#endif
-void mlx5e_fs_set_state_destroy(struct mlx5e_flow_steering *fs, bool state_destroy)
+void mlx5e_fs_set_rx_mode_active(struct mlx5e_flow_steering *fs,
+ bool rx_mode_active)
{
- fs->state_destroy = state_destroy;
+ fs->rx_mode_active = rx_mode_active;
}
void mlx5e_fs_set_vlan_strip_disable(struct mlx5e_flow_steering *fs,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 77c54b1702a90..bda57b117250f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -6559,8 +6559,9 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
clear_bit(MLX5E_STATE_DESTROYING, &priv->state);
if (priv->fs)
- mlx5e_fs_set_state_destroy(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING, &priv->state));
+ mlx5e_fs_set_rx_mode_active(priv->fs,
+ !test_bit(MLX5E_STATE_DESTROYING,
+ &priv->state));
/* Validate the max_wqe_size_sq capability. */
if (WARN_ON_ONCE(mlx5e_get_max_sq_wqebbs(priv->mdev) < MLX5E_MAX_TX_WQEBBS)) {
@@ -6640,8 +6641,9 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
mlx5e_reset_channels(priv->netdev);
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
if (priv->fs)
- mlx5e_fs_set_state_destroy(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING, &priv->state));
+ mlx5e_fs_set_rx_mode_active(priv->fs,
+ !test_bit(MLX5E_STATE_DESTROYING,
+ &priv->state));
cancel_work_sync(&priv->update_stats_work);
return err;
}
@@ -6652,8 +6654,9 @@ void mlx5e_detach_netdev(struct mlx5e_priv *priv)
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
if (priv->fs)
- mlx5e_fs_set_state_destroy(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING, &priv->state));
+ mlx5e_fs_set_rx_mode_active(priv->fs,
+ !test_bit(MLX5E_STATE_DESTROYING,
+ &priv->state));
if (profile->disable)
profile->disable(priv);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0548/1005] net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (546 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0547/1005] net/mlx5e: Rename state_destroy to rx_mode_active in flow steering Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0549/1005] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
` (450 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Lazar, Gal Pressman,
Shahar Shitrit, Tariq Toukan, Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Lazar <alazar@nvidia.com>
[ Upstream commit 3962ded998c1df8a449fdf986f44f478e9c09675 ]
mlx5e_attach_netdev() sets rx_mode_active before calling init_rx(), so
any init_rx() failure after mlx5e_create_flow_steering() has succeeded
makes mlx5e_destroy_flow_steering() trip
WARN_ON_ONCE(fs->rx_mode_active) in mlx5e_del_vlan_rules().
Hit in internal regression testing, so kthread creation failed
with -EINTR:
WARNING: CPU: 3 PID: 170 at drivers/net/ethernet/mellanox/mlx5/core/en_fs.c:564 mlx5e_del_vlan_rules+0x295/0x2b0 [mlx5_core]
mlx5e_destroy_flow_steering+0x34/0xc0 [mlx5_core]
mlx5e_init_nic_rx+0x137/0x200 [mlx5_core]
mlx5e_attach_netdev+0x105/0x360 [mlx5_core]
Fix it by creating NIC flow steering with rx_mode_active cleared and
setting it only after profile->init_rx() succeeds. This also lets the
internal error paths of mlx5e_create_flow_steering() destroy partially
created steering without warning. The flag is set in
mlx5e_attach_netdev() rather than mlx5e_init_nic_rx() so that non-NIC
profiles, such as representors, also get it set after a detach/attach
cycle.
Fixes: 8c7353b6f716 ("net/mlx5e: Fix VLAN cleanup flow")
Signed-off-by: Alexei Lazar <alazar@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261111082142.3131746-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/mellanox/mlx5/core/en_main.c | 23 ++++++++-----------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index bda57b117250f..964d976c5c890 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -6039,9 +6039,7 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev,
priv->dfs_root = debugfs_create_dir("nic",
mlx5_debugfs_get_dev_root(mdev));
- fs = mlx5e_fs_init(priv->profile, mdev,
- !test_bit(MLX5E_STATE_DESTROYING, &priv->state),
- priv->dfs_root);
+ fs = mlx5e_fs_init(priv->profile, mdev, false, priv->dfs_root);
if (!fs) {
err = -ENOMEM;
mlx5_core_err(mdev, "FS initialization failed, %d\n", err);
@@ -6558,10 +6556,6 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
int err;
clear_bit(MLX5E_STATE_DESTROYING, &priv->state);
- if (priv->fs)
- mlx5e_fs_set_rx_mode_active(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING,
- &priv->state));
/* Validate the max_wqe_size_sq capability. */
if (WARN_ON_ONCE(mlx5e_get_max_sq_wqebbs(priv->mdev) < MLX5E_MAX_TX_WQEBBS)) {
@@ -6622,6 +6616,9 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
if (err)
goto err_cleanup_tx;
+ if (priv->fs)
+ mlx5e_fs_set_rx_mode_active(priv->fs, true);
+
if (profile->enable) {
err = profile->enable(priv);
if (err)
@@ -6633,6 +6630,10 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
return 0;
err_cleanup_rx:
+ if (priv->fs) {
+ mlx5e_fs_set_rx_mode_active(priv->fs, false);
+ cancel_work_sync(&priv->set_rx_mode_work);
+ }
profile->cleanup_rx(priv);
err_cleanup_tx:
profile->cleanup_tx(priv);
@@ -6640,10 +6641,6 @@ int mlx5e_attach_netdev(struct mlx5e_priv *priv)
out:
mlx5e_reset_channels(priv->netdev);
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
- if (priv->fs)
- mlx5e_fs_set_rx_mode_active(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING,
- &priv->state));
cancel_work_sync(&priv->update_stats_work);
return err;
}
@@ -6654,9 +6651,7 @@ void mlx5e_detach_netdev(struct mlx5e_priv *priv)
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
if (priv->fs)
- mlx5e_fs_set_rx_mode_active(priv->fs,
- !test_bit(MLX5E_STATE_DESTROYING,
- &priv->state));
+ mlx5e_fs_set_rx_mode_active(priv->fs, false);
if (profile->disable)
profile->disable(priv);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0549/1005] net: phy: c45: select BASE-T1 type for the forced speed
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (547 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0548/1005] net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0550/1005] tls: Break the connection after a burst of empty data records Greg Kroah-Hartman
` (449 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Iustin Stolniceanu, Andrew Lunn,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
[ Upstream commit df501db9b18fae4d3edd534b992675f4673a938e ]
Commit 25108a834e14 ("net: phy: c45: add support for 1000BASE-T1 forced
setup") made genphy_c45_pma_setup_forced() write the type selection
field (bits 3:0) of the BASE-T1 PMA/PMD control register (1.2100) on
every forced setup: 1000BASE-T1 for SPEED_1000, and 0 for everything
else. 0 selects 100BASE-T1, so forcing a 10BASE-T1L PHY to 10 Mbit/s
now also switches its PMA to 100BASE-T1, a mode it does not implement.
Seen on an ADIN1110 (internal ADIN1100 PHY): after
ethtool -s ethX autoneg off speed 10 master-slave forced-master
1.2100 reads 0xc000 instead of the 0xc002. Since the field is not
restored by re-enabling autoneg, the PHY keeps the wrong type until
the next forced setup or reset.
Add a helper that returns the type selection value for the forced speed
and the supported link modes: 100BASE-T1, 1000BASE-T1, and 10BASE-T1L or
10BASE-T1S for SPEED_10 depending on the supported 10 Mbit/s modes. Fail
with -EINVAL when no type matches instead of writing 100BASE-T1. This
also applies to forced 2.5G, 5G and 10G on BASE-T1 capable PHYs, for
which there are no link modes yet.
The field is called "type selection" in IEEE 802.3-2022 (45.2.1.214,
Table 45-178). Keep the old STRAP names as aliases.
Tested on EVAL-ADIN1110EBZ: with this change, forcing 10 Mbit/s writes
1.2100 = 0xc002 (10BASE-T1L) instead of the invalid 0xc000.
Fixes: 25108a834e14 ("net: phy: c45: add support for 1000BASE-T1 forced setup")
Signed-off-by: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20261111100053.345196-1-iustin.stolniceanu@analog.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/phy/phy-c45.c | 46 ++++++++++++++++++++++++++++++++++-----
include/uapi/linux/mdio.h | 13 +++++++++--
2 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 870920311f9a0..828af4c4e9d4c 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -104,6 +104,36 @@ int genphy_c45_pma_baset1_setup_master_slave(struct phy_device *phydev)
}
EXPORT_SYMBOL_GPL(genphy_c45_pma_baset1_setup_master_slave);
+/* Type selection value for the BASE-T1 PMA/PMD control register (1.2100,
+ * 802.3-2022 Table 45-178) matching the forced speed. 10 Mbit/s is ambiguous
+ * between 10BASE-T1L and 10BASE-T1S, so the supported link modes decide.
+ * 2.5G, 5G and 10GBASE-T1 are not handled as there are no link modes for them
+ * yet.
+ */
+static int genphy_c45_baset1_type_sel(struct phy_device *phydev)
+{
+ switch (phydev->speed) {
+ case SPEED_10:
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
+ phydev->supported))
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1L;
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_Full_BIT,
+ phydev->supported) ||
+ linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_Half_BIT,
+ phydev->supported) ||
+ linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT,
+ phydev->supported))
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1S;
+ return -EINVAL;
+ case SPEED_100:
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_100BT1;
+ case SPEED_1000:
+ return MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_1000BT1;
+ default:
+ return -EINVAL;
+ }
+}
+
/**
* genphy_c45_pma_setup_forced - configures a forced speed
* @phydev: target phy_device struct
@@ -166,6 +196,16 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
return -EINVAL;
}
+ /* Resolve the type before the first write, so a speed without a
+ * matching type leaves the PHY untouched.
+ */
+ bt1_ctrl = 0;
+ if (genphy_c45_baset1_able(phydev)) {
+ bt1_ctrl = genphy_c45_baset1_type_sel(phydev);
+ if (bt1_ctrl < 0)
+ return bt1_ctrl;
+ }
+
ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, ctrl1);
if (ret < 0)
return ret;
@@ -179,12 +219,8 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
if (ret < 0)
return ret;
- bt1_ctrl = 0;
- if (phydev->speed == SPEED_1000)
- bt1_ctrl = MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000;
-
ret = phy_modify_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_PMD_BT1_CTRL,
- MDIO_PMA_PMD_BT1_CTRL_STRAP, bt1_ctrl);
+ MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL, bt1_ctrl);
if (ret < 0)
return ret;
}
diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h
index 06f4bc3c20c71..2806f60ed1054 100644
--- a/include/uapi/linux/mdio.h
+++ b/include/uapi/linux/mdio.h
@@ -417,8 +417,17 @@
#define MDIO_AN_10BT1_AN_STAT_LPA_EEE_T1L 0x4000 /* 10BASE-T1L LP EEE ability advertisement */
/* BASE-T1 PMA/PMD control register */
-#define MDIO_PMA_PMD_BT1_CTRL_STRAP 0x000F /* Type selection (Strap) */
-#define MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000 0x0001 /* Select 1000BASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL 0x000F /* Type selection */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_100BT1 0x0000 /* Select 100BASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_1000BT1 0x0001 /* Select 1000BASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1L 0x0002 /* Select 10BASE-T1L */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10BT1S 0x0003 /* Select 10BASE-T1S */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_2P5GBT1 0x0004 /* Select 2.5GBASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_5GBT1 0x0005 /* Select 5GBASE-T1 */
+#define MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_10GBT1 0x0006 /* Select 10GBASE-T1 */
+/* Legacy names, kept for userspace */
+#define MDIO_PMA_PMD_BT1_CTRL_STRAP MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL
+#define MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000 MDIO_PMA_PMD_BT1_CTRL_TYPE_SEL_1000BT1
#define MDIO_PMA_PMD_BT1_CTRL_CFG_MST 0x4000 /* MASTER-SLAVE config value */
/* 1000BASE-T1 PCS control register */
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0550/1005] tls: Break the connection after a burst of empty data records
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (548 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0549/1005] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0551/1005] tls: Consume empty data records in tls_sw_splice_read() Greg Kroah-Hartman
` (448 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Chuck Lever,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 201f0531e413d6cdd9673a77bea340839e1713ae ]
TLS permits zero-length application_data records, and RFC 8446
suggests them for generating cover traffic. Nothing bounds how many of
them a reader processes back to back, though. They advance neither
loop bound in tls_sw_recvmsg() and tls_sw_read_sock(), so a peer
streaming them faster than the reader decrypts them keeps it in the
kernel for as long as they arrive. recvmsg() does not check for signals
while records are ready, and its peek and async paths queue every empty
record on rx_list. read_sock consumers like nvme-tcp hold the socket
lock throughout and never get control back.
Break the connection once a reader decrypts more than 128 consecutive
empty data records without sleeping or returning to its caller in
between, treating the burst as a protocol violation like a malformed
record header. A stream of empty records which the reader keeps up with
costs no more than any other traffic, so the count starts over on every
read and whenever the reader waits for the next record. The strparser
is stopped before it parses the next record, so the reader gets the
error from tls_rx_rec_wait() and no later record is delivered.
Returning to the caller and keeping the connection alive would need a
way to wake read_sock consumers which installed their own sk_data_ready
after the handshake, a lot of code for a peer that is either broken or
malicious.
Consume empty records in recvmsg() rather than queuing them on rx_list,
so that repeated MSG_PEEK cannot pile them up past the per-read count.
Decrypt them synchronously, too. Once a recvmsg() call has decrypted a
record asynchronously, recv_end replaces the error with the result of
process_rx_list(), so a call that saw only empty records returns 0, a
false EOF, instead of the error or -EAGAIN.
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260720-tcp-read-sock-v2-0-29545d034f3c@kernel.org?part=1
Closes: https://sashiko.dev/#/patchset/20260630191551.875664-1-cel@kernel.org?part=1
Link: https://lore.kernel.org/all/20261019-tls-follow-on-v6-0-ab01c4ecca0c@kernel.org/
Fixes: c46234ebb4d1 ("tls: RX path for ktls")
Fixes: 3be28e2c9cd0 ("net/tls: Consume empty data records in tls_sw_read_sock()")
Reviewed-by: Chuck Lever <cel@kernel.org>
Link: https://patch.msgid.link/20261111185522.2859004-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/tls.h | 1 +
net/tls/tls_sw.c | 29 +++++++++++++++++++++++++----
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/include/net/tls.h b/include/net/tls.h
index e57bef58851ea..0b001b8ab1c3b 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -139,6 +139,7 @@ struct tls_sw_context_rx {
u8 zc_capable:1;
u8 reader_contended:1;
bool key_update_pending;
+ u8 empty_run;
struct tls_strparser strp;
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 47e46547108e9..3dc0d9db3e882 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1153,6 +1153,7 @@ tls_rx_rec_wait(struct sock *sk, bool nonblock, bool released, bool has_copied)
if (!timeo)
return -EAGAIN;
+ ctx->empty_run = 0;
released = true;
add_wait_queue(sk_sleep(sk), &wait);
sk_set_bit(SOCKWQ_ASYNC_WAITDATA, sk);
@@ -1572,6 +1573,7 @@ static int tls_rx_one_record(struct sock *sk, struct msghdr *msg,
struct tls_decrypt_arg *darg)
{
struct tls_context *tls_ctx = tls_get_ctx(sk);
+ struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
struct tls_prot_info *prot = &tls_ctx->prot_info;
struct strp_msg *rxm;
int err;
@@ -1589,6 +1591,19 @@ static int tls_rx_one_record(struct sock *sk, struct msghdr *msg,
rxm->full_len -= prot->overhead_size;
tls_advance_record_sn(sk, prot, &tls_ctx->rx);
+ /* A peer may send empty data records, e.g. as cover traffic, but
+ * a burst of them traps the reader in the kernel. Treat more than
+ * 128 in a row, without the reader sleeping or returning to the
+ * caller in between, as a protocol violation. Stop the strparser
+ * before the next record gets parsed, so the reader finds the
+ * error in tls_rx_rec_wait().
+ */
+ if (rxm->full_len ||
+ tls_msg(darg->skb)->control != TLS_RECORD_TYPE_DATA)
+ ctx->empty_run = 0;
+ else if (unlikely(++ctx->empty_run > 128))
+ tls_strp_abort_strp(&ctx->strp, -EBADMSG);
+
return tls_check_pending_rekey(sk, tls_ctx, darg->skb);
}
@@ -1768,6 +1783,7 @@ static int tls_rx_reader_acquire(struct sock *sk, struct tls_sw_context_rx *ctx,
}
WRITE_ONCE(ctx->reader_present, 1);
+ ctx->empty_run = 0;
return 0;
}
@@ -1881,9 +1897,11 @@ int tls_sw_recvmsg(struct sock *sk,
tlm->control == TLS_RECORD_TYPE_DATA)
darg.zc = true;
- /* Do not use async mode if record is non-data */
+ /* Do not use async mode if record is non-data or empty,
+ * recv_end would report an error after empty records as EOF.
+ */
if (tlm->control == TLS_RECORD_TYPE_DATA)
- darg.async = ctx->async_capable;
+ darg.async = ctx->async_capable && to_decrypt;
else
darg.async = false;
@@ -1925,7 +1943,10 @@ int tls_sw_recvmsg(struct sock *sk,
DEBUG_NET_WARN_ON_ONCE(darg.skb == ctx->strp.anchor);
- if (async) {
+ /* Consume empty records, even when peeking, so that
+ * they cannot pile up on rx_list.
+ */
+ if (async && chunk) {
/* TLS 1.2-only, to_decrypt must be text len */
chunk = min_t(int, to_decrypt, len);
async_copy_bytes += chunk;
@@ -1946,7 +1967,7 @@ int tls_sw_recvmsg(struct sock *sk,
if (err < 0)
goto put_on_rx_list_err;
- if (is_peek) {
+ if (is_peek && chunk) {
peeked += chunk;
goto put_on_rx_list;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0551/1005] tls: Consume empty data records in tls_sw_splice_read()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (549 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0550/1005] tls: Break the connection after a burst of empty data records Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0552/1005] selftests: tls: Skip the zero_len tests when TLS is unavailable Greg Kroah-Hartman
` (447 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sabrina Dubroca, Chuck Lever,
Jakub Kicinski, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <cel@kernel.org>
[ Upstream commit db6a6c6863bd22b2543e313cb8e4807fdd33778b ]
A zero-length application_data record decrypts to full_len == 0,
so tls_sw_splice_read() splices zero bytes and returns zero. A zero
return from a splice read means EOF, and the caller tears down a
connection that is still live.
Consume the record and fetch the next one, as tls_sw_read_sock()
does. The cap on consecutive empty records bounds the loop.
When an empty record precedes a close_notify, splice(2) now returns
-EINVAL from the control-record test instead of a false EOF. A
splice that reaches an alert record already reports -EINVAL.
Fixes: c46234ebb4d1 ("tls: RX path for ktls")
Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Closes: https://lore.kernel.org/netdev/akaoXcfamBp8_mYe@krikkit/
Signed-off-by: Chuck Lever <cel@kernel.org>
Link: https://patch.msgid.link/20261111185522.2859004-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tls/tls_sw.c | 48 ++++++++++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 20 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 3dc0d9db3e882..ecd26d1f3019f 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2051,32 +2051,40 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
if (err)
goto splice_read_end;
- if (!skb_queue_empty(&ctx->rx_list)) {
- skb = __skb_dequeue(&ctx->rx_list);
- } else {
- struct tls_decrypt_arg darg;
+ for (;;) {
+ if (!skb_queue_empty(&ctx->rx_list)) {
+ skb = __skb_dequeue(&ctx->rx_list);
+ } else {
+ struct tls_decrypt_arg darg;
- err = tls_rx_rec_wait(sk, nonblock, true, false);
- if (err <= 0)
- goto splice_read_end;
+ err = tls_rx_rec_wait(sk, nonblock, true, false);
+ if (err <= 0)
+ goto splice_read_end;
- memset(&darg.inargs, 0, sizeof(darg.inargs));
+ memset(&darg.inargs, 0, sizeof(darg.inargs));
- err = tls_rx_one_record(sk, NULL, &darg);
- if (err < 0)
- goto splice_read_end;
+ err = tls_rx_one_record(sk, NULL, &darg);
+ if (err < 0)
+ goto splice_read_end;
- tls_rx_rec_done(ctx);
- skb = darg.skb;
- }
+ tls_rx_rec_done(ctx);
+ skb = darg.skb;
+ }
- rxm = strp_msg(skb);
- tlm = tls_msg(skb);
+ rxm = strp_msg(skb);
+ tlm = tls_msg(skb);
- /* splice does not support reading control messages */
- if (tlm->control != TLS_RECORD_TYPE_DATA) {
- err = -EINVAL;
- goto splice_requeue;
+ /* splice does not support reading control messages */
+ if (tlm->control != TLS_RECORD_TYPE_DATA) {
+ err = -EINVAL;
+ goto splice_requeue;
+ }
+
+ /* Splicing zero bytes would read as EOF */
+ if (rxm->full_len)
+ break;
+
+ consume_skb(skb);
}
chunk = min_t(unsigned int, rxm->full_len, len);
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0552/1005] selftests: tls: Skip the zero_len tests when TLS is unavailable
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (550 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0551/1005] tls: Consume empty data records in tls_sw_splice_read() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0553/1005] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
` (446 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Jakub Kicinski,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <cel@kernel.org>
[ Upstream commit 77389a6d30a262fa94d427c03a393c05c013665c ]
FIXTURE_SETUP(zero_len) returns early when ulp_sock_pair() reports
that the TCP_ULP setsockopt failed, so on a kernel built without
CONFIG_TLS the TLS_RX setsockopt never runs. TEST_F(zero_len, test)
then sends its raw records over a plain TCP socket, which returns
the ciphertext verbatim. All eight variants FAIL on a machine that
lacks TLS, and those failures mask any real regression in the same
run.
Skip the test when the fixture recorded notls, as the other
fixtures in this file do.
Fixes: a61a3e961baf ("selftests: tls: add tests for zero-length records")
Signed-off-by: Chuck Lever <cel@kernel.org>
Link: https://patch.msgid.link/20261111185522.2859004-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/net/tls.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index 9d3cd4fff062b..0bc43728262e0 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -2639,6 +2639,9 @@ TEST_F(zero_len, test)
int rec_off;
int i;
+ if (self->notls)
+ SKIP(return, "no TLS support");
+
for (i = 0; i < 4 && variant->recs[i]; i++)
EXPECT_EQ(send(self->fd, variant->recs[i]->cipher_data,
variant->recs[i]->cipher_len, 0),
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0553/1005] nsh: limit recursion in nsh_gso_segment()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (551 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0552/1005] selftests: tls: Skip the zero_len tests when TLS is unavailable Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0554/1005] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
` (445 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jiri Benc, 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 3921fb102d78a6d7aa61b8d273e097a1a8026b90 ]
nsh_gso_segment() calls skb_mac_gso_segment() for the inner packet,
which calls nsh_gso_segment() again when the next protocol is NSH,
either directly or behind an inner Ethernet header (ETH_P_TEB).
Nothing limits the depth: a GSO packet made of stacked 8-byte NSH
headers recurses once per header, and a 64KB packet can hold about
8000 of them, overflowing the kernel stack.
Such a packet can be injected with a packet socket using
PACKET_VNET_HDR, or with tun/tap or virtio_net, as nothing checks
that a GSO packet with VIRTIO_NET_HDR_F_NEEDS_CSUM carries the
protocol it claims. It is then segmented in software if the output
device does not support the GSO type:
BUG: TASK stack guard page was hit at ffffcad5c0ab3ff8 (stack is ffffcad5c0ab4000..ffffcad5c0ab8000)
Oops: stack guard page: 0000 [#1] SMP NOPTI
CPU: 3 UID: 0 PID: 337 Comm: nsh_gso Tainted: G E 7.4.0-rc1+ #118 PREEMPT(lazy)
RIP: 0010:lock_acquire (kernel/locking/lockdep.c:5902)
Call Trace:
<TASK>
skb_mac_gso_segment (include/linux/rcupdate.h:309 include/linux/rcupdate.h:849 net/core/gso.c:50)
nsh_gso_segment (net/nsh/nsh.c:110) nsh
skb_mac_gso_segment (net/core/gso.c:53)
nsh_gso_segment (net/nsh/nsh.c:110) nsh
[...]
skb_mac_gso_segment (net/core/gso.c:53)
__skb_gso_segment (net/core/gso.c:129)
validate_xmit_skb (net/core/dev.c:4238)
__dev_queue_xmit (net/core/dev.c:5087)
packet_sendmsg (net/packet/af_packet.c:3157 net/packet/af_packet.c:3189)
__sys_sendto (net/socket.c:800 net/socket.c:818 net/socket.c:2283)
__x64_sys_sendto (net/socket.c:2290 net/socket.c:2286 net/socket.c:2286)
do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:84)
entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
Use gso_recursion_inc_test(), added in commit 006c8b834aed ("net: gso:
limit recursive IP-in-IP segmentation"), with the same limit as IPv4
and IPv6. The counter is shared with them: a packet with four NSH
headers in front of an IPv4 header is still segmented, one more NSH
header and it is dropped.
The NSH -> ETH_P_TEB -> NSH route is covered as well, as each round
goes through nsh_gso_segment().
Fixes: c411ed854584 ("nsh: add GSO support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/179443691180.2199510.148246238688217560@kernel.org/
Cc: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiri Benc <jbenc@redhat.com>
Link: https://patch.msgid.link/20261112102001.3744643-2-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/gso.h | 2 +-
net/nsh/nsh.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/net/gso.h b/include/net/gso.h
index 0749230d414ec..e311a8f5b5a72 100644
--- a/include/net/gso.h
+++ b/include/net/gso.h
@@ -19,7 +19,7 @@ struct skb_gso_cb {
int encap_level;
__wsum csum;
__u16 csum_start;
- /* Number of IPv4/IPv6 GSO handler entries for this packet. */
+ /* Number of IPv4/IPv6/NSH GSO handler entries for this packet. */
u8 recursion_counter;
};
#define SKB_GSO_CB_OFFSET 32
diff --git a/net/nsh/nsh.c b/net/nsh/nsh.c
index bfb7758063f31..dd4de50fc38c3 100644
--- a/net/nsh/nsh.c
+++ b/net/nsh/nsh.c
@@ -9,6 +9,7 @@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/gso.h>
+#include <net/ip_tunnels.h>
#include <net/nsh.h>
#include <net/tun_proto.h>
@@ -84,6 +85,12 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
skb_reset_network_header(skb);
+ /* NSH can carry NSH (directly, or in an inner Ethernet frame):
+ * limit the recursion, as IPv4 and IPv6 do.
+ */
+ if (unlikely(gso_recursion_inc_test(skb, IP_TUNNEL_RECURSION_LIMIT)))
+ goto out;
+
outer_proto = skb->protocol;
outer_hlen = skb_mac_header_len(skb);
mac_len = skb->mac_len;
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0554/1005] tracing: skip boot kprobe setup when no events were requested
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (552 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0553/1005] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0555/1005] docs, kprobes: Fix bracket Greg Kroah-Hartman
` (444 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wenwen Fu, Masami Hiramatsu (Google),
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenwen Fu <wenwfu@qti.qualcomm.com>
[ Upstream commit 2388a673e9276de30c7e917fce50830e497d46cc ]
setup_boot_kprobe_events() calls enable_boot_kprobe_events() even when
the kprobe_event= boot parameter was not supplied. That call takes
event_mutex without any command-line probes to enable.
Asynchronous eval-map updates also hold event_mutex. A normal boot can
therefore wait in init_kprobe_trace() for this background work despite
having no boot probes to set up.
Return early when the boot-event buffer is empty. Keep the mutex
protection in trace_event_update_all() and retain setup for explicit
kprobe_event= parameters. Bootconfig handles its own probe enablement,
and the existing trace_eval_sync() still waits for background work
before init memory is freed.
Link: https://lore.kernel.org/all/20261106021457.2648231-1-wenwfu@qti.qualcomm.com/
Fixes: 970988e19eb0 ("tracing/kprobe: Add kprobe_event= boot parameter")
Signed-off-by: Wenwen Fu <wenwfu@qti.qualcomm.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_kprobe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index e41a7c113646b..6e0fff6b4d91f 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -2017,6 +2017,9 @@ static __init void setup_boot_kprobe_events(void)
char *p, *cmd = kprobe_boot_events_buf;
int ret;
+ if (!kprobe_boot_events_buf[0])
+ return;
+
strreplace(kprobe_boot_events_buf, ',', ' ');
while (cmd && *cmd != '\0') {
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0555/1005] docs, kprobes: Fix bracket
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (553 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0554/1005] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0556/1005] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
` (443 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Manuel Ebner, Randy Dunlap,
Masami Hiramatsu (Google), Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manuel Ebner <manuelebnerli@mailbox.org>
[ Upstream commit b91a5c16996d089cd07ceaf33b5a621cb94c2c2f ]
Remove needless ')'
Link: https://lore.kernel.org/all/20261112085511.690900-2-manuelebnerli@mailbox.org/
Fixes: a1dac767622c ("kprobes.txt: standardize document format")
Signed-off-by: Manuel Ebner <manuelebnerli@mailbox.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/trace/kprobes.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/trace/kprobes.rst b/Documentation/trace/kprobes.rst
index 5e606730cec63..0b19d82d7d4cb 100644
--- a/Documentation/trace/kprobes.rst
+++ b/Documentation/trace/kprobes.rst
@@ -31,7 +31,7 @@ can trap at almost any kernel code address [1]_, specifying a handler
routine to be invoked when the breakpoint is hit.
.. [1] some parts of the kernel code can not be trapped, see
- :ref:`kprobes_blacklist`)
+ :ref:`kprobes_blacklist`
There are currently two types of probes: kprobes, and kretprobes
(also called return probes). A kprobe can be inserted on virtually
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0556/1005] KEYS: do not let an unmatched key decide the search result
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (554 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0555/1005] docs, kprobes: Fix bracket Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0557/1005] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
` (442 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jarkko Sakkinen, Guixiong Wei,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixiong Wei <weiguixiong@bytedance.com>
[ Upstream commit 143fe160178c73e43575bff4890d23f84e37146d ]
With the dns_resolver key type available, put a key named "foo" in a
fresh session keyring, revoke it, and search for "bar":
keyctl new_session >/dev/null
A=$(printf '127.0.0.1\0' | keyctl padd dns_resolver foo @s)
keyctl revoke "$A"
keyctl search @s dns_resolver bar
Results:
keyctl_search: Key has been revoked
The search returns -EKEYREVOKED even though there is no key named "bar".
It should return -ENOKEY.
A dns_resolver search walks the keys in the keyring and uses
dns_resolver_cmp() to compare their descriptions with the requested
name. When keyring_search_iterator() sees the revoked "foo" key, it
records -EKEYREVOKED in ctx->result and skips the key before comparing
its description. The search continues, but without a match it returns
the error recorded for "foo".
Call the match callback before checking for invalidated, revoked or
expired keys. A nonmatching key then leaves ctx->result alone.
Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring")
Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
Closes: https://lore.kernel.org/lkml/avDG8G-Jl1YsmfCs@kernel.org/
Signed-off-by: Guixiong Wei <weiguixiong@bytedance.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261109032931.80406-2-weiguixiong@bytedance.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/keys/keyring.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index 7143f3079d200..39645b8f9b30c 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -598,6 +598,12 @@ static int keyring_search_iterator(const void *object, void *iterator_data)
return 0;
}
+ /* A key the caller did not ask for must not decide the result. */
+ if (!ctx->match_data.cmp(key, &ctx->match_data)) {
+ kleave(" = 0 [!match]");
+ return 0;
+ }
+
/* skip invalidated, revoked and expired keys */
if (ctx->flags & KEYRING_SEARCH_DO_STATE_CHECK) {
time64_t expiry = READ_ONCE(key->expiry);
@@ -617,12 +623,6 @@ static int keyring_search_iterator(const void *object, void *iterator_data)
}
}
- /* keys that don't match */
- if (!ctx->match_data.cmp(key, &ctx->match_data)) {
- kleave(" = 0 [!match]");
- return 0;
- }
-
/* key must have search permissions */
if (!(ctx->flags & KEYRING_SEARCH_NO_CHECK_PERM) &&
key_task_permission(make_key_ref(key, ctx->possessed),
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0557/1005] ALSA: aw2-alsa: select SND_PCM
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (555 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0556/1005] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0558/1005] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
` (441 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jude Gyimah, Takashi Iwai,
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 bca568589ad118a9b0bac086760baee2a41976a5 ]
Several stanzas in sound/pci/Kconfig select SND_PCM.
SND_AW2 selects nothing at all.
aw2-alsa calls snd_pcm_new, which sound/core/pcm.c provides under SND_PCM.
aw2-alsa.c:(.text+0x554): undefined reference to `snd_pcm_new'
4 symbols are undefined in all.
The driver can be built into vmlinux while SND_PCM is a module, in which
case the symbols are not there at link time.
Select rather than depend on: SND_PCM has no prompt of its own and is only
ever enabled by a select, so a depends on would leave SND_AW2
unselectable.
Reproduced on v7.3, arm64, with CONFIG_SND_AW2=y and CONFIG_SND_PCM=m.
Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.
Fixes: 98f2a97f207a ("[ALSA] Emagic Audiowerk 2 ALSA driver.")
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
Link: https://patch.msgid.link/20261113064614.15045-1-jude.gyimah87@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 6366f72b36679..9c192d51ff445 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -141,6 +141,7 @@ config SND_AU8830
config SND_AW2
tristate "Emagic Audiowerk 2"
+ select SND_PCM
help
Say Y here to include support for Emagic Audiowerk 2 soundcards.
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0558/1005] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (556 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0557/1005] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0559/1005] cpuset: generalize the validate_partition() interface Greg Kroah-Hartman
` (440 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Beulich, Juergen Gross,
Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Beulich <jbeulich@suse.com>
[ Upstream commit 2b66f2cc753243a6adb3e9a5c038b0fc59ba7ec9 ]
Both decrease-reservation and populate-physmap can succeed partially. For
the former this may be pretty unlikely, but clearly the latter can hit
both out-of-memory conditions in the hypervisor or denial because of the
allocation exceeding the domain's allowance (there's no interaction with
the balloon driver here either).
In gnttab_dma_free_pages() we simply can't give back to the system what
hasn't been re-filled with backing memory. For gnttab_dma_alloc_pages()
both parts of the overall region need dealing with differently.
While no present caller of gnttab_dma_free_pages() checks its return
value, also don't use -EFAULT there: It really is an out-of-memory
condition. (In gnttab_dma_alloc_pages() -EFAULT doesn't look quite right
either, but I couldn't think of a clearly better error code there.)
Fixes: 9bdc7304f536 ("xen/grant-table: Allow allocating buffers suitable for DMA")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261110095605.369848-3-jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/xen/grant-table.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 11c2ef1cc86eb..2a28884a84b78 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1097,6 +1097,24 @@ int gnttab_dma_alloc_pages(struct gnttab_dma_alloc_args *args)
ret = xenmem_reservation_decrease(args->nr_pages, args->frames);
if (ret != args->nr_pages) {
pr_debug("Failed to decrease reservation for DMA buffer\n");
+ if (ret >= 0) {
+ /* Free the part where decrease didn't work. */
+ size_t done = ret << PAGE_SHIFT;
+
+ if (args->coherent)
+ dma_free_coherent(args->dev, size - done,
+ args->vaddr + done,
+ args->dev_bus_addr + done);
+ else
+ dma_free_wc(args->dev, size - done,
+ args->vaddr + done,
+ args->dev_bus_addr + done);
+
+ if (!ret) /* Nothing else to do? */
+ return -EFAULT;
+
+ args->nr_pages = ret;
+ }
ret = -EFAULT;
goto fail;
}
@@ -1130,7 +1148,12 @@ int gnttab_dma_free_pages(struct gnttab_dma_alloc_args *args)
ret = xenmem_reservation_increase(args->nr_pages, args->frames);
if (ret != args->nr_pages) {
pr_debug("Failed to increase reservation for DMA buffer\n");
- ret = -EFAULT;
+ /* Can only free what has been re-filled. */
+ if (!ret)
+ return -ENOMEM;
+ if (ret > 0)
+ args->nr_pages = ret;
+ ret = -ENOMEM;
} else {
ret = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0559/1005] cpuset: generalize the validate_partition() interface
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (557 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0558/1005] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0560/1005] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
` (439 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ridong Chen, Guopeng Zhang,
Waiman Long, Tejun Heo, Sasha Levin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ridong Chen <chenridong@xiaomi.com>
[ Upstream commit e234ed1bb82c96a5643fd70784f16cf3d72eeed3 ]
Refactor validate_partition() to take the parent partition, the new
partition root state, the new effective exclusive CPUs and the CPUs to
be deleted, instead of a trial cpuset. A NULL parent stands for a
remote partition, whose CPUs come from top_cpuset. This makes the
interface flexible enough to handle both local and remote partition
validation.
This also fixes a false PERR_NOCPUS error when expanding a remote
partition. The no CPU left for tasks check in partition_cpus_change()
is done against the cgroup parent, but the CPUs of a remote partition
come from top_cpuset, not from its parent. For example, on a 4-CPU
system:
echo 2-3 > P/cpuset.cpus
echo 2-3 > P/cpuset.cpus.exclusive
echo 2-3 > P/C/cpuset.cpus
echo 2 > P/C/cpuset.cpus.exclusive
echo root > P/C/cpuset.cpus.partition
(a task in P)
echo 2-3 > P/C/cpuset.cpus.exclusive
cat P/C/cpuset.cpus.partition
root invalid (Parent is not a partition root)
The effective_cpus of P is 3, a subset of the new exclusive CPUs 2-3 of
C, and P has a task, so the expansion is rejected. However, P is not a
partition root and does not give any CPU to C, and top_cpuset still has
CPUs 0-1 for the task. Enabling C directly with exclusive CPUs 2-3
succeeds, as remote_partition_enable() checks top_cpuset instead.
The no CPU left for tasks check now uses the given parent instead of
parent_cs(cs), and top_cpuset for a remote partition, as that is where
its CPUs are taken from.
The housekeeping conflict check is folded into validate_partition(). It
is skipped when the parent is not a valid partition root, as @cs can't
be a valid local partition in that case.
Use the new interface for local partition enablement in
update_parent_effective_cpumask() and in partition_cpus_change(),
replacing the open-coded checks there. The order of the checks is now
the same for both paths: empty CPUs, housekeeping conflict, then no CPU
left for tasks.
Add a test case to test_cpuset_prs.sh for the remote partition
expansion above.
Fixes: 181c8e091aae ("cgroup/cpuset: Introduce remote partition")
Signed-off-by: Ridong Chen <chenridong@xiaomi.com>
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 119 +++++++++---------
.../selftests/cgroup/test_cpuset_prs.sh | 5 +
2 files changed, 64 insertions(+), 60 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 67d79749a1444..2be2e39da7952 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1511,6 +1511,48 @@ static bool prstate_housekeeping_conflict(int new_prs, int parent_prs,
return res;
}
+/**
+ * validate_partition - Validate a cpuset partition configuration
+ * @cs: The cpuset to validate
+ * @parent: Parent partition of @cs, NULL for remote partition
+ * @new_prs: The proposed new partition root state
+ * @new_excpus: The new effective exclusive CPUs mask to validate
+ * @del: exclusive CPUs to be deleted from @cs, can be NULL
+ *
+ * A remote partition gets its CPUs from top_cpuset, so top_cpuset is used
+ * as the parent when @parent is NULL.
+ *
+ * The housekeeping check is skipped if @parent is not a valid partition
+ * root as @cs can't be a valid local partition in that case.
+ *
+ * Return: PRS error code (0 if valid, non-zero error code if invalid)
+ */
+static enum prs_errcode validate_partition(struct cpuset *cs,
+ struct cpuset *parent, int new_prs,
+ struct cpumask *new_excpus,
+ struct cpumask *del)
+{
+ int parent_prs;
+
+ if (new_prs == PRS_MEMBER)
+ return PERR_NONE;
+
+ if (cpumask_empty(new_excpus))
+ return PERR_INVCPUS;
+
+ if (!parent)
+ parent = &top_cpuset;
+ parent_prs = parent->partition_root_state;
+ if (parent_prs > 0 &&
+ prstate_housekeeping_conflict(new_prs, parent_prs, new_excpus, del))
+ return PERR_HKEEPING;
+
+ if (tasks_nocpu_error(parent, cs, new_excpus))
+ return PERR_NOCPUS;
+
+ return PERR_NONE;
+}
+
/*
* cpuset_update_sd_hk_unlock - Rebuild sched domains, update HK & unlock
*
@@ -1921,18 +1963,10 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
if ((cmd == partcmd_enable) || (cmd == partcmd_enablei)) {
new_prs = (cmd == partcmd_enable) ? PRS_ROOT : PRS_ISOLATED;
- /*
- * Enabling partition root is not allowed if its
- * effective_xcpus is empty.
- */
- if (cpumask_empty(tmp->delmask))
- return PERR_INVCPUS;
-
- if (prstate_housekeeping_conflict(new_prs, parent_prs, tmp->delmask, NULL))
- return PERR_HKEEPING;
-
- if (nocpu)
- return PERR_NOCPUS;
+ part_error = validate_partition(cs, parent, new_prs,
+ tmp->delmask, NULL);
+ if (part_error)
+ return part_error;
/*
* This function will only be called when all the preliminary
@@ -2510,32 +2544,6 @@ static int parse_cpuset_cpulist(const char *buf, struct cpumask *out_mask)
return 0;
}
-/**
- * validate_partition - Validate a cpuset partition configuration
- * @cs: The cpuset to validate
- * @trialcs: The trial cpuset containing proposed configuration changes
- *
- * If any validation check fails, the appropriate error code is set in the
- * cpuset's prs_err field.
- *
- * Return: PRS error code (0 if valid, non-zero error code if invalid)
- */
-static enum prs_errcode validate_partition(struct cpuset *cs, struct cpuset *trialcs)
-{
- struct cpuset *parent = parent_cs(cs);
-
- if (cs_is_member(trialcs))
- return PERR_NONE;
-
- if (cpumask_empty(trialcs->effective_xcpus))
- return PERR_INVCPUS;
-
- if (tasks_nocpu_error(parent, cs, trialcs->effective_xcpus))
- return PERR_NOCPUS;
-
- return PERR_NONE;
-}
-
/**
* partition_cpus_change - Handle partition state changes due to CPU mask updates
* @cs: The target cpuset being modified
@@ -2549,33 +2557,24 @@ static void partition_cpus_change(struct cpuset *cs, struct cpuset *trialcs,
struct tmpmasks *tmp)
{
enum prs_errcode prs_err;
- int parent_prs = is_remote_partition(cs)
- ? PRS_ROOT : parent_cs(cs)->partition_root_state;
+ struct cpuset *parent = is_remote_partition(cs) ? NULL : parent_cs(cs);
if (cs_is_member(cs))
return;
- prs_err = validate_partition(cs, trialcs);
- if (!prs_err && (parent_prs > 0) &&
- !cpumask_empty(trialcs->effective_xcpus)) {
- int prs = cs->partition_root_state;
-
- /*
- * Check for housekeeping conflict by passing the whole
- * effective_xcpus as well as those CPUs that are to be
- * removed from cs as delmask.
- */
- if (prs > 0)
- cpumask_andnot(tmp->delmask, cs->effective_xcpus,
- trialcs->effective_xcpus);
- else
- cpumask_clear(tmp->delmask);
-
- if (prstate_housekeeping_conflict(prs, parent_prs,
- trialcs->effective_xcpus, tmp->delmask))
- prs_err = PERR_HKEEPING;
- }
+ /*
+ * Check for housekeeping conflict by passing the whole
+ * effective_xcpus as well as those CPUs that are to be
+ * removed from cs as delmask.
+ */
+ if (is_partition_valid(cs))
+ cpumask_andnot(tmp->delmask, cs->effective_xcpus,
+ trialcs->effective_xcpus);
+ else
+ cpumask_clear(tmp->delmask);
+ prs_err = validate_partition(cs, parent, trialcs->partition_root_state,
+ trialcs->effective_xcpus, tmp->delmask);
if (prs_err) {
WRITE_ONCE(cs->prs_err, prs_err);
trialcs->prs_err = prs_err;
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index 7d5ca28e46c21..d7260a4c6a610 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -556,6 +556,11 @@ REMOTE_TEST_MATRIX=(
" C1-4:P1 C5-6 C1-2 . C5 . \
. P1 P1 . O5=0 . p1:3-4|p2:6|c11:1-2|c12:3-4|c21:6|c22:6 \
p1:P1|p2:P1|c11:P1"
+ # Expanding a remote partition should check top cpuset, not its member
+ # parent, for the no CPU left for tasks error.
+ " CX2-3:T . C2-3:X2:P1 . . . \
+ . . X2-3 . . . p1:1,4-7|c11:2-3 \
+ p1:P0|c11:P1"
)
#
--
2.53.0
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0560/1005] tracing/eprobe: Install the trigger for every instance that enables the eprobe
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (558 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0559/1005] cpuset: generalize the validate_partition() interface Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0561/1005] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
` (438 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Carlier,
Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Carlier <devnexen@gmail.com>
commit be94710b1f6ba1bea33e73129c110af80e999b2d upstream.
The eprobe trigger lives in the instance of the enabling file, but it is
only added when the eprobe is first enabled and only removed when the
last file goes away. A second instance then records nothing, and the
first instance's trigger is left behind once the eprobe is disabled
there, so the eprobe can be deleted while that trigger still uses it.
Add and remove the trigger for each file. The file is never NULL here,
so warn if it is and drop the dead perf paths.
Link: https://lore.kernel.org/all/20261107101233.151434-1-devnexen@gmail.com/
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 58 ++++++++++++++------------------------------
1 file changed, 19 insertions(+), 39 deletions(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -644,37 +644,32 @@ static int enable_trace_eprobe(struct tr
{
struct trace_probe *tp;
struct trace_eprobe *ep;
- bool enabled;
int ret = 0;
int cnt = 0;
+ if (WARN_ON_ONCE(!file))
+ return -EINVAL;
+
tp = trace_probe_primary_from_call(call);
if (WARN_ON_ONCE(!tp))
return -ENODEV;
- enabled = trace_probe_is_enabled(tp);
/* This also changes "enabled" state */
- if (file) {
- ret = trace_probe_add_file(tp, file);
- if (ret)
- return ret;
- } else
- trace_probe_set_flag(tp, TP_FLAG_PROFILE);
-
- if (enabled)
- return 0;
+ ret = trace_probe_add_file(tp, file);
+ if (ret)
+ return ret;
+ /* The trigger lives in the instance of the file, add it for each file */
for_each_trace_eprobe_tp(ep, tp) {
ret = enable_eprobe(ep, file);
if (ret)
break;
- enabled = true;
cnt++;
}
if (ret) {
/* Failed to enable one of them. Roll back all */
- if (enabled) {
+ if (cnt) {
/*
* It's a bug if one failed for something other than memory
* not being available but another eprobe succeeded.
@@ -687,10 +682,7 @@ static int enable_trace_eprobe(struct tr
break;
}
}
- if (file)
- trace_probe_remove_file(tp, file);
- else
- trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
+ trace_probe_remove_file(tp, file);
}
return ret;
@@ -702,33 +694,21 @@ static int disable_trace_eprobe(struct t
struct trace_probe *tp;
struct trace_eprobe *ep;
+ if (WARN_ON_ONCE(!file))
+ return -EINVAL;
+
tp = trace_probe_primary_from_call(call);
if (WARN_ON_ONCE(!tp))
return -ENODEV;
- if (file) {
- if (!trace_probe_get_file_link(tp, file))
- return -ENOENT;
- if (!trace_probe_has_single_file(tp))
- goto out;
- trace_probe_clear_flag(tp, TP_FLAG_TRACE);
- } else
- trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
-
- if (!trace_probe_is_enabled(tp)) {
- for_each_trace_eprobe_tp(ep, tp)
- disable_eprobe(ep, file->tr);
- }
+ if (!trace_probe_get_file_link(tp, file))
+ return -ENOENT;
- out:
- if (file)
- /*
- * Synchronization is done in below function. For perf event,
- * file == NULL and perf_trace_event_unreg() calls
- * tracepoint_synchronize_unregister() to ensure synchronize
- * event. We don't need to care about it.
- */
- trace_probe_remove_file(tp, file);
+ for_each_trace_eprobe_tp(ep, tp)
+ disable_eprobe(ep, file->tr);
+
+ /* Synchronization is done in below function. */
+ trace_probe_remove_file(tp, file);
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0561/1005] KEYS: Expand key->{datalen,quotalen} to unsigned int
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (559 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0560/1005] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0562/1005] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
` (437 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarkko Sakkinen <jarkko@kernel.org>
commit 4a65eaf146f0d10ebaa88cfaef9c3b24f93766d9 upstream.
In key_alloc() and key_payload_reserve(), key->quotalen and key->datalen
can receive values larger than USHRT_MAX.
Example:
keyctl new_session >/dev/null
owner=$(keyctl newring owner @s)
keeper=$(keyctl newring keeper @s)
for ((i=0; i<16384; i++)); do
key=$(keyctl add user "k$i" x "$keeper")
keyctl link "$key" "$owner"
done
awk -v uid="$(id -u):" '$1 == uid {print $NF}' /proc/key-users
keyctl clear "$owner"
awk -v uid="$(id -u):" '$1 == uid {print $NF}' /proc/key-users
Because key->datalen wraps around 65535, the quota refunded upon clearing
is truncated, causing quota bytes to leak in /proc/key-users.
Change the types of key->datalen and key->quotalen from unsigned short to
unsigned int so that they can carry the full payload length without
truncation.
Cc: stable@vger.kernel.org
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/r/20261020174325.2229448-2-jarkko@kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsacl.c | 6 +++---
include/linux/key.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/fs/smb/client/cifsacl.c
+++ b/fs/smb/client/cifsacl.c
@@ -385,7 +385,7 @@ id_to_sid(unsigned int cid, uint sidtype
goto out_revert_creds;
} else if (sidkey->datalen < CIFS_SID_BASE_SIZE) {
rc = smb_EIO1(smb_eio_trace_malformed_sid_key, sidkey->datalen);
- cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
+ cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%u)\n",
__func__, sidkey->datalen);
goto invalidate_key;
}
@@ -403,7 +403,7 @@ id_to_sid(unsigned int cid, uint sidtype
if (ksid_size > sidkey->datalen) {
rc = smb_EIO2(smb_eio_trace_malformed_ksid_key,
ksid_size, sidkey->datalen);
- cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu, ksid_size=%u)\n",
+ cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%u, ksid_size=%u)\n",
__func__, sidkey->datalen, ksid_size);
goto invalidate_key;
}
@@ -498,7 +498,7 @@ try_upcall_to_get_id:
*/
BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
if (sidkey->datalen != sizeof(uid_t)) {
- cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
+ cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%u)\n",
__func__, sidkey->datalen);
key_invalidate(sidkey);
goto out_key_put;
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -216,8 +216,8 @@ struct key {
kuid_t uid;
kgid_t gid;
key_perm_t perm; /* access permissions */
- unsigned short quotalen; /* length added to quota */
- unsigned short datalen; /* payload data length
+ unsigned int quotalen; /* length added to quota */
+ unsigned int datalen; /* payload data length
* - may not match RCU dereferenced payload
* - payload should contain own length
*/
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0562/1005] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (560 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0561/1005] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0563/1005] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
` (436 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarkko Sakkinen <jarkko@kernel.org>
commit 094c53d2994975e36d4cab7cf5d9f34c1b0f1916 upstream.
KEY_MAX_DESC_SIZE includes the trailing NULL character. Descriptions
generated from payloads and in-kernel paths bypass the userspace limit.
Reject descriptions at or above KEY_MAX_DESC_SIZE with -EINVAL at the
following sites:
- key_alloc(): before quota calculation
- __key_create_or_update(): before key_set_index_key()
- keyring_search(): before match_preparse
- request_key_and_link(): before match_preparse
- request_key_rcu(): before check_cached_key()
Cc: stable@vger.kernel.org
Fixes: f771fde82051 ("keys: Simplify key description management")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/r/20261020174325.2229448-3-jarkko@kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/key.h | 3 +++
security/keys/key.c | 10 +++++++++-
security/keys/keyctl.c | 2 --
security/keys/keyring.c | 7 ++++++-
security/keys/request_key.c | 14 ++++++++++++--
5 files changed, 30 insertions(+), 6 deletions(-)
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -37,6 +37,9 @@ struct net;
#undef KEY_DEBUGGING
+/* Maximum length of a key description, including the trailing NUL */
+#define KEY_MAX_DESC_SIZE 4096
+
#define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */
#define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */
#define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -245,6 +245,8 @@ struct key *key_alloc(struct key_type *t
}
desclen = strlen(desc);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ goto error;
quotalen = desclen + 1 + type->def_datalen;
/* get hold of the key tracking for this user */
@@ -829,6 +831,7 @@ static key_ref_t __key_create_or_update(
key_ref_t key_ref;
int ret;
struct key_restriction *restrict_link = NULL;
+ size_t desclen;
/* look up the key type to see if it's one of the registered kernel
* types */
@@ -869,7 +872,12 @@ static key_ref_t __key_create_or_update(
if (!index_key.description)
goto error_free_prep;
}
- index_key.desc_len = strlen(index_key.description);
+ desclen = strlen(index_key.description);
+ if (desclen >= KEY_MAX_DESC_SIZE) {
+ key_ref = ERR_PTR(-EINVAL);
+ goto error_free_prep;
+ }
+ index_key.desc_len = desclen;
key_set_index_key(&index_key);
ret = __key_link_lock(keyring, &index_key);
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -24,8 +24,6 @@
#include <keys/request_key_auth-type.h>
#include "internal.h"
-#define KEY_MAX_DESC_SIZE 4096
-
static const unsigned char keyrings_capabilities[2] = {
[0] = (KEYCTL_CAPS0_CAPABILITIES |
(IS_ENABLED(CONFIG_PERSISTENT_KEYRINGS) ? KEYCTL_CAPS0_PERSISTENT_KEYRINGS : 0) |
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -957,7 +957,6 @@ key_ref_t keyring_search(key_ref_t keyri
struct keyring_search_context ctx = {
.index_key.type = type,
.index_key.description = description,
- .index_key.desc_len = strlen(description),
.cred = current_cred(),
.match_data.cmp = key_default_cmp,
.match_data.raw_data = description,
@@ -965,8 +964,14 @@ key_ref_t keyring_search(key_ref_t keyri
.flags = KEYRING_SEARCH_DO_STATE_CHECK,
};
key_ref_t key;
+ size_t desclen;
int ret;
+ desclen = strlen(description);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ return ERR_PTR(-EINVAL);
+ ctx.index_key.desc_len = desclen;
+
if (recurse)
ctx.flags |= KEYRING_SEARCH_RECURSE;
if (type->match_preparse) {
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -584,7 +584,6 @@ struct key *request_key_and_link(struct
.index_key.type = type,
.index_key.domain_tag = domain_tag,
.index_key.description = description,
- .index_key.desc_len = strlen(description),
.cred = current_cred(),
.match_data.cmp = key_default_cmp,
.match_data.raw_data = description,
@@ -595,8 +594,14 @@ struct key *request_key_and_link(struct
};
struct key *key;
key_ref_t key_ref;
+ size_t desclen;
int ret;
+ desclen = strlen(description);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ return ERR_PTR(-EINVAL);
+ ctx.index_key.desc_len = desclen;
+
kenter("%s,%s,%p,%zu,%p,%p,%lx",
ctx.index_key.type->name, ctx.index_key.description,
callout_info, callout_len, aux, dest_keyring, flags);
@@ -787,7 +792,6 @@ struct key *request_key_rcu(struct key_t
.index_key.type = type,
.index_key.domain_tag = domain_tag,
.index_key.description = description,
- .index_key.desc_len = strlen(description),
.cred = current_cred(),
.match_data.cmp = key_default_cmp,
.match_data.raw_data = description,
@@ -797,6 +801,12 @@ struct key *request_key_rcu(struct key_t
};
struct key *key;
key_ref_t key_ref;
+ size_t desclen;
+
+ desclen = strlen(description);
+ if (desclen >= KEY_MAX_DESC_SIZE)
+ return ERR_PTR(-EINVAL);
+ ctx.index_key.desc_len = desclen;
kenter("%s,%s", type->name, description);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0563/1005] KEYS: Verify the key identity in __key_unlink_begin
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (561 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0562/1005] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0564/1005] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
` (435 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarkko Sakkinen <jarkko@kernel.org>
commit 7a7f70ff7b26519c98b339a3e0cd9ee3c8d17f77 upstream.
When two keys have identical type and description, linking the second key
replaces the first in a keyring. However, attempting to unlink the first
key (no longer in the keyring) unlinks the second key.
This happens because __key_unlink_begin() calls assoc_array_delete() with
&key->index_key, matching only on type and description rather than the
key's identity.
Example:
keyctl new_session >/dev/null
keyctl newring ring_a @s
keyctl newring ring_b @s
A=$(keyctl add user A ss %:ring_a)
B=$(keyctl add user A qq %:ring_b)
keyctl newring R @s
keyctl link $A %:R
keyctl link $B %:R
keyctl unlink $A %:R
keyctl show
Verify the key identity before unlinking, and return -ENOENT on mismatch,
instead of unlinking the key with the wrong identity.
Cc: stable@vger.kernel.org
Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/r/20261020174325.2229448-4-jarkko@kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/keys/keyring.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -1506,9 +1506,15 @@ static int __key_unlink_begin(struct key
struct assoc_array_edit **_edit)
{
struct assoc_array_edit *edit;
+ const void *object;
BUG_ON(*_edit != NULL);
+ object = assoc_array_find(&keyring->keys, &keyring_assoc_array_ops,
+ &key->index_key);
+ if (!object || keyring_ptr_to_key(object) != key)
+ return -ENOENT;
+
edit = assoc_array_delete(&keyring->keys, &keyring_assoc_array_ops,
&key->index_key);
if (IS_ERR(edit))
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0564/1005] KEYS: Protect pkey method checks against type removal
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (562 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0563/1005] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0565/1005] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
` (434 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yuansheng Yang, Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuansheng Yang <0xbeac@gmail.com>
commit bab48a1044475f62d6e910c6d7267ce4bae847f9 upstream.
keyctl_pkey_query(), keyctl_pkey_e_d_s() and keyctl_pkey_verify() check
that key->type has the ->asym_*() method they need and call it later,
without holding key->sem. A reference keeps the key alive, but does not
pin the module that provides its type.
When that module is unloaded, unregister_key_type() waits for the key GC
to process every remaining key of the type. For each such key, the GC
takes key->sem for writing, switches key->type to key_type_dead, whose
->asym_*() methods are NULL, and destroys the payload. If that happens
between the check and the call, the keyctl calls a NULL method; if it
happens while the method runs, the method returns into freed module text.
In-tree, turris-signing-key provides ->asym_query() and ->asym_eds_op()
and can be built as a module.
Take key->sem for reading around each method call, and check the method
again under it, right before the call. While the lock is held the GC
cannot switch the key to key_type_dead, so unregister_key_type() and the
module unload cannot complete until the method returns. If the type is
already gone, the check finds key_type_dead and the keyctl fails with
-EOPNOTSUPP, as it does for any key type without the method.
memdup_user() and copy_to_user() stay outside key->sem, as in
keyctl_read_key(), so no page fault is taken with key->sem held. The
in-tree ->asym_*() methods do not take key->sem themselves. Nothing else
in the kernel calls these methods, so these four call sites are the full
coverage:
- keyctl_pkey_query(): ->asym_query() for KEYCTL_PKEY_QUERY
- keyctl_pkey_params_get_2(): ->asym_query(), and the op-specific check
for KEYCTL_PKEY_ENCRYPT, _DECRYPT, _SIGN and _VERIFY
- keyctl_pkey_e_d_s(): ->asym_eds_op() for _ENCRYPT, _DECRYPT and _SIGN
- keyctl_pkey_verify(): ->asym_verify_signature() for _VERIFY
This problem was recently fixed for keyctl_read_key() by 925c84e3cc21
("keys: Protect the read method check against type removal") and for
key_update() by aef3a8a4f988 ("KEYS: Protect the update method check
against type removal").
Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]")
Cc: stable@vger.kernel.org
Signed-off-by: Yuansheng Yang <0xbeac@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261110030252.9979-1-0xbeac@gmail.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/keys/keyctl_pkey.c | 100 +++++++++++++++++++++++++++++++++-----------
1 file changed, 76 insertions(+), 24 deletions(-)
--- a/security/keys/keyctl_pkey.c
+++ b/security/keys/keyctl_pkey.c
@@ -129,45 +129,77 @@ static int keyctl_pkey_params_get_2(cons
if (ret < 0)
return ret;
+ down_read(¶ms->key->sem);
+
+ if (!params->key->type->asym_query) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params->key->type->asym_query(params, &info);
if (ret < 0)
- return ret;
+ goto out_up_key_sem;
switch (op) {
case KEYCTL_PKEY_ENCRYPT:
if (uparams.in_len > info.max_dec_size ||
- uparams.out_len > info.max_enc_size)
- return -EINVAL;
+ uparams.out_len > info.max_enc_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_enc_size;
break;
case KEYCTL_PKEY_DECRYPT:
if (uparams.in_len > info.max_enc_size ||
- uparams.out_len > info.max_dec_size)
- return -EINVAL;
+ uparams.out_len > info.max_dec_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_dec_size;
break;
case KEYCTL_PKEY_SIGN:
if (uparams.in_len > info.max_data_size ||
- uparams.out_len > info.max_sig_size)
- return -EINVAL;
+ uparams.out_len > info.max_sig_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_sig_size;
break;
case KEYCTL_PKEY_VERIFY:
if (uparams.in_len > info.max_data_size ||
- uparams.in2_len > info.max_sig_size)
- return -EINVAL;
+ uparams.in2_len > info.max_sig_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_sig_size;
break;
default:
- return -EOPNOTSUPP;
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
}
params->in_len = uparams.in_len;
- return 0;
+
+ switch (op) {
+ case KEYCTL_PKEY_VERIFY:
+ if (!params->key->type->asym_verify_signature)
+ ret = -EOPNOTSUPP;
+ break;
+ case KEYCTL_PKEY_ENCRYPT:
+ case KEYCTL_PKEY_DECRYPT:
+ case KEYCTL_PKEY_SIGN:
+ if (!params->key->type->asym_eds_op)
+ ret = -EOPNOTSUPP;
+ break;
+ }
+
+out_up_key_sem:
+ up_read(¶ms->key->sem);
+ return ret;
}
/*
@@ -185,7 +217,16 @@ long keyctl_pkey_query(key_serial_t id,
if (ret < 0)
goto error;
+ down_read(¶ms.key->sem);
+ if (!params.key->type->asym_query) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params.key->type->asym_query(¶ms, &res);
+
+out_up_key_sem:
+ up_read(¶ms.key->sem);
if (ret < 0)
goto error;
@@ -230,10 +271,6 @@ long keyctl_pkey_e_d_s(int op,
if (ret < 0)
goto error_params;
- ret = -EOPNOTSUPP;
- if (!params.key->type->asym_eds_op)
- goto error_params;
-
switch (op) {
case KEYCTL_PKEY_ENCRYPT:
params.op = kernel_pkey_encrypt;
@@ -260,7 +297,16 @@ long keyctl_pkey_e_d_s(int op,
if (!out)
goto error_in;
+ down_read(¶ms.key->sem);
+ if (!params.key->type->asym_eds_op) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params.key->type->asym_eds_op(¶ms, in, out);
+
+out_up_key_sem:
+ up_read(¶ms.key->sem);
if (ret < 0)
goto error_out;
@@ -305,31 +351,37 @@ long keyctl_pkey_verify(const struct key
ret = keyctl_pkey_params_get_2(_params, _info, KEYCTL_PKEY_VERIFY,
¶ms);
if (ret < 0)
- goto error_params;
-
- ret = -EOPNOTSUPP;
- if (!params.key->type->asym_verify_signature)
- goto error_params;
+ goto out_free_params;
in = memdup_user(_in, params.in_len);
if (IS_ERR(in)) {
ret = PTR_ERR(in);
- goto error_params;
+ goto out_free_params;
}
in2 = memdup_user(_in2, params.in2_len);
if (IS_ERR(in2)) {
ret = PTR_ERR(in2);
- goto error_in;
+ goto out_free_in;
}
params.op = kernel_pkey_verify;
+ down_read(¶ms.key->sem);
+ if (!params.key->type->asym_verify_signature) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params.key->type->asym_verify_signature(¶ms, in, in2);
+out_up_key_sem:
+ up_read(¶ms.key->sem);
kfree(in2);
-error_in:
+
+out_free_in:
kfree(in);
-error_params:
+
+out_free_params:
keyctl_pkey_params_free(¶ms);
return ret;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0565/1005] bootconfig: Allow keys with the maximum supported depth
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (563 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0564/1005] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0566/1005] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
` (433 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhiqi Zhang,
Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhiqi Zhang <zhiqizhangg@gmail.com>
commit cab697164b47eecfa2f146024f5d661f99a1a1e7 upstream.
xbc_verify_tree() accepts keys with XBC_DEPTH_MAX (16) components,
but xbc_node_compose_key_after() returns -ERANGE immediately after
storing the sixteenth component. It rejects the key before discovering
that there are no more ancestors to collect.
For example, a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p = value can be attached
to an initrd successfully. However, bootconfig -l stops listing and
prints "Failed to compose key -34". In the kernel, the same error
propagates through copy_xbc_key_value_list() during its length probe,
so proc_boot_config_init() returns before creating /proc/bootconfig.
Check the array capacity before storing the next component. This lets
exactly XBC_DEPTH_MAX components be composed while retaining the check
before any out-of-bounds store.
I found this issue while reviewing bootconfig's depth handling and used
OpenAI Codex to verify the failure and develop the fix. I reviewed the
change and wrote and ran the regression tests.
Link: https://lore.kernel.org/all/20261104073742.21202-2-zhiqizhangg@gmail.com/
Fixes: 76db5a27a827 ("bootconfig: Add Extra Boot Config support")
Cc: stable@vger.kernel.org
Signed-off-by: Zhiqi Zhang <zhiqizhangg@gmail.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/bootconfig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -431,9 +431,9 @@ int __init xbc_node_compose_key_after(st
node = xbc_node_get_parent(node);
while (node && node != root) {
- keys[depth++] = xbc_node_index(node);
if (depth == XBC_DEPTH_MAX)
return -ERANGE;
+ keys[depth++] = xbc_node_index(node);
node = xbc_node_get_parent(node);
}
if (!node && root)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0566/1005] ALSA: caiaq: Kill EP1 URB before unregistering the input device
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (564 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0565/1005] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0567/1005] Revert "ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2" Greg Kroah-Hartman
` (432 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sergei Nizovtsev, Takashi Iwai
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergei Nizovtsev <snizovtsev@cloudlinux.com>
commit 5d325345185015024a86abca4cc5fa6a3f75294e upstream.
snd_disconnect() unregisters the input device via
snd_usb_caiaq_input_disconnect() and only afterwards kills the EP1
command URB (cdev->ep1_in_urb). The EP1 completion handler
usb_ep1_command_reply_dispatch() feeds snd_usb_caiaq_input_dispatch()
for EP1_CMD_READ_{ERP,ANALOG,IO} replies, which report into
cdev->input_dev. Since commit b04dcbb7f7b1 ("ALSA: caiaq: Use
snd_card_free_when_closed() at disconnection") the input device is
unregistered from snd_usb_caiaq_input_disconnect() but cdev->input_dev
is cleared only later, in snd_usb_caiaq_input_free() from the card
destructor. As the dispatch guard only tests cdev->input_dev for NULL,
an EP1 reply that completes after input_unregister_device() but before
cdev->ep1_in_urb is killed reports into an input device that has
already been unregistered and, with no evdev client holding it open,
freed.
Normally the window is closed by the USB core: usb_unbind_interface()
calls usb_disable_interface() before ->disconnect(), which flushes the
EP1 URB as long as endpoint 0x81 belongs to the interface being
unbound. But caiaq addresses EP1 through the device-wide pipe
usb_rcvbulkpipe(usb_dev, 0x1) without checking which interface owns
the endpoint. If a device declares it in another interface, the URB
stays live across snd_disconnect() of the interface that owns the card.
This needs a crafted device descriptor; a device that has EP1 in the
interface caiaq is bound to is not affected.
Kill cdev->ep1_in_urb (and the paired midi_out_urb) before the input
and audio disconnect helpers, so no EP1 completion can run once the
input device has been unregistered.
Reproduced under KASAN with raw-gadget + dummy_hcd emulating an Audio
Kontrol 1 (17cc:0815) with the EP1 bulk pair in interface 1: only
interface 0 was bound to snd-usb-caiaq and then unbound through sysfs
while the gadget flooded EP1 with EP1_CMD_READ_ERP replies. With no PCM
stream running the window is very short and was only hit by stalling
the unbinding CPU with a kgdb breakpoint at
snd_usb_caiaq_audio_disconnect(). With the fix applied, the same test
runs clean.
BUG: KASAN: slab-use-after-free in input_event+0x3a/0xc0
Read of size 8 at addr ffff8880151a4028 by task sh/118
Call Trace:
<IRQ>
input_event+0x3a/0xc0
snd_usb_caiaq_input_dispatch+0xab2/0xf00
usb_ep1_command_reply_dispatch+0x1f3/0x580
__usb_hcd_giveback_urb+0x246/0x400
dummy_timer+0x1415/0x3380
__hrtimer_run_queues+0x39d/0x800
hrtimer_run_softirq+0x187/0x2d0
handle_softirqs+0x1ff/0x930
__irq_exit_rcu+0x15b/0x210
irq_exit_rcu+0xe/0x20
sysvec_apic_timer_interrupt+0x81/0xb0
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x1a/0x20
RIP: 0010:snd_usb_caiaq_audio_disconnect+0x0/0x70
snd_disconnect+0x81/0x110
usb_unbind_interface+0x1a0/0x860
device_release_driver_internal+0x2c5/0x470
unbind_store+0xde/0x100
</TASK>
Allocated by task 80:
input_allocate_device+0x47/0x340
snd_usb_caiaq_input_init+0x4c/0x1ac0
snd_probe+0xab3/0x1160
usb_probe_interface+0x2ea/0x810
Freed by task 118:
kfree+0x1ea/0x5c0
input_dev_release+0xab/0xd0
device_release+0xcf/0x250
kobject_put+0x169/0x320
snd_disconnect+0x79/0x110
usb_unbind_interface+0x1a0/0x860
Fixes: b04dcbb7f7b1 ("ALSA: caiaq: Use snd_card_free_when_closed() at disconnection")
Cc: stable@vger.kernel.org
Signed-off-by: Sergei Nizovtsev <snizovtsev@cloudlinux.com>
Assisted-by: Claude:claude-opus-4-8
Link: https://patch.msgid.link/20261112094904.2430318-1-snizovtsev@cloudlinux.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/caiaq/device.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -593,14 +593,19 @@ static void snd_disconnect(struct usb_in
snd_card_disconnect(card);
+ /*
+ * Kill the EP1 URB before disconnecting the input device: its
+ * completion reports into cdev->input_dev, which input_disconnect()
+ * frees without clearing the pointer.
+ */
+ usb_kill_urb(cdev->ep1_in_urb);
+ usb_kill_urb(cdev->midi_out_urb);
+
#ifdef CONFIG_SND_USB_CAIAQ_INPUT
snd_usb_caiaq_input_disconnect(cdev);
#endif
snd_usb_caiaq_audio_disconnect(cdev);
- usb_kill_urb(cdev->ep1_in_urb);
- usb_kill_urb(cdev->midi_out_urb);
-
snd_card_free_when_closed(card);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0567/1005] Revert "ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2"
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (565 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0566/1005] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0568/1005] ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone Greg Kroah-Hartman
` (431 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit d1a1f361e08311f6d9a4aea2da2d1bcb3891f4ef upstream.
This reverts commit 82cfab6a52621febf36752bd5ed5184f82c96e07.
The quirk entry seems matching with other multiple irrelevant models
that lead to a regression on those.
Maybe we should use HDA_CODEC_QUIRK() entry for the corresponding
codec SSID, instead. But let's revert for addressing the regression
at first.
Fixes: 82cfab6a5262 ("ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2")
Closes: https://lore.kernel.org/71fb1e29-60e1-4522-a071-c53557cea39b@icloud.com
Closes: https://lore.kernel.org/CABWzDrqrskmtb7MVFgJ54k4WNSqby7Qo3R1XeoVBaJ+djaO1ew@mail.gmail.com
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20261112124844.694544-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/codecs/cirrus/cs420x.c | 2 --
1 file changed, 2 deletions(-)
--- a/sound/hda/codecs/cirrus/cs420x.c
+++ b/sound/hda/codecs/cirrus/cs420x.c
@@ -571,7 +571,6 @@ static const struct hda_model_fixup cs42
static const struct hda_quirk cs4208_fixup_tbl[] = {
SND_PCI_QUIRK_VENDOR(0x106b, "Apple", CS4208_MAC_AUTO),
- SND_PCI_QUIRK(0x8086, 0x7270, "MacBookAir 7,2", CS4208_MAC_AUTO),
{} /* terminator */
};
@@ -584,7 +583,6 @@ static const struct hda_quirk cs4208_mac
SND_PCI_QUIRK(0x106b, 0x7800, "MacPro 6,1", CS4208_MACMINI),
SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11),
SND_PCI_QUIRK(0x106b, 0x7f00, "iMac 16,1", CS4208_MBP11),
- SND_PCI_QUIRK(0x8086, 0x7270, "MacBookAir 7,2", CS4208_MBA6),
{} /* terminator */
};
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0568/1005] ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (566 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0567/1005] Revert "ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2" Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0569/1005] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
` (430 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Angel J, Takashi Iwai
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Angel J <iamanaws@httpd.dev>
commit ae28ba98f55a2f30fed57371899b8cecd7cbde64 upstream.
The Dell XPS 8940 (1028:09c5) has an ALC3861 codec (0x10ec0899).
Its BIOS marks the headset microphone pin at NID 0x19 as disconnected
(0x411111f0). With no external microphone input in the pin configuration,
the generic parser creates a shared headphone/mic input on NID 0x1b
instead. Headphone playback works, but the headset microphone is silent.
Override NID 0x19 as a front microphone without independent presence
detection. This gives the generic parser the dedicated microphone
input and preserves NID 0x1b for simultaneous headphone playback.
I encountered this issue on my XPS 8940. Similar symptoms were also
reported by a user on Ubuntu:
https://bugs.launchpad.net/bugs/1971232
Cc: stable@vger.kernel.org
Assisted-by: Codex (GPT-6.1 Sol)
Signed-off-by: Angel J <iamanaws@httpd.dev>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261103150336.507675-1-iamanaws@httpd.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/codecs/realtek/alc882.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/sound/hda/codecs/realtek/alc882.c
+++ b/sound/hda/codecs/realtek/alc882.c
@@ -50,6 +50,7 @@ enum {
ALC889_FIXUP_MP41_VREF,
ALC882_FIXUP_INV_DMIC,
ALC882_FIXUP_NO_PRIMARY_HP,
+ ALC898_FIXUP_DELL_XPS8940_MIC,
ALC887_FIXUP_ASUS_BASS,
ALC887_FIXUP_BASS_CHMAP,
ALC1220_FIXUP_GB_DUAL_CODECS,
@@ -507,6 +508,13 @@ static const struct hda_fixup alc882_fix
.type = HDA_FIXUP_FUNC,
.v.func = alc882_fixup_no_primary_hp,
},
+ [ALC898_FIXUP_DELL_XPS8940_MIC] = {
+ .type = HDA_FIXUP_PINS,
+ .v.pins = (const struct hda_pintbl[]) {
+ { 0x19, 0x02a19130 }, /* headset mic, no separate jack detect */
+ {}
+ },
+ },
[ALC887_FIXUP_ASUS_BASS] = {
.type = HDA_FIXUP_PINS,
.v.pins = (const struct hda_pintbl[]) {
@@ -610,6 +618,8 @@ static const struct hda_quirk alc882_fix
SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
+ SND_PCI_QUIRK(0x1028, 0x09c5, "Dell XPS 8940",
+ ALC898_FIXUP_DELL_XPS8940_MIC),
SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0569/1005] ALSA: usb-audio: Drop capture packets with bogus actual_length
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (567 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0568/1005] ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0570/1005] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set Greg Kroah-Hartman
` (429 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Gichoon Han, Takashi Iwai
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gichoon Han <gichoon.han@samsung.com>
commit eed0e9583a290e6adbe3a8480bdae911f31e1ed9 upstream.
retire_capture_urb() copies urb->iso_frame_desc[i].actual_length bytes
out of urb->transfer_buffer at the packet's offset, but never checks
that value against the requested packet length. A host controller
reporting more data than requested makes memcpy() read past the end
of the URB transfer buffer.
Commit 06be918062ad ("ALSA: usb-audio: Bound packet copies by the PCM
buffer size") clamps the count to the PCM ring buffer size, which
protects the destination. The source slot is only ep->curpacksize
bytes per packet, though, so the over-read remains.
This was hit on an ARM32 system (vendor 5.4 kernel; the code path is
unchanged in mainline) with a full-speed UAC1 microphone behind a
high-speed hub, i.e. the EHCI siTD path. sitd_complete() computes
actual_length as desc->length - SITD_LENGTH(t); the controller
reported a remaining length larger than the programmed one, the value
wrapped to ~4G, and the capture copy faulted on the first unmapped
page after the URB buffer:
Unable to handle kernel paging request at virtual address e8756000
Internal error: Oops: 7 [#1] PREEMPT SMP ARM
r3 : 00000000 r2 : 0001e700 r1 : e8756000 r0 : e878fc80
Code: ba000002 f5d1f03c f5d1f05c f5d1f07c (e8b151f8)
A packet can never legitimately carry more than its requested length,
so warn and skip it instead of copying.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Gichoon Han <gichoon.han@samsung.com>
Link: https://patch.msgid.link/20261110060021.2146383-1-gichoon.han@samsung.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/pcm.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -1337,6 +1337,12 @@ static void retire_capture_urb(struct sn
"frame %d active: %d\n", i,
urb->iso_frame_desc[i].status);
bytes = urb->iso_frame_desc[i].actual_length;
+ if (unlikely(bytes > urb->iso_frame_desc[i].length)) {
+ dev_warn_ratelimited(&subs->dev->dev,
+ "packet %d: actual_length %u exceeds length %u, dropping\n",
+ i, bytes, urb->iso_frame_desc[i].length);
+ continue;
+ }
if (subs->stream_offset_adj > 0) {
unsigned int adj = min(subs->stream_offset_adj, bytes);
cp += adj;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0570/1005] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (568 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0569/1005] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0571/1005] selftests/ftrace: Add missing spaces after ! in probe syntax tests Greg Kroah-Hartman
` (428 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrew Davison, Takashi Iwai
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Davison <andy@dvsn.net>
commit fda103c1432f344e1cd548f346d157b1e67ee7c5 upstream.
parse_codec_mode() reads the vendor and subsystem IDs of a patch file's
[codec] line into an int, and skips the check when the value is zero or
negative, as documented. An ID with bit 31 set, such as SigmaTel's
0x8384xxxx or Intel's 0x8086xxxx, comes out negative, so it is taken as
a wildcard and the section is applied to every codec instead of the one
it names.
This was seen on an OpenPeak OpenFrame 2 with an IDT 92HD75B2X5
(0x111d7608). A patch file written for the STAC9202 (0x83847632) in the
related OpenFrame 1 was applied to it, swapping the headphone and
speaker pin configurations, so auto-mute never muted the speaker.
Read the IDs as long long, so real IDs are compared exactly. Values
written as negative numbers (e.g. -1) still act as wildcards, as
documented; a hex value such as 0xffffffff is now compared as written.
Tested on 6.18.60 on an OpenFrame 2, with a rebuilt snd-hda-codec and
the STAC9202 patch file: user_pin_configs stays empty for the IDT codec,
and the headphone and line-out pins are assigned as the BIOS sets them.
Not tested on a STAC9202 itself.
The bug was tracked down and this fix written with an AI coding
assistant (Claude Code, Claude Opus 5.5), which also ran the tests
above. I have reviewed the change and the tests.
Fixes: ef940b0403d4 ("ALSA: hda - Allow patching with any vendor/subsystem ids")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Davison <andy@dvsn.net>
Link: https://patch.msgid.link/20261106175518.18629-1-andy@dvsn.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/common/sysfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/sound/hda/common/sysfs.c
+++ b/sound/hda/common/sysfs.c
@@ -512,11 +512,12 @@ static inline int strmatch(const char *a
static void parse_codec_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{
- int vendorid, subid, caddr;
+ long long vendorid, subid;
+ int caddr;
struct hda_codec *codec;
*codecp = NULL;
- if (sscanf(buf, "%i %i %i", &vendorid, &subid, &caddr) == 3) {
+ if (sscanf(buf, "%lli %lli %i", &vendorid, &subid, &caddr) == 3) {
list_for_each_codec(codec, bus) {
if ((vendorid <= 0 || codec->core.vendor_id == vendorid) &&
(subid <= 0 || codec->core.subsystem_id == subid) &&
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0571/1005] selftests/ftrace: Add missing spaces after ! in probe syntax tests
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (569 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0570/1005] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0572/1005] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
` (427 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jaewon Jung,
Masami Hiramatsu (Google), Shuah Khan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaewon Jung <jaewon8868@gmail.com>
commit 36990c8fda77d918b1e52d5d6df3a144b552d86e upstream.
Add the missing space between ! and grep. Otherwise, the shell tries
to run !grep and reports "!grep: not found". This always skips the
conditional checks without checking for kernel return probe argument
support.
Link: https://lore.kernel.org/r/20261025075044.1750113-1-jaewon8868@gmail.com
Fixes: 25f00e40ce79 ("tracing/probes: Support $argN in return probe (kprobe and fprobe)")
Cc: stable@vger.kernel.org
Signed-off-by: Jaewon Jung <jaewon8868@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc | 4 ++--
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--- a/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
+++ b/tools/testing/selftests/ftrace/test.d/dynevent/fprobe_syntax_errors.tc
@@ -33,7 +33,7 @@ check_error 'f vfs_read ^$stack10000' #
check_error 'f vfs_read ^$arg10000' # BAD_ARG_NUM
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
check_error 'f vfs_read $retval ^$arg1' # BAD_VAR
fi
check_error 'f vfs_read ^$none_var' # BAD_VAR
@@ -100,7 +100,7 @@ if grep -q "<argname>" README; then
check_error 'f vfs_read args=^$arg*' # BAD_VAR_ARGS
check_error 'f vfs_read +0(^$arg*)' # BAD_VAR_ARGS
check_error 'f vfs_read $arg* ^$arg*' # DOUBLE_ARGS
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
check_error 'f vfs_read%return ^$arg*' # NOFENTRY_ARGS
fi
check_error 'f vfs_read ^hoge' # NO_BTFARG
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
@@ -108,7 +108,7 @@ if grep -q "<argname>" README; then
check_error 'p vfs_read args=^$arg*' # BAD_VAR_ARGS
check_error 'p vfs_read +0(^$arg*)' # BAD_VAR_ARGS
check_error 'p vfs_read $arg* ^$arg*' # DOUBLE_ARGS
-if !grep -q 'kernel return probes support:' README; then
+if ! grep -q 'kernel return probes support:' README; then
check_error 'r vfs_read ^$arg*' # NOFENTRY_ARGS
fi
check_error 'p vfs_read+20 ^$arg*' # NOFENTRY_ARGS
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0572/1005] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (570 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0571/1005] selftests/ftrace: Add missing spaces after ! in probe syntax tests Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0573/1005] kprobes: Fix error return and slot leak in __register_kprobe() Greg Kroah-Hartman
` (426 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Steven Rostedt,
Masami Hiramatsu (Google), Shuah Khan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <rostedt@goodmis.org>
commit 88d5f8cb8a6276194ac8c1de44f3ed77d7e938ce upstream.
The checkbashism is giving a false positive to the kprobe test of:
($"foo" should be eval_gettext "foo"):
if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then
This is because it sees the $" at the end of the grep as a bash symbol.
Instead, escape the '$' with a backslash as it is within quotes and that
'$' is for grep to process an end of line character and not a bash
variable.
Link: https://lore.kernel.org/r/20261029211218.3749963a@fedora
Cc: stable@vger.kernel.org
Fixes: d22c3e0088e85 ("selftests/ftrace: Fix unique symbol check in kprobe_non_uniq_symbol.tc")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
@@ -6,7 +6,7 @@
SYMBOL='name_show'
# We skip this test on kernel where SYMBOL is unique or does not exist.
-if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then
+if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}\$" /proc/kallsyms)" -le '1' ]; then
exit_unsupported
fi
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0573/1005] kprobes: Fix error return and slot leak in __register_kprobe()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (571 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0572/1005] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0574/1005] kprobes: Fix double free and NULL deref in unregister_kretprobes() Greg Kroah-Hartman
` (425 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 6a658cc2d605e5acf35e638c62f480460d5939cd upstream.
When arm_kprobe() fails in __register_kprobe(), the probe is removed
from kprobe_table and synchronize_rcu() is executed, but the error code
ret was ignored and try_to_optimize_kprobe(p) was executed, returning 0.
Additionally, the instruction slot allocated by prepare_kprobe() was
leaked.
Fix this by releasing the instruction slot via arch_remove_kprobe(p)
and returning ret when arm_kprobe() fails.
Link: https://lore.kernel.org/all/179375030756.247640.10859474201266455798.stgit@devnote2/
Fixes: 587e8e6d640b ("kprobes: Adopt guard() and scoped_guard()")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/kprobes.c | 2 ++
1 file changed, 2 insertions(+)
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1711,6 +1711,8 @@ static int __register_kprobe(struct kpro
if (ret) {
hlist_del_rcu(&p->hlist);
synchronize_rcu();
+ arch_remove_kprobe(p);
+ return ret;
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0574/1005] kprobes: Fix double free and NULL deref in unregister_kretprobes()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (572 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0573/1005] kprobes: Fix error return and slot leak in __register_kprobe() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0575/1005] kprobes: Validate re-registration earlier in register_kretprobe() Greg Kroah-Hartman
` (424 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 2053bac1d6e47b33fa2e570c87518395e64f7da0 upstream.
In unregister_kretprobes(), if __unregister_kprobe_top() returns an error
(e.g., if the kretprobe was not registered or was already unregistered),
rethook_free(rps[i]->rh) or rcu_assign_pointer(rps[i]->rph->rp, NULL) is
still executed. For rethook-based kretprobes, calling rethook_free() on an
already-freed rethook causes a double-free / list corruption in RCU. For
legacy kretprobes, rps[i]->rph is NULL after previous cleanup, resulting
in a NULL pointer dereference.
Skip rethook_free() and rph cleanup if __unregister_kprobe_top() fails,
and clear rps[i]->rh after synchronize_rcu() has waited for in-flight
pre_handler_kretprobe() invocations to complete.
Link: https://lore.kernel.org/all/179375031660.247640.6349602689169856649.stgit@devnote2/
Fixes: 73f9b911faa7 ("kprobes: Use rethook for kretprobe if possible")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/kprobes.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -2370,8 +2370,10 @@ void unregister_kretprobes(struct kretpr
for (i = 0; i < num; i++) {
guard(mutex)(&kprobe_mutex);
- if (__unregister_kprobe_top(&rps[i]->kp) < 0)
+ if (__unregister_kprobe_top(&rps[i]->kp) < 0) {
rps[i]->kp.addr = NULL;
+ continue;
+ }
#ifdef CONFIG_KRETPROBE_ON_RETHOOK
rethook_free(rps[i]->rh);
#else
@@ -2383,7 +2385,9 @@ void unregister_kretprobes(struct kretpr
for (i = 0; i < num; i++) {
if (rps[i]->kp.addr) {
__unregister_kprobe_bottom(&rps[i]->kp);
-#ifndef CONFIG_KRETPROBE_ON_RETHOOK
+#ifdef CONFIG_KRETPROBE_ON_RETHOOK
+ rps[i]->rh = NULL;
+#else
free_rp_inst(rps[i]);
#endif
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0575/1005] kprobes: Validate re-registration earlier in register_kretprobe()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (573 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0574/1005] kprobes: Fix double free and NULL deref in unregister_kretprobes() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0576/1005] mmc: jz4740: Remove the host before resetting the controller Greg Kroah-Hartman
` (423 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit a553b499f22bf054964d4fd16d136f3d4f836c23 upstream.
register_kretprobe() only checked for re-registration if rp->kp.addr was
specified, skipping the check when rp was registered with symbol_name
and rp->kp.addr was NULL. In that scenario, register_kretprobe()
proceeded to allocate a new rethook (or kretprobe holder), and when
register_kprobe(&rp->kp) subsequently failed due to re-registration, the
error path freed and NULL-ed rp->rh (or rp->rph) on the still-active
kretprobe, leading to NULL pointer dereferences when the active probe
was hit.
Resolve the target address via _kprobe_addr() up-front and check whether
the probe is already registered at that address via
check_kprobe_rereg_at() before allocating any resources, and drop the
WARN_ON_ONCE() in the re-registration check now that re-registration is
gracefully detected and rejected.
Link: https://lore.kernel.org/all/179375032568.247640.17429793187163536192.stgit@devnote2/
Fixes: 0188b87899ff ("kretprobe: Avoid re-registration of the same kretprobe earlier")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/kprobes.c | 72 ++++++++++++++++++++++++++++++-------------------------
1 file changed, 40 insertions(+), 32 deletions(-)
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1558,52 +1558,61 @@ _kprobe_addr(kprobe_opcode_t *addr, cons
return addr;
}
-static kprobe_opcode_t *kprobe_addr(struct kprobe *p)
-{
- bool on_func_entry;
-
- return _kprobe_addr(p->addr, p->symbol_name, p->offset, &on_func_entry);
-}
-
/*
* Check the 'p' is valid and return the aggregator kprobe
* at the same address.
*/
-static struct kprobe *__get_valid_kprobe(struct kprobe *p)
+static struct kprobe *__get_valid_kprobe_at(struct kprobe *p, kprobe_opcode_t *addr)
{
+ struct hlist_head *head;
struct kprobe *ap, *list_p;
lockdep_assert_held(&kprobe_mutex);
- ap = get_kprobe(p->addr);
- if (unlikely(!ap))
+ if (unlikely(!addr))
return NULL;
- if (p == ap)
- return ap;
-
- list_for_each_entry(list_p, &ap->list, list)
- if (list_p == p)
- /* kprobe p is a valid probe */
+ head = &kprobe_table[hash_ptr(addr, KPROBE_HASH_BITS)];
+ hlist_for_each_entry_rcu(ap, head, hlist,
+ lockdep_is_held(&kprobe_mutex)) {
+ if (ap == p) {
+ p->addr = addr;
return ap;
+ }
+ if (ap->addr == addr && kprobe_aggrprobe(ap)) {
+ list_for_each_entry(list_p, &ap->list, list) {
+ if (list_p == p) {
+ p->addr = addr;
+ return ap;
+ }
+ }
+ }
+ }
return NULL;
}
-/*
- * Warn and return error if the kprobe is being re-registered since
- * there must be a software bug.
- */
-static inline int warn_kprobe_rereg(struct kprobe *p)
+static inline struct kprobe *__get_valid_kprobe(struct kprobe *p)
+{
+ return __get_valid_kprobe_at(p, p->addr);
+}
+
+/* Return error if the kprobe is being re-registered */
+static inline int check_kprobe_rereg_at(struct kprobe *p, kprobe_opcode_t *addr)
{
guard(mutex)(&kprobe_mutex);
- if (WARN_ON_ONCE(__get_valid_kprobe(p)))
+ if (__get_valid_kprobe_at(p, addr))
return -EINVAL;
return 0;
}
+static inline int check_kprobe_rereg(struct kprobe *p)
+{
+ return check_kprobe_rereg_at(p, p->addr);
+}
+
static int check_ftrace_location(struct kprobe *p)
{
unsigned long addr = (unsigned long)p->addr;
@@ -1734,7 +1743,7 @@ int register_kprobe(struct kprobe *p)
return PTR_ERR(addr);
p->addr = addr;
- ret = warn_kprobe_rereg(p);
+ ret = check_kprobe_rereg(p);
if (ret)
return ret;
@@ -2270,20 +2279,19 @@ int register_kretprobe(struct kretprobe
int ret;
int i;
void *addr;
+ bool on_func_entry;
- ret = kprobe_on_func_entry(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset);
- if (ret)
- return ret;
+ addr = _kprobe_addr(rp->kp.addr, rp->kp.symbol_name, rp->kp.offset, &on_func_entry);
+ if (IS_ERR(addr))
+ return PTR_ERR(addr);
+
+ if (!on_func_entry)
+ return -EINVAL;
- /* If only 'rp->kp.addr' is specified, check reregistering kprobes */
- if (rp->kp.addr && warn_kprobe_rereg(&rp->kp))
+ if (check_kprobe_rereg_at(&rp->kp, addr))
return -EINVAL;
if (kretprobe_blacklist_size) {
- addr = kprobe_addr(&rp->kp);
- if (IS_ERR(addr))
- return PTR_ERR(addr);
-
for (i = 0; kretprobe_blacklist[i].name != NULL; i++) {
if (kretprobe_blacklist[i].addr == addr)
return -EINVAL;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0576/1005] mmc: jz4740: Remove the host before resetting the controller
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (574 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0575/1005] kprobes: Validate re-registration earlier in register_kretprobe() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0577/1005] mmc: sdhci-brcmstb: dont log an error for missing BOOT registers Greg Kroah-Hartman
` (422 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Olivier Louvignes, Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Louvignes <olivier@mgcrea.io>
commit 6b8b1e8827837bf4cf1f87219038fddae9e81b0b upstream.
jz4740_mmc_remove() masks every interrupt and resets the controller
before mmc_remove_host(), which removes the card and lets the card's
driver send its last commands. Those commands then run on a controller
that was just reset, and can wait out the driver's 5 s request timeout.
With an SDIO card that cost 5 s on every unbind: on a HiBy R1 (Ingenic
X1600, a BCM43430A1 driven by brcmfmac), the CMD52 that
sdio_release_irq() sends from brcmfmac's remove waited 5.1 s. The
command had finished (END_CMD_RES set in MSC_STAT), but MSC_IMASK read
0xffffffff although the request had unmasked END_CMD_RES. MSC_STAT can
still show IS_RESETTING after jz4740_mmc_reset() returns, so the reset
most likely completed after that write and undid it.
Remove the host first, then quiesce the controller, as other host
drivers do. On the R1, unbinding the Wi-Fi's MSC now takes 0.65 s.
Fixes: 61bfbdb85687 ("MMC: Add support for the controller on JZ4740 SoCs.")
Cc: stable@vger.kernel.org
Signed-off-by: Olivier Louvignes <olivier@mgcrea.io>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/jz4740_mmc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -1151,12 +1151,13 @@ static void jz4740_mmc_remove(struct pla
{
struct jz4740_mmc_host *host = platform_get_drvdata(pdev);
+ /* The card's driver may still send commands as it goes */
+ mmc_remove_host(host->mmc);
+
timer_delete_sync(&host->timeout_timer);
jz4740_mmc_set_irq_enabled(host, 0xff, false);
jz4740_mmc_reset(host);
- mmc_remove_host(host->mmc);
-
free_irq(host->irq, host);
if (host->use_dma)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0577/1005] mmc: sdhci-brcmstb: dont log an error for missing BOOT registers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (575 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0576/1005] mmc: jz4740: Remove the host before resetting the controller Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0578/1005] mmc: sunxi: fix clock and runtime PM leaks on probe failure Greg Kroah-Hartman
` (421 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Gregor Herburger,
Adrian Hunter, Florian Fainelli, Kamal Dasu, Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
commit cf4a8d8b82db7f8e88e6ef4f3020a72860a9c440 upstream.
The BOOT register range is optional: the probe function ignores a
failure to map it and the suspend/resume code checks for NULL. It is
mapped with devm_platform_get_and_ioremap_resource(), though, which
calls dev_err_probe() when the resource does not exist. Every
non-removable host without a third reg entry therefore logs an error
at probe time and then works normally.
The binding only describes the "host" and "cfg" ranges, so this is the
case for the in-tree users. On the Raspberry Pi 5 family (BCM2712),
where the SDIO host of the Wi-Fi module is non-removable, each boot
prints:
sdhci-brcmstb 1001100000.mmc: error -EINVAL: invalid resource (null)
Look the resource up with platform_get_resource() first and map it only
when it is present. Hosts that do have the range are mapped by the same
two calls as before.
Fixes: b7e614802e3f ("mmc: sdhci-brcmstb: save and restore registers during PM")
Cc: stable@vger.kernel.org
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Gregor Herburger <gregor.herburger@linutronix.de>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/sdhci-brcmstb.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/drivers/mmc/host/sdhci-brcmstb.c
+++ b/drivers/mmc/host/sdhci-brcmstb.c
@@ -491,6 +491,7 @@ static int sdhci_brcmstb_probe(struct pl
struct sdhci_brcmstb_priv *priv;
u32 actual_clock_mhz;
struct sdhci_host *host;
+ struct resource *boot_res;
struct clk *clk;
struct clk *base_clk = NULL;
int res;
@@ -534,9 +535,13 @@ static int sdhci_brcmstb_probe(struct pl
/* map non-standard BOOT registers if present */
if (host->mmc->caps & MMC_CAP_NONREMOVABLE) {
- priv->boot_regs = devm_platform_get_and_ioremap_resource(pdev, 2, NULL);
- if (IS_ERR(priv->boot_regs))
- priv->boot_regs = NULL;
+ boot_res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
+ if (boot_res) {
+ priv->boot_regs = devm_ioremap_resource(&pdev->dev,
+ boot_res);
+ if (IS_ERR(priv->boot_regs))
+ priv->boot_regs = NULL;
+ }
}
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0578/1005] mmc: sunxi: fix clock and runtime PM leaks on probe failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (576 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0577/1005] mmc: sdhci-brcmstb: dont log an error for missing BOOT registers Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0579/1005] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
` (420 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Anfernee Cao, Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anfernee Cao <anferneemelokc5@gmail.com>
commit e35e360bd66898a977c296ab71fe4bae17ddceb7 upstream.
sunxi_mmc_resource_request() enables the bus, card, output and sample
clocks before returning. Several failure paths later in
sunxi_mmc_probe() leave them running:
- If devm_request_threaded_irq() fails, the clocks enabled by
sunxi_mmc_enable() are never disabled.
- If dma_alloc_coherent(), mmc_of_parse() or sunxi_mmc_init_host()
fails, probe only frees the DMA buffer and the mmc_host.
- If mmc_add_host() fails, runtime PM has already been enabled, but
pm_runtime_disable() is never called.
Besides leaking the clocks, this leaves the clock enable counts
unbalanced, so a reprobe (for example after -EPROBE_DEFER) calls
clk_prepare_enable() on the same clocks again.
Disable the IRQ and the clocks in the probe error path, and disable
runtime PM on the mmc_add_host() failure path. Also handle a failure of
devm_request_threaded_irq() in sunxi_mmc_resource_request().
Tested with QEMU's orangepi-pc machine: with forced sunxi_mmc_init_host()
and mmc_add_host() failures the MMC clocks stay disabled in clk_summary,
and a normal probe with an emulated SD card still works.
This issue was found by manual code inspection.
Fixes: 3cbcb16095f9 ("mmc: sunxi: Add driver for SD/MMC hosts found on Allwinner sunxi SoCs")
Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Anfernee Cao <anferneemelokc5@gmail.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/sunxi-mmc.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1354,8 +1354,13 @@ static int sunxi_mmc_resource_request(st
goto error_disable_mmc;
}
- return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
- sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);
+ ret = devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
+ sunxi_mmc_handle_manual_stop, 0,
+ "sunxi-mmc", host);
+ if (ret)
+ goto error_disable_mmc;
+
+ return 0;
error_disable_mmc:
sunxi_mmc_disable(host);
@@ -1385,9 +1390,11 @@ static int sunxi_mmc_probe(struct platfo
host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE,
&host->sg_dma, GFP_KERNEL);
- if (!host->sg_cpu)
- return dev_err_probe(&pdev->dev, -ENOMEM,
- "Failed to allocate DMA descriptor mem\n");
+ if (!host->sg_cpu) {
+ ret = dev_err_probe(&pdev->dev, -ENOMEM,
+ "Failed to allocate DMA descriptor mem\n");
+ goto error_disable_mmc;
+ }
if (host->cfg->ccu_has_timings_switch) {
/*
@@ -1467,7 +1474,7 @@ static int sunxi_mmc_probe(struct platfo
ret = mmc_add_host(mmc);
if (ret)
- goto error_free_dma;
+ goto error_disable_rpm;
dev_info(&pdev->dev, "initialized, max. request size: %u KB%s\n",
mmc->max_req_size >> 10,
@@ -1475,8 +1482,13 @@ static int sunxi_mmc_probe(struct platfo
return 0;
+error_disable_rpm:
+ pm_runtime_disable(&pdev->dev);
error_free_dma:
dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
+error_disable_mmc:
+ disable_irq(host->irq);
+ sunxi_mmc_disable(host);
return ret;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0579/1005] mmc: mmci: fix DMA channel leak when mmc_add_host() fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (577 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0578/1005] mmc: sunxi: fix clock and runtime PM leaks on probe failure Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0580/1005] mmc: omap: synchronize clock timer before disabling fclk Greg Kroah-Hartman
` (419 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Anfernee Cao, Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anfernee Cao <anferneemelokc5@gmail.com>
commit 2d8927fadbf95e2d2dfa95bcc73882d6e19c2ce4 upstream.
mmci_probe() calls mmci_dma_setup(), which acquires the RX and TX DMA
channels via dma_request_chan(). These channels are not managed by
devres, and are released only by mmci_dma_release().
If the following mmc_add_host() fails, probe jumps to the clk_disable
label, which only disables the clock. As probe then fails,
mmci_remove() is never called, so both DMA channels are leaked.
Release them by adding a dedicated unwind label, reached only after
mmci_dma_setup().
This issue was found by manual code inspection.
Fixes: b38a20f29a49 ("mmc: mmci: fix return value check of mmc_add_host()")
Cc: stable@vger.kernel.org
Signed-off-by: Anfernee Cao <anferneemelokc5@gmail.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/mmci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -2477,11 +2477,13 @@ static int mmci_probe(struct amba_device
ret = mmc_add_host(mmc);
if (ret)
- goto clk_disable;
+ goto dma_release;
pm_runtime_put(&dev->dev);
return 0;
+dma_release:
+ mmci_dma_release(host);
clk_disable:
clk_disable_unprepare(host->clk);
return ret;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0580/1005] mmc: omap: synchronize clock timer before disabling fclk
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (578 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0579/1005] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0581/1005] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
` (418 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Runyu Xiao, Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Runyu Xiao <runyu.xiao@seu.edu.cn>
commit c931c51681e33b24bc8d65c6df35b70e1827daa2 upstream.
mmc_omap_select_slot() removes clk_timer with timer_delete() before
switching slots and changing the functional clock state. timer_delete()
only removes a pending timer and does not wait for a callback that is
already running.
If mmc_omap_clk_timer() is already running, it can therefore call
mmc_omap_fclk_enable() while the request or slot-switch path changes the
same clock state. During host removal, the same window can overlap the
final clock shutdown.
Use timer_delete_sync() so the callback has completed before slot switching
or changing the functional clock state. Keep the timer restartable for
normal request handling.
Fixes: 0807a9b5739a ("MMC: OMAP: Lazy clock shutdown")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/omap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -214,7 +214,7 @@ static void mmc_omap_select_slot(struct
host->mmc = slot->mmc;
spin_unlock_irqrestore(&host->slot_lock, flags);
no_claim:
- timer_delete(&host->clk_timer);
+ timer_delete_sync(&host->clk_timer);
if (host->current_slot != slot || !claimed)
mmc_omap_fclk_offdelay(host->current_slot);
@@ -273,7 +273,7 @@ static void mmc_omap_release_slot(struct
/* Keeps clock running for at least 8 cycles on valid freq */
mod_timer(&host->clk_timer, jiffies + HZ/10);
else {
- timer_delete(&host->clk_timer);
+ timer_delete_sync(&host->clk_timer);
mmc_omap_fclk_offdelay(slot);
mmc_omap_fclk_enable(host, 0);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0581/1005] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (579 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0580/1005] mmc: omap: synchronize clock timer before disabling fclk Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0582/1005] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
` (417 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Hunter, Ian Ray, Haibo Chen,
Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Ray <ian.ray@gehealthcare.com>
commit d35d93c2902592a84347a15deac4d67a323694c9 upstream.
Since commit 5a52c5701a67 ("mmc: core: Fix host controller programming
for fixed driver type"), the eMMC driver strength is passed directly to
mmc_set_driver_type(), which propagates the value through ios.drv_type
all the way to sdhci_set_ios(). For value 4, SDHCI correctly warns:
mmc2: invalid driver type, default to driver type B
The host driver type has no effect on this controller: esdhc_writew_le()
never programs the driver-type field of SDHCI_HOST_CONTROL2. Hook
set_ios() and force drv_type to the always-valid Type B, so that SDHCI
never sees an unsupported value.
Tested on i.MX8MP (usdhc3, eMMC in HS400) with
`fixed-emmc-driver-type = <4>`: the warning is gone and the HS_TIMING
register contains 0x43 as expected.
Fixes: 5a52c5701a67 ("mmc: core: Fix host controller programming for fixed driver type")
Link: https://lore.kernel.org/all/20260926122908.866-1-ian.ray@gehealthcare.com/
Cc: stable@vger.kernel.org
Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1142,6 +1142,20 @@ static void esdhc_reset_tuning(struct sd
}
}
+static void sdhci_esdhc_imx_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+{
+ /*
+ * This controller has no driver-type control: esdhc_writew_le()
+ * discards the driver-type field when writing SDHCI_HOST_CONTROL2.
+ * The programmed value is therefore irrelevant, but SDHCI rejects
+ * non-SD values such as 4 (eMMC 40 ohm, from fixed-emmc-driver-type).
+ * Force an always-valid Type B.
+ */
+ ios->drv_type = MMC_SET_DRIVER_TYPE_B;
+
+ sdhci_set_ios(mmc, ios);
+}
+
static void usdhc_init_card(struct mmc_host *mmc, struct mmc_card *card)
{
struct sdhci_host *host = mmc_priv(mmc);
@@ -1952,6 +1966,9 @@ static int sdhci_esdhc_imx_probe(struct
host->max_timeout_count = 0xF;
}
+ /* No SDHCI driver type control */
+ host->mmc_host_ops.set_ios = sdhci_esdhc_imx_set_ios;
+
if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)
sdhci_esdhc_ops.platform_execute_tuning =
esdhc_executing_tuning;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0582/1005] mmc: meson-gx: report busy from DAT0 alone
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (580 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 7.3 0581/1005] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0583/1005] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
` (416 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit 318fdb75f4dc9d18ae621b9fb25eb11160c95649 upstream.
meson_mmc_card_busy() reports busy only while DAT0..3 are all low. A
busy card drives DAT0 low and leaves DAT1..3 to the pull-ups, and the
callback is defined as "Check if the card is pulling dat[0] low". So a
busy card is reported free, and the core, which prefers card_busy over
CMD13 in mmc_busy_cb(), stops polling after CMD6 and erase at once. The
controller hides this on R1b commands, where it waits for busy itself.
Once max_busy_timeout is reported, the core sends the longer waits, the
120 s BKOPS and 240 s sanitize switches among them, as R1 and has only
the polling left.
Look at DAT0 only, as sdhci_card_busy() does. The checks around the
voltage switch in mmc_set_uhs_voltage() still hold: the card drives
DAT0..3 low together after CMD11 and keeps them low together on
failure.
Fixes: 186cd8b7f586 ("mmc: meson-gx: implement card_busy callback")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1079,8 +1079,8 @@ static int meson_mmc_card_busy(struct mm
regval = readl(host->regs + SD_EMMC_STATUS);
- /* We are only interrested in lines 0 to 3, so mask the other ones */
- return !(FIELD_GET(STATUS_DATI, regval) & 0xf);
+ /* The card signals busy on DAT0 alone. */
+ return !(FIELD_GET(STATUS_DATI, regval) & BIT(0));
}
static int meson_mmc_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0583/1005] mmc: meson-gx: honour the busy timeout for R1b commands
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (581 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0582/1005] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0584/1005] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
` (415 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit 7e3cc541aa5855bc36e6cbffa82efc2795955a10 upstream.
For a command without data the driver programs a fixed 1024 ms into the
CMD_CFG timeout field, and for R1b the controller waits for the card to
release busy within that time. The core sends erase and cache flush as
R1b with busy timeouts of up to 60 s and 30 s, and the controller gives
up after one second:
mmc_erase: erase error -110, status 0x0
mmc1: cache flush error -110
Program the timeout from cmd->busy_timeout, kept between 1024 ms, the
fixed value until now, and 32768 ms, the most the field holds, and
rounded up to a power of two. The clamp comes first: MMC_IOC_CMD passes
cmd_timeout_ms from user space straight into busy_timeout, and
roundup_pow_of_two() of a value above 2^31 does not fit in unsigned
int. sdhci takes its command timeout from cmd->busy_timeout in the
same way.
Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -214,6 +214,20 @@ static unsigned int meson_mmc_get_timeou
return min(timeout, 32768U); /* max. 2^15 ms */
}
+/* For R1b the controller waits for busy to be released within this timeout. */
+static unsigned int meson_mmc_get_cmd_timeout_msecs(struct mmc_command *cmd)
+{
+ unsigned int timeout = cmd->busy_timeout;
+
+ if (!timeout)
+ return SD_EMMC_CMD_TIMEOUT;
+
+ timeout = clamp_t(unsigned int, timeout, SD_EMMC_CMD_TIMEOUT,
+ SD_EMMC_CMD_TIMEOUT_MAX);
+
+ return roundup_pow_of_two(timeout);
+}
+
static struct mmc_command *meson_mmc_get_next_command(struct mmc_command *cmd)
{
if (cmd->opcode == MMC_SET_BLOCK_COUNT && !cmd->error)
@@ -840,7 +854,7 @@ static void meson_mmc_start_cmd(struct m
cmd_data = host->bounce_dma_addr & CMD_DATA_MASK;
} else {
cmd_cfg |= FIELD_PREP(CMD_CFG_TIMEOUT_MASK,
- ilog2(SD_EMMC_CMD_TIMEOUT));
+ ilog2(meson_mmc_get_cmd_timeout_msecs(cmd)));
}
/* Last descriptor */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0584/1005] mmc: meson-gx: report the longest busy wait the controller can do
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (582 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0583/1005] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0585/1005] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
` (414 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit 18e9f7fb05ada68d491ff49165b9644f790e0e0c upstream.
The driver does not set max_busy_timeout, so the core takes the host
for one that can wait for busy indefinitely and sends erase and cache
flush as R1b with busy timeouts of up to 60 s and 30 s. The CMD_CFG
timeout field holds at most 32768 ms, so the controller times out first.
Report 32768 ms as max_busy_timeout. The core then sizes discards to
fit and, for a longer wait, sends R1 and polls for busy itself.
Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1180,6 +1180,9 @@ static int meson_mmc_probe(struct platfo
mmc->caps |= MMC_CAP_CMD23;
+ /* The longest busy wait the CMD_CFG timeout field can hold. */
+ mmc->max_busy_timeout = SD_EMMC_CMD_TIMEOUT_MAX;
+
if (mmc->caps & MMC_CAP_SDIO_IRQ)
mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0585/1005] mmc: meson-gx: name the limit of the CMD_CFG timeout field
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (583 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0584/1005] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0586/1005] memstick: core: dont clear dev->driver in memstick_device_remove() Greg Kroah-Hartman
` (413 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
commit e1644210d15f7f8adbe6315199b4b73bead63a2c upstream.
The data timeout is capped at a literal 32768 ms with a comment next to
it. Give the limit a name beside the other timeout constants.
Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/host/meson-gx-mmc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -125,6 +125,7 @@
#define SD_EMMC_CFG_RESP_TIMEOUT 256 /* in clock cycles */
#define SD_EMMC_CMD_TIMEOUT 1024 /* in ms */
#define SD_EMMC_CMD_TIMEOUT_DATA 4096 /* in ms */
+#define SD_EMMC_CMD_TIMEOUT_MAX 32768 /* in ms, 2^15: limit of CMD_CFG_TIMEOUT_MASK */
#define SD_EMMC_CFG_CMD_GAP 16 /* in clock cycles */
#define SD_EMMC_DESC_BUF_LEN PAGE_SIZE
@@ -211,7 +212,7 @@ static unsigned int meson_mmc_get_timeou
timeout = roundup_pow_of_two(timeout);
- return min(timeout, 32768U); /* max. 2^15 ms */
+ return min_t(unsigned int, timeout, SD_EMMC_CMD_TIMEOUT_MAX);
}
/* For R1b the controller waits for busy to be released within this timeout. */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0586/1005] memstick: core: dont clear dev->driver in memstick_device_remove()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (584 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0585/1005] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0587/1005] errseq: dont let errseq_check_and_advance() hide later errors Greg Kroah-Hartman
` (412 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joshua Mulloy, Ulf Hansson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joshua Mulloy <joshuamulloy@gmail.com>
commit 6f2b998a52746892968741cbf8fc226985cbf286 upstream.
memstick_device_remove() sets card->dev.driver to NULL after calling the
driver's remove() callback. Since commit a995fe1a3aa7 ("rust: driver:
drop device private data post unbind"), device_unbind_cleanup()
dereferences dev->driver after the bus remove() callback has returned,
so this should result in a NULL pointer dereference whenever a
MemoryStick card is removed or its driver is unbound.
The driver core clears dev->driver itself in device_unbind_cleanup(), so
there is no need for the bus code to do it. Remove the assignment.
This was found by code inspection, with the help of an AI coding
assistant, after hitting the same bug in the TI FlashMedia bus code
(drivers/misc/tifm_core.c), which oopsed on SD card removal. It has
only been compile-tested: no MemoryStick hardware was available.
Fixes: a995fe1a3aa7 ("rust: driver: drop device private data post unbind")
Cc: stable@vger.kernel.org
Signed-off-by: Joshua Mulloy <joshuamulloy@gmail.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/memstick/core/memstick.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -100,7 +100,6 @@ static void memstick_device_remove(struc
if (dev->driver && drv->remove) {
drv->remove(card);
- card->dev.driver = NULL;
}
put_device(dev);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0587/1005] errseq: dont let errseq_check_and_advance() hide later errors
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (585 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0586/1005] memstick: core: dont clear dev->driver in memstick_device_remove() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0588/1005] backing-file: pass RWF_NOAPPEND to synchronous writes Greg Kroah-Hartman
` (411 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain, Jan Kara,
Jeff Layton, Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashank Mohan Jain <jain.sm@gmail.com>
commit 94defd41d80f10bbe883c0c8d1b28d1665b6b153 upstream.
errseq_check_and_advance() reads the errseq_t, sets ERRSEQ_SEEN with a
cmpxchg() and then advances *since to the value it computed, ignoring
whether the cmpxchg() succeeded. When it fails because errseq_set()
recorded a different error in the meantime, *since ends up holding a
value that was never stored in the errseq_t.
errseq_set() only bumps the counter when ERRSEQ_SEEN is set. So as long
as nobody has seen the new error, recording the original errno again
recreates exactly the old value, and once another subscriber marks it
seen, it is equal to the stale *since. The next check through that
cursor then reports nothing, although -ENOSPC was recorded after the
value that check reported, and -EIO was recorded again after it
returned:
cursor f writeback cursor g
-------- --------- --------
set(-EIO)
check_and_advance(&f)
old = [c, EIO]
set(-ENOSPC)
-> [c, ENOSPC]
cmpxchg() fails
f = [c, EIO, SEEN]
returns -EIO
set(-EIO)
-> [c, EIO]
(no bump: unseen)
check_and_advance(&g)
-> [c, EIO, SEEN]
returns -EIO
check_and_advance(&f)
[c, EIO, SEEN] == f
returns 0 <- -ENOSPC and the second -EIO are lost
For file->f_wb_err this means that fsync() on one descriptor can return
0 although writeback failed after the previous fsync() on that
descriptor returned, when writeback errors race with fsync() on another
descriptor of the same file. The same applies to syncfs() through
sb->s_wb_err, which every file on the filesystem shares, and to the
ext4 and jbd2 cursors on the block device mapping. The kernel-doc
promises "Negative errno if one has been stored, or 0 if no new error
has occurred".
Retry with the value found when the cmpxchg() fails, so that *since is
only ever advanced to a value that was actually stored with ERRSEQ_SEEN
set. Every later errseq_set() then has to bump the counter, and the
error is reported. The retry loop terminates because each iteration
needs a concurrent update, like the loop in errseq_set().
A TLA+ model of errseq_set() and errseq_check_and_advance(), checked
with the TLC model checker, finds the lost error with the current code;
with this change TLC checks that an error recorded after a check
returned is always reported by the next check (exhaustively for two
subscribers with three checks each, and one writer recording four
errors or two writers recording two each). The KUnit race test added
in the next patch misses the error in 1-6% of 2 million rounds on
4-CPU UML before this change (depending on host load), and in none
after it.
Fixes: 84cbadadc6ea ("lib: add errseq_t type and infrastructure for handling it")
Cc: stable@vger.kernel.org
Signed-off-by: Shashank Mohan Jain <jain.sm@gmail.com>
Link: https://patch.msgid.link/20260927051726.71337-2-jain.sm@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/errseq.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
--- a/lib/errseq.c
+++ b/lib/errseq.c
@@ -162,7 +162,8 @@ EXPORT_SYMBOL(errseq_check);
* points to. If it does, then just return 0.
*
* If it doesn't, then the value has changed. Set the "seen" flag, and try to
- * swap it into place as the new eseq value. Then, set that value as the new
+ * swap it into place as the new eseq value. If the swap fails because the
+ * value changed, retry with the new value. Then, set that value as the new
* "since" value, and return whatever the error portion is set to.
*
* Note that no locking is provided here for concurrent updates to the "since"
@@ -184,24 +185,30 @@ int errseq_check_and_advance(errseq_t *e
* to take the lock that protects the "since" value.
*/
old = READ_ONCE(*eseq);
- if (old != *since) {
+ while (old != *since) {
/*
* Set the flag and try to swap it into place if it has
* changed.
*
- * We don't care about the outcome of the swap here. If the
- * swap doesn't occur, then it has either been updated by a
- * writer who is altering the value in some way (updating
- * counter or resetting the error), or another reader who is
- * just setting the "seen" flag. Either outcome is OK, and we
- * can advance "since" and return an error based on what we
- * have.
+ * If the swap fails, a writer or another reader changed the
+ * value under us, so retry with the new value. "since" must
+ * only ever be set to a value that was stored with the SEEN
+ * flag: errseq_set() does not bump the counter while the
+ * flag is clear, so an unstored value could come back later
+ * and hide the errors that were recorded in the meantime.
*/
new = old | ERRSEQ_SEEN;
- if (new != old)
- cmpxchg(eseq, old, new);
+ if (new != old) {
+ errseq_t cur = cmpxchg(eseq, old, new);
+
+ if (cur != old) {
+ old = cur;
+ continue;
+ }
+ }
*since = new;
err = -(new & ERRNO_MASK);
+ break;
}
return err;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0588/1005] backing-file: pass RWF_NOAPPEND to synchronous writes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (586 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0587/1005] errseq: dont let errseq_check_and_advance() hide later errors Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0589/1005] pidfd: restrict task access ioctls to the callers pid namespace Greg Kroah-Hartman
` (410 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Amir Goldstein,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
commit afa735786a89bde4959db52f20e3579de54ec740 upstream.
pwritev2() with RWF_NOAPPEND ignores the offset and appends the data on
an overlayfs or FUSE passthrough file that was opened with O_APPEND, and
the call still returns success. The flag must make the write go to the
given offset even though the file is in append mode. Any user who can
write to the file is affected, with the default mount options.
overlayfs and FUSE passthrough forward the reads and writes on their
files to a backing file on an underlying filesystem, through the helpers
in fs/backing-file.c.
The flag works for the file that the user opened: kiocb_set_rw_flags()
clears IOCB_APPEND in the write's kiocb. It also copies RWF_NOAPPEND
into ki_flags, as it does with every RWF_ flag.
overlayfs and FUSE passthrough then pass the write on to the backing
file. They opened it with the open flags of the user's file, so it is in
append mode too.
For a synchronous write, do_backing_file_write_iter() calls
vfs_iter_write(), which sets up a new kiocb for the backing file. That
kiocb starts out with IOCB_APPEND set. vfs_iter_write() is only given
the flags of the user's kiocb that are in BACKING_IOCB_MASK, and
RWF_NOAPPEND is not one of them. So nothing clears IOCB_APPEND again,
and the data goes to the end of the file while the call returns success.
An asynchronous write reuses the flags of the user's kiocb and is not
affected.
Reproduced by calling pwritev2() with RWF_NOAPPEND at offset 0, on an
overlayfs file and on a FUSE passthrough file opened with O_APPEND: the
data was at the end of the file afterwards.
Fix this by adding RWF_NOAPPEND to BACKING_IOCB_MASK.
Fixes: 73fa7547c70b ("vfs: add RWF_NOAPPEND flag for pwritev2")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://patch.msgid.link/20261101123440.3184069-1-amir73il@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/backing-file.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/fs/backing-file.c
+++ b/fs/backing-file.c
@@ -115,8 +115,13 @@ struct backing_aio {
static struct kmem_cache *backing_aio_cachep;
+/*
+ * RWF_NOAPPEND stays set in ki_flags. Pass it on, because the backing file is
+ * in append mode as well and a new kiocb for it starts with IOCB_APPEND.
+ */
#define BACKING_IOCB_MASK \
- (IOCB_NOWAIT | IOCB_HIPRI | IOCB_DSYNC | IOCB_SYNC | IOCB_APPEND)
+ (IOCB_NOWAIT | IOCB_HIPRI | IOCB_DSYNC | IOCB_SYNC | IOCB_APPEND | \
+ (__force int) RWF_NOAPPEND)
static rwf_t iocb_to_rw_flags(int flags)
{
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0589/1005] pidfd: restrict task access ioctls to the callers pid namespace
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (587 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0588/1005] backing-file: pass RWF_NOAPPEND to synchronous writes Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0590/1005] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
` (409 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jann Horn, Christian Brauner,
Chen Linxuan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Linxuan <me@black-desk.cn>
commit ee8323fdc827c580425644db605a4be776cace57 upstream.
pidfds can cross pid namespace boundaries: a task may obtain one for a
process outside of its own pid namespace hierarchy through SO_PASSPIDFD
or SO_PEERPIDFD, via SCM_RIGHTS, or through file descriptor inheritance.
The namespace ioctls gate access with a ptrace check against the
target's credentials only. That check does not account for the pid
namespace relationship between the caller and the target, so a task
inside a pid namespace can use a pidfd obtained across that boundary to
acquire namespace file descriptors of a task outside of its hierarchy.
procfs exposes the equivalent information only for tasks visible in the
reader's pid namespace, and PIDFD_GET_INFO already answers with -EREMOTE
for targets outside the caller's hierarchy. Extend that policy to the
namespace ioctls: fail with -EREMOTE unless the target is visible in the
caller's active pid namespace. Callers in ancestor pid namespaces are
unaffected.
Unlike PIDFD_GET_INFO, the visibility check is performed after the task
lookup here, so reaped targets outside of the caller's pid namespace
hierarchy answer -ESRCH instead of -EREMOTE.
Link: https://lore.kernel.org/all/CAG48ez1T5-tUHVK_iHsgUtWa-inVdrZxA3E-ZCW0iENJvasKfg@mail.gmail.com
Link: https://lore.kernel.org/all/20260925-gewischt-auftrag-tierzucht-c153cb3f9f74@brauner
Suggested-by: Jann Horn <jannh@google.com>
Suggested-by: Christian Brauner <brauner@kernel.org>
Fixes: 5b08bd408534 ("pidfs: allow retrieval of namespace file descriptors")
Cc: stable@vger.kernel.org
Signed-off-by: Chen Linxuan <me@black-desk.cn>
Link: https://patch.msgid.link/20261027-pidfd-task-access-v1-1-d46cf0fa4ca1@black-desk.cn
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/pidfs.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/fs/pidfs.c
+++ b/fs/pidfs.c
@@ -591,6 +591,14 @@ static long pidfd_ioctl(struct file *fil
return -EINVAL;
/*
+ * Require the target to be visible in the caller's pid namespace
+ * for operations that grant access to its resources, mirroring
+ * procfs and PIDFD_GET_INFO.
+ */
+ if (!pid_in_current_pidns(pidfd_pid(file)))
+ return -EREMOTE;
+
+ /*
* We're trying to open a file descriptor to the namespace so perform a
* filesystem cred ptrace check. Hold @task's exec_update_lock for the
* duration of the ptrace check and the namespace lookup so that the
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0590/1005] eventpoll: wake the next waiter when a woken waiter is killed
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (588 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0589/1005] pidfd: restrict task access ioctls to the callers pid namespace Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0591/1005] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
` (408 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mani Tofigh,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mani Tofigh <mt4022@columbia.edu>
commit 9f4413e522faed76f4cf610098b2369eb3ba1f1c upstream.
Processes sharing an epoll instance can sleep forever while an event is
ready. An event wakes only one waiter, which then wakes the next one in
ep_done_scan() if events are still ready. Since commit c257a340ede0
("fs, epoll: short circuit fetching events if thread has been killed"),
ep_send_events() returns before the scan when the waiter has a fatal
signal. If the woken waiter is killed before it runs, nobody wakes the
next one:
Task A Task B Task C
epoll_wait(ep, -1) epoll_wait(ep, -1)
write(efd)
/* wakes A only */
kill(A, SIGKILL)
ep_send_events()
return -EINTR
/* skips ep_done_scan() */
/* still asleep */
B then sleeps until another file on the instance becomes ready, if ever.
This can hit eg a pre-fork server whose worker gets OOM killed. Commit
7fab29e35630 ("fs/epoll: restore waking from ep_done_scan()") fixed the
same kind of hang when the wakeup in ep_done_scan() was removed.
Keep the early return so that a dying task still doesn't take events
nobody will see, but wake the next waiter there if events are ready, as
ep_done_scan() would have. With the fix, B gets the event.
This bug was identified and confirmed with the help of a deterministic
hypervisor currently under development. The C reproducer below however
hits it within about 2s.
Fixes: c257a340ede0 ("fs, epoll: short circuit fetching events if thread has been killed")
Cc: stable@vger.kernel.org
Signed-off-by: Mani Tofigh <mt4022@columbia.edu>
Link: https://patch.msgid.link/20261103-epoll-killed-waiter-v1-1-36e08c16b8a2@columbia.edu
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/eventpoll.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -2144,10 +2144,17 @@ static int ep_send_events(struct eventpo
/*
* Always short-circuit for fatal signals to allow threads to make a
* timely exit without the chance of finding more events available and
- * fetching repeatedly.
+ * fetching repeatedly. The wakeup that got us here may have been the
+ * only one for the events on ->rdllist, so pass it on to the next
+ * waiter, as ep_done_scan() would have.
*/
- if (fatal_signal_pending(current))
+ if (fatal_signal_pending(current)) {
+ spin_lock_irq(&ep->lock);
+ if (!list_empty(&ep->rdllist))
+ wake_up(&ep->wq);
+ spin_unlock_irq(&ep->lock);
return -EINTR;
+ }
init_poll_funcptr(&pt, NULL);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0591/1005] aio: dont let exit_aio() return before complete() is done
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (589 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0590/1005] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0592/1005] fs: fix the SEEK_CUR f_lock condition Greg Kroah-Hartman
` (407 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit ac4b449b39e605123c12ea10042cafc9b6f39603 upstream.
exit_aio() kills all contexts in one go and waits for them with a
single on-stack struct ctx_rq_wait. The count starts at table->nr, each
killed context drops one count in free_ioctx_reqs() and exit_aio()
subtracts the empty slots afterwards. Whoever drops the last count
either calls complete() or, if it is exit_aio(), skips the wait.
With a full table skipped is zero and atomic_sub_and_test(0, ...) only
tells us whether the count already hit zero. free_ioctx_reqs() runs from
the percpu_ref RCU callback, so if exit_aio() is off the CPU long enough
the last callback can have done its atomic_dec_and_test() but not yet
called complete():
free_ioctx_reqs() exit_aio()
atomic_dec_and_test() // 1 -> 0
atomic_sub_and_test(0) // true
kfree(table)
return
complete(&wait.comp)
complete() then locks and writes a completion on a stack frame that is
gone. So hold an extra count for exit_aio() itself. Then the last count
is always dropped by exit_aio() after it waited, or by a callback while
exit_aio() waits for it. An unprivileged user gets there with four
io_setup() calls and an exit without io_destroy().
Reported-by: Kyle Zeng <kylebot@openai.com>
Fixes: dc48e56d7616 ("aio: fix serial draining in exit_aio()")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261030-work-aio-exit_aio-v1-1-83942022a4c4@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/aio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -962,7 +962,7 @@ void exit_aio(struct mm_struct *mm)
if (!table)
return;
- atomic_set(&wait.count, table->nr);
+ atomic_set(&wait.count, table->nr + 1);
init_completion(&wait.comp);
skipped = 0;
@@ -986,7 +986,7 @@ void exit_aio(struct mm_struct *mm)
kill_ioctx(mm, ctx, &wait);
}
- if (!atomic_sub_and_test(skipped, &wait.count)) {
+ if (!atomic_sub_and_test(skipped + 1, &wait.count)) {
/* Wait until all IO for the context are done. */
wait_for_completion(&wait.comp);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0592/1005] fs: fix the SEEK_CUR f_lock condition
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (590 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0591/1005] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0593/1005] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
` (406 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 1448959fe3d013ffdb8302d17e4a8fdad2d2da95 upstream.
Commit da06e3c51794 ("fs: don't needlessly acquire f_lock") wanted to
skip f_lock for SEEK_CUR on files that already serialize f_pos through
f_pos_lock, i.e. FMODE_ATOMIC_POS files and directories, and keep it
for everything else. The condition it added does the opposite:
file_seek_cur_needs_f_lock() returns false exactly for the files that
never take f_pos_lock and true for the ones that do.
So since v6.15 a SEEK_CUR on a shared block device or on a character
device that uses fixed_size_llseek() updates f_pos without any lock and
two concurrent calls can lose an update, while regular files and
directories pay for a spinlock they don't need.
Invert the condition.
Fixes: da06e3c51794 ("fs: don't needlessly acquire f_lock")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261106-work-file-seek_f_lock-v1-1-5b9a6c2928d4@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/file.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/fs/file.c
+++ b/fs/file.c
@@ -1237,14 +1237,18 @@ static inline bool file_needs_f_pos_lock
bool file_seek_cur_needs_f_lock(struct file *file)
{
- if (!(file->f_mode & FMODE_ATOMIC_POS) && !file->f_op->iterate_shared)
- return false;
-
/*
+ * Files that go through f_pos_lock when they are shared, i.e.
+ * FMODE_ATOMIC_POS files and directories, don't need f_lock for a
+ * SEEK_CUR. Everything else does, since nothing else serializes
+ * the f_pos update.
+ *
* Note that we are not guaranteed to be called after fdget_pos() on
* this file obj, in which case the caller is expected to provide the
* appropriate locking.
*/
+ if ((file->f_mode & FMODE_ATOMIC_POS) || file->f_op->iterate_shared)
+ return false;
return true;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0593/1005] splice, net: avoid MSG_MORE when the bvec array fills
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (591 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0592/1005] fs: fix the SEEK_CUR f_lock condition Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0594/1005] libfs: make i_rwsem the lock of the offset tree Greg Kroah-Hartman
` (405 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
commit 8eaa35c6c29ae669949f4b5b0814c3d34c8ed658 upstream.
splice_to_socket() leaves tail at the last included pipe buffer when
its 16-entry bvec array fills. If the requested length exceeds the
available pipe data, pipe_occupancy() counts that buffer again and sets
MSG_MORE even though the pipe is empty. Small TCP transfers can then be
delayed until the cork timeout expires.
Advance tail before checking the array limit so the occupancy test
counts only pipe buffers that have not been included in the send.
Fixes: ca2d49f77ce4 ("splice, net: Fix splice_to_socket() to handle pipe bufs larger than a page")
Cc: stable@vger.kernel.org
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20261031095922.3577591-2-thnkslprpt@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/splice.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -863,9 +863,9 @@ ssize_t splice_to_socket(struct pipe_ino
bvec_set_page(&bvec[bc++], buf->page, seg, buf->offset);
remain -= seg;
+ tail++;
if (remain == 0 || bc >= ARRAY_SIZE(bvec))
break;
- tail++;
}
if (!bc)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0594/1005] libfs: make i_rwsem the lock of the offset tree
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (592 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0593/1005] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0595/1005] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
` (404 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit e7d73cef9726bea49de97ae1fd76405df4050a75 upstream.
The offset tree of a directory is only changed with the directory's
i_rwsem held exclusive and offset_readdir() walks it with i_rwsem held
shared. But the maple tree doesn't know that. It is set up with its
internal spinlock, which every mtree_*() helper takes, and readdir takes
rcu_read_lock() around each lookup.
The next patch makes readdir keep one ma_state across dir_emit(), which
can sleep. That is safe because no writer can run while readdir holds
i_rwsem. But the maple tree only allows keeping a ma_state across a
sleep if it is protected by the tree's lock. A reader that relies on
rcu_read_lock() has to mas_pause() before it drops it, and that means a
walk from the root for every entry again.
So tell the tree what protects it. Initialize it with
MT_FLAGS_LOCK_EXTERN and the directory's i_rwsem as its lock and switch
the writers from the mtree_*() helpers to the mas_*() api. They all run
with i_rwsem held exclusive already. With lockdep enabled the maple tree
now also checks that every writer holds i_rwsem exclusive.
Nothing can reach the offset tree anymore when the directory inode is
destroyed. So clear the external lock with mt_on_stack() and destroy the
tree with __mt_destroy() instead of taking i_rwsem in ->destroy_inode().
Cc: stable@vger.kernel.org # v6.14+
Link: https://patch.msgid.link/20261101-work-libfs-offset_readdir-v2-1-c621125b56d1@kernel.org
Reviewed-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/libfs.c | 46 +++++++++++++++++++++++++++++-----------------
include/linux/fs.h | 2 +-
mm/shmem.c | 2 +-
3 files changed, 31 insertions(+), 19 deletions(-)
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -263,17 +263,18 @@ static long dentry2offset(struct dentry
return (long)dentry->d_fsdata;
}
-static struct lock_class_key simple_offset_lock_class;
-
/**
* simple_offset_init - initialize an offset_ctx
* @octx: directory offset map to be initialized
+ * @dir: the directory @octx belongs to
*
+ * The directory's i_rwsem is the lock of the offset map. Writers hold it
+ * exclusive, offset_readdir() holds it shared.
*/
-void simple_offset_init(struct offset_ctx *octx)
+void simple_offset_init(struct offset_ctx *octx, struct inode *dir)
{
- mt_init_flags(&octx->mt, MT_FLAGS_ALLOC_RANGE);
- lockdep_set_class(&octx->mt.ma_lock, &simple_offset_lock_class);
+ mt_init_flags(&octx->mt, MT_FLAGS_ALLOC_RANGE | MT_FLAGS_LOCK_EXTERN);
+ mt_set_external_lock(&octx->mt, &dir->i_rwsem);
octx->next_offset = DIR_OFFSET_MIN;
}
@@ -296,12 +297,13 @@ int simple_offset_add(struct offset_ctx
unsigned long offset;
int ret;
+ MA_STATE(mas, &octx->mt, 0, 0);
+
if (dentry2offset(dentry) != 0)
return -EBUSY;
- ret = mtree_alloc_cyclic(&octx->mt, &offset, dentry, DIR_OFFSET_MIN,
- DIR_OFFSET_MAX, &octx->next_offset,
- GFP_KERNEL);
+ ret = mas_alloc_cyclic(&mas, &offset, dentry, DIR_OFFSET_MIN,
+ DIR_OFFSET_MAX, &octx->next_offset, GFP_KERNEL);
if (unlikely(ret < 0))
return ret == -EBUSY ? -ENOSPC : ret;
@@ -314,7 +316,9 @@ static int simple_offset_replace(struct
{
int ret;
- ret = mtree_store(&octx->mt, offset, dentry, GFP_KERNEL);
+ MA_STATE(mas, &octx->mt, offset, offset);
+
+ ret = mas_store_gfp(&mas, dentry, GFP_KERNEL);
if (ret)
return ret;
offset_set(dentry, offset);
@@ -329,13 +333,14 @@ static int simple_offset_replace(struct
*/
void simple_offset_remove(struct offset_ctx *octx, struct dentry *dentry)
{
- long offset;
+ long offset = dentry2offset(dentry);
+
+ MA_STATE(mas, &octx->mt, offset, offset);
- offset = dentry2offset(dentry);
if (offset == 0)
return;
- mtree_erase(&octx->mt, offset);
+ mas_erase(&mas);
offset_set(dentry, 0);
}
@@ -393,16 +398,20 @@ int simple_offset_rename_exchange(struct
long new_index = dentry2offset(new_dentry);
int ret;
+ MA_STATE(old_mas, &old_ctx->mt, old_index, old_index);
+ MA_STATE(new_mas, &new_ctx->mt, new_index, new_index);
+
if (WARN_ON(!old_index || !new_index))
return -EINVAL;
- ret = mtree_store(&new_ctx->mt, new_index, old_dentry, GFP_KERNEL);
+ ret = mas_store_gfp(&new_mas, old_dentry, GFP_KERNEL);
if (WARN_ON(ret))
return ret;
- ret = mtree_store(&old_ctx->mt, old_index, new_dentry, GFP_KERNEL);
+ ret = mas_store_gfp(&old_mas, new_dentry, GFP_KERNEL);
if (WARN_ON(ret)) {
- mtree_store(&new_ctx->mt, new_index, new_dentry, GFP_KERNEL);
+ mas_set(&new_mas, new_index);
+ mas_store_gfp(&new_mas, new_dentry, GFP_KERNEL);
return ret;
}
@@ -417,11 +426,14 @@ int simple_offset_rename_exchange(struct
* @octx: directory offset ctx that is about to be destroyed
*
* During fs teardown (eg. umount), a directory's offset map might still
- * contain entries. xa_destroy() cleans out anything that remains.
+ * contain entries. __mt_destroy() cleans out anything that remains.
+ * Nothing can reach the map of a directory that is being destroyed, so
+ * this runs without the directory's i_rwsem.
*/
void simple_offset_destroy(struct offset_ctx *octx)
{
- mtree_destroy(&octx->mt);
+ mt_on_stack(octx->mt);
+ __mt_destroy(&octx->mt);
}
/**
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3328,7 +3328,7 @@ struct offset_ctx {
unsigned long next_offset;
};
-void simple_offset_init(struct offset_ctx *octx);
+void simple_offset_init(struct offset_ctx *octx, struct inode *dir);
int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry);
void simple_offset_remove(struct offset_ctx *octx, struct dentry *dentry);
void simple_offset_rename(struct inode *old_dir, struct dentry *old_dentry,
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3131,7 +3131,7 @@ static struct inode *__shmem_get_inode(s
inode->i_size = 2 * BOGO_DIRENT_SIZE;
inode->i_op = &shmem_dir_inode_operations;
inode->i_fop = &simple_offset_dir_operations;
- simple_offset_init(shmem_get_offset_ctx(inode));
+ simple_offset_init(shmem_get_offset_ctx(inode), inode);
break;
case S_IFLNK:
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0595/1005] mm/mmzone: read the zoneref slot once in zonelist_zone()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (593 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0594/1005] libfs: make i_rwsem the lock of the offset tree Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0596/1005] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone Greg Kroah-Hartman
` (403 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta), Zi Yan,
Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit 9c52ebe9c89d41c56fcb5d94efe9e539414175a9 upstream.
Memory hotplug rebuilds zonelists in place while allocations walk them,
so a zoneref slot can change between two loads of it.
zonelist_zone() loads the slot with a plain access. The compiler may
load it again later instead of keeping the zone it already read, so a
caller can check one zone and then use another, or the NULL terminator.
Use READ_ONCE(). Callers that take a zone from a slot and keep using
it, such as get_page_from_freelist() with ac->preferred_zoneref, need
that single load.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-6-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/mmzone.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1815,7 +1815,8 @@ extern struct zone *next_zone(struct zon
static inline struct zone *zonelist_zone(struct zoneref *zoneref)
{
- return zoneref->zone;
+ /* Memory hotplug rewrites zonelists in place. */
+ return READ_ONCE(zoneref->zone);
}
static inline int zonelist_zone_idx(const struct zoneref *zoneref)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0596/1005] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (594 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0595/1005] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0597/1005] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt Greg Kroah-Hartman
` (402 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Gregory Price (Meta), Zi Yan, Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 6c48b3ab4ee435c41c3395d31e8ec3dbccc3478c upstream.
should_reclaim_retry() walks a zonelist and passes the zoneref pointer
to the reclaim_retry_zone tracepoint, which loads the zone from the
entry again to find the node.
Memory hotplug rebuilds the zonelists in place while allocations are
under way. When a zone in front of the zoneref entry has become empty,
the entries move up, and this one can be the end marker by the time the
tracepoint looks at it. zonelist_node_idx() then dereferences a NULL
zone. Short of that, the event can name another zone than the one its
numbers belong to.
Pass the zone pointer instead of the zoneref pointer.
Fixes: d379f01de095 ("oom, trace: add oom detection tracepoints")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Gregory Price (Meta) <gourry@gourry.net>
Acked-by: Zi Yan <ziy@nvidia.com>
Link: https://patch.msgid.link/20261101021340.2251928-4-gourry@gourry.net
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/trace/events/oom.h | 8 ++++----
mm/page_alloc.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/include/trace/events/oom.h
+++ b/include/trace/events/oom.h
@@ -33,7 +33,7 @@ TRACE_EVENT(oom_score_adj_update,
TRACE_EVENT(reclaim_retry_zone,
- TP_PROTO(struct zoneref *zoneref,
+ TP_PROTO(struct zone *zone,
int order,
unsigned long reclaimable,
unsigned long available,
@@ -41,7 +41,7 @@ TRACE_EVENT(reclaim_retry_zone,
int no_progress_loops,
bool wmark_check),
- TP_ARGS(zoneref, order, reclaimable, available, min_wmark, no_progress_loops, wmark_check),
+ TP_ARGS(zone, order, reclaimable, available, min_wmark, no_progress_loops, wmark_check),
TP_STRUCT__entry(
__field( int, node)
@@ -55,8 +55,8 @@ TRACE_EVENT(reclaim_retry_zone,
),
TP_fast_assign(
- __entry->node = zonelist_node_idx(zoneref);
- __entry->zone_idx = zonelist_zone_idx(zoneref);
+ __entry->node = zone_to_nid(zone);
+ __entry->zone_idx = zone_idx(zone);
__entry->order = order;
__entry->reclaimable = reclaimable;
__entry->available = available;
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4693,7 +4693,7 @@ should_reclaim_retry(gfp_t gfp_mask, uns
*/
wmark = __zone_watermark_ok(zone, order, min_wmark,
ac->highest_zoneidx, alloc_flags, available);
- trace_reclaim_retry_zone(z, order, reclaimable,
+ trace_reclaim_retry_zone(zone, order, reclaimable,
available, min_wmark, *no_progress_loops, wmark);
if (wmark) {
ret = true;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0597/1005] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (595 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0596/1005] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0598/1005] mm: page_frag: refill the cache for large fragments Greg Kroah-Hartman
` (401 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit da0d7a895e9021dc2cffa90fb6fafd8b9379e544 upstream.
Onlining the first block of a zone rebuilds every zonelist in place,
shifting the slots after the new zone.
alloc_contig_frozen_pages_noprof() approves a slot by the caller's gfp
and nodemask, then loads the zone from it:
CPU 0 CPU 1
alloc_contig_frozen_pages_noprof(GFP_HIGHUSER | __GFP_THISNODE)
slot 0 (NORMAL1) approved
online_pages()
build_all_zonelists()
[NORMAL1]
-> [MOVABLE1, NORMAL1]
zone = zonelist_zone(slot 0) /* MOVABLE1 */
alloc_contig_frozen_range(MOVABLE1 pfns)
A gigantic hugetlb page can then land in ZONE_MOVABLE, and a nodemask
caller can get a range from another node. Gigantic pages are kept out
of ZONE_MOVABLE since commit 79b63f12abcb ("mm, hugetlb: do not allocate
non-migrateable gigantic pages from movable zones").
Check zonelist_update_seq before using each zone, and restart the walk
if it changed, as the hugetlb pool walk does. Check again before
escalating to the pass that may migrate hugetlb pages, so a pass a
rebuild cut short is redone rather than escalated.
With kprobes holding the walk across the online, the base kernel put the
1G page in ZONE_MOVABLE in 3 of 3 runs, and this change put it in
ZONE_NORMAL in 3 of 3. Direct GFP_KERNEL calls with nodemask {1} and
{2} got a ZONE_MOVABLE range and a node 1 range on base, 3 of 3 each,
and neither with this change.
Fixes: 5e27a2df03b8 ("mm/page_alloc: add alloc_contig_pages()")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://patch.msgid.link/20261101021340.2251928-11-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7583,6 +7583,7 @@ struct page *alloc_contig_frozen_pages_n
gfp_t gfp_mask, int nid, nodemask_t *nodemask)
{
unsigned long ret, pfn, flags;
+ unsigned int zonelist_cookie;
struct zonelist *zonelist;
struct zone *zone;
struct zoneref *z;
@@ -7591,8 +7592,13 @@ struct page *alloc_contig_frozen_pages_n
retry:
zonelist = node_zonelist(nid, gfp_mask);
+ zonelist_cookie = zonelist_iter_begin();
for_each_zone_zonelist_nodemask(zone, z, zonelist,
gfp_zone(gfp_mask), nodemask) {
+ /* A rebuild may have shifted an ineligible zone into this slot. */
+ if (unlikely(check_retry_zonelist(zonelist_cookie)))
+ goto retry;
+
spin_lock_irqsave(&zone->lock, flags);
pfn = ALIGN(zone->zone_start_pfn, nr_pages);
@@ -7627,6 +7633,9 @@ retry:
* second pass, we will try moving HugeTLB pages when those pages are
* smaller than the requested contiguous region size.
*/
+ /* Redo a pass that a rebuild cut short before escalating. */
+ if (unlikely(check_retry_zonelist(zonelist_cookie)))
+ goto retry;
if (skip_hugetlb && skipped_hugetlb) {
skip_hugetlb = false;
goto retry;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0598/1005] mm: page_frag: refill the cache for large fragments
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (596 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0597/1005] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0599/1005] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node() Greg Kroah-Hartman
` (400 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Johannes Weiner, Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit c028ecdf15131a2ab70d78a76657b81c00fa240d upstream.
A fragment which is larger than PAGE_SIZE can only be served from the
32K page of a page_frag_cache. If memory is low and the cache had to fall
back to a single page, __page_frag_alloc_align() returns NULL and keeps
that page.
Since the offset counts up, this check comes first and is made whenever
the fragment does not fit behind nc->offset, no matter how big the page
of the cache is. So the cache is never refilled on behalf of a large
fragment: with fragsz = 10000 the first three allocations succeed, the
fourth one and all the following ones fail although memory is plentiful.
nc->offset does not move either, so this lasts until smaller fragments
have used up the rest of the page, which never happens if the cache has
no other user.
The nfp driver allocates its receive buffers with napi_alloc_frag() and
netdev_alloc_frag(). They are larger than a page with a jumbo MTU.
Only give up if the fragment does not fit into the page at all, which is
what the comment describes. The fourth allocation in the scenario above
with a 32k page will thus now proceed to refill the cache.
Fixes: 8218f62c9c9b ("mm: page_frag: use initial zero offset for page_frag_alloc_align()")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
[vbabka@kernel.org: make the comment more obvious]
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-2-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_frag_cache.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
--- a/mm/page_frag_cache.c
+++ b/mm/page_frag_cache.c
@@ -119,15 +119,20 @@ refill:
size = PAGE_SIZE << encoded_page_decode_order(encoded_page);
offset = __ALIGN_KERNEL_MASK(nc->offset, ~align_mask);
if (unlikely(offset + fragsz > size)) {
- if (unlikely(fragsz > PAGE_SIZE)) {
+ if (unlikely(fragsz > size)) {
/*
- * The caller is trying to allocate a fragment
- * with fragsz > PAGE_SIZE but the cache isn't big
- * enough to satisfy the request, this may
- * happen in low memory conditions.
- * We don't release the cache page because
- * it could make memory pressure worse
- * so we simply return NULL here.
+ * The caller is trying to allocate a fragment that's
+ * larger than the whole cache page.
+ *
+ * Either fragsz is larger than PAGE_FRAG_CACHE_MAX_SIZE
+ * so this cannot ever succeed.
+ *
+ * Or the refill has fallen back to order-0 due to a low
+ * memory condition. Then we don't want to release the
+ * cache page to attempt a new large-size refill because
+ * it could make memory pressure worse.
+ *
+ * So in both cases we simply return NULL here.
*/
return NULL;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0599/1005] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (597 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0598/1005] mm: page_frag: refill the cache for large fragments Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0600/1005] mm/mmzone: read each zoneref slot once when filtering by nodemask Greg Kroah-Hartman
` (399 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit 4cc1bcdf2e4ebcd319005ce2ea132489f6155139 upstream.
For a bind or preferred-many policy, mempolicy_slab_node() tests the
first matching slot's zone for NULL, then reads the slot again to look
up the zone's node. Offlining a zone's last block rebuilds the
zonelists in place, so the second read can return the terminator:
CPU 0 CPU 1
mempolicy_slab_node()
zonelist_zone(slot 4)
= node 2 NORMAL
offline_pages()
build_all_zonelists()
slot 4 = NULL
zonelist_node_idx(slot 4)
zone_to_nid(NULL)
Current GCC merges the two reads, but nothing requires it. With
mm/mempolicy.o built with -fno-inline -fno-ipa-sra, holding a bound
task's slab_strict_numa allocation between the reads while a movable
block earlier in the zonelist goes offline oopses every time:
BUG: kernel NULL pointer dereference, address: 0000000000000060
RIP: 0010:zone_to_nid+0x0/0x10
Call Trace:
kmem_cache_alloc_noprof+0x294/0x610
do_getname+0x34/0x230
mempolicy_slab_node() and zonelist_node_idx() are tail calls here, so
neither appears in the trace.
Read the slot once and use that zone.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://patch.msgid.link/20261101021340.2251928-12-gourry@gourry.net
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/mempolicy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2159,6 +2159,7 @@ unsigned int mempolicy_slab_node(void)
case MPOL_PREFERRED_MANY:
{
struct zoneref *z;
+ struct zone *zone;
/*
* Follow bind policy behavior and start allocation at the
@@ -2169,7 +2170,8 @@ unsigned int mempolicy_slab_node(void)
zonelist = &NODE_DATA(node)->node_zonelists[ZONELIST_FALLBACK];
z = first_zones_zonelist(zonelist, highest_zoneidx,
&policy->nodes);
- return zonelist_zone(z) ? zonelist_node_idx(z) : node;
+ zone = zonelist_zone(z);
+ return zone ? zone_to_nid(zone) : node;
}
case MPOL_LOCAL:
return node;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0600/1005] mm/mmzone: read each zoneref slot once when filtering by nodemask
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (598 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0599/1005] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0601/1005] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
` (398 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit e55119ab611a0e47595db7e1d2ac1e69f7a73ff0 upstream.
__next_zones_zonelist() tests a slot's zone for NULL, then reads the
slot again to look up the zone's node. Offlining a zone's last block
rebuilds the zonelists in place, so the second read can return the
terminator:
CPU 0 CPU 1
__next_zones_zonelist(nodemask)
zonelist_zone(slot 1) = NORMAL
offline_pages()
build_all_zonelists()
[MOVABLE, NORMAL, NULL]
-> [NORMAL, NULL]
zref_in_nodemask(slot 1)
zone_to_nid(NULL)
Current GCC and clang merge the two reads, but nothing requires it.
With mm/mmzone.o built with -fno-inline -fno-ipa-sra, holding a
nodemask allocation between the reads while the node's last movable
block goes offline oopses every time:
BUG: kernel NULL pointer dereference, address: 0000000000000060
RIP: 0010:zone_to_nid+0x0/0x10
Call Trace:
zref_in_nodemask+0x9/0x20
__next_zones_zonelist+0x23/0x70
prepare_alloc_pages.constprop.0+0x16c/0x190
__alloc_frozen_pages_noprof+0xaf/0x330
Read the slot once and test that zone. A NULL zone still ends the walk.
To achieve that, rename zref_in_nodemask() to zone_in_nodemask() and
pass a zone instead of zoneref pointer.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://patch.msgid.link/20261101021340.2251928-8-gourry@gourry.net
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/mmzone.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--- a/mm/mmzone.c
+++ b/mm/mmzone.c
@@ -43,13 +43,14 @@ struct zone *next_zone(struct zone *zone
return zone;
}
-static inline int zref_in_nodemask(struct zoneref *zref,
- const nodemask_t *nodes)
+/* A NULL zone terminates the zonelist, so it ends the search. */
+static inline bool zone_in_nodemask(const struct zone *zone,
+ const nodemask_t *nodes)
{
#ifdef CONFIG_NUMA
- return node_isset(zonelist_node_idx(zref), *nodes);
+ return !zone || node_isset(zone_to_nid(zone), *nodes);
#else
- return 1;
+ return true;
#endif /* CONFIG_NUMA */
}
@@ -67,7 +68,7 @@ struct zoneref *__next_zones_zonelist(st
z++;
else
while (zonelist_zone_idx(z) > highest_zoneidx ||
- (zonelist_zone(z) && !zref_in_nodemask(z, nodes)))
+ !zone_in_nodemask(zonelist_zone(z), nodes))
z++;
return z;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0601/1005] mm/memory_hotplug: resize zones under their seqlock
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (599 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0600/1005] mm/mmzone: read each zoneref slot once when filtering by nodemask Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0602/1005] mm: page_isolation: do not take slab pages for free Greg Kroah-Hartman
` (397 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 58e81bb7de5aac8ec5e4aa21d401e7dafbd4058b upstream.
With CONFIG_DEBUG_VM the page allocator checks that a page which is
freed, split or allocated lies within its zone. The check reads
zone->zone_start_pfn and zone->spanned_pages under zone->span_seqlock, as
memory hotplug can change the two at any time.
Commit 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking") removed
the write side, since all resizing is serialized by the hotplug lock. That
leaves the reader without protection. When memory below the start of a
zone goes online, the start is lowered first and the size is raised
afterwards. When the lowest memory of a zone goes offline, the size is
reduced first. In between, the zone seems to end before its last pages. If
one of them goes through the allocator at that moment, it is reported as
being outside of the zone triggers VM_BUG_ON_PAGE().
Write the two fields in a write section of the seqlock. Interrupts are
disabled as pages are freed from interrupts, too, and the reader would
wait for the writer which it has interrupted.
Fixes: 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-4-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/memory_hotplug.c | 44 ++++++++++++++++++++++++++++----------------
1 file changed, 28 insertions(+), 16 deletions(-)
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -475,6 +475,22 @@ static unsigned long find_biggest_sectio
return 0;
}
+/*
+ * The page allocator checks pages against the span of their zone while the
+ * zone is resized, see page_outside_zone_boundaries(). It must not see the
+ * new value of one field together with the old value of the other one.
+ */
+static void zone_set_span(struct zone *zone, unsigned long start_pfn,
+ unsigned long spanned_pages)
+{
+ unsigned long flags;
+
+ write_seqlock_irqsave(&zone->span_seqlock, flags);
+ zone->zone_start_pfn = start_pfn;
+ zone->spanned_pages = spanned_pages;
+ write_sequnlock_irqrestore(&zone->span_seqlock, flags);
+}
+
static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
unsigned long end_pfn)
{
@@ -490,13 +506,10 @@ static void shrink_zone_span(struct zone
*/
pfn = find_smallest_section_pfn(nid, zone, end_pfn,
zone_end_pfn(zone));
- if (pfn) {
- zone->spanned_pages = zone_end_pfn(zone) - pfn;
- zone->zone_start_pfn = pfn;
- } else {
- zone->zone_start_pfn = 0;
- zone->spanned_pages = 0;
- }
+ if (pfn)
+ zone_set_span(zone, pfn, zone_end_pfn(zone) - pfn);
+ else
+ zone_set_span(zone, 0, 0);
} else if (zone_end_pfn(zone) == end_pfn) {
/*
* If the section is biggest section in the zone, it need
@@ -507,11 +520,10 @@ static void shrink_zone_span(struct zone
pfn = find_biggest_section_pfn(nid, zone, zone->zone_start_pfn,
start_pfn);
if (pfn)
- zone->spanned_pages = pfn - zone->zone_start_pfn + 1;
- else {
- zone->zone_start_pfn = 0;
- zone->spanned_pages = 0;
- }
+ zone_set_span(zone, zone->zone_start_pfn,
+ pfn - zone->zone_start_pfn + 1);
+ else
+ zone_set_span(zone, 0, 0);
}
}
@@ -703,12 +715,12 @@ static void online_pages_range(unsigned
static void __meminit resize_zone_range(struct zone *zone, unsigned long start_pfn,
unsigned long nr_pages)
{
- unsigned long old_end_pfn = zone_end_pfn(zone);
+ unsigned long end_pfn = max(start_pfn + nr_pages, zone_end_pfn(zone));
- if (zone_is_empty(zone) || start_pfn < zone->zone_start_pfn)
- zone->zone_start_pfn = start_pfn;
+ if (!zone_is_empty(zone) && start_pfn > zone->zone_start_pfn)
+ start_pfn = zone->zone_start_pfn;
- zone->spanned_pages = max(start_pfn + nr_pages, old_end_pfn) - zone->zone_start_pfn;
+ zone_set_span(zone, start_pfn, end_pfn - start_pfn);
}
static void __meminit resize_pgdat_range(struct pglist_data *pgdat, unsigned long start_pfn,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0602/1005] mm: page_isolation: do not take slab pages for free
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (600 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0601/1005] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0603/1005] mm/page_alloc: dont undo another isolation in alloc_contig_range Greg Kroah-Hartman
` (396 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Zi Yan, Johannes Weiner, Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 213268869301f747d19ca00a391757a6cf2d4fa8 upstream.
page_is_unmovable() regards a page with a reference count of zero as free
or about to be freed. Since slab allocates frozen pages, they will
be wrongly considered to be freed if order 0 (higher-order compound
pages are caught earlier).
If such slabs are the only unmovable pages of a memory block, memory
offlining now isolates the block, this can lead to offline_pages()
looping without progress.
Thus detect the slab pages as removable to return -EBUSY, as would
happen before commit 9aec2fb0fd5e ("slab: allocate frozen pages").
Fixes: 9aec2fb0fd5e ("slab: allocate frozen pages")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-3-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/memory_hotplug.c | 7 +++++++
mm/page_isolation.c | 7 +++++++
2 files changed, 14 insertions(+)
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1835,6 +1835,13 @@ static int scan_movable_pages(unsigned l
if (PageOffline(page) && page_count(page))
return -EBUSY;
+ /*
+ * A page that was allocated, but was not a slab page yet, when
+ * its pageblock was isolated.
+ */
+ if (PageSlab(page))
+ return -EBUSY;
+
folio = page_folio(page);
if (!folio_test_hugetlb(folio))
continue;
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -75,6 +75,13 @@ bool page_is_unmovable(struct zone *zone
}
/*
+ * Slab pages are frozen: do not take their reference count of zero
+ * for that of a free page.
+ */
+ if (PageSlab(page))
+ return true;
+
+ /*
* We can't use page_count without pin a page
* because another CPU can free compound page.
* This check already skips compound tails of THP
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0603/1005] mm/page_alloc: dont undo another isolation in alloc_contig_range
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (601 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0602/1005] mm: page_isolation: do not take slab pages for free Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0604/1005] mm/page_alloc: reset can_retry_reserves when the slowpath restarts Greg Kroah-Hartman
` (395 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta), Zi Yan,
Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit 7d9c29ed8feec8bfbe5e5f673ba2b5926da11375 upstream.
An alloc_contig_range() that overlaps a block going offline can leave
the offline spinning until it gets a signal, holding the device hotplug
lock. When isolation fails, alloc_contig_frozen_range() undoes it over
the whole range, clearing the offline's MIGRATE_ISOLATE too:
CPU 1 (offline_pages) CPU 2 (alloc_contig_range)
start_isolate_page_range()
blocks are MIGRATE_ISOLATE
start_isolate_page_range()
-EBUSY on CPU 1's blocks
undo_isolate_page_range()
blocks are MIGRATE_MOVABLE
test_pages_isolated()
never succeeds again
start_isolate_page_range() fails only on a block someone else isolated,
after undoing its own, so this undo only ever clears another caller's.
Return directly, as before alloc_contig_range() went pageblock granular.
With offline_pages() parked after isolating a DIMM block and a 1G
hugetlb allocation made over it, the offline on base still loops 30s
later in 4 of 4 runs:
offline_pages+0x5b2/0x1570
memory_subsys_offline+0x17e/0x470
device_offline+0x250/0x340
state_store+0x88/0x110
With this patch the allocation still fails, and the offline completes in
3 of 3 runs.
Fixes: b2c9e2fbba32 ("mm: make alloc_contig_range work at pageblock granularity")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261027042204.3741307-5-gourry@gourry.net
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7377,9 +7377,13 @@ int alloc_contig_frozen_range_noprof(uns
* put back to page allocator so that buddy can use them.
*/
+ /*
+ * On failure this has undone its own isolation, and any other
+ * isolated blocks in the range belong to someone else, e.g. offline.
+ */
ret = start_isolate_page_range(start, end, mode);
if (ret)
- goto done;
+ return ret;
drain_all_pages(cc.zone);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0604/1005] mm/page_alloc: reset can_retry_reserves when the slowpath restarts
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (602 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0603/1005] mm/page_alloc: dont undo another isolation in alloc_contig_range Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0605/1005] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
` (394 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta), Zi Yan,
Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit b35ce030893929b3670de82bdac2713cb7b20d90 upstream.
Commit 2c4c3e29897d ("mm/page_alloc: simplify __alloc_pages_slowpath()
flow") retries an allocation once with reserve_flags when the caller
becomes eligible for reserves, guarded by can_retry_reserves.
A restart after a cpuset update or a zonelist rebuild retries with
can_retry_reserves already set to false, so a caller that cannot
reclaim (GFP_NOWAIT | __GFP_MEMALLOC), fails without trying reserves.
Reset can_retry_reserves on restart. Only a cpuset or zonelist change
restarts the slowpath, so the retry still runs at most once per change.
With a kprobe helping to make the race deterministic, an allocation
can be made to return NULL. With this patch the allocation will succeed.
Fixes: 2c4c3e29897d ("mm/page_alloc: simplify __alloc_pages_slowpath() flow")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-2-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4806,7 +4806,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, u
unsigned int zonelist_iter_cookie;
int reserve_flags;
bool compact_first = false;
- bool can_retry_reserves = true;
+ bool can_retry_reserves;
unsigned long alloc_start_time = jiffies;
/*
@@ -4840,6 +4840,7 @@ restart:
no_progress_loops = 0;
compact_result = COMPACT_SKIPPED;
compact_priority = DEF_COMPACT_PRIORITY;
+ can_retry_reserves = true;
cpuset_mems_cookie = read_mems_allowed_begin();
zonelist_iter_cookie = zonelist_iter_begin();
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0605/1005] mm/page_alloc: keep the pagesets of an empty zone
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (603 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0604/1005] mm/page_alloc: reset can_retry_reserves when the slowpath restarts Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0606/1005] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
` (393 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Johannes Weiner, Gregory Price (Meta), Zi Yan,
Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 7bfcf81b1cb469bc016fa8e07939c0924b9ff8db upstream.
When the last memory of a zone goes offline, zone_pcp_reset() frees
zone->per_cpu_pageset and zone->per_cpu_zonestats. Nothing waits for those
who found the zone populated and still use the two pointers. They take
neither the memory hotplug lock nor any other lock which offline_pages()
holds, and some of them can sleep:
CPU0 vmstat_update() CPU1 offline_pages()
refresh_cpu_vm_stats()
for_each_populated_zone(zone)
pcp = zone->per_cpu_pageset
cond_resched()
adjust_present_page_count()
zone_pcp_reset(zone)
free_percpu(zone->per_cpu_pageset)
decay_pcp_high(zone, pcp)
__this_cpu_write(pcp->expire, 0)
The same goes for drain_all_pages(NULL), which takes pcp->lock, for
zone_pcp_update(), show_free_areas() and the readers and writers of the
zonestats. If the per-cpu memory has got a new owner in the meantime, it
is corrupted.
The pagesets are only freed because setup_zone_pageset() would otherwise
leak them when the zone gets memory again. Keep them instead and let
setup_zone_pageset() and zone_pcp_init() use them again, like it is done
with pgdat->per_cpu_nodestats. Their lists are empty, and their limits
have been calculated for a zone without memory by the
init_per_zone_wmark_min() of offline_pages(), which is what
setup_zone_pageset() would come up with as well.
Fixes: 340175b7d14d ("mm/hotplug: free zone->pageset when a zone becomes empty")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-3-gourry@gourry.net
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6357,6 +6357,10 @@ void __meminit setup_zone_pageset(struct
{
int cpu;
+ /* The zone has been populated before, see zone_pcp_reset(). */
+ if (zone->per_cpu_pageset != &boot_pageset)
+ return;
+
/* Size may be 0 on !SMP && !NUMA */
if (sizeof(struct per_cpu_zonestat) > 0)
zone->per_cpu_zonestats = alloc_percpu(struct per_cpu_zonestat);
@@ -6449,6 +6453,10 @@ void __init setup_per_cpu_pageset(void)
__meminit void zone_pcp_init(struct zone *zone)
{
+ /* This initialization only needs to be done once */
+ if (zone->per_cpu_pageset)
+ return;
+
/*
* per cpu subsystem is not up at this point. The following code
* relies on the ability of the linker to provide the
@@ -7746,6 +7754,12 @@ void zone_pcp_enable(struct zone *zone)
mutex_unlock(&pcp_batch_high_lock);
}
+/*
+ * The zone has become empty. Its pagesets and zonestats are not freed: nothing
+ * keeps somebody who found the zone populated, such as refresh_cpu_vm_stats()
+ * or drain_all_pages(), from still using them. They are used again when the
+ * zone gets memory again.
+ */
void zone_pcp_reset(struct zone *zone)
{
int cpu;
@@ -7756,12 +7770,6 @@ void zone_pcp_reset(struct zone *zone)
pzstats = per_cpu_ptr(zone->per_cpu_zonestats, cpu);
drain_zonestat(zone, pzstats);
}
- free_percpu(zone->per_cpu_pageset);
- zone->per_cpu_pageset = &boot_pageset;
- if (zone->per_cpu_zonestats != &boot_zonestats) {
- free_percpu(zone->per_cpu_zonestats);
- zone->per_cpu_zonestats = &boot_zonestats;
- }
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0606/1005] mm/page_alloc: detect zonelist rebuilds from memory hot-add
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (604 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0605/1005] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0607/1005] mm/page_alloc: snapshot the preferred zone against shrink rebuilds Greg Kroah-Hartman
` (392 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vlastimil Babka (SUSE),
Gregory Price (Meta), Zi Yan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit e5db040c3d09c5d85dda70f736d4d1a6714b741e upstream.
The zonelist_update_seq retry was limited to CONFIG_MEMORY_HOTREMOVE,
presumably because only hot-remove takes zones out of a zonelist.
However, build_zonerefs_node() rewrites the zonelists in place, so
onlining the first block of a zone shifts the entries that follow it
in every zonelist containing that zone. This can cause a spurious
allocation failure for a __GFP_THISNODE caller.
For a node with only ZONE_NORMAL, onlining its first ZONE_MOVABLE block
rewrites the node's ZONELIST_NOFALLBACK list as:
[NORMAL, NULL] -> [MOVABLE, NULL] -> [MOVABLE, NORMAL, NULL]
A concurrent GFP_KERNEL | __GFP_THISNODE allocation can observe the
intermediate list, skip ZONE_MOVABLE, and find no eligible zone. With
CONFIG_MEMORY_HOTREMOVE=n, check_retry_zonelist() returns 0 and the
allocation fails even though the node has free ZONE_NORMAL memory.
Gate the sequence checks on CONFIG_MEMORY_HOTPLUG, which covers every
configuration that rebuilds zonelists after boot.
Fixes: 3d36424b3b58 ("mm/page_alloc: fix race condition between build_all_zonelists and page allocation")
Cc: stable@vger.kernel.org
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-5-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4427,7 +4427,7 @@ static DEFINE_SEQLOCK(zonelist_update_se
static unsigned int zonelist_iter_begin(void)
{
- if (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
return read_seqbegin(&zonelist_update_seq);
return 0;
@@ -4435,7 +4435,7 @@ static unsigned int zonelist_iter_begin(
static unsigned int check_retry_zonelist(unsigned int seq)
{
- if (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
return read_seqretry(&zonelist_update_seq, seq);
return seq;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0607/1005] mm/page_alloc: snapshot the preferred zone against shrink rebuilds
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (605 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0606/1005] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0608/1005] mm/page_alloc: clear ->private of deferred free pages Greg Kroah-Hartman
` (391 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
commit b3e3a760eb68449e2794ef68ab212173d9c3e8c7 upstream.
get_page_from_freelist() and alloc_pages_bulk_noprof() reread
ac->preferred_zoneref->zone at every use. Offlining a zone's last block
rebuilds the zonelists in place, and the shrunk list's NULL terminator
can land on the preferred slot mid-walk:
CPU 0 CPU 1
get_page_from_freelist(GFP_KERNEL | __GFP_THISNODE)
zone = NORMAL (slot 1)
offline_pages()
build_all_zonelists()
[MOVABLE, NORMAL, NULL]
-> [NORMAL, NULL]
rmqueue(zonelist_zone(slot 1), zone)
zone_statistics(NULL, zone)
BUG: kernel NULL pointer dereference, address: 0000000000000060
RIP: 0010:get_page_from_freelist+0x6a5/0x15f0
Call Trace:
__alloc_frozen_pages_noprof+0x125/0x330
Read the slot once. Zones are never freed, so a stale zone is safe, and
a NULL slot fails the same way as walking off the end.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://patch.msgid.link/20261101021340.2251928-7-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3817,12 +3817,21 @@ get_page_from_freelist(gfp_t gfp_mask, u
{
struct zoneref *z;
struct zone *zone;
+ struct zone *preferred_zone;
struct pglist_data *last_pgdat = NULL;
bool last_pgdat_dirty_ok = false;
bool no_fallback;
bool skip_kswapd_nodes = nr_online_nodes > 1;
bool skipped_kswapd_nodes = false;
+ /*
+ * A concurrent zonelist rebuild can NULL or replace this slot. Zones
+ * are never freed, so reading it once keeps a usable zone.
+ */
+ preferred_zone = zonelist_zone(ac->preferred_zoneref);
+ if (!preferred_zone)
+ return NULL;
+
retry:
/*
* Scan zonelist, looking for a zone with enough free.
@@ -3869,7 +3878,7 @@ retry:
}
if (no_fallback && !defrag_mode && nr_online_nodes > 1 &&
- zone != zonelist_zone(ac->preferred_zoneref)) {
+ zone != preferred_zone) {
int local_nid;
/*
@@ -3877,7 +3886,7 @@ retry:
* fragmenting fallbacks. Locality is more important
* than fragmentation avoidance.
*/
- local_nid = zonelist_node_idx(ac->preferred_zoneref);
+ local_nid = zone_to_nid(preferred_zone);
if (zone_to_nid(zone) != local_nid) {
alloc_flags &= ~ALLOC_NOFRAGMENT;
goto retry;
@@ -3939,7 +3948,7 @@ check_alloc_wmark:
goto try_this_zone;
if (!node_reclaim_enabled() ||
- !zone_allows_reclaim(zonelist_zone(ac->preferred_zoneref), zone))
+ !zone_allows_reclaim(preferred_zone, zone))
continue;
if (!node_reclaim(zone->zone_pgdat, gfp_mask, order))
@@ -3952,7 +3961,7 @@ check_alloc_wmark:
}
try_this_zone:
- page = rmqueue(zonelist_zone(ac->preferred_zoneref), zone, order,
+ page = rmqueue(preferred_zone, zone, order,
gfp_mask, alloc_flags, ac->migratetype);
if (page) {
prep_new_page(page, order, gfp_mask, alloc_flags);
@@ -5207,6 +5216,7 @@ unsigned long alloc_pages_bulk_noprof(gf
{
struct page *page;
struct zone *zone;
+ struct zone *preferred_zone;
struct zoneref *z;
struct per_cpu_pages *pcp;
struct list_head *pcp_list;
@@ -5254,6 +5264,11 @@ unsigned long alloc_pages_bulk_noprof(gf
if (!prepare_alloc_pages(gfp, 0, preferred_nid, nodemask, &ac, &gfp, &alloc_flags))
goto out;
+ /* Read once; see get_page_from_freelist(). */
+ preferred_zone = zonelist_zone(ac.preferred_zoneref);
+ if (!preferred_zone)
+ goto failed;
+
/* Find an allowed local zone that meets the low watermark. */
z = ac.preferred_zoneref;
for_next_zone_zonelist_nodemask(zone, z, ac.highest_zoneidx, ac.nodemask) {
@@ -5264,8 +5279,8 @@ unsigned long alloc_pages_bulk_noprof(gf
continue;
}
- if (nr_online_nodes > 1 && zone != zonelist_zone(ac.preferred_zoneref) &&
- zone_to_nid(zone) != zonelist_node_idx(ac.preferred_zoneref)) {
+ if (nr_online_nodes > 1 && zone != preferred_zone &&
+ zone_to_nid(zone) != zone_to_nid(preferred_zone)) {
goto failed;
}
@@ -5273,7 +5288,7 @@ unsigned long alloc_pages_bulk_noprof(gf
retry_this_zone:
mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK) + nr_pages - nr_populated;
if (zone_watermark_fast(zone, 0, mark,
- zonelist_zone_idx(ac.preferred_zoneref),
+ zone_idx(preferred_zone),
alloc_flags, gfp)) {
break;
}
@@ -5330,7 +5345,7 @@ retry_this_zone:
pcp_spin_unlock(pcp);
__count_zid_vm_events(PGALLOC, zone_idx(zone), nr_account);
- zone_statistics(zonelist_zone(ac.preferred_zoneref), zone, nr_account);
+ zone_statistics(preferred_zone, zone, nr_account);
out:
return nr_populated;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0608/1005] mm/page_alloc: clear ->private of deferred free pages
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (606 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0607/1005] mm/page_alloc: snapshot the preferred zone against shrink rebuilds Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0609/1005] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() Greg Kroah-Hartman
` (390 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Zi Yan, Johannes Weiner, Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit aae6b83fe47ed8bff9195efbe1d191ec52e5436e upstream.
free_pages_nolock() and free_frozen_pages_nolock() put the page on
zone->trylock_free_pages if they get neither the pcp lock nor zone->lock.
add_page_to_zone_llist() keeps the order of the page in page->private.
The next free_one_page() which does get zone->lock passes these pages to
split_large_buddy() with ->private still set.
__free_one_page() writes ->private of the head of the resulting free page
only. If the deferred page is merged with its lower buddy, it becomes a
tail of that free page and keeps the order in ->private.
All other free pages which are not the head of a buddy have a ->private
of zero, and since commit 819bfbd47e49 ("mm/page_alloc: remove
set_page_private() in prep_compound_tail()") the allocator relies on it.
When the stale page is allocated again as a tail of a larger page:
- prep_compound_tail() hits VM_WARN_ON_ONCE(tail->private);
- with the page checks enabled, __free_pages_prepare() reports
"BUG: Bad page state", "nonzero private", and leaks the whole page;
- without them the value is seen by whoever uses that page next, e.g. as
folio->private of a folio which is split off a large folio.
Only pages of an order above zero are affected. Those can be freed
through _nolock() by the stack depot (order 2) and by SLUB (a new slab
which cannot be added to the partial list by kmalloc_nolock()).
Clear ->private when the page is taken off the list.
Fixes: 8c57b687e833 ("mm, bpf: Introduce free_pages_nolock()")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-1-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 2 ++
1 file changed, 2 insertions(+)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1580,6 +1580,8 @@ static void free_one_page(struct zone *z
llist_for_each_entry_safe(p, tmp, llnode, pcp_llist) {
unsigned int p_order = p->private;
+ /* It may end up as a tail of the merged free page. */
+ p->private = 0;
split_large_buddy(zone, p, page_to_pfn(p), p_order, fpi_flags);
__count_vm_events(PGFREE, 1 << p_order);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0609/1005] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (607 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0608/1005] mm/page_alloc: clear ->private of deferred free pages Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0610/1005] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr() Greg Kroah-Hartman
` (389 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Bacik, Vlastimil Babka (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlastimil Babka (SUSE) <vbabka@kernel.org>
commit 2122887b04f3f2d76daa80055c2c273926032fa0 upstream.
Whenever the flags of a pageblock are read or written, a kernel with
CONFIG_DEBUG_VM makes sure that the pfn lies within the zone of the page.
Unlike bad_range(), that check reads zone->zone_start_pfn and
zone->spanned_pages without zone->span_seqlock.
Memory hotplug changes the two fields one after the other. If the lower
end of a zone moves, the zone seems to end before its last pages in
between. A page of that part which is freed at that moment, on another
CPU, ends in
page dumped because: VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn))
kernel BUG at mm/page_alloc.c:372!
free_unref_folios+0x55e/0xed0
folios_put_refs+0x2b5/0x530
An attempt has been made [1] to fix this with the span seqlock check.
But that can trigger all sorts of problems in restricted contexts, as
noted by sashiko [2].
Since this is just a sanity debug check and anything with BUG_ON is
frowned upon anyway, just remove it altogether.
Reported-by: Josef Bacik <josef@toxicpanda.com>
Closes: https://lore.kernel.org/all/20261027-pgalloc-ai-hotfixes-v1-9-9c7d1aca801e@kernel.org/ [1]
Link: https://lore.kernel.org/all/sashiko-outbox-188081@kernel.org/ [2]
Fixes: 86051ca5eaf5 ("mm: fix usemap initialization")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-5-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page_alloc.c | 1 -
1 file changed, 1 deletion(-)
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -370,7 +370,6 @@ get_pfnblock_bitmap_bitidx(const struct
BUILD_BUG_ON(NR_PAGEBLOCK_BITS != 4);
#endif
BUILD_BUG_ON(__MIGRATE_TYPE_END > PAGEBLOCK_MIGRATETYPE_MASK);
- VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page);
bitmap = get_pageblock_bitmap(page, pfn);
*bitidx = pfn_to_bitidx(page, pfn);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0610/1005] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (608 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0609/1005] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0611/1005] bootconfig: Trim unquoted values at end of file Greg Kroah-Hartman
` (388 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Shuai Xue,
Rafael J. Wysocki
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
commit cf12faa1e76d43f97b1486aaec959b16baca498a upstream.
ghes_log_hwerr() is meant to count recoverable GHES errors in
hwerror_data[], but it skips them and counts informational records
instead. As a result, recoverable CPU, memory, CXL and vendor-specific
errors reported through GHES never show up in a vmcore.
ghes_do_proc() passes ghes_log_hwerr() the record severity after
ghes_severity() has converted it to a GHES_SEV_* value.
ghes_log_hwerr() compares it against CPER_SEV_RECOVERABLE, which is 0
in the CPER enum and matches GHES_SEV_NO, so only informational records
pass and GHES_SEV_RECOVERABLE ones return early.
Compare against GHES_SEV_RECOVERABLE instead.
Recoverable PCIe errors that ghes_handle_aer() hands to AER are also
counted by pci_dev_aer_stats_incr(), so with the check fixed they are
counted twice under HWERR_RECOV_PCI. That is not addressed here.
Fixes: 3fa805c37dd4 ("vmcoreinfo: track and log recoverable hardware errors")
Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Link: https://patch.msgid.link/20261030-ghes-hwerr-sev-v1-1-145ceb996c77@debian.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/apei/ghes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -912,7 +912,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_cper_kfifo_get,
static void ghes_log_hwerr(int sev, guid_t *sec_type)
{
- if (sev != CPER_SEV_RECOVERABLE)
+ if (sev != GHES_SEV_RECOVERABLE)
return;
if (guid_equal(sec_type, &CPER_SEC_PROC_ARM) ||
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0611/1005] bootconfig: Trim unquoted values at end of file
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (609 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0610/1005] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0612/1005] btrfs: fix bio counter and bioc leak when async checksumming fails Greg Kroah-Hartman
` (387 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eduardo Mucelli Rezende Oliveira,
Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
commit 381b391bfaa3f10d52da4740529804b0b6b8160d upstream.
__xbc_parse_value() trims an unquoted value when it encounters a
delimiter, but leaves trailing whitespace intact when it reaches the end
of the input. Thus "key = value " has a different value depending on
whether the file ends with a newline. The extra whitespace also reaches
the rendered kernel command line.
Trim unquoted values after the scan finishes, including at end of input.
Skip trimming after a closing quote so intentional whitespace in quoted
values remains unchanged. Add checks for scalars, arrays and quoted
values without a final newline.
Link: https://lore.kernel.org/all/31f248f330e716b925add3a0ba76f62826527312.1794337724.git.edumucelli@gmail.com/
Fixes: 76db5a27a827 ("bootconfig: Add Extra Boot Config support")
Cc: stable@vger.kernel.org
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/bootconfig.c | 5 +++--
tools/bootconfig/test-bootconfig.sh | 18 ++++++++++++++++++
2 files changed, 21 insertions(+), 2 deletions(-)
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -790,16 +790,17 @@ static int __init __xbc_parse_value(char
return xbc_parse_error("No value delimiter", p);
if (*p)
p++;
- break;
+ goto skip_trim;
}
if (strchr(",;\n#}", c)) {
*p++ = '\0';
- v = strim(v);
break;
}
}
if (quotes)
return xbc_parse_error("No closing quotes", p);
+ v = strim(v);
+skip_trim:
if (c == '#') {
p = skip_comment(p);
c = '\n'; /* A comment must be treated as a newline */
--- a/tools/bootconfig/test-bootconfig.sh
+++ b/tools/bootconfig/test-bootconfig.sh
@@ -171,6 +171,24 @@ $BOOTCONF $INITRD > $OUTFILE
xfail grep -q 'val[[:space:]]' $OUTFILE
xpass grep -q 'val2[[:space:]]' $OUTFILE
+echo "Remove unquoted trailing whitespace at end of file"
+printf 'foo = val \t' > $TEMPCONF
+$BOOTCONF -l $TEMPCONF > $OUTFILE
+printf 'foo = "val"\n' > $TEMPCONF
+xpass cmp $TEMPCONF $OUTFILE
+
+echo "Remove trailing whitespace from the last array value at end of file"
+printf 'foo = first, last \t' > $TEMPCONF
+$BOOTCONF -l $TEMPCONF > $OUTFILE
+printf 'foo = "first", "last"\n' > $TEMPCONF
+xpass cmp $TEMPCONF $OUTFILE
+
+echo "Keep quoted trailing whitespace at end of file"
+printf 'foo = "val "' > $TEMPCONF
+$BOOTCONF -l $TEMPCONF > $OUTFILE
+printf 'foo = "val "\n' > $TEMPCONF
+xpass cmp $TEMPCONF $OUTFILE
+
echo "Showing correct line:column of no closing brace"
cat > $TEMPCONF << EOF
foo {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0612/1005] btrfs: fix bio counter and bioc leak when async checksumming fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (610 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0611/1005] bootconfig: Trim unquoted values at end of file Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0613/1005] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT Greg Kroah-Hartman
` (386 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Mani Tofigh, David Sterba
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mani Tofigh <mt4022@columbia.edu>
commit d27d0039bc1334be8a72c769e14c0b0c3efc317d upstream.
A single failed checksum allocation can make a later device replace
hang forever. btrfs_submit_chunk() takes a dev-replace bio counter
reference and a bioc before it hands a write to the checksum worker.
If the checksum fails there (e.g., its allocation fails),
run_one_async_done() ends the bio but drops neither. The counter then
never gets back to zero and the next replace waits for it:
[ 8.369] BTRFS info (device ram0): dev_replace from /dev/ram0 (devid 1) to /dev/ram1 finished
[41.534] INFO: task btrfscsum:80 blocked for more than 20 seconds.
[41.534] btrfs_rm_dev_replace_blocked+0x135/0x180
[41.534] btrfs_dev_replace_finishing+0xefe/0x13b0
The worker is only used when CONFIG_BTRFS_EXPERIMENTAL is off and the
checksum isn't a fast one, e.g., sha256. We hit it on a sha256
filesystem.
We put the bioc and drop the counter in that error branch. We also
put the bioc on the synchronous error path and on the btrfs_split_bio()
error path, which both only drop the counter. With the fix, the
replace doesn't hang anymore.
This bug was identified and confirmed with the help of fault-injection
testing on a deterministic hypervisor currently under development. Our
C reproducer however hits it within about 35s.
Fixes: f8a53bb58ec7 ("btrfs: handle checksum generation in the storage layer")
Fixes: c7c97ceff98c ("btrfs: handle bio_split() errors")
CC: stable@vger.kernel.org # 6.6+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mani Tofigh <mt4022@columbia.edu>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/btrfs/bio.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/fs/btrfs/bio.c
+++ b/fs/btrfs/bio.c
@@ -634,6 +634,8 @@ static void run_one_async_done(struct bt
/* If an error occurred we just want to clean up the bio and move on. */
if (bio->bi_status) {
+ btrfs_put_bioc(async->bioc);
+ btrfs_bio_counter_dec(async->bbio->inode->root->fs_info);
btrfs_bio_end_io(async->bbio, bio->bi_status);
return;
}
@@ -772,6 +774,7 @@ static bool btrfs_submit_chunk(struct bt
split = btrfs_split_bio(fs_info, bbio, map_length);
if (IS_ERR(split)) {
status = errno_to_blk_status(PTR_ERR(split));
+ btrfs_put_bioc(bioc);
btrfs_bio_counter_dec(fs_info);
goto end_bbio;
}
@@ -832,6 +835,7 @@ done:
return map_length == length;
fail:
+ btrfs_put_bioc(bioc);
btrfs_bio_counter_dec(fs_info);
/*
* We have split the original bbio, now we have to end both the current
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0613/1005] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (611 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0612/1005] btrfs: fix bio counter and bioc leak when async checksumming fails Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0614/1005] coda: honor the append state of each write Greg Kroah-Hartman
` (385 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Cheng Yongkang, Qu Wenruo,
David Sterba
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
commit 9a58e56e70f610e29b53821e9c706600e529cca3 upstream.
btrfs_ioctl_subvol_sync() assumes that a cached root with zero
references has BTRFS_ROOT_SUBVOL_DEAD set, and asserts that before
waiting for the cleaner. Two states break the assumption:
- A corrupt ROOT_ITEM with zero references and a matching orphan item,
on a writable filesystem.
- A failed subvolume deletion. btrfs_delete_subvolume() zeroes the
root references, aborts the transaction, which forces the filesystem
read-only, and then clears DEAD again. No on-disk metadata is
corrupted in this case.
With CONFIG_BTRFS_ASSERT=y, both reach a BUG().
Change the ASSERT() into a proper rejection to avoid triggering a BUG().
Fixes: 6c83d153ed86 ("btrfs: add new ioctl to wait for cleaned subvolumes")
CC: stable@vger.kernel.org
Suggested-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Link: https://lore.kernel.org/linux-btrfs/dd97efe9-91ec-495b-b698-acff1447421c@gmx.com/
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
[ Rework the commit message, drop the ad-hoc RW check. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/btrfs/ioctl.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -5173,8 +5173,12 @@ static int btrfs_ioctl_subvol_sync(struc
return -ENOENT;
wait_for_deletion = true;
- ASSERT(root_flags & BTRFS_ROOT_SUBVOL_DEAD, "root_flags=0x%llx",
- root_flags);
+ if (unlikely(!(root_flags & BTRFS_ROOT_SUBVOL_DEAD))) {
+ btrfs_err(fs_info,
+ "subvol %llu has refs 0 without DEAD flag",
+ args.subvolid);
+ return -EUCLEAN;
+ }
sched_ret = schedule_timeout_interruptible(HZ);
/* Early wake up or error. */
if (sched_ret != 0)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0614/1005] coda: honor the append state of each write
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (612 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0613/1005] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0615/1005] entry: Complete syscall_enter_from_user_mode_work() to bool migration Greg Kroah-Hartman
` (384 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hungyu Lin,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hungyu Lin <dennylin0707@gmail.com>
commit 87ea037a9166a5842356ce68e3585fc6e756603b upstream.
coda_open() adds O_APPEND to the container file's f_flags after it has
been opened, without updating its cached f_iocb_flags. An O_APPEND write
can therefore overwrite existing data instead of appending. For example,
writing "Z" to a file containing "abc" produces "Zbc" rather than "abcZ".
Pass RWF_APPEND or RWF_NOAPPEND to vfs_iter_write() according to the
incoming IOCB_APPEND state. This also honors changes made with F_SETFL
and per-write append overrides instead of relying on the container's
open-time flags.
Fixes: 164f4064ca81 ("keep iocb_flags() result cached in struct file")
Cc: stable@vger.kernel.org # 6.9+
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20261105051406.52442-1-dennylin0707@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/coda/file.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/coda/file.c
+++ b/fs/coda/file.c
@@ -71,6 +71,7 @@ coda_file_write_iter(struct kiocb *iocb,
struct file *host_file = cfi->cfi_container;
loff_t ki_pos = iocb->ki_pos;
size_t count = iov_iter_count(to);
+ rwf_t flags = (iocb->ki_flags & IOCB_APPEND) ? RWF_APPEND : RWF_NOAPPEND;
ssize_t ret;
ret = venus_access_intent(coda_inode->i_sb, coda_i2f(coda_inode),
@@ -80,7 +81,7 @@ coda_file_write_iter(struct kiocb *iocb,
goto finish_write;
inode_lock(coda_inode);
- ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos, 0);
+ ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos, flags);
coda_inode->i_size = file_inode(host_file)->i_size;
coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9;
inode_set_mtime_to_ts(coda_inode, inode_set_ctime_current(coda_inode));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0615/1005] entry: Complete syscall_enter_from_user_mode_work() to bool migration
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (613 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0614/1005] coda: honor the append state of each write Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0616/1005] entry: Fix return type of syscall_trace_enter() Greg Kroah-Hartman
` (383 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Florian Bezdeka, Thomas Gleixner
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Bezdeka <florian.bezdeka@siemens.com>
commit efe191f1605a149b06eb0fe1ff975e7d3137c9bb upstream.
The return type of syscall_enter_from_user_mode_work() was changed to
bool in the commit referenced below.
While doing so, one caller in syscall_enter_from_user_mode_randomize_stack()
was overlooked and stayed at the previous type: long.
Update this caller accordingly.
Fixes: 05c033db7e9a ("entry, treewide: Make syscall_enter_from_user_mode[_work]() indicate syscall execution")
Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261030-wip-flo-fixup-entry-code-v1-2-7724c29e800b@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/entry-common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index a8b2430eadc5..15278416f886 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -202,7 +202,7 @@ do { \
\
instrumentation_begin(); \
local_irq_enable(); \
- long _ret = syscall_enter_from_user_mode_work(regs, syscall); \
+ bool _ret = syscall_enter_from_user_mode_work(regs, syscall); \
instrumentation_end(); \
\
_ret; \
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0616/1005] entry: Fix return type of syscall_trace_enter()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (614 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0615/1005] entry: Complete syscall_enter_from_user_mode_work() to bool migration Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0617/1005] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
` (382 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Florian Bezdeka, Thomas Gleixner
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Bezdeka <florian.bezdeka@siemens.com>
commit 75b1663222d7aa0b3c33cc3522a347757e6d1d26 upstream.
All return values of syscall_trace_enter() were migrated to bool in
commit 71ff30013f19 ("entry: Make return type of syscall_trace_enter() bool"),
but the function declaration has not been updated.
Fix that up now.
Fixes: 71ff30013f19 ("entry: Make return type of syscall_trace_enter() bool")
Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261030-wip-flo-fixup-entry-code-v1-1-7724c29e800b@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/entry-common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index fa2854fed1f2..a8b2430eadc5 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -62,7 +62,7 @@ void trace_syscall_enter(struct pt_regs *regs);
void trace_syscall_exit(struct pt_regs *regs, long ret);
void syscall_enter_audit(struct pt_regs *regs);
-static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned long work,
+static __always_inline bool syscall_trace_enter(struct pt_regs *regs, unsigned long work,
long syscall)
{
/*
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0617/1005] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (615 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0616/1005] entry: Fix return type of syscall_trace_enter() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0618/1005] liveupdate: check for duplicate session before growing block set Greg Kroah-Hartman
` (381 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ilya Maximets, Sasha Levin,
Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Sridhar Samudrala, Kees Cook, Jean-Paul Sergent
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Paul Sergent <jpsergent@gmail.com>
commit 74a7db839308dd7d1c3f72dd1e3299784df3affb upstream.
Commit 3fcece12bc1b6 ("net: store port/representator id in
metadata_dst") dropped the options_len equality check when converting
skb_metadata_dst_cmp() to a type switch, so the memcmp length is taken
from skb a alone. When skb b carries fewer options than a, the
comparison reads past b's allocation.
Hit in practice with Cilium geneve GRO aggregation, comparing an skb
carrying 12 bytes of tunnel options against one carrying none:
memcmp: detected buffer overflow: 108 byte read of buffer size 96
WARNING: CPU: 0 PID: 15 at lib/string_helpers.c:1036 __fortify_report
__fortify_panic+0x9/0x10
skb_metadata_dst_cmp+0x11b/0x120
dev_gro_receive+0x303/0x620
gro_cell_poll+0x67/0xa0
Restore the check: unequal options_len means different metadata and no
aggregation; the memcmp only runs when both sides carry the same
options length.
Fixes: 3fcece12bc1b6 ("net: store port/representator id in metadata_dst")
Cc: stable@vger.kernel.org
Cc: Ilya Maximets <i.maximets@ovn.org>
Cc: Sasha Levin <sashal@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>
Cc: Sridhar Samudrala <sridhar.samudrala@intel.com>
Cc: Kees Cook <kees@kernel.org>
Signed-off-by: Jean-Paul Sergent <jpsergent@gmail.com>
Link: https://patch.msgid.link/20261109082410.206140-1-jpsergent@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/dst_metadata.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/net/dst_metadata.h
+++ b/include/net/dst_metadata.h
@@ -116,6 +116,8 @@ static inline int skb_metadata_dst_cmp(c
return memcmp(&a->u.port_info, &b->u.port_info,
sizeof(a->u.port_info));
case METADATA_IP_TUNNEL:
+ if (a->u.tun_info.options_len != b->u.tun_info.options_len)
+ return 1;
return memcmp(&a->u.tun_info, &b->u.tun_info,
sizeof(a->u.tun_info) +
a->u.tun_info.options_len);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0618/1005] liveupdate: check for duplicate session before growing block set
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (616 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0617/1005] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0619/1005] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
` (380 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Aurich Zanettini Martins,
Pratyush Yadav (Google), Pasha Tatashin,
Mike Rapoport (Microsoft)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
commit cc448e44f6e9fc83f1527f926f52ebfa5a3d1ce9 upstream.
luo_session_insert() grows the outgoing block set before checking for a
duplicate session name. On -EEXIST the new block stays in the set.
If the session count is an exact multiple of the per-block capacity (51
with 4K pages), that block stays empty. It is serialized with count 0,
which kho_block_set_restore() rejects in the next kernel:
luo: Block contains invalid entry count: 0
Kernel panic - not syncing: The incoming tree failed to initialize properly [-EINVAL], disabling live update
Check for the duplicate before growing the block set, as
luo_preserve_file() does with the token.
Fixes: 2a441a14c2c0 ("liveupdate: Remove limit on the number of sessions")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Link: https://patch.msgid.link/20261103153928.716753-1-christian.aurichzm@gmail.com
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/liveupdate/luo_session.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
--- a/kernel/liveupdate/luo_session.c
+++ b/kernel/liveupdate/luo_session.c
@@ -177,16 +177,6 @@ static int luo_session_insert(struct luo
guard(rwsem_write)(&sh->rwsem);
/*
- * For outgoing we should make sure there is room in serialization array
- * for new session.
- */
- if (sh == &luo_session_global.outgoing) {
- err = kho_block_set_grow(&sh->block_set, sh->count + 1);
- if (err)
- return err;
- }
-
- /*
* For small number of sessions this loop won't hurt performance
* but if we ever start using a lot of sessions, this might
* become a bottle neck during deserialization time, as it would
@@ -196,6 +186,17 @@ static int luo_session_insert(struct luo
if (!strncmp(it->name, session->name, sizeof(it->name)))
return -EEXIST;
}
+
+ /*
+ * For outgoing we should make sure there is room in serialization array
+ * for new session.
+ */
+ if (sh == &luo_session_global.outgoing) {
+ err = kho_block_set_grow(&sh->block_set, sh->count + 1);
+ if (err)
+ return err;
+ }
+
list_add_tail(&session->list, &sh->list);
sh->count++;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0619/1005] macsec: reject frames that decapsulate into runt Ethernet frames
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (617 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0618/1005] liveupdate: check for duplicate session before growing block set Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0620/1005] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
` (379 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Dave Miller
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 1d5e2c57e9ffc134e14b3f837c8d7c53b508bd22 upstream.
When an SCI is unknown and the C bit is clear, macsec_handle_frame()
removes the SecTAG and the default ICV without checking how much of the
frame remains. A short frame can therefore become an skb shorter than
ETH_HLEN. eth_type_trans() cannot pull its Ethernet header, and a second
stacked MACsec device can copy stale skb headroom into a packet delivered
to a packet socket.
The matched-SCI path has a related hole: macsec_validate_skb() accepts a
short_length of one, so a frame that passes the existing length check can
still become a 13-byte Ethernet frame.
Require enough bytes for the MACsec overhead and a complete Ethernet
header before decapsulating an unknown-SCI frame. Apply the same bound
in macsec_validate_skb(), using the selected SecY's ICV length, to cover
the no-SA, synchronous-decrypt and asynchronous-decrypt delivery paths.
Leave other unknown-SCI handling unchanged.
Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/macsec.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -407,8 +407,10 @@ static bool macsec_validate_skb(struct s
int len = skb->len - 2 * ETH_ALEN;
int extra_len = macsec_extra_len(!!(h->tci_an & MACSEC_TCI_SC)) + icv_len;
- /* a) It comprises at least 17 octets */
- if (skb->len <= 16)
+ /* a) It comprises at least 17 octets. The SecTAG and ICV must
+ * also leave a complete Ethernet header.
+ */
+ if (skb->len < ETH_HLEN + extra_len)
return false;
/* b) MACsec EtherType: already checked */
@@ -1330,9 +1332,12 @@ drop_direct:
nosci:
/* 10.6.1 if the SC is not found */
cbit = !!(hdr->tci_an & MACSEC_TCI_C);
- if (!cbit)
- macsec_finalize_skb(skb, MACSEC_DEFAULT_ICV_LEN,
- macsec_extra_len(macsec_skb_cb(skb)->has_sci));
+ if (!cbit) {
+ len = macsec_extra_len(macsec_skb_cb(skb)->has_sci);
+ if (skb->len < ETH_HLEN + len + MACSEC_DEFAULT_ICV_LEN)
+ goto drop_nosc;
+ macsec_finalize_skb(skb, MACSEC_DEFAULT_ICV_LEN, len);
+ }
list_for_each_entry_rcu(macsec, &rxd->secys, secys) {
struct sk_buff *nskb;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0620/1005] mctp: accept MSG_CMSG_COMPAT in recvmsg
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (618 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0619/1005] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0621/1005] net/mlx5e: Fix queue stats access to queues without stats Greg Kroah-Hartman
` (378 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Davidlohr Bueso, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Davidlohr Bueso <dave@stgolabs.net>
commit 350e1d0d3b386fcc0cff2d37aa920fab4800bf72 upstream.
32-bit userspace running on a 64-bit kernel is unable to receive MCTP
messages on an AF_MCTP socket, even though sending succeeds. There is
nothing for MCTP to do with it beyond not rejecting it, as af_packet,
af_key and can/isotp already do, for example.
Fixes: 833ef3b91de6 ("mctp: Populate socket implementation")
Cc: stable@vger.kernel.org
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://patch.msgid.link/20261105160704.2546031-1-dave@stgolabs.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mctp/af_mctp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -292,7 +292,7 @@ static int mctp_recvmsg(struct socket *s
u8 type;
int rc;
- if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
+ if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK | MSG_CMSG_COMPAT))
return -EOPNOTSUPP;
skb = skb_recv_datagram(sk, flags, &rc);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0621/1005] net/mlx5e: Fix queue stats access to queues without stats
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (619 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0620/1005] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0622/1005] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
` (377 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Tariq Toukan,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
commit 9a24799e219b1699bb1c144248c8c500b9504db5 upstream.
I am seeing the following mlx5e crash in the Meta fleet:
pc : mlx5e_get_queue_stats_rx+0x4c/0xc8
Call trace:
mlx5e_get_queue_stats_rx+0x4c/0xc8 (P)
netdev_stat_queue_sum+0x78/0x480
netdev_nl_qstats_get_dump_one+0xf0/0x268
netdev_nl_qstats_get_dumpit+0x7c/0x1f8
When dumping device-wide qstats, the core calls the per-queue callbacks
for every queue below real_num_{rx,tx}_queues, regardless of whether the
netdev is up. Some of those queues have no stats behind them:
- RX stats live in priv->channel_stats[], which only has entries for
channels that have been opened (stats_nch). real_num_rx_queues can
be larger, for example after the channel count is raised while the
netdev is down, or after opening the channels failed part way.
- TX stats are looked up in priv->txq2sq_stats[], which is NULL for
SQs that were never activated and for HTB queues while the channels
are closed.
In both cases the callback dereferences a NULL pointer. The dump needs
no privileges, so any user can trigger it.
Return early for RX queues at or above stats_nch and for TX queues
without SQ stats.
Fixes: 7b66ae536a78 ("net/mlx5e: Add per queue netdev-genl stats")
Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261104-mlx5e-qstats-null-v1-1-a6a003245cec@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5490,7 +5490,7 @@ static void mlx5e_get_queue_stats_rx(str
struct mlx5e_rq_stats *xskrq_stats;
struct mlx5e_rq_stats *rq_stats;
- if (mlx5e_is_uplink_rep(priv) || !mlx5e_stats_nch_read(priv))
+ if (mlx5e_is_uplink_rep(priv) || i >= mlx5e_stats_nch_read(priv))
return;
channel_stats = priv->channel_stats[i];
@@ -5522,6 +5522,9 @@ static void mlx5e_get_queue_stats_tx(str
* inactive sqs.
*/
sq_stats = priv->txq2sq_stats[i];
+ if (!sq_stats)
+ return;
+
stats->packets = sq_stats->packets;
stats->bytes = sq_stats->bytes;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0622/1005] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (620 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0621/1005] net/mlx5e: Fix queue stats access to queues without stats Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0623/1005] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
` (376 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dragos Tatulea, Tariq Toukan,
Jiabin Deng, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiabin Deng <dengjiabin2023@gmail.com>
commit 68c183619f24982a635930697bf8e148f2d78f71 upstream.
When SHAMPO and relaxed ordering writes are enabled, aligned RQ end
padding can corrupt received TCP data. Due to reordering, alignment
padding written at the end of one packet can overwrite data from the
next packet.
The current RQ end padding selection avoids alignment padding for LRO,
but not for SHAMPO. Extend the condition to SHAMPO to prevent this
corruption.
The issue was observed in a two-host test using a BlueField-3 NIC and
an NVIDIA H20 GPU. In the original test with MTU 1500, 354 of 400
transfers contained corrupted data before the fix. After applying this
change, all 400 transfers across eight message sizes from 32 KiB to
4 MiB, with 50 transfers per size, completed successfully, with no
incorrect bytes or corrupted intervals.
Fixes: e5ca8fb08ab2 ("net/mlx5e: Add control path for SHAMPO feature")
Closes: https://lore.kernel.org/r/CAFxp=AY2cVRQrZvB9WNnigbsobuw11NMG-cagHx0_V+ur2ToFw@mail.gmail.com
Link: https://lore.kernel.org/r/atZKOtjrb9HKSNHF@dtatulea-c5.nvidia.com
Suggested-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jiabin Deng <dengjiabin2023@gmail.com>
Link: https://patch.msgid.link/20261110035723.26587-1-dengjiabin2023@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
@@ -911,10 +911,11 @@ static void mlx5e_build_rx_cq_param(stru
static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
{
- bool lro_en = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO;
+ bool no_pad = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO ||
+ params->packet_merge.type == MLX5E_PACKET_MERGE_SHAMPO;
bool ro = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
- return ro && lro_en ?
+ return ro && no_pad ?
MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0623/1005] net/rds: Do not unpin a page after a failed atomic pin
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (621 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0622/1005] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0624/1005] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
` (375 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Kyle Zeng, Allison Henderson,
Dave Miller
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 8d5ce4751fad9499ea408163af7f410f18a85782 upstream.
rds_cmsg_atomic() assumes that a non-NULL output from rds_pin_pages()
represents a pin that it owns. However, pin_user_pages_fast() can roll
back a fast-GUP pin after racing fork() and then fail in the slow path,
for example after a concurrent mprotect(PROT_NONE). The output slot can
still contain the already-unpinned page.
The common error path calls unpin_user_page() on that stale pointer.
This can consume another subsystem's pin and allow the page to be freed
while it is still in use. A local unprivileged reproducer triggers a
KASAN use-after-free write through an io_uring registered buffer.
Clear page when rds_pin_pages() does not return one. The error path
continues to release the page on errors after a successful pin, and
successful requests retain their existing ownership and behavior. All
four RDS atomic ancillary operations share this path.
The issue was found by an LLM.
Fixes: 15133f6e67d8 ("RDS: Implement atomic operations")
Cc: stable@kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Allison Henderson <achender@kernel.org>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/rds/rdma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/net/rds/rdma.c
+++ b/net/rds/rdma.c
@@ -957,8 +957,11 @@ int rds_cmsg_atomic(struct rds_sock *rs,
}
ret = rds_pin_pages(args->local_addr, 1, &page, 1);
- if (ret != 1)
+ if (ret != 1) {
+ /* A failed pin can leave a stale page pointer. */
+ page = NULL;
goto err;
+ }
ret = 0;
sg_set_page(rm->atomic.op_sg, page, 8, offset_in_page(args->local_addr));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0624/1005] net/smc: fix lgr/lnk lifetime vs diag reader race
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (622 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0623/1005] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0625/1005] net/smc: fix link group ownership in handshake abort Greg Kroah-Hartman
` (374 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mahanta Jambigi, Sidraya Jayagond,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahanta Jambigi <mjambigi@linux.ibm.com>
commit d7900fa51642fbc2a5a03354238e71050a7d391d upstream.
The diag dump walks the socket hash table under a read_lock and
dereferences conn->lgr and conn->lnk. Several paths expose a window
where a hashed socket has freed or partially freed conn/lgr/lnk state.
First, smc_conn_abort() calls smc_conn_free() during early handshake
aborts while the socket is still hashed in SMC_INIT, synchronously
freeing the lgr on the smc_lgr_cleanup_early() path without holding the
hash write_lock. A concurrent diag reader can load a non-NULL conn->lgr
and dereference it after the kfree. Skip the connection, link group and
DMB attributes in __smc_diag_dump() for sockets in SMC_INIT or
SMC_CLOSED or fallen back to TCP, and take diag_mode from an is_smcd
flag cached at connection creation.
The state filter alone does not close the race. A connection aborted by
a failed handshake can keep its alert token, because smc_conn_free()
skips the unregister when smc_lgr_terminate_sched() has emptied
lgr->list; close_work may also have been queued before the abort, as the
CDC receive path is not excluded by the handshake's socket lock.
smc_close_passive_work() would then move the hashed socket from SMC_INIT
to SMC_APPCLOSEWAIT1 or SMC_PROCESSABORT, states the filter does not
cover, and later run a passive-closing sock_put() that
smc_connect_decline_fallback() dropped already. Return early from
smc_close_passive_work() when the connection was freed; the check holds
the socket lock that every smc_conn_free() caller holds as well, so a
hashed socket with a freed connection stays in SMC_INIT or SMC_CLOSED
until release.
This changes the sock_diag output for such sockets: the connection, link
group and DMB attributes are omitted, which smcss does not read for
sockets in these states, while SMC_DIAG_FALLBACK is still reported and
an SMC-D socket in SMC_INIT or SMC_CLOSED still reports
SMC_DIAG_MODE_SMCD from the cached flag. A fallback socket is a plain
TCP socket with no SMC connection state to report; the stale conn fields
left behind by smc_conn_abort() must not be read.
Second, in smc_conn_kill() on SMC-D with dmb_nocopy, smcd_buf_detach()
NULLs and frees conn->sndbuf_desc while the socket is still hashed. A
concurrent diag reader entering the CONNINFO block can dereference the
freed descriptor. Unhash the socket right before smcd_buf_detach(). As a
result, killed ACTIVE and APPCLOSEWAIT sockets that are still open are
no longer visible to smcss on loopback-ism devices.
Third, in the terminal teardown branches of smc_close_active_abort()
(PEERCLOSEWAIT and PROCESSABORT groups) and in smc_close_passive_work(),
smc_conn_free() drops lgr and lnk references while the socket is still
hashed. Unhash immediately before each smc_conn_free() call at those
sites. Sockets killed in those close states are therefore unhashed, and
their inuse accounting dropped, before close(), even if the fd is still
open.
Fourth, use smp_load_acquire() / smp_store_release() on sk_state to
order these checks on weakly ordered CPUs. A reader that observes
SMC_ACTIVE is guaranteed to see the connection setup that preceded the
store; a reader that observes SMC_CLOSED from smc_listen_out_err() skips
the connection fields in any case, so that particular store is hardening
kept for uniformity, not a required ordering.
Additionally, in __smc_diag_dump(), use the cached link->ibname instead
of link->smcibdev->ibdev->name, avoiding a NULL pointer dereference or
use-after-free of the IB device when __smcr_link_clear() zeroes the link
during concurrent SMC-R link failover. The link data is still read
without conns_lock or send_lock, so a dump racing a failover may
transiently report zeroed or mixed link fields; this does not affect
memory safety and the next dump reports the new link. Like the SMC
netlink link dump and the tracepoints, the name is the one cached at
link creation time.
Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets")
Fixes: 2a0674fffb6b ("net/smc: improve abnormal termination of link groups")
Fixes: 46c28dbd4c23 ("net/smc: no socket state changes in tasklet context")
Fixes: 9dbe086c69b8 ("net/smc: fix invalid link access in dumping SMC-R connections")
Fixes: ae2be35cbed2 ("net/smc: {at|de}tach sndbuf to peer DMB if supported")
Cc: stable@vger.kernel.org
Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
Reviewed-by: Sidraya Jayagond <sidraya@linux.ibm.com>
Link: https://patch.msgid.link/20261102083122.1098393-1-mjambigi@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/smc/af_smc.c | 10 +++++-----
net/smc/smc.h | 1 +
net/smc/smc_close.c | 14 ++++++++++++++
net/smc/smc_core.c | 8 +++++++-
net/smc/smc_diag.c | 12 ++++++++----
5 files changed, 35 insertions(+), 10 deletions(-)
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -976,7 +976,7 @@ static int smc_connect_fallback(struct s
smc_copy_sock_settings_to_clc(smc);
smc->connect_nonblock = 0;
if (smc->sk.sk_state == SMC_INIT)
- smc->sk.sk_state = SMC_ACTIVE;
+ smp_store_release(&smc->sk.sk_state, SMC_ACTIVE);
return 0;
}
@@ -1381,7 +1381,7 @@ static int smc_connect_rdma(struct smc_s
smc_copy_sock_settings_to_clc(smc);
smc->connect_nonblock = 0;
if (smc->sk.sk_state == SMC_INIT)
- smc->sk.sk_state = SMC_ACTIVE;
+ smp_store_release(&smc->sk.sk_state, SMC_ACTIVE);
return 0;
connect_abort:
@@ -1484,7 +1484,7 @@ static int smc_connect_ism(struct smc_so
smc_copy_sock_settings_to_clc(smc);
smc->connect_nonblock = 0;
if (smc->sk.sk_state == SMC_INIT)
- smc->sk.sk_state = SMC_ACTIVE;
+ smp_store_release(&smc->sk.sk_state, SMC_ACTIVE);
return 0;
connect_abort:
@@ -1951,7 +1951,7 @@ static void smc_listen_out_connected(str
struct sock *newsmcsk = &new_smc->sk;
if (newsmcsk->sk_state == SMC_INIT)
- newsmcsk->sk_state = SMC_ACTIVE;
+ smp_store_release(&newsmcsk->sk_state, SMC_ACTIVE);
smc_listen_out(new_smc);
}
@@ -1965,7 +1965,7 @@ static void smc_listen_out_err(struct sm
this_cpu_inc(net->smc.smc_stats->srv_hshake_err_cnt);
if (newsmcsk->sk_state == SMC_INIT)
sock_put(&new_smc->sk); /* passive closing */
- newsmcsk->sk_state = SMC_CLOSED;
+ smp_store_release(&newsmcsk->sk_state, SMC_CLOSED);
smc_listen_out(new_smc);
}
--- a/net/smc/smc.h
+++ b/net/smc/smc.h
@@ -196,6 +196,7 @@ struct smc_connection {
struct rb_node alert_node;
struct smc_link_group *lgr; /* link group of connection */
struct smc_link *lnk; /* assigned SMC-R link */
+ bool is_smcd; /* SMC-R or SMC-D connection */
u32 alert_token_local; /* unique conn. id */
u8 peer_rmbe_idx; /* from tcp handshake */
int peer_rmbe_size; /* size of peer rx buffer */
--- a/net/smc/smc_close.c
+++ b/net/smc/smc_close.c
@@ -154,6 +154,7 @@ void smc_close_active_abort(struct smc_s
if (sk->sk_state != SMC_PEERABORTWAIT)
break;
sk->sk_state = SMC_CLOSED;
+ sk->sk_prot->unhash(sk);
smc_conn_free(&smc->conn);
release_clcsock = true;
sock_put(sk); /* passive closing */
@@ -165,6 +166,7 @@ void smc_close_active_abort(struct smc_s
if (sk->sk_state != SMC_PEERABORTWAIT)
break;
sk->sk_state = SMC_CLOSED;
+ sk->sk_prot->unhash(sk);
smc_conn_free(&smc->conn);
release_clcsock = true;
break;
@@ -367,6 +369,17 @@ static void smc_close_passive_work(struc
lock_sock(sk);
old_state = sk->sk_state;
+ if (conn->freed) {
+ /* conn->freed is set under the socket lock, which is
+ * held here as well, so this cannot race with the free; the
+ * state machine and its postponed sock_put() are not owed
+ * anymore
+ */
+ release_sock(sk);
+ sock_put(sk); /* sock_hold done by schedulers of close_work */
+ return;
+ }
+
rxflags = &conn->local_rx_ctrl.conn_state_flags;
if (rxflags->peer_conn_abort) {
/* peer has not received all data */
@@ -433,6 +446,7 @@ wakeup:
sk->sk_state_change(sk);
if ((sk->sk_state == SMC_CLOSED) &&
(sock_flag(sk, SOCK_DEAD) || !sk->sk_socket)) {
+ sk->sk_prot->unhash(sk);
smc_conn_free(conn);
if (smc->clcsock)
release_clcsock = true;
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -1530,8 +1530,10 @@ static void smc_conn_kill(struct smc_con
tasklet_kill(&conn->rx_tsklet);
else
tasklet_unlock_wait(&conn->rx_tsklet);
- if (smc_ism_support_dmb_nocopy(conn->lgr->smcd))
+ if (smc_ism_support_dmb_nocopy(conn->lgr->smcd)) {
+ smc->sk.sk_prot->unhash(&smc->sk);
smcd_buf_detach(conn);
+ }
} else {
smc_cdc_wait_pend_tx_wr(conn);
}
@@ -2051,6 +2053,10 @@ create:
goto out;
}
}
+ /* cache the connection type: smc_diag reads it after
+ * smc_conn_free() dropped the link group reference
+ */
+ conn->is_smcd = conn->lgr->is_smcd;
smc_lgr_hold(conn->lgr); /* lgr_put in smc_conn_free() */
if (!conn->lgr->is_smcd)
smcr_link_hold(conn->lnk); /* link_put in smc_conn_free() */
--- a/net/smc/smc_diag.c
+++ b/net/smc/smc_diag.c
@@ -87,10 +87,10 @@ static int __smc_diag_dump(struct sock *
r = nlmsg_data(nlh);
smc_diag_msg_common_fill(r, sk);
- r->diag_state = sk->sk_state;
+ r->diag_state = smp_load_acquire(&sk->sk_state);
if (smc->use_fallback)
r->diag_mode = SMC_DIAG_MODE_FALLBACK_TCP;
- else if (smc_conn_lgr_valid(&smc->conn) && smc->conn.lgr->is_smcd)
+ else if (smc->conn.is_smcd)
r->diag_mode = SMC_DIAG_MODE_SMCD;
else
r->diag_mode = SMC_DIAG_MODE_SMCR;
@@ -103,6 +103,10 @@ static int __smc_diag_dump(struct sock *
if (nla_put(skb, SMC_DIAG_FALLBACK, sizeof(fallback), &fallback) < 0)
goto errout;
+ if (r->diag_state == SMC_INIT || r->diag_state == SMC_CLOSED ||
+ smc->use_fallback)
+ goto out;
+
if ((req->diag_ext & (1 << (SMC_DIAG_CONNINFO - 1))) &&
smc->conn.alert_token_local) {
struct smc_connection *conn = &smc->conn;
@@ -154,8 +158,7 @@ static int __smc_diag_dump(struct sock *
.lnk[0].link_id = link->link_id,
};
- memcpy(linfo.lnk[0].ibname, link->smcibdev->ibdev->name,
- sizeof(link->smcibdev->ibdev->name));
+ memcpy(linfo.lnk[0].ibname, link->ibname, sizeof(link->ibname));
smc_gid_be16_convert(linfo.lnk[0].gid, link->gid);
smc_gid_be16_convert(linfo.lnk[0].peer_gid, link->peer_gid);
@@ -185,6 +188,7 @@ static int __smc_diag_dump(struct sock *
goto errout;
}
+out:
nlmsg_end(skb, nlh);
return 0;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0625/1005] net/smc: fix link group ownership in handshake abort
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (623 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0624/1005] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0626/1005] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
` (373 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mahanta Jambigi, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahanta Jambigi <mjambigi@linux.ibm.com>
commit e227b511582828c5a6513f70fc6a71211e5efbf0 upstream.
An aborted first-contact handshake can hang the handshake worker on the
socket lock it already holds, reset the clcsock of a socket that has
fallen back to TCP, or corrupt the alert-node lookup when the handshake
retries with the same connection.
The abort leaves a connection registered in a link group that another
context has already unlinked for termination: smc_conn_free() skips the
unregister when lgr->list is empty, so the alert token and alert node
stay in lgr->conns_all. If the handshake retries another device or SMC
version, smc_conn_create() creates a second link group and
smc_lgr_register_conn() inserts the same alert node into it: the token
loop is skipped, rb_link_node() links a node that is still in the old
tree into the new one, and a second sock_hold() is taken where only one
sock_put() will follow. The old group's terminator then keeps returning
that node from rb_first() and can kill a connection that now belongs to
the new group.
smc_lgr_cleanup_early() also starts a second termination of the link
group that is already being terminated, which takes lock_sock() on the
socket the handshake worker holds; if the termination work wins the race
instead, it later kills the freed connection and aborts the clcsock of a
socket that has fallen back to TCP. Making the unregister unconditional
also lets smc_conn_free() reach the delayed free work on a claimed link
group, where the lockless freeing check can arm it after the owner has
cancelled it.
Always unregister the connection, claim a link group for termination
once under lgr_lock, keep the link group alive across the abort, and arm
the delayed free work only under the same lock and cancel it
synchronously before the teardown. Drop an already freed connection in
smc_conn_kill() without running the connection and socket teardown.
Fixes: 2a0674fffb6b ("net/smc: improve abnormal termination of link groups")
Fixes: f9aab6f2ce57 ("net/smc: immediate freeing in smc_lgr_cleanup_early()")
Cc: stable@vger.kernel.org
Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
Link: https://patch.msgid.link/20261106130457.1092203-1-mjambigi@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/smc/af_smc.c | 11 ++++---
net/smc/smc_core.c | 78 ++++++++++++++++++++++++++++++++++++++---------------
net/smc/smc_core.h | 6 ++--
3 files changed, 65 insertions(+), 30 deletions(-)
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1009,14 +1009,15 @@ static void smc_conn_abort(struct smc_so
{
struct smc_connection *conn = &smc->conn;
struct smc_link_group *lgr = conn->lgr;
- bool lgr_valid = false;
-
- if (smc_conn_lgr_valid(conn))
- lgr_valid = true;
+ bool lgr_valid = local_first && smc_conn_lgr_valid(conn);
+ if (lgr_valid)
+ smc_lgr_hold(lgr); /* lgr_put below */
smc_conn_free(conn);
- if (local_first && lgr_valid)
+ if (lgr_valid) {
smc_lgr_cleanup_early(lgr);
+ smc_lgr_put(lgr);
+ }
}
/* check if there is a rdma device available for this connection. */
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -80,16 +80,21 @@ static void smc_ibdev_cnt_dec(struct smc
static void smc_lgr_schedule_free_work(struct smc_link_group *lgr)
{
+ spinlock_t *lgr_lock;
+
/* client link group creation always follows the server link group
* creation. For client use a somewhat higher removal delay time,
* otherwise there is a risk of out-of-sync link groups.
*/
+ smc_lgr_list_head(lgr, &lgr_lock);
+ spin_lock_bh(lgr_lock);
if (!lgr->freeing) {
mod_delayed_work(system_percpu_wq, &lgr->free_work,
(!lgr->is_smcd && lgr->role == SMC_CLNT) ?
SMC_LGR_FREE_DELAY_CLNT :
SMC_LGR_FREE_DELAY_SERV);
}
+ spin_unlock_bh(lgr_lock);
}
/* Register connection's alert token in our lookup structure.
@@ -679,19 +684,34 @@ int smcd_nl_get_lgr(struct sk_buff *skb,
return skb->len;
}
-void smc_lgr_cleanup_early(struct smc_link_group *lgr)
+/* Claim a link group for termination. Only one context can succeed: the
+ * lgr is removed from its list and marked freeing under lgr_lock.
+ * Returns false if @lgr is NULL or another context owns it.
+ */
+static bool smc_lgr_claim(struct smc_link_group *lgr)
{
spinlock_t *lgr_lock;
if (!lgr)
- return;
-
+ return false;
smc_lgr_list_head(lgr, &lgr_lock);
spin_lock_bh(lgr_lock);
+ if (lgr->freeing || lgr->terminating || list_empty(&lgr->list)) {
+ spin_unlock_bh(lgr_lock);
+ return false;
+ }
/* do not use this link group for new connections */
- if (!list_empty(&lgr->list))
- list_del_init(&lgr->list);
+ list_del_init(&lgr->list);
+ lgr->freeing = 1;
spin_unlock_bh(lgr_lock);
+ return true;
+}
+
+/* The caller must keep @lgr alive for the duration of the call. */
+void smc_lgr_cleanup_early(struct smc_link_group *lgr)
+{
+ if (!smc_lgr_claim(lgr))
+ return; /* another context owns the termination */
__smc_lgr_terminate(lgr, true);
}
@@ -1279,10 +1299,12 @@ void smc_conn_free(struct smc_connection
if (current_work() != &conn->abort_work)
cancel_work_sync(&conn->abort_work);
}
- if (!list_empty(&lgr->list)) {
+ /* The handshake can retry another device or SMC version with this
+ * connection, so it must never stay registered in an lgr it left.
+ */
+ if (!list_empty(&lgr->list))
smc_buf_unuse(conn, lgr); /* allow buffer reuse */
- smc_lgr_unregister_conn(conn);
- }
+ smc_lgr_unregister_conn(conn);
if (!lgr->conns_num)
smc_lgr_schedule_free_work(lgr);
@@ -1517,6 +1539,15 @@ static void smc_conn_kill(struct smc_con
{
struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
+ if (conn->freed) {
+ /* The connection was already freed, e.g. by a close or
+ * a handshake that fell back to TCP. Do not abort a socket
+ * that is no longer part of this link group.
+ */
+ smc_lgr_unregister_conn(conn);
+ return;
+ }
+
if (conn->lgr->is_smcd && conn->lgr->peer_shutdown)
conn->local_tx_ctrl.conn_state_flags.peer_conn_abort = 1;
else
@@ -1564,12 +1595,20 @@ static void __smc_lgr_terminate(struct s
struct smc_connection *conn;
struct smc_sock *smc;
struct rb_node *node;
+ spinlock_t *lgr_lock;
- if (lgr->terminating)
+ smc_lgr_list_head(lgr, &lgr_lock);
+ spin_lock_bh(lgr_lock);
+ if (lgr->terminating) {
+ spin_unlock_bh(lgr_lock);
return; /* lgr already terminating */
- /* cancel free_work sync, will terminate when lgr->freeing is set */
- cancel_delayed_work(&lgr->free_work);
+ }
lgr->terminating = 1;
+ spin_unlock_bh(lgr_lock);
+ /* The lgr is claimed, so no new free_work can be armed; wait for
+ * one that is already queued or running.
+ */
+ cancel_delayed_work_sync(&lgr->free_work);
/* kill remaining link group connections */
read_lock_bh(&lgr->conns_lock);
@@ -1580,7 +1619,11 @@ static void __smc_lgr_terminate(struct s
sock_hold(&smc->sk); /* sock_put below */
read_unlock_bh(&lgr->conns_lock);
lock_sock(&smc->sk);
- smc_conn_kill(conn, soft);
+ /* The connection may have been re-registered in another
+ * link group by a retried handshake in the meantime.
+ */
+ if (conn->lgr == lgr)
+ smc_conn_kill(conn, soft);
release_sock(&smc->sk);
sock_put(&smc->sk); /* sock_hold above */
read_lock_bh(&lgr->conns_lock);
@@ -1594,17 +1637,8 @@ static void __smc_lgr_terminate(struct s
/* unlink link group and schedule termination */
void smc_lgr_terminate_sched(struct smc_link_group *lgr)
{
- spinlock_t *lgr_lock;
-
- smc_lgr_list_head(lgr, &lgr_lock);
- spin_lock_bh(lgr_lock);
- if (list_empty(&lgr->list) || lgr->terminating || lgr->freeing) {
- spin_unlock_bh(lgr_lock);
+ if (!smc_lgr_claim(lgr))
return; /* lgr already terminating */
- }
- list_del_init(&lgr->list);
- lgr->freeing = 1;
- spin_unlock_bh(lgr_lock);
schedule_work(&lgr->terminate_work);
}
--- a/net/smc/smc_core.h
+++ b/net/smc/smc_core.h
@@ -301,9 +301,9 @@ struct smc_link_group {
struct delayed_work free_work; /* delayed freeing of an lgr */
struct work_struct terminate_work; /* abnormal lgr termination */
struct workqueue_struct *tx_wq; /* wq for conn. tx workers */
- u8 sync_err : 1; /* lgr no longer fits to peer */
- u8 terminating : 1;/* lgr is terminating */
- u8 freeing : 1; /* lgr is being freed */
+ u8 sync_err; /* lgr no longer fits to peer */
+ u8 terminating; /* lgr is terminating */
+ u8 freeing; /* lgr is being freed */
refcount_t refcnt; /* lgr reference count */
bool is_smcd; /* SMC-R or SMC-D */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0626/1005] net: bridge: use one headroom snapshot for ND replies
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (624 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0625/1005] net/smc: fix link group ownership in handshake abort Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0627/1005] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
` (372 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, TencentOS Corvus AI,
Jun Yang, Nikolay Aleksandrov, Ido Schimmel, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jun Yang <junvyyang@tencent.com>
commit e573df093ef849bb7c763aed591cb6556b110671 upstream.
br_nd_send() calls LL_RESERVED_SPACE(dev) once to size the reply skb and
again to reserve its headroom. When a port requiring more headroom is
added to the bridge, br_add_if() can increase dev->needed_headroom
between the two calls. The reserved headroom can then exceed the space
accounted for by alloc_skb().
Take one headroom snapshot and use it for both the allocation size and
skb_reserve().
Fixes: ed842faeb2bd ("bridge: suppress nd pkts on BR_NEIGH_SUPPRESS ports")
Cc: stable@kernel.org
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Signed-off-by: Jun Yang <junvyyang@tencent.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261103075439.43644-1-juny24602@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bridge/br_arp_nd_proxy.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/bridge/br_arp_nd_proxy.c
+++ b/net/bridge/br_arp_nd_proxy.c
@@ -262,6 +262,7 @@ static void br_nd_send(struct net_bridge
struct sk_buff *reply;
struct ipv6hdr *pip6;
int na_olen = 8; /* opt hdr + ETH_ALEN for target */
+ int headroom;
int ns_olen;
u8 *daddr;
bool dad;
@@ -271,7 +272,8 @@ static void br_nd_send(struct net_bridge
if (!dev)
return;
- len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) +
+ headroom = LL_RESERVED_SPACE(dev);
+ len = headroom + sizeof(struct ipv6hdr) +
sizeof(*na) + na_olen + dev->needed_tailroom;
reply = alloc_skb(len, GFP_ATOMIC);
@@ -280,7 +282,7 @@ static void br_nd_send(struct net_bridge
reply->protocol = htons(ETH_P_IPV6);
reply->dev = dev;
- skb_reserve(reply, LL_RESERVED_SPACE(dev));
+ skb_reserve(reply, headroom);
skb_push(reply, sizeof(struct ethhdr));
skb_set_mac_header(reply, 0);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0627/1005] net: dsa: microchip: initialize the IRQ access mutex
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (625 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0626/1005] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0628/1005] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
` (371 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tapio Reijonen, Daniel Machon,
Paolo Abeni
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tapio Reijonen <tapio.reijonen@vaisala.com>
commit ba1dc196502f3435f4ae53ed6745caacf066f83e upstream.
ksz_switch_register() initializes dev_mutex, regmap_mutex, alu_mutex and
vlan_mutex but not lock_irq, which the IRQ chip takes in its bus lock
callbacks on every mask and unmask of a switch interrupt, and the PTP
code takes the same way. The zeroed mutex happens to work on the
uncontended fast path, but with CONFIG_DEBUG_MUTEXES the first lock,
from the IRQ domain mapping during probe, warns:
DEBUG_LOCKS_WARN_ON(lock->magic != lock)
WARNING: kernel/locking/mutex.c:625 at __mutex_lock
...
ksz_irq_domain_map
irq_domain_associate_locked
irq_create_mapping_affinity
ksz_irq_common_setup
ksz9477_setup
dsa_register_switch
ksz_spi_probe
and turns lock debugging off for the rest of the boot.
Initialize it with the other mutexes.
Triggered at every boot of a KSZ9897S over SPI on an i.MX6 SoloX board
with CONFIG_DEBUG_MUTEXES, on v7.4-rc1 and earlier. With this patch the
same board boots with lock debugging enabled and it stays enabled
(debug_locks 1) through two hours of unrelated stress tests.
Fixes: c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link")
Cc: stable@vger.kernel.org
Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261104-ksz-irq-mutex-init-v1-1-e3bb7d9dbd80@vaisala.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/dsa/microchip/ksz_common.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -3928,6 +3928,7 @@ int ksz_switch_register(struct ksz_devic
mutex_init(&dev->regmap_mutex);
mutex_init(&dev->alu_mutex);
mutex_init(&dev->vlan_mutex);
+ mutex_init(&dev->lock_irq);
ret = ksz_switch_detect(dev);
if (ret)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0628/1005] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (626 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0627/1005] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0629/1005] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
` (370 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukáš Lalinský,
Jens Axboe, Dave Miller
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
commit bdc350ddbcbe4788158019d4d8e8e9345cb16235 upstream.
____sys_sendmsg() and ____sys_recvmsg() turn O_NONBLOCK on the socket
into MSG_DONTWAIT. That is right for the system calls, but io_uring uses
__sys_sendmsg_sock() and __sys_recvmsg_sock() for a blocking attempt
from io-wq as well, after the non-blocking attempts with MSG_DONTWAIT
have failed. On an O_NONBLOCK socket that attempt can't block either and
the request completes with -EAGAIN, unlike IORING_OP_SEND and RECV,
which call sock_sendmsg() and sock_recvmsg() directly and don't look at
O_NONBLOCK at all.
Move the O_NONBLOCK handling to ___sys_sendmsg() and ___sys_recvmsg(),
which the sendmsg, sendmmsg, recvmsg and recvmmsg system calls go
through. The io_uring helpers then pass the flags the caller asked for.
Cc: stable@vger.kernel.org
Fixes: 0fa03c624d8f ("io_uring: add support for sendmsg()")
Fixes: aa1fa28fc73e ("io_uring: add support for recvmsg()")
Link: https://lore.kernel.org/io-uring/a5589b66-9a20-4b1c-a0f1-1b5b31af3667@app.fastmail.com/
Reported-by: Lukáš Lalinský <lukas@lalinsky.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/socket.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--- a/net/socket.c
+++ b/net/socket.c
@@ -2695,8 +2695,6 @@ static int ____sys_sendmsg(struct socket
flags &= ~MSG_INTERNAL_SENDMSG_FLAGS;
msg_sys->msg_flags = flags;
- if (sock->file->f_flags & O_NONBLOCK)
- msg_sys->msg_flags |= MSG_DONTWAIT;
/*
* If this is sendmmsg() and current destination address is same as
* previously succeeded address, omit asking LSM's decision.
@@ -2760,6 +2758,9 @@ static int ___sys_sendmsg(struct socket
msg_sys->msg_name = &address;
+ if (sock->file->f_flags & O_NONBLOCK)
+ flags |= MSG_DONTWAIT;
+
err = sendmsg_copy_msghdr(msg_sys, msg, flags, &iov);
if (err < 0)
return err;
@@ -2924,9 +2925,6 @@ static int ____sys_recvmsg(struct socket
/* We assume all kernel code knows the size of sockaddr_storage */
msg_sys->msg_namelen = 0;
- if (sock->file->f_flags & O_NONBLOCK)
- flags |= MSG_DONTWAIT;
-
if (unlikely(nosec))
err = sock_recvmsg_nosec(sock, msg_sys, flags);
else
@@ -2968,6 +2966,9 @@ static int ___sys_recvmsg(struct socket
struct sockaddr __user *uaddr;
ssize_t err;
+ if (sock->file->f_flags & O_NONBLOCK)
+ flags |= MSG_DONTWAIT;
+
err = recvmsg_copy_msghdr(msg_sys, msg, flags, &uaddr, &iov);
if (err < 0)
return err;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0629/1005] net: mana: report RX checksum offload for IPv6
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (627 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0628/1005] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0630/1005] net: netns: fix INT_MAX nsid cleanup Greg Kroah-Hartman
` (369 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haiyang Zhang, Hamza Mahfooz,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
commit bbcd02741c4cfbf9e1c59b1906f21ef772bd15eb upstream.
The hardware validates TCP and UDP checksums for both IPv4 and IPv6 and
reports the result in rx_tcp_csum_succeed and rx_udp_csum_succeed.
However, mana_rx_skb() also requires rx_iphdr_csum_succeed before it
sets CHECKSUM_UNNECESSARY. That bit is only set for IPv4 (since IPv6
has no header checksum), so IPv6 TCP and UDP traffic is always
checksummed again in software.
So, only look at the L4 result. For IPv4 this makes no material
difference since CHECKSUM_UNNECESSARY only covers the L4 checksum, and
ip_rcv_core() always verifies the IPv4 header checksum in software.
Between two Azure Standard_E16s_v6 VMs (VF enabled), IPv6 TCP and UDP
packets (including VXLAN over IPv6), now arrive with
CHECKSUM_UNNECESSARY instead of CHECKSUM_NONE, so GRO no longer
checksums them in software. Calls to __skb_gro_checksum_complete() on
the receiver during an 8 second iperf3 run:
before after
TCP/IPv4, 12.2 Gbps 23 28
TCP/IPv6, 12.1 Gbps 8728419 25
UDP/IPv6, 1.5 Gbps 1071380 20
TCP/VXLAN/IPv6, 10.9 Gbps 7934373 18
Cc: stable@vger.kernel.org
Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Link: https://patch.msgid.link/20261109142856.779955-1-hamzamahfooz@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -2148,10 +2148,9 @@ static void mana_rx_skb(void *buf_va, bo
skb_checksum_none_assert(skb);
skb_record_rx_queue(skb, rxq_idx);
- if ((ndev->features & NETIF_F_RXCSUM) && cqe->rx_iphdr_csum_succeed) {
- if (cqe->rx_tcp_csum_succeed || cqe->rx_udp_csum_succeed)
- skb->ip_summed = CHECKSUM_UNNECESSARY;
- }
+ if ((ndev->features & NETIF_F_RXCSUM) &&
+ (cqe->rx_tcp_csum_succeed || cqe->rx_udp_csum_succeed))
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
if (cqe->rx_hashtype != 0 && (ndev->features & NETIF_F_RXHASH)) {
if (cqe->rx_hashtype & MANA_HASH_L4)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0630/1005] net: netns: fix INT_MAX nsid cleanup
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (628 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0629/1005] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0631/1005] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl Greg Kroah-Hartman
` (368 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Gongyi, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Gongyi <zhaogongyi@bytedance.com>
commit dd6f1e7582f0f7f12c2d620cf50446aa987d7327 upstream.
A syzkaller reproducer assigning INT_MAX as a peer nsid triggers an
idr_get_next() warning during netns cleanup. With panic_on_warn, this
panics the kernel.
alloc_netid() also overflows reqid + 1 for this nsid. Use
idr_alloc_u32() for requested IDs and idr_get_next_ul() for cleanup so
the cursor can advance past INT_MAX.
QEMU/KVM reproduced the warning without kernel changes or fault
injection. The same reproducer ran without warnings after this change.
Kernel selftests were not run.
Fixes: 7acee67a6bce ("netns: optimize netns cleaning by batching unhash_nsid calls")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Gongyi <zhaogongyi@bytedance.com>
Link: https://patch.msgid.link/20261111033525.65828-1-zhaogongyi@bytedance.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/net_namespace.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 52c2bd44778a..c94718429771 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -270,14 +270,19 @@ static void ops_undo_single(struct pernet_operations *ops,
/* should be called with nsid_lock held */
static int alloc_netid(struct net *net, struct net *peer, int reqid)
{
- int min = 0, max = 0;
+ int ret;
+ u32 id;
if (reqid >= 0) {
- min = reqid;
- max = reqid + 1;
+ id = reqid;
+ ret = idr_alloc_u32(&net->netns_ids, peer, &id, id,
+ GFP_ATOMIC);
+ if (ret)
+ return ret;
+ return id;
}
- return idr_alloc(&net->netns_ids, peer, min, max, GFP_ATOMIC);
+ return idr_alloc(&net->netns_ids, peer, 0, 0, GFP_ATOMIC);
}
/* This function is used by idr_for_each(). If net is equal to peer, the
@@ -639,10 +644,10 @@ static void unhash_nsid(struct net *last)
* use for_each_net_rcu() or net_rwsem.
*/
for_each_net(tmp) {
- int id = 0;
+ unsigned long id = 0;
spin_lock(&tmp->nsid_lock);
- while ((peer = idr_get_next(&tmp->netns_ids, &id))) {
+ while ((peer = idr_get_next_ul(&tmp->netns_ids, &id))) {
int curr_id = id;
id++;
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0631/1005] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (629 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0630/1005] net: netns: fix INT_MAX nsid cleanup Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0632/1005] net: usb: lan78xx: let unregister_netdev() stop phylink Greg Kroah-Hartman
` (367 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Clark, Maxime Chevallier,
Lorenzo Bianconi, Kory Maincent, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Clark <jjc@jclark.com>
commit b66fca408bf85bb40f48a689daac75421f5283f8 upstream.
Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") modified the PTP core to validate the supported flags
of external timestamp requests, rather than relying on each driver to
check them.
stmmac_enable() and dwmac1000_ptp_enable() ignore the flags, and
neither stmmac_ptp_clock_ops nor dwmac1000_ptp_clock_ops was given any
.supported_extts_flags. Since PTP_EXTTS_REQUEST2 always implies
PTP_STRICT_FLAGS, the core now rejects every PTP_EXTTS_REQUEST2 for
this driver with -EOPNOTSUPP, where before that commit the same
requests succeeded. Only the PTP_EXTTS_REQUEST ioctl still works.
Tests on an NXP i.MX 8M Plus (FRDM-IMX8MPLUS, GMAC 5.10a) show that the
auxiliary snapshot inputs timestamp just the rising edge. The reference
manuals for the STM32MP13 (GMAC 4.20a) and the Cyclone V HPS (GMAC
3.70a, which uses dwmac1000_ptp_clock_ops) say the same.
Encode this in .supported_extts_flags. A PTP_EXTTS_REQUEST2 for the
rising edge then succeeds, and one for the falling edge or for both
edges fails with -EOPNOTSUPP.
Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
Cc: stable@vger.kernel.org
Signed-off-by: James Clark <jjc@jclark.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20261104052504.1886335-1-jjc@jclark.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -277,6 +277,7 @@ const struct ptp_clock_info stmmac_ptp_c
.n_per_out = 0, /* will be overwritten in stmmac_ptp_register */
.n_pins = 0,
.pps = 0,
+ .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
.adjfine = stmmac_adjust_freq,
.adjtime = stmmac_adjust_time,
.gettimex64 = stmmac_get_timex,
@@ -294,6 +295,7 @@ const struct ptp_clock_info dwmac1000_pt
.n_per_out = 0,
.n_pins = 0,
.pps = 0,
+ .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
.adjfine = stmmac_adjust_freq,
.adjtime = stmmac_adjust_time,
.gettimex64 = stmmac_get_timex,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0632/1005] net: usb: lan78xx: let unregister_netdev() stop phylink
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (630 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0631/1005] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0633/1005] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
` (366 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bin Yu, Cheng Wen, YuanZhe Liu,
Oleksij Rempel, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
commit 9280128245612b30ca4a238daa6a777b0f4e583e upstream.
lan78xx_disconnect() stops phylink before unregistering the net device.
phylink_start() is only called from lan78xx_open(), so when the device is
unplugged before the interface has been brought up, the attached PHY is
still in PHY_READY and phy_stop() reports:
called from state READY
WARNING: drivers/net/phy/phy.c:1670 at phy_stop+0xad/0x380
The same warning is emitted after an ifup/ifdown cycle, where the PHY is
already in PHY_HALTED.
unregister_netdev() already closes a running device, which calls
lan78xx_stop() and phylink_stop() with dev->dev_mutex held and after the
URBs have been terminated. Unregister first and disconnect the PHY
afterwards, so the interface is stopped exactly once and only while it is
running, and the net device can no longer be opened while its phylink
instance has no PHY attached.
Fixes: e110bc825897 ("net: usb: lan78xx: Convert to PHYLINK for improved PHY and MAC management")
Cc: stable@vger.kernel.org
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20261031165213.2738-1-25031212351@stu.xidian.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/usb/lan78xx.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -4592,13 +4592,12 @@ static void lan78xx_disconnect(struct us
net = dev->net;
+ unregister_netdev(net);
+
rtnl_lock();
- phylink_stop(dev->phylink);
phylink_disconnect_phy(dev->phylink);
rtnl_unlock();
- unregister_netdev(net);
-
timer_shutdown_sync(&dev->stat_monitor);
set_bit(EVENT_DEV_DISCONNECT, &dev->flags);
cancel_delayed_work_sync(&dev->wq);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0633/1005] xprtrdma: serialize unmap_sync with xprt_disconnect
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (631 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0632/1005] net: usb: lan78xx: let unregister_netdev() stop phylink Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0634/1005] xsk: defer software checksum until the skb is complete Greg Kroah-Hartman
` (365 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Tim Menninger,
Anna Schumaker
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Menninger <tmenninger@everpuredata.com>
commit 1fa415883c37b02ff17acdd7977ed591d3d389ee upstream.
frwr_unmap_sync() posts LOCAL_INV Work Requests to the QP and waits
for the matching CQE. This can race with rpcrdma_xprt_disconnect():
1. frwr_unmap_sync() samples r_xprt->rx_ep
2. rpcrdma_xprt_disconnect() drains the QP
3. frwr_unmap_sync() posts LOCAL_INV WRs after the drain
4. No CQE arrives, so wait_for_completion() blocks indefinitely
The hung task appears in the rpciod workqueue:
Workqueue: rpciod rpc_async_schedule [sunrpc]
wait_for_completion()
frwr_unmap_sync()
xprt_rdma_free()
xprt_release()
Serialize synchronous MR invalidation against QP teardown with
rx_unmap_rwsem. frwr_unmap_sync() holds the read side while it builds
and submits the LOCAL_INV chain. Disconnect holds the write side across
QP drain and resource teardown. Drop the read side before waiting so
disconnect can drain the submitted Work Requests and deliver their CQEs.
Disconnect can reset a request while frwr_unmap_sync() waits for the
read side. Recheck rl_registered after acquiring the rwsem and return
without posting if the request has already been reset.
Move the synchronous invalidation completion from the final MR to the
request, whose lifetime covers xprt_rdma_free(). This allows disconnect
to destroy MRs after draining the QP while frwr_unmap_sync() is still
waiting. On a post failure, call rpcrdma_force_disconnect() before
dropping the read side so the endpoint is not dereferenced after
disconnect can run.
frwr_unmap_async() runs inline from Receive completion processing.
rpcrdma_xprt_drain() drains the Receive Queue before the Send Queue, so
asynchronous LOCAL_INV Work Requests are submitted before Send Queue
drain. frwr_unmap_sync(), however, runs from xprt_rdma_free() after the
transport send lock has been released, so it is not ordered against
disconnect.
Tested on v7.4-rc1 under pNFS load with repeated data server restarts
to provoke rapid QP disconnect/reconnect cycling. Without the fix, a
hung task in frwr_unmap_sync() reproduced twice in six attempts. With
the fix, no hang occurred across 200 cycles.
Also observed on v6.8 and v6.18.34.
Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt")
Cc: stable@vger.kernel.org
Assisted-by: Claude:opus-4-7
Reviewed-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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 ++++
4 files changed, 78 insertions(+), 39 deletions(-)
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -27,13 +27,17 @@
/* Transport recovery
*
- * frwr_map and frwr_unmap_* cannot run at the same time the transport
- * connect worker is running. The connect worker holds the transport
- * send lock, just as ->send_request does. This prevents frwr_map and
- * the connect worker from running concurrently. When a connection is
- * closed, the Receive completion queue is drained before the allowing
- * the connect worker to get control. This prevents frwr_unmap and the
- * connect worker from running concurrently.
+ * frwr_map() is serialized with the connect worker by the transport
+ * send lock.
+ *
+ * frwr_unmap_async() runs from Receive completion processing.
+ * rpcrdma_xprt_drain() drains the Receive Queue before the Send Queue,
+ * so asynchronous LOCAL_INV Work Requests are submitted before Send
+ * Queue drain.
+ *
+ * frwr_unmap_sync() runs after the transport send lock is released.
+ * rx_unmap_rwsem orders its LOCAL_INV submission before disconnect
+ * drains the QP.
*
* When the underlying transport disconnects, MRs that are in flight
* are flushed and are likely unusable. Thus all MRs are destroyed.
@@ -139,7 +143,6 @@ int frwr_mr_init(struct rpcrdma_xprt *r_
mr->mr_ibmr = frmr;
mr->mr_device = NULL;
INIT_LIST_HEAD(&mr->mr_list);
- init_completion(&mr->mr_linv_done);
frwr_cid_init(ep, mr);
sg_init_table(sg, depth);
@@ -539,40 +542,60 @@ static void frwr_wc_localinv(struct ib_c
* @cq: completion queue
* @wc: WCE for a completed LocalInv WR
*
- * Awaken anyone waiting for an MR to finish being fenced.
+ * Wake frwr_unmap_sync() after the final LOCAL_INV completion.
*/
static void frwr_wc_localinv_wake(struct ib_cq *cq, struct ib_wc *wc)
{
struct ib_cqe *cqe = wc->wr_cqe;
struct rpcrdma_mr *mr = container_of(cqe, struct rpcrdma_mr, mr_cqe);
+ struct rpcrdma_req *req = mr->mr_req;
/* WARNING: Only wr_cqe and status are reliable at this point */
trace_xprtrdma_wc_li_wake(wc, &mr->mr_cid);
frwr_mr_done(wc, mr);
- complete(&mr->mr_linv_done);
+ complete(&req->rl_linv_done);
rpcrdma_flush_disconnect(cq->cq_context, wc);
}
/**
- * frwr_unmap_sync - invalidate memory regions that were registered for @req
+ * frwr_unmap_sync - synchronously invalidate MRs registered for @req
* @r_xprt: controlling transport instance
- * @req: rpcrdma_req with a non-empty list of MRs to process
+ * @req: request whose registered MRs are to be invalidated
+ *
+ * If @req still owns registered MRs after synchronizing with transport
+ * disconnect, post a chain of LOCAL_INV Work Requests and wait for the
+ * final completion. On successful completion, this fences the mapped
+ * regions from remote access and preserves Send Queue flow control.
+ *
+ * A concurrent disconnect can reset @req while this function waits for
+ * the read side. In that case the MRs have already been released and no
+ * LOCAL_INV Work Requests are posted.
*
- * Sleeps until it is safe for the host CPU to access the previously mapped
- * memory regions. This guarantees that registered MRs are properly fenced
- * from the server before the RPC consumer accesses the data in them. It
- * also ensures proper Send flow control: waking the next RPC waits until
- * this RPC has relinquished all its Send Queue entries.
+ * Context: Process context. Takes and releases
+ * @r_xprt->rx_unmap_rwsem for read. May sleep.
*/
void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
{
struct ib_send_wr *first, **prev, *last;
- struct rpcrdma_ep *ep = r_xprt->rx_ep;
const struct ib_send_wr *bad_wr;
+ struct rpcrdma_ep *ep;
struct rpcrdma_mr *mr;
int rc;
+ /* serialize against rpcrdma_xprt_disconnect() */
+ down_read(&r_xprt->rx_unmap_rwsem);
+
+ /*
+ * Disconnect can reset this request while we wait for the read side.
+ * Recheck rl_registered in case rx_ep now refers to a new connection.
+ */
+ ep = r_xprt->rx_ep;
+ if (!ep || list_empty(&req->rl_registered)) {
+ up_read(&r_xprt->rx_unmap_rwsem);
+ return;
+ }
+
/* ORDER: Invalidate all of the MRs first
*
* Chain the LOCAL_INV Work Requests and post them with
@@ -599,37 +622,35 @@ void frwr_unmap_sync(struct rpcrdma_xprt
prev = &last->next;
} while ((mr = rpcrdma_mr_pop(&req->rl_registered)));
- mr = container_of(last, struct rpcrdma_mr, mr_invwr);
-
/* Strong send queue ordering guarantees that when the
* last WR in the chain completes, all WRs in the chain
* are complete.
*/
last->wr_cqe->done = frwr_wc_localinv_wake;
- reinit_completion(&mr->mr_linv_done);
+ reinit_completion(&req->rl_linv_done);
- /* Transport disconnect drains the receive CQ before it
- * replaces the QP. The RPC reply handler won't call us
- * unless re_id->qp is a valid pointer.
+ /*
+ * The read side prevents disconnect from draining this QP until the
+ * LOCAL_INV chain has been submitted.
*/
bad_wr = NULL;
rc = ib_post_send(ep->re_id->qp, first, &bad_wr);
+ if (rc) {
+ /* On error, the MRs get destroyed once the QP has drained. */
+ trace_xprtrdma_post_linv_err(req, rc);
+
+ /* Force a connection loss to ensure complete recovery.
+ */
+ rpcrdma_force_disconnect(ep);
+ }
+ up_read(&r_xprt->rx_unmap_rwsem);
/* The final LOCAL_INV WR in the chain is supposed to
* do the wake. If it was never posted, the wake will
* not happen, so don't wait in that case.
*/
if (bad_wr != first)
- wait_for_completion(&mr->mr_linv_done);
- if (!rc)
- return;
-
- /* On error, the MRs get destroyed once the QP has drained. */
- trace_xprtrdma_post_linv_err(req, rc);
-
- /* Force a connection loss to ensure complete recovery.
- */
- rpcrdma_force_disconnect(ep);
+ wait_for_completion(&req->rl_linv_done);
}
/**
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -364,6 +364,8 @@ xprt_setup_rdma(struct xprt_create *args
INIT_DELAYED_WORK(&new_xprt->rx_connect_worker,
xprt_rdma_connect_worker);
+ init_rwsem(&new_xprt->rx_unmap_rwsem);
+
xprt->max_payload = RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT;
return xprt;
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -572,20 +572,24 @@ out:
* rpcrdma_xprt_disconnect - Disconnect underlying transport
* @r_xprt: controlling transport instance
*
- * Caller serializes. Either the transport send lock is held,
- * or we're being called to destroy the transport.
+ * Context: Caller serializes. Either the transport send lock is held,
+ * or the transport is being destroyed. Takes and releases
+ * @r_xprt->rx_unmap_rwsem for write. May sleep.
*
* On return, @r_xprt is completely divested of all hardware
* resources and prepared for the next ->connect operation.
*/
void rpcrdma_xprt_disconnect(struct rpcrdma_xprt *r_xprt)
{
- struct rpcrdma_ep *ep = r_xprt->rx_ep;
+ struct rpcrdma_ep *ep;
struct rdma_cm_id *id;
int rc;
+ down_write(&r_xprt->rx_unmap_rwsem);
+
+ ep = r_xprt->rx_ep;
if (!ep)
- return;
+ goto out_unlock;
/* Prevent teardown-generated events from requesting another close. */
atomic_xchg(&ep->re_force_disconnect, 1);
@@ -604,6 +608,9 @@ void rpcrdma_xprt_disconnect(struct rpcr
rdma_destroy_id(id);
r_xprt->rx_ep = NULL;
+
+out_unlock:
+ up_write(&r_xprt->rx_unmap_rwsem);
}
/* Fixed-size circular FIFO queue. This implementation is wait-free and
@@ -927,6 +934,7 @@ struct rpcrdma_req *rpcrdma_req_create(s
INIT_LIST_HEAD(&req->rl_free_mrs);
INIT_LIST_HEAD(&req->rl_registered);
+ init_completion(&req->rl_linv_done);
spin_lock(&buffer->rb_lock);
list_add(&req->rl_all, &buffer->rb_allreqs);
spin_unlock(&buffer->rb_lock);
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -46,6 +46,7 @@
#include <linux/spinlock.h> /* spinlock_t, etc */
#include <linux/atomic.h> /* atomic_t, etc */
#include <linux/kref.h> /* struct kref */
+#include <linux/rwsem.h> /* struct rw_semaphore */
#include <linux/workqueue.h> /* struct work_struct */
#include <linux/llist.h>
@@ -249,7 +250,6 @@ struct rpcrdma_mr {
int mr_nents;
enum dma_data_direction mr_dir;
struct ib_cqe mr_cqe;
- struct completion mr_linv_done;
union {
struct ib_reg_wr mr_regwr;
struct ib_send_wr mr_invwr;
@@ -348,6 +348,7 @@ struct rpcrdma_req {
struct list_head rl_free_mrs;
struct list_head rl_registered;
+ struct completion rl_linv_done;
};
static inline struct rpcrdma_req *
@@ -449,6 +450,13 @@ struct rpcrdma_xprt {
struct delayed_work rx_connect_worker;
struct rpc_timeout rx_timeout;
struct rpcrdma_stats rx_stats;
+
+ /*
+ * Orders frwr_unmap_sync()'s LOCAL_INV submission ahead of the
+ * QP drain. Disconnect holds the write side across the drain
+ * and resource teardown.
+ */
+ struct rw_semaphore rx_unmap_rwsem;
};
#define rpcx_to_rdmax(x) container_of(x, struct rpcrdma_xprt, rx_xprt)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0634/1005] xsk: defer software checksum until the skb is complete
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (632 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0633/1005] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0635/1005] udf: dont allocate the inode block in udf_sync_inode_metadata() Greg Kroah-Hartman
` (364 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Stanislav Fomichev, Jason Xing, Rongzheng Wang, Paolo Abeni
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rongzheng Wang <testwrzwrz@gmail.com>
commit f2eddafbfcc004098425fee7c5664adbe29152d7 upstream.
When XDP_UMEM_TX_SW_CSUM is used with multi-buffer TX, xsk_skb_metadata()
calls skb_checksum_help() while only the first descriptor has been added to
the skb. The checksum therefore covers just the first fragment, and
skb_checksum_help() sets ip_summed to CHECKSUM_NONE, so the remaining
fragments are never included in the checksum.
Move the software checksum calculation to the point where the last
descriptor has been added to the skb.
On a checksum failure the packet is now dropped instead of being returned
to the application for a retry. This path is not reachable with the
existing metadata validation, but the behavior change is intentional.
Fixes: 11614723af26 ("xsk: Add option to calculate TX checksum in SW")
Cc: stable@vger.kernel.org
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Signed-off-by: Rongzheng Wang <testwrzwrz@gmail.com>
Link: https://patch.msgid.link/20261104034809.24545-2-testwrzwrz@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/xdp/xsk.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -1011,14 +1011,6 @@ static int xsk_skb_metadata(struct sk_bu
skb->csum_start = hr + csum_start;
skb->csum_offset = csum_offset;
skb->ip_summed = CHECKSUM_PARTIAL;
-
- if (unlikely(pool->tx_sw_csum)) {
- int err;
-
- err = skb_checksum_help(skb);
- if (err)
- return err;
- }
}
if (flags & XDP_TXMD_FLAGS_LAUNCH_TIME)
@@ -1030,6 +1022,15 @@ static int xsk_skb_metadata(struct sk_bu
return 0;
}
+static int xsk_skb_sw_csum(struct sk_buff *skb, struct xsk_buff_pool *pool)
+{
+ if (unlikely(pool->tx_sw_csum &&
+ skb->ip_summed == CHECKSUM_PARTIAL))
+ return skb_checksum_help(skb);
+
+ return 0;
+}
+
static struct sk_buff *xsk_build_skb_zerocopy(struct xdp_sock *xs,
struct xdp_desc *desc)
{
@@ -1277,6 +1278,12 @@ static int __xsk_generic_xmit(struct soc
continue;
}
+ err = xsk_skb_sw_csum(skb, xs->pool);
+ if (unlikely(err)) {
+ xsk_drop_skb(skb);
+ goto out;
+ }
+
err = __dev_direct_xmit(skb, xs->queue_id);
if (err == NETDEV_TX_BUSY) {
/* Tell user-space to retry the send */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0635/1005] udf: dont allocate the inode block in udf_sync_inode_metadata()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (633 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0634/1005] xsk: defer software checksum until the skb is complete Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0636/1005] vdso: Add VDSO_UNALIGNED_PACKED config option Greg Kroah-Hartman
` (363 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 05ad4c91fe2852a19d04311883420ffefb02300d upstream.
udf_sync_inode_metadata() looks the block that holds the inode up with
sb_getblk() which allocates a buffer for it if it isn't cached. But a
block that isn't cached is neither dirty nor under writeback, so there's
nothing to write or to wait for and the buffer just gets thrown away
again.
That allocation is also something we can't afford once inode eviction
calls ->sync_inode_metadata() from reclaim. So look the block up with
sb_find_get_block_nonatomic() instead.
Cc: stable@vger.kernel.org # v7.3
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-7-91ac6c024018@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/udf/inode.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1735,25 +1735,24 @@ void udf_update_extra_perms(struct inode
int udf_sync_inode_metadata(struct inode *inode, struct writeback_control *wbc)
{
struct buffer_head *bh;
+ unsigned long block;
int err = 0;
- bh = sb_getblk(inode->i_sb,
- udf_get_lb_pblock(inode->i_sb,
- &UDF_I(inode)->i_location, 0));
- if (!bh)
- return -EIO;
-
- sync_dirty_buffer(bh);
- if (buffer_write_io_error(bh)) {
- udf_warn(inode->i_sb, "IO error syncing udf inode [%08llx]\n",
- inode->i_ino);
- err = -EIO;
- goto out;
+ block = udf_get_lb_pblock(inode->i_sb, &UDF_I(inode)->i_location, 0);
+ /* A block that isn't cached is neither dirty nor under writeback. */
+ bh = sb_find_get_block_nonatomic(inode->i_sb, block);
+ if (bh) {
+ sync_dirty_buffer(bh);
+ if (buffer_write_io_error(bh)) {
+ udf_warn(inode->i_sb, "IO error syncing udf inode [%08llx]\n",
+ inode->i_ino);
+ err = -EIO;
+ }
+ brelse(bh);
+ if (err)
+ return err;
}
- err = mmb_sync(&UDF_I(inode)->i_metadata_bhs);
-out:
- brelse(bh);
- return err;
+ return mmb_sync(&UDF_I(inode)->i_metadata_bhs);
}
static void udf_adjust_time(struct udf_inode_info *iinfo, struct timespec64 time)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0636/1005] vdso: Add VDSO_UNALIGNED_PACKED config option
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (634 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0635/1005] udf: dont allocate the inode block in udf_sync_inode_metadata() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0637/1005] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore Greg Kroah-Hartman
` (362 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefan Kerkmann, Ian Rogers,
Thomas Gleixner
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
commit 2727aca4439ee4b9085141a3babadc8de580397f upstream.
Commit a339671db64b ("vdso: Switch get/put_unaligned() from packed struct
to memcpy()") switched __get_unaligned_t() and __put_unaligned_t() from
using a __packed struct to __builtin_memcpy() to avoid strict aliasing
undefined behavior.
On targets without efficient unaligned memory accesses (such as ARMv5),
GCC may not inline __builtin_memcpy() into byte shifts and instead emit
stack spills or much slower out-of-line memcpy() calls. Add
CONFIG_VDSO_UNALIGNED_PACKED, defaulting to
!HAVE_EFFICIENT_UNALIGNED_ACCESS, to use the __packed struct
implementation on strict-alignment targets while keeping
__builtin_memcpy() elsewhere and in tools/.
Fixes: a339671db64b ("vdso: Switch get/put_unaligned() from packed struct to memcpy()")
Reported-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261020163210.742728-1-irogers@google.com
Closes: https://lore.kernel.org/lkml/47f8c30b-e326-4ff0-a2bc-5683209a9e2d@pengutronix.de/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/vdso/unaligned.h | 16 ++++++++++++++++
lib/vdso/Kconfig | 10 ++++++++++
2 files changed, 26 insertions(+)
diff --git a/include/vdso/unaligned.h b/include/vdso/unaligned.h
index 9076483c9fbb..726fd15efc82 100644
--- a/include/vdso/unaligned.h
+++ b/include/vdso/unaligned.h
@@ -4,6 +4,20 @@
#include <linux/compiler_types.h>
+#ifdef CONFIG_VDSO_UNALIGNED_PACKED
+
+#define __get_unaligned_t(type, ptr) ({ \
+ const struct { type x; } __packed * __get_pptr = (typeof(__get_pptr))(ptr); \
+ __get_pptr->x; \
+})
+
+#define __put_unaligned_t(type, val, ptr) do { \
+ struct { type x; } __packed * __put_pptr = (typeof(__put_pptr))(ptr); \
+ __put_pptr->x = (val); \
+} while (0)
+
+#else /* !CONFIG_VDSO_UNALIGNED_PACKED */
+
/**
* __get_unaligned_t - read an unaligned value from memory.
* @type: the type to load from the pointer.
@@ -41,4 +55,6 @@
sizeof(__put_unaligned_val)); \
} while (0)
+#endif /* CONFIG_VDSO_UNALIGNED_PACKED */
+
#endif /* __VDSO_UNALIGNED_H */
diff --git a/lib/vdso/Kconfig b/lib/vdso/Kconfig
index 597f5f0f9681..2436c20ee0ef 100644
--- a/lib/vdso/Kconfig
+++ b/lib/vdso/Kconfig
@@ -23,3 +23,13 @@ config VDSO_GETRANDOM
select VDSO_DATASTORE
help
Selected by architectures that support vDSO getrandom().
+
+config VDSO_UNALIGNED_PACKED
+ bool
+ default !HAVE_EFFICIENT_UNALIGNED_ACCESS
+ help
+ Use packed structs rather than memcpy() in include/vdso/unaligned.h
+ for unaligned memory accesses. Enabled by default when the
+ architecture does not have efficient unaligned accesses, as GCC may
+ emit stack spills or out-of-line memcpy() calls instead of inlining
+ byte shifts.
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0637/1005] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (635 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0636/1005] vdso: Add VDSO_UNALIGNED_PACKED config option Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0638/1005] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
` (361 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jerome Mohm, Stefano Garzarella,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Mohm <jrmmhm.kernel@eldare.de>
commit 2a24ba1694f14299fbde3fa107e5d56629f2f8b6 upstream.
virtio_vsock_vqs_del() frees the virtqueues but leaves vsock->vqs[]
pointing at them. If virtio_vsock_restore() then fails, the driver
stays bound with a dangling vqs[], and the next freeze or unbind
passes a freed virtqueue to virtqueue_detach_unused_buf():
BUG: KASAN: slab-use-after-free in virtqueue_detach_unused_buf
virtio_vsock_vqs_del (net/vmw_vsock/virtio_transport.c:785)
virtio_vsock_remove
Freed by task ...:
vp_del_vqs
virtio_vsock_freeze
Clear vqs[] after del_vqs() and when virtio_find_vqs() fails. Return
early from virtio_vsock_vqs_del() when vqs[] is empty: the detach
loops would pass NULL to virtqueue_detach_unused_buf(), and a second
del_vqs() would free virtio-mmio's IRQ again, which only WARNs in
free_irq() ("Trying to free already-free IRQ").
Found with the help of Anthropic's Claude and reproduced on virtio-pci
and virtio-mmio by failing the restore with failslab, without other
kernel changes; the virtio-mmio WARN was found by the netdev Sashiko
review and reproduced with v1 of this patch. With this patch neither
report appears on virtio-pci or virtio-mmio guests, and the vsock
vmtest.sh single-VM tests pass. A find_vqs() failure after some
virtqueues were set up was not exercised.
Fixes: bd50c5dc182b ("vsock/virtio: add support for device suspend/resume")
Cc: stable@vger.kernel.org
Signed-off-by: Jerome Mohm <jrmmhm.kernel@eldare.de>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20261109-vsock-restore-uaf-send-v4-1-1df8dfb5d5de@eldare.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/vmw_vsock/virtio_transport.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -714,8 +714,10 @@ static int virtio_vsock_vqs_init(struct
atomic_set(&vsock->queued_replies, 0);
ret = virtio_find_vqs(vdev, VSOCK_VQ_MAX, vsock->vqs, vqs_info, NULL);
- if (ret < 0)
+ if (ret < 0) {
+ memset(vsock->vqs, 0, sizeof(vsock->vqs));
return ret;
+ }
virtio_vsock_update_guest_cid(vsock);
@@ -776,11 +778,19 @@ static void virtio_vsock_vqs_del(struct
vsock->event_run = false;
mutex_unlock(&vsock->event_lock);
+ virtio_vsock_skb_queue_purge(&vsock->send_pkt_queue);
+
/* Flush all device writes and interrupts, device will not use any
* more buffers.
*/
virtio_reset_device(vdev);
+ /* After a failed restore no virtqueues are live, and a second
+ * del_vqs() would free virtio-mmio's IRQ again (a WARN in free_irq()).
+ */
+ if (!vsock->vqs[VSOCK_VQ_RX])
+ return;
+
mutex_lock(&vsock->rx_lock);
while ((skb = virtqueue_detach_unused_buf(vsock->vqs[VSOCK_VQ_RX])))
kfree_skb(skb);
@@ -791,10 +801,10 @@ static void virtio_vsock_vqs_del(struct
kfree_skb(skb);
mutex_unlock(&vsock->tx_lock);
- virtio_vsock_skb_queue_purge(&vsock->send_pkt_queue);
-
/* Delete virtqueues and flush outstanding callbacks if any */
vdev->config->del_vqs(vdev);
+
+ memset(vsock->vqs, 0, sizeof(vsock->vqs));
}
static int virtio_vsock_probe(struct virtio_device *vdev)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0638/1005] tsacct: Keep task begin times stable across suspend
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (636 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0637/1005] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0639/1005] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
` (360 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Nesterov, Thomas Gleixner,
Hungyu Lin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hungyu Lin <dennylin0707@gmail.com>
commit c49b3c20a2d0b22700e2100a527e68e829ece7f0 upstream.
bacct_add_tsk() derives ac_btime and ac_btime64 by subtracting a
CLOCK_MONOTONIC elapsed duration from CLOCK_REALTIME. MONOTONIC stops
during suspend while REALTIME continues, so querying an existing task
after resume moves its reported begin time forward by the time spent
suspended.
Calculate the begin time from the wall-clock boot timestamp and the
task's CLOCK_BOOTTIME start timestamp instead. This accounts for suspend
and adds the nanoseconds before truncating to seconds. Keep ac_etime and
ac_tgetime on CLOCK_MONOTONIC and retain the existing rebasing when the
wall clock is adjusted.
The new begin time can be negative: setting CLOCK_REALTIME is bounded
by CLOCK_MONOTONIC, which excludes suspend, rather than CLOCK_BOOTTIME.
A permitted backward clock adjustment after suspend can therefore put
the task's begin time before the epoch. Clamp ac_btime64 at zero too,
instead of wrapping in the unsigned field, and retain its positive range.
Fixes: f3cef7a99469 ("[PATCH] csa: basic accounting over taskstats")
Reported-by: Oleg Nesterov <oleg@redhat.com>
Suggested-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20130611200600.GA15168@redhat.com
Link: https://lore.kernel.org/r/alpine.DEB.2.21.1911071335320.4256@nanos.tec.linutronix.de
Link: https://patch.msgid.link/20261030054227.35453-3-dennylin0707@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/tsacct.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -24,7 +24,7 @@ void bacct_add_tsk(struct user_namespace
const struct cred *tcred;
u64 utime, stime, utimescaled, stimescaled;
u64 now_ns, delta;
- time64_t btime;
+ struct timespec64 btime;
BUILD_BUG_ON(TS_COMM_LEN < TASK_COMM_LEN);
@@ -39,9 +39,11 @@ void bacct_add_tsk(struct user_namespace
do_div(delta, NSEC_PER_USEC);
stats->ac_etime = delta;
/* Convert to seconds for btime (note y2106 limit) */
- btime = ktime_get_real_seconds() - div_u64(delta, USEC_PER_SEC);
- stats->ac_btime = clamp_t(time64_t, btime, 0, U32_MAX);
- stats->ac_btime64 = btime;
+ getboottime64(&btime);
+ btime = timespec64_add(btime, ns_to_timespec64(tsk->start_boottime));
+ stats->ac_btime = clamp_t(time64_t, btime.tv_sec, 0, U32_MAX);
+ /* Setting the clock back after suspend can make btime negative. */
+ stats->ac_btime64 = max_t(time64_t, btime.tv_sec, 0);
if (tsk->flags & PF_EXITING)
stats->ac_exitcode = tsk->exit_code;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0639/1005] tls: only install push_pending_record for a TX context
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (637 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0638/1005] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0640/1005] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
` (359 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rishikesh Jethwani, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rishikesh Jethwani <rjethwani@purestorage.com>
commit c47e766c5307c06a78304582b2b5b5ab01ee1358 upstream.
tls_set_sw_offload() assigns ctx->push_pending_record for both
directions, but the hook is a TX-side dispatcher. On a socket whose TX
side is HW offloaded, tls_set_device_offload() installs
tls_device_push_pending_record(); any later TLS_RX setsockopt
overwrites it with tls_sw_push_pending_record(), because
tls_set_device_offload_rx() itself calls tls_set_sw_offload(sk, 0, NULL)
for the software half of a successful HW RX offload, and so does the
fallback when the RX offload is declined (NIC with TX-only offload,
tls_dev_add() failure).
>From then on tls_handle_open_record() (a TLS_SET_RECORD_TYPE cmsg after
a MSG_MORE send, or the close path with a pending writer) runs
tls_sw_push_pending_record() against priv_ctx_tx, which is a
struct tls_offload_context_tx, not a struct tls_sw_context_tx, and
reads open_rec from inside the offload context. On x86_64 without lock
debugging that field overlays sg_tx_data[2].dma_address, which is never
set, so the push is silently skipped and the data buffered by the
MSG_MORE send is later sent under the cmsg's record type, e.g.
application data in a handshake or alert record. Enabling
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_LOCK_ALLOC and CONFIG_LOCKDEP, but
not CONFIG_LOCK_STAT, in the tested x86_64 configuration moves open_rec
over sg_tx_data[5].page_link. Once populated, its page pointer and
scatterlist flags are interpreted as a tls_rec pointer and dereferenced
while reading msg_plaintext.sg.size.
Only set the hook when initialising the TX side.
Found by code review while developing TLS 1.3 HW offload rekey support.
Tested with HW TLS TX and RX offload on Mellanox ConnectX-6 Dx (Crypto
Enabled): after setting TLS_RX, send() "AAAA" with MSG_MORE, then
sendmsg() "BBBB" with a TLS_SET_RECORD_TYPE cmsg for a handshake
record. Without this patch the peer receives a single handshake record
"AAAABBBB"; with it, an application data record "AAAA" followed by a
handshake record "BBBB".
Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure")
Cc: stable@vger.kernel.org
Signed-off-by: Rishikesh Jethwani <rjethwani@purestorage.com>
Link: https://patch.msgid.link/20261102213011.4191020-1-rjethwani@purestorage.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/tls/tls_sw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2630,7 +2630,8 @@ int tls_set_sw_offload(struct sock *sk,
}
}
- ctx->push_pending_record = tls_sw_push_pending_record;
+ if (tx)
+ ctx->push_pending_record = tls_sw_push_pending_record;
/* setkey is the last operation that could fail during a
* rekey. if it succeeds, we can start modifying the
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0640/1005] tools/bootconfig: Close only opened braces in compact output
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (638 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0639/1005] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0641/1005] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
` (358 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eduardo Mucelli Rezende Oliveira,
Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
commit 26fa92f351d4993428268afebf6c60c987477af5 upstream.
A key may have both a value and subkeys. When it has only one subkey,
xbc_show_compact_tree() can print that subkey using dotted notation
without opening a brace. During backtracking, however, it treats the
value node followed by a subkey as evidence that a brace was opened.
For example, a.b=v, a.b.c=w and a.z=q are printed with the brace for a
closed before z. Reading that output back changes a.z into the root key
z, silently changing the configuration.
Check the key children when deciding whether to close a brace. Skip the
value child, and account for a sole subkey that itself has both a value
and subkeys, since that combination is not compacted. This follows the
conditions used to open braces without keeping a depth-indexed array.
Extend the mixed-value/subkey sample to cover the lost sibling.
Link: https://lore.kernel.org/all/6ad67e4cda05238cd173c99e820a85de2c13f5fc.1794337724.git.edumucelli@gmail.com/
Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key")
Cc: stable@vger.kernel.org
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/bootconfig/main.c | 29 ++++++++++++++++------
tools/bootconfig/samples/exp-good-mixed-kv1.bconf | 5 +++
tools/bootconfig/samples/good-mixed-kv1.bconf | 5 +++
3 files changed, 32 insertions(+), 7 deletions(-)
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -39,6 +39,23 @@ static int xbc_show_value(struct xbc_nod
return i;
}
+/* Match the conditions under which the compact formatter opens braces. */
+static bool xbc_node_needs_braces(struct xbc_node *node)
+{
+ struct xbc_node *child = xbc_node_get_child(node);
+
+ if (child && xbc_node_is_value(child))
+ child = xbc_node_get_next(child);
+ if (!child)
+ return false;
+ if (child->next)
+ return true;
+
+ /* A single subkey with both a value and subkeys is not compacted. */
+ child = xbc_node_get_child(child);
+ return child && xbc_node_is_value(child) && child->next;
+}
+
static void xbc_show_compact_tree(void)
{
struct xbc_node *node, *cnode = NULL, *vnode;
@@ -99,14 +116,12 @@ static void xbc_show_compact_tree(void)
node = xbc_node_get_parent(node);
if (!node)
return;
- if (!xbc_node_get_child(node)->next)
+ if (!depth || !xbc_node_needs_braces(node))
continue;
- if (depth) {
- depth--;
- for (i = 0; i < depth; i++)
- printf("\t");
- printf("}\n");
- }
+ depth--;
+ for (i = 0; i < depth; i++)
+ printf("\t");
+ printf("}\n");
}
node = xbc_node_get_next(node);
}
--- a/tools/bootconfig/samples/exp-good-mixed-kv1.bconf
+++ b/tools/bootconfig/samples/exp-good-mixed-kv1.bconf
@@ -1,2 +1,7 @@
key = "value";
key.subkey = "another-value";
+a {
+ b = "v";
+ b.c = "w";
+ z = "q";
+}
--- a/tools/bootconfig/samples/good-mixed-kv1.bconf
+++ b/tools/bootconfig/samples/good-mixed-kv1.bconf
@@ -1,3 +1,8 @@
# value -> subkey pattern
key = value
key.subkey = another-value
+
+# A valued parent with one subkey must not close its enclosing brace.
+a.b = v
+a.b.c = w
+a.z = q
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0641/1005] tcp: free saved_syn after an RCU grace period
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (639 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0640/1005] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0642/1005] tcp: do not coalesce segments after FIN Greg Kroah-Hartman
` (357 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Kuniyuki Iwashima,
Eric Dumazet, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <x-professor@outlook.com>
commit 2b9fd1a0abf0c1c7200be7a33cfeeca1c68089b6 upstream.
tcp_reqsk_record_syn() allocates saved_syn separately from its request
socket. bpf_sock_ops_get_syn() can load that pointer while processing a
retransmitted SYN under RCU.
There are two ownership transfers which can let another CPU reclaim the
allocation while such a reader is still using it.
First, tcp_move_syn() transfers req->saved_syn to a newly created child
socket. The child can be closed and tcp_saved_syn_free() can reclaim the
allocation before a reader of the old request finishes.
Second, inet_reqsk_clone() shallow-copies request_sock during request
migration. After reqsk_migrate_reset() clears the old request pointer, the
migrated clone owns it. However, a reader which already loaded the pointer
from the old request can still be using it when the clone is released.
I found this through LLM-assisted concurrency fuzzing.
Mark the request-socket saved_syn pointer as RCU protected and use RCU
accessors for its reads and updates. Keep the full-socket pointer plain
because all of its accesses hold the socket lock. Embed an rcu_head in
struct saved_syn and use kfree_rcu() in both teardown paths. This lets a
request-side reader which loaded the object before an ownership transfer
finish.
This follows commit e3f33b0a1d89 ("ipv4: free inet_opt and ireq_opt
after an RCU grace period"), which fixed the same ownership-transfer
pattern for IPv4 options.
The issue was confirmed with KASAN on v7.3-16007-g36aad21d50d1 using
temporary kernel instrumentation to widen the reader and request-migration
window. KASAN reported a slab-use-after-free read in
bpf_sock_ops_get_syn(), with the allocation freed by __reqsk_free() from
reqsk_timer_handler(). The same explicit migration test completed without
a report with deferred reclamation. A patched kernel without the delay
instrumentation also completed a successful migration and seven saved-SYN
reads without a KASAN report.
Fixes: 0813a841566f ("bpf: tcp: Allow bpf prog to write and parse TCP header option")
Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.")
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <x-professor@outlook.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/38fa9f2cc476502e9b1c1fef09ebba1df5dd5901.1793795528.git.x-professor@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/tcp.h | 6 +++---
include/net/request_sock.h | 3 ++-
net/core/filter.c | 2 +-
net/ipv4/inet_connection_sock.c | 6 +++---
net/ipv4/tcp_input.c | 2 +-
5 files changed, 10 insertions(+), 9 deletions(-)
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -612,13 +612,13 @@ static inline void fastopen_queue_tune(s
static inline void tcp_move_syn(struct tcp_sock *tp,
struct request_sock *req)
{
- tp->saved_syn = req->saved_syn;
- req->saved_syn = NULL;
+ tp->saved_syn = unrcu_pointer(req->saved_syn);
+ RCU_INIT_POINTER(req->saved_syn, NULL);
}
static inline void tcp_saved_syn_free(struct tcp_sock *tp)
{
- kfree(tp->saved_syn);
+ kfree_rcu(tp->saved_syn, rcu);
tp->saved_syn = NULL;
}
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -39,6 +39,7 @@ struct request_sock_ops {
};
struct saved_syn {
+ struct rcu_head rcu;
u32 mac_hdrlen;
u32 network_hdrlen;
u32 tcp_hdrlen;
@@ -68,7 +69,7 @@ struct request_sock {
struct timer_list rsk_timer;
const struct request_sock_ops *rsk_ops;
struct sock *sk;
- struct saved_syn *saved_syn;
+ struct saved_syn __rcu *saved_syn;
u32 secid;
u32 peer_secid;
u32 timeout;
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6188,7 +6188,7 @@ static int bpf_sock_ops_get_syn(struct b
* not be available. It has to resort to
* saved_syn (if it is saved).
*/
- saved_syn = inet_reqsk(sk)->saved_syn;
+ saved_syn = rcu_dereference(inet_reqsk(sk)->saved_syn);
else
saved_syn = tcp_sk(sk)->saved_syn;
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -869,7 +869,7 @@ reqsk_alloc_noprof(const struct request_
req_to_sk(req)->sk_prot = sk_listener->sk_prot;
sk_node_init(&req_to_sk(req)->sk_node);
sk_tx_queue_clear(req_to_sk(req));
- req->saved_syn = NULL;
+ RCU_INIT_POINTER(req->saved_syn, NULL);
req->syncookie = 0;
req->num_timeout = 0;
req->num_retrans = 0;
@@ -908,7 +908,7 @@ void __reqsk_free(struct request_sock *r
req->rsk_ops->destructor(req);
if (req->rsk_listener)
sock_put(req->rsk_listener);
- kfree(req->saved_syn);
+ kfree_rcu(unrcu_pointer(req->saved_syn), rcu);
kmem_cache_free(req->rsk_ops->slab, req);
}
@@ -979,7 +979,7 @@ static void reqsk_queue_migrated(struct
static void reqsk_migrate_reset(struct request_sock *req)
{
- req->saved_syn = NULL;
+ RCU_INIT_POINTER(req->saved_syn, NULL);
#if IS_ENABLED(CONFIG_IPV6)
inet_rsk(req)->ipv6_opt = NULL;
inet_rsk(req)->pktopts = NULL;
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -7636,7 +7636,7 @@ static void tcp_reqsk_record_syn(const s
saved_syn->network_hdrlen = skb_network_header_len(skb);
saved_syn->tcp_hdrlen = tcp_hdrlen(skb);
memcpy(saved_syn->data, base, len);
- req->saved_syn = saved_syn;
+ RCU_INIT_POINTER(req->saved_syn, saved_syn);
}
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0642/1005] tcp: do not coalesce segments after FIN
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (640 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 7.3 0641/1005] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0643/1005] tcp: fix authentication bypass via unsupported TCP auth options Greg Kroah-Hartman
` (356 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Eric Dumazet,
Kuniyuki Iwashima, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunwoo Kim <imv4bel@gmail.com>
commit 1c46780dec48893b8c25fd5e33a3127e8dc39dd4 upstream.
A FIN consumes a sequence number. If another FIN segment is coalesced
into an skb that already carries FIN, end_seq advances to account for
the additional FIN, but tcp_flags still contains only one FIN bit.
When the preceding gap is filled and tcp_ofo_queue() processes the
coalesced skb, rcv_nxt advances to the skb's end_seq. When the receive
path consumes all data in the skb, copied_seq advances by the data
length and one sequence number for FIN. If three or more FIN segments
have been coalesced into one skb, tcp_inq() can still return a positive
value after the receive queue becomes empty and the SOCK_DONE adjustment
is applied.
TCP_ZEROCOPY_RECEIVE is another consumer affected by this state.
tcp_zerocopy_receive() takes its length from tcp_inq() and follows
skb->next without checking for the end of the receive queue.
Software kTLS receive is one consumer affected by this state. When
strp->copy_mode is false, tls_strp_msg_consume() calls the TCP helper
tcp_read_done() to consume the current TLS record. In the reproducer,
tcp_read_done() consumed the record data and one FIN before freeing the
receive skb.
When kTLS looked for the next record, tcp_inq() reported at least
TLS_HEADER_SIZE bytes even though the receive queue was empty.
tcp_recv_skb() returned NULL, so tls_strp_load_anchor_with_queue() hit
WARN_ON_ONCE() and returned without updating the anchor.
Since tcp_inq() had reported at least TLS_HEADER_SIZE,
tls_strp_read_sock() proceeded to tls_strp_check_queue_ok().
skb_shinfo(strp->anchor)->frag_list still pointed to the freed receive
skb. tls_strp_check_queue_ok() then read TCP_SKB_CB(first)->seq through
the stale pointer, causing a use-after-free.
The reproducer followed this call path:
tls_rx_rec_done()
tls_strp_msg_consume()
tcp_read_done() // frees the receive skb
tls_strp_check_rcv()
tls_strp_read_sock()
tls_strp_load_anchor_with_queue() // returns after WARN_ON_ONCE()
tcp_recv_skb() == NULL
tls_strp_check_queue_ok()
TCP_SKB_CB(first)->seq // reads the freed receive skb
KASAN reported:
BUG: KASAN: slab-use-after-free in tls_strp_check_queue_ok.isra.0+0x5f/0x100
Read of size 4 at addr ffff888103169ca8 by task ktls-server/71
...
Call Trace:
<TASK>
...
tls_strp_check_queue_ok.isra.0+0x5f/0x100
tls_strp_check_rcv+0x2a9/0x400
...
tls_sw_recvmsg+0x3ce/0xa10
...
sock_recvmsg+0xea/0x100
__sys_recvfrom+0x142/0x1f0
...
__x64_sys_recvfrom+0x76/0x90
do_syscall_64+0xdd/0x4a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
...
</TASK>
...
Freed by task 71:
...
napi_skb_cache_put+0x24/0xf0
skb_attempt_defer_free+0x183/0x3b0
tcp_read_done+0x2d4/0x340
tls_strp_msg_consume+0x45/0x80
tls_sw_recvmsg+0x3c4/0xa10
...
In tcp_try_coalesce(), skip coalescing when the destination skb already
carries FIN. tcp_add_backlog() calls skb_try_coalesce() directly instead
of using this helper, so add the same check there. Since both paths check
only the destination skb, a final segment carrying data and FIN can still
be coalesced into an skb without FIN when the other coalescing checks pass.
Fixes: e93a0435f809 ("tcp: allow segment with FIN in tcp_try_coalesce()")
Fixes: 4f693b55c3d2 ("tcp: implement coalescing on backlog queue")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/au3HMfqNW3_DRMqS@v4bel
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp_input.c | 4 ++++
net/ipv4/tcp_ipv4.c | 2 ++
2 files changed, 6 insertions(+)
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5263,6 +5263,10 @@ static bool tcp_try_coalesce(struct sock
if (!tcp_skb_can_collapse_rx(to, from))
return false;
+ /* Nothing follows a FIN. */
+ if (unlikely(TCP_SKB_CB(to)->tcp_flags & TCPHDR_FIN))
+ return false;
+
if (!skb_try_coalesce(to, from, fragstolen, &delta))
return false;
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1957,6 +1957,8 @@ enum skb_drop_reason tcp_add_backlog(str
((TCP_SKB_CB(tail)->tcp_flags ^
TCP_SKB_CB(skb)->tcp_flags) &
(TCPHDR_ECE | TCPHDR_CWR | TCPHDR_AE)) ||
+ /* Nothing follows a FIN, see tcp_try_coalesce() */
+ (TCP_SKB_CB(tail)->tcp_flags & TCPHDR_FIN) ||
!tcp_skb_can_collapse_rx(tail, skb) ||
thtail->doff != th->doff ||
memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th)) ||
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0643/1005] tcp: fix authentication bypass via unsupported TCP auth options
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (641 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0642/1005] tcp: do not coalesce segments after FIN Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0644/1005] tcp: fix request_sock use-after-free during Fast Open accept() Greg Kroah-Hartman
` (355 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean,
Kuniyuki Iwashima, Dmitry Safonov, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit 7cc235fb1251fec1183e3158c60d2e504c2a8e8b upstream.
tcp_inbound_hash() parses both TCP-MD5 and TCP-AO options when at
least one of the two features is enabled. With TCP_MD5SIG=y and
TCP_AO=n, a packet carrying an AO option reaches the disabled
tcp_inbound_ao_hash() stub. That stub returns success, so sockets
configured to require MD5 authentication end up accepting
unauthenticated data. A forged AO option skips the unsigned fast
path, which is the only place where tcp_inbound_hash() can return
SKB_DROP_REASON_TCP_MD5NOTFOUND.
The inverse configuration with TCP_MD5SIG=n and TCP_AO=y has the same
problem for an MD5 option on AO sockets.
Note that TCP-AO depends on 64BIT: therefore, every 32-bit kernel with
TCP_MD5SIG=y is in the vulnerable configuration.
Make the disabled stubs reject options for the unsupported
authentication scheme. This matches the real helpers' behavior for
sockets without keys. It also means that kernels with TCP_MD5SIG=n and
TCP_AO=y now drop segments carrying an MD5 option on unkeyed sockets,
as kernels configured with TCP_MD5SIG=y already do.
Fixes: 0a3a809089eb ("net/tcp: Verify inbound TCP-AO signed segments")
Cc: stable@vger.kernel.org
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Acked-by: Dmitry Safonov <dima@arista.com>
Link: https://patch.msgid.link/20261107224733.1104094-2-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/tcp_ao.h | 3 ++-
net/ipv4/tcp.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
--- a/include/net/tcp_ao.h
+++ b/include/net/tcp_ao.h
@@ -303,7 +303,8 @@ static inline enum skb_drop_reason tcp_i
const struct request_sock *req, int l3index,
const struct tcp_ao_hdr *aoh)
{
- return SKB_NOT_DROPPED_YET;
+ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPAOKEYNOTFOUND);
+ return SKB_DROP_REASON_TCP_AOUNEXPECTED;
}
static inline struct tcp_ao_key *tcp_ao_do_lookup(const struct sock *sk,
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4974,7 +4974,8 @@ tcp_inbound_md5_hash(const struct sock *
const void *saddr, const void *daddr,
int family, int l3index, const __u8 *hash_location)
{
- return SKB_NOT_DROPPED_YET;
+ NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5UNEXPECTED);
+ return SKB_DROP_REASON_TCP_MD5UNEXPECTED;
}
#endif
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0644/1005] tcp: fix request_sock use-after-free during Fast Open accept()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (642 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0643/1005] tcp: fix authentication bypass via unsupported TCP auth options Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0645/1005] seg6: validate state in netfilter continuations Greg Kroah-Hartman
` (354 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Kuniyuki Iwashima,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunwoo Kim <imv4bel@gmail.com>
commit 62754aad50d0b30938bd8ce30b43474ce502a2af upstream.
Commit e3d95ad7da4f ("inet: avoid fastopen lock for regular accept()")
made inet_csk_accept() check tfo_listener before taking fastopenq.lock
to avoid taking the lock for connections that did not use Fast Open.
reqsk_fastopen_remove() clears tfo_listener while holding fastopenq.lock,
then reads req->sk. If inet_csk_accept() concurrently observes
tfo_listener after it has been cleared, it skips fastopenq.lock and
drops the last reference to the request_sock. This can free the
request_sock while reqsk_fastopen_remove() is still using it.
If the freed memory is reused for a new request_sock with req->sk ==
NULL, the reset path in reqsk_fastopen_remove() can append the new
request_sock to the original listener's list of requests that caused an
RST. After the new request_sock is freed, the next append writes through
the stale rskq_rst_tail into freed memory.
KASAN reported the following use-after-free when writing
fastopenq->rskq_rst_tail->dl_next = req:
BUG: KASAN: slab-use-after-free in reqsk_fastopen_remove+0x142/0x210
Write of size 8 at addr ffff888108230688 by task swapper/5/0
...
Call Trace:
<IRQ>
...
reqsk_fastopen_remove+0x142/0x210
tcp_check_req+0x96f/0xdd0
...
tcp_rcv_state_process+0x19c/0x26b0
...
tcp_v4_do_rcv+0x16e/0x490
tcp_v4_rcv+0x14a0/0x1af0
...
ip_protocol_deliver_rcu+0x39/0x1e0
ip_local_deliver_finish+0x124/0x1e0
ip_local_deliver+0xfb/0x1e0
...
</IRQ>
To widen the race windows, mdelay(5) was added after newsk = req->sk,
mdelay(20) after the if (req) reqsk_put(req) block, and mdelay(100)
after tcp_rsk(req)->tfo_listener = false. The KASAN report above was
reproduced with this kernel.
For the lockless check, use tcp_sk(newsk)->syn_fastopen_child instead of
tfo_listener, which reqsk_fastopen_remove() clears.
syn_fastopen_child is a field of the Fast Open child TCP socket
referenced by newsk, not of the request_sock. It is set before the child
socket is added to the accept queue. The paths that call
reqsk_fastopen_remove() in response to a remote ACK or RST do not clear
this field.
inet_csk_accept() uses this field to take fastopenq.lock only for Fast
Open child sockets and rechecks tfo_listener while holding the lock.
Connections that did not use Fast Open continue to avoid the lock.
Fixes: e3d95ad7da4f ("inet: avoid fastopen lock for regular accept()")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/avQKA_YTAThtbsYU@v4bel
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/inet_connection_sock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -683,7 +683,7 @@ struct sock *inet_csk_accept(struct sock
newsk = req->sk;
if (sk->sk_protocol == IPPROTO_TCP &&
- tcp_rsk(req)->tfo_listener) {
+ tcp_sk(newsk)->syn_fastopen_child) {
spin_lock_bh(&queue->fastopenq.lock);
if (tcp_rsk(req)->tfo_listener) {
/* We are still waiting for the final ACK from 3WHS
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0645/1005] seg6: validate state in netfilter continuations
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (643 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0644/1005] tcp: fix request_sock use-after-free during Fast Open accept() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0646/1005] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
` (353 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vega, Sashiko, Zixuan Chai, Ren Wei,
Hangbin Liu, Pablo Neira Ayuso, Andrea Mayer, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zixuan Chai <petalzu987@gmail.com>
commit 549484dd3e80a721d51bd695f22a800d2e05bea1 upstream.
When nf_hooks_lwtunnel is enabled, End.DX4 sends decapsulated packets
through NF_INET_PRE_ROUTING. If DNAT changes the inner destination,
nf_nat_ipv4_pre_routing() drops skb_dst(), and the continuation then
dereferences the missing dst's lwtstate. This causes a KASAN NULL
pointer dereference and fatal exception panic.
End.DX6 has the same issue with IPv6 DNAT. In seg6_iptunnel,
POST_ROUTING SNAT with an outbound XFRM policy can replace the dst before
the continuation resumes.
Validate the current dst and expected lwtstate type in each NF_HOOK()
continuation before calling the existing handler. Drop packets with
missing or incompatible state while preserving direct no-hook paths.
The helpers return bool because callers only need a validity check.
Testing shows that the End.DX4 DNAT reproducer triggers a KASAN NULL
pointer dereference without this change and no longer does so with the
fix. The SNAT+ESP/XFRM reproducer also completes without the reported
fault. The in-tree End.DX4 netfilter forwarding selftest passes all four
bidirectional checks with nf_hooks_lwtunnel disabled and enabled.
Fixes: 7a3f5b0de364 ("netfilter: add netfilter hooks to SRv6 data plane")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260720204430.1886091-1-xmei5@asu.edu
Signed-off-by: Zixuan Chai <petalzu987@gmail.com>
Signed-off-by: Ren Wei <weir@nebusec.ai>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Link: https://patch.msgid.link/8574739acd6f5d9eb0a5640e893122619e9f79ef.1793726355.git.petalzu987@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/seg6_iptunnel.c | 46 +++++++++++++++++++++++++++++++++++----
net/ipv6/seg6_local.c | 55 ++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 94 insertions(+), 7 deletions(-)
--- a/net/ipv6/seg6_iptunnel.c
+++ b/net/ipv6/seg6_iptunnel.c
@@ -18,6 +18,7 @@
#include <net/ip6_fib.h>
#include <net/route.h>
#include <net/seg6.h>
+#include <net/dst_metadata.h>
#include <linux/seg6.h>
#include <linux/seg6_iptunnel.h>
#include <net/addrconf.h>
@@ -60,6 +61,21 @@ static inline struct seg6_lwt *seg6_lwt_
return (struct seg6_lwt *)lwt->data;
}
+static bool seg6_skb_has_lwtstate(struct sk_buff *skb)
+{
+ struct dst_entry *dst;
+
+ if (unlikely(!skb_valid_dst(skb)))
+ return false;
+
+ dst = skb_dst(skb);
+ if (unlikely(!dst->lwtstate ||
+ dst->lwtstate->type != LWTUNNEL_ENCAP_SEG6))
+ return false;
+
+ return true;
+}
+
static inline struct seg6_iptunnel_encap *
seg6_encap_lwtunnel(struct lwtunnel_state *lwt)
{
@@ -616,6 +632,17 @@ drop:
return err;
}
+static int seg6_input_core_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return seg6_input_core(net, sk, skb);
+}
+
static int seg6_input_nf(struct sk_buff *skb)
{
struct net_device *dev = skb_dst_dev(skb);
@@ -624,10 +651,10 @@ static int seg6_input_nf(struct sk_buff
switch (skb->protocol) {
case htons(ETH_P_IP):
return NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING, net, NULL,
- skb, NULL, dev, seg6_input_core);
+ skb, NULL, dev, seg6_input_core_nf);
case htons(ETH_P_IPV6):
return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, net, NULL,
- skb, NULL, dev, seg6_input_core);
+ skb, NULL, dev, seg6_input_core_nf);
}
return -EINVAL;
@@ -720,6 +747,17 @@ drop:
return err;
}
+static int seg6_output_core_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return seg6_output_core(net, sk, skb);
+}
+
static int seg6_output_nf(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct net_device *dev = skb_dst_dev(skb);
@@ -727,10 +765,10 @@ static int seg6_output_nf(struct net *ne
switch (skb->protocol) {
case htons(ETH_P_IP):
return NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING, net, sk, skb,
- NULL, dev, seg6_output_core);
+ NULL, dev, seg6_output_core_nf);
case htons(ETH_P_IPV6):
return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, net, sk, skb,
- NULL, dev, seg6_output_core);
+ NULL, dev, seg6_output_core_nf);
}
return -EINVAL;
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -24,6 +24,7 @@
#include <net/addrconf.h>
#include <net/ip6_route.h>
#include <net/dst_cache.h>
+#include <net/dst_metadata.h>
#include <net/ip_tunnels.h>
#ifdef CONFIG_IPV6_SEG6_HMAC
#include <net/seg6_hmac.h>
@@ -211,6 +212,21 @@ static struct seg6_local_lwt *seg6_local
return (struct seg6_local_lwt *)lwt->data;
}
+static bool seg6_local_skb_has_lwtstate(struct sk_buff *skb)
+{
+ struct dst_entry *dst;
+
+ if (unlikely(!skb_valid_dst(skb)))
+ return false;
+
+ dst = skb_dst(skb);
+ if (unlikely(!dst->lwtstate ||
+ dst->lwtstate->type != LWTUNNEL_ENCAP_SEG6_LOCAL))
+ return false;
+
+ return true;
+}
+
static struct ipv6_sr_hdr *get_and_validate_srh(struct sk_buff *skb)
{
struct ipv6_sr_hdr *srh;
@@ -1026,6 +1042,17 @@ static int input_action_end_dx6_finish(s
return dst_input(skb);
}
+static int input_action_end_dx6_finish_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_local_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return input_action_end_dx6_finish(net, sk, skb);
+}
+
/* decapsulate and forward to specified nexthop */
static int input_action_end_dx6(struct sk_buff *skb,
struct seg6_local_lwt *slwt)
@@ -1046,7 +1073,7 @@ static int input_action_end_dx6(struct s
if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
return NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING,
dev_net(skb->dev), NULL, skb, skb->dev,
- NULL, input_action_end_dx6_finish);
+ NULL, input_action_end_dx6_finish_nf);
return input_action_end_dx6_finish(dev_net(skb->dev), NULL, skb);
drop:
@@ -1114,6 +1141,17 @@ static int input_action_end_dx4_finish(s
return dst_input(skb);
}
+static int input_action_end_dx4_finish_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_local_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return input_action_end_dx4_finish(net, sk, skb);
+}
+
static int input_action_end_dx4(struct sk_buff *skb,
struct seg6_local_lwt *slwt)
{
@@ -1134,7 +1172,7 @@ static int input_action_end_dx4(struct s
if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
return NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING,
dev_net(skb->dev), NULL, skb, skb->dev,
- NULL, input_action_end_dx4_finish);
+ NULL, input_action_end_dx4_finish_nf);
return input_action_end_dx4_finish(dev_net(skb->dev), NULL, skb);
drop:
@@ -1778,6 +1816,17 @@ static int seg6_local_input_core(struct
return rc;
}
+static int seg6_local_input_core_nf(struct net *net, struct sock *sk,
+ struct sk_buff *skb)
+{
+ if (unlikely(!seg6_local_skb_has_lwtstate(skb))) {
+ kfree_skb(skb);
+ return -EINVAL;
+ }
+
+ return seg6_local_input_core(net, sk, skb);
+}
+
static int seg6_local_input(struct sk_buff *skb)
{
if (skb->protocol != htons(ETH_P_IPV6)) {
@@ -1788,7 +1837,7 @@ static int seg6_local_input(struct sk_bu
if (static_branch_unlikely(&nf_hooks_lwtunnel_enabled))
return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_IN,
dev_net(skb->dev), NULL, skb, skb->dev, NULL,
- seg6_local_input_core);
+ seg6_local_input_core_nf);
return seg6_local_input_core(dev_net(skb->dev), NULL, skb);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0646/1005] mptcp: reject DATA_ACKs against a reversed send interval
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (644 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0645/1005] seg6: validate state in netfilter continuations Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0647/1005] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
` (352 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Matthieu Baerts (NGI0), Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit d75e5cd72995ec2fa77ec77a593cea28e2490ff1 upstream.
ack_update_msk() samples snd_nxt before taking the data lock, but reads
snd_una after taking it. Concurrent transmission and ACK processing can
therefore leave the sampled upper bound behind snd_una. Active-open
completion also exposes a reversed interval when it initializes snd_una
to IDSN + 1 while the socket-owned state synchronization is deferred.
A peer-supplied 64-bit Data ACK half a sequence space away can pass both
wraparound comparisons against such an interval. The resulting snd_una
can make __mptcp_retrans() inflate a fragment's already_sent field. Later
ACKs can then underflow data_len and cause out-of-bounds page fragments
to be passed to TCP.
Read snd_nxt after acquiring the data lock and reject reversed intervals
before checking the received Data ACK. This keeps the interval shorter
than half the sequence space, so the existing upper-bound check cannot
accept an advance beyond snd_nxt. Preserve the existing handling of old
ACKs and keep the transmit fields under their existing socket locking.
Cc: stable@vger.kernel.org
Fixes: 7439d687b79c ("mptcp: avoid a few atomic ops in the rx path")
Fixes: 3f83d8a77eee ("mptcp: fix more tx path fields initialization")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20261104130747.1045741-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mptcp/options.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1122,9 +1122,9 @@ static void ack_update_msk(struct mptcp_
struct sock *ssk,
struct mptcp_options_received *mp_opt)
{
- u64 new_wnd_end, new_snd_una, snd_nxt = READ_ONCE(msk->snd_nxt);
+ u64 new_wnd_end, new_snd_una, old_snd_una;
struct sock *sk = (struct sock *)msk;
- u64 old_snd_una;
+ u64 snd_nxt;
mptcp_data_lock(sk);
@@ -1133,10 +1133,14 @@ static void ack_update_msk(struct mptcp_
* more dangerous than missing an ack
*/
old_snd_una = msk->snd_una;
+ snd_nxt = READ_ONCE(msk->snd_nxt);
new_snd_una = mptcp_expand_seq(old_snd_una, mp_opt->data_ack, mp_opt->ack64);
- /* ACK for data not even sent yet? Ignore.*/
- if (unlikely(after64(new_snd_una, snd_nxt)))
+ /* The active-open state sync can defer the snd_nxt update. Do not
+ * accept an ACK against a reversed interval, or beyond snd_nxt.
+ */
+ if (unlikely(before64(snd_nxt, old_snd_una) ||
+ after64(new_snd_una, snd_nxt)))
new_snd_una = old_snd_una;
new_wnd_end = new_snd_una + tcp_sk(ssk)->snd_wnd;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0647/1005] ipv4: keep XFRM headers out of corked skb lengths
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (645 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0646/1005] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0648/1005] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
` (351 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 0f47fce51a98d3d9f439c16861d519a7b833a176 upstream.
__ip_append_data() allocates space for dst.header_len in the first skb,
but includes that space in skb->len until __ip_make_skb() pulls it.
Fragment accounting uses an MTU that already excludes the XFRM headers.
As a result, the next skb can have a fraggap larger than its capped
datalen, and skb_copy_and_csum_bits() can overwrite its shared info.
For example, five AH tunnel states can reserve 500 bytes while leaving
an effective MTU of 348. With 40 bytes of IPv4 options, the second skb
has room for 288 bytes of fragment data but receives a 500-byte gap
copy. The overwritten shared info is subsequently consumed by the skb
release paths.
Reserve the XFRM headers together with the link-layer headroom instead.
This keeps skb->len, the gap-copy offsets and the trim lengths relative
to the IPv4 packet throughout corking. The network and transport header
addresses and the headroom available to XFRM at output are unchanged.
Both paged and linear allocations, including subsequent corked appends,
use the corrected accounting.
Fixes: 353e5c9abd90 ("ipv4: Fix IPsec slowpath fragmentation problem")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Link: https://patch.msgid.link/20261030042229.74068-1-kylebot@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/ip_output.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1150,16 +1150,16 @@ alloc_new_skb:
*/
skb->ip_summed = csummode;
skb->csum = 0;
- skb_reserve(skb, hh_len);
+ skb_reserve(skb, hh_len + exthdrlen);
/*
* Find where to start putting bytes.
*/
- data = skb_put(skb, fraglen + exthdrlen - pagedlen);
- skb_set_network_header(skb, exthdrlen);
+ data = skb_put(skb, fraglen - pagedlen);
+ skb_reset_network_header(skb);
skb->transport_header = (skb->network_header +
fragheaderlen);
- data += fragheaderlen + exthdrlen;
+ data += fragheaderlen;
if (fraggap) {
skb->csum = skb_copy_and_csum_bits(
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0648/1005] ipv4: fib_trie: prevent speculative out-of-bounds child access
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (646 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0647/1005] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0649/1005] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
` (350 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Daniël Trujillo,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniël Trujillo <datrujillo@nvidia.com>
commit fd3d73286662950656f54616d0b3fea29e2dc99a upstream.
fib_table_lookup() checks the child index against the bounds before
passing it to get_child_rcu().
The index is derived from the lookup key, which in turn is derived from
flp->daddr. A userspace process can therefore influence the index by
triggering lookups for chosen destination IPv4 addresses.
If this bounds check is mispredicted as in-bounds, an out-of-bounds index
can be transiently passed to get_child_rcu(). The value loaded beyond the
child array is then treated as a node pointer. A later transient
dereference of that pointer can cause a data-dependent cache footprint.
This was found during Spectre-v1 research. Leakage was demonstrated with
instrumentation that delays branch resolution with a CLFLUSH before the
mispredicted branch and makes the leaked location deterministic for
reproducible measurement. In that setup, a userspace-controlled IPv4
lookup key was able to trigger a transient out-of-bounds child access.
The transient use of the loaded value as a pointer caused a
data-dependent cache footprint that was recoverable from userspace using
Prime+Probe. A real-world attacker would likely need to delay branch
resolution, which was not demonstrated end-to-end without the added
CLFLUSH.
Sanitize the index with array_index_nospec() before accessing the child
array. This removed the observed leakage in the described setup.
Apply the hardening before setting cindex in fib_table_lookup(), because
cindex can later be used by the backtrace path to load another child
pointer. fib_find_node() has the same pattern, with the checked index
derived from a user-provided key in fib_table_insert() and
fib_table_delete(). leaf_walk_rcu() has a similar checked cindex before
get_child_rcu(), and the traversed state can be influenced by userspace
actions. fib_find_node() runs under RTNL and leaf_walk_rcu() is not on
the packet lookup hot path, so harden those analogous accesses in the
same way. Also harden fib_trie_get_next(), where a mispredicted loop
condition could transiently read one child past the array.
I see a slowdown of roughly 10% in a microbenchmark where we call
fib_table_lookup() with 64 routes directly from inside the kernel. I
observed no slowdown in a loopback UDP sendto() microbenchmark.
Fixes: 9f9e636d4f89 ("fib_trie: Optimize fib_table_lookup to avoid wasting time on loops/variables")
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Daniël Trujillo <datrujillo@nvidia.com>
Link: https://patch.msgid.link/20261106-fib-trie-nospec-v3-1-53da6550dcf8@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/fib_trie.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -61,6 +61,7 @@
#include <linux/export.h>
#include <linux/vmalloc.h>
#include <linux/notifier.h>
+#include <linux/nospec.h>
#include <net/net_namespace.h>
#include <net/inet_dscp.h>
#include <net/ip.h>
@@ -961,6 +962,8 @@ static struct key_vector *fib_find_node(
break;
}
+ index = array_index_nospec(index, 1ul << n->bits);
+
/* keep searching until we find a perfect match leaf or NULL */
} while (IS_TNODE(n));
@@ -1466,6 +1469,8 @@ int fib_table_lookup(struct fib_table *t
if (IS_LEAF(n))
goto found;
+ index = array_index_nospec(index, 1ul << n->bits);
+
/* only record pn and cindex if we are going to be chopping
* bits later. Otherwise we are just wasting cycles.
*/
@@ -1766,6 +1771,8 @@ static struct key_vector *leaf_walk_rcu(
if (cindex >> pn->bits)
break;
+ cindex = array_index_nospec(cindex, 1ul << pn->bits);
+
/* descend into the next child */
n = get_child_rcu(pn, cindex++);
if (!n)
@@ -1787,6 +1794,8 @@ static struct key_vector *leaf_walk_rcu(
continue;
}
+ cindex = array_index_nospec(cindex, 1ul << pn->bits);
+
/* grab the next available node */
n = get_child_rcu(pn, cindex++);
if (!n)
@@ -2431,7 +2440,10 @@ static struct key_vector *fib_trie_get_n
while (!IS_TRIE(pn)) {
while (cindex < child_length(pn)) {
- struct key_vector *n = get_child_rcu(pn, cindex++);
+ struct key_vector *n;
+
+ cindex = array_index_nospec(cindex, child_length(pn));
+ n = get_child_rcu(pn, cindex++);
if (!n)
continue;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0649/1005] ipv6: fix cached route reuse for control messages
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (647 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0648/1005] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0650/1005] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
` (349 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Willem de Bruijn, Xia Yan,
Willem de Bruijn, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xia Yan <yanxia@cmss.chinamobile.com>
commit f778e80b3daf5033fb996f45c2b5d0ce1e82c0a7 upstream.
A connected IPv6 UDP or ping socket can reuse its cached route when an
SO_MARK cmsg requests another mark. A packet can then bypass a prohibit
rule instead of failing with EACCES.
ip6_sk_dst_lookup_flow() reads the cache even when connected is false.
UDP clears connected after parsing IP or socket control messages. Ping
always passes false.
Only read the cache when connected is true. Ordinary connected UDP
sends keep using the cache. Ping sends do a fresh lookup.
Found during code review of IPv6 UDP route caching. On UML, the same
connected-socket selftest fails four IPv6 cases before the fix and
passes all 54 with it.
Fixes: c6af0c227a22 ("ip: support SO_MARK cmsg")
Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Link: https://lore.kernel.org/netdev/willemdebruijn.kernel.1e0038bcc3ef8@gmail.com/
Cc: stable@vger.kernel.org
Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261109014400.9025-1-yanxia@cmss.chinamobile.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/ip6_output.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1305,7 +1305,7 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow);
* @sk: socket which provides the dst cache and route info
* @fl6: flow to lookup
* @final_dst: final destination address for ipsec lookup
- * @connected: whether @sk is connected or not
+ * @connected: whether the flow can use and update the socket dst cache
*
* This function performs a route lookup on the given flow with the
* possibility of using the cached route in the socket if it is valid.
@@ -1322,11 +1322,14 @@ struct dst_entry *ip6_sk_dst_lookup_flow
const struct in6_addr *final_dst,
bool connected)
{
- struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
+ struct dst_entry *dst;
- dst = ip6_sk_dst_check(sk, dst, fl6);
- if (dst)
- return dst;
+ if (connected) {
+ dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
+ dst = ip6_sk_dst_check(sk, dst, fl6);
+ if (dst)
+ return dst;
+ }
dst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_dst);
if (connected && !IS_ERR(dst))
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0650/1005] ipv6: reject routes without an inet6_dev
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (648 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0649/1005] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0651/1005] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
` (348 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Hangbin Liu,
Yingjie Wang, Ido Schimmel, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <1075151112@qq.com>
commit 08a1eb7a634f665718ebe74e0960e242f597135e upstream.
ip6_route_output() and ip6_route_lookup() can return an error-free route
whose rt6i_idev is NULL. Lowering an external nexthop device's MTU below
IPV6_MIN_MTU tears down its inet6_dev, while fib6_ifdown() leaves routes
using nexthop objects in the FIB.
An unprivileged user with CAP_NET_ADMIN in a private user and network
namespace can construct this state. Consumers which treat a route without
an error as usable can then dereference the NULL rt6i_idev. This was
reproduced as a KASAN NULL pointer dereference in ip6_tnl_xmit().
An audit of IPv6 route and tunnel users found this unchecked
ip6_dst_idev() dereference.
A similar missing inet6_dev check was fixed in commit 1b9b5323725e
("netfilter: ip6t_rpfilter: reject routes without inet6_dev"). However,
the route construction path still marks routes without an inet6_dev as
successful, leaving every consumer responsible for the same check.
Acquire the inet6_dev reference before initializing the destination. If a
non-reject route has no inet6_dev, initialize it as RTN_UNREACHABLE instead
of a successful route. Explicit reject routes keep their original type and
error. This establishes that ordinary error-free IPv6 routes have an
inet6_dev while retaining the existing defensive checks at callers.
The modified route object builds cleanly with W=1. A full x86_64 KASAN
bzImage build completes; it reports two pre-existing kernel-doc warnings
outside this change.
Tests:
- `make W=1 net/ipv6/route.o`
- full x86_64 KASAN `bzImage` build with `W=1`
- KASAN QEMU with an unprivileged user and network namespace: after
lowering the MTU, the stale route returned `No route to host`, a normal
route still resolved, and the collect_md trigger completed without
KASAN, oops, or panic
- `tools/testing/selftests/net/ip6_tunnel.sh` in the same KASAN QEMU
Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects")
Closes: https://lore.kernel.org/netdev/DMP4WRIOGMBX.3VW2KNLBGDZ0K@gmail.com/
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <1075151112@qq.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/tencent_91DA7FD8277B509C55906702D1E425FBC906@qq.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/route.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1165,6 +1165,12 @@ static void ip6_rt_init_dst(struct rt6_i
return;
}
+ /* addrconf_ifdown() removed inet6_dev. The device can't do IPv6. */
+ if (!rt->rt6i_idev) {
+ ip6_rt_init_dst_reject(rt, RTN_UNREACHABLE);
+ return;
+ }
+
rt->dst.error = 0;
rt->dst.output = ip6_output;
@@ -1200,10 +1206,10 @@ static void ip6_rt_copy_init(struct rt6_
const struct net_device *dev = nh->fib_nh_dev;
struct fib6_info *f6i = res->f6i;
+ rt->rt6i_idev = dev ? in6_dev_get(dev) : NULL;
ip6_rt_init_dst(rt, res);
rt->rt6i_dst = f6i->fib6_dst;
- rt->rt6i_idev = dev ? in6_dev_get(dev) : NULL;
rt->rt6i_flags = res->fib6_flags;
if (nh->fib_nh_gw_family) {
rt->rt6i_gateway = nh->fib_nh_gw6;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0651/1005] ipvs: Defer application parent freeing until after RCU readers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (649 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0650/1005] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0652/1005] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
` (347 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Julian Anastasov,
Pablo Neira Ayuso
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
commit 1e0808008e44d736e57a897a51d14fa995099010 upstream.
unregister_ip_vs_app() removes each incarnation from its protocol list and
uses call_rcu() to defer freeing it, but frees the parent application
immediately. An RCU reader that already found an incarnation can still
access the parent through inc->app in ip_vs_app_inc_get().
During FTP helper module unload, the following interleaving is possible:
CPU 0 (RCU reader) CPU 1 (module unload)
tcp_app_conn_bind()
find inc in protocol list
unregister_ip_vs_app()
ip_vs_app_inc_release(inc)
list_del_rcu(&inc->p_list)
call_rcu(&inc->rcu_head, ...)
kfree(a)
ip_vs_app_inc_get(inc)
try_module_get(inc->app->module)
The helper module is already going away, so try_module_get() would fail,
but evaluating its argument first reads the freed parent. The subsequent
rcu_barrier() in pernet unregistration cannot protect this earlier free.
KASAN reported:
BUG: KASAN: slab-use-after-free in ip_vs_app_inc_get+0x7c/0x90
Call Trace:
ip_vs_app_inc_get+0x7c/0x90
tcp_app_conn_bind+0x1bc/0x290
ip_vs_conn_new+0x1915/0x20d0
ip_vs_schedule+0x697/0xea0
tcp_conn_schedule+0x489/0x820
ip_vs_in_hook+0x7bf/0x1f40
Allocated by task 88:
kmemdup_noprof+0x20/0x50
register_ip_vs_app+0x12d/0x2c0
__ip_vs_ftp_init+0x56/0x160 [ip_vs_ftp]
Freed by task 104:
kfree+0x131/0x3c0
unregister_ip_vs_app+0x2f4/0x5b0
unregister_pernet_operations+0x232/0x490
unregister_pernet_subsys+0x1c/0x30
__do_sys_delete_module+0x346/0x510
Use kfree_rcu() with the existing rcu_head to keep the parent alive until
these readers finish. Successful helper references already prevent normal
module unload, and incarnation RCU callbacks do not access the parent.
Fixes: 363c97d7435e ("ipvs: convert app locks")
Cc: stable@vger.kernel.org
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/ipvs/ip_vs_app.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -242,7 +242,7 @@ void unregister_ip_vs_app(struct netns_i
}
list_del(&a->a_list);
- kfree(a);
+ kfree_rcu(a, rcu_head);
/* decrease the module use count */
ip_vs_use_count_dec();
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0652/1005] ipvs: fix protocol data lifetime during namespace teardown
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (650 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0651/1005] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0653/1005] gtp: free the skb after handling an echo response Greg Kroah-Hartman
` (346 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Julian Anastasov,
Pablo Neira Ayuso
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
commit 832aa3e89e806bb2667fe4e656b705f4088b3c9d upstream.
IPVS frees its per-net protocol data before control cleanup cancels
defense work and unregisters the sysctl table. A defense worker can load
a protocol data pointer, then namespace cleanup can unlink and free that
object before the worker dereferences pd->pp or pd->next. The worker's
securetcp_lock does not serialize with protocol cleanup. A concurrent
defense-mode sysctl write can reach the same timeout update path.
KASAN reported:
BUG: KASAN: slab-use-after-free in ip_vs_protocol_timeout_change
Workqueue: events_long defense_work_handler
Call Trace:
ip_vs_protocol_timeout_change+0x1b4/0x1e0
update_defense_level+0x63e/0xd80
defense_work_handler+0x1e/0xc0
Allocated by task 125:
ip_vs_protocol_net_init+0xda/0x2f0
__ip_vs_init+0x16b/0x240
setup_net+0xfc/0x310
Freed by task 12:
ip_vs_protocol_net_cleanup+0x1d6/0x2e0
__ip_vs_cleanup_batch+0x7d/0x100
cleanup_net+0x38c/0x770
Run control cleanup before protocol cleanup so that defense work and
active sysctl handlers have finished before their protocol data is freed.
Initialize protocols before exposing the control interface, and unwind
in reverse order, to enforce the same lifetime on initialization failure.
Protocol initialization and exit do not depend on control state.
Fixes: 9330419d9aa4 ("IPVS: netns, use ip_vs_proto_data as param.")
Cc: stable@vger.kernel.org
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/ipvs/ip_vs_core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -2502,12 +2502,12 @@ static int __net_init __ip_vs_init(struc
if (ip_vs_estimator_net_init(ipvs) < 0)
goto estimator_fail;
- if (ip_vs_control_net_init(ipvs) < 0)
- goto control_fail;
-
if (ip_vs_protocol_net_init(ipvs) < 0)
goto protocol_fail;
+ if (ip_vs_control_net_init(ipvs) < 0)
+ goto control_fail;
+
if (ip_vs_app_net_init(ipvs) < 0)
goto app_fail;
@@ -2527,10 +2527,10 @@ sync_fail:
conn_fail:
ip_vs_app_net_cleanup(ipvs);
app_fail:
- ip_vs_protocol_net_cleanup(ipvs);
-protocol_fail:
ip_vs_control_net_cleanup(ipvs);
control_fail:
+ ip_vs_protocol_net_cleanup(ipvs);
+protocol_fail:
ip_vs_estimator_net_cleanup(ipvs);
estimator_fail:
net->ipvs = NULL;
@@ -2547,8 +2547,8 @@ static void __net_exit __ip_vs_cleanup_b
ipvs = net_ipvs(net);
ip_vs_conn_net_cleanup(ipvs);
ip_vs_app_net_cleanup(ipvs);
- ip_vs_protocol_net_cleanup(ipvs);
ip_vs_control_net_cleanup(ipvs);
+ ip_vs_protocol_net_cleanup(ipvs);
ip_vs_estimator_net_cleanup(ipvs);
IP_VS_DBG(2, "ipvs netns %d released\n", ipvs->gen);
net->ipvs = NULL;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0653/1005] gtp: free the skb after handling an echo response
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (651 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0652/1005] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0654/1005] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
` (345 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joas Antonio dos Santos <joasantonio108@gmail.com>
commit f17b293d155f377e4cff582b8113991d2ad346d6 upstream.
gtp0_handle_echo_resp() and gtp1u_handle_echo_resp() return the result
of genlmsg_multicast_netns() to gtp_encap_recv(). When the netlink
notification is delivered that result is 0, and gtp_encap_recv() treats
0 as "the skb has been consumed":
switch (ret) {
case 1:
netdev_dbg(gtp->dev, "pass up to the process\n");
break;
case 0:
break;
case -1:
netdev_dbg(gtp->dev, "GTP packet has been dropped\n");
kfree_skb(skb);
ret = 0;
break;
}
The echo response handlers only read from the skb and never free it or
pass it on, so every echo response that is reported to a listener on the
gtp multicast group leaks the skb. Echo responses are handled for any
peer when the UDP sockets were created by the kernel, so a remote host
can leak memory on the receiver by sending GTP echo responses while a
process with CAP_NET_ADMIN is subscribed to the gtp multicast group, for
example a daemon that monitors echo responses.
The error paths do not leak but have a related problem. -ENOMEM and the error from
genlmsg_multicast_netns() (-ESRCH when nobody listens) are not -1, so
they are returned unchanged to the UDP stack, which takes a negative
value from encap_rcv() as a request to resubmit the packet to the
protocol with that number.
Return -1 when the notification cannot be built, so that
gtp_encap_recv() drops the skb, and consume the skb once the
notification has been handed to netlink, whether or not anybody is
listening.
Found by LLM-assisted source review, untested.
Fixes: d33bd757d362 ("gtp: Implement GTP echo request")
Cc: stable@vger.kernel.org
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Link: https://patch.msgid.link/20261110-gtp-echo-rsp-leak-v1-1-192c032f3dfa@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/gtp.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -560,16 +560,19 @@ static int gtp0_handle_echo_resp(struct
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!msg)
- return -ENOMEM;
+ return -1;
ret = gtp_genl_fill_echo(msg, 0, 0, 0, GTP_CMD_ECHOREQ, echo);
if (ret < 0) {
nlmsg_free(msg);
- return ret;
+ return -1;
}
- return genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
- msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
+ genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
+ msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
+ consume_skb(skb);
+
+ return 0;
}
static int gtp_proto_to_family(__u16 proto)
@@ -747,16 +750,19 @@ static int gtp1u_handle_echo_resp(struct
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!msg)
- return -ENOMEM;
+ return -1;
ret = gtp_genl_fill_echo(msg, 0, 0, 0, GTP_CMD_ECHOREQ, echo);
if (ret < 0) {
nlmsg_free(msg);
- return ret;
+ return -1;
}
- return genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
- msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
+ genlmsg_multicast_netns(>p_genl_family, dev_net(gtp->dev),
+ msg, 0, GTP_GENL_MCGRP, GFP_ATOMIC);
+ consume_skb(skb);
+
+ return 0;
}
static int gtp_parse_exthdrs(struct sk_buff *skb, unsigned int *hdrlen)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0654/1005] hv_netvsc: Stop PPI parsing on invalid metadata
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (652 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0653/1005] gtp: free the skb after handling an echo response Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0655/1005] hv_sock: Report no unread data before a channel is available Greg Kroah-Hartman
` (344 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Erni Sri Satya Vennela,
Haiyang Zhang, Wei Liu, Simon Horman, Dave Miller
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
commit 19a227903e65c7a9c179156485660a4e017575fe upstream.
rndis_get_ppi() uses continue when a per-packet information entry has an
invalid size or offset, or cannot hold the requested metadata. However,
the remaining length and entry pointer are only updated at the bottom
of the loop. Each error path therefore retries the same invalid entry
indefinitely, repeatedly logging the error and preventing receive
processing from completing.
Return NULL on these validation failures instead of continuing. This
terminates the lookup when malformed metadata is encountered while
preserving the existing behavior for valid entries.
The issue was reported through an internal bug-tracking system and
confirmed by manual code inspection. The pre-fix hang has not been
reproduced locally.
Fixes: 44144185951a ("hv_netvsc: Add validation for untrusted Hyper-V values")
Cc: stable@vger.kernel.org
Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Wei Liu <liuwe@microsoft.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/hyperv/rndis_filter.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -401,12 +401,12 @@ static inline void *rndis_get_ppi(struct
/* Validate ppi_offset and ppi_size */
if (ppi->size > len) {
netdev_err(ndev, "Invalid ppi size: %u\n", ppi->size);
- continue;
+ return NULL;
}
if (ppi->ppi_offset >= ppi->size) {
netdev_err(ndev, "Invalid ppi_offset: %u\n", ppi->ppi_offset);
- continue;
+ return NULL;
}
if (ppi->type == type && ppi->internal == internal) {
@@ -414,7 +414,7 @@ static inline void *rndis_get_ppi(struct
if (ppi->size - ppi->ppi_offset < ppi_size) {
netdev_err(ndev, "Invalid ppi: size %u ppi_offset %u\n",
ppi->size, ppi->ppi_offset);
- continue;
+ return NULL;
}
return (void *)((ulong)ppi + ppi->ppi_offset);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0655/1005] hv_sock: Report no unread data before a channel is available
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (653 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0654/1005] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0656/1005] net: gro: avoid parsing headers from shared fragments Greg Kroah-Hartman
` (343 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrea Parri, Stefano Garzarella,
Luigi Leonardi, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <parri.andrea@gmail.com>
commit 71b06766b7c49ed5f489b8bd104f82ff164d67a3 upstream.
The Hyper-V transport is assigned before the asynchronous VMBus channel
offer completes. Its zero-initialized hvsock therefore has a NULL chan
until hvs_open_connection() associates the channel with the socket.
SIOCINQ can query the assigned transport while the socket is connecting,
or after connect() fails once the transport has been assigned. Unlike
poll(), that path does not check stream_is_active() before calling the
transport's stream_has_data callback. hvs_stream_has_data() then passes
the NULL channel to hvs_channel_readable_payload(), and any user in the
guest can trigger an oops:
BUG: kernel NULL pointer dereference, address: 0000000000000178
RIP: 0010:hvs_stream_has_data+0x23/0x120
Call Trace:
<TASK>
? vsock_ioctl+0x74/0xf0
sock_do_ioctl+0x42/0xf0
sock_ioctl+0x27d/0x310
do_vfs_ioctl+0x700/0x810
__x64_sys_ioctl+0x7d/0xf0
Return zero unread bytes when no channel is available, before accessing
the receive state or ring. Leave the existing channel-backed receive
handling unchanged.
The oops was reproduced on an unmodified v7.4-rc1 kernel in a WSL2
guest with a small user-space program, available on request. With this
patch, the program reports zero unread bytes and the kernel logs nothing.
Other vsock_test cases were not run, as most of them need a host-side
peer.
AI assistance was used to identify the issue and develop the fix.
Fixes: f7c722659275 ("vsock: Add support for SIOCINQ ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Link: https://patch.msgid.link/20261106123920.162131-1-parri.andrea@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/vmw_vsock/hyperv_transport.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -697,6 +697,9 @@ static s64 hvs_stream_has_data(struct vs
struct hvsock *hvs = vsk->trans;
s64 ret;
+ if (!hvs->chan)
+ return 0;
+
if (hvs->recv_data_len > 0)
return hvs->recv_data_len;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0656/1005] net: gro: avoid parsing headers from shared fragments
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (654 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0655/1005] hv_sock: Report no unread data before a channel is available Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0657/1005] net: gro: do not undo remote checksum offload on merged packets Greg Kroah-Hartman
` (342 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Kyle Zeng, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 44818c9a826d766dc0e21179dc76f229334f1dda upstream.
When an skb has an empty linear head, skb_gro_reset_offset() can expose
the first page fragment directly to GRO header parsers. For an
SKBFL_SHARED_FRAG skb, those bytes may still be writable through a file
mapping. Headers validated during receive can therefore differ from the
headers later copied into the linear head and used during completion.
For example, changing an IPv6 destination-options length between the
short and full header fetches in ipv6_gro_pull_exthdrs() can make
ipv6_gro_complete() pass an out-of-bounds offset to udp6_gro_complete().
A userspace reproducer triggered a KASAN slab-out-of-bounds read there
on an unmodified kernel as UID 1000. The same completion path can write
the UDP checksum and length through the invalid offset. The packet has
trusted TCP GSO metadata and spliced file data, so it reaches completion
without an skb zerocopy destructor or a second GRO packet.
Disable the direct-fragment fast path for skbs with externally writable
fragments. With an empty linear head, frag0_len remains zero, so
skb_gro_header_slow() pulls each required header into the linear head
before it is inspected. Subsequent pulls preserve the validated prefix.
This covers both gro_receive_skb() and napi_gro_frags(), including other
protocols using the same helpers. Linear headers and private fragments
retain their existing fast paths.
Codex assisted with review of the supplied report, reproducer and draft
fix, related-path analysis, and this changelog. The patched
net/core/gro.o builds with W=1 using the supplied x86-64 configuration,
allyesconfig and allmodconfig. The fix was checked by code-path analysis;
the reproducer and kernel selftests have not been run on a booted
patched kernel.
The issue was found by an LLM.
Fixes: dff0b0161ad5 ("net: gro: parse ipv6 ext headers without frag0 invalidation")
Cc: stable@kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Link: https://patch.msgid.link/20261031050752.31869-1-kylebot@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/gro.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -414,7 +414,8 @@ static inline void skb_gro_reset_offset(
headlen = skb_headlen(skb);
NAPI_GRO_CB(skb)->frag0 = skb->data;
NAPI_GRO_CB(skb)->frag0_len = headlen;
- if (headlen)
+ /* Shared fragments must be pulled into the linear head before parsing. */
+ if (headlen || skb_has_shared_frag(skb))
return;
pinfo = skb_shinfo(skb);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0657/1005] net: gro: do not undo remote checksum offload on merged packets
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (655 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0656/1005] net: gro: avoid parsing headers from shared fragments Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0658/1005] net: gro: invalidate frag0 after a pull Greg Kroah-Hartman
` (341 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
commit c817ec1b06875b98460fbd19591be541bc3fa924 upstream.
skb_gro_flush_final_remcsum() calls skb_gro_remcsum_cleanup() to undo
the checksum adjustment done by skb_gro_remcsum_process() when the
packet was not consumed by GRO.
When the inner handler merged the packet (NAPI_GRO_CB(skb)->same_flow
is set), grc->offset can no longer be trusted:
- skb_gro_receive() either gives the frags or the head of the skb
to the held packet, or uses __skb_pull(skb, offset) before adding
the skb to the frag_list of the held packet.
- skb_gro_receive_list() uses skb_pull(skb, skb_gro_offset(skb)).
grc->offset is relative to the original skb->data, so the 2-byte
read-modify-write done by skb_gro_remcsum_cleanup() can land in
the payload of a packet which now belongs to the GRO packet.
pskb_may_pull() can also be called on this frag_list member.
With fraglist GRO, this can also be a use-after-free:
pskb_may_pull(skb, skb_gro_offset(skb)) in skb_gro_receive_list()
or udp_gro_receive_segment() releases the first page fragment if it
only contains headers. NAPI_GRO_CB(skb)->frag0 and frag0_len are not
updated, so skb_gro_remcsum_cleanup() takes the fast path and writes
through frag0 into a page the skb no longer holds a reference on.
The non merged case, where frag0 is used after this pull, is handled
in the following patch.
For skbs merged by skb_gro_receive(), the cleanup can be skipped:
the skb is freed, or its headers are rebuilt from the head skb in
skb_segment().
Fraglist members keep their own inner headers, as skb_segment_list()
only copies the link-layer and tunnel headers from the head skb.
Their checksum can not be right in all cases: a packet forwarded with
its tunnel header needs the original value, while a VXLAN packet
decapsulated locally needs the adjusted one, as vxlan_remcsum() only
adjusts the head skb. Make skb_gro_receive_list() refuse packets with
skb->remcsum_offload set, so that fraglist members never carry an
adjusted checksum.
This affects VXLAN (VXLAN_F_REMCSUM_NOPARTIAL) and GUE
(FOU_F_REMCSUM_NOPARTIAL).
This was found while fixing a report from Taesoo Kim and Cen Zhang,
who used LLM assisted code analysis and provided reproducers.
Fixes: 26c4f7da3e41 ("net: Fix remcsum in GRO path to not change packet")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261104151042.1157782-2-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/gro.h | 8 +++++++-
net/core/gro.c | 7 +++++++
2 files changed, 14 insertions(+), 1 deletion(-)
--- a/include/net/gro.h
+++ b/include/net/gro.h
@@ -351,7 +351,13 @@ static inline void skb_gro_remcsum_clean
void *ptr;
size_t plen = grc->offset + sizeof(u16);
- if (!grc->delta)
+ /* Once merged, grc->offset can not be trusted: the frags or head
+ * of this skb now belong to the GRO packet, or skb->data was pulled
+ * past the headers before adding it to a frag_list.
+ * skb_gro_receive_list() does not merge packets with an adjusted
+ * checksum, other merged packets do not use their headers anymore.
+ */
+ if (!grc->delta || NAPI_GRO_CB(skb)->same_flow)
return;
ptr = skb_gro_header(skb, plen, grc->offset);
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -238,6 +238,13 @@ int skb_gro_receive_list(struct sk_buff
NAPI_GRO_CB(skb)->flush))
return -E2BIG;
+ /* Fraglist members keep their own headers. Their checksum can not
+ * be right both for a forwarded packet and for a decapsulated one,
+ * if remote checksum offload adjusted it.
+ */
+ if (unlikely(skb->remcsum_offload))
+ return -EINVAL;
+
if (!pskb_may_pull(skb, skb_gro_offset(skb))) {
NAPI_GRO_CB(skb)->flush = 1;
return -ENOMEM;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0658/1005] net: gro: invalidate frag0 after a pull
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (656 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0657/1005] net: gro: do not undo remote checksum offload on merged packets Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0659/1005] netfilter: nf_dup: preserve guard across NFQUEUE reinjection Greg Kroah-Hartman
` (340 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Taesoo Kim, Cen Zhang, Eric Dumazet,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
commit 98d949a15ff9d3fffaa6983223178374aab92db6 upstream.
Since commit bd56a29c7a4e ("net: gro: change skb_gro_network_header()"),
skb_gro_header_slow() no longer invalidates NAPI_GRO_CB(skb)->frag0
after pskb_may_pull(). skb_gro_may_pull() keeps comparing against the
frag0_len value set in skb_gro_reset_offset(), assuming that after a
slow pull, all later accesses are beyond frag0_len.
This is not true:
- udp4_gro_receive() and udp6_gro_receive() read the network header
with skb_gro_network_header() after udp_gro_udphdr() pulled the
UDP header.
- vxlan_gro_receive() calls skb_gro_remcsum_cleanup() at a lower
offset after the inner handlers pulled their headers.
- skb_gro_remcsum_process() can pull beyond the inner Ethernet header
before eth_gro_receive() reads it.
- napi_frags_skb() calls __skb_pull(skb, ETH_HLEN) after a slow pull,
so frag0 still points to the Ethernet header.
If the pull consumed the first page fragment, __skb_pull_tail() released
it. If the head had to grow, pskb_expand_head() freed the old one.
These reads, and the 2-byte write in skb_gro_remcsum_cleanup(), then
access memory the skb no longer holds a reference on.
esp4_gro_receive(), esp6_gro_receive(), skb_gro_receive_list() and
udp_gro_receive_segment() also pull directly and never invalidated
frag0.
Add skb_gro_frag0_invalidate(), which only clears frag0_len, and call
it before each of these pulls. This is a single store in the slow path,
and frag0 stays non NULL, so skb_gro_network_header() does not need
a NULL test.
frag0 must be invalidated even if the pull fails: __pskb_pull_tail()
can return NULL after pskb_expand_head() freed the old head, for
instance if a frag_list member has to be cloned or pulled.
As frag0 is now invalidated before a pull that can fail,
gro_try_pull_from_frag0() can see an skb whose linear part does not
cover skb_gro_offset() while frag0 still points to the start of the
packet, for instance after skb_gro_remcsum_cleanup() pulled a shorter
length. Copying from frag0 would then corrupt the headers: only use
frag0 while frag0_len is not zero, and use pskb_may_pull() otherwise.
If this pull fails, for instance after a failed pskb_pull() in
esp4_gro_receive(), do not hold the packet: later GRO lookups and
gro_complete() handlers expect its headers in the linear part.
This was found by Taesoo Kim and Cen Zhang, using LLM assisted code
analysis, and confirmed with reproducers.
Fixes: bd56a29c7a4e ("net: gro: change skb_gro_network_header()")
Fixes: 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.")
Cc: stable@vger.kernel.org
Reported-by: Taesoo Kim <tsgatesv@gmail.com>
Reported-by: Cen Zhang <cenzhang@linux.microsoft.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261104151042.1157782-3-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/gro.h | 10 ++++++++++
net/core/gro.c | 20 ++++++++++++++++----
net/ipv4/esp4_offload.c | 1 +
net/ipv4/udp_offload.c | 1 +
net/ipv6/esp6_offload.c | 1 +
5 files changed, 29 insertions(+), 4 deletions(-)
--- a/include/net/gro.h
+++ b/include/net/gro.h
@@ -160,9 +160,19 @@ static inline bool skb_gro_may_pull(cons
return likely(hlen <= NAPI_GRO_CB(skb)->frag0_len);
}
+/* A pull can release the page fragment frag0 points to, or reallocate
+ * skb->head, even if it fails. Call this before the pull, to make sure later
+ * skb_gro_header() and skb_gro_network_header() calls no longer use frag0.
+ */
+static inline void skb_gro_frag0_invalidate(struct sk_buff *skb)
+{
+ NAPI_GRO_CB(skb)->frag0_len = 0;
+}
+
static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
unsigned int offset)
{
+ skb_gro_frag0_invalidate(skb);
if (!pskb_may_pull(skb, hlen))
return NULL;
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -245,6 +245,7 @@ int skb_gro_receive_list(struct sk_buff
if (unlikely(skb->remcsum_offload))
return -EINVAL;
+ skb_gro_frag0_invalidate(skb);
if (!pskb_may_pull(skb, skb_gro_offset(skb))) {
NAPI_GRO_CB(skb)->flush = 1;
return -ENOMEM;
@@ -459,12 +460,19 @@ static void gro_pull_from_frag0(struct s
}
}
-static void gro_try_pull_from_frag0(struct sk_buff *skb)
+static bool gro_try_pull_from_frag0(struct sk_buff *skb)
{
int grow = skb_gro_offset(skb) - skb_headlen(skb);
- if (grow > 0)
+ if (grow <= 0)
+ return true;
+
+ /* frag0 can only be used if no pull happened. */
+ if (likely(NAPI_GRO_CB(skb)->frag0_len)) {
gro_pull_from_frag0(skb, grow);
+ return true;
+ }
+ return pskb_may_pull(skb, skb_gro_offset(skb));
}
static void gro_flush_oldest(struct gro_node *gro, struct list_head *head)
@@ -566,13 +574,17 @@ found_ptype:
if (NAPI_GRO_CB(skb)->flush)
goto normal;
+ /* Must be called before setting NAPI_GRO_CB(skb)->{age|last}.
+ * A held packet must have its headers in the linear part.
+ */
+ if (unlikely(!gro_try_pull_from_frag0(skb)))
+ goto normal;
+
if (unlikely(gro_list->count >= MAX_GRO_SKBS))
gro_flush_oldest(gro, &gro_list->list);
else
gro_list->count++;
- /* Must be called before setting NAPI_GRO_CB(skb)->{age|last} */
- gro_try_pull_from_frag0(skb);
NAPI_GRO_CB(skb)->age = jiffies;
NAPI_GRO_CB(skb)->last = skb;
if (!skb_is_gso(skb))
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -37,6 +37,7 @@ static struct sk_buff *esp4_gro_receive(
__be32 seq;
__be32 spi;
+ skb_gro_frag0_invalidate(skb);
if (!pskb_pull(skb, offset))
return NULL;
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -748,6 +748,7 @@ static struct sk_buff *udp_gro_receive_s
pp = p;
} else {
if (NAPI_GRO_CB(skb)->is_flist) {
+ skb_gro_frag0_invalidate(skb);
if (!pskb_may_pull(skb, skb_gro_offset(skb))) {
NAPI_GRO_CB(skb)->flush = 1;
return NULL;
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -64,6 +64,7 @@ static struct sk_buff *esp6_gro_receive(
if (NAPI_GRO_CB(skb)->proto == IPPROTO_UDP)
encap_type = UDP_ENCAP_ESPINUDP;
+ skb_gro_frag0_invalidate(skb);
if (!pskb_pull(skb, offset))
return NULL;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0659/1005] netfilter: nf_dup: preserve guard across NFQUEUE reinjection
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (657 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0658/1005] net: gro: invalidate frag0 after a pull Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0660/1005] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
` (339 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vega, Luxing Yin, Zihan Xi,
Pablo Neira Ayuso
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zihan Xi <zihanx@nebusec.ai>
commit 82052e5b5ec36504fe1b9c3c28a711a78fcacf37 upstream.
NFQUEUE can suspend traversal of a duplicated packet while the task-local
duplication guard is set. The output call then returns and clears the guard
before a later verdict resumes hook traversal.
Save the guard in the queue entry and restore it while reinjection
continues hook traversal. Preserve and restore the verdict task's prior
state, including nested synchronous reinjection.
Fixes: cd58bcd9787e ("netfilter: xt_TEE: have cloned packet travel through Xtables too")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Assisted-by: LLM
Co-developed-by: Luxing Yin <root@tr0jan.top>
Signed-off-by: Luxing Yin <root@tr0jan.top>
Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/netfilter/nf_queue.h | 1 +
net/netfilter/nf_queue.c | 1 +
net/netfilter/nfnetlink_queue.c | 17 ++++++++++++++---
3 files changed, 16 insertions(+), 3 deletions(-)
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -23,6 +23,7 @@ struct nf_queue_entry {
struct net_device *physout;
#endif
struct nf_hook_state state;
+ bool in_nf_duplicate;
bool nf_ct_is_unconfirmed;
u16 size; /* sizeof(entry) + saved route keys */
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -219,6 +219,7 @@ static int __nf_queue(struct sk_buff *sk
*entry = (struct nf_queue_entry) {
.skb = skb,
.skb_dev = skb->dev,
+ .in_nf_duplicate = current->in_nf_duplicate,
.state = *state,
.hook_index = index,
.size = sizeof(*entry) + route_key_size,
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -44,6 +44,7 @@
#include <net/sock.h>
#include <net/tcp_states.h>
#include <net/netfilter/nf_queue.h>
+#include <net/net_debug.h>
#include <net/netns/generic.h>
#include <linux/atomic.h>
@@ -365,21 +366,30 @@ static void nf_reinject(struct nf_queue_
const struct nf_hook_entry *hook_entry;
const struct nf_hook_entries *hooks;
struct sk_buff *skb = entry->skb;
+ bool old_in_nf_duplicate;
const struct net *net;
unsigned int i;
int err;
u8 pf;
+ DEBUG_NET_WARN_ONCE(current->in_nf_duplicate &&
+ !entry->in_nf_duplicate,
+ "%s called with unexpected duplication guard",
+ __func__);
+ local_bh_disable();
+ old_in_nf_duplicate = current->in_nf_duplicate;
+
net = entry->state.net;
pf = entry->state.pf;
+ current->in_nf_duplicate = entry->in_nf_duplicate;
hooks = nf_hook_entries_head(net, pf, entry->state.hook);
i = entry->hook_index;
if (!hooks || i >= hooks->num_hook_entries) {
kfree_skb_reason(skb, SKB_DROP_REASON_NETFILTER_DROP);
nf_queue_entry_free(entry);
- return;
+ goto out;
}
hook_entry = &hooks->hooks[i];
@@ -402,9 +412,7 @@ next_hook:
switch (verdict & NF_VERDICT_MASK) {
case NF_ACCEPT:
case NF_STOP:
- local_bh_disable();
entry->state.okfn(entry->state.net, entry->state.sk, skb);
- local_bh_enable();
break;
case NF_QUEUE:
err = nf_queue(skb, &entry->state, i, verdict);
@@ -418,6 +426,9 @@ next_hook:
}
nf_queue_entry_free(entry);
+out:
+ current->in_nf_duplicate = old_in_nf_duplicate;
+ local_bh_enable();
}
/* return true if the entry has an unconfirmed conntrack attached that isn't owned by us
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0660/1005] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (658 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0659/1005] netfilter: nf_dup: preserve guard across NFQUEUE reinjection Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0661/1005] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
` (338 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Cen Zhang (Microsoft), Pablo Neira Ayuso
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
commit 17c2e41736b62cfe444c64d67860b1fbc1e886ac upstream.
recent_proc_net_exit() removes the /proc/net/xt_recent/<name> entries of
a dying network namespace while holding spin_lock_bh(&recent_lock).
remove_proc_entry() may sleep: proc_entry_rundown() waits until every
task that is still inside the entry's file operations has left. A reader
of such an entry is counted in by proc_reg_read() before
recent_seq_start() takes recent_lock. So if a read is in flight when the
namespace is torn down, cleanup_net() sleeps in atomic context holding
the spinlock that the reader is spinning on, and neither side can ever
make progress.
An unprivileged user can trigger this from a user namespace by adding a
rule with the "recent" match and reading its proc file while the
namespace is being destroyed. As recent_lock is global, every later
attempt to take it spins forever too: the spinning can spread to all
CPUs, and network namespace teardown stops system-wide.
BUG: sleeping function called from invalid context at
kernel/sched/completion.c:116
#3: (recent_lock){+...}-{3:3}, at: recent_net_exit+0x2b/0x140
Workqueue: netns cleanup_net
Call Trace:
proc_entry_rundown+0x185/0x1b0
remove_proc_entry+0x21a/0x520
recent_net_exit+0x7f/0x140
cleanup_net+0x414/0x8f0
...
rcu: INFO: rcu_preempt self-detected stall on CPU
Call Trace:
queued_spin_lock_slowpath+0x313/0xc20
recent_seq_start+0x87/0x1b0
seq_read_iter+0x265/0x11e0
proc_reg_read+0x1ab/0x270
Fix by taking recent_mutex instead of recent_lock. According to
commit a0e889bb1bdc ("[NETFILTER]: recent match: fix "sleeping function
called from invalid context""), recent_mutex is the lock to use here: it
protects recent_net->tables and was introduced so that proc entries are
created and removed without recent_lock held, because those calls may
sleep. hashlimit_proc_net_exit() does the same for xt_hashlimit.
Fixes: 665e205c16c1 ("netfilter: xt_recent: fix namespace destroy path")
Cc: stable@vger.kernel.org
Cc: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/xt_recent.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -649,14 +649,15 @@ static void __net_exit recent_proc_net_e
/* recent_net_exit() is called before recent_mt_destroy(). Make sure
* that the parent xt_recent proc entry is empty before trying to
- * remove it.
+ * remove it. Use recent_mutex instead of recent_lock since
+ * remove_proc_entry() may sleep.
*/
- spin_lock_bh(&recent_lock);
+ mutex_lock(&recent_mutex);
list_for_each_entry(t, &recent_net->tables, list)
remove_proc_entry(t->name, recent_net->xt_recent);
recent_net->xt_recent = NULL;
- spin_unlock_bh(&recent_lock);
+ mutex_unlock(&recent_mutex);
remove_proc_entry("xt_recent", net->proc_net);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0661/1005] netfilter: flowtable: extend ct timeout of offloaded GRE flows
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (659 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0660/1005] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0662/1005] netfs: preserve prepare_write errno on reissue Greg Kroah-Hartman
` (337 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+521f7e7e2b974abde99a,
Michail Andreas Michalopoulos, Pablo Neira Ayuso
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
commit 46ecda278f6eedffb2898d41e3e56757c996a41f upstream.
Since commit 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn
timeout extension logic"), the flowtable gc worker extends the timeout
of an offloaded conntrack entry from nf_flow_table_extend_ct_timeout()
once it falls below 5 minutes. That function only knows about TCP and
UDP and hits WARN_ON_ONCE() for any other layer 4 protocol. However,
GRE flows can be offloaded too, both via nft_flow_offload and act_ct,
since commit 4e8d9584d154 ("netfilter: flowtable: Support GRE").
The timeout of an offloaded GRE entry drops below that threshold as soon
as a packet of the flow still goes through conntrack. With ip6gre
tunnels using the default encapsulation limit this is ordinary traffic:
the flowtable does not parse the Destination Options header in front of
GRE, so every packet of the flow takes the classic forwarding path. It
also happens for a packet with ttl <= 1, which the flowtable fast path
passes up to the classic forwarding path. nf_conntrack_gre_packet() then
refreshes ct->timeout to the GRE stream timeout (180 seconds by default),
and the next gc run triggers, as reported by syzbot:
WARNING: net/netfilter/nf_flow_table_core.c:553 at nf_flow_table_extend_ct_timeout+0x1ee/0x2f0
Workqueue: events_power_efficient nf_flow_offload_work_gc
Call Trace:
nf_flow_offload_gc_step+0x545/0x7b0
nf_flow_table_iterate+0x13c/0x1f0
nf_flow_offload_work_gc+0x22/0x70
process_scheduled_works+0xc3d/0x1630
worker_thread+0xa47/0xfb0
kthread+0x38b/0x480
Besides the splat, which panics the machine with panic_on_warn, the
default branch sets the new timeout to 1 jiffy, so the conntrack entry
expires right away and the offloaded flow is torn down.
Handle GRE like UDP and extend the timeout to NF_CT_DAY. GRE conntrack
has no protocol state to take into account, and NF_CT_DAY is also what
flow_offload_add() already sets for every offloaded entry, GRE included.
This also restores the behaviour from before commit 03428ca5cee9, when
the conntrack gc worker extended offloaded entries of any protocol to
NF_CT_DAY.
Fixes: 03428ca5cee9 ("netfilter: conntrack: rework offload nf_conn timeout extension logic")
Reported-by: syzbot+521f7e7e2b974abde99a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=521f7e7e2b974abde99a
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netfilter/nf_flow_table_core.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -544,6 +544,7 @@ static void nf_flow_table_extend_ct_time
switch (l4proto) {
case IPPROTO_UDP:
+ case IPPROTO_GRE:
new_timeout = NF_CT_DAY;
break;
case IPPROTO_TCP:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0662/1005] netfs: preserve prepare_write errno on reissue
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (660 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0661/1005] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0663/1005] netfs: keep the prepare_read errno when abandoning read retries Greg Kroah-Hartman
` (336 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Iván Ezequiel Rodriguez,
David Howells, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iván Ezequiel Rodriguez <ivanrwcm25@gmail.com>
commit 62869ecb3aeca670b86058387e7533a33524b95b upstream.
prepare_write() may call netfs_prepare_write_failed() (FAILED + errno)
before write_retry calls netfs_reissue_write(). Clearing subreq->error
to 0 for a clean I/O reissue (82e8885bd763) then makes
netfs_do_issue_write() terminate with 0. The collector copies
front->error into stream->error and mapping_set_error(), which ignores
0, so writeback failure is silent.
Skip clearing error when NETFS_SREQ_FAILED is already set;
do_issue_write() already terminates FAILED subrequests.
Fixes: 82e8885bd763 ("netfs: when subreq is marked for retry, do not check if it faced an error")
Signed-off-by: Iván Ezequiel Rodriguez <ivanrwcm25@gmail.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/netfs/write_issue.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/netfs/write_issue.c
+++ b/fs/netfs/write_issue.c
@@ -252,7 +252,9 @@ void netfs_reissue_write(struct netfs_io
iov_iter_truncate(&subreq->io_iter, size);
subreq->retry_count++;
- subreq->error = 0;
+ /* Keep prepare_write() errno; do_issue_write() terminates FAILED. */
+ if (!test_bit(NETFS_SREQ_FAILED, &subreq->flags))
+ subreq->error = 0;
__clear_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);
__set_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);
netfs_stat(&netfs_n_wh_retry_write_subreq);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0663/1005] netfs: keep the prepare_read errno when abandoning read retries
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (661 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0662/1005] netfs: preserve prepare_write errno on reissue Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0664/1005] netfs: dont hang a read whose retry is abandoned Greg Kroah-Hartman
` (335 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Howells, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit d88a0c3a96fd6d7228d04532cecb23f23676aa2d upstream.
When ->prepare_read() fails while retrying a read,
netfs_retry_read_subrequests() marks the subrequest failed and abandons
the rest, which overwrites the error of every failed subrequest with
-ENOMEM. The reader then gets -ENOMEM for e.g. a handle that couldn't be
reopened (-EHOSTDOWN, -ENOENT), a credit wait interrupted by a signal
(-ERESTARTSYS) or umount -f (-EIO). The first pass doesn't have this
problem, as netfs_cancel_read() keeps the errno.
Record the errno of ->prepare_read() in the subrequest and keep the error
of subrequests that already failed, using -ENOMEM only for those
abandoned while still waiting for a retry.
Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/netfs/read_retry.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
--- a/fs/netfs/read_retry.c
+++ b/fs/netfs/read_retry.c
@@ -28,6 +28,7 @@ static void netfs_retry_read_subrequests
struct netfs_io_subrequest *subreq;
struct netfs_io_stream *stream = &rreq->io_streams[0];
struct list_head *next;
+ int ret;
_enter("R=%x", rreq->debug_id);
@@ -140,8 +141,11 @@ static void netfs_retry_read_subrequests
/* Renegotiate max_len (rsize) */
stream->sreq_max_len = subreq->len;
- if (rreq->netfs_ops->prepare_read &&
- rreq->netfs_ops->prepare_read(subreq) < 0) {
+ ret = 0;
+ if (rreq->netfs_ops->prepare_read)
+ ret = rreq->netfs_ops->prepare_read(subreq);
+ if (ret < 0) {
+ subreq->error = ret;
trace_netfs_sreq(subreq, netfs_sreq_trace_reprep_failed);
__set_bit(NETFS_SREQ_FAILED, &subreq->flags);
goto abandon;
@@ -222,7 +226,9 @@ static void netfs_retry_read_subrequests
part = netfs_limit_iter(&source, 0, part, stream->sreq_max_segs);
netfs_stat(&netfs_n_rh_download);
- if (rreq->netfs_ops->prepare_read(subreq) < 0) {
+ ret = rreq->netfs_ops->prepare_read(subreq);
+ if (ret < 0) {
+ subreq->error = ret;
trace_netfs_sreq(subreq, netfs_sreq_trace_reprep_failed);
__set_bit(NETFS_SREQ_FAILED, &subreq->flags);
goto abandon;
@@ -258,7 +264,9 @@ abandon:
if (!test_bit(NETFS_SREQ_FAILED, &subreq->flags) &&
!test_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags))
continue;
- subreq->error = -ENOMEM;
+ if (!subreq->error ||
+ !test_bit(NETFS_SREQ_FAILED, &subreq->flags))
+ subreq->error = -ENOMEM;
__set_bit(NETFS_SREQ_FAILED, &subreq->flags);
__clear_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0664/1005] netfs: dont hang a read whose retry is abandoned
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (662 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0663/1005] netfs: keep the prepare_read errno when abandoning read retries Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0665/1005] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
` (334 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Howells, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit d1bb754ab9e775b0fbb2743d3df425c25a561114 upstream.
When ->prepare_read() fails while retrying a read, or a subrequest can't
be allocated, netfs_retry_read_subrequests() marks the remaining
subrequests failed without reissuing them. If none was reissued in that
pass, nothing is in progress any more to wake the collector, which
returned after the retry, so an offloaded read (readahead, async direct
I/O) never completes and its folios stay locked.
Wake the collector after abandoning, so it collects the failed
subrequests and completes the request.
Fixes: e2d46f2ec332 ("netfs: Change the read result collector to only use one work item")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/netfs/read_retry.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/netfs/read_retry.c
+++ b/fs/netfs/read_retry.c
@@ -270,6 +270,7 @@ abandon:
__set_bit(NETFS_SREQ_FAILED, &subreq->flags);
__clear_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);
}
+ netfs_wake_collector(rreq);
}
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0665/1005] net/sched: sch_teql: reject qdiscs from another network namespace
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (663 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0664/1005] netfs: dont hang a read whose retry is abandoned Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0666/1005] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
` (333 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, shaos, Victor Nogueira,
Jamal Hadi Salim, Simon Horman, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
commit 1ae84bdd736f8fab30180159996e1d193f8029ff upstream.
Reported by shaos <shawnq1@163.com> with a reproducer, which was
reproduced and verified in our test environment.
The issue:
The teql master devices are created once in the initial network
namespace and their Qdisc_ops are global. teql_qdisc_init() takes the
teql_master embedded in the registered sch->ops and uses it without
checking whether the new qdisc's device lives in the same network
namespace as the master. A qdisc created in another netns can therefore
attach to the init-net master and change its MTU and flags.
The Fix:
Reject a teql qdisc whose device is not in the master's network
namespace with -EOPNOTSUPP and an extack message; same-netns teql still
works.
Initialize the private skb queue before any validation so every
constructor failure path, including qdisc_create_dflt(), which resets the
qdisc before destroying it, sees an initialized empty queue.
Conditions to recreate the bug:
CONFIG_NET_SCH_TEQL=y, CONFIG_DUMMY=y, CONFIG_USER_NS=y, CONFIG_NET_NS=y.
As an unprivileged UID, unshare a user and network namespace, create a
dummy device, set its MTU to 60000, and add a root teql0 qdisc:
unshare -Urn
ip link add dummy0 type dummy
ip link set dummy0 mtu 60000
tc qdisc add dev dummy0 root teql0
The init-net teql0 device changes from MTU 1500 to 60000. A pfifo control
on the same device leaves the MTU unchanged, and a direct MTU change on
init-net teql0 is denied. The namespace needs CAP_NET_ADMIN; no init-net
privilege is required. With the fix the attach fails with
"Operation not supported" and the init-net MTU stays 1500.
Fixes: 7316ae88c43d ("net_sched: make traffic control network namespace aware")
Reported-by: shaos <shawnq1@163.com>
Link: https://lore.kernel.org/netdev/20261022144830.67948-1-shawnq1@163.com/
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/SER-NSBD.v1.r2.20261031160050-3%40mojatatu.com
Link: https://lore.kernel.org/netdev/179366641863.488856.17368571591466000274@kernel.org/
Cc: stable@vger.kernel.org
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-3@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/sch_teql.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -198,6 +198,8 @@ static int teql_qdisc_init(struct Qdisc
struct Qdisc *first;
unsigned long flags;
+ skb_queue_head_init(&q->q);
+
if (dev->hard_header_len > m->dev->hard_header_len)
return -EINVAL;
@@ -209,9 +211,12 @@ static int teql_qdisc_init(struct Qdisc
return -EOPNOTSUPP;
}
- q->m = m;
+ if (dev_net(dev) != dev_net(m->dev)) {
+ NL_SET_ERR_MSG_MOD(extack, "teql master is in a different network namespace");
+ return -EOPNOTSUPP;
+ }
- skb_queue_head_init(&q->q);
+ q->m = m;
raw_spin_lock_irqsave(&m->slaves_lock, flags);
first = rcu_dereference_protected(m->slaves, lockdep_is_held(&m->slaves_lock));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0666/1005] net/sched: act_ife: encode configured zero metadata values
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (664 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0665/1005] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0667/1005] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
` (332 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, shaos, Victor Nogueira,
Jamal Hadi Salim, Simon Horman, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
commit 7d02c07c738bf5c4b9a7d7ef498fbf465c446853 upstream.
Reported by shaos <shawnq1@163.com> with a reproducer for the 32-bit
case, which was reproduced and verified in our test environment.
The issue:
ife_check_meta_u32() and ife_check_meta_u16() both reserve eight bytes
of metadata for a configured value even when that value is zero, but the
matching encoder returns without calling ife_tlv_meta_encode(). The
encoder therefore writes neither the TLV header nor its value, while the
enclosing IFE length still includes the reserved bytes, exposing stale
skb headroom contents to the peer.
The 32-bit helper has been present since the IFE action was introduced
(v4.6); the 16-bit helper was added with the 16-bit metadata helpers used
by the skbtcindex callback (v4.9). Both defects predate the oldest
supported stable kernel (5.10), so they are fixed together in this patch.
Each hunk keeps its own Fixes: tag for provenance.
The fix:
Encode any configured value, including zero; skip the TLV only when
there is neither a configured nor a runtime value. The runtime fallback
is unchanged.
A raw TCA_IFE_METALST netlink request is needed to express the
configured zero: the IFE_META_SKBMARK attribute carries four zero
payload bytes for the u32 helper, and IFE_META_TCINDEX two zero payload
bytes for the 16-bit helper (not an absent or zero-length attribute).
Stock tc cannot build these requests; "use mark 0x0" emits no mark
attribute and "allow mark" emits a zero-length one.
Conditions to recreate the bug:
CONFIG_NET_ACT_IFE=y, CONFIG_NET_IFE_SKBMARK=y,
CONFIG_NET_IFE_SKBTCINDEX=y, CONFIG_NET_CLS_MATCHALL=y,
CONFIG_NET_SCH_INGRESS=y, CONFIG_USER_NS=y, CONFIG_NET_NS=y,
CONFIG_VETH=y. In a fresh user and network namespace create a veth pair
and attach clsact to the egress side. Install a matchall filter whose
ife encode action carries a zero skb mark (or a zero tcindex) in
TCA_IFE_METALST. Send a frame through the veth and inspect the IFE
metadata in the received frame. The metadata region is eight bytes but
holds neither a valid TLV header nor a value; it exposes prior headroom
contents. Setting the value to a nonzero one does not trigger the leak.
The namespace needs CAP_NET_ADMIN; no additional privilege is required.
With the fix the zero TLVs are 0001000800000000 (u32) and
0005000600000000 (u16).
Fixes: ef6980b6becb ("introduce IFE action")
Fixes: 6a5d58b67e20 ("net sched ife action: add 16 bit helpers")
Reported-by: shaos <shawnq1@163.com>
Link: https://lore.kernel.org/netdev/20261022144739.61342-1-shawnq1@163.com/
Cc: stable@vger.kernel.org
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-1@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/act_ife.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -50,8 +50,7 @@ int ife_encode_meta_u16(u16 metaval, voi
edata = *(u16 *)mi->metaval;
else if (metaval)
edata = metaval;
-
- if (!edata) /* will not encode */
+ else
return 0;
edata = htons(edata);
@@ -94,8 +93,7 @@ int ife_encode_meta_u32(u32 metaval, voi
edata = *(u32 *)mi->metaval;
else if (metaval)
edata = metaval;
-
- if (!edata) /* will not encode */
+ else
return 0;
edata = htonl(edata);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0667/1005] net/sched: act_ife: require a full Ethernet header on egress
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (665 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0666/1005] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0668/1005] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
` (331 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko (nipa), shaos,
Victor Nogueira, Jamal Hadi Salim, Simon Horman, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
commit 11dbce09083473249c3843ff31bf8d8fa01bdeef upstream.
This is a followup of commit 5b483f7791b0 ("net/sched: act_ife: Only
operate on Ethernet frames") as reported by Sashiko.
The finding was raised by both Sashiko providers (nipa and gemini)
while reviewing the parent patchset. shaos <shawnq1@163.com>
independently reported the same undersized-egress path with a
reproducer, which was reproduced and verified in our test environment.
The issue:
On egress tcf_ife_is_eth_skb() only checks the device type; it does not
check that the skb carries a full Ethernet header. For an Ethernet or
loopback device it returns true even when the skb has no Ethernet
header. tcf_ife_encode() then calls ife_encode(), which copies ETH_HLEN
bytes from skb->data. A short skb therefore reads past its linear data
and the copied bytes, including stale kernel memory, are emitted in the
outer Ethernet header.
The parent commit fixed the reported ingress mac_len case but left the
egress path without a length check.
A total-length test is not sufficient: a non-GSO TUN skb can have a
large total length while only a single byte sits in the linear area, so
ife_encode() still reads past the linear header. Require instead that
the Ethernet header the encoder copies is present in the linear part of
the skb.
The Fix:
On egress require pskb_may_pull(skb, ETH_HLEN) before encoding, which
ensures the Ethernet header is present in the linear data ife_encode()
copies from; the ingress mac_len check is unchanged. A short egress skb
is now dropped instead of being encoded.
Conditions to recreate the bug:
CONFIG_NET_ACT_IFE=y, CONFIG_NET_CLS_MATCHALL=y, CONFIG_NET_SCH_INGRESS=y,
CONFIG_TUN=y, CONFIG_NET_ACT_MIRRED=y. In two user and network
namespaces (a victim and an attacker), open a TUN device in IFF_TUN mode
and attach clsact to it and to lo. Redirect ingress traffic from the TUN
device to lo egress with mirred, and install an ife encode action on lo
egress:
tc qdisc add dev <tun> clsact
tc qdisc add dev lo clsact
tc filter add dev <tun> ingress matchall action mirred egress \
redirect dev lo
tc filter add dev lo egress matchall action ife encode use mark 1 \
action ok
Send a TUN packet shorter than ETH_HLEN (a one-byte payload is enough)
and receive the emitted frame on the other side. Without the fix the
outer Ethernet header contains bytes copied past the short packet; with
the fix the short skb is dropped. The attacker needs CAP_NET_ADMIN in
its user namespace; no init-net privilege is required.
The same path is reachable when the total length is large but the
Ethernet header is not linear: write a non-GSO virtio header with
hdr_len=1 followed by an 8192-byte packet so that only one byte stays
linear. Without the fix the copied header reads past the linear data;
with the fix the header is pulled into the linear area before the copy.
Fixes: 295a6e06d21e ("net/sched: act_ife: Change to use ife module")
Reported-by: Sashiko (nipa) <sashiko-bot@kernel.org>
Reported-by: Sashiko (gemini) <sashiko-bot@kernel.org>
Reported-by: shaos <shawnq1@163.com>
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260821164031.32824-1-victor%40mojatatu.com
Link: https://sashiko.dev/#/patchset/20260821164031.32824-1-victor@mojatatu.com
Link: https://lore.kernel.org/netdev/20261022144736.61227-1-shawnq1@163.com/
Cc: stable@vger.kernel.org
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/SER-NSBD.v3.r0.20261103064310-2@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/act_ife.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -878,13 +878,16 @@ drop:
* is an Ethernet header because the skb could've been redirected with mirred
* from a non-Ethernet device.
*/
-static bool tcf_ife_is_eth_skb(const struct sk_buff *skb)
+static bool tcf_ife_is_eth_skb(struct sk_buff *skb)
{
if (skb->dev->type != ARPHRD_ETHER &&
skb->dev->type != ARPHRD_LOOPBACK)
return false;
- return !skb_at_tc_ingress(skb) || skb->mac_len == ETH_HLEN;
+ if (skb_at_tc_ingress(skb))
+ return skb->mac_len == ETH_HLEN;
+
+ return pskb_may_pull(skb, ETH_HLEN);
}
TC_INDIRECT_SCOPE int tcf_ife_act(struct sk_buff *skb,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0668/1005] net: wait for in-flight device unregistrations before netns dismantle
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (666 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0667/1005] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0669/1005] minix: add minix_inode_block() helper Greg Kroah-Hartman
` (330 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1269fe6cc2016008124e,
Henry Martin, Eric Dumazet, Naman Gulati, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
commit c164a431a646983275d0076ff5b0e4c326fbc10b upstream.
A device can be unregistered by a context other than the cleanup_net()
of its own netns, for instance a veth whose peer in another netns is
deleted. If references on it are still held, it stays in
netdev_wait_allrefs_any(), which rebroadcasts NETDEV_UNREGISTER every
second.
Meanwhile its netns can be dismantled: default_device_exit_batch()
only takes care of devices still listed in the netns, then pernet exit
handlers free their state, and finally struct net is freed while the
device still points to it.
The rebroadcasts then run notifiers against torn down pernet state, or
freed memory. Three instances were reported so far:
- netdev_genl_netdevice_event(): net->genl_sock is NULL [1]
- nh_netdev_event(): net->nexthop.devhash is NULL [2]
- nf_tables netdevice notifiers: use-after-free of the nftables
pernet storage [3]
but any notifier using dev_net(dev) is affected, as is
netdev_wait_allrefs_any() itself (__rtnl_net_lock(dev_net(dev)) with
CONFIG_DEBUG_NET_SMALL_RTNL=y).
This was prevented by rtnl_lock_unregistering() until I removed it
in commit 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()"),
considering only the loopback dependency, and missing the notifiers one.
Restore a per-netns counter of devices sitting in netdev_run_todo(),
and make default_device_exit_batch() wait for it to reach zero, after
it has unregistered all devices of the dying netns(es). At this point
no new unregistration can be started for these netns.
Unlike the old barrier, this only waits for devices of the netns being
dismantled and runs after their own devices are gone.
Tested on a KASAN kernel with a debug-only hack holding a reference
on a veth device for 5 seconds after its unregistration: a nexthop
on the veth in netns X, delete its peer from init_net, then delete X.
Without this patch, the nexthop_flush_dev() null-ptr-deref from [2]
triggers. With it, no splat; netns churn and dismantle of a netns
whose own device is held still work.
[1] https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/
[2] https://lore.kernel.org/netdev/20261105114707.3030737-1-bsdhenrymartin@gmail.com/
[3] https://lore.kernel.org/netdev/20261105114817.3033625-1-bsdhenrymartin@gmail.com/
Fixes: 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()")
Cc: stable@vger.kernel.org
Reported-by: syzbot+1269fe6cc2016008124e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/
Reported-by: Henry Martin <bsdhenrymartin@gmail.com>
Closes: https://lore.kernel.org/netdev/20261105114707.3030737-1-bsdhenrymartin@gmail.com/
Closes: https://lore.kernel.org/netdev/20261105114817.3033625-1-bsdhenrymartin@gmail.com/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Naman Gulati <namangulati@google.com>
Link: https://patch.msgid.link/20261105144543.1624238-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/net_namespace.h | 1 +
net/core/dev.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -69,6 +69,7 @@ struct net {
spinlock_t rules_mod_lock;
unsigned int dev_base_seq; /* protected by rtnl_mutex */
+ atomic_t dev_unreg_pending; /* devices in netdev_run_todo() */
u32 ifindex;
spinlock_t nsid_lock;
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -11007,6 +11007,14 @@ atomic_t dev_unreg_count = ATOMIC_INIT(0
static void net_set_todo(struct net_device *dev)
{
list_add_tail(&dev->todo_list, &net_todo_list);
+ atomic_inc(&dev_net(dev)->dev_unreg_pending);
+}
+
+/* Paired with net_set_todo(). @net must not be used after this call. */
+static void net_unreg_done(struct net *net)
+{
+ if (atomic_dec_and_test(&net->dev_unreg_pending))
+ wake_up(&netdev_unregistering_wq);
}
static netdev_features_t netdev_sync_upper_features(struct net_device *lower,
@@ -11890,6 +11898,7 @@ void netdev_run_todo(void)
if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
netdev_WARN(dev, "run_todo but not unregistering\n");
list_del(&dev->todo_list);
+ net_unreg_done(dev_net(dev));
continue;
}
@@ -11906,8 +11915,11 @@ void netdev_run_todo(void)
cnt = 0;
while (!list_empty(&list)) {
+ struct net *net;
+
dev = netdev_wait_allrefs_any(&list);
list_del(&dev->todo_list);
+ net = dev_net(dev);
/* paranoia */
BUG_ON(netdev_refcnt_read(dev) != 1);
@@ -11928,6 +11940,8 @@ void netdev_run_todo(void)
/* Free network device */
kobject_put(&dev->dev.kobj);
+
+ net_unreg_done(net);
}
if (cnt && atomic_sub_and_test(cnt, &dev_unreg_count))
wake_up(&netdev_unregistering_wq);
@@ -13372,6 +13386,17 @@ static void __net_exit default_device_ex
}
}
+static bool __net_exit netns_dev_unreg_pending(const struct list_head *net_list)
+{
+ struct net *net;
+
+ list_for_each_entry(net, net_list, exit_list) {
+ if (atomic_read(&net->dev_unreg_pending))
+ return true;
+ }
+ return false;
+}
+
static void __net_exit default_device_exit_batch(struct list_head *net_list)
{
/* At exit all network devices most be removed from a network
@@ -13413,6 +13438,16 @@ static void __net_exit default_device_ex
unregister_netdevice_many(&dev_kill_list);
rtnl_unlock();
+ /* Devices of these netns unregistered from another context
+ * (e.g. a veth whose peer was deleted) can still be waiting
+ * in netdev_run_todo() for their last references, while
+ * NETDEV_UNREGISTER is rebroadcast for them. Wait for them
+ * before pernet exit handlers tear down the state used by
+ * netdevice notifiers, and before the netns is freed.
+ * No new unregistration can start: all devices are unlisted.
+ */
+ wait_event(netdev_unregistering_wq, !netns_dev_unreg_pending(net_list));
+
rtnl_net_flush_workqueue();
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0669/1005] minix: add minix_inode_block() helper
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (667 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0668/1005] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0670/1005] minix: dont read the inode block in minix_sync_inode_metadata() Greg Kroah-Hartman
` (329 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 1037134824e9d5c8cc04eea5ec6a5eb3ef4312bb upstream.
Move the lookup of the block that holds an inode out of
minix_V1_raw_inode() and minix_V2_raw_inode() into a helper.
minix_sync_inode_metadata() is going to use it to find the block
without reading it from disk.
No functional changes.
Cc: stable@vger.kernel.org # v7.3
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-5-91ac6c024018@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/minix/bitmap.c | 37 +++++++++++++++++++++++--------------
fs/minix/minix.h | 1 +
2 files changed, 24 insertions(+), 14 deletions(-)
--- a/fs/minix/bitmap.c
+++ b/fs/minix/bitmap.c
@@ -103,21 +103,35 @@ unsigned long minix_count_free_blocks(st
<< sbi->s_log_zone_size);
}
-struct minix_inode *
-minix_V1_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
+/* Return the block that holds inode @ino or 0 if @ino is out of range. */
+int minix_inode_block(struct super_block *sb, ino_t ino)
{
- int block;
struct minix_sb_info *sbi = minix_sb(sb);
- struct minix_inode *p;
+ int inodes_per_block;
if (!ino || ino > sbi->s_ninodes) {
printk("Bad inode number on dev %s: %ld is out of range\n",
sb->s_id, (long)ino);
- return NULL;
+ return 0;
}
+ if (sbi->s_version == MINIX_V1)
+ inodes_per_block = MINIX_INODES_PER_BLOCK;
+ else
+ inodes_per_block = sb->s_blocksize / sizeof(struct minix2_inode);
+ return 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
+ (ino - 1) / inodes_per_block;
+}
+
+struct minix_inode *
+minix_V1_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
+{
+ int block;
+ struct minix_inode *p;
+
+ block = minix_inode_block(sb, ino);
+ if (!block)
+ return NULL;
ino--;
- block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
- ino / MINIX_INODES_PER_BLOCK;
*bh = sb_bread(sb, block);
if (!*bh) {
printk("Unable to read inode block\n");
@@ -131,19 +145,14 @@ struct minix2_inode *
minix_V2_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
{
int block;
- struct minix_sb_info *sbi = minix_sb(sb);
struct minix2_inode *p;
int minix2_inodes_per_block = sb->s_blocksize / sizeof(struct minix2_inode);
*bh = NULL;
- if (!ino || ino > sbi->s_ninodes) {
- printk("Bad inode number on dev %s: %ld is out of range\n",
- sb->s_id, (long)ino);
+ block = minix_inode_block(sb, ino);
+ if (!block)
return NULL;
- }
ino--;
- block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
- ino / minix2_inodes_per_block;
*bh = sb_bread(sb, block);
if (!*bh) {
printk("Unable to read inode block\n");
--- a/fs/minix/minix.h
+++ b/fs/minix/minix.h
@@ -47,6 +47,7 @@ void __minix_error_inode(struct inode *i
unsigned int line, const char *fmt, ...);
struct inode *minix_iget(struct super_block *, unsigned long);
+int minix_inode_block(struct super_block *sb, ino_t ino);
struct minix_inode *minix_V1_raw_inode(struct super_block *, ino_t, struct buffer_head **);
struct minix2_inode *minix_V2_raw_inode(struct super_block *, ino_t, struct buffer_head **);
struct inode *minix_new_inode(const struct inode *, umode_t);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0670/1005] minix: dont read the inode block in minix_sync_inode_metadata()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (668 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0669/1005] minix: add minix_inode_block() helper Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0671/1005] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
` (328 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit ccb8bbf93985d89f60d904386e27aad60f34dbbf upstream.
minix_sync_inode_metadata() looks the inode block up with
minix_V1_raw_inode() or minix_V2_raw_inode() which read it from disk if
it isn't cached. But a block that isn't cached is neither dirty nor
under writeback, so there's nothing to write or to wait for.
That read is also something we can't afford once inode eviction calls
->sync_inode_metadata() from reclaim. So look the block up with
sb_find_get_block_nonatomic() instead.
Cc: stable@vger.kernel.org # v7.3
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-6-91ac6c024018@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/minix/inode.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 670179173645..756bef4dc832 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -702,24 +702,24 @@ static int minix_sync_inode_metadata(struct inode *inode,
{
int err = 0;
struct buffer_head *bh;
- void *raw_inode;
+ int block;
- if (INODE_VERSION(inode) == MINIX_V1)
- raw_inode = minix_V1_raw_inode(inode->i_sb, inode->i_ino, &bh);
- else
- raw_inode = minix_V2_raw_inode(inode->i_sb, inode->i_ino, &bh);
- if (!raw_inode)
+ block = minix_inode_block(inode->i_sb, inode->i_ino);
+ if (!block)
return -EIO;
err = mmb_sync(&minix_i(inode)->i_metadata_bhs);
if (err)
- goto out;
+ return err;
+ /* A block that isn't cached is neither dirty nor under writeback. */
+ bh = sb_find_get_block_nonatomic(inode->i_sb, block);
+ if (!bh)
+ return 0;
sync_dirty_buffer(bh);
if (buffer_write_io_error(bh)) {
printk("IO error syncing minix inode [%s:%08llx]\n",
inode->i_sb->s_id, inode->i_ino);
err = -EIO;
}
-out:
brelse(bh);
return err;
}
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0671/1005] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (669 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0670/1005] minix: dont read the inode block in minix_sync_inode_metadata() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0672/1005] ntfs: check the file name against the key length of an index entry Greg Kroah-Hartman
` (327 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Menninger, Anna Schumaker
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Menninger <tmenninger@everpuredata.com>
commit 151d95a1e696979a7d54b23c96338754be2fcc1f upstream.
When processing an out-of-order OPEN stateid on an NFSv4.1 or later
mount, nfs_set_open_stateid_locked() waits for stateid updates to be
processed in order. A five-second timeout is intended to prevent
indefinite waits when preceding updates never arrive.
However, each iteration calls schedule_timeout() with a fresh
five-second timeout. An update to the shared open state can wake the
caller without satisfying its ordering check. The remaining timeout
is then discarded, and the next iteration starts another full wait.
Under sustained concurrent OPEN/CLOSE activity on the same open state,
repeated wakeups can prevent the timeout from ever expiring. Some
tasks can remain stuck in update_open_stateid() while others continue
making progress.
Compute a single deadline on entry and pass only the remaining time
to schedule_timeout(). Once the deadline expires, take the existing
timeout path rather than starting another wait. This prevents
wakeups from extending the wait indefinitely.
Observed on Linux 6.8.0 and reproduced on 7.3.0 with 96 concurrent
O_RDWR|O_TRUNC open/close loops on one NFSv4.1/TCP file (nconnect=16).
Ten workers made no progress for over 300 seconds while others ran.
With the fix, all workers resumed after transient stalls.
Fixes: c9399f21c215 ("NFSv4: Fix OPEN / CLOSE race")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1722,6 +1722,8 @@ static void nfs_set_open_stateid_locked(
{
DEFINE_WAIT(wait);
int status = 0;
+ unsigned long deadline = jiffies + 5 * HZ;
+ signed long remaining;
for (;;) {
if (nfs_stateid_is_sequential(state, stateid))
@@ -1756,7 +1758,8 @@ static void nfs_set_open_stateid_locked(
if (!fatal_signal_pending(current) &&
!nfs_current_task_exiting()) {
- if (schedule_timeout(5*HZ) == 0)
+ remaining = (long)(deadline - jiffies);
+ if (remaining <= 0 || schedule_timeout(remaining) == 0)
status = -EAGAIN;
else
status = 0;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0672/1005] ntfs: check the file name against the key length of an index entry
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (670 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0671/1005] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0673/1005] ntfs: do not read an index block outside $INDEX_ALLOCATION Greg Kroah-Hartman
` (326 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wahid Khan, Namjae Jeon
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wahid Khan <wahidzk0091@gmail.com>
commit 5e7143476219eac7cab7bdd341db68dab1649737 upstream.
ntfs_index_entry_inconsistent() checks that the file name of a
$FILE_NAME key fits in the index entry. It does not check that the name
fits in the key, which is what key_length describes. Code that works on
the key alone relies on that.
ntfs_readdir() copies key_length bytes of the key of the next entry to
resume the enumeration, and later uses the copy to search the index. If
file_name_length is larger than the key holds, the name comparison reads
past the copy:
BUG: KASAN: slab-out-of-bounds in ntfs_file_compare_values+0x2d1/0x4b0
Read of size 2 at addr ffff88800a4ef2ce by task init/1
ntfs_file_compare_values
ntfs_collate
ntfs_ie_lookup
ntfs_index_lookup
ntfs_readdir
iterate_dir
Allocated by task 1:
kmemdup_noprof
ntfs_readdir
The buggy address is located 0 bytes to the right of
allocated 78-byte region
Two bytes of an image from mkntfs are enough: in an entry whose name has
six characters (key_length 78), change file_name_length from 6 to 7, so
the key claims 80 bytes. The entry itself is 96 bytes, so the existing
check lets it pass. The next readdir of the directory reads the extra
bytes.
Check the name against key_length, and check that the key is large
enough to hold file_name_length in the first place.
Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Wahid Khan <wahidzk0091@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/index.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/fs/ntfs/index.c
+++ b/fs/ntfs/index.c
@@ -41,9 +41,11 @@ static int ntfs_index_entry_inconsistent
} else {
if (collation_rule == COLLATION_FILE_NAME) {
- if ((offsetof(struct index_entry, key.file_name.file_name) +
- ie->key.file_name.file_name_length * sizeof(__le16)) >
- le16_to_cpu(ie->length)) {
+ if (le16_to_cpu(ie->key_length) <
+ offsetof(struct file_name_attr, file_name) ||
+ (offsetof(struct file_name_attr, file_name) +
+ ie->key.file_name.file_name_length * sizeof(__le16)) >
+ le16_to_cpu(ie->key_length)) {
ntfs_error(vol->sb,
"File name overflow from index entry in inode %lld\n",
(long long)inum);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0673/1005] ntfs: do not read an index block outside $INDEX_ALLOCATION
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (671 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0672/1005] ntfs: check the file name against the key length of an index entry Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0674/1005] ntfs: open the index allocation before reading or writing an index block Greg Kroah-Hartman
` (325 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wahid Khan, Namjae Jeon
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wahid Khan <wahidzk0091@gmail.com>
commit 0ea30dd6eeabc09235d5c2cdb98ca4e0d593963f upstream.
A directory whose $INDEX_ROOT has a child node but whose
$INDEX_ALLOCATION is missing or damaged gets an empty index inode from
ntfs_read_locked_index_inode(): size 0 and not non-resident.
ntfs_lookup_inode_by_name() still follows the child node and reads a
folio from that inode while it holds the mft record lock of the
directory.
Since the resident iomap read started to take base_ni->mrec_lock, that
read waits for a lock the caller already holds:
INFO: task init:1 is blocked on a mutex likely owned by task init:1.
__mutex_lock
__ntfs_read_iomap_begin
ntfs_read_iomap_next
iomap_read_folio
ntfs_read_folio
ntfs_lookup_inode_by_name
ntfs_lookup
The task never returns, and neither does anything else that needs the
directory's mft record.
It takes one corrupted byte on an image from mkntfs: change the first
byte of the type of the $INDEX_ALLOCATION attribute header of a
directory with index blocks from 0xa0 to 0x00. The first lookup in that
directory hangs.
Check that the index inode is non-resident and that the vcn lies inside
it before every index block read, and fail with -EIO otherwise. This
also rejects a negative vcn, which was only checked on later descents.
Fixes: d9e00c457d4a ("ntfs: serialize resident iomap reads with mrec_lock")
Cc: stable@vger.kernel.org # v7.3+
Signed-off-by: Wahid Khan <wahidzk0091@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/dir.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -308,6 +308,20 @@ found_it:
ia_mapping = ia_vi->i_mapping;
descend_into_child_node:
/*
+ * The child node has to be inside $INDEX_ALLOCATION. A directory that
+ * lacks the attribute gets an empty index inode that is not
+ * non-resident, and reading a folio from it locks the mft record that
+ * is already locked here.
+ */
+ if (!NInoNonResident(NTFS_I(ia_vi)) || vcn < 0 ||
+ (u64)vcn >= (u64)i_size_read(ia_vi) >> dir_ni->itype.index.vcn_size_bits) {
+ ntfs_error(sb,
+ "Child node vcn %lld is outside $INDEX_ALLOCATION in directory inode 0x%llx.",
+ vcn, dir_ni->mft_no);
+ err = -EIO;
+ goto err_out;
+ }
+ /*
* Convert vcn to index into the index allocation attribute in units
* of PAGE_SIZE and map the page cache page, reading it from
* disk if necessary.
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0674/1005] ntfs: open the index allocation before reading or writing an index block
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (672 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0673/1005] ntfs: do not read an index block outside $INDEX_ALLOCATION Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0675/1005] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
` (324 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wahid Khan, Namjae Jeon
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wahid Khan <wahidzk0091@gmail.com>
commit bada7bbb11aaa6feba8904cf38ff833453f5b5d9 upstream.
ntfs_ib_write() and ntfs_ib_read() use icx->ia_ni without checking it.
ntfs_ir_reparent() only opens the index allocation through
ntfs_ia_add() when the root is a small index. For a root that is already
marked as a large index it calls ntfs_ib_write() directly.
The lookup does not open the index allocation either when it ends in the
root. If the last entry of the root has no child node, ia_ni is still
NULL when the root has to be moved into an index block, and the write
dereferences it:
Oops: general protection fault, KASAN: null-ptr-deref in range
[0x0000000000000128-0x000000000000012f]
RIP: 0010:ntfs_inode_attr_pwrite+0x52/0x1600
ntfs_ir_make_space
ntfs_ie_add
ntfs_index_add_filename
__ntfs_link
ntfs_link
vfs_link
A single byte of an image from mkntfs is enough. In a directory that has
one empty index block, clear INDEX_ENTRY_NODE (flags 3 -> 2) of the last
entry of the $INDEX_ROOT and link() a file into the directory.
Commit 9365c4a1357e ("ntfs: fix NULL dereference on index allocation open failure")
covers the case where ntfs_ia_open() fails in the lookup. Here it was
never tried. Open the index allocation on demand in both
helpers and fail with -EIO if that does not work.
ntfs_ia_open() also succeeds for a directory that has no
$INDEX_ALLOCATION attribute. The inode it returns is then an empty resident
stub that does not describe an index allocation, so reject that case too.
Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Wahid Khan <wahidzk0091@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/index.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
--- a/fs/ntfs/index.c
+++ b/fs/ntfs/index.c
@@ -99,12 +99,30 @@ static s64 ntfs_ib_pos_to_vcn(struct ntf
return pos >> icx->vcn_size_bits;
}
+/* Open the index allocation inode if no earlier step of the operation did. */
+static int ntfs_icx_ia_ensure(struct ntfs_index_context *icx)
+{
+ if (!icx->ia_ni) {
+ icx->ia_ni = ntfs_ia_open(icx, icx->idx_ni);
+ if (!icx->ia_ni)
+ return -EIO;
+ }
+ /* Without $INDEX_ALLOCATION the index inode is an empty resident stub. */
+ if (!NInoNonResident(icx->ia_ni))
+ return -EIO;
+ return 0;
+}
+
static int ntfs_ib_write(struct ntfs_index_context *icx, struct index_block *ib)
{
s64 ret, vcn = le64_to_cpu(ib->index_block_vcn);
ntfs_debug("vcn: %lld\n", vcn);
+ ret = ntfs_icx_ia_ensure(icx);
+ if (ret)
+ return ret;
+
ret = pre_write_mst_fixup((struct ntfs_record *)ib, icx->block_size);
if (ret)
return -EIO;
@@ -770,6 +788,10 @@ static int ntfs_ib_read(struct ntfs_inde
ntfs_debug("vcn: %lld\n", vcn);
+ ret = ntfs_icx_ia_ensure(icx);
+ if (ret)
+ return ret;
+
pos = ntfs_ib_vcn_to_pos(icx, vcn);
ret = ntfs_inode_attr_pread(VFS_I(icx->ia_ni), pos, icx->block_size, (u8 *)dst);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0675/1005] openvswitch: advance by the real header length in get_ipv6_ext_hdrs()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (673 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0674/1005] ntfs: open the index allocation before reading or writing an index block Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0676/1005] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
` (323 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Simon Horman, Aaron Conole, Eelco Chaudron, Paolo Abeni
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joas Antonio dos Santos <joasantonio108@gmail.com>
commit dbce972650ed6348e3d3856e49308aa5603e02a7 upstream.
get_ipv6_ext_hdrs() walks the IPv6 extension header chain to fill
key->ipv6.exthdrs, but advances to the next header with ipv6_optlen()
whatever the current header is. That is only right for Hop-by-Hop,
Destination Options and Routing headers:
- an Authentication Header is ((hdrlen + 2) << 2) bytes long
(ipv6_authlen()), so with hdrlen = 4 the walk skips 40 bytes instead
of 24 and reads the next "header" from the ICV and payload;
- a Fragment header is always 8 bytes, and the byte read as hdrlen is
its Reserved field, which the sender controls and receivers ignore,
so a non-zero value makes the walk skip up to 2048 bytes and miss
the headers that follow;
- in a non-first fragment nothing after the Fragment header is a
header at all, it is the middle of the fragmentable part, yet the
walk keeps parsing it as an extension header chain.
In all cases the OFPIEH12_* bits stored in key->ipv6.exthdrs depend on
bytes chosen by the sender rather than on the headers that are actually
present: payload bytes that look like another AH or a Hop-by-Hop header
add OFPIEH12_UNREP/OFPIEH12_UNSEQ, and real headers after a Fragment
header can go unreported. Flows that match on OVS_KEY_ATTR_IPV6_EXTHDRS
then classify such packets wrongly. There is no memory safety issue,
skb_header_pointer() bounds every read.
Advance by sizeof(struct frag_hdr) for Fragment headers and by
ipv6_authlen() for AH, and stop at the Fragment header if its offset is
non-zero, as ipv6_find_hdr() does.
Fixes: 28a3f0601727 ("net: openvswitch: IPv6: Add IPv6 extension header support")
Link: https://lore.kernel.org/all/178905555085.219967.6617611783437228045@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Eelco Chaudron <echaudron@ovn.org>
Link: https://patch.msgid.link/20261102-ovs-exthdrs-v2-1-21ceef6a243d@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/openvswitch/flow.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -370,11 +370,28 @@ static void get_ipv6_ext_hdrs(struct sk_
return;
}
+ if (next_type == IPPROTO_FRAGMENT) {
+ struct frag_hdr _fh, *fh;
+
+ fh = skb_header_pointer(skb, start, sizeof(_fh), &_fh);
+ if (!fh)
+ break;
+ /* Only the first fragment has the headers that follow. */
+ if (fh->frag_off & htons(IP6_OFFSET))
+ break;
+ start += sizeof(_fh);
+ next_type = fh->nexthdr;
+ continue;
+ }
+
hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr);
if (!hp)
break;
+ if (next_type == IPPROTO_AH)
+ start += ipv6_authlen(hp);
+ else
+ start += ipv6_optlen(hp);
next_type = hp->nexthdr;
- start += ipv6_optlen(hp);
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0676/1005] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (674 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0675/1005] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0677/1005] perf/hw_breakpoint: Clear stop state in hw_breakpoint_add() Greg Kroah-Hartman
` (322 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Phat Dinh, Peter Zijlstra (Intel)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phat Dinh <phatdt1116@gmail.com>
commit 59f1398140869432c7171b9a2a279ca315467c4e upstream.
perf_cgroup_switch() relies on:
/*
* cpuctx->cgrp is set when the first cgroup event enabled,
* and is cleared when the last cgroup event disabled.
*/
It computes the next task's cgroup, schedules out the CPU context and
then assigns cpuctx->cgrp unconditionally:
ctx_sched_out(&cpuctx->ctx, NULL, EVENT_ALL|EVENT_CGROUP);
/*
* must not be done before ctxswout due
* to update_cgrp_time_from_cpuctx() in
* ctx_sched_out()
*/
cpuctx->cgrp = cgrp;
However, ctx_sched_out() can disable events itself. If a cgroup event
has a pending disable from perf_event_disable_inatomic() (e.g. its
PERF_EVENT_IOC_REFRESH limit ran out) that the irq_work has not
handled yet, event_sched_out() consumes it inline:
if (event->pending_disable) {
event->pending_disable = 0;
perf_cgroup_event_disable(event, ctx);
state = PERF_EVENT_STATE_OFF;
}
If that was the last cgroup event, perf_cgroup_event_disable() clears
cpuctx->cgrp:
if (--ctx->nr_cgroups)
return;
cpuctx->cgrp = NULL;
and perf_cgroup_switch() then sets it again. cpuctx->cgrp is left
non-NULL with ctx.nr_cgroups == 0, so the NULL check in
perf_cgroup_switch() no longer catches it and the next switch trips:
WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0);
cpuctx->cgrp does not hold a reference on the cgroup. Once that cgroup
is removed, the next ctx_sched_in() dereferences the stale pointer:
BUG: KASAN: slab-use-after-free in ctx_sched_in+0xb1f/0xfa0
Read of size 8 at addr ffff8881008972d0 by task swapper/3/0
Tainted: [W]=WARN
Call Trace:
<IRQ>
ctx_sched_in+0xb1f/0xfa0
perf_event_sched_in+0x1a/0x70
ctx_resched+0x32b/0xac0
__perf_install_in_context+0x475/0xab0
remote_function+0x105/0x200
__flush_smp_call_function_queue+0x179/0x8d0
__sysvec_call_function_single+0x1b/0x1c0
sysvec_call_function_single+0x66/0x80
</IRQ>
<TASK>
asm_sysvec_call_function_single+0x1a/0x20
Only assign cpuctx->cgrp when cgroup events remain after the context
has been scheduled out, so that it stays NULL as the invariant
requires.
Fixes: e19cd0b6fa59 ("perf/core: Always set cpuctx cgrp when enable cgroup event")
Signed-off-by: Phat Dinh <phatdt1116@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261106101642.494674-1-phatdt1116@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/events/core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1072,8 +1072,13 @@ static void perf_cgroup_switch(struct ta
* must not be done before ctxswout due
* to update_cgrp_time_from_cpuctx() in
* ctx_sched_out()
+ *
+ * ctx_sched_out() can consume a pending disable and drop the last cgroup
+ * event, which clear the cpuctx->cgrp. Cgroup tracking follow active cgroup
+ * event, so do not resurrect it
*/
- cpuctx->cgrp = cgrp;
+ if (cpuctx->ctx.nr_cgroups)
+ cpuctx->cgrp = cgrp;
/*
* set cgrp before ctxsw in to allow
* perf_cgroup_set_timestamp() in ctx_sched_in()
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0677/1005] perf/hw_breakpoint: Clear stop state in hw_breakpoint_add()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (675 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0676/1005] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0678/1005] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
` (321 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paolo Bertinetti,
Peter Zijlstra (Intel)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bertinetti <paolobertinetti200f4@proton.me>
commit 6bea5e29daf123a78ae58cb5926023f4705f396f upstream.
Since commit 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage"),
__perf_event_overflow() stops the event with pmu->stop() and disables
it when the PERF_EVENT_IOC_REFRESH limit is reached. When userspace
re-arms the event with PERF_EVENT_IOC_REFRESH, the event is enabled
again and pmu->add() is called with PERF_EF_START.
hw_breakpoint_add() sets PERF_HES_STOPPED when PERF_EF_START is
missing, but never clears it. The flag set by pmu->stop() stays, and
perf_bp_event() drops every later hit, so a breakpoint re-armed this
way delivers only its first overflow.
Set the state from PERF_EF_START on every add, as perf_swevent_add()
does.
Fixes: 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage")
Assisted-by: LLM
Signed-off-by: Paolo Bertinetti <paolobertinetti200f4@proton.me>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261103130732.764081-3-paolobertinetti200f4@proton.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/events/hw_breakpoint.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -968,8 +968,7 @@ static int hw_breakpoint_event_init(stru
static int hw_breakpoint_add(struct perf_event *bp, int flags)
{
- if (!(flags & PERF_EF_START))
- bp->hw.state = PERF_HES_STOPPED;
+ bp->hw.state = (flags & PERF_EF_START) ? 0 : PERF_HES_STOPPED;
if (is_sampling_event(bp)) {
bp->hw.last_period = bp->hw.sample_period;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0678/1005] PM: runtime: Update last_busy in rpm_resume() for active devices
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (676 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0677/1005] perf/hw_breakpoint: Clear stop state in hw_breakpoint_add() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0679/1005] Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask" Greg Kroah-Hartman
` (320 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
Alan Stern
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 55b2b8af704f845e01fa2f31ee259b07641ce3a9 upstream.
Setting an autosuspend delay for a device can be expected to cause a
runtime suspend of the device after calling, say, pm_runtime_put() to
be deferred, so the time between the last successful attempt to resume
the device and its subsequent suspend is at least equal to the
autosuspend delay.
However, that expectation is only met after the device has been actually
resumed in rpm_resume() by invoking its runtime resume callback. If the
runtime PM status of the device is already "active" when rpm_resume()
runs for it, the device's last_busy timestamp is not updated which may
allow a subsequent pm_runtime_put() invocation (or similar) to suspend
it right away.
This is arguably inconsistent and confusing, so make rpm_resume() also
update the device's last_busy timestamp when it finds that the device is
already "active" and it is about to return 1 early.
Fixes: 56f487c78015 ("PM / Runtime: Update last_busy in rpm_resume")
Link: https://lore.kernel.org/linux-pm/CAJZ5v0jTX1FgeS9FCV=+V4uacSgLQBVsSPnU27ybgUGg57GUOA@mail.gmail.com/
Reported-by: Brian Norris <briannorris@chromium.org>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/13032301.O9o76ZdvQC@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/power/runtime.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -822,6 +822,12 @@ static int rpm_resume(struct device *dev
pm_runtime_deactivate_timer(dev);
if (dev->power.runtime_status == RPM_ACTIVE) {
+ /*
+ * The attempt to resume the device means that it is needed for
+ * something, so update its last_busy timestamp as in the case
+ * in which it actually resumes below.
+ */
+ pm_runtime_mark_last_busy(dev);
retval = 1;
goto out;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0679/1005] Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask"
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (677 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0678/1005] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0680/1005] power: sequencing: pcie-m2: fix use-after-free in pwrseq_pcie_m2_vregs_enable() Greg Kroah-Hartman
` (319 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dennis Chen, Rafael J. Wysocki
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dennis Chen <dechen@redhat.com>
commit a74c332aaf46270101b32a32311275d86953a2b5 upstream.
Commit 525e0064f3d8 ("powercap: intel_rapl: Expose all package CPUs in
PMU cpumask") expanded cpumask to include all CPUs in the package.
Since perf opens an event for every CPU in cpumask, the value returned
for power/energy-pkg/ is roughly scaled by the number of CPUs.
On a single-socket 72-core DMR machine the reported value is roughly
72x higher than when perf is restricted to reading from a single CPU:
$ perf stat -e power/energy-pkg/ -- sleep 1
Performance counter stats for 'system wide':
8,052.48 Joules power/energy-pkg/
1.010483558 seconds time elapsed
$ perf stat -C 5 -e power/energy-pkg/ -- sleep 1
Performance counter stats for 'CPU(s) 5':
112.15 Joules power/energy-pkg/
1.009685587 seconds time elapsed
Reverting this commit restores the expected behavior for perf.
Fixes: 525e0064f3d8 ("powercap: intel_rapl: Expose all package CPUs in PMU cpumask")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Dennis Chen <dechen@redhat.com>
Link: https://patch.msgid.link/20261106203115.237269-1-dechen@redhat.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/powercap/intel_rapl_common.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
index 70cab5f08bc6..f58649ff4f53 100644
--- a/drivers/powercap/intel_rapl_common.c
+++ b/drivers/powercap/intel_rapl_common.c
@@ -1139,21 +1139,23 @@ static struct rapl_pmu rapl_pmu;
/* PMU helpers */
-static void set_pmu_cpumask(struct rapl_package *rp, cpumask_var_t mask)
+static int get_pmu_cpu(struct rapl_package *rp)
{
int cpu;
if (!rp->has_pmu)
- return;
+ return nr_cpu_ids;
/* Only TPMI & MSR RAPL are supported for now */
if (rp->priv->type != RAPL_IF_TPMI && rp->priv->type != RAPL_IF_MSR)
- return;
+ return nr_cpu_ids;
/* TPMI/MSR RAPL uses any CPU in the package for PMU */
for_each_online_cpu(cpu)
if (topology_physical_package_id(cpu) == rp->id)
- cpumask_set_cpu(cpu, mask);
+ return cpu;
+
+ return nr_cpu_ids;
}
static bool is_rp_pmu_cpu(struct rapl_package *rp, int cpu)
@@ -1435,6 +1437,7 @@ static ssize_t cpumask_show(struct device *dev,
{
struct rapl_package *rp;
cpumask_var_t cpu_mask;
+ int cpu;
int ret;
if (!alloc_cpumask_var(&cpu_mask, GFP_KERNEL))
@@ -1446,7 +1449,9 @@ static ssize_t cpumask_show(struct device *dev,
/* Choose a cpu for each RAPL Package */
list_for_each_entry(rp, &rapl_packages, plist) {
- set_pmu_cpumask(rp, cpu_mask);
+ cpu = get_pmu_cpu(rp);
+ if (cpu < nr_cpu_ids)
+ cpumask_set_cpu(cpu, cpu_mask);
}
cpus_read_unlock();
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0680/1005] power: sequencing: pcie-m2: fix use-after-free in pwrseq_pcie_m2_vregs_enable()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (678 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0679/1005] Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask" Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0681/1005] power: sequencing: pcie-m2: fix serdev controller reference leak Greg Kroah-Hartman
` (318 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit cd5f26ed96604b18e4235052525abe6b4ba505d6 upstream.
During device teardown or on the probe error path, a concurrent consumer
access triggers a use-after-free in pwrseq_pcie_m2_vregs_enable() or
pwrseq_pcie_m2_vregs_disable() due to a lifetime inversion between
devm-managed device registration and manual resource cleanup.
The driver exposes the power sequencer using devm_pwrseq_device_register(),
meaning the device remains fully registered and accessible on the
pwrseq_bus until the driver core schedules devm_pwrseq_device_unregister()
to run after pwrseq_pcie_m2_remove() returns. However, the driver performs
manual resource teardown within pwrseq_pcie_m2_remove() and the
pwrseq_pcie_m2_probe() error path, prematurely destroying the backing
regulator array.
This creates a narrow vulnerability window where the globally visible power
sequencer is backed by freed memory. If a concurrent consumer invokes
pwrseq_enable() during this window, execution is routed to the sequencer
callback and dereferences the destroyed ctx->regs array, resulting in a
direct use-after-free and a kernel crash.
Schedule a devres action for freeing the memory used for the regulator
array to ensure it runs *after* the pwrseq provider was unregistered.
Cc: stable@vger.kernel.org
Fixes: 3f736aecbdc8 ("power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth")
Closes: https://sashiko.dev/#/bug/linux-bd17e5b1-a000-4717-b392-0ff0c2a9c376
Link: https://patch.msgid.link/20261105-pwrseq-pcie-m2-uaf-v2-1-3e1dd415af9a@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/power/sequencing/pwrseq-pcie-m2.c | 36 +++++++++++++++---------------
1 file changed, 18 insertions(+), 18 deletions(-)
--- a/drivers/power/sequencing/pwrseq-pcie-m2.c
+++ b/drivers/power/sequencing/pwrseq-pcie-m2.c
@@ -492,6 +492,14 @@ err_remove_serdev:
return ret;
}
+static void pwrseq_pcie_m2_free_regulators(void *data)
+{
+ struct pwrseq_pcie_m2_ctx *ctx = data;
+
+ regulator_bulk_free(ctx->num_vregs, ctx->regs);
+ kfree(ctx->regs);
+}
+
static int pwrseq_pcie_m2_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -522,19 +530,19 @@ static int pwrseq_pcie_m2_probe(struct p
ctx->num_vregs = ret;
+ ret = devm_add_action_or_reset(dev, pwrseq_pcie_m2_free_regulators, ctx);
+ if (ret)
+ return ret;
+
ctx->w_disable1_gpio = devm_gpiod_get_optional(dev, "w-disable1", GPIOD_OUT_HIGH);
- if (IS_ERR(ctx->w_disable1_gpio)) {
- ret = dev_err_probe(dev, PTR_ERR(ctx->w_disable1_gpio),
+ if (IS_ERR(ctx->w_disable1_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->w_disable1_gpio),
"Failed to get the W_DISABLE_1# GPIO\n");
- goto err_free_regulators;
- }
ctx->w_disable2_gpio = devm_gpiod_get_optional(dev, "w-disable2", GPIOD_OUT_HIGH);
- if (IS_ERR(ctx->w_disable2_gpio)) {
- ret = dev_err_probe(dev, PTR_ERR(ctx->w_disable2_gpio),
+ if (IS_ERR(ctx->w_disable2_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->w_disable2_gpio),
"Failed to get the W_DISABLE_2# GPIO\n");
- goto err_free_regulators;
- }
config.parent = dev;
config.owner = THIS_MODULE;
@@ -543,11 +551,9 @@ static int pwrseq_pcie_m2_probe(struct p
config.targets = ctx->pdata->targets;
ctx->pwrseq = devm_pwrseq_device_register(dev, &config);
- if (IS_ERR(ctx->pwrseq)) {
- ret = dev_err_probe(dev, PTR_ERR(ctx->pwrseq),
+ if (IS_ERR(ctx->pwrseq))
+ return dev_err_probe(dev, PTR_ERR(ctx->pwrseq),
"Failed to register the power sequencer\n");
- goto err_free_regulators;
- }
mutex_init(&ctx->list_lock);
INIT_LIST_HEAD(&ctx->pci_devices);
@@ -572,9 +578,6 @@ err_remove_serdev:
pwrseq_pcie_m2_remove_serdev(ctx, NULL);
err_destroy_mutex:
mutex_destroy(&ctx->list_lock);
-err_free_regulators:
- regulator_bulk_free(ctx->num_vregs, ctx->regs);
- kfree(ctx->regs);
return ret;
}
@@ -586,9 +589,6 @@ static void pwrseq_pcie_m2_remove(struct
bus_unregister_notifier(&pci_bus_type, &ctx->nb);
pwrseq_pcie_m2_remove_serdev(ctx, NULL);
mutex_destroy(&ctx->list_lock);
-
- regulator_bulk_free(ctx->num_vregs, ctx->regs);
- kfree(ctx->regs);
}
static const struct of_device_id pwrseq_pcie_m2_of_match[] = {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0681/1005] power: sequencing: pcie-m2: fix serdev controller reference leak
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (679 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0680/1005] power: sequencing: pcie-m2: fix use-after-free in pwrseq_pcie_m2_vregs_enable() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0682/1005] ASoC: qcom: q6asm: Reset PCM positions when preparing a stream Greg Kroah-Hartman
` (317 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit b149b12f6a52997eded725ae5deae24620dbbbff upstream.
In pwrseq_pcie_m2_create_serdev_one(), if serdev_ctrl->serdev is NULL but
pdev is already tracked in ctx->pci_devices, we return early from the
loop and skip the serdev_controller_put(), leaking the reference.
Initialize ret to 0 and jump directly to the label that ensures the
reference is released.
Cc: stable@vger.kernel.org
Closes: https://sashiko.dev/#/bug/linux-07754192-a8ad-42d6-ab1b-cd6f16bec846
Fixes: c4be520907a4 ("power: sequencing: pcie-m2: Create serdev for PCI devices present before probe")
Link: https://patch.msgid.link/20261105-pwrseq-pcie-m2-serdev-ref-leak-v1-1-e2e022ca17ec@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/power/sequencing/pwrseq-pcie-m2.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
--- a/drivers/power/sequencing/pwrseq-pcie-m2.c
+++ b/drivers/power/sequencing/pwrseq-pcie-m2.c
@@ -270,7 +270,7 @@ static int pwrseq_pcie_m2_create_serdev_
struct serdev_controller *serdev_ctrl;
struct device *dev = ctx->dev;
struct pwrseq_pci_dev *pci_dev;
- int ret;
+ int ret = 0;
struct device_node *serdev_parent __free(device_node) =
of_graph_get_remote_node(dev_of_node(ctx->dev), 3, 0);
@@ -282,16 +282,14 @@ static int pwrseq_pcie_m2_create_serdev_
return 0;
/* Bail out if the device was already attached to this controller */
- if (serdev_ctrl->serdev) {
- serdev_controller_put(serdev_ctrl);
- return 0;
- }
+ if (serdev_ctrl->serdev)
+ goto err_put_ctrl;
/* Bail out if the serdev device was already created for the PCI dev */
scoped_guard(mutex, &ctx->list_lock) {
list_for_each_entry(pci_dev, &ctx->pci_devices, list) {
if (pci_dev->pdev == pdev)
- return 0;
+ goto err_put_ctrl;
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0682/1005] ASoC: qcom: q6asm: Reset PCM positions when preparing a stream
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (680 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0681/1005] power: sequencing: pcie-m2: fix serdev controller reference leak Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0683/1005] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
` (316 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Michael McAllister, Mark Brown
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael McAllister <me@michaelmcallister.org>
commit 54e89fab723d5a374972d3f5c3e0b89ae055bd18 upstream.
Preparing an existing PCM stream closes the DSP stream and remaps its
buffers, but leaves queue_ptr, dsp_buf and hw_ptr at their previous
positions. ALSA resets appl_ptr during prepare, so q6asm_dai_ack() can
subtract a stale queue_ptr from the new appl_ptr and queue an incorrect
number of periods.
On the Motorola Moto G10, playback works after opening the PCM device,
but the first write after snd_pcm_drop() and snd_pcm_prepare() fails
with -EBUSY and "Error queuing playback buffer -16".
Reset queue_ptr in prepare, and reset the DSP buffer index and hardware
pointer when allocating the new buffer ring. This keeps the queued,
submitted and completed positions aligned with the new PCM stream.
Fixes: e386c2cf3df2 ("ASoC: qcom: q6asm-dai: schedule all available frames to avoid dsp under-runs")
Fixes: 44432315444c ("ASoC: qcom: q6asm-dai: use q6asm_get_hw_pointer")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Michael McAllister <me@michaelmcallister.org>
Link: https://patch.msgid.link/20261021204202.43738-1-me@michaelmcallister.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/qcom/qdsp6/q6asm-dai.c | 3 +++
sound/soc/qcom/qdsp6/q6asm.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c
index dc5230f13a97..77e60b13400c 100644
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -243,6 +243,9 @@ static int q6asm_dai_prepare(struct snd_soc_component *component,
prtd->state = Q6ASM_STREAM_STOPPED;
}
+ /* ALSA resets appl_ptr for every prepare, including xrun recovery. */
+ prtd->queue_ptr = 0;
+
ret = q6asm_map_memory_regions(substream->stream, prtd->audio_client,
prtd->phys,
(prtd->pcm_size / prtd->periods),
diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c
index 3f9f2448eb32..d042132caf03 100644
--- a/sound/soc/qcom/qdsp6/q6asm.c
+++ b/sound/soc/qcom/qdsp6/q6asm.c
@@ -514,6 +514,8 @@ int q6asm_map_memory_regions(unsigned int dir, struct audio_client *ac,
ac->port[dir].buf = buf;
+ ac->port[dir].dsp_buf = 0;
+ atomic_set(&ac->port[dir].hw_ptr, 0);
buf[0].phys = phys;
buf[0].size = period_sz;
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0683/1005] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (681 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0682/1005] ASoC: qcom: q6asm: Reset PCM positions when preparing a stream Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0684/1005] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
` (315 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Baoli Zhang, Peter Ujfalusi,
Mark Brown
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baoli Zhang <baoli.zhang@linux.intel.com>
commit e5c09fe3f9c8d9da33b177ee432db15b6ab46884 upstream.
sof_ipc4_widget_setup_comp_process() allocates the input and output pin
format arrays via sof_ipc4_get_audio_fmt(). When the following
sof_ipc4_widget_setup_msg() fails, e.g. because the firmware does not
provide a module matching the widget UUID, the error path jumps to the
'err' label, which frees the process struct and clears swidget->private
but skips sof_ipc4_free_audio_fmt(). The arrays are then unreachable and
are reported by kmemleak:
sof_ipc4_get_audio_fmt+0xc9/0x420 [snd_sof]
sof_ipc4_widget_setup_comp_process+0x8e/0x200 [snd_sof]
snd_sof_load_topology+0x71a/0x840 [snd_sof]
sof_pcm_probe+0x77/0x120 [snd_sof]
snd_soc_component_probe+0x21/0x60 [snd_soc_core]
...
Jump to 'free_available_fmt' instead, as the other process widget error
paths after sof_ipc4_get_audio_fmt() already do.
The other IPC4 widget setup functions (pga, mixer, src, asrc) free the
audio formats in their common error label and are not affected.
Fixes: f9efae954905 ("ASoC: SOF: ipc4-topology: Add support for base config extension")
Cc: stable@vger.kernel.org
Signed-off-by: Baoli Zhang <baoli.zhang@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20261109005604.1004362-1-baoli.zhang@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sof/ipc4-topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -1310,7 +1310,7 @@ static int sof_ipc4_widget_setup_comp_pr
ret = sof_ipc4_widget_setup_msg(swidget, &process->msg);
if (ret)
- goto err;
+ goto free_available_fmt;
/* parse process init module payload config type from module info */
fw_module = swidget->module_info;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0684/1005] Bluetooth: btusb: fix use-after-free in force_poll_sync
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (682 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0683/1005] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0685/1005] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
` (314 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bin Yu, Cheng Wen, YuanZhe Liu,
Luiz Augusto von Dentz
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
commit 868c886f45f7c10dc888b94c6993352702a84d04 upstream.
The force_poll_sync debugfs file uses the driver's struct btusb_data as
its private data. The file is created under hdev->debugfs and is removed
only when the HCI device is released, while btusb_disconnect() frees
btusb_data unconditionally. The HCI device can outlive the driver data,
for example when an HCI socket still references it, so reading or
writing the already opened file then dereferences freed memory:
BUG: KASAN: slab-use-after-free in force_poll_sync_read+0x129/0x140
Read of size 1 at addr ffff88800cfb7038
...
Freed by task ...:
kfree
btusb_disconnect
Remove the debugfs file before the private data is freed.
debugfs_remove() waits for callers that are already inside the file
operations, and any later access fails with -EIO instead of reaching the
driver, so the force_poll_sync file can no longer dereference btusb_data
after it is gone.
Fixes: 800fe5ec302e ("Bluetooth: btusb: Add support for queuing during polling interval")
Cc: stable@vger.kernel.org
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/bluetooth/btusb_main.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/drivers/bluetooth/btusb_main.c
+++ b/drivers/bluetooth/btusb_main.c
@@ -1063,6 +1063,8 @@ struct btusb_data {
int (*disconnect)(struct hci_dev *hdev);
int oob_wake_irq; /* irq for out-of-band wake-on-bt */
+
+ struct dentry *force_poll_sync_dentry;
};
static void btusb_reset(struct hci_dev *hdev)
@@ -4557,8 +4559,9 @@ static int btusb_probe(struct usb_interf
usb_set_intfdata(intf, data);
- debugfs_create_file("force_poll_sync", 0644, hdev->debugfs, data,
- &force_poll_sync_fops);
+ data->force_poll_sync_dentry =
+ debugfs_create_file("force_poll_sync", 0644, hdev->debugfs,
+ data, &force_poll_sync_fops);
return 0;
@@ -4599,6 +4602,9 @@ static void btusb_disconnect(struct usb_
if (!data)
return;
+ debugfs_remove(data->force_poll_sync_dentry);
+ data->force_poll_sync_dentry = NULL;
+
hdev = data->hdev;
usb_set_intfdata(data->intf, NULL);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0685/1005] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (683 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0684/1005] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0686/1005] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
` (313 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, YuanZhe Liu, Bartosz Golaszewski,
Luiz Augusto von Dentz
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
commit eeca795cec6d9c6c193c2c1bd0cb26cde44f9fc3 upstream.
qca_debugfs_init() creates an "ibs" directory under hdev->debugfs and
stores pointers to fields of struct qca_data in the debugfs files.
qca_close() frees qca_data without removing that directory, while
hdev->debugfs is only removed when the HCI device is released. The HCI
device can outlive the driver data, for example when an HCI socket still
references it, so reading or writing one of the ibs files then
dereferences freed memory.
Store the directory dentry in struct qca_data and remove the directory
with debugfs_remove_recursive() before qca_data is freed.
debugfs_remove() waits for callers that are already inside the file
operations, and any later access fails with -EIO instead of reaching the
debugfs helpers. This covers the two writable files as well.
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261102113654.8724-1-25031212351%40stu.xidian.edu.cn
Fixes: 0ff252c1976d ("Bluetooth: hciuart: Add support QCA chipset for UART")
Cc: stable@vger.kernel.org
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/bluetooth/hci_qca.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -161,6 +161,7 @@ struct qca_data {
struct delayed_work ctrl_memdump_timeout;
struct qca_memdump_info *qca_memdump;
unsigned long flags;
+ struct dentry *debugfs_ibs_dir;
struct completion drop_ev_comp;
wait_queue_head_t suspend_wait_q;
enum qca_memdump_states memdump_state;
@@ -665,6 +666,7 @@ static void qca_debugfs_init(struct hci_
return;
ibs_dir = debugfs_create_dir("ibs", hdev->debugfs);
+ qca->debugfs_ibs_dir = ibs_dir;
/* read only */
mode = 0444;
@@ -744,6 +746,9 @@ static int qca_close(struct hci_uart *hu
hu->priv = NULL;
+ debugfs_remove_recursive(qca->debugfs_ibs_dir);
+ qca->debugfs_ibs_dir = NULL;
+
kfree(qca);
return 0;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0686/1005] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (684 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0685/1005] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0687/1005] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
` (312 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Luiz Augusto von Dentz
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 1f2ac56137c51be0601e18a163d817e02a15913f upstream.
Reading buffered ERTM data after ACL link loss can clear local busy and
send a supervisory frame after l2cap_conn_del() has destroyed the HCI
channel, which oopses on a NULL pointer in hci_send_acl(). The socket still
owns its L2CAP channel, so its lifetime does not protect the underlying HCI
channel.
Require BT_CONNECTED before clearing local busy in recvmsg. The socket lock
already held here serializes this check and send with teardown, which
closes the socket before the HCI channel is destroyed. Continue to allow
buffered data to be read after disconnection.
AI assistance was used.
Fixes: 61aa4f5b9f43 ("Bluetooth: Use the transmit state machine for busy state changes")
Cc: stable@vger.kernel.org # needs adjustments for 5.15
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/l2cap_sock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1332,7 +1332,8 @@ static int l2cap_sock_recvmsg(struct soc
* available. This avoids resending large numbers of
* frames.
*/
- if (test_bit(CONN_LOCAL_BUSY, &pi->chan->conn_state) &&
+ if (sk->sk_state == BT_CONNECTED &&
+ test_bit(CONN_LOCAL_BUSY, &pi->chan->conn_state) &&
atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf >> 1)
l2cap_chan_busy(pi->chan, 0);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0687/1005] cgroup/cpuset: Correctly set isolated_cpus when switching partition state
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (685 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0686/1005] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0688/1005] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug Greg Kroah-Hartman
` (311 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Waiman Long, Ridong Chen, Tejun Heo
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
commit 56681bc448a80bb2473026b41c44c133766bc38d upstream.
When update_prstate() is called to switch the partition state from
root to isolated or vice versa, the whole effective_xcpus is passed to
isolated_cpus_update(). However, if there are child partitions present,
some of the effective_xcpus are dedicated to those child partitions
and their partition states will remain the same or get invalidated in
the case of child root partition with isolated parent in the latter
update_cpumasks_hier() call. In the latter case, their exclusive CPUs
will be returned to their parent.
Therefore isolated_cpus may be set incorrectly with child partitions
underneath. Fix that by excluding their exclusive CPUs in computing
the correct cpumask of exclusive CPUs used by that partition alone.
Add new test cases into test_cpuset_prs.sh to test for such cases.
Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions")
Cc: stable@vger.kernel.org # v6.8+
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Ridong Chen <ridong.chen@linux.dev>
Tested-by: Ridong Chen <ridong.chen@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup/cpuset.c | 30 ++++++++++++++++++----
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 7 +++++
2 files changed, 32 insertions(+), 5 deletions(-)
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -3151,12 +3151,32 @@ static int update_prstate(struct cpuset
cs->effective_xcpus, NULL))
err = PERR_HKEEPING;
else if (parent_prs == PRS_ISOLATED)
- err = PERR_ISOPARENT;
+ err = PERR_ISOPARENT; /* old_prs should be isolated */
- if (!err)
- isolcpus_updated = true;
- else
+ if (err) {
disable_partition = true;
+ } else {
+ struct cgroup_subsys_state *css;
+ struct cpuset *child;
+
+ /*
+ * Need to scan child partitions, if present, and
+ * exclude their effective_xcpus from cs. In the case
+ * of switching to isolated partition with child root
+ * partitions, those child partitions will be
+ * invalidated in update_cpumasks_hier().
+ */
+ isolcpus_updated = true;
+ cpumask_copy(tmpmask.new_cpus, cs->effective_xcpus);
+ rcu_read_lock();
+ cpuset_for_each_child(child, css, cs) {
+ if (!is_partition_valid(child))
+ continue;
+ cpumask_andnot(tmpmask.new_cpus, tmpmask.new_cpus,
+ child->effective_xcpus);
+ }
+ rcu_read_unlock();
+ }
} else {
/*
* Switching back to member is always allowed even if it
@@ -3193,7 +3213,7 @@ out:
if (!is_partition_valid(cs))
reset_partition_data(cs);
else if (isolcpus_updated)
- isolated_cpus_update(old_prs, new_prs, cs->effective_xcpus);
+ isolated_cpus_update(old_prs, new_prs, tmpmask.new_cpus);
spin_unlock_irq(&callback_lock);
/* Force update if partition is disabled & update effective_xcpus */
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -468,6 +468,13 @@ TEST_MATRIX=(
" C1-4:P1 C3-4:P2 . . T:C4-6 . . . 0 A1:5-6|A2:4 A1:P1|A2:P2 4"
" C1-4:P1 C1-2:P2 . . T:C4-6 . . . 0 A1:4-6|A2:4-6 A1:P1|A2:P-2 ."
+ # Switch PRS state (root <=> isolated) will properly update cpuset.cpus.isolated
+ # even if child partitions are present.
+ " C1-6:P1 C3-6:P1 C5-6:P2 . . P2 . . 0 A1:1-2|A2:3-4|A3:5-6 \
+ A1:P1|A2:P2|A3:P2 3-6"
+ " C1-6:P1 C3-6:P2 C5-6:P2 . . P1 . . 0 A1:1-2|A2:3-4|A3:5-6 \
+ A1:P1|A2:P1|A3:P2 5-6"
+
#
# old-A1 old-A2 old-A3 old-B1 new-A1 new-A2 new-A3 new-B1 fail ECPUs Pstate ISOLCPUS
# ------ ------ ------ ------ ------ ------ ------ ------ ---- ----- ------ --------
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0688/1005] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (686 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0687/1005] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0689/1005] cgroup/freezer: walk exiting tasks in the v1 freezer Greg Kroah-Hartman
` (310 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ridong Chen, Waiman Long,
Tejun Heo
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ridong Chen <chenridong@xiaomi.com>
commit acec9637e03ca54bd3c3a0c1a6ad5c6dfa07c0df upstream.
When a CPU hotplug leaves no CPU outside of the partitions for the top
cpuset, cpuset_handle_hotplug() clears subpartitions_cpus and gives all
the active CPUs back to the top cpuset. cpuset_hotplug_update_tasks()
then walks the hierarchy and invalidates the partitions, as
subpartitions_cpus is empty.
However, an invalid partition visited in the same walk may be revived
if its effective_xcpus is not empty. tasks_nocpu_error() doesn't catch
it when its CPUs are all offline but it has no task. Its CPUs are put
back into subpartitions_cpus, and the valid partitions visited after it
are no longer invalidated, as subpartitions_cpus is not empty any more.
The top cpuset is left with CPUs overlapping with these partitions.
It can be reproduced on a system with 8 CPUs:
# cd /sys/fs/cgroup
# echo +cpuset > cgroup.subtree_control
# mkdir A1 B1
# echo 1 > A1/cpuset.cpus
# echo 1 > A1/cpuset.cpus.exclusive
# echo 0,2-7 > B1/cpuset.cpus
# echo root > B1/cpuset.cpus.partition
# echo root > A1/cpuset.cpus.partition
# cat A1/cpuset.cpus.partition
root invalid (Parent unable to distribute cpu downstream)
# echo 0 > /sys/devices/system/cpu/cpu1/online
# cat A1/cpuset.cpus.partition B1/cpuset.cpus.partition
root
root
# cat cpuset.cpus.effective
0,2-7
A1 can't take CPU 1, the last CPU of the root cgroup which has tasks.
When CPU 1 is offlined, A1 is revived without any active CPU, and B1
stays valid while its CPUs are also in the effective CPUs of the root
cgroup, which triggers
WARNING: kernel/cgroup/cpuset.c:919 at rebuild_sched_domains_locked
Only revive an invalid partition in hotplug if its effective_xcpus has
an active CPU, the same as what is required to create a partition with
tasks. With that, A1 and B1 are both invalidated in the above case.
Fixes: 0c7f293efc87 ("cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2")
Cc: stable@vger.kernel.org # v6.7+
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20261114083124.1340140-1-ridong.chen%40linux.dev?part=11
Signed-off-by: Ridong Chen <chenridong@xiaomi.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup/cpuset.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -4179,10 +4179,10 @@ static void cpuset_hotplug_update_tasks(
partcmd = partcmd_invalidate;
/*
* On the other hand, an invalid partition root may be transitioned
- * back to a regular one with a non-empty effective xcpus.
+ * back to a regular one if its effective xcpus has an active CPU.
*/
else if (is_partition_valid(parent) && is_partition_invalid(cs) &&
- !cpumask_empty(cs->effective_xcpus))
+ cpumask_intersects(cs->effective_xcpus, cpu_active_mask))
partcmd = partcmd_update;
if (partcmd >= 0) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0689/1005] cgroup/freezer: walk exiting tasks in the v1 freezer
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (687 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0688/1005] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0690/1005] cgroup/freezer: Fix exiting tasks left frozen forever after rmdir Greg Kroah-Hartman
` (309 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mani Tofigh, Tao Cui, Tejun Heo
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mani Tofigh <mt4022@columbia.edu>
commit 8ab6980c70076db5f8c0c66a5fac06472b254333 upstream.
An exiting task can stay frozen after its v1 freezer cgroup is thawed.
Since commit a72f73c4dd9b ("cgroup: Don't expose dead tasks in cgroup")
the css task walk hides an exiting task once its process has no live
threads left. That count drops when another thread of the process
exits, which can happen between the freeze and the thaw walk. A pid
namespace init hits this easily since it waits freezably in
zap_pid_ns_processes() after commit 81933038f5e2 ("pid_namespace: make
zap_pid_ns_processes() freezable"):
Task A (pid ns init) Task B (A's thread) Task C
do_exit()
exit_signals()
do_exit()
zap_pid_ns_processes()
write FROZEN
/* A frozen */
/* live count 0 */
write THAWED
/* A skipped */
A then stays frozen even after SIGKILL:
[ 10.775155] task:fz-init state:D stack:28152 pid:65 tgid:65 ppid:1 task_flags:0xc0004c flags:0x00080000
[ 10.775176] Call Trace:
[ 10.775180] <TASK>
[ 10.775188] __schedule+0x10f1/0x4760
[ 10.775252] schedule+0xd7/0x2c0
[ 10.775265] zap_pid_ns_processes+0x2c7/0x5f0
[ 10.775346] do_exit+0x1bf4/0x2560
[ 10.775403] __x64_sys_exit+0x3d/0x50
[ 10.775414] x64_sys_call+0x156c/0x1570
[ 10.775425] do_syscall_64+0xfb/0x590
[ 10.775450] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 10.775529] </TASK>
Use CSS_TASK_ITER_WITH_DEAD in the three v1 freezer walks so they all
see the same tasks, as commit 60f21a264930 ("cgroup, sched_ext: Include
exiting tasks in cgroup iter") did for sched_ext. With the fix, A is
thawed and exits.
This bug was identified and confirmed with the help of a deterministic
hypervisor currently under development. The C reproducer below however
hits it within about 10s.
Fixes: a72f73c4dd9b ("cgroup: Don't expose dead tasks in cgroup")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Mani Tofigh <mt4022@columbia.edu>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Tested-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup/legacy_freezer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/kernel/cgroup/legacy_freezer.c
+++ b/kernel/cgroup/legacy_freezer.c
@@ -265,7 +265,7 @@ static void update_if_frozen(struct cgro
rcu_read_unlock();
/* are all tasks frozen? */
- css_task_iter_start(css, 0, &it);
+ css_task_iter_start(css, CSS_TASK_ITER_WITH_DEAD, &it);
while ((task = css_task_iter_next(&it))) {
if (freezing(task) && !frozen(task))
@@ -309,7 +309,7 @@ static void freeze_cgroup(struct freezer
struct css_task_iter it;
struct task_struct *task;
- css_task_iter_start(&freezer->css, 0, &it);
+ css_task_iter_start(&freezer->css, CSS_TASK_ITER_WITH_DEAD, &it);
while ((task = css_task_iter_next(&it)))
freeze_task(task);
css_task_iter_end(&it);
@@ -320,7 +320,7 @@ static void unfreeze_cgroup(struct freez
struct css_task_iter it;
struct task_struct *task;
- css_task_iter_start(&freezer->css, 0, &it);
+ css_task_iter_start(&freezer->css, CSS_TASK_ITER_WITH_DEAD, &it);
while ((task = css_task_iter_next(&it)))
__thaw_task(task);
css_task_iter_end(&it);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0690/1005] cgroup/freezer: Fix exiting tasks left frozen forever after rmdir
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (688 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0689/1005] cgroup/freezer: walk exiting tasks in the v1 freezer Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0691/1005] cgroup: arm the notify timer only while the file exists Greg Kroah-Hartman
` (308 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Tao Cui
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit e1aed52b68a361f6fc047b24a37d9ec4d928a158 upstream.
Since 93618edf7538 ("cgroup: Defer css percpu_ref kill on rmdir until cgroup
is depopulated"), rmdir succeeds once cgroup.procs is empty, but exiting
tasks hidden from it can stay in the cgroup until their final context
switch. If such a task is frozen in a v1 freezer cgroup, nothing is left to
thaw it after rmdir: freezer.state is gone with the cgroup, and a THAWED
write to an ancestor clears only CGROUP_FREEZING_PARENT.
8ab6980c7007 ("cgroup/freezer: walk exiting tasks in the v1 freezer") made
the freezer walks include exiting tasks. A FROZEN write now also freezes a
hidden task in a freezable sleep on its exit path. The fix depends on that
commit, as the thaw reaches hidden tasks through the same walk.
Since 81933038f5e2 ("pid_namespace: make zap_pid_ns_processes() freezable"),
an exiting pid namespace init sleeps that way until a parent outside the
namespace reaps a zombie in it.
Thaw the cgroup from ->css_killed(), as a THAWED write to it would. A
descendant removed earlier can still hold hidden tasks frozen through
CGROUP_FREEZING_PARENT. The thaw reaches it too, as its css stays online
until its tasks are gone.
rmdir removes freezer.state only after ->css_killed() returns, and a write
to it takes no cgroup_mutex. A FROZEN write after the thaw would freeze the
removed cgroup again, so refuse to freeze a dead cgroup.
Verified with a reproducer, including under a frozen parent, from an already
removed child and with a racing FROZEN write.
Fixes: 93618edf7538 ("cgroup: Defer css percpu_ref kill on rmdir until cgroup is depopulated")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
Tested-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup/legacy_freezer.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/kernel/cgroup/legacy_freezer.c b/kernel/cgroup/legacy_freezer.c
index bd11047f2311..1792523d119a 100644
--- a/kernel/cgroup/legacy_freezer.c
+++ b/kernel/cgroup/legacy_freezer.c
@@ -382,6 +382,24 @@ static void freezer_change_state(struct freezer *freezer, bool freeze)
* CGROUP_FREEZING_PARENT.
*/
mutex_lock(&freezer_mutex);
+
+ /*
+ * A dead cgroup must not be frozen.
+ *
+ * rmdir thaws the cgroup from freezer_css_killed(), but freezer.state
+ * stays writable until rmdir removes it a moment later. A FROZEN write
+ * in that gap would freeze the cgroup again, and nothing could thaw it
+ * after that.
+ *
+ * A freezer.state write doesn't take cgroup_mutex, but testing
+ * cgroup_is_dead() without it is safe. rmdir marks the cgroup dead
+ * before the thaw, so a write that takes freezer_mutex after the thaw
+ * sees it dead. One that takes it before the thaw may still see the
+ * cgroup alive, but the thaw then undoes its freeze.
+ */
+ if (freeze && data_race(cgroup_is_dead(freezer->css.cgroup)))
+ goto out_unlock;
+
rcu_read_lock();
css_for_each_descendant_pre(pos, &freezer->css) {
struct freezer *pos_f = css_freezer(pos);
@@ -403,10 +421,25 @@ static void freezer_change_state(struct freezer *freezer, bool freeze)
css_put(pos);
}
rcu_read_unlock();
+out_unlock:
mutex_unlock(&freezer_mutex);
cpus_read_unlock();
}
+/**
+ * freezer_css_killed - Thaw a freezer cgroup being removed
+ * @css: css being killed
+ *
+ * Exiting tasks hidden from cgroup.procs can still be in the cgroup when it is
+ * removed, and a frozen one has nothing left to thaw it once freezer.state is
+ * gone. Thaw the cgroup as a THAWED write to it would. A frozen ancestor keeps
+ * the tasks frozen through CGROUP_FREEZING_PARENT until the ancestor is thawed.
+ */
+static void freezer_css_killed(struct cgroup_subsys_state *css)
+{
+ freezer_change_state(css_freezer(css), false);
+}
+
static ssize_t freezer_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off)
{
@@ -466,6 +499,7 @@ static struct cftype files[] = {
struct cgroup_subsys freezer_cgrp_subsys = {
.css_alloc = freezer_css_alloc,
.css_online = freezer_css_online,
+ .css_killed = freezer_css_killed,
.css_offline = freezer_css_offline,
.css_free = freezer_css_free,
.attach = freezer_attach,
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0691/1005] cgroup: arm the notify timer only while the file exists
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (689 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0690/1005] cgroup/freezer: Fix exiting tasks left frozen forever after rmdir Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0692/1005] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
` (307 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mani Tofigh, Tejun Heo
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mani Tofigh <mt4022@columbia.edu>
commit fffbdad76a57eed26cff1be19f4cbb407f0b6e7c upstream.
cgroup_rm_file() clears cfile->kn under cfile->lock and then deletes the
notify timer. Since commit 4616120fca7f ("cgroup: add lockless
fast-path checks to cgroup_file_notify()"), cgroup_file_notify() checks
kn and arms the timer without that lock and can arm it right after it
was deleted:
Task A (memcg charge) Task B (subtree_control write)
cgroup_file_notify()
READ_ONCE(cfile->kn) != NULL
cgroup_rm_file()
cfile->kn = NULL
timer_delete_sync()
timer_reduce(&cfile->notify_timer)
/* timer queued again */
If the css is only hidden, showing it again runs timer_setup() on the
still queued timer and corrupts the timer wheel:
[ 14.324093] ODEBUG: init active (active state 0) object: 0000000009e526fd object type: timer_list hint: cgroup_file_notify_timer+0x0/0x10
[ 14.324123] WARNING: lib/debugobjects.c:629 at debug_print_object+0x1a4/0x3b0, CPU#1: cgnotify/64
[ 14.329806] CPU: 1 UID: 0 PID: 64 Comm: cgnotify Tainted: G W 7.3.0-17087-gd865f2677c44 #1 PREEMPT
[ 14.335109] RIP: 0010:debug_print_object+0x1ae/0x3b0
[ 14.354351] Call Trace:
[ 14.354927] <TASK>
[ 14.356650] __debug_object_init+0x203/0x3c0
[ 14.361799] timer_init_key+0x2c/0x240
[ 14.362682] cgroup_addrm_files+0x754/0xc40
[ 14.366744] css_populate_dir+0x12e/0x440
[ 14.368636] cgroup_apply_control_enable+0x2f3/0xb60
[ 14.371769] cgroup_subtree_control_write+0x740/0xc10
[ 14.376924] cgroup_file_write+0x19e/0x700
[ 14.381809] kernfs_fop_write_iter+0x337/0x510
[ 14.382818] vfs_write+0x545/0x1250
[ 14.386491] ksys_write+0xfa/0x200
[ 14.390144] do_syscall_64+0xfb/0x590
[ 14.390994] entry_SYSCALL_64_after_hwframe+0x77/0x7f
If the css is freed instead, the timer can fire on freed memory.
Arm the timer under cfile->lock after checking kn again and keep only
the kn and timer_pending() checks outside the lock. With the fix, the
timer stays idle once the file is removed.
This bug was identified and confirmed with the help of a deterministic
hypervisor currently under development. The C reproducer below however
hits it within a minute.
Fixes: 4616120fca7f ("cgroup: add lockless fast-path checks to cgroup_file_notify()")
Cc: stable@vger.kernel.org
Signed-off-by: Mani Tofigh <mt4022@columbia.edu>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup/cgroup.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -4810,19 +4810,21 @@ void cgroup_file_notify(struct cgroup_fi
if (!READ_ONCE(cfile->kn))
return;
- last = READ_ONCE(cfile->notified_at);
- next = last + CGROUP_FILE_NOTIFY_MIN_INTV;
- if (time_in_range(jiffies, last, next)) {
- timer_reduce(&cfile->notify_timer, next);
- if (timer_pending(&cfile->notify_timer))
- return;
- }
+ if (timer_pending(&cfile->notify_timer))
+ return;
spin_lock_irqsave(&cfile->lock, flags);
if (cfile->kn) {
- kn = cfile->kn;
- kernfs_get(kn);
- WRITE_ONCE(cfile->notified_at, jiffies);
+ last = cfile->notified_at;
+ next = last + CGROUP_FILE_NOTIFY_MIN_INTV;
+
+ if (time_in_range(jiffies, last, next)) {
+ timer_reduce(&cfile->notify_timer, next);
+ } else {
+ kn = cfile->kn;
+ kernfs_get(kn);
+ cfile->notified_at = jiffies;
+ }
}
spin_unlock_irqrestore(&cfile->lock, flags);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0692/1005] crypto: caam - reject overlong RSA CRT parameters
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (690 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0691/1005] cgroup: arm the notify timer only while the file exists Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0693/1005] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
` (306 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean,
Sahil Malhotra, Herbert Xu
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit 828c3b265b6df877dced3dde56ea41daa2e6181e upstream.
caam_read_rsa_crt() right-aligns dP, dQ, and qInv in buffers sized
from the corresponding prime. rsa_parse_priv_key() only bounds these
integers against n, so a malformed key can provide, for example, a
two-byte dP with a one-byte p. dstlen - nbytes then underflows and
memcpy() writes outside the allocation during set_priv_key(). KASAN
reports a slab-out-of-bounds write in caam_read_rsa_crt().
Reject empty or overlong CRT parameters after stripping leading zeros.
qInv is consumed by CAAM as a p-sized value, so size it from p rather
than q to match the DMA mapping in set_rsa_priv_f3_pdb(). Let the
top-level key cleanup handle partial form-3 allocations and return the
specific error to the caller.
Also test nbytes before dereferencing it while stripping zeros, so an
all-zero integer does not read one byte beyond its input.
Fixes: 4a651b122adb ("crypto: caam - add support for RSA key form 3")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Reviewed-by: Sahil Malhotra <sahil.malhotra@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/crypto/caam/caampkc.c | 79 +++++++++++++++++-------------------------
1 file changed, 32 insertions(+), 47 deletions(-)
--- a/drivers/crypto/caam/caampkc.c
+++ b/drivers/crypto/caam/caampkc.c
@@ -880,7 +880,7 @@ static void caam_rsa_free_key(struct caa
static void caam_rsa_drop_leading_zeros(const u8 **ptr, size_t *nbytes)
{
- while (!**ptr && *nbytes) {
+ while (*nbytes && !**ptr) {
(*ptr)++;
(*nbytes)--;
}
@@ -896,22 +896,22 @@ static void caam_rsa_drop_leading_zeros(
* @ptr : pointer to {dP, dQ, qInv} CRT member
* @nbytes: length in bytes of {dP, dQ, qInv} CRT member
* @dstlen: length in bytes of corresponding p or q prime factor
+ * @dst : pointer to the zero-padded output buffer
*/
-static u8 *caam_read_rsa_crt(const u8 *ptr, size_t nbytes, size_t dstlen)
+static int caam_read_rsa_crt(const u8 *ptr, size_t nbytes, size_t dstlen,
+ u8 **dst)
{
- u8 *dst;
-
caam_rsa_drop_leading_zeros(&ptr, &nbytes);
- if (!nbytes)
- return NULL;
+ if (!nbytes || nbytes > dstlen)
+ return -EINVAL;
- dst = kzalloc(dstlen, GFP_KERNEL);
- if (!dst)
- return NULL;
+ *dst = kzalloc(dstlen, GFP_KERNEL);
+ if (!*dst)
+ return -ENOMEM;
- memcpy(dst + (dstlen - nbytes), ptr, nbytes);
+ memcpy(*dst + (dstlen - nbytes), ptr, nbytes);
- return dst;
+ return 0;
}
/**
@@ -991,6 +991,7 @@ static int caam_rsa_set_priv_key_form(st
size_t p_sz = raw_key->p_sz;
size_t q_sz = raw_key->q_sz;
unsigned aligned_size;
+ int ret;
rsa_key->p = caam_read_raw_data(raw_key->p, &p_sz);
if (!rsa_key->p)
@@ -999,57 +1000,39 @@ static int caam_rsa_set_priv_key_form(st
rsa_key->q = caam_read_raw_data(raw_key->q, &q_sz);
if (!rsa_key->q)
- goto free_p;
+ return -ENOMEM;
rsa_key->q_sz = q_sz;
aligned_size = ALIGN(raw_key->p_sz, dma_get_cache_alignment());
rsa_key->tmp1 = kzalloc(aligned_size, GFP_KERNEL);
if (!rsa_key->tmp1)
- goto free_q;
+ return -ENOMEM;
aligned_size = ALIGN(raw_key->q_sz, dma_get_cache_alignment());
rsa_key->tmp2 = kzalloc(aligned_size, GFP_KERNEL);
if (!rsa_key->tmp2)
- goto free_tmp1;
+ return -ENOMEM;
rsa_key->priv_form = FORM2;
- rsa_key->dp = caam_read_rsa_crt(raw_key->dp, raw_key->dp_sz, p_sz);
- if (!rsa_key->dp)
- goto free_tmp2;
-
- rsa_key->dq = caam_read_rsa_crt(raw_key->dq, raw_key->dq_sz, q_sz);
- if (!rsa_key->dq)
- goto free_dp;
-
- rsa_key->qinv = caam_read_rsa_crt(raw_key->qinv, raw_key->qinv_sz,
- q_sz);
- if (!rsa_key->qinv)
- goto free_dq;
+ ret = caam_read_rsa_crt(raw_key->dp, raw_key->dp_sz, p_sz,
+ &rsa_key->dp);
+ if (ret)
+ return ret;
+
+ ret = caam_read_rsa_crt(raw_key->dq, raw_key->dq_sz, q_sz,
+ &rsa_key->dq);
+ if (ret)
+ return ret;
+
+ ret = caam_read_rsa_crt(raw_key->qinv, raw_key->qinv_sz, p_sz,
+ &rsa_key->qinv);
+ if (ret)
+ return ret;
rsa_key->priv_form = FORM3;
return 0;
-
-free_dq:
- kfree_sensitive(rsa_key->dq);
- rsa_key->dq = NULL;
-free_dp:
- kfree_sensitive(rsa_key->dp);
- rsa_key->dp = NULL;
-free_tmp2:
- kfree_sensitive(rsa_key->tmp2);
- rsa_key->tmp2 = NULL;
-free_tmp1:
- kfree_sensitive(rsa_key->tmp1);
- rsa_key->tmp1 = NULL;
-free_q:
- kfree_sensitive(rsa_key->q);
- rsa_key->q = NULL;
-free_p:
- kfree_sensitive(rsa_key->p);
- rsa_key->p = NULL;
- return -ENOMEM;
}
static int caam_rsa_set_priv_key(struct crypto_akcipher *tfm, const void *key,
@@ -1067,6 +1050,8 @@ static int caam_rsa_set_priv_key(struct
if (ret)
return ret;
+ ret = -ENOMEM;
+
/* Copy key in DMA zone */
rsa_key->d = kmemdup(raw_key.d, raw_key.d_sz, GFP_KERNEL);
if (!rsa_key->d)
@@ -1103,7 +1088,7 @@ static int caam_rsa_set_priv_key(struct
err:
caam_rsa_free_key(rsa_key);
- return -ENOMEM;
+ return ret;
}
static unsigned int caam_rsa_max_size(struct crypto_akcipher *tfm)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0693/1005] crypto: essiv - fix use-after-free in AEAD path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (691 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0692/1005] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0694/1005] dcache: let d_invalidate() wait for a d_set_mounted() in flight Greg Kroah-Hartman
` (305 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Herbert Xu
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit e9ce64dce975a14700e835003847415e29918474 upstream.
The request that ESSIV submits to its wrapped AEAD transform may
finish before crypto_aead_encrypt() or crypto_aead_decrypt() returns.
In case this happens, essiv_aead_done() calls aead_request_complete()
on the original ESSIV request, which can end up freeing the request
before essiv_aead_crypt() resumes, creating a UAF:
BUG: KASAN: slab-use-after-free in essiv_aead_crypt+0x8e6/0x950
Read of size 8 at addr ffff888102af1360 by task init/66
Check the return status before dereferencing rctx after submitting that
request. If the operation did not return -EINPROGRESS or -EBUSY, then
the request cannot have been freed yet.
Fixes: be1eb7f78aa8 ("crypto: essiv - create wrapper template for ESSIV generation")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
crypto/essiv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/crypto/essiv.c
+++ b/crypto/essiv.c
@@ -250,7 +250,7 @@ static int essiv_aead_crypt(struct aead_
err = enc ? crypto_aead_encrypt(subreq) :
crypto_aead_decrypt(subreq);
- if (rctx->assoc && err != -EINPROGRESS && err != -EBUSY)
+ if (err != -EINPROGRESS && err != -EBUSY)
kfree(rctx->assoc);
return err;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0694/1005] dcache: let d_invalidate() wait for a d_set_mounted() in flight
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (692 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0693/1005] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0695/1005] dcache: wait for a racing eviction of a secondary root Greg Kroah-Hartman
` (304 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 20a6a9ec19e522ae85f87337886b3fb47efce5f3 upstream.
d_invalidate() and d_set_mounted() are supposed to exclude each other.
Either the mount fails with -ENOENT because an ancestor of the
mountpoint was unhashed or d_invalidate() finds the mountpoint and
detaches the mount. d_invalidate() unhashes the dentry first and then
searches the subtree with d_walk() which starts out lockless and only
looks at the seqcount of rename_lock.
Since d_set_mounted() switched to read_seqlock_excl() nothing makes that
walk wait or retry:
CPU0: mount on A/M CPU1: d_invalidate(A)
d_set_mounted(M)
read_seqlock_excl(&rename_lock)
A is hashed, go on
__d_drop(A)
shrink_dcache_parent(A)
d_walk(A, find_submount)
read_seqbegin(&rename_lock)
M is not a mountpoint
need_seqretry() == false
return
M->d_flags |= DCACHE_MOUNTED
return 0
mount gets attached to M
The mount ends up below an unhashed dentry. It can't be reached anymore
and pins the subtree until its parent mount or the mount namespace goes
away. The window grows with the depth of the mountpoint. With a FUSE
directory 3000 levels deep a bind mount racing with
FUSE_NOTIFY_INVAL_ENTRY for the parent of the mountpoint survived in 151
of 200 attempts.
Before 5e317d23f6c6 the seqcount bump made the walk wait while
d_set_mounted() ran and retry under the lock when one had run in the
meantime. That was the right thing to wait for on the wrong counter:
every rename_lock reader paid for it, d_lookup(), d_path(), the ".."
step of the RCU walk.
So give d_set_mounted() a seqlock of its own. It is the only writer and
d_invalidate() is the only reader. After unhashing the dentry
d_invalidate() runs an empty read_seqbegin()/read_seqretry() section on
it. That spins while the count is odd, i.e. while a d_set_mounted() is
between its ancestor check and its flag, and goes round once more if
one started in the meantime. Nobody else retries anything. The ordering
comes from the locks both already take:
- If that d_set_mounted() saw the dentry hashed its check ran under the
dentry's d_lock before __d_drop() took it. So the count is odd by the
time d_invalidate() reads it and d_invalidate() waits.
- Once the count is even again the flag has been set under the
mountpoint's d_lock and the walk takes that lock to look at it.
A d_set_mounted() that starts after the unhash fails its ancestor check
and never touches the flag. So the only flag the walk can pick up
belongs to the one mount that saw the dentry hashed and is still in
flight, and there is at most one of those because namespace_sem
serializes mounts. Either it gets attached and detach_mounts() takes it
off after waiting for namespace_sem or it fails later on and drops the
flag again. In that case the walk goes round once more and finds
nothing. The same goes for the mountpoint that attach_recursive_mnt()
preallocates on the root of the tree it attaches. IOW, d_invalidate()
does at most one extra round, which the removed-name trap (cf. [1])
relies on.
Note that on PREEMPT_RT read_seqbegin() takes the lock instead of
spinning on a preempted d_set_mounted().
The cost is a seqlock around the ancestor walk for every new mountpoint
and two loads of a cacheline that only d_set_mounted() writes for every
d_invalidate() of a positive dentry. Walking the ancestors a second time
after setting the flag would close the race as well but doubles the
cost of d_set_mounted() with the depth of the mountpoint: about 1us at
64 levels and 75us at 4096 levels.
[1]: https://patch.msgid.link/20261028-work-mount-trap-b4-v1-0-f20d9d0730d6@kernel.org
Fixes: 5e317d23f6c6 ("d_set_mounted(): we don't need to bump seqcount component of rename_lock")
Reported-by: Josef Bacik <josef@toxicpanda.com>
Cc: stable@vger.kernel.org # v6.17+
Link: https://patch.msgid.link/20261030-work-dcache-ai-v1-1-cd6b86e0ccc7@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/dcache.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1589,21 +1589,25 @@ int path_has_submounts(const struct path
}
EXPORT_SYMBOL(path_has_submounts);
+/* odd while d_set_mounted() runs, d_invalidate() waits on it */
+static __cacheline_aligned_in_smp DEFINE_SEQLOCK(d_set_mounted_lock);
+
/*
* Called by mount code to set a mountpoint and check if the mountpoint is
* reachable (e.g. NFS can unhash a directory dentry and then the complete
* subtree can become unreachable).
*
* Only one of d_invalidate() and d_set_mounted() must succeed. For
- * this reason take rename_lock and d_lock on dentry and ancestors.
- * Likewise for dont_mount() which marks a dentry that is being removed
- * under d_lock.
+ * this reason take rename_lock, d_set_mounted_lock and d_lock on dentry
+ * and ancestors. Likewise for dont_mount() which marks a dentry that
+ * is being removed under d_lock.
*/
int d_set_mounted(struct dentry *dentry)
{
struct dentry *p;
int ret = -ENOENT;
read_seqlock_excl(&rename_lock);
+ write_seqlock(&d_set_mounted_lock);
for (p = dentry->d_parent; !IS_ROOT(p); p = p->d_parent) {
/* Need exclusion wrt. d_invalidate() */
spin_lock(&p->d_lock);
@@ -1621,8 +1625,9 @@ int d_set_mounted(struct dentry *dentry)
ret = 0;
}
}
- spin_unlock(&dentry->d_lock);
+ spin_unlock(&dentry->d_lock);
out:
+ write_sequnlock(&d_set_mounted_lock);
read_sequnlock_excl(&rename_lock);
return ret;
}
@@ -1875,6 +1880,7 @@ static enum d_walk_ret find_submount(voi
void d_invalidate(struct dentry *dentry)
{
bool had_submounts = false;
+ unsigned seq;
spin_lock(&dentry->d_lock);
if (d_unhashed(dentry)) {
spin_unlock(&dentry->d_lock);
@@ -1887,6 +1893,11 @@ void d_invalidate(struct dentry *dentry)
if (!dentry->d_inode)
return;
+ /* wait for a d_set_mounted() that saw us hashed to set its flag */
+ do {
+ seq = read_seqbegin(&d_set_mounted_lock);
+ } while (read_seqretry(&d_set_mounted_lock, seq));
+
shrink_dcache_parent(dentry);
for (;;) {
struct dentry *victim = NULL;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0695/1005] dcache: wait for a racing eviction of a secondary root
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (693 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0694/1005] dcache: let d_invalidate() wait for a d_set_mounted() in flight Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0696/1005] dcache: let umount find a disconnected ex-mountpoint Greg Kroah-Hartman
` (303 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 649918e04e0ead9bfc861aacdd2e5b39b5bdf869 upstream.
Commit e9895609cb7f ("wind ->s_roots via ->d_sib instead of ->d_hash")
keeps a secondary root on ->s_roots until dentry_unlist() so that
shrink_dcache_for_umount() can find one that another thread is evicting
and wait for it. But do_one_tree() takes every root off the list before
its dput() which breaks that:
thread A umount
dentry_kill(root), refcount is 0
lock_for_kill()
spin_trylock(->i_lock) fails
spin_unlock(->d_lock)
shrink_dcache_for_umount()
dget_dlock(root)
do_one_tree(root)
unlink_secondary_root(root)
spin_lock(->i_lock)
dput(root), refcount is 0
lock_for_kill()
trylock fails, waits
spin_lock(->d_lock)
refcount is 0 again, go on
lockref_mark_dead()
dentry_unlink_inode()
drops both locks
root is dead, give up
->s_roots is empty, done
evict_inodes()
"Busy inodes after unmount"
iput()
Thread A evicts without pinning the superblock. namespace_unlock() does
that for old mountpoints after dropping namespace_sem, and a secondary
root goes with its last child.
So only take busy roots off the list. Leave the others to
dentry_unlist() so that shrink_dcache_for_umount() finds them and waits
for an eviction in progress. A root that becomes busy after the check is
picked up again and taken off the list then.
Fixes: 78db93943210 ("dcache: keep shrink_dcache_for_umount() making progress on busy roots")
Cc: stable@vger.kernel.org # v7.2+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261030-work-dcache-ai-v1-2-cd6b86e0ccc7@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/dcache.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1816,8 +1816,13 @@ static void do_one_tree(struct dentry *d
d_walk(dentry, dentry, umount_check);
spin_lock(&dentry->d_lock);
__d_drop(dentry);
- /* A busy root survives the dput() below so don't leave it on ->s_roots. */
- if (unlikely(!hlist_unhashed(&dentry->d_sib)))
+ /*
+ * A busy root survives the dput() below so don't leave it on ->s_roots.
+ * An idle one stays until dentry_unlist() so that umount can wait for
+ * a racing eviction, see lock_for_kill().
+ */
+ if (unlikely(dentry->d_lockref.count > 1 &&
+ !hlist_unhashed(&dentry->d_sib)))
unlink_secondary_root(dentry);
spin_unlock(&dentry->d_lock);
dput(dentry);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0696/1005] dcache: let umount find a disconnected ex-mountpoint
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (694 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0695/1005] dcache: wait for a racing eviction of a secondary root Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0697/1005] ext2: add ext2_inode_block() helper Greg Kroah-Hartman
` (302 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 32e564e222b7ca3811b2acee404b73fcaf43f312 upstream.
When a mount goes away the reference to its mountpoint is dropped with
dput_to_list() and namespace_unlock() evicts the dentry after dropping
namespace_sem. Nothing pins the filesystem at that point so it can be
unmounted at the same time. That's fine as long as
shrink_dcache_for_umount() finds the dentry. It then either evicts it
itself or waits for the eviction to finish.
But it can't find a disconnected root as those are neither in the tree
nor on ->s_roots. And they can be mounted on:
fd = open_by_handle_at(mnt_fd, handle of a file with no dentry, O_PATH);
tree = open_tree(AT_FDCWD, "/tmp/x", OPEN_TREE_CLONE);
move_mount(tree, "", fd, "", MOVE_MOUNT_F_EMPTY_PATH |
MOVE_MOUNT_T_EMPTY_PATH);
close(fd);
thread A thread B
umount2("/proc/self/fd/<tree>", MNT_DETACH)
namespace_unlock()
up_write(&namespace_sem)
umount of the filesystem
shrink_dcache_for_umount()
evict_inodes()
"Busy inodes after unmount"
shrink_dentry_list()
dentry_kill()
iput() of an inode of a superblock that is gone
So put such a dentry on ->s_roots when it's put on the shrink list. From
then on it's a secondary root like any other.
This needs the previous patch. Otherwise do_one_tree() takes the dentry
off ->s_roots and umount doesn't wait for an eviction in progress.
The stable tag is narrower than the Fixes tag on purpose. Before commit
e9895609cb7f ("wind ->s_roots via ->d_sib instead of ->d_hash") umount
doesn't wait for a secondary root that is being evicted either.
Fixes: 4edbe133f851 ("make struct mountpoint bear the dentry reference to mountpoint, not struct mount")
Cc: stable@vger.kernel.org # v7.2+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261030-work-dcache-ai-v1-3-cd6b86e0ccc7@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/dcache.c | 16 ++++++++++++++--
include/linux/fs/super_types.h | 2 +-
2 files changed, 15 insertions(+), 3 deletions(-)
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -45,7 +45,8 @@
* dcache_hash_bucket lock protects:
* - the dcache hash table
* s_roots_lock protects:
- * - the s_roots list (see __d_move()/dentry_unlist()/d_obtain_root())
+ * - the s_roots list (see __d_move()/dentry_unlist()/d_obtain_root()/
+ * dput_to_list())
* dentry->d_sb->s_dentry_lru_lock protects:
* - the dcache lru lists and counters
* d_lock protects:
@@ -1101,7 +1102,18 @@ void dput_to_list(struct dentry *dentry,
{
if (likely(fast_dput(dentry)))
return;
- __move_to_shrink_list(dentry, list);
+ /*
+ * The list owner need not pin the superblock, so make a disconnected
+ * root a secondary one for shrink_dcache_for_umount() to find.
+ */
+ if (__move_to_shrink_list(dentry, list) &&
+ unlikely(IS_ROOT(dentry) && hlist_unhashed(&dentry->d_sib))) {
+ struct super_block *sb = dentry->d_sb;
+
+ spin_lock(&sb->s_roots_lock);
+ hlist_add_head(&dentry->d_sib, &sb->s_roots);
+ spin_unlock(&sb->s_roots_lock);
+ }
spin_unlock(&dentry->d_lock);
}
--- a/include/linux/fs/super_types.h
+++ b/include/linux/fs/super_types.h
@@ -173,7 +173,7 @@ struct super_block {
struct unicode_map *s_encoding;
__u16 s_encoding_flags;
#endif
- struct hlist_head s_roots; /* alternate root dentries for NFS */
+ struct hlist_head s_roots; /* alternate root dentries for NFS and ex-mountpoints */
spinlock_t s_roots_lock;
struct mount *s_mounts; /* list of mounts; _not_ for fs use */
struct block_device *s_bdev; /* can go away once we use an accessor for @s_bdev_file */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0697/1005] ext2: add ext2_inode_block() helper
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (695 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0696/1005] dcache: let umount find a disconnected ex-mountpoint Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0698/1005] ext2: dont read the inode block in ext2_sync_inode_metadata() Greg Kroah-Hartman
` (301 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 57a84ef0520b0d17e930ff15cbd13af687e6d233 upstream.
Move the lookup of the inode table block that holds an inode out of
ext2_get_inode() into a helper. ext2_sync_inode_metadata() is going to
use it to find the block without reading it from disk.
No functional changes.
Cc: stable@vger.kernel.org # v7.3
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-1-91ac6c024018@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext2/inode.c | 49 +++++++++++++++++++++++++++++++------------------
1 file changed, 31 insertions(+), 18 deletions(-)
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1264,46 +1264,59 @@ static int ext2_setsize(struct inode *in
return 0;
}
-static struct ext2_inode *ext2_get_inode(struct super_block *sb, ino_t ino,
- struct buffer_head **p)
+/*
+ * Find the inode table block that holds inode @ino and the offset of the
+ * inode in that block.
+ */
+static int ext2_inode_block(struct super_block *sb, ino_t ino,
+ unsigned long *block, unsigned long *offset)
{
- struct buffer_head * bh;
unsigned long block_group;
- unsigned long block;
- unsigned long offset;
struct ext2_group_desc * gdp;
- *p = NULL;
if ((ino != EXT2_ROOT_INO && ino < EXT2_FIRST_INO(sb)) ||
- ino > le32_to_cpu(EXT2_SB(sb)->s_es->s_inodes_count))
- goto Einval;
+ ino > le32_to_cpu(EXT2_SB(sb)->s_es->s_inodes_count)) {
+ ext2_error(sb, __func__, "bad inode number: %lu",
+ (unsigned long) ino);
+ return -EINVAL;
+ }
block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb);
gdp = ext2_get_group_desc(sb, block_group, NULL);
if (!gdp)
- goto Egdp;
+ return -EIO;
/*
* Figure out the offset within the block group inode table
*/
- offset = ((ino - 1) % EXT2_INODES_PER_GROUP(sb)) * EXT2_INODE_SIZE(sb);
- block = le32_to_cpu(gdp->bg_inode_table) +
- (offset >> EXT2_BLOCK_SIZE_BITS(sb));
+ *offset = ((ino - 1) % EXT2_INODES_PER_GROUP(sb)) * EXT2_INODE_SIZE(sb);
+ *block = le32_to_cpu(gdp->bg_inode_table) +
+ (*offset >> EXT2_BLOCK_SIZE_BITS(sb));
+ *offset &= (EXT2_BLOCK_SIZE(sb) - 1);
+ return 0;
+}
+
+static struct ext2_inode *ext2_get_inode(struct super_block *sb, ino_t ino,
+ struct buffer_head **p)
+{
+ struct buffer_head *bh;
+ unsigned long block;
+ unsigned long offset;
+ int err;
+
+ *p = NULL;
+ err = ext2_inode_block(sb, ino, &block, &offset);
+ if (err)
+ return ERR_PTR(err);
if (!(bh = sb_bread(sb, block)))
goto Eio;
*p = bh;
- offset &= (EXT2_BLOCK_SIZE(sb) - 1);
return (struct ext2_inode *) (bh->b_data + offset);
-Einval:
- ext2_error(sb, "ext2_get_inode", "bad inode number: %lu",
- (unsigned long) ino);
- return ERR_PTR(-EINVAL);
Eio:
ext2_error(sb, "ext2_get_inode",
"unable to read inode block - inode=%lu, block=%lu",
(unsigned long) ino, block);
-Egdp:
return ERR_PTR(-EIO);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0698/1005] ext2: dont read the inode block in ext2_sync_inode_metadata()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (696 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0697/1005] ext2: add ext2_inode_block() helper Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0699/1005] ext4: use sb_find_get_block_nonatomic() in ext4_get_inode_loc_noio() Greg Kroah-Hartman
` (300 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit c2e595a57aba6aa166053776969f31cc510b3e71 upstream.
ext2_sync_inode_metadata() looks the inode block up with
ext2_get_inode() which reads it from disk if it isn't cached. But a
block that isn't cached is neither dirty nor under writeback, so there's
nothing to write or to wait for.
That read is also something we can't afford once inode eviction calls
->sync_inode_metadata() from reclaim. So look the block up with
sb_find_get_block_nonatomic() instead, the way fat_sync_inode_metadata()
already does.
Cc: stable@vger.kernel.org # v7.3
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-2-91ac6c024018@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext2/inode.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1578,19 +1578,22 @@ int ext2_write_inode(struct inode *inode
int ext2_sync_inode_metadata(struct inode *inode, struct writeback_control *wbc)
{
struct buffer_head *bh;
- struct ext2_inode *raw_inode = ext2_get_inode(inode->i_sb, inode->i_ino,
- &bh);
+ unsigned long block, offset;
int err = 0;
- if (IS_ERR(raw_inode))
+ if (ext2_inode_block(inode->i_sb, inode->i_ino, &block, &offset))
return -EIO;
err = mmb_sync(&EXT2_I(inode)->i_metadata_bhs);
if (err) {
ext2_error(inode->i_sb, __func__,
"Error syncing inode metadata ino=%lu\n",
(unsigned long)inode->i_ino);
- goto out;
+ return err;
}
+ /* A block that isn't cached is neither dirty nor under writeback. */
+ bh = sb_find_get_block_nonatomic(inode->i_sb, block);
+ if (!bh)
+ return 0;
sync_dirty_buffer(bh);
if (buffer_write_io_error(bh)) {
ext2_error(inode->i_sb, __func__,
@@ -1598,7 +1601,6 @@ int ext2_sync_inode_metadata(struct inod
(unsigned long)inode->i_ino);
err = -EIO;
}
-out:
brelse(bh);
return err;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0699/1005] ext4: use sb_find_get_block_nonatomic() in ext4_get_inode_loc_noio()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (697 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0698/1005] ext2: dont read the inode block in ext2_sync_inode_metadata() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0700/1005] ext4: dont read the inode block in ext4_sync_inode_metadata() Greg Kroah-Hartman
` (299 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit d25c14b2d79e4e8292b19041efd1aae4057bf383 upstream.
ext4_get_inode_loc_noio() looks the inode table block up with
sb_find_get_block(). That's the atomic lookup. It serializes against
try_to_free_buffers() with i_private_lock instead of the folio lock and
gives up if the folio is being migrated. So it can report the block as
not cached while it is.
For ext4_fc_snapshot_inode() that only means falling back to a full
commit. But ext4_sync_inode_metadata() is going to use
ext4_get_inode_loc_noio() to find the inode block that fsync() has to
write out and there a dirty block must not be skipped.
ext4_fc_snapshot_inode() is the only caller and it can sleep. It runs
under jbd2_journal_lock_updates() and allocates the snapshot with
GFP_NOFS. So use sb_find_get_block_nonatomic() which takes the folio
lock and waits for the migration instead.
Suggested-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org # v7.3
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-3-91ac6c024018@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/inode.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -5060,7 +5060,8 @@ int ext4_get_inode_loc(struct inode *ino
/*
* ext4_get_inode_loc_noio() is a best-effort variant of ext4_get_inode_loc().
* It looks up the inode table block in the buffer cache and returns -EAGAIN if
- * the block is not present or not uptodate, without starting any I/O.
+ * the block is not present or not uptodate, without starting any I/O. It may
+ * sleep on the folio lock of the block.
*/
int ext4_get_inode_loc_noio(struct inode *inode, struct ext4_iloc *iloc)
{
@@ -5096,7 +5097,7 @@ int ext4_get_inode_loc_noio(struct inode
}
block += inode_offset / inodes_per_block;
- bh = sb_find_get_block(sb, block);
+ bh = sb_find_get_block_nonatomic(sb, block);
if (!bh)
return -EAGAIN;
if (!ext4_buffer_uptodate(bh)) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0700/1005] ext4: dont read the inode block in ext4_sync_inode_metadata()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (698 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0699/1005] ext4: use sb_find_get_block_nonatomic() in ext4_get_inode_loc_noio() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0701/1005] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
` (298 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 2ca2e88b106175c1037939de52cb28e4cb545b9e upstream.
Without a journal ext4_sync_inode_metadata() looks the inode table
block up with __ext4_get_inode_loc_noinmem() which reads it from disk,
with readahead of the inode table on top, if it isn't cached. But a
block that isn't cached is neither dirty nor under writeback, so there's
nothing to write or to wait for.
That read is also something we can't afford once inode eviction calls
->sync_inode_metadata() from reclaim. So look the block up with
ext4_get_inode_loc_noio() instead and treat -EAGAIN as nothing to do.
Note that ext4_get_inode_loc_noio() also returns -EAGAIN for a block
that isn't uptodate. Such a block is being read or failed to be read
and can't be dirty either. A block whose write failed still counts as
uptodate for ext4_buffer_uptodate() so the write error still gets
reported.
Suggested-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org # v7.3
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-4-91ac6c024018@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/inode.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -5922,22 +5922,24 @@ int ext4_sync_inode_metadata(struct inod
if (WARN_ON_ONCE(EXT4_SB(inode->i_sb)->s_journal))
return -EFSCORRUPTED;
- err = __ext4_get_inode_loc_noinmem(inode, &iloc);
- if (err)
- return err;
mmb = READ_ONCE(EXT4_I(inode)->i_metadata_bhs);
if (mmb) {
err = mmb_sync(mmb);
if (err)
- goto out;
+ return err;
}
+ /* A block that isn't cached is neither dirty nor under writeback. */
+ err = ext4_get_inode_loc_noio(inode, &iloc);
+ if (err == -EAGAIN)
+ return 0;
+ if (err)
+ return err;
sync_dirty_buffer(iloc.bh);
if (buffer_write_io_error(iloc.bh)) {
ext4_error_inode_block(inode, iloc.bh->b_blocknr, EIO,
"IO error syncing inode");
err = -EIO;
}
-out:
brelse(iloc.bh);
return err;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0701/1005] fs/adfs: bound directory entry name length in adfs_fplus_getnext()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (699 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0700/1005] ext4: dont read the inode block in ext4_sync_inode_metadata() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0702/1005] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
` (297 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyungjung Joo, HyeongJun An,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
commit ebf5025b0d989f95542fc9da899b7de2fec499f2 upstream.
adfs_fplus_getnext() reads the per-entry name length bigdirobnamelen
straight from the on-disk big directory and passes it to
adfs_dir_copyfrom() as the copy length into obj->name[], a fixed
ADFS_MAX_NAME_LEN (260) byte buffer. adfs_dir_copyfrom() only bounds
the copy against the number of directory buffers, not the size of the
destination, so a crafted image with bigdirobnamelen larger than the
buffer overflows the stack-allocated object_info::name that
adfs_fplus_iterate() passes in.
adfs_object_fixup() may additionally append a four byte ",xyz" filetype
suffix, so the accepted length must also leave room for that.
The old-style directory parser (dir_f.c) already clamps names to
ADFS_F_NAME_LEN, and adfs_fplus_validate_header() validates the header
name fields, but the per-entry name length in the big directory format
was never checked. Reject over-long entries, using -EIO as elsewhere
in this file for a corrupt big directory.
Reported-by: Hyungjung Joo <jhj140711@gmail.com>
Closes: https://lore.kernel.org/all/CAP_j_b9BqyQrk3D5nj6RSa=eGcs2HkRYsWc3WdXeXp9O3=z4nQ@mail.gmail.com/
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20260715115231.1585166-1-sammiee5311@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/adfs/dir_fplus.c | 2 ++
1 file changed, 2 insertions(+)
--- a/fs/adfs/dir_fplus.c
+++ b/fs/adfs/dir_fplus.c
@@ -192,6 +192,8 @@ adfs_fplus_getnext(struct adfs_dir *dir,
obj->indaddr = le32_to_cpu(bde.bigdirindaddr);
obj->attr = le32_to_cpu(bde.bigdirattr);
obj->name_len = le32_to_cpu(bde.bigdirobnamelen);
+ if (obj->name_len > ADFS_MAX_NAME_LEN - 4) /* leave room for ,xyz suffix */
+ return -EIO;
offset = adfs_fplus_offset(h, le32_to_cpu(h->bigdirentries));
offset += le32_to_cpu(bde.bigdirobnameptr);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0702/1005] fs/proc: fix the write length returned by proc_sys_call_handler()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (700 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 7.3 0701/1005] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0703/1005] fs/splice: clamp an over-reported write_iter result Greg Kroah-Hartman
` (296 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cheng Yongkang,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
commit fbdc020ee1b82079102e493aaa7200de5f497a38 upstream.
proc_sys_call_handler() reads the write length from iov_iter_count() and
copies that many bytes from the iterator into kbuf. A cgroup/sysctl BPF
program can replace the new value through bpf_sysctl_set_new_value() and
update count to the length of the replacement value. The handler then
returns that adjusted count as the number of bytes written, even though
the iterator originally held a different number of bytes.
If the replacement value is longer than the original input, ->write_iter()
reports more bytes than the iterator held. splice(2) passes that value to
iter_file_splice_write(), which subtracts it from the pipe length and
walks past the pipe head:
Splice Exceeded! ret=7 tot=1 left=0
Oops: general protection fault
RIP: 0010:iter_file_splice_write+0xb6f/0x1170
The write path consumes at most the original iterator length in
copy_from_iter_full() before the BPF hook runs. Return the smaller of the
adjusted and original counts on the write path, so an expanded BPF value
cannot exceed the iterator while a handler that reports a shorter parsed
length still produces a short write. The read path keeps using the
adjusted count for copy_to_iter().
Fixes: 4e63acdff864 ("bpf: Introduce bpf_sysctl_{get,set}_new_value helpers")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/179328314073.648427.7892850166511253762@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/proc/proc_sysctl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -557,6 +557,8 @@ static ssize_t proc_sys_call_handler(str
struct ctl_table_header *head = grab_header(inode);
const struct ctl_table *table = PROC_I(inode)->sysctl_entry;
size_t count = iov_iter_count(iter);
+ /* ->write_iter() must never report more than the iterator held */
+ size_t orig_count = count;
char *kbuf;
ssize_t error;
@@ -607,7 +609,8 @@ static ssize_t proc_sys_call_handler(str
goto out_free_buf;
}
- error = count;
+ /* the write path consumed at most the original iterator length */
+ error = write ? min(count, orig_count) : count;
out_free_buf:
kvfree(kbuf);
out:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0703/1005] fs/splice: clamp an over-reported write_iter result
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (701 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0702/1005] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0704/1005] fs: dont strand I_METADATA_WRITEBACK inodes outside the LRU Greg Kroah-Hartman
` (295 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cheng Yongkang,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
commit 2d956723e82cddae8ff8e9da99a666217b02065f upstream.
iter_file_splice_write() builds a bvec iterator of at most
sd.total_len - left bytes and passes it to ->write_iter(). It then
subtracts the returned length from sd.total_len and walks the pipe
buffers by that length. A ->write_iter() implementation that reports
more bytes than the iterator held makes sd.total_len underflow and the
dismissal loop advance pipe->tail past pipe->head, releasing a zeroed
pipe buffer:
Splice Exceeded! ret=7 tot=1 left=0
Oops: general protection fault
RIP: 0010:iter_file_splice_write+0xb6f/0x1170
Commit a3de58b12ce0 ("netfs: Fix unbuffered write error handling")
added the warning for this condition but only reports it. Clamp the
return value to the size of the iterator that was actually handed to
->write_iter(), so the pipe accounting stays consistent even when a
producer violates the iterator contract.
Fixes: 8d0207652cbe ("->splice_write() via ->write_iter()")
Cc: stable@vger.kernel.org
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
Link: https://patch.msgid.link/179328314072.648427.13388575162083843840@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/splice.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -737,9 +737,12 @@ iter_file_splice_write(struct pipe_inode
sd.pos = kiocb.ki_pos;
if (ret <= 0)
break;
- WARN_ONCE(ret > sd.total_len - left,
- "Splice Exceeded! ret=%zd tot=%zu left=%zu\n",
- ret, sd.total_len, left);
+ if (unlikely(ret > sd.total_len - left)) {
+ WARN_ONCE(1,
+ "Splice Exceeded! ret=%zd tot=%zu left=%zu\n",
+ ret, sd.total_len, left);
+ ret = sd.total_len - left;
+ }
sd.num_spliced += ret;
sd.total_len -= ret;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0704/1005] fs: dont strand I_METADATA_WRITEBACK inodes outside the LRU
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (702 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0703/1005] fs/splice: clamp an over-reported write_iter result Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0705/1005] arm64/gcs: Ignore attempts to change GCS mode during signal return Greg Kroah-Hartman
` (294 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Jan Kara,
Christian Brauner (Amutable)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 9b4b26d110f32008134750f82c98e621f2e4758f upstream.
Since commit c474bc56b6d1 ("fs: Provide way for filesystem to wait for
metadata writeback") ext2, ext4 without a journal, fat, udf and minix
set I_METADATA_WRITEBACK on an inode whose metadata was copied into a
buffer that might not have reached the disk yet. Only data integrity
writeback, i.e. fsync() and friends, clears it again. The flusher and
sync(2) leave it alone.
inode_lru_isolate() treats every state bit other than I_REFERENCED as a
reason not to reclaim the inode right now. It takes the inode off the
LRU and relies on iput(), writeback completion or the removal of the
last page from the page cache to put it back once the reason is gone.
But I_METADATA_WRITEBACK doesn't go away on its own. iput() puts the
inode back on the LRU with the bit still set and the next scan takes it
off again. So neither memory pressure nor drop_caches can free these
inodes. Only fsync() and friends or unmounting the filesystem get rid
of them.
On ext4 without a journal ext4_mark_iloc_dirty() sets the bit on every
ext4_mark_inode_dirty(), so even an atime update is enough. An
unprivileged user creating or touching lots of files grows the inode
cache without bound until the OOM killer comes along.
The inode can't just be thrown away though. An fsync() after the inode
was read back in wouldn't know that its metadata still has to be
written out. So let the shrinker reclaim inodes with
I_METADATA_WRITEBACK like any other clean inode and make evict() write
out what the bit tracks unless the inode is being deleted. Since the
previous patch the bit covers the tracked metadata buffers as well, and
since the lookup patches ->sync_inode_metadata() doesn't read anything
from disk for that. It writes and waits for whatever is still dirty or
under writeback. The mmb_sync() calls in ->evict_inode() are redundant
with that and the following patches drop them.
Handing these inodes to a work item that syncs them and puts them back
on the LRU would work too. But that's a second inode reclaim offload
mechanism next to the deferred inode reclaim that is being worked on,
and it needs a reference on the inode which leaks into remount, freeze
and umount.
For stable this needs the previous patches as well. Without the lookup
changes evict() ends up reading inode blocks from disk with
__GFP_NOFAIL allocations from reclaim. v7.3 also still has bfs which
sets I_METADATA_WRITEBACK too and reads the inode block in
bfs_sync_inode_metadata(), so the backport needs the cache-only lookup
for bfs as well.
Fixes: c474bc56b6d1 ("fs: Provide way for filesystem to wait for metadata writeback")
Cc: stable@vger.kernel.org # v7.3; see patch description
Reported-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-9-91ac6c024018@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/inode.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/fs/inode.c b/fs/inode.c
index 9cbcb0de7dfc..de207f2f95a9 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -817,6 +817,14 @@ static void evict(struct inode *inode)
inode_wait_for_writeback(inode);
spin_unlock(&inode->i_lock);
+ /*
+ * fsync() can't find what I_METADATA_WRITEBACK tracks anymore once the
+ * inode is gone, so write it out unless the inode is being deleted.
+ */
+ if (inode->i_nlink &&
+ (inode_state_read_once(inode) & I_METADATA_WRITEBACK))
+ sync_inode_metadata(inode, 1);
+
if (op->evict_inode) {
op->evict_inode(inode);
} else {
@@ -952,9 +960,12 @@ static enum lru_status inode_lru_isolate(struct list_head *item,
* they're already on the LRU, and this can make them
* unreclaimable for a while. Remove them lazily here; iput,
* sync, or the last page cache deletion will requeue them.
+ * Nothing requeues them for I_METADATA_WRITEBACK, evict() writes
+ * that out instead.
*/
if (icount_read(inode) ||
- (inode_state_read(inode) & ~I_REFERENCED) ||
+ (inode_state_read(inode) &
+ ~(I_REFERENCED | I_METADATA_WRITEBACK)) ||
!mapping_shrinkable(&inode->i_data)) {
list_lru_isolate(lru, &inode->i_lru);
spin_unlock(&inode->i_lock);
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0705/1005] arm64/gcs: Ignore attempts to change GCS mode during signal return
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (703 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0704/1005] fs: dont strand I_METADATA_WRITEBACK inodes outside the LRU Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0706/1005] arm64: errata: Extend the workaround for broken AMEVCNTR01 counter Greg Kroah-Hartman
` (293 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Catalin Marinas, Mark Brown
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <broonie@kernel.org>
commit d395db3dcd4c590d26a2f3d581d8d5b7ddbfa478 upstream.
If userspace tries to update the GCS mode as part of signal return then
we update the thread state but don't update GCSCRE0_EL1, meaning the
change does not take effect. We may also get issues for other tasks on
context switch since we suppress writes of the register if the two tasks
have the same mode.
Since no currently known userspace tries to use this functionality close
this by ignoring any attempt to change the mode through signal return.
The GCS mode for the current thread can be changed using the prctl()
interface and will be preserved on signal return, allowing updates to
the mode from the signal handler.
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/as-8IqsbMbOBo5Oq@arm.com
Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 16f47bb9ac8a ("arm64/signal: Expose GCS state in signal frames")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/arch/arm64/gcs.rst | 13 ++++---------
arch/arm64/kernel/signal.c | 22 +---------------------
2 files changed, 5 insertions(+), 30 deletions(-)
--- a/Documentation/arch/arm64/gcs.rst
+++ b/Documentation/arch/arm64/gcs.rst
@@ -179,9 +179,8 @@ intended to be exhaustive.
When returning from a signal handler:
-* If there is a gcs_context record in the signal frame then the GCS flags
- and GCSPR_EL0 will be restored from that context prior to further
- validation.
+* If there is a gcs_context record in the signal frame then GCSPR_EL0
+ will be restored from that context prior to further validation.
* If there is no gcs_context record in the signal frame then the GCS
configuration will be unchanged.
@@ -190,12 +189,8 @@ When returning from a signal handler:
point to a valid GCS signal cap record, this will be popped from the
GCS prior to signal return.
-* If the GCS configuration is locked when returning from a signal then any
- attempt to change the GCS configuration will be treated as an error. This
- is true even if GCS was not enabled prior to signal entry.
-
-* GCS may be disabled via signal return but any attempt to enable GCS via
- signal return will be rejected.
+* The features_enabled in the signal return context will be ignored; any
+ changes made using the prctl() in the signal handler will be preserved.
6. ptrace extensions
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -741,36 +741,16 @@ static int preserve_gcs_context(struct g
static int restore_gcs_context(struct user_ctxs *user)
{
- u64 gcspr, enabled;
+ u64 gcspr;
int err = 0;
if (user->gcs_size != sizeof(*user->gcs))
return -EINVAL;
__get_user_error(gcspr, &user->gcs->gcspr, err);
- __get_user_error(enabled, &user->gcs->features_enabled, err);
if (err)
return err;
- /* Don't allow unknown modes */
- if (enabled & ~PR_SHADOW_STACK_SUPPORTED_STATUS_MASK)
- return -EINVAL;
-
- err = gcs_check_locked(current, enabled);
- if (err != 0)
- return err;
-
- /* Don't allow enabling */
- if (!task_gcs_el0_enabled(current) &&
- (enabled & PR_SHADOW_STACK_ENABLE))
- return -EINVAL;
-
- /* If we are disabling disable everything */
- if (!(enabled & PR_SHADOW_STACK_ENABLE))
- enabled = 0;
-
- current->thread.gcs_el0_mode = enabled;
-
/*
* We let userspace set GCSPR_EL0 to anything here, we will
* validate later in gcs_restore_signal().
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0706/1005] arm64: errata: Extend the workaround for broken AMEVCNTR01 counter
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (704 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0705/1005] arm64/gcs: Ignore attempts to change GCS mode during signal return Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0707/1005] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
` (292 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Beata Michalska, Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beata Michalska <beata.michalska@arm.com>
commit 139a9b7d5a07a570d5f636db02105025ece99e16 upstream.
The erratum causing significant inaccuracies in the AMU CNT_CYCLES
counter due to WFI/WFE has been identified in additional
microarchitectures.
Extend the existing workaround to cover these implementations,
which are affected by the following errata:
- ARM Cortex-A725 erratum 3821522 (SDEN-2832921)
- ARM Cortex-A720 erratum 4689339 (SDEN-2439421)
- ARM Cortex-A720AE erratum 4689340 (SDEN-3090091)
- ARM Neoverse N3 erratum 4689341 (SDEN-3050973)
- ARM C1-Pro erratum 4689344 (SDEN-3273080)
Cc: <stable@vger.kernel.org>
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/arch/arm64/silicon-errata.rst | 8 ++++++++
arch/arm64/Kconfig | 12 +++++++++---
arch/arm64/kernel/cpu_errata.c | 8 ++++++++
3 files changed, 25 insertions(+), 3 deletions(-)
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -172,6 +172,10 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-A720 | #4689339 | ARM64_ERRATUM_3821522 |
++----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-A720AE | #4689340 | ARM64_ERRATUM_3821522 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A725 | #3456106 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A725 | #3821522 | ARM64_ERRATUM_3821522 |
@@ -230,6 +234,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-N3 | #3456111 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Neoverse-N3 | #4689341 | ARM64_ERRATUM_3821522 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V1 | #1619801 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 |
@@ -254,6 +260,8 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | C1-Pro | #4193714 | ARM64_ERRATUM_4193714 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | C1-Pro | #4689344 | ARM64_ERRATUM_3821522 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | C1-Ultra | #3683289 | N/A |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | C1-Ultra | #4193780 | ARM64_ERRATUM_4118414 |
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1083,14 +1083,20 @@ config ARM64_ERRATUM_2645198
If unsure, say Y.
config ARM64_ERRATUM_3821522
- bool "Cortex-A725: 3821522: workaround for possible CNT_CYCLES increment error due to WFE/WFI"
+ bool "Cortex-*/Neoverse-*/C1-*: workaround for possible CNT_CYCLES increment error due to WFE/WFI"
depends on ARM64_AMU_EXTN
select ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT
default y
help
- This option adds the workaround for ARM Cortex-A725 erratum 3821522.
+ This option adds the workaround for the following errata:
- On affected A725 cores, the CNT_CYCLES event may incur a significant
+ * ARM Cortex-A725 erratum 3821522
+ * ARM Cortex-A720 erratum 4689339
+ * ARM Cortex-A720AE erratum 4689340
+ * ARM Neoverse N3 erratum 4689341
+ * ARM C1-Pro erratum 4689344
+
+ On affected cores, the CNT_CYCLES event may incur a significant
increment error when entering and subsequently exiting WFx.
As a result, the CNT_CYCLES may diverge from the system counter
frequency at which it is expected to increment.
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -391,8 +391,16 @@ static const struct midr_range workaroun
MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1),
#endif
#ifdef CONFIG_ARM64_ERRATUM_3821522
+ /* Cortex-A720 r0p0 - r0p2 */
+ MIDR_RANGE(MIDR_CORTEX_A720, 0, 0, 0, 2),
+ /* Cortex-A720AE r0p0 - r0p1 */
+ MIDR_RANGE(MIDR_CORTEX_A720AE, 0, 0, 0, 1),
/* Cortex-A725 r0p0 - r0p2 */
MIDR_RANGE(MIDR_CORTEX_A725, 0, 0, 0, 2),
+ /* Neoverse N3 r0p0 - r0p1 */
+ MIDR_RANGE(MIDR_NEOVERSE_N3, 0, 0, 0, 1),
+ /* C1-Pro r0p0 - r1p3 */
+ MIDR_RANGE(MIDR_C1_PRO, 0, 0, 1, 3),
#endif
{}
};
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0707/1005] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (705 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0706/1005] arm64: errata: Extend the workaround for broken AMEVCNTR01 counter Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0708/1005] arm64: hugetlb: Prevent write fault livelocks on stale TLB entries Greg Kroah-Hartman
` (291 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Beata Michalska, Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beata Michalska <beata.michalska@arm.com>
commit be777145858218f591b4d9d19f3d40d3ecea9de3 upstream.
On Cortex-A715 (erratum 2738462) and Cortex-A720 (erratum 2738461),
the AMEVCNTR00 counter may continue incrementing while the core
remains in WFE with the clocks being enabled. The resulting core
cycle count may become unreliable.
Add a workaround that effectively treats the AMU counter
as unavailable.
Cc: <stable@vger.kernel.org>
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/arch/arm64/silicon-errata.rst | 4 +++
arch/arm64/Kconfig | 32 ++++++++++++++++++++++++++++
arch/arm64/kernel/cpu_errata.c | 20 +++++++++++++++++
arch/arm64/kernel/cpufeature.c | 3 +-
arch/arm64/kernel/topology.c | 3 +-
arch/arm64/tools/cpucaps | 1
6 files changed, 61 insertions(+), 2 deletions(-)
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -168,8 +168,12 @@ stable kernels.
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A715 | #2645198 | ARM64_ERRATUM_2645198 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-A715 | #2738462 | ARM64_ERRATUM_2738461 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A715 | #3456084 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
+| ARM | Cortex-A720 | #2738461 | ARM64_ERRATUM_2738461 |
++----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A720 | #3456091 | ARM64_ERRATUM_3194386 |
+----------------+-----------------+-----------------+-----------------------------+
| ARM | Cortex-A720 | #4689339 | ARM64_ERRATUM_3821522 |
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1048,6 +1048,38 @@ config ARM64_WORKAROUND_BROKEN_AMU_CONST
# making it unreliable. As a result, AMU users should treat it as
# unavailable rather than relying on misleading counter values.
+config ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+ bool
+ # Targeting errata affecting AMEVCNTR00, the AMU core cycle counter.
+ # On affected CPUs the counter may continue incrementing while core
+ # remains in WFE with the clocks enabled.
+ # This may lead to readings of said counter being unreliable.
+ # How much though depends on the sampling intervals.
+
+config ARM64_ERRATUM_2738461
+ bool "Cortex-A715/Cortex-A720: workaround for AMEVCNTR00 incrementing incorrectly"
+ depends on ARM64_AMU_EXTN
+ select ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+ default y
+ help
+ This option adds the workaround for the following errata:
+
+ * ARM Cortex-A715 erratum 2738462
+ * ARM Cortex-A720 erratum 2738461
+
+ On affected cores the AMEVCNTR00 counter (AMU core frequency cycles
+ counter) may continue incrementing while the core remains in WFE
+ with the clocks being enabled.
+ This may result in inaccurate counter readings, with the magnitude
+ of the discrepancy depending on the sampling interval.
+
+ With this workaround, reads of the affected counter return 0 in
+ the relevant paths. This causes users of the counter to treat it
+ as unavailable and is functionally equivalent to firmware disabling
+ the affected counter.
+
+ If unsure, say Y.
+
config ARM64_ERRATUM_2457168
bool "Cortex-A510: 2457168: workaround for AMEVCNTR01 incrementing incorrectly"
depends on ARM64_AMU_EXTN
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -406,6 +406,18 @@ static const struct midr_range workaroun
};
#endif /* CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT */
+#ifdef CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+static const struct midr_range workaround_amu_corecnt_list[] = {
+#ifdef CONFIG_ARM64_ERRATUM_2738461
+ /* Cortex-A715 r0p0 - r1p3 */
+ MIDR_RANGE(MIDR_CORTEX_A715, 0, 0, 1, 3),
+ /* Cortex-A720 r0p0 - r0p1 */
+ MIDR_RANGE(MIDR_CORTEX_A720, 0, 0, 0, 1),
+#endif
+ {}
+};
+#endif /* CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CORECNT */
+
#ifdef CONFIG_CAVIUM_ERRATUM_23154
static const struct midr_range cavium_erratum_23154_cpus[] = {
MIDR_ALL_VERSIONS(MIDR_THUNDERX),
@@ -949,6 +961,14 @@ const struct arm64_cpu_capabilities arm6
CAP_MIDR_RANGE_LIST(workaround_amu_constcnt_list)
},
#endif
+#ifdef CONFIG_ARM64_WORKAROUND_BROKEN_AMU_CORECNT
+ {
+ .desc = "Broken AMU AMEVCNTR00 (core cycle counter)",
+ .capability = ARM64_WORKAROUND_BROKEN_AMU_CORECNT,
+ .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
+ CAP_MIDR_RANGE_LIST(workaround_amu_corecnt_list)
+ },
+#endif
#ifdef CONFIG_ARM64_ERRATUM_2038923
{
.desc = "ARM erratum 2038923",
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -2089,7 +2089,8 @@ static void cpu_amu_enable(struct arm64_
cpumask_set_cpu(smp_processor_id(), &amu_cpus);
/* 0 reference values signal broken/disabled counters */
- if (!this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT))
+ if (!this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CONSTCNT) &&
+ !this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CORECNT))
update_freq_counters_refs();
}
}
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -389,7 +389,8 @@ static void cpu_read_corecnt(void *val)
* counter read is properly handled as an error case by the users of the
* counter.
*/
- *(u64 *)val = read_corecnt();
+ *(u64 *)val = this_cpu_has_cap(ARM64_WORKAROUND_BROKEN_AMU_CORECNT) ?
+ 0UL : read_corecnt();
}
static void cpu_read_constcnt(void *val)
--- a/arch/arm64/tools/cpucaps
+++ b/arch/arm64/tools/cpucaps
@@ -132,3 +132,4 @@ WORKAROUND_SPECULATIVE_AT
WORKAROUND_SPECULATIVE_SSBS
WORKAROUND_SPECULATIVE_UNPRIV_LOAD
WORKAROUND_BROKEN_AMU_CONSTCNT
+WORKAROUND_BROKEN_AMU_CORECNT
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0708/1005] arm64: hugetlb: Prevent write fault livelocks on stale TLB entries
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (706 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0707/1005] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0709/1005] arm64: kexec_file: Do not use CMA for images with a non-zero text_offset Greg Kroah-Hartman
` (290 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chris Down, Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Down <chris@chrisdown.name>
commit 3c47ec82540ce89a6fdfd5e0e6d79f35892adfa4 upstream.
In Meta production, we have had tasks get stuck in a fault loop while
using hugetlb on arm64. During my investigations I found that affected
tasks share a private hugetlb page.
Looking at the stuck task states, I found the following ordering:
CPU0 CPU1
---- ----
read page
[read only entry cached in TLB]
write page
hugetlb_fault()
hugetlb_wp()
[reuse folio]
set_huge_ptep_maybe_writable()
set_huge_ptep_writable()
[flush local TLB only]
write page using stale entry
hugetlb_fault()
huge_ptep_set_access_flags()
[entry already writable, no flush]
retry write using stale entry
[fault indefinitely. well, that's not ideal!]
The reason is that when a write fault makes a non-contiguous hugetlb
entry writable, it only invalidates the local TLB. However, another CPU
can keep the old read-only entry, so its write will fault even though
the page table already permits it. hugetlb_fault() then finds nothing to
change and leaves the stale entry in place, so the same write keeps
going round in circles.
This is particularly bad because, if the kernel is copying to user
memory, the retry stays inside the kernel and the task can't act on the
pending signal.
It can even remain unkillable while holding locks across the copy,
resulting in further failures. For example, a read into a hugetlb
buffer can hold the pipe mutex and block other users of the pipe until
the loop ends, causing cascading lockups across the machine.
To fix this, when a write fault finds nothing to change in a
non-contiguous hugetlb entry, let's invalidate the local entry.
Fixes: cb1fa2e99955 ("arm64, tlbflush: don't TLBI broadcast if page reused in write fault")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Down <chris@chrisdown.name>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/mm/hugetlbpage.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -429,9 +429,24 @@ int huge_ptep_set_access_flags(struct vm
VM_WARN_ON(!pte_present(pte));
ncontig = num_contig_ptes(huge_page_size(hstate_vma(vma)), &pgsize);
- if (!pte_cont(pte))
- return __ptep_set_access_flags_anysz(vma, addr, ptep, pte,
- dirty, pgsize);
+ if (!pte_cont(pte)) {
+ if (__ptep_set_access_flags_anysz(vma, addr, ptep, pte,
+ dirty, pgsize))
+ return 1;
+
+ /*
+ * Another CPU may have made the entry writable without
+ * invalidating our stale read-only TLB entry. To avoid
+ * indefinitely faulting on this entry, flush it.
+ */
+ if (dirty)
+ __flush_hugetlb_tlb_range(vma, addr, addr + pgsize,
+ pgsize,
+ TLBF_NOWALKCACHE |
+ TLBF_NOBROADCAST |
+ TLBF_NONOTIFY);
+ return 0;
+ }
if (!__cont_access_flags_changed(ptep, pte, ncontig))
return 0;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0709/1005] arm64: kexec_file: Do not use CMA for images with a non-zero text_offset
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (707 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0708/1005] arm64: hugetlb: Prevent write fault livelocks on stale TLB entries Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0710/1005] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
` (289 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jinjie Ruan, Will Deacon,
Mike Rapoport, Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinjie Ruan <ruanjinjie@huawei.com>
commit 18f2d01bfce99a885511c451cba95234eea190bc upstream.
image_load() adds text_offset to kernel_segment->mem and subtracts it
from kernel_segment->memsz. For CMA backed segments this breaks the
load path: the payload is copied to page_address(cma), which is the CMA
base, while image->start is set to the adjusted address, so kexec jumps
into the middle of the kernel. kimage_map_segment() has the same
mismatch when a segment has been moved.
The adjusted memsz also breaks the release path: the CMA pages are
freed using segment->memsz >> PAGE_SHIFT, which is fewer than were
allocated, leaking the tail of the allocation.
Both problems are specific to CMA segments, which are accessed through
page_address(cma) and ignore segment->mem. The normal load path uses
segment->mem, so the text_offset adjustment stays consistent there.
Keep honoring text_offset, but load such images from regular memory by
setting image->no_cma: they lose the CMA contiguous allocation, but
keep working.
Fixes: 07d24902977e ("kexec: enable CMA based contiguous allocation")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20260921090450.807575-2-ruanjinjie@huawei.com/
Link: https://lore.kernel.org/all/20260921090450.807575-3-ruanjinjie@huawei.com/
Link: https://lore.kernel.org/all/au4JOjnQlx2aSpiE@arm.com/
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/kernel/kexec_image.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/arch/arm64/kernel/kexec_image.c
+++ b/arch/arm64/kernel/kexec_image.c
@@ -82,6 +82,13 @@ static void *image_load(struct kimage *i
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
kbuf.memsz = le64_to_cpu(h->image_size);
text_offset = le64_to_cpu(h->text_offset);
+ /*
+ * A CMA segment is loaded and mapped through page_address(cma), which
+ * is the CMA base and cannot represent the text_offset adjustment
+ * below. Load images with a non-zero text_offset from normal memory.
+ */
+ if (text_offset)
+ image->no_cma = true;
kbuf.buf_align = MIN_KIMG_ALIGN;
/* Adjust kernel segment with TEXT_OFFSET */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0710/1005] arm64: ptrace: dont warn on missing siginfo in a group-stop
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (708 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0709/1005] arm64: kexec_file: Do not use CMA for images with a non-zero text_offset Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0711/1005] arm64: suspend: Save POR_EL0 over suspend Greg Kroah-Hartman
` (288 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhao Gongyi, Oleg Nesterov,
Will Deacon, Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Gongyi <zhaogongyi@bytedance.com>
commit 5306f124f3171289b2ef5bac1e08aad175f66d1e upstream.
PTRACE_ATTACH to a group-stopped child can enter do_jobctl_trap(),
which calls ptrace_stop() without siginfo. If the tracer writes
NT_ARM_SYSTEM_CALL, system_call_set() can change syscallno from
NO_SYSCALL before update_syscall_orig_x0_after_ptrace() checks
last_siginfo. WARN_ON_ONCE(!info) then fires for a valid ptrace stop.
Keep the early return when siginfo is absent, but remove the warning.
This leaves orig_x0 untouched at a non-seized group-stop and preserves
the existing syscall-exit-stop handling.
Fixes: 88b839ce497c ("arm64: ptrace: Keep 'orig_x0' in-sync with x0 on syscall entry")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Gongyi <zhaogongyi@bytedance.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Will Deacon <will@kernel.org>
[catalin.marinas@arm.com: modified comment as per Will's suggestion]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/kernel/ptrace.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -573,8 +573,12 @@ static void update_syscall_orig_x0_after
if (regs->syscallno == NO_SYSCALL)
return;
- /* We should only be called when target is in a ptrace stop */
- if (WARN_ON_ONCE(!info))
+ /*
+ * For exit-stops, info is always non-NULL, but that's not true for other
+ * stops such as non-seized group-stops. In those cases, just return early
+ * as there's no need to update orig_x0 anyway.
+ */
+ if (!info)
return;
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0711/1005] arm64: suspend: Save POR_EL0 over suspend
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (709 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0710/1005] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0712/1005] arm64: suspend: Save GCS state " Greg Kroah-Hartman
` (287 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Brown, Vladimir Murzin,
Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <broonie@kernel.org>
commit 2386c3dcf13e39d7576eae821af66537332c02de upstream.
POR_EL0 is a live EL0 register on systems with S1POE but it is not saved
and restored by cpu_do_suspend()/cpu_do_resume(). This means that the task
that initiated suspend can return to userspace with an UNKNOWN value. Fix
this by saving and restoring the value over suspend.
This increases the size of struct cpu_suspend_ctx.
Fixes: bf83dae90fbc ("arm64: enable the Permission Overlay Extension for EL0")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/include/asm/suspend.h | 2 +-
arch/arm64/mm/proc.S | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
--- a/arch/arm64/include/asm/suspend.h
+++ b/arch/arm64/include/asm/suspend.h
@@ -2,7 +2,7 @@
#ifndef __ASM_SUSPEND_H
#define __ASM_SUSPEND_H
-#define NR_CTX_REGS 15
+#define NR_CTX_REGS 16
#define NR_CALLEE_SAVED_REGS 12
/*
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -118,6 +118,10 @@ alternative_if ARM64_SME
mrs_s x2, SYS_TPIDR2_EL0
str x2, [x0, #112]
alternative_else_nop_endif
+alternative_if ARM64_HAS_S1POE
+ mrs x2, REG_POR_EL0
+ str x2, [x0, #120]
+alternative_else_nop_endif
ret
SYM_FUNC_END(cpu_do_suspend)
@@ -160,6 +164,10 @@ alternative_if ARM64_SME
ldr x2, [x0, #112]
msr_s SYS_TPIDR2_EL0, x2
alternative_else_nop_endif
+alternative_if ARM64_HAS_S1POE
+ ldr x2, [x0, #120]
+ msr REG_POR_EL0, x2
+alternative_else_nop_endif
msr sctlr_el1, x12
set_this_cpu_offset x13
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0712/1005] arm64: suspend: Save GCS state over suspend
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (710 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0711/1005] arm64: suspend: Save POR_EL0 over suspend Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0713/1005] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
` (286 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mark Brown, Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <broonie@kernel.org>
commit 7ca488055c69eed71219546deb805811854aca35 upstream.
GCSCRE0_EL1 and GCSPR_EL0 are live registers for EL0 on systems with GCS
but are not saved and restored by cpu_do_suspend()/cpu_do_resume(). This
means that the task that initiated suspend can return to userspace with
UNKNOWN or incorrect values for GCSPR_EL0 and GCSCRE0_EL1 (many fields
in GCSCRE0_EL1 reset to 0). This will in turn lead to ongoing
corruption, including not restoring mode until a task with a different
GCS mode is run. Fix this by saving and restoring the values over
suspend.
This increases the size of struct cpu_suspend_ctx by 16 bytes.
Fixes: 5d8b172e7005 ("arm64: Add Kconfig for Guarded Control Stack (GCS)")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/include/asm/suspend.h | 2 +-
arch/arm64/mm/proc.S | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
--- a/arch/arm64/include/asm/suspend.h
+++ b/arch/arm64/include/asm/suspend.h
@@ -2,7 +2,7 @@
#ifndef __ASM_SUSPEND_H
#define __ASM_SUSPEND_H
-#define NR_CTX_REGS 16
+#define NR_CTX_REGS 18
#define NR_CALLEE_SAVED_REGS 12
/*
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -122,6 +122,12 @@ alternative_if ARM64_HAS_S1POE
mrs x2, REG_POR_EL0
str x2, [x0, #120]
alternative_else_nop_endif
+alternative_if ARM64_HAS_GCS
+ mrs x2, REG_GCSPR_EL0
+ str x2, [x0, #128]
+ mrs x2, REG_GCSCRE0_EL1
+ str x2, [x0, #136]
+alternative_else_nop_endif
ret
SYM_FUNC_END(cpu_do_suspend)
@@ -168,6 +174,12 @@ alternative_if ARM64_HAS_S1POE
ldr x2, [x0, #120]
msr REG_POR_EL0, x2
alternative_else_nop_endif
+alternative_if ARM64_HAS_GCS
+ ldr x2, [x0, #128]
+ msr REG_GCSPR_EL0, x2
+ ldr x2, [x0, #136]
+ msr REG_GCSCRE0_EL1, x2
+alternative_else_nop_endif
msr sctlr_el1, x12
set_this_cpu_offset x13
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0713/1005] arm64: suspend: Only track cpuidle context for idle tasks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (711 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0712/1005] arm64: suspend: Save GCS state " Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0714/1005] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
` (285 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+79883955da3a62652a80,
Uladzislau Zhauniarovich, Catalin Marinas
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
commit ad3fc05c7e65009355effeea06aa629a687acef2 upstream.
Commit 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic") moved
the calls to ct_cpuidle_enter() and ct_cpuidle_exit() into cpu_suspend() so
that arm64 cpuidle could keep RCU watching longer and manage context
tracking internally. However, cpu_suspend() is called not only by cpuidle
via psci_cpu_suspend_enter() (which runs in the context of the idle task),
but also during system suspend via psci_system_suspend_enter() (which runs
in the context of the task initiating suspend, such as a process writing to
/sys/power/state).
When entering system suspend, current is a non-idle task. Calling
ct_cpuidle_enter() invokes ct_kernel_exit() from kernel space (!user) on a
non-idle task. With CONFIG_RCU_EQS_DEBUG enabled, this violates context
tracking invariants and triggers a warning:
WARNING: kernel/context_tracking.c:120 at ct_kernel_exit+0x1b4/0x1f4
kernel/context_tracking.c:118
Call trace:
ct_kernel_exit+0x1b4/0x1f4 kernel/context_tracking.c:118
ct_idle_enter+0x20/0x34 kernel/context_tracking.c:299
ct_cpuidle_enter include/linux/cpuidle.h:134 [inline]
cpu_suspend+0x264/0x474 arch/arm64/kernel/suspend.c:136
psci_system_suspend_enter+0x4c/0x80 drivers/firmware/psci/psci.c:544
suspend_enter kernel/power/suspend.c:468 [inline]
suspend_devices_and_enter+0x88c/0xd0c kernel/power/suspend.c:533
enter_state kernel/power/suspend.c:618 [inline]
pm_suspend+0x498/0x698 kernel/power/suspend.c:644
state_store+0x14c/0x1fc kernel/power/main.c:819
kobj_attr_store+0x6c/0x90 lib/kobject.c:842
sysfs_kf_write+0xe0/0x108 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x260/0x3b8 fs/kernfs/file.c:345
vfs_write+0x51c/0xa0c fs/read_write.c:687
ksys_write+0x12c/0x228 fs/read_write.c:739
A corresponding warning is subsequently triggered in ct_kernel_enter() via
ct_cpuidle_exit() upon resume.
Fix this by checking is_idle_task(current) in cpu_suspend() and only
invoking ct_cpuidle_enter() and ct_cpuidle_exit() when executing in the
context of an idle task.
Fixes: 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic")
Cc: <stable@vger.kernel.org>
Assisted-by: Gemini:gemini-3.8-flash Gemini:gemini-3.1-pro-preview syzbot
Reported-by: syzbot+79883955da3a62652a80@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=79883955da3a62652a80
Link: https://syzkaller.appspot.com/ai_job?id=5359e16f-013b-4850-9cbc-ddfb3bac95e5
Signed-off-by: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
Tested-by: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
Link: https://lore.kernel.org/r/3e92ccb0-2952-4317-af4c-45457c15efae@gmail.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/kernel/suspend.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -5,6 +5,7 @@
#include <linux/uaccess.h>
#include <linux/pgtable.h>
#include <linux/cpuidle.h>
+#include <linux/sched.h>
#include <asm/alternative.h>
#include <asm/cacheflush.h>
#include <asm/cpufeature.h>
@@ -99,6 +100,7 @@ int cpu_suspend(unsigned long arg, int (
int ret = 0;
unsigned long flags;
struct sleep_stack_data state;
+ bool idle = is_idle_task(current);
/*
* Some portions of CPU state (e.g. PSTATE.{PAN,DIT}) are initialized
@@ -133,7 +135,8 @@ int cpu_suspend(unsigned long arg, int (
*/
pause_graph_tracing();
- ct_cpuidle_enter();
+ if (idle)
+ ct_cpuidle_enter();
if (__cpu_suspend_enter(&state)) {
/* Call the suspend finisher */
@@ -149,9 +152,11 @@ int cpu_suspend(unsigned long arg, int (
if (!ret)
ret = -EOPNOTSUPP;
- ct_cpuidle_exit();
+ if (idle)
+ ct_cpuidle_exit();
} else {
- ct_cpuidle_exit();
+ if (idle)
+ ct_cpuidle_exit();
__cpu_suspend_exit();
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0714/1005] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (712 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0713/1005] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0715/1005] cpufreq: Improve suspend-resume synchronization Greg Kroah-Hartman
` (284 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Zhongqiu Han,
Rafael J. Wysocki
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
commit 6bc092a0fc4d331a4adbbb664078af149c580834 upstream.
When policy->freq_table is built in acpi_cpufreq_cpu_init(), entries
that are not lower in frequency than the previous one are skipped.
For each remaining entry, freq_table[].driver_data stores the
original ACPI P-state index, so the index space of freq_table no
longer matches perf->states[].
extract_io() currently walks perf->states[] with index i and uses the
same i to index policy->freq_table[i]. When duplicate frequencies
exist, this can associate a P-state status with the frequency of a
different P-state. It can also access an invalid or sentinel entry in
freq_table when the number of entries in perf->states[] is greater than
the number of entries remaining in the frequency table.
extract_io() is used on ACPI_ADR_SPACE_SYSTEM_IO platforms by the
frequency verification path, which is enabled by the
acpi_pstate_strict module parameter. With the mismatched lookup,
check_freqs() can fail to match the frequency of the P-state that
drv_write() has already programmed. It then sleeps through all 100
iterations - at least ~1 ms of usleep_range() plus 100 cross-CPU
calls and I/O port reads, all with policy->rwsem held, and
.target_index() returns -EAGAIN, leaving perf->state at its previous
value while the hardware is running at the newly requested P-state.
The cpufreq core consequently keeps policy->cur at the old frequency.
Since __cpufreq_driver_target() returns early when the requested
frequency equals policy->cur, the driver is not called again for that
frequency and the control register is not rewritten. The hardware can
therefore remain at a frequency that differs from the frequency known
to the cpufreq core.
Fix this by iterating over policy->freq_table and using
pos->driver_data as the original ACPI P-state index when accessing
perf->states[], as extract_msr() already does.
Fixes: fe27cb358835 ("[CPUFREQ][2/8] acpi: reorganize code to make MSR support addition easier")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Cc: All applicable <stable@vger.kernel.org>
Link: https://patch.msgid.link/20260910111329.2220-2-lirongqing@baidu.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/acpi-cpufreq.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -197,14 +197,13 @@ static unsigned extract_io(struct cpufre
{
struct acpi_cpufreq_data *data = policy->driver_data;
struct acpi_processor_performance *perf;
- int i;
+ struct cpufreq_frequency_table *pos;
perf = to_perf_data(data);
- for (i = 0; i < perf->state_count; i++) {
- if (value == perf->states[i].status)
- return policy->freq_table[i].frequency;
- }
+ cpufreq_for_each_entry(pos, policy->freq_table)
+ if (value == perf->states[pos->driver_data].status)
+ return pos->frequency;
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0715/1005] cpufreq: Improve suspend-resume synchronization
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (713 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0714/1005] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0716/1005] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
` (283 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki,
Zak Brighton Knight, Zhongqiu Han, Viresh Kumar, Doug Smythies,
Christian Loehle
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit eee2a44e4e2b41c0699919a550d41cc38daa4f42 upstream.
The suspend-resume synchronization in the cpufreq core is not perfect
because the global cpufreq_suspended variable is set at the end of
cpufreq_suspend() after stopping governors for all of the active
policies, so the governor .limits() callback may run via
cpufreq_governor_limits() after stopping the governor and before
setting cpufreq_suspended which is questionable. Likewise, the
governor .limits() callback may run between clearing cpufreq_suspended
in cpufreq_resume() and starting the governor.
Address this by adding a per-policy "suspended" flag that is always
read under the policy rwsem and is updated under it when the governor
is stopped in cpufreq_suspend() and when the governor is restarted in
cpufreq_resume().
Also make cpufreq_resume() use the cpus_read_lock guard to reflect
what is done in cpufreq_suspend() and call cpufreq_exit_governor() for
policies that were suspended during a system suspend transition and
are inactive during the subsequent system resume (to avoid leaking an
inactive policy with a stopped governor that has not exited yet).
Fixes: 8e30444e1530 ("cpufreq: fix cpufreq suspend/resume for intel_pstate")
Fixes: b1b12babe3b7 ("cpufreq: update 'cpufreq_suspended' after stopping governors")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/4796894.LvFx2qVVIh@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/cpufreq.c | 86 +++++++++++++++++++++++++++++++++-------------
include/linux/cpufreq.h | 3 +
2 files changed, 66 insertions(+), 23 deletions(-)
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -35,6 +35,9 @@
static LIST_HEAD(cpufreq_policy_list);
/* Macros to iterate over CPU policies */
+#define for_each_policy(__policy) \
+ list_for_each_entry(__policy, &cpufreq_policy_list, policy_list)
+
#define for_each_suitable_policy(__policy, __active) \
list_for_each_entry(__policy, &cpufreq_policy_list, policy_list) \
if ((__active) == !policy_is_inactive(__policy))
@@ -1960,6 +1963,14 @@ int cpufreq_generic_suspend(struct cpufr
}
EXPORT_SYMBOL(cpufreq_generic_suspend);
+static void cpufreq_suspend_policy(struct cpufreq_policy *policy)
+{
+ guard(cpufreq_policy_write)(policy);
+
+ cpufreq_stop_governor(policy);
+ policy->suspended = true;
+}
+
/**
* cpufreq_suspend() - Suspend CPUFreq governors.
*
@@ -1982,11 +1993,8 @@ void cpufreq_suspend(void)
pr_debug("%s: Suspending Governors\n", __func__);
for_each_active_policy(policy) {
- if (has_target()) {
- scoped_guard(cpufreq_policy_write, policy) {
- cpufreq_stop_governor(policy);
- }
- }
+ if (has_target())
+ cpufreq_suspend_policy(policy);
if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))
pr_err("%s: Failed to suspend driver: %s\n", __func__,
@@ -1998,6 +2006,32 @@ suspend:
cpus_read_unlock();
}
+static void cpufreq_resume_policy(struct cpufreq_policy *policy, bool start)
+{
+ guard(cpufreq_policy_write)(policy);
+
+ if (!policy->suspended)
+ return;
+
+ policy->suspended = false;
+
+ if (policy_is_inactive(policy)) {
+ /*
+ * The policy was active when it was suspended, so its governor
+ * is still there. Let the governor go.
+ */
+ cpufreq_exit_governor(policy);
+ return;
+ }
+
+ if (!start)
+ return;
+
+ if (cpufreq_start_governor(policy))
+ pr_err("%s: Failed to start governor for CPU%u's policy\n",
+ __func__, policy->cpu);
+}
+
/**
* cpufreq_resume() - Resume CPUFreq governors.
*
@@ -2007,11 +2041,12 @@ suspend:
void cpufreq_resume(void)
{
struct cpufreq_policy *policy;
- int ret;
if (!cpufreq_driver)
return;
+ guard(cpus_read_lock)();
+
if (unlikely(!cpufreq_suspended))
return;
@@ -2022,19 +2057,18 @@ void cpufreq_resume(void)
pr_debug("%s: Resuming Governors\n", __func__);
- for_each_active_policy(policy) {
- if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) {
- pr_err("%s: Failed to resume driver: %s\n", __func__,
- cpufreq_driver->name);
- } else if (has_target()) {
- scoped_guard(cpufreq_policy_write, policy) {
- ret = cpufreq_start_governor(policy);
- }
+ for_each_policy(policy) {
+ int ret = 0;
+ if (cpufreq_driver->resume && !policy_is_inactive(policy)) {
+ ret = cpufreq_driver->resume(policy);
if (ret)
- pr_err("%s: Failed to start governor for CPU%u's policy\n",
- __func__, policy->cpu);
+ pr_err("%s: Failed to resume driver: %s\n", __func__,
+ cpufreq_driver->name);
}
+
+ if (has_target())
+ cpufreq_resume_policy(policy, ret == 0);
}
}
@@ -2416,12 +2450,17 @@ __weak struct cpufreq_governor *cpufreq_
return NULL;
}
+static bool cpufreq_is_suspended(struct cpufreq_policy *policy)
+{
+ return cpufreq_suspended || policy->suspended;
+}
+
static int cpufreq_init_governor(struct cpufreq_policy *policy)
{
int ret;
- /* Don't start any governor operations if we are entering suspend */
- if (cpufreq_suspended)
+ /* Don't start any governor operations for suspended policies. */
+ if (cpufreq_is_suspended(policy))
return 0;
/*
* Governor might not be initiated here if ACPI _PPC changed
@@ -2464,7 +2503,7 @@ static int cpufreq_init_governor(struct
static void cpufreq_exit_governor(struct cpufreq_policy *policy)
{
- if (cpufreq_suspended || !policy->governor)
+ if (cpufreq_is_suspended(policy) || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
@@ -2479,7 +2518,7 @@ int cpufreq_start_governor(struct cpufre
{
int ret;
- if (cpufreq_suspended)
+ if (cpufreq_is_suspended(policy))
return 0;
if (!policy->governor)
@@ -2503,7 +2542,7 @@ int cpufreq_start_governor(struct cpufre
void cpufreq_stop_governor(struct cpufreq_policy *policy)
{
- if (cpufreq_suspended || !policy->governor)
+ if (cpufreq_is_suspended(policy) || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
@@ -2514,7 +2553,7 @@ void cpufreq_stop_governor(struct cpufre
static void cpufreq_governor_limits(struct cpufreq_policy *policy)
{
- if (cpufreq_suspended || !policy->governor)
+ if (cpufreq_is_suspended(policy) || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
@@ -2751,7 +2790,8 @@ static void cpufreq_policy_refresh(struc
* -> ask driver for current freq and notify governors about a change
*/
if (cpufreq_driver->get && has_target() &&
- (cpufreq_suspended || WARN_ON(!cpufreq_verify_current_freq(policy, false))))
+ (cpufreq_is_suspended(policy) ||
+ WARN_ON(!cpufreq_verify_current_freq(policy, false))))
return;
refresh_frequency_limits(policy);
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -149,6 +149,9 @@ struct cpufreq_policy {
/* Pending policy->min/max update for the driver */
bool update_limits;
+ /* The policy has been suspended. */
+ bool suspended;
+
/* Cached frequency lookup from cpufreq_driver_resolve_freq. */
unsigned int cached_target_freq;
unsigned int cached_resolved_idx;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0716/1005] cpufreq: intel_pstate: Clear last written P-state value on suspend
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (714 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0715/1005] cpufreq: Improve suspend-resume synchronization Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0717/1005] cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT Greg Kroah-Hartman
` (282 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zak Brighton Knight, Doug Smythies,
Rafael J. Wysocki, Zhongqiu Han, Viresh Kumar, Christian Loehle
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 02e77af824d5be3a94fdd885835a352f90d24c5c upstream.
Preserving cpu->pstate.current_pstate across system suspend-resume
cycles, when running in the passive mode with HWP disabled, is a mistake
because its value from before system suspend may become stale after the
subsequent system resume and in some cases it prevents MSR_IA32_PERF_CTL
from being updated properly after system resume [1].
Address this by clearing cpu->pstate.current_pstate after the governor
has been stopped during system suspend.
Fixes: 001c76f05b01 ("cpufreq: intel_pstate: Generic governors support")
Fixes: 4adcf2e5829f ("cpufreq: intel_pstate: Add ->offline and ->online callbacks")
Link: https://lore.kernel.org/linux-pm/20261027143725.3763827-1-zakbrightonknight@gmail.com/ [1]
Reported-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reported-by: Doug Smythies <dsmythies@telus.net>
Cc: All applicable <stable@vger.kernel.org> # 342d3a73c5db cpufreq: Force passing target frequency to driver during resume
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/14150222.uLZWGnKmhe@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/intel_pstate.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -3389,10 +3389,11 @@ static void intel_cpufreq_cpu_exit(struc
static int intel_cpufreq_suspend(struct cpufreq_policy *policy)
{
+ struct cpudata *cpu = all_cpu_data[policy->cpu];
+
intel_pstate_suspend(policy);
if (hwp_active) {
- struct cpudata *cpu = all_cpu_data[policy->cpu];
u64 value = READ_ONCE(cpu->hwp_req_cached);
/*
@@ -3403,6 +3404,17 @@ static int intel_cpufreq_suspend(struct
value &= ~HWP_DESIRED_PERF(~0L);
wrmsrq_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value);
WRITE_ONCE(cpu->hwp_req_cached, value);
+ } else {
+ /*
+ * Invalidate the cached P-state value that may be stale when
+ * the governor is started again during resume and may prevent
+ * MSR_IA32_PERF_CTL from being updated.
+ *
+ * This does not require synchronization because the core
+ * prevents frequency updates for suspended policies from
+ * occurring.
+ */
+ cpu->pstate.current_pstate = 0;
}
return 0;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0717/1005] cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (715 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0716/1005] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0718/1005] cpufreq: Force passing target frequency to driver during resume Greg Kroah-Hartman
` (281 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Li Zhaoxin, Rafael J. Wysocki
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Zhaoxin <lizhaoxin04@baidu.com>
commit 2c0e6f2858d235c99f7ba4621bd176cd67226f00 upstream.
Commit ed7cad0504e3 ("cpufreq: intel_pstate: Relocate platform
preference check") moved the intel_pstate_platform_pwr_mgmt_exists()
call to the beginning of intel_pstate_init(), right after the vendor
check, so it now runs before "no_load" (intel_pstate=disable) and the
other checks.
MSR_MISC_PWR_MGMT is model-specific and KVM does not emulate it. In a
KVM guest using a CPU model listed in intel_pstate_cpu_oob_ids[] (for
example "-cpu host" on Emerald Rapids), reading it raises #GP and the
unchecked rdmsrq() emits a warning with a call trace on every boot, even
with intel_pstate=disable:
unchecked MSR access error: RDMSR from 0x1aa at rIP: 0xffffffffa4009342 (native_read_msr+0x2/0x50)
Call Trace:
<TASK>
intel_pstate_platform_pwr_mgmt_exists+0x3b/0x220
intel_pstate_init+0x1e/0x500
do_one_initcall+0x59/0x350
...
Before that commit, such guests typically returned from
intel_pstate_init() earlier, either because of intel_pstate=disable or
because intel_pstate_msrs_not_valid() failed on the zero ratios that
KVM reports in MSR_PLATFORM_INFO by default, so the MSR was not read.
Use rdmsrq_safe() and treat a failing read as "no OOB mode". The
exception fixup already zeroes the result of a failed unchecked read,
so apart from the warning going away there is no functional change.
Fixes: ed7cad0504e3 ("cpufreq: intel_pstate: Relocate platform preference check")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Li Zhaoxin <lizhaoxin04@baidu.com>
Link: https://patch.msgid.link/20261104070149.41393-1-lizhaoxin04@baidu.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/intel_pstate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -3661,12 +3661,12 @@ static struct acpi_platform_list plat_in
static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
{
const struct x86_cpu_id *id;
- u64 misc_pwr;
+ u64 misc_pwr = 0;
int idx;
id = x86_match_cpu(intel_pstate_cpu_oob_ids);
if (id) {
- rdmsrq(MSR_MISC_PWR_MGMT, misc_pwr);
+ rdmsrq_safe(MSR_MISC_PWR_MGMT, &misc_pwr);
if (misc_pwr & BITMASK_OOB) {
pr_debug("Bit 8 or 18 in the MISC_PWR_MGMT MSR set\n");
pr_debug("P states are controlled in Out of Band mode by the firmware/hardware\n");
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0718/1005] cpufreq: Force passing target frequency to driver during resume
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (716 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0717/1005] cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0719/1005] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
` (280 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zak Brighton Knight, Doug Smythies,
Rafael J. Wysocki, Zhongqiu Han, Viresh Kumar, Christian Loehle
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 342d3a73c5dbc2f1cd0c5142e2d11bda4dc54cd7 upstream.
The policy->cur value preserved across a system suspend-resume cycle
may become stale in some cases and it may prevent the CPU performance
scaling logic from being updated due to the target_freq == policy->cur
check in __cpufreq_driver_target() [1].
To address this, adjust the existing mechanism to force the invocation
of the driver .target() callback in __cpufreq_driver_target() and make
cpufreq_resume_policy() use it.
This involves renaming update_limits in struct cpufreq_policy to
force_target and moving the driver CPUFREQ_NEED_UPDATE_LIMITS flag check
from __cpufreq_driver_target() to cpufreq_set_policy(), where it is used
as a condition for setting policy->force_target.
In cpufreq_resume_policy(), policy->force_target is set for drivers that
implement the .target() callback, but don't implement the .get() one,
which is the case when the driver callback needs to run if policy->cur
becomes stale while suspended.
Fixes: 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate")
Link: https://lore.kernel.org/linux-pm/20261027143725.3763827-1-zakbrightonknight@gmail.com/ [1]
Reported-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reported-by: Doug Smythies <dsmythies@telus.net>
Cc: All applicable <stable@vger.kernel.org> # eee2a44e4e2b cpufreq: Improve suspend-resume synchronization
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/1995295.tdWV9SEqCh@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/cpufreq.c | 33 +++++++++++++++++++++------------
include/linux/cpufreq.h | 4 ++--
2 files changed, 23 insertions(+), 14 deletions(-)
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2027,6 +2027,15 @@ static void cpufreq_resume_policy(struct
if (!start)
return;
+ /*
+ * Force executing the driver .target() callback, if present, in the
+ * next invocation of __cpufreq_driver_target() in case policy->cur has
+ * become stale while suspended, but do it only for drivers without a
+ * .get() callback for which cpufreq_verify_current_freq() is a NOP.
+ */
+ if (cpufreq_driver->target && !cpufreq_driver->get)
+ policy->force_target = true;
+
if (cpufreq_start_governor(policy))
pr_err("%s: Failed to start governor for CPU%u's policy\n",
__func__, policy->cpu);
@@ -2404,17 +2413,14 @@ int __cpufreq_driver_target(struct cpufr
policy->cpu, policy->cur, target_freq, old_target_freq, relation);
/*
- * This might look like a redundant call as we are checking it again
- * after finding index. But it is left intentionally for cases where
- * exactly same freq is called again and so we can save on few function
- * calls.
+ * Unless invoking the target callback is forced, skip the update if the
+ * frequency is not really changing.
*/
- if (target_freq == policy->cur) {
- if (!(cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS) ||
- !policy->update_limits)
- return 0;
-
- policy->update_limits = false;
+ if (policy->force_target) {
+ /* Avoid forcing the driver callback unnecessarily next time. */
+ policy->force_target = false;
+ } else if (target_freq == policy->cur) {
+ return 0;
}
if (cpufreq_driver->target) {
@@ -2673,6 +2679,7 @@ static int cpufreq_set_policy(struct cpu
struct cpufreq_governor *new_gov,
unsigned int new_pol)
{
+ bool need_update_limits = cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS;
struct cpufreq_policy_data new_data;
struct cpufreq_governor *old_gov;
unsigned int freq;
@@ -2712,7 +2719,8 @@ static int cpufreq_set_policy(struct cpu
CPUFREQ_RELATION_H);
if (freq != policy->max) {
WRITE_ONCE(policy->max, freq);
- policy->update_limits = true;
+ if (need_update_limits)
+ policy->force_target = true;
}
freq = __resolve_freq(policy, new_data.min, new_data.min, new_data.max,
@@ -2720,7 +2728,8 @@ static int cpufreq_set_policy(struct cpu
freq = min(freq, policy->max);
if (freq != policy->min) {
WRITE_ONCE(policy->min, freq);
- policy->update_limits = true;
+ if (need_update_limits)
+ policy->force_target = true;
}
trace_cpu_frequency_limits(policy);
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -146,8 +146,8 @@ struct cpufreq_policy {
/* Per policy boost supported flag. */
bool boost_supported;
- /* Pending policy->min/max update for the driver */
- bool update_limits;
+ /* Force passing target frequency to the driver. */
+ bool force_target;
/* The policy has been suspended. */
bool suspended;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0719/1005] cpufreq: Cache post-resolution target frequency in __resolve_freq()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (717 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0718/1005] cpufreq: Force passing target frequency to driver during resume Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0720/1005] cpufreq: Fix updates of cached resolved frequency and index Greg Kroah-Hartman
` (279 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Christian Loehle
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 166207cac45191637c47a457a5c16ca6b6773a16 upstream.
get_next_freq() in the schedutil governor returns the resolved
frequency from cpufreq_driver_resolve_freq(), and that resolved value
is then passed to cpufreq_driver_fast_switch(). The only reader of
cached_target_freq, acpi_cpufreq_fast_switch(), compares it with the
post-resolution target frequency, but it holds the pre-resolution
clamped frequency, so any request that falls between table entries
misses the cache and falls back to a table scan.
Address this by making __resolve_freq() store the post-resolution
frequency in cached_target_freq.
Fixes: e3c062360870 ("cpufreq: add cpufreq_driver_resolve_freq()")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/14161745.uLZWGnKmhe@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/cpufreq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -488,8 +488,8 @@ static unsigned int __resolve_freq(struc
idx = cpufreq_frequency_table_target(policy, target_freq, min, max, relation);
policy->cached_resolved_idx = idx;
- policy->cached_target_freq = target_freq;
- return policy->freq_table[idx].frequency;
+ policy->cached_target_freq = policy->freq_table[idx].frequency;
+ return policy->cached_target_freq;
}
/**
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0720/1005] cpufreq: Fix updates of cached resolved frequency and index
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (718 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0719/1005] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0721/1005] software node: only let the owner release a managed node Greg Kroah-Hartman
` (278 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhongqiu Han, Rafael J. Wysocki,
Christian Loehle
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
commit 75120f31aed010c326b28d7c80d22314df34d9a8 upstream.
The cached resolved frequency and index, cached_target_freq and
cached_resolved_idx, respectively, may be updated concurrently if
cpufreq_driver_resolve_freq() is called by the schedutil governor
while cpufreq_set_policy() is running for the same policy. Those
concurrent updates are not synchronized in any way and the values
written by cpufreq_set_policy(), if it wins the race, may confuse
drivers using those policy fields [1].
To address this, use the observation that the only place where
cached_target_freq and cached_resolved_idx need to be updated is
cpufreq_driver_resolve_freq() because the only legitimate users of
them are .fast_switch() driver callbacks. Although cached_resolved_idx
is also used in __cpufreq_driver_target(), that is in fact unnecessary
and it is better to use a local variable for storing the frequency
table index in that function.
Accordingly, rearrange __resolve_freq() and its callers so that
cached_target_freq and cached_resolved_idx are only updated in
cpufreq_driver_resolve_freq().
The cached_target_freq initialization in cpufreq_set_policy() is still
needed, but move it after stopping the old governor and before starting
the new one to avoid racing with cpufreq_driver_resolve_freq().
Fixes: f9ccdec24d91 ("cpufreq: Reuse cpufreq_driver_resolve_freq() in __cpufreq_driver_target()")
Fixes: 151717690694 ("cpufreq: Make policy min/max hard requirements")
Reported-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Closes: https://lore.kernel.org/linux-pm/20261105140357.1331894-1-zhongqiu.han@oss.qualcomm.com/ [1]
Co-developed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Signed-off-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Cc: All applicable <stable@vger.kernel.org> # 342d3a73c5db cpufreq: Force passing target frequency to driver during resume
Cc: All applicable <stable@vger.kernel.org> # 166207cac451 cpufreq: Cache post-resolution target frequency in __resolve_freq()
Link: https://patch.msgid.link/3472677.aeNJFYEL58@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/cpufreq.c | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -477,7 +477,7 @@ EXPORT_SYMBOL_GPL(cpufreq_disable_fast_s
static unsigned int __resolve_freq(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int min, unsigned int max,
- unsigned int relation)
+ unsigned int relation, unsigned int *idx_p)
{
unsigned int idx;
@@ -487,9 +487,10 @@ static unsigned int __resolve_freq(struc
return target_freq;
idx = cpufreq_frequency_table_target(policy, target_freq, min, max, relation);
- policy->cached_resolved_idx = idx;
- policy->cached_target_freq = policy->freq_table[idx].frequency;
- return policy->cached_target_freq;
+ if (idx_p)
+ *idx_p = idx;
+
+ return policy->freq_table[idx].frequency;
}
/**
@@ -520,7 +521,10 @@ unsigned int cpufreq_driver_resolve_freq
if (unlikely(min > max))
min = max;
- return __resolve_freq(policy, target_freq, min, max, CPUFREQ_RELATION_LE);
+ policy->cached_target_freq = __resolve_freq(policy, target_freq, min, max,
+ CPUFREQ_RELATION_LE,
+ &policy->cached_resolved_idx);
+ return policy->cached_target_freq;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq);
@@ -2402,12 +2406,13 @@ int __cpufreq_driver_target(struct cpufr
unsigned int relation)
{
unsigned int old_target_freq = target_freq;
+ unsigned int idx = 0;
if (cpufreq_disabled())
return -ENODEV;
target_freq = __resolve_freq(policy, target_freq, policy->min,
- policy->max, relation);
+ policy->max, relation, &idx);
pr_debug("CPU %u: cur %u kHz -> target %u kHz (req %u kHz, rel %u)\n",
policy->cpu, policy->cur, target_freq, old_target_freq, relation);
@@ -2437,7 +2442,7 @@ int __cpufreq_driver_target(struct cpufr
if (!cpufreq_driver->target_index)
return -EINVAL;
- return __target_index(policy, policy->cached_resolved_idx);
+ return __target_index(policy, idx);
}
EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
@@ -2716,7 +2721,7 @@ static int cpufreq_set_policy(struct cpu
* concurrently by cpufreq_driver_resolve_freq() during the update.
*/
freq = __resolve_freq(policy, new_data.max, new_data.min, new_data.max,
- CPUFREQ_RELATION_H);
+ CPUFREQ_RELATION_H, NULL);
if (freq != policy->max) {
WRITE_ONCE(policy->max, freq);
if (need_update_limits)
@@ -2724,7 +2729,7 @@ static int cpufreq_set_policy(struct cpu
}
freq = __resolve_freq(policy, new_data.min, new_data.min, new_data.max,
- CPUFREQ_RELATION_L);
+ CPUFREQ_RELATION_L, NULL);
freq = min(freq, policy->max);
if (freq != policy->min) {
WRITE_ONCE(policy->min, freq);
@@ -2736,8 +2741,6 @@ static int cpufreq_set_policy(struct cpu
cpufreq_update_pressure(policy);
- policy->cached_target_freq = UINT_MAX;
-
pr_debug("new min and max freqs are %u - %u kHz\n",
policy->min, policy->max);
@@ -2763,6 +2766,12 @@ static int cpufreq_set_policy(struct cpu
cpufreq_exit_governor(policy);
}
+ /*
+ * Initialize cached_target_freq while no governor is running to avoid
+ * racing with cpufreq_driver_resolve_freq(), which updates it.
+ */
+ policy->cached_target_freq = UINT_MAX;
+
/* start new governor */
policy->governor = new_gov;
ret = cpufreq_init_governor(policy);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0721/1005] software node: only let the owner release a managed node
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (719 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0720/1005] cpufreq: Fix updates of cached resolved frequency and index Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0722/1005] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
` (277 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Balasubramani Vivekanandan,
Bartosz Golaszewski, Heikki Krogerus, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit f8623ce596492d2e96ca57eeec992938d3d79f00 upstream.
device_create_managed_software_node() creates a node whose lifetime is
tied to the device it was created for. software_node_notify_remove() is
called for every device that has the node as its fwnode (primary OR
secondary) and, if the node is managed, unconditionally detaches it from
that device and drops the creation reference.
This breaks when the node is shared with another device. Example: the
i2c-designware copies the parent's fwnode to the adapter's struct device.
When the adapter is deleted, it releases the reference that belongs to
the owner and the latter ends up with a dangling pointer.
Record the device's "manager" and only perform the actual release when
notify is called for that "owner" device.
Note that it was never the intention that managed software nodes would
be shared, but descendants reusing ancestor firmware nodes is not
uncommon and such use is hard to predict when allocating software nodes.
Reported-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Closes: https://lore.kernel.org/all/20261009164241.923756-2-balasubramani.vivekanandan@intel.com/
Fixes: 151f6ff78cdf ("software node: Provide replacement for device_add_properties()")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Fixes: 0f485f88656a ("drm/xe/i2c: use device_create_managed_software_node()")
Reviewed-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Tested-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261102-swnode-only-owner-release-v1-1-ee4c9022a629@oss.qualcomm.com
[ johan: drop temporary variable; skip clearing owner field;
mention reuse not intended in commit message ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/swnode.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -29,6 +29,8 @@ struct swnode {
struct fwnode_handle fwnode;
const struct software_node *node;
int id;
+ /* Device the managed node's lifetime is tied to. */
+ struct device *owner;
/* hierarchy */
struct ida child_ids;
@@ -37,7 +39,6 @@ struct swnode {
struct swnode *parent;
unsigned int allocated:1;
- unsigned int managed:1;
};
static DEFINE_IDA(swnode_root_ids);
@@ -1145,7 +1146,7 @@ int device_create_managed_software_node(
if (IS_ERR(fwnode))
return PTR_ERR(fwnode);
- to_swnode(fwnode)->managed = true;
+ to_swnode(fwnode)->owner = dev;
set_secondary_fwnode(dev, fwnode);
if (device_is_registered(dev))
@@ -1208,7 +1209,7 @@ void software_node_notify_remove(struct
swnode_put(swnode);
- if (swnode->managed) {
+ if (swnode->owner == dev) {
set_secondary_fwnode(dev, NULL);
swnode_put(swnode);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0722/1005] SUNRPC: Fix TCP-with-TLS transport class identification
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (720 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0721/1005] software node: only let the owner release a managed node Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0723/1005] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
` (276 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Benjamin Coddington,
Anna Schumaker
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
commit 0502c7e7f171a8c9c892bdef89e6aa6f44d7b2a3 upstream.
xs_setup_tcp_tls() assigns the ordinary TCP transport class to
a TCP-with-TLS transport. When rpc_clnt_add_xprt() is called
with an unspecified transport type, it inherits the class
identifier and can create an unencrypted TCP transport.
Looks like a copy-paste error from the commit 3 years ago.
NFSv4 trunk discovery uses an unspecified transport type when
adding server-advertised addresses. If the additional transport
passes server-identity validation, it can be admitted to the
client's transport switch.
An isolated loopback test reproduced plaintext application RPC
transmission for TLS- and mTLS-configured clients, including
an unpinned TLS-client RPC that selected the added transport.
Assign the TCP-with-TLS class instead. With the fix, the
plaintext-only test peer receives TLS negotiation probes but
no application payloads.
Fixes: 75eb6af7acdf ("SUNRPC: Add a TCP-with-TLS RPC transport class")
Cc: stable@vger.kernel.org
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Benjamin Coddington <bcodding@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sunrpc/xprtsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -3525,7 +3525,7 @@ static struct rpc_xprt *xs_setup_tcp_tls
transport = container_of(xprt, struct sock_xprt, xprt);
xprt->prot = IPPROTO_TCP;
- xprt->xprt_class = &xs_tcp_transport;
+ xprt->xprt_class = &xs_tcp_tls_transport;
xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
xprt->bind_timeout = XS_BIND_TO;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0723/1005] timekeeping: Read getboottime64() offsets under the sequence counter
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (721 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0722/1005] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0724/1005] timekeeping: Reject cross timestamps for invalid AUX clocks Greg Kroah-Hartman
` (275 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Thomas Gleixner,
John Stultz
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hungyu Lin <dennylin0707@gmail.com>
commit 385b5ec1f31dd39297578eed42be74b07ae74017 upstream.
getboottime64() computes the wall-clock boot timestamp from offs_real
minus offs_boot without checking tk_core.seq. A concurrent timekeeping
update can leave the reader with an inconsistent pair of offsets or,
on 32-bit systems, a torn 64-bit offset, producing an incorrect boot
timestamp.
Read both offsets under tk_core.seq and retry if an update overlaps
the sample. Convert the resulting local value to a timespec64 afterward.
Fixes: 7c3f1a573237 ("Introduce boot based time")
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: John Stultz <jstultz@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261030054227.35453-2-dennylin0707@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/time/timekeeping.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2698,7 +2698,13 @@ void update_wall_time(void)
void getboottime64(struct timespec64 *ts)
{
struct timekeeper *tk = &tk_core.timekeeper;
- ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot);
+ unsigned int seq;
+ ktime_t t;
+
+ do {
+ seq = read_seqcount_begin(&tk_core.seq);
+ t = ktime_sub(tk->offs_real, tk->offs_boot);
+ } while (read_seqcount_retry(&tk_core.seq, seq));
*ts = ktime_to_timespec64(t);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0724/1005] timekeeping: Reject cross timestamps for invalid AUX clocks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (722 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0723/1005] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0725/1005] timekeeping: Refresh auxiliary base before offset validation Greg Kroah-Hartman
` (274 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Thomas Gleixner
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
commit 67f1969e29b692ab3cfcc97ba175b9109212de00 upstream.
get_device_system_crosststamp() accepts AUX clock IDs even when the
corresponding timekeeper is disabled. A never-enabled AUX timekeeper
has no initialized clocksource, and a previously enabled one can
retain stale timekeeping data.
Return -ENODEV before calling the device timestamp callback when the
selected timekeeper is invalid.
Fixes: 9aebde8af6fe ("timekeeping: Add support for AUX clock cross timestamping")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261031122218.118921-1-thnkslprpt@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/time/timekeeping.c | 3 +++
1 file changed, 3 insertions(+)
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1598,6 +1598,9 @@ int get_device_system_crosststamp(int (*
do {
seq = read_seqcount_begin(&tkd->seq);
+ if (!tk->clock_valid)
+ return -ENODEV;
+
/*
* Try to synchronously capture device time and a system
* counter value calling back into the device driver
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0725/1005] timekeeping: Refresh auxiliary base before offset validation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (723 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0724/1005] timekeeping: Reject cross timestamps for invalid AUX clocks Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0726/1005] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
` (273 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Thomas Gleixner
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
commit c1b96ba87e3caaa701d6dba254e58db7cc3c99be upstream.
timekeeping_forward_now() can advance an auxiliary timekeeper across a
second boundary without refreshing tkr_mono.base. The negative-time
check in __timekeeping_inject_offset() then uses the stale base and
rejects valid ADJ_SETOFFSET adjustments with -EINVAL.
Refresh the derived timekeeper data before calculating the current
auxiliary time, as aux_clock_set() already does.
On 7.4-rc1, a valid negative adjustment fails at the first second
rollover. The patched kernel accepts all 12 tested rollover adjustments
and continues to reject invalid negative offsets.
Fixes: 2c8aea59c206 ("timekeeping: Add auxiliary clock support to __timekeeping_inject_offset()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261103090605.1292660-1-thnkslprpt@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/time/timekeeping.c | 1 +
1 file changed, 1 insertion(+)
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1776,6 +1776,7 @@ static int __timekeeping_inject_offset(s
struct tk_read_base *tkr_mono = &tks->tkr_mono;
ktime_t now, offs;
+ tk_update_ktime_data(tks);
/* Get the current time */
now = ktime_add_ns(tkr_mono->base, timekeeping_get_ns(tkr_mono));
/* Add the relative offset change */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0726/1005] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (724 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0725/1005] timekeeping: Refresh auxiliary base before offset validation Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0727/1005] tpm: Check return value of crypto_kpp_set_secret() Greg Kroah-Hartman
` (272 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Paul Menzel,
Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 03fcb358249dc715124b3616f814ea0ecc6ec36c upstream.
When devm_add_action() returns an error, tpm_read_log_acpi() clears
log->bios_event_log unnecessarily to NULL before calling
tpm_bios_log_free(), and it would lead to a memory leak of the
allocated log buffer.
Fix it by simply jumping to the err.
Cc: stable@vger.kernel.org # v6.18+
Fixes: a3a860bc0fd6 ("tpm: Change to kvalloc() in eventlog/acpi.c")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261109173756.742248-1-tiwai@suse.de
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/tpm/eventlog/acpi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/char/tpm/eventlog/acpi.c
+++ b/drivers/char/tpm/eventlog/acpi.c
@@ -167,10 +167,8 @@ int tpm_read_log_acpi(struct tpm_chip *c
}
ret = devm_add_action(&chip->dev, tpm_bios_log_free, log->bios_event_log);
- if (ret) {
- log->bios_event_log = NULL;
+ if (ret)
goto err;
- }
return format;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0727/1005] tpm: Check return value of crypto_kpp_set_secret()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (725 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0726/1005] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0728/1005] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
` (271 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Biggers, Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <ebiggers@kernel.org>
commit 8cff8f1c89d33e55c9af82177b14f6f9f6a899fe upstream.
crypto_kpp_set_secret() can fail, for example if the kernel is booted
with fips=1 and the broken-by-design FIPS RNG used for ECC private key
generation doesn't feel like generating random bytes at the moment.
Check for error, cancelling the TPM session creation rather than
proceeding with a zero or uninitialized private key.
Fixes: 699e3efd6c64 ("tpm: Add HMAC session start and end functions")
Cc: stable@vger.kernel.org # v6.12+
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261025211119.138277-1-ebiggers@kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/tpm/tpm2-sessions.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/char/tpm/tpm2-sessions.c
+++ b/drivers/char/tpm/tpm2-sessions.c
@@ -527,7 +527,9 @@ static int tpm_buf_append_salt(struct tp
}
crypto_ecdh_encode_key(encoded_key, buf_len, &p);
/* this generates a random private key */
- crypto_kpp_set_secret(kpp, encoded_key, buf_len);
+ rc = crypto_kpp_set_secret(kpp, encoded_key, buf_len);
+ if (rc)
+ goto err_free_kpp;
/* salt is now the public point of this private key */
req = kpp_request_alloc(kpp, GFP_KERNEL);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0728/1005] tpm: eventlog: check the payload size before reading tag events
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (726 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0727/1005] tpm: Check return value of crypto_kpp_set_secret() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0729/1005] tpm: flush timeout work outside buffer_mutex to avoid deadlock Greg Kroah-Hartman
` (270 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guanglei Zhu, Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanglei Zhu <zhugl3@xiaopeng.com>
commit 0a385f668ba77d29ae167c1668fd452418ebc9d6 upstream.
The EVENT_TAG branch of get_event_name() casts the event payload to
struct tcpa_pc_event and reads from it:
pc_event = (struct tcpa_pc_event *)event_entry;
switch (do_endian_conversion(pc_event->event_id)) {
...
for (i = 0; i < 20; i++)
d_len += sprintf(&data[2*i], "%02x",
pc_event->event_data[i]);
The log iterators only verify that the event header plus the declared
event_size stays within the log buffer; they do not require the
payload of an EVENT_TAG entry to be large enough for the fields the
branch reads. A truncated entry makes the branch read up to 20 bytes
of event_data[] past the end of the entry, and, for the last entry in
the log, past the end of the buffer itself.
The legacy PC Client spec defines the EV_EVENT_TAG payload as a
TCPA_PC_EVENT - event_id, event_size and event-type-specific data -
so a conformant entry carries the 8-byte header and the hash-type
ids carry a full digest. The log itself, however, is an ACPI table
the firmware leaves in memory: the TPM never measures the log, so
the kernel cannot tell a conformant log from a corrupted one. The
iterators already work on that assumption - they stop once the
declared event_size runs past the buffer end - and the readers
should apply the same rule to what they take off the payload.
Skip entries whose payload cannot even hold the event id, and skip
the 20-byte digest dump when the payload cannot hold the full
tcpa_pc_event header plus the digest, so the branch never reads
beyond the entry it is formatting.
Cc: stable@vger.kernel.org
Fixes: 55a82ab3181b ("[PATCH] tpm: add bios measurement log")
Signed-off-by: Guanglei Zhu <zhugl3@xiaopeng.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/tpm/eventlog/tpm1.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/char/tpm/eventlog/tpm1.c
+++ b/drivers/char/tpm/eventlog/tpm1.c
@@ -178,6 +178,10 @@ static int get_event_name(char *dest, st
}
break;
case EVENT_TAG:
+ if (do_endian_conversion(event->event_size) <
+ sizeof(pc_event->event_id))
+ break;
+
pc_event = (struct tcpa_pc_event *)event_entry;
/* ToDo Row data -> Base64 */
@@ -203,6 +207,9 @@ static int get_event_name(char *dest, st
name = tcpa_pc_event_id_strings[do_endian_conversion
(pc_event->event_id)];
n_len = strlen(name);
+ if (do_endian_conversion(event->event_size) <
+ sizeof(struct tcpa_pc_event) + 20)
+ break;
for (i = 0; i < 20; i++)
d_len += sprintf(&data[2*i], "%02x",
pc_event->event_data[i]);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0729/1005] tpm: flush timeout work outside buffer_mutex to avoid deadlock
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (727 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0728/1005] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0730/1005] spi: axi-spi-engine: Start the program length at zero Greg Kroah-Hartman
` (269 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hyunjung Ko, Jarkko Sakkinen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunjung Ko <hj351016@gmail.com>
commit c22052a012698ce56d599d75b669d55778521c7c upstream.
tpm_common_read() calls flush_work(&priv->timeout_work) under
priv->buffer_mutex, but tpm_timeout_work() also takes buffer_mutex, so a
running timeout work deadlocks the flush. Flush after unlocking; the timer
is deleted under the lock, so no new work can be queued.
Fixes: 9488585b21be ("tpm: add support for partial reads")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261108165812.676876-1-hj351016@gmail.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/tpm/tpm-dev-common.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- a/drivers/char/tpm/tpm-dev-common.c
+++ b/drivers/char/tpm/tpm-dev-common.c
@@ -132,6 +132,7 @@ ssize_t tpm_common_read(struct file *fil
{
struct file_priv *priv = file->private_data;
ssize_t ret_size = 0;
+ bool flush = false;
int rc;
if (!size)
@@ -164,9 +165,18 @@ out:
if (!priv->response_length) {
*off = 0;
timer_delete_sync(&priv->user_read_timer);
- flush_work(&priv->timeout_work);
+ flush = true;
}
mutex_unlock(&priv->buffer_mutex);
+
+ /*
+ * tpm_timeout_work() takes buffer_mutex, so flush it after dropping
+ * the mutex to avoid a deadlock; the timer is deleted above, so no new
+ * timeout work can be queued once the mutex is released.
+ */
+ if (flush)
+ flush_work(&priv->timeout_work);
+
return ret_size;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0730/1005] spi: axi-spi-engine: Start the program length at zero
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (728 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0729/1005] tpm: flush timeout work outside buffer_mutex to avoid deadlock Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0731/1005] spi: tegra210-quad: Track DMA mapping state Greg Kroah-Hartman
` (268 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dennis Gilmore, Kees Cook,
David Lechner, Mark Brown
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <kees@kernel.org>
commit 2a490521d74ac76e5eb3c9a69d928a4c76dd3f78 upstream.
spi_engine_optimize_message() allocates the program with kzalloc_flex(),
which sets the __counted_by() counter "length" to the allocated size when
the compiler supports __builtin_counted_by_ref(). The program is then
filled by spi_engine_program_add_cmd(), which increments "length" and
stores at length - 1, expecting it to start at zero as it did when the
program came from kzalloc().
Reset "length" after the allocation, since it is a "usage" counter, not
a "total allocation" counter.
Build tested ARCH=x86_64 defconfig with CONFIG_SPI_AXI_SPI_ENGINE=m and
W=1, with GCC 16.2.0.
Reported-by: Dennis Gilmore <dennis@ausil.us>
Closes: https://lore.kernel.org/all/20261112025252.71375-1-dennis@ausil.us/
Fixes: 69050f8d6d075 ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20261113065508.i.606-kees@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi-axi-spi-engine.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index ead5b295e680..9cfee409f15c 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -818,6 +818,8 @@ static int spi_engine_optimize_message(struct spi_message *msg)
p = kzalloc_flex(*p, instructions, p_dry.length + 1);
if (!p)
return -ENOMEM;
+ /* spi_engine_program_add_cmd() counts the instructions as it adds them. */
+ p->length = 0;
spi_engine_compile_message(msg, false, p);
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0731/1005] spi: tegra210-quad: Track DMA mapping state
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (729 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0730/1005] spi: axi-spi-engine: Start the program length at zero Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0732/1005] spi: tegra210-quad: Unmap DMA buffers on transfer timeout Greg Kroah-Hartman
` (267 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mark Brown, Vishwaroop A
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <va@nvidia.com>
commit 7b9e6f7bc13c0259b192d0a964e802d4ad53b8b8 upstream.
tegra_qspi_dma_unmap_xfer() assumes a streaming mapping is always
outstanding and recomputes its length from the live
tqspi->curr_dma_words. Nothing records whether tegra_qspi_dma_map_xfer()
mapped anything, so neither assumption holds.
For a multi-chunk transfer, handle_dma_based_xfer() unmaps the chunk that
just completed, recalculates the parameters for the next chunk, which
overwrites curr_dma_words, and re-arms the hardware. If
tegra_qspi_start_dma_based_transfer() then fails at its
tegra_qspi_dma_map_xfer() call, nothing is mapped. That early return also
sits above the smp_store_release() that clears tqspi->trans_status, so the
previous chunk's QSPI_RDY survives, and the re-arm's return value is never
checked, so handle_dma_based_xfer() returns IRQ_HANDLED without completing
the transfer.
The caller times out, tegra_qspi_handle_timeout() sees the stale QSPI_RDY,
concludes the transfer completed and calls handle_dma_based_xfer() again.
No DMA completion arrives, so num_errors is incremented and
tegra_qspi_dma_unmap_xfer() runs with nothing mapped. t->tx_dma then holds
either the DMA_MAPPING_ERROR sentinel or, if the RX mapping was the one
that failed, the preceding chunk's address that has already been released.
Behind an IOMMU the latter frees an IOVA that may since have been
reallocated.
Record whether a mapping is outstanding and the length that was mapped,
and return early from tegra_qspi_dma_unmap_xfer() when there is nothing to
release. is_dma_mapped is only updated under tqspi->lock, or on the timeout
path after synchronize_irq() and cancel_work_sync() have quiesced the ISR
and the bottom half.
Also skip releasing the TX mapping on the RX failure path unless a TX
mapping was created; t->tx_dma is uninitialised when t->tx_buf is NULL.
Fixes: 921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Suggested-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Vishwaroop A <va@nvidia.com>
Link: https://patch.msgid.link/20261026111412.3843954-3-va@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi-tegra210-quad.c | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -215,6 +215,17 @@ struct tegra_qspi {
bool is_packed;
bool use_dma;
+ /*
+ * Set while a streaming mapping created by
+ * tegra_qspi_dma_map_xfer() is outstanding, together with the
+ * length that was handed to dma_map_single(). is_curr_dma_xfer
+ * only records that the last armed chunk took the DMA path,
+ * which is not the same thing: a chunk whose mapping failed
+ * leaves the DMA path flagged with nothing mapped.
+ */
+ bool is_dma_mapped;
+ unsigned int dma_map_len;
+
u32 command1_reg;
u32 dma_control_reg;
u32 def_command1_reg;
@@ -584,24 +595,32 @@ static int tegra_qspi_dma_map_xfer(struc
if (t->rx_buf) {
t->rx_dma = dma_map_single(tqspi->rx_dma_dev, (void *)rx_buf, len, DMA_FROM_DEVICE);
if (dma_mapping_error(tqspi->rx_dma_dev, t->rx_dma)) {
- dma_unmap_single(tqspi->tx_dma_dev, t->tx_dma, len, DMA_TO_DEVICE);
+ if (t->tx_buf)
+ dma_unmap_single(tqspi->tx_dma_dev, t->tx_dma,
+ len, DMA_TO_DEVICE);
return -ENOMEM;
}
}
+ tqspi->dma_map_len = len;
+ tqspi->is_dma_mapped = true;
+
return 0;
}
static void tegra_qspi_dma_unmap_xfer(struct tegra_qspi *tqspi, struct spi_transfer *t)
{
- unsigned int len;
-
- len = DIV_ROUND_UP(tqspi->curr_dma_words * tqspi->bytes_per_word, 4) * 4;
+ if (!tqspi->is_dma_mapped)
+ return;
if (t->tx_buf)
- dma_unmap_single(tqspi->tx_dma_dev, t->tx_dma, len, DMA_TO_DEVICE);
+ dma_unmap_single(tqspi->tx_dma_dev, t->tx_dma,
+ tqspi->dma_map_len, DMA_TO_DEVICE);
if (t->rx_buf)
- dma_unmap_single(tqspi->rx_dma_dev, t->rx_dma, len, DMA_FROM_DEVICE);
+ dma_unmap_single(tqspi->rx_dma_dev, t->rx_dma,
+ tqspi->dma_map_len, DMA_FROM_DEVICE);
+
+ tqspi->is_dma_mapped = false;
}
static int tegra_qspi_start_dma_based_transfer(struct tegra_qspi *tqspi, struct spi_transfer *t)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0732/1005] spi: tegra210-quad: Unmap DMA buffers on transfer timeout
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (730 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0731/1005] spi: tegra210-quad: Track DMA mapping state Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0733/1005] watchdog: gunyah_wdt: Re-enable the watchdog on resume Greg Kroah-Hartman
` (266 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Vishwaroop A, Mark Brown
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <va@nvidia.com>
commit d04ad85dd8015713b0b2531b5b934fe67828d741 upstream.
tegra_qspi_start_dma_based_transfer() maps the client TX/RX buffers with
dma_map_single() via tegra_qspi_dma_map_xfer(). The matching unmap only
happens in handle_dma_based_xfer(), which runs from the interrupt bottom
half.
When wait_for_completion_timeout() expires and tegra_qspi_handle_timeout()
cannot establish that the hardware finished, it returns an error without
the bottom half ever having run. Both transfer paths then abort the
transfer with tegra_qspi_dma_stop(), reset the controller and clear
curr_xfer, but never unmap the buffers. Every genuine transfer timeout
therefore leaks the streaming DMA mappings for that chunk, which
gradually exhausts the IOVA space on systems with an IOMMU in front of
QSPI.
Unmap the transfer after stopping DMA on both timeout error paths. The
unmap is placed after tegra_qspi_dma_stop() so the DMA engine is
quiesced before the mappings go away.
The recovery paths that do reach handle_dma_based_xfer() unmap there
themselves. The preceding patch makes tegra_qspi_dma_unmap_xfer() a no-op
once the mapping is released, so this cleanup cannot unmap twice or run
against a chunk that was never mapped.
Fixes: 921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Cc: stable@vger.kernel.org # with "spi: tegra210-quad: Track DMA mapping state"
Signed-off-by: Vishwaroop A <va@nvidia.com>
Link: https://patch.msgid.link/20261026111412.3843954-4-va@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi-tegra210-quad.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1262,10 +1262,12 @@ static int tegra_qspi_combined_seq_xfer(
dev_err(tqspi->dev, "transfer timeout\n");
/* Abort transfer by resetting pio/dma bit */
- if (tqspi->is_curr_dma_xfer)
+ if (tqspi->is_curr_dma_xfer) {
tegra_qspi_dma_stop(tqspi);
- else
+ tegra_qspi_dma_unmap_xfer(tqspi, xfer);
+ } else {
tegra_qspi_pio_stop(tqspi);
+ }
/* Reset controller if timeout happens */
tegra_qspi_reset(tqspi);
@@ -1379,8 +1381,10 @@ static int tegra_qspi_non_combined_seq_x
WARN_ON(1);
dev_err(tqspi->dev, "transfer timeout\n");
- if (tqspi->is_curr_dma_xfer)
+ if (tqspi->is_curr_dma_xfer) {
tegra_qspi_dma_stop(tqspi);
+ tegra_qspi_dma_unmap_xfer(tqspi, xfer);
+ }
tegra_qspi_handle_error(tqspi);
ret = -EIO;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0733/1005] watchdog: gunyah_wdt: Re-enable the watchdog on resume
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (731 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0732/1005] spi: tegra210-quad: Unmap DMA buffers on transfer timeout Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0734/1005] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog Greg Kroah-Hartman
` (265 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Aleksandrov <lightofmysoul@gmail.com>
commit f0dfc756bb46235068279755249131c2a7130111 upstream.
gunyah_wdt_suspend() disables an active watchdog, and
gunyah_wdt_resume() enables it again with gunyah_wdt_start(). start()
first disables the watchdog, which fails with -EINVAL when it is
already disabled. start() ignores that only while the watchdog is
inactive, but on resume it is still active for the watchdog core, so
start() returns before it enables the watchdog:
gunyah-wdt gunyah-wdt: gunyah_wdt_start: Failed to stop gunyah wdt -22
So after every system suspend, the watchdog is left disabled.
Move setting the timeout and enabling the watchdog into
gunyah_wdt_enable(), and call it on resume, where the watchdog is
already disabled.
Tested on the Samsung Galaxy XR (Qualcomm Halliday) with s2idle and
deep suspend.
Fixes: ca316e145c35 ("watchdog: Add driver for Gunyah Watchdog")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Link: https://patch.msgid.link/20261109-gunyah-wdt-resume-v1-1-fbd84545ce92@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/watchdog/gunyah_wdt.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/drivers/watchdog/gunyah_wdt.c b/drivers/watchdog/gunyah_wdt.c
index e3c2a2131624..35958594e17c 100644
--- a/drivers/watchdog/gunyah_wdt.c
+++ b/drivers/watchdog/gunyah_wdt.c
@@ -62,19 +62,12 @@ static int gunyah_wdt_call(unsigned long func_id, unsigned long arg1,
return gunyah_error_remap(res.a0);
}
-static int gunyah_wdt_start(struct watchdog_device *wdd)
+static int gunyah_wdt_enable(struct watchdog_device *wdd)
{
- unsigned int timeout_ms;
+ unsigned int timeout_ms = wdd->timeout * 1000;
struct device *dev = wdd->parent;
int ret;
- ret = gunyah_wdt_call(GUNYAH_WDT_CONTROL, WDT_CTRL_DISABLE, 0);
- if (ret && watchdog_active(wdd)) {
- dev_err(dev, "%s: Failed to stop gunyah wdt %d\n", __func__, ret);
- return ret;
- }
-
- timeout_ms = wdd->timeout * 1000;
ret = gunyah_wdt_call(GUNYAH_WDT_SET_TIME, timeout_ms, timeout_ms);
if (ret) {
dev_err(dev, "%s: Failed to set timeout for gunyah wdt %d\n",
@@ -89,6 +82,20 @@ static int gunyah_wdt_start(struct watchdog_device *wdd)
return ret;
}
+static int gunyah_wdt_start(struct watchdog_device *wdd)
+{
+ struct device *dev = wdd->parent;
+ int ret;
+
+ ret = gunyah_wdt_call(GUNYAH_WDT_CONTROL, WDT_CTRL_DISABLE, 0);
+ if (ret && watchdog_active(wdd)) {
+ dev_err(dev, "%s: Failed to stop gunyah wdt %d\n", __func__, ret);
+ return ret;
+ }
+
+ return gunyah_wdt_enable(wdd);
+}
+
static int gunyah_wdt_stop(struct watchdog_device *wdd)
{
return gunyah_wdt_call(GUNYAH_WDT_CONTROL, WDT_CTRL_DISABLE, 0);
@@ -224,7 +231,7 @@ static int gunyah_wdt_resume(struct device *dev)
struct watchdog_device *wdd = dev_get_drvdata(dev);
if (watchdog_active(wdd))
- gunyah_wdt_start(wdd);
+ gunyah_wdt_enable(wdd);
return 0;
}
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0734/1005] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (732 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0733/1005] watchdog: gunyah_wdt: Re-enable the watchdog on resume Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0735/1005] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
` (264 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Feng, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
commit 57c7cbe21acc77291ec0fbdd4bd72aa259cf4986 upstream.
npcm_wdt_start() unconditionally prepares and enables the watchdog
clock, and npcm_wdt_stop() is the only place that disables it.
npcm_wdt_set_timeout() calls npcm_wdt_start() again whenever the
watchdog is already active, so every WDIOC_SETTIMEOUT ioctl issued
while the watchdog is running takes one extra clock prepare/enable
reference that is never dropped.
Split the register programming out of npcm_wdt_start() into a
__npcm_wdt_start() helper that assumes the clock is already running,
and call the helper from npcm_wdt_set_timeout() instead; only the
watchdog .start callback (and the restart path, which intentionally
keeps the clock) now acquires the clock.
Fixes: af084fdccfaf ("watchdog: npcm: Enable clock if provided")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261109071004.1506-1-zhaofeng2@cmss.chinamobile.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/watchdog/npcm_wdt.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/drivers/watchdog/npcm_wdt.c
+++ b/drivers/watchdog/npcm_wdt.c
@@ -145,13 +145,11 @@ static int npcm_wdt_ping(struct watchdog
return 0;
}
-static int npcm_wdt_start(struct watchdog_device *wdd)
+static void __npcm_wdt_start(struct watchdog_device *wdd)
{
struct npcm_wdt *wdt = to_npcm_wdt(wdd);
u32 val;
- clk_prepare_enable(wdt->clk);
-
if (wdd->timeout < 2)
val = 0x800;
else if (wdd->timeout < 3)
@@ -176,6 +174,15 @@ static int npcm_wdt_start(struct watchdo
val |= NPCM_WTRE | NPCM_WTE | NPCM_WTR | NPCM_WTIE;
writel(val, wdt->reg);
+}
+
+static int npcm_wdt_start(struct watchdog_device *wdd)
+{
+ struct npcm_wdt *wdt = to_npcm_wdt(wdd);
+
+ clk_prepare_enable(wdt->clk);
+
+ __npcm_wdt_start(wdd);
return 0;
}
@@ -216,7 +223,7 @@ static int npcm_wdt_set_timeout(struct w
wdd->timeout = 2750;
if (watchdog_active(wdd))
- npcm_wdt_start(wdd);
+ __npcm_wdt_start(wdd);
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0735/1005] watchdog: rzv2h: Use pm_runtime_put_sync()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (733 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0734/1005] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0736/1005] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init Greg Kroah-Hartman
` (263 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Lad Prabhakar, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
commit ca800e625d18a9f5b19f94ab837ceb3fccdca22f upstream.
pm_runtime_put() may trigger the idle check after pm_runtime_disable()
is run as part of devm_pm_runtime_enable()'s cleanup action, leaving
runtime PM active.
Use pm_runtime_put_sync() to ensure the idle check runs synchronously.
Fixes: f6febd0a30b6e ("watchdog: Add Watchdog Timer driver for RZ/V2H(P)")
Cc: stable@vger.kernel.org
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20261001165201.763882-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/watchdog/rzv2h_wdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -174,7 +174,7 @@ static int rzv2h_wdt_stop(struct watchdo
if (priv->of_data->wdtdcr)
rzt2h_wdt_wdtdcr_count_stop(priv);
- pm_runtime_put(wdev->parent);
+ pm_runtime_put_sync(wdev->parent);
return 0;
}
@@ -268,7 +268,7 @@ static int rzt2h_wdt_wdtdcr_init(struct
rzt2h_wdt_wdtdcr_count_stop(priv);
- pm_runtime_put(&pdev->dev);
+ pm_runtime_put_sync(&pdev->dev);
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0736/1005] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (734 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0735/1005] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0737/1005] x86/CPU/AMD: Dont print reset reason in VMs Greg Kroah-Hartman
` (262 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Lad Prabhakar, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
commit f00afd5d8d5dc03994cb67246543d5c70571ebbe upstream.
WDTDCR is located in the CPG region, outside the watchdog module, and is
accessible regardless of the watchdog's clocks and reset state.
Drop the unnecessary runtime PM handling from WDTDCR initialization and
access the register directly.
Fixes: f6febd0a30b6e ("watchdog: Add Watchdog Timer driver for RZ/V2H(P)")
Cc: stable@vger.kernel.org
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20261001165201.763882-5-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/watchdog/rzv2h_wdt.c | 8 --------
1 file changed, 8 deletions(-)
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -256,20 +256,12 @@ static const struct watchdog_ops rzv2h_w
static int rzt2h_wdt_wdtdcr_init(struct platform_device *pdev,
struct rzv2h_wdt_priv *priv)
{
- int ret;
-
priv->wdtdcr = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(priv->wdtdcr))
return PTR_ERR(priv->wdtdcr);
- ret = pm_runtime_resume_and_get(&pdev->dev);
- if (ret)
- return ret;
-
rzt2h_wdt_wdtdcr_count_stop(priv);
- pm_runtime_put_sync(&pdev->dev);
-
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0737/1005] x86/CPU/AMD: Dont print reset reason in VMs
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (735 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0736/1005] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0738/1005] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
` (261 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Borislav Petkov, Jason Andryuk,
Mario Limonciello (AMD), Yazen Ghannam, Juergen Gross
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Andryuk <jason.andryuk@amd.com>
commit ea51d1a4c31fc8320c34f897dc5296a0bfc5c7ca upstream.
print_s5_reset_status_mmio() expects to read FCH MMIO on baremetal. VMs don't
have emulated FCH registers, so there is nothing to check. Add an early exit
when running on a hypervisor.
The real motivation is Xen PV domUs can't boot on Zen CPUs. PV domUs PTEs
contain system physical addresses - they don't have the concept of guest
physical addresses. domUs can only map physical addresses they are assigned, so
a domU fails to map the FCH MMIO addresses.
However set_pte() does not return failure, so ioremap() returns a pointer while
the PTEs are unpopulated. print_s5_reset_status_mmio() faults when reading
through the pointer, breaking the boot.
Limit the reset reason printing to baremetal only where it actually makes sense.
[ bp: Massage commit message. ]
Fixes: ab8131028710 ("x86/CPU/AMD: Print the reason for the last reset")
Suggested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261104013026.185392-1-jason.andryuk@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/cpu/amd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1362,7 +1362,8 @@ static __init int print_s5_reset_status_
u32 value;
int i;
- if (!cpu_feature_enabled(X86_FEATURE_ZEN))
+ if (!cpu_feature_enabled(X86_FEATURE_ZEN) ||
+ cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
return 0;
addr = ioremap(FCH_PM_BASE + FCH_PM_S5_RESET_STATUS, sizeof(value));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0738/1005] x86/mm: Ensure write visibility during LDT installation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (736 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0737/1005] x86/CPU/AMD: Dont print reset reason in VMs Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0739/1005] x86/video: Preserve the default VGA fallback for legacy modes Greg Kroah-Hartman
` (260 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jaeyoung Chung, Dave Hansen,
Ingo Molnar, Linus Torvalds, Peter Zijlstra (Intel)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Hansen <dave.hansen@linux.intel.com>
commit 0dc2a4dac3d04e9e4479aeb0b46172feab1cca0a upstream.
During LDT installation, the intent is to overwrite the old per-mm
LDT value, then send an IPI to the mm user CPUs to have each load
the new value.
But there is an ordering problem: a new mm user CPU sets itself in
mm_cpumask() and then reads mm->context.ldt. The LDT-installing CPU
writes mm->context.ldt and then reads mm_cpumask(). But, there is
nothing which orders the LDT installation side actions. The CPU
can read mm_cpumask() before its write becomes visible.
Ensure that new mm user CPUs see the new mm->context.ldt. Make
mm->context.ldt visible before reading mm_cpumask().
Also convert the smp_store_release() over to a WRITE_ONCE().
smp_store_release() has an internal barrier which is weaker than
the new smp_mb(). Avoid an extra barrier by converting it to
WRITE_ONCE().
Also refresh/correct misleading comments. READ/WRITE_ONCE() do not
"synchronize" anything themselves.
Reported-by: Jaeyoung Chung <jjy600901@snu.ac.kr>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Jaeyoung Chung <jjy600901@snu.ac.kr>
Acked-by: Linus Torvalds <torvalds@linuxfoundation.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/ldt.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -43,7 +43,7 @@ void load_mm_ldt(struct mm_struct *mm)
{
struct ldt_struct *ldt;
- /* READ_ONCE synchronizes with smp_store_release */
+ /* Pairs with WRITE_ONCE() in install_ldt() */
ldt = READ_ONCE(mm->context.ldt);
/*
@@ -422,8 +422,14 @@ static void install_ldt(struct mm_struct
{
mutex_lock(&mm->context.lock);
- /* Synchronizes with READ_ONCE in load_mm_ldt. */
- smp_store_release(&mm->context.ldt, ldt);
+ /*
+ * Ensure that new mm user CPUs either see the new LDT value
+ * or get an IPI. Make the store visible before reading
+ * mm_cpumask(). New mm users make their mm_cpumask() writes
+ * visible before reading mm->context.ldt.
+ */
+ WRITE_ONCE(mm->context.ldt, ldt);
+ smp_mb();
/* Activate the LDT for all CPUs using currents mm. */
on_each_cpu_mask(mm_cpumask(mm), flush_ldt, mm, true);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0739/1005] x86/video: Preserve the default VGA fallback for legacy modes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (737 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0738/1005] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0740/1005] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
` (259 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hengyu Liang, Borislav Petkov (AMD),
Mario Limonciello (AMD), Thomas Zimmermann
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hengyu Liang <hengyul@cs.unc.edu>
commit 3b4c98b47ba7c3c57bcf54fb85f54a854622041c upstream.
Commit
596b3678326d ("x86/video: Only fall back to vga_default_device() without screen info")
made video_is_primary_device() rely exclusively on screen_info resources
whenever any are available.
However, screen_info_resources() also returns legacy I/O and memory ranges for
VGA text modes. These ranges are not PCI BARs, so pci_find_resource() does not
find them and the default VGA fallback is skipped. As a result, no device is
primary in VGA text mode.
On a SeaBIOS QEMU guest with bochs and VKMS, the boot VGA (bochs) loses its
DRM boot_display attribute. VKMS registers fb0 and bochs registers fb1. VKMS
is not a PCI device, so it is not primary either. With no primary device,
fbcon keeps the console on fb0 and never remaps it to bochs. This can be
checked with:
cat /sys/class/drm/card1/boot_display
stty -F /dev/tty1 size
Without the fix, boot_display is missing and tty1 is 48 rows by 128 columns.
With it, boot_display contains 1 and tty1 is 50 rows by 160 columns. VKMS only
makes the console part visible. Without VKMS, tty1 has the same size with and
without the fix, but boot_display is still missing without it.
Use resource-based selection only for linear framebuffers. Fall back to
vga_default_device() for legacy display modes, while keeping EFI and VESA
framebuffer ownership authoritative.
Fixes: 596b3678326d ("x86/video: Only fall back to vga_default_device() without screen info")
Signed-off-by: Hengyu Liang <hengyul@cs.unc.edu>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261103031630.2085194-1-hengyul@cs.unc.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/video/video-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/video/video-common.c
+++ b/arch/x86/video/video-common.c
@@ -45,7 +45,7 @@ bool video_is_primary_device(struct devi
#ifdef CONFIG_SCREEN_INFO
numres = screen_info_resources(si, res, ARRAY_SIZE(res));
- if (numres > 0) {
+ if (numres > 0 && __screen_info_has_lfb(screen_info_video_type(si))) {
for (i = 0; i < numres; ++i) {
if (!(res[i].flags & IORESOURCE_MEM))
continue;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0740/1005] xen/gntdev: fix deadlock between map ioctl and mmap
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (738 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0739/1005] x86/video: Preserve the default VGA fallback for legacy modes Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0741/1005] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
` (258 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Juergen Gross
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Misiurov <andrey.misyrov@gmail.com>
commit 7620a997e4854c94eacebf0c2d453fbd78ccdb46 upstream.
Commit 45ca1afe2fd1 ("xen/gntdev: fix error handling in ioctl") moved
copy_to_user() in gntdev_ioctl_map_grant_ref() under priv->lock. A
fault in copy_to_user() takes mmap_lock, while gntdev_mmap() is called
with mmap_lock held and takes priv->lock:
ioctl thread mmap thread
mutex_lock(&priv->lock)
mmap_write_lock(mm)
gntdev_mmap()
mutex_lock(&priv->lock)
copy_to_user() faults
mmap_read_lock(mm)
Reproduced on Debian 6.12.111 in a Xen guest, with the ioctl argument
on a MAP_PRIVATE file page that has not been written yet. sysrq-w:
task:repro state:D stack:0 pid:4479 tgid:4477 ppid:1 flags:0x00000000
rwsem_down_read_slowpath+0x25c/0x480
down_read_killable+0x48/0xc0
lock_mm_and_find_vma+0x96/0x250
do_user_addr_fault+0x12d/0x620
exc_page_fault+0x7e/0x180
asm_exc_page_fault+0x26/0x30
_copy_to_user+0x36/0x50
gntdev_ioctl+0x3b9/0xa00 [xen_gntdev]
__x64_sys_ioctl+0x97/0xc0
task:repro state:D stack:0 pid:4480 tgid:4477 ppid:1 flags:0x00000000
__mutex_lock.constprop.0+0x41b/0x720
gntdev_mmap+0x4d/0x330 [xen_gntdev]
__mmap_region+0x697/0xb10
mmap_region+0x78/0xa0
do_mmap+0x45d/0x630
vm_mmap_pgoff+0xf8/0x1c0
Drop priv->lock before copy_to_user() again. On failure, re-take it
and remove the map by index, as IOCTL_GNTDEV_UNMAP_GRANT_REF does,
since another thread may have unmapped it meanwhile.
Fixes: 45ca1afe2fd1 ("xen/gntdev: fix error handling in ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Misiurov <andrey.misyrov@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261013170745.583279-1-andrey.misyrov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/gntdev.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -670,15 +670,19 @@ static long gntdev_ioctl_map_grant_ref(s
mutex_lock(&priv->lock);
gntdev_add_map(priv, map);
op.index = map->index << PAGE_SHIFT;
+ mutex_unlock(&priv->lock);
if (copy_to_user(u, &op, sizeof(op)) != 0) {
- list_del(&map->next);
+ mutex_lock(&priv->lock);
+ map = gntdev_find_map_index(priv, op.index >> PAGE_SHIFT,
+ op.count);
+ if (map)
+ list_del(&map->next);
mutex_unlock(&priv->lock);
gntdev_put_map(priv, map);
return -EFAULT;
}
- mutex_unlock(&priv->lock);
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0741/1005] xen/privcmd: fix double free when an irqfd is shut down twice
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (739 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0740/1005] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0742/1005] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
` (257 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Qihang, Juergen Gross
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qihang <q.h.hack.winter@gmail.com>
commit 72a900c666adb97df77b05cf8540c4117f9c83ba upstream.
irqfd_deactivate() takes the irqfd off irqfds_list and queues
irqfd_shutdown(). queue_work() is not a once-only gate: it refuses to
enqueue a work item only while WORK_STRUCT_PENDING is set, and
process_one_work() clears that bit before it calls the work function. So
nothing records that the shutdown work has already been queued, and
nothing protects the window between the start of irqfd_shutdown() and the
kfree() at its end.
Two paths call irqfd_deactivate() for the same irqfd:
- privcmd_irqfd_deassign(), from the PRIVCMD_IRQFD_FLAG_DEASSIGN ioctl;
- irqfd_wakeup(), with EPOLLHUP set, when the last reference to the
eventfd file goes away, which runs wake_up_poll(&ctx->wqh, EPOLLHUP)
from eventfd_release().
irqfds_lock serialises the two calls, but it does not make the second one
a no-op, and eventfd_ctx_fdget() takes a reference to the eventfd_ctx,
not to the struct file, so the last fd can still be closed while the
ioctl is running:
CPU0 CPU1
eventfd_ctx_fdget()
spin_lock(irqfds_lock)
list_del_init(&kirqfd->list)
queue_work(&kirqfd->shutdown) close(fd)
eventfd_release()
wake_up_poll(EPOLLHUP)
irqfd_wakeup()
spin_lock(irqfds_lock)
irqfd_deactivate() again
If the work item has already started by then, its pending bit has been
cleared and the second queue_work() succeeds. irqfd_shutdown() then runs
twice, so eventfd_ctx_remove_wait_queue(), eventfd_ctx_put() and kfree()
each hit the same object a second time; and when the second queue_work()
lands after the irqfd has been freed, the workqueue list operations write
to freed memory.
virt/kvm/eventfd.c has the same two callers and has had this guard since
the original irqfd support (721eecbf4fe99): irqfd_wakeup() calls
irqfd_deactivate() only if irqfd_is_active(). The comment there explains
why that is enough: the other side deactivates the irqfd before it takes
it off the waitqueue, and irqfd_shutdown() needs the waitqueue lock,
which this callback holds, so the irqfd cannot be freed under it.
Do the same here. list_del_init() leaves the list head empty and the
irqfd stays off the list until kfree(), so it serves as a one-way
"active" flag. The test is in irqfd_deactivate() rather than in
irqfd_wakeup() because privcmd_irqfd_deassign() walks irqfds_list and can
therefore never reach an inactive irqfd; only the wakeup path can, and a
single test covers both callers.
Fixes: f8941e6c4c712 ("xen: privcmd: Add support for irqfd")
Cc: stable@vger.kernel.org
Signed-off-by: Qihang <q.h.hack.winter@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261101163251.55099-1-q.h.hack.winter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/privcmd.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -901,10 +901,25 @@ struct privcmd_kernel_irqfd {
poll_table pt;
};
+static bool irqfd_is_active(struct privcmd_kernel_irqfd *kirqfd)
+{
+ lockdep_assert_held(&irqfds_lock);
+
+ return !list_empty(&kirqfd->list);
+}
+
static void irqfd_deactivate(struct privcmd_kernel_irqfd *kirqfd)
{
lockdep_assert_held(&irqfds_lock);
+ /*
+ * Both the deassign ioctl and the eventfd wakeup path can reach
+ * this function. list_del_init() marks the irqfd inactive, so
+ * only the first caller may queue the shutdown work.
+ */
+ if (!irqfd_is_active(kirqfd))
+ return;
+
list_del_init(&kirqfd->list);
queue_work(irqfd_cleanup_wq, &kirqfd->shutdown);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0742/1005] xen/pvcalls: unwind pvcalls_new_active_socket() step by step
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (740 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0741/1005] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0743/1005] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
` (256 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Stabellini, Yehyeong Lee,
Juergen Gross
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 702ba3c80a8736898813a2c7484d695278aa114d upstream.
Every error path in pvcalls_new_active_socket() jumps to one shared label
that does list_del(&map->list) and then hands map to
pvcalls_back_release_active(). But map comes from kzalloc() and its
list_head is only published at the very end of the function, after the last
of those jumps:
down(&fedata->socket_lock);
list_add_tail(&map->list, &fedata->socket_mappings);
up(&fedata->socket_lock);
so on the error path map->list is still {NULL, NULL} and __list_del()
writes through a NULL pointer.
A frontend gets there with one value it owns: the ring_order field of the
page it granted. Anything above MAX_RING_ORDER takes the second goto, and
nothing else in the function has run by then.
The result is an oops in whichever context handled the request - the
pvcalls-back threaded IRQ handler for PVCALLS_CONNECT, mappass->wq for
PVCALLS_ACCEPT - and because it happens after down(&fedata->socket_lock)
that semaphore is never released, so every later operation on the frontend
blocks on it and the backend never completes backend_disconnect(). (With
CONFIG_DEBUG_LIST the list_del() only reports and returns, and
pvcalls_back_release_active() then runs on a map whose irq is still 0 and
whose bytes, ioworker.wq and saved_data_ready are all NULL.)
A frontend asking for ring_order 5, on a dom0 built with KASAN
(the request was issued by a test-only change to the frontend):
[ 133.728877] pvcalls_new_active_socket frontend requested ring_order 5, which is > MAX (4)
[ 133.732868] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
[ 133.737910] KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
[ 133.741666] CPU: 0 UID: 0 PID: 133 Comm: irq/39-pvcalls- Not tainted 7.3.0-kCTLblk2-15482-g21a7f44fd076-dirty #1 PREEMPT(full)
[ 133.746986] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 133.751512] RIP: 0010:pvcalls_new_active_socket+0x821/0xb90
[ 133.754237] Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 f6 01 00 00 48 8d 79 08 4c 8b 6b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 14 02 00 00 4c 89 ea 4c 89 69 08 48 b8 00 00 00
[ 133.763126] RSP: 0018:ffffc900004afb38 EFLAGS: 00010202
[ 133.765861] RAX: dffffc0000000000 RBX: ffff88810886c900 RCX: 0000000000000000
[ 133.769348] RDX: 0000000000000001 RSI: 0000000000000246 RDI: 0000000000000008
[ 133.772787] RBP: 1ffff92000095f6b R08: 0000000000000001 R09: fffff52000095f58
[ 133.776260] R10: 0000000000000003 R11: ffff888100077320 R12: ffff88810858b410
[ 133.779823] R13: 0000000000000000 R14: ffff88810858b460 R15: ffff88810858b400
[ 133.783382] FS: 0000000000000000(0000) GS:ffff8881b034c000(0000) knlGS:0000000000000000
[ 133.787351] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 133.790308] CR2: 00000000006042c0 CR3: 0000000108400001 CR4: 0000000000770ef0
[ 133.793822] PKRU: 55555554
[ 133.795347] Call Trace:
[ 133.796778] <TASK>
[ 133.798082] ? __pfx_pvcalls_new_active_socket+0x10/0x10
[ 133.800801] ? security_socket_post_create+0x4d/0x60
[ 133.803275] ? release_sock+0x1a/0x1d0
[ 133.805182] pvcalls_back_event+0x1b09/0x23e0
[ 133.807431] ? __pfx_pvcalls_back_event+0x10/0x10
[ 133.809814] ? __pfx__raw_spin_lock_irqsave+0x10/0x10
[ 133.812251] ? __pfx_pvcalls_back_event+0x10/0x10
[ 133.814554] irq_thread_fn+0x86/0x150
[ 133.816468] irq_thread+0x2da/0x580
[ 133.818363] ? __pfx_irq_thread_fn+0x10/0x10
[ 133.820586] ? __pfx_irq_thread+0x10/0x10
[ 133.822670] ? __kthread_parkme+0x88/0x170
[ 133.824803] ? __pfx_irq_thread+0x10/0x10
[ 133.827153] ? __pfx_irq_thread+0x10/0x10
[ 133.829304] kthread+0x2c8/0x3b0
[ 133.831176] ? recalc_sigpending+0x15c/0x1e0
[ 133.833570] ? __pfx_kthread+0x10/0x10
[ 133.835572] ret_from_fork+0x373/0x5b0
[ 133.837581] ? __pfx_ret_from_fork+0x10/0x10
[ 133.839978] ? __switch_to+0x3c4/0xb40
[ 133.841984] ? __pfx_kthread+0x10/0x10
[ 133.843970] ret_from_fork_asm+0x1a/0x30
[ 133.846031] </TASK>
[ 133.847420] Modules linked in:
[ 133.849240] ---[ end trace 0000000000000000 ]---
Give each failure its own label, so that only resources that were actually
acquired are released and the list the map was never added to is left
alone. The map is not published anywhere at that point, so the error path
needs no socket_lock at all. sock_release() stays in the callee on every
error path, the way
commit 8fafac202d18 ("xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()")
arranged it.
Fixes: 5db4d286a8ef ("xen/pvcalls: implement connect command")
Cc: stable@vger.kernel.org
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261110125002.46683-2-yhlee@isslab.korea.ac.kr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/pvcalls-back.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -337,7 +337,7 @@ static struct sock_mapping *pvcalls_new_
ret = xenbus_map_ring_valloc(fedata->dev, &ref, 1, &page);
if (ret < 0)
- goto out;
+ goto out_map;
map->ring = page;
map->ring_order = map->ring->ring_order;
/* first read the order, then map the data ring */
@@ -345,19 +345,19 @@ static struct sock_mapping *pvcalls_new_
if (map->ring_order > MAX_RING_ORDER) {
pr_warn("%s frontend requested ring_order %u, which is > MAX (%u)\n",
__func__, map->ring_order, MAX_RING_ORDER);
- goto out;
+ goto out_unmap_ring;
}
ret = xenbus_map_ring_valloc(fedata->dev, map->ring->ref,
(1 << map->ring_order), &page);
if (ret < 0)
- goto out;
+ goto out_unmap_ring;
map->bytes = page;
ret = bind_interdomain_evtchn_to_irqhandler_lateeoi(
fedata->dev, evtchn,
pvcalls_back_conn_event, 0, "pvcalls-backend", map);
if (ret < 0)
- goto out;
+ goto out_unmap_bytes;
map->irq = ret;
map->data.in = map->bytes;
@@ -365,7 +365,7 @@ static struct sock_mapping *pvcalls_new_
map->ioworker.wq = alloc_ordered_workqueue("pvcalls_io", 0);
if (!map->ioworker.wq)
- goto out;
+ goto out_unbind;
atomic_set(&map->io, 1);
INIT_WORK(&map->ioworker.register_work, pvcalls_back_ioworker);
@@ -381,11 +381,16 @@ static struct sock_mapping *pvcalls_new_
write_unlock_bh(&map->sock->sk->sk_callback_lock);
return map;
-out:
- down(&fedata->socket_lock);
- list_del(&map->list);
- pvcalls_back_release_active(fedata->dev, fedata, map);
- up(&fedata->socket_lock);
+
+out_unbind:
+ unbind_from_irqhandler(map->irq, map);
+out_unmap_bytes:
+ xenbus_unmap_ring_vfree(fedata->dev, map->bytes);
+out_unmap_ring:
+ xenbus_unmap_ring_vfree(fedata->dev, (void *)map->ring);
+out_map:
+ sock_release(sock);
+ kfree(map);
return NULL;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0743/1005] xen/pvcalls: destroy the per-socket workqueue on release
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (741 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0742/1005] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0744/1005] kbuild: rust: support stabilized flag `-Cprofile-sample-use` for Rust >= 1.100 Greg Kroah-Hartman
` (255 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Stabellini, Yehyeong Lee,
Juergen Gross
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 6b3feb6bfa9ac384f7a3ec25c40b9b4d3da96d25 upstream.
pvcalls_new_active_socket() gives every active socket its own ordered
workqueue:
map->ioworker.wq = alloc_ordered_workqueue("pvcalls_io", 0);
and nothing ever destroys it. pvcalls_back_release_active() flushes
map->ioworker.register_work and frees map, but the workqueue and its
pool_workqueues stay allocated, so a frontend leaks a workqueue per socket
it connects and releases - a loop a guest can run as long as it likes.
Destroy it right after flush_work(): the IRQ is disabled and sk_data_ready
restored by then, so nothing can queue new work, and the rings are still
mapped while it drains - pvcalls_conn_back_read() reads map->ring and
map->data, which xenbus_unmap_ring_vfree() takes away a few lines later.
pvcalls_back_ioworker() does not take fedata->socket_lock, which the
backend_disconnect() caller holds here - only the socket's own
sk_receive_queue lock - so draining it from this point is safe; the
flush_work() just above already has the same requirement.
Fixes: 5db4d286a8ef ("xen/pvcalls: implement connect command")
Cc: stable@vger.kernel.org
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20261110125002.46683-3-yhlee@isslab.korea.ac.kr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/xen/pvcalls-back.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -452,6 +452,7 @@ static int pvcalls_back_release_active(s
atomic_set(&map->release, 1);
flush_work(&map->ioworker.register_work);
+ destroy_workqueue(map->ioworker.wq);
xenbus_unmap_ring_vfree(dev, map->bytes);
xenbus_unmap_ring_vfree(dev, (void *)map->ring);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0744/1005] kbuild: rust: support stabilized flag `-Cprofile-sample-use` for Rust >= 1.100
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (742 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0743/1005] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0745/1005] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
` (254 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alice Ryhl, Nicolas Schier,
Miguel Ojeda
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miguel Ojeda <ojeda@kernel.org>
commit 1178120c3bed1733aea1c465200a6b42f8a7105d upstream.
Starting with Rust 1.100.0 (expected 2026-11-12), the
`-Zprofile-sample-use` flag has been stabilized as
`-Cprofile-sample-use` and the former is not available anymore [1].
Without this change, when building with `CLANG_AUTOFDO_PROFILE` set, one
gets in the latest betas and nightlies:
error: unknown unstable option: `profile-sample-use`
Thus pass the right name.
Cc: stable@vger.kernel.org # 7.3.x
Link: https://github.com/rust-lang/rust/pull/155942 [1]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20261106073528.93371-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
scripts/Makefile.autofdo | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Makefile.autofdo b/scripts/Makefile.autofdo
index 57a3aba6ffc2..32c18df237f1 100644
--- a/scripts/Makefile.autofdo
+++ b/scripts/Makefile.autofdo
@@ -13,7 +13,7 @@ endif
ifdef CLANG_AUTOFDO_PROFILE
CFLAGS_AUTOFDO_CLANG += -fprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -ffunction-sections
CFLAGS_AUTOFDO_CLANG += -fsplit-machine-functions
- RUSTFLAGS_AUTOFDO_CLANG += -Zprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -Zfunction-sections=y
+ RUSTFLAGS_AUTOFDO_CLANG += $(if $(call rustc-min-version,110000),-Cprofile-sample-use,-Zprofile-sample-use)=$(CLANG_AUTOFDO_PROFILE) -Zfunction-sections=y
RUSTFLAGS_AUTOFDO_CLANG += -Cllvm-args=-split-machine-functions
endif
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0745/1005] hwmon: (aht10) Fix update_interval overflow on 64-bit
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (743 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0744/1005] kbuild: rust: support stabilized flag `-Cprofile-sample-use` for Rust >= 1.100 Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0746/1005] hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown Greg Kroah-Hartman
` (253 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rupesh Majhi, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rupesh Majhi <zoone.rupert@gmail.com>
commit b5c5b67e02406fb48acf57cf2c30a570230fd6aa upstream.
On 64-bit, update_interval writes are clamped to LONG_MAX ms, but
ms_to_ktime() overflows above 9223372036854 ms and the interval wraps.
LONG_MAX becomes -1 ms, so every read starts a new measurement and
update_interval reads back -1.
Clamp to INT_MAX like sht4x, so the limit is the same on all platforms.
Fixes: 8c78f0dee437 ("hwmon: Add AHT10 Temperature and Humidity Sensor Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
Link: https://patch.msgid.link/20261108172651.220121-1-zoone.rupert@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/aht10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/aht10.c
+++ b/drivers/hwmon/aht10.c
@@ -222,7 +222,7 @@ static int aht10_read_values(struct aht1
static ssize_t aht10_interval_write(struct aht10_data *data,
long val)
{
- data->min_poll_interval = ms_to_ktime(clamp_val(val, 2000, LONG_MAX));
+ data->min_poll_interval = ms_to_ktime(clamp_val(val, 2000, INT_MAX));
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0746/1005] hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (744 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0745/1005] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0747/1005] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
` (252 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <linux@roeck-us.net>
commit 221b565a3316b1ba3a9bcd1f61238440207b3e00 upstream.
In gpio_fan_probe(), gpio_fan_stop() is registered conditionally as a
devres action before runtime PM is initialized, while gpio_fan_stop()
unconditionally calls pm_runtime_disable(). This breaks runtime PM
disable_depth and usage_count invariants across several paths:
- On alarm-only devices without control GPIOs, gpio_fan_stop() is never
registered, leaving pm_runtime_enable() unbalanced on unbind and
triggering "Unbalanced pm_runtime_enable!" on subsequent binds.
- When control GPIOs are present and devm_add_action_or_reset(), hwmon
registration, or fan_alarm_init() fails, gpio_fan_stop() runs before
pm_runtime_enable(), incrementing disable_depth to 2 (leaving runtime
PM permanently disabled on re-probe) and, if speed_index > 0,
underflowing usage_count via pm_runtime_put_sync().
- If pm_runtime_resume_and_get() fails when speed_index > 0, it drops
its reference while speed_index remains non-zero, causing
gpio_fan_stop() to call pm_runtime_put_sync() and underflow
usage_count.
- Registering the hwmon device before enabling runtime PM exposes sysfs
attributes that can invoke set_fan_speed() before runtime PM state is
initialized.
Initialize runtime PM upfront with pm_runtime_set_suspended() and
devm_pm_runtime_enable(), remove pm_runtime_disable() from
gpio_fan_stop(), and acquire the initial active runtime PM reference
before registering gpio_fan_stop() and the hwmon device.
Fixes: 0d01110e6356 ("hwmon: (gpio-fan) Add regulator support")
Reported-by: Sashiko <sashiko@sashiko.dev>
Link: https://sashiko.dev/#/bug/linux-349aa3ba-30c3-4c3c-b47e-f52839af2b8d
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/gpio-fan.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -531,8 +531,6 @@ static void gpio_fan_stop(void *data)
mutex_lock(&fan_data->lock);
set_fan_speed(data, 0);
mutex_unlock(&fan_data->lock);
-
- pm_runtime_disable(fan_data->dev);
}
static int gpio_fan_probe(struct platform_device *pdev)
@@ -560,6 +558,11 @@ static int gpio_fan_probe(struct platfor
return dev_err_probe(dev, PTR_ERR(fan_data->supply),
"Failed to get fan-supply");
+ pm_runtime_set_suspended(dev);
+ err = devm_pm_runtime_enable(dev);
+ if (err)
+ return err;
+
/* Configure control GPIOs if available. */
if (fan_data->gpios && fan_data->num_gpios > 0) {
if (!fan_data->speed || fan_data->num_speed <= 1)
@@ -567,6 +570,12 @@ static int gpio_fan_probe(struct platfor
err = fan_ctrl_init(fan_data);
if (err)
return err;
+ /* If current GPIO state is active, mark RPM as active as well */
+ if (fan_data->speed_index > 0) {
+ err = pm_runtime_resume_and_get(dev);
+ if (err)
+ return err;
+ }
err = devm_add_action_or_reset(dev, gpio_fan_stop, fan_data);
if (err)
return err;
@@ -587,17 +596,6 @@ static int gpio_fan_probe(struct platfor
return err;
}
- pm_runtime_set_suspended(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
- /* If current GPIO state is active, mark RPM as active as well */
- if (fan_data->speed_index > 0) {
- int ret;
-
- ret = pm_runtime_resume_and_get(&pdev->dev);
- if (ret)
- return ret;
- }
-
/* Optional cooling device register for Device tree platforms */
fan_data->cdev = devm_thermal_of_child_cooling_device_register(dev, np,
"gpio-fan",
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0747/1005] hwmon: (pmbus/mp2975) Get vout fault limits dynamically
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (745 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0746/1005] hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0748/1005] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
` (251 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Felix Radensky, Vadim Pasternak,
Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Radensky <fradensky@nvidia.com>
commit 00944852275efd39706fe7b9ce75c28edde983eb upstream.
The over- and under-voltage fault limits of the tracking mode are
relative to the voltage reference, which follows the VID/AVS requests
issued to the device and therefore changes at runtime.
The driver reads the voltage reference once during probe and derives the
limits from that snapshot, which the PMBus core caches in addition. As a
result in2_crit and in2_lcrit reflect the operating point at probe, rather
than the thresholds the device enforces. On systems where the device
supplies the CPU core voltage, in2_crit was reported anywhere between
1.15V and 1.70V across identical systems, causing false over-voltage
reports once the CPU voltage exceeded the value latched at probe.
Read the voltage reference and the over-voltage offset selector whenever
a limit is requested, and mark both limits with pmbus_set_update(), so
that the core does not cache them. The voltage reference is available on
page 3 only. Let the core change the page, so that the page it caches
matches the device, except for a single rail configuration, for which the
core does not issue PAGE commands, and the page is changed directly.
With the selector read at runtime, a device configured with an
unsupported selector no longer fails to probe. The OVP1 threshold, which
does not depend on the selector, is reported for it instead, with a
warning.
Clamp the under-voltage limit to zero, since the offset can exceed a low
voltage reference, while a negative value would be reported as a read
error.
Fixes: 2c6fcbb21149 ("hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Radensky <fradensky@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://patch.msgid.link/20261105193200.1570996-1-fradensky@nvidia.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/pmbus/mp2975.c | 207 +++++++++++++++++++++++--------------------
1 file changed, 115 insertions(+), 92 deletions(-)
--- a/drivers/hwmon/pmbus/mp2975.c
+++ b/drivers/hwmon/pmbus/mp2975.c
@@ -109,10 +109,7 @@ struct mp2975_data {
int vout_scale;
int max_phases[MP2975_PAGE_NUM];
int vid_step[MP2975_PAGE_NUM];
- int vref[MP2975_PAGE_NUM];
- int vref_off[MP2975_PAGE_NUM];
int vout_max[MP2975_PAGE_NUM];
- int vout_ov_fixed[MP2975_PAGE_NUM];
int curr_sense_gain[MP2975_PAGE_NUM];
};
@@ -460,12 +457,77 @@ static int mp2973_write_word_data(struct
return pmbus_write_word_data(client, 0, PMBUS_SMBALERT_MASK, ret);
}
+/*
+ * Let the PMBus core change the page, so that the page it caches matches the
+ * device. The core does not issue PAGE commands for a single rail
+ * configuration, thus change the page directly then.
+ */
+static int
+mp2975_page_set(struct i2c_client *client, struct mp2975_data *data, int page)
+{
+ if (data->info.pages > 1)
+ return pmbus_set_page(client, page, 0xff);
+
+ return i2c_smbus_write_byte_data(client, PMBUS_PAGE, page);
+}
+
+/*
+ * Voltage reference is available on page 3 only. The callers read a register
+ * of the rail through the core first, thus the core caches the rail page.
+ */
+static int
+mp2975_vref_get(struct i2c_client *client, struct mp2975_data *data, int page)
+{
+ int ret, vref;
+
+ ret = mp2975_page_set(client, data, 3);
+ if (ret < 0)
+ return ret;
+
+ vref = i2c_smbus_read_word_data(client, page ? MP2975_MFR_READ_VREF_R2 :
+ MP2975_MFR_READ_VREF_R1);
+
+ ret = mp2975_page_set(client, data, page);
+ if (ret < 0)
+ return ret;
+
+ return (vref < 0) ? vref : vref * data->vid_step[page];
+}
+
+static int
+mp2975_ovp2_offset_get(int ovp_th_set)
+{
+ switch ((ovp_th_set & GENMASK(5, 3)) >> 3) {
+ case 1:
+ return 140;
+ case 2:
+ return 220;
+ case 4:
+ return 400;
+ default:
+ return -EINVAL;
+ }
+}
+
+static int
+mp2975_vout_ovp2_get(struct i2c_client *client, struct mp2975_data *data,
+ int page, int vref_off)
+{
+ int vref;
+
+ vref = mp2975_vref_get(client, data, page);
+ if (vref < 0)
+ return vref;
+
+ return vref + DIV_ROUND_CLOSEST(vref_off * data->vout_scale, 10);
+}
+
static int mp2975_read_word_data(struct i2c_client *client, int page,
int phase, int reg)
{
const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
struct mp2975_data *data = to_mp2975_data(info);
- int ret;
+ int ret, ovp1, vref_off, uv_off;
switch (reg) {
case PMBUS_OT_FAULT_LIMIT:
@@ -482,19 +544,35 @@ static int mp2975_read_word_data(struct
break;
case PMBUS_VOUT_OV_FAULT_LIMIT:
/*
- * Register provides two values for over-voltage protection
- * threshold for fixed (ovp2) and tracking (ovp1) modes. The
- * minimum of these two values is provided as over-voltage
- * fault alarm.
+ * Device provides dual over-voltage protection. OVP1 is
+ * referred to the maximum reference voltage, while OVP2 is
+ * referred to the current voltage reference, which is changed
+ * at runtime. Protection is tripped by any of them, thus the
+ * minimum of the two is exposed as over-voltage fault alarm,
+ * and OVP2 is obtained on each read.
*/
ret = mp2975_read_word_helper(client, page, phase,
MP2975_MFR_OVP_TH_SET,
- GENMASK(2, 0));
+ GENMASK(5, 0));
if (ret < 0)
return ret;
- ret = min_t(int, data->vout_max[page] + 50 * (ret + 1),
- data->vout_ov_fixed[page]);
+ ovp1 = data->vout_max[page] + 50 * ((ret & GENMASK(2, 0)) + 1);
+
+ /* OVP1 still applies if the OVP2 threshold is unknown. */
+ vref_off = mp2975_ovp2_offset_get(ret);
+ if (vref_off < 0) {
+ dev_warn_once(&client->dev,
+ "unsupported OVP2 selector, reporting OVP1 threshold\n");
+ ret = ovp1;
+ break;
+ }
+
+ ret = mp2975_vout_ovp2_get(client, data, page, vref_off);
+ if (ret < 0)
+ return ret;
+
+ ret = min_t(int, ovp1, ret);
break;
case PMBUS_VOUT_UV_FAULT_LIMIT:
ret = mp2975_read_word_helper(client, page, phase,
@@ -503,8 +581,17 @@ static int mp2975_read_word_data(struct
if (ret < 0)
return ret;
- ret = DIV_ROUND_CLOSEST(data->vref[page] * 10 - 50 *
- (ret + 1) * data->vout_scale, 10);
+ uv_off = 50 * (ret + 1) * data->vout_scale;
+
+ ret = mp2975_vref_get(client, data, page);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * Offset can exceed the voltage reference, while a negative
+ * value would be reported as a read error.
+ */
+ ret = max_t(int, DIV_ROUND_CLOSEST(ret * 10 - uv_off, 10), 0);
break;
case PMBUS_VIRT_READ_POUT_MAX:
ret = mp2975_read_word_helper(client, page, phase,
@@ -754,60 +841,6 @@ mp2975_current_sense_gain_get(struct i2c
}
static int
-mp2975_vref_get(struct i2c_client *client, struct mp2975_data *data,
- struct pmbus_driver_info *info)
-{
- int ret;
-
- ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, 3);
- if (ret < 0)
- return ret;
-
- /* Get voltage reference value for rail 1. */
- ret = i2c_smbus_read_word_data(client, MP2975_MFR_READ_VREF_R1);
- if (ret < 0)
- return ret;
-
- data->vref[0] = ret * data->vid_step[0];
-
- /* Get voltage reference value for rail 2, if connected. */
- if (data->info.pages == MP2975_PAGE_NUM) {
- ret = i2c_smbus_read_word_data(client, MP2975_MFR_READ_VREF_R2);
- if (ret < 0)
- return ret;
-
- data->vref[1] = ret * data->vid_step[1];
- }
- return 0;
-}
-
-static int
-mp2975_vref_offset_get(struct i2c_client *client, struct mp2975_data *data,
- int page)
-{
- int ret;
-
- ret = i2c_smbus_read_word_data(client, MP2975_MFR_OVP_TH_SET);
- if (ret < 0)
- return ret;
-
- switch ((ret & GENMASK(5, 3)) >> 3) {
- case 1:
- data->vref_off[page] = 140;
- break;
- case 2:
- data->vref_off[page] = 220;
- break;
- case 4:
- data->vref_off[page] = 400;
- break;
- default:
- return -EINVAL;
- }
- return 0;
-}
-
-static int
mp2975_vout_max_get(struct i2c_client *client, struct mp2975_data *data,
struct pmbus_driver_info *info, int page)
{
@@ -911,25 +944,6 @@ mp2975_vout_per_rail_config_get(struct i
ret = mp2975_vout_max_get(client, data, info, i);
if (ret < 0)
return ret;
-
- /* Skip if reading Vref is unsupported */
- if (data->chip_id != mp2975)
- continue;
-
- /* Obtain voltage reference offsets. */
- ret = mp2975_vref_offset_get(client, data, i);
- if (ret < 0)
- return ret;
-
- /*
- * Set over-voltage fixed value. Thresholds are provided as
- * fixed value, and tracking value. The minimum of them are
- * exposed as over-voltage critical threshold.
- */
- data->vout_ov_fixed[i] = data->vref[i] +
- DIV_ROUND_CLOSEST(data->vref_off[i] *
- data->vout_scale,
- 10);
}
return 0;
@@ -1043,11 +1057,6 @@ static int mp2975_probe(struct i2c_clien
if (ret)
return ret;
- /* Obtain voltage reference values. */
- ret = mp2975_vref_get(client, data, info);
- if (ret)
- return ret;
-
/* Obtain vout over-voltage scales. */
ret = mp2975_vout_ov_scale_get(client, data, info);
if (ret < 0)
@@ -1064,7 +1073,21 @@ static int mp2975_probe(struct i2c_clien
if (ret)
return ret;
- return pmbus_do_probe(client, info);
+ ret = pmbus_do_probe(client, info);
+ if (ret)
+ return ret;
+
+ /*
+ * Vout over- and under-voltage fault limits are relative to the
+ * voltage reference, which is changed at runtime. Do not allow the
+ * PMBus core to cache them.
+ */
+ if (data->chip_id == mp2975) {
+ pmbus_set_update(client, PMBUS_VOUT_OV_FAULT_LIMIT, true);
+ pmbus_set_update(client, PMBUS_VOUT_UV_FAULT_LIMIT, true);
+ }
+
+ return 0;
}
static const struct of_device_id mp2975_of_match[] = {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0748/1005] hwmon: (sy7636a) fix negative temperatures
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (746 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0747/1005] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0749/1005] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
` (250 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Mazzini, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Mazzini <pmazzini@gmail.com>
commit fc8519fab34e162b0c29dacccf73031820878917 upstream.
The thermistor readout is a signed 8-bit value in degrees Celsius.
Fixes: de34a4053250 ("hwmon: sy7636a: Add temperature driver for sy7636a")
Cc: stable@vger.kernel.org
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
Link: https://patch.msgid.link/20261108093602.329554-3-pmazzini@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/sy7636a-hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/sy7636a-hwmon.c
+++ b/drivers/hwmon/sy7636a-hwmon.c
@@ -29,7 +29,7 @@ static int sy7636a_read(struct device *d
if (ret)
return ret;
- *temp = reg_val * 1000;
+ *temp = (s8)reg_val * 1000;
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0749/1005] hwmon: (scmi) Check channel config allocation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (747 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0748/1005] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0750/1005] hwmon: (scmi) Enable temperature sensors using their sensor IDs Greg Kroah-Hartman
` (249 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Sudeep Holla, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
commit a2996d892d0150d059d39c683d95d6fd7a37630a upstream.
scmi_hwmon_add_chan_info() can fail to allocate a channel's config
array. Ignoring that error leaves a channel with a NULL config pointer
in the hwmon chip info, which hwmon dereferences while registering the
device.
Check the helper's return value and abort probe on failure.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-d10ced6b-a6f0-403b-9619-f5a6573f9e7f
Fixes: b23688aefb8b ("hwmon: add support for sensors exported via ARM SCMI")
Cc: stable@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://patch.msgid.link/20261109151927.1672956-1-sudeep.holla@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/scmi-hwmon.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/hwmon/scmi-hwmon.c
+++ b/drivers/hwmon/scmi-hwmon.c
@@ -228,8 +228,8 @@ static int scmi_thermal_sensor_register(
static int scmi_hwmon_probe(struct scmi_device *sdev)
{
- int i, idx;
u16 nr_sensors;
+ int i, idx, ret;
enum hwmon_sensor_types type;
struct scmi_sensors *scmi_sensors;
const struct scmi_sensor_info *sensor;
@@ -299,8 +299,12 @@ static int scmi_hwmon_probe(struct scmi_
if (!nr_count[type])
continue;
- scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev, nr_count[type],
- type, hwmon_attributes[type]);
+ ret = scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev,
+ nr_count[type], type,
+ hwmon_attributes[type]);
+ if (ret)
+ return ret;
+
*ptr_scmi_ci++ = scmi_hwmon_chan++;
scmi_sensors->info[type] =
@@ -335,8 +339,6 @@ static int scmi_hwmon_probe(struct scmi_
return PTR_ERR(hwdev);
for (i = 0; i < nr_count_temp; i++) {
- int ret;
-
sensor = *(scmi_sensors->info[hwmon_temp] + i);
if (!sensor)
continue;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0750/1005] hwmon: (scmi) Enable temperature sensors using their sensor IDs
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (748 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0749/1005] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0751/1005] hwmon: (scmi) Configure sensors before exposing channels Greg Kroah-Hartman
` (248 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xu Rao, Sudeep Holla, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xu Rao <raoxu@uniontech.com>
commit 3ae1af2faad93276645d7620261643457daec73b upstream.
scmi_hwmon_probe() groups sensors by hwmon type, so the index in
scmi_sensors->info[hwmon_temp] is not necessarily the SCMI sensor ID.
Passing that index to config_set() targets a different sensor if the
platform exposes non-temperature sensors ahead of temperature sensors.
The intended temperature sensor can remain disabled, causing subsequent
readings to fail. If configuring the wrong sensor fails, thermal
registration of the intended sensor is also skipped.
Use the firmware sensor ID, as the read and thermal registration paths
already do, so temperature sensors are enabled correctly.
The patch was reviewed and the commit message expanded with OpenCode
AI assistance.
Fixes: 72804d1631b3 ("hwmon: (scmi) Enable sensors to assure they can be read")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://patch.msgid.link/AED18609B941BCFD+20261109082854.3739085-1-raoxu@uniontech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/scmi-hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/hwmon/scmi-hwmon.c
+++ b/drivers/hwmon/scmi-hwmon.c
@@ -343,7 +343,7 @@ static int scmi_hwmon_probe(struct scmi_
if (!sensor)
continue;
- ret = sensor_ops->config_set(ph, i, sensor_config);
+ ret = sensor_ops->config_set(ph, sensor->id, sensor_config);
if (ret) {
dev_err(dev, "Error enabling sensor %s. err=%d\n",
sensor->name, ret);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0751/1005] hwmon: (scmi) Configure sensors before exposing channels
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (749 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0750/1005] hwmon: (scmi) Enable temperature sensors using their sensor IDs Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0752/1005] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
` (247 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marek Vasut, Sashiko, Sudeep Holla,
Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
commit 68af85b730f9a9e5f66c96ba861a66da08cfa5a9 upstream.
SCMI hwmon enables sensors with SENSOR_CONFIG_SET, but only after
registering the hwmon device and only for temperature sensors. This
leaves other sensor classes disabled on firmware that defaults sensors
to off, and exposes temperature channels before they are ready.
Configure each supported sensor while building the channel list, before
registering the hwmon device. Leave failed sensors out of the list so
their channels remain hidden, while continuing with other sensors.
Cc: Marek Vasut <marek.vasut@mailbox.org>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-4bdf9a68-22d5-4305-b684-f11fe6d1dbcc
Fixes: 72804d1631b3 ("hwmon: (scmi) Enable sensors to assure they can be read")
Cc: stable@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://patch.msgid.link/20261109151927.1672956-2-sudeep.holla@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/scmi-hwmon.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
--- a/drivers/hwmon/scmi-hwmon.c
+++ b/drivers/hwmon/scmi-hwmon.c
@@ -327,6 +327,12 @@ static int scmi_hwmon_probe(struct scmi_
case ENERGY:
type = scmi_types[sensor->type];
idx = --nr_count[type];
+ ret = sensor_ops->config_set(ph, sensor->id, sensor_config);
+ if (ret) {
+ dev_err(dev, "Error enabling sensor %s. err=%d\n",
+ sensor->name, ret);
+ continue;
+ }
*(scmi_sensors->info[type] + idx) = sensor;
break;
}
@@ -343,13 +349,6 @@ static int scmi_hwmon_probe(struct scmi_
if (!sensor)
continue;
- ret = sensor_ops->config_set(ph, sensor->id, sensor_config);
- if (ret) {
- dev_err(dev, "Error enabling sensor %s. err=%d\n",
- sensor->name, ret);
- continue;
- }
-
/*
* Warn on any misconfiguration related to thermal zones but
* bail out of probing only on memory errors.
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0752/1005] hwmon: (max31760) Fix the local temperature limit registers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (750 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0751/1005] hwmon: (scmi) Configure sensors before exposing channels Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0753/1005] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
` (246 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Aleksandrov <lightofmysoul@gmail.com>
commit 028ed93145d9be88eee670088ef13482b5d36c1a upstream.
temp2_max and temp2_crit use each other's registers, so reading them
shows the local limits swapped and writing temp2_max changes the
overtemperature (SHDN) threshold.
Use the high limit (0x0C) for temp2_max and the overtemperature limit
(0x08) for temp2_crit.
Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Link: https://patch.msgid.link/20261108-max31760-fixes-v1-1-a61450463059@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/max31760.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/hwmon/max31760.c
+++ b/drivers/hwmon/max31760.c
@@ -27,8 +27,8 @@
#define REG_TACH(ch) (0x52 + (ch) * 2)
#define REG_TEMP_INPUT(ch) (0x56 + (ch) * 2)
-#define REG_TEMP_MAX(ch) (0x06 + (ch) * 2)
-#define REG_TEMP_CRIT(ch) (0x0A + (ch) * 2)
+#define REG_TEMP_MAX(ch) ((ch) ? 0x0C : 0x06)
+#define REG_TEMP_CRIT(ch) ((ch) ? 0x08 : 0x0A)
#define TEMP11_FROM_REG(reg) ((reg) / 32 * 125)
#define TEMP11_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0753/1005] hwmon: (max31760) Leave standby mode at probe
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (751 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0752/1005] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0754/1005] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
` (245 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Aleksandrov <lightofmysoul@gmail.com>
commit 95bddc5252a4c0a2ed9d62e7e53a3461265d9603 upstream.
The driver never clears the standby bit (CR2_STBY) during probe.
While max31760_resume() clears this bit on resume, probe only
configured CR2_ALERTS.
If the chip was left in standby (for example, by boot firmware or a
previously running OS before a warm reboot), it remains in standby:
temperature sensing, fan speed counting, and PWM output are halted.
This occurs on the Samsung Galaxy XR, where the bootloader places the
chip in standby during boot.
Clear CR2_STBY alongside setting CR2_ALERTS in probe.
Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Link: https://patch.msgid.link/20261108-max31760-fixes-v1-2-a61450463059@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/max31760.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/hwmon/max31760.c
+++ b/drivers/hwmon/max31760.c
@@ -533,8 +533,9 @@ static int max31760_probe(struct i2c_cli
dev_set_drvdata(dev, state);
- /* Set alert output to comparator mode */
- ret = regmap_set_bits(state->regmap, REG_CR2, CR2_ALERTS);
+ /* Leave standby mode, set alert output to comparator mode */
+ ret = regmap_update_bits(state->regmap, REG_CR2, CR2_STBY | CR2_ALERTS,
+ CR2_ALERTS);
if (ret)
return dev_err_probe(dev, ret, "cannot write register\n");
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0754/1005] hwmon: (max31760) Report 0 RPM before the first fan speed measurement
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (752 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0753/1005] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0755/1005] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
` (244 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Aleksandrov <lightofmysoul@gmail.com>
commit 33d58cbf2ab26bda81bc3052158d8b9867d5b9a6 upstream.
The tachometer count registers initialize to 0 until the first
measurement cycle completes after power-on. To prevent division by
zero, tach_to_rpm() clamped tach == 0 to 1, causing it to compute
and report 3,000,000 RPM (60 * 100000 / 1 / 2).
Return 0 RPM when tach == 0 instead.
Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Link: https://patch.msgid.link/20261108-max31760-fixes-v1-3-a61450463059@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/max31760.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/hwmon/max31760.c
+++ b/drivers/hwmon/max31760.c
@@ -68,8 +68,9 @@ static const int max31760_pwm_freq[] = {
static int tach_to_rpm(u16 tach)
{
+ /* The count is 0 until the first measurement */
if (tach == 0)
- tach = 1;
+ return 0;
return 60 * 100000 / tach / 2;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0755/1005] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (753 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0754/1005] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0756/1005] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
` (243 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jan Höppner,
Stefan Haberland, Jens Axboe
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Haberland <sth@linux.ibm.com>
commit df56f7a6c20a5eb2794c0a7391bde50ba7c8c54b upstream.
dasd_eckd_build_check_tcw() allocates its request with
dasd_fmalloc_request(), but its out_err path frees it with
dasd_sfree_request(). The latter uses a different pool and therefor,
leading to invalid pointer arithmetic and a crash.
Use the matching dasd_ffree_request() instead.
The same error path also leaves start_priv->count incremented
without ever decrementing it again.
This leaks a permanent reference on every build failure.
Decrement it before freeing the request.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260722103704.1709668-1-sth@linux.ibm.com
Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT")
Cc: stable@vger.kernel.org #4.7
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Fixes: 5e2b17e712cf ("s390/dasd: Add dynamic formatting support for ESE volumes")
Link: https://patch.msgid.link/20261112102608.1057852-4-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/block/dasd_eckd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -2780,7 +2780,8 @@ dasd_eckd_build_check_tcw(struct dasd_de
return cqr;
out_err:
- dasd_sfree_request(cqr, startdev);
+ start_priv->count--;
+ dasd_ffree_request(cqr, startdev);
return ERR_PTR(rc);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0756/1005] s390/dasd: Dont trust userspace-supplied result field in format check
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (754 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0755/1005] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0757/1005] sched/deadline: Fix spurious -EPERM for migration-disabled tasks Greg Kroah-Hartman
` (242 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jan Höppner,
Stefan Haberland, Jens Axboe
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Haberland <sth@linux.ibm.com>
commit 7cc2dda4f7aaf596c1796184649007151ff98f8d upstream.
BIODASDCHECKFMT used to copy the entire format_check_t struct from
userspace, including the result/unit/rec/num_records/blksize/
key_length fields that are output fields only.
dasd_eckd_format_evaluate_tracks() relies on cdata->result being zero
to decide whether to apply an index correction (i--/pos--) after a
successful check. A caller that pre-sets result to a non-zero value
can suppress that correction, leaving pos advanced past the last valid
entry; the (partially out-of-bounds) fmt_buffer[pos] fields are then
copied back to userspace, leaking heap contents.
Only expect is an Input field; copy just that member in and zero
the rest of cdata.
Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260722103704.1709668-1-sth@linux.ibm.com
Cc: stable@vger.kernel.org #4.7
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20261112102608.1057852-5-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/block/dasd_ioctl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -303,7 +303,9 @@ static int dasd_ioctl_check_format(struc
goto out_err;
}
- if (copy_from_user(&cdata, argp, sizeof(cdata))) {
+ /* copy only input fields, clear the rest */
+ memset(&cdata, 0, sizeof(cdata));
+ if (copy_from_user(&cdata.expect, argp, sizeof(cdata.expect))) {
rc = -EFAULT;
goto out_err;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0757/1005] sched/deadline: Fix spurious -EPERM for migration-disabled tasks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (755 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0756/1005] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0758/1005] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE Greg Kroah-Hartman
` (241 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrea Parri, Peter Zijlstra (Intel),
Ingo Molnar, Sebastian Andrzej Siewior, Juri Lelli
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <parri.andrea@gmail.com>
commit 6616bffa9b52da1338cf8bff9882404e02b9e361 upstream.
sched_setattr() can refuse to make a task SCHED_DEADLINE with -EPERM,
even though the task's affinity covers the whole root domain. A retry
can succeed, but the error blames an affinity the task does not have.
__sched_setscheduler() tests p->cpus_ptr, which is not always the task's
affinity. When a task is scheduled out inside a migrate_disable() section,
migrate_disable_switch() points p->cpus_ptr at the current CPU until
migrate_enable(). On PREEMPT_RT every spinlock_t holder is in such a
section, so ordinary kernel work opens the window. Elsewhere, seccomp
filters run in one.
Test p->cpus_mask instead, which keeps the task's affinity and is what
sched_getaffinity() reports. This should be safe because an admitted
task's cpus_mask covers the root domain, so set_cpus_allowed_dl() moves
no bandwidth when migrate_enable() restores p->cpus_ptr.
The following program, run as root, had 553679, 453720 and 424623 of its
1000000 requests refused on three boots of a 4-CPU PREEMPT_RT guest, and
236182, 217174 and 237183 without PREEMPT_RT. With this applied the count
is 0, also with lockdep, and a task pinned to one CPU is still refused:
#define _GNU_SOURCE
#include <errno.h>
#include <linux/filter.h>
#include <linux/seccomp.h>
#include <pthread.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/syscall.h>
#include <unistd.h>
#define REQUESTS 1000000
#define INSNS 300
struct attr {
uint32_t size, policy;
uint64_t flags;
int32_t nice;
uint32_t prio;
uint64_t runtime, deadline, period;
};
static volatile int stop;
static volatile pid_t target;
static long set(struct attr a)
{
a.size = sizeof(a);
return syscall(SYS_sched_setattr, target, &a, 0);
}
static void *worker(void *arg)
{
struct sock_filter f[INSNS + 1];
struct sock_fprog prog = { .len = INSNS + 1, .filter = f };
int i;
/* Reading the arguments keeps seccomp from caching the result */
for (i = 0; i < INSNS; i++)
f[i] = (struct sock_filter)
BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
offsetof(struct seccomp_data, args));
f[INSNS] = (struct sock_filter)
BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW);
syscall(SYS_seccomp, SECCOMP_SET_MODE_FILTER, 0, &prog);
target = syscall(SYS_gettid);
while (!stop)
syscall(SYS_getppid);
return arg;
}
static void *hog(void *arg)
{
while (!stop)
;
return arg;
}
int main(void)
{
pthread_t t[9];
long refused = 0;
int i;
pthread_create(&t[0], NULL, worker, NULL);
while (!target)
usleep(100);
for (i = 1; i < 9; i++)
pthread_create(&t[i], NULL, hog, NULL);
for (i = 0; i < REQUESTS; i++) {
/* SCHED_DEADLINE, 2us every 1s */
if (set((struct attr){ .policy = 6, .runtime = 2000,
.deadline = 1000000000,
.period = 1000000000 }) && errno == EPERM)
refused++;
set((struct attr){ .policy = 0 }); /* SCHED_OTHER */
}
stop = 1;
for (i = 0; i < 9; i++)
pthread_join(t[i], NULL);
printf("%ld of %d requests refused\n", refused, REQUESTS);
return 0;
}
An LLM helped find this bug and write this patch and its test.
Fixes: af449901b84c ("sched: Add migrate_disable()")
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261102135420.244745-1-parri.andrea@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/syscalls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.c
@@ -628,7 +628,7 @@ change:
* the entire root_domain to become SCHED_DEADLINE. We
* will also fail if there's no bandwidth available.
*/
- if (!cpumask_subset(span, p->cpus_ptr) ||
+ if (!cpumask_subset(span, &p->cpus_mask) ||
rq->rd->dl_bw.bw == 0) {
retval = -EPERM;
goto unlock;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0758/1005] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (756 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0757/1005] sched/deadline: Fix spurious -EPERM for migration-disabled tasks Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0759/1005] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler() Greg Kroah-Hartman
` (240 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Andrea Parri,
Peter Zijlstra (Intel), Ingo Molnar, Vincent Guittot
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <parri.andrea@gmail.com>
commit 8127ec8458df29bd702db602473042ccb9e619b9 upstream.
sched_setattr() accepts sched_util_min and sched_util_max values that do
not fit in uclamp_se::value. A single thread can do:
sched_setattr(max = 800) returns 0
sched_setattr(min = 0xfffffffe) returns 0
sched_getattr() min=2046 max=800
which leaves the minimum above both SCHED_CAPACITY_SCALE and the task's own
maximum.
The range check in uclamp_validate() relies on the + 1 wrapping -1, the
reset value, to 0:
if (util_min + 1 > SCHED_CAPACITY_SCALE + 1)
That only works for an unsigned type. util_min and util_max are int and
SCHED_CAPACITY_SCALE is a long, so every negative value passes the check,
and so does INT_MAX, whose + 1 wraps.
uclamp_se_set() then truncates what got through to the 11 bits of
uclamp_se::value, but computes the bucket from the full value. A minimum
of 0xfffff800 is stored as 0 in the top bucket, where uclamp_rq_max_value()
takes it for the highest active clamp once a higher value leaves the rq.
The rq clamp falls below what the remaining tasks requested, and emptying
their bucket trips the WARN_ON_ONCE() in uclamp_rq_dec_id(), without any
privilege:
WARNING: kernel/sched/core.c:1862 at dequeue_task+0x2a3/0x2b0, CPU#0: repro/126
Call Trace:
__schedule+0x933/0x1320
schedule+0x36/0x100
do_nanosleep+0x61/0x190
hrtimer_nanosleep+0xb5/0x1d0
Make util_min and util_max unsigned int, so that -1 is the only value that
wraps. The pair check below is unaffected, since it skips -1 explicitly and
anything else is at most SCHED_CAPACITY_SCALE by then.
Requests that were only accepted because of this now fail with -EINVAL.
The following program triggers the warning when run by any user outside
a child cpu cgroup. With this applied, its 0xfffff800 request fails with
-EINVAL and the warning no longer appears:
#define _GNU_SOURCE
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
struct attr {
uint32_t size, policy;
uint64_t flags;
int32_t nice;
uint32_t prio;
uint64_t runtime, deadline, period;
uint32_t util_min, util_max;
};
static volatile int stop;
static void set_min(uint32_t v)
{
/* KEEP_POLICY | KEEP_PARAMS | UTIL_CLAMP_MIN */
struct attr a = { .size = sizeof(a), .flags = 0x38, .util_min = v };
syscall(SYS_sched_setattr, 0, &a, 0);
}
static void burn(long us)
{
struct timespec s, n;
clock_gettime(CLOCK_MONOTONIC, &s);
do
clock_gettime(CLOCK_MONOTONIC, &n);
while ((n.tv_sec - s.tv_sec) * 1000000 +
(n.tv_nsec - s.tv_nsec) / 1000 < us);
}
static void *bogus(void *arg)
{
set_min(0xfffff800);
while (!stop)
burn(1000);
return arg;
}
static void *worker(void *arg)
{
long v = (long)arg;
set_min(v);
while (!stop) {
burn(v == 800 ? 300 : 1500);
usleep(100);
}
return arg;
}
int main(void)
{
pthread_t t[3];
cpu_set_t c;
int i;
CPU_ZERO(&c);
CPU_SET(0, &c);
sched_setaffinity(0, sizeof(c), &c);
pthread_create(&t[0], NULL, bogus, NULL);
usleep(50000);
pthread_create(&t[1], NULL, worker, (void *)500L);
pthread_create(&t[2], NULL, worker, (void *)800L);
sleep(15);
stop = 1;
for (i = 0; i < 3; i++)
pthread_join(t[i], NULL);
return 0;
}
An LLM helped find the warning and write this patch and its tests.
Fixes: 480a6ca2dc6e ("sched/uclamp: Allow to reset a task uclamp constraint value")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Andrea Parri <parri.andrea@gmail.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>
Cc: stable@vger.kernel.org
Link: https://sashiko.dev/#/patchset/20261016062629.2102883-1-sh_def%40163.com
Link: https://patch.msgid.link/20261102134831.243255-1-parri.andrea@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/syscalls.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.c
@@ -318,8 +318,8 @@ static inline void __setscheduler_dl_pi(
static int uclamp_validate(struct task_struct *p,
const struct sched_attr *attr)
{
- int util_min = p->uclamp_req[UCLAMP_MIN].value;
- int util_max = p->uclamp_req[UCLAMP_MAX].value;
+ unsigned int util_min = p->uclamp_req[UCLAMP_MIN].value;
+ unsigned int util_max = p->uclamp_req[UCLAMP_MAX].value;
if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MIN) {
util_min = attr->sched_util_min;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0759/1005] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (757 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0758/1005] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0760/1005] sched/core: Do not touch SMT siblings that have not joined the core yet Greg Kroah-Hartman
` (239 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Andrea Parri,
Peter Zijlstra (Intel), Ingo Molnar, Waiman Long, Kayra Cizmeci,
Juri Lelli
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <parri.andrea@gmail.com>
commit f7141257dd67d4936f906a6cfd1d0007721f6898 upstream.
A sched_setattr() with SCHED_FLAG_KEEP_POLICY on a SCHED_DEADLINE task
unlocks cpuset_mutex twice if the task's policy changes concurrently:
WARNING: bad unlock balance detected!
7.4.0-rc1 #1 Not tainted
-------------------------------------
repro/126 is trying to release lock (cpuset_mutex) at:
[<ffffffff9a17cacc>] __sched_setscheduler+0x9cc/0xc40
but there are no more locks to release!
...
Call Trace:
print_unlock_imbalance_bug.part.0+0xfb/0x110
lock_release+0x286/0x2e0
__mutex_unlock_slowpath+0x1a/0x400
__sched_setscheduler+0x9cc/0xc40
__x64_sys_sched_setattr+0xa3/0x1b0
do_syscall_64+0x106/0x5f0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
__sched_setscheduler() samples p->policy before taking any lock, and
restarts from the recheck label if p->policy differs under the rq lock.
The restart drops cpuset_mutex but leaves cpuset_locked set, so a pass
that no longer needs the mutex still unlocks it on its way out:
CPU 1 CPU 2
__sched_setscheduler(KEEP_POLICY)
policy = p->policy /* DEADLINE */
__sched_setscheduler(SCHED_OTHER)
p->policy = SCHED_OTHER
cpuset_locked = true
cpuset_lock()
rq = task_rq_lock(p)
oldpolicy != p->policy
cpuset_unlock()
goto recheck
/* no cpuset_lock() this time */
...
if (cpuset_locked)
cpuset_unlock()
Without CONFIG_DEBUG_MUTEXES, or CONFIG_DEBUG_RT_MUTEXES on PREEMPT_RT,
nothing warns. The second unlock still clears the owner field regardless
of who holds the mutex, so another task can lose cpuset_mutex inside its
critical section. Entering SCHED_DEADLINE needs CAP_SYS_NICE, but a
racing caller that owns the task does not need it if it samples a policy
other than SCHED_DEADLINE.
Clear cpuset_locked when dropping the mutex for the restart. This should be
safe because the flag is only tested on the paths leaving the next pass,
after that pass has set it again if it took the mutex.
The following program, run as root, reproduces the splat, which no longer
appears with this applied. On PREEMPT_RT it crashes the kernel within
seconds, which this also fixes:
#define _GNU_SOURCE
#include <pthread.h>
#include <stdint.h>
#include <sys/syscall.h>
#include <unistd.h>
struct attr {
uint32_t size, policy;
uint64_t flags;
int32_t nice;
uint32_t prio;
uint64_t runtime, deadline, period;
};
static volatile int stop;
static volatile pid_t target;
static void set(struct attr a)
{
a.size = sizeof(a);
syscall(SYS_sched_setattr, target, &a, 0);
}
static void *sleeper(void *arg)
{
target = syscall(SYS_gettid);
while (!stop)
usleep(1000);
return arg;
}
static void *switcher(void *arg)
{
while (!stop) {
/* SCHED_DEADLINE, 2us every 1s */
set((struct attr){ .policy = 6, .runtime = 2000,
.deadline = 1000000000,
.period = 1000000000 });
set((struct attr){ .policy = 0 }); /* SCHED_OTHER */
}
return arg;
}
static void *racer(void *arg)
{
/* KEEP_POLICY | KEEP_PARAMS */
while (!stop)
set((struct attr){ .flags = 0x18 });
return arg;
}
int main(void)
{
pthread_t t[5];
int i;
pthread_create(&t[0], NULL, sleeper, NULL);
while (!target)
usleep(100);
pthread_create(&t[1], NULL, switcher, NULL);
for (i = 2; i < 5; i++)
pthread_create(&t[i], NULL, racer, NULL);
sleep(30);
stop = 1;
for (i = 0; i < 5; i++)
pthread_join(t[i], NULL);
return 0;
}
An LLM helped find the PREEMPT_RT crash and write this patch and its test.
Fixes: 111cd11bbc54 ("sched/cpuset: Bring back cpuset_mutex")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Waiman Long <longman@redhat.com>
Reviewed-by: Kayra Cizmeci <kayracizmeci@gmail.com>
Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
Cc: stable@vger.kernel.org
Link: https://sashiko.dev/#/patchset/20261016062629.2102883-1-sh_def%40163.com
Link: https://patch.msgid.link/20261102134606.242743-1-parri.andrea@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/syscalls.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.c
@@ -640,8 +640,10 @@ change:
if (unlikely(oldpolicy != -1 && oldpolicy != p->policy)) {
policy = oldpolicy = -1;
task_rq_unlock(rq, p, &rf);
- if (cpuset_locked)
+ if (cpuset_locked) {
cpuset_unlock();
+ cpuset_locked = false;
+ }
goto recheck;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0760/1005] sched/core: Do not touch SMT siblings that have not joined the core yet
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (758 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0759/1005] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0761/1005] sched_ext: Fix stale pick when the donor changes during dispatch Greg Kroah-Hartman
` (238 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+681e729b2cf0d4860042,
Seiji Nishikawa, Peter Zijlstra (Intel), Ingo Molnar
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seiji Nishikawa <snishika@redhat.com>
commit ec6f6731538e0d45872eb279fdeb477bed152d6f upstream.
When a CPU comes online, it is added to cpu_smt_mask() of its siblings
before sched_core_cpu_starting() sets its rq->core to the core leader.
For example, on x86, ap_starting() calls set_cpu_sibling_map() first,
and calls notify_cpu_starting() after that. This order is intended.
Before sched_core_cpu_starting() runs, rq->core of the new CPU still
points to its own rq. But rq->core_enabled of the new CPU is already
set. __sched_core_flip() sets it for all possible CPUs, also for
offline CPUs, and CPU offline does not clear it. So __rq_lockp() of the
new CPU returns its own rq->__lock. It does not return the core wide
lock.
If a sibling CPU runs pick_next_task() for SCHED_CORE at this time, it
checks all CPUs in cpu_smt_mask(). It calls update_rq_clock() and
pick_task() for the rq of the new CPU. But it holds only its own core
lock, not the lock of the new CPU. Then lockdep shows this warning in
update_rq_clock().
debug_locks && !(lock_is_held(&(__rq_lockp(rq))->dep_map) != 0)
WARNING: kernel/sched/sched.h:1666 at update_rq_clock+0x40a/0xd20 kernel/sched/core.c:875, CPU#0: syz-executor251/5712
Call Trace:
<TASK>
pick_next_task kernel/sched/core.c:6375 [inline]
__schedule+0x1c69/0x6920 kernel/sched/core.c:7199
preempt_schedule_irq+0x4e/0x90 kernel/sched/core.c:7606
The next loops in pick_next_task() also change rq_i->core_pick of this
rq, and can call resched_curr() for it, without its lock.
resched_curr() has the same lockdep_assert_rq_held() check.
__sched_core_account_forceidle() also checks all CPUs in the same mask.
CPU offline does not have this problem. remove_siblinginfo() and
sched_core_cpu_dying() both run in take_cpu_down() under stop_machine.
So no sibling CPU can be in pick_next_task() at that time.
Fix this. In these loops, skip a sibling CPU if its rq->core is
different from our rq->core. At run time, rq->core of a CPU is changed
by sched_core_cpu_starting(), sched_core_cpu_deactivate() and
sched_core_cpu_dying(). The first two hold sched_core_lock(), and
sched_core_lock() takes the rq locks of all CPUs in the SMT mask. The
last one runs under stop_machine, as written above. So while we hold
our core lock, the result of this check does not change. A CPU that is
not in the core yet will pick its own tasks. The comment in the
reschedule loop of pick_next_task() already expects this case.
I tested this with the syzbot C reproducer in QEMU. The two vCPUs were
SMT siblings (-smp 2,sockets=1,cores=1,threads=2). Without this patch,
the warning came after about 100 seconds. Just before the warning, a
debug print showed that the loop on CPU 0 saw CPU 1 with rq->core
pointing to CPU 1 itself, and cpu_online() was false for CPU 1. With
this patch, the same state still happened, but there was no warning
in more than 2 hours.
Fixes: 3c474b3239f1 ("sched: Fix Core-wide rq->lock for uninitialized CPUs")
Closes: https://syzkaller.appspot.com/bug?extid=681e729b2cf0d4860042
Reported-by: syzbot+681e729b2cf0d4860042@syzkaller.appspotmail.com
Signed-off-by: Seiji Nishikawa <snishika@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261104022004.3810619-1-snishika@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/core.c | 9 +++------
kernel/sched/core_sched.c | 3 +--
kernel/sched/sched.h | 19 +++++++++++++++++++
3 files changed, 23 insertions(+), 8 deletions(-)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6251,7 +6251,6 @@ pick_next_task(struct rq *rq, struct rq_
__must_hold(__rq_lockp(rq))
{
struct task_struct *next, *p, *max;
- const struct cpumask *smt_mask;
bool fi_before = false;
bool core_clock_updated = (rq == rq->core);
unsigned long cookie;
@@ -6301,8 +6300,6 @@ pick_next_task(struct rq *rq, struct rq_
prev_balance(rq, rf);
- smt_mask = cpu_smt_mask(cpu);
-
restart:
need_sync |= !!rq->core->core_cookie;
@@ -6368,7 +6365,7 @@ restart:
* Tie-break prio towards the current CPU
*/
max = NULL;
- for_each_cpu_wrap(i, smt_mask, cpu) {
+ for_each_core_cpu_wrap(i, rq) {
rq_i = cpu_rq(i);
/*
@@ -6401,7 +6398,7 @@ restart:
* For each thread: try and find a runnable task that matches @max or
* force idle.
*/
- for_each_cpu(i, smt_mask) {
+ for_each_core_cpu(i, rq) {
rq_i = cpu_rq(i);
p = rq_i->core_pick;
@@ -6447,7 +6444,7 @@ restart:
* their task. This ensures there is no inter-sibling overlap between
* non-matching user state.
*/
- for_each_cpu(i, smt_mask) {
+ for_each_core_cpu(i, rq) {
rq_i = cpu_rq(i);
/*
--- a/kernel/sched/core_sched.c
+++ b/kernel/sched/core_sched.c
@@ -241,7 +241,6 @@ out:
/* REQUIRES: rq->core's clock recently updated. */
void __sched_core_account_forceidle(struct rq *rq)
{
- const struct cpumask *smt_mask = cpu_smt_mask(cpu_of(rq));
u64 delta, now = rq_clock(rq->core);
struct rq *rq_i;
struct task_struct *p;
@@ -273,7 +272,7 @@ void __sched_core_account_forceidle(stru
delta = div_u64(delta, rq->core->core_forceidle_occupation);
}
- for_each_cpu(i, smt_mask) {
+ for_each_core_cpu(i, rq) {
rq_i = cpu_rq(i);
p = rq_i->core_pick ?: rq_i->curr;
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1514,6 +1514,25 @@ static inline raw_spinlock_t *__rq_lockp
return &rq->__lock;
}
+/*
+ * A CPU coming online is set in cpu_smt_mask() before
+ * sched_core_cpu_starting() links its rq->core to the core leader.
+ * Until then it does not share the core-wide lock, so it must not be
+ * touched as part of the core.
+ */
+static inline bool sched_core_sibling(struct rq *rq, struct rq *rq_i)
+{
+ return rq_i->core == rq->core;
+}
+
+#define for_each_core_cpu(i, rq) \
+ for_each_cpu(i, cpu_smt_mask(rq->cpu)) \
+ if (sched_core_sibling(rq, cpu_rq(i)))
+
+#define for_each_core_cpu_wrap(i, rq) \
+ for_each_cpu_wrap(i, cpu_smt_mask(rq->cpu), rq->cpu) \
+ if (sched_core_sibling(rq, cpu_rq(i)))
+
extern bool
cfs_prio_less(const struct task_struct *a, const struct task_struct *b, bool fi);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0761/1005] sched_ext: Fix stale pick when the donor changes during dispatch
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (759 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0760/1005] sched/core: Do not touch SMT siblings that have not joined the core yet Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0762/1005] sched_ext: Factor out drain_offline_rq() Greg Kroah-Hartman
` (237 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Andrea Righi
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 9ce6fca02867911ba79bc3664219effe8c7be8f4 upstream.
Dispatch takes rq->donor as @prev and can drop the rq lock. With proxy
execution, @prev may not be the running task, and another CPU can reset the
donor to rq->curr meanwhile, through proxy_needs_return() on a wakeup or
sched_proxy_block_task() on a class or scheduler change. The wakeup case:
1. dispatch_one() drops the rq lock, e.g. to move a task from another CPU.
2. Another CPU wakes the donor, which proxy execution migrated to this CPU.
proxy_needs_return() dequeues it and resets the donor to rq->curr, and
the wakeup enqueues it, possibly on another CPU.
3. dispatch_one() sees @prev queued and returns SCX_DSP_PREV.
4. do_pick_task_scx() returns @prev, and this CPU runs a task that is queued
on another rq.
Under core scheduling, the core pick runs dispatch for the sibling rqs with
each sibling's donor as @prev, and a sibling can switch @prev out while
dispatch has the lock dropped.
Whatever dispatch concluded, and whatever it does with @prev after the drop,
is about a task the rq no longer owns, whether it keeps @prev running or
hands it to ops.dispatch().
rq_modified_above() catches the change only when rq->curr is in a class
above ext, and the dl_server pick skips that check. dispatch_core_pick()
retries after a lock drop, but by then dispatch has used @prev.
Restart the pick when @prev is no longer the donor. dispatch_one() tests
after each step that can drop the lock, and scx_dispatch_sched() decides per
ops.dispatch() call whether to hand @prev over, which also covers a class or
scheduler change across a drop.
With proxy execution alone, the donor only ever changes to rq->curr during a
pick, so the retried pick can't go stale again. Under core scheduling, the
restart goes through the core pick, which already retries after any lock
drop.
7a3a6bfbd62a ("sched: Rework prev_balance() to avoid stale prev references")
closed the same window in prev_balance() by reading rq->donor instead of
taking @prev. That doesn't work here, as dispatch never evaluated the new
donor, which may not even be a sched_ext task.
Verified with synthetic reproducers for both cases.
v2: Also cover rq lock drops inside dispatch (sashiko).
v3: Don't keep a stale @prev after ops.dispatch() (sashiko).
v4: Also cover a sibling switching @prev out under core scheduling. Retitle.
Fixes: 7b0888b7cc19 ("sched_ext: Implement core-sched support")
Fixes: c6fe97c34a1a ("sched: Allow enabling proxy exec with sched_ext")
Cc: stable@vger.kernel.org # v6.12+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/ext.c | 10 ++++++++++
kernel/sched/ext/inlines.h | 37 +++++++++++++++++++++++++++++++++----
2 files changed, 43 insertions(+), 4 deletions(-)
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -3007,6 +3007,12 @@ static enum scx_dsp_verdict dispatch_one
rq->scx.cpu_released = false;
}
+ /* the ecaps sync may have dropped the rq lock */
+ if (scx_dsp_prev_stale(rq, prev)) {
+ verdict = SCX_DSP_RETRY;
+ goto has_tasks;
+ }
+
if (prev->sched_class == &ext_sched_class) {
update_curr_scx(rq);
@@ -3034,6 +3040,10 @@ static enum scx_dsp_verdict dispatch_one
}
verdict = scx_dispatch_sched(root_sch, rq, prev, false);
+
+ /* scx_dispatch_sched() may have dropped the rq lock */
+ if (scx_dsp_prev_stale(rq, prev))
+ verdict = SCX_DSP_RETRY;
if (verdict != SCX_DSP_NONE)
goto has_tasks;
--- a/kernel/sched/ext/inlines.h
+++ b/kernel/sched/ext/inlines.h
@@ -18,9 +18,32 @@ enum scx_dsp_verdict {
SCX_DSP_NONE, /* nothing to run */
SCX_DSP_LOCAL, /* local DSQ has tasks */
SCX_DSP_PREV, /* keep running @prev */
- SCX_DSP_RETRY, /* pick helpers only: restart the pick */
+ SCX_DSP_RETRY, /* restart the pick */
};
+/**
+ * scx_dsp_prev_stale - Test whether dispatch's @prev went stale
+ * @rq: rq being dispatched for
+ * @prev: @rq's donor when dispatch started
+ *
+ * @prev can stop being @rq's donor while dispatch has the rq lock dropped. With
+ * proxy execution, @prev may not be the running task, and another CPU can reset
+ * the donor to rq->curr. With core scheduling, the core pick runs dispatch for
+ * the sibling rqs too, and a sibling can switch @prev out. Dispatch restarts
+ * the pick when that happened and doesn't hand the old donor to the BPF
+ * scheduler.
+ *
+ * With proxy execution alone, the donor only ever changes to rq->curr during a
+ * pick. Only __schedule() on this CPU sets a different donor, after the pick,
+ * so the restarted pick takes rq->curr as @prev and can't go stale again. Under
+ * core scheduling, the restart goes through the core pick, which already
+ * retries whenever dispatch dropped the lock.
+ */
+static inline bool scx_dsp_prev_stale(struct rq *rq, struct task_struct *prev)
+{
+ return (sched_proxy_exec() || sched_core_enabled(rq)) && unlikely(prev != rq->donor);
+}
+
/*
* One user of this function is scx_bpf_sub_dispatch() which can be called
* recursively as sub-sched dispatches nest. Always inline to reduce stack usage
@@ -33,8 +56,7 @@ scx_dispatch_sched(struct scx_sched *sch
struct scx_dsp_ctx *dspc = &this_cpu_ptr(sch->pcpu)->dsp_ctx;
int nr_loops = SCX_DSP_MAX_LOOPS;
s32 cpu = cpu_of(rq);
- bool prev_on_sch = (prev->sched_class == &ext_sched_class) &&
- scx_task_on_sched(sch, prev);
+ bool prev_on_sch;
if (scx_consume_global_dsq(sch, rq))
return SCX_DSP_LOCAL;
@@ -106,6 +128,11 @@ scx_dispatch_sched(struct scx_sched *sch
rq->scx.sub_dispatch_prev = prev;
#endif
+ /* the dispatch so far may have dropped the rq lock */
+ prev_on_sch = !scx_dsp_prev_stale(rq, prev) &&
+ prev->sched_class == &ext_sched_class &&
+ scx_task_on_sched(sch, prev);
+
SCX_CALL_OP(sch, dispatch, rq, scx_cpu_arg(cpu),
prev_on_sch ? prev : NULL);
@@ -116,7 +143,9 @@ scx_dispatch_sched(struct scx_sched *sch
scx_flush_dispatch_buf(sch, rq);
- if ((prev->scx.flags & SCX_TASK_QUEUED) && prev->scx.slice)
+ /* ops.dispatch() and the flush may have dropped the rq lock */
+ if (!scx_dsp_prev_stale(rq, prev) &&
+ (prev->scx.flags & SCX_TASK_QUEUED) && prev->scx.slice)
return SCX_DSP_PREV;
if (rq->scx.local_dsq.nr)
return SCX_DSP_LOCAL;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0762/1005] sched_ext: Factor out drain_offline_rq()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (760 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 7.3 0761/1005] sched_ext: Fix stale pick when the donor changes during dispatch Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0763/1005] sched_ext: Read exit_kind before flushing in scx_flush_disable_work() Greg Kroah-Hartman
` (236 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Andrea Righi
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 1826e5aa068cf6c21791773f160b4a2ce5d5f9a5 upstream.
Factor drain_offline_rq() out of rq_offline_scx() so that the drain can move
to handle_hotplug() in the following patch, which removes the rq_online and
rq_offline hooks. The drain is the rescue flush and the re-enqueue of an
offline cpu's tasks onto its local DSQ. No functional change.
Cc: stable@vger.kernel.org # v6.12+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/ext.c | 35 ++++++++++++++++++++---------------
kernel/sched/sched.h | 2 +-
2 files changed, 21 insertions(+), 16 deletions(-)
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -2157,7 +2157,7 @@ static void set_task_runnable(struct rq
}
/*
- * list_add_tail() must be used. scx_bypass() and rq_offline_scx()
+ * list_add_tail() must be used. scx_bypass() and drain_offline_rq()
* depend on tasks being appended to the runnable_list.
*/
list_add_tail(&p->scx.runnable_node, &rq->scx.runnable_list);
@@ -3806,6 +3806,24 @@ static void set_cpus_allowed_scx(struct
scx_call_op_set_cpumask(sch, task_rq(p), p, (struct cpumask *)p->cpus_ptr);
}
+static void drain_offline_rq(struct rq *rq)
+{
+ struct task_struct *p, *n;
+
+ scx_rescue_flush(rq);
+
+ /*
+ * An offline CPU no longer calls ops.dispatch(). Re-enqueue its tasks
+ * onto the local DSQ so that they run here and balance_push() moves
+ * them off.
+ */
+ list_for_each_entry_safe_reverse(p, n, &rq->scx.runnable_list, scx.runnable_node) {
+ if (p->scx.dsq == &rq->scx.local_dsq)
+ continue;
+ guard(sched_change)(p, DEQUEUE_SAVE | DEQUEUE_MOVE | DEQUEUE_NOCLOCK);
+ }
+}
+
static void handle_hotplug(struct rq *rq, bool online)
{
struct scx_sched *sch = scx_root_protected();
@@ -3886,26 +3904,13 @@ static void rq_online_scx(struct rq *rq)
static void rq_offline_scx(struct rq *rq)
{
- struct task_struct *p, *n;
-
rq->scx.flags &= ~SCX_RQ_ONLINE;
/* sched domain rebuilds call rq_offline with the CPU staying alive */
if (cpu_active(cpu_of(rq)))
return;
- scx_rescue_flush(rq);
-
- /*
- * An offline CPU no longer calls ops.dispatch(). Re-enqueue its tasks
- * onto the local DSQ so that they run here and balance_push() moves
- * them off.
- */
- list_for_each_entry_safe_reverse(p, n, &rq->scx.runnable_list, scx.runnable_node) {
- if (p->scx.dsq == &rq->scx.local_dsq)
- continue;
- guard(sched_change)(p, DEQUEUE_SAVE | DEQUEUE_MOVE | DEQUEUE_NOCLOCK);
- }
+ drain_offline_rq(rq);
}
static bool check_rq_for_timeouts(struct rq *rq)
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -4247,7 +4247,7 @@ extern void balance_callbacks(struct rq
* Typically this must be called while holding task_rq_lock, since most/all
* properties are serialized under those locks. There are currently two
* exceptions to this rule in sched/ext which only hold rq->lock: scx_bypass()
- * and rq_offline_scx().
+ * and drain_offline_rq().
*/
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0763/1005] sched_ext: Read exit_kind before flushing in scx_flush_disable_work()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (761 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0762/1005] sched_ext: Factor out drain_offline_rq() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0764/1005] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
` (235 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Kuba Piecuch, Andrea Righi,
Tejun Heo
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuba Piecuch <jpiecuch@google.com>
commit 3133107d98057595c0af39ff907c852134926912 upstream.
scx_disable_workfn() sets exit_kind to SCX_EXIT_DONE before it tears the
scheduler down. scx_flush_disable_work() reads exit_kind after syncing
disable_irq_work and flushing disable_work, so it can observe DONE from
a disable_work that was queued after its flush and return while the
teardown is still running:
CPU A CPU B
----- -----
scx_vexit()
scx_claim_exit() -> true
bpf_struct_ops_map_link_detach()
bpf_scx_unreg()
scx_disable()
scx_claim_exit() -> false
scx_flush_disable_work()
irq_work_sync() // not queued
kthread_flush_work() // not queued
irq_work_queue()
scx_disable_irq_workfn()
kthread_queue_work()
scx_disable_workfn()
exit_kind = SCX_EXIT_DONE
scx_root_disable()
atomic_read() -> SCX_EXIT_DONE
bpf_map_put()
Once bpf_scx_unreg() returns, its caller drops the struct_ops map
reference, and the struct_ops trampolines can be freed while
scx_root_disable() is still running and can still call into the BPF
scheduler, e.g. ops.exit().
Read exit_kind before syncing and flushing, with acquire ordering paired
with the atomic_try_cmpxchg() in scx_disable_workfn(). DONE is only set
from disable_work, so once it is observed, the following
kthread_flush_work() sees the queued work and waits for the teardown to
finish.
This patch was created with the help of an AI coding assistant.
Fixes: d99f7a32f09d ("sched_ext: Fix scx_flush_disable_work() UAF race")
Cc: stable@vger.kernel.org # v7.1+
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/sashiko-outbox-195908@kernel.org/
Signed-off-by: Kuba Piecuch <jpiecuch@google.com>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/ext.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -7131,10 +7131,17 @@ void scx_flush_disable_work(struct scx_s
{
int kind;
+ /*
+ * scx_disable_workfn() sets SCX_EXIT_DONE before tearing down. Read
+ * exit_kind with acquire ordering (paired with atomic_try_cmpxchg() in
+ * scx_disable_workfn()) before syncing and flushing so that, once DONE
+ * is seen, the following flush observes the queued work and waits for
+ * the teardown to finish.
+ */
do {
+ kind = atomic_read_acquire(&sch->exit_kind);
irq_work_sync(&sch->disable_irq_work);
kthread_flush_work(&sch->disable_work);
- kind = atomic_read(&sch->exit_kind);
} while (kind != SCX_EXIT_NONE && kind != SCX_EXIT_DONE);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0764/1005] sctp: abort unordered partial delivery when its message is skipped
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (762 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0763/1005] sched_ext: Read exit_kind before flushing in scx_flush_disable_work() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0765/1005] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
` (234 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Budding, Xin Long,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Budding <tim.budding@gmail.com>
commit 05852c8b70f2291a50bb3f740a66ce9caf9cb98d upstream.
When an I-FORWARD-TSN skips unordered messages on a stream,
sctp_intl_skip() only aborts the stream's unordered partial delivery if
the MID being delivered is lower than the skipped MID. If the skipped
message is the one being partially delivered, partial delivery stays in
progress: no PARTIAL_DELIVERY_ABORTED is sent, and the next unordered
message on the stream is delivered as the rest of the abandoned one.
Abort the partial delivery when the MID being delivered is at or below
the skipped MID, as the ordered case already does.
Reproduced on an unmodified kernel with the uo_pd test of the
sctp_ifwdtsn.sh selftest added later in this series; its partial
delivery checks pass with this fix. Reproduction and fix done with AI
assistance.
Fixes: de60fe910543 ("sctp: implement handle_ftsn for sctp_stream_interleave")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Budding <tim.budding@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261105050225.49292-2-tim.budding@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/stream_interleave.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -1255,7 +1255,7 @@ static void sctp_intl_skip(struct sctp_u
struct sctp_stream *stream = &ulpq->asoc->stream;
if (flags & SCTP_FTSN_U_BIT) {
- if (sin->pd_mode_uo && MID_lt(sin->mid_uo, mid)) {
+ if (sin->pd_mode_uo && !MID_lt(mid, sin->mid_uo)) {
sin->pd_mode_uo = 0;
sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x1,
GFP_ATOMIC);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0765/1005] sctp: avoid requeueing pending control chunks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (763 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0764/1005] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0766/1005] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
` (233 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Xin Long, Kyle Zeng,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 665b4149e91b781a71bce8637c3a4d7d64dba05f upstream.
The T4 and RE-CONFIG timeout handlers take a reference to their cached
control chunk and submit it through SCTP_CMD_REPLY. A previous
transmission can still be on the control outqueue when output is corked
or suppressed, or when sctp_packet_transmit_chunk() could not append the
chunk.
sctp_outq_tail() then adds the same list node a second time. Re-adding a
non-tail entry can corrupt the list without being caught by the
insertion-time list checks. A subsequent flush or association teardown
can access an already freed chunk. The ASCONF path is reproducible by an
unprivileged SCTP socket owner in a user/network namespace, with KASAN
reporting a use-after-free in __sctp_outq_teardown().
Check sctp_chunk_pending() in both timeout handlers before taking the
extra reference and issuing SCTP_CMD_REPLY. If the chunk is already
linked, leave the existing entry for normal output processing. Keep
the remaining timer and error-handling commands unchanged. This also
covers RE-CONFIG retransmission after sctp_assoc_rm_peer() moves the
request to another transport and starts its timer.
The issue was found by an LLM.
Fixes: 2e3216cd54b1 ("sctp: Follow security requirement of responding with 1 packet")
Fixes: 7b9438de0cd4 ("sctp: add stream reconf timer")
Cc: stable@kernel.org
Suggested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261107030532.32310-1-kylebot@openai.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/sm_statefuns.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1122,9 +1122,11 @@ enum sctp_disposition sctp_sf_send_recon
return SCTP_DISPOSITION_DELETE_TCB;
}
- sctp_chunk_hold(asoc->strreset_chunk);
- sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
- SCTP_CHUNK(asoc->strreset_chunk));
+ if (!sctp_chunk_pending(asoc->strreset_chunk)) {
+ sctp_chunk_hold(asoc->strreset_chunk);
+ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+ SCTP_CHUNK(asoc->strreset_chunk));
+ }
sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport));
return SCTP_DISPOSITION_CONSUME;
@@ -6197,9 +6199,11 @@ enum sctp_disposition sctp_sf_t4_timer_e
* chunk, it MUST be the same (including its serial number) as the last
* ASCONF sent.
*/
- sctp_chunk_hold(asoc->addip_last_asconf);
- sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
- SCTP_CHUNK(asoc->addip_last_asconf));
+ if (!sctp_chunk_pending(asoc->addip_last_asconf)) {
+ sctp_chunk_hold(asoc->addip_last_asconf);
+ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+ SCTP_CHUNK(asoc->addip_last_asconf));
+ }
/* ADDIP 4.1 B5) Restart the T-4 RTO timer. Note that if a different
* destination is selected, then the RTO used will be that of the new
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0766/1005] sctp: fix ASCONF address change on single-homed hosts
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (764 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0765/1005] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0767/1005] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
` (232 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Xin Long,
Dave Miller
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Misiurov <andrey.misyrov@gmail.com>
commit 5175b2fb34c77cf2cd56a290affa45412cb3a228 upstream.
Commit 9b2854f86f0b ("sctp: don't free the ASCONF's own transport in
DEL-IP processing") refuses a DEL-IP of the transport the ASCONF was
located by, so that a later wildcard DEL-IP cannot use it after free.
This also breaks the single-homed address change (RFC 5061 5.3.2). The
host sends [Address Parameter L] [ADD-IP S] [DEL-IP L], the association
is located by L, and DEL-IP L is now refused. The sender never gets an
all-success ASCONF-ACK, keeps src_out_of_asoc_ok set and stops sending
data, so the association stalls.
Fix the wildcard DEL-IP instead: look up the transport of the packet
source rather than reusing asconf->transport. Both DEL-IP paths can
now free asconf->transport, and chunks bundled after the ASCONF still
use it, so point it at a surviving transport: the packet source for the
wildcard delete, the primary path for a plain one.
Found by manual code inspection while reviewing a backport of commit
9b2854f86f0b; reproduced on a two-namespace single-homed renumber.
Fixes: 9b2854f86f0b ("sctp: don't free the ASCONF's own transport in DEL-IP processing")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Misiurov <andrey.misyrov@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/sm_make_chunk.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3160,9 +3160,12 @@ static __be16 sctp_process_asconf_param(
* packet MUST be deleted.
*/
if (af->is_any(&addr)) {
- sctp_assoc_set_primary(asoc, asconf->transport);
- sctp_assoc_del_nonprimary_peers(asoc,
- asconf->transport);
+ peer = sctp_assoc_lookup_paddr(asoc, &asconf->source);
+ if (!peer)
+ return SCTP_ERROR_REQ_REFUSED;
+ sctp_assoc_set_primary(asoc, peer);
+ sctp_assoc_del_nonprimary_peers(asoc, peer);
+ asconf->transport = peer;
return SCTP_ERROR_NO_ERROR;
}
@@ -3175,13 +3178,9 @@ static __be16 sctp_process_asconf_param(
if (!peer)
return SCTP_ERROR_DNS_FAILED;
- /* Don't free asconf->transport; a later wildcard DEL-IP
- * parameter reuses it.
- */
- if (peer == asconf->transport)
- return SCTP_ERROR_REQ_REFUSED;
-
sctp_assoc_rm_peer(asoc, peer);
+ if (asconf->transport == peer)
+ asconf->transport = asoc->peer.primary_path;
break;
case SCTP_PARAM_SET_PRIMARY:
/* ADDIP Section 4.2.4
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0767/1005] sctp: fix I-FORWARD-TSN handling of fragments on other streams
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (765 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0766/1005] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0768/1005] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
` (231 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Budding, Xin Long,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Budding <tim.budding@gmail.com>
commit 5b9cfc6491a6e32e7315dc222992c7dbd5baa3e9 upstream.
sctp_report_iftsn() incorrectly frees queued I-DATA fragments in two
cases. First, it drops any queued fragments with TSN less than or equal
to the New Cumulative TSN. This prevents reconstruction of messages
still being received on other streams and can fully block an ordered
stream. Second, it calls sctp_intl_abort_pd() if the New Cumulative TSN
equals the highest TSN seen. This check exists for association resets
but can be inadvertently triggered by any I-FORWARD-TSN that arrives
before data with a higher TSN, causing data loss and, if a partial
delivery is in progress on an ordered stream, an aborted association.
Fix the first by freeing fragments from sctp_intl_skip() based on
stream, U bit, and MID instead of TSN. Fix the second by moving the call
to sctp_intl_abort_pd() from sctp_report_iftsn() to the corresponding
reset handlers.
Observed in real use as unexpected message loss. Reproduced on an
unmodified kernel with the sctp_ifwdtsn.sh selftest added later in this
series, which passes with this fix. Reproduction and fix done with AI
assistance.
Fixes: 47b20a88566f ("sctp: implement report_ftsn for sctp_stream_interleave")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Budding <tim.budding@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261105050225.49292-4-tim.budding@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/stream.c | 2 ++
net/sctp/stream_interleave.c | 32 +++++++++++---------------------
2 files changed, 13 insertions(+), 21 deletions(-)
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -749,6 +749,7 @@ struct sctp_chunk *sctp_process_strreset
*/
max_tsn_seen = sctp_tsnmap_get_max_tsn_seen(&asoc->peer.tsn_map);
asoc->stream.si->report_ftsn(&asoc->ulpq, max_tsn_seen);
+ asoc->stream.si->abort_pd(&asoc->ulpq, GFP_ATOMIC);
/* G1: Compute an appropriate value for the Receiver's Next TSN -- the
* TSN that the peer should use to send the next DATA chunk. The
@@ -1028,6 +1029,7 @@ struct sctp_chunk *sctp_process_strreset
LIST_HEAD(temp);
asoc->stream.si->report_ftsn(&asoc->ulpq, mtsn);
+ asoc->stream.si->abort_pd(&asoc->ulpq, GFP_ATOMIC);
sctp_tsnmap_init(&asoc->peer.tsn_map,
SCTP_TSN_MAP_INITIAL,
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -1203,28 +1203,21 @@ static void sctp_report_fwdtsn(struct sc
sctp_ulpq_abort_pd(ulpq, GFP_ATOMIC);
}
-static void sctp_intl_reasm_flushtsn(struct sctp_ulpq *ulpq, __u32 ftsn)
+static void sctp_intl_reasm_flush_mid(struct sk_buff_head *reasm, __u16 sid,
+ __u32 mid)
{
struct sk_buff *pos, *tmp;
- skb_queue_walk_safe(&ulpq->reasm, pos, tmp) {
+ skb_queue_walk_safe(reasm, pos, tmp) {
struct sctp_ulpevent *event = sctp_skb2event(pos);
- __u32 tsn = event->tsn;
- if (TSN_lte(tsn, ftsn)) {
- __skb_unlink(pos, &ulpq->reasm);
- sctp_ulpevent_free(event);
- }
- }
+ if (event->stream < sid)
+ continue;
+ if (event->stream > sid || MID_lt(mid, event->mid))
+ break;
- skb_queue_walk_safe(&ulpq->reasm_uo, pos, tmp) {
- struct sctp_ulpevent *event = sctp_skb2event(pos);
- __u32 tsn = event->tsn;
-
- if (TSN_lte(tsn, ftsn)) {
- __skb_unlink(pos, &ulpq->reasm_uo);
- sctp_ulpevent_free(event);
- }
+ __skb_unlink(pos, reasm);
+ sctp_ulpevent_free(event);
}
}
@@ -1232,11 +1225,6 @@ static void sctp_report_iftsn(struct sct
{
/* Move the Cumulattive TSN Ack ahead. */
sctp_tsnmap_skip(&ulpq->asoc->peer.tsn_map, ftsn);
- /* purge the fragmentation queue */
- sctp_intl_reasm_flushtsn(ulpq, ftsn);
- /* abort only when it's for all data */
- if (ftsn == sctp_tsnmap_get_max_tsn_seen(&ulpq->asoc->peer.tsn_map))
- sctp_intl_abort_pd(ulpq, GFP_ATOMIC);
}
static void sctp_handle_fwdtsn(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk)
@@ -1260,6 +1248,7 @@ static void sctp_intl_skip(struct sctp_u
sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x1,
GFP_ATOMIC);
}
+ sctp_intl_reasm_flush_mid(&ulpq->reasm_uo, sid, mid);
return;
}
@@ -1271,6 +1260,7 @@ static void sctp_intl_skip(struct sctp_u
sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x0, GFP_ATOMIC);
}
+ sctp_intl_reasm_flush_mid(&ulpq->reasm, sid, mid);
sctp_mid_skip(stream, in, sid, mid);
sctp_intl_reap_ordered(ulpq, sid);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0768/1005] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (766 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0767/1005] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0769/1005] sctp: reset stored flag for each association Greg Kroah-Hartman
` (230 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tim Budding, Xin Long,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Budding <tim.budding@gmail.com>
commit 3097fba868019924e92b8786ebd473992565f015 upstream.
When an I-FORWARD-TSN skips the message being partially delivered on a
stream, sctp_intl_skip() passes the MID from the I-FORWARD-TSN to the
PARTIAL_DELIVERY_ABORTED notification as pdapi_seq. That MID is the
highest one skipped on the stream, so when more than one message is
skipped, the notification names a later message instead of the one
whose partial delivery was aborted.
Report the MID being partially delivered, sin->mid_uo or sin->mid,
instead.
Reproduced on an unmodified kernel with the pdapi and pdapi_uo tests of
the sctp_ifwdtsn.sh selftest added later in this series, which pass
with this fix. Reproduction and fix done with AI assistance.
Fixes: de60fe910543 ("sctp: implement handle_ftsn for sctp_stream_interleave")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/179293012867.3134.16497481637722705271@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Tim Budding <tim.budding@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261105050225.49292-3-tim.budding@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/stream_interleave.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -1245,7 +1245,7 @@ static void sctp_intl_skip(struct sctp_u
if (flags & SCTP_FTSN_U_BIT) {
if (sin->pd_mode_uo && !MID_lt(mid, sin->mid_uo)) {
sin->pd_mode_uo = 0;
- sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x1,
+ sctp_intl_stream_abort_pd(ulpq, sid, sin->mid_uo, 0x1,
GFP_ATOMIC);
}
sctp_intl_reasm_flush_mid(&ulpq->reasm_uo, sid, mid);
@@ -1257,7 +1257,7 @@ static void sctp_intl_skip(struct sctp_u
if (sin->pd_mode) {
sin->pd_mode = 0;
- sctp_intl_stream_abort_pd(ulpq, sid, mid, 0x0, GFP_ATOMIC);
+ sctp_intl_stream_abort_pd(ulpq, sid, sin->mid, 0x0, GFP_ATOMIC);
}
sctp_intl_reasm_flush_mid(&ulpq->reasm, sid, mid);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0769/1005] sctp: reset stored flag for each association
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (767 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0768/1005] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0770/1005] ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow Greg Kroah-Hartman
` (229 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi, Xin Long,
Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <bestswngs@gmail.com>
commit 173712d868eb20628ad82deb07f6829a68a9e064 upstream.
sctp_send_asconf_del_ip() walks every association on an endpoint. The
stored flag records that the current association took the single-homed
deferral path and therefore did not allocate an ASCONF chunk. It is
currently scoped to the whole function. Once one association sets it,
later eligible multihomed associations allocate chunks but skip
sctp_send_asconf(), leaking each chunk and its skb.
Reset stored for every association so only an association taking the
deferral path skips transmission. In an A/B kmemleak test, the
vulnerable kernel reported 210 leaked objects from this call path and the
fixed kernel reported none.
Cc: stable@vger.kernel.org
Fixes: 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host")
Reported-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261108161149.2774119-1-bestswngs@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -809,7 +809,6 @@ static int sctp_send_asconf_del_ip(struc
struct sctp_sockaddr_entry *saddr;
int i;
int retval = 0;
- int stored = 0;
chunk = NULL;
sp = sctp_sk(sk);
@@ -822,6 +821,7 @@ static int sctp_send_asconf_del_ip(struc
__func__, sk, addrs, addrcnt);
list_for_each_entry(asoc, &ep->asocs, asocs) {
+ int stored = 0;
if (!asoc->peer.asconf_capable)
continue;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0770/1005] ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (768 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0769/1005] sctp: reset stored flag for each association Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0771/1005] ksmbd: keep group denials when a POSIX ACL entry decides access Greg Kroah-Hartman
` (228 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
commit 42ac1f1917ae678ee2c47f415ab844af03bbd46b upstream.
smb_check_perm_dacl() does not match ACEs for the caller's Unix
groups and refuses an owner named only by OWNER RIGHTS. These callers
cannot use rights the DACL grants them under MS-DTYP 2.5.3.2.
Match Unix group SIDs (S-1-22-2) against the caller's credentials. Use
the ordered DACL result when the existing SID lookup and POSIX ACL
fallback do not decide access. In that result, deny ACEs for the
caller's groups limit what it grants, also for MAXIMUM_ALLOWED. Count
only the exact OWNER RIGHTS SID in that result, since compare_sids()
also matches shorter and longer SIDs, and return only file access
rights. Preserve the refusal for non-inherit-only object deny ACEs,
which ksmbd does not parse.
MAXIMUM_ALLOWED still excludes group allow ACEs. Including them
requires corresponding changes in smb2_open() to avoid breaking
existing opens. An open relying on group grants can therefore still
fail when it requests a maximal access reply. For the owner, that
reply leaves out the rights of its groups.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smbacl.c | 162 +++++++++++++++++++++++++++++++++++--------------
1 file changed, 117 insertions(+), 45 deletions(-)
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -1452,6 +1452,35 @@ bool smb_inherit_flags(int flags, bool i
return false;
}
+/* Whether the caller's credentials hold the group of an S-1-22-2-<gid> SID */
+static bool smb_sid_in_group(const struct smb_sid *sid)
+{
+ gid_t gid;
+
+ if (sid->num_subauth != sid_unix_groups.num_subauth + 1 ||
+ compare_sids(sid, &sid_unix_groups))
+ return false;
+ gid = le32_to_cpu(sid->sub_auth[sid->num_subauth - 1]);
+ /*
+ * ksmbd_override_fsids() builds the caller's credentials with
+ * make_kgid(&init_user_ns, ...), so the group membership test must
+ * compare in that space. Applying the mount idmap here (as when
+ * resolving a SID to an on-disk gid) would mismatch on idmapped
+ * mounts.
+ */
+ return in_group_p(make_kgid(&init_user_ns, gid));
+}
+
+/*
+ * compare_sids() compares only the sub-authorities both SIDs have, so it
+ * also matches a shorter or longer SID, such as S-1-3 or S-1-3-4-777
+ */
+static bool smb_sid_is_owner_rights(const struct smb_sid *sid)
+{
+ return sid->num_subauth == sid_owner_rights.num_subauth &&
+ !compare_sids(sid, &sid_owner_rights);
+}
+
int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
__le32 *pdaccess, __le32 raw_daccess, int uid,
bool strict)
@@ -1468,13 +1497,15 @@ int smb_check_perm_dacl(struct ksmbd_con
int granted = requested;
struct smb_ace *ace;
int i, found = 0;
- unsigned int access_bits = 0, denied = 0;
+ unsigned int access_bits = 0, denied = 0, grp_granted = 0;
+ unsigned int grp_allowed = 0, grp_denied = 0, bits;
struct smb_ace *others_ace = NULL;
- bool or_ace = false;
+ bool or_ace = false, obj_deny = false, member, counted;
struct posix_acl_entry *pa_entry;
unsigned int sid_type = SIDOWNER;
unsigned short ace_size;
bool is_owner, owner_rights = false;
+ bool maximal = *pdaccess & FILE_MAXIMAL_ACCESS_LE;
vfsuid_t vfsuid;
ksmbd_debug(SMB, "check permission using windows acl\n");
@@ -1515,7 +1546,7 @@ int smb_check_perm_dacl(struct ksmbd_con
*/
if (is_owner)
allowed = READ_CONTROL | WRITE_DAC;
- if (*pdaccess & FILE_MAXIMAL_ACCESS_LE)
+ if (maximal)
requested |= allowed;
if (!allowed || requested & ~allowed)
rc = -EACCES;
@@ -1524,53 +1555,83 @@ int smb_check_perm_dacl(struct ksmbd_con
goto err_out;
}
- if (*pdaccess & FILE_MAXIMAL_ACCESS_LE) {
- ace = (struct smb_ace *)((char *)pdacl + sizeof(struct smb_acl));
- aces_size = pdacl_size - sizeof(struct smb_acl);
- for (i = 0; i < le16_to_cpu(pdacl->num_aces); i++) {
- if (aces_size < offsetof(struct smb_ace, sid) +
- CIFS_SID_BASE_SIZE)
- break;
- ace_size = le16_to_cpu(ace->size);
- if (ace_size > aces_size ||
- ace_size < offsetof(struct smb_ace, sid) +
- CIFS_SID_BASE_SIZE)
- break;
- aces_size -= ace_size;
+ /*
+ * Evaluate the DACL in order (MS-DTYP 2.5.3.2). access_bits collects
+ * the MAXIMUM_ALLOWED result. grp_granted collects what ACEs for the
+ * caller's groups, or OWNER RIGHTS for the owner, grant. It is used
+ * when the SID lookup and POSIX ACL fallback below do not decide.
+ */
+ ace = (struct smb_ace *)((char *)pdacl + sizeof(struct smb_acl));
+ aces_size = pdacl_size - sizeof(struct smb_acl);
+ for (i = 0; i < le16_to_cpu(pdacl->num_aces); i++) {
+ if (aces_size < offsetof(struct smb_ace, sid) +
+ CIFS_SID_BASE_SIZE)
+ break;
+ ace_size = le16_to_cpu(ace->size);
+ if (ace_size > aces_size ||
+ ace_size < offsetof(struct smb_ace, sid) +
+ CIFS_SID_BASE_SIZE)
+ break;
+ aces_size -= ace_size;
- if (ace->sid.num_subauth > SID_MAX_SUB_AUTHORITIES ||
- ace_size < offsetof(struct smb_ace, sid) +
- CIFS_SID_BASE_SIZE +
- sizeof(__le32) * ace->sid.num_subauth)
- break;
+ if (ace->sid.num_subauth > SID_MAX_SUB_AUTHORITIES ||
+ ace_size < offsetof(struct smb_ace, sid) +
+ CIFS_SID_BASE_SIZE +
+ sizeof(__le32) * ace->sid.num_subauth)
+ break;
- if (!compare_sids(&sid_owner_rights, &ace->sid)) {
- owner_rights = true;
- if (!is_owner)
- goto next_ace;
- }
+ if ((ace->type == ACCESS_DENIED_OBJECT_ACE_TYPE ||
+ ace->type == ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE) &&
+ !(ace->flags & INHERIT_ONLY_ACE))
+ obj_deny = true;
- if (ace->flags & INHERIT_ONLY_ACE ||
- (compare_sids(&sid, &ace->sid) &&
- compare_sids(&sid_unix_NFS_mode, &ace->sid) &&
- compare_sids(&sid_everyone, &ace->sid) &&
- compare_sids(&sid_authusers, &ace->sid) &&
- compare_sids(&sid_owner_rights, &ace->sid)))
+ if (!compare_sids(&sid_owner_rights, &ace->sid)) {
+ owner_rights = true;
+ if (!is_owner)
goto next_ace;
+ }
- switch (ace->type) {
- case ACCESS_ALLOWED_ACE_TYPE:
- access_bits |= le32_to_cpu(ace->access_req);
- break;
- case ACCESS_DENIED_ACE_TYPE:
- case ACCESS_DENIED_CALLBACK_ACE_TYPE:
- denied |= ~access_bits &
- le32_to_cpu(ace->access_req);
+ member = smb_sid_in_group(&ace->sid);
+ /* The grp_ masks count groups and OWNER RIGHTS only */
+ counted = member ||
+ (is_owner && smb_sid_is_owner_rights(&ace->sid));
+ if (ace->flags & INHERIT_ONLY_ACE ||
+ (compare_sids(&sid, &ace->sid) &&
+ compare_sids(&sid_unix_NFS_mode, &ace->sid) &&
+ compare_sids(&sid_everyone, &ace->sid) &&
+ compare_sids(&sid_authusers, &ace->sid) &&
+ compare_sids(&sid_owner_rights, &ace->sid) &&
+ !member))
+ goto next_ace;
+
+ bits = le32_to_cpu(ace->access_req);
+ switch (ace->type) {
+ case ACCESS_ALLOWED_ACE_TYPE:
+ if (counted)
+ grp_allowed |= bits;
+ /* MAXIMUM_ALLOWED takes no group grants */
+ if (maximal && member)
break;
- }
-next_ace:
- ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size));
+ if (counted)
+ grp_granted |= bits;
+ access_bits |= bits;
+ break;
+ case ACCESS_DENIED_ACE_TYPE:
+ case ACCESS_DENIED_CALLBACK_ACE_TYPE:
+ if (counted)
+ grp_denied |= ~grp_allowed & bits;
+ /* access_bits takes no group denials either */
+ if (!member)
+ denied |= ~access_bits & bits;
+ break;
}
+next_ace:
+ ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size));
+ }
+
+ /* Keep only file rights, not MAXIMUM_ALLOWED or generic bits */
+ grp_granted &= GENERIC_ALL_FLAGS & ~grp_denied;
+ if (maximal) {
if (is_owner && !owner_rights)
access_bits |= READ_CONTROL | WRITE_DAC |
FILE_READ_ATTRIBUTES | DELETE;
@@ -1580,6 +1641,9 @@ next_ace:
(access_bits & GENERIC_READ_FLAGS) == GENERIC_READ_FLAGS)
access_bits |= FILE_EXECUTE;
granted = requested | access_bits;
+ } else {
+ /* An explicit request uses only grp_granted and obj_deny */
+ access_bits = 0;
}
ace = (struct smb_ace *)((char *)pdacl + sizeof(struct smb_acl));
@@ -1661,7 +1725,15 @@ next_ace:
*/
if (is_owner && !or_ace)
allowed = READ_CONTROL | WRITE_DAC;
- if (*pdaccess & FILE_MAXIMAL_ACCESS_LE)
+ /*
+ * Add what ACEs for the caller's groups, or OWNER
+ * RIGHTS for the owner, grant in DACL order, unless an
+ * object deny ACE, which ksmbd does not parse, could
+ * apply.
+ */
+ if (!obj_deny)
+ allowed |= grp_granted;
+ if (maximal)
requested |= allowed;
if (!allowed || requested & ~allowed) {
ksmbd_debug(SMB, "Can't find corresponding sid\n");
@@ -1673,7 +1745,7 @@ next_ace:
}
}
- if (!(*pdaccess & FILE_MAXIMAL_ACCESS_LE)) {
+ if (!maximal) {
switch (ace->type) {
case ACCESS_ALLOWED_ACE_TYPE:
access_bits = le32_to_cpu(ace->access_req);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0771/1005] ksmbd: keep group denials when a POSIX ACL entry decides access
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (769 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0770/1005] ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0772/1005] ksmbd: refuse reauthentication of an expired session as another user Greg Kroah-Hartman
` (227 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Ian Bridges, Namjae Jeon
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
commit b0af9a3e6b1534d353ca6ac23caaf46127f62e4a upstream.
When no ACE names the caller, Everyone or Authenticated Users,
smb_check_perm_dacl() lets a POSIX ACL entry for the caller decide
access. The entry's rights replace the result of the DACL walk. Deny
ACEs for the caller's groups, and OWNER RIGHTS for the owner, are then
lost.
For example, a deny of FILE_WRITE_DATA for one of the caller's groups
should refuse writes. A POSIX ACL entry that gives the caller write
access still lets the caller write.
Remove the requested rights that those ACEs deny from the entry's
rights. The DACL walk already records them in grp_denied.
Fixes: 42ac1f1917ae ("ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20261102200353.884509-1-icb%40fastmail.org
Link: https://sashiko.dev/#/patchset/20261103150458.11591-1-icb%40fastmail.org
Link: https://sashiko.dev/#/patchset/20261107062233.1579198-1-icb%40fastmail.org?part=1
Link: https://sashiko.dev/#/patchset/20261107231941.1824289-1-icb%40fastmail.org?part=1
Link: https://sashiko.dev/#/patchset/20261108182011.1888520-1-icb%40fastmail.org?part=1
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smbacl.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -1703,6 +1703,15 @@ next_ace:
if (!access_bits)
access_bits =
SET_MINIMUM_RIGHTS;
+ /*
+ * Only ACEs for the caller's groups,
+ * or OWNER RIGHTS for the owner, apply
+ * here. The POSIX ACL entry does not
+ * grant an explicitly requested right
+ * that they deny first in DACL order.
+ */
+ access_bits &= ~(grp_denied &
+ requested);
posix_acl_release(posix_acls);
goto check_access_bits;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0772/1005] ksmbd: refuse reauthentication of an expired session as another user
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (770 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0771/1005] ksmbd: keep group denials when a POSIX ACL entry decides access Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0773/1005] LoongArch: BPF: Make arena support depend on 128-bit cmpxchg Greg Kroah-Hartman
` (226 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michail Andreas Michalopoulos,
Namjae Jeon
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
commit 265709f9dc271693d1a261a62242db652fcc471d upstream.
When a Kerberos session expires, its owner can reauthenticate it. For an
NTLM reauthentication, ntlm_authenticate() only compares the new user with
sess->user when the session is still valid. An expired session is in
SMB2_SESSION_IN_PROGRESS during the reauthentication, so it takes the
other branch and simply sets sess->user to the new user:
- the session's open files, tree connects and other state, created under
the original user's identity, now belong to whichever user just
authenticated, and a later Kerberos reauthentication is compared
against that user rather than the original one;
- the original struct ksmbd_user is overwritten without being freed.
krb5_authenticate() already refuses a different user in this case, and
the valid-session branch of ntlm_authenticate() does too. Do the same for
an expired session: compare with the existing user and refuse a different
one with -EKEYREJECTED, freeing the newly looked-up user either way.
An AI assistant was used to find and fix this and as an independent
reviewer.
Fixes: a47634cd729b ("ksmbd: expire SMB sessions when Kerberos tickets expire")
Cc: stable@vger.kernel.org
Signed-off-by: Michail Andreas Michalopoulos <mike.michalo@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smb2pdu.c | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2358,6 +2358,17 @@ static int ntlm_authenticate(struct ksmb
return -EKEYREJECTED;
}
ksmbd_free_user(user);
+ } else if (sess->user) {
+ /*
+ * Reauthentication of an expired session: as for a valid
+ * session, and as krb5_authenticate() does, it must be by the
+ * same user. Replacing sess->user would also leak the old one.
+ */
+ if (!ksmbd_compare_user(sess->user, user)) {
+ ksmbd_free_user(user);
+ return -EKEYREJECTED;
+ }
+ ksmbd_free_user(user);
} else {
sess->user = user;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0773/1005] LoongArch: BPF: Make arena support depend on 128-bit cmpxchg
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (771 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0772/1005] ksmbd: refuse reauthentication of an expired session as another user Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0774/1005] LoongArch: BPF: Make use of beqz and bnez for trampoline branches Greg Kroah-Hartman
` (225 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tiezhu Yang, Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <yangtiezhu@loongson.cn>
commit 9496832b824ab5f570c86d65e3b6f08163e6908b upstream.
When testing bpf selftest "jit_insns/cast_to_user", there are different
behaviors on different Loongson machines.
(1) Loongson-3A6000
$ sudo ./test_progs -a jit_insns/cast_to_user
...
Summary: 1/1 PASSED, 0 SKIPPED, 0/0 FAILED
(2) Loongson-3A5000
$ sudo ./test_progs -a jit_insns/cast_to_user
...
libbpf: map 'arena': failed to create: -ENOMEM
run_subtest:FAIL:unexpected_load_failure unexpected error: -12 (errno 12)
...
Summary: 0/0 PASSED, 0 SKIPPED, 1/1 FAILED
This is because the arena range tree uses kmalloc_nolock() API, which
requires 128-bit atomic cmpxchg. This feature is provided by not only
hardware SCQ extension but also assembler support on LoongArch. On CPUs
without the SCQ extension, or if the older versions of assembler do not
support the sc.q instruction, arena map creation fails with a misleading
-ENOMEM error.
Since system_has_cmpxchg128() and arch_cmpxchg128() are only available
when CONFIG_AS_HAS_SCQ_EXTENSION is enabled (need assembler support), we
guard bpf_jit_supports_arena() with an #ifdef block to preserve compile-
time robustness first, and then safely return system_has_cmpxchg128() if
defined, otherwise falling back to false. This ensures that arena map
creation cleanly fails with a -EOPNOTSUPP on the systems without either
the assembler support or the hardware SCQ extension.
With this patch, here is the test result on Loongson-3A5000 without SCQ
extension:
$ sudo ./test_progs -a jit_insns/cast_to_user
...
libbpf: map 'arena': failed to create: -EOPNOTSUPP
run_subtest:FAIL:unexpected_load_failure unexpected error: -95 (errno 95)
...
Summary: 0/0 PASSED, 0 SKIPPED, 1/1 FAILED
It is better to mark the test status as SKIPPED rather than logging a
false-alarm failure if the feature is not supported, but this belongs
to a separate bpf selftest patch.
This is similar to commit 536b523b4073 ("bpf, riscv: Make arena support
depend on ZACAS").
Note that BPF should not depend on a SLUB debug-mode escape hatch, so no
need to consider the slub_debug exception.
Cc: stable@vger.kernel.org
Fixes: 4fdb5dd8aeba ("LoongArch: BPF: Implement bpf_addr_space_cast instruction")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/net/bpf_jit.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/arch/loongarch/net/bpf_jit.c
+++ b/arch/loongarch/net/bpf_jit.c
@@ -2436,7 +2436,16 @@ bool bpf_jit_bypass_spec_v4(void)
bool bpf_jit_supports_arena(void)
{
- return true;
+ /*
+ * The arena range tree uses kmalloc_nolock(), which requires
+ * 128-bit atomic cmpxchg; this is provided by not only hardware
+ * SCQ extension but also assembler support on LoongArch.
+ */
+#ifdef system_has_cmpxchg128
+ return system_has_cmpxchg128();
+#else
+ return false;
+#endif
}
bool bpf_jit_supports_fsession(void)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0774/1005] LoongArch: BPF: Make use of beqz and bnez for trampoline branches
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (772 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0773/1005] LoongArch: BPF: Make arena support depend on 128-bit cmpxchg Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0775/1005] LoongArch: kexec_file: Fix a modified cmdline leak Greg Kroah-Hartman
` (224 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tiezhu Yang, Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <yangtiezhu@loongson.cn>
commit 6dd070681326ef2fef5e008b8c3d0ae9634de222 upstream.
Currently, the implementation for BPF trampoline branches does not match
the existing technical comments. The code uses larch_insn_gen_beq, where
the comment indicates beqz should be used.
While the BPF trampoline size is restricted within a single memory page
(at most 64KB on LoongArch) and cannot cross the original 16-bit branch
offset limit of the reg2i16 format, switching to the beqz instruction
(which belongs to the reg1i21 format) avoids explicitly specifying the
zero register during dynamic JIT encoding, resulting in cleaner assembly
generation.
While at it, also apply the same optimization to the bne instruction by
replacing it with bnez and adding a corresponding comment.
Cc: stable@vger.kernel.org
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/include/asm/inst.h | 21 +++++++++++++++++++++
arch/loongarch/kernel/inst.c | 28 ++++++++++++++++++++++++++++
arch/loongarch/net/bpf_jit.c | 5 +++--
3 files changed, 52 insertions(+), 2 deletions(-)
--- a/arch/loongarch/include/asm/inst.h
+++ b/arch/loongarch/include/asm/inst.h
@@ -535,6 +535,8 @@ u32 larch_insn_gen_lu32id(enum loongarch
u32 larch_insn_gen_lu52id(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
u32 larch_insn_gen_beq(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
u32 larch_insn_gen_bne(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
+u32 larch_insn_gen_beqz(enum loongarch_gpr rj, int imm);
+u32 larch_insn_gen_bnez(enum loongarch_gpr rj, int imm);
u32 larch_insn_gen_jirl(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
static inline bool signed_imm_check(long val, unsigned int bit)
@@ -592,6 +594,25 @@ DEF_EMIT_REG1I20_FORMAT(lu12iw, lu12iw_o
DEF_EMIT_REG1I20_FORMAT(lu32id, lu32id_op)
DEF_EMIT_REG1I20_FORMAT(pcaddu18i, pcaddu18i_op)
+#define DEF_EMIT_REG1I21_FORMAT(NAME, OP) \
+static inline void emit_##NAME(union loongarch_instruction *insn, \
+ enum loongarch_gpr rj, int offset) \
+{ \
+ unsigned int immediate_l, immediate_h; \
+ \
+ immediate_l = offset & 0xffff; \
+ offset >>= 16; \
+ immediate_h = offset & 0x1f; \
+ \
+ insn->reg1i21_format.opcode = OP; \
+ insn->reg1i21_format.immediate_l = immediate_l; \
+ insn->reg1i21_format.rj = rj; \
+ insn->reg1i21_format.immediate_h = immediate_h; \
+}
+
+DEF_EMIT_REG1I21_FORMAT(beqz, beqz_op)
+DEF_EMIT_REG1I21_FORMAT(bnez, bnez_op)
+
#define DEF_EMIT_REG2_FORMAT(NAME, OP) \
static inline void emit_##NAME(union loongarch_instruction *insn, \
enum loongarch_gpr rd, \
--- a/arch/loongarch/kernel/inst.c
+++ b/arch/loongarch/kernel/inst.c
@@ -428,6 +428,34 @@ u32 larch_insn_gen_bne(enum loongarch_gp
return insn.word;
}
+u32 larch_insn_gen_beqz(enum loongarch_gpr rj, int imm)
+{
+ union loongarch_instruction insn;
+
+ if ((imm & 3) || imm < -SZ_4M || imm >= SZ_4M) {
+ pr_warn("The generated beqz instruction is out of range.\n");
+ return INSN_BREAK;
+ }
+
+ emit_beqz(&insn, rj, imm >> 2);
+
+ return insn.word;
+}
+
+u32 larch_insn_gen_bnez(enum loongarch_gpr rj, int imm)
+{
+ union loongarch_instruction insn;
+
+ if ((imm & 3) || imm < -SZ_4M || imm >= SZ_4M) {
+ pr_warn("The generated bnez instruction is out of range.\n");
+ return INSN_BREAK;
+ }
+
+ emit_bnez(&insn, rj, imm >> 2);
+
+ return insn.word;
+}
+
u32 larch_insn_gen_jirl(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm)
{
union loongarch_instruction insn;
--- a/arch/loongarch/net/bpf_jit.c
+++ b/arch/loongarch/net/bpf_jit.c
@@ -1768,7 +1768,7 @@ static int invoke_bpf_prog(struct jit_ct
/* update branch with beqz */
if (ctx->image) {
int offset = (void *)(&ctx->image[ctx->idx]) - (void *)branch;
- *branch = larch_insn_gen_beq(LOONGARCH_GPR_A0, LOONGARCH_GPR_ZERO, offset);
+ *branch = larch_insn_gen_beqz(LOONGARCH_GPR_A0, offset);
}
/* arg1: prog */
@@ -2081,9 +2081,10 @@ static int __arch_prepare_bpf_trampoline
emit_insn(ctx, std, regmap[BPF_REG_0], LOONGARCH_GPR_FP, -(retval_off - 8));
}
+ /* update branches with bnez */
for (i = 0; ctx->image && i < fmod_ret->nr_nodes; i++) {
int offset = (void *)(&ctx->image[ctx->idx]) - (void *)branches[i];
- *branches[i] = larch_insn_gen_bne(LOONGARCH_GPR_T1, LOONGARCH_GPR_ZERO, offset);
+ *branches[i] = larch_insn_gen_bnez(LOONGARCH_GPR_T1, offset);
}
/* Set "is_return" flag for fsession */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0775/1005] LoongArch: kexec_file: Fix a modified cmdline leak
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (773 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0774/1005] LoongArch: BPF: Make use of beqz and bnez for trampoline branches Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0776/1005] LoongArch: kexec_file: Fix elf_headers memory leak in retry loop Greg Kroah-Hartman
` (223 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jinjie Ruan, Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinjie Ruan <ruanjinjie@huawei.com>
commit b7000844b374a1ab75f0cc561f1d4d321cd6eeb0 upstream.
machine_kexec_prepare() copies it to KEXEC_CMDLINE_ADDR and overwrites
the pointer. Free the heap buffer after the copy here.
Cc: stable@vger.kernel.org
Fixes: d162feec6b6e ("LoongArch: Add preparatory infrastructure for kexec_file")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/kernel/machine_kexec.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/loongarch/kernel/machine_kexec.c
+++ b/arch/loongarch/kernel/machine_kexec.c
@@ -14,6 +14,7 @@
#include <linux/mm.h>
#include <linux/of_fdt.h>
#include <linux/reboot.h>
+#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/sched/task_stack.h>
@@ -56,6 +57,7 @@ int machine_kexec_prepare(struct kimage
*/
memcpy((void *)KEXEC_CMDLINE_ADDR, (void *)kimage->arch.cmdline_ptr,
strlen((char *)kimage->arch.cmdline_ptr) + 1);
+ kfree((void *)kimage->arch.cmdline_ptr);
kimage->arch.cmdline_ptr = (unsigned long)KEXEC_CMDLINE_ADDR;
} else {
/* Find the command line */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0776/1005] LoongArch: kexec_file: Fix elf_headers memory leak in retry loop
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (774 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0775/1005] LoongArch: kexec_file: Fix a modified cmdline leak Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0777/1005] LoongArch: Restore KFENCE pages through DMW on resume Greg Kroah-Hartman
` (222 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jinjie Ruan, Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinjie Ruan <ruanjinjie@huawei.com>
commit 065dd1636abef6b9962fd5af82accac69850bbe8 upstream.
A retry allocates new elf headers and overwrites image->elf_headers,
leaking the previous buffer. Free it before assigning here.
Cc: stable@vger.kernel.org
Fixes: 55d990f0084c ("LoongArch: Add EFI binary support for kexec_file")
Link: https://sashiko.dev/#/patchset/20260729031235.2840255-1-ruanjinjie%40huawei.com
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/kernel/machine_kexec_file.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/loongarch/kernel/machine_kexec_file.c
+++ b/arch/loongarch/kernel/machine_kexec_file.c
@@ -166,6 +166,10 @@ int load_other_segments(struct kimage *i
vfree(headers);
goto out_err;
}
+
+ if (unlikely(image->elf_headers))
+ vfree(image->elf_headers);
+
image->elf_headers = headers;
image->elf_load_addr = kbuf.mem;
image->elf_headers_sz = headers_sz;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0777/1005] LoongArch: Restore KFENCE pages through DMW on resume
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (775 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0776/1005] LoongArch: kexec_file: Fix elf_headers memory leak in retry loop Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0778/1005] LoongArch: KVM: Clear device pointer in irqchip destroy callbacks Greg Kroah-Hartman
` (221 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mike Rapoport (Microsoft),
Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Rapoport (Microsoft) <rppt@kernel.org>
commit 40d7a3e63c3d88b43e9115d23d9937dd506bbd02 upstream.
With KFENCE enabled, resume from hibernation triggers KFENCE reports
while swsusp_asm_resume() copies the image pages, for example:
BUG: KFENCE: use-after-free write in swsusp_asm_resume+0x20/0x94
Use-after-free write at 0x00000000a57ee925 (in kfence-#254):
swsusp_asm_resume+0x20/0x94
hibernation_restore+0x128/0x1a0
load_image_and_restore+0x6c/0xc8
software_resume+0x240/0x260
do_one_initcall+0x68/0x200
kernel_init_freeable+0x26c/0x304
kernel_init+0x20/0x134
ret_from_kernel_thread+0x24/0x1d0
ret_from_kernel_thread_asm+0xc/0x98
During resume from hibernation, the image pages that occupy physical
pages used by the restore kernel are first loaded into free pages and
then, as the very last step, swsusp_asm_resume() copies them to their
final location pointed to by pbe->orig_address, which the hibernation
core sets to page_address() of the page in the restore kernel.
The early KFENCE pool is allocated from memblock and normally occupies
the same physical pages in the restore kernel and in the image kernel,
so these pages are usually copied by swsusp_asm_resume().
The KFENCE pool is remapped into the KFENCE area above vm_map_base and
set_page_address() adjusts page->virtual so that page_address() returns
the page-table mapped alias rather than the DMW virtual address of the
pool pages.
Hence, pbe->orig_address of KFENCE pages points to that alias and
swsusp_asm_resume() writes them through the page tables. But:
* the copy loop overwrites the kernel page tables, so a TLB refill for
the KFENCE alias may use a partially restored page table
* the KFENCE pool pages that are protected in the restore kernel fault
in the middle of the copy
Convert pbe->orig_address to DMW addresses before starting the copy.
Cc: stable@vger.kernel.org
Fixes: 0ca84aeaee15 ("LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE")
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/power/hibernate.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/arch/loongarch/power/hibernate.c
+++ b/arch/loongarch/power/hibernate.c
@@ -59,6 +59,12 @@ extern int swsusp_asm_resume(void);
int swsusp_arch_resume(void)
{
+#ifdef CONFIG_KFENCE
+ struct pbe *pbe;
+
+ for (pbe = restore_pblist; pbe; pbe = pbe->next)
+ pbe->orig_address = __va(virt_to_phys(pbe->orig_address));
+#endif
/* Avoid TLB mismatch during and after kernel resume */
local_flush_tlb_all();
return swsusp_asm_resume();
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0778/1005] LoongArch: KVM: Clear device pointer in irqchip destroy callbacks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (776 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0777/1005] LoongArch: Restore KFENCE pages through DMW on resume Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0779/1005] LoongArch: KVM: Propagate real error code in kvm_pch_pic_create() Greg Kroah-Hartman
` (220 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bibo Mao, Tao Cui, Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Cui <cuitao@kylinos.cn>
commit a9ce1a00afb0402668877d37c04ffd0e53d48832 upstream.
The destroy callbacks of the four irqchip devices free the device
structure without clearing kvm->arch.{ipi,eiointc,pch_pic,dmsintc},
leaving a dangling pointer. ops->destroy() is not only called at VM
teardown but also when KVM_CREATE_DEVICE succeeds and the following
anon_inode_getfd() fails (e.g. under RLIMIT_NOFILE); the VM stays
alive, kvm_arch_irqchip_in_kernel() still reports true, and interrupt
injection dereferences the freed device.
Clear the pointer when destroying.
Cc: stable@vger.kernel.org
Fixes: c532de5a67a7 ("LoongArch: KVM: Add IPI device support")
Fixes: 2e8b9df82631 ("LoongArch: KVM: Add EIOINTC device support")
Fixes: e785dfacf7e7 ("LoongArch: KVM: Add PCHPIC device support")
Fixes: 229132c309d6 ("LoongArch: KVM: Add DMSINTC device support")
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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 | 1 +
4 files changed, 4 insertions(+)
--- a/arch/loongarch/kvm/intc/dmsintc.c
+++ b/arch/loongarch/kvm/intc/dmsintc.c
@@ -166,6 +166,7 @@ static void kvm_dmsintc_destroy(struct k
return;
kfree(dev->kvm->arch.dmsintc);
+ dev->kvm->arch.dmsintc = NULL;
kfree(dev);
}
--- a/arch/loongarch/kvm/intc/eiointc.c
+++ b/arch/loongarch/kvm/intc/eiointc.c
@@ -675,6 +675,7 @@ static void kvm_eiointc_destroy(struct k
kvm = dev->kvm;
eiointc = kvm->arch.eiointc;
+ kvm->arch.eiointc = NULL;
mutex_lock(&kvm->slots_lock);
kvm_io_bus_unregister_dev(kvm, KVM_IOCSR_BUS, &eiointc->device);
kvm_io_bus_unregister_dev(kvm, KVM_IOCSR_BUS, &eiointc->device_vext);
--- a/arch/loongarch/kvm/intc/ipi.c
+++ b/arch/loongarch/kvm/intc/ipi.c
@@ -444,6 +444,7 @@ static void kvm_ipi_destroy(struct kvm_d
kvm = dev->kvm;
ipi = kvm->arch.ipi;
+ kvm->arch.ipi = NULL;
mutex_lock(&kvm->slots_lock);
kvm_io_bus_unregister_dev(kvm, KVM_IOCSR_BUS, &ipi->device);
mutex_unlock(&kvm->slots_lock);
--- a/arch/loongarch/kvm/intc/pch_pic.c
+++ b/arch/loongarch/kvm/intc/pch_pic.c
@@ -483,6 +483,7 @@ static void kvm_pch_pic_destroy(struct k
kvm = dev->kvm;
s = kvm->arch.pch_pic;
+ kvm->arch.pch_pic = NULL;
/* unregister pch pic device and free it's memory */
mutex_lock(&kvm->slots_lock);
kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &s->device);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0779/1005] LoongArch: KVM: Propagate real error code in kvm_pch_pic_create()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (777 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0778/1005] LoongArch: KVM: Clear device pointer in irqchip destroy callbacks Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0780/1005] LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT Greg Kroah-Hartman
` (219 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bibo Mao, Tao Cui, Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Cui <cuitao@kylinos.cn>
commit 20f3bf3d3dce16f43b82881293586ce7d73982b6 upstream.
The real error code of kvm_setup_default_irq_routing() is replaced by
kvm_pch_pic_create() with a fixed -ENOMEM. Return the actual error code,
as kvm_eiointc_create() already does; while the kvm_ipi_create() case is
fixed separately by "Return the actual error code in kvm_ipi_create()"
(Chaithanya Lagisetty).
Cc: stable@vger.kernel.org
Fixes: e785dfacf7e7 ("LoongArch: KVM: Add PCHPIC device support")
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/kvm/intc/pch_pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/loongarch/kvm/intc/pch_pic.c
+++ b/arch/loongarch/kvm/intc/pch_pic.c
@@ -444,7 +444,7 @@ static int kvm_pch_pic_create(struct kvm
ret = kvm_setup_default_irq_routing(kvm);
if (ret)
- return -ENOMEM;
+ return ret;
s = kzalloc_obj(struct loongarch_pch_pic);
if (!s)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0780/1005] LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (778 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0779/1005] LoongArch: KVM: Propagate real error code in kvm_pch_pic_create() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0781/1005] tracing/perf: Clear stop state in perf_trace_add() Greg Kroah-Hartman
` (218 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bibo Mao, Tao Cui, Huacai Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Cui <cuitao@kylinos.cn>
commit 422e532809572ba1043192bf6a0c653bc68b3140 upstream.
KVM_DEV_LOONGARCH_PCH_PIC_CTRL_INIT has no guard against repeated
invocation: every call overwrites pch_pic_base and registers the same
kvm_io_device on the MMIO bus at the new base address, while the
kvm_pch_pic_destroy() unregisters only one bus range. After a repeated
init, MMIO to the stale ranges computes its register offset against the
new base address and silently reads 0 / drops writes, and the leftover
bus entries persist until the VM is destroyed.
Reject repeated initialization with -EEXIST, using the initialized
state of the kvm_io_device as the indicator. The check, the MMIO base
update and the bus registration are serialized by slots_lock, and the
real registration error is propagated instead of being replaced with
-EFAULT. On a registration failure the base addr and the device state
are rolled back so that a retry can start over.
Cc: stable@vger.kernel.org
Fixes: d206d9514873 ("LoongArch: KVM: Add PCHPIC user mode read and write functions")
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/kvm/intc/pch_pic.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
--- a/arch/loongarch/kvm/intc/pch_pic.c
+++ b/arch/loongarch/kvm/intc/pch_pic.c
@@ -281,16 +281,25 @@ static int kvm_pch_pic_init(struct kvm_d
struct kvm_io_device *device;
struct loongarch_pch_pic *s = dev->kvm->arch.pch_pic;
- s->pch_pic_base = addr;
device = &s->device;
+ mutex_lock(&kvm->slots_lock);
+ if (s->device.ops) {
+ ret = -EEXIST;
+ goto out;
+ }
+ s->pch_pic_base = addr;
/* init device by pch pic writing and reading ops */
kvm_iodevice_init(device, &kvm_pch_pic_ops);
- mutex_lock(&kvm->slots_lock);
/* register pch pic device */
ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS, addr, PCH_PIC_SIZE, device);
+ if (ret) {
+ s->pch_pic_base = 0;
+ s->device.ops = NULL;
+ }
+out:
mutex_unlock(&kvm->slots_lock);
- return (ret < 0) ? -EFAULT : 0;
+ return ret;
}
/* used by user space to get or set pch pic registers */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0781/1005] tracing/perf: Clear stop state in perf_trace_add()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (779 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0780/1005] LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0782/1005] tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create() Greg Kroah-Hartman
` (217 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Francesco Nigro, Paolo Bertinetti,
Peter Zijlstra (Intel)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bertinetti <paolobertinetti200f4@proton.me>
commit fb3f6b21b04f1e8b8982e90e9bf62db9f0dcb5e4 upstream.
Since commit 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage"),
__perf_event_overflow() stops the event with pmu->stop() and disables
it when the PERF_EVENT_IOC_REFRESH limit is reached. When userspace
re-arms the event with PERF_EVENT_IOC_REFRESH, the event is enabled
again and pmu->add() is called with PERF_EF_START.
perf_trace_add() sets PERF_HES_STOPPED when PERF_EF_START is missing,
but never clears it. The flag set by pmu->stop() stays, and
perf_tp_event_match() drops every later hit. A tracepoint, kprobe or
uprobe event re-armed this way delivers only its first overflow. This
breaks self-profilers such as async-profiler, and the "Event re-armed
with PERF_EVENT_IOC_REFRESH" perf test fails:
1000 events, count 1, 1 overflows (1 POLL_HUP), re-arm errno 0
Tracepoint event : FAILED!
Set the state from PERF_EF_START on every add, as perf_swevent_add()
does.
Fixes: 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage")
Closes: https://lore.kernel.org/r/20261021131006.2101248-1-nigro.fra@gmail.com/
Reported-by: Francesco Nigro <nigro.fra@gmail.com>
Assisted-by: LLM
Signed-off-by: Paolo Bertinetti <paolobertinetti200f4@proton.me>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://github.com/async-profiler/async-profiler/issues/1813
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261103130732.764081-2-paolobertinetti200f4@proton.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_event_perf.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -354,8 +354,7 @@ int perf_trace_add(struct perf_event *p_
struct trace_event_call *tp_event = p_event->tp_event;
struct hw_perf_event *hwc = &p_event->hw;
- if (!(flags & PERF_EF_START))
- p_event->hw.state = PERF_HES_STOPPED;
+ hwc->state = (flags & PERF_EF_START) ? 0 : PERF_HES_STOPPED;
if (is_sampling_event(p_event)) {
hwc->last_period = hwc->sample_period;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0782/1005] tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (780 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0781/1005] tracing/perf: Clear stop state in perf_trace_add() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0783/1005] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
` (216 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit c15120853eebbda98f3fe1f1e59370439c6c4447 upstream.
When generating a default event name in __trace_uprobe_create(), tail is
allocated with kstrdup() without __free(kfree). If the subsequent
kmalloc() for buf fails, the function returns -ENOMEM immediately and
leaks tail.
Declare tail with __free(kfree) so it is automatically freed on all
exit paths.
Link: https://lore.kernel.org/all/179455856197.403392.16569431894958507645.stgit@devnote2/
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/sashiko-outbox-204240@kernel.org/
Fixes: 97e8230f89a3 ("tracing: uprobe-event: Allocate string buffers from heap")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_uprobe.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -663,7 +663,7 @@ static int __trace_uprobe_create(int arg
}
if (!event) {
- char *tail;
+ char *tail __free(kfree) = NULL;
char *ptr;
tail = kstrdup(kbasename(filename), GFP_KERNEL);
@@ -679,7 +679,6 @@ static int __trace_uprobe_create(int arg
return -ENOMEM;
snprintf(buf, MAX_EVENT_NAME_LEN, "%c_%s_0x%lx", 'p', tail, offset);
event = buf;
- kfree(tail);
}
argc -= 2;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0783/1005] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (781 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0782/1005] tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0784/1005] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
` (215 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit a0f836eea463d4c468edb58eedb03911c9c0791d upstream.
Because the kernel is built with -funsigned-char, plain 'char' is
unsigned on all architectures. Reading 1-byte signed trace event fields
via *(char *)addr in get_event_field() therefore zero-extends instead of
sign-extending negative s8 values.
Use explicit fixed-width integer types (s8/u8, s16/u16, s32/u32) when
reading event fields.
Link: https://lore.kernel.org/all/179455852542.403392.15666310371702309464.stgit@devnote2/
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -330,21 +330,21 @@ get_event_field(struct fetch_insn *code,
switch (field->size) {
case 1:
if (field->is_signed)
- val = *(char *)addr;
+ val = *(s8 *)addr;
else
- val = *(unsigned char *)addr;
+ val = *(u8 *)addr;
break;
case 2:
if (field->is_signed)
- val = *(short *)addr;
+ val = *(s16 *)addr;
else
- val = *(unsigned short *)addr;
+ val = *(u16 *)addr;
break;
case 4:
if (field->is_signed)
- val = *(int *)addr;
+ val = *(s32 *)addr;
else
- val = *(unsigned int *)addr;
+ val = *(u32 *)addr;
break;
default:
if (field->size == sizeof(long)) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0784/1005] tracing/eprobe: Disallow attaching eprobes to fprobe events
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (782 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0783/1005] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0785/1005] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
` (214 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 92d9fa0ed69e1f724feed908bd0a462a42df4b88 upstream.
Event probes (eprobes) are not allowed to attach to other dynamic probe
events (kprobes, uprobes, and eprobes) to avoid recursive probe chains
and lifecycle dependencies. However, when fprobe events were introduced,
TRACE_EVENT_FL_FPROBE was omitted from the exclusion mask in
find_and_get_event(), allowing eprobes to attach to fprobe and tprobe
events.
Exclude TRACE_EVENT_FL_FPROBE events in find_and_get_event().
Link: https://lore.kernel.org/all/179455853457.403392.14549390017750529531.stgit@devnote2/
Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -758,7 +758,8 @@ find_and_get_event(const char *system, c
(TRACE_EVENT_FL_IGNORE_ENABLE |
TRACE_EVENT_FL_KPROBE |
TRACE_EVENT_FL_UPROBE |
- TRACE_EVENT_FL_EPROBE))
+ TRACE_EVENT_FL_EPROBE |
+ TRACE_EVENT_FL_FPROBE))
continue;
if (!tp_event->class->system ||
strcmp(system, tp_event->class->system))
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0785/1005] tracing/probes: Check enabled and busy state before unlinking sibling probes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (783 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0784/1005] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0786/1005] tracing/probes: Enable newly appended probe when target event is enabled Greg Kroah-Hartman
` (213 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit f1d9b7a3fe99b4228acdbab3c744c29f7ffe86ef upstream.
When a multiprobe event is enabled or referenced (for example, by an
eprobe, trigger, or open tracefs file) and a user attempts to delete the
event or one of its probes via dynamic_events, checking
trace_probe_has_sibling() before the enabled and busy checks allows the
first probe to be unlinked and freed while the event is still active,
only returning -EBUSY on the last sibling probe. For uprobe events,
unlinking and freeing an enabled sibling probe without unregistering its
uprobe_consumer also causes a use-after-free.
Ensure all four probe types (kprobe, fprobe, uprobe, and eprobe) verify
that the event is neither enabled nor busy before unlinking any sibling
probe.
Link: https://lore.kernel.org/all/179455848898.403392.17675270675769076596.stgit@devnote2/
Fixes: ca89bc071d5e ("tracing/kprobe: Add multi-probe per event support")
Fixes: 41af3cf587f4 ("tracing/uprobe: Add multi-probe per uprobe event support")
Fixes: 7491e2c44278 ("tracing: Add a probe that attaches to trace events")
Fixes: 334e5519c375 ("tracing/probes: Add fprobe events for tracing function entry and exit.")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_eprobe.c | 12 ++++++++----
kernel/trace/trace_fprobe.c | 8 ++++----
kernel/trace/trace_kprobe.c | 8 ++++----
kernel/trace/trace_uprobe.c | 8 ++++++--
4 files changed, 22 insertions(+), 14 deletions(-)
--- a/kernel/trace/trace_eprobe.c
+++ b/kernel/trace/trace_eprobe.c
@@ -94,14 +94,18 @@ static int eprobe_dyn_event_show(struct
static int unregister_trace_eprobe(struct trace_eprobe *ep)
{
- /* If other probes are on the event, just unregister eprobe */
- if (trace_probe_has_sibling(&ep->tp))
- goto unreg;
-
/* Enabled event can not be unregistered */
if (trace_probe_is_enabled(&ep->tp))
return -EBUSY;
+ /* If there's a reference to the dynamic event */
+ if (trace_event_dyn_busy(trace_probe_event_call(&ep->tp)))
+ return -EBUSY;
+
+ /* If other probes are on the event, just unregister eprobe */
+ if (trace_probe_has_sibling(&ep->tp))
+ goto unreg;
+
/* Will fail if probe is being used by ftrace or perf */
if (trace_probe_unregister_event_call(&ep->tp))
return -EBUSY;
--- a/kernel/trace/trace_fprobe.c
+++ b/kernel/trace/trace_fprobe.c
@@ -853,10 +853,6 @@ static void __unregister_trace_fprobe(st
/* Unregister a trace_probe and probe_event */
static int unregister_trace_fprobe(struct trace_fprobe *tf)
{
- /* If other probes are on the event, just unregister fprobe */
- if (trace_probe_has_sibling(&tf->tp))
- goto unreg;
-
/* Enabled event can not be unregistered */
if (trace_probe_is_enabled(&tf->tp))
return -EBUSY;
@@ -865,6 +861,10 @@ static int unregister_trace_fprobe(struc
if (trace_event_dyn_busy(trace_probe_event_call(&tf->tp)))
return -EBUSY;
+ /* If other probes are on the event, just unregister fprobe */
+ if (trace_probe_has_sibling(&tf->tp))
+ goto unreg;
+
/* Will fail if probe is being used by ftrace or perf */
if (unregister_fprobe_event(tf))
return -EBUSY;
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -548,10 +548,6 @@ static void __unregister_trace_kprobe(st
/* Unregister a trace_probe and probe_event */
static int unregister_trace_kprobe(struct trace_kprobe *tk)
{
- /* If other probes are on the event, just unregister kprobe */
- if (trace_probe_has_sibling(&tk->tp))
- goto unreg;
-
/* Enabled event can not be unregistered */
if (trace_probe_is_enabled(&tk->tp))
return -EBUSY;
@@ -560,6 +556,10 @@ static int unregister_trace_kprobe(struc
if (trace_event_dyn_busy(trace_probe_event_call(&tk->tp)))
return -EBUSY;
+ /* If other probes are on the event, just unregister kprobe */
+ if (trace_probe_has_sibling(&tk->tp))
+ goto unreg;
+
/* Will fail if probe is being used by ftrace or perf */
if (unregister_kprobe_event(tk))
return -EBUSY;
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -396,13 +396,17 @@ static int unregister_trace_uprobe(struc
{
int ret;
- if (trace_probe_has_sibling(&tu->tp))
- goto unreg;
+ /* Enabled event can not be unregistered */
+ if (trace_probe_is_enabled(&tu->tp))
+ return -EBUSY;
/* If there's a reference to the dynamic event */
if (trace_event_dyn_busy(trace_probe_event_call(&tu->tp)))
return -EBUSY;
+ if (trace_probe_has_sibling(&tu->tp))
+ goto unreg;
+
ret = unregister_uprobe_event(tu);
if (ret)
return ret;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0786/1005] tracing/probes: Enable newly appended probe when target event is enabled
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (784 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0785/1005] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0787/1005] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
` (212 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 72d3a5cb0cd7335553549aaffecc683e3ecc0c43 upstream.
Unlike kprobe events, fprobe and uprobe events only register their
underlying probes when the trace event is enabled. When a new probe is
appended to an existing multiprobe fprobe or uprobe event that is
already enabled, the appended probe is linked into the event's probe
list without being registered.
As a result, the newly appended probe never fires until the event is
disabled and re-enabled. Moreover, disabling an fprobe event calls
unregister_fprobe() on the unregistered fprobe, and opening or closing a
perf event on an enabled uprobe event dereferences a NULL tu->uprobe in
uprobe_apply().
Register and enable the newly appended fprobe or uprobe immediately when
the target event is already enabled.
Link: https://lore.kernel.org/all/179455849798.403392.135678786198324285.stgit@devnote2/
Fixes: 41af3cf587f4 ("tracing/uprobe: Add multi-probe per uprobe event support")
Fixes: 2db832ec9090 ("tracing: fprobe-events: Register fprobe-events only when it is enabled")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_fprobe.c | 14 ++++-------
kernel/trace/trace_uprobe.c | 56 +++++++++++++++++++++++++++++---------------
2 files changed, 43 insertions(+), 27 deletions(-)
--- a/kernel/trace/trace_fprobe.c
+++ b/kernel/trace/trace_fprobe.c
@@ -933,7 +933,10 @@ static int append_trace_fprobe_event(str
if (ret)
return ret;
- ret = trace_fprobe_verify_target(tf);
+ if (trace_probe_is_enabled(&tf->tp))
+ ret = __register_trace_fprobe(tf);
+ else
+ ret = trace_fprobe_verify_target(tf);
if (ret)
trace_probe_unlink(&tf->tp);
else
@@ -1520,13 +1523,8 @@ static int disable_trace_fprobe(struct t
trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
if (!trace_probe_is_enabled(tp)) {
- list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list) {
- unregister_fprobe(&tf->fp);
- if (tf->tuser) {
- tracepoint_user_put(tf->tuser);
- tf->tuser = NULL;
- }
- }
+ list_for_each_entry(tf, trace_probe_probe_list(tp), tp.list)
+ __unregister_trace_fprobe(tf);
}
out:
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -447,6 +447,28 @@ static bool trace_uprobe_has_same_uprobe
return false;
}
+typedef bool (*filter_func_t)(struct uprobe_consumer *self, struct mm_struct *mm);
+
+#ifdef CONFIG_PERF_EVENTS
+static bool uprobe_perf_filter(struct uprobe_consumer *uc, struct mm_struct *mm);
+#else
+#define uprobe_perf_filter NULL
+#endif
+
+static int trace_uprobe_enable(struct trace_uprobe *tu, filter_func_t filter)
+{
+ struct inode *inode = d_real_inode(tu->path.dentry);
+ struct uprobe *uprobe;
+
+ tu->consumer.filter = filter;
+ uprobe = uprobe_register(inode, tu->offset, tu->ref_ctr_offset, &tu->consumer);
+ if (IS_ERR(uprobe))
+ return PTR_ERR(uprobe);
+
+ tu->uprobe = uprobe;
+ return 0;
+}
+
static int append_trace_uprobe(struct trace_uprobe *tu, struct trace_uprobe *to)
{
int ret;
@@ -466,10 +488,22 @@ static int append_trace_uprobe(struct tr
/* Append to existing event */
ret = trace_probe_append(&tu->tp, &to->tp);
- if (!ret)
- dyn_event_add(&tu->devent, trace_probe_event_call(&tu->tp));
+ if (ret)
+ return ret;
- return ret;
+ if (trace_probe_is_enabled(&tu->tp)) {
+ ret = trace_uprobe_enable(tu,
+ trace_probe_test_flag(&tu->tp, TP_FLAG_PROFILE) ?
+ uprobe_perf_filter : NULL);
+ if (ret) {
+ trace_probe_unlink(&tu->tp);
+ return ret;
+ }
+ }
+
+ dyn_event_add(&tu->devent, trace_probe_event_call(&tu->tp));
+
+ return 0;
}
/*
@@ -1104,22 +1138,6 @@ print_uprobe_event(struct trace_iterator
return trace_handle_return(s);
}
-typedef bool (*filter_func_t)(struct uprobe_consumer *self, struct mm_struct *mm);
-
-static int trace_uprobe_enable(struct trace_uprobe *tu, filter_func_t filter)
-{
- struct inode *inode = d_real_inode(tu->path.dentry);
- struct uprobe *uprobe;
-
- tu->consumer.filter = filter;
- uprobe = uprobe_register(inode, tu->offset, tu->ref_ctr_offset, &tu->consumer);
- if (IS_ERR(uprobe))
- return PTR_ERR(uprobe);
-
- tu->uprobe = uprobe;
- return 0;
-}
-
static void __probe_event_disable(struct trace_probe *tp)
{
struct trace_uprobe *tu;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0787/1005] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (785 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0786/1005] tracing/probes: Enable newly appended probe when target event is enabled Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0788/1005] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers Greg Kroah-Hartman
` (211 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 9b6e9d6a11090ac34516c45f48663b37ac94a9b1 upstream.
BTF bitfield parsing in trace_probe.c assumes a 64-bit (8-byte) container
when computing FETCH_OP_MOD_BF shift amounts and basesize, whereas the
preceding store instruction only allocates and writes the field's fetch
type size (which may be 1, 2, or 4 bytes when kflag=1). At runtime,
fetch_apply_bitfield() performs an 8-byte read-modify-write on the
smaller ring buffer slot, corrupting adjacent ring buffer data or writing
past the end of the event record.
In addition, signed bitfields with bit widths other than 8/16/32/64 fail
to resolve a fetch type, bitfields whose width is a multiple of 8 inside
a larger integer or spanning a byte boundary fail to emit FETCH_OP_MOD_BF
or select a container wide enough for bitoffs + bitsize, kflag=0 bitfield
offsets >= 8 bits are not folded into the byte offset, and big-endian
architectures use the little-endian left-shift formula in
parse_btf_bitfield().
Compute the bitfield byte and bit offsets consistently during field
lookup, select the smallest unsigned fetch type that covers the bit
offset and bit width, and calculate the FETCH_OP_MOD_BF parameters from
the selected fetch type size for both big- and little-endian bitfields.
Link: https://lore.kernel.org/all/179455850711.403392.10512730891220678403.stgit@devnote2/
Fixes: c440adfbe302 ("tracing/probes: Support BTF based data structure field access")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_probe.c | 59 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 45 insertions(+), 14 deletions(-)
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -486,6 +486,18 @@ static const char *fetch_type_from_btf_t
{
u32 intdata;
+ if (ctx->last_bitsize) {
+ u32 bits = ctx->last_bitsize + ctx->last_bitoffs;
+
+ if (bits <= 8)
+ return "u8";
+ if (bits <= 16)
+ return "u16";
+ if (bits <= 32)
+ return "u32";
+ return "u64";
+ }
+
/* TODO: const char * could be converted as a string */
switch (BTF_INFO_KIND(type->info)) {
case BTF_KIND_ENUM:
@@ -520,10 +532,6 @@ static const char *fetch_type_from_btf_t
case 64:
return "u64";
}
- /* bitfield, size is encoded in the type */
- ctx->last_bitsize = BTF_INT_BITS(intdata);
- ctx->last_bitoffs += BTF_INT_OFFSET(intdata);
- return "u64";
}
}
/* TODO: support other types */
@@ -653,6 +661,12 @@ static int get_bitoffset_of_field(char *
/* Add anonymous structure/union offset */
bitoffs += anon_offs;
+ type = btf_type_skip_modifiers(btf, field->type, NULL);
+ if (!type) {
+ trace_probe_log_err(ctx->offset, BAD_BTF_TID);
+ return -EINVAL;
+ }
+
/* Accumulate the bit-offsets of the dot-connected fields */
if (btf_type_kflag(mtype)) {
bitoffs += BTF_MEMBER_BIT_OFFSET(field->offset);
@@ -660,12 +674,15 @@ static int get_bitoffset_of_field(char *
} else {
bitoffs += field->offset;
ctx->last_bitsize = 0;
- }
+ if (BTF_INFO_KIND(type->info) == BTF_KIND_INT) {
+ u32 intdata = btf_type_int(type);
- type = btf_type_skip_modifiers(btf, field->type, NULL);
- if (!type) {
- trace_probe_log_err(ctx->offset, BAD_BTF_TID);
- return -EINVAL;
+ bitoffs += BTF_INT_OFFSET(intdata);
+ if ((bitoffs % 8) ||
+ BTF_INT_BITS(intdata) != BYTES_TO_BITS(type->size) ||
+ !is_power_of_2(type->size))
+ ctx->last_bitsize = BTF_INT_BITS(intdata);
+ }
}
if (next)
@@ -858,13 +875,22 @@ static const struct fetch_type *find_fet
}
static int parse_btf_bitfield(struct fetch_insn **pcode,
+ const struct fetch_type *t,
struct traceprobe_parse_context *ctx)
{
struct fetch_insn *code = *pcode;
- if ((ctx->last_bitsize % 8 == 0) && ctx->last_bitoffs == 0)
+ if ((ctx->last_bitsize == 0 ||
+ ctx->last_bitsize == BYTES_TO_BITS(t->size)) &&
+ ctx->last_bitoffs == 0)
return 0;
+ if (ctx->last_bitsize == 0 ||
+ BYTES_TO_BITS(t->size) < (ctx->last_bitsize + ctx->last_bitoffs)) {
+ trace_probe_log_err(ctx->offset, BAD_BITFIELD);
+ return -EINVAL;
+ }
+
code++;
if (code->op != FETCH_OP_NOP) {
trace_probe_log_err(ctx->offset, TOO_MANY_OPS);
@@ -873,9 +899,13 @@ static int parse_btf_bitfield(struct fet
*pcode = code;
code->op = FETCH_OP_MOD_BF;
- code->lshift = 64 - (ctx->last_bitsize + ctx->last_bitoffs);
- code->rshift = 64 - ctx->last_bitsize;
- code->basesize = 64 / 8;
+#ifdef __BIG_ENDIAN_BITFIELD
+ code->lshift = ctx->last_bitoffs;
+#else
+ code->lshift = BYTES_TO_BITS(t->size) - (ctx->last_bitsize + ctx->last_bitoffs);
+#endif
+ code->rshift = BYTES_TO_BITS(t->size) - ctx->last_bitsize;
+ code->basesize = t->size;
return 0;
}
@@ -1085,6 +1115,7 @@ static int parse_btf_arg(char *varname,
}
static int parse_btf_bitfield(struct fetch_insn **pcode,
+ const struct fetch_type *t,
struct traceprobe_parse_context *ctx)
{
trace_probe_log_err(ctx->offset, NOSUP_BTFARG);
@@ -1995,7 +2026,7 @@ static int finalize_fetch_insn(struct fe
} else if (IS_ENABLED(CONFIG_PROBE_EVENTS_BTF_ARGS) &&
ctx->last_type) {
/* If user not specified the type, try parsing BTF bitfield. */
- ret = parse_btf_bitfield(&code, ctx);
+ ret = parse_btf_bitfield(&code, parg->type, ctx);
if (ret)
return ret;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0788/1005] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (786 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0787/1005] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0789/1005] tracing/probes: Fix user-space dereference string array store type Greg Kroah-Hartman
` (210 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit c1e2c63e65421068566db3dde44dfd4fe7adb46d upstream.
In struct btf_type, the type ID and byte size share a union, and only
BTF_KIND_INT types are followed by a 32-bit integer encoding word.
Because btf_type_is_char_ptr() and btf_type_is_char_array() do not
verify that the outer type is BTF_KIND_PTR or that the resolved element
type is a non-NULL BTF_KIND_INT before inspecting it, non-pointer BTF
types can have their byte size misinterpreted as a BTF type ID, and
arrays of non-integer types read out-of-bounds or misinterpret trailing
BTF metadata as BTF_INT_* encoding bits.
Validate the BTF type kinds and NULL pointers before reading inner type
metadata in both helpers.
Link: https://lore.kernel.org/all/179455851632.403392.258264246782960594.stgit@devnote2/
Fixes: 27973e5c64b9 ("tracing/probes: Add string type check with BTF")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_probe.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -411,6 +411,9 @@ static bool btf_type_is_char_ptr(struct
const struct btf_type *real_type;
u32 intdata;
+ if (BTF_INFO_KIND(type->info) != BTF_KIND_PTR)
+ return false;
+
real_type = btf_type_skip_modifiers(btf, type->type, NULL);
if (!real_type)
return false;
@@ -435,6 +438,11 @@ static bool btf_type_is_char_array(struc
array = (const struct btf_array *)(type + 1);
real_type = btf_type_skip_modifiers(btf, array->type, NULL);
+ if (!real_type)
+ return false;
+
+ if (BTF_INFO_KIND(real_type->info) != BTF_KIND_INT)
+ return false;
intdata = btf_type_int(real_type);
return !(BTF_INT_ENCODING(intdata) & BTF_INT_SIGNED)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0789/1005] tracing/probes: Fix user-space dereference string array store type
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (787 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0788/1005] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0790/1005] tracing/probes: Reject array count on non-dereference string sources Greg Kroah-Hartman
` (209 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 2721573e6c6faaba2e31f352f2c02ec5f3ecf5e9 upstream.
When finalizing a string array argument (e.g. +0u(%reg):string[N]),
finalize_fetch_insn() advances the instruction pointer to a new slot
for the store operation before checking whether the preceding operation
was FETCH_OP_UDEREF. As a result, user-space dereference string arrays
with type "string" emit FETCH_OP_ST_STRING (kernel memory read) instead
of FETCH_OP_ST_USTRING.
Check for FETCH_OP_UDEREF before advancing the instruction pointer.
Link: https://lore.kernel.org/all/179455854396.403392.18073771811100192405.stgit@devnote2/
Fixes: e65f7ae7f4da ("tracing/probe: Support user-space dereference")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_probe.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1956,6 +1956,8 @@ static int finalize_fetch_insn(struct fe
/* Store operation */
if (parg->type->is_string) {
+ bool is_uderef;
+
/* Check bad combination of the type and the last fetch_insn. */
if (!strcmp(parg->type->name, "symstr")) {
if (code->op != FETCH_OP_REG && code->op != FETCH_OP_STACK &&
@@ -1975,6 +1977,7 @@ static int finalize_fetch_insn(struct fe
}
}
+ is_uderef = (code->op == FETCH_OP_UDEREF);
if (!strcmp(parg->type->name, "symstr") ||
(code->op == FETCH_OP_IMM || code->op == FETCH_OP_COMM ||
code->op == FETCH_OP_IMMSTR) || code->op == FETCH_OP_TP_ARG ||
@@ -1995,8 +1998,7 @@ static int finalize_fetch_insn(struct fe
}
/* If op == DEREF, replace it with STRING */
- if (!strcmp(parg->type->name, "ustring") ||
- code->op == FETCH_OP_UDEREF)
+ if (!strcmp(parg->type->name, "ustring") || is_uderef)
code->op = FETCH_OP_ST_USTRING;
else if (!strcmp(parg->type->name, "symstr"))
code->op = FETCH_OP_ST_SYMSTR;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0790/1005] tracing/probes: Reject array count on non-dereference string sources
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (788 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0789/1005] tracing/probes: Fix user-space dereference string array store type Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0791/1005] wifi: ath12k: assign device id from the WSI index Greg Kroah-Hartman
` (208 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
commit 0941144ebeaf3ce46c80711f00e935921eb28b21 upstream.
The runtime array loop (FETCH_OP_LP_ARRAY) for string types requires a
preceding memory dereference instruction so it can advance the pointer
address on each iteration. Non-dereference string sources such as $comm,
immediate strings, and eprobe event fields cannot be indexed as pointer
arrays, but finalize_fetch_insn() still accepts an array count on them
and emits an invalid FETCH_OP_LP_ARRAY sequence.
Reject string array counts when the preceding operation is not a memory
dereference.
Link: https://lore.kernel.org/all/179455855309.403392.4197028577158545202.stgit@devnote2/
Fixes: 40b53b771806 ("tracing: probeevent: Add array type support")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_probe.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1990,6 +1990,12 @@ static int finalize_fetch_insn(struct fe
* For the symstr, it doesn't need to dereference, thus
* it just get the value.
*/
+ if (parg->count && (code->op != FETCH_OP_DEREF &&
+ code->op != FETCH_OP_UDEREF)) {
+ trace_probe_log_err(ctx->offset + type_offset,
+ BAD_STRING);
+ return -EINVAL;
+ }
code++;
if (code->op != FETCH_OP_NOP) {
trace_probe_log_err(ctx->offset, TOO_MANY_OPS);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0791/1005] wifi: ath12k: assign device id from the WSI index
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (789 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0790/1005] tracing/probes: Reject array count on non-dereference string sources Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0792/1005] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
` (207 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rameshkumar Sundaram, Benoit Masson,
Jeff Johnson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benoit Masson <yahoo@perenite.com>
commit 81986a81f09fae73926c7c44863b335880269c90 upstream.
Devices of a hardware group are added to ag->ab[] in PCI probe
completion order (ab->device_id = ag->num_probed++), which is not
stable across boots. The wiphy radio array is built from ag->ab[] and
the wiphy device is taken from its first entry, so the wiphy sysfs
path and the mapping of radio indices to bands change on every boot.
Persisted wireless configurations reference radios by index (e.g.
OpenWrt/hostapd "radio0"), so such a configuration attaches to a
random band at each boot. This affects any multi-chip group with
single-band radios, e.g. TP-Link Archer BE800 (three QCN9274/QCN9224
radios in one group).
Store each ab in ag->ab[] at its wsi_info.index, which is derived from
the device tree WSI ring and is therefore deterministic.
ag->num_probed remains the group device counter. The unassign path is
unchanged, it already indexes ag->ab[] by ab->device_id.
Suggested-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Fixes: 6f245ea0ec6c ("wifi: ath12k: introduce device group abstraction")
Cc: stable@vger.kernel.org # 6.14+
Signed-off-by: Benoit Masson <yahoo@perenite.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260928213322.98949-1-yahoo@perenite.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/ath/ath12k/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -2007,7 +2007,8 @@ exit:
goto invalid_group;
}
- ab->device_id = ag->num_probed++;
+ ag->num_probed++;
+ ab->device_id = wsi->index;
ag->ab[ab->device_id] = ab;
ab->ag = ag;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0792/1005] wifi: ath9k_htc: do not start ANI before the first channel is set
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (790 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0791/1005] wifi: ath12k: assign device id from the WSI index Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0793/1005] wifi: mac80211_hwsim: ignore non-generic netlink releases Greg Kroah-Hartman
` (206 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mehmet Fide,
Toke Høiland-Jørgensen, Jeff Johnson
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
commit dda63dd136ba2bc3b297079b190ac81a0aea40ae upstream.
ath9k_htc_add_interface() starts ANI for the first AP interface, before
any channel is configured. The per-channel calibration data only gets
attached by the first ath9k_htc_set_channel() that is not a fast
channel change, and that same call cancels the ANI work a few
milliseconds after add_interface, so normally the work never runs.
When the bring-up stalls for more than the 100 ms ANI poll interval in
between, it does run, and ar9002_hw_per_calibration() records the IQ
calibration result in the calibration data that does not exist yet:
Unable to handle kernel NULL pointer dereference at virtual address
00000008
PC is at ar9002_hw_calibrate+0x1f8/0x570 [ath9k_hw]
Workqueue: phy0 ath9k_htc_ani_work [ath9k_htc]
Seen about once per thousand AP starts with an AR9271 on a Cortex-A5
board that starts hostapd while still booting; a 500 ms delay after
add_interface reproduces it on every start. The crashed work never
completes, so the next cancel_delayed_work_sync() blocks for good.
Drop the start; it has nothing to calibrate against and is cancelled
anyway. The TSF adjust bit that shared its condition is now set for
every AP interface, which is harmless: the next reset applies it. The
next patch starts ANI once the interface beacons.
Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode")
Cc: stable@vger.kernel.org
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-2-mehmet.fide@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1098,11 +1098,8 @@ static int ath9k_htc_add_interface(struc
ath9k_htc_set_opmode(priv);
- if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
- !test_bit(ATH_OP_ANI_RUN, &common->op_flags)) {
+ if (priv->ah->opmode == NL80211_IFTYPE_AP)
ath9k_hw_set_tsfadjust(priv->ah, true);
- ath9k_htc_start_ani(priv);
- }
ath_dbg(common, CONFIG, "Attach a VIF of type: %d at idx: %d\n",
vif->type, avp->index);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0793/1005] wifi: mac80211_hwsim: ignore non-generic netlink releases
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (791 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0792/1005] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0794/1005] wifi: nxpwifi: validate scan response TLV sizes before indexed access Greg Kroah-Hartman
` (205 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 989f47c56e48d442d79497a25ed946d029c4dc53 upstream.
Closing an unrelated netlink socket can remove mac80211_hwsim radios or
clear the active wmediumd registration when its port ID matches a generic
netlink socket.
mac80211_hwsim_netlink_notify() handles every NETLINK_URELEASE event,
but netlink port IDs are scoped by protocol. The notifier therefore treats
a release from another protocol as a MAC80211_HWSIM socket release.
Ignore release notifications unless they come from NETLINK_GENERIC.
LLM assistance was used to find the bug and review.
Fixes: 7882513bacb1 ("mac80211_hwsim driver support userspace frame tx/rx")
Fixes: e9ed49bf4c2c ("mac80211-hwsim: Add support for HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028141751.6728-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/virtual/mac80211_hwsim_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
@@ -7197,7 +7197,7 @@ static int mac80211_hwsim_netlink_notify
{
struct netlink_notify *notify = _notify;
- if (state != NETLINK_URELEASE)
+ if (state != NETLINK_URELEASE || notify->protocol != NETLINK_GENERIC)
return NOTIFY_DONE;
remove_user_radios(notify->portid, hwsim_net_get_netgroup(notify->net));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0794/1005] wifi: nxpwifi: validate scan response TLV sizes before indexed access
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (792 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0793/1005] wifi: mac80211_hwsim: ignore non-generic netlink releases Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0795/1005] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
` (204 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tristan Madani, Jeff Chen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tristan Madani <tristmd@gmail.com>
commit bcc5bbaa6de61a0ccaa57228ca233b4390eca27e upstream.
The scan response handler indexes into TSF and channel-band TLV arrays
using a loop counter derived from the number of BSS entries, but never
checks whether the TLV data is large enough. A firmware response with
fewer TLV entries than BSS entries leads to reads past the TLV buffer.
Add bounds checks that verify each indexed access falls within the
TLV's declared length before dereferencing.
Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Cc: stable@vger.kernel.org
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/nxp/nxpwifi/scan.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/nxp/nxpwifi/scan.c
+++ b/drivers/net/wireless/nxp/nxpwifi/scan.c
@@ -2017,12 +2017,22 @@ int nxpwifi_ret_802_11_scan(struct nxpwi
* was received.
*/
if (tsf_tlv)
- memcpy(&fw_tsf, &tsf_tlv->tsf_data[idx * TSF_DATA_SIZE],
- sizeof(fw_tsf));
+ if ((idx + 1) * TSF_DATA_SIZE <=
+ le16_to_cpu(tsf_tlv->header.len))
+ memcpy(&fw_tsf,
+ &tsf_tlv->tsf_data[idx *
+ TSF_DATA_SIZE],
+ sizeof(fw_tsf));
if (chan_band_tlv) {
- chan_band = &chan_band_tlv->chan_band_param[idx];
- radio_type = &chan_band->radio_type;
+ if ((idx + 1) * sizeof(*chan_band) <=
+ le16_to_cpu(chan_band_tlv->header.len)) {
+ chan_band =
+ &chan_band_tlv->chan_band_param[idx];
+ radio_type = &chan_band->radio_type;
+ } else {
+ radio_type = NULL;
+ }
} else {
radio_type = NULL;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0795/1005] wifi: cfg80211: release rejected nontransmitted BSS reference
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (793 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0794/1005] wifi: nxpwifi: validate scan response TLV sizes before indexed access Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0796/1005] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
` (203 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit f3c45d5b741a7d7586e639c2f55d2557029f2e1a upstream.
Repeated MBSSID reports without an SSID can leak BSS entries outside the
scan cache, where the BSS entry limit cannot account for them.
__cfg80211_bss_update() returns a referenced BSS. If adding it to the
transmitting BSS list fails, unlinking drops the cache reference, but the
caller reference is lost when res is cleared.
Release the caller reference before discarding the unlinked BSS.
LLM assistance was used to find the bug and review.
Fixes: 0b7808818cb9 ("wifi: cfg80211: fix BSS refcounting bugs")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028141731.6185-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/scan.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2452,6 +2452,7 @@ cfg80211_inform_single_bss_data(struct w
if (cfg80211_add_nontrans_list(data->source_bss, &res->pub)) {
if (__cfg80211_unlink_bss(rdev, res)) {
rdev->bss_generation++;
+ bss_ref_put(rdev, res);
res = NULL;
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0796/1005] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (794 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0795/1005] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0797/1005] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
` (202 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 9083da9dd3223068237395432323b407012aec1f upstream.
A malformed mesh A-MSDU subframe with a declared payload length near
65535 bytes can pass validation against a much shorter aggregate.
ieee80211_amsdu_subframe_length() adds the mesh control length to the
declared length in a u16, and ieee80211_is_valid_amsdu() stores the
result in a u16 local. The sum therefore wraps before either walker
compares it with the remaining aggregate length. The decomposer then
splits and delivers the malformed aggregate instead of rejecting it.
Keep the computed length in unsigned int in both the helper and the
validator so oversized subframes cannot wrap.
LLM assistance was used to find the bug and review.
Fixes: 6e4c0d0460bd ("wifi: mac80211: add a workaround for receiving non-standard mesh A-MSDU")
Fixes: fe4a6d2db3ba ("wifi: mac80211: implement support for yet another mesh A-MSDU format")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142149.13834-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/util.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -822,12 +822,12 @@ __ieee80211_amsdu_copy(struct sk_buff *s
return frame;
}
-static u16
+static unsigned int
ieee80211_amsdu_subframe_length(void *field, u8 mesh_flags, u8 hdr_type)
{
__le16 *field_le = field;
__be16 *field_be = field;
- u16 len;
+ unsigned int len;
if (hdr_type >= 2)
len = le16_to_cpu(*field_le);
@@ -849,7 +849,7 @@ bool ieee80211_is_valid_amsdu(struct sk_
__be16 len;
u8 mesh_flags;
} hdr;
- u16 len;
+ unsigned int len;
if (sizeof(hdr) > remaining)
return false;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0797/1005] wifi: cfg80211: dont truncate the merged MBSSID profile length
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (795 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0796/1005] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0798/1005] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
` (201 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wahid Khan, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wahid Khan <wahidzk0091@gmail.com>
commit 3ea152f3f77eeffc37b2f4423688b4df9136f90c upstream.
cfg80211_parse_mbssid_data() keeps the length of a non-transmitted BSSID
profile in a u8. cfg80211_merge_profile() returns a size_t, and it
concatenates a profile that is split over several Multiple BSSID
elements, so the merged length can be well above 255 even though every
single sub-element is at most 255 bytes long.
The value is then cut to its low 8 bits. A 300 byte profile is handled
as a 44 byte one: the elements after the cut are lost from the generated
non-transmitted BSS, and if the Multiple BSSID-Index element lies past
the cut the BSS is dropped altogether. Any AP in range can send such a
profile.
The multi-link code further down in the same file already uses a signed
size type for the profile length. Do the same here, cfg80211_find_ie()
and cfg80211_gen_new_ie() take a size_t anyway.
Fixes: fe806e4992c9 ("cfg80211: support profile split between elements")
Cc: stable@vger.kernel.org
Signed-off-by: Wahid Khan <wahidzk0091@gmail.com>
Link: https://patch.msgid.link/20261104211451.693451-1-wahidzk0091@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2592,7 +2592,7 @@ cfg80211_parse_mbssid_data(struct wiphy
if (elem->data[0] < 1 || (int)elem->data[0] > 8)
continue;
for_each_element(sub, elem->data + 1, elem->datalen - 1) {
- u8 profile_len;
+ size_t profile_len;
if (sub->id != 0 || sub->datalen < 4) {
/* not a valid BSS profile */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0798/1005] wifi: mac80211: fix use-after-free when MLO link setup is rolled back
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (796 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0797/1005] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0799/1005] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
` (200 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit a155ef2ef79531c139244289c5b8f15c05d16a0e upstream.
Rolling back an MLO link addition can free link containers while RCU
readers still hold pointers to them. ieee80211_vif_update_links()
publishes new links before checking for duplicate addresses and calling
drv_change_vif_links(). If either fails, it restores the old pointers
and frees the new containers without waiting for readers.
During a non-MLO to MLO transition, the published link 0 replaces the
deflink, so existing link 0 users can acquire the new container. Readers
such as ieee80211_csa_finish() and
ieee80211_obss_color_collision_notify() can also queue work embedded in
the link. If they queue after ieee80211_link_stop() cancels that work,
it remains queued when the container is freed.
Wait for RCU readers after restoring the old pointers and before
stopping the new links, so their work is queued before it is cancelled.
Fixes: d3e2439b0f33 ("wifi: mac80211: fix link manipulation")
Cc: stable@vger.kernel.org # 7.2.x
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261026152654.80697-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/link.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -400,6 +400,8 @@ static int ieee80211_vif_update_links(st
memcpy(sdata->link, old_data, sizeof(old_data));
memcpy(sdata->vif.link_conf, old, sizeof(old));
ieee80211_set_vif_links_bitmaps(sdata, old_links, dormant_links);
+ /* drain RCU readers before cancelling work they may queue */
+ synchronize_rcu();
for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
ieee80211_link_debugfs_remove(&links[link_id]->data);
ieee80211_link_stop(&links[link_id]->data);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0799/1005] wifi: mac80211: drain link readers before stopping removed links
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (797 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0798/1005] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0800/1005] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
` (199 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 745f5d04395dfc4c311f443c7c04ccb00c436984 upstream.
Removing an MLO link can leave work queued on its link container after
the container is freed.
ieee80211_tear_down_links() stops each link before the RCU grace period.
A reader that fetched the link earlier can therefore queue work after
ieee80211_link_stop() has canceled it. ieee80211_request_smps() and
ieee80211_csa_finish() can both reach this window.
Record each removed link while removing its keys and debugfs state. Wait
for RCU readers, then stop the recorded links so cancellation includes
work queued by those readers. Free the detached keys after the grace
period as before.
LLM assistance was used to find the bug and review.
Fixes: efe9c2bfd1a8 ("wifi: mac80211: isolate driver from inactive links")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028141708.5532-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/link.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -191,6 +191,7 @@ struct link_container {
static void ieee80211_tear_down_links(struct ieee80211_sub_if_data *sdata,
struct link_container **links, u16 mask)
{
+ struct ieee80211_link_data *stop[IEEE80211_MLD_MAX_NUM_LINKS] = {};
struct ieee80211_link_data *link;
LIST_HEAD(keys);
unsigned int link_id;
@@ -205,11 +206,16 @@ static void ieee80211_tear_down_links(st
continue;
ieee80211_remove_link_keys(link, &keys);
ieee80211_link_debugfs_remove(link);
- ieee80211_link_stop(link);
+ stop[link_id] = link;
}
+ /* drain RCU readers before cancelling work they may queue */
synchronize_rcu();
+ for (link_id = 0; link_id < IEEE80211_MLD_MAX_NUM_LINKS; link_id++)
+ if (stop[link_id])
+ ieee80211_link_stop(stop[link_id]);
+
ieee80211_free_key_list(sdata->local, &keys);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0800/1005] wifi: mac80211: recheck injected headers after removing FCS
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (798 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0799/1005] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0801/1005] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
` (198 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 339564c7ac50464695dfed847f89d118f4cc1dc5 upstream.
Injecting a short frame with IEEE80211_RADIOTAP_F_FCS on a monitor
interface can pass a truncated 802.11 header to transmit handlers.
ieee80211_monitor_start_xmit() validates the linear 802.11 header before
parsing radiotap. Radiotap parsing then removes the four-byte FCS without
rechecking the remaining header length. Software encryption can subtract
the larger header length and pass the resulting negative length as an
unsigned size.
Recheck the required linear header length after pulling the radiotap
header and before handing the frame to the transmit path. Require at
least addr1, which the transmit path reads even for extension frames
whose header is shorter.
LLM assistance was used to find the bug and review.
Fixes: bddc0c411a45 ("mac80211: Fix NULL ptr deref for injected rate info")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142101.11994-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/tx.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2586,6 +2586,12 @@ netdev_tx_t ieee80211_monitor_start_xmit
/* remove the injection radiotap header */
skb_pull(skb, len_rthdr);
+ /* FCS removal may have shortened the 802.11 header. */
+ hdrlen = max_t(int, hdrlen,
+ offsetofend(struct ieee80211_hdr, addr1));
+ if (skb_headlen(skb) < hdrlen)
+ goto fail_rcu;
+
ieee80211_xmit(sdata, NULL, skb);
rcu_read_unlock();
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0801/1005] wifi: mac80211: recheck the IBSS station limit before insertion
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (799 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0800/1005] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0802/1005] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
` (197 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit f7670bcdf650b37551a9c5d084521f877d939f11 upstream.
Frames from successive unknown IBSS peers can make the deferred worker
install more than 128 stations.
The receive path checks local->num_sta before allocating each station,
but pending stations are not included in that count. Several allocations
can therefore pass before the worker inserts any of them, and the worker
then drains the list without rechecking the limit.
Recheck the installed-station limit in the worker under the wiphy mutex
and free entries that no longer fit.
LLM assistance was used to find the bug and review.
Fixes: 8bf11d8d0811 ("mac80211: delay IBSS station insertion")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142235.15428-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ibss.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1630,8 +1630,12 @@ void ieee80211_ibss_work(struct ieee8021
list_del(&sta->list);
spin_unlock_bh(&ifibss->incomplete_lock);
- ieee80211_ibss_finish_sta(sta);
- rcu_read_unlock();
+ if (sdata->local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
+ sta_info_free(sdata->local, sta);
+ } else {
+ ieee80211_ibss_finish_sta(sta);
+ rcu_read_unlock();
+ }
spin_lock_bh(&ifibss->incomplete_lock);
}
spin_unlock_bh(&ifibss->incomplete_lock);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0802/1005] wifi: mac80211: recheck the OCB station limit before insertion
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (800 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0801/1005] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0803/1005] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates Greg Kroah-Hartman
` (196 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 27e29a077b4887d0e0a813337f8b7e06bd020c81 upstream.
Frames from successive unknown OCB peers can make the deferred worker
install more than 128 stations.
The receive path checks local->num_sta before allocating each station,
but pending stations are not included in that count. Several allocations
can therefore pass before the worker inserts any of them, and the worker
then drains the list without rechecking the limit.
Recheck the installed-station limit in the worker under the wiphy mutex
and free entries that no longer fit.
LLM assistance was used to find the bug and review.
Fixes: 239281f803e2 ("mac80211: 802.11p OCB mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142302.16634-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ocb.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/net/mac80211/ocb.c
+++ b/net/mac80211/ocb.c
@@ -139,8 +139,12 @@ void ieee80211_ocb_work(struct ieee80211
list_del(&sta->list);
spin_unlock_bh(&ifocb->incomplete_lock);
- ieee80211_ocb_finish_sta(sta);
- rcu_read_unlock();
+ if (sdata->local->num_sta >= IEEE80211_OCB_MAX_STA_ENTRIES) {
+ sta_info_free(sdata->local, sta);
+ } else {
+ ieee80211_ocb_finish_sta(sta);
+ rcu_read_unlock();
+ }
spin_lock_bh(&ifocb->incomplete_lock);
}
spin_unlock_bh(&ifocb->incomplete_lock);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0803/1005] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (801 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0802/1005] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0804/1005] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
` (195 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 582edbdbc5d288bd128b54935738fe38f15c8c29 upstream.
An invalid EHT guard interval can select the wrong airtime group and, at
320 MHz, read beyond airtime_mcs_groups.
Guard interval 3 advances EHT_GROUP_IDX() into the next bandwidth group
at narrower widths. With one spatial stream and 320 MHz, it evaluates to
264, one past the 264-entry table. RX rate parsing rejects the value, but
the common TX-status validator has no EHT check and last_rate_info can
carry it to the airtime helper.
Reject values above NL80211_RATE_INFO_EHT_GI_3_2 in the helper. This also
protects exported ieee80211_calc_rx_airtime() callers that do not pass
through the TX-status validator.
LLM assistance was used to find the bug and review.
Fixes: 3702a33216e6 ("wifi: mac80211: introduce EHT rate support in AQL airtime")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142212.14523-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/airtime.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/mac80211/airtime.c
+++ b/net/mac80211/airtime.c
@@ -550,6 +550,8 @@ static u32 ieee80211_get_rate_duration(s
group = HE_GROUP_IDX(streams, status->he_gi, bw);
break;
case RX_ENC_EHT:
+ if (status->eht.gi > NL80211_RATE_INFO_EHT_GI_3_2)
+ return 0;
streams = status->nss;
idx = status->rate_idx;
group = EHT_GROUP_IDX(streams, status->eht.gi, bw);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0804/1005] wifi: mac80211: restore dormant links when link updates fail
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (802 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0803/1005] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0805/1005] wifi: mac80211: fix use-after-free on TTLM disconnect Greg Kroah-Hartman
` (194 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit bb22f3b2d8f8a2f883944f24678cf84e18b162e8 upstream.
A failed MLO link update can leave the interface with the requested
dormant-links bitmap instead of its previous one. This can disable active
links or trigger a bitmap warning during rollback.
The error path restores the old valid-links bitmap but passes the new
dormant_links argument to ieee80211_set_vif_links_bitmaps().
Save the old dormant bitmap before changing link state and use it when
restoring the old configuration.
LLM assistance was used to find the bug and review.
Fixes: 6d543b34dbcf ("wifi: mac80211: Support disabled links during association")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142123.13072-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/link.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -296,6 +296,7 @@ static int ieee80211_vif_update_links(st
{
u16 old_links = sdata->vif.valid_links;
u16 old_active = sdata->vif.active_links;
+ u16 old_dormant = sdata->vif.dormant_links;
unsigned long add = new_links & ~old_links;
unsigned long rem = old_links & ~new_links;
unsigned long sta_rem = rem;
@@ -405,7 +406,7 @@ static int ieee80211_vif_update_links(st
/* restore config */
memcpy(sdata->link, old_data, sizeof(old_data));
memcpy(sdata->vif.link_conf, old, sizeof(old));
- ieee80211_set_vif_links_bitmaps(sdata, old_links, dormant_links);
+ ieee80211_set_vif_links_bitmaps(sdata, old_links, old_dormant);
/* drain RCU readers before cancelling work they may queue */
synchronize_rcu();
for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0805/1005] wifi: mac80211: fix use-after-free on TTLM disconnect
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (803 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0804/1005] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0806/1005] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
` (193 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Benjamin Berg, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit 4af2b71495a3f12196cbea1c9a502c62ada867be upstream.
If ieee80211_process_adv_ttlm() disconnects, and some other
changes were also detected in the beacon, the link update
to the driver is still done, leading to use-after-free. Fix
this by returning, like other functions, whether or not the
update was accepted by the function.
Cc: stable@vger.kernel.org
Fixes: 702e80470a33 ("wifi: mac80211: support handling of advertised TID-to-link mapping")
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20261102220313.3cf5e709417b.I339967c7e614057253aa68c005d9ae220577f99a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/mlme.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -7849,15 +7849,15 @@ static void ieee80211_tid_to_link_map_wo
sdata->u.mgd.ttlm_info.switch_time = 0;
}
-static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
- struct ieee802_11_elems *elems,
- u64 beacon_ts)
+static bool ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
+ struct ieee802_11_elems *elems,
+ u64 beacon_ts)
{
u8 i;
int ret;
if (!ieee80211_vif_is_mld(&sdata->vif))
- return;
+ return true;
if (!elems->ttlm_num) {
if (sdata->u.mgd.ttlm_info.switch_time) {
@@ -7875,14 +7875,14 @@ static void ieee80211_process_adv_ttlm(s
0);
if (ret) {
sdata_info(sdata, "Failed setting valid/dormant links\n");
- return;
+ return true;
}
ieee80211_vif_cfg_change_notify(sdata,
BSS_CHANGED_MLD_VALID_LINKS);
}
memset(&sdata->u.mgd.ttlm_info, 0,
sizeof(sdata->u.mgd.ttlm_info));
- return;
+ return true;
}
for (i = 0; i < elems->ttlm_num; i++) {
@@ -7894,7 +7894,7 @@ static void ieee80211_process_adv_ttlm(s
if (res) {
__ieee80211_disconnect(sdata);
- return;
+ return false;
}
if (ttlm_info.switch_time) {
@@ -7919,7 +7919,7 @@ static void ieee80211_process_adv_ttlm(s
* switch the AP will continue to announce it anyway.
*/
if (delay > IEEE80211_ADV_TTLM_ST_UNDERFLOW)
- return;
+ return true;
delay_usec = ieee80211_tu_to_usec(delay);
@@ -7938,9 +7938,11 @@ static void ieee80211_process_adv_ttlm(s
wiphy_hrtimer_work_queue(sdata->local->hw.wiphy,
&sdata->u.mgd.ttlm_work,
us_to_ktime(delay_usec));
- return;
+ return true;
}
}
+
+ return true;
}
static void
@@ -8463,8 +8465,9 @@ static void ieee80211_rx_mgmt_beacon(str
elems->cisco_dtpc_elem);
ieee80211_ml_reconfiguration(sdata, elems);
- ieee80211_process_adv_ttlm(sdata, elems,
- le64_to_cpu(mgmt->u.beacon.timestamp));
+ if (!ieee80211_process_adv_ttlm(sdata, elems,
+ le64_to_cpu(mgmt->u.beacon.timestamp)))
+ goto free;
apply:
ieee80211_link_info_change_notify(sdata, link, changed);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0806/1005] wifi: mac80211: bound pending IBSS station allocations
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (804 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0805/1005] wifi: mac80211: fix use-after-free on TTLM disconnect Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0807/1005] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
` (192 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit 3029ca2112d7bee4d3e3eadd02decdb3eddb9485 upstream.
Delaying the IBSS station worker while frames arrive from new peers can
retain an unbounded number of station allocations.
The receive-side limit counts installed stations, while new allocations
wait on incomplete_stations until process context inserts them. The list
lock does not cover the interval between allocation and list insertion.
Reserve one of 128 pending slots per interface before allocation. Release
the reservation on allocation failure, after the worker inserts or frees
the station, and when disconnect frees the pending list.
LLM assistance was used to find the bug and review.
Fixes: 8bf11d8d0811 ("mac80211: delay IBSS station insertion")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142235.15428-3-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ibss.c | 13 ++++++++++++-
net/mac80211/ieee80211_i.h | 1 +
2 files changed, 13 insertions(+), 1 deletion(-)
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -684,6 +684,7 @@ static void ieee80211_ibss_disconnect(st
spin_unlock_bh(&ifibss->incomplete_lock);
sta_info_free(local, sta);
+ atomic_dec(&ifibss->incomplete_sta_count);
spin_lock_bh(&ifibss->incomplete_lock);
}
spin_unlock_bh(&ifibss->incomplete_lock);
@@ -1177,9 +1178,18 @@ void ieee80211_ibss_rx_no_sta(struct iee
band = chanctx_conf->def.chan->band;
rcu_read_unlock();
+ if (!atomic_add_unless(&ifibss->incomplete_sta_count, 1,
+ IEEE80211_IBSS_MAX_STA_ENTRIES)) {
+ net_info_ratelimited("%s: No room for a new IBSS STA entry %pM\n",
+ sdata->name, addr);
+ return;
+ }
+
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
- if (!sta)
+ if (!sta) {
+ atomic_dec(&ifibss->incomplete_sta_count);
return;
+ }
/* make sure mandatory rates are always added */
sband = local->hw.wiphy->bands[band];
@@ -1636,6 +1646,7 @@ void ieee80211_ibss_work(struct ieee8021
ieee80211_ibss_finish_sta(sta);
rcu_read_unlock();
}
+ atomic_dec(&ifibss->incomplete_sta_count);
spin_lock_bh(&ifibss->incomplete_lock);
}
spin_unlock_bh(&ifibss->incomplete_lock);
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -682,6 +682,7 @@ struct ieee80211_if_ibss {
spinlock_t incomplete_lock;
struct list_head incomplete_stations;
+ atomic_t incomplete_sta_count;
enum {
IEEE80211_IBSS_MLME_SEARCH,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0807/1005] wifi: mac80211: bound pending OCB station allocations
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (805 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0806/1005] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0808/1005] ksmbd: evaluate the DACL in order for explicit access requests Greg Kroah-Hartman
` (191 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
commit ee1a5e92dba0a98cabe476c780e3af4f0ab88b27 upstream.
Delaying the OCB station worker while frames arrive from new peers can
retain an unbounded number of station allocations.
The receive-side limit counts installed stations, while new allocations
wait on incomplete_stations until process context inserts them. The list
lock does not cover the interval between allocation and list insertion.
Reserve one of 128 pending slots per interface before allocation. Release
the reservation on allocation failure, after the worker inserts or frees
the station, and when leave frees the pending list.
LLM assistance was used to find the bug and review.
Fixes: 239281f803e2 ("mac80211: 802.11p OCB mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028142302.16634-3-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/ieee80211_i.h | 2 ++
net/mac80211/ocb.c | 13 ++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -697,6 +697,7 @@ struct ieee80211_if_ibss {
* @wrkq_flags: OCB deferred task action
* @incomplete_lock: delayed STA insertion lock
* @incomplete_stations: list of STAs waiting for delayed insertion
+ * @incomplete_sta_count: pending entries and reserved allocations
* @joined: indication if the interface is connected to an OCB network
*/
struct ieee80211_if_ocb {
@@ -705,6 +706,7 @@ struct ieee80211_if_ocb {
spinlock_t incomplete_lock;
struct list_head incomplete_stations;
+ atomic_t incomplete_sta_count;
bool joined;
};
--- a/net/mac80211/ocb.c
+++ b/net/mac80211/ocb.c
@@ -70,9 +70,18 @@ void ieee80211_ocb_rx_no_sta(struct ieee
band = chanctx_conf->def.chan->band;
rcu_read_unlock();
+ if (!atomic_add_unless(&ifocb->incomplete_sta_count, 1,
+ IEEE80211_OCB_MAX_STA_ENTRIES)) {
+ net_info_ratelimited("%s: No room for a new OCB STA entry %pM\n",
+ sdata->name, addr);
+ return;
+ }
+
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
- if (!sta)
+ if (!sta) {
+ atomic_dec(&ifocb->incomplete_sta_count);
return;
+ }
/* Add only mandatory rates for now */
sband = local->hw.wiphy->bands[band];
@@ -145,6 +154,7 @@ void ieee80211_ocb_work(struct ieee80211
ieee80211_ocb_finish_sta(sta);
rcu_read_unlock();
}
+ atomic_dec(&ifocb->incomplete_sta_count);
spin_lock_bh(&ifocb->incomplete_lock);
}
spin_unlock_bh(&ifocb->incomplete_lock);
@@ -228,6 +238,7 @@ int ieee80211_ocb_leave(struct ieee80211
spin_unlock_bh(&ifocb->incomplete_lock);
sta_info_free(local, sta);
+ atomic_dec(&ifocb->incomplete_sta_count);
spin_lock_bh(&ifocb->incomplete_lock);
}
spin_unlock_bh(&ifocb->incomplete_lock);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0808/1005] ksmbd: evaluate the DACL in order for explicit access requests
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (806 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0807/1005] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0809/1005] gpio: aspeed: Clear only the acked lines G4 interrupt status Greg Kroah-Hartman
` (190 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
commit 20bed0d6ff62d985fe8222958825504b8aad4e88 upstream.
For requests without MAXIMUM_ALLOWED, smb_check_perm_dacl() selects one
ACE instead of evaluating the DACL in order. When the selected ACE is a
deny ACE, the function grants the complement of its mask, and deny ACEs
before it are ignored. The selected ACE can also be inherit-only,
unsupported, or an NFS mode ACE.
Guest and anonymous sessions also match Authenticated Users. These bugs
can grant read or write access that the stored DACL does not grant. For
example, a deny of FILE_READ_DATA grants FILE_WRITE_DATA, and guests can
read files granted only to Authenticated Users.
Evaluate explicit requests in DACL order. Use exact SID matching for the
caller, Everyone, Authenticated Users, OWNER RIGHTS and the caller's
groups. Match Authenticated Users only for authenticated sessions, and
ignore the NFS mode SID.
An Authenticated Users ACE must still prevent the POSIX ACL fallback
from replacing the DACL result for guest and anonymous sessions. The ACE
does not grant them access.
Keep the existing single-ACE behavior when a non-inherit-only object
deny ACE is present because ksmbd does not parse those ACEs. Guest and
anonymous sessions do not match Authenticated Users there either.
MAXIMUM_ALLOWED behavior is unchanged.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Fixes: cc2f133e80eb ("ksmbd: fix maximum allowed access checks")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/mgmt/user_config.h | 5 +++
fs/smb/server/smb2pdu.c | 11 +++++--
fs/smb/server/smbacl.c | 58 ++++++++++++++++++++++++++++++---------
fs/smb/server/smbacl.h | 2 -
4 files changed, 60 insertions(+), 16 deletions(-)
--- a/fs/smb/server/mgmt/user_config.h
+++ b/fs/smb/server/mgmt/user_config.h
@@ -67,4 +67,9 @@ struct ksmbd_user *ksmbd_alloc_user(stru
void ksmbd_free_user(struct ksmbd_user *user);
bool ksmbd_anonymous_user(struct ksmbd_user *user);
bool ksmbd_compare_user(struct ksmbd_user *u1, struct ksmbd_user *u2);
+
+static inline bool ksmbd_user_authenticated(struct ksmbd_user *user)
+{
+ return user && !user_guest(user) && !ksmbd_anonymous_user(user);
+}
#endif /* __USER_CONFIG_MANAGEMENT_H__ */
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -4359,7 +4359,8 @@ static int smb2_handle_app_instance_id(s
/* Authorize the referenced open even if its name changes meanwhile. */
old_path = &old_fp->filp->f_path;
rc = smb_check_perm_dacl(conn, old_path, &maximal_access, 0,
- work->sess->user->uid, false);
+ work->sess->user->uid,
+ ksmbd_user_authenticated(work->sess->user), false);
if (rc) {
/* Access denial prevents takeover, not the CREATE itself. */
ksmbd_put_durable_fd(old_fp);
@@ -4868,14 +4869,17 @@ resolve_path:
if (file_present && !(req->CreateOptions & FILE_DELETE_ON_CLOSE_LE)) {
rc = smb_check_perm_dacl(conn, &path, &daccess,
req->DesiredAccess,
- sess->user->uid, false);
+ sess->user->uid,
+ ksmbd_user_authenticated(sess->user), false);
if (rc)
goto err_out;
if (maximal_access_ctxt) {
maximal_access = FILE_MAXIMAL_ACCESS_LE;
rc = smb_check_perm_dacl(conn, &path, &maximal_access,
- 0, sess->user->uid, false);
+ 0, sess->user->uid,
+ ksmbd_user_authenticated(sess->user),
+ false);
if (rc)
goto err_out;
@@ -6158,6 +6162,7 @@ static int process_query_dir_entries(str
rc = smb_check_perm_dacl(priv->work->conn, &path,
&daccess, daccess,
priv->work->sess->user->uid,
+ ksmbd_user_authenticated(priv->work->sess->user),
true);
if (rc) {
dput(dent);
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -1471,6 +1471,12 @@ static bool smb_sid_in_group(const struc
return in_group_p(make_kgid(&init_user_ns, gid));
}
+/* Whether two SIDs are the same SID */
+static bool smb_sid_equal(const struct smb_sid *a, const struct smb_sid *b)
+{
+ return a->num_subauth == b->num_subauth && !compare_sids(a, b);
+}
+
/*
* compare_sids() compares only the sub-authorities both SIDs have, so it
* also matches a shorter or longer SID, such as S-1-3 or S-1-3-4-777
@@ -1483,7 +1489,7 @@ static bool smb_sid_is_owner_rights(cons
int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
__le32 *pdaccess, __le32 raw_daccess, int uid,
- bool strict)
+ bool authenticated, bool strict)
{
struct mnt_idmap *idmap = mnt_idmap(path->mnt);
struct smb_ntsd *pntsd = NULL;
@@ -1500,12 +1506,17 @@ int smb_check_perm_dacl(struct ksmbd_con
unsigned int access_bits = 0, denied = 0, grp_granted = 0;
unsigned int grp_allowed = 0, grp_denied = 0, bits;
struct smb_ace *others_ace = NULL;
- bool or_ace = false, obj_deny = false, member, counted;
+ bool or_ace = false, obj_deny = false, au_ace = false, member, counted;
struct posix_acl_entry *pa_entry;
unsigned int sid_type = SIDOWNER;
unsigned short ace_size;
bool is_owner, owner_rights = false;
bool maximal = *pdaccess & FILE_MAXIMAL_ACCESS_LE;
+ /*
+ * MAXIMUM_ALLOWED requests match every session against
+ * Authenticated Users.
+ */
+ bool authusers = authenticated || maximal;
vfsuid_t vfsuid;
ksmbd_debug(SMB, "check permission using windows acl\n");
@@ -1557,9 +1568,10 @@ int smb_check_perm_dacl(struct ksmbd_con
/*
* Evaluate the DACL in order (MS-DTYP 2.5.3.2). access_bits collects
- * the MAXIMUM_ALLOWED result. grp_granted collects what ACEs for the
- * caller's groups, or OWNER RIGHTS for the owner, grant. It is used
- * when the SID lookup and POSIX ACL fallback below do not decide.
+ * the result for the ACEs that apply to the caller, without its groups
+ * for MAXIMUM_ALLOWED. grp_granted collects what ACEs for the caller's
+ * groups, or OWNER RIGHTS for the owner, grant. It is used when the
+ * SID lookup and POSIX ACL fallback below do not decide.
*/
ace = (struct smb_ace *)((char *)pdacl + sizeof(struct smb_acl));
aces_size = pdacl_size - sizeof(struct smb_acl);
@@ -1599,10 +1611,18 @@ int smb_check_perm_dacl(struct ksmbd_con
(compare_sids(&sid, &ace->sid) &&
compare_sids(&sid_unix_NFS_mode, &ace->sid) &&
compare_sids(&sid_everyone, &ace->sid) &&
- compare_sids(&sid_authusers, &ace->sid) &&
+ (!authusers ||
+ compare_sids(&sid_authusers, &ace->sid)) &&
compare_sids(&sid_owner_rights, &ace->sid) &&
!member))
goto next_ace;
+ /* An explicit request counts only SIDs that match exactly */
+ if (!maximal && !member &&
+ !smb_sid_equal(&sid, &ace->sid) &&
+ !smb_sid_equal(&sid_everyone, &ace->sid) &&
+ !(authusers && smb_sid_equal(&sid_authusers, &ace->sid)) &&
+ !smb_sid_is_owner_rights(&ace->sid))
+ goto next_ace;
bits = le32_to_cpu(ace->access_req);
switch (ace->type) {
@@ -1620,8 +1640,8 @@ int smb_check_perm_dacl(struct ksmbd_con
case ACCESS_DENIED_CALLBACK_ACE_TYPE:
if (counted)
grp_denied |= ~grp_allowed & bits;
- /* access_bits takes no group denials either */
- if (!member)
+ /* MAXIMUM_ALLOWED takes no group denials either */
+ if (!(maximal && member))
denied |= ~access_bits & bits;
break;
}
@@ -1641,8 +1661,14 @@ next_ace:
(access_bits & GENERIC_READ_FLAGS) == GENERIC_READ_FLAGS)
access_bits |= FILE_EXECUTE;
granted = requested | access_bits;
+ } else if (!obj_deny) {
+ /* An explicit request takes the ordered result */
+ access_bits &= ~denied;
} else {
- /* An explicit request uses only grp_granted and obj_deny */
+ /*
+ * ksmbd does not parse object deny ACEs, so with one present an
+ * explicit request keeps the answer of the ACE found below
+ */
access_bits = 0;
}
@@ -1673,15 +1699,23 @@ next_ace:
!(ace->flags & INHERIT_ONLY_ACE))
or_ace = true;
if (!compare_sids(&sid_everyone, &ace->sid) ||
- !compare_sids(&sid_authusers, &ace->sid))
+ (authusers &&
+ !compare_sids(&sid_authusers, &ace->sid)))
others_ace = ace;
+ if (!compare_sids(&sid_authusers, &ace->sid))
+ au_ace = true;
ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size));
}
if (IS_ENABLED(CONFIG_FS_POSIX_ACL)) {
posix_acls = get_inode_acl(d_inode(path->dentry), ACL_TYPE_ACCESS);
- if (!IS_ERR_OR_NULL(posix_acls) && !found && !others_ace) {
+ /*
+ * An Authenticated Users ACE keeps the POSIX ACL from deciding,
+ * also for sessions that it does not match.
+ */
+ if (!IS_ERR_OR_NULL(posix_acls) && !found && !others_ace &&
+ !au_ace) {
unsigned int id = -1;
pa_entry = posix_acls->a_entries;
@@ -1754,7 +1788,7 @@ next_ace:
}
}
- if (!maximal) {
+ if (!maximal && obj_deny) {
switch (ace->type) {
case ACCESS_ALLOWED_ACE_TYPE:
access_bits = le32_to_cpu(ace->access_req);
--- a/fs/smb/server/smbacl.h
+++ b/fs/smb/server/smbacl.h
@@ -96,7 +96,7 @@ int smb_inherit_dacl(struct ksmbd_conn *
unsigned int uid, unsigned int gid);
int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
__le32 *pdaccess, __le32 raw_daccess, int uid,
- bool strict);
+ bool authenticated, bool strict);
int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon,
const struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
bool type_check, bool get_write);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0809/1005] gpio: aspeed: Clear only the acked lines G4 interrupt status
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (807 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0808/1005] ksmbd: evaluate the DACL in order for explicit access requests Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0810/1005] gpio: aspeed: Preserve the pending G7 interrupt status on control writes Greg Kroah-Hartman
` (189 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aaron Antone, Billy Tsai,
Andrew Jeffery, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Billy Tsai <billy_tsai@aspeedtech.com>
commit 5d362564bd2982def7e80d7f1e756a97440c7adb upstream.
The G4 interrupt status registers are write-1-to-clear: writing 0 to a
bit has no effect and writing 1 clears that line's status flag.
aspeed_gpio_irq_ack() clears a line's status through
aspeed_g4_reg_bit_set(), which reads the bank's status register, sets
the line's bit and writes the whole value back. That write clears every
interrupt pending in the 32-line bank, not just the acked one.
aspeed_gpio_irq_handler() reads each bank's status register once and
dispatches the lines that were set. If another line in the same bank
latches an edge after that read and before an ack in the bank, the ack
clears its status and the handler is never called for it, so the edge
is lost.
Write only the line's own bit when clearing the interrupt status on G4.
Fixes: 79fc9a2fcc45 ("gpio: aspeed: Create llops to handle hardware access")
Cc: stable@vger.kernel.org
Reported-by: Aaron Antone <aae@amazon.com>
Suggested-by: Aaron Antone <aae@amazon.com>
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Tested-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Link: https://patch.msgid.link/20261104-gpio-aspeed-irq-status-v1-1-9805645f856d@aspeedtech.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-aspeed.c | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -1041,6 +1041,17 @@ static void aspeed_g4_reg_bit_set(struct
void __iomem *addr = aspeed_gpio_g4_bank_reg(gpio, bank, reg);
u32 temp;
+ /*
+ * The interrupt status register is write-1-to-clear. Write only this
+ * line's bit so that interrupts pending on the other lines of the bank
+ * stay latched.
+ */
+ if (reg == reg_irq_status) {
+ if (val)
+ iowrite32(GPIO_BIT(offset), addr);
+ return;
+ }
+
if (reg == reg_val)
temp = gpio->dcache[GPIO_BANK(offset)];
else
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0810/1005] gpio: aspeed: Preserve the pending G7 interrupt status on control writes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (808 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0809/1005] gpio: aspeed: Clear only the acked lines G4 interrupt status Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0811/1005] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
` (188 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Billy Tsai, Andrew Jeffery,
Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Billy Tsai <billy_tsai@aspeedtech.com>
commit 18cc1d1ad94df8a6760fff2617d3d6923550cba0 upstream.
On G7 each line has its own control register, and its interrupt status
bit (bit 12) is write-1-to-clear. aspeed_g7_reg_bit_set() updates a
field by reading the control register, replacing that field and writing
the value back. When the line's interrupt is pending, the status bit
reads as 1 and is written back as 1, so updating an unrelated field
such as the interrupt enable, trigger type, direction or debounce
selection also clears the pending interrupt.
Mask out the status bit when composing the value to write, so it is
written as 1 only when the status field itself is being set to ack the
interrupt.
Fixes: b2e861bd1eaf ("gpio: aspeed: Support G7 Aspeed gpio controller")
Cc: stable@vger.kernel.org
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Link: https://patch.msgid.link/20261104-gpio-aspeed-irq-status-v1-2-9805645f856d@aspeedtech.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-aspeed.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -1168,7 +1168,13 @@ static void aspeed_g7_reg_bit_set(struct
u32 write_val;
if (mask) {
- write_val = (ioread32(addr) & ~(mask)) | field_prep(mask, val);
+ /*
+ * The interrupt status bit is write-1-to-clear. Keep it zero
+ * unless it is the field being written, so that updating any
+ * other field leaves a pending interrupt latched.
+ */
+ write_val = ioread32(addr) & ~(mask | GPIO_G7_CTRL_IRQ_STS);
+ write_val |= field_prep(mask, val);
iowrite32(write_val, addr);
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0811/1005] gpio: brcmstb: fix UAF after IRQ domain setup failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (809 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0810/1005] gpio: aspeed: Preserve the pending G7 interrupt status on control writes Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0812/1005] gpio: keep the chip reference when deferred setup fails Greg Kroah-Hartman
` (187 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Florian Fainelli,
Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
commit baa14758afb3e2828de1f76511edc1de50216f39 upstream.
When devm_request_irq() fails in brcmstb_gpio_irq_setup(), the error
path removes the IRQ domain but leaves priv->irq_domain non-NULL.
The probe error path subsequently calls brcmstb_gpio_remove(), which
checks priv->irq_domain and attempts to access the already-freed
domain through irq_find_mapping(). It also attempts to remove the
domain again, resulting in a use-after-free and potentially further
memory corruption.
Set priv->irq_domain to NULL after removing it so that the common
cleanup path skips the already-freed IRQ domain.
This issue was found by our static analysis tool under development.
Fixes: 0ba31dc201de ("gpio: brcmstb: consolidate interrupt domains")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261026115227.41779-1-lgs201920130244@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-brcmstb.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -513,6 +513,7 @@ static int brcmstb_gpio_irq_setup(struct
out_free_domain:
irq_domain_remove(priv->irq_domain);
+ priv->irq_domain = NULL;
return err;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0812/1005] gpio: keep the chip reference when deferred setup fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (810 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0811/1005] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0813/1005] gpio: of: fix potential misconfiguration of hogged lines Greg Kroah-Hartman
` (186 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wentao Liang, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
commit 7e899fe007d2ffc753e6aa5bc8f2ae0a802b9e07 upstream.
gpiochip_setup_devs() runs once gpiolib has been initialized and
finishes the registration of the chips that were added before that.
When the registration of such a chip fails, the function drops the
reference taken in gpiochip_add_data_with_key() with
gpio_device_put(), and only then logs the error through &gdev->dev.
For these chips that reference is the last one, so gpiodev_release()
frees gdev: the dev_err() dereferences freed memory, and the chip is
still linked in gpio_devices, so the next lookup walks into the freed
object as well. Here the registration cannot be undone the way
gpiochip_add_data_with_key() does it, as the driver already got success
from gpiochip_add_data() and will call gpiochip_remove(), which unlinks
the chip and drops the reference.
Keep the reference and only report the failure.
Fixes: 16fdabe143fc ("gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20261104025345.1527526-1-vulab@iscas.ac.cn
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpiolib.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -924,7 +924,8 @@ static const struct device_type gpio_dev
/*
* An initial reference count has been held in gpiochip_add_data_with_key().
- * The caller should drop the reference via gpio_device_put() on errors.
+ * A caller that tears the chip down on errors must drop the reference via
+ * gpio_device_put().
*/
static int gpiochip_setup_dev(struct gpio_chip *gc)
{
@@ -1100,12 +1101,16 @@ static void gpiochip_setup_devs(void)
continue;
}
+ /*
+ * The reference taken in gpiochip_add_data_with_key() is
+ * dropped by gpiochip_remove(): this chip is still registered
+ * and its driver has not been told about the failure, so the
+ * reference must be kept here.
+ */
ret = gpiochip_setup_dev(gc);
- if (ret) {
- gpio_device_put(gdev);
+ if (ret)
dev_err(&gdev->dev,
"Failed to initialize gpio device (%d)\n", ret);
- }
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0813/1005] gpio: of: fix potential misconfiguration of hogged lines
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (811 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0812/1005] gpio: keep the chip reference when deferred setup fails Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0814/1005] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
` (185 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Mika Westerberg,
Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit c62364eeac0f123478fca2f2d8e2424fdcd55032 upstream.
In of_gpiochip_get_lflags() the local variable xlate_flags is declared
without being initialized before its address is passed to
of_xlate_and_get_gpiod_flags() when processing a devicetree gpio-hog
child node. If a driver uses an of_xlate() callback that doesn't update
the flags argument (like gpiochip_fwd_delay_of_xlate()) we'll end up
passing that uninitialized value to of_convert_gpio_flags(), potentially
misconfiguring the hogged GPIO.
Initialize xlate_flags to 0.
Cc: stable@vger.kernel.org
Fixes: d1d564ec4992 ("gpio: move hogs into GPIO core")
Closes: https://sashiko.dev/#/bug/linux-2bb44847-fd6e-406c-878d-9739da2cb8b5
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Mika Westerberg <westeri@kernel.org>
Link: https://patch.msgid.link/20261105-gpiolib-of-hog-uninitialized-v1-1-fcaeaccefab6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpiolib-of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -725,7 +725,7 @@ int of_gpiochip_get_lflags(struct gpio_c
struct fwnode_reference_args *gpiospec,
unsigned long *lflags)
{
- enum of_gpio_flags xlate_flags;
+ enum of_gpio_flags xlate_flags = 0;
struct of_phandle_args args;
struct gpio_desc *desc;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0814/1005] gpio: rockchip: Fix debounce arithmetic for GPIO v2
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (812 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0813/1005] gpio: of: fix potential misconfiguration of hogged lines Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0815/1005] gpio: sa1100: defer GPIO chip registration to postcore_initcall Greg Kroah-Hartman
` (184 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cunhao Lu, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cunhao Lu <1579567540@qq.com>
commit 13467fd6998f5da4f5b4f172f1af3d9c48d5de8f upstream.
The debounce interval calculations use unsigned long operands. On 32-bit
systems, the numerator used to calculate the maximum interval overflows
before division, while multiplying the requested interval by the clock
rate overflows before it is assigned to a u64. A zero debounce clock rate
also causes division by zero.
Use 64-bit arithmetic for both calculations and reject a zero clock rate
before division.
At 32768 Hz, a 1 us request rounds to zero divider periods. Subtracting
one then wraps the divider value to ULONG_MAX. Decrement only a nonzero
rounded period count so that such requests use the smallest divider
value.
Fixes: 3bcbd1a85b68 ("gpio/rockchip: support next version gpio controller")
Cc: stable@vger.kernel.org
Signed-off-by: Cunhao Lu <1579567540@qq.com>
Link: https://patch.msgid.link/20261023-fix-rockchip-gpio-v2-debounce-v1-1-f1141bd5b58f@qq.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-rockchip.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -201,20 +201,25 @@ static int rockchip_gpio_set_debounce(st
{
struct rockchip_pin_bank *bank = gpiochip_get_data(gc);
const struct rockchip_gpio_regs *reg = bank->gpio_regs;
- unsigned long flags, div_reg, freq, max_debounce;
+ unsigned long flags, div_reg, freq;
bool div_debounce_support;
unsigned int cur_div_reg;
- u64 div;
+ u64 div, max_debounce;
if (bank->gpio_type == GPIO_TYPE_V2 && !IS_ERR(bank->db_clk)) {
div_debounce_support = true;
freq = clk_get_rate(bank->db_clk);
- max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;
+ if (!freq)
+ return -EINVAL;
+
+ div = (u64)(GENMASK(23, 0) + 1) * 2 * USEC_PER_SEC;
+ max_debounce = div64_u64(div, freq);
if (debounce > max_debounce)
return -EINVAL;
- div = debounce * freq;
- div_reg = DIV_ROUND_CLOSEST_ULL(div, 2 * USEC_PER_SEC) - 1;
+ div = (u64)debounce * freq;
+ div_reg = DIV_ROUND_CLOSEST_ULL(div, 2 * USEC_PER_SEC);
+ div_reg = div_reg ? div_reg - 1 : 0;
} else {
div_debounce_support = false;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0815/1005] gpio: sa1100: defer GPIO chip registration to postcore_initcall
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (813 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0814/1005] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0816/1005] gpio: shared: fix a race in shared desc release path Greg Kroah-Hartman
` (183 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Dmitry Torokhov,
Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
commit 32c89e32b3fef2ee0aa5c4d0b0fb089bb20b3223 upstream.
Registering the software node and the GPIO chip for the SA-1100 GPIO
controller during early IRQ initialization causes boot hangs on
SA-1100 platforms because the software node subsystem has not yet
been initialized. At that early boot stage, attempting to register
software nodes dereferences a NULL kset pointer before console or
driver model initialization.
Nothing on SA-1100 platforms requests GPIO lines via gpiolib during
early boot before initcalls run; only the GPIO IRQ controller and
domain must be initialized during init_IRQ(). Defer registering the
software node, assigning its firmware node, and registering the GPIO
chip with gpiolib to postcore_initcall, running after driver and
gpiolib device initialization and before board consumers register.
Fixes: e4671f292ebb ("gpio: sa1100: register software node for GPIO controller")
Cc: stable@vger.kernel.org
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/r/2a561a27-a3bf-4cac-a4dc-bfbc5c859f45@roeck-us.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/20261029-sa1100-swnode-fix-v1-1-112f4d83d191@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-sa1100.c | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c
index e4f3bf949b87..1916200ebbd5 100644
--- a/drivers/gpio/gpio-sa1100.c
+++ b/drivers/gpio/gpio-sa1100.c
@@ -8,6 +8,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/io.h>
+#include <linux/printk.h>
#include <linux/syscore_ops.h>
#include <soc/sa1100/pwer.h>
#include <mach/hardware.h>
@@ -322,7 +323,6 @@ static const int sa1100_gpio_irqs[] __initconst = {
void __init sa1100_init_gpio(void)
{
struct sa1100_gpio_chip *sgc = &sa1100_gpio_chip;
- struct gpio_chip *gc = &sgc->chip;
int i;
/* clear all GPIO edge detects */
@@ -330,10 +330,6 @@ void __init sa1100_init_gpio(void)
writel_relaxed(0, sgc->membase + R_GRER);
writel_relaxed(-1, sgc->membase + R_GEDR);
- software_node_register(&sa1100_gpiochip_node);
- gc->fwnode = software_node_fwnode(&sa1100_gpiochip_node);
- gpiochip_add_data(gc, NULL);
-
sa1100_gpio_irqdomain = irq_domain_create_simple(NULL,
28, IRQ_GPIO0,
&sa1100_gpio_irqdomain_ops, sgc);
@@ -342,3 +338,29 @@ void __init sa1100_init_gpio(void)
irq_set_chained_handler_and_data(sa1100_gpio_irqs[i],
sa1100_gpio_handler, sgc);
}
+
+static int __init sa1100_gpio_init_chip(void)
+{
+ struct gpio_chip *gc = &sa1100_gpio_chip.chip;
+ int error;
+
+ error = software_node_register(&sa1100_gpiochip_node);
+ if (error) {
+ pr_err("failed to register sa1100 gpiochip software node: %d\n",
+ error);
+ return error;
+ }
+
+ gc->fwnode = software_node_fwnode(&sa1100_gpiochip_node);
+
+ error = gpiochip_add_data(gc, NULL);
+ if (error) {
+ pr_err("failed to add sa1100 gpiochip: %d\n", error);
+ gc->fwnode = NULL;
+ software_node_unregister(&sa1100_gpiochip_node);
+ return error;
+ }
+
+ return 0;
+}
+postcore_initcall(sa1100_gpio_init_chip);
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0816/1005] gpio: shared: fix a race in shared desc release path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (814 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0815/1005] gpio: sa1100: defer GPIO chip registration to postcore_initcall Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0817/1005] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
` (182 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit 53043b9e83cc7f4e30e70161b67ae93c4c9fdb87 upstream.
gpiod_shared_put() races with concurrent calls to
devm_gpiod_shared_get() like so:
CPU 0 (unbind / probe failure) CPU 1 (concurrent proxy probe)
============================== ==============================
gpiod_shared_put()
kref_put(&entry->ref, ...)
refcount_dec_and_test() // -> 0
devm_gpiod_shared_get()
mutex_lock(&entry->lock);
if (entry->shared_desc) {
kref_get(&entry->ref); // on 0!
shared_desc = entry->shared_desc;
}
mutex_unlock(&entry->lock);
gpio_shared_release()
mutex_lock(&entry->lock);
kfree(shared_desc);
entry->shared_desc = NULL;
mutex_unlock(&entry->lock);
// uses freed shared_desc
Because gpiod_shared_put() decrements entry->ref without holding
entry->lock and gpio_shared_release() only acquires entry->lock after the
reference count has already reached zero, a concurrent call to
devm_gpiod_shared_get() can acquire entry->lock in the intermediate window
and observe a non-NULL entry->shared_desc. This can result in a
use-after-free and a double-free when the second consumer releases its
reference.
Use kref_put_mutex() to ensure the entry lock is taken without a window
in which a concurrent user can see a non-NULL entry->shared_desc while
it's being released.
Cc: stable@vger.kernel.org
Closes: https://sashiko.dev/#/bug/linux-30e071e4-4e4a-4b63-bd83-df1147055d35
Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support")
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261110-gpio-shared-refcnt-race-v2-1-8a0b76e01714@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpiolib-shared.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c
index 8c9ac9d93304..edb04a5bb987 100644
--- a/drivers/gpio/gpiolib-shared.c
+++ b/drivers/gpio/gpiolib-shared.c
@@ -635,20 +635,20 @@ static void gpio_shared_release(struct kref *kref)
container_of(kref, struct gpio_shared_entry, ref);
struct gpio_shared_desc *shared_desc;
- guard(mutex)(&entry->lock);
-
shared_desc = entry->shared_desc;
gpio_device_put(shared_desc->desc->gdev);
mutex_destroy(&shared_desc->mutex);
kfree(shared_desc);
entry->shared_desc = NULL;
+
+ mutex_unlock(&entry->lock);
}
static void gpiod_shared_put(void *data)
{
struct gpio_shared_entry *entry = data;
- kref_put(&entry->ref, gpio_shared_release);
+ kref_put_mutex(&entry->ref, gpio_shared_release, &entry->lock);
}
static struct gpio_shared_desc *
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0817/1005] gpio: sodaville: fix use-after-free bug when registering the irqchip
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (815 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0816/1005] gpio: shared: fix a race in shared desc release path Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0818/1005] gpio: virtuser: fix interrupt leak and UAF Greg Kroah-Hartman
` (181 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit ab9102375b7c77e0c4d33c7594e514454dc9f2b3 upstream.
In sdv_register_irqsupport(), if irq_domain_create_legacy() fails during
device probing, a generic IRQ chip is left registered in the global gc_list
while its underlying memory is freed, leading to a use-after-free. Use
the managed variant of irq_setup_generic_chip() to ensure that the chip
gets unregistered before the memory it uses is freed.
Cc: stable@vger.kernel.org
Fixes: 9381fc5d655d ("gpio: sodaville: Convert to use managed functions pcim_* and devm_*")
Closes: https://sashiko.dev/#/bug/linux-2f7ac8b6-5034-4ff1-9afa-5700ff44e3e9
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261105-gpio-sodaville-use-after-free-v1-1-f572f40feedd@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-sodaville.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/gpio/gpio-sodaville.c
+++ b/drivers/gpio/gpio-sodaville.c
@@ -166,9 +166,12 @@ static int sdv_register_irqsupport(struc
ct->chip.irq_eoi = irq_gc_eoi;
ct->chip.irq_set_type = sdv_gpio_pub_set_type;
- irq_setup_generic_chip(sd->gc, IRQ_MSK(SDV_NUM_PUB_GPIOS),
- IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
- IRQ_LEVEL | IRQ_NOPROBE);
+ ret = devm_irq_setup_generic_chip(&pdev->dev, sd->gc,
+ IRQ_MSK(SDV_NUM_PUB_GPIOS),
+ IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
+ IRQ_LEVEL | IRQ_NOPROBE);
+ if (ret)
+ return ret;
sd->id = irq_domain_create_legacy(dev_fwnode(&pdev->dev), SDV_NUM_PUB_GPIOS, sd->irq_base,
0, &irq_domain_sdv_ops, sd);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0818/1005] gpio: virtuser: fix interrupt leak and UAF
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (816 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0817/1005] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0819/1005] gpio: virtuser: remove the debugfs files before freeing the line data Greg Kroah-Hartman
` (180 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit 24cafd9580627f9f066296f4a6ce1b282a3f425d upstream.
When configuring interrupt handlers for GPIOs requested by virtual
users, we never verify if an interrupt has been previously requested and
just leak it if it was.
We also never free the interrupts at device unbind. This is both a leak
and a potential UAF bug.
We use atomic_t for the irq field for now reason, it can't be modifying
or read from atomic context. Let's repurpose the existing consumer_lock
mutex and serialize access to the irq field. Let's add sanitization of
input and schedule a tear-down action.
Cc: stable@vger.kernel.org
Fixes: 91581c4b3f29 ("gpio: virtuser: new virtual testing driver for the GPIO API")
Closes: https://sashiko.dev/#/bug/linux-d8935133-0e80-487a-9e00-e748056f595e
Link: https://patch.msgid.link/20261106-gpio-virtuser-irq-uaf-leak-v1-1-ce9772d8ad0d@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-virtuser.c | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
--- a/drivers/gpio/gpio-virtuser.c
+++ b/drivers/gpio/gpio-virtuser.c
@@ -55,9 +55,9 @@ struct gpio_virtuser_line_array_data {
struct gpio_virtuser_line_data {
struct gpio_virtuser_attr_data ad;
char consumer[GPIO_VIRTUSER_NAME_BUF_LEN];
- struct mutex consumer_lock;
+ struct mutex lock;
unsigned int debounce;
- atomic_t irq;
+ int irq;
atomic_t irq_count;
};
@@ -607,7 +607,7 @@ static ssize_t gpio_virtuser_consumer_re
memset(buf, 0x0, sizeof(buf));
- scoped_guard(mutex, &data->consumer_lock)
+ scoped_guard(mutex, &data->lock)
ret = snprintf(buf, sizeof(buf), "%s\n", data->consumer);
return simple_read_from_buffer(user_buf, size, ppos, buf, ret);
@@ -635,7 +635,7 @@ static ssize_t gpio_virtuser_consumer_wr
if (ret)
return ret;
- scoped_guard(mutex, &data->consumer_lock)
+ scoped_guard(mutex, &data->lock)
strscpy(data->consumer, buf, sizeof(data->consumer));
return count;
@@ -675,7 +675,12 @@ static int gpio_virtuser_interrupts_set(
if (val > 1)
return -EINVAL;
+ guard(mutex)(&ld->lock);
+
if (val) {
+ if (ld->irq >= 0)
+ return -EBUSY;
+
irq = gpiod_to_irq(ld->ad.desc);
if (irq < 0)
return irq;
@@ -689,11 +694,13 @@ static int gpio_virtuser_interrupts_set(
if (ret)
return ret;
- atomic_set(&ld->irq, irq);
+ ld->irq = irq;
} else {
- irq = atomic_xchg(&ld->irq, 0);
- if (irq)
- free_irq(irq, ld);
+ if (ld->irq < 0)
+ return -EBUSY;
+
+ free_irq(ld->irq, ld);
+ ld->irq = -1;
}
return 0;
@@ -793,6 +800,14 @@ static int gpio_virtuser_dbgfs_init_line
data->ad.dbgfs_dir, data);
}
+static void gpio_virtuser_free_irq(void *data)
+{
+ struct gpio_virtuser_line_data *ld = data;
+
+ if (ld->irq >= 0)
+ free_irq(ld->irq, ld);
+}
+
static int gpio_virtuser_dbgfs_init_line_attrs(struct device *dev,
struct gpio_desc *desc,
const char *id,
@@ -809,14 +824,18 @@ static int gpio_virtuser_dbgfs_init_line
data->ad.desc = desc;
strscpy(data->consumer, id);
- atomic_set(&data->irq, 0);
+ data->irq = -1;
atomic_set(&data->irq_count, 0);
+ ret = devm_add_action_or_reset(dev, gpio_virtuser_free_irq, data);
+ if (ret)
+ return ret;
+
name = devm_kasprintf(dev, GFP_KERNEL, "gpiod:%s:%u", id, index);
if (!name)
return -ENOMEM;
- ret = devm_mutex_init(dev, &data->consumer_lock);
+ ret = devm_mutex_init(dev, &data->lock);
if (ret)
return ret;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0819/1005] gpio: virtuser: remove the debugfs files before freeing the line data
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (817 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0818/1005] gpio: virtuser: fix interrupt leak and UAF Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0820/1005] gpiolib: fix stack out-of-bounds access in gpiochip_add_hog() Greg Kroah-Hartman
` (179 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yu Zhang, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Zhang <yuz08559@gmail.com>
commit c2d0710318b8cd57d0ef6088d0ee4bbc1e827fd3 upstream.
gpio_virtuser_probe() registers the devm action that removes the debugfs
directory before it allocates the per-line and per-array data that the
debugfs files point to. devres releases resources in reverse order, so
on unbind the line data is freed, the consumer_lock mutex is destroyed
and the GPIO descriptors are put first, and the debugfs files are only
removed afterwards.
A read or write of any of the per-line debugfs files (value, direction,
consumer, interrupts, ...) that runs in that window dereferences the
freed data. debugfs_remove_recursive() waits for in-flight file
operations, but by then the data has already been freed.
Running eight threads that read the per-line debugfs files while
another task writes 1 and 0 to the configfs "live" attribute triggers
this within a second on a KASAN kernel, with gpio-sim as the provider:
BUG: KASAN: slab-use-after-free in gpio_virtuser_value_get+0x19/0x60
Read of size 8 at addr ffff888005109e38 by task vu_race/3479
Call Trace:
gpio_virtuser_value_get+0x19/0x60
simple_attr_read+0x109/0x290
debugfs_attr_read+0x5e/0x80
full_proxy_read+0xae/0xe0
vfs_read+0x1bc/0x7a0
Allocated by task 1:
devm_kmalloc+0x89/0x1d0
gpio_virtuser_probe+0x56f/0x910
Freed by task 1:
kfree+0x196/0x430
release_nodes+0x77/0xa0
devres_release_all+0xf3/0x150
device_unbind_cleanup+0x18/0x130
...
platform_device_unregister+0x3c/0x50
gpio_virtuser_device_deactivate+0x3c/0xc0
The same run also reports use-after-free on the freed consumer_lock
from the consumer attribute.
Register the debugfs removal action after the line data has been set
up, so that it runs first on unbind, and remove the directory by hand
on the probe error paths before that point.
Fixes: 91581c4b3f29 ("gpio: virtuser: new virtual testing driver for the GPIO API")
Cc: stable@vger.kernel.org
Signed-off-by: Yu Zhang <yuz08559@gmail.com>
Link: https://patch.msgid.link/20261102075707.41742-1-yuz08559@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-virtuser.c | 46 +++++++++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 17 deletions(-)
--- a/drivers/gpio/gpio-virtuser.c
+++ b/drivers/gpio/gpio-virtuser.c
@@ -946,38 +946,50 @@ static int gpio_virtuser_probe(struct pl
"Failed to get the IDs of GPIOs to request\n");
dbgfs_entry = debugfs_create_dir(dev_name(dev), gpio_virtuser_dbg_root);
- ret = devm_add_action_or_reset(dev, gpio_virtuser_debugfs_remove,
- dbgfs_entry);
- if (ret)
- return ret;
for (i = 0; i < num_ids; i++) {
descs = devm_gpiod_get_array(dev, ids[i], GPIOD_ASIS);
- if (IS_ERR(descs))
- return dev_err_probe(dev, PTR_ERR(descs),
- "Failed to request the '%s' GPIOs\n",
- ids[i]);
+ if (IS_ERR(descs)) {
+ ret = dev_err_probe(dev, PTR_ERR(descs),
+ "Failed to request the '%s' GPIOs\n",
+ ids[i]);
+ goto err_remove_debugfs;
+ }
ret = gpio_virtuser_dbgfs_init_line_array_attrs(dev, descs,
ids[i],
dbgfs_entry);
- if (ret)
- return dev_err_probe(dev, ret,
- "Failed to setup the debugfs array interface for the '%s' GPIOs\n",
- ids[i]);
+ if (ret) {
+ dev_err_probe(dev, ret,
+ "Failed to setup the debugfs array interface for the '%s' GPIOs\n",
+ ids[i]);
+ goto err_remove_debugfs;
+ }
for (j = 0; j < descs->ndescs; j++) {
ret = gpio_virtuser_dbgfs_init_line_attrs(dev,
descs->desc[j], ids[i],
j, dbgfs_entry);
- if (ret)
- return dev_err_probe(dev, ret,
- "Failed to setup the debugfs line interface for the '%s' GPIOs\n",
- ids[i]);
+ if (ret) {
+ dev_err_probe(dev, ret,
+ "Failed to setup the debugfs line interface for the '%s' GPIOs\n",
+ ids[i]);
+ goto err_remove_debugfs;
+ }
}
}
- return 0;
+ /*
+ * The debugfs files point to the devres-managed line data allocated
+ * above. Register the removal last so that it runs first on unbind,
+ * before any of that data is released.
+ */
+ return devm_add_action_or_reset(dev, gpio_virtuser_debugfs_remove,
+ dbgfs_entry);
+
+err_remove_debugfs:
+ debugfs_remove_recursive(dbgfs_entry);
+ return ret;
}
static const struct of_device_id gpio_virtuser_of_match[] = {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0820/1005] gpiolib: fix stack out-of-bounds access in gpiochip_add_hog()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (818 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0819/1005] gpio: virtuser: remove the debugfs files before freeing the line data Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0821/1005] gpiolib: synchronize updates of descriptor labels Greg Kroah-Hartman
` (178 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Linus Walleij,
Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit f8a4fdf57cedb9cb3f47d94269ff27fea8e819e8 upstream.
In gpiochip_add_hog(), parsing a device tree with an excessively large
"#gpio-cells" property causes a stack out-of-bounds write when populating
the GPIO specification.
The value read from #gpio-cells is used to copy the values into right
places in struct fwnode_reference_args but that struct's args field is
an array of size NR_FWNODE_REFERENCE_ARGS so a value larger than it will
make the loop write past the end of that array.
If #gpio-cells is 0, we can trigger a divide-by-zero later when
calculating the actual number of hogs.
If #gpio-cells is 1, we can also perform an out-of-bounds read of
the "gpios" array.
Reject #gpio-cells larger than NR_FWNODE_REFERENCE_ARGS, lower than 1
and make sure #gpio-cells is larger than 1 before checking the
active-low flag.
Cc: stable@vger.kernel.org
Fixes: 802c51a83e9a ("gpiolib: fix hogs with multiple lines")
Closes: https://sashiko.dev/#/bug/linux-fdec1c0e-c6e3-4eb6-8746-d68a3f951374
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261110-gpiolib-hog-stack-corruption-v2-1-c5b28cb8dc8e@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpiolib.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -986,6 +986,8 @@ int gpiochip_add_hog(struct gpio_chip *g
ret = fwnode_property_read_u32(gc_node, "#gpio-cells", &cells);
if (ret && is_of_node(fwnode))
return ret;
+ if (cells < 1 || cells > NR_FWNODE_REFERENCE_ARGS)
+ return -EINVAL;
if (argc % cells)
return -EINVAL;
@@ -1041,9 +1043,10 @@ int gpiochip_add_hog(struct gpio_chip *g
} else {
/*
* GPIO_ACTIVE_LOW is currently the only lookup flag
- * supported for non-OF firmware nodes.
+ * supported for non-OF firmware nodes and it must live
+ * in the second cell.
*/
- if (gpios[i * cells + 1])
+ if (cells > 1 && gpios[i * cells + 1])
lflags |= GPIO_ACTIVE_LOW;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0821/1005] gpiolib: synchronize updates of descriptor labels
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (819 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0820/1005] gpiolib: fix stack out-of-bounds access in gpiochip_add_hog() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0822/1005] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
` (177 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit 82028344caeed2ea3536708906adee02e472633d upstream.
desc_set_label() swaps desc->label with rcu_replace_pointer() but
without any synchronization of concurrent updates. The swap is a plain
read + write: two threads can observe the same old label and then call
call_scru() on the same SRCU head corrupting the state of the chain.
Add a spinlock to struct gpio_device - we're using a single spinlock for
all descriptors as using a per-descriptor lock would unnecessarily bloat
the size of the desc array with very little chance and no consequences of
contention - and use it to serialize the pointer update.
Cc: stable@vger.kernel.org
Fixes: 1f2bcb8c8ccd ("gpio: protect the descriptor label with SRCU")
Closes: https://sashiko.dev/#/bug/linux-2f7ac8b6-5034-4ff1-9afa-5700ff44e3e9
Link: https://patch.msgid.link/20261105-gpiolib-set-desc-label-corruption-v1-1-fa84726ceac0@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpiolib.c | 11 ++++++++---
drivers/gpio/gpiolib.h | 2 ++
2 files changed, 10 insertions(+), 3 deletions(-)
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -154,9 +154,12 @@ static int desc_set_label(struct gpio_de
memcpy(new->str, label, len);
}
- old = rcu_replace_pointer(desc->label, new, 1);
- if (old)
- call_srcu(&desc->gdev->desc_srcu, &old->rh, desc_free_label);
+ scoped_guard(spinlock, &desc->gdev->desc_lock) {
+ old = rcu_replace_pointer(desc->label, new,
+ lockdep_is_held(&desc->gdev->desc_lock));
+ if (old)
+ call_srcu(&desc->gdev->desc_srcu, &old->rh, desc_free_label);
+ }
return 0;
}
@@ -1210,6 +1213,8 @@ int gpiochip_add_data_with_key(struct gp
goto err_free_ida;
rcu_assign_pointer(gdev->chip, gc);
+ spin_lock_init(&gdev->desc_lock);
+
ret = init_srcu_struct(&gdev->desc_srcu);
if (ret)
goto err_cleanup_gdev_srcu;
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -37,6 +37,7 @@ struct fwnode_handle;
* @valid_mask: If not %NULL, holds bitmask of GPIOs which are valid to be
* used from the chip.
* @desc_srcu: ensures consistent state of GPIO descriptors exposed to users
+ * @desc_lock: synchronizes the updates to descriptor labels
* @ngpio: the number of GPIO lines on this GPIO device, equal to the size
* of the @descs array.
* @can_sleep: indicate whether the GPIO chip driver's callbacks can sleep
@@ -71,6 +72,7 @@ struct gpio_device {
struct gpio_desc *descs;
unsigned long *valid_mask;
struct srcu_struct desc_srcu;
+ spinlock_t desc_lock;
unsigned int base;
u16 ngpio;
bool can_sleep;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0822/1005] ovl: do not always clear absolute_redirect
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (820 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 7.3 0821/1005] gpiolib: synchronize updates of descriptor labels Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0823/1005] ovl: do not read the flags of a put upper dentry in lookup Greg Kroah-Hartman
` (176 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giuseppe Scrivano <giuseppe@scrivano.org>
commit 477449a7a5fd1b2fe973fe2978b0c921115a65f3 upstream.
ovl_check_redirect() clears d->absolute_redirect before it checks that
the path element has a redirect xattr. An element without one, such as
an intermediate directory in a lower layer, then clears the flag set by
the absolute redirect of a metacopy file found in a higher layer. The
lookup of the data in the data-only layers is not deferred any more and
the lookup fails with -EIO:
# l2/f: metacopy, redirect "/dir/file"; l1/dir/ exists, no "file"
mount -t overlay none -o metacopy=on,redirect_dir=on,\
lowerdir+=l2,lowerdir+=l1,datadir+=data m
cat m/f # Input/output error
Set d->absolute_redirect only when a redirect xattr was read.
Fixes: 5436ab0a864e ("ovl: implement lookup in data-only layers")
Closes: https://sashiko.dev/#/bug/linux-2cc24e0b-fbdc-4cf1-aded-cfd19c2918ee
Cc: stable@vger.kernel.org
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/namei.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -39,13 +39,12 @@ static int ovl_check_redirect(const stru
char *buf;
struct ovl_fs *ofs = OVL_FS(d->sb);
- d->absolute_redirect = false;
buf = ovl_get_redirect_xattr(ofs, path, prelen + strlen(post));
if (IS_ERR_OR_NULL(buf))
return PTR_ERR(buf);
- if (buf[0] == '/') {
- d->absolute_redirect = true;
+ d->absolute_redirect = buf[0] == '/';
+ if (d->absolute_redirect) {
/*
* One of the ancestor path elements in an absolute path
* lookup in ovl_lookup_layer() could have been opaque and
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0823/1005] ovl: do not read the flags of a put upper dentry in lookup
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (821 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0822/1005] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0824/1005] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure Greg Kroah-Hartman
` (175 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
commit 7031366be218f291592a7ad38bc34a7cd1459737 upstream.
ovl_lookup_layers() passes ctx->upperdentry to ovl_get_inode(), which
takes over the reference. If an overlay inode for the upper inode is
already cached, as for a second hard link, ovl_get_inode() puts the
dentry and returns the cached inode. ovl_lookup_layers() then passes
the put dentry to ovl_dentry_init_reval(), which reads its d_flags.
With a local upper fs the put dentry usually stays in the dcache, but
with a FUSE upper whose entry has timed out, dput() kills it, so this
is a use-after-free.
Fix this by taking the revalidate flags from the upper dentry of the
overlay inode, which is the one that ovl_dentry_revalidate_common()
revalidates.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-986db859-840c-479d-944c-b9c43b93377e
Fixes: bccece1ead36 ("ovl: allow remote upper")
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/namei.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1381,9 +1381,17 @@ static int ovl_lookup_layers(struct ovl_
if (metacopy_size > OVL_METACOPY_MIN_SIZE)
ovl_set_flag(OVL_HAS_DIGEST, ctx->inode);
- }
- ovl_dentry_init_reval(dentry, ctx->upperdentry, OVL_I_E(ctx->inode));
+ /*
+ * ovl_get_inode() puts ctx->upperdentry if it finds a cached
+ * inode, e.g. for another hard link, so use the upper dentry
+ * of the inode.
+ */
+ ovl_dentry_init_reval(dentry, ovl_i_dentry_upper(inode),
+ OVL_I_E(inode));
+ } else {
+ ovl_dentry_init_reval(dentry, NULL, NULL);
+ }
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0824/1005] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (822 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0823/1005] ovl: do not read the flags of a put upper dentry in lookup Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0825/1005] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
` (174 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
commit f1b7e5534854043077bb72afc8d87ad1e0b283e0 upstream.
ovl_lookup_layers() moves d->redirect into oip.lowerdata_redirect and
clears d->redirect before calling ovl_get_inode(). When ovl_get_inode()
fails, it does not free oip.lowerdata_redirect, and ovl_lookup() frees
the already cleared d->redirect, so the lowerdata redirect string is
leaked.
Clear d->redirect only after ovl_get_inode() has succeeded, like
d->upperredirect, so that ovl_lookup() frees it on failure.
Fixes: 2b21da920866 ("ovl: prepare to store lowerdata redirect for lazy lowerdata lookup")
Closes: https://sashiko.dev/#/bug/linux-dabbd363-9c71-4915-af72-e2b5e75fa58e
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/namei.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1366,15 +1366,16 @@ static int ovl_lookup_layers(struct ovl_
};
/* Store lowerdata redirect for lazy lookup */
- if (ctx->ctr > 1 && !d->is_dir && !ctx->stack[ctx->ctr - 1].dentry) {
+ if (ctx->ctr > 1 && !d->is_dir && !ctx->stack[ctx->ctr - 1].dentry)
oip.lowerdata_redirect = d->redirect;
- d->redirect = NULL;
- }
inode = ovl_get_inode(dentry->d_sb, &oip);
if (IS_ERR(inode))
return PTR_ERR(inode);
+ if (oip.lowerdata_redirect)
+ d->redirect = NULL;
+
ctx->inode = inode;
if (ctx->upperdentry && !uppermetacopy)
ovl_set_flag(OVL_UPPERDATA, ctx->inode);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0825/1005] ovl: reject different lower idmaps on the same fs
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (823 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0824/1005] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0826/1005] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
` (173 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner,
Jérémy Jean, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit 720f40c05b2785406121da0151543751204f2953 upstream.
Overayfs mounted with index=on or nfs_export=on require file handle
support from backing filesystems.
Overlay file handles identify a backing filesystem, but not the lower
mount used to decode it. If lower layers share a superblock and use
different idmaps, a handle can decode through the wrong layer.
Record the first idmap on a private lower clone for each backing
filesystem. Fail if another clone has a different idmap. Comparing
the private clones prevents mount_setattr() from changing the checked
state. Distinct idmap objects are treated as ambiguous.
Fixes: bc70682a497c ("ovl: support idmapped layers")
Suggested-by: Christian Brauner <brauner@kernel.org>
Link: Link: https://lore.kernel.org/all/20260925-server-hager-riskieren-06116eded213@brauner/
Cc: stable@vger.kernel.org
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/ovl_entry.h | 2 ++
fs/overlayfs/super.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
--- a/fs/overlayfs/ovl_entry.h
+++ b/fs/overlayfs/ovl_entry.h
@@ -24,6 +24,8 @@ struct ovl_config {
struct ovl_sb {
struct super_block *sb;
dev_t pseudo_dev;
+ /* Idmap of the first lower layer on this fs */
+ const struct mnt_idmap *lower_idmap;
/* Unusable (conflicting) uuid */
bool bad_uuid;
/* Used as a lower layer (but maybe also as upper) */
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1121,6 +1121,29 @@ static int ovl_get_layers(struct super_b
}
/*
+ * Lower file handles identify the lower fs, but not the layer,
+ * so with different idmaps on the same lower fs, index and
+ * nfs_export may decode a file handle through a layer with the
+ * wrong idmap. Following copy up origin without index is only
+ * used for st_ino, which does not depend on the idmap.
+ */
+ if (i < nr_merged_lower &&
+ (ofs->config.index || ofs->config.nfs_export)) {
+ const struct mnt_idmap *idmap = mnt_idmap(mnt);
+ struct ovl_sb *fs = &ofs->fs[fsid];
+
+ if (!fs->lower_idmap) {
+ fs->lower_idmap = idmap;
+ } else if (fs->lower_idmap != idmap) {
+ pr_err("lower layer '%pd2' conflicts with idmap of another lower layer on the same fs, mount with '-o index=off,nfs_export=off' to override.\n",
+ l->path.dentry);
+ iput(trap);
+ kern_unmount(mnt);
+ return -EINVAL;
+ }
+ }
+
+ /*
* Make lower layers R/O. That way fchmod/fchown on lower file
* will fail instead of modifying lower fs.
*/
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0826/1005] ovl: report the requested redirect_dir mode in conflicting options
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (824 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0825/1005] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0827/1005] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
` (172 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
commit 248503755b3cab89742edcc3cfd53adbcf7bfec2 upstream.
Since the redirect_dir mode is stored as an enum, "off" is translated to
"follow" or "nofollow" when parsing the option and redirect_dir=follow is
translated to "on" for a non-upper mount, so the errors about options
that conflict with an explicit redirect_dir= report a mode that the user
did not request.
Translate "off" when verifying the mount options instead of when parsing
them and report the requested mode in those errors.
Fixes: af5f2396b671 ("ovl: store enum redirect_mode in config instead of a string")
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/overlayfs.h | 10 +++++++---
fs/overlayfs/params.c | 43 ++++++++++++++++++++++++++++++-------------
2 files changed, 37 insertions(+), 16 deletions(-)
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -74,9 +74,13 @@ enum ovl_entry_flag {
};
enum {
- OVL_REDIRECT_OFF, /* "off" mode is never used. In effect */
- OVL_REDIRECT_FOLLOW, /* ...it translates to either "follow" */
- OVL_REDIRECT_NOFOLLOW, /* ...or "nofollow". */
+ /*
+ * "off" mode is never used after mount options are verified. In effect
+ * it translates to either "follow" or "nofollow".
+ */
+ OVL_REDIRECT_OFF,
+ OVL_REDIRECT_FOLLOW,
+ OVL_REDIRECT_NOFOLLOW,
OVL_REDIRECT_ON,
};
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -112,18 +112,28 @@ const struct constant_table ovl_paramete
{}
};
+static const char *ovl_redirect_mode_name(int redirect_mode)
+{
+ return ovl_parameter_redirect_dir[redirect_mode].name;
+}
+
static const char *ovl_redirect_mode(struct ovl_config *config)
{
- return ovl_parameter_redirect_dir[config->redirect_mode].name;
+ return ovl_redirect_mode_name(config->redirect_mode);
}
-static int ovl_redirect_mode_def(void)
+static int ovl_redirect_follow_mode(void)
{
- return ovl_redirect_dir_def ? OVL_REDIRECT_ON :
- ovl_redirect_always_follow ? OVL_REDIRECT_FOLLOW :
+ return ovl_redirect_always_follow ? OVL_REDIRECT_FOLLOW :
OVL_REDIRECT_NOFOLLOW;
}
+static int ovl_redirect_mode_def(void)
+{
+ return ovl_redirect_dir_def ? OVL_REDIRECT_ON :
+ ovl_redirect_follow_mode();
+}
+
static const struct constant_table ovl_parameter_verity[] = {
{ "off", OVL_VERITY_OFF },
{ "on", OVL_VERITY_ON },
@@ -659,11 +669,6 @@ static int ovl_parse_param(struct fs_con
break;
case Opt_redirect_dir:
config->redirect_mode = result.uint_32;
- if (config->redirect_mode == OVL_REDIRECT_OFF) {
- config->redirect_mode = ovl_redirect_always_follow ?
- OVL_REDIRECT_FOLLOW :
- OVL_REDIRECT_NOFOLLOW;
- }
ctx->set.redirect = true;
break;
case Opt_index:
@@ -819,7 +824,13 @@ int ovl_init_fs_context(struct fs_contex
if (!ofs)
goto out_err;
- ofs->config.redirect_mode = ovl_redirect_mode_def();
+ /*
+ * The module default determines only if new redirects are created in
+ * upper dir. If they are not, the redirect follow mode will be
+ * determined after parsing mount options.
+ */
+ ofs->config.redirect_mode = ovl_redirect_dir_def ?
+ OVL_REDIRECT_ON : OVL_REDIRECT_OFF;
ofs->config.index = ovl_index_def;
ofs->config.uuid = ovl_uuid_def();
ofs->config.nfs_export = ovl_nfs_export_def;
@@ -877,6 +888,8 @@ int ovl_fs_params_verify(const struct ov
struct ovl_config *config)
{
struct ovl_opt_set set = ctx->set;
+ /* The requested redirect_dir=, for reporting conflicts with it */
+ int redirect_opt = config->redirect_mode;
/* Workdir/index are useless in non-upper mount */
if (!config->upperdir) {
@@ -903,6 +916,10 @@ int ovl_fs_params_verify(const struct ov
config->uuid = OVL_UUID_NULL;
}
+ /* Resolve redirect_dir=off to the default redirect follow mode */
+ if (config->redirect_mode == OVL_REDIRECT_OFF)
+ config->redirect_mode = ovl_redirect_follow_mode();
+
/*
* This is to make the logic below simpler. It doesn't make any other
* difference, since redirect_dir=on is only used for upper.
@@ -914,7 +931,7 @@ int ovl_fs_params_verify(const struct ov
if (config->metacopy && config->redirect_mode != OVL_REDIRECT_ON) {
if (set.metacopy && set.redirect) {
pr_err("conflicting options: metacopy=on,redirect_dir=%s\n",
- ovl_redirect_mode(config));
+ ovl_redirect_mode_name(redirect_opt));
return -EINVAL;
}
if (set.redirect) {
@@ -923,7 +940,7 @@ int ovl_fs_params_verify(const struct ov
* in this conflict.
*/
pr_info("disabling metacopy due to redirect_dir=%s\n",
- ovl_redirect_mode(config));
+ ovl_redirect_mode_name(redirect_opt));
config->metacopy = false;
} else {
/* Automatically enable redirect otherwise. */
@@ -990,7 +1007,7 @@ int ovl_fs_params_verify(const struct ov
if (set.redirect &&
config->redirect_mode != OVL_REDIRECT_NOFOLLOW) {
pr_err("conflicting options: userxattr,redirect_dir=%s\n",
- ovl_redirect_mode(config));
+ ovl_redirect_mode_name(redirect_opt));
return -EINVAL;
}
if (config->metacopy && set.metacopy) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0827/1005] ovl: return EIO if the lowerdata is missing
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (825 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0826/1005] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0828/1005] ovl: bump the impure dir version when linking a file with origin Greg Kroah-Hartman
` (171 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giuseppe Scrivano <giuseppe@scrivano.org>
commit 0d5e729c515f4ae4eacc179dbcf350d9b499a161 upstream.
The data of a metacopy file that redirects to a data-only layer is
looked up when the file is opened, and the error of the lookup is
returned as is. If the data file is missing, open() fails with ENOENT
even though the file is there and stat() works.
This can be an integrity problem when using composefs: a data file that
is changed or has the wrong fs-verity digest is reported with EIO, but
a missing one is not reported, the file just looks like it does not
exist, e.g. a configuration file that overrides the defaults.
Return EIO as it is already done in ovl_lookup() when no lower data is
found for a metacopy file. ENOMEM is not changed.
Fixes: 42dd69ae1af4 ("ovl: implement lazy lookup of lowerdata in data-only layers")
Cc: stable@vger.kernel.org
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/namei.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1046,6 +1046,14 @@ out:
out_err:
pr_warn_ratelimited("lazy lowerdata lookup failed (%pd2, err=%i)\n",
dentry, err);
+ /*
+ * The data of a metacopy file is missing or is not a regular file in
+ * the data-only layers: the layers are corrupted. Do not return the
+ * error of the lookup (e.g. ENOENT) to the caller, it would make the
+ * file look like it does not exist.
+ */
+ if (err != -ENOMEM)
+ err = -EIO;
goto out;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0828/1005] ovl: bump the impure dir version when linking a file with origin
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (826 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0827/1005] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0829/1005] ovl: do not allow nfs_export with data-only layers Greg Kroah-Hartman
` (170 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Daejun Park, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daejun Park <daejun7.park@samsung.com>
commit 86e2facd8630cc2fdec6ea80c53e370b26b441d9 upstream.
Linking a file with copy up origin into a non-merge impure dir does
not bump the dir version. readdir then reuses the impure dir cache
built before the link. It reports the upper inode number as d_ino of
the new link, not st_ino.
Pass whether the linked file has an origin to ovl_dir_modified(), as
rename and unlink do.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-98f207b6-3936-48e9-a40f-88f20be4db7b
Fixes: 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")
Cc: stable@vger.kernel.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/dir.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -368,7 +368,7 @@ static bool ovl_type_origin(struct dentr
}
static int ovl_create_upper(struct dentry *dentry, struct inode *inode,
- struct ovl_cattr *attr)
+ struct ovl_cattr *attr, bool origin)
{
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct dentry *upperdir = ovl_dentry_upper(dentry->d_parent);
@@ -393,7 +393,7 @@ static int ovl_create_upper(struct dentr
ovl_set_opaque(dentry, newdentry);
}
- ovl_dir_modified(dentry->d_parent, false);
+ ovl_dir_modified(dentry->d_parent, origin);
err = ovl_instantiate(dentry, inode, newdentry, !!attr->hardlink, NULL);
if (err)
goto out_cleanup;
@@ -491,7 +491,7 @@ static int ovl_set_upper_acl(struct ovl_
}
static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
- struct ovl_cattr *cattr)
+ struct ovl_cattr *cattr, bool origin)
{
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct dentry *workdir = ovl_workdir(dentry);
@@ -582,7 +582,7 @@ static int ovl_create_over_whiteout(stru
if (err)
goto out_cleanup_unlocked;
}
- ovl_dir_modified(dentry->d_parent, false);
+ ovl_dir_modified(dentry->d_parent, origin);
err = ovl_instantiate(dentry, inode, newdentry, hardlink, NULL);
if (err) {
ovl_cleanup(ofs, upperdir, newdentry);
@@ -647,12 +647,12 @@ DEFINE_CLASS(ovl_override_creator_creds,
static int ovl_create_handle_whiteouts(struct dentry *dentry,
struct inode *inode,
- struct ovl_cattr *attr)
+ struct ovl_cattr *attr, bool origin)
{
if (!ovl_dentry_is_whiteout(dentry))
- return ovl_create_upper(dentry, inode, attr);
+ return ovl_create_upper(dentry, inode, attr, origin);
- return ovl_create_over_whiteout(dentry, inode, attr);
+ return ovl_create_over_whiteout(dentry, inode, attr, origin);
}
static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
@@ -687,12 +687,14 @@ static int ovl_create_or_link(struct den
*/
if (attr->hardlink)
- return ovl_create_handle_whiteouts(dentry, inode, attr);
+ return ovl_create_handle_whiteouts(dentry, inode, attr,
+ origin);
scoped_class(ovl_override_creator_creds, cred, original_creds, dentry, inode, attr->mode) {
if (IS_ERR(cred))
return PTR_ERR(cred);
- return ovl_create_handle_whiteouts(dentry, inode, attr);
+ return ovl_create_handle_whiteouts(dentry, inode, attr,
+ origin);
}
}
return err;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0829/1005] ovl: do not allow nfs_export with data-only layers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (827 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0828/1005] ovl: bump the impure dir version when linking a file with origin Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0830/1005] ovl: do not check the deferred lowerdata redirect on index lookup Greg Kroah-Hartman
` (169 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
commit fba955b070d13e2fdac097577ce3c6ffbeda4ea9 upstream.
Since data-only layers no longer require metacopy=on, which conflicts
with nfs_export=on, an overlay with data-only layers can be mounted
with nfs_export=on.
Decoding a file handle of a lower metacopy file whose data is in a
data-only layer builds the inode only from the decoded lower dentry,
without the lazy lowerdata redirect, so the data of the file would be
read from the metacopy file in the lower layer.
Fail the mount with explicit nfs_export=on and data-only layers and
otherwise disable nfs_export with data-only layers.
Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect")
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/params.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -948,6 +948,16 @@ int ovl_fs_params_verify(const struct ov
}
}
+ /* Resolve nfs_export -> !data-only layers dependency */
+ if (config->nfs_export && ctx->nr_data) {
+ if (set.nfs_export) {
+ pr_err("NFS export is not supported with data-only layers\n");
+ return -EINVAL;
+ }
+ pr_info("disabling nfs_export due to data-only layers\n");
+ config->nfs_export = false;
+ }
+
/* Resolve nfs_export -> index dependency */
if (config->nfs_export && !config->index) {
if (!config->upperdir &&
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0830/1005] ovl: do not check the deferred lowerdata redirect on index lookup
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (828 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0829/1005] ovl: do not allow nfs_export with data-only layers Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0831/1005] ovl: follow lower to lowerdata redirects from any lower layer Greg Kroah-Hartman
` (168 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
commit 011f67b2b5c366679af023261ee02e284d534a96 upstream.
When a lower metacopy has an absolute redirect into a data-only layer,
ovl_lookup_layers() defers the data lookup and skips
ovl_check_follow_redirect(), but leaves the redirect in d->redirect.
If there is no upper dentry and a sibling hardlink was already copied
up to the index dir, the index branch calls ovl_check_follow_redirect()
again and, with redirect_dir=nofollow (e.g. forced by userxattr), fails
the lookup with -EPERM because of the lower data redirect.
Take the lowerdata redirect out of d->redirect at the point where the
data lookup is deferred, so that the index check only validates the
redirect and metacopy state of the index entry.
Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect")
Closes: https://sashiko.dev/#/bug/linux-29bea9ea-5376-4e54-88f6-04dabce4db70
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/overlayfs/namei.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -27,6 +27,7 @@ struct ovl_lookup_data {
bool last;
char *redirect;
char *upperredirect;
+ char *lowerdata_redirect;
int metacopy;
/* Referring to last redirect xattr */
bool absolute_redirect;
@@ -1258,6 +1259,8 @@ static int ovl_lookup_layers(struct ovl_
if (d->metacopy && ctx->ctr && ofs->numdatalayer && d->absolute_redirect) {
d->metacopy = 0;
ctx->ctr++;
+ d->lowerdata_redirect = d->redirect;
+ d->redirect = NULL;
} else if (!ovl_check_follow_redirect(d)) {
err = -EPERM;
return err;
@@ -1374,15 +1377,14 @@ static int ovl_lookup_layers(struct ovl_
};
/* Store lowerdata redirect for lazy lookup */
- if (ctx->ctr > 1 && !d->is_dir && !ctx->stack[ctx->ctr - 1].dentry)
- oip.lowerdata_redirect = d->redirect;
+ if (d->lowerdata_redirect)
+ oip.lowerdata_redirect = d->lowerdata_redirect;
inode = ovl_get_inode(dentry->d_sb, &oip);
if (IS_ERR(inode))
return PTR_ERR(inode);
- if (oip.lowerdata_redirect)
- d->redirect = NULL;
+ d->lowerdata_redirect = NULL;
ctx->inode = inode;
if (ctx->upperdentry && !uppermetacopy)
@@ -1435,6 +1437,7 @@ struct dentry *ovl_lookup(struct inode *
dput(ctx.index);
ovl_stack_free(ctx.stack, ctx.ctr);
kfree(d.redirect);
+ kfree(d.lowerdata_redirect);
if (err) {
ovl_free_entry(ctx.oe);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0831/1005] ovl: follow lower to lowerdata redirects from any lower layer
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (829 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0830/1005] ovl: do not check the deferred lowerdata redirect on index lookup Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0832/1005] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
` (167 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giuseppe Scrivano <giuseppe@scrivano.org>
commit cbf4ccabcbfdda3da70c10b37e21e99cd2ee0946 upstream.
Commit 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower
-> data redirect") allowed following redirects from a lower layer to a
data-only layer without redirect_dir=follow and metacopy=on, so that
data-only layers can be used with userxattr.
That fix was incomplete. Without metacopy=on, a metacopy file with an
absolute redirect into a data-only layer is followed only from the lowest
lower layer. From any other lower layer, the lookup fails with EPERM.
That commit also changed the behavior of redirect_dir=nofollow without
making it visible to users. With data-only layers, some redirects are
followed, although the mount options show redirect_dir=nofollow, or
show nothing when that is the default.
Add redirect_dir=followdata, which follows only redirects from lower to
lowerdata, and select it when there are data-only layers, unless
redirect_dir=follow or redirect_dir=on is in effect, so the redirect
follow mode in effect is shown in /proc/self/mountinfo.
Without metacopy=on, the absolute redirect of a lower metacopy file stops
the lookup in the lower layers and the data is looked up in the data-only
layers. Data-only layers cannot be used without following redirects,
so reject an explicit redirect_dir=nofollow with data-only layers.
Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect")
Cc: stable@vger.kernel.org
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/filesystems/overlayfs.rst | 24 ++++++++++-------
fs/overlayfs/namei.c | 24 ++++++++++++++---
fs/overlayfs/overlayfs.h | 15 +++++++++-
fs/overlayfs/params.c | 45 +++++++++++++++++++++++++-------
fs/overlayfs/params.h | 2 +
fs/overlayfs/super.c | 17 +++++++-----
6 files changed, 97 insertions(+), 30 deletions(-)
--- a/Documentation/filesystems/overlayfs.rst
+++ b/Documentation/filesystems/overlayfs.rst
@@ -236,14 +236,19 @@ Module options (can also be changed thro
Mount options:
- "redirect_dir=on":
- Redirects are enabled.
+ Redirects are created and followed.
- "redirect_dir=follow":
Redirects are not created, but followed.
+- "redirect_dir=followdata":
+ Redirects are not created.
+ Only redirects from lower to lowerdata are followed.
- "redirect_dir=nofollow":
Redirects are not created and not followed.
- "redirect_dir=off":
- If "redirect_always_follow" is enabled in the kernel/module config,
- this "off" translates to "follow", otherwise it translates to "nofollow".
+ Redirects are not created.
+ Which redirects are followed depends on "redirect_always_follow" in the
+ kernel/module config, on data-only lower layers and on the "userxattr"
+ mount option.
When the NFS export feature is enabled, every copied up directory is
indexed by the file handle of the lower inode and a file handle of the
@@ -418,8 +423,8 @@ pointed by REDIRECT. This should not be
"trusted." xattrs will require CAP_SYS_ADMIN. But it should be possible
for untrusted layers like from a pen drive.
-Note: redirect_dir={off|nofollow|follow[*]} and nfs_export=on mount options
-conflict with metacopy=on, and will result in an error.
+Note: redirect_dir={off|nofollow|followdata|follow[*]} and nfs_export=on
+mount options conflict with metacopy=on, and will result in an error.
[*] redirect_dir=follow only conflicts with metacopy=on if upperdir=... is
given.
@@ -460,10 +465,11 @@ to the absolute path of the "lower data"
Instead of explicitly enabling "metacopy=on" it is sufficient to specify at
least one data-only layer to enable redirection of data to a data-only layer.
-In this case other forms of metacopy are rejected. Note: this way, data-only
-layers may be used together with "userxattr", in which case careful attention
-must be given to privileges needed to change the "user.overlay.redirect" xattr
-to prevent misuse.
+In this case other forms of metacopy are rejected. A data-only layer selects
+"redirect_dir=followdata", unless "redirect_dir=follow" or "redirect_dir=on" is
+in effect. Note: this way, data-only layers may be used together with
+"userxattr", in which case careful attention must be given to privileges needed
+to change the "user.overlay.redirect" xattr to prevent misuse.
Since kernel version v6.8, "data-only" lower layers can also be added using
the "datadir+" mount options and the fsconfig syscall from new mount api.
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1087,7 +1087,8 @@ static bool ovl_check_follow_redirect(st
pr_warn_ratelimited("refusing to follow metacopy origin for (%pd2)\n", d->dentry);
return false;
}
- if ((d->redirect || d->upperredirect) && !ovl_redirect_follow(ofs)) {
+ /* Check follow to lower layer, redirects to lowerdata are not checked here */
+ if ((d->redirect || d->upperredirect) && !ovl_redirect_follow_lower(ofs)) {
pr_warn_ratelimited("refusing to follow redirect for (%pd2)\n", d->dentry);
return false;
}
@@ -1105,13 +1106,26 @@ struct ovl_lookup_ctx {
unsigned int ctr;
};
+/*
+ * Without metacopy=on, the absolute redirect of a lower metacopy file is
+ * followed only into the data-only layers.
+ */
+static bool ovl_is_lowerdata_redirect(struct ovl_lookup_ctx *ctx,
+ struct ovl_lookup_data *d)
+{
+ struct ovl_fs *ofs = OVL_FS(d->sb);
+
+ return ofs->numdatalayer && !ofs->config.metacopy && ctx->ctr &&
+ d->metacopy && d->absolute_redirect;
+}
+
static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data *d)
{
struct dentry *dentry = ctx->dentry;
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct ovl_entry *poe = OVL_E(dentry->d_parent);
struct ovl_entry *roe = OVL_E(dentry->d_sb->s_root);
- bool check_redirect = (ovl_redirect_follow(ofs) || ofs->numdatalayer);
+ bool check_redirect = ovl_redirect_follow(ofs);
struct dentry *upperdir;
struct dentry *this;
struct dentry *origin = NULL;
@@ -1242,6 +1256,10 @@ static int ovl_lookup_layers(struct ovl_
ctx->ctr++;
}
+ /* Lookup of lowerdata in the data-only layers only */
+ if (ovl_is_lowerdata_redirect(ctx, d))
+ d->stop = true;
+
if (d->stop)
break;
@@ -1412,7 +1430,7 @@ struct dentry *ovl_lookup(struct inode *
{
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct ovl_entry *poe = OVL_E(dentry->d_parent);
- bool check_redirect = (ovl_redirect_follow(ofs) || ofs->numdatalayer);
+ bool check_redirect = ovl_redirect_follow(ofs);
int err;
struct ovl_lookup_ctx ctx = {
.dentry = dentry,
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -75,11 +75,13 @@ enum ovl_entry_flag {
enum {
/*
- * "off" mode is never used after mount options are verified. In effect
- * it translates to either "follow" or "nofollow".
+ * "off" mode is never used after mount options are verified.
+ * In effect it translates to either "follow", "nofollow" or
+ * "followdata" (with data-only layers).
*/
OVL_REDIRECT_OFF,
OVL_REDIRECT_FOLLOW,
+ OVL_REDIRECT_FOLLOWDATA,
OVL_REDIRECT_NOFOLLOW,
OVL_REDIRECT_ON,
};
@@ -635,11 +637,20 @@ static inline char ovl_get_opaquedir_val
return ovl_get_dir_xattr_val(ofs, path, OVL_XATTR_OPAQUE);
}
+/* Are redirects followed into lower layers? */
+static inline bool ovl_redirect_follow_lower(struct ovl_fs *ofs)
+{
+ return ofs->config.redirect_mode == OVL_REDIRECT_FOLLOW ||
+ ofs->config.redirect_mode == OVL_REDIRECT_ON;
+}
+
+/* Are redirects followed into lower or lowerdata layers? */
static inline bool ovl_redirect_follow(struct ovl_fs *ofs)
{
return ofs->config.redirect_mode != OVL_REDIRECT_NOFOLLOW;
}
+/* Are redirects created in upper dir? */
static inline bool ovl_redirect_dir(struct ovl_fs *ofs)
{
return ofs->config.redirect_mode == OVL_REDIRECT_ON;
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -107,6 +107,7 @@ static int ovl_xino_def(void)
const struct constant_table ovl_parameter_redirect_dir[] = {
{ "off", OVL_REDIRECT_OFF },
{ "follow", OVL_REDIRECT_FOLLOW },
+ { "followdata", OVL_REDIRECT_FOLLOWDATA },
{ "nofollow", OVL_REDIRECT_NOFOLLOW },
{ "on", OVL_REDIRECT_ON },
{}
@@ -117,21 +118,29 @@ static const char *ovl_redirect_mode_nam
return ovl_parameter_redirect_dir[redirect_mode].name;
}
-static const char *ovl_redirect_mode(struct ovl_config *config)
+const char *ovl_redirect_mode(struct ovl_config *config)
{
return ovl_redirect_mode_name(config->redirect_mode);
}
-static int ovl_redirect_follow_mode(void)
+int ovl_redirect_follow_mode(bool follow_lower, size_t nr_data)
{
- return ovl_redirect_always_follow ? OVL_REDIRECT_FOLLOW :
- OVL_REDIRECT_NOFOLLOW;
+ if (ovl_redirect_always_follow && follow_lower)
+ return OVL_REDIRECT_FOLLOW;
+
+ /* Data-only layers cannot be used without following redirects to them */
+ return nr_data ? OVL_REDIRECT_FOLLOWDATA : OVL_REDIRECT_NOFOLLOW;
}
+/*
+ * The default for show_options() is resolved as if there are no data-only layers,
+ * so that redirect_dir=followdata, which is auto selected with data-only layers,
+ * is displayed in mount options.
+ */
static int ovl_redirect_mode_def(void)
{
return ovl_redirect_dir_def ? OVL_REDIRECT_ON :
- ovl_redirect_follow_mode();
+ ovl_redirect_follow_mode(true, 0);
}
static const struct constant_table ovl_parameter_verity[] = {
@@ -890,6 +899,9 @@ int ovl_fs_params_verify(const struct ov
struct ovl_opt_set set = ctx->set;
/* The requested redirect_dir=, for reporting conflicts with it */
int redirect_opt = config->redirect_mode;
+ /* The redirect follow mode for redirect_dir=off and for the default */
+ int follow_mode = ovl_redirect_follow_mode(!config->userxattr,
+ ctx->nr_data);
/* Workdir/index are useless in non-upper mount */
if (!config->upperdir) {
@@ -916,9 +928,12 @@ int ovl_fs_params_verify(const struct ov
config->uuid = OVL_UUID_NULL;
}
- /* Resolve redirect_dir=off to the default redirect follow mode */
+ /*
+ * Resolve redirect_dir=off to the default redirect follow mode.
+ * With userxattr, redirects are not followed to lower by default.
+ */
if (config->redirect_mode == OVL_REDIRECT_OFF)
- config->redirect_mode = ovl_redirect_follow_mode();
+ config->redirect_mode = follow_mode;
/*
* This is to make the logic below simpler. It doesn't make any other
@@ -1015,7 +1030,8 @@ int ovl_fs_params_verify(const struct ov
/* Resolve userxattr -> !redirect && !metacopy dependency */
if (config->userxattr) {
if (set.redirect &&
- config->redirect_mode != OVL_REDIRECT_NOFOLLOW) {
+ config->redirect_mode != OVL_REDIRECT_NOFOLLOW &&
+ config->redirect_mode != OVL_REDIRECT_FOLLOWDATA) {
pr_err("conflicting options: userxattr,redirect_dir=%s\n",
ovl_redirect_mode_name(redirect_opt));
return -EINVAL;
@@ -1030,10 +1046,21 @@ int ovl_fs_params_verify(const struct ov
* options must be explicitly enabled if used together with
* userxattr.
*/
- config->redirect_mode = OVL_REDIRECT_NOFOLLOW;
+ if (!set.redirect)
+ config->redirect_mode = follow_mode;
config->metacopy = false;
}
+ /* Data-only layers are reached through redirects */
+ if (ctx->nr_data && config->redirect_mode == OVL_REDIRECT_NOFOLLOW) {
+ pr_err("redirect_dir=nofollow is not supported with data-only layers\n");
+ return -EINVAL;
+ }
+ if (!ctx->nr_data && config->redirect_mode == OVL_REDIRECT_FOLLOWDATA) {
+ pr_err("redirect_dir=followdata requires data-only layers\n");
+ return -EINVAL;
+ }
+
/*
* Fail if we don't have trusted xattr capability and a feature was
* explicitly requested that requires them.
--- a/fs/overlayfs/params.h
+++ b/fs/overlayfs/params.h
@@ -42,3 +42,5 @@ int ovl_fs_params_verify(const struct ov
struct ovl_config *config);
int ovl_show_options(struct seq_file *m, struct dentry *dentry);
const char *ovl_xino_mode(struct ovl_config *config);
+const char *ovl_redirect_mode(struct ovl_config *config);
+int ovl_redirect_follow_mode(bool follow_lower, size_t nr_data);
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -680,7 +680,7 @@ static int ovl_create_volatile_dirty(str
}
static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
- const struct path *workpath)
+ const struct path *workpath, size_t nr_data)
{
struct vfsmount *mnt = ovl_upper_mnt(ofs);
struct dentry *workdir;
@@ -744,9 +744,11 @@ static int ovl_make_workdir(struct super
if (err) {
pr_warn("failed to set xattr on upper\n");
ofs->noxattr = true;
- if (ovl_redirect_follow(ofs)) {
- ofs->config.redirect_mode = OVL_REDIRECT_NOFOLLOW;
- pr_warn("...falling back to redirect_dir=nofollow.\n");
+ if (ovl_redirect_follow_lower(ofs)) {
+ ofs->config.redirect_mode =
+ ovl_redirect_follow_mode(false, nr_data);
+ pr_warn("...falling back to redirect_dir=%s.\n",
+ ovl_redirect_mode(&ofs->config));
}
if (ofs->config.metacopy) {
ofs->config.metacopy = false;
@@ -823,7 +825,7 @@ out:
static int ovl_get_workdir(struct super_block *sb, struct ovl_fs *ofs,
const struct path *upperpath,
- const struct path *workpath)
+ const struct path *workpath, size_t nr_data)
{
int err;
@@ -852,7 +854,7 @@ static int ovl_get_workdir(struct super_
if (err)
return err;
- return ovl_make_workdir(sb, ofs, workpath);
+ return ovl_make_workdir(sb, ofs, workpath, nr_data);
}
static int ovl_get_indexdir(struct super_block *sb, struct ovl_fs *ofs,
@@ -1487,7 +1489,8 @@ static int ovl_fill_super_creds(struct f
}
}
- err = ovl_get_workdir(sb, ofs, &ctx->upper, &ctx->work);
+ err = ovl_get_workdir(sb, ofs, &ctx->upper, &ctx->work,
+ ctx->nr_data);
if (err)
return err;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0832/1005] smb: client: bound invalid NTLMSSP signature diagnostic
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (830 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0831/1005] ovl: follow lower to lowerdata redirects from any lower layer Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0833/1005] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
` (166 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Yifan Zhang,
Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
commit 0584b02669c3e76188097174b4f25ed13723e94c upstream.
The NTLMSSP Signature field is an eight-byte binary value and need not be
NUL-terminated. decode_ntlmssp_challenge() prints it with %s on the
signature-mismatch path, so the diagnostic can continue beyond the received
blob until it encounters a zero byte.
KASAN reports:
BUG: KASAN: slab-out-of-bounds in string
Read of size 1
string
vsnprintf
_printk
decode_ntlmssp_challenge
Print the fixed-width field with the bounded hexadecimal format.
The patched kernel reaches the invalid-signature path and returns -EINVAL
without a KASAN report.
Fixes: 0b3cc858003b ("[CIFS] NTLMSSP reenabled after move from connect.c to sess.c")
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Yifan Zhang <yfzhang23@stu.pku.edu.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/sess.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/smb/client/sess.c
+++ b/fs/smb/client/sess.c
@@ -666,8 +666,8 @@ int decode_ntlmssp_challenge(char *bcc_p
}
if (memcmp(pblob->Signature, "NTLMSSP", 8)) {
- cifs_dbg(VFS, "blob signature incorrect %s\n",
- pblob->Signature);
+ cifs_dbg(VFS, "%s: blob signature incorrect: %8phN\n",
+ __func__, pblob->Signature);
return -EINVAL;
}
if (pblob->MessageType != NtLmChallenge) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0833/1005] smb: client: compare owner and group SIDs using their encoded lengths
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (831 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0832/1005] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0834/1005] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
` (165 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, liuyong, Namjae Jeon,
Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: liuyong <pkfxxxing@gmail.com>
commit a2dabe73ea05ad3b3f8e1cc08fb2e7c2ddc5564b upstream.
populate_new_aces() compares owner and group SIDs over sizeof(struct
smb_sid), including storage for all 15 possible subauthorities. Received
SIDs contain only their encoded subauthorities. The comparison can read
past the security descriptor, as shown by the supplied KASAN report for
a 44-byte descriptor during chmod.
The input SIDs have already been checked by sid_from_sd(). Require equal
subauthority counts, then compare only the fixed SID header and the
encoded subauthorities with memcmp(). The count check ensures that both
validated SIDs contain the number of bytes being compared.
These issues were discovered and fixed by Qihoo 360's Tulongfeng
multi-agent system.
Fixes: 0f22053e811c ("cifs: Fix unix perm bits to cifsacl conversion for "other" bits.")
Cc: stable@vger.kernel.org
Signed-off-by: liuyong <pkfxxxing@gmail.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsacl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/fs/smb/client/cifsacl.c
+++ b/fs/smb/client/cifsacl.c
@@ -1134,7 +1134,10 @@ static void populate_new_aces(char *nacl
* updated in the inode.
*/
- if (!memcmp(pownersid, pgrpsid, sizeof(struct smb_sid))) {
+ if (pownersid->num_subauth == pgrpsid->num_subauth &&
+ !memcmp(pownersid, pgrpsid,
+ CIFS_SID_BASE_SIZE +
+ pownersid->num_subauth * sizeof(__le32))) {
/*
* Case when owner and group SIDs are the same.
* Set the more restrictive of the two modes.
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0834/1005] smb: client: dont block dying tasks waiting for writeback on close
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (832 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0833/1005] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0835/1005] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
` (164 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 15ea186abbcd04157c62e0901701870b812bb2bd upstream.
cifs_flush() waits uninterruptibly for the writeback it starts. A task
that gets killed while closing a file on a hard mount with an
unresponsive server is stuck in D state until the server comes back. It
also consumes any writeback error for a caller that is about to exit,
hiding it from everyone else.
Wait killably instead. If the closer gets killed, stop waiting and leave
the error bits in the mapping for others to see; writeback already in
flight completes on its own. Don't wait at all, nor check for errors,
if it is already dying.
This is also needed before letting dying tasks issue their writes from a
worker, which would otherwise make them wait for every one of them.
Fixes: d3f1322af8f8 ("cifs: wait for writeback to complete in cifs_flush")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -2955,17 +2955,44 @@ fsync_exit:
return rc;
}
+static int cifs_wait_writeback_killable(struct address_space *mapping)
+{
+ struct folio_batch fbatch;
+ pgoff_t index = 0;
+ int rc = 0;
+
+ folio_batch_init(&fbatch);
+ while (!rc &&
+ filemap_get_folios_tag(mapping, &index, (pgoff_t)-1,
+ PAGECACHE_TAG_WRITEBACK, &fbatch)) {
+ for (unsigned int i = 0;
+ !rc && i < folio_batch_count(&fbatch); i++)
+ rc = folio_wait_writeback_killable(fbatch.folios[i]);
+ folio_batch_release(&fbatch);
+ cond_resched();
+ }
+ return rc;
+}
+
/*
* As file closes, flush all cached write data for this inode checking
* for write behind errors.
*/
int cifs_flush(struct file *file, fl_owner_t id)
{
+ struct address_space *mapping = file->f_mapping;
struct inode *inode = file_inode(file);
- int rc = 0;
+ int rc = 0, rc2;
- if (file->f_mode & FMODE_WRITE)
- rc = filemap_write_and_wait(inode->i_mapping);
+ if (file->f_mode & FMODE_WRITE) {
+ rc = filemap_fdatawrite(mapping);
+ if (fatal_signal_pending(current) ||
+ cifs_wait_writeback_killable(mapping))
+ return 0;
+ rc2 = filemap_check_errors(mapping);
+ if (!rc)
+ rc = rc2;
+ }
cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
if (rc) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0835/1005] smb: client: dont block dying tasks waiting for writeback on fsync
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (833 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0834/1005] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0836/1005] smb: client: fix double conversion of DFS path in setup_dfs_ref() Greg Kroah-Hartman
` (163 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara, David Howells
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 0df0f24803061b6c2bef0d24de7c63c9cce46a49 upstream.
cifs_fsync() and cifs_strict_fsync() wait uninterruptibly for writeback
through file_write_and_wait_range(). As with close, a task killed in
fsync(2) on a hard mount with an unresponsive server is stuck in D state
until the server comes back.
Wait killably instead, using the same helper as cifs_flush(). The
writeback keeps going and its errors stay in the mapping; only the dying
caller stops waiting for it.
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 64 +++++++++++++++++++++++++++++++++------------------
1 file changed, 42 insertions(+), 22 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -2877,6 +2877,45 @@ cifs_get_readable_path(struct cifs_tcon
return -ENOENT;
}
+static int cifs_wait_writeback_killable(struct address_space *mapping,
+ loff_t start, loff_t end)
+{
+ pgoff_t end_index = end >> PAGE_SHIFT;
+ pgoff_t index = start >> PAGE_SHIFT;
+ struct folio_batch fbatch;
+ int rc = 0;
+
+ folio_batch_init(&fbatch);
+ while (!rc &&
+ filemap_get_folios_tag(mapping, &index, end_index,
+ PAGECACHE_TAG_WRITEBACK, &fbatch)) {
+ for (unsigned int i = 0;
+ !rc && i < folio_batch_count(&fbatch); i++)
+ rc = folio_wait_writeback_killable(fbatch.folios[i]);
+ folio_batch_release(&fbatch);
+ cond_resched();
+ }
+ return rc;
+}
+
+static int cifs_file_write_and_wait_killable(struct file *file,
+ loff_t start, loff_t end)
+{
+ struct address_space *mapping = file->f_mapping;
+ int rc, rc2;
+
+ if (end < start)
+ return 0;
+
+ rc = filemap_fdatawrite_range(mapping, start, end);
+ if (cifs_wait_writeback_killable(mapping, start, end))
+ return -EINTR;
+ rc2 = file_check_and_advance_wb_err(file);
+ if (!rc)
+ rc = rc2;
+ return rc;
+}
+
/*
* Flush data on a strict file.
*/
@@ -2888,7 +2927,7 @@ int cifs_strict_fsync(struct file *file,
unsigned int xid;
int rc;
- rc = file_write_and_wait_range(file, start, end);
+ rc = cifs_file_write_and_wait_killable(file, start, end);
if (rc) {
trace_cifs_fsync_err(inode->i_ino, rc);
return rc;
@@ -2920,7 +2959,7 @@ int cifs_fsync(struct file *file, loff_t
struct inode *inode = file_inode(file);
struct cifs_sb_info *cifs_sb = CIFS_SB(file);
- rc = file_write_and_wait_range(file, start, end);
+ rc = cifs_file_write_and_wait_killable(file, start, end);
if (rc) {
trace_cifs_fsync_err(file_inode(file)->i_ino, rc);
return rc;
@@ -2955,25 +2994,6 @@ fsync_exit:
return rc;
}
-static int cifs_wait_writeback_killable(struct address_space *mapping)
-{
- struct folio_batch fbatch;
- pgoff_t index = 0;
- int rc = 0;
-
- folio_batch_init(&fbatch);
- while (!rc &&
- filemap_get_folios_tag(mapping, &index, (pgoff_t)-1,
- PAGECACHE_TAG_WRITEBACK, &fbatch)) {
- for (unsigned int i = 0;
- !rc && i < folio_batch_count(&fbatch); i++)
- rc = folio_wait_writeback_killable(fbatch.folios[i]);
- folio_batch_release(&fbatch);
- cond_resched();
- }
- return rc;
-}
-
/*
* As file closes, flush all cached write data for this inode checking
* for write behind errors.
@@ -2987,7 +3007,7 @@ int cifs_flush(struct file *file, fl_own
if (file->f_mode & FMODE_WRITE) {
rc = filemap_fdatawrite(mapping);
if (fatal_signal_pending(current) ||
- cifs_wait_writeback_killable(mapping))
+ cifs_wait_writeback_killable(mapping, 0, LLONG_MAX))
return 0;
rc2 = filemap_check_errors(mapping);
if (!rc)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0836/1005] smb: client: fix double conversion of DFS path in setup_dfs_ref()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (834 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0835/1005] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0837/1005] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption Greg Kroah-Hartman
` (162 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fredric Cover, Namjae Jeon,
Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fredric Cover <fredric.cover.lkernel@gmail.com>
commit 92509ce64ffff02d05fe9f3c82b889e1cc500076 upstream.
setup_dfs_ref() converts the path from the mount charset to the DFS
cache charset (utf8) via dfs_get_path(), and then passes that already
converted string to dfs_get_referral(). dfs_cache_find() converts its
input again, assuming it is still in the mount charset.
When the mount charset is not utf8 (iocharset=iso8859-1, or a kernel
built with a non-utf8 CONFIG_NLS_DEFAULT) and the DFS path contains
non-ASCII characters, the utf8 bytes are interpreted as mount-charset
characters and encoded a second time. For example, "é" is sent as
c3 83 c2 a9 instead of c3 a9. The server then fails the second-level
referral with STATUS_OBJECT_PATH_NOT_FOUND and the mount fails with
-ENOENT, even though the path exists.
Pass the unconverted path to dfs_get_referral() so that it is converted
exactly once.
Such mounts now get past the second-level referral and reach
dfs_parse_target_referral(), which is why this change depends on
"smb: client: fix out-of-bounds read in dfs_parse_target_referral()".
Tested with a Samba DFS root containing a link named "café", mounted
with iocharset=iso8859-1 and the single Latin-1 byte 0xe9 in the path:
before, the mount failed with -ENOENT; with both patches applied, it
succeeds.
Signed-off-by: Fredric Cover <fredric.cover.lkernel@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/dfs.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/fs/smb/client/dfs.c
+++ b/fs/smb/client/dfs.c
@@ -103,6 +103,7 @@ static int setup_dfs_ref(struct dfs_info
struct cifs_sb_info *cifs_sb = rw->mnt_ctx->cifs_sb;
struct smb3_fs_context *ctx = rw->mnt_ctx->fs_ctx;
char *ref_path, *full_path;
+ const char *raw_path;
int rc;
set_root_smb_session(rw->mnt_ctx);
@@ -114,9 +115,10 @@ static int setup_dfs_ref(struct dfs_info
if (!tgt || (tgt->server_type == DFS_TYPE_LINK &&
DFS_INTERLINK(tgt->flags)))
- ref_path = dfs_get_path(cifs_sb, ctx->UNC);
+ raw_path = ctx->UNC;
else
- ref_path = dfs_get_path(cifs_sb, full_path);
+ raw_path = full_path;
+ ref_path = dfs_get_path(cifs_sb, raw_path);
if (IS_ERR(ref_path)) {
rc = PTR_ERR(ref_path);
kfree(full_path);
@@ -125,9 +127,7 @@ static int setup_dfs_ref(struct dfs_info
ref_walk_path(rw) = ref_path;
ref_walk_fpath(rw) = full_path;
- return dfs_get_referral(rw->mnt_ctx,
- ref_walk_path(rw) + 1,
- ref_walk_tl(rw));
+ return dfs_get_referral(rw->mnt_ctx, raw_path + 1, ref_walk_tl(rw));
}
static int __dfs_referral_walk(struct dfs_ref_walk *rw)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0837/1005] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (835 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0836/1005] smb: client: fix double conversion of DFS path in setup_dfs_ref() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0838/1005] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
` (161 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Namjae Jeon,
Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Misiurov <andrey.misyrov@gmail.com>
commit 73a0060cb22a1d2bd8bff364c18a4259ec0cb528 upstream.
On an encrypted ("seal") mount, SMB2_ioctl_init() keeps the IOCTL input
in a separate iov (iov[1]); iov[0] is a 448-byte buffer from
cifs_small_buf_get(). When such an IOCTL is not the last request of a
compound, smb2_set_next_command() pads it for alignment by copying the
whole request into iov[0]. A large enough input overflows that 448-byte
buffer and corrupts the slab; the copy also sets rq_nvec to 1, so the
input buffer is leaked too.
An unprivileged user can trigger it by creating a symlink with a long
target on such a mount: the native symlink is sent as
FSCTL_SET_REPARSE_POINT + QUERY_INFO + CLOSE in one compound, so the
IOCTL is not the last request.
With slub_debug red zones on the cifs_small_rq cache, the overflow is
caught on the next allocation from that cache in the same compound (the
0x61 bytes are the 'a' characters of the symlink target):
BUG cifs_small_rq (Not tainted): Object corrupt
[Left Redzone overwritten] 0xffff8a59c7790500-0xffff8a59c779053f
First byte 0x61 instead of 0xbb
Call Trace:
check_object+0x1a8/0x350
alloc_debug_processing+0xab/0x110
___slab_alloc+0x7e/0x2f0
kmem_cache_alloc_noprof+0x28d/0x4b0
mempool_alloc_slab+0x16/0x30
cifs_small_buf_get+0x1a/0x30 [cifs]
SMB2_close_init+0x8a/0x100 [cifs]
smb2_compound_op+0x2571/0x2b50 [cifs]
smb2_create_reparse_inode+0x27e/0x490 [cifs]
mknod_nfs+0x1ce/0x2e0 [cifs]
create_reparse_symlink+0x119/0x180 [cifs]
cifs_symlink+0x19f/0x8e0 [cifs]
vfs_symlink+0xa3/0x1b0
__x64_sys_symlink+0x41/0x70
Pad the input to a multiple of 8 bytes when encryption is required. The
request is then already aligned and smb2_set_next_command() no longer
copies it; InputCount still carries the real length.
Fixes: 90f7c100d2dd ("smb: client: fix compound alignment with encryption")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Misiurov <andrey.misyrov@gmail.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2pdu.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -3453,11 +3453,12 @@ SMB2_ioctl_init(struct cifs_tcon *tcon,
char *in_data, u32 indatalen,
__u32 max_response_size)
{
- struct smb2_ioctl_req *req;
struct kvec *iov = rqst->rq_iov;
+ struct smb2_ioctl_req *req;
+ u32 in_buf_len = indatalen;
unsigned int total_len;
- int rc;
char *in_data_buf;
+ int rc;
rc = smb2_ioctl_req_init(opcode, tcon, server,
(void **) &req, &total_len);
@@ -3465,15 +3466,18 @@ SMB2_ioctl_init(struct cifs_tcon *tcon,
return rc;
if (indatalen) {
+ if (smb3_encryption_required(tcon))
+ in_buf_len = ALIGN(indatalen, 8);
/*
* indatalen is usually small at a couple of bytes max, so
* just allocate through generic pool
*/
- in_data_buf = kmemdup(in_data, indatalen, GFP_NOFS);
+ in_data_buf = kzalloc(in_buf_len, GFP_NOFS);
if (!in_data_buf) {
cifs_small_buf_release(req);
return -ENOMEM;
}
+ memcpy(in_data_buf, in_data, indatalen);
}
req->CtlCode = cpu_to_le32(opcode);
@@ -3497,7 +3501,7 @@ SMB2_ioctl_init(struct cifs_tcon *tcon,
rqst->rq_nvec = 2;
iov[0].iov_len = total_len - 1;
iov[1].iov_base = in_data_buf;
- iov[1].iov_len = indatalen;
+ iov[1].iov_len = in_buf_len;
} else {
rqst->rq_nvec = 1;
iov[0].iov_len = total_len;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0838/1005] smb: client: fix out-of-bounds read in dfs_parse_target_referral()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (836 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0837/1005] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0839/1005] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
` (160 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fredric Cover, Namjae Jeon,
Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fredric Cover <fredric.cover.lkernel@gmail.com>
commit 86aacc2f3f6ba18e1d87feee24f37c94b3ce863a upstream.
dfs_parse_target_referral() decides whether a prefix path remains after
the consumed part of full_path with:
if (strlen(full_path) - ref->path_consumed)
strlen() returns size_t, so if path_consumed is larger than the length
of full_path, the subtraction wraps around to a huge non-zero value.
The branch is then taken, prepath is set to a pointer past the
terminating NUL of full_path, and *prepath reads out of bounds.
path_consumed can exceed strlen(full_path) when the mount charset is
not utf8. The referral code derives path_consumed from the canonical
path, which is in the DFS cache charset (utf8), but it is applied here
to full_path, which is in the mount charset. Each non-ASCII character
in the consumed part of the path that is longer in utf8 than in the
mount charset makes the count too large by the difference.
This was reproduced with iocharset=iso8859-1 against a Samba DFS root
containing a link named "café", mounting with the single Latin-1 byte
0xe9 in the path. On an unmodified tree such a mount fails earlier
with -ENOENT because the path is converted to utf8 twice in
setup_dfs_ref(); with that fixed ("smb: client: fix double conversion
of DFS path in setup_dfs_ref()"), the mount reaches this code.
full_path was 29 bytes while path_consumed was 30:
BUG: KASAN: slab-out-of-bounds in dfs_parse_target_referral+0x26a/0x270
Read of size 1 at addr ffff88810db89d5f by task mount/1743
...
The buggy address is located 0 bytes to the right of
allocated 31-byte region [ffff88810db89d40, ffff88810db89d5f)
Compare path_consumed against the string length instead of subtracting,
so that no prefix path is used when the consumed count covers the whole
string. With the bounds check in place the same mount succeeds and no
KASAN report is produced.
This only prevents the out-of-bounds access. path_consumed is still in
the wrong units, so a non-ASCII link followed by a path component can
still produce a wrong prefix path. That needs a separate fix.
Signed-off-by: Fredric Cover <fredric.cover.lkernel@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/dfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/smb/client/dfs.c
+++ b/fs/smb/client/dfs.c
@@ -33,7 +33,7 @@ int dfs_parse_target_referral(const char
if (WARN_ON_ONCE(!ref->node_name || ref->path_consumed < 0))
return -EINVAL;
- if (strlen(full_path) - ref->path_consumed) {
+ if ((size_t)ref->path_consumed < strlen(full_path)) {
prepath = full_path + ref->path_consumed;
/* skip initial delimiter */
if (*prepath == '/' || *prepath == '\\')
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0839/1005] smb: client: flush deferred handles of other names before a hard link open
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (837 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0838/1005] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0840/1005] smb: client: hold server ref while queueing reconnect work Greg Kroah-Hartman
` (159 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli, Namjae Jeon,
Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 25912ed3b75dcf5ff623dcb549b925dd0d0948f7 upstream.
Opening a hard link of a file whose other name still holds a deferred,
leased handle fails with EINVAL over SMB3. The client caches lease keys
per inode, but the server ties a lease to the file name it was granted
under, so reusing the inode's lease key to open a different name of the
same inode is rejected with STATUS_INVALID_PARAMETER (MS-SMB2 3.3.5.9.11).
Commit 262b73ef442e ("smb3 client: fix open hardlink on deferred close
file error") already closes the inode's deferred handles before such an
open so the new name can take a fresh lease, but cifs_get_hardlink_path()
only triggered that flush when a cached handle had the same open flags as
the new open, so a differently accessed name - written then read, say -
slipped through and still failed.
Match on the name instead: flush when a cached handle for another name of
the inode is open, regardless of access mode.
Reported-by: Giuseppe Piscitelli <ooonea@gmail.com>
Closes: https://lore.kernel.org/r/CACmoRBbDZR3eyEM65j73sWMS7A=T89z1QAvCP=+u0WGzZhwW6g@mail.gmail.com
Fixes: 262b73ef442e ("smb3 client: fix open hardlink on deferred close file error")
Cc: stable@vger.kernel.org
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -2232,7 +2232,7 @@ cifs_get_hardlink_path(struct cifs_tcon
spin_lock(&cinode->open_file_lock);
list_for_each_entry(open_file, &cinode->openFileList, flist) {
- if (file->f_flags == open_file->f_flags) {
+ if (open_file->dentry != file_dentry(file)) {
rc = -EINVAL;
break;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0840/1005] smb: client: hold server ref while queueing reconnect work
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (838 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0839/1005] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0841/1005] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
` (158 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
commit f02d249e9756b78990aaaa1635e47e06deb2cb51 upstream.
When query_server_interfaces() returns -EOPNOTSUPP on a secondary
channel, smb2_reconnect() calls smb3_update_ses_channels() which for a
channel runs cifs_chan_skip_or_disable(). That clears the channel's
slot in the session and calls cifs_put_tcp_session(), which can drop
the last reference of the channel and tear it down.
smb2_reconnect() then falls through to skip_add_channels and queues
reconnect work on that server, using a server that may already be
freed. The send path obtained the channel from cifs_pick_channel(),
which does not take a reference, so the session's channel reference is
the only one.
Take our own reference on the channel before calling
smb3_update_ses_channels() and drop it after the reconnect work has
been queued, so the channel cannot be freed while it is still used.
Fixes: f591062bdbf4 ("cifs: handle servers that still advertise multichannel after disabling")
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2pdu.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -250,9 +250,10 @@ static int
smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
struct TCP_Server_Info *server, bool from_reconnect)
{
+ bool hold_server_ref = false;
struct cifs_ses *ses;
- int xid;
int rc = 0;
+ int xid;
/*
* SMB2s NegProt, SessSetup, Logoff do not have tcon yet so
@@ -470,6 +471,20 @@ skip_sess_setup:
* treat this as server not supporting multichannel
*/
+ /*
+ * If server is a secondary channel,
+ * cifs_chan_skip_or_disable() called below may
+ * drop its last reference, so hold our own
+ * reference until the reconnect work below has
+ * been queued.
+ */
+ spin_lock(&cifs_tcp_ses_lock);
+ if (server->srv_count) {
+ server->srv_count++;
+ hold_server_ref = true;
+ }
+ spin_unlock(&cifs_tcp_ses_lock);
+
rc = smb3_update_ses_channels(ses, server,
from_reconnect,
true /* disable_mchan */);
@@ -498,6 +513,8 @@ skip_add_channels:
if (smb2_command != SMB2_INTERNAL_CMD)
cifs_queue_server_reconn(server);
+ if (hold_server_ref)
+ cifs_put_tcp_session(server, from_reconnect);
atomic_inc(&tconInfoReconnectCount);
out:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0841/1005] smb: client: hold the inode across cifs_oplock_break()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (839 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0840/1005] smb: client: hold server ref while queueing reconnect work Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0842/1005] smb: client: issue writes from a worker if the task is dying Greg Kroah-Hartman
` (157 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
commit fce78321f1b59531cf6fc94860550db1db8dec55 upstream.
cifs_oplock_break() drops the handle reference in the middle of the
handler and keeps using cinode afterwards, to send the break
acknowledgment and again in cifs_done_oplock_break(). The reference
cifs_queue_oplock_break() takes is the only pin: the handle holds the
dentry and the dentry is what keeps the inode alive.
When that put is the last reference, the dput() in
cifsFileInfo_put_final() kills an unhashed dentry, drops the last
i_count and evicts the inode, so the rest of the handler runs on an
object whose free is only RCU-deferred. An unhashed dentry that a
handle still references is an ordinary state: unlinking an open file
leaves the dentry that way, and so does the dcache teardown at unmount.
Take a reference on the inode for the lifetime of the handler and drop
it once the break has been reported. This also covers the
cifs_get_tlink() failure path, where the put is followed directly by
the out label.
Fixes: b98749cac4a6 ("CIFS: keep FileInfo handle live during oplock break")
Fixes: 23b26f4408ac ("smb: client: avoid leaking refcount when cifs_sb_tlink() fails")
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -3401,6 +3401,14 @@ void cifs_oplock_break(struct work_struc
__u64 persistent_fid, volatile_fid;
__u16 net_fid;
+ /*
+ * Dropping the handle reference below also drops the dentry
+ * reference that pins this inode, and cinode is still needed to
+ * acknowledge the break and to report it as complete. Hold the inode
+ * until that is done.
+ */
+ ihold(inode);
+
wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS,
TASK_UNINTERRUPTIBLE);
@@ -3488,6 +3496,7 @@ oplock_break_ack:
cifs_put_tlink(tlink);
out:
cifs_done_oplock_break(cinode);
+ iput(inode);
}
#ifdef CONFIG_SWAP
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0842/1005] smb: client: issue writes from a worker if the task is dying
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (840 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0841/1005] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0843/1005] smb: client: let umount -f abort retried reads and writes Greg Kroah-Hartman
` (156 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 1a747bacf250959703c68fed1bb643f888dd3ad2 upstream.
A task with a fatal signal pending can't send on the socket:
__smb_send_rqst() refuses it upfront with -ERESTARTSYS, as SIGKILL can't
be blocked and a send interrupted halfway forces a reconnect. Writeback,
however, runs in the context of whoever starts it, so when a dying task
flushes dirty pages - close() racing with SIGKILL, or fd teardown during
exit_group() - every write subrequest gets refused:
smb3_write_err: ... offset=0x1400000 len=0x400000 rc=-512
cifs_flush_err: ino=... rc=-512
Since the switch to netfslib, a failed upload ends writeback with the
folios clean, so the data is silently lost: the server ends up with
20MiB of a 64MiB file while stat(2) reports the full size.
Issue writeback subrequests of dying tasks from a new cifswritebackd
workqueue instead, like afs does for all of its writes, so they get sent
from a context with no signals. Leave direct and unbuffered writes
alone, as their callers get the error. Use a dedicated WQ_UNBOUND
workqueue as the writes may block for long on credits, sends or reopens,
e.g. on hard mounts with an unresponsive server, and must not hold up
other cifs work such as reconnects, nor starve the WQ_MEM_RECLAIM
rescuer of cifsiod_wq.
Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsfs.c | 13 ++++++++++++-
fs/smb/client/cifsglob.h | 1 +
fs/smb/client/file.c | 26 +++++++++++++++++++++++++-
3 files changed, 38 insertions(+), 2 deletions(-)
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -165,6 +165,7 @@ struct workqueue_struct *cifsoplockd_wq;
struct workqueue_struct *deferredclose_wq;
struct workqueue_struct *serverclose_wq;
struct workqueue_struct *cfid_put_wq;
+struct workqueue_struct *cifs_writeback_wq;
__u32 cifs_lock_secret;
/*
@@ -2125,9 +2126,16 @@ init_cifs(void)
goto out_destroy_serverclose_wq;
}
+ cifs_writeback_wq = alloc_workqueue("cifswritebackd",
+ WQ_UNBOUND | WQ_MEM_RECLAIM, 0);
+ if (!cifs_writeback_wq) {
+ rc = -ENOMEM;
+ goto out_destroy_cfid_put_wq;
+ }
+
rc = cifs_init_inodecache();
if (rc)
- goto out_destroy_cfid_put_wq;
+ goto out_destroy_writeback_wq;
rc = cifs_init_netfs();
if (rc)
@@ -2198,6 +2206,8 @@ out_destroy_netfs:
cifs_destroy_netfs();
out_destroy_inodecache:
cifs_destroy_inodecache();
+out_destroy_writeback_wq:
+ destroy_workqueue(cifs_writeback_wq);
out_destroy_cfid_put_wq:
destroy_workqueue(cfid_put_wq);
out_destroy_serverclose_wq:
@@ -2243,6 +2253,7 @@ exit_cifs(void)
destroy_workqueue(fileinfo_put_wq);
destroy_workqueue(serverclose_wq);
destroy_workqueue(cfid_put_wq);
+ destroy_workqueue(cifs_writeback_wq);
destroy_workqueue(cifsiod_wq);
}
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -2145,6 +2145,7 @@ extern struct workqueue_struct *cifsoplo
extern struct workqueue_struct *deferredclose_wq;
extern struct workqueue_struct *serverclose_wq;
extern struct workqueue_struct *cfid_put_wq;
+extern struct workqueue_struct *cifs_writeback_wq;
extern __u32 cifs_lock_secret;
extern mempool_t *cifs_sm_req_poolp;
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -105,10 +105,16 @@ retry:
#endif
}
+static bool cifs_writeback_dying(struct netfs_io_subrequest *subreq)
+{
+ return subreq->rreq->origin == NETFS_WRITEBACK &&
+ fatal_signal_pending(current);
+}
+
/*
* Issue a subrequest to upload to the server.
*/
-static void cifs_issue_write(struct netfs_io_subrequest *subreq)
+static void __cifs_issue_write(struct netfs_io_subrequest *subreq)
{
struct cifs_io_subrequest *wdata =
container_of(subreq, struct cifs_io_subrequest, subreq);
@@ -142,6 +148,24 @@ fail:
goto out;
}
+static void cifs_issue_write_worker(struct work_struct *work)
+{
+ struct netfs_io_subrequest *subreq;
+
+ subreq = container_of(work, struct netfs_io_subrequest, work);
+ __cifs_issue_write(subreq);
+}
+
+static void cifs_issue_write(struct netfs_io_subrequest *subreq)
+{
+ if (unlikely(cifs_writeback_dying(subreq))) {
+ subreq->work.func = cifs_issue_write_worker;
+ WARN_ON_ONCE(!queue_work(cifs_writeback_wq, &subreq->work));
+ return;
+ }
+ __cifs_issue_write(subreq);
+}
+
static void cifs_netfs_invalidate_cache(struct netfs_io_request *wreq)
{
cifs_invalidate_cache(wreq->inode, 0);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0843/1005] smb: client: let umount -f abort retried reads and writes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (841 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0842/1005] smb: client: issue writes from a worker if the task is dying Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0844/1005] smb: client: retry writeback on interrupts and allocation failures Greg Kroah-Hartman
` (155 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit adeb82ac455582eac1894d1ca1b0aba110a65cc3 upstream.
umount -f only wakes up tasks waiting on the server's queues. Reads and
writes being retried - forever on hard mounts - keep going, so with the
server gone the unmount still hangs in sync_filesystem() waiting for
their writeback. NFS kills outstanding RPCs on umount -f instead.
Count umount -f attempts per superblock and have each read and write
request remember the count it started with. Fail with -EIO, rather than
retry, reissue, issue or wait for credits, any subrequest of a request
that predates a umount -f once it is a retry or the server or share is
disconnected; a kworker doing writeback can't be signalled out of the
credit wait otherwise. First attempts on a connected server still go
ahead, and requests started later aren't aborted (but see below), so
I/O on a healthy server keeps working if the unmount then fails with
-EBUSY or only detaches one of several mounts.
retry_count is not bumped yet when netfs_retry_write_stream() calls
prepare_write() for the first retry, so don't rely on it alone to tell a
reissue from a first attempt: treat a subrequest as a retry when it
already carries an xid (it has been prepared before) in
prepare_write()/prepare_read(), or when its replay flag is set in
cifs_io_aborted(), and abort it when the mount is going away even if the
connection still looks healthy.
Requests created after umount -f - writeback kicked off by the background
flusher, an oplock break or sync_filesystem() during the final teardown -
snapshot the already bumped count and would otherwise retry forever on a
hard mount, hanging cifs_kill_sb(). Once a superblock that saw a umount
-f reaches cifs_kill_sb() the mount is going away for good, so flag it and
stop retrying I/O on it too; one that never saw a umount -f still
flushes as before.
A sync(2) or syncfs() waiting under s_umount for writeback started after
umount -f would still keep the unmount from reaching cifs_kill_sb(), so
also stop retrying such I/O while s_umount is contended. After a failed
umount -f, that also stops reads and writes retrying while a remount,
freeze or new mount of the same superblock waits on s_umount.
Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifs_fs_sb.h | 2 +
fs/smb/client/cifsfs.c | 10 ++++++++
fs/smb/client/cifsglob.h | 1
fs/smb/client/cifsproto.h | 2 +
fs/smb/client/file.c | 55 +++++++++++++++++++++++++++++++++++++++++++++
fs/smb/client/smb2pdu.c | 16 +++----------
6 files changed, 74 insertions(+), 12 deletions(-)
--- a/fs/smb/client/cifs_fs_sb.h
+++ b/fs/smb/client/cifs_fs_sb.h
@@ -57,6 +57,7 @@ struct cifs_sb_info {
atomic_t active;
atomic_t mnt_cifs_flags;
atomic_t outstanding_rreq; /* nr of rreqs not yet fully deinitialized */
+ atomic_t umount_aborts; /* nr of umount -f attempts */
struct delayed_work prune_tlinks;
struct rcu_head rcu;
@@ -68,6 +69,7 @@ struct cifs_sb_info {
* (cifs_autodisable_serverino) in order to match new mounts.
*/
bool mnt_cifs_serverino_autodisabled;
+ bool exiting; /* umount -f committed: stop retries */
/*
* Available once the mount has completed.
*/
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -300,6 +300,15 @@ static void cifs_kill_sb(struct super_bl
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
/*
+ * Reaching here after a umount -f means the mount is going away for
+ * good, so stop retrying I/O that can no longer complete (e.g.
+ * writeback to a server that is gone) rather than looping forever on
+ * a hard mount and hanging the teardown below.
+ */
+ if (atomic_read(&cifs_sb->umount_aborts))
+ WRITE_ONCE(cifs_sb->exiting, true);
+
+ /*
* We need to release all dentries for the cached directories
* and close all deferred file handles before we kill the sb.
*/
@@ -838,6 +847,7 @@ static void cifs_umount_begin(struct sup
if (cifs_sb == NULL)
return;
+ atomic_inc(&cifs_sb->umount_aborts);
tcon = cifs_sb_master_tcon(cifs_sb);
spin_lock(&cifs_tcp_ses_lock);
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -1486,6 +1486,7 @@ struct cifs_io_request {
struct netfs_io_request rreq;
struct cifsFileInfo *cfile;
pid_t pid;
+ int umount_aborts;
};
/* asynchronous read support */
--- a/fs/smb/client/cifsproto.h
+++ b/fs/smb/client/cifsproto.h
@@ -137,6 +137,8 @@ bool is_size_safe_to_change(struct cifsI
bool from_readdir);
void cifs_write_subrequest_terminated(struct cifs_io_subrequest *wdata,
ssize_t result);
+bool cifs_io_stopped(struct cifs_io_subrequest *subreq);
+bool cifs_io_should_replay(struct cifs_io_subrequest *subreq);
struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
int flags);
int __cifs_get_writable_file(struct cifsInodeInfo *cifs_inode,
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -39,6 +39,40 @@
static int cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush);
+bool cifs_io_stopped(struct cifs_io_subrequest *subreq)
+{
+ struct super_block *sb = subreq->rreq->inode->i_sb;
+ struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
+ int aborts;
+
+ if (cifs_forced_shutdown(cifs_sb) || READ_ONCE(cifs_sb->exiting))
+ return true;
+ aborts = atomic_read(&cifs_sb->umount_aborts);
+ if (aborts != subreq->req->umount_aborts)
+ return true;
+ return aborts && rwsem_is_contended(&sb->s_umount);
+}
+
+bool cifs_io_should_replay(struct cifs_io_subrequest *subreq)
+{
+ struct cifs_tcon *tcon = tlink_tcon(subreq->req->cfile->tlink);
+
+ if (cifs_io_stopped(subreq))
+ return false;
+ return smb2_should_replay(tcon, &subreq->retries, &subreq->cur_sleep);
+}
+
+static bool cifs_io_aborted(struct cifs_io_subrequest *subreq)
+{
+ struct cifs_tcon *tcon = tlink_tcon(subreq->req->cfile->tlink);
+
+ if (!cifs_io_stopped(subreq))
+ return false;
+ return subreq->subreq.retry_count || subreq->replay ||
+ READ_ONCE(subreq->server->tcpStatus) == CifsNeedReconnect ||
+ tcon->need_reconnect;
+}
+
/*
* Prepare a subrequest to upload to the server. We need to allocate credits
* so that we know the maximum amount of data that we can include in it.
@@ -52,6 +86,7 @@ static void cifs_prepare_write(struct ne
struct TCP_Server_Info *server;
struct cifsFileInfo *open_file = req->cfile;
struct cifs_sb_info *cifs_sb = CIFS_SB(wdata->rreq->inode->i_sb);
+ bool reprepared = wdata->have_xid;
size_t wsize = req->rreq.wsize;
int rc;
@@ -63,6 +98,12 @@ static void cifs_prepare_write(struct ne
server = cifs_pick_channel(tlink_tcon(open_file->tlink)->ses);
wdata->server = server;
+ if (cifs_io_aborted(wdata) ||
+ (reprepared && cifs_io_stopped(wdata))) {
+ subreq->error = -EIO;
+ return netfs_prepare_write_failed(subreq);
+ }
+
if (cifs_sb->ctx->wsize == 0)
cifs_negotiate_wsize(server, cifs_sb->ctx,
tlink_tcon(req->cfile->tlink));
@@ -126,6 +167,10 @@ static void __cifs_issue_write(struct ne
goto fail;
}
+ rc = -EIO;
+ if (cifs_io_aborted(wdata))
+ goto fail;
+
rc = adjust_credits(wdata->server, wdata, cifs_trace_rw_credits_issue_write_adjust);
if (rc)
goto fail;
@@ -181,6 +226,7 @@ static int cifs_prepare_read(struct netf
struct cifs_io_request *req = container_of(subreq->rreq, struct cifs_io_request, rreq);
struct TCP_Server_Info *server;
struct cifs_sb_info *cifs_sb = CIFS_SB(rreq->inode->i_sb);
+ bool reprepared = rdata->have_xid;
size_t size;
int rc = 0;
@@ -192,6 +238,10 @@ static int cifs_prepare_read(struct netf
server = cifs_pick_channel(tlink_tcon(req->cfile->tlink)->ses);
rdata->server = server;
+ if (cifs_io_aborted(rdata) ||
+ (reprepared && cifs_io_stopped(rdata)))
+ return -EIO;
+
if (cifs_sb->ctx->rsize == 0)
cifs_negotiate_rsize(server, cifs_sb->ctx,
tlink_tcon(req->cfile->tlink));
@@ -242,6 +292,10 @@ static void cifs_issue_read(struct netfs
__func__, rreq->debug_id, subreq->debug_index, rreq->mapping,
subreq->transferred, subreq->len);
+ rc = -EIO;
+ if (cifs_io_aborted(rdata))
+ goto failed;
+
rc = adjust_credits(server, rdata, cifs_trace_rw_credits_issue_read_adjust);
if (rc)
goto failed;
@@ -300,6 +354,7 @@ static int cifs_init_request(struct netf
rreq->rsize = cifs_sb->ctx->rsize;
rreq->wsize = cifs_sb->ctx->wsize;
req->pid = current->tgid; // Ummm... This may be a workqueue
+ req->umount_aborts = atomic_read(&cifs_sb->umount_aborts);
if (file) {
open_file = file->private_data;
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -4850,9 +4850,7 @@ do_retry:
/* see if we need to retry */
if (is_replayable_error(rdata->result) &&
- smb2_should_replay(tcon,
- &rdata->retries,
- &rdata->cur_sleep))
+ cifs_io_should_replay(rdata))
rdata->replay = true;
trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value,
@@ -4961,9 +4959,7 @@ async_readv_out:
out:
/* if the send error is retryable, let netfs know about it */
if (is_replayable_error(rc) &&
- smb2_should_replay(tcon,
- &rdata->retries,
- &rdata->cur_sleep)) {
+ cifs_io_should_replay(rdata)) {
rdata->replay = true;
trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_retry_needed);
__set_bit(NETFS_SREQ_NEED_RETRY, &rdata->subreq.flags);
@@ -5200,9 +5196,7 @@ smb2_writev_callback(struct TCP_Server_I
/* see if we need to retry */
if (is_replayable_error(wdata->result) &&
- smb2_should_replay(tcon,
- &wdata->retries,
- &wdata->cur_sleep))
+ cifs_io_should_replay(wdata))
wdata->replay = true;
cifs_write_subrequest_terminated(wdata, result ?: written);
@@ -5374,9 +5368,7 @@ async_writev_out:
out:
/* if the send error is retryable, let netfs know about it */
if (is_replayable_error(rc) &&
- smb2_should_replay(tcon,
- &wdata->retries,
- &wdata->cur_sleep)) {
+ cifs_io_should_replay(wdata)) {
wdata->replay = true;
trace_netfs_sreq(&wdata->subreq, netfs_sreq_trace_io_retry_needed);
__set_bit(NETFS_SREQ_NEED_RETRY, &wdata->subreq.flags);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0844/1005] smb: client: retry writeback on interrupts and allocation failures
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (842 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0843/1005] smb: client: let umount -f abort retried reads and writes Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0845/1005] smb: client: retry writes that couldnt be issued due to a reconnect Greg Kroah-Hartman
` (154 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Howells, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit fb39fbd782bcd2dccd05f633bc6ac348209dc272 upstream.
Issuing writes from a worker only helps when the task is already dying
at issue time. A fatal signal can still arrive after that check and
before __smb_send_rqst() checks again, or while waiting for a credit in
cifs_call_async(), or in the middle of a send. The write then fails
with -ERESTARTSYS, which isn't a replayable error, so netfs marks the
subrequest failed and drops its folios clean:
netfs_sreq: R=000041f6[2] UPLD SUBMT ... s=400000 0/400000
smb3_write_err: R=000041f6[2] ... offset=0x400000 len=0x400000 rc=-512
netfs_failure: R=000041f6[2] UPLD ... upload e=-512
losing 4MiB of a 64MiB file closed by a task killed meanwhile. A failed
memory allocation while building or sending a write drops its data the
same way.
No server status maps to an interrupt error or to -ENOMEM, so for
writeback such errors always mean the client gave up locally. Mark the
subrequest for retry, with backoff and giving up on umount -f, as cifs
did with is_retryable_error() before switching to netfslib and as NFS
does for these errors. netfs collects writeback from a workqueue, so
the retry gets prepared and issued with no signals pending.
Only the SMB2 read and write paths sleep before replaying, so SMB1 would
resend such writes right away. Move the sleep to cifs_issue_read() and
__cifs_issue_write().
Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 14 ++++++++++++++
fs/smb/client/smb2pdu.c | 12 ++----------
2 files changed, 16 insertions(+), 10 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -179,6 +179,9 @@ static void __cifs_issue_write(struct ne
if (wdata->req->cfile->invalidHandle)
goto fail;
+ if (wdata->replay && wdata->cur_sleep)
+ msleep(wdata->cur_sleep);
+
wdata->server->ops->async_writev(wdata);
out:
return;
@@ -312,6 +315,9 @@ static void cifs_issue_read(struct netfs
subreq->rreq->origin != NETFS_DIO_READ)
__set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags);
+ if (rdata->replay && rdata->cur_sleep)
+ msleep(rdata->cur_sleep);
+
trace_netfs_sreq(subreq, netfs_sreq_trace_submit);
rc = rdata->server->ops->async_readv(rdata);
if (rc)
@@ -2705,6 +2711,14 @@ void cifs_write_subrequest_terminated(st
spin_unlock(&inode->i_lock);
}
+ if ((is_interrupt_error(result) || result == -ENOMEM) &&
+ wreq->origin == NETFS_WRITEBACK && cifs_io_should_replay(wdata)) {
+ wdata->replay = true;
+ trace_netfs_sreq(&wdata->subreq,
+ netfs_sreq_trace_io_retry_needed);
+ __set_bit(NETFS_SREQ_NEED_RETRY, &wdata->subreq.flags);
+ }
+
netfs_write_subrequest_terminated(&wdata->subreq, result);
}
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -4913,12 +4913,8 @@ smb2_async_readv(struct cifs_io_subreque
shdr = (struct smb2_hdr *)buf;
- if (rdata->replay) {
- /* Back-off before retry */
- if (rdata->cur_sleep)
- msleep(rdata->cur_sleep);
+ if (rdata->replay)
smb2_set_replay(server, &rqst);
- }
if (rdata->credits.value > 0) {
shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(io_parms.length,
@@ -5315,12 +5311,8 @@ smb2_async_writev(struct cifs_io_subrequ
}
#endif
- if (wdata->replay) {
- /* Back-off before retry */
- if (wdata->cur_sleep)
- msleep(wdata->cur_sleep);
+ if (wdata->replay)
smb2_set_replay(server, &rqst);
- }
cifs_dbg(FYI, "async write at %llu %u bytes iter=%zx\n",
io_parms->offset, io_parms->length, iov_iter_count(&wdata->subreq.io_iter));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0845/1005] smb: client: retry writes that couldnt be issued due to a reconnect
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (843 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0844/1005] smb: client: retry writeback on interrupts and allocation failures Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0846/1005] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
` (153 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Howells, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 64db0dc1f3e689145e698bc1b20ee70b1724b945 upstream.
__cifs_issue_write() fails a subrequest with -EAGAIN when its handle got
invalidated or its credits belong to a session from before a reconnect,
both before sending anything. netfs used to retry any -EAGAIN by itself,
but now only retries subrequests marked for it, so these writes fail and
their folios end writeback clean, losing the data.
Mark them for retry instead. The retry gets the handle reopened and
fresh credits in cifs_prepare_write().
Fixes: 82e8885bd763 ("netfs: when subreq is marked for retry, do not check if it faced an error")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -187,10 +187,12 @@ out:
return;
fail:
- if (rc == -EAGAIN)
+ if (rc == -EAGAIN) {
trace_netfs_sreq(subreq, netfs_sreq_trace_retry);
- else
+ __set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);
+ } else {
trace_netfs_sreq(subreq, netfs_sreq_trace_fail);
+ }
add_credits_and_wake_if(wdata->server, &wdata->credits, 0);
cifs_write_subrequest_terminated(wdata, rc);
goto out;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0846/1005] smb: client: skip NULL channel in __cifs_put_smb_ses()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (844 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0845/1005] smb: client: retry writes that couldnt be issued due to a reconnect Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0847/1005] smb: client: validate descriptor headers before query result allocation Greg Kroah-Hartman
` (152 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
commit 8deaf64a59a263161dfc5128f8398fb3dcba4fac upstream.
cifs_chan_skip_or_disable() clears a secondary channel's slot in the
session (ses->chans[chan_index].server = NULL) without lowering
chan_count when the server stops supporting multichannel. When the
session is later released, __cifs_put_smb_ses() walks every slot up to
chan_count and calls cifs_put_tcp_session() on it, which dereferences
the server pointer immediately, so a slot left NULL by the skip path
makes the release crash with a NULL pointer dereference.
Clearing a slot without lowering chan_count is older than
cifs_chan_skip_or_disable(): cifs_chan_update_iface() could already do
the same since commit b54034a73baf9 ("cifs: during reconnect, update
interface if necessary"), and the release loop has been unguarded
since then. Commit 12d1e301bdfd1 ("cifs: do not let
cifs_chan_update_iface deallocate channels") later removed that
trigger, but the crash is reachable through it on older kernels.
cifs_decrease_secondary_channels() already guards the same put with
if (server). Add the same guard to the release loop so a skipped
channel slot is left alone.
Fixes: b54034a73baf9 ("cifs: during reconnect, update interface if necessary")
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/connect.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -2179,7 +2179,8 @@ void __cifs_put_smb_ses(struct cifs_ses
kref_put(&ses->chans[i].iface->refcount, release_iface);
ses->chans[i].iface = NULL;
}
- cifs_put_tcp_session(ses->chans[i].server, 0);
+ if (ses->chans[i].server)
+ cifs_put_tcp_session(ses->chans[i].server, 0);
ses->chans[i].server = NULL;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0847/1005] smb: client: validate descriptor headers before query result allocation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (845 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0846/1005] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0848/1005] smb: client: dont give up writeback on the first replayable error Greg Kroah-Hartman
` (151 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, liuyong, Namjae Jeon,
Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: liuyong <pkfxxxing@gmail.com>
commit ffb59029c0d52bf76fdd2678f5d6fd13e26220dd upstream.
query_info() uses the server's returned length instead of the caller's
minimum when a dynamic result is requested. A zero-length ACL response
can therefore return ZERO_SIZE_PTR to id_mode_to_cifs_acl(), whose
ownership-change path reads dacloffset before checking the header size.
A KASAN-enabled test shows a read at address 0x20 and a kernel Oops.
Validate the returned range and the caller's minimum before allocating
the dynamic result. Keep the reported length zero if validation fails.
Use the security descriptor header size as the minimum in SMB2_query_acl().
DACL-only and SACL-only xattr queries do not require owner and group SIDs,
so enforcing MIN_SEC_DESC_LEN would reject short descriptors that these
queries could previously return. The rewrite paths validate the required
owner/group SIDs and DACL separately before using their contents.
These issues were discovered and fixed by Qihoo 360's Tulongfeng
multi-agent system.
Fixes: 9ee2afe5207b ("cifs: prevent copying past input buffer boundaries")
Cc: stable@vger.kernel.org
Signed-off-by: liuyong <pkfxxxing@gmail.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsacl.h | 14 --------------
fs/smb/client/smb2pdu.c | 11 ++++++++++-
2 files changed, 10 insertions(+), 15 deletions(-)
--- a/fs/smb/client/cifsacl.h
+++ b/fs/smb/client/cifsacl.h
@@ -93,18 +93,4 @@ struct owner_group_sids {
struct owner_sid group;
} __packed;
-/*
- * Minimum security identifier can be one for system defined Users
- * and Groups such as NULL SID and World or Built-in accounts such
- * as Administrator and Guest and consists of
- * Revision + Num (Sub)Auths + Authority + Domain (one Subauthority)
- */
-#define MIN_SID_LEN (1 + 1 + 6 + 4) /* in bytes */
-
-/*
- * Minimum security descriptor can be one without any SACL and DACL and can
- * consist of revision, type, and two sids of minimum size for owner and group
- */
-#define MIN_SEC_DESC_LEN (sizeof(struct smb_ntsd) + (2 * MIN_SID_LEN))
-
#endif /* _CIFSACL_H */
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -4058,6 +4058,14 @@ replay_again:
ses->Suid, info_class, (__u32)info_type);
if (dlen) {
+ rc = smb2_validate_iov(le16_to_cpu(rsp->OutputBufferOffset),
+ le32_to_cpu(rsp->OutputBufferLength),
+ &rsp_iov, min_len);
+ if (rc) {
+ *dlen = 0;
+ goto qinf_exit;
+ }
+
*dlen = le32_to_cpu(rsp->OutputBufferLength);
if (!*data) {
*data = kmalloc(*dlen, GFP_KERNEL);
@@ -4112,7 +4120,8 @@ SMB2_query_acl(const unsigned int xid, s
return query_info(xid, tcon, persistent_fid, volatile_fid,
0, SMB2_O_INFO_SECURITY, extra_info,
- SMB2_MAX_BUFFER_SIZE, MIN_SEC_DESC_LEN, data, plen);
+ SMB2_MAX_BUFFER_SIZE, sizeof(struct smb_ntsd),
+ data, plen);
}
int
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0848/1005] smb: client: dont give up writeback on the first replayable error
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (846 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0847/1005] smb: client: validate descriptor headers before query result allocation Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0849/1005] smb: client: dont retry failed writes forever regardless of mount options Greg Kroah-Hartman
` (150 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 274dec866f0882ee5a0f3d58d4d5c31af0c02417 upstream.
Read and write retries follow the hard and retrans mount options, and
mounts are soft with no retrans by default. For writeback this means
that a single replayable error, e.g. a reconnect while sending, fails
the subrequest and netfs ends writeback with its folios clean: the data
is gone, possibly long after write(2) succeeded, with only fsync(2) left
to notice. NFS soft mounts, by comparison, wait minutes for a server to
answer before failing a request.
Keep retrying writeback on replayable errors, with exponential backoff:
forever on hard mounts, and on soft mounts for max(3, retrans) echo
intervals from the first failure - 3 minutes by default, the time after
which a silent server is considered unresponsive. The window applies to
each write sent to the server, not to the whole writeback. umount -f or
a shutdown still stops it right away. Direct and unbuffered writes,
whose callers get the error, keep following the mount options.
Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsglob.h | 1 +
fs/smb/client/file.c | 21 +++++++++++++++++++++
fs/smb/client/smb2ops.c | 9 +--------
fs/smb/client/smb2proto.h | 9 +++++++++
4 files changed, 32 insertions(+), 8 deletions(-)
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -1503,6 +1503,7 @@ struct cifs_io_subrequest {
bool replay;
unsigned int retries; /* number of retries so far */
unsigned int cur_sleep; /* time to sleep before replay */
+ unsigned long retry_deadline;
struct kvec iov[2];
struct TCP_Server_Info *server;
#ifdef CONFIG_CIFS_SMB_DIRECT
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -53,12 +53,33 @@ bool cifs_io_stopped(struct cifs_io_subr
return aborts && rwsem_is_contended(&sb->s_umount);
}
+static bool cifs_writeback_retry_expired(struct cifs_io_subrequest *subreq,
+ struct cifs_tcon *tcon)
+{
+ struct TCP_Server_Info *server = tcon->ses->server;
+ unsigned long window;
+
+ if (tcon->retry)
+ return false;
+ if (!subreq->retry_deadline) {
+ window = max(3U, server->retrans) * server->echo_interval;
+ subreq->retry_deadline = (jiffies + window) | 1;
+ }
+ return time_after(jiffies, subreq->retry_deadline);
+}
+
bool cifs_io_should_replay(struct cifs_io_subrequest *subreq)
{
struct cifs_tcon *tcon = tlink_tcon(subreq->req->cfile->tlink);
if (cifs_io_stopped(subreq))
return false;
+ if (subreq->rreq->origin == NETFS_WRITEBACK) {
+ if (cifs_writeback_retry_expired(subreq, tcon))
+ return false;
+ smb2_replay_backoff(&subreq->cur_sleep);
+ return true;
+ }
return smb2_should_replay(tcon, &subreq->retries, &subreq->cur_sleep);
}
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -2935,14 +2935,7 @@ bool smb2_should_replay(struct cifs_tcon
return false;
if (tcon->retry || (*pretries)++ < tcon->ses->server->retrans) {
- /* Update sleep time for exponential backoff */
- if (!(*pcur_sleep))
- (*pcur_sleep) = 1;
- else {
- (*pcur_sleep) = ((*pcur_sleep) << 1);
- if ((*pcur_sleep) > CIFS_MAX_SLEEP)
- (*pcur_sleep) = CIFS_MAX_SLEEP;
- }
+ smb2_replay_backoff(pcur_sleep);
return true;
}
--- a/fs/smb/client/smb2proto.h
+++ b/fs/smb/client/smb2proto.h
@@ -119,6 +119,15 @@ unsigned long smb_rqst_len(struct TCP_Se
void smb2_set_next_command(struct cifs_tcon *tcon, struct smb_rqst *rqst);
void smb2_set_related(struct smb_rqst *rqst);
void smb2_set_replay(struct TCP_Server_Info *server, struct smb_rqst *rqst);
+
+static inline void smb2_replay_backoff(int *pcur_sleep)
+{
+ if (!*pcur_sleep)
+ *pcur_sleep = 1;
+ else
+ *pcur_sleep = min(*pcur_sleep << 1, CIFS_MAX_SLEEP);
+}
+
bool smb2_should_replay(struct cifs_tcon *tcon, int *pretries,
int *pcur_sleep);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0849/1005] smb: client: dont retry failed writes forever regardless of mount options
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (847 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0848/1005] smb: client: dont give up writeback on the first replayable error Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0850/1005] smb: client: dont spend read retries on reads cut short by a reconnect Greg Kroah-Hartman
` (149 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit bb203c9af62adb59d82e8ecb715e778329e3b771 upstream.
smb2_writev_callback() marks a write for retry whenever the server fails
it with a replayable status, ignoring smb2_should_replay() and so the
hard and retrans mount options. The latter is only used to decide on a
backoff, so on a soft mount with no retrans, a server that keeps failing
a write with e.g. STATUS_INSUFFICIENT_RESOURCES gets it resent forever,
thousands of times per second, hanging anything waiting on its
writeback:
smb3_write_err: R=005c359e[2] ... offset=0x27000 len=0xfdf0 rc=-11
(569410 times in 255 seconds, same subrequest, no growing delay)
Only retry such writes when cifs_io_should_replay() allows it, as already
done for send errors in smb2_async_writev(), otherwise let them fail.
Writeback thus keeps retrying them with backoff, within its retry
window. Base the decision on the result of this attempt rather than on
wdata->result, which is never reset on success and may hold the error of
a previous attempt.
Writes cut short by a reconnect get retried regardless too. Have
writeback ones go through cifs_io_should_replay() as well, so that they
back off and soft mounts give up on them after the retry window, as on
other replayable errors. Other writes cut short keep being retried,
without spending the mount's retries, but as replays, since they may
have reached the server, unless umount -f stopped them, which fails them
with -EIO.
Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2pdu.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -5096,6 +5096,7 @@ smb2_writev_callback(struct TCP_Server_I
};
unsigned int rreq_debug_id = wdata->rreq->debug_id;
unsigned int subreq_debug_index = wdata->subreq.debug_index;
+ bool cut_short = false;
ssize_t result = 0;
size_t written = 0;
@@ -5109,10 +5110,7 @@ smb2_writev_callback(struct TCP_Server_I
credits.instance = server->reconnect_instance;
result = smb2_check_receive(mid, server, 0);
if (result != 0) {
- if (is_replayable_error(result)) {
- trace_netfs_sreq(&wdata->subreq, netfs_sreq_trace_io_retry_needed);
- __set_bit(NETFS_SREQ_NEED_RETRY, &wdata->subreq.flags);
- } else {
+ if (!is_replayable_error(result)) {
wdata->subreq.error = result;
trace_netfs_sreq(&wdata->subreq, netfs_sreq_trace_io_bad);
}
@@ -5141,12 +5139,9 @@ smb2_writev_callback(struct TCP_Server_I
break;
case MID_REQUEST_SUBMITTED:
trace_netfs_sreq(&wdata->subreq, netfs_sreq_trace_io_req_submitted);
- __set_bit(NETFS_SREQ_NEED_RETRY, &wdata->subreq.flags);
- result = -EAGAIN;
- break;
+ fallthrough;
case MID_RETRY_NEEDED:
- trace_netfs_sreq(&wdata->subreq, netfs_sreq_trace_io_retry_needed);
- __set_bit(NETFS_SREQ_NEED_RETRY, &wdata->subreq.flags);
+ cut_short = true;
result = -EAGAIN;
break;
case MID_RESPONSE_MALFORMED:
@@ -5200,9 +5195,17 @@ smb2_writev_callback(struct TCP_Server_I
wdata->credits.value = 0;
/* see if we need to retry */
- if (is_replayable_error(wdata->result) &&
- cifs_io_should_replay(wdata))
+ if (is_replayable_error(result) &&
+ ((cut_short && wdata->rreq->origin != NETFS_WRITEBACK &&
+ !cifs_io_stopped(wdata)) ||
+ cifs_io_should_replay(wdata))) {
wdata->replay = true;
+ trace_netfs_sreq(&wdata->subreq,
+ netfs_sreq_trace_io_retry_needed);
+ __set_bit(NETFS_SREQ_NEED_RETRY, &wdata->subreq.flags);
+ } else if (cut_short && cifs_io_stopped(wdata)) {
+ result = -EIO;
+ }
cifs_write_subrequest_terminated(wdata, result ?: written);
release_mid(server, mid);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0850/1005] smb: client: dont spend read retries on reads cut short by a reconnect
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (848 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0849/1005] smb: client: dont retry failed writes forever regardless of mount options Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0851/1005] smb: client: dont write back through O_DIRECT handles Greg Kroah-Hartman
` (148 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 1d4fcbfad120ddc30b81651f12096bfc84052f9a upstream.
smb2_readv_callback() always retries a read cut short by a reconnect,
but still asks cifs_io_should_replay() whether to mark it as a replay.
On a soft mount that spends one of the mount's retransmissions and grows
the backoff, so a later replayable error on the reissued read can fail
it early.
Mark such reads as replays without consulting the mount's retries, as
already done for writes.
Fixes: 2c1238a7477a ("cifs: make retry logic in read/write path consistent with other paths")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2pdu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -4739,6 +4739,7 @@ smb2_readv_callback(struct TCP_Server_In
struct smb_rqst rqst = { .rq_iov = &rdata->iov[0], .rq_nvec = 1 };
unsigned int rreq_debug_id = rdata->rreq->debug_id;
unsigned int subreq_debug_index = rdata->subreq.debug_index;
+ bool cut_short = false;
if (rdata->got_bytes) {
rqst.rq_iter = rdata->subreq.io_iter;
@@ -4787,6 +4788,7 @@ smb2_readv_callback(struct TCP_Server_In
trace_netfs_sreq(&rdata->subreq, netfs_sreq_trace_io_retry_needed);
do_retry:
__set_bit(NETFS_SREQ_NEED_RETRY, &rdata->subreq.flags);
+ cut_short = true;
rdata->result = -EAGAIN;
if (server->sign && rdata->got_bytes)
/* reset bytes number since we can not check a sign */
@@ -4859,7 +4861,7 @@ do_retry:
/* see if we need to retry */
if (is_replayable_error(rdata->result) &&
- cifs_io_should_replay(rdata))
+ (cut_short || cifs_io_should_replay(rdata)))
rdata->replay = true;
trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0851/1005] smb: client: dont write back through O_DIRECT handles
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (849 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0850/1005] smb: client: dont spend read retries on reads cut short by a reconnect Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0852/1005] dm log userspace: drop the device reference on error Greg Kroah-Hartman
` (147 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Howells, Paulo Alcantara
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 0e85145af984f7cae2aadaa694cb8612009027ac upstream.
Writeback uses the first writable handle of the inode, which may have
been opened with O_DIRECT. Such handles are opened with
FILE_NO_INTERMEDIATE_BUFFERING, for which Windows rejects any unaligned
I/O with STATUS_INVALID_PARAMETER. Writeback of partly dirty pages and
of the unaligned tail of a file through one of them fails, so netfs ends
it with the folios clean and the data never reaches the server.
xfstests generic/051, where fsstress mixes both kinds of opens, loses
about 1% of its writes this way:
smb3_write_err: ... offset=0xde90d7 len=0xbd0b rc=-22
All the rejected writes in a network capture were unaligned writes on a
no-buffering handle; none of the aligned ones, and none of the unaligned
ones on regular handles, were.
Prefer a handle that was not opened with O_DIRECT, and use one that was
only if there is no other.
Fixes: 1013e760d10e ("SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsglob.h | 1 +
fs/smb/client/file.c | 15 ++++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -1897,6 +1897,7 @@ enum cifs_find_flags {
FIND_WITH_DELETE = (1U << 1),
FIND_NO_PENDING_DELETE = (1U << 2),
FIND_OPEN_FLAGS = (1U << 3),
+ FIND_NO_DIRECT = (1U << 4),
};
#define MID_FREE 0
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -362,9 +362,15 @@ static void cifs_begin_writeback(struct
struct cifs_io_request *req = container_of(wreq, struct cifs_io_request, rreq);
int ret;
- ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_ANY, &req->cfile);
+ ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_NO_DIRECT,
+ &req->cfile);
if (ret) {
- cifs_dbg(VFS, "No writable handle in writepages ret=%d\n", ret);
+ ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_ANY,
+ &req->cfile);
+ }
+ if (ret) {
+ cifs_dbg(VFS, "%s: couldn't find writable handle: %d\n",
+ __func__, ret);
return;
}
@@ -2835,7 +2841,7 @@ int __cifs_get_writable_file(struct cifs
}
if (test_bit(CIFS_INO_TMPFILE, &cifs_inode->flags))
- find_flags = FIND_ANY;
+ find_flags &= FIND_NO_DIRECT;
cifs_sb = CIFS_SB(cifs_inode);
@@ -2865,6 +2871,9 @@ refind_writable:
!open_flags_match(cifs_inode, open_flags,
open_file->f_flags))
continue;
+ if ((find_flags & FIND_NO_DIRECT) &&
+ (open_file->f_flags & O_DIRECT))
+ continue;
if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
if (!open_file->invalidHandle) {
/* found a good writable file */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0852/1005] dm log userspace: drop the device reference on error
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (850 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0851/1005] smb: client: dont write back through O_DIRECT handles Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0853/1005] dm: avoid double-dropping the zone reset submission reference Greg Kroah-Hartman
` (146 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
commit 0550d3b14e008b033b02cfce668008ec6addffe4 upstream.
userspace_ctr() takes a reference on the log device with
dm_get_device(). When the integrated-flush workqueue allocation fails it
jumps to the shared error path, which frees the log context without
dropping that reference, so the device stays busy and cannot be removed.
userspace_dtr() drops the reference correctly; do the same here.
Fixes: 5066a4df1f42 ("dm log userspace: allow mark requests to piggyback on flush requests")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-log-userspace-base.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-log-userspace-base.c
+++ b/drivers/md/dm-log-userspace-base.c
@@ -294,9 +294,11 @@ static int userspace_ctr(struct dm_dirty
}
r = dm_get_device(ti, devices_rdata,
dm_table_get_mode(ti->table), &lc->log_dev);
- if (r)
+ if (r) {
DMERR("Failed to register %s with device-mapper",
devices_rdata);
+ goto out;
+ }
}
if (lc->integrated_flush) {
@@ -315,6 +317,8 @@ static int userspace_ctr(struct dm_dirty
out:
kfree(devices_rdata);
if (r) {
+ if (lc->log_dev)
+ dm_put_device(lc->ti, lc->log_dev);
mempool_exit(&lc->flush_entry_pool);
kfree(lc);
kfree(ctr_str);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0853/1005] dm: avoid double-dropping the zone reset submission reference
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (851 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0852/1005] dm log userspace: drop the device reference on error Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0854/1005] dm: fail a REQ_PREFLUSH bio with data when its preflush fails Greg Kroah-Hartman
` (145 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yaohan Li, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yaohan Li <shunsheng1218@gmail.com>
commit c4965effbe15f837a8089e79c0fc17ab19363cce upstream.
On an error in __send_zone_reset_all(), the submission reference
held by the dm_io can be decremented there and again by the caller's
error path. If another clone is still outstanding, the second drop
can release the dm_io before that clone completes.
Only drop the submission reference in __send_zone_reset_all() on
success. On failure, leave the reference for the caller's existing
error handling to release once.
The error path was reproduced under KASAN with an injected GFP_NOIO
allocation failure while another zone-reset clone remained in
flight. With the change, the same failure was reported normally,
without the observed use-after-free, and ordinary zone resets
continued to work.
Fixes: 81e7706345f06 ("dm: handle REQ_OP_ZONE_RESET_ALL")
Cc: stable@vger.kernel.org
Assisted-by: ZCode:GLM-4
Signed-off-by: Yaohan Li <shunsheng1218@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1929,8 +1929,13 @@ static blk_status_t __send_zone_reset_al
break;
}
- /* Release the reference that alloc_io() took for submission. */
- atomic_sub(1, &ci->io->io_count);
+ /*
+ * Release the reference that alloc_io() took for submission. On error,
+ * that reference was not consumed: dm_split_and_process_bio() releases
+ * it on the error path, so do not release it here a second time.
+ */
+ if (sts == BLK_STS_OK)
+ atomic_dec(&ci->io->io_count);
return sts;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0854/1005] dm: fail a REQ_PREFLUSH bio with data when its preflush fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (852 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0853/1005] dm: avoid double-dropping the zone reset submission reference Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0855/1005] dm: fix infinite loop in dm_blk_do_report_zones() Greg Kroah-Hartman
` (144 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Daejun Park, Tejun Heo,
Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daejun Park <daejun7.park@samsung.com>
commit e92cd41e8e5ee5616c6c7cd4378661d942f0a7c0 upstream.
For a bio with REQ_PREFLUSH and data, dm core may send an empty flush
first. If the flush fails, __dm_io_complete() still reissues the bio
without REQ_PREFLUSH and drops the error. When that write succeeds,
the XFS log keeps running and fsync() can return 0.
End the bio with the flush error instead of writing the data, as
blk-mq does.
Fixes: 6a8736d10cb4 ("dm: relax ordering of bio-based flush implementation")
Cc: stable@vger.kernel.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -983,7 +983,7 @@ static void __dm_io_complete(struct dm_i
if (requeued)
return;
- if (unlikely(requeue_flush_with_data)) {
+ if (unlikely(requeue_flush_with_data) && !io_error) {
/*
* Preflush done for flush with data, reissue
* without REQ_PREFLUSH.
@@ -991,7 +991,7 @@ static void __dm_io_complete(struct dm_i
bio->bi_opf &= ~REQ_PREFLUSH;
queue_io(md, bio);
} else {
- /* done with normal IO or empty flush */
+ /* done with normal IO, empty flush or failed preflush */
if (io_error)
bio->bi_status = io_error;
bio_endio(bio);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0855/1005] dm: fix infinite loop in dm_blk_do_report_zones()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (853 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0854/1005] dm: fail a REQ_PREFLUSH bio with data when its preflush fails Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0856/1005] dm: fix use-after-free when dm_get_device() widens the open mode Greg Kroah-Hartman
` (143 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Bundschuh, Mikulas Patocka,
Damien Le Moal
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Bundschuh <mkbund@amazon.com>
commit 648320de920b30ae1730bbf0e8b86c0df0fb490a upstream.
If the device underlying a zoned target is removed, its capacity is set
to 0 and blkdev_report_zones() returns 0 without reporting any zones.
The mapped device keeps its old capacity, so args->zone_idx and
args->next_sector never advance and dm_blk_do_report_zones() loops
forever. On non-preemptible kernels this causes soft lockups and RCU
stalls.
The following sequence of commands triggers the hang:
modprobe scsi_debug zbc=managed dev_size_mb=1024 zone_size_mb=64
udevadm settle
echo '0 2097152 linear /dev/sda 0' | dmsetup create lin
echo 1 > /sys/block/sda/device/delete
blkzone report -o 0 -c 1 /dev/mapper/lin
Fix this by returning -EIO when a target reports no zones. The target
always maps args->next_sector, so a zero return means the underlying
device no longer covers that sector.
Fixes: d41003513e61 ("block: rework zone reporting")
Cc: stable@vger.kernel.org
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-zone.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/md/dm-zone.c
+++ b/drivers/md/dm-zone.c
@@ -33,6 +33,8 @@ static int dm_blk_do_report_zones(struct
nr_zones - args->zone_idx);
if (ret < 0)
return ret;
+ if (!ret)
+ return -EIO;
} while (args->zone_idx < nr_zones &&
args->next_sector < get_capacity(md->disk));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0856/1005] dm: fix use-after-free when dm_get_device() widens the open mode
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (854 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0855/1005] dm: fix infinite loop in dm_blk_do_report_zones() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0857/1005] dm: Reject table setup after queue or disk teardown Greg Kroah-Hartman
` (142 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ming Hung Tsai, Mikulas Patocka,
Claude Opus 5
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming-Hung Tsai <mtsai@redhat.com>
commit c834161ded1a141a58d5f03b24f6894291222c96 upstream.
There's an UAF bug in dm_get_device(): when a table construction calls
dm_get_device() on the same device twice with widen access mode (e.g.,
read-only first then read-write), the second dm_get_device() calls
upgrade_mode(), which reopens the device in upgraded mode, making
previously returned dm_dev* a stale pointer.
Fixing approaches:
- Add per-mode views (dm_dev_ref) from a per-device dm_dev_internal to
multiple table_devices.
- Keep reusing the dm_dev_ref when the requested mode is included, i.e.,
a read-only reference can reuse the read-write opened device within a
table.
- Maintain a canonical block_device pointer in dm_dev_internal for
handling the DM_TABLE_DEPS ioctl.
Also tweak the way of mode sharing check in find_ref() to
"(x & mask) == mask". The result stays the same to the previous
upgrade_mode() guard "(x | mask) == x".
Pros: keep the relationship between dm_dev_internal and table_device:
one dm_dev_internal per device, regardless the mode, so the output of
DMM_TABLE_DEPS ioctl unchanged.
Cons: extra dm_dev_ref allocation.
Note that now the table_device's count not necessarily mean the number
tables referecing this <dev, mode> pair, since we're allowing multiple
references within a table.
Signed-off-by: Ming Hung Tsai <mtsai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fixes: 86f1152b117a ("dm: allow active and inactive tables to share dm_devs")
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-ioctl.c | 2
drivers/md/dm-table.c | 140 +++++++++++++++++++++++++++-----------------------
drivers/md/dm.c | 2
drivers/md/dm.h | 18 ++++++
4 files changed, 97 insertions(+), 65 deletions(-)
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1794,7 +1794,7 @@ static void retrieve_deps(struct dm_tabl
deps->count = count;
count = 0;
list_for_each_entry(dd, dm_table_get_devices(table), list)
- deps->dev[count++] = huge_encode_dev(dd->dm_dev->bdev->bd_dev);
+ deps->dev[count++] = huge_encode_dev(dd->bdev->bd_dev);
param->data_size = param->data_start + needed;
}
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -165,14 +165,16 @@ int dm_table_create(struct dm_table **re
static void free_devices(struct list_head *devices, struct mapped_device *md)
{
- struct list_head *tmp, *next;
+ struct dm_dev_internal *dd, *dd_next;
+ struct dm_dev_ref *ref, *ref_next;
- list_for_each_safe(tmp, next, devices) {
- struct dm_dev_internal *dd =
- list_entry(tmp, struct dm_dev_internal, list);
- DMWARN("%s: dm_table_destroy: dm_put_device call missing for %s",
- dm_device_name(md), dd->dm_dev->name);
- dm_put_table_device(md, dd->dm_dev);
+ list_for_each_entry_safe(dd, dd_next, devices, list) {
+ list_for_each_entry_safe(ref, ref_next, &dd->refs, list) {
+ DMWARN("%s: dm_table_destroy: dm_put_device call missing for %s",
+ dm_device_name(md), ref->dm_dev->name);
+ dm_put_table_device(md, ref->dm_dev);
+ kfree(ref);
+ }
kfree(dd);
}
}
@@ -218,13 +220,28 @@ static struct dm_dev_internal *find_devi
struct dm_dev_internal *dd;
list_for_each_entry(dd, l, list)
- if (dd->dm_dev->bdev->bd_dev == dev)
+ if (dd->bdev->bd_dev == dev)
return dd;
return NULL;
}
/*
+ * See if the device is already open with a mode that covers the
+ * requested one.
+ */
+static struct dm_dev_ref *find_ref(struct dm_dev_internal *dd, blk_mode_t mode)
+{
+ struct dm_dev_ref *ref;
+
+ list_for_each_entry(ref, &dd->refs, list)
+ if ((ref->dm_dev->mode & mode) == mode)
+ return ref;
+
+ return NULL;
+}
+
+/*
* If possible, this checks an area of a destination device is invalid.
*/
static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
@@ -304,31 +321,6 @@ static int device_area_is_invalid(struct
}
/*
- * This upgrades the mode on an already open dm_dev, being
- * careful to leave things as they were if we fail to reopen the
- * device and not to touch the existing bdev field in case
- * it is accessed concurrently.
- */
-static int upgrade_mode(struct dm_dev_internal *dd, blk_mode_t new_mode,
- struct mapped_device *md)
-{
- int r;
- struct dm_dev *old_dev, *new_dev;
-
- old_dev = dd->dm_dev;
-
- r = dm_get_table_device(md, dd->dm_dev->bdev->bd_dev,
- dd->dm_dev->mode | new_mode, &new_dev);
- if (r)
- return r;
-
- dd->dm_dev = new_dev;
- dm_put_table_device(md, old_dev);
-
- return 0;
-}
-
-/*
* Note: the __ref annotation is because this function can call the __init
* marked early_lookup_bdev when called during early boot code from dm-init.c.
*/
@@ -360,7 +352,9 @@ EXPORT_SYMBOL(dm_devt_from_path);
/*
* Add a device to the list, or just increment the usage count if
- * it's already present.
+ * it's already present with a mode that covers the requested one.
+ * Otherwise open the device again with the requested mode, so the
+ * dm_devs returned earlier stay valid.
*/
int dm_get_device(struct dm_target *ti, const char *path, blk_mode_t mode,
struct dm_dev **result)
@@ -368,6 +362,7 @@ int dm_get_device(struct dm_target *ti,
int r;
dev_t dev;
struct dm_dev_internal *dd;
+ struct dm_dev_ref *ref;
struct dm_table *t = ti->table;
BUG_ON(!t);
@@ -380,30 +375,46 @@ int dm_get_device(struct dm_target *ti,
return -EINVAL;
dd = find_device(&t->devices, dev);
- if (!dd) {
+ if (dd) {
+ ref = find_ref(dd, mode);
+ if (ref) {
+ refcount_inc(&ref->count);
+ goto out;
+ }
+ } else {
dd = kmalloc_obj(*dd);
if (!dd)
return -ENOMEM;
+ INIT_LIST_HEAD(&dd->refs);
+ }
- r = dm_get_table_device(t->md, dev, mode, &dd->dm_dev);
- if (r) {
- kfree(dd);
- return r;
- }
+ ref = kmalloc_obj(*ref);
+ if (!ref) {
+ r = -ENOMEM;
+ goto bad;
+ }
- refcount_set(&dd->count, 1);
- list_add(&dd->list, &t->devices);
- goto out;
+ r = dm_get_table_device(t->md, dev, mode, &ref->dm_dev);
+ if (r) {
+ kfree(ref);
+ goto bad;
+ }
+ refcount_set(&ref->count, 1);
- } else if (dd->dm_dev->mode != (mode | dd->dm_dev->mode)) {
- r = upgrade_mode(dd, mode, t->md);
- if (r)
- return r;
+ /* A device in the list always has at least one ref */
+ if (list_empty(&dd->refs)) {
+ dd->bdev = ref->dm_dev->bdev;
+ list_add(&dd->list, &t->devices);
}
- refcount_inc(&dd->count);
+ list_add_tail(&ref->list, &dd->refs);
out:
- *result = dd->dm_dev;
+ *result = ref->dm_dev;
return 0;
+
+bad:
+ if (list_empty(&dd->refs))
+ kfree(dd);
+ return r;
}
EXPORT_SYMBOL(dm_get_device);
@@ -453,23 +464,28 @@ static int dm_set_device_limits(struct d
*/
void dm_put_device(struct dm_target *ti, struct dm_dev *d)
{
- int found = 0;
struct list_head *devices = &ti->table->devices;
struct dm_dev_internal *dd;
+ struct dm_dev_ref *ref;
- list_for_each_entry(dd, devices, list) {
- if (dd->dm_dev == d) {
- found = 1;
- break;
- }
- }
- if (!found) {
- DMERR("%s: device %s not in table devices list",
- dm_device_name(ti->table->md), d->name);
+ list_for_each_entry(dd, devices, list)
+ list_for_each_entry(ref, &dd->refs, list)
+ if (ref->dm_dev == d)
+ goto found;
+
+ DMERR("%s: device %s not in table devices list",
+ dm_device_name(ti->table->md), d->name);
+ return;
+
+found:
+ if (!refcount_dec_and_test(&ref->count))
return;
- }
- if (refcount_dec_and_test(&dd->count)) {
- dm_put_table_device(ti->table->md, d);
+
+ dm_put_table_device(ti->table->md, d);
+ list_del(&ref->list);
+ kfree(ref);
+
+ if (list_empty(&dd->refs)) {
list_del(&dd->list);
kfree(dd);
}
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1588,7 +1588,7 @@ static void __send_empty_flush(struct cl
*/
clone = alloc_tio(ci, NULL, 0, &len, GFP_NOIO);
atomic_add(1, &ci->io->io_count);
- bio_set_dev(clone, dd->dm_dev->bdev);
+ bio_set_dev(clone, dd->bdev);
clone->bi_end_io = clone_endio;
dm_submit_bio_remap(clone, NULL);
}
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -37,10 +37,26 @@
/*
* List of devices that a metadevice uses and should open/close.
+ * There is one dm_dev_internal per device. It holds one dm_dev_ref
+ * for each mode that the targets opened the device with.
*/
struct dm_dev_internal {
struct list_head list;
- refcount_t count;
+ struct block_device *bdev;
+ struct list_head refs;
+};
+
+/*
+ * One open of a device with one mode, shared by the targets of a table.
+ * dm_get_device() reuses a dm_dev_ref whose mode covers the requested
+ * mode, and adds a new one only when none does. So the dm_dev_refs of
+ * a device have different modes, and a table holds each table_device
+ * at most once. table_device->count is still the number of tables that
+ * use the table_device.
+ */
+struct dm_dev_ref {
+ struct list_head list;
+ refcount_t count; /* dm_get_device() calls that returned dm_dev */
struct dm_dev *dm_dev;
};
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0857/1005] dm: Reject table setup after queue or disk teardown
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (855 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0856/1005] dm: fix use-after-free when dm_get_device() widens the open mode Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0858/1005] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
` (141 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+5307e3bcacec2ce4c2f0,
Kirtikumar Anandrao Ramchandani, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
commit ae310e4ad872a42f4707a596e66417f2aaa52826 upstream.
A failed table load can leave a mapped device in a state where its
queue has already been initialized or its disk has been removed, while
md->type is still DM_TYPE_NONE. A later table load then calls
blk_mq_init_allocated_queue() on the same queue. If del_gendisk() exited
the old hardware contexts, blk_mq_exit_hctx() dereferences their cleared
flush queue pointer.
Reject setup attempts after queue initialization or disk removal. A
failed request queue initialization still leaves md->tag_set NULL and
can be retried. Set the request-based disk operations only after that
initialization succeeds, so an unsuccessful attempt cannot leave a
bio-based retry with request-based operations.
Reported-by: syzbot+5307e3bcacec2ce4c2f0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=5307e3bcacec2ce4c2f0
Cc: stable@vger.kernel.org
Signed-off-by: Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2611,13 +2611,17 @@ int dm_setup_md_queue(struct mapped_devi
WARN_ON_ONCE(type == DM_TYPE_NONE);
+ /* A failed setup may have left the queue initialized or the disk dead. */
+ if (md->tag_set || test_bit(GD_DEAD, &md->disk->state))
+ return -ENODEV;
+
if (type == DM_TYPE_REQUEST_BASED) {
- md->disk->fops = &dm_rq_blk_dops;
r = dm_mq_init_request_queue(md, t);
if (r) {
DMERR("Cannot initialize queue for request-based dm mapped device");
return r;
}
+ md->disk->fops = &dm_rq_blk_dops;
}
r = dm_calculate_queue_limits(t, &limits);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0858/1005] dm cache: reject kcopyd client destory if it setup failed
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (856 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0857/1005] dm: Reject table setup after queue or disk teardown Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0859/1005] dm cache: validate the discard block size before narrowing Greg Kroah-Hartman
` (140 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+a2626a25eb2595e3ec3c,
Edward Adam Davis, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <eadavis@sina.com>
commit 8b97b168eb4d3affcf23d2980a0c3f35ed9262e2 upstream.
The value of cache->copier is -EINTR when failed to create a rescuer
kthread for wq kcopyd, in cache_create(), the code jumps directly to
__destroy(cache), it merely performs a simple check to see whether copier
is NULL, potentially hitting:
BUG: KASAN: null-ptr-deref in dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980
Read of size 4 at addr 0000000000000174 by task syz.2.19/6560
Call Trace:
dm_kcopyd_client_destroy+0xae/0x480 drivers/md/dm-kcopyd.c:980
__destroy+0x172/0x2f0 drivers/md/dm-cache-target.c:1973
cache_create drivers/md/dm-cache-target.c:2604 [inline]
cache_ctr+0x1674/0x2bf0 drivers/md/dm-cache-target.c:2649
dm_table_add_target+0x58d/0xc70 drivers/md/dm-table.c:749
populate_table drivers/md/dm-ioctl.c:1602 [inline]
table_load+0x325/0x8a0 drivers/md/dm-ioctl.c:1645
ctl_ioctl drivers/md/dm-ioctl.c:2221 [inline]
Set copier to NULL to avoid destroying a invalid kcopy client.
Cc: stable@vger.kernel.org
Fixes: c6b4fcbad044 ("dm: add cache target")
Reported-by: syzbot+a2626a25eb2595e3ec3c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a2626a25eb2595e3ec3c
Signed-off-by: Edward Adam Davis <eadavis@sina.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-target.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -2544,6 +2544,7 @@ static int cache_create(struct cache_arg
if (IS_ERR(cache->copier)) {
*error = "could not create kcopyd client";
r = PTR_ERR(cache->copier);
+ cache->copier = NULL;
goto bad;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0859/1005] dm cache: validate the discard block size before narrowing
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (857 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0858/1005] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0860/1005] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
` (139 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+c8564fc0a96e3ecbe4d4,
Kirtikumar Anandrao Ramchandani, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
commit df8daa4d916c88ef7888c738e0eb3b6f11714a6f upstream.
The discard block size doubles until the origin fits within the discard
bitset limit. too_many_discard_blocks() passes this sector_t size to
sector_div(), whose divisor is only 32 bits. Once the size exceeds that
range, the division uses a truncated divisor, which can become zero.
Use a 64-bit divisor when checking the block count. The selected size is
stored in a u32, so reject sizes that cannot be represented before the
assignment and before calculating the bitset size. This prevents a
truncated zero size from reaching dm_sector_div_up().
An earlier proposal checks whether the mapped length exceeds the origin
device. This fix also covers an origin device whose valid size requires a
discard block size beyond the field's range.
Reported-by: syzbot+c8564fc0a96e3ecbe4d4@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c8564fc0a96e3ecbe4d4
Cc: stable@vger.kernel.org
Fixes: 08b184514f65 ("dm cache: revert 'prevent corruption caused by discard_block_size > cache_block_size'")
Signed-off-by: Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-target.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -17,6 +17,7 @@
#include <linux/jiffies.h>
#include <linux/init.h>
#include <linux/kstrtox.h>
+#include <linux/math64.h>
#include <linux/mempool.h>
#include <linux/module.h>
#include <linux/rwsem.h>
@@ -2383,9 +2384,7 @@ static int create_cache_policy(struct ca
static bool too_many_discard_blocks(sector_t discard_block_size,
sector_t origin_size)
{
- (void) sector_div(origin_size, discard_block_size);
-
- return origin_size > MAX_DISCARD_BLOCKS;
+ return div64_u64(origin_size, discard_block_size) > MAX_DISCARD_BLOCKS;
}
static sector_t calculate_discard_block_size(sector_t cache_block_size,
@@ -2422,6 +2421,7 @@ static int cache_create(struct cache_arg
struct cache *cache;
struct dm_target *ti = ca->ti;
dm_block_t origin_blocks;
+ sector_t discard_block_size;
struct dm_cache_metadata *cmd;
bool may_format = ca->features.mode == CM_WRITE;
@@ -2521,9 +2521,15 @@ static int cache_create(struct cache_arg
}
clear_bitset(cache->dirty_bitset, from_cblock(cache->cache_size));
- cache->discard_block_size =
+ discard_block_size =
calculate_discard_block_size(cache->sectors_per_block,
cache->origin_sectors);
+ if (discard_block_size > U32_MAX) {
+ *error = "Discard block size exceeds 32 bits";
+ r = -EOVERFLOW;
+ goto bad;
+ }
+ cache->discard_block_size = discard_block_size;
cache->discard_nr_blocks = to_dblock(dm_sector_div_up(cache->origin_sectors,
cache->discard_block_size));
cache->discard_bitset = alloc_bitset(from_dblock(cache->discard_nr_blocks));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0860/1005] dm crypt: fix use of uninitialized percpu_counter in ctr error path
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (858 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0859/1005] dm cache: validate the discard block size before narrowing Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0861/1005] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
` (138 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+4b232570d625662eaab4,
Zhao Feng, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
commit 8ba1ade3e6b595b9091040feaa3341d7e45ba95d upstream.
If percpu_counter_init() fails in crypt_ctr() (e.g. when the
underlying percpu allocation fails under memory pressure or fault
injection), the error path jumps to "bad", which calls
crypt_dtr(). crypt_dtr() then evaluates
WARN_ON(percpu_counter_sum(&cc->n_allocated_pages) != 0) and calls
percpu_counter_destroy() on a counter that was never initialized,
because __percpu_counter_init_many() returns -ENOMEM before
calling raw_spin_lock_init() on fbc->lock.
With lockdep enabled this triggers "INFO: trying to register
non-static key" in __percpu_counter_sum(), as reported by syzbot.
The console additionally shows "crypt: Unknown error (-ENOMEM)"
because this failure path sets no ti->error.
Move percpu_counter_init() to right after the allocation of cc,
before ti->private is set and before any "goto bad" can happen.
On failure, set ti->error and free cc directly, so that
crypt_dtr() is only ever called with an initialized counter.
Reported-by: syzbot+4b232570d625662eaab4@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=4b232570d625662eaab4
Fixes: 5059353df86e ("dm crypt: limit the number of allocated pages")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -3208,6 +3208,14 @@ static int crypt_ctr(struct dm_target *t
ti->error = "Cannot allocate encryption context";
return -ENOMEM;
}
+
+ ret = percpu_counter_init(&cc->n_allocated_pages, 0, GFP_KERNEL);
+ if (ret < 0) {
+ ti->error = "Cannot initialize page counter";
+ kfree_sensitive(cc);
+ return ret;
+ }
+
cc->key_size = key_size;
cc->sector_size = (1 << SECTOR_SHIFT);
cc->sector_shift = 0;
@@ -3219,10 +3227,6 @@ static int crypt_ctr(struct dm_target *t
crypt_calculate_pages_per_client();
spin_unlock(&dm_crypt_clients_lock);
- ret = percpu_counter_init(&cc->n_allocated_pages, 0, GFP_KERNEL);
- if (ret < 0)
- goto bad;
-
/* Optional parameters need to be read before cipher constructor */
if (argc > 5) {
ret = crypt_ctr_optional(ti, argc - 5, &argv[5]);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0861/1005] dm mpath: fix buffer overflow in parse_hw_handler()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (859 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0860/1005] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0862/1005] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
` (137 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: shao.mingyin@zte.com.cn <shao.mingyin@zte.com.cn>
commit 8f611fe94a781c6fb658488cc7eab4e4923e6df6 upstream.
parse_hw_handler() builds the hw_handler parameter string in a buffer
sized with
len = 4;
plus one byte per argument. Those four bytes were meant for the decimal
form of the parameter count, three digits plus the terminating NUL.
dm_read_arg_group() accepts up to 1024 arguments and the count written is
'hw_argc - 1', so a count of 1000 or more needs four digits plus the NUL
and sprintf() writes one byte past the allocation.
Size the buffer from the actual string length instead.
Fixes: 2bfd2e1337f0 ("[SCSI] scsi_dh: Use scsi_dh_set_params() in multipath.")
Cc: stable@vger.kernel.org
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-mpath.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1085,8 +1085,9 @@ static int parse_hw_handler(struct dm_ar
if (hw_argc > 1) {
char *p;
- int i, j, len = 4;
+ int i, j, len;
+ len = snprintf(NULL, 0, "%d", hw_argc - 1) + 1;
for (i = 0; i <= hw_argc - 2; i++)
len += strlen(as->argv[i]) + 1;
p = m->hw_handler_params = kzalloc(len, GFP_KERNEL);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0862/1005] dm mpath: cap queue_if_no_path_timeout_secs
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (860 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0861/1005] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0863/1005] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
` (136 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <x-professor@outlook.com>
commit ae5b40accbc06f93e6a513e0e9a07fd32b197e49 upstream.
enable_nopath_timeout() arms the no-path timer with
jiffies + queue_if_no_path_timeout_secs * HZ. The module parameter is an
unbounded unsigned long, so the delay can exceed what mod_timer()
handles: a delay above LONG_MAX is treated as already expired, and
values above ULONG_MAX / HZ also wrap in the multiplication. The timer
then clears queue_if_no_path right away, and I/O queued after the last
path fails gets -EIO instead of waiting for the configured time.
On x86-64 with HZ=1000, 9223372036854776 seconds failed a write after
124 ms while one second less remained queued throughout a 4.2-second
observation window. A value of 18446744073709552 seconds wrapped to 384
jiffies and failed the write after 455 ms. On 32-bit kernels with
HZ=1000 the delay passes LONG_MAX above 2147483 seconds, a little under
25 days.
Cap the seconds value at the largest whole-second delay not exceeding
MAX_JIFFY_OFFSET before multiplying by HZ. This prevents signed-delta
overflow and multiplication wrap. The timer wheel's existing handling
of very long delays is unchanged.
Fixes: be240ff5e402 ("dm mpath: Add timeout mechanism for queue_if_no_path")
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <x-professor@outlook.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-mpath.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -797,7 +797,8 @@ static void queue_if_no_path_timeout_wor
static void enable_nopath_timeout(struct multipath *m)
{
unsigned long queue_if_no_path_timeout =
- READ_ONCE(queue_if_no_path_timeout_secs) * HZ;
+ min_t(unsigned long, READ_ONCE(queue_if_no_path_timeout_secs),
+ MAX_JIFFY_OFFSET / HZ) * HZ;
lockdep_assert_held(&m->lock);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0863/1005] dm thin: avoid wrapping no_space_timeout
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (861 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0862/1005] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0864/1005] dm-pcache: do not advance dirty_tail after backing flush failure Greg Kroah-Hartman
` (135 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <1075151112@qq.com>
commit bcb78d49620f666b4a9d62997691e8d031fd4ebc upstream.
set_pool_mode() converts the no_space_timeout module parameter with
READ_ONCE(no_space_timeout_secs) * HZ. The usual arithmetic conversions
evaluate the product as unsigned int, so it can wrap before being stored
in the unsigned long delay. With HZ=1000, 4294968 seconds becomes 704
jiffies: a pool that runs out of data space switches to
error_if_no_space and fails queued writes with -ENOSPC after about 0.7
seconds.
Widen the value before the multiplication and cap it at
MAX_JIFFY_OFFSET / HZ, so large timeouts no longer wrap into short
delays. On 32-bit kernels, values beyond the supported jiffies range
saturate at the largest whole-second delay not exceeding
MAX_JIFFY_OFFSET. The timer wheel's existing handling of very long
delays is unchanged.
Fixes: 80c578930ce7 ("dm thin: add 'no_space_timeout' dm-thin-pool module param")
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <1075151112@qq.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2542,7 +2542,9 @@ static void set_pool_mode(struct pool *p
struct pool_c *pt = pool->ti->private;
bool needs_check = dm_pool_metadata_needs_check(pool->pmd);
enum pool_mode old_mode = get_pool_mode(pool);
- unsigned long no_space_timeout = READ_ONCE(no_space_timeout_secs) * HZ;
+ unsigned long no_space_timeout =
+ min_t(unsigned long, READ_ONCE(no_space_timeout_secs),
+ MAX_JIFFY_OFFSET / HZ) * HZ;
/*
* Never allow the pool to transition to PM_WRITE mode if user
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0864/1005] dm-pcache: do not advance dirty_tail after backing flush failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (862 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0863/1005] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0865/1005] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
` (134 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, guolingxing, Mikulas Patocka,
Dongsheng Yang
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: guolingxing <guolingxing@tju.edu.cn>
commit b1310cb291935c788f34ed6eb1e7e9b42cfac045 upstream.
After all writeback bios for a kset complete, writeback_ctx_end()
flushes the backing device and then advances the persistent dirty_tail.
However, backing_dev_flush() discards the error returned by
blkdev_issue_flush(), so dirty_tail is advanced even when the written
data is not known to be durable.
dirty_tail points to the first kset that still requires writeback.
Advancing it causes recovery to treat the preceding kset as clean and
allows its cache copy to eventually be reclaimed by garbage collection.
If the backing device flush failed, a subsequent power failure may
therefore result in data loss.
Make backing_dev_flush() return the flush status and handle a flush
failure like a writeback I/O failure. Leave dirty_tail unchanged so
that the same kset will be retried.
Fixes: 1d57628ff95b ("dm-pcache: add persistent cache target in device-mapper")
Cc: stable@vger.kernel.org
Signed-off-by: guolingxing <guolingxing@tju.edu.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-pcache/backing_dev.c | 4 ++--
drivers/md/dm-pcache/backing_dev.h | 2 +-
drivers/md/dm-pcache/cache_writeback.c | 28 +++++++++++++++++++++-------
3 files changed, 24 insertions(+), 10 deletions(-)
--- a/drivers/md/dm-pcache/backing_dev.c
+++ b/drivers/md/dm-pcache/backing_dev.c
@@ -336,9 +336,9 @@ struct pcache_backing_dev_req *backing_d
return backing_req;
}
-void backing_dev_flush(struct pcache_backing_dev *backing_dev)
+int backing_dev_flush(struct pcache_backing_dev *backing_dev)
{
- blkdev_issue_flush(backing_dev->dm_dev->bdev);
+ return blkdev_issue_flush(backing_dev->dm_dev->bdev);
}
int pcache_backing_init(void)
--- a/drivers/md/dm-pcache/backing_dev.h
+++ b/drivers/md/dm-pcache/backing_dev.h
@@ -120,7 +120,7 @@ struct pcache_backing_dev_req *backing_d
struct pcache_backing_dev_req_opts *opts);
void backing_dev_req_init(struct pcache_backing_dev_req *backing_req,
struct pcache_backing_dev_req_opts *opts);
-void backing_dev_flush(struct pcache_backing_dev *backing_dev);
+int backing_dev_flush(struct pcache_backing_dev *backing_dev);
int pcache_backing_init(void);
void pcache_backing_exit(void);
--- a/drivers/md/dm-pcache/cache_writeback.c
+++ b/drivers/md/dm-pcache/cache_writeback.c
@@ -18,12 +18,18 @@ static void writeback_ctx_end(struct pca
return;
if (!cache->writeback_ctx.ret) {
- backing_dev_flush(cache->backing_dev);
-
- mutex_lock(&cache->dirty_tail_lock);
- cache_pos_advance(&cache->dirty_tail, cache->writeback_ctx.advance);
- cache_encode_dirty_tail(cache);
- mutex_unlock(&cache->dirty_tail_lock);
+ ret = backing_dev_flush(cache->backing_dev);
+ if (ret) {
+ pcache_dev_err(CACHE_TO_PCACHE(cache),
+ "failed to flush backing device: %d", ret);
+ cache->writeback_ctx.ret = ret;
+ } else {
+ mutex_lock(&cache->dirty_tail_lock);
+ cache_pos_advance(&cache->dirty_tail,
+ cache->writeback_ctx.advance);
+ cache_encode_dirty_tail(cache);
+ mutex_unlock(&cache->dirty_tail_lock);
+ }
}
queue_delayed_work(cache_get_wq(cache), &cache->writeback_work, 0);
}
@@ -76,8 +82,16 @@ static inline bool is_cache_clean(struct
void cache_writeback_exit(struct pcache_cache *cache)
{
+ int ret;
+
cancel_delayed_work_sync(&cache->writeback_work);
- backing_dev_flush(cache->backing_dev);
+
+ ret = backing_dev_flush(cache->backing_dev);
+ if (ret)
+ pcache_dev_err(CACHE_TO_PCACHE(cache),
+ "failed to flush backing device during exit: %d",
+ ret);
+
cache_tree_exit(&cache->writeback_key_tree);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0865/1005] dm-sysfs: fix misbehavior if kobject_init_and_add fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (863 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0864/1005] dm-pcache: do not advance dirty_tail after backing flush failure Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0866/1005] dm-verity: dont restart or panic on errors during system shutdown Greg Kroah-Hartman
` (133 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka, Wentao Liang
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 406d576cc457203cf86eac7f17839b2efec81db4 upstream.
If kobject_init_and_add fails, we must call kobject_put (see the comment
at kobject_init_and_add).
Before calling kobject_init_and_add, we must zero the kobject (see
https://lwn.net/Articles/52085/). If the first call to dm_sysfs_init
failed, it may be called again, and that second call would see an
uninitialized kobject.
Cc: stable@vger.kernel.org
Fixes: 784aae735d9b ("dm: add name and uuid to sysfs")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-sysfs.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -128,9 +128,20 @@ static const struct kobj_type dm_ktype =
*/
int dm_sysfs_init(struct mapped_device *md)
{
- return kobject_init_and_add(dm_kobject(md), &dm_ktype,
- &disk_to_dev(dm_disk(md))->kobj,
- "%s", "dm");
+ struct kobject *kobj = dm_kobject(md);
+ int r;
+
+ /* The kobject must be zeroed before calling kobject_init */
+ memset(kobj, 0, sizeof(struct kobject));
+ r = kobject_init_and_add(kobj, &dm_ktype,
+ &disk_to_dev(dm_disk(md))->kobj,
+ "%s", "dm");
+ if (unlikely(r)) {
+ /* Weird semantics - we must call kobject_put on failure */
+ dm_sysfs_exit(md);
+ return r;
+ }
+ return 0;
}
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0866/1005] dm-verity: dont restart or panic on errors during system shutdown
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (864 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0865/1005] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0867/1005] dm persistent data: test return value of node_copy Greg Kroah-Hartman
` (132 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongyu Jin, weijiang.zhou,
Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weijiang Zhou <weijiang.zhou@unisoc.com>
commit 47930d1236d2988cdc580c10d3af21b6b02d7ece upstream.
Commit 252bd1256396 ("dm verity: skip verity work if I/O error when system
is shutting down") stopped I/O errors during shutdown from triggering a
restart, since devices may legitimately be gone by then. Errors that reach
verity_handle_err(), e.g. through a failed hash block read followed by a
failed FEC attempt, are not covered and still call kernel_restart() or
panic().
During a reboot that is both wrong (nothing is corrupt) and harmful: it
races with the reboot already in progress and replaces its reason with
"dm-verity device corrupted", which bootloaders such as Android's treat as
a verity failure and switch the device to EIO mode.
Apply the same shutdown check in verity_handle_err(). Corruption is still
logged, recorded in hash_failed and reported via uevent, and the I/O still
fails.
Signed-off-by: Hongyu Jin <hongyu.jin@unisoc.com>
Signed-off-by: weijiang.zhou <weijiang.zhou@unisoc.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 252bd1256396 ("dm verity: skip verity work if I/O error when system is shutting down")
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-verity-target.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
--- a/drivers/md/dm-verity-target.c
+++ b/drivers/md/dm-verity-target.c
@@ -171,6 +171,15 @@ static void verity_hash_at_level(struct
}
/*
+ * Skip verity work in response to I/O error when system is shutting down.
+ */
+static inline bool verity_is_system_shutting_down(void)
+{
+ return system_state == SYSTEM_HALT || system_state == SYSTEM_POWER_OFF
+ || system_state == SYSTEM_RESTART;
+}
+
+/*
* Handle verification errors.
*/
static int verity_handle_err(struct dm_verity *v, enum verity_block_type type,
@@ -219,6 +228,15 @@ out:
if (v->mode == DM_VERITY_MODE_LOGGING)
return 0;
+ /*
+ * Devices may already be quiesced (e.g. UFS set offline by its
+ * shutdown hook), so a failure here does not imply corruption. Fail
+ * the I/O but do not restart or panic, which would also override the
+ * reboot reason of the shutdown already in progress.
+ */
+ if (verity_is_system_shutting_down())
+ return 1;
+
if (v->mode == DM_VERITY_MODE_RESTART)
kernel_restart("dm-verity device corrupted");
@@ -593,15 +611,6 @@ error:
return r;
}
-/*
- * Skip verity work in response to I/O error when system is shutting down.
- */
-static inline bool verity_is_system_shutting_down(void)
-{
- return system_state == SYSTEM_HALT || system_state == SYSTEM_POWER_OFF
- || system_state == SYSTEM_RESTART;
-}
-
static void restart_io_error(struct work_struct *w)
{
kernel_restart("dm-verity device has I/O error");
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0867/1005] dm persistent data: test return value of node_copy
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (865 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0866/1005] dm-verity: dont restart or panic on errors during system shutdown Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0868/1005] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
` (131 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 624d146d97c5fbe7200ef4b2dd5350ecf57d6b79 upstream.
There were 3 places where the return value of node_copy was not tested.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: c671ffa55d8b ("dm btree remove: change a bunch of BUG_ON() calls to proper errors")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/persistent-data/dm-btree-remove.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--- a/drivers/md/persistent-data/dm-btree-remove.c
+++ b/drivers/md/persistent-data/dm-btree-remove.c
@@ -253,7 +253,9 @@ static int __rebalance2(struct dm_btree_
/*
* Merge
*/
- node_copy(left, right, -nr_right);
+ ret = node_copy(left, right, -nr_right);
+ if (unlikely(ret))
+ return ret;
left->header.nr_entries = cpu_to_le32(nr_left + nr_right);
delete_at(parent, r->index);
@@ -315,13 +317,16 @@ static int delete_center_node(struct dm_
{
uint32_t max_entries = le32_to_cpu(left->header.max_entries);
unsigned int shift = min(max_entries - nr_left, nr_center);
+ int ret;
if (nr_left + shift > max_entries) {
DMERR("node shift out of bounds");
return -EINVAL;
}
- node_copy(left, center, -shift);
+ ret = node_copy(left, center, -shift);
+ if (unlikely(ret))
+ return ret;
left->header.nr_entries = cpu_to_le32(nr_left + shift);
if (shift != nr_center) {
@@ -333,7 +338,9 @@ static int delete_center_node(struct dm_
}
node_shift(right, shift);
- node_copy(center, right, shift);
+ ret = node_copy(center, right, shift);
+ if (unlikely(ret))
+ return ret;
right->header.nr_entries = cpu_to_le32(nr_right + shift);
}
*key_ptr(parent, r->index) = right->keys[0];
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0868/1005] dm persistent data: dont ignore writeback errors
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (866 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0867/1005] dm persistent data: test return value of node_copy Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0869/1005] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
` (130 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit fa887f2ebee7aff97eb87b3365939616ade09774 upstream.
An error returned by ie_cache_writeback could be silently overwritten by
another successful ie_cache_writeback. This commit fixes disk_ll_commit,
so that it doesn't ignore the error and returns it immediatelly.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 6b06dd5a9722 ("dm space map disk: cache a small number of index entries")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/persistent-data/dm-space-map-common.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/md/persistent-data/dm-space-map-common.c
+++ b/drivers/md/persistent-data/dm-space-map-common.c
@@ -1190,17 +1190,20 @@ static dm_block_t disk_ll_max_entries(st
static int disk_ll_commit(struct ll_disk *ll)
{
- int r = 0;
+ int r;
unsigned int i;
for (i = 0; i < IE_CACHE_SIZE; i++) {
struct ie_cache *iec = ll->ie_cache + i;
- if (iec->valid && iec->dirty)
+ if (iec->valid && iec->dirty) {
r = ie_cache_writeback(ll, iec);
+ if (unlikely(r))
+ return r;
+ }
}
- return r;
+ return 0;
}
int sm_ll_new_disk(struct ll_disk *ll, struct dm_transaction_manager *tm)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0869/1005] dm persistent data: dont leak bufio buffer if find_leaf fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (867 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0868/1005] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0870/1005] dm snapshot: fix discard_granularity unit in snapshot_io_hints Greg Kroah-Hartman
` (129 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit b27523a0781aae0b51ac13f29dc65373d14b8434 upstream.
If find_leaf fails, the function dm_btree_cursor_begin would return an
error, but it would keep the dm-bufio buffers held. This would result in
a memory leak and a warning when releasing the dm-bufio cache.
This commit fixes it, so that dm_btree_cursor_begin releases the buffers
on error.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 7d111c81fa29 ("dm btree: introduce cursor api")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/persistent-data/dm-btree.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -1582,7 +1582,13 @@ int dm_btree_cursor_begin(struct dm_btre
if (r)
return r;
- return find_leaf(c);
+ r = find_leaf(c);
+ if (unlikely(r)) {
+ dm_btree_cursor_end(c);
+ return r;
+ }
+
+ return 0;
}
EXPORT_SYMBOL_GPL(dm_btree_cursor_begin);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0870/1005] dm snapshot: fix discard_granularity unit in snapshot_io_hints
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (868 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0869/1005] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0871/1005] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
` (128 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1288484b13bf6af3620d,
wuyuehong, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: wuyuehong <wuyuehong@cmss.chinamobile.com>
commit d7216d7be2bbfdf3312695b6e41a4fc7c5e22902 upstream.
snapshot_io_hints() copies the snapshot store's chunk_size, which is
in 512-byte sectors, into queue_limits.discard_granularity, which, like
all other members of struct queue_limits, is in bytes.
For snapshots with a chunk size smaller than 512 sectors, e.g. the
16 KiB (32-sector) chunks created by the syzkaller reproducer, the
resulting granularity is smaller than a single sector. When
dm_calculate_queue_limits() then stacks the target limits into the
table limits:
blk_stack_limits(limits, &ti_limits, 0)
queue_limit_discard_alignment() truncates that granularity to zero
sectors and sector_div() divides by zero:
Oops: divide error: 0000 [#1] SMP KASAN NOPTI
RIP: 0010:queue_limit_discard_alignment block/blk-settings.c:645 [inline]
RIP: 0010:blk_stack_limits+0x1105/0x2d00 block/blk-settings.c:916
Call Trace:
dm_calculate_queue_limits+0x70c/0x1510 drivers/md/dm-table.c:1823
dm_setup_md_queue+0x199/0x4f0 drivers/md/dm.c:2618
table_load+0x4fd/0x8a0 drivers/md/dm-ioctl.c:1661
The divide fault itself only became reachable when commit e924da7d6622
("block: Drop granularity check in queue_limit_discard_alignment()")
removed the check for a sub-sector granularity in v6.13. Kernels
before that returned a zero discard alignment instead of faulting, but
they still advertised a granularity 512 times too small.
Use the same chunk_size << SECTOR_SHIFT conversion that
io_overlaps_chunk() already applies to turn chunk_size into bytes.
Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features")
Reported-by: syzbot+1288484b13bf6af3620d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1288484b13bf6af3620d
Cc: stable@vger.kernel.org
Signed-off-by: wuyuehong <wuyuehong@cmss.chinamobile.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-snap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -2414,7 +2414,7 @@ static void snapshot_io_hints(struct dm_
snap = snap_src;
/* All discards are split on chunk_size boundary */
- limits->discard_granularity = snap->store->chunk_size;
+ limits->discard_granularity = snap->store->chunk_size << SECTOR_SHIFT;
limits->max_hw_discard_sectors = snap->store->chunk_size;
up_read(&_origins_lock);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0871/1005] dm snapshot: split discards on chunk boundaries
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (869 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0870/1005] dm snapshot: fix discard_granularity unit in snapshot_io_hints Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0872/1005] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
` (127 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Cheng, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Cheng <chencheng@fnnas.com>
commit 4fe2c2baad01da64d47f1a0c8fc093df994bcef5 upstream.
dm-snapshot did not set ti->max_discard_granularity when it allows
discards, so a discard could reach the target unaligned, or spanning
several chunks. Set the flag, so dm splits discards on chunk
boundaries.
Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features")
Cc: stable@vger.kernel.org
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-snap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1358,8 +1358,10 @@ static int snapshot_ctr(struct dm_target
ti->private = s;
ti->num_flush_bios = num_flush_bios;
- if (s->discard_zeroes_cow)
+ if (s->discard_zeroes_cow) {
ti->num_discard_bios = (s->discard_passdown_origin ? 2 : 1);
+ ti->max_discard_granularity = true;
+ }
ti->per_io_data_size = sizeof(struct dm_snap_tracked_chunk);
/* Add snapshot to the list of snapshots for this origin */
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0872/1005] dm snapshot: fix discard writing into the next COW chunk
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (870 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0871/1005] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0873/1005] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
` (126 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Cheng, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Cheng <chencheng@fnnas.com>
commit 73174b4bb6fcd0e6cf973c9402a0fae2e567ad9f upstream.
zero_exception() zeroes one chunk of the COW device and takes the start
sector from bio->bi_iter.bi_sector. remap_exception() has already set
that to the COW chunk start plus the offset inside the chunk. That
offset is needed for reads and writes, but for a discard it is wrong:
the zeroing window is shifted, so the head of the target chunk keeps
its old data and the tail lands in the next COW chunk, which holds a
different exception.
io_overlaps_chunk() should have caught this, but it only compares the
length. "maps to entire chunks" in snapshot.rst also means the discard
has to start on a chunk boundary.
A discard that is not a full chunk has a second problem: after
remap_exception() it is sent to the COW device, where it hits a chunk
that still backs a live exception. After a discard the contents are
undefined, but the exception stays in the table and keeps pointing at
that chunk, so a later read returns whatever the discard left instead
of the snapshot's data.
Reproducer:
truncate -s 4M o.img c.img
o=$(losetup -f --show o.img)
c=$(losetup -f --show c.img)
dmsetup create snap --table \
"0 8192 snapshot $o $c P 512 1 discard_zeroes_cow"
# write two chunks, this creates two exceptions
head -c 256K /dev/zero | tr '\000' '\252' > pat
dd if=pat of=/dev/mapper/snap bs=256K seek=1 count=1 conv=notrunc
dd if=pat of=/dev/mapper/snap bs=256K seek=2 count=1 conv=notrunc
# shift the snapshot by 8 sectors, so a discard that is aligned on
# top is unaligned inside the snapshot
dmsetup create top --table "0 8184 linear /dev/mapper/snap 8"
blkdiscard -o 262144 -l 262144 /dev/mapper/top
sync
echo 3 > /proc/sys/vm/drop_caches
# chunk 1
dd if=/dev/mapper/snap bs=512 skip=512 count=8 | od -An -tx1 -N1
# chunk 2
dd if=/dev/mapper/snap bs=512 skip=1024 count=8 | od -An -tx1 -N1
Before: aa 00 <- chunk 2 was zeroed although it was not discarded
After: aa aa <- nothing written, a discard is only a hint
Fix it by requiring the discard to start on a chunk boundary in
io_overlaps_chunk(), and by finishing a discard that is not a full
chunk with bio_endio() instead of passing it down to the COW device.
Fixes: 2e6023850e17 ("dm snapshot: add optional discard support features")
Cc: stable@vger.kernel.org
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-snap.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1948,8 +1948,8 @@ static void zero_exception(struct dm_sna
static bool io_overlaps_chunk(struct dm_snapshot *s, struct bio *bio)
{
- return bio->bi_iter.bi_size ==
- (s->store->chunk_size << SECTOR_SHIFT);
+ return bio->bi_iter.bi_size == (s->store->chunk_size << SECTOR_SHIFT) &&
+ !(bio->bi_iter.bi_sector & s->store->chunk_mask);
}
static int snapshot_map(struct dm_target *ti, struct bio *bio)
@@ -2009,11 +2009,13 @@ static int snapshot_map(struct dm_target
e = dm_lookup_exception(&s->complete, chunk);
if (e) {
remap_exception(s, e, bio, chunk);
- if (unlikely(bio_op(bio) == REQ_OP_DISCARD) &&
- io_overlaps_chunk(s, bio)) {
+ if (unlikely(bio_op(bio) == REQ_OP_DISCARD)) {
dm_exception_table_unlock(&lock);
up_read(&s->lock);
- zero_exception(s, e, bio, chunk);
+ if (io_overlaps_chunk(s, bio))
+ zero_exception(s, e, bio, chunk);
+ else
+ bio_endio(bio);
r = DM_MAPIO_SUBMITTED; /* discard is not issued */
goto out;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0873/1005] dm zoned: back off when reclaim cannot make progress
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (871 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0872/1005] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0874/1005] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
` (125 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyrylo Biryuk, Damien Le Moal,
Hannes Reinecke, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyrylo Biryuk <illofspeed@gmail.com>
commit 9bb1d14877f4929be17f7fdbeb4cfdf5025d464b upstream.
When a reclaim pass cannot make progress, dmz_reclaim_work() still ends
with dmz_schedule_reclaim(). If the target is idle, dmz_should_reclaim()
keeps returning true, the work is queued again with no delay and the
worker spins on the same failing pass. This patch handles two such
cases:
- dmz_do_reclaim() fails with -ENOSPC because no free zone is
available to copy the data into, for example on a target without
cache zones that has no free sequential zone left. The next patch
also makes this the expected result when an idle target with cache
zones has random zones but no free sequential zone.
- dmz_do_reclaim() finds no zone it can lock for reclaim and returns
-EBUSY. Since commit 90a9b8693f1b ("dm zoned: reclaim random zones
when idle"), dmz_should_reclaim() returns true on an idle target
whenever the total number of random (and cache) zones is non-zero,
whether or not any of them holds data. Each pass then also runs
dmz_check_dev(), which checks every device for media events (a TEST
UNIT READY on SCSI disks).
The -EBUSY loop lasts as long as the target stays idle; it ends when a
pass finishes while the target is busy and has enough free zones. On
three 27 TB host-managed SATA drives used as md RAID5 members (7.2.10
with the module built out of tree, all random zones free, target idle
for 300 seconds, kprobes attached, two other drives on the controller
being zero-filled), each member's SCSI device counted about 108,000
requests per second with the stock module and the system used about
915 s of CPU time, against about 46 s with this series. libata completes
TEST UNIT READY in software, so these counters do not measure commands
sent to the drives; the cost is CPU time.
When a pass fails with -ENOSPC or -EBUSY, retrying at once is unlikely
to make progress: re-arm the idle poll instead, so that reclaim is
retried after DMZ_IDLE_PERIOD unless a zone allocation or a "reclaim"
message queues it earlier. On a busy target, zone allocations can
restart reclaim immediately when free space is low enough to require
reclaim. Re-arming also keeps the poll running after a complete idle
drain. The poll can still stop after a pass that ends while reclaim is
not needed; that is unchanged.
Skip the device check for these two results: they normally mean that
there is no zone to copy into or no zone to reclaim, not that a device
failed, and the I/O paths check the devices themselves. Use
queue_delayed_work() so that work an allocation has already queued is
not postponed.
A pass that fails with an I/O error, for example on an unreadable block
of a device that stays online, is still retried at once while the
target is idle; this patch does not change that.
Tested on 7.4-rc1 with this patch and the next one, on three emulated
host-managed drives (scsi_debug, 1 GiB, 32 MiB zones) each under
dm-zoned as md RAID5 members, all random zones free and the target idle
for 300 seconds. With the stock module each member's SCSI device counted
about 70.2 million requests and the reclaim workers used 726 s of CPU.
With this series: 75 requests per member, 30 passes per worker (one per
DMZ_IDLE_PERIOD) and 0.08 s of CPU. Data written during the tests read
back with matching checksums, and no kernel warnings were logged.
Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
Fixes: 90a9b8693f1b ("dm zoned: reclaim random zones when idle")
Cc: stable@vger.kernel.org
Signed-off-by: Kyrylo Biryuk <illofspeed@gmail.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-zoned-reclaim.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/md/dm-zoned-reclaim.c
+++ b/drivers/md/dm-zoned-reclaim.c
@@ -537,6 +537,16 @@ static void dmz_reclaim_work(struct work
dmz_nr_rnd_zones(zmd, zrc->dev_idx));
ret = dmz_do_reclaim(zrc);
+ if (ret == -ENOSPC || ret == -EBUSY) {
+ /*
+ * No zone to copy into (-ENOSPC) or no zone to reclaim
+ * (-EBUSY): retrying at once cannot make progress and would
+ * spin. Poll again after the idle period instead, without
+ * postponing work that an allocation has already queued.
+ */
+ queue_delayed_work(zrc->wq, &zrc->work, DMZ_IDLE_PERIOD);
+ return;
+ }
if (ret && ret != -EINTR) {
if (!dmz_check_dev(zmd))
return;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0874/1005] dm zoned: do not reclaim a random zone into another random zone
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (872 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0873/1005] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0875/1005] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
` (124 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Hannes Reinecke,
Kyrylo Biryuk, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyrylo Biryuk <illofspeed@gmail.com>
commit dab527d83462a618d99bfc96370ce45ae3428706 upstream.
dmz_reclaim_rnd_data() falls back to a random destination zone when no
free sequential zone is available and the target has cache zones. When
the target is idle and the cache zone list is empty,
dmz_get_rnd_zone_for_reclaim() selects random zones of the zoned device
as well, so a random zone is then copied into another random zone. That
frees nothing: the next pass picks the next random zone and copies it
again, for as long as the target stays idle.
Seen on a two-device target (256 GiB regular cache device plus a 27 TB
host-managed drive) used as an md RAID5 member: after a full rebuild
every chunk was mapped and no sequential zone was free, and the idle
drive kept reading and writing while the free zone counters
in "dmsetup status" did not change.
Only switch to a random destination zone when the zone being reclaimed
is a cache zone: moving it to the zoned device still frees cache space.
This depends on "dm zoned: back off when reclaim cannot make progress":
without it, dmz_reclaim_work() would retry the resulting -ENOSPC at
once, and run dmz_check_dev(), for as long as the target stays idle.
Tested on 7.4-rc1 together with the previous patch, on a two-device
target (a 512 MiB RAM-backed regular cache device plus a 1 GiB
scsi_debug host-managed drive) filled until no sequential zone was
free, then idle for 60 seconds: the stock module made 877
random-to-random copies; with this series it made none, and each pass
failed with -ENOSPC once per DMZ_IDLE_PERIOD without a device check.
Fixes: c5c788595292 ("dm zoned: start reclaim with sequential zones")
Cc: stable@vger.kernel.org
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Kyrylo Biryuk <illofspeed@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-zoned-reclaim.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-zoned-reclaim.c
+++ b/drivers/md/dm-zoned-reclaim.c
@@ -288,7 +288,13 @@ static int dmz_reclaim_rnd_data(struct d
again:
szone = dmz_alloc_zone(zmd, zrc->dev_idx,
alloc_flags | DMZ_ALLOC_RECLAIM);
- if (!szone && alloc_flags == DMZ_ALLOC_SEQ && dmz_nr_cache_zones(zmd)) {
+ /*
+ * If no free sequential zone is available, a cache zone can still be
+ * moved into a free random zone of the zoned device, which frees cache
+ * space. Do not do this for a random zone: moving it into another
+ * random zone frees nothing and, on an idle target, repeats forever.
+ */
+ if (!szone && alloc_flags == DMZ_ALLOC_SEQ && dmz_is_cache(dzone)) {
alloc_flags = DMZ_ALLOC_RND;
goto again;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0875/1005] dm-cache: fix NULL pointer dereference on open failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (873 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0874/1005] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0876/1005] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
` (123 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit d12afc2f9ed6e14019fed9c02a74ad699915dc85 upstream.
When __begin_transaction_flags in metadata_open fails,
dm_cache_metadata_close is called. dm_cache_metadata_close attempts to
execute list_del(&cmd->list);, but the "cmd" object is not on any list
yet, thus it crashes with NULL pointer dereference.
Fix this by initializing cmd->list after cmd is allocated.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 9b1cc9f251af ("dm cache: share cache-metadata object across inactive and active DM tables")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-metadata.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -766,6 +766,7 @@ static struct dm_cache_metadata *metadat
return ERR_PTR(-ENOMEM);
}
+ INIT_LIST_HEAD(&cmd->list);
cmd->version = metadata_version;
refcount_set(&cmd->ref_count, 1);
init_rwsem(&cmd->root_lock);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0876/1005] dm-cache: fix ending a cursor that never began
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (874 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0875/1005] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0877/1005] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers Greg Kroah-Hartman
` (122 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 421420758be348cb90715bfaa26e1211a12ff1d0 upstream.
If dm_bitset_cursor_begin fails, dm_array_cursor_end(&cmd->hint_cursor)
is called. However, cmd->hint_cursor was only initialized if the variable
hints_valid is true. Thus, we must also destroy hint_cursor only if
hints_valid is true.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 629d0a8a1a10 ("dm cache metadata: add "metadata2" feature")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-metadata.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-cache-metadata.c
+++ b/drivers/md/dm-cache-metadata.c
@@ -1433,7 +1433,8 @@ static int __load_mappings(struct dm_cac
from_cblock(cmd->cache_blocks),
&cmd->dirty_cursor);
if (r) {
- dm_array_cursor_end(&cmd->hint_cursor);
+ if (hints_valid)
+ dm_array_cursor_end(&cmd->hint_cursor);
dm_array_cursor_end(&cmd->mapping_cursor);
return r;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0877/1005] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (875 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0876/1005] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0878/1005] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
` (121 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+ff132cb52bce4f44ecc9,
xietangxin, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: xietangxin <xietangxin@h-partners.com>
commit bd93c4e59c5132282c01f142806e307c7380e7ea upstream.
When integrity_key_size parameter is paired with a pure AEAD cipher that
is not an authenc composite, crypt_ctr_auth_cipher() returns 0 early
without allocating cc->authenc_key, but cc->key_mac_size remains
non-zero because CRYPT_KEY_MAC_SIZE_SET was set during option parsing.
As a result crypt_copy_authenckey() dereferences NULL crashes the kernel.
Reject the contradictory configuration explicitly instead of silently
returning 0, so userspace gets a clear -EINVAL.
Fixes: 4441686b24a1 ("dm-crypt: Allow to specify the integrity key size as option")
Cc: stable@vger.kernel.org
Reported-by: syzbot+ff132cb52bce4f44ecc9@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ff132cb52bce4f44ecc9
Assisted-by: LLM
Signed-off-by: xietangxin <xietangxin@h-partners.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -2826,8 +2826,11 @@ static int crypt_ctr_auth_cipher(struct
char *start, *end, *mac_alg = NULL;
struct crypto_ahash *mac;
- if (!strstarts(cipher_api, "authenc("))
+ if (!strstarts(cipher_api, "authenc(")) {
+ if (test_bit(CRYPT_KEY_MAC_SIZE_SET, &cc->cipher_flags))
+ return -EINVAL;
return 0;
+ }
start = strchr(cipher_api, '(');
end = strchr(cipher_api, ',');
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0878/1005] dm-crypt: defer async write submission to write thread
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (876 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0877/1005] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0879/1005] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
` (120 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Schlehofer, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Schlehofer <pepe.schlehofer@gmail.com>
commit 6fed9e26810f0b466dbcebe35a73d1fd48793ff5 upstream.
With no_write_workqueue, kcryptd_crypt_write_io_submit() submits the
bio directly, even when called from kcryptd_async_done(). An async
cipher may run this callback in softirq or with BH disabled, where
submit_bio_noacct() must not be called because it can sleep.
Submit inline only when async is false. Async completions are sent to
the write thread, as is already done for submit_from_crypt_cpus. Use
the async flag rather than in_interrupt(), since callback context
depends on the cipher driver. Sync ciphers still submit inline.
Tested with cryptd in QEMU (x86_64 and arm64) with
CONFIG_DEBUG_ATOMIC_SLEEP, and on a P2020 running 6.18.55 without it.
In QEMU:
- 4k writes logging "sleeping function called from invalid context":
100/100 unpatched, 0/155 patched.
- nr_requests=4 on a loop device: 0/6 unpatched runs completed,
4/4 patched runs completed.
On the P2020, a warning in blk_mq_run_hw_queue() appeared in the
6th unpatched run and did not appear in 30 patched runs.
Fixes: 39d42fa96ba1 ("dm crypt: add flags to optionally bypass kcryptd workqueues")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1964,8 +1964,9 @@ static void kcryptd_crypt_write_io_submi
/* crypt_convert should have filled the clone bio */
BUG_ON(io->ctx.iter_out.bi_size);
- if ((likely(!async) && test_bit(DM_CRYPT_NO_OFFLOAD, &cc->flags)) ||
- test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags)) {
+ if (likely(!async) &&
+ (test_bit(DM_CRYPT_NO_OFFLOAD, &cc->flags) ||
+ test_bit(DM_CRYPT_NO_WRITE_WORKQUEUE, &cc->flags))) {
dm_submit_bio_remap(io->base_bio, clone);
return;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0879/1005] dm-integrity: dont recalculate with HMAC because of a dirty bitmap
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (877 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0878/1005] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0880/1005] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
` (119 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sinan Polat, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sinan Polat <sinan86polat@gmail.com>
commit 875a7161fe1574205293c36f7bbd0815023e48a1 upstream.
Commit 5c02406428d5 ("dm integrity: conditionally disable "recalculate"
feature") refuses a superblock with SB_FLAG_RECALCULATING if a keyed
hash is used without "legacy_recalculate". Otherwise someone who can
write to the device, but does not know the key, could modify data and
have the kernel compute valid tags for it.
dm_integrity_resume() can still start the same recalculation in J or D
mode: if SB_FLAG_DIRTY_BITMAP is set and the bitmap is not clear, or
log2_blocks_per_bitmap_bit does not match, it sets
SB_FLAG_RECALCULATING and recalc_sector = 0. The superblock is not
authenticated unless fix_hmac and journal_mac are both used, so the
flag can be set offline. Resume also runs on the first activation.
Apply the constructor's policy there. If recalculation is not allowed,
log an error and keep the existing tags, so modified blocks fail
verification. This also avoids queueing recalc_work on a NULL
recalc_wq when internal_hash is not used.
Fixes: 5c02406428d5 ("dm integrity: conditionally disable "recalculate" feature")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sinan Polat <sinan86polat@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -3888,6 +3888,24 @@ static bool superblock_changed(struct dm
memcmp(ic->sb->salt, ic->sb_copy->salt, SALT_SIZE) != 0;
}
+/*
+ * The superblock is authenticated only if fix_hmac and journal_mac are used,
+ * so SB_FLAG_DIRTY_BITMAP may have been set by someone who doesn't know the
+ * key. Apply the policy that the constructor applies to SB_FLAG_RECALCULATING.
+ */
+static bool dm_integrity_may_recalc_dirty_bitmap(struct dm_integrity_c *ic)
+{
+ if (!ic->internal_hash) {
+ DMERR("Dirty bitmap found, but internal_hash is not used");
+ return false;
+ }
+ if (dm_integrity_disable_recalculate(ic)) {
+ DMERR("Dirty bitmap found, but HMAC recalculation requires \"legacy_recalculate\"");
+ return false;
+ }
+ return true;
+}
+
static void dm_integrity_resume(struct dm_target *ti)
{
struct dm_integrity_c *ic = ti->private;
@@ -3977,8 +3995,10 @@ static void dm_integrity_resume(struct d
if (!(ic->sb->log2_blocks_per_bitmap_bit == ic->log2_blocks_per_bitmap_bit &&
block_bitmap_op(ic, ic->journal, 0, ic->provided_data_sectors, BITMAP_OP_TEST_ALL_CLEAR)) ||
ic->reset_recalculate_flag) {
- ic->sb->flags |= cpu_to_le32(SB_FLAG_RECALCULATING);
- ic->sb->recalc_sector = cpu_to_le64(0);
+ if (dm_integrity_may_recalc_dirty_bitmap(ic)) {
+ ic->sb->flags |= cpu_to_le32(SB_FLAG_RECALCULATING);
+ ic->sb->recalc_sector = cpu_to_le64(0);
+ }
}
init_journal(ic, 0, ic->journal_sections, 0);
replay_journal(ic);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0880/1005] dm-integrity: dont attempt to commit journal on disabled device
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (878 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0879/1005] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0881/1005] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
` (118 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+94dac3c75477e184f0b0,
Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit e5e03918fbec31f0c896f4f43c2bd2aadf35d43d upstream.
If the device is disabled due to an error, we shouldn't attempt to flush
the journal. We jump straight to the label release_flush_bios, that will
call do_endio on all queued bios. do_endio will terminate the bios with
the error.
This fixes WARN_ON in the function pad_uncommitted reported by syzkaller.
Reported-by: syzbot+94dac3c75477e184f0b0@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=94dac3c75477e184f0b0
Fixes: 7eada909bfd7 ("dm: add integrity target")
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -2908,6 +2908,11 @@ static void integrity_commit(struct work
spin_lock_irq(&ic->endio_wait.lock);
flushes = bio_list_get(&ic->flush_bio_list);
+ if (unlikely(dm_integrity_failed(ic))) {
+ wake_up_locked(&ic->endio_wait);
+ spin_unlock_irq(&ic->endio_wait.lock);
+ goto release_flush_bios;
+ }
if (unlikely(ic->mode != 'J')) {
spin_unlock_irq(&ic->endio_wait.lock);
dm_integrity_flush_buffers(ic, true);
@@ -5429,7 +5434,6 @@ try_smaller_buffer:
r = create_journal(ic, &ti->error);
if (r)
goto bad;
-
}
if (ic->mode == 'B') {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0881/1005] dm-raid: bound array_position before indexing failed_devices
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (879 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0880/1005] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0882/1005] dm-raid: fix use-after-free in raid_dtr() Greg Kroah-Hartman
` (117 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jay Vadayath, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jay Vadayath <jay@artiphishell.com>
commit 11b5cd14c0eecae458cecbe53d21a3dbc10190f5 upstream.
super_init_validation() reads role = le32_to_cpu(sb2->array_position)
out of an on-disk dm_raid_superblock and then uses it as a bit index into
the failed_devices bitmap via test_bit(role, (void *)failed_devices).
failed_devices is a uint64_t[DISKS_ARRAY_ELEMS] (DISKS_ARRAY_ELEMS == 4,
i.e. 256 bits) living on the stack. The only guard is role < 0, so any
on-disk array_position >= 256 makes test_bit() read past the end of the
stack array (array_position == 256 reads failed_devices[4], 8 bytes past
the object). For a raid1 set the role != raid_disk reorder branch falls
through to the same test_bit().
A crafted dm-raid superblock therefore causes a stack out-of-bounds read
during table load. Reachable by anyone able to issue a dmsetup create
with attacker-controlled metadata (CAP_SYS_ADMIN in the target
namespace); the crash fires in the constructor / analyse_superblocks
path, before any md_run or array sizing.
BUG: KASAN: stack-out-of-bounds in super_validate+0x1cd0/0x3390
Read of size 8 at addr ffff888007b17828 by task poc/152
Call Trace:
dump_stack_lvl+0x64/0x80
print_report+0xd0/0x630
kasan_report+0xe5/0x120
kasan_check_range+0x105/0x1b0
super_validate+0x1cd0/0x3390 (super_init_validation, inlined)
raid_ctr+0x2c4b/0xa0f0
dm_table_add_target+0x66f/0xf80
table_load+0x2ee/0x780
ctl_ioctl+0x362/0x9f0
dm_ctl_ioctl+0x9/0x10
__x64_sys_ioctl+0x134/0x1c0
do_syscall_64+0xe2/0x4b0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
role is a device position that must refer to an actual member of the
array, so reject anything outside [0, rs->raid_disks) instead of only the
negative case. rs->raid_disks is always <= the 256-bit capacity of
failed_devices, so this both closes the out-of-bounds access and matches
the intended semantics.
This bug was discovered by Artiphishell's vTriage pipeline, which
generated a crafted raid1 superblock (magic "DmRd", compat_features=1,
num_devices=2, array_position=256, level=1) and a dmsetup-create
reproducer that reliably triggers the KASAN report on an unpatched kernel
(the precursor DMINFO "raid device #256 now at position #0" is visible in
the serial log just before the splat). The fix below was drafted with the
Claude coding assistant; a userspace reproducer is available on request.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Jay Vadayath <jay@artiphishell.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-raid.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -2420,7 +2420,8 @@ static int super_init_validation(struct
*/
if (!test_bit(FirstUse, &r->flags) && (r->raid_disk >= 0)) {
role = le32_to_cpu(sb2->array_position);
- if (role < 0)
+ /* Bound @role before it indexes the failed_devices stack bitmap. */
+ if (role < 0 || role >= rs->raid_disks)
continue;
if (role != r->raid_disk) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0882/1005] dm-raid: fix use-after-free in raid_dtr()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (880 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 7.3 0881/1005] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0883/1005] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
` (116 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Li Youhong, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Youhong <liyouhong@kylinos.cn>
commit 46af2c975958119290ddcd984a98491966123a7b upstream.
raid_dtr() currently flushes event_work only if work_pending() is true.
This is insufficient because once a worker has dequeued the work, the
PENDING bit is cleared while do_table_event() is still running. In that
window raid_set_free() can free the raid_set, leading to a
use-after-free when do_table_event() accesses rs->ti->table.
Flush event_work whenever it has been initialized, so raid_set is not
freed while the event handler is still running. The .func guard skips the
flush for mddev instances where INIT_WORK has not run yet.
Fixes: db29d79b34d9 ("dm-raid: delay flushing event_work() after reconfig_mutex is released")
Cc: stable@vger.kernel.org
Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-raid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3334,7 +3334,7 @@ static void raid_dtr(struct dm_target *t
rs->md.dm_gendisk = NULL;
mddev_unlock(&rs->md);
- if (work_pending(&rs->md.event_work))
+ if (rs->md.event_work.func)
flush_work(&rs->md.event_work);
raid_set_free(rs);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0883/1005] dm-thin: fix data corruption if discard races with regular I/O
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (881 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0882/1005] dm-raid: fix use-after-free in raid_dtr() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0884/1005] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
` (115 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit 62ee9c09366cad69410330087d990e469dd92314 upstream.
In the function break_up_discard_bio, if a discard hits the same block as
regular I/O, it was intended to skip the discard for the affected range.
However, the skip code only advances "data_begin", it doesn't advance
"virt_begin". So, the data_begin and virt_begin variables become
unsynchronized.
process_prepared_discard_passdown_pt1 calculates "data_end =
m->data_block + (m->virt_end - m->virt_begin);" - if m->data_block is
incremented and m->virt_begin isn't, it will overshoot the intended
discard range.
Cc: stable@vger.kernel.org
Fixes: e2dd8aca2d76 ("dm bio prison v1: improve concurrent IO performance")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1703,6 +1703,7 @@ static void break_up_discard_bio(struct
(void) build_key(tc->td, PHYSICAL, data_begin, data_begin + len, &data_key);
if (bio_detain(tc->pool, &data_key, NULL, &data_cell)) {
/* contention, we'll give up with this range */
+ virt_begin += len;
data_begin += len;
continue;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0884/1005] dm-thin: fix leak if __set_snapshot_details fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (882 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0883/1005] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0885/1005] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
` (114 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit dfb95816cf6f2f2660af2ec64c65dc204c60b5e7 upstream.
If __set_snapshot_details fails, the variable td is leaked - this
prevents any other snapshot with the same id from being created.
Fix this by removing it from the list and freeing it.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 991d9fa02da0 ("dm: add thin provisioning target")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin-metadata.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-thin-metadata.c
+++ b/drivers/md/dm-thin-metadata.c
@@ -1225,10 +1225,13 @@ static int __create_snap(struct dm_pool_
__close_device(td);
if (r)
- goto bad;
+ goto bad2;
return 0;
+bad2:
+ list_del(&td->list);
+ kfree(td);
bad:
dm_btree_remove(&pmd->tl_info, pmd->root, &key, &pmd->root);
dm_btree_remove(&pmd->details_info, pmd->details_root,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0885/1005] dm-thin: fix parsing of feature arguments
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (883 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0884/1005] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0886/1005] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
` (113 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <mpatocka@redhat.com>
commit c557fa19a83efad1e20eb733df821b745a4589ff upstream.
"struct dm_arg _args" limits the number of arguments to 4, but there are
5 possible arguments that can be specified.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Cc: stable@vger.kernel.org
Fixes: 787a996cb251 ("dm thin: add error_if_no_space feature")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-thin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -3149,7 +3149,7 @@ static int parse_pool_features(struct dm
const char *arg_name;
static const struct dm_arg _args[] = {
- {0, 4, "Invalid number of pool feature arguments"},
+ {0, 5, "Invalid number of pool feature arguments"},
};
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0886/1005] vt: serialise the producers of the flip buffer
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (884 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0885/1005] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0887/1005] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
` (112 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Nicolas Pitre,
Kees Cook, Joshua Rogers, Chris Mason, Helge Deller,
Thomas Zimmermann, Mingyu Wang, Randy Dunlap, Ronan Pigott,
Liav Mordouch
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
commit 5d1d814408c1c8e797031eac8ddd40de1a9e8e93 upstream.
Typing on a virtual console while the console replies to an escape
sequence can make the kernel write past the end of a buffer. A user who
can write to the foreground console can cause this on purpose if they
can also inject key events, through /dev/uinput or by writing to the
/dev/input/event* node of a keyboard.
Input for a tty goes through the flip buffer of its port. A driver
inserts the data with tty_insert_flip_*() and then calls
tty_flip_buffer_push() to pass it on to the line discipline. The insert
functions take no lock: they check that the current struct tty_buffer
has room, copy the data to offset ->used, and then advance ->used. So a
flip buffer supports only one producer at a time, and a driver that has
several must serialise them.
Four functions feed the flip buffer of a virtual console:
- put_queue(), puts_queue() and fn_send_intr() insert typed characters
and breaks for the keyboard handler. They run under kbd_event_lock.
- respond_string() inserts the reply when a program writes an escape
sequence that requests one, such as a cursor position report. It runs
under the console lock.
The keyboard handler gets its events from the input layer and feeds the
foreground console. Key events that a program writes to /dev/uinput or
to an event node reach it in the same way as typed keys.
The keyboard handler and respond_string() share no lock, so they can
interleave:
keyboard handler respond_string()
================ ================
room check passes
room check passes
memcpy() to offset used
used += len
memcpy() to offset used
used += len
/* used > size of the buffer */
The room check subtracts ->used from the size, and both are unsigned.
Once ->used exceeds the size, the result wraps, so the check always
passes, and each later insert lands further past the buffer.
Reproduced as root, with keys from a uinput keyboard and cursor position
reports on the same console: KFENCE reported an out-of-bounds write
1,024 bytes past the buffer in under 10 s.
Fix this by taking port->lock, with interrupts disabled, around the
insert and the push in these four functions. kbd_keycode() already takes
port->lock under kbd_event_lock, so this lock ordering is not new.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Nicolas Pitre <npitre@baylibre.com>
Cc: Kees Cook <kees+treewide@kernel.org>
Cc: Joshua Rogers <linux@joshua.hu>
Cc: Chris Mason <mason@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Mingyu Wang <25181214217@stu.xidian.edu.cn>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Ronan Pigott <ronan@rjp.ie>
Cc: Liav Mordouch <liavmordouch@gmail.com>
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-1-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/vt/keyboard.c | 6 ++++++
drivers/tty/vt/vt.c | 2 ++
2 files changed, 8 insertions(+)
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -322,15 +322,20 @@ int kbd_rate(struct kbd_repeat *rpt)
/*
* Helper Functions.
+ *
+ * A flip buffer allows one producer at a time, and respond_string() in vt.c
+ * feeds the same one under the console lock. So take the lock of the port.
*/
static void put_queue(struct vc_data *vc, int ch)
{
+ guard(spinlock_irqsave)(&vc->port.lock);
tty_insert_flip_char(&vc->port, ch, 0);
tty_flip_buffer_push(&vc->port);
}
static void puts_queue(struct vc_data *vc, const char *cp)
{
+ guard(spinlock_irqsave)(&vc->port.lock);
tty_insert_flip_string(&vc->port, cp, strlen(cp));
tty_flip_buffer_push(&vc->port);
}
@@ -587,6 +592,7 @@ static void fn_inc_console(struct vc_dat
static void fn_send_intr(struct vc_data *vc)
{
+ guard(spinlock_irqsave)(&vc->port.lock);
tty_insert_flip_char(&vc->port, 0, TTY_BREAK);
tty_flip_buffer_push(&vc->port);
}
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1857,6 +1857,8 @@ static void csi_m(struct vc_data *vc)
static void respond_string(const char *p, size_t len, struct tty_port *port)
{
+ /* The keyboard handler feeds the same flip buffer. */
+ guard(spinlock_irqsave)(&port->lock);
tty_insert_flip_string(port, p, len);
tty_flip_buffer_push(port);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0887/1005] comedi: addi_apci_1500: fix clearing of the gate enable
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (885 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0886/1005] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0888/1005] comedi: fix endless recursion in comedi_event() Greg Kroah-Hartman
` (111 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit ade85ceef46892425a08f3ee52ca06729ee4922e upstream.
INSN_CONFIG_SET_GATE_SRC reads the mode register of the counter/timer,
is meant to clear the External Gate Enable bit, sets it again if the
external gate was asked for, and writes the register back. The mask lacks
its '~': all the bits but EGE are cleared instead. So
- the external gate can be enabled but never be disabled again, and
- the instruction wipes the mode (continuous or single cycle, external
output, count and trigger enables, retrigger, duty cycle) which
INSN_CONFIG_SET_COUNTER_MODE has programmed: the timer silently falls
back to a single cycle pulse.
With the right mask, the instruction only changes the gate bit. An
application which sets the gate source after the counter mode now keeps
the mode it has asked for.
Fixes: a8c66b684efa ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-2-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/addi_apci_1500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/comedi/drivers/addi_apci_1500.c
+++ b/drivers/comedi/drivers/addi_apci_1500.c
@@ -696,7 +696,7 @@ static int apci1500_timer_insn_config(st
return -EINVAL;
val = z8536_read(dev, Z8536_CT_MODE_REG(chan));
- val &= Z8536_CT_MODE_EGE;
+ val &= ~Z8536_CT_MODE_EGE;
if (data[1] == 1)
val |= Z8536_CT_MODE_EGE;
else if (data[1] > 1)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0888/1005] comedi: fix endless recursion in comedi_event()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (886 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0887/1005] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0889/1005] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
` (110 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit d432e5d3dbd98589029905e898bfe7005be69b68 upstream.
When comedi_event() was split into a wrapper which takes a reference on
the running command and _comedi_event(), which does the work, the wrapper
ended up calling itself:
if (comedi_get_is_subdevice_running(s)) {
comedi_event(dev, s);
comedi_put_is_subdevice_running(s);
}
As long as the command is running every level takes another reference
and recurses, until the stack is used up.
Most drivers go through comedi_handle_events(), which calls
_comedi_event(). usbdux, usbduxfast and usbduxsigma cannot use that and
call comedi_event() from their URB completion handlers, i.e. for every
completed URB of a running acquisition.
Fixes: 51495254fda4 ("comedi: Use reference count for asynchronous command functions")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-1-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/comedi_fops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/comedi/comedi_fops.c
+++ b/drivers/comedi/comedi_fops.c
@@ -3494,7 +3494,7 @@ void _comedi_event(struct comedi_device
void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s)
{
if (comedi_get_is_subdevice_running(s)) {
- comedi_event(dev, s);
+ _comedi_event(dev, s);
comedi_put_is_subdevice_running(s);
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0889/1005] comedi: ni_660x: dont poll without a DMA channel
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (887 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0888/1005] comedi: fix endless recursion in comedi_event() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0890/1005] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
` (109 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 5a0c88567a5ebbe24ecb7828e200f63ed972718f upstream.
A counter command owns a MITE DMA channel from ni_660x_cmd() to
ni_660x_cancel(). A command does not only end by COMEDI_CANCEL: when the
reader is too slow mite_sync_input_dma() sets COMEDI_CB_OVERFLOW, and
counter errors set COMEDI_CB_ERROR, and comedi_handle_events() then calls
->cancel() from the interrupt handler. That releases the channel and
clears counter->mite_chan, but s->busy stays set until the owner has read
the rest of the data and seen the end of the acquisition.
do_poll_ioctl() only looks at s->busy, so a COMEDI_POLL in that state
ends in mite_sync_dma(NULL, s), which dereferences the channel.
Test the channel like ni_pcidio_poll() and ni_sync_ai_dma() do. The
pointer only changes under dev->mutex, which the ioctl holds, or in the
interrupt handler under interrupt_lock, which is taken here.
Fixes: 894db1197347 ("Staging: Comedi: ni_600x: Added support for comedi_poll.")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-3-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/ni_660x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/comedi/drivers/ni_660x.c
+++ b/drivers/comedi/drivers/ni_660x.c
@@ -459,7 +459,8 @@ static int ni_660x_input_poll(struct com
/* lock to avoid race with comedi_poll */
spin_lock_irqsave(&devpriv->interrupt_lock, flags);
- mite_sync_dma(counter->mite_chan, s);
+ if (counter->mite_chan)
+ mite_sync_dma(counter->mite_chan, s);
spin_unlock_irqrestore(&devpriv->interrupt_lock, flags);
return comedi_buf_read_n_available(s);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0890/1005] comedi: ni_tio: Fix overflow of the clock period
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (888 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0889/1005] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0891/1005] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
` (108 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Ian Abbott
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit ec214735bb113be747454812035b83010892e0d2 upstream.
ni_tio_set_clock_src() stores the period of the clock source, which the
user passes in nanoseconds, in picoseconds:
counter->clock_period_ps = period_ns * 1000;
period_ns is an unsigned int, so that the product is computed in 32
bits, although clock_period_ps is a u64. It wraps for periods above
4294967 ns, that is for external clocks slower than 233 Hz.
INSN_CONFIG_GET_CLOCK_SRC then reports a wrong period, and
ni_tio_set_sync_mode() decides on a wrong one: 4294968 ns become 704 ps,
which is below the limit of 25 ns under which the alternate
synchronization mode for fast clocks is switched on.
The multiplication was done in 64 bits until the constant
pico_per_nano, a uint64_t, was replaced by a literal. Widen again.
Fixes: 3e90b1c7ebe9 ("staging: comedi: ni_tio: tidy up ni_tio_set_clock_src() and helpers")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-4-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/ni_tio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/comedi/drivers/ni_tio.c
+++ b/drivers/comedi/drivers/ni_tio.c
@@ -800,7 +800,7 @@ static int ni_tio_set_clock_src(struct n
GI_PRESCALE_X2(counter_dev->variant) |
GI_PRESCALE_X8(counter_dev->variant), bits);
}
- counter->clock_period_ps = period_ns * 1000;
+ counter->clock_period_ps = (u64)period_ns * 1000;
ni_tio_set_sync_mode(counter);
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0891/1005] comedi: vmk80xx: report failed transfers of the K8061
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (889 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0890/1005] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0892/1005] iio: accel: adxl380: dont stay in standby on -EINVAL Greg Kroah-Hartman
` (107 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 92fa93505576188acc22c5de1999db9a1c70c09b upstream.
For the K8061 board vmk80xx_read_packet() and vmk80xx_write_packet() call
vmk80xx_do_bulk_msg(), which ignores the result of its two bulk transfers,
and return 0. After a timeout, a stall or an unplug the instruction
handlers therefore go on and hand the old content of usb_rx_buf to user
space as a fresh sample (analog and digital inputs, counters, PWM and
output read-back), and writes to the outputs are reported as done.
All callers check the result already, because the K8055 branch of the two
functions returns that of usb_interrupt_msg(). Return the error of the
bulk transfers as well, and don't wait for an answer to a command that
could not be sent.
Fixes: 985cafccbf9b ("Staging: Comedi: vmk80xx: Add k8061 support")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-5-1899771ee15b@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/comedi/drivers/vmk80xx.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
--- a/drivers/comedi/drivers/vmk80xx.c
+++ b/drivers/comedi/drivers/vmk80xx.c
@@ -151,7 +151,7 @@ struct vmk80xx_private {
enum vmk80xx_model model;
};
-static void vmk80xx_do_bulk_msg(struct comedi_device *dev)
+static int vmk80xx_do_bulk_msg(struct comedi_device *dev)
{
struct vmk80xx_private *devpriv = dev->private;
struct usb_device *usb = comedi_to_usb_dev(dev);
@@ -161,6 +161,7 @@ static void vmk80xx_do_bulk_msg(struct c
unsigned int rx_pipe;
size_t tx_size;
size_t rx_size;
+ int ret;
tx_addr = devpriv->ep_tx->bEndpointAddress;
rx_addr = devpriv->ep_rx->bEndpointAddress;
@@ -169,11 +170,13 @@ static void vmk80xx_do_bulk_msg(struct c
tx_size = usb_endpoint_maxp(devpriv->ep_tx);
rx_size = usb_endpoint_maxp(devpriv->ep_rx);
- usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf, tx_size, NULL,
- PACKET_TIMEOUT);
+ ret = usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf, tx_size, NULL,
+ PACKET_TIMEOUT);
+ if (ret)
+ return ret;
- usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL,
- PACKET_TIMEOUT);
+ return usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL,
+ PACKET_TIMEOUT);
}
static int vmk80xx_read_packet(struct comedi_device *dev)
@@ -183,10 +186,8 @@ static int vmk80xx_read_packet(struct co
struct usb_endpoint_descriptor *ep;
unsigned int pipe;
- if (devpriv->model == VMK8061_MODEL) {
- vmk80xx_do_bulk_msg(dev);
- return 0;
- }
+ if (devpriv->model == VMK8061_MODEL)
+ return vmk80xx_do_bulk_msg(dev);
ep = devpriv->ep_rx;
pipe = usb_rcvintpipe(usb, ep->bEndpointAddress);
@@ -204,10 +205,8 @@ static int vmk80xx_write_packet(struct c
devpriv->usb_tx_buf[0] = cmd;
- if (devpriv->model == VMK8061_MODEL) {
- vmk80xx_do_bulk_msg(dev);
- return 0;
- }
+ if (devpriv->model == VMK8061_MODEL)
+ return vmk80xx_do_bulk_msg(dev);
ep = devpriv->ep_tx;
pipe = usb_sndintpipe(usb, ep->bEndpointAddress);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0892/1005] iio: accel: adxl380: dont stay in standby on -EINVAL
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (890 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0891/1005] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0893/1005] iio: adc: ad7923: add the AD7927 to the SPI ID table Greg Kroah-Hartman
` (106 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Nuno Sá,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 4c56180167ea4d419a0578545bf62110494b563d upstream.
adxl380_set_act_inact_threshold() puts the sensor into standby, writes the
threshold and switches the measurement on again. A threshold above 8191 is
refused in between, and the sensor stays in standby: no samples and no
events until the next write that succeeds.
adxl380_set_range() has the same problem and a worse one. It rescales both
thresholds for the new range. If one no longer fits it returns -EINVAL
with the sensor in standby, the new range in the chip, the old one in
st->range and rescaled thresholds in the driver's state: from the next
successful write on the samples are reported with the wrong scale.
Switch the measurement on again if the threshold is refused. In
adxl380_set_range() see whether the thresholds fit before anything is
changed.
Fixes: df36de13677a ("iio: accel: add ADXL380 driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/accel/adxl380.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/drivers/iio/accel/adxl380.c
+++ b/drivers/iio/accel/adxl380.c
@@ -334,8 +334,11 @@ static int adxl380_set_act_inact_thresho
return ret;
ret = adxl380_write_act_inact_threshold(st, act, th);
- if (ret)
+ if (ret) {
+ /* Leave standby also if the value was refused */
+ adxl380_set_measure_en(st, true);
return ret;
+ }
return adxl380_set_measure_en(st, true);
}
@@ -698,6 +701,12 @@ static int adxl380_set_range(struct adxl
guard(mutex)(&st->lock);
+ /* The thresholds are rescaled: see that they fit before any change */
+ if (mult_frac(max(st->act_threshold, st->inact_threshold),
+ adxl380_range_scale_factor_tbl[st->range],
+ adxl380_range_scale_factor_tbl[range]) > ADXL380_THRESH_MAX)
+ return -EINVAL;
+
ret = adxl380_set_measure_en(st, false);
if (ret)
return ret;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0893/1005] iio: adc: ad7923: add the AD7927 to the SPI ID table
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (891 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0892/1005] iio: accel: adxl380: dont stay in standby on -EINVAL Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0894/1005] iio: adc: check the result of ad_sd_init() Greg Kroah-Hartman
` (105 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Nuno Sá,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 594157b4f3f64db5833dee679194c33a5968f92e upstream.
The binding describes the AD7927 as
compatible = "adi,ad7927", "adi,ad7928";
The OF match takes the second string. The modalias of the SPI device is
made from the first one, "ad7927", which is not in the spi_device_id table:
spi_get_device_id() returns NULL and ad7923_probe() dereferences it for
the chip information. The module is not loaded automatically either, as the
uevent of an SPI device says "spi:ad7927".
Add the name, with the data of the AD7928.
Fixes: 1140f96cd4af ("dt-bindings: iio: adc: ad7923: adjust documentation")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/adc/ad7923.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/iio/adc/ad7923.c
+++ b/drivers/iio/adc/ad7923.c
@@ -366,6 +366,7 @@ static const struct spi_device_id ad7923
{ .name = "ad7924", .driver_data = AD7924 },
{ .name = "ad7908", .driver_data = AD7908 },
{ .name = "ad7918", .driver_data = AD7918 },
+ { .name = "ad7927", .driver_data = AD7928 },
{ .name = "ad7928", .driver_data = AD7928 },
{ }
};
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0894/1005] iio: adc: check the result of ad_sd_init()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (892 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0893/1005] iio: adc: ad7923: add the AD7927 to the SPI ID table Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0895/1005] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
` (104 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Nuno Sá,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 905b5d93b795b0e2311a8c855c1cdd97c9cc2989 upstream.
ad_sd_init() asks for the optional "rdy" GPIO and returns the error if
that fails, for instance -EPROBE_DEFER. The binding of the AD7780
describes such a GPIO.
ad7780, ad7791, ad7793 and max11205 ignore the result. The function has
then returned before it set the driver data of the IIO device, which
devm_ad_sd_setup_buffer_and_trigger() dereferences a few lines further
down in these probe functions, and sigma_delta->rdy_gpiod holds an
ERR_PTR() which ad_sigma_delta_clear_pending_event() takes for a GPIO.
Return the error, as the other users of the library do.
Fixes: a87ef09b1fdf ("iio: adc: ad_sigma_delta: Add support for reading irq status using a GPIO")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/adc/ad7780.c | 4 +++-
drivers/iio/adc/ad7791.c | 4 +++-
drivers/iio/adc/ad7793.c | 4 +++-
drivers/iio/adc/max11205.c | 4 +++-
4 files changed, 12 insertions(+), 4 deletions(-)
--- a/drivers/iio/adc/ad7780.c
+++ b/drivers/iio/adc/ad7780.c
@@ -311,7 +311,9 @@ static int ad7780_probe(struct spi_devic
st = iio_priv(indio_dev);
st->gain = 1;
- ad_sd_init(&st->sd, indio_dev, spi, &ad7780_sigma_delta_info);
+ ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7780_sigma_delta_info);
+ if (ret)
+ return ret;
st->chip_info =
&ad7780_chip_info_tbl[spi_get_device_id(spi)->driver_data];
--- a/drivers/iio/adc/ad7791.c
+++ b/drivers/iio/adc/ad7791.c
@@ -435,7 +435,9 @@ static int ad7791_probe(struct spi_devic
return ret;
st->info = &ad7791_chip_infos[spi_get_device_id(spi)->driver_data];
- ad_sd_init(&st->sd, indio_dev, spi, &ad7791_sigma_delta_info);
+ ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7791_sigma_delta_info);
+ if (ret)
+ return ret;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
--- a/drivers/iio/adc/ad7793.c
+++ b/drivers/iio/adc/ad7793.c
@@ -796,7 +796,9 @@ static int ad7793_probe(struct spi_devic
st = iio_priv(indio_dev);
- ad_sd_init(&st->sd, indio_dev, spi, &ad7793_sigma_delta_info);
+ ret = ad_sd_init(&st->sd, indio_dev, spi, &ad7793_sigma_delta_info);
+ if (ret)
+ return ret;
if (pdata->refsel != AD7793_REFSEL_INTERNAL) {
ret = devm_regulator_get_enable_read_voltage(dev, "refin");
--- a/drivers/iio/adc/max11205.c
+++ b/drivers/iio/adc/max11205.c
@@ -114,7 +114,9 @@ static int max11205_probe(struct spi_dev
st = iio_priv(indio_dev);
- ad_sd_init(&st->sd, indio_dev, spi, &max11205_sigma_delta_info);
+ ret = ad_sd_init(&st->sd, indio_dev, spi, &max11205_sigma_delta_info);
+ if (ret)
+ return ret;
st->chip_info = spi_get_device_match_data(spi);
if (!st->chip_info)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0895/1005] iio: addac: ad74413r: fix the values of set_multiple
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (893 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0894/1005] iio: adc: check the result of ad_sd_init() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0896/1005] iio: hid-sensors: fix a division by zero Greg Kroah-Hartman
` (103 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Nuno Sá,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit e6dfbd84b833ed595a5236b027357e917de28260 upstream.
ad74413r_gpio_set_multiple() walks over the lines in the mask and looks up
the new value of each with
if (*bits & offset)
offset is the number of the line, not a bit mask. Line 0 is always driven
low, line 1 gets the value meant for line 0, line 2 the one meant for line
1, and line 3 is driven high if either of these two is.
Test the bit which belongs to the line.
Fixes: fea251b6a5db ("iio: addac: add AD74413R driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/addac/ad74413r.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/addac/ad74413r.c
+++ b/drivers/iio/addac/ad74413r.c
@@ -312,7 +312,7 @@ static int ad74413r_gpio_set_multiple(st
return ret;
real_mask |= BIT(real_offset);
- if (*bits & offset)
+ if (test_bit(offset, bits))
real_bits |= BIT(real_offset);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0896/1005] iio: hid-sensors: fix a division by zero
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (894 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0895/1005] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0897/1005] iio: sx9310: use the data of the I2C table Greg Kroah-Hartman
` (102 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Srinivas Pandruvada, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit fd4c92bbd3a64556e81042ff8d30545b15a3b93a upstream.
convert_to_vtf_format() divides the micro part of a value by
10^(6 + exp). The unit exponent of a HID field is a nibble and goes
down to -8. For -7 and -8 the argument of int_pow() is negative, which
the unsigned parameter turns into a huge power of ten: 0 modulo 2^64.
The division by it is a divide error. The exponent comes from the report
descriptor of the sensor hub, the value from a write to the hysteresis
attribute of the IIO device.
Multiply by 10^(-exp - 6) in these two cases.
Fixes: 73c6768b710a ("iio: hid-sensors: Common attribute and trigger")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -140,7 +140,10 @@ static u32 convert_to_vtf_format(int siz
if (val1 < 0 || val2 < 0)
sign = -1;
exp = hid_sensor_convert_exponent(exp);
- if (exp < 0) {
+ if (exp < -6) {
+ value = abs(val1) * int_pow(10, -exp);
+ value += abs(val2) * int_pow(10, -exp - 6);
+ } else if (exp < 0) {
divisor = int_pow(10, 6 + exp);
value = abs(val1) * int_pow(10, -exp);
value += abs(val2) / divisor;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0897/1005] iio: sx9310: use the data of the I2C table
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (895 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0896/1005] iio: hid-sensors: fix a division by zero Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0898/1005] mei: lb: read the MTU once Greg Kroah-Hartman
` (101 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit f3fc8718af9189aad13a2ad7f5b256475bb14b21 upstream.
sx9310_check_whoami() takes the chip information from
device_get_match_data(), which only looks at the OF and ACPI tables, and
dereferences it. For a client which was bound through the i2c_device_id
table, for instance one created with
echo sx9310 0x28 > /sys/bus/i2c/devices/i2c-1/new_device
it returns NULL, and the kernel oopses as soon as something at that address
answers the read of the WHOAMI register.
The I2C table has the same pointers. Use i2c_get_match_data(), which falls
back to it.
Fixes: 21fd3b1373f6 ("iio: proximity: sx9310: Convert enum->pointer for match data table")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/proximity/sx9310.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/proximity/sx9310.c
+++ b/drivers/iio/proximity/sx9310.c
@@ -891,7 +891,7 @@ static int sx9310_check_whoami(struct de
if (ret)
return ret;
- ddata = device_get_match_data(dev);
+ ddata = i2c_get_match_data(data->client);
if (ddata->whoami != whoami)
return -ENODEV;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0898/1005] mei: lb: read the MTU once
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (896 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0897/1005] iio: sx9310: use the data of the I2C table Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0899/1005] mei: me: add ice lake point LP iTouch DID Greg Kroah-Hartman
` (100 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Alexander Usyskin,
Arnd Bergmann, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 1115120f89f5c22bf49f7423cf158a04a474dd93 upstream.
mei_cldev_mtu() returns 0 if the client is not connected. A link reset
disconnects all clients at any time, from the reset work.
mei_lb_push_payload_v2() asks for the MTU to allocate the request buffer
and asks again for every chunk. If the reset comes in between,
chunk_size = min(payload_size - sent_data, 0 - sizeof(*req));
makes the chunk the whole rest of the payload, and the memcpy() behind it
writes over the end of the buffer. If the reset comes before the first
call, kzalloc(0) returns ZERO_SIZE_PTR, which passes the NULL check and is
dereferenced. An MTU not bigger than the request header has the same
effect as 0.
Read the MTU once and refuse one which leaves no room for payload. If the
client has gone, sending the chunk fails.
Fixes: 773a43b8627f ("mei: lb: add late binding version 2")
Cc: stable <stable@kernel.org>
Cc: Alexander Usyskin <alexander.usyskin@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Alexander Usyskin <alexander.usyskin@intel.com>
Link: https://patch.msgid.link/2026102739-boil-startup-145b@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/mei/mei_lb.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/drivers/misc/mei/mei_lb.c
+++ b/drivers/misc/mei/mei_lb.c
@@ -312,16 +312,24 @@ static int mei_lb_push_payload_v2(struct
size_t chunk_size;
size_t req_size;
ssize_t bytes;
+ size_t mtu;
int ret;
- struct mei_lb2_req *req __free(kfree) = kzalloc(mei_cldev_mtu(cldev), GFP_KERNEL);
+ /* The MTU turns into 0 when a link reset disconnects the client */
+ mtu = mei_cldev_mtu(cldev);
+ if (mtu <= sizeof(struct mei_lb2_req)) {
+ dev_err(dev, "MTU is too small: %zu\n", mtu);
+ return -EMSGSIZE;
+ }
+
+ struct mei_lb2_req *req __free(kfree) = kzalloc(mtu, GFP_KERNEL);
if (!req)
return -ENOMEM;
first_chunk = MEI_LB2_FLAG_FST_CHUNK;
last_chunk = 0;
do {
- chunk_size = min(payload_size - sent_data, mei_cldev_mtu(cldev) - sizeof(*req));
+ chunk_size = min(payload_size - sent_data, mtu - sizeof(*req));
req_size = struct_size(req, payload, chunk_size);
if (sent_data + chunk_size == payload_size)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0899/1005] mei: me: add ice lake point LP iTouch DID
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (897 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0898/1005] mei: lb: read the MTU once Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0900/1005] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
` (99 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Antonio Vázquez Blanco,
Alexander Usyskin
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
commit 73383d06da9a1ded4c85845407cb4029aeecca39 upstream.
Add the device ID for the Intel Precise Touch & Stylus (iTouch) function
on Ice Lake Point LP. It appears as PCI device 8086:34e4, next to the
regular MEI function at 8086:34e0, on Microsoft Surface Pro 7 and
Surface Laptop 3.
Without this entry mei_me does not bind, the touch controller is
unreachable, and neither the touchscreen nor the pen work. Users
currently work around this by binding the device by hand at boot:
echo "8086 34e4 ffffffff ffffffff 0 0 9" > \
/sys/bus/pci/drivers/mei_me/new_id
where the trailing 9 is the mei_me_cfgs[] index of MEI_ME_PCH12_CFG.
That is fragile by construction, since the index is positional and any
reordering of the config array silently changes which config the device
gets.
This ID was first reported in June 2020, together with Sunrise Point's
0x9d3e, in "mei: me: Add itouch device IDs for SPT / ICP" [1]. That
submission was declined over the server platform ID conflict, and the
Sunrise Point half was subsequently added in commit 372a829862e5 ("mei:
me: add MEI device for SPT with ITPS capability"). Ice Lake Point was
never added.
Use MEI_ME_PCH12_SPS_ITOUCH_CFG, so that the device is reported with the
correct kind and the SPS firmware exclusion applies. Note this is not the
config the manual new_id workaround above selects: it reports kind
"itouch" rather than "mei", and it does not set up a DMA ring.
Link: https://lore.kernel.org/all/20200601155954.764558-1-dorian.stoll@tmsp.io/ [1]
Cc: stable <stable@kernel.org>
Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com>
Acked-by: Alexander Usyskin <alexander.usyskin@intel.com>
Link: https://patch.msgid.link/20261029084859.4537-1-antoniovazquezblanco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/mei/hw-me-regs.h | 1 +
drivers/misc/mei/pci-me.c | 1 +
2 files changed, 2 insertions(+)
--- a/drivers/misc/mei/hw-me-regs.h
+++ b/drivers/misc/mei/hw-me-regs.h
@@ -94,6 +94,7 @@
#define PCI_DEVICE_ID_INTEL_MEI_CDF 0x18D3 /* Cedar Fork */
#define PCI_DEVICE_ID_INTEL_MEI_ICP_LP 0x34E0 /* Ice Lake Point LP */
+#define PCI_DEVICE_ID_INTEL_MEI_ICP_LP_3 0x34E4 /* Ice Lake Point LP 3 (iTouch) */
#define PCI_DEVICE_ID_INTEL_MEI_ICP_N 0x38E0 /* Ice Lake Point N */
#define PCI_DEVICE_ID_INTEL_MEI_JSP_N 0x4DE0 /* Jasper Lake Point N */
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -98,6 +98,7 @@ static const struct pci_device_id mei_me
{ PCI_DEVICE_DATA(INTEL, MEI_CMP_H_3, MEI_ME_PCH8_ITOUCH_CFG) },
{ PCI_DEVICE_DATA(INTEL, MEI_ICP_LP, MEI_ME_PCH12_CFG) },
+ { PCI_DEVICE_DATA(INTEL, MEI_ICP_LP_3, MEI_ME_PCH12_SPS_ITOUCH_CFG) },
{ PCI_DEVICE_DATA(INTEL, MEI_ICP_N, MEI_ME_PCH12_CFG) },
{ PCI_DEVICE_DATA(INTEL, MEI_TGP_LP, MEI_ME_PCH15_CFG) },
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0900/1005] misc: bcm-vk: fix DMA allocation memory leak
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (898 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0899/1005] mei: me: add ice lake point LP iTouch DID Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0901/1005] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
` (98 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
commit a36b3db60466d44eefcc5c252ce927c043429922 upstream.
bcm_vk_dma_alloc() leaks dma->pages and pinned user-page references
when page pinning or coherent SG allocation fails. DMA mapping
failures can also leave the SG list and earlier mappings unreleased,
as bcm_vk_sg_alloc() skips the partially initialized slot.
This issue was found by our static analysis tool under development.
Fixes: 111d746bb476 ("misc: bcm-vk: add VK messaging support")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20261027150921.137189-1-lgs201920130244@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/bcm-vk/bcm_vk_sg.c | 43 +++++++++++++++++++++++++++++++++-------
1 file changed, 36 insertions(+), 7 deletions(-)
--- a/drivers/misc/bcm-vk/bcm_vk_sg.c
+++ b/drivers/misc/bcm-vk/bcm_vk_sg.c
@@ -78,7 +78,8 @@ static int bcm_vk_dma_alloc(struct devic
dma->nr_pages = (err >= 0) ? err : 0;
dev_err(dev, "get_user_pages_fast, err=%d [%d]\n",
err, dma->nr_pages);
- return err < 0 ? err : -EINVAL;
+ err = err < 0 ? err : -EINVAL;
+ goto err_pages;
}
/* Max size of sg list is 1 per mapped page + fields at start */
@@ -90,8 +91,10 @@ static int bcm_vk_dma_alloc(struct devic
dma->sglen,
&dma->handle,
GFP_KERNEL);
- if (!dma->sglist)
- return -ENOMEM;
+ if (!dma->sglist) {
+ err = -ENOMEM;
+ goto err_pages;
+ }
dma->sglist[SGLIST_NUM_SG] = 0;
dma->sglist[SGLIST_TOTALSIZE] = vkdata->size;
@@ -108,8 +111,8 @@ static int bcm_vk_dma_alloc(struct devic
dma->direction);
transfer_size = size;
if (unlikely(dma_mapping_error(dev, sg_addr))) {
- __free_page(dma->pages[0]);
- return -EIO;
+ err = -EIO;
+ goto err_sglist;
}
for (i = 1; i < dma->nr_pages; i++) {
@@ -121,8 +124,8 @@ static int bcm_vk_dma_alloc(struct devic
size,
dma->direction);
if (unlikely(dma_mapping_error(dev, addr))) {
- __free_page(dma->pages[i]);
- return -EIO;
+ err = -EIO;
+ goto err_unmap;
}
/*
@@ -167,6 +170,32 @@ static int bcm_vk_dma_alloc(struct devic
#endif
return 0;
+
+err_unmap:
+ /*
+ * Unmap completed SG entries and the in-progress DMA range,
+ * which has not been written to the SG list yet.
+ */
+ sgdata = (struct _vk_data *)&dma->sglist[SGLIST_VKDATA_START];
+ for (i = 0; i < dma->sglist[SGLIST_NUM_SG]; i++) {
+ size = sgdata[i].size;
+ addr = get_unaligned(&sgdata[i].address);
+ dma_unmap_page(dev, addr, size, dma->direction);
+ }
+ dma_unmap_page(dev, sg_addr, transfer_size, dma->direction);
+
+err_sglist:
+ dma_free_coherent(dev, dma->sglen, dma->sglist, dma->handle);
+
+err_pages:
+ for (i = 0; i < dma->nr_pages; i++)
+ put_page(dma->pages[i]);
+ kfree(dma->pages);
+ dma->pages = NULL;
+ dma->sglist = NULL;
+ dma->sglen = 0;
+ dma->nr_pages = 0;
+ return err;
}
int bcm_vk_sg_alloc(struct device *dev,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0901/1005] misc: ibmvmc: initialize HMC state before device registration
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (899 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0900/1005] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0902/1005] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
` (97 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Jiale Yao
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
commit 2022f170e5655c40b93ed98629f7d0adb98cea49 upstream.
misc_register() exposes the IBM VMC device before the HMC state and
spinlocks are initialized. A userspace operation racing module
initialization can therefore access an HMC through an uninitialized
spinlock.
Initialize all HMC state before registering the misc device.
Fixes: 0eca353e7ae7 ("misc: IBM Virtual Management Channel Driver (VMC)")
Cc: stable <stable@kernel.org>
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20261028044828.96177-5-yaojiale02@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/ibmvmc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/drivers/misc/ibmvmc.c
+++ b/drivers/misc/ibmvmc.c
@@ -2365,14 +2365,6 @@ static int __init ibmvmc_module_init(voi
ibmvmc.state = ibmvmc_state_initial;
pr_info("ibmvmc: version %s\n", IBMVMC_DRIVER_VERSION);
- rc = misc_register(&ibmvmc_miscdev);
- if (rc) {
- pr_err("ibmvmc: misc registration failed\n");
- goto misc_register_failed;
- }
- pr_info("ibmvmc: node %d:%d\n", MISC_MAJOR,
- ibmvmc_miscdev.minor);
-
/* Initialize data structures */
memset(hmcs, 0, sizeof(struct ibmvmc_hmc) * MAX_HMCS);
for (i = 0; i < MAX_HMCS; i++) {
@@ -2382,6 +2374,14 @@ static int __init ibmvmc_module_init(voi
hmcs[i].queue_outbound_msgs[j] = VMC_INVALID_BUFFER_ID;
}
+ rc = misc_register(&ibmvmc_miscdev);
+ if (rc) {
+ pr_err("ibmvmc: misc registration failed\n");
+ goto misc_register_failed;
+ }
+ pr_info("ibmvmc: node %d:%d\n", MISC_MAJOR,
+ ibmvmc_miscdev.minor);
+
/* Sanity check module parms */
ibmvmc_scrub_module_parms();
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0902/1005] misc: vmw_vmci: wait for callbacks in event unsubscribe
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (900 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0901/1005] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0903/1005] serial: 8250_exar: check priv->gpio properly Greg Kroah-Hartman
` (96 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Bryan Tan, Vishnu Dasa,
Broadcom internal kernel review list, Arnd Bergmann, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 824a27d391cf934d3232e8e2dabee221fc4e18ae upstream.
event_deliver() calls the callbacks of the subscribers inside an RCU read
side critical section. vmci_event_unsubscribe() used to call
synchronize_rcu() before it freed the subscription. This did more than
to protect the struct vmci_subscription: when the function returned, no
callback was running any more, and its callers rely on that.
vmci_transport_free_resources() unsubscribes from
VMCI_EVENT_QP_PEER_DETACH and frees the struct vmci_transport, which is
the callback data, a few lines later:
CPU0 CPU1
event_deliver()
rcu_read_lock()
vmci_transport_peer_detach_cb()
vmci_event_unsubscribe()
list_del_rcu(&s->node)
kvfree_rcu_mightsleep(s)
kfree(transport)
spin_lock_bh(&trans->lock)
The event is sent when the peer of the queue pair detaches, so the other
end of a vsock connection chooses the time. vmci_transport_exit() and
vmci_guest_remove_device() unsubscribe callbacks which are gone with
their module.
kvfree_rcu_mightsleep() only waits for a grace period if it cannot
allocate memory. Bring the synchronize_rcu() back. The cleanup work of
the vmci transport now waits for one grace period per socket again.
Fixes: 6da3f33770e0 ("misc: vmw_vmci: Switch to kvfree_rcu() API")
Cc: stable <stable@kernel.org>
Cc: Bryan Tan <bryan-bt.tan@broadcom.com>
Cc: Vishnu Dasa <vishnu.dasa@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/2026102715-escapable-quaintly-8530@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/vmw_vmci/vmci_event.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/misc/vmw_vmci/vmci_event.c
+++ b/drivers/misc/vmw_vmci/vmci_event.c
@@ -213,7 +213,12 @@ int vmci_event_unsubscribe(u32 sub_id)
if (!s)
return VMCI_ERROR_NOT_FOUND;
- kvfree_rcu_mightsleep(s);
+ /*
+ * Wait for event_deliver(): the caller is going to free what the
+ * callback works on.
+ */
+ synchronize_rcu();
+ kfree(s);
return VMCI_SUCCESS;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0903/1005] serial: 8250_exar: check priv->gpio properly
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (901 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0902/1005] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0904/1005] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
` (95 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Slaby (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Slaby (SUSE) <jirislaby@kernel.org>
commit 0353b51965883cf70dad162908e07395f242000f upstream.
priv->gpio is set by platform_device_register_full(), which returns
error-encoded pointers on failure, not NULL. Sashiko reported:
> Does __xr17v35x_register_gpio() return an ERR_PTR if
> platform_device_register_full() fails?
>
> If it does, we might be storing an error pointer directly into
> priv->gpio in xr17v35x_register_gpio() without validating it with
> IS_ERR(). Because the error is ignored, the device probe
> successfully continues.
Before commit 1145d1a0703f ("serial: 8250_exar: use
platform_device_register_full()"), __xr17v35x_register_gpio()
returned NULL on any failure (platform_device_alloc(),
device_add_software_node() or platform_device_add() failing were all
turned into a NULL return). The plain truthy check in
xr17v35x_unregister_gpio() matched that convention. That commit
switched registration to platform_device_register_full(), which
reports failure as an ERR_PTR() instead of NULL, but the unregister
check was never updated to match. As a result, a failed registration
left an error pointer in priv->gpio, and unbind would tear it down as
if it were a real platform_device, dereferencing the encoded error
value in device_remove_software_node() and
platform_device_unregister().
Use IS_ERR_OR_NULL() instead, so both the unset (non-EXAR vendor,
priv->gpio never assigned) and failed-registration (ERR_PTR) cases
are skipped.
Fixes: 1145d1a0703f ("serial: 8250_exar: use platform_device_register_full()")
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: stable@vger.kernel.org
Assisted-by: LLM
Link: https://lore.kernel.org/all/sashiko-outbox-170895@kernel.org/
Link: https://patch.msgid.link/28c09cf858795491f66667781bf79fb6a603f159.1793704520.git.jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_exar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -1180,7 +1180,7 @@ static int xr17v35x_register_gpio(struct
static void xr17v35x_unregister_gpio(struct exar8250 *priv)
{
- if (priv->gpio) {
+ if (!IS_ERR_OR_NULL(priv->gpio)) {
__xr17v35x_unregister_gpio(priv->gpio);
priv->gpio = NULL;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0904/1005] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (902 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0903/1005] serial: 8250_exar: check priv->gpio properly Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0905/1005] serial: 8250_mxpcie: handle hangup during break Greg Kroah-Hartman
` (94 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Ilpo Järvinen,
Andy Shevchenko, Jiri Slaby, Heikki Krogerus, Peter Hurley,
Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 08daebfd63e9054e097eb2653eff9381de43a422 upstream.
byt_set_termios() derives the clock of the UART from the baud rate in
the termios, which nobody has looked at yet:
fuart = baud * 16;
...
fuart *= rounddown_pow_of_two(fref / fuart);
...
p->uartclk = fuart;
fref is 100 MHz. For a baud rate above 6250000, which BOTHER allows,
fref / fuart is 0, and rounddown_pow_of_two(0) shifts 1UL by -1. On x86
that is 1UL << 63, the product with a multiple of 16 is 0, and so is
uartclk. serial8250_get_baud_rate() then passes 0 for both limits,
uart_get_baud_rate() finds no rate which fits, WARNs and returns 0, and
uart_get_divisor() or dw8250_get_divisor() divide by 16 * 0.
Everybody who may open the tty can oops the kernel with one TCSETS2.
Don't ask for more than fref. The limits are those of a 100 MHz clock
then, and uart_get_baud_rate() falls back to the old rate as for any
other rate that the port cannot do. 8250_mid, which has the same
formula, treats this case separately.
Fixes: 21947ba654a6 ("serial: 8250_pci: replace switch-case by formula")
Cc: stable <stable@kernel.org>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-16-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_lpss.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/tty/serial/8250/8250_lpss.c
+++ b/drivers/tty/serial/8250/8250_lpss.c
@@ -82,6 +82,9 @@ static void byt_set_termios(struct uart_
/* Gracefully handle the B0 case: fall back to B9600 */
fuart = fuart ? fuart : 9600 * 16;
+ /* Fuart <= Fref: leave it to the core to refuse a higher baud rate */
+ fuart = min(fuart, fref);
+
/* Get Fuart closer to Fref */
fuart *= rounddown_pow_of_two(fref / fuart);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0905/1005] serial: 8250_mxpcie: handle hangup during break
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (903 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0904/1005] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0906/1005] serial: core: respect runtime PM when sending x_char Greg Kroah-Hartman
` (93 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Crescent Hsieh,
Andy Shevchenko, Linmao Li, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 899e3c6e30ff34cf7a260b806fdedb56749e36e9 upstream.
Ending a software break on a Moxa PCIe port in RS-485 2-wire mode
dereferences a NULL tty pointer if the port was hung up while the break
was being sent.
send_break() calls ->break_ctl(tty, -1), sleeps for the break duration
and then calls ->break_ctl(tty, 0), without excluding a concurrent
hangup. A hangup (a modem DCD drop, or the session leader exiting while
another process of the session is in TCSBRK/TCSBRKP) runs uart_hangup(),
which shuts the port down and clears port->state->port.tty. The second
call still reaches mxpcie8250_software_break_ctl() through
uart_break_ctl(), which then does:
struct tty_struct *tty = port->state->port.tty;
...
baud = tty_get_baud_rate(tty);
with tty == NULL.
The bug was found by code inspection and has not been reproduced.
Fix by taking a reference to the port's tty with tty_port_tty_get() and
only restoring the divisor when a tty is still attached; a hung up port
is shut down, and the next open programs the divisor again through
set_termios().
Fixes: ade78d3d253c ("serial: 8250_mxpcie: add break support for RS485 using MUEx50 features")
Cc: stable <stable@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Crescent Hsieh <crescentcy.hsieh@moxa.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linmao Li <lilinmao@kylinos.cn>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-17-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_mxpcie.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/drivers/tty/serial/8250/8250_mxpcie.c
+++ b/drivers/tty/serial/8250/8250_mxpcie.c
@@ -411,7 +411,7 @@ static int mxpcie8250_handle_irq(struct
static void mxpcie8250_software_break_ctl(struct uart_port *port, int break_state)
{
struct uart_8250_port *up = up_to_u8250p(port);
- struct tty_struct *tty = port->state->port.tty;
+ struct tty_struct *tty;
unsigned int baud, quot;
u8 sfr, tx_byte = 0x01;
@@ -438,9 +438,14 @@ static void mxpcie8250_software_break_ct
serial_out(up, UART_FCR, UART_FCR_CLEAR_XMIT);
- baud = tty_get_baud_rate(tty);
- quot = uart_get_divisor(port, baud);
- serial8250_do_set_divisor(port, baud, quot);
+ /* A hangup during the break detaches the tty */
+ tty = tty_port_tty_get(&port->state->port);
+ if (tty) {
+ baud = tty_get_baud_rate(tty);
+ quot = uart_get_divisor(port, baud);
+ serial8250_do_set_divisor(port, baud, quot);
+ tty_kref_put(tty);
+ }
serial_out(up, UART_LCR, up->lcr);
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0906/1005] serial: core: respect runtime PM when sending x_char
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (904 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0905/1005] serial: 8250_mxpcie: handle hangup during break Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0907/1005] serial: fsl_lpuart: fix tty ref of wakeup event Greg Kroah-Hartman
` (92 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Hugo Villeneuve,
Johan Hovold, Karl Mehltretter, John Ogness,
Uwe Kleine-König , Tony Lindgren, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 84da8238f7bd3025fc16da32c4cd9992c95a783b upstream.
__uart_start() calls the start_tx operation only if the port is runtime
active. Otherwise it asks for a resume, and
serial_port_runtime_resume() starts the transmitter.
uart_send_xchar() calls start_tx at once, under the port lock, whatever
the state of the device. With 8250_omap, serial8250_start_tx() then
calls pm_runtime_get_sync() for a suspended device: that sleeps, and
omap8250_runtime_resume() takes the port lock again. A tcflow(TCIOFF)
on an idle port is enough, if autosuspend has been enabled. It was
allowed as long as that driver used pm_runtime_irq_safe().
Share the part of __uart_start() that deals with runtime PM. A stopped
transmission still does not hold up an XON or XOFF character. Let a
pending x_char count as work for serial_port_runtime_resume(), and keep
the port from being suspended with it.
Fixes: 8700a7ea5519 ("serial: 8250_omap: Drop pm_runtime_irq_safe()")
Cc: stable <stable@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Karl Mehltretter <kmehltretter@gmail.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Tony Lindgren <tony.lindgren@linux.intel.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-2-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/serial_core.c | 25 +++++++++++++++----------
drivers/tty/serial/serial_port.c | 4 ++--
2 files changed, 17 insertions(+), 12 deletions(-)
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -135,17 +135,11 @@ static void uart_stop(struct tty_struct
uart_port_unlock_deref(port, flags);
}
-static void __uart_start(struct uart_state *state)
+static void uart_port_start_tx(struct uart_port *port)
{
- struct uart_port *port = state->uart_port;
- struct serial_port_device *port_dev;
+ struct serial_port_device *port_dev = port->port_dev;
int err;
- if (!port || port->flags & UPF_DEAD || uart_tx_stopped(port))
- return;
-
- port_dev = port->port_dev;
-
/* Increment the runtime PM usage count for the active check below */
err = pm_runtime_get(&port_dev->dev);
if (err < 0 && err != -EINPROGRESS) {
@@ -164,6 +158,16 @@ static void __uart_start(struct uart_sta
pm_runtime_put_autosuspend(&port_dev->dev);
}
+static void __uart_start(struct uart_state *state)
+{
+ struct uart_port *port = state->uart_port;
+
+ if (!port || port->flags & UPF_DEAD || uart_tx_stopped(port))
+ return;
+
+ uart_port_start_tx(port);
+}
+
static void uart_start(struct tty_struct *tty)
{
struct uart_state *state = tty->driver_data;
@@ -718,8 +722,9 @@ static void uart_send_xchar(struct tty_s
else {
guard(uart_port_lock_irqsave)(port);
port->x_char = ch;
- if (ch)
- port->ops->start_tx(port);
+ /* It goes out even if the transmission is stopped */
+ if (ch && !(port->flags & UPF_DEAD))
+ uart_port_start_tx(port);
}
uart_port_deref(port);
}
--- a/drivers/tty/serial/serial_port.c
+++ b/drivers/tty/serial/serial_port.c
@@ -23,8 +23,8 @@
/* Only considers pending TX for now. Caller must take care of locking */
static int __serial_port_busy(struct uart_port *port)
{
- return !uart_tx_stopped(port) &&
- !kfifo_is_empty(&port->state->port.xmit_fifo);
+ return port->x_char || (!uart_tx_stopped(port) &&
+ !kfifo_is_empty(&port->state->port.xmit_fifo));
}
static int serial_port_runtime_resume(struct device *dev)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0907/1005] serial: fsl_lpuart: fix tty ref of wakeup event
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (905 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0906/1005] serial: core: respect runtime PM when sending x_char Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0908/1005] serial: imx: fix the tty reference of the " Greg Kroah-Hartman
` (91 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Frank Li,
Peng Fan, Shitalkumar Gandhi, Sherry Sun, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 0f0664a63efdfd70d1c555080781f4e8464445aa upstream.
To report a wakeup event, lpuart_resume_noirq() gets the tty with
tty_port_tty_get() and never puts it: each wakeup by the UART leaks a
reference, and the tty is not freed when it is closed.
With no_console_suspend, the function also gets there for a console
which is not open. Then tty_port_tty_get() returns NULL, which is
dereferenced.
Fixes: 18bdfccf3c30 ("tty: serial: fsl_lpuart: Add missing wakeup event reporting")
Cc: stable <stable@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Shitalkumar Gandhi <shital.gandhi45@gmail.com>
Cc: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-18-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/fsl_lpuart.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -3113,8 +3113,14 @@ static int lpuart_resume_noirq(struct de
/* check whether lpuart wakeup was triggered */
wake_active = stat & (UARTSTAT_RDRF | UARTSTAT_RXEDGIF);
- if (wake_active && irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq)))
- pm_wakeup_event(tty_port_tty_get(port)->dev, 0);
+ if (wake_active && irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq))) {
+ struct tty_struct *tty = tty_port_tty_get(port);
+
+ if (tty) {
+ pm_wakeup_event(tty->dev, 0);
+ tty_kref_put(tty);
+ }
+ }
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0908/1005] serial: imx: fix the tty reference of the wakeup event
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (906 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0907/1005] serial: fsl_lpuart: fix tty ref of wakeup event Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0909/1005] serial: rda: free the interrupt on shutdown Greg Kroah-Hartman
` (90 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Robin Gong,
Petr Mladek, John Ogness, Pan Chuang, Karl Mehltretter,
Sherry Sun, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 6d7fbd5a28d092ab61ec0092cf1e085d2bb9ed7e upstream.
To report a wakeup event, imx_uart_enable_wakeup() gets the tty with
tty_port_tty_get() and never puts it: each wakeup by the UART leaks a
reference, and the tty is not freed when it is closed.
Fixes: 0cfadf4bcd28 ("tty: serial: imx: Add missing wakeup event reporting")
Cc: stable <stable@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Robin Gong <yibin.gong@nxp.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Pan Chuang <panchuang@vivo.com>
Cc: Karl Mehltretter <kmehltretter@gmail.com>
Cc: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-19-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/imx.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 986fefb45c63..18892fc4a35b 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2742,8 +2742,14 @@ static void imx_uart_enable_wakeup(struct imx_port *sport, bool on)
imx_uart_writel(sport, ucr1, UCR1);
}
- if (wake_active && irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq)))
- pm_wakeup_event(tty_port_tty_get(port)->dev, 0);
+ if (wake_active && irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq))) {
+ struct tty_struct *tty = tty_port_tty_get(port);
+
+ if (tty) {
+ pm_wakeup_event(tty->dev, 0);
+ tty_kref_put(tty);
+ }
+ }
uart_port_unlock_irq(&sport->port);
}
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0909/1005] serial: rda: free the interrupt on shutdown
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (907 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0908/1005] serial: imx: fix the tty reference of the " Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0910/1005] serial: samsung: dont leak the tty on an RX IRQ Greg Kroah-Hartman
` (89 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Arnd Bergmann,
Andreas Färber, Olof Johansson, Josef Bacik,
Manivannan Sadhasivam
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 859f7c56709b161a72b629b6f2f1384dcd374404 upstream.
rda_uart_startup() requests the interrupt, and nothing ever frees it.
It is not shared, so once the port has been closed, the next startup
fails with -EBUSY and the port cannot be opened any more.
Free it in rda_uart_shutdown().
Fixes: c10b13325ced ("tty: serial: Add RDA8810PL UART driver")
Cc: stable <stable@kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: Olof Johansson <olof@lixom.net>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-20-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/rda-uart.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/tty/serial/rda-uart.c
+++ b/drivers/tty/serial/rda-uart.c
@@ -471,6 +471,8 @@ static void rda_uart_shutdown(struct uar
rda_uart_write(port, val, RDA_UART_CTRL);
uart_port_unlock_irqrestore(port, flags);
+
+ free_irq(port->irq, port);
}
static const char *rda_uart_type(struct uart_port *port)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0910/1005] serial: samsung: dont leak the tty on an RX IRQ
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (908 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0909/1005] serial: rda: free the interrupt on shutdown Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0911/1005] serial: samsung: put the previous baud clock Greg Kroah-Hartman
` (88 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Krzysztof Kozlowski,
Peter Griffin, Alim Akhtar, Jiri Slaby, Robert Baldyga,
Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 7ada442f5ef77f8d53f608a0141a5e88a888ca9f upstream.
s3c24xx_serial_rx_chars_dma() starts by taking a reference to the tty.
If the interrupt is not a receive timeout, it switches the port from PIO
back to DMA and leaves through the "finish" label, which does not drop
the reference.
A port with RX DMA changes to PIO on every receive timeout, that is at
the end of every burst of data, and comes back this way when the next
burst starts. So each burst takes a reference which is never dropped,
and the tty structure is not freed when the port is closed for the last
time.
Drop the reference on both paths.
Fixes: b543c301c2c5 ("serial: samsung: add DMA support for RX")
Cc: stable <stable@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Peter Griffin <peter.griffin@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-21-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/samsung_tty.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -736,14 +736,13 @@ static irqreturn_t s3c24xx_serial_rx_cha
s3c24xx_serial_rx_drain_fifo(ourport);
- if (tty) {
+ if (tty)
tty_flip_buffer_push(t);
- tty_kref_put(tty);
- }
wr_regl(port, S3C2410_UTRSTAT, S3C2410_UTRSTAT_TIMEOUT);
finish:
+ tty_kref_put(tty);
uart_port_unlock(port);
return IRQ_HANDLED;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0911/1005] serial: samsung: put the previous baud clock
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (909 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0910/1005] serial: samsung: dont leak the tty on an RX IRQ Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0912/1005] thunderbolt: stream: Undo more if the start fails Greg Kroah-Hartman
` (87 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Krzysztof Kozlowski,
Peter Griffin, Alim Akhtar, Jiri Slaby, Kukjin Kim,
Thomas Abraham, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit eedf2cf3505c1562a2fb24f8b997056f023d242b upstream.
s3c24xx_serial_getclk() returns the best baud clock with the reference
which clk_get() has taken. s3c24xx_serial_set_termios() stores it in
ourport->baudclk and disables the clock which was there before, but does
not put it.
clk_get() hands out a new handle on every call, so the new clock never
equals the old one, and every call of ->set_termios() leaks a handle: a
struct clk and a copy of the connection name. Whoever has the port open
can repeat that at will with tcsetattr().
Put the old clock when it is replaced, and the new one in case it is not
stored.
Fixes: 5f5a7a5578c5 ("serial: samsung: switch to clkdev based clock lookup")
Cc: stable <stable@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Peter Griffin <peter.griffin@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20261027-tty-llm-v1-22-99b0202ae546@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/samsung_tty.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -1498,11 +1498,14 @@ static void s3c24xx_serial_set_termios(s
if (!IS_ERR(ourport->baudclk)) {
clk_disable_unprepare(ourport->baudclk);
+ clk_put(ourport->baudclk);
ourport->baudclk = ERR_PTR(-EINVAL);
}
ourport->baudclk = clk;
ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;
+ } else {
+ clk_put(clk);
}
if (ourport->info->has_divslot) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0912/1005] thunderbolt: stream: Undo more if the start fails
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (910 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0911/1005] serial: samsung: put the previous baud clock Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0913/1005] tty: fix misapplied compat_ptr() in tty_compat_ioctl() Greg Kroah-Hartman
` (86 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Andreas Noever,
Mika Westerberg, Yehezkel Bernat, Alan Borzeszkowski, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 03e3c33fe074ba57ae4457894fe5b6a90e3be6ee upstream.
If the receive buffers cannot be allocated or mapped,
tbstream_dev_start() stops and frees the rings, but
- leaves the DMA paths through the XDomain connection enabled, with the
hop IDs of rings which no longer exist;
- does not release the frame array and the pages which
tbstream_dev_alloc_rx_buffers() had allocated and mapped before it
failed.
Fixes: 6db21d817b43 ("thunderbolt: Add support for USB4STREAM")
Cc: stable <stable@kernel.org>
Cc: Andreas Noever <andreas.noever@gmail.com>
Cc: Mika Westerberg <westeri@kernel.org>
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
Cc: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Mika Westerberg (Intel) <westeri@kernel.org>
Link: https://patch.msgid.link/2026102751-nibble-synapse-d406@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/thunderbolt/stream.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/thunderbolt/stream.c
+++ b/drivers/thunderbolt/stream.c
@@ -630,6 +630,12 @@ static int tbstream_dev_start(struct tbs
err_stop:
tb_ring_stop(sdev->rx_ring.ring);
tb_ring_stop(sdev->tx_ring.ring);
+ tb_xdomain_disable_paths(xd, sdev->out_hopid,
+ sdev->tx_ring.ring->hop,
+ sdev->in_hopid,
+ sdev->rx_ring.ring->hop);
+ if (sdev->rx_ring.frames)
+ tbstream_ring_free(&sdev->rx_ring);
err_free_rx:
tb_ring_free(sdev->rx_ring.ring);
err_free_tx_buffers:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0913/1005] tty: fix misapplied compat_ptr() in tty_compat_ioctl()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (911 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0912/1005] thunderbolt: stream: Undo more if the start fails Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0914/1005] USB: cdc-acm: fix NULL-deref on hangup Greg Kroah-Hartman
` (85 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Slaby (SUSE)
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Slaby (SUSE) <jirislaby@kernel.org>
commit 895dc0eaa2779ff46a0b2a20b5ce9eb0b1125cb2 upstream.
Since commit f0193d3ea73b below, `cmd` was converted with compat_ptr(),
while `arg` was passed to ld->ops->ioctl() unmodified. Fix it so `cmd`
stays `cmd` and `arg` gets converted through compat_ptr() as intended.
Notes:
2) compat_ptr() did nothing to `cmd`, provided it is uint,
1) compat_ptr() is no-op everywhere (was different on s390 before
8e0b986c59c6 ("s390: Remove compat support")),
3) `arg` might not have been chopped correctly until 8e0b986c59c6. But I
am not sure why noone noticed all those (7) years (from f0193d3ea73b
to 8e0b986c59c6)?
Fixes: f0193d3ea73b ("change semantics of ldisc ->compat_ioctl()")
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: stable@vger.kernel.org # applicable from 4.20 to 6.18 incl
Assisted-by: LLM
Link: https://patch.msgid.link/63e9d84a1e8e23852423206cf3f8907aafc88f17.1793704520.git.jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/tty_io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2969,8 +2969,7 @@ static long tty_compat_ioctl(struct file
if (ld->ops->compat_ioctl)
retval = ld->ops->compat_ioctl(tty, cmd, arg);
if (retval == -ENOIOCTLCMD && ld->ops->ioctl)
- retval = ld->ops->ioctl(tty, (unsigned long)compat_ptr(cmd),
- arg);
+ retval = ld->ops->ioctl(tty, cmd, (unsigned long)compat_ptr(arg));
tty_ldisc_deref(ld);
return retval;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0914/1005] USB: cdc-acm: fix NULL-deref on hangup
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (912 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0913/1005] tty: fix misapplied compat_ptr() in tty_compat_ioctl() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0915/1005] usb: pci-quirks: always assert xHCI OS ownership Greg Kroah-Hartman
` (84 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Dan Drown, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit bc9dd21ec61acd152d9e7c12cb07db37c63ad41a upstream.
Make sure to take a reference to the port tty when processing carrier
detect changes to avoid dereferencing a NULL pointer when the port is
being hung up.
Fixes: 3b563b901eef ("usb: cdc-acm: add PPS support")
Cc: stable <stable@kernel.org>
Cc: Dan Drown <dan-netdev@drown.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20261019123755.2008384-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/class/cdc-acm.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -294,6 +294,7 @@ static void acm_process_notification(str
unsigned long flags;
struct usb_cdc_notification *dr = (struct usb_cdc_notification *)buf;
unsigned char *data = buf + sizeof(struct usb_cdc_notification);
+ struct tty_struct *tty;
switch (dr->bNotificationType) {
case USB_CDC_NOTIFY_NETWORK_CONNECTION:
@@ -320,12 +321,17 @@ static void acm_process_notification(str
difference = acm->ctrlin ^ newctrl;
- if ((difference & USB_CDC_SERIAL_STATE_DCD) && acm->port.tty) {
- struct tty_ldisc *ld = tty_ldisc_ref(acm->port.tty);
- if (ld) {
- if (ld->ops->dcd_change)
- ld->ops->dcd_change(acm->port.tty, newctrl & USB_CDC_SERIAL_STATE_DCD);
- tty_ldisc_deref(ld);
+ if (difference & USB_CDC_SERIAL_STATE_DCD) {
+ tty = tty_port_tty_get(&acm->port);
+ if (tty) {
+ struct tty_ldisc *ld = tty_ldisc_ref(tty);
+
+ if (ld) {
+ if (ld->ops->dcd_change)
+ ld->ops->dcd_change(tty, newctrl & USB_CDC_SERIAL_STATE_DCD);
+ tty_ldisc_deref(ld);
+ }
+ tty_kref_put(tty);
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0915/1005] usb: pci-quirks: always assert xHCI OS ownership
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (913 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0914/1005] USB: cdc-acm: fix NULL-deref on hangup Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0916/1005] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
` (83 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mario Limonciello (AMD), McKenna Fan,
Quinn Schive, Bruno Filipe, Maciej Zonski, Rishabh Jain,
Mathias Nyman
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rishabh Jain <rishabh.jain1198@gmail.com>
commit 5550405351199fe78f4a3cd606c07f5ad7220e1b upstream.
The xHCI ownership protocol requires the OS driver to assert the HC OS
Owned semaphore before using the host controller, then wait for HC BIOS
Owned to clear if firmware owns it.
quirk_usb_handoff_xhci() currently asserts OS Owned only when BIOS Owned
is already set. If firmware leaves BIOS Owned clear, Linux uses the xHC
while both ownership semaphores remain clear.
The timeout fallback also clears BIOS Owned using the original register
value, which can clear OS Owned at the same time.
On an AMD PROM21 xHCI controller (1022:43fc), this caused every S3
resume to terminate Controller Restore State with USBSTS 0x401. Linux
then reset the host controller, both root hubs and the USB Bluetooth
adapter.
The controller entered resume ready and halted with USBSTS 0x1.
Endpoint state, 100 ms save/restore delays, scratchpads, the DCBAA,
device contexts and command, event and transfer rings were verified not
to cause the restore error.
Across four S3 cycles, asserting only HC OS Owned changed USBLEGSUP from
0x00000801 to 0x01000801 and eliminated the restore failure. Testing
included the unmodified 7.1.8-ogc1.1.fc44.x86_64 distribution kernel
using a test module that set the HC OS Owned semaphore. The same test
was repeated after review with the same result. Clearing USBLEGCTLSTS
was independently verified to be unnecessary.
Always assert OS Owned for controllers using the standard xHCI handoff,
and leave the existing TI/Renesas forced handoff unchanged. Keep OS
Owned asserted after the standard handoff, including when forcing BIOS
Owned clear after a timeout, to prevent firmware from reclaiming the
controller during subsequent suspends.
Fixes: 66d4eadd8d06 ("USB: xhci: BIOS handoff and HW initialization.")
Cc: stable@vger.kernel.org
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Tested-by: McKenna Fan <blue_sun@tuta.io>
Tested-by: Quinn Schive <quinnschive@hotmail.com>
Tested-by: Bruno Filipe <bmilreu@gmail.com>
Tested-by: Maciej Zonski <me@zonni.pl>
Signed-off-by: Rishabh Jain <rishabh.jain1198@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20261105175106.241182-4-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/pci-quirks.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -1194,10 +1194,11 @@ static void quirk_usb_handoff_xhci(struc
&& pdev->device == 0x0014)) {
val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
writel(val, base + ext_cap_offset);
- }
-
- /* If the BIOS owns the HC, signal that the OS wants it, and wait */
- if (val & XHCI_HC_BIOS_OWNED) {
+ } else {
+ /*
+ * Perform the standard handoff and leave OS ownership set to
+ * keep the BIOS at bay during subsequent suspends.
+ */
writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
/* Wait for 1 second with 10 microsecond polling interval */
@@ -1209,7 +1210,9 @@ static void quirk_usb_handoff_xhci(struc
dev_warn(&pdev->dev,
"xHCI BIOS handoff failed (BIOS bug ?) %08x\n",
val);
- writel(val & ~XHCI_HC_BIOS_OWNED, base + ext_cap_offset);
+ writel((val | XHCI_HC_OS_OWNED) &
+ ~XHCI_HC_BIOS_OWNED,
+ base + ext_cap_offset);
}
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0916/1005] USB: serial: garmin_gps: fix deadlock on reset request
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (914 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0915/1005] usb: pci-quirks: always assert xHCI OS ownership Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0917/1005] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
` (82 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Bacik, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit ab89a9dab02d9553eb0cc27fd3e4a4998acbc8e9 upstream.
The garmin_gps driver has a reset feature that is supposed to reset the
device when writing a private reset request packet. The reset is however
done synchronously from the write() callback (and without holding the
required device lock) which leads to a deadlock in the line discipline
when hanging up the port as part of disconnect.
Switch to using the asynchronous reset interface while dropping the
redundant and synchronous stopping of the interrupt urb (write()
callbacks are supposed to be atomic and USB core, USB serial core and
the driver itself will unlink and kill all URBs during disconnect).
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/2026102733-prayer-drainer-56f3@gregkh
Cc: stable@vger.kernel.org
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/garmin_gps.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -818,10 +818,9 @@ static void priv_status_resp(struct usb_
* Garmin specific driver functions
******************************************************************************/
-static int process_resetdev_request(struct usb_serial_port *port)
+static void process_resetdev_request(struct usb_serial_port *port)
{
unsigned long flags;
- int status;
struct garmin_data *garmin_data_p = usb_get_serial_port_data(port);
spin_lock_irqsave(&garmin_data_p->lock, flags);
@@ -830,13 +829,8 @@ static int process_resetdev_request(stru
garmin_data_p->serial_num = 0;
spin_unlock_irqrestore(&garmin_data_p->lock, flags);
- usb_kill_urb(port->interrupt_in_urb);
- dev_dbg(&port->dev, "%s - usb_reset_device\n", __func__);
- status = usb_reset_device(port->serial->dev);
- if (status)
- dev_dbg(&port->dev, "%s - usb_reset_device failed: %d\n",
- __func__, status);
- return status;
+ dev_dbg(&port->dev, "%s - usb_queue_reset_device\n", __func__);
+ usb_queue_reset_device(port->serial->interface);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0917/1005] USB: serial: oti6858: fix the teardown order in close
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (915 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0916/1005] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0918/1005] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
` (81 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Johan Hovold, Josef Bacik
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit f184ae84a5d19554d980a918a9c8baaef87ac301 upstream.
The driver passes a baton around: the completion handler of the
interrupt urb either resubmits the urb, submits the read urb or
schedules one of the two delayed works, and the works and the bulk
completion handlers submit the interrupt urb again.
oti6858_close() cancels the works first and kills the urbs afterwards.
An interrupt urb that completes in between schedules a work again:
oti6858_close()
cancel_delayed_work_sync(setup)
cancel_delayed_work_sync(write)
oti6858_read_int_callback()
schedule_delayed_work(setup)
usb_kill_urb(interrupt_in_urb) /* not in flight */
setup_line()
usb_submit_urb(interrupt_in_urb)
The port is now closed with the baton still going round. The next open
fails because the interrupt urb is already submitted, and if the device
is unplugged, oti6858_port_remove() frees the private data while a work
may be pending or running.
Poison the interrupt urb first: that waits for the handler and makes all
further submissions fail, so nothing schedules the works any more. Then
cancel the works, after which only the bulk urbs are left, kill those,
and make the interrupt urb usable again for the next open. Don't print
an error for the submissions that fail with -EPERM in this window, as
oti6858_read_bulk_callback() already does.
Fixes: 49cdee0ed0fc ("USB: oti6858 usb-serial driver (in Nokia CA-42 cable)")
Cc: stable <stable@kernel.org>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/oti6858.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -248,7 +248,7 @@ static void setup_line(struct work_struc
dev_dbg(&port->dev, "%s(): submitting interrupt urb\n", __func__);
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
- if (result != 0) {
+ if (result != 0 && result != -EPERM) {
dev_err(&port->dev, "%s(): usb_submit_urb() failed with error %d\n",
__func__, result);
}
@@ -300,7 +300,7 @@ static void send_data(struct work_struct
dev_dbg(&port->dev, "%s(): submitting interrupt urb\n", __func__);
result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
- if (result != 0) {
+ if (result != 0 && result != -EPERM) {
dev_err(&port->dev, "%s(): usb_submit_urb() failed with error %d\n",
__func__, result);
}
@@ -561,6 +561,13 @@ static void oti6858_close(struct usb_ser
dev_dbg(&port->dev, "%s(): after buf_clear()\n", __func__);
+ /*
+ * The interrupt urb schedules the works, and the works and the bulk
+ * urbs resubmit the interrupt urb: keep it from being submitted until
+ * all of them are gone.
+ */
+ usb_poison_urb(port->interrupt_in_urb);
+
/* cancel scheduled setup */
cancel_delayed_work_sync(&priv->delayed_setup_work);
cancel_delayed_work_sync(&priv->delayed_write_work);
@@ -569,7 +576,8 @@ static void oti6858_close(struct usb_ser
dev_dbg(&port->dev, "%s(): shutting down urbs\n", __func__);
usb_kill_urb(port->write_urb);
usb_kill_urb(port->read_urb);
- usb_kill_urb(port->interrupt_in_urb);
+
+ usb_unpoison_urb(port->interrupt_in_urb);
}
static int oti6858_tiocmset(struct tty_struct *tty,
@@ -826,7 +834,7 @@ static void oti6858_write_bulk_callback(
/* schedule the interrupt urb if we are still open */
dev_dbg(&port->dev, "%s(): submitting interrupt urb\n", __func__);
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
- if (result != 0) {
+ if (result != 0 && result != -EPERM) {
dev_err(&port->dev, "%s(): failed submitting int urb,"
" error %d\n", __func__, result);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0918/1005] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (916 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0917/1005] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0919/1005] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
` (80 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Joonhoe Kim, Konrad Dybcio,
Heikki Krogerus
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonhoe Kim <26rote@gmail.com>
commit 89aaaa26f6985d55676fc5c90440f279733fa132 upstream.
DisplayPort pin assignments C and E give all four SuperSpeed lanes to
DisplayPort, but the USB 2.0 D+/D- pair is not part of the pin
assignment and stays available. The FSA4480 sits on that pair, and in
these modes the driver turns its USB switch off, so a USB 2.0 hub or
device behind a DisplayPort sink is disconnected as soon as the
DisplayPort mode is set.
Configure the USB switch the same way in all DisplayPort modes.
Fixes: c7054c31c1c9 ("usb: typec: fsa4480: rework mux & switch setup to handle more states")
Cc: stable <stable@kernel.org>
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20261022165143.1327-1-26rote@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/mux/fsa4480.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
--- a/drivers/usb/typec/mux/fsa4480.c
+++ b/drivers/usb/typec/mux/fsa4480.c
@@ -93,16 +93,9 @@ static int fsa4480_set(struct fsa4480 *f
sel = FSA4480_SEL_USB;
} else if (fsa->svid) {
switch (fsa->mode) {
- /* DP Only */
case TYPEC_DP_STATE_C:
- case TYPEC_DP_STATE_E:
- enable |= FSA4480_ENABLE_SBU;
- if (reverse)
- sel = FSA4480_SEL_SBU_REVERSE;
- break;
-
- /* DP + USB */
case TYPEC_DP_STATE_D:
+ case TYPEC_DP_STATE_E:
case TYPEC_DP_STATE_F:
enable |= FSA4480_ENABLE_USB | FSA4480_ENABLE_SBU;
sel = FSA4480_SEL_USB;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0919/1005] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (917 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0918/1005] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0920/1005] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
` (79 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Chaz Bailey,
Krishna Kurapati, Heikki Krogerus
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chaz Bailey <charles.s.bailey@gmail.com>
commit 2022b10726be78849626ea3fa33038ee96a54e46 upstream.
nb7vpq904m_probe() allocates struct nb7vpq904m, but client data is not
set during probe.
In nb7vpq904m_remove(), i2c_get_clientdata(client) returns NULL, leading
to a NULL pointer dereference when accessing nb7->retimer or nb7->sw.
Set client data upon successful allocation in probe.
Fixes: 88d8f3ac9c67 ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver")
Cc: stable <stable@kernel.org>
Signed-off-by: Chaz Bailey <charles.s.bailey@gmail.com>
Reviewed-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20261016122045.187862-1-charles.s.bailey@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/mux/nb7vpq904m.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/typec/mux/nb7vpq904m.c
+++ b/drivers/usb/typec/mux/nb7vpq904m.c
@@ -396,6 +396,7 @@ static int nb7vpq904m_probe(struct i2c_c
return -ENOMEM;
nb7->client = client;
+ i2c_set_clientdata(client, nb7);
nb7->regmap = devm_regmap_init_i2c(client, &nb7_regmap);
if (IS_ERR(nb7->regmap)) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0920/1005] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa)
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (918 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0919/1005] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0921/1005] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
` (78 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Olivier Kaloudoff, stable,
Alan Stern
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Kaloudoff <olivier.kaloudoff@gmail.com>
commit fafd23d61494461256d374f67c121f2712e1af2f upstream.
The ASMedia chip detection in uas_use_uas_driver() assumes that every
device with idVendor/idProduct 174c:5106 or 174c:55aa reporting a
config.MaxPower of 0 is an ASM1153 with working UAS.
ASMT135x bridges (iProduct "ASMT135x") share the same 174c:55aa id and
also report MaxPower == 0, so they take the "ASM1153, do nothing"
path — but their UAS implementation is broken:
- The first READ(16) issued by sd probing times out after 30 s;
enumeration only completes after a uas_eh_abort_handler plus a full
uas_eh_host_reset_handler cycle:
scsi 3:0:0:0: Direct-Access ASMT ASMT135x 0 PQ: 0 ANSI: 6
sd 3:0:0:0: [sdb] tag#26 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN
sd 3:0:0:0: [sdb] tag#26 CDB: Read(16) 88 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
scsi host3: uas_eh_host_reset_handler start
usb 6-2: reset SuperSpeed USB device number 2 using xhci_hcd
scsi host3: uas_eh_host_reset_handler success
- Under concurrent load the bridge stalls: all inflight commands (20+
UAS tags in the captured incident, mixed READ(16)/WRITE(16)) hit the
30 s UAS timeout in the same event, forcing repeated abort/reset
cycles and eventually a USB disconnect. Writes dropped mid-flight
during these resets returned zeros to the filesystem (observed as
XFS metadata corruption on the mounted volume).
- Sequential-write throughput is ~45 MiB/s under UAS versus ~136 MiB/s
after disabling UAS (usb-storage BOT mode), which is fully stable:
several tens of GiB written without a single error.
- Bulk reads of healthy LBA ranges do work under UAS (~190 MiB/s, no
errors); the failure pattern is command-timeout at enumeration and
under queue depth / write load, not a broken transfer path.
Since 174c:55aa is shared across several ASMedia bridges and enclosure
rebrandings, distinguish the ASMT135x by its product string — the same
approach used for the HIKSEMI MD202 check a few lines below. The
product strings of working bridges using the same id ("ASM1053E",
"ASM1153", "ASM1153E", "ASM1351", vendor rebrands such as "YZWY_TECH")
do not contain "ASMT135", so the match is safe.
Verified on an ORICO enclosure (iManufacturer "ASMT", iProduct
"ASMT135x", bcdDevice 1.00) attached through an Alpine Ridge TB3 dock:
with the equivalent usb-storage quirks parameter (174c:55aa:u) the
device is completely stable.
Signed-off-by: Olivier Kaloudoff <olivier.kaloudoff@gmail.com>
Cc: stable <stable@kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20261014165741.35758-1-olivier.kaloudoff@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/storage/uas-detect.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -78,6 +78,8 @@ static int uas_use_uas_driver(struct usb
* ASM1051 - with broken (*) uas support
* ASM1053 - with working uas support, but problems with large xfers
* ASM1153 - with working uas support
+ * ASMT135x - broken uas support, shares the ASM1153 MaxPower == 0
+ * signature, identify it by its product string
*
* Devices with these chips re-use a number of device-ids over the
* entire line, so the device-id is useless to determine if we're
@@ -99,7 +101,11 @@ static int uas_use_uas_driver(struct usb
(le16_to_cpu(udev->descriptor.idProduct) == 0x5106 ||
le16_to_cpu(udev->descriptor.idProduct) == 0x55aa)) {
if (udev->actconfig->desc.bMaxPower == 0) {
- /* ASM1153, do nothing */
+ if (udev->product && strstr(udev->product, "ASMT135")) {
+ /* ASMT135x, broken uas */
+ flags |= US_FL_IGNORE_UAS;
+ }
+ /* else ASM1153, do nothing */
} else if (udev->speed < USB_SPEED_SUPER) {
/* No streams info, assume ASM1051 */
flags |= US_FL_IGNORE_UAS;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0921/1005] usb: usbtest: prevent divide by zero in simple_io() with zero length
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (919 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0920/1005] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0922/1005] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 Greg Kroah-Hartman
` (77 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Bin Yu, Cheng Wen,
YuanZhe Liu, Alan Stern
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
commit fdaca138694111153f96c7d76877734b9dbf0e01 upstream.
A divide error oops was observed in simple_io():
usbtest 1-1:1.0: TEST 3: write/1 0..0 bytes 16307 times
Oops: divide error: 0000 [#1] SMP KASAN
RIP: 0010:simple_io+0x2c4/0x540 drivers/usb/misc/usbtest.c:497
The variable-length tests (test 3 and test 4) compute the next URB
size with "len %= max", where max is the original
urb->transfer_buffer_length. However, when a zero-length transfer is
requested (param->length == 0), simple_alloc_urb() still returns a valid
URB with transfer_buffer_length set to 0. On the first vary update,
"len %= max" divides by zero and the kernel oopses.
Commit 564e69893c63 ("USB: usbtest: prevent a divide by zero bug") added
the equivalent zero check to alloc_sglist(), which covers the
scatterlist tests (test 7/8), but the single-URB variable-length path in
simple_io() was left unprotected.
Fix this by returning -EINVAL early from simple_io() when vary is
requested but max is zero, so the divide by zero never occurs.
Zero-length transfers without vary remain valid for the other callers of
simple_io().
Cc: stable <stable@kernel.org>
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20261016072750.34256-1-25031212351@stu.xidian.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/misc/usbtest.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -466,6 +466,9 @@ static int simple_io(
int retval = 0;
unsigned long expire;
+ if (vary && !max)
+ return -EINVAL;
+
urb->context = &completion;
while (retval == 0 && iterations-- > 0) {
init_completion(&completion);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0922/1005] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (920 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0921/1005] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0923/1005] usb: typec: ucsi: debugfs: Fix GET commands on UCSI < 2.0 Greg Kroah-Hartman
` (76 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Francesco Orro, Ihor Urazov,
Heikki Krogerus, Huang Wei
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ihor Urazov <z0rc3r@gmail.com>
commit 3ee1e1c3fca6fb5d0abbe0fc91539951ffa60aa7 upstream.
The HP ZBook 8 G2i 14 (board 8ED9) exposes a working UCSI ACPI PPM, but
its UCSI VERSION field reads zero until the first command completes.
ucsi_register() rejects a zero version with -ENODEV, so no Type-C ports
are registered.
The firmware's _DSM READ function (2) is a stub. The mailbox VERSION
field is written only by the EC response handler, after a command
completes, after which it reads 0x0100 (UCSI 1.0). The mailbox is
48 bytes with 16-byte MESSAGE_IN/MESSAGE_OUT fields, the UCSI 1.x
layout, and _DSM function 5 is not implemented.
Add a DMI-specific read_version for this board that substitutes the
version the firmware itself reports, UCSI 1.0, only when VERSION reads
zero. A non-zero firmware version is used as is.
The same firmware defect on the HP ZBook Fury G1i 16 was discussed in
"[RFC PATCH] usb: typec: ucsi: acpi: bootstrap PPM on HP systems with
empty _DSM func 2" [1]. The defect was reported to HP as case
5166176673.
Tested on an HP ZBook 8 G2i 14 with BIOS Y70 01.02.08, from a fresh
boot where VERSION reads zero: three connectors register, the PD
contract and alternate modes of a Thunderbolt dock are reported, and
its DisplayPort output stays up across the PPM reset in ucsi_init().
Dock unplug/replug and s2idle suspend/resume update the connector
state without errors.
Link: https://lore.kernel.org/linux-usb/f3M_fpjtt8FxDqGKcA84vqXmRbKzCBfpCrIK4-jCWvIscER51zkD8qD8FYpz75qZw51rMDRSkUyYlrBvLvdM8CGRY2l8TFVvr4MC1LdTzbc=@interstellar.eu/ [1]
Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface")
Cc: stable <stable@kernel.org>
Cc: Francesco Orro <ncesco@interstellar.eu>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ihor Urazov <z0rc3r@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Huang Wei <huangwei@kylinos.cn>
Link: https://patch.msgid.link/20261026-ucsi-hp-zbook-8-g2i-v1-1-91002e9ef073@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/ucsi/ucsi_acpi.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
--- a/drivers/usb/typec/ucsi/ucsi_acpi.c
+++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
@@ -148,6 +148,34 @@ static const struct ucsi_operations ucsi
.async_control = ucsi_acpi_async_control
};
+static int ucsi_hp_read_version(struct ucsi *ucsi, u16 *version)
+{
+ struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
+ int ret;
+
+ ret = ucsi_acpi_read_version(ucsi, version);
+ if (ret)
+ return ret;
+
+ /* Firmware fills in VERSION (1.0) only after the first command completes */
+ if (!*version) {
+ dev_warn(ua->dev, "UCSI version is zero, assuming 1.0\n");
+ *version = UCSI_VERSION_1_0;
+ }
+
+ return 0;
+}
+
+static const struct ucsi_operations ucsi_hp_ops = {
+ .read_version = ucsi_hp_read_version,
+ .read_cci = ucsi_acpi_read_cci,
+ .poll_cci = ucsi_acpi_poll_cci,
+ .read_message_in = ucsi_acpi_read_message_in,
+ .write_message_out = ucsi_acpi_write_message_out,
+ .sync_control = ucsi_sync_control_common,
+ .async_control = ucsi_acpi_async_control
+};
+
static int ucsi_gram_sync_control(struct ucsi *ucsi, u64 command, u32 *cci,
void *val, size_t len, void *msg_out,
size_t msg_out_size)
@@ -198,6 +226,13 @@ static const struct dmi_system_id ucsi_a
},
{
.matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+ DMI_MATCH(DMI_BOARD_NAME, "8ED9"),
+ },
+ .driver_data = (void *)&ucsi_hp_ops,
+ },
+ {
+ .matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
DMI_MATCH(DMI_PRODUCT_FAMILY, "LG gram PC"),
DMI_MATCH(DMI_PRODUCT_NAME, "90Q"),
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0923/1005] usb: typec: ucsi: debugfs: Fix GET commands on UCSI < 2.0
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (921 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0922/1005] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0924/1005] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
` (75 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Ali Ahmet Memiş,
Heikki Krogerus
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ali Ahmet Memiş <aliamemis@disroot.org>
commit 7cfb037005c04b9dee5b0c4626e56e2eddeef157 upstream.
Since the debugfs response buffer grew to 24 bytes, every GET command
fails with -EINVAL on UCSI < 2.0, where the data length is limited to 16
bytes. Clamp the length to UCSI_MAX_DATA_LENGTH().
Fixes: d9dc19910321 ("usb: typec: ucsi: Fix debugfs response truncation beyond 16 bytes")
Cc: stable <stable@kernel.org>
Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://patch.msgid.link/20261024174441.878903-1-aliamemis@disroot.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/ucsi/debugfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/typec/ucsi/debugfs.c b/drivers/usb/typec/ucsi/debugfs.c
index 77a0dd75edd3..3cffd3778c67 100644
--- a/drivers/usb/typec/ucsi/debugfs.c
+++ b/drivers/usb/typec/ucsi/debugfs.c
@@ -60,7 +60,8 @@ static int ucsi_cmd(void *data, u64 val)
case UCSI_GET_LPM_PPM_INFO:
ret = ucsi_send_command(ucsi, val,
&ucsi->debugfs->response,
- sizeof(ucsi->debugfs->response));
+ min(sizeof(ucsi->debugfs->response),
+ UCSI_MAX_DATA_LENGTH(ucsi)));
break;
default:
ret = -EOPNOTSUPP;
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0924/1005] usb: typec: ucsi: Set ucsi->connector before enabling notifications
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (922 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0923/1005] usb: typec: ucsi: debugfs: Fix GET commands on UCSI < 2.0 Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0925/1005] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
` (74 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Uttkarsh Aggarwal,
Peter Chen, Heikki Krogerus
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uttkarsh Aggarwal <uttkarsh.aggarwal@oss.qualcomm.com>
commit 5b4b83c2ffe8740f6f3e54ea4d4962a62c063ef1 upstream.
In ucsi_init(), ucsi->connector is assigned only after the
UCSI_SET_NOTIFICATION_ENABLE command completes. But once that command
is sent, the PPM is free to raise a connector change notification at
any time, which is handled through:
ucsi_notify_common() -> ucsi_connector_change()
ucsi_connector_change() indexes into ucsi->connector to get the
connector and schedule its work item. If this notification arrives
before ucsi_init() reaches the "ucsi->connector = connector;" line,
ucsi->connector is still NULL and the driver crashes dereferencing it.
Fix this by setting ucsi->connector right after the connectors are
registered, before notifications are enabled, so it is always valid
by the time a connector change event can be delivered. Also clear
ucsi->connector in the err_unregister path so it isn't left pointing
at freed memory if a later step in ucsi_init() fails.
Fixes: 0482c34ec6f8 ("usb: ucsi: Fix ucsi->connector race")
Cc: stable <stable@kernel.org>
Signed-off-by: Uttkarsh Aggarwal <uttkarsh.aggarwal@oss.qualcomm.com>
Reviewed-by: Peter Chen <peter.chen@oss.qualcomm.com>
Reviewed-by: Heikki Krogerus <heikki.krogeurs@linuc.intel.com>
Link: https://patch.msgid.link/20260929092939.1806907-1-uttkarsh.aggarwal@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/ucsi/ucsi.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -2134,6 +2134,14 @@ static int ucsi_init(struct ucsi *ucsi)
goto err_unregister;
}
+ /*
+ * Set ucsi->connector before enabling notifications. A connector
+ * change event can be handled as soon as the notifications are
+ * enabled below, and ucsi_connector_change() indexes into
+ * ucsi->connector, so it must not be NULL at that point.
+ */
+ ucsi->connector = connector;
+
/* Enable all supported notifications */
ntfy = ucsi_get_supported_notifications(ucsi);
command = UCSI_SET_NOTIFICATION_ENABLE | ntfy;
@@ -2141,7 +2149,6 @@ static int ucsi_init(struct ucsi *ucsi)
if (ret < 0)
goto err_unregister;
- ucsi->connector = connector;
ucsi->ntfy = ntfy;
mutex_lock(&ucsi->ppm_lock);
@@ -2155,6 +2162,7 @@ static int ucsi_init(struct ucsi *ucsi)
return 0;
err_unregister:
+ ucsi->connector = NULL;
for (con = connector; con->port; con++)
ucsi_unregister_port(con);
for (i = 0; i < ucsi->cap.num_connectors; i++)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0925/1005] usb: xhci: disable the correct slot on alloc_dev failure
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (923 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0924/1005] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0926/1005] usb: xhci: clear stale bandwidth data after hibernation Greg Kroah-Hartman
` (73 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xu Rao, Niklas Neronin,
Mathias Nyman
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xu Rao <raoxu@uniontech.com>
commit 2f2fe3201029ffc215b46ac40a0a9587715bc43a upstream.
xhci_alloc_dev() stores the Slot ID returned by the Enable Slot command
in the local slot_id variable. udev->slot_id is updated only after
xhci_alloc_virt_device() succeeds.
If endpoint resource reservation or virtual device allocation fails
before that update, the error path passes udev->slot_id to
xhci_disable_and_free_slot(). During initial enumeration this is slot 0.
When reallocating a device whose virtual device is missing or belongs to
another usb_device, udev->slot_id may contain a stale Slot ID.
The newly enabled slot can therefore remain active, or the wrong slot can
be disabled.
Pass slot_id, which identifies the slot enabled by this invocation.
xhci_disable_and_free_slot() already handles a missing xhci->devs entry.
Fixes: 3ffbba9511b4 ("USB: xhci: Allocate and address USB devices")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Reviewed-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20261105175106.241182-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4300,7 +4300,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd,
return 1;
disable_slot:
- xhci_disable_and_free_slot(xhci, udev->slot_id);
+ xhci_disable_and_free_slot(xhci, slot_id);
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0926/1005] usb: xhci: clear stale bandwidth data after hibernation
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (924 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0925/1005] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0927/1005] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
` (72 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Harald Judt, Lovekesh Solanki,
stable, Niklas Neronin, Mathias Nyman
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Neronin <niklas.neronin@linux.intel.com>
commit d1ec1859f3b8641e3e5c5953cc7dd8e63b54339f upstream.
Controllers using software managed bandwidth accounting maintain
periodic endpoint bandwidth information in struct 'xhci_interval_bw_table'.
Each root hub port owns a bandwidth table and a list of TT bandwidth
domains, where each TT has its own bandwidth table. Virtual devices
reference the bandwidth table of their current bandwidth domain through
'bw_table' or 'tt_info'.
Historically, resume from S4 reinitialized the entire xHCI driver state,
which implicitly cleared all bandwidth accounting data. After the
hibernation resume path was optimized to preserve parts of the driver
state, virtual devices and TT bandwidth information were freed and
recreated, but the root hub bandwidth tables were left intact.
As a result, stale bandwidth accounting data could remain in the root
hub bandwidth tables across hibernation resume, leading to incorrect
bandwidth calculations after devices were rediscovered.
Fix this by resetting all bandwidth accounting data in xhci_rh_bw_cleanup()
so that resume starts with a clean bandwidth state, and resetting the total
active endpoints count.
Fixes: 2a70e5dc0301 ("usb: xhci: optimize resuming from S4 (suspend-to-disk)")
Reported-by: Harald Judt <h.judt@gmx.at>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=222071
Suggested-by: Lovekesh Solanki <lovekeshsolanki00@gmail.com>
Tested-by: Harald Judt <h.judt@gmx.at>
Cc: stable <stable@kernel.org>
Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20261105175106.241182-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci-mem.c | 16 +++++++++++++++-
drivers/usb/host/xhci.c | 1 +
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index af8d4b74c4ba..75577f441cdd 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1903,24 +1903,38 @@ EXPORT_SYMBOL_GPL(xhci_remove_secondary_interrupter);
void xhci_rh_bw_cleanup(struct xhci_hcd *xhci)
{
struct xhci_root_port_bw_info *rh_bw;
+ struct xhci_interval_bw_table *bw_table;
+ struct xhci_interval_bw *interval_bw;
struct xhci_tt_bw_info *tt_info, *tt_next;
struct list_head *eps, *ep, *ep_next;
for (int i = 0; i < xhci->max_ports; i++) {
rh_bw = &xhci->rh_bw[i];
+ rh_bw->num_active_tts = 0;
/* Clear and free all TT bandwidth entries */
list_for_each_entry_safe(tt_info, tt_next, &rh_bw->tts, tt_list) {
list_del(&tt_info->tt_list);
kfree(tt_info);
}
+ bw_table = &rh_bw->bw_table;
+ bw_table->interval0_esit_payload = 0;
+ bw_table->bw_used = 0;
+ bw_table->ss_bw_in = 0;
+ bw_table->ss_bw_out = 0;
+
/* Clear per-interval endpoint lists */
for (int j = 0; j < XHCI_MAX_INTERVAL; j++) {
- eps = &rh_bw->bw_table.interval_bw[j].endpoints;
+ interval_bw = &bw_table->interval_bw[j];
+ eps = &interval_bw->endpoints;
+ interval_bw->num_packets = 0;
list_for_each_safe(ep, ep_next, eps)
list_del_init(ep);
+ interval_bw->overhead[LS_OVERHEAD_TYPE] = 0;
+ interval_bw->overhead[FS_OVERHEAD_TYPE] = 0;
+ interval_bw->overhead[HS_OVERHEAD_TYPE] = 0;
}
}
}
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 94da0268b7b3..a762dd010e8d 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1185,6 +1185,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool power_lost, bool is_auto_resume)
for (int i = xhci->max_slots; i > 0; i--)
xhci_free_virt_devices_depth_first(xhci, i);
+ xhci->num_active_eps = 0;
xhci_rh_bw_cleanup(xhci);
xhci->cmd_ring_reserved_trbs = 0;
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0927/1005] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (925 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0926/1005] usb: xhci: clear stale bandwidth data after hibernation Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0928/1005] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
` (71 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Yu Zhang, Alan Stern
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Zhang <yuz08559@gmail.com>
commit 450fa94d7ae9fc91c3df525f5d1322bf8fecf7b2 upstream.
fsg_store_nofua() syncs the LUN's backing file when switching from async
to sync mode:
if (!nofua && curlun->nofua)
fsg_lun_fsync_sub(curlun);
fsg_lun_fsync_sub() dereferences curlun->filp (vfs_fsync(filp)). Unlike
every other store that touches the backing file -- fsg_store_ro() and
fsg_store_cdrom() (down_read), fsg_store_file() (down_write) --
fsg_store_nofua() holds no filesem while doing so.
A concurrent close of the backing file runs under down_write(filesem) and
does fput(curlun->filp) in fsg_lun_close() (fsg_store_file() with an empty
path, the SCSI START_STOP eject in do_start_stop(), or forced_eject), so
it can free the file while fsg_store_nofua() is dereferencing it:
BUG: KASAN: slab-use-after-free in vfs_fsync+0x20/0xe0
vfs_fsync+0x20/0xe0
fsg_lun_fsync_sub+0xa0/0xd0
fsg_store_nofua+0x138/0x160
configfs_write_iter+0x1a7/0x250
vfs_write+0x5df/0x940
Allocated by task 3459:
fsg_store_file+0x150/0x1f0
configfs_write_iter+0x1a7/0x250
Freed by task 3459:
__fput+0x456/0x6c0
__fput_deferred+0x10d/0x330
fsg_store_file+0x9e/0x1f0
configfs_write_iter+0x1a7/0x250
Hold filesem for read around the fsync in fsg_store_nofua() so the backing
file cannot be closed underneath it. The lock is only needed when the
fsync actually runs, so it is taken only in that branch.
Reproduced on a mass_storage gadget over dummy_hcd by writing lun.N/nofua
(1 then 0) from one task while another task rewrites and clears lun.N/file.
Cc: stable <stable@kernel.org>
Signed-off-by: Yu Zhang <yuz08559@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20261020023050.87701-1-yuz08559@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/f_mass_storage.c | 8 ++++++--
drivers/usb/gadget/function/storage_common.c | 7 +++++--
drivers/usb/gadget/function/storage_common.h | 3 ++-
3 files changed, 13 insertions(+), 5 deletions(-)
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -2667,8 +2667,9 @@ static ssize_t nofua_store(struct device
const char *buf, size_t count)
{
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
+ struct rw_semaphore *filesem = dev_get_drvdata(dev);
- return fsg_store_nofua(curlun, buf, count);
+ return fsg_store_nofua(curlun, filesem, buf, count);
}
static ssize_t file_store(struct device *dev, struct device_attribute *attr,
@@ -3246,7 +3247,10 @@ static ssize_t fsg_lun_opts_nofua_show(s
static ssize_t fsg_lun_opts_nofua_store(struct config_item *item,
const char *page, size_t len)
{
- return fsg_store_nofua(to_fsg_lun_opts(item)->lun, page, len);
+ struct fsg_lun_opts *opts = to_fsg_lun_opts(item);
+ struct fsg_opts *fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent);
+
+ return fsg_store_nofua(opts->lun, &fsg_opts->common->filesem, page, len);
}
CONFIGFS_ATTR(fsg_lun_opts_, nofua);
--- a/drivers/usb/gadget/function/storage_common.c
+++ b/drivers/usb/gadget/function/storage_common.c
@@ -415,7 +415,8 @@ ssize_t fsg_store_ro(struct fsg_lun *cur
}
EXPORT_SYMBOL_GPL(fsg_store_ro);
-ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count)
+ssize_t fsg_store_nofua(struct fsg_lun *curlun, struct rw_semaphore *filesem,
+ const char *buf, size_t count)
{
bool nofua;
int ret;
@@ -425,8 +426,10 @@ ssize_t fsg_store_nofua(struct fsg_lun *
return ret;
/* Sync data when switching from async mode to sync */
- if (!nofua && curlun->nofua)
+ if (!nofua && curlun->nofua) {
+ guard(rwsem_read)(filesem);
fsg_lun_fsync_sub(curlun);
+ }
curlun->nofua = nofua;
--- a/drivers/usb/gadget/function/storage_common.h
+++ b/drivers/usb/gadget/function/storage_common.h
@@ -210,7 +210,8 @@ ssize_t fsg_show_cdrom(struct fsg_lun *c
ssize_t fsg_show_removable(struct fsg_lun *curlun, char *buf);
ssize_t fsg_store_ro(struct fsg_lun *curlun, struct rw_semaphore *filesem,
const char *buf, size_t count);
-ssize_t fsg_store_nofua(struct fsg_lun *curlun, const char *buf, size_t count);
+ssize_t fsg_store_nofua(struct fsg_lun *curlun, struct rw_semaphore *filesem,
+ const char *buf, size_t count);
ssize_t fsg_store_file(struct fsg_lun *curlun, struct rw_semaphore *filesem,
const char *buf, size_t count);
ssize_t fsg_store_cdrom(struct fsg_lun *curlun, struct rw_semaphore *filesem,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0928/1005] usb: gadget: f_midi: fix UAF race during IN request handling
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (926 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0927/1005] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0929/1005] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
` (70 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Sonali Pradhan
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sonali Pradhan <sonalipradhan@google.com>
commit 78a8d6537f1de34770e460edee360b556ef40427 upstream.
f_midi_disable() drains and frees pre-allocated IN requests from
in_req_fifo without holding midi->transmit_lock. If f_midi_transmit()
runs concurrently on the workqueue, f_midi_do_transmit() can peek a
request from in_req_fifo and write into its buffer while
f_midi_disable() frees it, leading to a use-after-free.
Additionally, when usb_ep_queue() fails in f_midi_do_transmit() (such
as with -ESHUTDOWN when the endpoint is disabled concurrently), it
resets req->length = 0 and returns active instead of the error code,
causing the do-while loop in f_midi_transmit() to keep spinning under
midi->transmit_lock until the substream is drained.
Fix this by acquiring midi->transmit_lock in f_midi_disable() while
releasing IN requests from in_req_fifo, and returning the error code
from f_midi_do_transmit() when usb_ep_queue() fails so f_midi_transmit()
aborts immediately and drops active substreams.
Fixes: e1e3d7ec5da3 ("usb: gadget: f_midi: pre-allocate IN requests")
Cc: stable <stable@kernel.org>
Signed-off-by: Sonali Pradhan <sonalipradhan@google.com>
Link: https://patch.msgid.link/20261028074821.579450-1-sonalipradhan@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/f_midi.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -420,6 +420,7 @@ static void f_midi_disable(struct usb_fu
struct f_midi *midi = func_to_midi(f);
struct usb_composite_dev *cdev = f->config->cdev;
struct usb_request *req = NULL;
+ unsigned long flags;
DBG(cdev, "disable\n");
@@ -431,8 +432,10 @@ static void f_midi_disable(struct usb_fu
usb_ep_disable(midi->out_ep);
/* release IN requests */
+ spin_lock_irqsave(&midi->transmit_lock, flags);
while (kfifo_get(&midi->in_req_fifo, &req))
free_ep_req(midi->in_ep, req);
+ spin_unlock_irqrestore(&midi->transmit_lock, flags);
f_midi_drop_out_substreams(midi);
}
@@ -661,6 +664,7 @@ static int f_midi_do_transmit(struct f_m
ERROR(midi, "%s failed to queue req: %d\n",
midi->in_ep->name, err);
req->length = 0; /* Re-use request next time. */
+ return err;
} else {
/* Upon success, put request at the back of the queue. */
kfifo_skip(&midi->in_req_fifo);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0929/1005] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (927 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0928/1005] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0930/1005] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
` (69 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Cosmin Tanislav,
Vladyslav Tymoshchuk, Leonardo Costa, Hiago De Franco
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
commit 78585f90feb3bbaf3b1c642294c8c47e451dc3cf upstream.
ncm_wrap_ntb() aggregates datagrams into a pending NTB, which is sent
either when it becomes full, or after 300us since the NTB was started,
using ndo_start_xmit() (eth_start_xmit()).
ndo_start_xmit() returns NETDEV_TX_BUSY when the TX freelist is empty.
For regular packets this is fine since the networking core will requeue
them, but for timer-flushed packets there is no logic to handle this
situation, and HRTIMER_NORESTART is returned from ncm_tx_timeout()
without checking eth_start_xmit()'s return value.
Under sustained TX saturation the request freelist is empty most of the
time. Since the timer is never restarted, small packets keep getting
accumulated into the NTB, until either TX_MAX_NUM_DPE packets are stored
or NTB_DEFAULT_IN_SIZE is reached, which is an unknown amount of time.
Check the return value of ndo_start_xmit() and restart the timer after
another 300us.
Cc: stable <stable@kernel.org>
Fixes: 6d3865f9d41f ("usb: gadget: NCM: Add transmit multi-frame.")
Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Tested-by: Vladyslav Tymoshchuk <tvlad744@gmail.com>
Tested-by: Leonardo Costa <leonardo.costa@toradex.com>
Reported-by: Hiago De Franco <hiago.franco@toradex.com>
Closes: https://lore.kernel.org/all/20231204183751.64202-1-hiagofranco@gmail.com/
Link: https://patch.msgid.link/20260817192638.437798-1-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/f_ncm.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -1148,6 +1148,7 @@ static enum hrtimer_restart ncm_tx_timeo
{
struct f_ncm *ncm = container_of(data, struct f_ncm, task_timer);
struct net_device *netdev = READ_ONCE(ncm->netdev);
+ netdev_tx_t ret;
if (netdev) {
/* XXX This allowance of a NULL skb argument to ndo_start_xmit
@@ -1158,7 +1159,11 @@ static enum hrtimer_restart ncm_tx_timeo
*
* This will call directly into u_ether's eth_start_xmit()
*/
- netdev->netdev_ops->ndo_start_xmit(NULL, netdev);
+ ret = netdev->netdev_ops->ndo_start_xmit(NULL, netdev);
+ if (ret == NETDEV_TX_BUSY) {
+ hrtimer_forward_now(data, TX_TIMEOUT_NSECS);
+ return HRTIMER_RESTART;
+ }
}
return HRTIMER_NORESTART;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0930/1005] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (928 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0929/1005] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0931/1005] usb: gadget: u_serial: pin ports while TTYs are installed Greg Kroah-Hartman
` (68 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+782b2f1063e38ba8fa6e, stable,
Brian Ellis
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Ellis <brianellis@gotenna.com>
commit ea6cf69ad03c8d85138830c0d2c3b946b5ae231d upstream.
gs_close() opens with
struct gs_port *port = tty->driver_data;
...
spin_lock_irq(&port->port_lock);
and never checks port. gs_open() assigns tty->driver_data only on the
port.count 0 -> 1 edge, so any failure earlier in gs_open() leaves it NULL,
and tty_open() calls tty_release(), and hence ->close(), when ->open()
fails.
syzbot hit exactly this on arm64. Fault injection failed the kfifo_alloc()
of the write buffer in gs_open():
__kfifo_alloc_node+0x10c/0x208 lib/kfifo.c:44
gs_open+0x144/0x514 drivers/usb/gadget/function/u_serial.c:636
tty_open+0x404/0x89c drivers/tty/tty_io.c:2137
and the tty core's close of the failed open then took port_lock through
the NULL port:
BUG: unable to handle kernel paging request in gs_close
KASAN: null-ptr-deref in range [0x00000000000003a0-0x00000000000003a7]
Call trace:
spin_lock_irq include/linux/spinlock.h:372 [inline]
gs_close+0xac/0x65c drivers/usb/gadget/function/u_serial.c:698
tty_release+0x2c4/0xffc drivers/tty/tty_io.c:1745
tty_open+0x46c/0x89c drivers/tty/tty_io.c:2146
Return early instead. There is nothing to release when the open never got
far enough to claim the port.
Unlike the check reverted by commit f6c7bc4a6823 ("Revert "usb: gadget:
u_serial: Add null pointer check in gs_start_io""), this is not hiding a
race: the tty core calls ->close() for an ->open() that failed by design,
so driver_data is legitimately unset on that path.
Fixes: c1dca562be8a ("usb gadget: split out serial core")
Reported-by: syzbot+782b2f1063e38ba8fa6e@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=782b2f1063e38ba8fa6e
Cc: stable <stable@kernel.org>
Assisted-by: LLM
Signed-off-by: Brian Ellis <brianellis@gotenna.com>
Link: https://patch.msgid.link/20261013-u_serial-gs-close-null-v4-1-9ea038501994@gotenna.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/u_serial.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/usb/gadget/function/u_serial.c
+++ b/drivers/usb/gadget/function/u_serial.c
@@ -695,6 +695,9 @@ static void gs_close(struct tty_struct *
struct gs_port *port = tty->driver_data;
struct gserial *gser;
+ if (!port)
+ return;
+
spin_lock_irq(&port->port_lock);
if (port->port.count != 1) {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0931/1005] usb: gadget: u_serial: pin ports while TTYs are installed
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (929 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0930/1005] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0932/1005] usb: dwc3: trace: Restore request name assignment Greg Kroah-Hartman
` (67 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+fe63e4d633540f230624, stable,
Krystian Kaniewski, syzbot, Mehmet Fide,
syzbot+bca09f5d8b843bbf7571
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krystian Kaniewski <krystianmkaniewski@gmail.com>
commit 1981b53c2b52a00f0f4b9eb87183c9aedc8dac5d upstream.
A slab-use-after-free can occur when gserial_free_line() frees struct
gs_port while it is still reachable through an installed TTY. The
port->port.count value tracks successful opens, but it is zero before
gs_open() and again after gs_close(), before TTY cleanup has finished.
Teardown can therefore free gs_port while tty_init_dev() or release_tty()
still accesses its tty_port.
Manage gs_port lifetime with tty_port references. Take a reference in
gs_install(), drop it in gs_cleanup(), and move the final free to
gs_port_destruct(). Unregister the TTY device before dropping the owner
reference.
Keep each minor reserved until the old port is destroyed so an installed
TTY for one generation cannot overlap a replacement at the same minor.
Publish the new port before device registration so the cdev and add uevent
never expose a TTY before gs_install() can pin it. Since commit
8df07fe93573 ("tty: fix saved termios reset race"), u_serial registration
no longer frees saved termios. On registration failure, unpublish the port
before dropping its owner reference.
Check in gs_open() that the installed port is still the published
generation. Track failures after a successful install so close callbacks
issued by the TTY core do not decrement port->port.count for opens that
never incremented it.
Fixes: 19b10a8828a6 ("usb: gadget: allocate & giveback serial ports instead hard code them")
Assisted-by: Gemini:gemini-3.8-flash syzbot
Reported-by: syzbot+fe63e4d633540f230624@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=fe63e4d633540f230624
Link: https://syzkaller.appspot.com/ai_job?id=ec789387-2e7b-4a8f-a7a1-a47bf7fa57f5
Cc: stable <stable@kernel.org>
Signed-off-by: Krystian Kaniewski <krystianmkaniewski@gmail.com>
Tested-by: syzbot@syzkaller.appspotmail.com
Tested-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
Reported-by: syzbot+bca09f5d8b843bbf7571@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=bca09f5d8b843bbf7571
Link: https://patch.msgid.link/20261022091359.1187468-1-krystianmkaniewski@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/u_serial.c | 167 ++++++++++++++++++++++++++-------
1 file changed, 134 insertions(+), 33 deletions(-)
--- a/drivers/usb/gadget/function/u_serial.c
+++ b/drivers/usb/gadget/function/u_serial.c
@@ -70,10 +70,28 @@
* gserial->ioport == usb_ep->driver_data ... gs_port
* gs_port->port_usb ... gserial
*
- * gs_port <---> tty_struct ... links will be null when the TTY file
- * isn't opened; managed by gs_open()/gs_close()
- * gserial->port_tty ... tty_struct
- * tty_struct->driver_data ... gserial
+ * gs_port <---> tty_struct:
+ * tty->driver_data refers to gs_port from install through cleanup,
+ * pinning the port via tty_port reference counting.
+ * gs_port->port.tty exists only while the port is open.
+ *
+ * Each entry in ports[] is guarded by ports[i].lock and models three states:
+ * - Free: !port && !reserved
+ * - Published: port && reserved
+ * - Retiring: !port && reserved
+ *
+ * A minor remains reserved until gs_port_destruct() runs upon final tty_port
+ * release, preventing minor reuse while cleanup of the installed TTY is still
+ * underway. The owner reference is retained through device unregister so the
+ * destructor releases the reservation only after device teardown is complete.
+ *
+ * open_close_failures tracks failed gs_open() calls where port->port.count
+ * was not incremented. The TTY core calls gs_close() on open failure to tear
+ * down the tty; tracking failures as aggregate credits allows gs_close() to
+ * consume a credit and exit without decrementing port->port.count. Credits
+ * are aggregate rather than paired with individual files (another gs_close()
+ * can consume a failed open's credit before that file's own close runs).
+ * It is protected by tty_lock.
*/
/* RX and TX queues can buffer QUEUE_SIZE packets before they hit the
@@ -128,6 +146,7 @@ struct gs_port {
wait_queue_head_t close_wait;
bool suspended; /* port suspended */
bool start_delayed; /* delay start when suspended */
+ unsigned int open_close_failures; /* protected by tty_lock */
struct async_icount icount;
/* REVISIT this state ... */
@@ -135,8 +154,9 @@ struct gs_port {
};
static struct portmaster {
- struct mutex lock; /* protect open/close */
+ struct mutex lock; /* protect open/close and port slot */
struct gs_port *port;
+ bool reserved;
} ports[MAX_U_SERIAL_PORTS];
#define GS_CLOSE_TIMEOUT 15 /* seconds */
@@ -603,22 +623,60 @@ static int gserial_wakeup_host(struct gs
/* TTY Driver */
+static int gs_install(struct tty_driver *driver, struct tty_struct *tty)
+{
+ struct gs_port *port;
+ struct tty_port *tport;
+ int ret;
+
+ mutex_lock(&ports[tty->index].lock);
+ port = ports[tty->index].port;
+ if (!port) {
+ mutex_unlock(&ports[tty->index].lock);
+ return -ENODEV;
+ }
+
+ tport = tty_port_get(&port->port);
+ if (!tport) {
+ mutex_unlock(&ports[tty->index].lock);
+ return -ENODEV;
+ }
+
+ ret = tty_port_install(tport, driver, tty);
+ if (ret) {
+ mutex_unlock(&ports[tty->index].lock);
+ tty_port_put(tport);
+ return ret;
+ }
+
+ tty->driver_data = port;
+ mutex_unlock(&ports[tty->index].lock);
+
+ return 0;
+}
+
+static void gs_cleanup(struct tty_struct *tty)
+{
+ tty_port_put(tty->port);
+}
+
/*
- * gs_open sets up the link between a gs_port and its associated TTY.
- * That link is broken *only* by TTY close(), and all driver methods
- * know that.
+ * gs_open associates an open TTY with its gs_port.
+ *
+ * There are two TTY-to-port relationships: port->port.tty exists from the
+ * first successful open until final close, while tty->driver_data is assigned
+ * during gs_install() and remains valid through gs_cleanup().
*/
static int gs_open(struct tty_struct *tty, struct file *file)
{
int port_num = tty->index;
- struct gs_port *port;
+ struct gs_port *port = tty->driver_data;
int status = 0;
mutex_lock(&ports[port_num].lock);
- port = ports[port_num].port;
- if (!port) {
+ if (ports[port_num].port != port) {
status = -ENODEV;
- goto out;
+ goto fail_unlock;
}
spin_lock_irq(&port->port_lock);
@@ -638,7 +696,7 @@ static int gs_open(struct tty_struct *tt
if (status) {
pr_debug("gs_open: ttyGS%d (%p,%p) no buffer\n",
port_num, tty, file);
- goto out;
+ goto fail_unlock;
}
spin_lock_irq(&port->port_lock);
@@ -648,7 +706,6 @@ static int gs_open(struct tty_struct *tt
if (port->port.count++)
goto exit_unlock_port;
- tty->driver_data = port;
port->port.tty = tty;
/* if connected, start the I/O stream */
@@ -672,7 +729,11 @@ static int gs_open(struct tty_struct *tt
exit_unlock_port:
spin_unlock_irq(&port->port_lock);
-out:
+ mutex_unlock(&ports[port_num].lock);
+ return status;
+
+fail_unlock:
+ port->open_close_failures++;
mutex_unlock(&ports[port_num].lock);
return status;
}
@@ -698,6 +759,11 @@ static void gs_close(struct tty_struct *
if (!port)
return;
+ if (port->open_close_failures > 0) {
+ port->open_close_failures--;
+ return;
+ }
+
spin_lock_irq(&port->port_lock);
if (port->port.count != 1) {
@@ -912,8 +978,10 @@ static int gs_get_icount(struct tty_stru
}
static const struct tty_operations gs_tty_ops = {
+ .install = gs_install,
.open = gs_open,
.close = gs_close,
+ .cleanup = gs_cleanup,
.write = gs_write,
.put_char = gs_put_char,
.flush_chars = gs_flush_chars,
@@ -1206,14 +1274,41 @@ static void gs_console_exit(struct gs_po
#endif
-static int
+static void gs_port_destruct(struct tty_port *tport)
+{
+ struct gs_port *port = container_of(tport, struct gs_port, port);
+ unsigned int port_num = port->port_num;
+
+ mutex_lock(&ports[port_num].lock);
+ if (WARN_ON(ports[port_num].port))
+ ports[port_num].port = NULL;
+ WARN_ON(!ports[port_num].reserved);
+ if (gs_tty_driver)
+ gs_tty_driver->ports[port_num] = NULL;
+ ports[port_num].reserved = false;
+ mutex_unlock(&ports[port_num].lock);
+
+ kfifo_free(&port->port_write_buf);
+ kfree(port);
+}
+
+static const struct tty_port_operations gs_port_ops = {
+ .destruct = gs_port_destruct,
+};
+
+static struct gs_port *
gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding)
{
struct gs_port *port;
int ret = 0;
mutex_lock(&ports[port_num].lock);
- if (ports[port_num].port) {
+ if (WARN_ON_ONCE(ports[port_num].port && !ports[port_num].reserved)) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if (ports[port_num].reserved) {
ret = -EBUSY;
goto out;
}
@@ -1225,6 +1320,7 @@ gs_port_alloc(unsigned port_num, struct
}
tty_port_init(&port->port);
+ port->port.ops = &gs_port_ops;
spin_lock_init(&port->port_lock);
init_waitqueue_head(&port->drain_wait);
init_waitqueue_head(&port->close_wait);
@@ -1238,10 +1334,14 @@ gs_port_alloc(unsigned port_num, struct
port->port_num = port_num;
port->port_line_coding = *coding;
+ ports[port_num].reserved = true;
ports[port_num].port = port;
+ mutex_unlock(&ports[port_num].lock);
+ return port;
+
out:
mutex_unlock(&ports[port_num].lock);
- return ret;
+ return ERR_PTR(ret);
}
static int gs_closed(struct gs_port *port)
@@ -1261,8 +1361,7 @@ static void gserial_free_port(struct gs_
/* wait for old opens to finish */
wait_event(port->close_wait, gs_closed(port));
WARN_ON(port->port_usb != NULL);
- tty_port_destroy(&port->port);
- kfree(port);
+ tty_port_put(&port->port);
}
void gserial_free_line(unsigned char port_num)
@@ -1279,15 +1378,15 @@ void gserial_free_line(unsigned char por
ports[port_num].port = NULL;
mutex_unlock(&ports[port_num].lock);
- gserial_free_port(port);
tty_unregister_device(gs_tty_driver, port_num);
+ gserial_free_port(port);
}
EXPORT_SYMBOL_GPL(gserial_free_line);
int gserial_alloc_line_no_console(unsigned char *line_num)
{
struct usb_cdc_line_coding coding;
- struct gs_port *port;
+ struct gs_port *port = ERR_PTR(-EBUSY);
struct device *tty_dev;
int ret;
int port_num;
@@ -1298,19 +1397,20 @@ int gserial_alloc_line_no_console(unsign
coding.bDataBits = USB_CDC_1_STOP_BITS;
for (port_num = 0; port_num < MAX_U_SERIAL_PORTS; port_num++) {
- ret = gs_port_alloc(port_num, &coding);
- if (ret == -EBUSY)
- continue;
- if (ret)
+ port = gs_port_alloc(port_num, &coding);
+ if (IS_ERR(port)) {
+ ret = PTR_ERR(port);
+ if (ret == -EBUSY)
+ continue;
return ret;
+ }
break;
}
- if (ret)
- return ret;
+ if (IS_ERR(port))
+ return PTR_ERR(port);
/* ... and sysfs class devices, so mdev/udev make /dev/ttyGS* */
- port = ports[port_num].port;
tty_dev = tty_port_register_device(&port->port,
gs_tty_driver, port_num, NULL);
if (IS_ERR(tty_dev)) {
@@ -1319,14 +1419,15 @@ int gserial_alloc_line_no_console(unsign
ret = PTR_ERR(tty_dev);
mutex_lock(&ports[port_num].lock);
+ WARN_ON(ports[port_num].port != port);
ports[port_num].port = NULL;
mutex_unlock(&ports[port_num].lock);
- gserial_free_port(port);
- goto err;
+ tty_port_put(&port->port);
+ return ret;
}
+
*line_num = port_num;
-err:
- return ret;
+ return 0;
}
EXPORT_SYMBOL_GPL(gserial_alloc_line_no_console);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0932/1005] usb: dwc3: trace: Restore request name assignment
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (930 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0931/1005] usb: gadget: u_serial: pin ports while TTYs are installed Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0933/1005] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
` (66 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit d8090de52e0a8f1761ced4fc31d52a3e289e341c upstream.
The commit 0a06917432a7 ("usb: dwc3: Log dwc3 address in traces")
removed the __assign_str(name) call from dwc3_log_request. The name
field still exists in the trace event, but nothing fills it in, so the
endpoint name printed for these events is leftover garbage from the ring
buffer.
Put the __assign_str() call back so the endpoint name is logged again.
Fixes: 0a06917432a7 ("usb: dwc3: Log dwc3 address in traces")
Cc: stable <stable@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/8bd045b136bfef8ce5de79f1fa2f09db639f0707.1792543567.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/trace.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/dwc3/trace.h b/drivers/usb/dwc3/trace.h
index 5253da23d8b0..0caaa0b396d1 100644
--- a/drivers/usb/dwc3/trace.h
+++ b/drivers/usb/dwc3/trace.h
@@ -141,6 +141,7 @@ DECLARE_EVENT_CLASS(dwc3_log_request,
),
TP_fast_assign(
__entry->base_address = req->dep->dwc->xhci_resources[0].start;
+ __assign_str(name);
__entry->req = req;
__entry->actual = req->request.actual;
__entry->length = req->request.length;
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0933/1005] usb: dwc3: gadget: Clear delayed stop on End Transfer completion
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (931 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0932/1005] usb: dwc3: trace: Restore request name assignment Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0934/1005] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
` (65 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit f2bd20f92a7dc68980a6098397503067192ce63a upstream.
When an End Transfer command times out outside of the SETUP phase, the
driver sets DWC3_EP_DELAY_STOP to retry it on the next SETUP phase. If
the command completes in the meantime, the flag is left set. Requests
queued to the endpoint are then deferred, and the retry may end a
transfer that is started later.
Clear DWC3_EP_DELAY_STOP when the End Transfer command completes.
Fixes: 4db0fbb60136 ("usb: dwc3: gadget: Don't delay End Transfer on delayed_status")
Cc: stable <stable@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/c28a9660f7b6bfa626077ddcfbadd50e6b503f86.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -3872,6 +3872,7 @@ static void dwc3_gadget_endpoint_command
if (dep->stream_capable)
dep->flags |= DWC3_EP_IGNORE_NEXT_NOSTREAM;
+ dep->flags &= ~DWC3_EP_DELAY_STOP;
dep->flags &= ~DWC3_EP_END_TRANSFER_PENDING;
dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
dwc3_gadget_ep_cleanup_cancelled_requests(dep);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0934/1005] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (932 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0933/1005] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0935/1005] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
` (64 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit e616d91e02881983e5dadf6980c4aa08123800b3 upstream.
The function driver may re-enable an endpoint before the End Transfer
command issued on ep disable completes. The no-op Start Transfer issued
on ep enable then fails with "No Resource".
Only stream endpoints need the no-op Start Transfer to initiate a
stream. Other bulk and interrupt endpoints start their transfer when a
request is queued. Skip it for those endpoints, and move it to a helper
to be reused.
Fixes: a97ea994605e ("usb: dwc3: gadget: offset Start Transfer latency for bulk EPs")
Cc: stable <stable@kernel.org>
Reported-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Closes: https://lore.kernel.org/linux-usb/20260227121236.963-1-selvarasu.g@samsung.com/
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/227e97e30d26a017c92d7008a8633c01f955d088.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 97 +++++++++++++++++++++++-----------------------
1 file changed, 50 insertions(+), 47 deletions(-)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -906,6 +906,54 @@ static int dwc3_gadget_resize_tx_fifos(s
return 0;
}
+static int dwc3_gadget_ep_start_noop_transfer(struct dwc3_ep *dep)
+{
+ struct dwc3_gadget_ep_cmd_params params;
+ struct dwc3 *dwc = dep->dwc;
+ struct dwc3_trb *trb;
+ dma_addr_t trb_dma;
+ u32 cmd;
+ int ret;
+
+ memset(¶ms, 0, sizeof(params));
+ trb = &dep->trb_pool[0];
+ trb_dma = dwc3_trb_dma_offset(dep, trb);
+
+ params.param0 = upper_32_bits(trb_dma);
+ params.param1 = lower_32_bits(trb_dma);
+
+ cmd = DWC3_DEPCMD_STARTTRANSFER;
+
+ ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * For streams, at start, there maybe a race where the host primes the
+ * endpoint before the function driver queues a request to initiate a
+ * stream. In that case, the controller will not see the prime to
+ * generate the ERDY and start stream. To workaround this, issue a
+ * no-op TRB as normal, but end it immediately. As a result, when the
+ * function driver queues the request, the next START_TRANSFER command
+ * will cause the controller to generate an ERDY to initiate the
+ * stream.
+ */
+ dwc3_stop_active_transfer(dep, false, true);
+
+ /*
+ * All stream eps will reinitiate stream on NoStream rejection.
+ *
+ * However, if the controller is capable of TXF_FLUSH_BYPASS, then IN
+ * direction endpoints will automatically restart the stream without
+ * the driver initiation.
+ */
+ if (!dep->direction ||
+ !(dwc->hwparams.hwparams9 & DWC3_GHWPARAMS9_DEV_TXF_FLUSH_BYPASS))
+ dep->flags |= DWC3_EP_FORCE_RESTART_STREAM;
+
+ return 0;
+}
+
/**
* __dwc3_gadget_ep_enable - initializes a hw endpoint
* @dep: endpoint to be initialized
@@ -971,55 +1019,10 @@ static int __dwc3_gadget_ep_enable(struc
* Issue StartTransfer here with no-op TRB so we can always rely on No
* Response Update Transfer command.
*/
- if (usb_endpoint_xfer_bulk(desc) ||
- usb_endpoint_xfer_int(desc)) {
- struct dwc3_gadget_ep_cmd_params params;
- struct dwc3_trb *trb;
- dma_addr_t trb_dma;
- u32 cmd;
-
- memset(¶ms, 0, sizeof(params));
- trb = &dep->trb_pool[0];
- trb_dma = dwc3_trb_dma_offset(dep, trb);
-
- params.param0 = upper_32_bits(trb_dma);
- params.param1 = lower_32_bits(trb_dma);
-
- cmd = DWC3_DEPCMD_STARTTRANSFER;
-
- ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms);
+ if (dep->stream_capable) {
+ ret = dwc3_gadget_ep_start_noop_transfer(dep);
if (ret < 0)
return ret;
-
- if (dep->stream_capable) {
- /*
- * For streams, at start, there maybe a race where the
- * host primes the endpoint before the function driver
- * queues a request to initiate a stream. In that case,
- * the controller will not see the prime to generate the
- * ERDY and start stream. To workaround this, issue a
- * no-op TRB as normal, but end it immediately. As a
- * result, when the function driver queues the request,
- * the next START_TRANSFER command will cause the
- * controller to generate an ERDY to initiate the
- * stream.
- */
- dwc3_stop_active_transfer(dep, false, true);
-
- /*
- * All stream eps will reinitiate stream on NoStream
- * rejection.
- *
- * However, if the controller is capable of
- * TXF_FLUSH_BYPASS, then IN direction endpoints will
- * automatically restart the stream without the driver
- * initiation.
- */
- if (!dep->direction ||
- !(dwc->hwparams.hwparams9 &
- DWC3_GHWPARAMS9_DEV_TXF_FLUSH_BYPASS))
- dep->flags |= DWC3_EP_FORCE_RESTART_STREAM;
- }
}
out:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0935/1005] usb: dwc3: gadget: Recover from End Transfer timeout
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (933 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0934/1005] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0936/1005] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
` (63 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Thinh Nguyen, stable
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 61575534fb05d52d36979f38976ece74649f091a upstream.
If the End Transfer command times out, the endpoint resource is never
released and every subsequent Start Transfer to the endpoint fails with
"No Resource". Schedule an error recovery to reset the controller.
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: stable <stable@kernel.org>
Link: https://patch.msgid.link/7523e9a11303a33acd0b92a092fb0e8218d509d2.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1754,6 +1754,8 @@ static int __dwc3_gadget_get_frame(struc
return DWC3_DSTS_SOFFN(reg);
}
+static void dwc3_schedule_err_recovery(struct dwc3 *dwc);
+
/**
* __dwc3_stop_active_transfer - stop the current active transfer
* @dep: isoc endpoint
@@ -1797,6 +1799,9 @@ static int __dwc3_stop_active_transfer(s
dev_err_ratelimited(dep->dwc->dev,
"end transfer failed: %d\n", ret);
+ if (ret == -ETIMEDOUT && dep->dwc->err_state == DWC3_ERR_NONE)
+ dwc3_schedule_err_recovery(dep->dwc);
+
dep->resource_index = 0;
if (!interrupt)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0936/1005] usb: dwc3: gadget: Reject requests to a disabled endpoint
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (934 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0935/1005] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0937/1005] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
` (62 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 5eb11b1647b0534b3a61a21473d77ebf4ffbed7c upstream.
__dwc3_gadget_ep_disable() releases the lock while giving back requests,
and DWC3_EP_ENABLED is only cleared afterward. A function driver can
queue a new request in this window, and the driver would start a
transfer on an endpoint that is already disabled in hardware.
Clear DWC3_EP_ENABLED before giving back the requests, and reject
requests queued to an endpoint that is not enabled.
Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/4ceab6aa5d6af0e4780f9d3a964fd5d8168a0a02.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1087,6 +1087,8 @@ static int __dwc3_gadget_ep_disable(stru
reg &= ~DWC3_DALEPENA_EP(dep->number);
dwc3_writel(dwc, DWC3_DALEPENA, reg);
+ dep->flags &= ~DWC3_EP_ENABLED;
+
dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
dep->stream_capable = false;
@@ -1998,7 +2000,8 @@ static int __dwc3_gadget_ep_queue(struct
{
struct dwc3 *dwc = dep->dwc;
- if (!dep->endpoint.desc || !dwc->pullups_connected || !dwc->connected) {
+ if (!(dep->flags & DWC3_EP_ENABLED) || !dep->endpoint.desc ||
+ !dwc->pullups_connected || !dwc->connected) {
dev_dbg(dwc->dev, "%s: can't queue to disabled endpoint\n",
dep->name);
return -ESHUTDOWN;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0937/1005] usb: dwc3: gadget: Reset endpoint flags on controller start
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (935 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0936/1005] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0938/1005] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
` (61 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 7c9bc134e5b3315e0456cda9e8e59c752309ea78 upstream.
The flags of a disabled endpoint may be preserved while its End
Transfer command is pending. If the command never completes, the stale
flags persist across a soft disconnect or an error recovery, and the
endpoint can't be used again.
Reset the flags of all non-control endpoints when starting the
controller.
Fixes: 76bff31c7fba ("usb: dwc3: gadget: Do not clear ep delayed stop flag during ep disable")
Cc: stable <stable@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/21cd189962b9d32a4f9df381df4947d35341d5a9.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2958,6 +2958,7 @@ static int __dwc3_gadget_start(struct dw
{
struct dwc3_ep *dep;
int ret = 0;
+ u32 epnum;
u32 reg;
/*
@@ -3015,6 +3016,15 @@ static int __dwc3_gadget_start(struct dw
return ret;
}
+ for (epnum = 2; epnum < dwc->num_eps; epnum++) {
+ dep = dwc->eps[epnum];
+ if (!dep)
+ continue;
+
+ dep->flags &= (DWC3_EP_TXFIFO_RESIZED |
+ DWC3_EP_RESOURCE_ALLOCATED);
+ }
+
dep = dwc->eps[0];
dep->flags = 0;
ret = __dwc3_gadget_ep_enable(dep, DWC3_DEPCFG_ACTION_INIT);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0938/1005] usb: dwc3: gadget: Track a timed out End Transfer
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (936 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0937/1005] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0939/1005] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
` (60 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit af91c6322e633504aa45de278f5d520f39d127be upstream.
If an End Transfer command with CMDIOC times out, the driver clears the
resource index but keeps DWC3_EP_TRANSFER_STARTED without setting
DWC3_EP_END_TRANSFER_PENDING. The command is still outstanding, but a
later stop issues another End Transfer with resource index 0, and the
next Start Transfer fails with "No Resource".
Mark the timed out End Transfer as pending so that no other command is
issued to the endpoint until it completes. For any other failure, there
is no outstanding command, so clear DWC3_EP_TRANSFER_STARTED.
Fixes: e192cc7b5239 ("usb: dwc3: gadget: move cmd_endtransfer to extra function")
Cc: stable <stable@kernel.org>
Reported-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Closes: https://lore.kernel.org/linux-usb/3fdda532-8181-48e9-b58d-cad7289408e7@samsung.com/
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/5815c41a7e7923edb114741f29697cf0161f523c.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/gadget.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1806,9 +1806,9 @@ static int __dwc3_stop_active_transfer(s
dep->resource_index = 0;
- if (!interrupt)
+ if (!interrupt || (ret && ret != -ETIMEDOUT))
dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
- else if (!ret)
+ else
dep->flags |= DWC3_EP_END_TRANSFER_PENDING;
dep->flags &= ~DWC3_EP_DELAY_STOP;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0939/1005] usb: dwc3: gadget: Wait for End Transfer completion on ep disable
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (937 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0938/1005] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0940/1005] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
` (59 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
commit 1338410c21a5710b7ba88057034d35367ba0f054 upstream.
The End Transfer command on ep disable is issued without interrupt, and
the endpoint flags are cleared right after a fixed delay. The command
may not have completed by then. If the function driver re-enables the
endpoint and queues a request, the next Start Transfer fails with "No
Resource".
Issue the End Transfer command with interrupt on ep disable, and keep
DWC3_EP_END_TRANSFER_PENDING and DWC3_EP_TRANSFER_STARTED until the
command completes. Defer the no-op Start Transfer of a stream endpoint
re-enabled in the meantime to the command completion.
Fixes: c5353b225df9 ("usb: dwc3: gadget: don't enable interrupt when disabling endpoint")
Cc: stable <stable@kernel.org>
Reported-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Closes: https://lore.kernel.org/linux-usb/20260227121236.963-1-selvarasu.g@samsung.com/
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/24fa8adeb0222dab415c8c2799405188440bad4b.1792542945.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/core.h | 4 +++-
drivers/usb/dwc3/ep0.c | 2 +-
drivers/usb/dwc3/gadget.c | 42 +++++++++++++++++++++++++++++++++++-------
3 files changed, 39 insertions(+), 9 deletions(-)
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -771,6 +771,7 @@ struct dwc3_ep {
#define DWC3_EP_TXFIFO_RESIZED BIT(12)
#define DWC3_EP_DELAY_STOP BIT(13)
#define DWC3_EP_RESOURCE_ALLOCATED BIT(14)
+#define DWC3_EP_PENDING_NOOP_START BIT(15)
/* This last one is specific to EP0 */
#define DWC3_EP0_DIR_IN BIT(31)
@@ -1695,7 +1696,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_
int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned int cmd,
u32 param);
void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc);
-void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status);
+void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status,
+ bool interrupt);
#else
static inline int dwc3_gadget_init(struct dwc3 *dwc)
{ return 0; }
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -315,7 +315,7 @@ void dwc3_ep0_out_start(struct dwc3 *dwc
if (dwc->connected)
dwc3_stop_active_transfer(dwc3_ep, false, true);
else
- dwc3_remove_requests(dwc, dwc3_ep, -ESHUTDOWN);
+ dwc3_remove_requests(dwc, dwc3_ep, -ESHUTDOWN, false);
}
}
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1020,9 +1020,14 @@ static int __dwc3_gadget_ep_enable(struc
* Response Update Transfer command.
*/
if (dep->stream_capable) {
- ret = dwc3_gadget_ep_start_noop_transfer(dep);
- if (ret < 0)
- return ret;
+ if (dep->flags & (DWC3_EP_END_TRANSFER_PENDING |
+ DWC3_EP_DELAY_STOP)) {
+ dep->flags |= DWC3_EP_PENDING_NOOP_START;
+ } else {
+ ret = dwc3_gadget_ep_start_noop_transfer(dep);
+ if (ret < 0)
+ return ret;
+ }
}
out:
@@ -1031,16 +1036,21 @@ out:
return 0;
}
-void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status)
+void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status,
+ bool interrupt)
{
struct dwc3_request *req;
- dwc3_stop_active_transfer(dep, false, false);
+ dwc3_stop_active_transfer(dep, false, interrupt);
/* If endxfer is delayed, avoid unmapping requests */
if (dep->flags & DWC3_EP_DELAY_STOP)
return;
+ /* Give the controller time to stop accessing the request buffers */
+ if (dep->flags & DWC3_EP_END_TRANSFER_PENDING)
+ mdelay(1);
+
/* - giveback all requests to gadget driver */
while (!list_empty(&dep->started_list)) {
req = next_request(&dep->started_list);
@@ -1089,7 +1099,7 @@ static int __dwc3_gadget_ep_disable(stru
dep->flags &= ~DWC3_EP_ENABLED;
- dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
+ dwc3_remove_requests(dwc, dep, -ESHUTDOWN, true);
dep->stream_capable = false;
dep->type = 0;
@@ -1101,6 +1111,15 @@ static int __dwc3_gadget_ep_disable(stru
*/
if (dep->flags & DWC3_EP_DELAY_STOP)
mask |= (DWC3_EP_DELAY_STOP | DWC3_EP_TRANSFER_STARTED);
+
+ /*
+ * The End Transfer command is still in progress. Do not clear the
+ * flags, so that the ep is only rearmed once the command completes.
+ */
+ if (dep->flags & DWC3_EP_END_TRANSFER_PENDING)
+ mask |= (DWC3_EP_END_TRANSFER_PENDING |
+ DWC3_EP_TRANSFER_STARTED);
+
dep->flags &= mask;
/* Clear out the ep descriptors for non-ep0 */
@@ -2558,7 +2577,7 @@ static void dwc3_stop_active_transfers(s
if (!dep)
continue;
- dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
+ dwc3_remove_requests(dwc, dep, -ESHUTDOWN, false);
}
}
@@ -3916,7 +3935,16 @@ static void dwc3_gadget_endpoint_command
dwc3_ep0_send_delayed_status(dwc);
}
+ if (dep->flags & DWC3_EP_PENDING_NOOP_START) {
+ dep->flags &= ~DWC3_EP_PENDING_NOOP_START;
+
+ if (!(dep->flags & DWC3_EP_DELAY_START) &&
+ (dep->flags & DWC3_EP_ENABLED))
+ dwc3_gadget_ep_start_noop_transfer(dep);
+ }
+
if ((dep->flags & DWC3_EP_DELAY_START) &&
+ (dep->flags & DWC3_EP_ENABLED) &&
!usb_endpoint_xfer_isoc(dep->endpoint.desc))
__dwc3_gadget_kick_transfer(dep);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0940/1005] usb: dwc3: xilinx: fix system suspend and resume PHY handling
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (938 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0939/1005] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0941/1005] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Greg Kroah-Hartman
` (58 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Radhey Shyam Pandey,
Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
commit 2fad8d241a6833d0c7aeafa0ab596e83c7b4ec9c upstream.
System suspend and resume error paths do not handle PHY and clock
resources correctly. Suspend calls phy_exit() without first powering
off the PHY and ignores failures, while resume can leave clocks
enabled if PHY reinitialization fails.
Propagate errors to the PM core and unwind resources to ensure a
consistent state on suspend and resume failures.
Fixes: d6edcdc1ef06 ("usb: dwc3: xilinx: fix usb3 non-wakeup source resume failure")
Cc: stable <stable@kernel.org>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260928120015.3152461-2-radhey.shyam.pandey@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/dwc3-xilinx.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -383,13 +383,26 @@ static int __maybe_unused dwc3_xlnx_runt
static int __maybe_unused dwc3_xlnx_suspend(struct device *dev)
{
struct dwc3_xlnx *priv_data = dev_get_drvdata(dev);
+ int ret;
+
+ ret = phy_power_off(priv_data->usb3_phy);
+ if (ret < 0)
+ return ret;
- phy_exit(priv_data->usb3_phy);
+ ret = phy_exit(priv_data->usb3_phy);
+ if (ret < 0)
+ goto err_phy_power_on;
/* Disable the clocks */
clk_bulk_disable(priv_data->num_clocks, priv_data->clks);
return 0;
+
+err_phy_power_on:
+ if (phy_power_on(priv_data->usb3_phy))
+ dev_err(dev, "failed to restore PHY power after suspend error\n");
+
+ return ret;
}
static int __maybe_unused dwc3_xlnx_resume(struct device *dev)
@@ -403,15 +416,20 @@ static int __maybe_unused dwc3_xlnx_resu
ret = phy_init(priv_data->usb3_phy);
if (ret < 0)
- return ret;
+ goto err_clk_disable;
ret = phy_power_on(priv_data->usb3_phy);
if (ret < 0) {
phy_exit(priv_data->usb3_phy);
- return ret;
+ goto err_clk_disable;
}
return 0;
+
+err_clk_disable:
+ clk_bulk_disable(priv_data->num_clocks, priv_data->clks);
+
+ return ret;
}
static const struct dev_pm_ops dwc3_xlnx_dev_pm_ops = {
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0941/1005] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (939 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0940/1005] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0942/1005] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Greg Kroah-Hartman
` (57 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Radhey Shyam Pandey,
Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
commit f33f0dd2eb014bffda02ecfd182de3ddab058596 upstream.
If reset deassert or PHY setup fails partway through
dwc3_xlnx_init_zynqmp(), re-assert the resets that were already
released before unwinding the PHY.
Only undo the reset cycle the function actually performed. The cycle is
skipped when no usb3-phy is present, because asserting the core resets
can break a USB3 configuration that is live but missing from the device
tree, so the error path skips it for the same reason. Asserting an
already asserted reset is harmless, so one block covers however far the
deasserts progressed.
Save the ZynqMP reset handles in driver private data so later probe
teardown can re-assert released resets.
Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms")
Cc: stable <stable@kernel.org>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260928120015.3152461-3-radhey.shyam.pandey@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/dwc3-xilinx.c | 55 ++++++++++++++++++++++++++---------------
1 file changed, 36 insertions(+), 19 deletions(-)
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -48,6 +48,9 @@ struct dwc3_xlnx {
void __iomem *regs;
int (*pltfm_init)(struct dwc3_xlnx *data);
struct phy *usb3_phy;
+ struct reset_control *usb_crst;
+ struct reset_control *usb_hibrst;
+ struct reset_control *usb_apbrst;
};
static void dwc3_xlnx_mask_phy_rst(struct dwc3_xlnx *priv_data, bool mask)
@@ -112,7 +115,6 @@ static int dwc3_xlnx_init_versal(struct
static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
{
struct device *dev = priv_data->dev;
- struct reset_control *crst, *hibrst, *apbrst;
struct gpio_desc *reset_gpio;
int ret = 0;
@@ -124,25 +126,25 @@ static int dwc3_xlnx_init_zynqmp(struct
goto err;
}
- crst = devm_reset_control_get_exclusive(dev, "usb_crst");
- if (IS_ERR(crst)) {
- ret = PTR_ERR(crst);
+ priv_data->usb_crst = devm_reset_control_get_exclusive(dev, "usb_crst");
+ if (IS_ERR(priv_data->usb_crst)) {
+ ret = PTR_ERR(priv_data->usb_crst);
dev_err_probe(dev, ret,
"failed to get core reset signal\n");
goto err;
}
- hibrst = devm_reset_control_get_exclusive(dev, "usb_hibrst");
- if (IS_ERR(hibrst)) {
- ret = PTR_ERR(hibrst);
+ priv_data->usb_hibrst = devm_reset_control_get_exclusive(dev, "usb_hibrst");
+ if (IS_ERR(priv_data->usb_hibrst)) {
+ ret = PTR_ERR(priv_data->usb_hibrst);
dev_err_probe(dev, ret,
"failed to get hibernation reset signal\n");
goto err;
}
- apbrst = devm_reset_control_get_exclusive(dev, "usb_apbrst");
- if (IS_ERR(apbrst)) {
- ret = PTR_ERR(apbrst);
+ priv_data->usb_apbrst = devm_reset_control_get_exclusive(dev, "usb_apbrst");
+ if (IS_ERR(priv_data->usb_apbrst)) {
+ ret = PTR_ERR(priv_data->usb_apbrst);
dev_err_probe(dev, ret,
"failed to get APB reset signal\n");
goto err;
@@ -156,19 +158,19 @@ static int dwc3_xlnx_init_zynqmp(struct
* absent.
*/
if (priv_data->usb3_phy) {
- ret = reset_control_assert(crst);
+ ret = reset_control_assert(priv_data->usb_crst);
if (ret < 0) {
dev_err(dev, "Failed to assert core reset\n");
goto err;
}
- ret = reset_control_assert(hibrst);
+ ret = reset_control_assert(priv_data->usb_hibrst);
if (ret < 0) {
dev_err(dev, "Failed to assert hibernation reset\n");
goto err;
}
- ret = reset_control_assert(apbrst);
+ ret = reset_control_assert(priv_data->usb_apbrst);
if (ret < 0) {
dev_err(dev, "Failed to assert APB reset\n");
goto err;
@@ -179,7 +181,7 @@ static int dwc3_xlnx_init_zynqmp(struct
if (ret < 0)
goto err;
- ret = reset_control_deassert(apbrst);
+ ret = reset_control_deassert(priv_data->usb_apbrst);
if (ret < 0) {
dev_err(dev, "Failed to release APB reset\n");
goto err_phy_exit;
@@ -195,21 +197,21 @@ static int dwc3_xlnx_init_zynqmp(struct
writel(PIPE_CLK_DESELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
}
- ret = reset_control_deassert(crst);
+ ret = reset_control_deassert(priv_data->usb_crst);
if (ret < 0) {
dev_err(dev, "Failed to release core reset\n");
- goto err_phy_exit;
+ goto err_reset_assert;
}
- ret = reset_control_deassert(hibrst);
+ ret = reset_control_deassert(priv_data->usb_hibrst);
if (ret < 0) {
dev_err(dev, "Failed to release hibernation reset\n");
- goto err_phy_exit;
+ goto err_reset_assert;
}
ret = phy_power_on(priv_data->usb3_phy);
if (ret < 0)
- goto err_phy_exit;
+ goto err_reset_assert;
/* ulpi reset via gpio-modepin or gpio-framework driver */
reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
@@ -230,6 +232,21 @@ static int dwc3_xlnx_init_zynqmp(struct
err_phy_power_off:
phy_power_off(priv_data->usb3_phy);
+err_reset_assert:
+ /*
+ * Undo only the reset cycle performed above. That cycle is skipped
+ * when there is no usb3-phy. The deasserts stay unconditional so a
+ * core the bootloader left in reset still comes up, but they are
+ * deliberately not paired with an assert here: resetting a USB3
+ * configuration that is live but missing from the device tree could
+ * break it. Asserting an already asserted reset is harmless, so one
+ * block covers however far the cycle's deasserts got.
+ */
+ if (priv_data->usb3_phy) {
+ reset_control_assert(priv_data->usb_hibrst);
+ reset_control_assert(priv_data->usb_crst);
+ reset_control_assert(priv_data->usb_apbrst);
+ }
err_phy_exit:
phy_exit(priv_data->usb3_phy);
err:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0942/1005] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (940 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 7.3 0941/1005] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0943/1005] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
` (56 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Philipp Zabel,
Radhey Shyam Pandey, Thinh Nguyen
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
commit 6c6508e742b47539224eb18cb23f7ed5d401dcb6 upstream.
dwc3_xlnx_init_zynqmp() leaves the controller out of reset with the PHY
powered on, but nothing undoes that if probe fails later or when the
driver is removed. The resets stay deasserted and the PHY stays on with
no driver bound.
Register the teardown with devm_add_action_or_reset() once init has
completed, so it runs on probe failure without the driver having to
track how far init progressed. The teardown only undoes the reset cycle
init performed, so it carries the same usb3-phy guard: with no PHY the
resets were never asserted, and asserting them could break a USB3
configuration that is live but missing from the device tree.
The resets have to be asserted while the clocks are still running, so
both the probe error path and remove() run the teardown explicitly
before gating the clocks rather than leaving it to devres, which would
otherwise run it afterwards. devm_release_action() unlinks the action
before calling it, so devres cannot run it a second time.
Running it from remove() also covers .shutdown, which shares
dwc3_xlnx_remove(): device_shutdown() does not call
devres_release_all(), so a teardown left to devres would never run
there.
Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms")
Cc: stable <stable@kernel.org>
Suggested-by: Philipp Zabel <p.zabel@pengutronix.de>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260928120015.3152461-4-radhey.shyam.pandey@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc3/dwc3-xilinx.c | 44 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -112,6 +112,39 @@ static int dwc3_xlnx_init_versal(struct
return 0;
}
+static void dwc3_xlnx_zynqmp_teardown(void *data)
+{
+ struct dwc3_xlnx *priv_data = data;
+
+ phy_power_off(priv_data->usb3_phy);
+
+ /*
+ * Undo only the reset cycle init performed. As on the init error
+ * path, the unconditional deasserts are not paired with an assert
+ * here: with no usb3-phy, resetting the core could break a USB3
+ * configuration that is live but missing from the device tree.
+ */
+ if (priv_data->usb3_phy) {
+ reset_control_assert(priv_data->usb_hibrst);
+ reset_control_assert(priv_data->usb_crst);
+ reset_control_assert(priv_data->usb_apbrst);
+ }
+
+ phy_exit(priv_data->usb3_phy);
+}
+
+/*
+ * Run the platform teardown explicitly, so the resets are asserted while the
+ * clocks are still running. devm_release_action() unlinks the action before
+ * calling it, so devres will not run it a second time.
+ */
+static void dwc3_xlnx_release_teardown(struct device *dev,
+ struct dwc3_xlnx *priv_data)
+{
+ if (devm_is_action_added(dev, dwc3_xlnx_zynqmp_teardown, priv_data))
+ devm_release_action(dev, dwc3_xlnx_zynqmp_teardown, priv_data);
+}
+
static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
{
struct device *dev = priv_data->dev;
@@ -228,7 +261,8 @@ static int dwc3_xlnx_init_zynqmp(struct
dwc3_xlnx_set_coherency(priv_data, XLNX_USB_TRAFFIC_ROUTE_CONFIG);
- return 0;
+ return devm_add_action_or_reset(dev, dwc3_xlnx_zynqmp_teardown,
+ priv_data);
err_phy_power_off:
phy_power_off(priv_data->usb3_phy);
@@ -355,6 +389,7 @@ err_pm_set_suspended:
pm_runtime_set_suspended(dev);
err_clk_put:
+ dwc3_xlnx_release_teardown(dev, priv_data);
clk_bulk_disable_unprepare(priv_data->num_clocks, priv_data->clks);
return ret;
@@ -367,6 +402,13 @@ static void dwc3_xlnx_remove(struct plat
of_platform_depopulate(dev);
+ /*
+ * This is also what makes .shutdown behave the same as .remove:
+ * device_shutdown() does not call devres_release_all(), so a teardown
+ * left to devres would never run on the shutdown path.
+ */
+ dwc3_xlnx_release_teardown(dev, priv_data);
+
clk_bulk_disable_unprepare(priv_data->num_clocks, priv_data->clks);
priv_data->num_clocks = 0;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0943/1005] w1: dont hold list_mutex while a slave is torn down
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (941 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0942/1005] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0944/1005] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
` (55 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 7ef382cb0ae0b2d6df4fbc5c822cd80394308839 upstream.
When the last reference to a slave is dropped, w1_unref_slave() holds
list_mutex of the master until the slave has been freed. In between it
calls the ->remove_slave() callback of the family driver and
device_unregister(). Both wait for others: for the sysfs callbacks
which are running, and in the case of w1_therm also for the file
therm_bulk_read of the master and for everybody who is talking to the
sensor. None of those can therefore take list_mutex, although the
callbacks of therm_bulk_read walk the list which it protects.
The mutex is only needed to make the decrement of the reference count and
the removal from the list one step for w1_search_slave() and
w1_slave_search_device(), which look the slave up in the list and, in the
first case, take a reference. Once the slave is off the list, nobody can
find it any more. Drop the mutex at that point.
The callers which hold the mutex of the master, which serialises
attaching and detaching, are not affected. The one which does not is
w1_process_cb(), when it drops the last reference to a slave which has
been detached while a netlink command for it was queued. Somebody who
attaches a slave with the same ID through sysfs or netlink at that very
moment used to wait until the old device was gone. Now the registration
of the new device may fail because the name is still in use.
This is a preparation for "w1: w1_therm: lock the list of slaves for the
bulk read".
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-7-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -781,16 +781,24 @@ int w1_unref_slave(struct w1_slave *sl)
{
struct w1_master *dev = sl->master;
int refcnt;
+
+ /*
+ * Once it is off the list nobody can find the slave and take a new
+ * reference. The lock must not be held any longer than that: the rest
+ * waits for sysfs callbacks and for users of the family data.
+ */
mutex_lock(&dev->list_mutex);
refcnt = atomic_sub_return(1, &sl->refcnt);
+ if (refcnt == 0)
+ list_del(&sl->w1_slave_entry);
+ mutex_unlock(&dev->list_mutex);
+
if (refcnt == 0) {
struct w1_netlink_msg msg;
dev_dbg(&sl->dev, "%s: detaching %s [%p].\n", __func__,
sl->name, sl);
- list_del(&sl->w1_slave_entry);
-
memset(&msg, 0, sizeof(msg));
memcpy(msg.id.id, &sl->reg_num, sizeof(msg.id));
msg.type = W1_SLAVE_REMOVE;
@@ -804,7 +812,6 @@ int w1_unref_slave(struct w1_slave *sl)
kfree(sl);
}
atomic_dec(&dev->refcnt);
- mutex_unlock(&dev->list_mutex);
return refcnt;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0944/1005] w1: ds2482: set the strong pull-up with its byte
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (942 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0943/1005] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0945/1005] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
` (54 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit e4f673632fa8292a2922bcfbb39519b08016b382 upstream.
The eight channels of a DS2482-800 are eight independent 1-wire masters
for the w1 core, but share one I2C device. Each bus operation consists of
several I2C transfers: select the channel, send the command, poll the
status, set the read pointer, read the result. access_lock keeps the
operations of the channels apart.
ds2482_w1_set_pullup() polls the status, writes the configuration and
polls again without the lock. Polling sets the read pointer of the device
to the status register. In the middle of a read on another channel, after
that one has set the pointer to the data register, this makes the read
return the status instead of the data. The cached copy of the pointer in
pdev->read_prt can go wrong as well.
The lock alone is not enough. The strong pull-up is a setting of the
whole chip which is used up by the next byte. If an operation of another
channel gets in before the byte it was meant for, that channel gets the
pull-up, and the sensor converts without power.
So only note the request in ds2482_w1_set_pullup(), and write the
configuration in ds2482_w1_write_byte(), under the lock and after the
channel has been selected. The w1 core calls the former right before the
latter, under the bus mutex of the channel.
Fixes: 9c95bb6f25ff ("w1: ds2482: Added 1-Wire pull-up support to the driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-3-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/masters/ds2482.c | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -103,6 +103,7 @@ struct ds2482_data;
struct ds2482_w1_chan {
struct ds2482_data *pdev;
u8 channel;
+ bool spu; /* strong pullup after the next byte */
struct w1_bus_master w1_bm;
};
@@ -336,6 +337,19 @@ static void ds2482_w1_write_byte(void *d
if (pdev->w1_count > 1)
ds2482_set_channel(pdev, pchan->channel);
+ if (pchan->spu) {
+ pchan->spu = false;
+ /* the wait above and this one are crucial, otherwise devices
+ * might not be powered long enough, causing e.g. a w1_therm
+ * sensor to provide wrong conversion results
+ */
+ /* note: it seems like both SPU and APU have to be set! */
+ ds2482_send_cmd_data(pdev, DS2482_CMD_WRITE_CONFIG,
+ ds2482_calculate_config(DS2482_REG_CFG_SPU |
+ DS2482_REG_CFG_APU));
+ ds2482_wait_1wire_idle(pdev);
+ }
+
/* Send the write byte command */
ds2482_send_cmd_data(pdev, DS2482_CMD_1WIRE_WRITE_BYTE, byte);
@@ -420,27 +434,19 @@ static u8 ds2482_w1_reset_bus(void *data
static u8 ds2482_w1_set_pullup(void *data, int delay)
{
struct ds2482_w1_chan *pchan = data;
- struct ds2482_data *pdev = pchan->pdev;
- u8 retval = 1;
/* if delay is non-zero activate the pullup,
* the strong pullup will be automatically deactivated
* by the master, so do not explicitly deactive it
+ *
+ * The setting is used up by the next byte on any channel of the chip:
+ * ds2482_w1_write_byte() makes it, in one go with the byte.
*/
- if (delay) {
- /* both waits are crucial, otherwise devices might not be
- * powered long enough, causing e.g. a w1_therm sensor to
- * provide wrong conversion results
- */
- ds2482_wait_1wire_idle(pdev);
- /* note: it seems like both SPU and APU have to be set! */
- retval = ds2482_send_cmd_data(pdev, DS2482_CMD_WRITE_CONFIG,
- ds2482_calculate_config(DS2482_REG_CFG_SPU |
- DS2482_REG_CFG_APU));
- ds2482_wait_1wire_idle(pdev);
- }
+ if (!delay)
+ return 1;
- return retval;
+ pchan->spu = true;
+ return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0945/1005] w1: ds2805: use the bus mutex to talk on the bus
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (943 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0944/1005] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0946/1005] w1: ds28e04: " Greg Kroah-Hartman
` (53 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit a2e52ccce044e13d2695bb1bbdc07942727f28dd upstream.
Since commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.")
the slave drivers serialise their accesses to the bus with bus_mutex.
This driver takes the mutex of the master in the callbacks of its eeprom
file instead.
That mutex is held while a slave which has disappeared from the bus is
removed, which waits for the sysfs callbacks of the slave to return. A
callback which is waiting for the mutex at that moment never does: both
tasks are stuck, and with them the thread of the bus master.
Besides, it does not keep the other slave drivers off the bus, so that two
transactions can get mixed up on the wire.
Fixes: f6887531c0c6 ("drivers: w1: Add 1w slave driver for DS28E05 EEPROM")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-5-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/slaves/w1_ds2805.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/w1/slaves/w1_ds2805.c
+++ b/drivers/w1/slaves/w1_ds2805.c
@@ -102,7 +102,7 @@ static ssize_t w1_f0d_read_bin(struct fi
if (count == 0)
return 0;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* read directly from the EEPROM in chunks of W1_F0D_READ_MAXLEN */
while (todo > 0) {
@@ -123,7 +123,7 @@ static ssize_t w1_f0d_read_bin(struct fi
off += W1_F0D_READ_MAXLEN;
}
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -211,7 +211,7 @@ static ssize_t w1_f0d_write_bin(struct f
if (count == 0)
return 0;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* Can only write data in blocks of the size of the scratchpad */
addr = off;
@@ -256,7 +256,7 @@ static ssize_t w1_f0d_write_bin(struct f
}
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0946/1005] w1: ds28e04: use the bus mutex to talk on the bus
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (944 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0945/1005] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0947/1005] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
` (52 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 5bc51235d0ad4a4991e38f4e9dc3440738296850 upstream.
Since commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.")
the slave drivers serialise their accesses to the bus with bus_mutex.
This driver, which was merged shortly afterwards, takes the mutex of the
master in the callbacks of its eeprom and pio files instead.
That mutex is held while a slave which has disappeared from the bus is
removed, which waits for the sysfs callbacks of the slave to return. A
callback which is waiting for the mutex at that moment never does: both
tasks are stuck, and with them the thread of the bus master.
Besides, it does not keep the other slave drivers off the bus, so that two
transactions can get mixed up on the wire.
Fixes: fbf7f7b4e2ae ("w1: Add 1-wire slave device driver for DS28E04-100")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-4-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/slaves/w1_ds28e04.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
--- a/drivers/w1/slaves/w1_ds28e04.c
+++ b/drivers/w1/slaves/w1_ds28e04.c
@@ -123,7 +123,7 @@ static ssize_t eeprom_read(struct file *
if (count == 0)
return 0;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
if (w1_enable_crccheck) {
min_page = (off >> W1_PAGE_BITS);
@@ -140,7 +140,7 @@ static ssize_t eeprom_read(struct file *
}
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -253,7 +253,7 @@ static ssize_t eeprom_write(struct file
}
}
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* Can only write data to one page at a time */
idx = 0;
@@ -271,7 +271,7 @@ static ssize_t eeprom_write(struct file
}
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -290,9 +290,9 @@ static ssize_t pio_read(struct file *fil
if (off != 0 || count != 1 || buf == NULL)
return -EINVAL;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
ret = w1_f1C_read(sl, W1_1C_REG_LOGIC_STATE, count, buf);
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return ret;
}
@@ -310,11 +310,11 @@ static ssize_t pio_write(struct file *fi
if (off != 0 || count != 1 || buf == NULL)
return -EINVAL;
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
/* Write the PIO data */
if (w1_reset_select_slave(sl)) {
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return -1;
}
@@ -328,7 +328,7 @@ static ssize_t pio_write(struct file *fi
w1_read_block(sl->master, &ack, sizeof(ack));
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
/* check for acknowledgement */
if (ack != 0xAA)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0947/1005] w1: netlink: drop the slave after the bus is unlocked
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (945 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0946/1005] w1: ds28e04: " Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0948/1005] w1: remove the masters files before taking its locks Greg Kroah-Hartman
` (51 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 847fa880a3e1b2fdbbf72d89e830566108457637 upstream.
w1_process_cb() executes the commands of a netlink message with bus_mutex
held, and drops the reference to the slave which the message was
addressed to before it unlocks the mutex. If the slave has been detached
in the meantime, this is the last reference, and w1_unref_slave() tears
the slave down on the spot. That waits
- in device_unregister(), for the sysfs callbacks of the slave which are
running, and
- in w1_therm_remove_slave(), for the readers which have taken a
reference to the family data,
and both kinds take bus_mutex to talk to the slave. Whoever is waiting
for the mutex at that moment is never going to finish, and neither is the
thread of the bus master.
Unlock the bus first. The reference keeps the slave, and with it the
master, alive until then.
Fixes: d3a8a9dbb903 ("w1: hold bus_mutex in netlink and search")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-6-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1_netlink.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -478,15 +478,17 @@ static void w1_process_cb(struct w1_mast
if (!cmd || err)
w1_netlink_queue_status(node->block, node->msg, cmd, err);
+ dev->priv = NULL;
+ mutex_unlock(&dev->bus_mutex);
+
/* ref taken in w1_search_slave or w1_search_master_id when building
- * the block
+ * the block. If it is the last one, the slave is removed, which waits
+ * for users of the bus.
*/
if (sl)
w1_unref_slave(sl);
else
atomic_dec(&dev->refcnt);
- dev->priv = NULL;
- mutex_unlock(&dev->bus_mutex);
mutex_lock(&dev->list_mutex);
list_del(&async_cmd->async_entry);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0948/1005] w1: remove the masters files before taking its locks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (946 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0947/1005] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0949/1005] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
` (50 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit dfc57752ec53c3cc6105656d3037fb2f5e80e9cc upstream.
__w1_remove_master_device() calls w1_destroy_master_attributes() with
both the mutex of the master and list_mutex held. Removing the files
waits for the callbacks which are running, and nearly all of them take
one of these two locks:
__w1_remove_master_device() read() of .../w1_master_slaves
mutex_lock(&dev->mutex) kernfs active reference
mutex_lock(&dev->list_mutex) w1_master_attribute_show_slaves()
w1_destroy_master_attributes() mutex_lock(&md->list_mutex)
sysfs_remove_group() waits
waits for the reference
The files are readable for everybody, and a bus master goes away when, for
instance, a DS2490 USB adapter is unplugged.
Remove the files first, before the locks are taken. That has to be done
before the slaves are detached and not afterwards: as long as the files
exist, a write to w1_master_add could attach a new slave behind the back
of this function, which would then wait for the reference count of the
master for ever. And it is done before the thread is stopped, because a
write to w1_master_search wakes the thread up.
Fixes: c30c9b15187e ("W1: fix deadlocks and remove w1_control_thread")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-2-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1_int.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -176,6 +176,13 @@ void __w1_remove_master_device(struct w1
mutex_unlock(&w1_mlock);
set_bit(W1_ABORT_SEARCH, &dev->flags);
+
+ /*
+ * This waits for the callbacks, which take the locks below. One of
+ * them wakes the thread up.
+ */
+ w1_destroy_master_attributes(dev);
+
kthread_stop(dev->thread);
mutex_lock(&dev->mutex);
@@ -185,7 +192,6 @@ void __w1_remove_master_device(struct w1
w1_slave_detach(sl);
mutex_lock(&dev->list_mutex);
}
- w1_destroy_master_attributes(dev);
mutex_unlock(&dev->list_mutex);
mutex_unlock(&dev->mutex);
atomic_dec(&dev->refcnt);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0949/1005] w1: use the bus mutex for the "rw" file
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (947 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0948/1005] w1: remove the masters files before taking its locks Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0950/1005] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
` (49 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit 8599e08648c0b4913ea7b202511f1294d176e793 upstream.
Commit b02f8bede217 ("W1: split master mutex to avoid deadlocks.") gave
the bus a mutex of its own, because the lock which protects the list of
slaves is held while a slave is removed, which waits for the sysfs
callbacks of the slave, so these must not take it. It converted all the
slave drivers, but not the "rw" file of the default family in w1.c,
which still takes the mutex of the master to talk on the bus. That has
two consequences:
- A deadlock. w1_process() holds the mutex of the master while it
searches the bus and detaches the slaves which have gone:
w1_process() read() of .../rw
mutex_lock(&dev->mutex) kernfs active reference
w1_search_process() rw_read()
w1_slave_detach() mutex_lock(&master->mutex)
w1_unref_slave() waits
device_unregister()
waits for the reference
The file is readable for everybody.
- The accesses through this file are not serialised with those of the
slave drivers, which take bus_mutex, so that two transactions can get
mixed up on the wire.
Take bus_mutex here as well. It also excludes the search, which takes it
for every pass.
Fixes: b02f8bede217 ("W1: split master mutex to avoid deadlocks.")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-1-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/w1.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -116,7 +116,7 @@ static ssize_t rw_write(struct file *fil
{
struct w1_slave *sl = kobj_to_w1_slave(kobj);
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
if (w1_reset_select_slave(sl)) {
count = 0;
goto out_up;
@@ -125,7 +125,7 @@ static ssize_t rw_write(struct file *fil
w1_write_block(sl->master, buf, count);
out_up:
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
@@ -135,9 +135,9 @@ static ssize_t rw_read(struct file *filp
{
struct w1_slave *sl = kobj_to_w1_slave(kobj);
- mutex_lock(&sl->master->mutex);
+ mutex_lock(&sl->master->bus_mutex);
w1_read_block(sl->master, buf, count);
- mutex_unlock(&sl->master->mutex);
+ mutex_unlock(&sl->master->bus_mutex);
return count;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0950/1005] w1: w1_therm: leave the slaves of other families alone
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (948 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0949/1005] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0951/1005] drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings Greg Kroah-Hartman
` (48 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
commit c0eadd2e06e52563cae2b80491e56eb9712eb727 upstream.
The file therm_bulk_read belongs to the bus master. Its callbacks walk
all the slaves of the bus and look at sl->family_data as if every slave
were a temperature sensor. A 1-wire bus can carry other devices too:
- The family data of a slave which is driven by another driver, such as
w1_ds2433, w1_ds250x, w1_ds28e04 or w1_ds28e17, is a structure of that
driver. bulk_read_support() takes whatever is at the offset of
specific_functions for a pointer and dereferences it, and if the
result happens not to be 0, the callbacks write the state of the
conversion into that foreign structure.
- For a slave without family data, which is the case for most of the
other drivers and for the default family, trigger_bulk_read() gives up
with -ENODEV. A single serial number chip on the bus is enough to
make the bulk read unusable for all the sensors.
Only look at the slaves whose family is one of ours. A bulk conversion
now works on a bus with other devices.
Fixes: 57c76221d5af ("w1_therm: adding bulk read support to trigger multiple conversion on bus")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-9-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/w1/slaves/w1_therm.c | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -907,6 +907,19 @@ static inline bool bulk_read_support(str
}
/**
+ * bulk_read_slave() - check if a slave of the bus takes part in a bulk read
+ * @sl: any slave on the list of the master
+ *
+ * The family data of the slaves of other families is none of our business.
+ *
+ * Return: true if it is one of our devices and supports bulk read
+ */
+static bool bulk_read_slave(struct w1_slave *sl)
+{
+ return device_family(sl) && sl->family_data && bulk_read_support(sl);
+}
+
+/**
* conversion_time() - get the Tconv for the slave
* @sl: device to get the conversion time
*
@@ -1496,9 +1509,7 @@ static int trigger_bulk_read(struct w1_m
* so we can apply a strong pullup if required
*/
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
- if (!sl->family_data)
- goto error;
- if (bulk_read_support(sl)) {
+ if (bulk_read_slave(sl)) {
int t_cur = conversion_time(sl);
t_conv = max(t_cur, t_conv);
@@ -1536,7 +1547,7 @@ static int trigger_bulk_read(struct w1_m
/* set a flag to instruct that converT pending */
list_for_each_entry(sl,
&dev_master->slist, w1_slave_entry) {
- if (bulk_read_support(sl))
+ if (bulk_read_slave(sl))
SLAVE_CONVERT_TRIGGERED(sl) = -1;
}
@@ -1565,7 +1576,7 @@ mt_unlock:
set_flag:
/* set a flag to register convsersion is done */
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
- if (bulk_read_support(sl))
+ if (bulk_read_slave(sl))
SLAVE_CONVERT_TRIGGERED(sl) = 1;
}
error:
@@ -1933,16 +1944,14 @@ static ssize_t therm_bulk_read_show(stru
int ret = 0;
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
- if (sl->family_data) {
- if (bulk_read_support(sl)) {
- if (SLAVE_CONVERT_TRIGGERED(sl) == -1) {
- ret = -1;
- goto show_result;
- }
- if (SLAVE_CONVERT_TRIGGERED(sl) == 1)
- /* continue to check other slaves */
- ret = 1;
+ if (bulk_read_slave(sl)) {
+ if (SLAVE_CONVERT_TRIGGERED(sl) == -1) {
+ ret = -1;
+ goto show_result;
}
+ if (SLAVE_CONVERT_TRIGGERED(sl) == 1)
+ /* continue to check other slaves */
+ ret = 1;
}
}
show_result:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0951/1005] drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (949 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0950/1005] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0952/1005] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
` (47 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Felix Kuehling, Jesse Zhang,
Alex Deucher
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit 1a5ca15b558bf0e6621602c84e0a633d237dd052 upstream.
criu_checkpoint_bos() asks every device of the process whether a BO is
mapped there, passing its drm_priv, which is NULL for the devices the
process never acquired a VM on. On navi48 with its iGPU, checkpointing a
process which acquired the VM of the dGPU only:
Oops: general protection fault, probably for non-canonical address 0xdffffc000000002f: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000178-0x000000000000017f]
RIP: 0010:amdgpu_amdkfd_bo_mapped_to_dev+0x35/0x160 [amdgpu]
kfd_ioctl_criu+0x30d1/0x4aa0 [amdgpu]
kfd_ioctl+0x767/0xb10 [amdgpu]
Nothing can be mapped on such a device, skip it.
Fixes: f9e292cbba21 ("drm/amdkfd: kfd_bo_mapped_dev support partition")
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 794381c358d344d8fcf8b9e6426aa2bac0a7d1f7)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -2175,7 +2175,9 @@ static int criu_checkpoint_bos(struct kf
bo_bucket->offset = amdgpu_bo_mmap_offset(dumper_bo);
for (i = 0; i < p->n_pdds; i++) {
- if (amdgpu_amdkfd_bo_mapped_to_dev(p->pdds[i]->drm_priv, kgd_mem))
+ /* nothing is mapped on a GPU without a VM */
+ if (p->pdds[i]->drm_priv &&
+ amdgpu_amdkfd_bo_mapped_to_dev(p->pdds[i]->drm_priv, kgd_mem))
bo_priv->mapped_gpuids[dev_idx++] = p->pdds[i]->user_gpu_id;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0952/1005] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (950 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0951/1005] drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0953/1005] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
` (46 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian König, Jesse Zhang,
Alex Deucher
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit de0f2a6eabd019a3129025862bffca934a5d7180 upstream.
When initializing the immediate entity fails, amdgpu_vm_init_entities()
destroys that entity which was never set up, and when initializing the
delayed entity fails, it returns without destroying the immediate one.
On navi48, with the allocation of the immediate entity's scheduler list
failing through failslab while opening the render node:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
RIP: 0010:do_raw_spin_lock+0x7b/0x280
_raw_spin_lock+0x3c/0x50
drm_sched_rq_remove_entity+0x90/0x2a0 [gpu_sched]
drm_sched_entity_kill+0x86/0x5a0 [gpu_sched]
drm_sched_entity_fini+0x23/0x270 [gpu_sched]
drm_sched_entity_destroy+0x24/0x30 [gpu_sched]
amdgpu_vm_init_entities+0xc7/0x100 [amdgpu]
amdgpu_vm_init+0x5d1/0x1480 [amdgpu]
amdgpu_driver_open_kms+0x2b1/0xd10 [amdgpu]
Only destroy the immediate entity once it exists and the delayed one
failed.
Fixes: 55bf196f60df ("drm/amdgpu: reset VM when an error is detected")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2f538f57501a71baeb7116ff7485f9a7025e4fb9)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -532,11 +532,15 @@ static int amdgpu_vm_init_entities(struc
adev->vm_manager.vm_pte_scheds,
adev->vm_manager.vm_pte_num_scheds, NULL);
if (r)
+ return r;
+
+ r = drm_sched_entity_init(&vm->delayed, DRM_SCHED_PRIORITY_NORMAL,
+ adev->vm_manager.vm_pte_scheds,
+ adev->vm_manager.vm_pte_num_scheds, NULL);
+ if (r)
goto error;
- return drm_sched_entity_init(&vm->delayed, DRM_SCHED_PRIORITY_NORMAL,
- adev->vm_manager.vm_pte_scheds,
- adev->vm_manager.vm_pte_num_scheds, NULL);
+ return 0;
error:
drm_sched_entity_destroy(&vm->immediate);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0953/1005] USB: serial: garmin_gps: validate packet data length in nat_receive()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (951 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0952/1005] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0954/1005] USB: serial: sierra: validate URB length in instat callback Greg Kroah-Hartman
` (45 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hui Peng, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Peng <benquike@gmail.com>
commit ca783a2d55b3361493917ad4a3573715ba902503 upstream.
In nat_receive() (called from garmin_write() when userspace writes to
/dev/ttyUSBn in MODE_NATIVE mode), while garmin_data_p->insize is less
than GARMIN_PKTHDR_LENGTH (12), the loop copies up to 12 bytes into
garmin_data_p->inbuffer. Once garmin_data_p->insize reaches
GARMIN_PKTHDR_LENGTH, nat_receive() computes the total packet size as:
len = GARMIN_PKTHDR_LENGTH + getDataLength(garmin_data_p->inbuffer);
Because getDataLength() returns a signed int from __le32_to_cpup(), a
12-byte header with a negative 32-bit length field (such as 0xfffffff5,
i.e., -11) causes len to underflow to a small positive value (12 + (-11)
= 1) without any bounds check at that point. Then garmin_data_p->insize
>= len (12 >= 1) evaluates to true and nat_receive() calls
garmin_write_bulk(port, inbuffer, 1, 0), which allocates a 1-byte slab
buffer via kmemdup() and immediately reads 4 bytes from it in
getLayerId(buffer) (and again in garmin_write_bulk_callback() when the
URB completes):
BUG: KASAN: slab-out-of-bounds in garmin_write_bulk.constprop.0+0x3eb/0x500
Read of size 4 at addr ffff888002cc0ba0 by task init/1
Call Trace:
<TASK>
dump_stack_lvl+0x70/0xa0
print_report+0x153/0x4c6
kasan_report+0xf1/0x120
garmin_write_bulk.constprop.0+0x3eb/0x500
garmin_write+0x60f/0x1450
serial_write+0x123/0x200
n_tty_write+0x8ea/0xeb0
file_tty_write.isra.0+0x44f/0x7a0
vfs_write+0x671/0xd20
Validate the unsigned 32-bit data length (dlen >= GPS_IN_BUFSIZ -
GARMIN_PKTHDR_LENGTH, matching the existing len >= GPS_IN_BUFSIZ bound)
in nat_receive() as soon as the 12-byte header is present, resetting
insize and returning -EINVPKT on invalid lengths so garmin_write_bulk()
is only ever called with a full valid packet header (12 <= len <
GPS_IN_BUFSIZ).
Tested in QEMU against Linux 7.3.0-rc3 by emulating a Garmin USB GPS
device (091e:0003) via dummy_hcd + raw-gadget, switching /dev/ttyUSB0
to MODE_NATIVE via PRIV_PKTID_SET_MODE, and writing a 12-byte native
packet with data length 0xfffffff5: on the unfixed kernel this triggers
KASAN slab-out-of-bounds reads in garmin_write_bulk() and
garmin_write_bulk_callback(), whereas on the fixed kernel nat_receive()
rejects the packet with -EINVPKT and 0 KASAN faults.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Hui Peng <benquike@gmail.com>
[ johan: move comment and dev_dbg(); add comment about redundant check ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/garmin_gps.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -746,11 +746,7 @@ static int nat_receive(struct garmin_dat
len = GARMIN_PKTHDR_LENGTH;
if (len >= GPS_IN_BUFSIZ) {
- /* seems to be an invalid packet, ignore rest
- of input */
- dev_dbg(&garmin_data_p->port->dev,
- "%s - packet size too large: %d\n",
- __func__, len);
+ /* should never end up here given the dlen check below */
garmin_data_p->insize = 0;
count = 0;
result = -EINVPKT;
@@ -769,8 +765,17 @@ static int nat_receive(struct garmin_dat
/* do we have a complete packet ? */
if (garmin_data_p->insize >= GARMIN_PKTHDR_LENGTH) {
- len = GARMIN_PKTHDR_LENGTH+
- getDataLength(garmin_data_p->inbuffer);
+ u32 dlen = getDataLength(garmin_data_p->inbuffer);
+
+ if (dlen >= GPS_IN_BUFSIZ - GARMIN_PKTHDR_LENGTH) {
+ /* invalid packet, ignore rest of input */
+ dev_dbg(&garmin_data_p->port->dev, "%s - invalid length: %u\n",
+ __func__, dlen);
+ garmin_data_p->insize = 0;
+ result = -EINVPKT;
+ break;
+ }
+ len = GARMIN_PKTHDR_LENGTH + dlen;
if (garmin_data_p->insize >= len) {
garmin_write_bulk(garmin_data_p->port,
garmin_data_p->inbuffer,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0954/1005] USB: serial: sierra: validate URB length in instat callback
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (952 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0953/1005] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0955/1005] USB: serial: upd78f0730: fix NULL-deref on hangup Greg Kroah-Hartman
` (44 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tristan Madani, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tristan Madani <tristan@talencesecurity.com>
commit a3d43b39032cc5565a5693a10c581844342372cd upstream.
sierra_instat_callback() reads request fields and one byte past the
usb_ctrlrequest header without first checking that urb->actual_length
is large enough. A short USB interrupt transfer could cause an
out-of-bounds read.
Add two length checks matching the pattern already present in the
option driver (option_instat_callback): one for the request header
before accessing bRequestType, and one for the line-state data byte
inside the serial-state notification handler. Use dev_err() since
failing these checks causes the interrupt URB not to be resubmitted.
Fixes: 033a3fb980b041 ("USB: Sierra Wireless driver update")
Cc: stable@vger.kernel.org
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
[ johan: use sizeof(*req_pkt) consistently ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/sierra.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -575,12 +575,24 @@ static void sierra_instat_callback(struc
__func__);
return;
}
+ if (urb->actual_length < sizeof(*req_pkt)) {
+ dev_err(&port->dev, "%s: short transfer\n",
+ __func__);
+ return;
+ }
if ((req_pkt->bRequestType == 0xA1) &&
(req_pkt->bRequest == 0x20)) {
int old_dcd_state;
- unsigned char signals = *((unsigned char *)
- urb->transfer_buffer +
- sizeof(struct usb_ctrlrequest));
+ unsigned char signals;
+
+ if (urb->actual_length < sizeof(*req_pkt) + 1) {
+ dev_err(&port->dev,
+ "%s: short interrupt transfer\n",
+ __func__);
+ return;
+ }
+ signals = *((unsigned char *)urb->transfer_buffer +
+ sizeof(*req_pkt));
dev_dbg(&port->dev, "%s: signal x%x\n", __func__,
signals);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0955/1005] USB: serial: upd78f0730: fix NULL-deref on hangup
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (953 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0954/1005] USB: serial: sierra: validate URB length in instat callback Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0956/1005] USB: serial: io_edgeport: fix NULL-deref on early status Greg Kroah-Hartman
` (43 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Maksim Salau, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 0e0b1fcfb80c0490bda7f7eb633ebb5e431c2e16 upstream.
The port tty pointer is cleared on hangup before deasserting the modem
control signals and should not be used in the dtr_rts() callback.
Factor out a new upd78f0730_port_tiocmset() helper that can be used in
upd78f0730_dtr_rts() to avoid dereferencing a NULL-pointer on hangup
(e.g. on disconnect).
This issue was flagged by an LLM.
Fixes: ea534e0b4047 ("USB: serial: add uPD78F0730 USB to Serial Adaptor Driver")
Cc: stable@vger.kernel.org # 4.11
Cc: Maksim Salau <maksim.salau@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/upd78f0730.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/drivers/usb/serial/upd78f0730.c
+++ b/drivers/usb/serial/upd78f0730.c
@@ -201,10 +201,9 @@ static int upd78f0730_tiocmget(struct tt
return res;
}
-static int upd78f0730_tiocmset(struct tty_struct *tty,
+static int upd78f0730_port_tiocmset(struct usb_serial_port *port,
unsigned int set, unsigned int clear)
{
- struct usb_serial_port *port = tty->driver_data;
struct upd78f0730_port_private *private;
struct upd78f0730_set_dtr_rts request;
struct device *dev = &port->dev;
@@ -238,6 +237,13 @@ static int upd78f0730_tiocmset(struct tt
return res;
}
+static int upd78f0730_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear)
+{
+ struct usb_serial_port *port = tty->driver_data;
+
+ return upd78f0730_port_tiocmset(port, set, clear);
+}
+
static int upd78f0730_break_ctl(struct tty_struct *tty, int break_state)
{
struct upd78f0730_port_private *private;
@@ -267,7 +273,6 @@ static int upd78f0730_break_ctl(struct t
static void upd78f0730_dtr_rts(struct usb_serial_port *port, int on)
{
- struct tty_struct *tty = port->port.tty;
unsigned int set = 0;
unsigned int clear = 0;
@@ -276,7 +281,7 @@ static void upd78f0730_dtr_rts(struct us
else
clear = TIOCM_DTR | TIOCM_RTS;
- upd78f0730_tiocmset(tty, set, clear);
+ upd78f0730_port_tiocmset(port, set, clear);
}
static speed_t upd78f0730_get_baud_rate(struct tty_struct *tty)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0956/1005] USB: serial: io_edgeport: fix NULL-deref on early status
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (954 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0955/1005] USB: serial: upd78f0730: fix NULL-deref on hangup Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0957/1005] USB: serial: io_edgeport: fix potential close() use-after-free Greg Kroah-Hartman
` (42 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+763813d65c7e18c1b6d5,
Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit ae22e9b6412e5dc99e1cf8bd13c6176d44c7d42e upstream.
The driver submits the interrupt-in URB during probe or on first port
open, which on completion may submit the bulk-in URB before all ports
have been opened and their waitqueues have been initialised.
If a (malicious) device sends a status message for a port that has not
yet been opened this may lead to a NULL-pointer dereference in the
bulk-in completion handler when attempting to wakeup blocked tasks.
Move waitqueue initialisation from open() to port_probe() to address
this.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+763813d65c7e18c1b6d5@syzkaller.appspotmail.com
Link: https://lore.kernel.org/6a8818d8.ae6ddae5.3da009.0031.GAE@google.com
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_edgeport.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -877,11 +877,6 @@ static int edge_open(struct tty_struct *
}
}
- /* initialize our wait queues */
- init_waitqueue_head(&edge_port->wait_open);
- init_waitqueue_head(&edge_port->wait_chase);
- init_waitqueue_head(&edge_port->wait_command);
-
/* initialize our port settings */
edge_port->txCredits = 0; /* Can't send any data yet */
/* Must always set this bit to enable ints! */
@@ -2965,6 +2960,11 @@ static int edge_port_probe(struct usb_se
return -ENOMEM;
spin_lock_init(&edge_port->ep_lock);
+
+ init_waitqueue_head(&edge_port->wait_open);
+ init_waitqueue_head(&edge_port->wait_chase);
+ init_waitqueue_head(&edge_port->wait_command);
+
edge_port->port = port;
usb_set_serial_port_data(port, edge_port);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0957/1005] USB: serial: io_edgeport: fix potential close() use-after-free
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (955 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0956/1005] USB: serial: io_edgeport: fix NULL-deref on early status Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0958/1005] USB: serial: io_edgeport: fix potential NULL-deref at open Greg Kroah-Hartman
` (41 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 839ff5fa30995c40cd5fba15fd976ad63416738a upstream.
Add the missing open check on write() and locking when updating the port
status during close() to prevent a racing interrupt completion handler
from trying to submit more data for the port while its write URB and
FIFO are being deallocated.
This issue was flagged by Sashiko when reviewing a related fix.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Link: https://sashiko.dev/#/patchset/20260714101316.823942-1-shpark061104%40gmail.com?part=1
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_edgeport.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -1085,7 +1085,9 @@ static void edge_close(struct usb_serial
/* port->close = true; */
edge_port->closePending = false;
+ spin_lock_irq(&edge_port->ep_lock);
edge_port->open = false;
+ spin_unlock_irq(&edge_port->ep_lock);
edge_port->openPending = false;
usb_kill_urb(edge_port->write_urb);
@@ -1127,6 +1129,12 @@ static int edge_write(struct tty_struct
spin_lock_irqsave(&edge_port->ep_lock, flags);
+ /* avoid accessing freed fifo if tty_wakeup() races with close() */
+ if (!edge_port->open) {
+ spin_unlock_irqrestore(&edge_port->ep_lock, flags);
+ return 0;
+ }
+
/* calculate number of bytes to put in fifo */
copySize = min_t(unsigned int, count,
(edge_port->txCredits - fifo->count));
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0958/1005] USB: serial: io_edgeport: fix potential NULL-deref at open
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (956 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0957/1005] USB: serial: io_edgeport: fix potential close() use-after-free Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0959/1005] USB: serial: io_edgeport: move initial termios update to open() Greg Kroah-Hartman
` (40 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit a0403880a0a638f189e5187068244d9fd5bc8d4d upstream.
Do not mark the port as open until after the write FIFO has been
allocated and initialised to prevent a racing interrupt completion from
attempting to send stale data and dereference the FIFO buffer pointer.
Note that the open flag defaults to false and is cleared on close() so
there is no need to reinitialise it on every open().
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_edgeport.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -885,9 +885,7 @@ static int edge_open(struct tty_struct *
/* send a open port command */
edge_port->openPending = true;
- edge_port->open = false;
response = send_iosp_ext_cmd(edge_port, IOSP_CMD_OPEN_PORT, 0);
-
if (response < 0) {
dev_err(dev, "%s - error sending open port command\n", __func__);
edge_port->openPending = false;
@@ -897,8 +895,7 @@ static int edge_open(struct tty_struct *
/* now wait for the port to be completely opened */
wait_event_timeout(edge_port->wait_open, !edge_port->openPending,
OPEN_TIMEOUT);
-
- if (!edge_port->open) {
+ if (edge_port->openPending) {
/* open timed out */
dev_dbg(dev, "%s - open timeout\n", __func__);
edge_port->openPending = false;
@@ -926,6 +923,10 @@ static int edge_open(struct tty_struct *
return -ENOMEM;
}
+ spin_lock_irq(&edge_port->ep_lock);
+ edge_port->open = true;
+ spin_unlock_irq(&edge_port->ep_lock);
+
dev_dbg(dev, "%s - Initialize TX fifo to %d bytes\n",
__func__, edge_port->maxTxCredits);
@@ -1818,7 +1819,6 @@ static void process_rcvd_status(struct e
/* we have completed the open */
edge_port->openPending = false;
- edge_port->open = true;
wake_up(&edge_port->wait_open);
return;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0959/1005] USB: serial: io_edgeport: move initial termios update to open()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (957 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0958/1005] USB: serial: io_edgeport: fix potential NULL-deref at open Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0960/1005] USB: serial: io_edgeport: fix potential fifo corruption Greg Kroah-Hartman
` (39 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit febadc65a4ef8d08a12e76d6ec50834d72cc0e59 upstream.
Explicitly update the terminal settings on open() instead of doing so
from the interrupt completion handler when receiving an open command
response, which in theory can be received after a failed open attempt.
Note that this will be used to fix a FIFO corruption issue and also
allows for switching to synchronous commands.
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_edgeport.c | 64 ++++++---------------------------------
1 file changed, 10 insertions(+), 54 deletions(-)
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -281,8 +281,7 @@ static void handle_new_lsr(struct edgepo
static int send_iosp_ext_cmd(struct edgeport_port *edge_port, __u8 command,
__u8 param);
static int calc_baud_rate_divisor(struct device *dev, int baud_rate, int *divisor);
-static void change_port_settings(struct tty_struct *tty,
- struct edgeport_port *edge_port,
+static void edge_set_termios(struct tty_struct *tty, struct usb_serial_port *port,
const struct ktermios *old_termios);
static int send_cmd_write_uart_register(struct edgeport_port *edge_port,
__u8 regNum, __u8 regValue);
@@ -923,6 +922,9 @@ static int edge_open(struct tty_struct *
return -ENOMEM;
}
+ if (tty)
+ edge_set_termios(tty, port, NULL);
+
spin_lock_irq(&edge_port->ep_lock);
edge_port->open = true;
spin_unlock_irq(&edge_port->ep_lock);
@@ -1444,30 +1446,6 @@ static void edge_unthrottle(struct tty_s
/*****************************************************************************
- * SerialSetTermios
- * this function is called by the tty driver when it wants to change
- * the termios structure
- *****************************************************************************/
-static void edge_set_termios(struct tty_struct *tty,
- struct usb_serial_port *port,
- const struct ktermios *old_termios)
-{
- struct edgeport_port *edge_port = usb_get_serial_port_data(port);
-
- if (edge_port == NULL)
- return;
-
- if (!edge_port->open) {
- dev_dbg(&port->dev, "%s - port not opened\n", __func__);
- return;
- }
-
- /* change the port settings to the new ones specified */
- change_port_settings(tty, edge_port, old_termios);
-}
-
-
-/*****************************************************************************
* get_lsr_info - get line status register info
*
* Purpose: Let user call ioctl() to get info when the UART physically
@@ -1756,7 +1734,6 @@ static void process_rcvd_status(struct e
{
struct usb_serial_port *port;
struct edgeport_port *edge_port;
- struct tty_struct *tty;
struct device *dev;
__u8 code = edge_serial->rxStatusCode;
@@ -1808,15 +1785,6 @@ static void process_rcvd_status(struct e
__func__, edge_serial->rxPort, byte2, edge_port->txCredits);
handle_new_msr(edge_port, byte2);
- /* send the current line settings to the port so we are
- in sync with any further termios calls */
- tty = tty_port_tty_get(&edge_port->port->port);
- if (tty) {
- change_port_settings(tty,
- edge_port, &tty->termios);
- tty_kref_put(tty);
- }
-
/* we have completed the open */
edge_port->openPending = false;
wake_up(&edge_port->wait_open);
@@ -2328,18 +2296,12 @@ static int send_cmd_write_uart_register(
}
-/*****************************************************************************
- * change_port_settings
- * This routine is called to set the UART on the device to match the
- * specified new settings.
- *****************************************************************************/
-
-static void change_port_settings(struct tty_struct *tty,
- struct edgeport_port *edge_port, const struct ktermios *old_termios)
+static void edge_set_termios(struct tty_struct *tty, struct usb_serial_port *port,
+ const struct ktermios *old_termios)
{
- struct device *dev = &edge_port->port->dev;
- struct edgeport_serial *edge_serial =
- usb_get_serial_data(edge_port->port->serial);
+ struct edgeport_serial *edge_serial = usb_get_serial_data(port->serial);
+ struct edgeport_port *edge_port = usb_get_serial_port_data(port);
+ struct device *dev = &port->dev;
int baud;
unsigned cflag;
__u8 mask = 0xff;
@@ -2350,12 +2312,6 @@ static void change_port_settings(struct
__u8 txFlow;
int status;
- if (!edge_port->open &&
- !edge_port->openPending) {
- dev_dbg(dev, "%s - port not opened\n", __func__);
- return;
- }
-
cflag = tty->termios.c_cflag;
switch (cflag & CSIZE) {
@@ -2489,7 +2445,7 @@ static void change_port_settings(struct
dev_dbg(dev, "%s - baud rate = %d\n", __func__, baud);
status = send_cmd_write_baud_rate(edge_port, baud);
- if (status == -1) {
+ if (status == -1 && old_termios) {
/* Speed change was not possible - put back the old speed */
baud = tty_termios_baud_rate(old_termios);
tty_encode_baud_rate(tty, baud, baud);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0960/1005] USB: serial: io_edgeport: fix potential fifo corruption
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (958 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0959/1005] USB: serial: io_edgeport: move initial termios update to open() Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0961/1005] USB: serial: io_edgeport: fix potential use-after-free on disconnect Greg Kroah-Hartman
` (38 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 270f76c3b88c9cc3d6ca58c5c0c0f34c2373b27c upstream.
The device buffer size is determined during open() and the driver
allocates a TX FIFO of corresponding size.
Add the missing sanity check to prevent memory corruption in case a
malicious device sends a second open response with a different buffer
size.
This issue was flagged by Sashiko when reviewing a related fix.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Link: https://sashiko.dev/#/patchset/20260714101316.823942-1-shpark061104%40gmail.com?part=1
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_edgeport.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -877,13 +877,17 @@ static int edge_open(struct tty_struct *
}
/* initialize our port settings */
+ spin_lock_irq(&edge_port->ep_lock);
edge_port->txCredits = 0; /* Can't send any data yet */
+ edge_port->maxTxCredits = 0;
+ edge_port->openPending = true;
+ spin_unlock_irq(&edge_port->ep_lock);
+
/* Must always set this bit to enable ints! */
edge_port->shadowMCR = MCR_MASTER_IE;
edge_port->chaseResponsePending = false;
/* send a open port command */
- edge_port->openPending = true;
response = send_iosp_ext_cmd(edge_port, IOSP_CMD_OPEN_PORT, 0);
if (response < 0) {
dev_err(dev, "%s - error sending open port command\n", __func__);
@@ -1736,6 +1740,7 @@ static void process_rcvd_status(struct e
struct edgeport_port *edge_port;
struct device *dev;
__u8 code = edge_serial->rxStatusCode;
+ unsigned long flags;
/* switch the port pointer to the one being currently talked about */
if (edge_serial->rxPort >= edge_serial->serial->num_ports)
@@ -1779,6 +1784,12 @@ static void process_rcvd_status(struct e
}
if (code == IOSP_STATUS_OPEN_RSP) {
+ spin_lock_irqsave(&edge_port->ep_lock, flags);
+ /* reject stray open responses to avoid FIFO corruption */
+ if (!edge_port->openPending) {
+ spin_unlock_irqrestore(&edge_port->ep_lock, flags);
+ return;
+ }
edge_port->txCredits = GET_TX_BUFFER_SIZE(byte3);
edge_port->maxTxCredits = edge_port->txCredits;
dev_dbg(dev, "%s - Port %u Open Response Initial MSR = %02x TxBufferSize = %d\n",
@@ -1787,6 +1798,8 @@ static void process_rcvd_status(struct e
/* we have completed the open */
edge_port->openPending = false;
+ spin_unlock_irqrestore(&edge_port->ep_lock, flags);
+
wake_up(&edge_port->wait_open);
return;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0961/1005] USB: serial: io_edgeport: fix potential use-after-free on disconnect
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (959 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0960/1005] USB: serial: io_edgeport: fix potential fifo corruption Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0962/1005] USB: serial: io_edgeport: serialise MCR accesses Greg Kroah-Hartman
` (37 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 50613e6380db7a904ef15c60ed0c436baf308f0a upstream.
The driver submits command URBs asynchronously but fails to stop them on
disconnect, something which could lead to a use-after-free when
accessing driver data in the completion handler after a port has been
unbound.
Add an URB anchor to track and kill outstanding command URBs on
disconnect.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_edgeport.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -225,6 +225,7 @@ struct edgeport_serial {
__u8 rxStatusParam; /* the receive status parameter */
__s16 rxBytesRemaining; /* the number of port bytes left to read */
struct usb_serial *serial; /* loop back to the owner of this object */
+ struct usb_anchor cmd_anchor;
};
/* baud rate information */
@@ -261,9 +262,6 @@ static const struct divisor_table_entry
{ 230400, 1},
};
-/* Number of outstanding Command Write Urbs */
-static atomic_t CmdUrbs = ATOMIC_INIT(0);
-
/* function prototypes */
@@ -776,11 +774,6 @@ static void edge_bulk_out_cmd_callback(s
struct device *dev = &urb->dev->dev;
int status = urb->status;
- atomic_dec(&CmdUrbs);
- dev_dbg(dev, "%s - FREE URB %p (outstanding %d)\n", __func__, urb,
- atomic_read(&CmdUrbs));
-
-
/* clean up the transfer buffer */
kfree(urb->transfer_buffer);
@@ -2127,24 +2120,21 @@ static int write_cmd_usb(struct edgeport
if (!urb)
return -ENOMEM;
- atomic_inc(&CmdUrbs);
- dev_dbg(dev, "%s - ALLOCATE URB %p (outstanding %d)\n",
- __func__, urb, atomic_read(&CmdUrbs));
-
usb_fill_bulk_urb(urb, edge_serial->serial->dev,
usb_sndbulkpipe(edge_serial->serial->dev,
edge_serial->bulk_out_endpoint),
buffer, length, edge_bulk_out_cmd_callback, edge_port);
edge_port->commandPending = true;
+ usb_anchor_urb(urb, &edge_serial->cmd_anchor);
status = usb_submit_urb(urb, GFP_ATOMIC);
if (status) {
/* something went wrong */
dev_err(dev, "%s - usb_submit_urb(write command) failed, status = %d\n",
__func__, status);
+ usb_unanchor_urb(urb);
usb_free_urb(urb);
- atomic_dec(&CmdUrbs);
return status;
}
@@ -2696,6 +2686,7 @@ static int edge_startup(struct usb_seria
spin_lock_init(&edge_serial->es_lock);
edge_serial->serial = serial;
+ init_usb_anchor(&edge_serial->cmd_anchor);
usb_set_serial_data(serial, edge_serial);
/* get the name for the device from the device */
@@ -2900,6 +2891,8 @@ static void edge_disconnect(struct usb_s
{
struct edgeport_serial *edge_serial = usb_get_serial_data(serial);
+ usb_kill_anchored_urbs(&edge_serial->cmd_anchor);
+
if (edge_serial->is_epic) {
usb_kill_urb(edge_serial->interrupt_read_urb);
usb_kill_urb(edge_serial->read_urb);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0962/1005] USB: serial: io_edgeport: serialise MCR accesses
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (960 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0961/1005] USB: serial: io_edgeport: fix potential use-after-free on disconnect Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0963/1005] dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs Greg Kroah-Hartman
` (36 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 6e4629504d7e5a22dd26f3b262f0a0f80e3cad6a upstream.
Add a mutex to serialise modem control register updates to prevent
concurrent tasks from interfering with each other.
Note that the register updates are currently asynchronous so a task may
read back a value which has not yet taken effect.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/io_edgeport.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -168,6 +168,7 @@ struct edgeport_port {
struct urb *write_urb; /* write URB for this port */
bool write_in_progress; /* 'true' while a write URB is outstanding */
spinlock_t ep_lock;
+ struct mutex mutex;
__u8 shadowLCR; /* last LCR value received */
__u8 shadowMCR; /* last MCR value received */
@@ -877,7 +878,10 @@ static int edge_open(struct tty_struct *
spin_unlock_irq(&edge_port->ep_lock);
/* Must always set this bit to enable ints! */
+ mutex_lock(&edge_port->mutex);
edge_port->shadowMCR = MCR_MASTER_IE;
+ mutex_unlock(&edge_port->mutex);
+
edge_port->chaseResponsePending = false;
/* send a open port command */
@@ -1398,9 +1402,11 @@ static void edge_throttle(struct tty_str
/* if we are implementing RTS/CTS, toggle that line */
if (C_CRTSCTS(tty)) {
+ mutex_lock(&edge_port->mutex);
edge_port->shadowMCR &= ~MCR_RTS;
status = send_cmd_write_uart_register(edge_port, MCR,
edge_port->shadowMCR);
+ mutex_unlock(&edge_port->mutex);
if (status != 0)
return;
}
@@ -1435,9 +1441,11 @@ static void edge_unthrottle(struct tty_s
}
/* if we are implementing RTS/CTS, toggle that line */
if (C_CRTSCTS(tty)) {
+ mutex_lock(&edge_port->mutex);
edge_port->shadowMCR |= MCR_RTS;
send_cmd_write_uart_register(edge_port, MCR,
edge_port->shadowMCR);
+ mutex_unlock(&edge_port->mutex);
}
}
@@ -1478,6 +1486,7 @@ static int edge_tiocmset(struct tty_stru
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
unsigned int mcr;
+ mutex_lock(&edge_port->mutex);
mcr = edge_port->shadowMCR;
if (set & TIOCM_RTS)
mcr |= MCR_RTS;
@@ -1496,6 +1505,7 @@ static int edge_tiocmset(struct tty_stru
edge_port->shadowMCR = mcr;
send_cmd_write_uart_register(edge_port, MCR, edge_port->shadowMCR);
+ mutex_unlock(&edge_port->mutex);
return 0;
}
@@ -1509,6 +1519,7 @@ static int edge_tiocmget(struct tty_stru
unsigned int mcr;
msr = edge_port->shadowMSR;
+ mutex_lock(&edge_port->mutex);
mcr = edge_port->shadowMCR;
result = ((mcr & MCR_DTR) ? TIOCM_DTR: 0) /* 0x002 */
| ((mcr & MCR_RTS) ? TIOCM_RTS: 0) /* 0x004 */
@@ -1516,6 +1527,7 @@ static int edge_tiocmget(struct tty_stru
| ((msr & EDGEPORT_MSR_CD) ? TIOCM_CAR: 0) /* 0x040 */
| ((msr & EDGEPORT_MSR_RI) ? TIOCM_RI: 0) /* 0x080 */
| ((msr & EDGEPORT_MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */
+ mutex_unlock(&edge_port->mutex);
return result;
}
@@ -2430,12 +2442,14 @@ static void edge_set_termios(struct tty_
return;
/* set up the MCR register and send it to the EdgePort */
+ mutex_lock(&edge_port->mutex);
edge_port->shadowMCR = MCR_MASTER_IE;
if (cflag & CBAUD)
edge_port->shadowMCR |= (MCR_DTR | MCR_RTS);
status = send_cmd_write_uart_register(edge_port, MCR,
edge_port->shadowMCR);
+ mutex_unlock(&edge_port->mutex);
if (status != 0)
return;
@@ -2930,6 +2944,7 @@ static int edge_port_probe(struct usb_se
return -ENOMEM;
spin_lock_init(&edge_port->ep_lock);
+ mutex_init(&edge_port->mutex);
init_waitqueue_head(&edge_port->wait_open);
init_waitqueue_head(&edge_port->wait_chase);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0963/1005] dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (961 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0962/1005] USB: serial: io_edgeport: serialise MCR accesses Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0964/1005] iio: accel: adxl313: add missing buffer selections in Kconfig Greg Kroah-Hartman
` (35 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Billy Tsai,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Billy Tsai <billy_tsai@aspeedtech.com>
commit 6ec0623a7c77bc2c383e9971d7b0c9df3ec988fb upstream.
The ADC's reference-voltage trimming data lives in a System Control
Unit (SCU) register. SoCs with a single SCU instance let the driver
locate it without any additional information, but SoCs such as AST2700
that expose more than one SCU node need an explicit phandle to
disambiguate which one holds the trimming data.
Add an "aspeed,trim-syscon" phandle property, and require it for the
AST2700 compatibles since they are the first multi-SCU SoCs supported
by this driver.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml | 17 ++++++++++
1 file changed, 17 insertions(+)
--- a/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml
@@ -67,6 +67,11 @@ properties:
description:
Inform the driver that last channel will be used to sensor battery.
+ aspeed,trim-syscon:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ Phandle to the SCU holding the ADC's reference-voltage trimming data.
+
required:
- compatible
- reg
@@ -74,6 +79,18 @@ required:
- resets
- "#io-channel-cells"
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - aspeed,ast2700-adc0
+ - aspeed,ast2700-adc1
+ then:
+ required:
+ - aspeed,trim-syscon
+
additionalProperties: false
examples:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0964/1005] iio: accel: adxl313: add missing buffer selections in Kconfig
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (962 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0963/1005] dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0965/1005] iio: accel: kxsd9: Fix potential use-after-free on removal Greg Kroah-Hartman
` (34 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexis Bouzigues, Joshua Crofts,
Nuno Sá, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
commit 4e9f192f997dc56f309090233352d62edbea42ce upstream.
The FIFO support added to the ADXL313 core uses
devm_iio_kfifo_buffer_setup() and iio_push_to_buffers(), but its Kconfig
entry does not select the required buffer support. Enabling either
frontend without IIO_BUFFER or IIO_KFIFO_BUF causes undefined references
to devm_iio_kfifo_buffer_setup_ext() and iio_push_to_buffers().
Select IIO_BUFFER and IIO_KFIFO_BUF from the shared ADXL313 core symbol
so both the I2C and SPI frontends have the required dependencies.
Fixes: ff8093fa6ba4 ("iio: accel: adxl313: add buffered FIFO watermark with interrupt handling")
Cc: stable@vger.kernel.org
Signed-off-by: Alexis Bouzigues <BouziguesAlexis@JohnDeere.com>
Tested-by: Joshua Crofts <joshua.crofts1@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/accel/Kconfig | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/iio/accel/Kconfig
+++ b/drivers/iio/accel/Kconfig
@@ -32,6 +32,8 @@ config ADIS16209
config ADXL313
tristate
+ select IIO_BUFFER
+ select IIO_KFIFO_BUF
config ADXL313_I2C
tristate "Analog Devices ADXL313 3-Axis Digital Accelerometer I2C Driver"
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0965/1005] iio: accel: kxsd9: Fix potential use-after-free on removal
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (963 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0964/1005] iio: accel: adxl313: add missing buffer selections in Kconfig Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0966/1005] iio: acpi: Accept comma separated values in ROTM strings Greg Kroah-Hartman
` (33 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Joshua Crofts,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
commit fd7334314f63a3a2a4927f209b2ca0e33d111840 upstream.
Unregistering an IIO device with an active triggered buffer detaches its
poll function. Freeing the poll function first can therefore make
iio_device_unregister() access freed memory.
Unregister the device before cleaning up the triggered buffer.
This issue was found by our static analysis tool under development.
Fixes: 0427a106a98a ("iio: accel: kxsd9: Add triggered buffer handling")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
Reviewed-by: Joshua Crofts <crofts@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/accel/kxsd9.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/accel/kxsd9.c
+++ b/drivers/iio/accel/kxsd9.c
@@ -478,8 +478,8 @@ void kxsd9_common_remove(struct device *
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct kxsd9_state *st = iio_priv(indio_dev);
- iio_triggered_buffer_cleanup(indio_dev);
iio_device_unregister(indio_dev);
+ iio_triggered_buffer_cleanup(indio_dev);
pm_runtime_get_sync(dev);
pm_runtime_put_noidle(dev);
pm_runtime_disable(dev);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0966/1005] iio: acpi: Accept comma separated values in ROTM strings
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (964 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0965/1005] iio: accel: kxsd9: Fix potential use-after-free on removal Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0967/1005] iio: adc: aspeed: Use syscon phandle for trimming data when available Greg Kroah-Hartman
` (32 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yu-Hsiang Tseng, Andy Shevchenko,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu-Hsiang Tseng <asas1asas200@gmail.com>
commit dd53f1841ecfa2da152cbc31038a5f125b2b9e57 upstream.
The ROTM method of the MXC6655 accelerometer on the Higole F9B, an
Alder Lake-N handheld (AMI BIOS F9D_16G_P800217, DMI strings are all
"Default string"), separates the values with a comma and a space:
Method (ROTM, 0, NotSerialized)
{
Name (SBUF, Package (0x03)
{
"-1, 0, 0",
"0, 1, 0",
"0, 0, 1"
})
Return (SBUF)
}
iio_read_acpi_mount_matrix() only accepts the space separated form used
in Microsoft's example ("0 1 0"). It rejects this matrix and mxc4005
falls back to the identity matrix:
mxc4005 i2c-MXC6655:00: Incorrect ACPI mount matrix string format
mxc4005 i2c-MXC6655:00: mounting matrix not found: using identity...
With the X axis not inverted, iio-sensor-proxy reports left-up when the
device is held right-up and vice versa, so the desktop turns the
picture upside down whenever the handheld is held in landscape.
It is not the only BIOS written this way. The BOSC0200 on the AYANEO
Air Plus uses commas in its ROMS method as well, with a space before
one of them, and its ROMK method has "1, 0,0":
Method (ROMS, 0, NotSerialized)
{
Name (SBUF, Package (0x03)
{
"-1, 0, 0",
"0, -1 , 0",
"0, 0, -1"
})
Return (SBUF)
}
The kernel's sscanf() does not support '%*[', so there is no clean way
to take both separators in a single format string. That leaves either
a second sscanf() call with a comma format, or normalizing the
separator first. Do the latter: turn the commas into spaces before
parsing, so the existing "%d %d %d" format, which already takes any
amount of white space around the values, keeps working unchanged. The
strings live in the buffer acpi_evaluate_object() allocated for us, so
they can be modified in place.
With this change in_accel_mount_matrix on the Higole F9B reads
"-1, 0, 0; 0, 1, 0; 0, 0, 1" and, with no udev hwdb override, the
desktop rotates correctly in all four orientations. The AYANEO Air
Plus was not tested; systemd's hwdb has an entry for it, which
iio-sensor-proxy prefers over the kernel's matrix.
Link: https://github.com/hhd-dev/hwinfo/blob/d9508123bee46ae3a59dc24826030ef51ea95058/devices/ayaneo_airplus/acpi/decoded/dsdt.dsl
Cc: stable@vger.kernel.org # 6.10.x
Signed-off-by: Yu-Hsiang Tseng <asas1asas200@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/industrialio-acpi.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/drivers/iio/industrialio-acpi.c
+++ b/drivers/iio/industrialio-acpi.c
@@ -6,6 +6,7 @@
#include <linux/export.h>
#include <linux/iio/iio.h>
#include <linux/sprintf.h>
+#include <linux/string.h>
/**
* iio_read_acpi_mount_matrix() - Read accelerometer mount matrix info from ACPI
@@ -63,6 +64,14 @@ bool iio_read_acpi_mount_matrix(struct d
}
str = elements[i].string.pointer;
+ /*
+ * Microsoft's example separates the values with spaces, "0 1 0".
+ * Some BIOSes use commas instead, with or without spaces around
+ * them: "0, 1, 0", "0, -1 , 0", "1, 0,0". The string lives in
+ * the buffer allocated for us above, so turn the commas into
+ * spaces in place before parsing.
+ */
+ strreplace(str, ',', ' ');
if (sscanf(str, "%d %d %d", &val[0], &val[1], &val[2]) != 3) {
dev_err(dev, "Incorrect ACPI mount matrix string format\n");
goto out_free_buffer;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0967/1005] iio: adc: aspeed: Use syscon phandle for trimming data when available
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (965 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0966/1005] iio: acpi: Accept comma separated values in ROTM strings Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0968/1005] iio: afe: rescale: expose offset if rescaler or source has one Greg Kroah-Hartman
` (31 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Billy Tsai, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Billy Tsai <billy_tsai@aspeedtech.com>
commit 4e7007317fdf83b5201f39afff5adfa0292fc707 upstream.
aspeed_adc_set_trim_data() locates the SCU holding the ADC's
reference-voltage trimming data with of_find_node_by_name(NULL,
"syscon"), a global search that matches the first device-tree node
named "syscon" regardless of which SCU instance it actually is.
On AST2700, which splits its SCU into "syscon0" (soc0) and "syscon1"
(soc1), both nodes share the same node name "syscon" and only differ
by label and unit address, so the lookup always resolves to syscon0
even though the ADC's trimming data lives in syscon1.
Use the new "aspeed,trim-syscon" phandle property when present to look
up the correct regmap directly, falling back to the old global by-name
search when the property is absent so existing device trees keep
working.
Fixes: 9d8b88ffb773 ("iio: adc: aspeed: Add AST2700 ADC support")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/adc/aspeed_adc.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -201,18 +201,29 @@ static const struct iio_chan_spec aspeed
static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev)
{
- struct device_node *syscon;
+ struct device_node *np, *syscon;
struct regmap *scu;
u32 scu_otp, trimming_val;
struct aspeed_adc_data *data = iio_priv(indio_dev);
+ const char *propname = "aspeed,trim-syscon";
- syscon = of_find_node_by_name(NULL, "syscon");
- if (syscon == NULL) {
- dev_warn(data->dev, "Couldn't find syscon node\n");
- return -EOPNOTSUPP;
+ np = dev_of_node(data->dev);
+ if (of_property_present(np, propname)) {
+ scu = syscon_regmap_lookup_by_phandle(np, propname);
+ } else {
+ /*
+ * No "aspeed,trim-syscon" phandle: either a single-SCU SoC,
+ * or a DTB predating the property. Fall back to the old
+ * global by-name lookup for backward compatibility.
+ */
+ syscon = of_find_node_by_name(NULL, "syscon");
+ if (!syscon) {
+ dev_warn(data->dev, "Couldn't find syscon node\n");
+ return -EOPNOTSUPP;
+ }
+ scu = syscon_node_to_regmap(syscon);
+ of_node_put(syscon);
}
- scu = syscon_node_to_regmap(syscon);
- of_node_put(syscon);
if (IS_ERR(scu)) {
dev_warn(data->dev, "Failed to get syscon regmap\n");
return -EOPNOTSUPP;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0968/1005] iio: afe: rescale: expose offset if rescaler or source has one
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (966 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0967/1005] iio: adc: aspeed: Use syscon phandle for trimming data when available Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0969/1005] iio: atlas-ezo: Fix humidity channel read support Greg Kroah-Hartman
` (30 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrea Amer, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Amer <and.amer@gmail.com>
commit c293f0db308fe76a0a9b0f6674cd2dea149b03aa upstream.
A rescale channel advertises IIO_CHAN_INFO_OFFSET only when its own
offset is non-zero. A child rescale therefore hides a source offset,
and consumers apply raw * scale and drop it, even though
rescale_read_raw() folds the source offset in.
Expose the attribute when either the rescaler or the source channel
provides an offset.
Fixes: a29c3283653b ("iio: afe: rescale: add offset support")
Signed-off-by: Andrea Amer <and.amer@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/afe/iio-rescale.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/iio/afe/iio-rescale.c
+++ b/drivers/iio/afe/iio-rescale.c
@@ -303,7 +303,8 @@ static int rescale_configure_channel(str
chan->info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
BIT(IIO_CHAN_INFO_SCALE);
- if (rescale->offset)
+ if (rescale->offset ||
+ iio_channel_has_info(schan, IIO_CHAN_INFO_OFFSET))
chan->info_mask_separate |= BIT(IIO_CHAN_INFO_OFFSET);
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0969/1005] iio: atlas-ezo: Fix humidity channel read support
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (967 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0968/1005] iio: afe: rescale: expose offset if rescaler or source has one Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0970/1005] iio: common: scmi_sensors: fix truncating 64-bit divisions Greg Kroah-Hartman
` (29 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nikhil Gautam, Joshua Crofts,
Matt Ranostay, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikhil Gautam <nikhilgtr@gmail.com>
commit 0cb3fc8987038a26ac0f581bfa26b16daf6ca6a7 upstream.
The atlas_ezo_read_raw() function rejects channels that are not of
type IIO_CONCENTRATION, preventing the relative humidity channel
from reading raw and scale values.
Remove the early channel type check to allow both concentration
and relative humidity channels to reach the mask-specific handling.
Fixes: dc3ebfcaa51f ("iio: chemical: atlas-ezo-sensor: add humidity sensor support")
Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Reviewed-by: Matt Ranostay <matt@ranostay.sg>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/chemical/atlas-ezo-sensor.c | 3 ---
1 file changed, 3 deletions(-)
--- a/drivers/iio/chemical/atlas-ezo-sensor.c
+++ b/drivers/iio/chemical/atlas-ezo-sensor.c
@@ -116,9 +116,6 @@ static int atlas_ezo_read_raw(struct iio
struct atlas_ezo_data *data = iio_priv(indio_dev);
struct i2c_client *client = data->client;
- if (chan->type != IIO_CONCENTRATION)
- return -EINVAL;
-
switch (mask) {
case IIO_CHAN_INFO_RAW: {
int ret;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0970/1005] iio: common: scmi_sensors: fix truncating 64-bit divisions
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (968 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0969/1005] iio: atlas-ezo: Fix humidity channel read support Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0971/1005] iio: dac: mcp4725: Update the cached DAC value only on success Greg Kroah-Hartman
` (28 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Arnav Kapoor,
Andy Shevchenko, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit 043ececf147863fbd253687aa0b9edcac358a711 upstream.
do_div() divides a 64-bit dividend by a 32-bit divisor: the divisor is
stored in a uint32_t on all architectures. The driver passes 64-bit
divisors to it in several places, so they are silently truncated:
- scmi_iio_set_odr_val() divides by uHz, which exceeds 32 bits for
sampling frequencies above ~4294 Hz.
- convert_ns_to_freq() divides by interval_ns, which exceeds 32 bits
for update intervals of ~4.29 s and above. If its low 32 bits happen
to be zero, this is a division by zero.
- scmi_iio_get_odr_val(), scmi_iio_convert_interval_to_ns(),
scmi_iio_sensor_update_cb() and scmi_iio_get_raw_available() divide
by int_pow(10, n), which returns u64 and exceeds 32 bits for n >= 10.
The SCMI exponent fields allow values down to -16.
Truncation results in wrong sampling frequency, timestamp and
raw_available values being reported to userspace.
Use div64_u64() and div64_u64_rem(), which take a 64-bit divisor.
Fixes: f774117c96f9 ("iio/scmi: Adding support for IIO SCMI Based Sensors")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606040245.XfmRpBhA-lkp@intel.com/
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/common/scmi_sensors/scmi_iio.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
--- a/drivers/iio/common/scmi_sensors/scmi_iio.c
+++ b/drivers/iio/common/scmi_sensors/scmi_iio.c
@@ -14,6 +14,7 @@
#include <linux/iio/sysfs.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
+#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/scmi_protocol.h>
@@ -70,8 +71,7 @@ static int scmi_iio_sensor_update_cb(str
*/
tstamp_scale = sensor->sensor_info->tstamp_scale + 9;
if (tstamp_scale < 0) {
- do_div(time, int_pow(10, abs(tstamp_scale)));
- time_ns = time;
+ time_ns = div64_u64(time, int_pow(10, abs(tstamp_scale)));
} else {
time_ns = time * int_pow(10, tstamp_scale);
}
@@ -162,7 +162,7 @@ static int scmi_iio_set_odr_val(struct i
mult = scnprintf(buf, sizeof(buf), "%llu", sf) - 1;
sec = int_pow(10, mult) * MICROHZ_PER_HZ;
- do_div(sec, uHz);
+ sec = div64_u64(sec, uHz);
if (sec == 0) {
dev_err(&iio_dev->dev,
"Trying to set invalid sensor update value for sensor %s",
@@ -237,13 +237,10 @@ static int scmi_iio_read_avail(struct ii
static void convert_ns_to_freq(u64 interval_ns, u64 *hz, u64 *uhz)
{
- u64 rem, freq;
+ u64 rem;
- freq = NSEC_PER_SEC;
- rem = do_div(freq, interval_ns);
- *hz = freq;
- *uhz = rem * 1000000UL;
- do_div(*uhz, interval_ns);
+ *hz = div64_u64_rem(HZ_PER_GHZ, interval_ns, &rem);
+ *uhz = div64_u64(rem * MICROHZ_PER_HZ, interval_ns);
}
static int scmi_iio_get_odr_val(struct iio_dev *iio_dev, int *val, int *val2)
@@ -269,7 +266,8 @@ static int scmi_iio_get_odr_val(struct i
mult = SCMI_SENS_CFG_GET_UPDATE_EXP(sensor_config);
if (mult < 0) {
sensor_interval_mult = int_pow(10, abs(mult));
- do_div(sensor_update_interval, sensor_interval_mult);
+ sensor_update_interval = div64_u64(sensor_update_interval,
+ sensor_interval_mult);
} else {
sensor_interval_mult = int_pow(10, mult);
sensor_update_interval =
@@ -395,9 +393,9 @@ static ssize_t scmi_iio_get_raw_availabl
*/
exponent = exponent - scale;
if (exponent < 0) {
- rem = do_div(resolution,
- int_pow(10, abs(exponent))
- );
+ resolution = div64_u64_rem(resolution,
+ int_pow(10, abs(exponent)),
+ &rem);
len = sysfs_emit(buf,
"[%lld %llu.%llu %lld]\n", min_range,
resolution, rem, max_range);
@@ -491,7 +489,8 @@ static u64 scmi_iio_convert_interval_to_
mult = SCMI_SENS_INTVL_GET_EXP(val);
if (mult < 0) {
sensor_interval_mult = int_pow(10, abs(mult));
- do_div(sensor_update_interval, sensor_interval_mult);
+ sensor_update_interval = div64_u64(sensor_update_interval,
+ sensor_interval_mult);
} else {
sensor_interval_mult = int_pow(10, mult);
sensor_update_interval =
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0971/1005] iio: dac: mcp4725: Update the cached DAC value only on success
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (969 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0970/1005] iio: common: scmi_sensors: fix truncating 64-bit divisions Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0972/1005] iio: gyro: bmg160: reject duplicate event disable Greg Kroah-Hartman
` (27 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Baek Kyu, Kim, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baek Kyu, Kim <pocj8ur4in@gmail.com>
commit 098a4c37dc8815ea941866179220394e4d182c67 upstream.
mcp4725_write_raw() updates dac_value even if mcp4725_set_value() rejects
the requested value or reports an I2C transfer error. After writing 1000,
a rejected write of 4096 returns -EINVAL without an I2C transfer, but
out_voltage0_raw reports 4096. A later powerdown exit sends 00 00 instead
of the 03 e8 frame for the last successful value. The EEPROM store path
uses the same cache.
Return the setter error before updating dac_value. This keeps the last
successful software value for readback, powerdown exit and EEPROM writes.
Fixes: cf35ad61aca2 ("iio: add mcp4725 I2C DAC driver")
Signed-off-by: Baek Kyu, Kim <pocj8ur4in@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/dac/mcp4725.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -356,6 +356,8 @@ static int mcp4725_write_raw(struct iio_
switch (mask) {
case IIO_CHAN_INFO_RAW:
ret = mcp4725_set_value(indio_dev, val);
+ if (ret)
+ return ret;
data->dac_value = val;
break;
default:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0972/1005] iio: gyro: bmg160: reject duplicate event disable
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (970 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0971/1005] iio: dac: mcp4725: Update the cached DAC value only on success Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0973/1005] iio: hid-sensor: Fix scale for magnetic north heading Greg Kroah-Hartman
` (26 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
commit d0c8bd5d18a492d64d05482f4b1700e14df7ff84 upstream.
The IIO core does not filter duplicate writes to the event enable
attribute. bmg160_write_event_config() already ignores repeated enable
requests, but a repeated disable request still calls
bmg160_set_power_state(data, false), dropping a runtime PM reference
that was not acquired for this request. This can underflow the runtime
PM usage count and trigger a "Runtime PM usage count underflow" warning.
Return early when the requested state already matches ev_enable_state.
Fixes: 22b46c45fb9b ("iio:gyro:bmg160 Gyro Sensor driver")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/gyro/bmg160_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/gyro/bmg160_core.c
+++ b/drivers/iio/gyro/bmg160_core.c
@@ -761,7 +761,7 @@ static int bmg160_write_event_config(str
struct bmg160_data *data = iio_priv(indio_dev);
int ret;
- if (state && data->ev_enable_state)
+ if (state == data->ev_enable_state)
return 0;
mutex_lock(&data->mutex);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0973/1005] iio: hid-sensor: Fix scale for magnetic north heading
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (971 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0972/1005] iio: gyro: bmg160: reject duplicate event disable Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0974/1005] iio: hid-sensors: fix fractional part for unit exponents -7 and -8 Greg Kroah-Hartman
` (25 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maximilian Czirr,
Srinivas Pandruvada, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maximilian Czirr <maxx-cz@web.de>
commit c72dcaeaabd60e164e7324f80ccb037e879eefdd upstream.
hid_sensor_format_scale() applies the HID unit exponent only when
the usage and unit match an entry in unit_conversion[].
Rotation-from-north support uses
HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH, but that usage has no entry in
the conversion table. As a result, the unit exponent is ignored and the
heading can be exposed with a scale of 1 instead of the scale specified
by the HID descriptor.
Add a unitless conversion entry so the HID unit exponent is applied to
the magnetic north heading. A sensor reporting an exponent of -5 then
correctly exposes a scale of 0.00001 instead of 1.
Fixes: abea9c62c32f ("iio: hid-sensor-magn-3d: Add support for rotation from north")
Cc: stable@vger.kernel.org
Signed-off-by: Maximilian Czirr <maxx-cz@web.de>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -38,6 +38,8 @@ static const struct {
{HID_USAGE_SENSOR_COMPASS_3D, 0, 0, 1000000},
{HID_USAGE_SENSOR_COMPASS_3D, HID_USAGE_SENSOR_UNITS_GAUSS, 1, 0},
+ {HID_USAGE_SENSOR_ORIENT_COMP_MAGN_NORTH, 0, 1, 0},
+
{HID_USAGE_SENSOR_INCLINOMETER_3D, 0, 0, 17453293},
{HID_USAGE_SENSOR_INCLINOMETER_3D,
HID_USAGE_SENSOR_UNITS_DEGREES, 0, 17453293},
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0974/1005] iio: hid-sensors: fix fractional part for unit exponents -7 and -8
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (972 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0973/1005] iio: hid-sensor: Fix scale for magnetic north heading Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0975/1005] iio: humidity: am2315: fix negative temperature decoding Greg Kroah-Hartman
` (24 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Srinivas Pandruvada, Semyon Maryasin,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
commit 79c8dffd84e9784ec05bea68dbe5e71f7ec9941a upstream.
split_micro_fraction() scales the remainder to micro units by
multiplying it by 10^(6 - exp). The unit exponent of a HID field goes
down to -8, so exp can be 7 or 8 here. Then the argument of int_pow()
is negative, which the unsigned parameter turns into a huge power of
ten: 0 modulo 2^64. As a result, the fractional part of a value read
from the hysteresis attributes is always reported as 0.
Divide by 10^(exp - 6) in these two cases. This matches the reverse
conversion in convert_to_vtf_format().
Fixes: 73c6768b710a ("iio: hid-sensors: Common attribute and trigger")
Cc: stable@vger.kernel.org
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: Semyon Maryasin <simeon@maryasin.name>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -98,9 +98,14 @@ static void simple_div(int dividend, int
static void split_micro_fraction(unsigned int no, int exp, int *val1, int *val2)
{
int divisor = int_pow(10, exp);
+ unsigned int rem;
*val1 = no / divisor;
- *val2 = no % divisor * int_pow(10, 6 - exp);
+ rem = no % divisor;
+ if (exp > 6)
+ *val2 = rem / (unsigned int)int_pow(10, exp - 6);
+ else
+ *val2 = rem * int_pow(10, 6 - exp);
}
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0975/1005] iio: humidity: am2315: fix negative temperature decoding
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (973 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0974/1005] iio: hid-sensors: fix fractional part for unit exponents -7 and -8 Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0976/1005] iio: humidity: hid-sensor-humidity: Use per-instance callbacks Greg Kroah-Hartman
` (23 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Vidhu Sarwal, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vidhu Sarwal <vidhu.linux@gmail.com>
commit 0a570feeca37d85fbfd6b4f6e3d9f33e1461c634 upstream.
The AM2315/AM2320 report temperature as a sign-magnitude value,
with bit 15 as the sign and bits 14-0 as the magnitude.
am2315_read_data() stores the raw value directly in an s16, causing
negative temperatures to be interpreted as two's complement. Both the
read_raw and the triggered buffer paths are affected.
Decode the sign bit before storing the temperature value. Positive
readings are unaffected.
Fixes: 366a3270c1c5 ("iio: humidity: Add support for AM2315")
Signed-off-by: Vidhu Sarwal <vidhu.linux@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/humidity/am2315.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/drivers/iio/humidity/am2315.c
+++ b/drivers/iio/humidity/am2315.c
@@ -113,6 +113,7 @@ static int am2315_read_data(struct am231
*/
u8 rx_buf[8];
u16 crc;
+ u16 temp_raw;
/* First wake up the device. */
am2315_ping(data->client);
@@ -144,8 +145,15 @@ static int am2315_read_data(struct am231
sensor_data->hum_data = (rx_buf[AM2315_HUM_OFFSET] << 8) |
rx_buf[AM2315_HUM_OFFSET + 1];
- sensor_data->temp_data = (rx_buf[AM2315_TEMP_OFFSET] << 8) |
- rx_buf[AM2315_TEMP_OFFSET + 1];
+
+ /*
+ * Temperature is sign-magnitude, not two's complement:
+ * bit 15 is the sign, bits 14-0 are the magnitude (x0.1 degC).
+ */
+ temp_raw = (rx_buf[AM2315_TEMP_OFFSET] << 8) |
+ rx_buf[AM2315_TEMP_OFFSET + 1];
+ sensor_data->temp_data = (temp_raw & 0x8000) ?
+ -(temp_raw & 0x7fff) : temp_raw;
return ret;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0976/1005] iio: humidity: hid-sensor-humidity: Use per-instance callbacks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (974 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0975/1005] iio: humidity: am2315: fix negative temperature decoding Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0977/1005] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change Greg Kroah-Hartman
` (22 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christopher Hoover, Joshua Crofts,
Srinivas Pandruvada, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christopher Hoover <ch@murgatroid.com>
commit bbe4f3f668babc9443fc1f075695e43e17ca7976 upstream.
hid-sensor-humidity keeps a single static struct
hid_sensor_hub_callbacks for all instances and overwrites its pdev in
every probe, so with two humidity sensors, input reports for one are
delivered with the other's platform device, and a NULL dereference
follows once that device is removed. The same bug was found in
hid-sensor-temperature, which shares this code.
Keep the callbacks in struct hid_humidity_state, as the other HID
sensor drivers (accel, gyro, als, ...) do.
Fixes: d7ed89d5aadf ("iio: hid: Add humidity sensor support")
Cc: stable@vger.kernel.org
Signed-off-by: Christopher Hoover <ch@murgatroid.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/humidity/hid-sensor-humidity.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/drivers/iio/humidity/hid-sensor-humidity.c
+++ b/drivers/iio/humidity/hid-sensor-humidity.c
@@ -15,6 +15,7 @@
struct hid_humidity_state {
struct hid_sensor_common common_attributes;
struct hid_sensor_hub_attribute_info humidity_attr;
+ struct hid_sensor_hub_callbacks callbacks;
struct {
s32 humidity_data;
aligned_s64 timestamp;
@@ -184,11 +185,6 @@ static int humidity_parse_report(struct
return ret;
}
-static struct hid_sensor_hub_callbacks humidity_callbacks = {
- .send_event = &humidity_proc_event,
- .capture_sample = &humidity_capture_sample,
-};
-
/* Function to initialize the processing for usage id */
static int hid_humidity_probe(struct platform_device *pdev)
{
@@ -240,9 +236,13 @@ static int hid_humidity_probe(struct pla
platform_set_drvdata(pdev, indio_dev);
- humidity_callbacks.pdev = pdev;
+ humid_st->callbacks = (struct hid_sensor_hub_callbacks) {
+ .send_event = humidity_proc_event,
+ .capture_sample = humidity_capture_sample,
+ .pdev = pdev,
+ };
ret = sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY,
- &humidity_callbacks);
+ &humid_st->callbacks);
if (ret)
goto error_remove_trigger;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0977/1005] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (975 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0976/1005] iio: humidity: hid-sensor-humidity: Use per-instance callbacks Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0978/1005] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes Greg Kroah-Hartman
` (21 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
commit 4a141623442888458d147f4e61fe47411c0e4e17 upstream.
For getting all odr change events, we need to parse all FIFO frames
in each iio device. Fix this correctly by sending effectively all
frames to all iio devices.
Previously only batches of frames containing a matching sensor event
were sent to the corresponding iio device.
Fixes: f670d4d34773 ("iio: imu: inv_icm42600: fix odr change not caught in certain cases")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 24 ++++++++-------------
1 file changed, 10 insertions(+), 14 deletions(-)
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
@@ -550,22 +550,20 @@ int inv_icm42600_buffer_fifo_parse(struc
ts = &gyro_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.watermark.eff_gyro,
st->timestamp.gyro);
- ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
- if (ret)
- return ret;
}
+ ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
+ if (ret)
+ return ret;
+
/* handle accelerometer timestamp and FIFO data parsing */
if (st->fifo.nb.accel > 0) {
ts = &accel_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.watermark.eff_accel,
st->timestamp.accel);
- ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
- if (ret)
- return ret;
}
- return 0;
+ return inv_icm42600_accel_parse_fifo(st->indio_accel);
}
int inv_icm42600_buffer_hwfifo_flush(struct inv_icm42600_state *st,
@@ -590,20 +588,18 @@ int inv_icm42600_buffer_hwfifo_flush(str
if (st->fifo.nb.gyro > 0) {
ts = &gyro_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.nb.gyro, gyro_ts);
- ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
- if (ret)
- return ret;
}
+ ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
+ if (ret)
+ return ret;
+
if (st->fifo.nb.accel > 0) {
ts = &accel_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.nb.accel, accel_ts);
- ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
- if (ret)
- return ret;
}
- return 0;
+ return inv_icm42600_accel_parse_fifo(st->indio_accel);
}
int inv_icm42600_buffer_init(struct inv_icm42600_state *st)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0978/1005] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (976 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0977/1005] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0979/1005] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times Greg Kroah-Hartman
` (20 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jean-Baptiste Maneyrol,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit e5f7a6684a23d9b20184a81b4ebded3b3504ccdc upstream.
inv_mpu_magn_get_scale() returns st->magn_raw_to_gauss[chan->address],
where magn_raw_to_gauss[] holds one coefficient per axis, computed in
inv_magn_init() from the per-axis factory sensitivity adjustment values
(ASAX, ASAY, ASAZ) of the AK8975/AK8963 magnetometer.
However INV_MPU9X50_MAGN_CHAN() never sets .address, so it is 0 for all
three magnetometer channels. As a result the Y and Z channels report the
scale computed from the X axis adjustment value, and userspace scales
the Y and Z readings with the wrong per-axis calibration.
Set .address to the axis index (0 for X, 1 for Y, 2 for Z) in the
channel macro, matching the order used to fill magn_raw_to_gauss[].
Fixes: b1392de06184 ("iio: imu: inv_mpu6050: add MPU925x magnetometer support")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -1574,6 +1574,8 @@ static const unsigned long inv_mpu_scan_
.type = IIO_MAGN, \
.modified = 1, \
.channel2 = _chan2, \
+ /* index of the axis in magn_raw_to_gauss[] */ \
+ .address = (_chan2) - IIO_MOD_X, \
.info_mask_separate = BIT(IIO_CHAN_INFO_SCALE) | \
BIT(IIO_CHAN_INFO_RAW), \
.scan_index = _index, \
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0979/1005] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (977 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0978/1005] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0980/1005] iio: imu: kmx61: reject duplicate event disable Greg Kroah-Hartman
` (19 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jean-Baptiste Maneyrol,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit 3a5e2ca34cadd9d5993064884aa5b9c4f6d71dff upstream.
struct inv_mpu6050_hw declares startup_time as { accel, gyro }, but
every entry of hw_info[] initializes it positionally as
{ *_GYRO_STARTUP_TIME, *_ACCEL_STARTUP_TIME }, so the two values are
swapped for all chips.
inv_mpu6050_switch_engine() waits for startup_time.gyro after enabling
the gyroscope, so it waits for the accelerometer startup time instead,
e.g. 20 ms instead of 60 ms on MPU6050 and 20 ms instead of 100 ms on
ICM20602, and the first gyroscope samples can be read before the sensor
has settled. Enabling only the accelerometer waits longer than needed.
Use designated initializers, so each value is assigned to the member it
is named after.
Fixes: e46a36d92da0 ("Add startup time for each chip using inv_mpu6050 driver")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 95 +++++++++++++++++++++++------
1 file changed, 76 insertions(+), 19 deletions(-)
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -149,7 +149,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6500_WHOAMI_VALUE,
@@ -158,7 +161,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6515_WHOAMI_VALUE,
@@ -167,7 +173,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6880_WHOAMI_VALUE,
@@ -176,7 +185,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 4096,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6000_WHOAMI_VALUE,
@@ -185,7 +197,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9150_WHOAMI_VALUE,
@@ -194,7 +209,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9250_WHOAMI_VALUE,
@@ -203,7 +221,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9255_WHOAMI_VALUE,
@@ -212,7 +233,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20608_WHOAMI_VALUE,
@@ -221,7 +245,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20608D_WHOAMI_VALUE,
@@ -230,7 +257,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20609_WHOAMI_VALUE,
@@ -239,7 +269,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20689_WHOAMI_VALUE,
@@ -248,7 +281,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20600_WHOAMI_VALUE,
@@ -257,7 +293,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 1008,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20602_GYRO_STARTUP_TIME, INV_ICM20602_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20602_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20602_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20602_WHOAMI_VALUE,
@@ -266,7 +305,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 1008,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20602_GYRO_STARTUP_TIME, INV_ICM20602_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20602_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20602_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20690_WHOAMI_VALUE,
@@ -275,7 +317,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20690_GYRO_STARTUP_TIME, INV_ICM20690_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20690_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20690_GYRO_STARTUP_TIME,
+ },
},
{ .whoami = INV_IAM20380_WHOAMI_VALUE,
.name = "IAM20380",
@@ -283,7 +328,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_IAM20680_WHOAMI_VALUE,
@@ -292,7 +340,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_IAM20680HP_WHOAMI_VALUE,
@@ -301,7 +352,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_IAM20680HT_WHOAMI_VALUE,
@@ -310,7 +364,10 @@ static const struct inv_mpu6050_hw hw_in
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
};
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0980/1005] iio: imu: kmx61: reject duplicate event disable
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (978 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0979/1005] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0981/1005] iio: inv_sensors: do not compute period estimation when updating odr Greg Kroah-Hartman
` (18 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
commit 9a60b35fe45801d45454e1efe90569c9cc6ea736 upstream.
The IIO core does not filter duplicate writes to the event enable
attribute. kmx61_write_event_config() already ignores repeated enable
requests, but a repeated disable request still calls
kmx61_set_power_state(data, false, KMX61_ACC), dropping a runtime PM
reference that was not acquired for this request. This can underflow the
runtime PM usage count and trigger a "Runtime PM usage count underflow"
warning.
Return early when the requested state already matches ev_enable_state.
Fixes: fd3ae7a9f21c ("iio: imu: kmx61: Add support for any motion trigger")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/imu/kmx61.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/imu/kmx61.c
+++ b/drivers/iio/imu/kmx61.c
@@ -939,7 +939,7 @@ static int kmx61_write_event_config(stru
struct kmx61_data *data = kmx61_get_data(indio_dev);
int ret = 0;
- if (state && data->ev_enable_state)
+ if (state == data->ev_enable_state)
return 0;
guard(mutex)(&data->lock);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0981/1005] iio: inv_sensors: do not compute period estimation when updating odr
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (979 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0980/1005] iio: imu: kmx61: reject duplicate event disable Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0982/1005] iio: inv_sensors: prevent timestamps going back in time in transitions Greg Kroah-Hartman
` (17 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
commit 0d695709ed380f1bc9303a91f57525d33766a07e upstream.
When odr is updated, the delta between the interrupts will change and it
will lead to a bad period estimation.
Avoid this by preventing the period estimation in this case.
Fixes: 82bd09ce4fd3 ("iio: inv_sensors: improve period measurement by using a longer delay")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/common/inv_sensors/inv_sensors_timestamp.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -142,6 +142,12 @@ void inv_sensors_timestamp_interrupt(str
/* update delta timestamps and estimated period */
it = &ts->delta;
ts->delta_counter += sample_nb;
+ /* reset in case of odr change */
+ if (ts->new_mult) {
+ it->lo = 0;
+ it->up = 0;
+ ts->delta_counter = 0;
+ }
delta = timestamp - it->up;
delta_threshold = INV_SENSORS_TIMESTAMP_MIN(INV_SENSORS_MIN_IT_DELTA, ts->chip.jitter);
if (delta >= delta_threshold) {
@@ -161,7 +167,7 @@ void inv_sensors_timestamp_interrupt(str
it->lo = it->up;
it->up = timestamp;
delta = it->up - it->lo;
- if (it->lo != 0) {
+ if (it->lo != 0 && !ts->new_mult) {
/* compute period and check validity */
period = div_s64(delta, sample_nb);
valid = inv_validate_period(ts, period);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0982/1005] iio: inv_sensors: prevent timestamps going back in time in transitions
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (980 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0981/1005] iio: inv_sensors: do not compute period estimation when updating odr Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0983/1005] iio: light: tsl2591: dont divide by zero Greg Kroah-Hartman
` (16 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
commit 3785dffc7c68751a8429ae6dd75804c14a5a7c7a upstream.
Ensure when computing first timestamp and when applying odr change,
that the next timestamp will not be lower than the previous one.
This way there is no risk to have a timestamp going back in time, meaning
being lower than the previous one. It already can never happen without
a transition because we are generating timestamps by adding the period
to the last timestamp.
Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/common/inv_sensors/inv_sensors_timestamp.c | 16 ++++++++++++----
include/linux/iio/common/inv_sensors_timestamp.h | 3 ++-
2 files changed, 14 insertions(+), 5 deletions(-)
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -133,10 +133,15 @@ void inv_sensors_timestamp_interrupt(str
return;
/* no previous data, compute theoretical value from interrupt */
- if (ts->timestamp == 0) {
+ if (!ts->init) {
/* elapsed time: sensor period * sensor samples number */
interval = (s64)ts->period * (s64)sample_nb;
- ts->timestamp = timestamp - interval;
+ delta = timestamp - interval;
+ /* prevent next timestamp to be lower than the last one */
+ if ((delta + ts->period) > ts->timestamp)
+ ts->timestamp = delta;
+ ts->init = true;
+
}
/* update delta timestamps and estimated period */
@@ -190,7 +195,7 @@ void inv_sensors_timestamp_apply_odr(str
u32 fifo_period, size_t fifo_nb,
unsigned int fifo_no)
{
- s64 interval;
+ s64 interval, timestamp;
u32 fifo_mult;
if (ts->new_mult == 0)
@@ -213,7 +218,10 @@ void inv_sensors_timestamp_apply_odr(str
fifo_period = fifo_mult * ts->chip_period.val;
/* computes time interval between interrupt and this sample */
interval = (s64)(fifo_nb - fifo_no) * (s64)fifo_period;
- ts->timestamp = ts->it.up - interval;
+ timestamp = ts->it.up - interval;
+ /* prevent next timestamp to be lower than current one */
+ if ((timestamp + ts->period) > ts->timestamp)
+ ts->timestamp = timestamp;
}
}
EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_apply_odr, "IIO_INV_SENSORS_TIMESTAMP");
--- a/include/linux/iio/common/inv_sensors_timestamp.h
+++ b/include/linux/iio/common/inv_sensors_timestamp.h
@@ -66,6 +66,7 @@ struct inv_sensors_timestamp {
u32 new_mult;
u32 period;
struct inv_sensors_timestamp_acc chip_period;
+ bool init;
};
void inv_sensors_timestamp_init(struct inv_sensors_timestamp *ts,
@@ -94,7 +95,7 @@ static inline void inv_sensors_timestamp
ts->it = interval_init;
ts->delta = interval_init;
ts->delta_counter = 0;
- ts->timestamp = 0;
+ ts->init = false;
}
#endif
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0983/1005] iio: light: tsl2591: dont divide by zero
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (981 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0982/1005] iio: inv_sensors: prevent timestamps going back in time in transitions Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0984/1005] iio: light: vcnl4035: Fix reversed ALS mode bit Greg Kroah-Hartman
` (15 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Martin Triska, Andy Shevchenko,
Jan Remes, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Remes <jan.remes@mycroftmind.com>
commit bd63c89aac5672f40cdc123a856493b628fc1abb upstream.
The TSL2591 has two raw light channels - CH0 and CH1. The algorithm for
calculating illumination from the raw channels requires division by CH0
(which can be zero) and by "counts per lux" (CPL) value which is also zero
for (gain = LOW, integration time <= 400 ms).
Furthermore, the algorithm assumes CH0 > CH1, which can be violated in
almost complete darkness.
As a result, reading from 'in_illuminance_input' results in
division-by-zero whenever CH0 is 0 (complete darkness) or whenever the
parameters result in CPL being zero. This results in kernel oops on
x86_64 and in reading the value as 0 on arm64.
Fix that by:
- reporting CH0 <= CH1 as zero (catches also CH0 = 0)
- updating the lux algorithm to only do the division at the end
Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation")
Cc: stable@vger.kernel.org
Reported-by: Martin Triska <martin.triska@mycroftmind.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jan Remes <jan.remes@mycroftmind.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/light/tsl2591.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
--- a/drivers/iio/light/tsl2591.c
+++ b/drivers/iio/light/tsl2591.c
@@ -16,6 +16,7 @@
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
+#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/pm_runtime.h>
@@ -362,6 +363,10 @@ static int tsl2591_wait_adc_complete(str
* Scale values to get more representative value of lux i.e.
* lux = ((C0DATA - C1DATA) * (1000 - ((C1DATA * 1000) / C0DATA))) / CPL
*
+ * CPL is not computed on its own: at 1x gain it is below 1 for integration
+ * times under 500 ms, so the division by LUX DF is folded into the final
+ * division instead.
+ *
* Channel 0 = IR + Visible
* Channel 1 = IR only
*/
@@ -373,8 +378,10 @@ static int tsl2591_read_channel_data(str
struct tsl2591_als_settings *settings = &chip->als_settings;
struct i2c_client *client = chip->client;
u8 als_data[TSL2591_NUM_DATA_REGISTERS];
- int counts_per_lux, int_time_fval, gain_multi, lux;
+ int int_time_fval, gain_multi;
u16 als_ch0, als_ch1;
+ u64 lux;
+ u32 rem;
int ret;
ret = tsl2591_wait_adc_complete(chip);
@@ -410,23 +417,28 @@ static int tsl2591_read_channel_data(str
return gain_multi;
}
- int_time_fval = TSL2591_FVAL_TO_MSEC(settings->als_int_time);
- /* Calculate counts per lux value */
- counts_per_lux = (int_time_fval * gain_multi) / TSL2591_LUX_COEFFICIENT;
+ /* No visible light, this also catches C0DATA == 0 */
+ if (als_ch0 <= als_ch1) {
+ *val = 0;
+ *val2 = 0;
+ break;
+ }
- dev_dbg(&client->dev, "Counts Per Lux: %d\n", counts_per_lux);
+ int_time_fval = TSL2591_FVAL_TO_MSEC(settings->als_int_time);
/* Calculate lux value */
- lux = ((als_ch0 - als_ch1) *
- (1000 - ((als_ch1 * 1000) / als_ch0))) / counts_per_lux;
+ lux = (u64)(als_ch0 - als_ch1) *
+ (1000 - ((als_ch1 * 1000) / als_ch0)) *
+ TSL2591_LUX_COEFFICIENT;
+ lux = div_u64(lux, int_time_fval * gain_multi);
- dev_dbg(&client->dev, "Raw lux calculation: %d\n", lux);
+ dev_dbg(&client->dev, "Raw lux calculation: %llu\n", lux);
/* Divide by 1000 to get real lux value before scaling */
- *val = lux / 1000;
+ *val = div_u64_rem(lux, 1000, &rem);
/* Get the decimal part of lux reading */
- *val2 = (lux - (*val * 1000)) * 1000;
+ *val2 = rem * 1000;
break;
default:
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0984/1005] iio: light: vcnl4035: Fix reversed ALS mode bit
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (982 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0983/1005] iio: light: tsl2591: dont divide by zero Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0985/1005] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Greg Kroah-Hartman
` (14 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Sarmanow, Nuno Sá,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Sarmanow <as@discnull.de>
commit 6bcabc30b89f31e2925647d1ffa5a0e4b7919829 upstream.
According to the datasheet (table 2) the ALS_SD bit behaves the opposite
way the current ALS mode defines are set, writing 0 powers the sensor
and writing 1 shuts it down.
The current driver thinks the ALS is up while it's actually shut down
and it's down when the systems powers it up.
Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035")
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Sarmanow <as@discnull.de>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/light/vcnl4035.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/iio/light/vcnl4035.c
+++ b/drivers/iio/light/vcnl4035.c
@@ -44,8 +44,8 @@
#define VCNL4035_DEV_ID_MASK GENMASK(7, 0)
/* Default values */
-#define VCNL4035_MODE_ALS_ENABLE BIT(0)
-#define VCNL4035_MODE_ALS_DISABLE 0x00
+#define VCNL4035_MODE_ALS_ENABLE 0x00
+#define VCNL4035_MODE_ALS_DISABLE BIT(0)
#define VCNL4035_MODE_ALS_INT_ENABLE BIT(1)
#define VCNL4035_MODE_ALS_INT_DISABLE 0
#define VCNL4035_DEV_ID_VAL 0x80
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0985/1005] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (983 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0984/1005] iio: light: vcnl4035: Fix reversed ALS mode bit Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0986/1005] iio: magnetometer: mmc5633: " Greg Kroah-Hartman
` (13 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashank Mohan Jain <jain.sm@gmail.com>
commit 38e05cf38df705b7fa9e8ada931589fa96816f09 upstream.
mmc35240_resume() marks the register cache dirty and calls
regcache_sync_region() while the regmap is still in cache-only mode.
It calls regcache_cache_only(false) only after the sync. This
ordering has been wrong since the resume support was added; it happened
to work until regmap started rejecting a sync in cache-only mode.
Since commit afc8e3ee8307 ("regcache: Validate cache_only state in
regcache_sync_region()") a sync in cache-only mode is refused with a
WARN and -EINVAL. Every resume now gives
WARNING: drivers/base/regmap/regcache.c:536 at regcache_sync_region+0x1a4/0x1c0
...
mmc35240_resume+0x30/0x70
dpm_run_callback+0x7d/0x1c0
device_resume+0x175/0x270
...
mmc35240 1-0030: Failed to restore control registers
and the control registers are not written. If the chip lost its state
during suspend, it runs with the reset value of CTRL1 while the cache,
and with it the sampling frequency attribute, still has the configured
value. Writing the same frequency again does not repair this, because
regmap_update_bits() finds no difference to the cache.
Leave cache-only mode first, then mark the cache dirty and sync it.
Reproduced in qemu with the driver bound to an i2c-stub device: set
in_magn_sampling_frequency to 25 (CTRL1 = 0x02), clear CTRL0 and CTRL1
of the stub behind the driver's back to emulate the power loss, and run
a suspend/resume cycle with "devices" in /sys/power/pm_test. Without
this change CTRL1 is still 0x00 after resume and the warning is
printed. With it, and also with the regcache commit reverted, CTRL1 is
0x02 again and there is no warning. Not tested on real hardware.
Fixes: 553a776b7908 ("iio: magnetometer: mmc35240: Add PM sleep support")
Signed-off-by: Shashank Mohan Jain <jain.sm@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/magnetometer/mmc35240.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/iio/magnetometer/mmc35240.c
+++ b/drivers/iio/magnetometer/mmc35240.c
@@ -532,14 +532,13 @@ static int mmc35240_resume(struct device
struct mmc35240_data *data = iio_priv(indio_dev);
int ret;
+ regcache_cache_only(data->regmap, false);
regcache_mark_dirty(data->regmap);
ret = regcache_sync_region(data->regmap, MMC35240_REG_CTRL0,
MMC35240_REG_CTRL1);
if (ret < 0)
dev_err(dev, "Failed to restore control registers\n");
- regcache_cache_only(data->regmap, false);
-
return 0;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0986/1005] iio: magnetometer: mmc5633: leave cache-only mode before the cache sync
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (984 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0985/1005] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0987/1005] iio: magnetometer: tlv493d: fix magnetic field scale Greg Kroah-Hartman
` (12 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashank Mohan Jain <jain.sm@gmail.com>
commit c794a0a82fb189d98c635c5791c67c672ad80eb8 upstream.
mmc5633_resume() marks the register cache dirty and calls
regcache_sync_region() while the regmap is still in cache-only mode.
It calls regcache_cache_only(false) only after the sync. This
ordering has been wrong since the driver was added; it happened to work
until regmap started rejecting a sync in cache-only mode.
Since commit afc8e3ee8307 ("regcache: Validate cache_only state in
regcache_sync_region()") a sync in cache-only mode is refused with a
WARN and -EINVAL. Every resume now gives
WARNING: drivers/base/regmap/regcache.c:536 at regcache_sync_region+0x1a4/0x1c0
...
mmc5633_resume+0x2d/0x70
dpm_run_callback+0x7d/0x1c0
device_resume+0x175/0x270
...
mmc5633_i2c 1-0030: Failed to restore control registers
and the control registers are not written. If the chip lost its state
during suspend, it runs with the reset value of CTRL1 while the cache,
and with it the sampling frequency attribute, still has the configured
value. Writing the same frequency again does not repair this, because
regmap_update_bits() finds no difference to the cache.
Leave cache-only mode first, then mark the cache dirty and sync it.
Reproduced in qemu with the I2C driver bound to an i2c-stub device: set
in_magn_sampling_frequency to 3.5 (CTRL1 = 0x02), clear CTRL0 and CTRL1
of the stub behind the driver's back to emulate the power loss, and run
a suspend/resume cycle with "devices" in /sys/power/pm_test. Without
this change CTRL1 is still 0x00 after resume and the warning is
printed. With it, and also with the regcache commit reverted, CTRL1 is
0x02 again and there is no warning. Not tested on real hardware.
Fixes: 6e5f6bf2e3f0 ("iio: magnetometer: Add mmc5633 sensor")
Signed-off-by: Shashank Mohan Jain <jain.sm@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/magnetometer/mmc5633.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/iio/magnetometer/mmc5633.c b/drivers/iio/magnetometer/mmc5633.c
index f4dae7ba1335..b651f01e1b5d 100644
--- a/drivers/iio/magnetometer/mmc5633.c
+++ b/drivers/iio/magnetometer/mmc5633.c
@@ -499,13 +499,12 @@ static int mmc5633_resume(struct device *dev)
struct regmap *regmap = dev_get_regmap(dev, NULL);
int ret;
+ regcache_cache_only(regmap, false);
regcache_mark_dirty(regmap);
ret = regcache_sync_region(regmap, MMC5633_REG_CTRL0, MMC5633_REG_CTRL1);
if (ret)
dev_err(dev, "Failed to restore control registers\n");
- regcache_cache_only(regmap, false);
-
return 0;
}
--
2.56.1
^ permalink raw reply related [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0987/1005] iio: magnetometer: tlv493d: fix magnetic field scale
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (985 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0986/1005] iio: magnetometer: mmc5633: " Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0988/1005] iio: proximity: hx9023s: Allocate trigger before requesting IRQ Greg Kroah-Hartman
` (11 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Viral Patel, Joshua Crofts,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viral Patel <viral8854@gmail.com>
commit ef5c183a863bb69bf019a2d2ae0e1bfdaebe6222 upstream.
The TLV493D-A1B6 datasheet specifies a magnetic resolution of
98 uT/LSB (0.098 mT/LSB). IIO reports magnetic field in Gauss
(1 mT = 10 G), so the scale should be 0.98 G/LSB.
The driver currently reports 98/1000 = 0.098 G/LSB, which
under-reports the magnetic field by a factor of 10. The comment
also gives the resolution as 0.0098 mT (9.8 uT), mixing up units.
Correct the scale value and the comment.
Fixes: 106511d280c7 ("iio: magnetometer: add support for Infineon TLV493D 3D Magentic sensor")
Signed-off-by: Viral Patel <viral8854@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/magnetometer/tlv493d.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/iio/magnetometer/tlv493d.c
+++ b/drivers/iio/magnetometer/tlv493d.c
@@ -299,11 +299,11 @@ static int tlv493d_read_raw(struct iio_d
switch (chan->type) {
case IIO_MAGN:
/*
- * Magnetic field scale: 0.0098 mTesla (i.e. 9.8 µT)
- * Magnetic field in Gauss: mT * 10 = 0.098.
+ * Magnetic field scale: 0.098 mTesla (i.e. 98 µT) per LSB.
+ * In Gauss (1 mT = 10 G): 0.98 G per LSB.
*/
*val = 98;
- *val2 = 1000;
+ *val2 = 100;
return IIO_VAL_FRACTIONAL;
case IIO_TEMP:
/*
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0988/1005] iio: proximity: hx9023s: Allocate trigger before requesting IRQ
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (986 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0987/1005] iio: magnetometer: tlv493d: fix magnetic field scale Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0989/1005] iio: proximity: sx9324: fix out-of-bounds read of scan period table Greg Kroah-Hartman
` (10 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Joshua Crofts, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
commit bfa3b177d839bb303d0187335115b572a2644920 upstream.
An IRQ handler that already read trigger_enabled can poll data->trig
after buffer disable. Detaching the virtual IRQ does not join this
physical IRQ, and trigger deselection can drop the consumer reference.
Devres may then free the trigger before joining the handler.
Allocate the trigger before requesting the IRQ so devres joins the
handler before dropping the allocation reference.
This issue was identified as part of our ongoing research while
reviewing kernel code.
Fixes: 60df548277b7 ("iio: proximity: Add driver support for TYHX's HX9023S capacitive proximity sensor")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/proximity/hx9023s.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/drivers/iio/proximity/hx9023s.c
+++ b/drivers/iio/proximity/hx9023s.c
@@ -1133,14 +1133,6 @@ static int hx9023s_probe(struct i2c_clie
return dev_err_probe(dev, ret, "reg config failed\n");
if (client->irq) {
- ret = devm_request_threaded_irq(dev, client->irq,
- hx9023s_irq_handler,
- hx9023s_irq_thread_handler,
- IRQF_ONESHOT,
- "hx9023s_event", indio_dev);
- if (ret)
- return ret;
-
data->trig = devm_iio_trigger_alloc(dev, "%s-dev%d",
indio_dev->name,
iio_device_id(indio_dev));
@@ -1150,6 +1142,14 @@ static int hx9023s_probe(struct i2c_clie
data->trig->ops = &hx9023s_trigger_ops;
iio_trigger_set_drvdata(data->trig, indio_dev);
+ ret = devm_request_threaded_irq(dev, client->irq,
+ hx9023s_irq_handler,
+ hx9023s_irq_thread_handler,
+ IRQF_ONESHOT,
+ "hx9023s_event", indio_dev);
+ if (ret)
+ return ret;
+
ret = devm_iio_trigger_register(dev, data->trig);
if (ret)
return dev_err_probe(dev, ret,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0989/1005] iio: proximity: sx9324: fix out-of-bounds read of scan period table
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (987 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0988/1005] iio: proximity: hx9023s: Allocate trigger before requesting IRQ Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0990/1005] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
` (9 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Andy Shevchenko,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit 7b5f54280f8e6ef07664f6705dd005feefbe87d1 upstream.
The scan period of the SX9324 is selected by the 5 bit wide
SX9324_REG_GNRL_CTRL0_SCANPERIOD field, so it has 32 possible values.
sx9324_scan_period_table[] however only has 16 entries, it was copied
over from the SX9310 driver where the field is only 4 bits wide.
sx9324_wait_for_sample() indexes the table with the raw field value, so
all the codes from 16 to 31 read past the end of the array. The default
value of the register is SX9324_REG_GNRL_CTRL0_SCANPERIOD_100MS (0x16,
i.e. 22), so the out-of-bounds read happens with the default
configuration of the device. It is only avoided when the device has an
interrupt line, as the wait is only done in the polling case.
The value read is then used as the duration of an msleep() call, so the
sensor is polled with a completely random delay.
Fill the table with the scan periods of all 32 codes, which are the
periods documented for the corresponding sx9324_samp_freq_table[]
entries, and add a static assertion to keep both tables in sync.
Fixes: 4c18a890dff8 ("iio:proximity:sx9324: Add SX9324 support")
Cc: stable@vger.kernel.org
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/proximity/sx9324.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/drivers/iio/proximity/sx9324.c
+++ b/drivers/iio/proximity/sx9324.c
@@ -279,11 +279,20 @@ static const struct {
{ 0, 250000 }, /* 11111: 4 s */
};
+/*
+ * The scan period of the SX9324 is selected by the 5-bit wide
+ * SX9324_REG_GNRL_CTRL0_SCANPERIOD field. The values below are the scan
+ * periods in ms of the corresponding sx9324_samp_freq_table[] entries.
+ */
static const unsigned int sx9324_scan_period_table[] = {
- 2, 15, 30, 45, 60, 90, 120, 200,
- 400, 600, 800, 1000, 2000, 3000, 4000, 5000,
+ 1, 2, 4, 6, 8, 10, 14, 18, /* 0x00 - 0x07 */
+ 22, 26, 30, 34, 38, 42, 46, 50, /* 0x08 - 0x0f */
+ 56, 62, 68, 74, 80, 90, 100, 200, /* 0x10 - 0x17 */
+ 300, 400, 600, 800, 1000, 2000, 3000, 4000, /* 0x18 - 0x1f */
};
+static_assert(ARRAY_SIZE(sx9324_scan_period_table) == ARRAY_SIZE(sx9324_samp_freq_table));
+
static const struct regmap_range sx9324_writable_reg_ranges[] = {
/*
* To set COMPSTAT for compensation, even if datasheet says register is
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0990/1005] iio: proximity: sx9360: fix sampling frequency write and available range
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (988 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0989/1005] iio: proximity: sx9324: fix out-of-bounds read of scan period table Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0991/1005] iio: proximity: sx9500: ignore event config writes that dont change state Greg Kroah-Hartman
` (8 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit d252425c1533bfacd5940faa3371af82196bff5b upstream.
GNRL_CTRL1/2 hold the scan period in units of 8192 / FOSC, but
sx9360_set_samp_freq() computes freq * 8192 / FOSC and mis-scales val2,
which is in micro units. Any integer frequency then programs a period
of 0, and fractional parts above ~0.26 Hz overflow the int, writing
0x10 to GNRL_CTRL1 outside the SCANPERIOD field.
Compute FOSC / (freq * 8192), rounded to the closest value, and reject
frequencies outside the 1..2047 period range.
The available range doesn't match the limits in the comments next to it
either: 4 MHz / 8192 is 488.28125 Hz, not 448.28125 Hz,
4 MHz / (8192 * 2047) is 0.238535 Hz, and (max - min) / 2047 is
0.238419 Hz. Use those values.
Fixes: 1cdb4c47f7f5 ("iio:proximity:sx9360: Add sx9360 support")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/proximity/sx9360.c | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
--- a/drivers/iio/proximity/sx9360.c
+++ b/drivers/iio/proximity/sx9360.c
@@ -14,10 +14,12 @@
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/log2.h>
+#include <linux/math64.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/regmap.h>
+#include <linux/units.h>
#include <linux/iio/iio.h>
@@ -43,6 +45,7 @@
#define SX9360_REG_GNRL_CTRL1_SCANPERIOD_MASK GENMASK(2, 0)
#define SX9360_REG_GNRL_CTRL2 0x12
#define SX9360_REG_GNRL_CTRL2_PERIOD_102MS 0x32
+#define SX9360_REG_GNRL_SCANPERIOD_MAX GENMASK(10, 0)
#define SX9360_REG_GNRL_REG_2_PERIOD_MS(_r) \
(((_r) * 8192) / (SX9360_FOSC_HZ / 1000))
#define SX9360_REG_GNRL_FREQ_2_REG(_f) (((_f) * 8192) / SX9360_FOSC_HZ)
@@ -182,9 +185,9 @@ static const struct {
int val;
int val2;
} sx9360_samp_freq_interval[] = {
- { 0, 281250 }, /* 4MHz / (8192 * 2047) */
- { 0, 281250 },
- { 448, 281250 }, /* 4MHz / 8192 */
+ { 0, 238535 }, /* 4MHz / (8192 * 2047) */
+ { 0, 238419 },
+ { 488, 281250 }, /* 4MHz / 8192 */
};
static const struct regmap_range sx9360_writable_reg_ranges[] = {
@@ -383,11 +386,25 @@ static int sx9360_read_avail(struct iio_
static int sx9360_set_samp_freq(struct sx_common_data *data,
int val, int val2)
{
- int reg;
+ unsigned int period_ticks;
+ u64 freq_uHz;
__be16 buf;
- reg = val * 8192 / SX9360_FOSC_HZ + val2 * 8192 / (SX9360_FOSC_MHZ);
- buf = cpu_to_be16(reg);
+ if (val < 0 || val2 < 0)
+ return -EINVAL;
+
+ freq_uHz = (u64)val * MICROHZ_PER_HZ + val2;
+ if (!freq_uHz)
+ return -EINVAL;
+
+ /* The register holds the scan period in ticks of 8192 FOSC cycles. */
+ period_ticks = DIV64_U64_ROUND_CLOSEST((u64)SX9360_FOSC_HZ * MICROHZ_PER_HZ,
+ freq_uHz * 8192);
+ if (!period_ticks || period_ticks > SX9360_REG_GNRL_SCANPERIOD_MAX)
+ return -EINVAL;
+
+ buf = cpu_to_be16(period_ticks);
+
guard(mutex)(&data->mutex);
return regmap_bulk_write(data->regmap, SX9360_REG_GNRL_CTRL1, &buf,
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0991/1005] iio: proximity: sx9500: ignore event config writes that dont change state
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (989 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0990/1005] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0992/1005] iio: temperature: hid-sensor-temperature: Use per-instance callbacks Greg Kroah-Hartman
` (7 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit b8ed9165906597b69a46fabf39ab41690721ebe8 upstream.
sx9500_write_event_config() adjusts the channel and close/far user
counts on every write, even when the event is already in the requested
state. Writing 0 to a disabled event and then 1 leaves the counts at 0,
so the channel and its interrupts stay off while the event reads as
enabled. As channel_users[] is shared with raw reads, those can then
wait forever for a conversion. Writing 1 twice and then 0 has the
opposite effect.
Return early when the state doesn't change, as
sx_common_write_event_config() does.
Fixes: 4193c0f1d863 ("iio: driver for Semtech SX9500 proximity solution")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/proximity/sx9500.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/iio/proximity/sx9500.c
+++ b/drivers/iio/proximity/sx9500.c
@@ -548,6 +548,12 @@ static int sx9500_write_event_config(str
mutex_lock(&data->mutex);
+ /* The user counts must only change when the state does. */
+ if (data->event_enabled[chan->channel] == state) {
+ ret = 0;
+ goto out_unlock;
+ }
+
if (state) {
ret = sx9500_inc_chan_users(data, chan->channel);
if (ret < 0)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0992/1005] iio: temperature: hid-sensor-temperature: Use per-instance callbacks
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (990 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0991/1005] iio: proximity: sx9500: ignore event config writes that dont change state Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0993/1005] iio: temperature: mlx90614: Fix dual channel probe condition check Greg Kroah-Hartman
` (6 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christopher Hoover, Joshua Crofts,
Srinivas Pandruvada, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christopher Hoover <ch@murgatroid.com>
commit 36eeb26031e90eeb81bbac3d3acad61d23fcbdf3 upstream.
hid-sensor-temperature keeps a single static struct
hid_sensor_hub_callbacks for all instances and overwrites its pdev in
every probe. With two temperature sensors, input reports for one are
delivered with the other's platform device; once that device is
removed, platform_get_drvdata() returns NULL and
temperature_capture_sample() dereferences it:
BUG: kernel NULL pointer dereference, address: 00000000000003a8
RIP: 0010:temperature_capture_sample+0xd/0x50 [hid_sensor_temperature]
The oops happens in sensor_hub_raw_event() with the hub's spinlock
held, so the hub's removal then hangs. It reproduces with two uhid
devices that each declare a temperature sensor, one destroyed while
the other still sends input reports.
Keep the callbacks in struct temperature_state, as the other HID
sensor drivers (accel, gyro, als, ...) do.
Fixes: 59d0f2da3569 ("iio: hid: Add temperature sensor support")
Cc: stable@vger.kernel.org
Signed-off-by: Christopher Hoover <ch@murgatroid.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/temperature/hid-sensor-temperature.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/drivers/iio/temperature/hid-sensor-temperature.c
+++ b/drivers/iio/temperature/hid-sensor-temperature.c
@@ -15,6 +15,7 @@
struct temperature_state {
struct hid_sensor_common common_attributes;
struct hid_sensor_hub_attribute_info temperature_attr;
+ struct hid_sensor_hub_callbacks callbacks;
struct {
s32 temperature_data;
aligned_s64 timestamp;
@@ -181,11 +182,6 @@ static int temperature_parse_report(stru
return ret;
}
-static struct hid_sensor_hub_callbacks temperature_callbacks = {
- .send_event = &temperature_proc_event,
- .capture_sample = &temperature_capture_sample,
-};
-
/* Function to initialize the processing for usage id */
static int hid_temperature_probe(struct platform_device *pdev)
{
@@ -237,9 +233,13 @@ static int hid_temperature_probe(struct
platform_set_drvdata(pdev, indio_dev);
- temperature_callbacks.pdev = pdev;
+ temp_st->callbacks = (struct hid_sensor_hub_callbacks) {
+ .send_event = temperature_proc_event,
+ .capture_sample = temperature_capture_sample,
+ .pdev = pdev,
+ };
ret = sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE,
- &temperature_callbacks);
+ &temp_st->callbacks);
if (ret)
goto error_remove_trigger;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0993/1005] iio: temperature: mlx90614: Fix dual channel probe condition check
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (991 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0992/1005] iio: temperature: hid-sensor-temperature: Use per-instance callbacks Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0994/1005] iio: trigger: free the trigger ID after device_del() Greg Kroah-Hartman
` (5 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Salah Triki, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Salah Triki <salah.triki@gmail.com>
commit 4d4e75b3074bc29525c963a81c19471528f29a45 upstream.
In mlx90614_probe_num_ir_sensors(), the check on chip_info->dual_channel
is inverted.
Currently, if dual_channel is true (MLX90614), the function returns 0
immediately without checking op_eeprom_config1. This forces all MLX90614
devices to be registered as single sensor (num_channels = 2), making the
second object temperature channel inaccessible.
Conversely, if dual_channel is false (MLX90615), the function skips the
early return and performs an unnecessary SMBus read on EEPROM CONFIG1 even
though MLX90615 does not support dual channel operation.
Fix this by negating the condition so that single-channel chips return
early with 0, while dual-channel capable chips (MLX90614) proceed to read
the EEPROM configuration register to detect whether 1 or 2 object channels
are present.
Fixes: 3d5ead238bc8 ("iio: mlx90614: Factor our register IO and constants into model specific descriptor")
Signed-off-by: Salah Triki <salah.triki@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/temperature/mlx90614.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/iio/temperature/mlx90614.c
+++ b/drivers/iio/temperature/mlx90614.c
@@ -565,7 +565,7 @@ static int mlx90614_probe_num_ir_sensors
const struct mlx_chip_info *chip_info = data->chip_info;
s32 ret;
- if (chip_info->dual_channel)
+ if (!chip_info->dual_channel)
return 0;
ret = i2c_smbus_read_word_data(client, chip_info->op_eeprom_config1);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0994/1005] iio: trigger: free the trigger ID after device_del()
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (992 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0993/1005] iio: temperature: mlx90614: Fix dual channel probe condition check Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0995/1005] iio: trigger: Return an error when the trigger has no free irq Greg Kroah-Hartman
` (4 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Changyul Lee, Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Changyul Lee <lcy8047@gmail.com>
commit d32bf759801e6df23038dc834622a122ec76a4dd upstream.
iio_trigger_unregister() returns the trigger ID to iio_trigger_ida
before device_del() removes the "trigger<N>" device. A trigger
registered in between can get the same ID, and its device_add() fails:
sysfs: cannot create duplicate filename '/bus/iio/devices/trigger0'
For example, adding a sysfs trigger while an hrtimer trigger is being
removed through configfs, or the other way around, hits this because the
two paths do not share a lock.
Free the ID after device_del(), as the error path of
iio_trigger_register() already does, and drop the "Possible issue in
here" comment.
Fixes: 1637db44413e ("Staging: IIO: Trigger support added to core.")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/industrialio-trigger.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -105,9 +105,8 @@ void iio_trigger_unregister(struct iio_t
scoped_guard(mutex, &iio_trigger_list_lock)
list_del(&trig_info->list);
- ida_free(&iio_trigger_ida, trig_info->id);
- /* Possible issue in here */
device_del(&trig_info->dev);
+ ida_free(&iio_trigger_ida, trig_info->id);
}
EXPORT_SYMBOL(iio_trigger_unregister);
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0995/1005] iio: trigger: Return an error when the trigger has no free irq
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (993 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0994/1005] iio: trigger: free the trigger ID after device_del() Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0996/1005] fou: reserve headroom before pushing the encap header Greg Kroah-Hartman
` (3 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Joshua Crofts,
Jonathan Cameron
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
commit dff701806ab6252f6a0fccba880c47cd09602625 upstream.
iio_trigger_attach_poll_func() prints an error when all
CONFIG_IIO_CONSUMERS_PER_TRIGGER irqs of the trigger are in use, but
returns 0. The buffer of the extra consumer is enabled without a poll
function.
Disabling that buffer calls clear_bit() with a negative bit number and
drops a module reference for the second time. On arm and arm64 the
clear_bit() goes about 512 MB past the pool bitmap. That is an oops if
the address is not mapped, and a bit cleared in unrelated memory if it
is.
Return the error from iio_trigger_get_irq().
Fixes: 995438233579 ("iio: Fix error handling in iio_trigger_attach_poll_func")
Cc: stable@vger.kernel.org
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iio/industrialio-trigger.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -292,6 +292,7 @@ int iio_trigger_attach_poll_func(struct
if (pf->irq < 0) {
pr_err("Could not find an available irq for trigger %s, CONFIG_IIO_CONSUMERS_PER_TRIGGER=%d limit might be exceeded\n",
trig->name, CONFIG_IIO_CONSUMERS_PER_TRIGGER);
+ ret = pf->irq;
goto out_put_module;
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0996/1005] fou: reserve headroom before pushing the encap header
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (994 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0995/1005] iio: trigger: Return an error when the trigger has no free irq Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0997/1005] blk-mq: take quiesce_lock when removing a queue from the tag set Greg Kroah-Hartman
` (2 subsequent siblings)
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye,
Theodor Arsenij Larionov Trichkine, Ido Schimmel, Jakub Kicinski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
commit bcb42672751a8786dce871a35bde363b041cb2f7 upstream.
ip_tunnel_xmit() and ip_md_tunnel_xmit() push the encap header before
reserving headroom. A packet redirected into the tunnel (tc mirred, nft
fwd/dup) keeps the headroom of its original device, so fou_build_udp()
panics:
kernel BUG at net/core/skbuff.c:214!
Call Trace:
skb_push+0xcc/0xf0
fou_build_udp+0x2f/0x380
gue_build_header+0xfa/0x150
ip_tunnel_xmit+0x87f/0x21c0
With a mirred mirror, the push overwrites the original packet instead.
Reachable with CAP_NET_ADMIN in a user namespace.
Reserve the headroom in fou_build_header() and gue_build_header(); GUE
sizes and builds the header from one copy of the encap fields. The skb
head may move, so reload inner_iph after ip_tunnel_encap() and read
tnl_params, which points into the head for GRE with header_ops, before
the call. sit's ipip6_tunnel_xmit() holds no head pointer across it.
Fixes: 56328486539d ("net: Changes to ip_tunnel to support foo-over-udp encapsulation")
Fixes: ac931d4cdec3 ("ipip,ip_tunnel,sit: Add FOU support for externally controlled ipip devices")
Reported-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Closes: https://lore.kernel.org/netdev/20260801060115.3538849-1-nicoyip.dev@gmail.com/
Cc: stable@vger.kernel.org
Signed-off-by: Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261116113845.166280-1-theodorlarionov@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/fou_core.c | 19 +++++++++++++++----
net/ipv4/ip_tunnel.c | 6 ++++--
2 files changed, 19 insertions(+), 6 deletions(-)
--- a/net/ipv4/fou_core.c
+++ b/net/ipv4/fou_core.c
@@ -1071,6 +1071,9 @@ static int fou_build_header(struct sk_bu
__be16 sport;
int err;
+ if (skb_cow_head(skb, fou_encap_hlen(e)))
+ return -ENOMEM;
+
err = __fou_build_header(skb, e, protocol, &sport, type);
if (err)
return err;
@@ -1083,16 +1086,24 @@ static int fou_build_header(struct sk_bu
static int gue_build_header(struct sk_buff *skb, struct ip_tunnel_encap *e,
u8 *protocol, struct flowi4 *fl4)
{
- int type = e->flags & TUNNEL_ENCAP_FLAG_CSUM ? SKB_GSO_UDP_TUNNEL_CSUM :
- SKB_GSO_UDP_TUNNEL;
+ struct ip_tunnel_encap encap = {
+ .flags = READ_ONCE(e->flags),
+ .sport = READ_ONCE(e->sport),
+ .dport = READ_ONCE(e->dport),
+ };
+ int type = encap.flags & TUNNEL_ENCAP_FLAG_CSUM ?
+ SKB_GSO_UDP_TUNNEL_CSUM : SKB_GSO_UDP_TUNNEL;
__be16 sport;
int err;
- err = __gue_build_header(skb, e, protocol, &sport, type);
+ if (skb_cow_head(skb, gue_encap_hlen(&encap)))
+ return -ENOMEM;
+
+ err = __gue_build_header(skb, &encap, protocol, &sport, type);
if (err)
return err;
- fou_build_udp(skb, e, fl4, protocol, sport);
+ fou_build_udp(skb, &encap, fl4, protocol, sport);
return 0;
}
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -604,6 +604,7 @@ void ip_md_tunnel_xmit(struct sk_buff *s
if (ip_tunnel_encap(skb, &tun_info->encap, &proto, &fl4) < 0)
goto tx_error;
+ inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
use_cache = ip_tunnel_dst_cache_usable(skb, tun_info);
if (use_cache)
@@ -747,6 +748,8 @@ void ip_tunnel_xmit(struct sk_buff *skb,
}
tos = tnl_params->tos;
+ df = tnl_params->frag_off;
+ ttl = tnl_params->ttl;
if (tos & 0x1) {
tos &= ~0x1;
if (payload_protocol == htons(ETH_P_IP)) {
@@ -765,6 +768,7 @@ void ip_tunnel_xmit(struct sk_buff *skb,
if (ip_tunnel_encap(skb, &tunnel->encap, &protocol, &fl4) < 0)
goto tx_error;
+ inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
if (connected && md) {
use_cache = ip_tunnel_dst_cache_usable(skb, tun_info);
@@ -797,7 +801,6 @@ void ip_tunnel_xmit(struct sk_buff *skb,
goto tx_error;
}
- df = tnl_params->frag_off;
if (payload_protocol == htons(ETH_P_IP) && !tunnel->ignore_df)
df |= (inner_iph->frag_off & htons(IP_DF));
@@ -819,7 +822,6 @@ void ip_tunnel_xmit(struct sk_buff *skb,
}
tos = ip_tunnel_ecn_encap(tos, inner_iph, skb);
- ttl = tnl_params->ttl;
if (ttl == 0) {
if (payload_protocol == htons(ETH_P_IP))
ttl = inner_iph->ttl;
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0997/1005] blk-mq: take quiesce_lock when removing a queue from the tag set
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (995 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0996/1005] fou: reserve headroom before pushing the encap header Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0998/1005] gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0999/1005] accel/ivpu: Defer recovery until probe completes Greg Kroah-Hartman
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mohamed Khalfella, Mani Tofigh,
Christoph Hellwig, Nilay Shroff, Jens Axboe
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mani Tofigh <mt4022@columbia.edu>
commit 495f22c5a99ac38e527294cdc4f3972718b9bee0 upstream.
Unquiescing a tag set can run the hw queues of a queue whose hctxs were
already freed. blk_mq_unquiesce_tagset() walks the tag set's queues
under quiesce_lock and rcu_read_lock(). Commit 71ec3c7d6db8 ("blk-mq:
quiesce a queue that joins a quiesced tag set") added quiesce_lock to
the walks and to adding a queue, but blk_mq_del_queue_tag_set() still
removes a queue without it. The hctxs are then freed right away since
RCU only keeps the request_queue itself alive:
Task A (controller reset) Task B (namespace removal)
blk_mq_unquiesce_tagset()
/* finds q */
blk_mq_del_queue_tag_set(q)
blk_mq_release(q)
/* frees the hctxs */
blk_mq_run_hw_queues(q)
/* reads freed hctxs */
The window is short. On PREEMPT_RT quiesce_lock is a sleeping lock and
the walk can be preempted inside it, which is how it's hit here:
[ 399.851277] BUG: KASAN: slab-use-after-free in blk_mq_run_hw_queues+0x4bd/0x550
[ 399.851328] Read of size 8 at addr ff11000003014148 by task kworker/u9:2/116
[ 399.851352] CPU: 1 UID: 0 PID: 116 Comm: kworker/u9:2 Not tainted 7.3.0-16299-g81cb9aa43246 #1 PREEMPT_RT
[ 399.851425] Workqueue: nvme-reset-wq nvme_loop_reset_ctrl_work
[ 399.851441] Call Trace:
[ 399.851457] <TASK>
[ 399.851551] blk_mq_run_hw_queues+0x4bd/0x550
[ 399.851564] blk_mq_unquiesce_tagset+0x128/0x210
[ 399.851576] nvme_loop_reset_ctrl_work+0x78/0x4c0
[ 399.851600] process_one_work+0x92b/0x16d0
[ 399.851660] worker_thread+0x4e6/0xd60
[ 399.851707] kthread+0x300/0x3e0
[ 399.851727] ret_from_fork+0x4f0/0x6f0
[ 399.851776] ret_from_fork_asm+0x1a/0x30
[ 399.851793] </TASK>
...
[ 399.851988] Freed by task 111:
[ 399.852040] kfree+0x1b3/0x4b0
[ 399.852050] blk_mq_release+0x400/0x550
[ 399.852060] blk_put_queue+0x94/0x120
[ 399.852068] disk_release+0x1bd/0x3f0
[ 399.852102] nvme_free_ns+0x39/0x270
[ 399.852113] nvme_remove_nsid_range+0x2d1/0x4a0
[ 399.852123] nvme_scan_ns_list+0x2cc/0x390
[ 399.852134] nvme_scan_work+0x421/0x9f0
...
With BLK_CGROUP the disk's root blkg holds the queue until a grace
period later, which hides this for NVMe namespaces. It's still open
without BLK_CGROUP, and from reading the code also for queues freed
without a disk (e.g., SCSI device queues on a UFS host).
Take quiesce_lock around the list_del_rcu() as well so that the walk
either finishes with a queue before it leaves the list or never sees
it, and say so in the comment of quiesce_lock. With the fix, KASAN
doesn't report the use-after-free anymore.
This bug was identified and confirmed with the help of a deterministic
hypervisor currently under development. The C reproducer below however
hits it about once every 20 minutes on a PREEMPT_RT kernel.
Fixes: 59e25ef2b413 ("block: Use RCU in blk_mq_[un]quiesce_tagset() instead of set->tag_list_lock")
Cc: stable@vger.kernel.org
Reviewed-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: Mani Tofigh <mt4022@columbia.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://patch.msgid.link/20261106-blk-mq-del-quiesce-lock-v2-1-cd4f72a6eb03@columbia.edu
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
block/blk-mq.c | 3 +++
include/linux/blk-mq.h | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4341,7 +4341,10 @@ static void blk_mq_del_queue_tag_set(str
lockdep_assert_held(&set->tag_list_lock);
+ /* blk_mq_unquiesce_tagset() runs the hctxs, which are not RCU freed */
+ spin_lock(&set->quiesce_lock);
list_del_rcu(&q->tag_set_list);
+ spin_unlock(&set->quiesce_lock);
if (list_is_singular(&set->tag_list)) {
/* just transitioned to unshared */
set->flags &= ~BLK_MQ_F_TAG_QUEUE_SHARED;
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -524,7 +524,8 @@ enum hctx_type {
* @tag_list: List of the request queues that use this tag set. See also
* request_queue.tag_set_list.
* @quiesce_lock: Serializes blk_mq_[un]quiesce_tagset() against each other
- * and against a request queue being added to @tag_list.
+ * and against a request queue being added to or removed from
+ * @tag_list.
* @quiesce_depth: How often blk_mq_quiesce_tagset() has been called without
* blk_mq_unquiesce_tagset().
* @srcu: Use as lock when type of the request queue is blocking
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0998/1005] gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (996 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0997/1005] blk-mq: take quiesce_lock when removing a queue from the tag set Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0999/1005] accel/ivpu: Defer recovery until probe completes Greg Kroah-Hartman
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hyunjung Ko, Bartosz Golaszewski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunjung Ko <hj351016@gmail.com>
commit f94f85f82e042c89a1e64ed3ff1d591a2bccfa7b upstream.
mpsse_read() reads min(len + 2, wMaxPacketSize) bytes and then copies
len_actual - 2 bytes to the caller. A device that declares a bulk-in
endpoint with wMaxPacketSize 1 completes the read with len_actual 1, so
the copy length becomes -1 and memcpy() runs far past the one byte
buffer on the caller's stack and past bulk_in_buf:
memcpy: detected buffer overflow: 18446744073709551615 byte write of buffer size 1
WARNING: lib/string_helpers.c:1036 at __fortify_report+0x6e/0xc0
Call Trace:
__fortify_panic+0xd/0x10
gpio_mpsse_get_multiple+0x767/0x780
gpio_mpsse_gpio_get+0xa2/0xf0
gpiod_get_raw_value_commit+0xf8/0x1f0
gpiod_get_value_cansleep+0x1e/0xa0
value_show+0x42/0x90
Reproduced with dummy_hcd and raw-gadget. A read needs room for the two
status bytes plus at least one data byte, so refuse to bind otherwise.
Fixes: c46a74ff05c0 ("gpio: add support for FTDI's MPSSE as GPIO")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
Link: https://patch.msgid.link/20261117104110.240112-1-hj351016@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpio-mpsse.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/gpio/gpio-mpsse.c
+++ b/drivers/gpio/gpio-mpsse.c
@@ -676,6 +676,10 @@ static int gpio_mpsse_probe(struct usb_i
if (err)
return err;
+ /* Every read carries two status bytes ahead of the data */
+ if (usb_endpoint_maxp(priv->bulk_in) < 3)
+ return -EINVAL;
+
priv->bulk_in_buf = devm_kmalloc(dev, usb_endpoint_maxp(priv->bulk_in),
GFP_KERNEL);
if (!priv->bulk_in_buf)
^ permalink raw reply [flat|nested] 1007+ messages in thread
* [PATCH 7.3 0999/1005] accel/ivpu: Defer recovery until probe completes
2026-11-25 14:22 [PATCH 7.3 0000/1005] 7.3.7-rc1 review Greg Kroah-Hartman
` (997 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 7.3 0998/1005] gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
998 siblings, 0 replies; 1007+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Daksh Sahni, Jeff Hugo,
Karol Wachowski
7.3-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karol Wachowski <karol.wachowski@linux.intel.com>
commit dc61b19db1f77deb4c15bb71e64f46071447837c upstream.
An error IRQ that fires after ivpu_boot() enables interrupts queues
recovery_work during probe. If probe then fails, the device is torn
down while the work runs, and the work faults on the unmapped BARs:
BUG: unable to handle page fault for address: ffffcfc6680200f4
Workqueue: events_unbound ivpu_pm_recovery_work [intel_vpu]
RIP: 0010:ivpu_hw_ip_ipc_rx_addr_get+0xc/0xb0 [intel_vpu]
Call Trace:
ivpu_wait_for_ready+0x155/0x220 [intel_vpu]
ivpu_boot+0x9e/0x270 [intel_vpu]
ivpu_resume+0xa4/0xd0 [intel_vpu]
ivpu_pm_reset_complete+0x2c/0x90 [intel_vpu]
ivpu_pm_recovery_work+0xf6/0x140 [intel_vpu]
If probe succeeds, the recovery runs concurrently with the rest of
probe, and its pm_runtime_disable() discards the initial autosuspend
request, leaving the NPU active until first use. Any recovery that
starts while the NPU is idle loses the pending autosuspend the same way.
Keep recovery_work disabled from ivpu_pm_init() until ivpu_pm_enable().
A trigger during probe still runs diagnostics and masks interrupts, and
ivpu_pm_enable() runs the deferred recovery before the initial
autosuspend request. A trigger racing with ivpu_pm_enable() can cause
a second, harmless recovery. Request autosuspend at the end of
ivpu_pm_reset_complete() so the NPU suspends again after every reset.
Fixes: 852be13f3bd3 ("accel/ivpu: Add PM support")
Cc: stable@vger.kernel.org # v6.10+
Reported-by: Daksh Sahni <swizzguy76@gmail.com>
Closes: https://lore.kernel.org/r/20261107174215.15818-1-swizzguy76@gmail.com
Tested-by: Daksh Sahni <swizzguy76@gmail.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20261110121534.3566028-1-karol.wachowski@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/accel/ivpu/ivpu_pm.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/drivers/accel/ivpu/ivpu_pm.c
+++ b/drivers/accel/ivpu/ivpu_pm.c
@@ -151,8 +151,8 @@ static void ivpu_pm_reset_complete(struc
up_write(&vdev->pm->reset_lock);
atomic_set(&vdev->pm->reset_pending, 0);
- pm_runtime_mark_last_busy(vdev->drm.dev);
pm_runtime_enable(vdev->drm.dev);
+ pm_request_autosuspend(vdev->drm.dev);
}
static void ivpu_pm_recovery_work(struct work_struct *work)
@@ -416,6 +416,7 @@ void ivpu_pm_init(struct ivpu_device *vd
atomic_set(&pm->engine_reset_counter, 0);
INIT_WORK(&pm->recovery_work, ivpu_pm_recovery_work);
+ disable_work(&pm->recovery_work);
INIT_DELAYED_WORK(&pm->job_timeout_work, ivpu_job_timeout_work);
if (ivpu_disable_recovery)
@@ -440,6 +441,12 @@ void ivpu_pm_enable(struct ivpu_device *
{
struct device *dev = vdev->drm.dev;
+ enable_work(&vdev->pm->recovery_work);
+ if (atomic_read(&vdev->pm->reset_pending)) {
+ queue_work(system_dfl_wq, &vdev->pm->recovery_work);
+ flush_work(&vdev->pm->recovery_work);
+ }
+
pm_runtime_allow(dev);
pm_runtime_put_autosuspend(dev);
}
^ permalink raw reply [flat|nested] 1007+ messages in thread
end of thread, other threads:[~2026-11-25 15:32 UTC | newest]
Thread overview: 1007+ 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 0357/1005] perf: Fix racy update of cpc->hrtimer_interval 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 0360/1005] cpufreq: Serialize global boost updates Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0361/1005] sched_ext: Reset task fields on exit of an SCX_TASK_READY task Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0362/1005] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0363/1005] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0364/1005] netlink: Do not call the unbind callback with the table locked Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0365/1005] net: ethernet: ti: am65-cpts: keep port and direction when matching PTPv1 TX timestamps Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0366/1005] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum 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:28 ` [PATCH 7.3 0382/1005] drm/xe/guc: Protect timeout handling from device unplug Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0383/1005] drm/xe/gt: Disable GT reset worker before engine teardown Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0384/1005] drm/xe/pcode: match argument naming with PCODE_DATAx Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0385/1005] drm/xe/pcode: Increase default pcode mailbox timeout to 10ms Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0386/1005] drm/xe/hwmon: Use shared pcode default timeout for power limit write Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0387/1005] drm/xe/hwmon: Fix pcode power limit handling Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0388/1005] drm/xe/hwmon: Decode mailbox temperature as sign-magnitude Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0389/1005] drm/xe/hwmon: Fix thermal sensor data handling Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0390/1005] drm/xe/hwmon: Add helpers to validate thermal sensor readings Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0391/1005] drm/xe/hwmon: Handle unavailable memory controller sensors Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0392/1005] drm/xe/tuning: Restrict Anyhit NULL-query tuning to render engines Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0393/1005] drm/xe/gsc: Fix NVL-S GSC compatibility number Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0394/1005] drm/xe/lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2 Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0395/1005] drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0396/1005] drm/xe/gt: Use GT ordered workqueue for wedging Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0397/1005] drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0398/1005] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0399/1005] drm/xe/pci_error: Flush GT wedge worker before bus reset Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0400/1005] drm/xe: Rebind BOs evicted before the first LR queue Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 7.3 0401/1005] drm/xe: Toggle the D3Cold enable flag at runtime resume Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0402/1005] drm/xe: Access GT MMIO after pcode init Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0403/1005] drm/xe/xe_late_bind_fw: Fix firmware leak on missing manifest entry Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0404/1005] drm/xe/svm: Preserve default PAT index when resetting VMA attributes Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0405/1005] drm/xe/guc: Fix race around q->guc->suspend_pending access Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0406/1005] drm/xe/guc: Do not attribute a TDR disable to a pending suspend Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0407/1005] gpiolib: fix GPIO descriptor leak in gpiod_get_array() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0408/1005] gpiolib: fix fast-path cancellation " Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0409/1005] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0410/1005] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0411/1005] ASoC: qcom: common: Add generic headset jack helpers Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0412/1005] ASoC: qcom: x1e80100: recreate the headset jack on card rebind Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0413/1005] drm/panfrost: Enable cycle counting when perfcnt is enabled Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0414/1005] ASoC: amd: ps: guard adata->sdw dereferences with NULL check in IRQ handler Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0415/1005] ASoC: SOF: amd: " Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0416/1005] cgroup/cpuset: Reset partition data when an invalid partition stays invalid Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0417/1005] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0418/1005] btrfs: zoned: only change active zone counter on successful (de)activation Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0419/1005] btrfs: zoned: fix possible UAF in wait_eb_writebacks() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0420/1005] btrfs: zoned: requeue block group if zone reset bails out Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0421/1005] btrfs: zoned: dont wait for ordered extents in do_zone_finish() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0422/1005] btrfs: zoned: fix lockdep splat on mount Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0423/1005] btrfs: zstd: prevent leak of workspace below maximum level Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0424/1005] btrfs: handle zero num_stripes in btrfs_chunk_item_size() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0425/1005] tcp: rate limit receive queue collapsing Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0426/1005] ASoC: es9356: fix the capture gain dB scale Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0427/1005] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0428/1005] NFS: honor UTIME_NOW atime with explicit mtime Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0429/1005] NFS: update ctime for atime-only UTIME_NOW requests Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0430/1005] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0431/1005] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0432/1005] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0433/1005] sunrpc: instantiate rpc_pipefs dentry before publishing it Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0434/1005] SUNRPC: preserve fatal network errors during RPC binding Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0435/1005] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0436/1005] SUNRPC: preserve transport security " Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0437/1005] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0438/1005] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0439/1005] NFS/localio: hold the client across an asynchronous LOCALIO probe Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0440/1005] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0441/1005] net: skbuff: preserve fclone lifetime when freeing stolen heads Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0442/1005] xsk: fix list corruption in xsk_buff_add_frag() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0443/1005] i40e: xsk: fix xsk_buff_add_frag() error handling in Rx Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0444/1005] ice: xsk: fix leaking Rx buffers in multi-buffer path Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0445/1005] ice: xsk: do not free in-flight frags on XDP_TX completion Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0446/1005] libeth: " Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0447/1005] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0448/1005] ice: xsk: free stashed Rx frame when cleaning the ring Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0449/1005] idpf: free stashed XSk Rx frame when releasing the queue Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0450/1005] net: usb: lan78xx: resume phylink on non-reset USB resume Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0451/1005] net: raw: fix ICMP unreachable sent when receive queue is full Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0452/1005] spi: virtio: move teardown to .remove() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0453/1005] af_unix: Convert unsigned long to u64 for GC Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0454/1005] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0455/1005] net/mlx5: Bridge, fix bogus MDB offload errors Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0456/1005] ipv6: ignore link state in gateway check Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0457/1005] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0458/1005] net: octeontx2: fix building without DEBUGFS Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0459/1005] net/mlx5: Use only loaded devices for PTP clock operations Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0460/1005] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 7.3 0461/1005] net: protect negative destination advice with RCU Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0462/1005] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0463/1005] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0464/1005] wifi: mac80211_hwsim: use CLOCK_BOOTTIME for the beacon timer Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0465/1005] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0466/1005] wifi: mac80211: abort chanswitch when leaving an IBSS Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0467/1005] net: fix mac_len of skbs copied by generic XDP Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0468/1005] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0469/1005] net: mana: fix XDP_REDIRECT of pre-allocated RX buffers Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0470/1005] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0471/1005] sched_ext: Fix partial-SMT core counting in calc_shard_layout() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0472/1005] cgroup/cpuset: Protect current->mems_allowed read in cpuset_fork() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0473/1005] NFS: dont let delegated c/mtime stamps go backward Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0474/1005] NFS: stamp after the servers ctime when truncating under delegated times Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0475/1005] NFS: stamp after the servers ctime following a CLONE Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0476/1005] NFSv4: wake blocking lock waiters when a delegated lock is released Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0477/1005] NFSv4: remember that the server may send CB_NOTIFY_LOCK Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0478/1005] sched_ext: Add scx_bpf_dsq_reenq_task() to re-enqueue single tasks from a DSQ iteration Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0479/1005] sched_ext: make DSQ iterator stay drained after NULL Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0480/1005] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0481/1005] fbnic: Fix service task races with ndo_stop and PM suspend Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0482/1005] fbnic: Disable PTP completions during the Tx force-flush Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0483/1005] fbnic: Suspend phylink after taking the datapath down in ndo_stop Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0484/1005] fbnic: Wait for the outbound flush to complete on mailbox teardown Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0485/1005] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0486/1005] NFSv4/flexfiles: Reference the device node across DS setup Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0487/1005] NFSv4/flexfiles: Hold a device node reference for layoutstats encoding Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0488/1005] NFSv4/flexfiles: Make the pinned device node pointer RCU-managed Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0489/1005] SUNRPC: add request-scoped disconnects when cancelling tasks Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0490/1005] NFSv4/flexfiles: limit transport disconnects when cancelling I/O Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0491/1005] net/mlx5: E-switch, Restore host PF enable for ECPF that isnt E-switch manager Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0492/1005] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0493/1005] dpll: notify about a reference sync pair only if it was added Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0494/1005] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0495/1005] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0496/1005] net: skbuff: uncharge trimmed zerocopy frags on error Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0497/1005] net/mlx5e: Release IPsec root table reference on RX setup failure Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0498/1005] net/mlx5e: Serialize ipsec encap reservations with eswitch operations Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0499/1005] net/mlx5e: Take HCA devcom lock before esw->mode_lock Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0500/1005] net/mlx5e: Fix E-Switch races in uplink unbind Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0501/1005] net/mlx5e: Fix ipsec core device access during profile changes Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0502/1005] net/mlx5e: Block E-Switch mode changes during IPsec policy creation Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0503/1005] net/mlx5e: Block E-Switch mode changes during IPsec state creation Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0504/1005] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0505/1005] net: Fix memory_allocated leak in __sk_mem_raise_allocated() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0506/1005] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0507/1005] tcp: Do not allow buggy transitions between ehash and lhash2 Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0508/1005] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0509/1005] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0510/1005] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0511/1005] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0512/1005] ASoC: apple: mca: Fix clock selection for clock consumer FEs Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0513/1005] drm/i915/psr: Flush on cursor update also when not using Selective Fetch Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0514/1005] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0515/1005] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0516/1005] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0517/1005] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0518/1005] erofs: reset buf->off in erofs_init_metabuf() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0519/1005] tcp: Clear DEFER_CONNECT before tcp_connect() and in tcp_abort() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0520/1005] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 7.3 0521/1005] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0522/1005] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0523/1005] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0524/1005] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0525/1005] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0526/1005] net/mlx5: HWS, fix flow meter release on FTE update Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0527/1005] drm/xe/pm: Apply tile workarounds after PCODE initialization Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0528/1005] drm/xe/guc: Demote uncorrectable local error log on CRI Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0529/1005] drm/xe/pf: Program LMTT directory pointer from each GTs init path Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0530/1005] drm/xe: Sync Wa_16023105232 in xe_was to match OOB rule Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0531/1005] ALSA: hda/realtek - remove headphone MIC support for Dell Pro QC1255 Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0532/1005] ALSA: hda/realtek: Update quirk for Acer Predator PHN16-72 Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0533/1005] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0534/1005] net: Make PSP skb extension survive packet scrubbing Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0535/1005] sched_ext: Reject DSQ iterator kfuncs in tracing programs Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0536/1005] ice: dpll: serialize changes of the SyncE CGU registers Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0537/1005] ice: dpll: set the SyncE divider only for the port driving the output Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0538/1005] net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0539/1005] udp_tunnel: dont treat IPv4 sockets bound to an address as wildcard Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0540/1005] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0541/1005] net: virtio: fix UDP tunnel GSO header of VLAN tagged packets Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0542/1005] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0543/1005] af_unix: Inherit SO_INQ in unix_stream_connect() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0544/1005] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0545/1005] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0546/1005] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0547/1005] net/mlx5e: Rename state_destroy to rx_mode_active in flow steering Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0548/1005] net/mlx5e: Fix false WARN_ON_ONCE in flow steering cleanup on RX init failure Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0549/1005] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0550/1005] tls: Break the connection after a burst of empty data records Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0551/1005] tls: Consume empty data records in tls_sw_splice_read() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0552/1005] selftests: tls: Skip the zero_len tests when TLS is unavailable Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0553/1005] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0554/1005] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0555/1005] docs, kprobes: Fix bracket Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0556/1005] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0557/1005] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0558/1005] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0559/1005] cpuset: generalize the validate_partition() interface Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0560/1005] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0561/1005] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0562/1005] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0563/1005] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0564/1005] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0565/1005] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0566/1005] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0567/1005] Revert "ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2" Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0568/1005] ALSA: hda/realtek: Fix the Dell XPS 8940 headset microphone Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0569/1005] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0570/1005] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0571/1005] selftests/ftrace: Add missing spaces after ! in probe syntax tests Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0572/1005] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0573/1005] kprobes: Fix error return and slot leak in __register_kprobe() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0574/1005] kprobes: Fix double free and NULL deref in unregister_kretprobes() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0575/1005] kprobes: Validate re-registration earlier in register_kretprobe() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0576/1005] mmc: jz4740: Remove the host before resetting the controller Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0577/1005] mmc: sdhci-brcmstb: dont log an error for missing BOOT registers Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0578/1005] mmc: sunxi: fix clock and runtime PM leaks on probe failure Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0579/1005] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0580/1005] mmc: omap: synchronize clock timer before disabling fclk Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 7.3 0581/1005] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0582/1005] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0583/1005] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0584/1005] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0585/1005] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0586/1005] memstick: core: dont clear dev->driver in memstick_device_remove() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0587/1005] errseq: dont let errseq_check_and_advance() hide later errors Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0588/1005] backing-file: pass RWF_NOAPPEND to synchronous writes Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0589/1005] pidfd: restrict task access ioctls to the callers pid namespace Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0590/1005] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0591/1005] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0592/1005] fs: fix the SEEK_CUR f_lock condition Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0593/1005] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0594/1005] libfs: make i_rwsem the lock of the offset tree Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0595/1005] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0596/1005] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0597/1005] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0598/1005] mm: page_frag: refill the cache for large fragments Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0599/1005] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0600/1005] mm/mmzone: read each zoneref slot once when filtering by nodemask Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0601/1005] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0602/1005] mm: page_isolation: do not take slab pages for free Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0603/1005] mm/page_alloc: dont undo another isolation in alloc_contig_range Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0604/1005] mm/page_alloc: reset can_retry_reserves when the slowpath restarts Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0605/1005] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0606/1005] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0607/1005] mm/page_alloc: snapshot the preferred zone against shrink rebuilds Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0608/1005] mm/page_alloc: clear ->private of deferred free pages Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0609/1005] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0610/1005] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0611/1005] bootconfig: Trim unquoted values at end of file Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0612/1005] btrfs: fix bio counter and bioc leak when async checksumming fails Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0613/1005] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0614/1005] coda: honor the append state of each write Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0615/1005] entry: Complete syscall_enter_from_user_mode_work() to bool migration Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0616/1005] entry: Fix return type of syscall_trace_enter() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0617/1005] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0618/1005] liveupdate: check for duplicate session before growing block set Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0619/1005] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0620/1005] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0621/1005] net/mlx5e: Fix queue stats access to queues without stats Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0622/1005] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0623/1005] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0624/1005] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0625/1005] net/smc: fix link group ownership in handshake abort Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0626/1005] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0627/1005] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0628/1005] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0629/1005] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0630/1005] net: netns: fix INT_MAX nsid cleanup Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0631/1005] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0632/1005] net: usb: lan78xx: let unregister_netdev() stop phylink Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0633/1005] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0634/1005] xsk: defer software checksum until the skb is complete Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0635/1005] udf: dont allocate the inode block in udf_sync_inode_metadata() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0636/1005] vdso: Add VDSO_UNALIGNED_PACKED config option Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0637/1005] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0638/1005] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0639/1005] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0640/1005] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 7.3 0641/1005] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0642/1005] tcp: do not coalesce segments after FIN Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0643/1005] tcp: fix authentication bypass via unsupported TCP auth options Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0644/1005] tcp: fix request_sock use-after-free during Fast Open accept() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0645/1005] seg6: validate state in netfilter continuations Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0646/1005] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0647/1005] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0648/1005] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0649/1005] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0650/1005] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0651/1005] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0652/1005] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0653/1005] gtp: free the skb after handling an echo response Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0654/1005] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0655/1005] hv_sock: Report no unread data before a channel is available Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0656/1005] net: gro: avoid parsing headers from shared fragments Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0657/1005] net: gro: do not undo remote checksum offload on merged packets Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0658/1005] net: gro: invalidate frag0 after a pull Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0659/1005] netfilter: nf_dup: preserve guard across NFQUEUE reinjection Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0660/1005] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0661/1005] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0662/1005] netfs: preserve prepare_write errno on reissue Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0663/1005] netfs: keep the prepare_read errno when abandoning read retries Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0664/1005] netfs: dont hang a read whose retry is abandoned Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0665/1005] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0666/1005] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0667/1005] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0668/1005] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0669/1005] minix: add minix_inode_block() helper Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0670/1005] minix: dont read the inode block in minix_sync_inode_metadata() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0671/1005] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0672/1005] ntfs: check the file name against the key length of an index entry Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0673/1005] ntfs: do not read an index block outside $INDEX_ALLOCATION Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0674/1005] ntfs: open the index allocation before reading or writing an index block Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0675/1005] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0676/1005] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0677/1005] perf/hw_breakpoint: Clear stop state in hw_breakpoint_add() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0678/1005] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0679/1005] Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask" Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0680/1005] power: sequencing: pcie-m2: fix use-after-free in pwrseq_pcie_m2_vregs_enable() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0681/1005] power: sequencing: pcie-m2: fix serdev controller reference leak Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0682/1005] ASoC: qcom: q6asm: Reset PCM positions when preparing a stream Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0683/1005] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0684/1005] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0685/1005] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0686/1005] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0687/1005] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0688/1005] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0689/1005] cgroup/freezer: walk exiting tasks in the v1 freezer Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0690/1005] cgroup/freezer: Fix exiting tasks left frozen forever after rmdir Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0691/1005] cgroup: arm the notify timer only while the file exists Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0692/1005] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0693/1005] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0694/1005] dcache: let d_invalidate() wait for a d_set_mounted() in flight Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0695/1005] dcache: wait for a racing eviction of a secondary root Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0696/1005] dcache: let umount find a disconnected ex-mountpoint Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0697/1005] ext2: add ext2_inode_block() helper Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0698/1005] ext2: dont read the inode block in ext2_sync_inode_metadata() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0699/1005] ext4: use sb_find_get_block_nonatomic() in ext4_get_inode_loc_noio() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0700/1005] ext4: dont read the inode block in ext4_sync_inode_metadata() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 7.3 0701/1005] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0702/1005] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0703/1005] fs/splice: clamp an over-reported write_iter result Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0704/1005] fs: dont strand I_METADATA_WRITEBACK inodes outside the LRU Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0705/1005] arm64/gcs: Ignore attempts to change GCS mode during signal return Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0706/1005] arm64: errata: Extend the workaround for broken AMEVCNTR01 counter Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0707/1005] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0708/1005] arm64: hugetlb: Prevent write fault livelocks on stale TLB entries Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0709/1005] arm64: kexec_file: Do not use CMA for images with a non-zero text_offset Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0710/1005] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0711/1005] arm64: suspend: Save POR_EL0 over suspend Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0712/1005] arm64: suspend: Save GCS state " Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0713/1005] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0714/1005] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0715/1005] cpufreq: Improve suspend-resume synchronization Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0716/1005] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0717/1005] cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0718/1005] cpufreq: Force passing target frequency to driver during resume Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0719/1005] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0720/1005] cpufreq: Fix updates of cached resolved frequency and index Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0721/1005] software node: only let the owner release a managed node Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0722/1005] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0723/1005] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0724/1005] timekeeping: Reject cross timestamps for invalid AUX clocks Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0725/1005] timekeeping: Refresh auxiliary base before offset validation Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0726/1005] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0727/1005] tpm: Check return value of crypto_kpp_set_secret() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0728/1005] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0729/1005] tpm: flush timeout work outside buffer_mutex to avoid deadlock Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0730/1005] spi: axi-spi-engine: Start the program length at zero Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0731/1005] spi: tegra210-quad: Track DMA mapping state Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0732/1005] spi: tegra210-quad: Unmap DMA buffers on transfer timeout Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0733/1005] watchdog: gunyah_wdt: Re-enable the watchdog on resume Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0734/1005] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0735/1005] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0736/1005] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0737/1005] x86/CPU/AMD: Dont print reset reason in VMs Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0738/1005] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0739/1005] x86/video: Preserve the default VGA fallback for legacy modes Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0740/1005] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0741/1005] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0742/1005] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0743/1005] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0744/1005] kbuild: rust: support stabilized flag `-Cprofile-sample-use` for Rust >= 1.100 Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0745/1005] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0746/1005] hwmon: (gpio-fan) Fix runtime PM imbalance in probe and teardown Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0747/1005] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0748/1005] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0749/1005] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0750/1005] hwmon: (scmi) Enable temperature sensors using their sensor IDs Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0751/1005] hwmon: (scmi) Configure sensors before exposing channels Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0752/1005] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0753/1005] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0754/1005] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0755/1005] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0756/1005] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0757/1005] sched/deadline: Fix spurious -EPERM for migration-disabled tasks Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0758/1005] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0759/1005] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0760/1005] sched/core: Do not touch SMT siblings that have not joined the core yet Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 7.3 0761/1005] sched_ext: Fix stale pick when the donor changes during dispatch Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0762/1005] sched_ext: Factor out drain_offline_rq() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0763/1005] sched_ext: Read exit_kind before flushing in scx_flush_disable_work() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0764/1005] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0765/1005] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0766/1005] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0767/1005] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0768/1005] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0769/1005] sctp: reset stored flag for each association Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0770/1005] ksmbd: grant a caller what its groups and OWNER RIGHTS ACEs allow Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0771/1005] ksmbd: keep group denials when a POSIX ACL entry decides access Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0772/1005] ksmbd: refuse reauthentication of an expired session as another user Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0773/1005] LoongArch: BPF: Make arena support depend on 128-bit cmpxchg Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0774/1005] LoongArch: BPF: Make use of beqz and bnez for trampoline branches Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0775/1005] LoongArch: kexec_file: Fix a modified cmdline leak Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0776/1005] LoongArch: kexec_file: Fix elf_headers memory leak in retry loop Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0777/1005] LoongArch: Restore KFENCE pages through DMW on resume Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0778/1005] LoongArch: KVM: Clear device pointer in irqchip destroy callbacks Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0779/1005] LoongArch: KVM: Propagate real error code in kvm_pch_pic_create() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0780/1005] LoongArch: KVM: Reject repeated PCH-PIC CTRL_INIT Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0781/1005] tracing/perf: Clear stop state in perf_trace_add() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0782/1005] tracing/uprobes: Fix memory leak of tail in __trace_uprobe_create() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0783/1005] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0784/1005] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0785/1005] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0786/1005] tracing/probes: Enable newly appended probe when target event is enabled Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0787/1005] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0788/1005] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0789/1005] tracing/probes: Fix user-space dereference string array store type Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0790/1005] tracing/probes: Reject array count on non-dereference string sources Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0791/1005] wifi: ath12k: assign device id from the WSI index Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0792/1005] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0793/1005] wifi: mac80211_hwsim: ignore non-generic netlink releases Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0794/1005] wifi: nxpwifi: validate scan response TLV sizes before indexed access Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0795/1005] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0796/1005] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0797/1005] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0798/1005] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0799/1005] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0800/1005] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0801/1005] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0802/1005] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0803/1005] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0804/1005] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0805/1005] wifi: mac80211: fix use-after-free on TTLM disconnect Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0806/1005] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0807/1005] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0808/1005] ksmbd: evaluate the DACL in order for explicit access requests Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0809/1005] gpio: aspeed: Clear only the acked lines G4 interrupt status Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0810/1005] gpio: aspeed: Preserve the pending G7 interrupt status on control writes Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0811/1005] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0812/1005] gpio: keep the chip reference when deferred setup fails Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0813/1005] gpio: of: fix potential misconfiguration of hogged lines Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0814/1005] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0815/1005] gpio: sa1100: defer GPIO chip registration to postcore_initcall Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0816/1005] gpio: shared: fix a race in shared desc release path Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0817/1005] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0818/1005] gpio: virtuser: fix interrupt leak and UAF Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0819/1005] gpio: virtuser: remove the debugfs files before freeing the line data Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0820/1005] gpiolib: fix stack out-of-bounds access in gpiochip_add_hog() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 7.3 0821/1005] gpiolib: synchronize updates of descriptor labels Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0822/1005] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0823/1005] ovl: do not read the flags of a put upper dentry in lookup Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0824/1005] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0825/1005] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0826/1005] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0827/1005] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0828/1005] ovl: bump the impure dir version when linking a file with origin Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0829/1005] ovl: do not allow nfs_export with data-only layers Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0830/1005] ovl: do not check the deferred lowerdata redirect on index lookup Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0831/1005] ovl: follow lower to lowerdata redirects from any lower layer Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0832/1005] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0833/1005] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0834/1005] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0835/1005] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0836/1005] smb: client: fix double conversion of DFS path in setup_dfs_ref() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0837/1005] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0838/1005] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0839/1005] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0840/1005] smb: client: hold server ref while queueing reconnect work Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0841/1005] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0842/1005] smb: client: issue writes from a worker if the task is dying Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0843/1005] smb: client: let umount -f abort retried reads and writes Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0844/1005] smb: client: retry writeback on interrupts and allocation failures Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0845/1005] smb: client: retry writes that couldnt be issued due to a reconnect Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0846/1005] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0847/1005] smb: client: validate descriptor headers before query result allocation Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0848/1005] smb: client: dont give up writeback on the first replayable error Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0849/1005] smb: client: dont retry failed writes forever regardless of mount options Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0850/1005] smb: client: dont spend read retries on reads cut short by a reconnect Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0851/1005] smb: client: dont write back through O_DIRECT handles Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0852/1005] dm log userspace: drop the device reference on error Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0853/1005] dm: avoid double-dropping the zone reset submission reference Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0854/1005] dm: fail a REQ_PREFLUSH bio with data when its preflush fails Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0855/1005] dm: fix infinite loop in dm_blk_do_report_zones() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0856/1005] dm: fix use-after-free when dm_get_device() widens the open mode Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0857/1005] dm: Reject table setup after queue or disk teardown Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0858/1005] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0859/1005] dm cache: validate the discard block size before narrowing Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0860/1005] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0861/1005] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0862/1005] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0863/1005] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0864/1005] dm-pcache: do not advance dirty_tail after backing flush failure Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0865/1005] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0866/1005] dm-verity: dont restart or panic on errors during system shutdown Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0867/1005] dm persistent data: test return value of node_copy Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0868/1005] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0869/1005] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0870/1005] dm snapshot: fix discard_granularity unit in snapshot_io_hints Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0871/1005] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0872/1005] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0873/1005] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0874/1005] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0875/1005] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0876/1005] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0877/1005] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0878/1005] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0879/1005] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0880/1005] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 7.3 0881/1005] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0882/1005] dm-raid: fix use-after-free in raid_dtr() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0883/1005] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0884/1005] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0885/1005] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0886/1005] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0887/1005] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0888/1005] comedi: fix endless recursion in comedi_event() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0889/1005] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0890/1005] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0891/1005] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0892/1005] iio: accel: adxl380: dont stay in standby on -EINVAL Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0893/1005] iio: adc: ad7923: add the AD7927 to the SPI ID table Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0894/1005] iio: adc: check the result of ad_sd_init() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0895/1005] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0896/1005] iio: hid-sensors: fix a division by zero Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0897/1005] iio: sx9310: use the data of the I2C table Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0898/1005] mei: lb: read the MTU once Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0899/1005] mei: me: add ice lake point LP iTouch DID Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0900/1005] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0901/1005] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0902/1005] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0903/1005] serial: 8250_exar: check priv->gpio properly Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0904/1005] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0905/1005] serial: 8250_mxpcie: handle hangup during break Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0906/1005] serial: core: respect runtime PM when sending x_char Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0907/1005] serial: fsl_lpuart: fix tty ref of wakeup event Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0908/1005] serial: imx: fix the tty reference of the " Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0909/1005] serial: rda: free the interrupt on shutdown Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0910/1005] serial: samsung: dont leak the tty on an RX IRQ Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0911/1005] serial: samsung: put the previous baud clock Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0912/1005] thunderbolt: stream: Undo more if the start fails Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0913/1005] tty: fix misapplied compat_ptr() in tty_compat_ioctl() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0914/1005] USB: cdc-acm: fix NULL-deref on hangup Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0915/1005] usb: pci-quirks: always assert xHCI OS ownership Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0916/1005] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0917/1005] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0918/1005] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0919/1005] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0920/1005] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0921/1005] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0922/1005] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0923/1005] usb: typec: ucsi: debugfs: Fix GET commands on UCSI < 2.0 Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0924/1005] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0925/1005] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0926/1005] usb: xhci: clear stale bandwidth data after hibernation Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0927/1005] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0928/1005] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0929/1005] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0930/1005] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0931/1005] usb: gadget: u_serial: pin ports while TTYs are installed Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0932/1005] usb: dwc3: trace: Restore request name assignment Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0933/1005] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0934/1005] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0935/1005] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0936/1005] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0937/1005] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0938/1005] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0939/1005] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0940/1005] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 7.3 0941/1005] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0942/1005] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0943/1005] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0944/1005] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0945/1005] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0946/1005] w1: ds28e04: " Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0947/1005] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0948/1005] w1: remove the masters files before taking its locks Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0949/1005] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0950/1005] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0951/1005] drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0952/1005] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0953/1005] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0954/1005] USB: serial: sierra: validate URB length in instat callback Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0955/1005] USB: serial: upd78f0730: fix NULL-deref on hangup Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0956/1005] USB: serial: io_edgeport: fix NULL-deref on early status Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0957/1005] USB: serial: io_edgeport: fix potential close() use-after-free Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0958/1005] USB: serial: io_edgeport: fix potential NULL-deref at open Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0959/1005] USB: serial: io_edgeport: move initial termios update to open() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0960/1005] USB: serial: io_edgeport: fix potential fifo corruption Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0961/1005] USB: serial: io_edgeport: fix potential use-after-free on disconnect Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0962/1005] USB: serial: io_edgeport: serialise MCR accesses Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0963/1005] dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0964/1005] iio: accel: adxl313: add missing buffer selections in Kconfig Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0965/1005] iio: accel: kxsd9: Fix potential use-after-free on removal Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0966/1005] iio: acpi: Accept comma separated values in ROTM strings Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0967/1005] iio: adc: aspeed: Use syscon phandle for trimming data when available Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0968/1005] iio: afe: rescale: expose offset if rescaler or source has one Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0969/1005] iio: atlas-ezo: Fix humidity channel read support Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0970/1005] iio: common: scmi_sensors: fix truncating 64-bit divisions Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0971/1005] iio: dac: mcp4725: Update the cached DAC value only on success Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0972/1005] iio: gyro: bmg160: reject duplicate event disable Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0973/1005] iio: hid-sensor: Fix scale for magnetic north heading Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0974/1005] iio: hid-sensors: fix fractional part for unit exponents -7 and -8 Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0975/1005] iio: humidity: am2315: fix negative temperature decoding Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0976/1005] iio: humidity: hid-sensor-humidity: Use per-instance callbacks Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0977/1005] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0978/1005] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0979/1005] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0980/1005] iio: imu: kmx61: reject duplicate event disable Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0981/1005] iio: inv_sensors: do not compute period estimation when updating odr Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0982/1005] iio: inv_sensors: prevent timestamps going back in time in transitions Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0983/1005] iio: light: tsl2591: dont divide by zero Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0984/1005] iio: light: vcnl4035: Fix reversed ALS mode bit Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0985/1005] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0986/1005] iio: magnetometer: mmc5633: " Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0987/1005] iio: magnetometer: tlv493d: fix magnetic field scale Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0988/1005] iio: proximity: hx9023s: Allocate trigger before requesting IRQ Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0989/1005] iio: proximity: sx9324: fix out-of-bounds read of scan period table Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0990/1005] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0991/1005] iio: proximity: sx9500: ignore event config writes that dont change state Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0992/1005] iio: temperature: hid-sensor-temperature: Use per-instance callbacks Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0993/1005] iio: temperature: mlx90614: Fix dual channel probe condition check Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0994/1005] iio: trigger: free the trigger ID after device_del() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0995/1005] iio: trigger: Return an error when the trigger has no free irq Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0996/1005] fou: reserve headroom before pushing the encap header Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0997/1005] blk-mq: take quiesce_lock when removing a queue from the tag set Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0998/1005] gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 7.3 0999/1005] accel/ivpu: Defer recovery until probe completes Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox