* [PATCH 6.12 000/816] 6.12.120-rc1 review
@ 2026-11-25 14:25 Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 001/816] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
` (820 more replies)
0 siblings, 821 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 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 6.12.120 release.
There are 816 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:37:39 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.120-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 6.12.120-rc1
Christian Loehle <christian.loehle@arm.com>
cpufreq: Preserve global boost state on failed updates
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
power: sequencing: qcom-wcn: fix bluetooth-wifi copypasta for WCN6855
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: clear stale buf->page after recycling on skb build failure
Pascal Kneuper <PKneuper@dspace.de>
net: stmmac: restore NET_IP_ALIGN in the RX DMA offset
Furong Xu <0x1207@gmail.com>
net: stmmac: Apply new page pool parameters when SPH is enabled
Daniel Gomez <da.gomez@samsung.com>
radix-tree: add missing cleanup.h
Kuniyuki Iwashima <kuniyu@google.com>
tcp: Set unhashed_state in inet_twsk_hashdance_schedule().
Stefano Garzarella <sgarzare@redhat.com>
9p: fix privport option setting wrong RDMA field
Pierre Barre <pierre@barre.sh>
9p: fix access mode flags being ORed instead of replaced
Sasha Levin <sashal@kernel.org>
9p: fix memory leak in v9fs_init_fs_context error path
Luiz Capitulino (Red Hat) <luiz.capitulino@linux.dev>
powerpc/watchdog: disable watchdog when watchdog_thresh=0
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
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
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: proximity: sx9324: fix out-of-bounds read of scan period table
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
Jiale Yao <yaojiale02@163.com>
iio: imu: kmx61: reject duplicate event disable
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
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
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
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
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: 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
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
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
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>
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: 8250_lpss: don't divide by 0 above 6.25 Mbaud
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
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: 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: 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
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
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
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
Joseph Qi <joseph.qi@linux.alibaba.com>
smb: client: skip NULL channel in __cifs_put_smb_ses()
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()
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
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: 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
Giuseppe Scrivano <giuseppe@scrivano.org>
ovl: do not always clear absolute_redirect
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
Cunhao Lu <1579567540@qq.com>
gpio: rockchip: Fix debounce arithmetic for GPIO v2
Guangshuo Li <lgs201920130244@gmail.com>
gpio: brcmstb: fix UAF after IRQ domain setup failure
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: bound pending OCB station allocations
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211: bound pending IBSS station allocations
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
Mehmet Fide <mehmet.fide@screeningeagle.com>
wifi: ath9k_htc: do not start ANI before the first channel is set
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: 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()
Mike Rapoport (Microsoft) <rppt@kernel.org>
LoongArch: Restore KFENCE pages through DMW on resume
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
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) 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
Rupesh Majhi <zoone.rupert@gmail.com>
hwmon: (aht10) Fix update_interval overflow on 64-bit
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
Dave Hansen <dave.hansen@linux.intel.com>
x86/mm: Ensure write visibility during LDT installation
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
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: Cache post-resolution target frequency in __resolve_freq()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: intel_pstate: Clear last written P-state value on suspend
Li RongQing <lirongqing@baidu.com>
cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()
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
Beata Michalska <beata.michalska@arm.com>
arm64: errata: Add Cortex-A715/A720 AMU core counter workaround
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()
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
Ridong Chen <chenridong@xiaomi.com>
cgroup/cpuset: Don't revive invalid partition without active CPU on hotplug
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
Baoli Zhang <baoli.zhang@linux.intel.com>
ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
PM: runtime: Update last_busy in rpm_resume() for active devices
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()
Tim Menninger <tmenninger@everpuredata.com>
NFSv4: Prevent indefinite waits for out-of-order OPEN stateids
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
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
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
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
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
tcp: fix authentication bypass via unsupported TCP auth options
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
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 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
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
Jean-Paul Sergent <jpsergent@gmail.com>
net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp
Hungyu Lin <dennylin0707@gmail.com>
coda: honor the append state of each write
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
Josef Bacik <josef@toxicpanda.com>
mm/memory_hotplug: resize zones under their seqlock
Gregory Price (Meta) <gourry@gourry.net>
mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()
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()
Avi Weiss <thnkslprpt@gmail.com>
splice, net: avoid MSG_MORE when the bvec array fills
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
Chris Mason <mason@kernel.org>
backing-file: pass RWF_NOAPPEND to synchronous writes
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
Anfernee Cao <anferneemelokc5@gmail.com>
mmc: mmci: fix DMA channel leak when mmc_add_host() fails
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
Gichoon Han <gichoon.han@samsung.com>
ALSA: usb-audio: Drop capture packets with bogus actual_length
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
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
David Carlier <devnexen@gmail.com>
tracing/eprobe: Install the trigger for every instance that enables the eprobe
Eric Dumazet <edumazet@kernel.org>
tun: clear stale skb->protocol of NAPI frags skbs
Jakub Kicinski <kuba@kernel.org>
eth: bnxt: don't leak buffers when XDP agg buffer allocation fails
Naman Gulati <namangulati@google.com>
netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts
Josef Bacik <josef@toxicpanda.com>
blk-mq: don't trust the cookie in blk_mq_poll()
Eric Dumazet <edumazet@kernel.org>
ppp: linearize and segment bridged packets when required
Chuck Lever <chuck.lever@oracle.com>
tls: Honor O_NONBLOCK in tls_sw_splice_read()
Josef Bacik <josef@toxicpanda.com>
block: don't enter reclaim under rq_qos_mutex
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: return complete and aligned stream information
Rishikesh Jethwani <rjethwani@purestorage.com>
tls: keep TX and RX hardware offload on the same device
Zhewei Yuan <yzwlhm@gmail.com>
tcp: Fix fastreuse cache initialization on first bind
Tao Gong <gongtao0607@gmail.com>
net: dsa: mt7530: trap frames to conduit in MFC on EN7581 and AN7583
Waiman Long <longman@redhat.com>
cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier()
Tal Zussman <tz2294@columbia.edu>
ceph: wait for pending fscache write in write_folio_nounlock()
Pooyan Azad <pooyan.azadparvar@gmail.com>
zram: fix short reads from block_state
Baek Kyu, Kim <pocj8ur4in@gmail.com>
gpiolib: Propagate emulated drive errors when setting arrays
Ian Rogers <irogers@google.com>
perf lock contention: Filter events before creating lock_stat
Ajanesh Lal <ajaneshlal3@gmail.com>
ALSA: hda/realtek: Add mute and mic-mute LEDs for HP ENVY 16 (103c:8be5)
Sasha Levin <sashal@kernel.org>
selftests/proc: proc-pid-vm: fix unused variable warning on non-x86
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: fix durable reconnects for root shares
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: cache the resolved share path for durable reconnects
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: disconnect on invalid encryption transform flags
Henry Hu <huhai@kylinos.cn>
ksmbd: fix iface_list use-after-free during server reset
Chi Zhiling <chizhiling@kylinos.cn>
exfat: take bitmap_lock at the start of exfat_alloc_cluster()
Chi Zhiling <chizhiling@kylinos.cn>
exfat: fix used_clusters accounting during cluster allocation
Eric Dumazet <edumazet@kernel.org>
ip6mr: clear skb->cb[] in reg_vif_xmit()
James Hilliard <james.hilliard1@gmail.com>
xsk: freeze deferred pool teardown without blocking unregister
Serhat Kumral <serhatkumral1@gmail.com>
RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler
Waiman Long <longman@redhat.com>
cgroup/cpuset: Do housekeeping check before converting invalid partition to valid
Cen Zhang <zzzccc427@gmail.com>
ALSA: aloop: Keep shared timer callbacks alive through close
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
netfilter: flowtable: reset transport header after nf_flow_encap_pop()
Adrian Ambrozewicz <aambrozewicz@nvidia.com>
gpiolib: clear the event clock flags when a line is released
Woojin Ji <random6.xyz@gmail.com>
bpf: Zero-extend the index in inlined bpf_get_func_arg()
Sasha Levin <sashal@kernel.org>
locking/atomic: arc, hexagon, openrisc: Define arch_cmpxchg_local()
Josef Bacik <josef@toxicpanda.com>
bpf: Follow the head if an skb is written from a slice
Josef Bacik <josef@toxicpanda.com>
bpf: Don't take a dynptr argument for a local dynptr
Josef Bacik <josef@toxicpanda.com>
bpf: Let bpf_dynptr_write() mark a global function
Josef Bacik <josef@toxicpanda.com>
bpf, cpumap: Hold the device of frames in the queue
Alexei Starovoitov <ast@kernel.org>
bpf: Don't let an extension reach further into the context than its target
Josef Bacik <josef@toxicpanda.com>
bpf: Assume no bounds for a writable tp with tail calls
Josef Bacik <josef@toxicpanda.com>
bpf: Assume no bounds for buffers behind a tail call
Josef Bacik <josef@toxicpanda.com>
bpf: Count sleepable callbacks as sleepable map users
Josef Bacik <josef@toxicpanda.com>
bpf: Keep a program until its bpf_wq callback has ended
Josef Bacik <josef@toxicpanda.com>
bpf: Don't hand out a linked element as extra element
Josef Bacik <josef@toxicpanda.com>
bpf: Use the frame mem type in devmap egress XDP
Viktor Menshin <ripeeerr@gmail.com>
ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912)
Ju Nan <junan76@163.com>
pinctrl: stm32: Fix the unit of the hwspinlock timeout
Eric Dumazet <edumazet@kernel.org>
tcp: use the echoed source route in cookie_v4_check()
Li RongQing <lirongqing@baidu.com>
ublk: use global index for reported zones
Myeonghun Pak <mhun512@gmail.com>
ASoC: rt5645: Shut down the button timer on removal
Pengpeng Hou <hppiscas@163.com>
irqchip/mst-intc: Validate the DT interrupt range
David Howells <dhowells@redhat.com>
rxrpc: Fix sendmsg length
David Howells <dhowells@redhat.com>
rxrpc: Fix aborting in rxperf test server
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails
Kevin Dewald <kevin@simpleble.org>
Bluetooth: hci_event: Fix LE link drop on remote features command status
Pauli Virtanen <pav@iki.fi>
Bluetooth: hci_sync: fix mesh adv timeout units
Namhyung Kim <namhyung@kernel.org>
perf symbol: Add missing symsrc__destroy() for libbfd
Namhyung Kim <namhyung@kernel.org>
perf symbol: Fix symbol loading from libbfd
Jiale Yao <yaojiale02@163.com>
wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup
Joonhoe Kim <26rote@gmail.com>
ASoC: codecs: wcd939x: read the SoundWire port switches per channel
Guanghui Yang <3497809730@qq.com>
btrfs: roll back sprout setup after device add failure
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: align real_num_tx_queues to mqprio configuration
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: set real_num_tx_queues to max(offset + count)
Adrián Larumbe <adrian.larumbe@collabora.com>
drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove
Kees Cook <kees@kernel.org>
seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk()
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
mailbox: arm_mhu_db: Remove redundant mbox_controller_unregister() on probe failure
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Preserve the LCPA I/O address space
Jacob Moroni <jmoroni@google.com>
RDMA/core: Clear driver_udata before destroying objects in rdma_core
Quanye Yang <quanyeyang@proton.me>
RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq
Maksim Krasutski <krasutskimaksim@gmail.com>
ALSA: hda/realtek: Fix mute LEDs on HP ENVY 17-cr1xxx
Matthew Wood <thepacketgeek@gmail.com>
bpf, arm64: Fix racy plt target update in bpf_arch_text_poke()
Tony Luck <tony.luck@intel.com>
fs/resctrl: Ensure default group reports tasks on monitor-only systems
Leon Romanovsky <leon@kernel.org>
PCI/P2PDMA: Do not tear down the allocate attribute on registration failure
Marek Szyprowski <m.szyprowski@samsung.com>
dma-direct: Restore arch_dma_alloc() for the DMA_ATTR_NO_KERNEL_MAPPING case
Johannes Berg <johannes.berg@intel.com>
wifi: nl80211: reject zero RNR/MBSSID elements
Takashi Iwai <tiwai@suse.de>
ALSA: hda: Use linked list for jack table
Takashi Iwai <tiwai@suse.de>
ALSA: aloop: Avoid a bad mixure of guard() and goto
Takashi Iwai <tiwai@suse.de>
ALSA: pcmtest: Fix leak at probe error
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path
Dmitry Morgun <d.morgun@ispras.ru>
fs/ntfs3: check return values in indx_delete_entry()
Melissa Wen <mwen@igalia.com>
drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7921: fix of_node reference leaks in regd update
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7996: fix the hw-queues debugfs queue requests
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7996: enable the SKU power limit table
Aamir Ahmed <elb12345@hotmail.co.uk>
wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown()
Andrei Vagin <avagin@google.com>
proc: report SIGEV_NONE in /proc/pid/timers if target task has died
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Recover coalesced cyclic callbacks
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix cyclic transfer residue
Roman Demidov <roman.demidov.nn@gmail.com>
drm/msm/a6xx: check pm_runtime_resume_and_get during resume
Qing Ming <a0yami@mailbox.org>
dlm: validate node weights before building member array
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drm/msm/a5xx: don't read the GPMU registers on GPUs without a GPMU
Marco Giunta <marco_giunta@outlook.it>
ASoC: aw88399: skip BSTS check when boost converter is bypassed
Nicolin Chen <nicolinc@nvidia.com>
iommu/arm-smmu-v3: Don't rb_erase() a never-inserted stream node
Shawn Lin <shawn.lin@rock-chips.com>
phy: rockchip: naneng-combphy: Fix TX detect RX termination errata
Yao Zi <ziyao@disroot.org>
phy: rockchip: naneng-combphy: Add SoC prefix to register definitions
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Advance the write pointer over the data written
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Enforce physical block alignment of zoned writes
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Avoid 32-bit overflow in WRITE SCATTERED offsets
Yuan Chen <chenyuan@kylinos.cn>
bpf: Roll back freplace link state when bpf_arch_text_poke() fails
Hal Feng <hal.feng@starfivetech.com>
riscv: dts: starfive: Correct pwm nodes
Guodong Xu <guodong@riscstar.com>
riscv: dts: starfive: jh7110-common: revised device node
Yichong Chen <chenyichong@uniontech.com>
debugfs: make debugfs_create_str() read-only
Runyu Xiao <runyu.xiao@seu.edu.cn>
mei: vsc-tp: initialize IRQ state before requesting interrupt
Alexandra Winter <wintera@linux.ibm.com>
s390/ism: Zerorize dmb at allocation
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Fix UAC2 mixer unit request handling
Ian Rogers <irogers@google.com>
perf evsel: Clamp sample_id size for ksymbol, bpf, and text_poke events
Venkat Rao Bagalkote <venkat88@linux.ibm.com>
powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Set QP event handler before firmware QPC insertion
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent
Yishai Hadas <yishaih@nvidia.com>
RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access
Phil Sutter <phil@nwl.cc>
netfilter: nfnetlink: Fix for interrupted hook dumps
Danish Khateeb <danishkhateeb03@gmail.com>
tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit
Daniel Borkmann <daniel@iogearbox.net>
bpf: Rebase the exception callback subprog when dead subprogs are removed
Andrei Vagin <avagin@google.com>
x86/fpu: Fix potential underflow in xstate_calculate_size()
Sudeep Holla <sudeep.holla@kernel.org>
ACPI: PCC: Free channel on OpRegion deactivation
Abel Vesa <abel.vesa@oss.qualcomm.com>
arm64: dts: qcom: x1-asus-vivobook-s15: Mark the EC reset gpio as reserved
Abel Vesa <abel.vesa@oss.qualcomm.com>
arm64: dts: qcom: x1e78100-t14s: Mark the EC reset gpio as reserved
Abel Vesa <abel.vesa@oss.qualcomm.com>
arm64: dts: qcom: x1-crd: Mark the EC reset gpio as reserved
Yibo Tan <lhfff@tju.edu.cn>
sysctl: unregister tables before freeing bitmap
Tengda Wu <wutengda@huaweicloud.com>
perf llvm: Fix memory leak of args->fileloc in symbol__disassemble_llvm()
Hao Sun <sunhao.th@gmail.com>
bpf: Fix uninit read for helper mem args on partially spilled slots
Hao Sun <sunhao.th@gmail.com>
bpf: Fix uninit read for non-fetch atomics on partially spilled slots
Alexei Starovoitov <ast@kernel.org>
bpf: Don't converge a loop on an iterator that was created anew
Alexei Starovoitov <ast@kernel.org>
bpf: Fix overflow of jump offset in may_goto expansion
Alexei Starovoitov <ast@kernel.org>
bpf: Adjust pc-relative insn copied into its own patch
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register
Puranjay Mohan <puranjay@kernel.org>
bpf: Look at frame 0 when telling async callback entries apart
Kumar Kartikeya Dwivedi <memxor@gmail.com>
bpf: Check fastcall stack contract once for all stack accesses
Yuan Chen <chenyuan@kylinos.cn>
bpf: Keep target extended until its last freplace link detaches
Myeonghun Pak <mhun512@gmail.com>
serial: sh-sci: Unregister UART on sysfs setup failure
Ahsan Atta <ahsan.atta@intel.com>
crypto: qat - hold cfg->lock when accessing config sections
Kim Wooseok <5mghybrid@khu.ac.kr>
wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors
Kim Wooseok <5mghybrid@khu.ac.kr>
wifi: rtl8xxxu: unwind incomplete receive startup
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()
Adrian Hunter <adrian.hunter@intel.com>
i3c: mipi-i3c-hci: Process multiple IBIs per interrupt
Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
drm/connector: hdmi: Handle reset() state allocation failure
Guixin Liu <kanie@linux.alibaba.com>
cxl/region: Unregister the pmem region when the bridge is unbound
Guixin Liu <kanie@linux.alibaba.com>
cxl/cdat: Fix uninitialized stack use in bandwidth gathering
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ASoC: SOF: amd: fix amd_sof_acp_probe() error unwind ordering
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ASoC: SOF: amd: fix amd_sof_acp_remove() teardown ordering
Shakeel Butt <shakeel.butt@linux.dev>
kernfs: don't repeat or skip an entry when readdir resumes
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt1015: make control calibration failures observable
Alison Schofield <alison.schofield@intel.com>
cxl/port: Bound switch decoder target array access by nr_targets
Alison Schofield <alison.schofield@intel.com>
cxl/hdm: Restore commit_end when decoder enumeration fails
Pengpeng Hou <pengpeng@iscas.ac.cn>
phy: samsung: usbdrd: propagate GS101 PIPE3 lock failures
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Rearrange acpi_bind_one() to avoid breakage
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Carry out companion lookup under bus_type_sem
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Rework the success message in acpi_device_notify()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Reduce debug noise from acpi_device_notify()
Thomas Huth <thuth@redhat.com>
crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data
Eric Dumazet <edumazet@google.com>
sit: charge ip_tunnel_prl_entry allocations to memcg
Baochen Qiang <baochen.qiang@oss.qualcomm.com>
wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor
Golla Nagendra <nagendra.golla@amd.com>
dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v alloc failure
Golla Nagendra <nagendra.golla@amd.com>
dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: sta32x: make power restoration transactional
Dave Jiang <dave.jiang@intel.com>
ACPI: APEI: GHES: Validate memory error section length before payload access
Lachlan Hodges <lachlan.hodges@morsemicro.com>
wifi: mac80211: don't seed an S1G sta's last_rate
Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete
Jingbo Xu <jefflexu@linux.alibaba.com>
fuse: don't bump attr_version for async direct read completion
Davidlohr Bueso <dave@stgolabs.net>
cxl/test: Map mock device nodes to an online node
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
drm/panthor: Revisit reqs_lock handling in flush/reset paths
Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl()
Guixin Liu <kanie@linux.alibaba.com>
nvme-tcp: Validate the queue state under the queue lock in the address attribute
Hui Su <sh_def@163.com>
perf evsel: Restrict incremental open error unwind
Salvatore Dipietro <dipiets@amazon.it>
mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations
Alexandr <youdoit@mail.ru>
ALSA: hda/realtek: Enable mute and mic-mute LEDs on HP ENVY 17-cr0xxx
Josef Bacik <josef@toxicpanda.com>
mm/userfaultfd: wake all waiters on unregister
Cunhao Lu <1579567540@qq.com>
can: skb: make echo skb freeing safe in any IRQ context
Daejun Park <daejun7.park@samsung.com>
xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks
Jouni Högander <jouni.hogander@intel.com>
drm/i915/psr: Disable linked plane sel fetch as well
Yingjie Wang <1075151112@qq.com>
nvmet-tcp: validate the TLS handshake timeout
Sinan Turunc <enscrpt@pm.me>
ALSA: ua101: Bound packet copies by the PCM buffer size
Fabricio Akio <fabricioakio@gmail.com>
power: supply: qcom_smbx: set the charge enable after software control
Shen Lichuan <shenlichuan@vivo.com>
power: supply: Correct multiple typos in comments
Jianping Li <jianping.li@oss.qualcomm.com>
misc: fastrpc: Allocate entire reserved memory for Audio PD in probe
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: take rcu_read_lock in the USB/SDIO tx completion path
Sean Young <sean@mess.org>
media: rc: Add missing locking for keymap
Sean Young <sean@mess.org>
media: rc: Replace open coded krealloc() for keymap
Sean Christopherson <seanjc@google.com>
x86/cpuid: Mark CPUID function 0x23 as being indexed
David Howells <dhowells@redhat.com>
rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data()
Ratnaker Gautam <ratnaker.gautam@kuleuven.be>
smb: client: validate NT transaction response layout and offsets
Paulo Alcantara <pc@manguebit.org>
smb: client: reclaim credits for decrypted reads with no matching mid
Vernon Yang <yanglincheng@kylinos.cn>
mm: khugepaged: fix folio is used after pte_unmap_unlock()
Harald Freudenberger <freude@linux.ibm.com>
s390/zcrypt: Fix and improve zcrypt reply message verification checks
Harald Freudenberger <freude@linux.ibm.com>
s390/zcrypt: Make apfs a real unsigned int field
Christian Brauner <brauner@kernel.org>
coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps
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()
Iustin Stolniceanu <iustin.stolniceanu@analog.com>
net: phy: c45: select BASE-T1 type for the forced speed
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()
Kuniyuki Iwashima <kuniyu@google.com>
tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().
Uri Dar <udar@nvidia.com>
net/mlx5: Lag, Return error when enabling MPESW without LAG support
Junyoung Jang <graypanda.inzag@gmail.com>
igmp: use the joined device when leaving a multicast group
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.
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()
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@google.com>
net: rfs: add sock_rps_delete_flow() helper
Eric Dumazet <edumazet@kernel.org>
fou: gue: check IP version of held packets for direct IP encapsulation
Cosmin Ratiu <cratiu@nvidia.com>
net/mlx5e: Serialize TC and IPsec offload exclusion counters
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
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
Umang Pokhriyal <umangpokhriyall@gmail.com>
tun: delete the flow entries of the moved queue on detach
Olga Kornievskaia <okorniev@redhat.com>
NFSv4: wake blocking lock waiters when a delegated lock is released
Eric Dumazet <edumazet@kernel.org>
bonding: fix slave_cnt leak on XDP enslave failure
Denis V. Lunev <den@openvz.org>
ovl: release the upperdir/workdir in-use locks before the umount sync
Christian Brauner <brauner@kernel.org>
ovl: allow idmapping overlay mounts
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
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
Li RongQing <lirongqing@baidu.com>
team: fix promisc/allmulti leak in team_port_add error path
Nikola Z. Ivanov <zlatistiv@gmail.com>
team: Add matching error label for failed action
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().
Chenguang Zhao <zhaochenguang@kylinos.cn>
i40e: xsk: fix multi-buffer XDP_PASS skb construction
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
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: 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
Jeff Layton <jlayton@kernel.org>
nfs: fix utimensat() for atime with delegated timestamps
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
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: 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
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: SOF: amd: add soundwire wake irq handling
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ASoC: SOF: amd: enable soundwire host wake irq mask
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ASoC: SOF: amd: enable ACP_PME_EN register for ACP7.0 & ACP7.1 platforms
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ASoC: SOF: amd: add ACP7.1 platform support
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
ASoC: SOF: amd: remove else condition in resume sequence
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
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
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
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
Christian Loehle <christian.loehle@arm.com>
cpufreq: Serialize global boost updates
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: Force sync policy boost with global boost on sysfs update
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: staticize cpufreq_boost_trigger_state()
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
Peter Zijlstra <peterz@infradead.org>
perf/core: Detach 'struct perf_cpu_pmu_context' and 'struct pmu' lifetimes
Peter Zijlstra <peterz@infradead.org>
perf/core: Add this_cpc() helper
Peter Zijlstra <peterz@infradead.org>
perf/core: Merge struct pmu::pmu_disable_count into struct perf_cpu_pmu_context::pmu_disable_count
Peter Zijlstra <peterz@infradead.org>
perf/core: Simplify perf_pmu_register()
Peter Zijlstra <peterz@infradead.org>
perf/core: Simplify the perf_pmu_register() error path
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
Thomas Fourier <fourier.thomas@gmail.com>
net/mlx5e: TC, Fix double free of branch in failure
Eric Dumazet <edumazet@kernel.org>
tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND
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
Siddharth Chintamaneni <sidchintamaneni@gmail.com>
fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()
Max Kellermann <max.kellermann@ionos.com>
fs/read_write: make default_llseek() killable
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
Florian Fainelli <f.fainelli@gmail.com>
MIPS: SB1250: Validate and update IRQ affinity
Florian Fainelli <f.fainelli@gmail.com>
MIPS: Alchemy: Save the Ethernet address before reusing PROM memory
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
Eric Dumazet <edumazet@kernel.org>
tcp: ipv6: free ireq->ipv6_opt after an RCU grace period
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()
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
Furong Xu <0x1207@gmail.com>
net: stmmac: Switch to zero-copy in non-XDP RX path
Furong Xu <0x1207@gmail.com>
net: stmmac: Unexport stmmac_rx_offset() from stmmac.h
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
Richard Fitzgerald <rf@opensource.cirrus.com>
ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
Michał Kopeć <michal.kopec@3mdeb.com>
ALSA: hda/core: Stop capability walk on empty capability header
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
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
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()
Eric Dumazet <edumazet@google.com>
inet: consolidate inet_csk_clone_lock()
Eric Dumazet <edumazet@google.com>
inet: reduce inet_csk_clone_lock() indent level
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 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
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
James Clark <jjc@jclark.com>
net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes
Chris Mason <mason@kernel.org>
nvmet-rdma: disconnect a queue on device removal
Bjorn Helgaas <bhelgaas@google.com>
nvme: fix various comment typos
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-tcp: ask for the TLS record type on every receive
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
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
Avi Weiss <thnkslprpt@gmail.com>
block: report the correct discard alignment in sysfs
zhangguopeng <zhangguopeng@kylinos.cn>
block: Replace sprintf() with sysfs_emit()
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
John Ogness <john.ogness@linutronix.de>
printk: Avoid multiple unregistration in unregister_console_locked()
Petr Mladek <pmladek@suse.com>
printk: Allow to use the printk kthread immediately even for 1st nbcon
Josef Bacik <josef@toxicpanda.com>
ext2: only flush DIRSYNC directories on every change
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
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
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
power: sequencing: qcom-wcn: improve support for wcn6855
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
Aaditya Kansal <aadityakansal390@gmail.com>
ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server
Bart Van Assche <bvanassche@acm.org>
mctp i3c: Fix locking in an error path
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: 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
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
Jerome Brunet <jbrunet@baylibre.com>
ASoC: meson: axg-fifo: request the irq with the clock enabled
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
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
gpio: mpc8xxx: use a helper variable to store the address of pdev->dev
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
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
Sean Christopherson <seanjc@google.com>
irqbypass: Take ownership of producer/consumer token tracking
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
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
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()
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
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: copy XDP metadata in AF_XDP zero-copy RX
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
net: stmmac: drop split frames on AF_XDP zero-copy RX
Furong Xu <0x1207@gmail.com>
net: stmmac: Set dma_sync_size to zero for discarded frames
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
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
Yuqiang Sun <izaiahsun@gmail.com>
bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom
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
Chris Mason <mason@kernel.org>
bpf: Check the offset in bpf_skb_generic_{push,pop}()
Chris Mason <mason@kernel.org>
bpf: Move the transport header with the moved headers
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
Guillaume Nault <gnault@redhat.com>
ipv4: Convert ip_route_input_noref() to dscp_t.
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()
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: 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()
Jiri Olsa <jolsa@kernel.org>
bpf: Avoid changing callchain in bpf_get_stackid_pe
Josef Bacik <josef@toxicpanda.com>
bpf: Clamp the trace length in __bpf_get_stack() again
Jiri Olsa <jolsa@kernel.org>
bpf: Avoid changing callchain in bpf_get_stack_pe
Hongjian Dai <daihongjian@kylinsec.com.cn>
spi: pic32-sqi: fail transfer when the BD ring is exhausted
Fernando Fernandez Mancera <fmancera@suse.de>
netfilter: nft_reject: prevent unbounded recursion in output hooks
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_dup_netdev: add nf_dev_xmit_recursion*() helpers and use them
Weiming Shi <bestswngs@gmail.com>
netfilter: nft_fwd_netdev: use recursion counter in neigh egress path
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nft_fwd_netdev: add device and headroom validate with neigh forwarding
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit
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
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: 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
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: fix fiemap merging compressed extents
guolingxing <guolingxing@tju.edu.cn>
btrfs: verity: propagate orphan insertion errors when enabling verity
Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
bpf: Fix jited line info off by the CFI preamble
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
Filippo Falezza <effeffe99@gmail.com>
wifi: ath10k: Stop unanswered temperature reads
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
Matthew Whitehead <tedheadster@gmail.com>
scsi: aha1542: Remove unneeded scsi_dma_unmap() call
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
Mehmet Fide <mehmet.fide@screeningeagle.com>
wifi: ath9k_htc: start ANI when an AP interface begins to beacon
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
David Laight <david.laight.linux@gmail.com>
net/9p: Replace strlen() strcpy() pair with strscpy()
Eric Sandeen <sandeen@redhat.com>
9p: convert to the new mount API
Eric Sandeen <sandeen@redhat.com>
9p: create a v9fs_context structure to hold parsed options
Eric Sandeen <sandeen@redhat.com>
net/9p: move structures and macros to header files
Eric Sandeen <sandeen@redhat.com>
fs/fs_parse: add back fsparam_u32hex
Zijun Hu <quic_zijuhu@quicinc.com>
fs/fs_parse: Delete macro fsparam_u32hex()
Joshua Murphy <joshuamurphy@posteo.net>
net/9p/fd: support ipv6 for trans=tcp
Feng Ning <feng@innora.ai>
staging: media: atomisp: use array3_size() for overflow-safe allocation
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: destroy force-feedback device on input unregistration
Bernard Pidoux <bernard.f6bvp@gmail.com>
bpqether: keep a bpq device in step with its Ethernet device
Bernard Pidoux <bernard.f6bvp@gmail.com>
bpqether: set both addresses or none in SIOCSBPQETHADDR
Bernard Pidoux <bernard.f6bvp@gmail.com>
bpqether: reserve the Ethernet device's own header room on transmit
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
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()
Jens Axboe <axboe@kernel.dk>
io_uring: enable toggle of iowait usage when waiting on CQEs
Hui Peng <benquike@gmail.com>
udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
Jan Kara <jack@suse.cz>
udf: validate VAT inode size for old VAT format
Lance Yang <lance.yang@linux.dev>
mm/ksm: fix userfaultfd protection during merge and unmerge
Bernard Pidoux <bernard.f6bvp@gmail.com>
netrom: give the sysctl timer limits in milliseconds
Bernard Pidoux <bernard.f6bvp@gmail.com>
netrom: keep T1 running after answering a NAK
Bernard Pidoux <bernard.f6bvp@gmail.com>
ax25: end a REJ recovery count once frames are acknowledged
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: reset a call when a DATA packet arrives out of sequence
Bernard Pidoux <bernard.f6bvp@gmail.com>
ax25: drop a message being reassembled when a new one starts
Bernard Pidoux <bernard.f6bvp@gmail.com>
netrom: send the unacknowledged frames again when T1 or T4 expires
Sasha Levin <sashal@kernel.org>
Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"
Long Li <leo.lilong@huawei.com>
xfs: only assert new size for datafork during truncate extents
Gabriele Monaco <gmonaco@redhat.com>
sched/deadline: Fix server stopping with runnable tasks
Peter Zijlstra <peterz@infradead.org>
sched: Provide idle_rq() helper
Peter Zijlstra <peterz@infradead.org>
sched/deadline: Fix dl_server stop condition
Peter Zijlstra <peterz@infradead.org>
sched/deadline: Fix dl_server time accounting
KP Singh <kpsingh@kernel.org>
bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature
Zizhi Wo <wozizhi@huawei.com>
fs: aio: reject partial mremap to avoid Null-pointer-dereference error
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)
Baokun Li <libaokun@linux.alibaba.com>
writeback: use a per-sb counter to drain inode wb switches at umount
Jerome Marchand <jmarchan@redhat.com>
bpf: Specify access type of bpf_sysctl_get_name args
Shuran Liu <electronlsr@gmail.com>
bpf: Fix verifier assumptions of bpf_d_path's output buffer
Zesen Liu <ftyghome@gmail.com>
bpf: Fix memory access flags in helper prototypes
Johannes Weiner <hannes@cmpxchg.org>
mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES
Pengpeng Hou <hppiscas@163.com>
irqchip/sifive-plic: Avoid signed shift in interrupt enable mask
Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
drm/amdgpu: Check cs flags.
Chris Mason <mason@kernel.org>
mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nft_ct: move custom expectation support to helper
Florian Westphal <fw@strlen.de>
netfilter: nft_ct: expectation timeouts are passed in milliseconds
-------------
Diffstat:
Documentation/admin-guide/kernel-parameters.txt | 5 +
Documentation/arch/arm64/silicon-errata.rst | 4 +
.../bindings/iio/adc/aspeed,ast2600-adc.yaml | 17 +
Documentation/filesystems/mount_api.rst | 1 -
Documentation/networking/rxrpc.rst | 8 +-
Documentation/networking/tls-offload.rst | 16 +-
Documentation/trace/kprobes.rst | 2 +-
Makefile | 4 +-
arch/arc/include/asm/cmpxchg.h | 4 +
arch/arm64/Kconfig | 32 ++
.../dts/qcom/x1e78100-lenovo-thinkpad-t14s.dts | 1 +
.../boot/dts/qcom/x1e80100-asus-vivobook-s15.dts | 1 +
arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 1 +
arch/arm64/include/asm/suspend.h | 2 +-
arch/arm64/kernel/cpu_errata.c | 20 +
arch/arm64/kernel/cpufeature.c | 3 +-
arch/arm64/kernel/ptrace.c | 8 +-
arch/arm64/kernel/topology.c | 3 +-
arch/arm64/mm/proc.S | 8 +
arch/arm64/net/bpf_jit_comp.c | 32 +-
arch/arm64/tools/cpucaps | 1 +
arch/hexagon/include/asm/cmpxchg.h | 6 +
arch/loongarch/power/hibernate.c | 6 +
arch/mips/Kconfig | 2 +-
arch/mips/alchemy/common/prom.c | 23 +-
arch/mips/configs/ip30_defconfig | 9 +-
arch/mips/sibyte/sb1250/irq.c | 3 +
arch/openrisc/include/asm/cmpxchg.h | 2 +
arch/powerpc/include/asm/interrupt.h | 5 +-
arch/powerpc/kernel/watchdog.c | 3 +
arch/riscv/boot/dts/starfive/jh7100-common.dtsi | 28 +-
arch/riscv/boot/dts/starfive/jh7100.dtsi | 67 ++-
arch/riscv/boot/dts/starfive/jh7110-common.dtsi | 32 +-
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts | 21 +
.../boot/dts/starfive/jh7110-pine64-star64.dts | 21 +
.../dts/starfive/jh7110-starfive-visionfive-2.dtsi | 24 +
arch/riscv/boot/dts/starfive/jh7110.dtsi | 67 ++-
arch/x86/events/amd/uncore.c | 2 +-
arch/x86/include/asm/cpuid.h | 1 +
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +-
arch/x86/kernel/fpu/xstate.c | 8 +-
arch/x86/kernel/ldt.c | 12 +-
arch/x86/kvm/x86.c | 4 +-
block/blk-cgroup.c | 13 +-
block/blk-iocost.c | 5 +-
block/blk-iolatency.c | 3 +-
block/blk-mq.c | 18 +-
block/blk-sysfs.c | 24 +-
block/blk-throttle.c | 3 +-
block/genhd.c | 30 +-
block/partitions/efi.c | 1 +
crypto/essiv.c | 2 +-
drivers/accel/ivpu/ivpu_pm.c | 9 +-
drivers/acpi/acpi_pcc.c | 13 +
drivers/acpi/apei/ghes.c | 41 ++
drivers/acpi/glue.c | 132 +++--
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 | 25 +-
drivers/block/virtio_blk.c | 69 ++-
drivers/block/zram/zram_drv.c | 115 +++--
drivers/bluetooth/btintel.c | 24 +-
drivers/bluetooth/btmtk.c | 49 +-
drivers/bluetooth/hci_qca.c | 5 +
drivers/char/tpm/eventlog/acpi.c | 4 +-
drivers/char/tpm/eventlog/tpm1.c | 7 +
drivers/char/tpm/tpm2-sessions.c | 4 +-
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 | 21 +-
drivers/cpufreq/intel_pstate.c | 14 +-
drivers/crypto/caam/caampkc.c | 75 ++-
drivers/crypto/inside-secure/safexcel_hash.c | 3 +
drivers/crypto/intel/qat/qat_common/adf_cfg.c | 49 +-
drivers/cxl/core/cdat.c | 8 +-
drivers/cxl/core/hdm.c | 23 +-
drivers/cxl/core/port.c | 20 +-
drivers/cxl/core/region.c | 6 +-
drivers/dma/ste_dma40.c | 179 ++++++-
drivers/dma/ste_dma40_ll.c | 8 +-
drivers/dma/ste_dma40_ll.h | 2 +-
drivers/dma/xilinx/zynqmp_dma.c | 19 +-
drivers/dpll/dpll_core.c | 3 +-
drivers/firmware/cirrus/cs_dsp.c | 6 +
drivers/gpio/gpio-brcmstb.c | 1 +
drivers/gpio/gpio-mpc8xxx.c | 68 +--
drivers/gpio/gpio-omap.c | 13 +-
drivers/gpio/gpio-rockchip.c | 15 +-
drivers/gpio/gpio-sodaville.c | 9 +-
drivers/gpio/gpio-virtuser.c | 85 ++-
drivers/gpio/gpiolib-of.h | 2 +-
drivers/gpio/gpiolib.c | 11 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 +-
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 +-
.../drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 56 +-
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 20 +-
drivers/gpu/drm/bridge/sii902x.c | 8 +-
drivers/gpu/drm/drm_connector.c | 5 +-
drivers/gpu/drm/i915/display/intel_psr.c | 27 +-
drivers/gpu/drm/imagination/pvr_rogue_fwif.h | 2 +-
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 49 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 33 +-
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_drv.c | 12 +
drivers/gpu/drm/panthor/panthor_gpu.c | 61 +--
drivers/gpu/drm/xe/xe_pci.c | 3 +
drivers/gpu/drm/xe/xe_vm.c | 9 +-
drivers/hwmon/aht10.c | 2 +-
drivers/hwmon/max31760.c | 12 +-
drivers/hwmon/pmbus/mp2975.c | 207 ++++----
drivers/hwmon/scmi-hwmon.c | 12 +-
drivers/hwmon/sy7636a-hwmon.c | 2 +-
drivers/i3c/master/mipi-i3c-hci/dma.c | 40 +-
drivers/iio/accel/adxl380.c | 11 +-
drivers/iio/accel/kxsd9.c | 2 +-
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 +-
drivers/iio/dac/mcp4725.c | 2 +
drivers/iio/gyro/bmg160_core.c | 2 +-
drivers/iio/humidity/am2315.c | 12 +-
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 24 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 +
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/proximity/sx9310.c | 2 +-
drivers/iio/proximity/sx9324.c | 13 +-
drivers/iio/temperature/mlx90614.c | 2 +-
drivers/infiniband/core/rdma_core.c | 2 +
drivers/infiniband/hw/mlx5/fs.c | 3 +
drivers/infiniband/hw/mlx5/main.c | 50 +-
drivers/infiniband/hw/mlx5/qp.c | 22 +-
drivers/infiniband/hw/mlx5/qpc.c | 10 +
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 6 +-
drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c | 3 +-
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 45 +-
drivers/input/ff-core.c | 2 +-
drivers/input/ff-memless.c | 10 +-
drivers/input/input.c | 2 +
drivers/iommu/amd/init.c | 1 +
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 +-
drivers/iommu/iommufd/device.c | 8 +-
drivers/irqchip/irq-mst-intc.c | 3 +
drivers/irqchip/irq-sifive-plic.c | 2 +-
drivers/mailbox/arm_mhu_db.c | 1 -
drivers/mailbox/qcom-ipcc.c | 5 +-
drivers/md/dm-cache-metadata.c | 4 +-
drivers/md/dm-cache-target.c | 1 +
drivers/md/dm-crypt.c | 22 +-
drivers/md/dm-integrity.c | 30 +-
drivers/md/dm-log-userspace-base.c | 6 +-
drivers/md/dm-mpath.c | 6 +-
drivers/md/dm-raid.c | 5 +-
drivers/md/dm-snap.c | 18 +-
drivers/md/dm-sysfs.c | 17 +-
drivers/md/dm-thin-metadata.c | 5 +-
drivers/md/dm-thin.c | 7 +-
drivers/md/dm-verity-target.c | 27 +-
drivers/md/dm-zoned-reclaim.c | 18 +-
drivers/md/dm.c | 15 +-
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/media/rc/rc-main.c | 125 +++--
drivers/misc/bcm-vk/bcm_vk_sg.c | 43 +-
drivers/misc/fastrpc.c | 198 +++----
drivers/misc/ibmvmc.c | 16 +-
drivers/misc/mei/vsc-tp.c | 15 +-
drivers/misc/vmw_vmci/vmci_event.c | 7 +-
drivers/mmc/host/meson-gx-mmc.c | 26 +-
drivers/mmc/host/mmci.c | 4 +-
drivers/mmc/host/sdhci-esdhc-imx.c | 17 +
drivers/net/amt.c | 61 +--
drivers/net/bonding/bond_main.c | 24 +-
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/dsa/mt7530.c | 6 +-
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 | 51 +-
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 13 +-
drivers/net/ethernet/mediatek/mtk_ppe.c | 5 +-
drivers/net/ethernet/mediatek/mtk_wed.c | 27 +-
.../net/ethernet/mellanox/mlx5/core/en/params.c | 5 +-
.../mellanox/mlx5/core/en_accel/ipsec_fs.c | 45 +-
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/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 +-
.../ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 41 +-
drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
drivers/net/ethernet/meta/fbnic/fbnic_csr.h | 4 +
drivers/net/ethernet/meta/fbnic/fbnic_fw.c | 16 +
.../net/ethernet/microchip/lan966x/lan966x_fdma.c | 6 +
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 10 +-
drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +-
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/norm_desc.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 15 +-
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 11 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 121 +++--
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 18 +-
drivers/net/ethernet/ti/am65-cpts.c | 67 ++-
drivers/net/gtp.c | 22 +-
drivers/net/hamradio/bpqether.c | 62 ++-
drivers/net/hyperv/rndis_filter.c | 6 +-
drivers/net/ipa/ipa_interrupt.c | 12 +-
drivers/net/ipvlan/ipvlan_core.c | 6 +-
drivers/net/ipvlan/ipvlan_l3s.c | 6 +-
drivers/net/macsec.c | 15 +-
drivers/net/mctp/mctp-i3c.c | 3 +-
drivers/net/phy/phy-c45.c | 46 +-
drivers/net/ppp/ppp_generic.c | 95 +++-
drivers/net/ppp/pppoe.c | 1 +
drivers/net/team/team_core.c | 12 +-
drivers/net/tun.c | 12 +-
drivers/net/usb/cdc_ncm.c | 4 +-
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/ath11k/ahb.c | 5 +-
drivers/net/wireless/ath/ath12k/core.c | 3 +-
drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +-
drivers/net/wireless/ath/ath12k/mac.c | 12 +-
drivers/net/wireless/ath/ath12k/mac.h | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 8 +-
drivers/net/wireless/mediatek/mt76/mt7921/init.c | 26 +-
drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 3 +
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 7 +-
drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 3 +
.../net/wireless/mediatek/mt76/mt7996/debugfs.c | 296 +++++++----
drivers/net/wireless/mediatek/mt76/mt7996/main.c | 5 +
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 46 +-
drivers/net/wireless/mediatek/mt76/mt7996/mcu.h | 23 +
drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h | 1 +
drivers/net/wireless/mediatek/mt76/mt7996/regs.h | 28 +
drivers/net/wireless/realtek/rtl8xxxu/core.c | 140 ++---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
drivers/nvme/host/core.c | 4 +
drivers/nvme/host/fc.c | 4 +-
drivers/nvme/host/tcp.c | 57 +-
drivers/nvme/target/fc.c | 6 +-
drivers/nvme/target/rdma.c | 57 +-
drivers/nvme/target/tcp.c | 39 +-
drivers/pci/p2pdma.c | 8 +-
drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 294 ++++++-----
drivers/phy/samsung/phy-exynos5-usbdrd.c | 51 +-
drivers/pinctrl/stm32/pinctrl-stm32.c | 12 +-
drivers/power/sequencing/pwrseq-qcom-wcn.c | 103 +++-
drivers/power/supply/88pm860x_battery.c | 4 +-
drivers/power/supply/ab8500_btemp.c | 2 +-
drivers/power/supply/charger-manager.c | 2 +-
drivers/power/supply/da9030_battery.c | 4 +-
drivers/power/supply/max8925_power.c | 2 +-
drivers/power/supply/qcom_battmgr.c | 2 +-
drivers/power/supply/qcom_smbx.c | 13 +-
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 | 121 +++--
drivers/regulator/Kconfig | 1 +
drivers/regulator/qcom_spmi-regulator.c | 35 +-
drivers/s390/block/dasd_eckd.c | 3 +-
drivers/s390/block/dasd_ioctl.c | 4 +-
drivers/s390/crypto/zcrypt_error.h | 28 +-
drivers/s390/crypto/zcrypt_msgtype50.c | 95 +++-
drivers/s390/crypto/zcrypt_msgtype6.c | 208 ++++++--
drivers/s390/crypto/zcrypt_msgtype6.h | 4 +-
drivers/s390/net/ism_drv.c | 3 +-
drivers/scsi/aha1542.c | 2 -
drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +-
drivers/scsi/scsi_debug.c | 38 +-
drivers/spi/spi-cadence-quadspi.c | 4 +-
drivers/spi/spi-pic32-sqi.c | 3 +-
drivers/spi/spi.c | 40 +-
.../staging/media/atomisp/pci/sh_css_param_dvs.c | 11 +-
.../media/atomisp/pci/sh_css_param_shading.c | 4 +-
drivers/staging/media/atomisp/pci/sh_css_params.c | 35 +-
drivers/target/target_core_pr.c | 9 +-
drivers/tty/serial/8250/8250_lpss.c | 3 +
drivers/tty/serial/rda-uart.c | 2 +
drivers/tty/serial/samsung_tty.c | 8 +-
drivers/tty/serial/sh-sci.c | 8 +-
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 | 24 +-
drivers/usb/dwc3/ep0.c | 2 +-
drivers/usb/dwc3/gadget.c | 160 ++++--
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.c | 2 +-
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/ucsi.c | 10 +-
drivers/vdpa/mlx5/net/mlx5_vnet.c | 10 +-
drivers/vdpa/vdpa.c | 7 +-
drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 +
drivers/vfio/pci/vfio_pci_intrs.c | 9 +-
drivers/vhost/scsi.c | 42 +-
drivers/vhost/test.c | 4 +
drivers/vhost/vdpa.c | 95 +++-
drivers/vhost/vhost.c | 3 +-
drivers/virtio/virtio_balloon.c | 3 +-
drivers/virtio/virtio_pci_common.c | 2 +-
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/xen/gntdev.c | 8 +-
drivers/xen/grant-table.c | 37 +-
drivers/xen/privcmd.c | 15 +
drivers/xen/pvcalls-back.c | 26 +-
fs/9p/v9fs.c | 572 +++++++++++----------
fs/9p/v9fs.h | 7 +-
fs/9p/vfs_dir.c | 6 +-
fs/9p/vfs_inode.c | 10 +
fs/9p/vfs_inode_dotl.c | 36 +-
fs/9p/vfs_super.c | 130 +++--
fs/adfs/dir_fplus.c | 2 +
fs/afs/rxrpc.c | 8 +-
fs/aio.c | 7 +-
fs/backing-file.c | 7 +-
fs/btrfs/fiemap.c | 3 +-
fs/btrfs/scrub.c | 8 +-
fs/btrfs/verity.c | 2 +-
fs/btrfs/volumes.c | 37 ++
fs/btrfs/zoned.c | 38 +-
fs/ceph/addr.c | 12 +
fs/coda/file.c | 3 +-
fs/coredump.c | 5 +
fs/debugfs/file.c | 81 +--
fs/dlm/config.c | 9 +-
fs/dlm/member.c | 17 +-
fs/eventpoll.c | 11 +-
fs/exfat/fatent.c | 20 +-
fs/ext2/dir.c | 3 +
fs/fs-writeback.c | 97 ++--
fs/fuse/file.c | 2 +-
fs/inode.c | 3 +-
fs/isofs/util.c | 8 +-
fs/kernfs/dir.c | 40 +-
fs/libfs.c | 2 +-
fs/nfs/dir.c | 4 +-
fs/nfs/inode.c | 11 +-
fs/nfs/nfs4proc.c | 24 +-
fs/nfs/pnfs.c | 2 +-
fs/ntfs3/index.c | 10 +
fs/overlayfs/namei.c | 13 +-
fs/overlayfs/overlayfs.h | 11 +-
fs/overlayfs/ovl_entry.h | 2 +
fs/overlayfs/params.c | 48 +-
fs/overlayfs/super.c | 37 +-
fs/overlayfs/util.c | 12 +
fs/proc/base.c | 10 +-
fs/proc/proc_sysctl.c | 5 +-
fs/read_write.c | 14 +-
fs/smb/client/cifsacl.c | 5 +-
fs/smb/client/cifsfs.c | 13 +-
fs/smb/client/cifsglob.h | 1 +
fs/smb/client/cifsproto.h | 1 +
fs/smb/client/cifssmb.c | 32 +-
fs/smb/client/connect.c | 6 +-
fs/smb/client/dfs.c | 2 +-
fs/smb/client/file.c | 94 +++-
fs/smb/client/sess.c | 4 +-
fs/smb/client/smb2ops.c | 6 +-
fs/smb/client/smb2pdu.c | 12 +-
fs/smb/server/mgmt/share_config.c | 43 +-
fs/smb/server/mgmt/share_config.h | 2 +
fs/smb/server/smb2pdu.c | 223 +++++---
fs/smb/server/transport_tcp.c | 7 +-
fs/smb/server/vfs_cache.c | 16 +-
fs/splice.c | 11 +-
fs/stat.c | 6 +-
fs/udf/super.c | 19 +-
fs/userfaultfd.c | 22 +-
fs/xfs/xfs_aops.c | 2 +-
fs/xfs/xfs_file.c | 2 +-
fs/xfs/xfs_inode.c | 3 +-
fs/xfs/xfs_iomap.c | 20 +-
fs/xfs/xfs_iomap.h | 3 +-
fs/xfs/xfs_pnfs.c | 9 +-
include/acpi/acpi_bus.h | 1 +
include/linux/blk-mq.h | 3 +-
include/linux/bpf.h | 14 +-
include/linux/can/dev.h | 2 +-
include/linux/can/skb.h | 4 +-
include/linux/cpufreq.h | 5 -
include/linux/fs.h | 8 +
include/linux/fs_parser.h | 2 +-
include/linux/idr.h | 17 +
include/linux/irqbypass.h | 35 +-
include/linux/key.h | 3 +
include/linux/mlx5/driver.h | 8 +-
include/linux/mmzone.h | 3 +-
include/linux/netdevice.h | 5 +
include/linux/netdevice_xmit.h | 3 +
include/linux/perf_event.h | 6 +-
include/linux/ppp_channel.h | 1 +
include/linux/sched.h | 16 +-
include/linux/stat.h | 3 +
include/linux/tcp.h | 3 +
include/linux/uio.h | 8 +-
include/media/rc-map.h | 2 -
include/net/9p/client.h | 100 +++-
include/net/9p/transport.h | 9 +-
include/net/af_rxrpc.h | 5 +-
include/net/bluetooth/hci_core.h | 15 +-
include/net/dst_metadata.h | 2 +
include/net/gro.h | 8 +-
include/net/gso.h | 2 +-
include/net/inet_connection_sock.h | 2 +
include/net/netfilter/nf_conntrack_helper.h | 1 +
include/net/netfilter/nf_dup_netdev.h | 2 +
include/net/netfilter/nf_recursion.h | 42 ++
include/net/netns/netfilter.h | 1 +
include/net/route.h | 7 +-
include/net/rps.h | 24 +
include/net/sock.h | 24 +-
include/net/tcp.h | 9 +
include/net/tcp_ao.h | 3 +-
include/net/xsk_buff_pool.h | 3 +
include/sound/hda_codec.h | 6 +-
include/trace/events/huge_memory.h | 6 +-
include/trace/events/oom.h | 8 +-
include/trace/events/rxrpc.h | 2 +-
include/uapi/linux/io_uring.h | 2 +
include/uapi/linux/mdio.h | 13 +-
init/do_mounts_rd.c | 5 +
io_uring/futex.c | 1 +
io_uring/io-wq.c | 44 +-
io_uring/io_uring.c | 39 +-
io_uring/io_uring.h | 1 +
io_uring/kbuf.c | 1 +
io_uring/napi.c | 31 +-
io_uring/rsrc.c | 25 +-
io_uring/rw.c | 4 +-
io_uring/timeout.c | 3 +-
kernel/bpf/arena.c | 10 +-
kernel/bpf/arraymap.c | 2 +-
kernel/bpf/cgroup.c | 28 +-
kernel/bpf/core.c | 10 +-
kernel/bpf/cpumap.c | 30 +-
kernel/bpf/devmap.c | 1 +
kernel/bpf/hashtab.c | 23 +-
kernel/bpf/helpers.c | 11 +-
kernel/bpf/stackmap.c | 102 ++--
kernel/bpf/syscall.c | 19 +-
kernel/bpf/trampoline.c | 19 +-
kernel/bpf/verifier.c | 173 ++++++-
kernel/cgroup/cpuset-internal.h | 5 +
kernel/cgroup/cpuset.c | 27 +-
kernel/dma/direct.c | 21 +-
kernel/events/core.c | 215 ++++----
kernel/locking/osq_lock.c | 62 ++-
kernel/printk/internal.h | 2 +
kernel/printk/nbcon.c | 26 +-
kernel/printk/printk.c | 52 +-
kernel/sched/deadline.c | 89 ++--
kernel/sched/fair.c | 9 +-
kernel/sched/idle.c | 16 +-
kernel/sched/pelt.c | 2 +-
kernel/sched/sched.h | 31 +-
kernel/sched/syscalls.c | 42 +-
kernel/sched/topology.c | 16 +-
kernel/time/timekeeping.c | 8 +-
kernel/trace/bpf_trace.c | 13 +-
kernel/trace/trace_eprobe.c | 83 ++-
kernel/trace/trace_fprobe.c | 8 +-
kernel/trace/trace_kprobe.c | 11 +-
kernel/trace/trace_probe.c | 12 +-
kernel/trace/trace_probe_tmpl.h | 14 +-
kernel/trace/trace_uprobe.c | 8 +-
kernel/tsacct.c | 10 +-
lib/bootconfig.c | 2 +-
lib/iov_iter.c | 6 +-
lib/seq_buf.c | 2 +-
lib/test_sysctl.c | 2 +-
mm/gup.c | 17 +-
mm/internal.h | 11 +-
mm/khugepaged.c | 14 +-
mm/ksm.c | 4 +
mm/memory_hotplug.c | 44 +-
mm/mempolicy.c | 4 +-
mm/page_alloc.c | 44 +-
net/9p/client.c | 154 +-----
net/9p/mod.c | 2 +-
net/9p/protocol.c | 12 +-
net/9p/trans_fd.c | 194 ++-----
net/9p/trans_rdma.c | 133 +----
net/9p/trans_usbg.c | 14 +-
net/9p/trans_virtio.c | 8 +-
net/9p/trans_xen.c | 4 +-
net/ax25/ax25_in.c | 30 +-
net/ax25/ax25_std_in.c | 23 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/bluetooth/hci_conn.c | 23 +-
net/bluetooth/hci_core.c | 66 ++-
net/bluetooth/hci_event.c | 68 ++-
net/bluetooth/hci_sync.c | 122 ++++-
net/bluetooth/l2cap_core.c | 5 +-
net/bluetooth/l2cap_sock.c | 3 +-
net/bluetooth/mgmt.c | 45 +-
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 | 12 +
net/core/filter.c | 143 ++++--
net/core/gro.c | 11 +-
net/core/lwt_bpf.c | 60 ++-
net/core/netdev-genl.c | 6 +
net/core/skbuff.c | 18 +-
net/core/sock_reuseport.c | 26 +-
net/dccp/ipv4.c | 3 -
net/dccp/ipv6.c | 9 +-
net/ipv4/fib_trie.c | 14 +-
net/ipv4/fou_core.c | 31 +-
net/ipv4/igmp.c | 2 +
net/ipv4/inet_connection_sock.c | 93 ++--
net/ipv4/inet_hashtables.c | 19 +-
net/ipv4/inet_timewait_sock.c | 6 +-
net/ipv4/ip_fragment.c | 4 +-
net/ipv4/ip_input.c | 2 +-
net/ipv4/ip_output.c | 8 +-
net/ipv4/ip_tunnel.c | 6 +-
net/ipv4/netfilter/arp_tables.c | 5 +-
net/ipv4/netfilter/ip_tables.c | 5 +-
net/ipv4/netfilter/nf_reject_ipv4.c | 12 +
net/ipv4/route.c | 31 +-
net/ipv4/syncookies.c | 12 +-
net/ipv4/tcp.c | 5 +-
net/ipv4/tcp_fastopen.c | 2 +
net/ipv4/tcp_input.c | 19 +-
net/ipv4/tcp_ipv4.c | 27 +-
net/ipv4/tcp_metrics.c | 3 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/udp.c | 7 +-
net/ipv4/udp_offload.c | 9 +-
net/ipv4/xfrm4_input.c | 2 +-
net/ipv4/xfrm4_protocol.c | 2 +-
net/ipv6/calipso.c | 12 +-
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 | 43 +-
net/ipv6/mip6.c | 9 +-
net/ipv6/netfilter/ip6_tables.c | 5 +-
net/ipv6/netfilter/nf_reject_ipv6.c | 13 +
net/ipv6/route.c | 16 +-
net/ipv6/seg6_iptunnel.c | 46 +-
net/ipv6/seg6_local.c | 124 ++++-
net/ipv6/sit.c | 2 +-
net/ipv6/tcp_ipv6.c | 17 +-
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 | 4 +-
net/mac80211/link.c | 13 +-
net/mac80211/mlme.c | 12 +-
net/mac80211/ocb.c | 23 +-
net/mac80211/rate.c | 1 -
net/mac80211/rx.c | 7 +-
net/mac80211/s1g.c | 8 -
net/mac80211/tx.c | 6 +
net/mctp/af_mctp.c | 2 +-
net/mptcp/options.c | 12 +-
net/netfilter/core.c | 17 +-
net/netfilter/ipvs/ip_vs_app.c | 2 +-
net/netfilter/ipvs/ip_vs_core.c | 12 +-
net/netfilter/nf_conntrack_helper.c | 20 +-
net/netfilter/nf_conntrack_sip.c | 4 +-
net/netfilter/nf_dup_netdev.c | 18 +-
net/netfilter/nf_flow_table_core.c | 1 +
net/netfilter/nf_flow_table_ip.c | 2 +
net/netfilter/nf_nat_masquerade.c | 4 +-
net/netfilter/nf_tables_api.c | 21 +-
net/netfilter/nf_tables_offload.c | 3 +
net/netfilter/nfnetlink_hook.c | 20 +-
net/netfilter/nft_ct.c | 119 ++++-
net/netfilter/nft_fwd_netdev.c | 28 +-
net/netfilter/xt_NETMAP.c | 4 +-
net/netfilter/xt_recent.c | 7 +-
net/netlink/af_netlink.c | 3 +-
net/netrom/nr_out.c | 7 +-
net/netrom/nr_subr.c | 6 +-
net/netrom/nr_timer.c | 4 +
net/netrom/sysctl_net_netrom.c | 17 +-
net/nsh/nsh.c | 7 +
net/openvswitch/flow.c | 19 +-
net/rds/rdma.c | 5 +-
net/rose/rose_in.c | 21 +
net/rxrpc/rxperf.c | 32 +-
net/rxrpc/sendmsg.c | 44 +-
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 | 4 +-
net/sctp/stream.c | 2 +
net/sctp/stream_interleave.c | 38 +-
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 +-
net/smc/smc_sysctl.c | 6 +-
net/socket.c | 11 +-
net/sunrpc/clnt.c | 6 +-
net/sunrpc/rpc_pipe.c | 1 +
net/sunrpc/xprtsock.c | 2 +-
net/tipc/bearer.c | 33 ++
net/tls/tls_device.c | 24 +
net/tls/tls_sw.c | 25 +-
net/unix/garbage.c | 3 -
net/vmw_vsock/af_vsock.c | 3 +-
net/vmw_vsock/virtio_transport.c | 16 +-
net/wireless/nl80211.c | 9 +-
net/wireless/scan.c | 3 +-
net/wireless/util.c | 6 +-
net/xdp/xsk.c | 5 +
net/xdp/xsk_buff_pool.c | 43 +-
net/xfrm/xfrm_replay.c | 6 +-
security/keys/key.c | 10 +-
security/keys/keyctl.c | 2 -
security/keys/keyring.c | 25 +-
security/keys/request_key.c | 14 +-
sound/core/memalloc.c | 2 +-
sound/drivers/aloop.c | 23 +-
sound/drivers/pcmtest.c | 66 +--
sound/hda/hdac_controller.c | 10 +-
sound/pci/Kconfig | 1 +
sound/pci/hda/cs35l56_hda.c | 2 +
sound/pci/hda/hda_codec.c | 1 -
sound/pci/hda/hda_jack.c | 79 +--
sound/pci/hda/hda_jack.h | 1 +
sound/pci/hda/patch_realtek.c | 52 +-
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c | 16 +-
sound/soc/codecs/aw88399.c | 13 +
sound/soc/codecs/aw88399.h | 5 +
sound/soc/codecs/max98090.c | 22 +-
sound/soc/codecs/rt1015.c | 81 ++-
sound/soc/codecs/rt5645.c | 7 +-
sound/soc/codecs/sta32x.c | 101 +++-
sound/soc/codecs/wcd939x.c | 10 +-
sound/soc/codecs/wcd939x.h | 1 -
sound/soc/codecs/wm_adsp.c | 10 +
sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +-
sound/soc/meson/axg-fifo.c | 30 +-
sound/soc/soc-core.c | 16 +
sound/soc/sof/amd/Kconfig | 6 +-
sound/soc/sof/amd/acp-dsp-offset.h | 10 +
sound/soc/sof/amd/acp.c | 141 ++++-
sound/soc/sof/amd/acp.h | 5 +
sound/soc/sof/amd/pci-acp70.c | 7 +-
sound/soc/sof/intel/hda-codec.c | 4 +-
sound/soc/sof/ipc4-topology.c | 2 +-
sound/usb/caiaq/device.c | 11 +-
sound/usb/misc/ua101.c | 29 +-
sound/usb/mixer.c | 23 +
sound/usb/mixer.h | 2 +
sound/usb/pcm.c | 6 +
tools/include/nolibc/types.h | 6 +-
tools/perf/builtin-lock.c | 61 ++-
tools/perf/tests/pe-file-parsing.c | 2 +-
tools/perf/util/disasm.c | 4 +-
tools/perf/util/evlist.c | 6 +-
tools/perf/util/evsel.c | 61 ++-
tools/perf/util/evsel.h | 1 +
tools/perf/util/symbol.c | 9 +-
tools/testing/cxl/test/cxl.c | 6 +-
.../selftests/bpf/prog_tests/kfunc_dynptr_param.c | 2 +-
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 1 +
.../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 +-
.../tcp_bidir_fast_retransmit_nosack.pkt | 42 ++
tools/testing/selftests/proc/proc-pid-vm.c | 2 -
tools/testing/shared/linux/cleanup.h | 2 +
virt/kvm/eventfd.c | 7 +-
virt/lib/irqbypass.c | 44 +-
731 files changed, 10854 insertions(+), 5123 deletions(-)
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 001/816] netfilter: nft_ct: expectation timeouts are passed in milliseconds
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 002/816] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
` (819 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Westphal, Pablo Neira Ayuso,
Mark Bundschuh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <fw@strlen.de>
[ Upstream commit 6fb421bd07f156cdf0cdede062d31f1c21def326 ]
Userspace passes '5000' in case user asks for 5 seconds.
Allowing for sub-second expectation lifetimes makes sense to me. so
fix up the kernel side instead of munging nft to send a value rounded
up to next second.
Also note that this violates nft convention of passing integers in
network byte order, but we can't change this anymore.
Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 3679da4ad8be ("netfilter: nft_ct: move custom expectation support to helper")
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nft_ct.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 07a879f66fabe..206cfa2734c68 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -1198,11 +1198,23 @@ struct nft_ct_expect_obj {
u32 timeout;
};
+static int nft_ct_expect_timeout_get(const struct nlattr *attr, u32 *val)
+{
+ unsigned long jiffies_val = msecs_to_jiffies(nla_get_u32(attr));
+
+ if (jiffies_val > UINT_MAX)
+ return -ERANGE;
+
+ *val = jiffies_val;
+ return 0;
+}
+
static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
const struct nlattr * const tb[],
struct nft_object *obj)
{
struct nft_ct_expect_obj *priv = nft_obj_data(obj);
+ int err;
if (!tb[NFTA_CT_EXPECT_L4PROTO] ||
!tb[NFTA_CT_EXPECT_DPORT] ||
@@ -1238,8 +1250,11 @@ static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
return -EOPNOTSUPP;
}
+ err = nft_ct_expect_timeout_get(tb[NFTA_CT_EXPECT_TIMEOUT], &priv->timeout);
+ if (err)
+ return err;
+
priv->dport = nla_get_be16(tb[NFTA_CT_EXPECT_DPORT]);
- priv->timeout = nla_get_u32(tb[NFTA_CT_EXPECT_TIMEOUT]);
priv->size = nla_get_u8(tb[NFTA_CT_EXPECT_SIZE]);
return nf_ct_netns_get(ctx->net, ctx->family);
@@ -1259,7 +1274,7 @@ static int nft_ct_expect_obj_dump(struct sk_buff *skb,
if (nla_put_be16(skb, NFTA_CT_EXPECT_L3PROTO, htons(priv->l3num)) ||
nla_put_u8(skb, NFTA_CT_EXPECT_L4PROTO, priv->l4proto) ||
nla_put_be16(skb, NFTA_CT_EXPECT_DPORT, priv->dport) ||
- nla_put_u32(skb, NFTA_CT_EXPECT_TIMEOUT, priv->timeout) ||
+ nla_put_u32(skb, NFTA_CT_EXPECT_TIMEOUT, jiffies_to_msecs(priv->timeout)) ||
nla_put_u8(skb, NFTA_CT_EXPECT_SIZE, priv->size))
return -1;
@@ -1309,7 +1324,7 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
&ct->tuplehash[!dir].tuple.src.u3,
&ct->tuplehash[!dir].tuple.dst.u3,
priv->l4proto, NULL, &priv->dport);
- exp->timeout += priv->timeout * HZ;
+ exp->timeout += priv->timeout;
if (nf_ct_expect_related(exp, 0) != 0)
regs->verdict.code = NF_DROP;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 002/816] netfilter: nft_ct: move custom expectation support to helper
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 001/816] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 003/816] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
` (818 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jaeyeong Lee, Pablo Neira Ayuso,
Mark Bundschuh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <pablo@netfilter.org>
[ Upstream commit 3679da4ad8be84cddaf40bc307fef1fe13e051ff ]
Originally, the ct expectation support called nf_ct_helper_ext_add() for
confirmed conntracks, which is invalid, triggering a splat. This was
fixed by commit 1710eb913bdc ("netfilter: nft_ct: skip expectations for
confirmed conntrack") which restricted it to unconfirmed conntracks.
However, early insertion of expectations into the expectations list when
the conntrack is unconfirmed leads to stale entries pointing to the
wrong hlist_head through .pprev due to ct extension reallocation.
Commit 7c9664351980 ("netfilter: move nat hlist_head to nf_conn") moved
the nat hlist_head to nf_conn for this reason:
1. ...
2. When reallocation of extension area occurs we need to fixup the
bysource hash head via hlist_replace_rcu.
I'd rather not increase the size of the struct nf_conn for this feature
has very limited scope: only one expectation can be created at a time
given expect_clash() will make nf_ct_expect_related() reports EBUSY.
For this reason, relax nf_ct_expect_related() not to drop packets in
case expectation creation fails, therefore, expectation creation becomes
best effort.
To address this issue, add an internal ct helper and attach it to the
conntrack entry to streamline the custom ct expectation support with
existing ct helpers.
Expose a new nf_conntrack_helper_release() function to release the
internal helper that is allocated and attached to the conntrack entry to
create the custom expectations. The nft_ct module removal always waits
for rcu grace period, then the NULL helper callback is observed after
this.
This patch also restricts the creation of expectations to different
helpers other than this custom helper that is created for this type of
expectations.
Fixes: 857b46027d6f ("netfilter: nft_ct: add ct expectations support")
Reported-by: Jaeyeong Lee <iostreampy@proton.me>
Link: https://patch.msgid.link/20260715144755.00ea7dfcd9f@proton.me
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[ - ac46f3f35b6e ("netfilter: nf_conntrack_helper: add refcounting from
datapath") is not backported because it reworks helper lifetime
around a datapath ct_refcnt in 9 files, so one static nft_ct_expect
helper is unhelped at nft_ct module exit.
- d4beefc90a66 ("netfilter: nft_ct: support expectation creation for
natted flows") is not backported because it adds expectation support
for NATed flows, so the moved expectation code has no NAT
follow-master part.
- Context differs due to commit: 6031487d4e27 ]
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netfilter/nf_conntrack_helper.h | 1 +
net/netfilter/nf_conntrack_helper.c | 20 ++--
net/netfilter/nft_ct.c | 100 +++++++++++++++-----
3 files changed, 89 insertions(+), 32 deletions(-)
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 24cf3d2d97450..5b76fa57fd76c 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -105,6 +105,7 @@ void nf_ct_helper_init(struct nf_conntrack_helper *helper,
int nf_conntrack_helper_register(struct nf_conntrack_helper *);
void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
+void nf_conntrack_helper_release(struct nf_conntrack_helper *);
int nf_conntrack_helpers_register(struct nf_conntrack_helper *, unsigned int);
void nf_conntrack_helpers_unregister(struct nf_conntrack_helper *,
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
index 2cef826e20fb9..17538e3382dd1 100644
--- a/net/netfilter/nf_conntrack_helper.c
+++ b/net/netfilter/nf_conntrack_helper.c
@@ -425,6 +425,18 @@ static bool expect_iter_me(struct nf_conntrack_expect *exp, void *data)
return this == me;
}
+void nf_conntrack_helper_release(struct nf_conntrack_helper *me)
+{
+ nf_ct_expect_iterate_destroy(expect_iter_me, me);
+ nf_ct_iterate_destroy(unhelp, me);
+
+ /* nf_ct_iterate_destroy() does an unconditional synchronize_rcu() as
+ * last step, this ensures rcu readers of exp->helper are done.
+ * No need for another synchronize_rcu() here.
+ */
+}
+EXPORT_SYMBOL_GPL(nf_conntrack_helper_release);
+
void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
{
mutex_lock(&nf_ct_helper_mutex);
@@ -437,13 +449,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)
*/
synchronize_rcu();
- nf_ct_expect_iterate_destroy(expect_iter_me, me);
- nf_ct_iterate_destroy(unhelp, me);
-
- /* nf_ct_iterate_destroy() does an unconditional synchronize_rcu() as
- * last step, this ensures rcu readers of exp->helper are done.
- * No need for another synchronize_rcu() here.
- */
+ nf_conntrack_helper_release(me);
}
EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);
diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 206cfa2734c68..60f15bd3b6d17 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -1209,6 +1209,65 @@ static int nft_ct_expect_timeout_get(const struct nlattr *attr, u32 *val)
return 0;
}
+struct nft_ct_expect_data {
+ struct nft_ct_expect_obj obj;
+ enum ip_conntrack_dir dir;
+};
+
+static int ct_expect_help(struct sk_buff *skb, unsigned int protoff,
+ struct nf_conn *ct, enum ip_conntrack_info ctinfo)
+{
+ enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
+ struct nft_ct_expect_data *expect_data;
+ struct nf_conntrack_expect *exp;
+ int ret = NF_ACCEPT;
+ u16 l3num;
+
+ if (nf_ct_is_confirmed(ct))
+ return NF_ACCEPT;
+
+ expect_data = nfct_help_data(ct);
+ if (!expect_data)
+ return NF_ACCEPT;
+
+ if (expect_data->dir != dir)
+ return NF_ACCEPT;
+
+ exp = nf_ct_expect_alloc(ct);
+ if (!exp)
+ return NF_DROP;
+
+ if (expect_data->obj.l3num == NFPROTO_INET)
+ l3num = nf_ct_l3num(ct);
+ else
+ l3num = expect_data->obj.l3num;
+
+ nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, l3num,
+ &ct->tuplehash[!dir].tuple.src.u3,
+ &ct->tuplehash[!dir].tuple.dst.u3,
+ expect_data->obj.l4proto, NULL, &expect_data->obj.dport);
+ exp->timeout += expect_data->obj.timeout;
+
+ if (nf_ct_expect_related(exp, 0) != 0)
+ ret = NF_ACCEPT;
+
+ nf_ct_expect_put(exp);
+
+ return ret;
+}
+
+static const struct nf_conntrack_expect_policy nft_ct_expect_helper_policy = {
+ .max_expected = NF_CT_EXPECT_MAX_CNT,
+};
+
+/* No need to register this helper, this is internal. */
+static struct nf_conntrack_helper nft_ct_expect_helper = {
+ .name = "nft_ct_expect",
+ .me = THIS_MODULE,
+ .expect_policy = &nft_ct_expect_helper_policy,
+ .help = ct_expect_help,
+};
+
static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
const struct nlattr * const tb[],
struct nft_object *obj)
@@ -1216,6 +1275,8 @@ static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
struct nft_ct_expect_obj *priv = nft_obj_data(obj);
int err;
+ NF_CT_HELPER_BUILD_BUG_ON(sizeof(struct nft_ct_expect_data));
+
if (!tb[NFTA_CT_EXPECT_L4PROTO] ||
!tb[NFTA_CT_EXPECT_DPORT] ||
!tb[NFTA_CT_EXPECT_TIMEOUT] ||
@@ -1261,7 +1322,7 @@ static int nft_ct_expect_obj_init(const struct nft_ctx *ctx,
}
static void nft_ct_expect_obj_destroy(const struct nft_ctx *ctx,
- struct nft_object *obj)
+ struct nft_object *obj)
{
nf_ct_netns_put(ctx->net, ctx->family);
}
@@ -1286,11 +1347,9 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
const struct nft_pktinfo *pkt)
{
const struct nft_ct_expect_obj *priv = nft_obj_data(obj);
- struct nf_conntrack_expect *exp;
+ struct nft_ct_expect_data *expect_data;
enum ip_conntrack_info ctinfo;
struct nf_conn_help *help;
- enum ip_conntrack_dir dir;
- u16 l3num = priv->l3num;
struct nf_conn *ct;
ct = nf_ct_get(pkt->skb, &ctinfo);
@@ -1298,38 +1357,28 @@ static void nft_ct_expect_obj_eval(struct nft_object *obj,
regs->verdict.code = NFT_BREAK;
return;
}
- dir = CTINFO2DIR(ctinfo);
help = nfct_help(ct);
- if (!help)
- help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
- if (!help) {
- regs->verdict.code = NF_DROP;
- return;
- }
-
- if (help->expecting[NF_CT_EXPECT_CLASS_DEFAULT] >= priv->size) {
+ if (help) {
regs->verdict.code = NFT_BREAK;
return;
}
- if (l3num == NFPROTO_INET)
- l3num = nf_ct_l3num(ct);
- exp = nf_ct_expect_alloc(ct);
- if (exp == NULL) {
+ help = nf_ct_helper_ext_add(ct, GFP_ATOMIC);
+ if (!help) {
regs->verdict.code = NF_DROP;
return;
}
- nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, l3num,
- &ct->tuplehash[!dir].tuple.src.u3,
- &ct->tuplehash[!dir].tuple.dst.u3,
- priv->l4proto, NULL, &priv->dport);
- exp->timeout += priv->timeout;
- if (nf_ct_expect_related(exp, 0) != 0)
- regs->verdict.code = NF_DROP;
+ expect_data = nfct_help_data(ct);
+ if (!expect_data) {
+ regs->verdict.code = NFT_BREAK;
+ return;
+ }
+ expect_data->obj = *priv;
+ expect_data->dir = CTINFO2DIR(ctinfo);
- nf_ct_expect_put(exp);
+ rcu_assign_pointer(help->helper, &nft_ct_expect_helper);
}
static const struct nla_policy nft_ct_expect_policy[NFTA_CT_EXPECT_MAX + 1] = {
@@ -1409,6 +1458,7 @@ static void __exit nft_ct_module_exit(void)
nft_unregister_obj(&nft_ct_helper_obj_type);
nft_unregister_expr(&nft_notrack_type);
nft_unregister_expr(&nft_ct_type);
+ nf_conntrack_helper_release(&nft_ct_expect_helper);
}
module_init(nft_ct_module_init);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 003/816] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 001/816] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 002/816] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 004/816] drm/amdgpu: Check cs flags Greg Kroah-Hartman
` (817 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Pedro Falcato,
Gregory Price (Meta), Muhammad Usama Anjum, Lance Yang,
Baolin Wang, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit fe2817e3d5ea347214342c9a5cd8bcbff20c0574 ]
try_collapse_pte_mapped_thp() clears PTEs without transferring their dirty
bits to the folio. A shmem read fault can map a clean folio writable, so
a later store only dirties the PTE. Losing that dirty bit allows reclaim
to discard modified data.
The assumption that regular files are read-only is also obsolete since
commit 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse
for writable files"). In any case, transferring PTE dirty bits to the folio
when removing mappings (and while the folio is still mapped) is the right
thing to do.
Use get_and_clear_ptes() to collect the dirty bits and mark the folio
dirty before unmapping it. Update the comment.
This was reproduced with shmem using MADV_COLLAPSE followed by
MADV_PAGEOUT.
Fix generated by an LLM and sent by Chris Mason in private.
Fixes: 27e1f8273113 ("khugepaged: enable collapse pmd for pte-mapped THP")
Fixes: 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse for writable files")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Mason <mason@kernel.org>
[ david: adjust comment; simplify description; cover file-thp as well ]
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-17-d6437171ecc3@kernel.org
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Adapted batched get_and_clear_ptes() handling to the existing single-PTE loop using ptep_get_and_clear(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/khugepaged.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 9b8021d440289..ea94f66cd0377 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1636,9 +1636,10 @@ int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr,
/*
* Must clear entry, or a racing truncate may re-remove it.
* TLB flush can be left until pmdp_collapse_flush() does it.
- * PTE dirty? Shmem page is already dirty; file is read-only.
*/
- ptep_clear(mm, addr, pte);
+ ptent = ptep_get_and_clear(mm, addr, pte);
+ if (pte_dirty(ptent))
+ folio_mark_dirty(folio);
folio_remove_rmap_pte(folio, page, vma);
nr_ptes++;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 004/816] drm/amdgpu: Check cs flags.
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 003/816] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 005/816] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
` (816 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bas Nieuwenhuizen, Faith Ekstrand,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
[ Upstream commit f5ea64f9fcd921bc4e2307a262e19450b8a58524 ]
Had no validation before. libdrm_amdgpu memsets this, even
for the raw/raw2 functions.
We have a lot of functions touching the ioctl struct, no
strong opinion on where this is placed, but I thought
early would be good.
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4d01e15e76358f60ef6734462d2b6d9972b9dfbc)
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 364fbaf4e0fa5..4ad34def4cd13 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -209,6 +209,9 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
int ret;
int i;
+ if (cs->in.flags)
+ return -EINVAL;
+
chunk_array = memdup_array_user(u64_to_user_ptr(cs->in.chunks),
cs->in.num_chunks,
sizeof(uint64_t));
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 005/816] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 004/816] drm/amdgpu: Check cs flags Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 006/816] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
` (815 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Thomas Gleixner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 0f214e5bbee59d5952d3c061fd65ed9a1e175981 ]
__plic_toggle() builds a 32-bit interrupt enable mask using a signed
integer literal. A valid interrupt selecting bit 31 evaluates 1 << 31,
which shifts a signed int into its sign bit.
Use BIT(), matching the equivalent mask construction in plic_irq_eoi().
The resulting mask remains representable in u32 on both RV32 and RV64.
The issue was found by our static-analysis tool.
Fixes: 8237f8bc4f6e ("irqchip: add a SiFive PLIC driver")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: gpt 5
Link: https://patch.msgid.link/caplitmus-rv.v2.plic.87a8fc444de44e109889ba28703c76f3@163.com
[ sashal: Context lines were rebased onto this tree's older __plic_toggle() (direct read-modify-write via reg), and only the 1 << (hwirq % 32) to BIT(hwirq % 32) change was applied. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-sifive-plic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index d57e9b25d0b4d..b061062f47c58 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -97,7 +97,7 @@ static int plic_irq_set_type(struct irq_data *d, unsigned int type);
static void __plic_toggle(void __iomem *enable_base, int hwirq, int enable)
{
u32 __iomem *reg = enable_base + (hwirq / 32) * sizeof(u32);
- u32 hwirq_mask = 1 << (hwirq % 32);
+ u32 hwirq_mask = BIT(hwirq % 32);
if (enable)
writel(readl(reg) | hwirq_mask, reg);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 006/816] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 005/816] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 007/816] bpf: Fix memory access flags in helper prototypes Greg Kroah-Hartman
` (814 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Johannes Weiner, Andrew Morton,
Balbir Singh, Vlastimil Babka (SUSE), Matthew Wilcox (Oracle),
Salvatore Dipietro, Christoph Hellwig, Dave Chinner, Matt Fleming,
Mel Gorman, Michal Hocko, Suren Baghdasaryan, Brendan Jackman,
Zi Yan, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Weiner <hannes@cmpxchg.org>
[ Upstream commit fe21f930d1e64d121191673076fc4ebe79fc82d5 ]
1ebbb21811b7 ("mm/page_alloc: explicitly define how __GFP_HIGH
non-blocking allocations accesses reserves") stopped handing out reserve
access for ALLOC_NON_BLOCK on its own: the extra 25% below the min
watermark is now only granted on top of ALLOC_MIN_RESERVE. But the flag
was left in ALLOC_RESERVES, which produces something odd:
With the ALLOC_RESERVES match, __zone_watermark_unusable_free() doesn't
subtract the free highatomic pages for them. So in the slowpath, they get
to consume regular blocks below the min watermark by the number of free
highatomic pages. The highatomic reserve is capped at 1% of the zone,
which on any decently sized machine is a multiple of the min watermark:
GFP_NOWAIT can drain regular memory to zero.
The user-visible result is brutal hiccups during bursts of GFP_NOWAIT
allocations under memory pressure. This was found in review and
reproduced with a synthetic burst, not observed in production, but the
sequence of events is a realistic one: On a 32G box with an anonymous
working set, swap, and a filled 290M highatomic reserve, a GFP_NOWAIT
burst drove regular free memory in the 28G Normal zone (min=60M) to 28M,
0.8M and 0.6M in three runs. Swapout failed to allocate its swap table,
reclaim scanned 13M pages to reclaim 200k, page faults stalled for tens to
hundreds of milliseconds. The machine survives it, but not by design:
direct reclaimers eventually fail and start unreserving highatomic blocks,
until the allocation succeeds or the reserve is gone and the OOM killer
runs. That reserve exists for high-order atomic allocations; here it is
destroyed to bail out a GFP_NOWAIT consumer that was never entitled to the
memory.
Remove ALLOC_NON_BLOCK from ALLOC_RESERVES. With that, the GFP_NOWAIT
burst is stopped short at the min watermark. No direct reclaim, no
stalls, no failed allocations, and the highatomic reserve stays intact for
the requests it exists for.
__zone_watermark_ok() is unaffected, since everything it keys on
ALLOC_NON_BLOCK is already nested under ALLOC_MIN_RESERVE. Update the
flag comments accordingly: ALLOC_NON_BLOCK just means the caller can't
block; the reserve math belongs with ALLOC_MIN_RESERVE.
GFP_ATOMIC order-0 requests have a milder version of the same problem.
Through ALLOC_MIN_RESERVE they also count the free highatomic pages in
their watermark check, but rmqueue_buddy() serves them regular pages first
and only falls back to the reserve once those are gone. They can still
push regular free memory to 37.5% of min minus the free highatomic pages
before the reserve is touched. Unlike GFP_NOWAIT they are entitled to the
reserve, so this needs the watermark check and the freelist order reworked
together, and is left to a separate patch.
Link: https://lore.kernel.org/20261028171719.2043421-3-hannes@cmpxchg.org
Fixes: 1ebbb21811b7 ("mm/page_alloc: explicitly define how __GFP_HIGH non-blocking allocations accesses reserves")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Balbir Singh <balbirs@nvidia.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Salvatore Dipietro <dipiets@amazon.it>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <dgc@kernel.org>
Cc: Matt Fleming <matt@readmodwrite.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Zi Yan <ziy@nvidia.com>
Cc: <stable@vger.kernel.org>
[ sashal: adjusted the hunk to edit ALLOC_* flags in mm/internal.h instead of mm/page_alloc.h, with context changed since ALLOC_NO_CODETAG is absent ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/internal.h | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/mm/internal.h b/mm/internal.h
index ba332da196e43..41a0b79fd71d3 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1209,12 +1209,11 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
#define ALLOC_OOM ALLOC_NO_WATERMARKS
#endif
-#define ALLOC_NON_BLOCK 0x10 /* Caller cannot block. Allow access
- * to 25% of the min watermark or
- * 62.5% if __GFP_HIGH is set.
- */
+#define ALLOC_NON_BLOCK 0x10 /* Caller cannot block. */
#define ALLOC_MIN_RESERVE 0x20 /* __GFP_HIGH set. Allow access to 50%
- * of the min watermark.
+ * of the min watermark, or 62.5% if
+ * the caller cannot block either
+ * (ALLOC_NON_BLOCK).
*/
#define ALLOC_CPUSET 0x40 /* check for correct cpuset */
#define ALLOC_CMA 0x80 /* allow allocations from CMA areas */
@@ -1227,7 +1226,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
#define ALLOC_KSWAPD 0x800 /* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */
/* Flags that allow allocations below the min watermark. */
-#define ALLOC_RESERVES (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)
+#define ALLOC_RESERVES (ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)
/* Flags that mean GFP_ATOMIC */
#define ALLOC_MASK_ATOMIC (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 007/816] bpf: Fix memory access flags in helper prototypes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 006/816] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 008/816] bpf: Fix verifier assumptions of bpf_d_paths output buffer Greg Kroah-Hartman
` (813 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shuran Liu, Peili Gao, Haoran Ni,
Zesen Liu, Eduard Zingerman, Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zesen Liu <ftyghome@gmail.com>
[ Upstream commit 802eef5afb1865bc5536a5302c068ba2215a1f72 ]
After commit 37cce22dbd51 ("bpf: verifier: Refactor helper access type tracking"),
the verifier started relying on the access type flags in helper
function prototypes to perform memory access optimizations.
Currently, several helper functions utilizing ARG_PTR_TO_MEM lack the
corresponding MEM_RDONLY or MEM_WRITE flags. This omission causes the
verifier to incorrectly assume that the buffer contents are unchanged
across the helper call. Consequently, the verifier may optimize away
subsequent reads based on this wrong assumption, leading to correctness
issues.
For bpf_get_stack_proto_raw_tp, the original MEM_RDONLY was incorrect
since the helper writes to the buffer. Change it to ARG_PTR_TO_UNINIT_MEM
which correctly indicates write access to potentially uninitialized memory.
Similar issues were recently addressed for specific helpers in commit
ac44dcc788b9 ("bpf: Fix verifier assumptions of bpf_d_path's output buffer")
and commit 2eb7648558a7 ("bpf: Specify access type of bpf_sysctl_get_name args").
Fix these prototypes by adding the correct memory access flags.
Fixes: 37cce22dbd51 ("bpf: verifier: Refactor helper access type tracking")
Co-developed-by: Shuran Liu <electronlsr@gmail.com>
Signed-off-by: Shuran Liu <electronlsr@gmail.com>
Co-developed-by: Peili Gao <gplhust955@gmail.com>
Signed-off-by: Peili Gao <gplhust955@gmail.com>
Co-developed-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Zesen Liu <ftyghome@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260120-helper_proto-v3-1-27b0180b4e77@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/helpers.c | 2 +-
kernel/bpf/syscall.c | 2 +-
kernel/trace/bpf_trace.c | 6 +++---
net/core/filter.c | 20 ++++++++++----------
4 files changed, 15 insertions(+), 15 deletions(-)
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -1090,7 +1090,7 @@ const struct bpf_func_proto bpf_snprintf
.func = bpf_snprintf,
.gpl_only = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_MEM_OR_NULL,
+ .arg1_type = ARG_PTR_TO_MEM_OR_NULL | MEM_WRITE,
.arg2_type = ARG_CONST_SIZE_OR_ZERO,
.arg3_type = ARG_PTR_TO_CONST_STR,
.arg4_type = ARG_PTR_TO_MEM | PTR_MAYBE_NULL | MEM_RDONLY,
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -6073,7 +6073,7 @@ static const struct bpf_func_proto bpf_k
.func = bpf_kallsyms_lookup_name,
.gpl_only = false,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_MEM,
+ .arg1_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg2_type = ARG_CONST_SIZE_OR_ZERO,
.arg3_type = ARG_ANYTHING,
.arg4_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_UNINIT | MEM_WRITE | MEM_ALIGNED,
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1030,7 +1030,7 @@ const struct bpf_func_proto bpf_snprintf
.func = bpf_snprintf_btf,
.gpl_only = false,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_MEM,
+ .arg1_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg2_type = ARG_CONST_SIZE,
.arg3_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg4_type = ARG_CONST_SIZE,
@@ -1808,7 +1808,7 @@ static const struct bpf_func_proto bpf_r
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM_OR_NULL,
+ .arg2_type = ARG_PTR_TO_MEM_OR_NULL | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
.arg4_type = ARG_ANYTHING,
};
@@ -1943,7 +1943,7 @@ static const struct bpf_func_proto bpf_g
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
+ .arg2_type = ARG_PTR_TO_UNINIT_MEM,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
.arg4_type = ARG_ANYTHING,
};
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6334,7 +6334,7 @@ static const struct bpf_func_proto bpf_x
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE,
.arg4_type = ARG_ANYTHING,
};
@@ -6389,7 +6389,7 @@ static const struct bpf_func_proto bpf_s
.gpl_only = true,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE,
.arg4_type = ARG_ANYTHING,
};
@@ -7948,9 +7948,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v4_init_sequence() is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct iphdr),
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
};
@@ -7980,9 +7980,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v6_init_sequence() is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct ipv6hdr),
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_RDONLY,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
};
@@ -8000,9 +8000,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v4_check is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct iphdr),
- .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg2_size = sizeof(struct tcphdr),
};
@@ -8024,9 +8024,9 @@ static const struct bpf_func_proto bpf_t
.gpl_only = true, /* __cookie_v6_check is GPL */
.pkt_access = true,
.ret_type = RET_INTEGER,
- .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg1_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg1_size = sizeof(struct ipv6hdr),
- .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM,
+ .arg2_type = ARG_PTR_TO_FIXED_SIZE_MEM | MEM_RDONLY,
.arg2_size = sizeof(struct tcphdr),
};
#endif /* CONFIG_SYN_COOKIES */
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 008/816] bpf: Fix verifier assumptions of bpf_d_paths output buffer
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 007/816] bpf: Fix memory access flags in helper prototypes Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 009/816] bpf: Specify access type of bpf_sysctl_get_name args Greg Kroah-Hartman
` (812 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zesen Liu, Peili Gao, Haoran Ni,
Shuran Liu, Matt Bobrowski, Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuran Liu <electronlsr@gmail.com>
[ Upstream commit ac44dcc788b950606793e8f9690c30925f59df02 ]
Commit 37cce22dbd51 ("bpf: verifier: Refactor helper access type
tracking") started distinguishing read vs write accesses performed by
helpers.
The second argument of bpf_d_path() is a pointer to a buffer that the
helper fills with the resulting path. However, its prototype currently
uses ARG_PTR_TO_MEM without MEM_WRITE.
Before 37cce22dbd51, helper accesses were conservatively treated as
potential writes, so this mismatch did not cause issues. Since that
commit, the verifier may incorrectly assume that the buffer contents
are unchanged across the helper call and base its optimizations on this
wrong assumption. This can lead to misbehaviour in BPF programs that
read back the buffer, such as prefix comparisons on the returned path.
Fix this by marking the second argument of bpf_d_path() as
ARG_PTR_TO_MEM | MEM_WRITE so that the verifier correctly models the
write to the caller-provided buffer.
Fixes: 37cce22dbd51 ("bpf: verifier: Refactor helper access type tracking")
Co-developed-by: Zesen Liu <ftyg@live.com>
Signed-off-by: Zesen Liu <ftyg@live.com>
Co-developed-by: Peili Gao <gplhust955@gmail.com>
Signed-off-by: Peili Gao <gplhust955@gmail.com>
Co-developed-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Haoran Ni <haoran.ni.cs@gmail.com>
Signed-off-by: Shuran Liu <electronlsr@gmail.com>
Reviewed-by: Matt Bobrowski <mattbobrowski@google.com>
Link: https://lore.kernel.org/r/20251206141210.3148-2-electronlsr@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/bpf_trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 2fe05b3d84000..1d6709e261b8c 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -973,7 +973,7 @@ static const struct bpf_func_proto bpf_d_path_proto = {
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_BTF_ID,
.arg1_btf_id = &bpf_d_path_btf_ids[0],
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE_OR_ZERO,
.allowed = bpf_d_path_allowed,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 009/816] bpf: Specify access type of bpf_sysctl_get_name args
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 008/816] bpf: Fix verifier assumptions of bpf_d_paths output buffer Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 010/816] writeback: use a per-sb counter to drain inode wb switches at umount Greg Kroah-Hartman
` (811 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jerome Marchand, Yonghong Song,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Marchand <jmarchan@redhat.com>
[ Upstream commit 2eb7648558a7911f2208e8940cd22ca40e93cc76 ]
The second argument of bpf_sysctl_get_name() helper is a pointer to a
buffer that is being written to. However that isn't specify in the
prototype.
Until commit 37cce22dbd51a ("bpf: verifier: Refactor helper access
type tracking"), all helper accesses were considered as a possible
write access by the verifier, so no big harm was done. However, since
then, the verifier might make wrong asssumption about the content of
that address which might lead it to make faulty optimizations (such as
removing code that was wrongly labeled dead). This is what happens in
test_sysctl selftest to the tests related to sysctl_get_name.
Add MEM_WRITE flag the second argument of bpf_sysctl_get_name().
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250619140603.148942-2-jmarchan@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 0674785e86767..bd47c4cb19910 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -2284,7 +2284,7 @@ static const struct bpf_func_proto bpf_sysctl_get_name_proto = {
.gpl_only = false,
.ret_type = RET_INTEGER,
.arg1_type = ARG_PTR_TO_CTX,
- .arg2_type = ARG_PTR_TO_MEM,
+ .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE,
.arg3_type = ARG_CONST_SIZE,
.arg4_type = ARG_ANYTHING,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 010/816] writeback: use a per-sb counter to drain inode wb switches at umount
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 009/816] bpf: Specify access type of bpf_sysctl_get_name args Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 011/816] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250) Greg Kroah-Hartman
` (810 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner, Jan Kara,
Baokun Li, Tejun Heo, Eric Hagberg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <libaokun@linux.alibaba.com>
commit 31c1d19ead2c26a63859a2757d8b786765ba9cdd upstream.
Tracking in-flight inode wb switches with a single global counter
(isw_nr_in_flight) plus a synchronize_rcu() based wait in
cgroup_writeback_umount() forces every umount to take a global hit
whenever any other superblock on the system has wb switches in flight,
even if the superblock being unmounted has none of its own.
Replace the global synchronize_rcu()/flush_workqueue() pair with a
per-sb counter, s_isw_nr_in_flight, plus three small helpers:
- cgroup_writeback_pin(sb) - increment counter
- cgroup_writeback_unpin(sb) - decrement and wake drainer if last
- cgroup_writeback_drain(sb) - wait for counter to reach zero
The wiring is:
- inode_prepare_wbs_switch() pins before checking SB_ACTIVE and
grabbing the inode; failure paths unpin before returning. A
lockless SB_ACTIVE check at the top of the function lets us skip
the atomic_inc/smp_mb dance once SB_ACTIVE has been cleared (it
is monotonic and never set back).
- process_inode_switch_wbs() unpins after the matching iput().
- cgroup_writeback_umount() drains the per-sb counter via
wait_var_event().
The smp_mb() pair between inode_prepare_wbs_switch() and
cgroup_writeback_umount() keeps the SB_ACTIVE / counter ordering:
either the umounter sees a non-zero counter and waits, or the
switcher sees SB_ACTIVE cleared and aborts before grabbing the
inode.
The global isw_nr_in_flight is left in place, since it is still used
to throttle in-flight switches via WB_FRN_MAX_IN_FLIGHT.
The rcu_read_lock() extension in inode_switch_wbs() and
cleanup_offline_cgwb() that the race fix added is no longer needed
and is reverted; the synchronize_rcu() that the race fix added to
cgroup_writeback_umount() is dropped as well.
The following numbers were measured on a 16 vCPU QEMU guest with 4
background superblocks each churning "create memcg -> write 1 MiB ->
rmdir memcg" to keep the global isw_nr_in_flight non-zero. Latencies
are wall-clock around umount(8); only the target sb's umount is
measured.
Target sb runs its own cgwb churn:
p50 p95 p99 max
global synchronize_rcu() 67.6 ms 88.3 ms 88.3 ms 96.8 ms
per-sb counter (this) 7.9 ms 10.0 ms 10.0 ms 10.1 ms
Idle target umount latency under cross-sb cgwb-switch pressure:
p50 p95 p99 max
global synchronize_rcu() 62.7 ms 95.4 ms 108.1 ms 108.6 ms
per-sb counter (this) 5.3 ms 6.9 ms 7.4 ms 7.4 ms
no-pressure baseline 4.9 ms 5.9 ms 6.3 ms 6.7 ms
8 concurrent umounts of idle sbs under the same pressure:
p50 p95 max
global synchronize_rcu() 61.3 ms 99.5 ms 113.7 ms
per-sb counter (this) 8.1 ms 9.1 ms 9.5 ms
In-kernel cgroup_writeback_umount() time across the same run
(bpftrace, ~340 calls covering all scenarios):
global synchronize_rcu() 12371 ms total (~36 ms / call)
per-sb counter (this) 1.37 ms total ( ~4 us / call)
Suggested-by: Christian Brauner <brauner@kernel.org>
Link: https://lore.kernel.org/r/177910456953.488929.2169908940676707307.b4-review@b4
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Baokun Li <libaokun@linux.alibaba.com>
Link: https://patch.msgid.link/20260521095016.2791354-4-libaokun@linux.alibaba.com
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ ehagberg: Backported to 6.12.y. struct super_block lives in
include/linux/fs.h here, so add the field there. 6.12.y predates the
inode_state_read()/inode_state_set() accessors and the
trace_inode_switch_wbs_queue() tracepoint, so adjust context
accordingly. Also adjust context in cleanup_offline_cgwb() for
"writeback: keep cleanup_offline_cgwb()'s scan out of syncs".
No functional change from upstream. ]
Signed-off-by: Eric Hagberg <ehagberg@janestreet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fs-writeback.c | 97 ++++++++++++++++++++++------------------------
include/linux/fs.h | 8 ++++
2 files changed, 55 insertions(+), 50 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index c195c97717396..eb7f3a525e39b 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -488,6 +488,23 @@ static bool inode_do_switch_wbs(struct inode *inode,
return switched;
}
+static inline void cgroup_writeback_pin(struct super_block *sb)
+{
+ atomic_inc(&sb->s_isw_nr_in_flight);
+}
+
+static inline void cgroup_writeback_unpin(struct super_block *sb)
+{
+ if (atomic_dec_and_test(&sb->s_isw_nr_in_flight))
+ wake_up_var(&sb->s_isw_nr_in_flight);
+}
+
+static inline void cgroup_writeback_drain(struct super_block *sb)
+{
+ wait_var_event(&sb->s_isw_nr_in_flight,
+ !atomic_read(&sb->s_isw_nr_in_flight));
+}
+
static void process_inode_switch_wbs(struct bdi_writeback *new_wb,
struct inode_switch_wbs_context *isw)
{
@@ -546,8 +563,12 @@ static void process_inode_switch_wbs(struct bdi_writeback *new_wb,
wb_put_many(old_wb, nr_switched);
}
- for (inodep = isw->inodes; *inodep; inodep++)
+ for (inodep = isw->inodes; *inodep; inodep++) {
+ struct super_block *sb = (*inodep)->i_sb;
+
iput(*inodep);
+ cgroup_writeback_unpin(sb);
+ }
wb_put(new_wb);
kfree(isw);
atomic_dec(&isw_nr_in_flight);
@@ -590,16 +611,19 @@ void inode_switch_wbs_work_fn(struct work_struct *work)
static bool inode_prepare_wbs_switch(struct inode *inode,
struct bdi_writeback *new_wb)
{
+ /* Avoid the atomic_inc/smp_mb dance once SB_ACTIVE is gone. */
+ if (!(inode->i_sb->s_flags & SB_ACTIVE))
+ return false;
+
/*
- * Paired with smp_mb() in cgroup_writeback_umount().
- * isw_nr_in_flight must be increased before checking SB_ACTIVE and
- * grabbing an inode, otherwise isw_nr_in_flight can be observed as 0
- * in cgroup_writeback_umount() and the isw_wq will be not flushed.
+ * Pairs with smp_mb() in cgroup_writeback_umount(): the umounter either
+ * sees a non-zero counter and waits, or we see SB_ACTIVE clear below.
*/
+ cgroup_writeback_pin(inode->i_sb);
smp_mb();
if (IS_DAX(inode))
- return false;
+ goto out_unpin;
/* while holding I_WB_SWITCH, no one else can update the association */
spin_lock(&inode->i_lock);
@@ -607,13 +631,17 @@ static bool inode_prepare_wbs_switch(struct inode *inode,
inode->i_state & (I_WB_SWITCH | I_FREEING | I_WILL_FREE) ||
inode_to_wb(inode) == new_wb) {
spin_unlock(&inode->i_lock);
- return false;
+ goto out_unpin;
}
inode->i_state |= I_WB_SWITCH;
__iget(inode);
spin_unlock(&inode->i_lock);
return true;
+
+out_unpin:
+ cgroup_writeback_unpin(inode->i_sb);
+ return false;
}
static void wb_queue_isw(struct bdi_writeback *wb,
@@ -652,19 +680,12 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
atomic_inc(&isw_nr_in_flight);
- /*
- * Paired with synchronize_rcu() in cgroup_writeback_umount():
- * holding rcu_read_lock across inode_prepare_wbs_switch()
- * (covering the SB_ACTIVE check and the inode grab) and
- * wb_queue_isw() ensures synchronize_rcu() cannot return until
- * the work is queued, so the subsequent flush_workqueue() will
- * wait for the switch.
- */
- rcu_read_lock();
/* find and pin the new wb */
+ rcu_read_lock();
memcg_css = css_from_id(new_wb_id, &memory_cgrp_subsys);
if (memcg_css && !css_tryget(memcg_css))
memcg_css = NULL;
+ rcu_read_unlock();
if (!memcg_css)
goto out_free;
@@ -679,11 +700,9 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
isw->inodes[0] = inode;
wb_queue_isw(new_wb, isw);
- rcu_read_unlock();
return;
out_free:
- rcu_read_unlock();
atomic_dec(&isw_nr_in_flight);
if (new_wb)
wb_put(new_wb);
@@ -764,14 +783,6 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)
* moved ones. Exclude syncs as process_inode_switch_wbs() does.
*/
down_read(&wb->bdi->wb_switch_rwsem);
- /*
- * Paired with synchronize_rcu() in cgroup_writeback_umount().
- * Holding rcu_read_lock across the SB_ACTIVE check, the inode grab
- * and wb_queue_isw() ensures synchronize_rcu() cannot return until
- * the work is queued, so the subsequent flush_workqueue() will wait
- * for the switch.
- */
- rcu_read_lock();
spin_lock(&wb->list_lock);
/*
* In addition to the inodes that have completed writeback, also switch
@@ -790,7 +801,6 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)
/* no attached inodes? bail out */
if (nr == 0) {
- rcu_read_unlock();
atomic_dec(&isw_nr_in_flight);
wb_put(new_wb);
kfree(isw);
@@ -798,7 +808,6 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)
}
wb_queue_isw(new_wb, isw);
- rcu_read_unlock();
return restart;
}
@@ -1208,39 +1217,27 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
}
/**
- * cgroup_writeback_umount - flush inode wb switches for umount
+ * cgroup_writeback_umount - wait for in-flight inode wb switches on @sb
* @sb: target super_block
*
- * This function is called when a super_block is about to be destroyed and
- * flushes in-flight inode wb switches. An inode wb switch goes through
- * RCU and then workqueue, so the two need to be flushed in order to ensure
- * that all previously scheduled switches are finished. As wb switches are
- * rare occurrences and synchronize_rcu() can take a while, perform
- * flushing iff wb switches are in flight.
+ * Wait until every inode wb switch that already passed the SB_ACTIVE
+ * check on this superblock has been completed by the worker. Since
+ * SB_ACTIVE is cleared before this is called, no new switches can start
+ * for @sb, so s_isw_nr_in_flight will monotonically drop to zero.
*/
void cgroup_writeback_umount(struct super_block *sb)
{
-
if (!(sb->s_bdi->capabilities & BDI_CAP_WRITEBACK))
return;
/*
- * SB_ACTIVE should be reliably cleared before checking
- * isw_nr_in_flight, see generic_shutdown_super().
+ * Pairs with smp_mb() in inode_prepare_wbs_switch(): we either observe
+ * a non-zero counter and wait, or the switcher sees SB_ACTIVE clear
+ * (cleared by generic_shutdown_super()) and bails before grabbing the
+ * inode.
*/
smp_mb();
-
- if (atomic_read(&isw_nr_in_flight)) {
- /*
- * Paired with rcu_read_lock() in inode_switch_wbs() and
- * cleanup_offline_cgwb(). synchronize_rcu() waits for any
- * in-flight switcher that already passed the SB_ACTIVE check
- * to finish queueing its work, so flush_workqueue() below
- * will then drain it.
- */
- synchronize_rcu();
- flush_workqueue(isw_wq);
- }
+ cgroup_writeback_drain(sb);
}
static int __init cgroup_writeback_init(void)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 67b57ce46b203..fc63611ac3c6c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1443,6 +1443,14 @@ struct super_block {
spinlock_t s_inode_wblist_lock;
struct list_head s_inodes_wb; /* writeback inodes */
+
+#ifdef CONFIG_CGROUP_WRITEBACK
+ /*
+ * Number of in-flight inode wb switches for this sb. Drained by
+ * cgroup_writeback_umount() before tear-down.
+ */
+ atomic_t s_isw_nr_in_flight;
+#endif
} __randomize_layout;
static inline struct user_namespace *i_user_ns(const struct inode *inode)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 011/816] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250)
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 010/816] writeback: use a per-sb counter to drain inode wb switches at umount Greg Kroah-Hartman
@ 2026-11-25 14:25 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 012/816] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 Greg Kroah-Hartman
` (809 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:25 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthias Dittrich, Rafael J. Wysocki,
Sasha Levin
6.12-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 9f9f580e393c7..754c3936db099 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -1047,6 +1047,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] 825+ messages in thread
* [PATCH 6.12 012/816] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-11-25 14:25 ` [PATCH 6.12 011/816] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250) Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 013/816] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] Greg Kroah-Hartman
` (808 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hakan Abay, Rafael J. Wysocki,
Sasha Levin
6.12-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 754c3936db099..aaa07997fdf31 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -1061,6 +1061,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] 825+ messages in thread
* [PATCH 6.12 013/816] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[]
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 012/816] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 014/816] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
` (807 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krittikun Wongnin, Rafael J. Wysocki,
Sasha Levin
6.12-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 aaa07997fdf31..d2c3ec958e4aa 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -1073,6 +1073,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] 825+ messages in thread
* [PATCH 6.12 014/816] fs: aio: reject partial mremap to avoid Null-pointer-dereference error
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 013/816] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 015/816] bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature Greg Kroah-Hartman
` (806 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zizhi Wo, Jan Kara,
Christian Brauner, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zizhi Wo <wozizhi@huawei.com>
[ Upstream commit 3adf7ae18bf42601246031002287c103a27df307 ]
[BUG]
Recently, our internal syzkaller testing uncovered a null pointer
dereference issue:
BUG: kernel NULL pointer dereference, address: 0000000000000000
...
[ 51.111664] filemap_read_folio+0x25/0xe0
[ 51.112410] filemap_fault+0xad7/0x1250
[ 51.113112] __do_fault+0x4b/0x460
[ 51.113699] do_pte_missing+0x5bc/0x1db0
[ 51.114250] ? __pte_offset_map+0x23/0x170
[ 51.114822] __handle_mm_fault+0x9f8/0x1680
...
Crash analysis showed the file involved was an AIO ring file. The
phenomenon triggered is the same as the issue described in [1].
[CAUSE]
Consider the following scenario: userspace sets up an AIO context via
io_setup(), which creates a VMA covering the entire ring buffer. Then
userspace calls mremap() with the AIO ring address as the source, a smaller
old_len (less than the full ring size), MREMAP_MAYMOVE set, and without
MREMAP_DONTUNMAP. The kernel will relocate the requested portion to a new
destination address.
During this move, __split_vma() splits the original AIO ring VMA. The
requested portion is unmapped from the source and re-established at the
destination, while the remainder stays at the original source address as
an orphan VMA. The aio_ring_mremap() callback fires on the new destination
VMA, updating ctx->mmap_base to the destination address. But the callback
is unaware that only a partial region was moved and that an orphan VMA
still exists at the source:
source(AIO):
+-------------------+---------------------+
| moved to dest | orphan VMA (AIO) |
+-------------------+---------------------+
A A+partial_len A+ctx->mmap_size
dest:
+-------------------+
| moved VMA (AIO) |
+-------------------+
B B+partial_len
Later, io_destroy() calls vm_munmap(ctx->mmap_base, ctx->mmap_size), which
unmaps the destination. This not only fails to unmap the orphan VMA at the
source, but also overshoots the destination VMA and may unmap unrelated
mappings adjacent to it! After put_aio_ring_file() calls truncate_setsize()
to remove all pages from the pagecache, any subsequent access to the orphan
VMA triggers filemap_fault(), which calls a_ops->read_folio(). Since aio
does not implement read_folio, this results in a NULL pointer dereference.
[FIX]
Note that expanding mremap (new_len > old_len) is already rejected because
AIO ring VMAs are created with VM_DONTEXPAND. The only problematic case is
a partial move where "old_len == new_len" but both are smaller than the
full ring size.
Fix this by checking in aio_ring_mremap() that the new VMA covers the
entire ring. This ensures the AIO ring is always moved as a whole,
preventing orphan VMAs and the subsequent crash.
[1]: https://lore.kernel.org/all/20260413010814.548568-1-wozizhi@huawei.com/
Signed-off-by: Zizhi Wo <wozizhi@huaweicloud.com>
Link: https://patch.msgid.link/20260418060634.3713620-1-wozizhi@huaweicloud.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/aio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/aio.c b/fs/aio.c
index 44447e4af6286..eac137a3a2b30 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -369,7 +369,8 @@ static int aio_ring_mremap(struct vm_area_struct *vma)
ctx = rcu_dereference(table->table[i]);
if (ctx && ctx->aio_ring_file == file) {
- if (!atomic_read(&ctx->dead)) {
+ if (!atomic_read(&ctx->dead) &&
+ (ctx->mmap_size == (vma->vm_end - vma->vm_start))) {
ctx->user_id = ctx->mmap_base = vma->vm_start;
res = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 015/816] bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 014/816] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 016/816] sched/deadline: Fix dl_server time accounting Greg Kroah-Hartman
` (805 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xianrui Dong, KP Singh, Amery Hung,
Song Liu, Daniel Borkmann, Kumar Kartikeya Dwivedi, Yingke Xiao,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: KP Singh <kpsingh@kernel.org>
[ Upstream commit 49b18315be4eecfc36b75f4aecb4d40a87d68a20 ]
__bpf_dynptr_data() can return NULL (FILE dynptrs, any non-contiguous
backing). bpf_verify_pkcs7_signature() forwards the pointer to
verify_pkcs7_signature() unchecked, causing a NULL deref in
asn1_ber_decoder() reachable from a sleepable BPF LSM at lsm.s/bpf.
NULL-check both pointers and reject with -EINVAL. Mirrors the guards
already in kernel/bpf/crypto.c.
Fixes: 865b0566d8f1 ("bpf: Add bpf_verify_pkcs7_signature() kfunc")
Reported-by: Xianrui Dong <dongxianrui1@gmail.com>
Signed-off-by: KP Singh <kpsingh@kernel.org>
Reviewed-by: Amery Hung <ameryhung@gmail.com>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20260520024059.313468-1-kpsingh@kernel.org
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[ In 6.12.y, bpf_verify_pkcs7_signature() lives in kernel/trace/bpf_trace.c
instead of kernel/bpf/helpers.c. Adapt to kernel/trace/bpf_trace.c. ]
Signed-off-by: Yingke Xiao <inkxiao12@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/bpf_trace.c | 5 +++++
tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 1d6709e261b8c..a174d4b27d662 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1408,8 +1408,13 @@ __bpf_kfunc int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_p,
data_len = __bpf_dynptr_size(data_ptr);
data = __bpf_dynptr_data(data_ptr, data_len);
+ if (!data)
+ return -EINVAL;
+
sig_len = __bpf_dynptr_size(sig_ptr);
sig = __bpf_dynptr_data(sig_ptr, sig_len);
+ if (!sig)
+ return -EINVAL;
return verify_pkcs7_signature(data, data_len, sig, sig_len,
trusted_keyring->key,
diff --git a/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c b/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c
index 8cd298b78e44a..04aaf4c9cf5ee 100644
--- a/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c
+++ b/tools/testing/selftests/bpf/prog_tests/kfunc_dynptr_param.c
@@ -14,7 +14,7 @@ static struct {
const char *prog_name;
int expected_runtime_err;
} kfunc_dynptr_tests[] = {
- {"dynptr_data_null", -EBADMSG},
+ {"dynptr_data_null", -EINVAL},
};
static bool kfunc_not_supported;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 016/816] sched/deadline: Fix dl_server time accounting
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 015/816] bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 017/816] sched/deadline: Fix dl_server stop condition Greg Kroah-Hartman
` (804 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel),
Florent Carli, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
commit e636ffb9e31b4f7dde7fef5358669266b9ce02ec upstream.
The dl_server time accounting code is a little odd. The normal scheduler
pattern is to update curr before doing something, such that the old state is
fully accounted before changing state.
Notably, the dl_server_timer() needs to propagate the current time accounting
since the current task could be ran by dl_server and thus this can affect
dl_se->runtime. Similarly for dl_server_start().
And since the (deferred) dl_server wants idle time accounted, rework
sched_idle_class time accounting to be more like all the others.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251020141130.GJ3245006@noisy.programming.kicks-ass.net
[ Florent: rq->donor does not exist in 6.12, use rq->curr ]
Signed-off-by: Florent Carli <fcarli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/deadline.c | 40 +++++++++++++++-------------------------
kernel/sched/fair.c | 9 ++-------
kernel/sched/idle.c | 16 +++++++++++++++-
kernel/sched/sched.h | 3 +--
4 files changed, 33 insertions(+), 35 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index f5c64d1a019d5..2e3bd43afd535 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1216,8 +1216,12 @@ static enum hrtimer_restart dl_server_timer(struct hrtimer *timer, struct sched_
sched_clock_tick();
update_rq_clock(rq);
- if (!dl_se->dl_runtime)
- return HRTIMER_NORESTART;
+ /*
+ * Make sure current has propagated its pending runtime into
+ * any relevant server through calling dl_server_update() and
+ * friends.
+ */
+ rq->curr->sched_class->update_curr(rq);
if (dl_se->dl_defer_armed) {
/*
@@ -1594,35 +1598,16 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64
* as time available for the fair server, avoiding a penalty for the
* rt scheduler that did not consumed that time.
*/
-void dl_server_update_idle_time(struct rq *rq, struct task_struct *p)
+void dl_server_update_idle(struct sched_dl_entity *dl_se, s64 delta_exec)
{
- s64 delta_exec;
-
- if (!rq->fair_server.dl_defer)
- return;
-
- /* no need to discount more */
- if (rq->fair_server.runtime < 0)
- return;
-
- delta_exec = rq_clock_task(rq) - p->se.exec_start;
- if (delta_exec < 0)
- return;
-
- rq->fair_server.runtime -= delta_exec;
-
- if (rq->fair_server.runtime < 0) {
- rq->fair_server.dl_defer_running = 0;
- rq->fair_server.runtime = 0;
- }
-
- p->se.exec_start = rq_clock_task(rq);
+ if (dl_se->dl_server_active && dl_se->dl_runtime && dl_se->dl_defer)
+ update_curr_dl_se(dl_se->rq, dl_se, delta_exec);
}
void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)
{
/* 0 runtime = fair server disabled */
- if (dl_se->dl_runtime)
+ if (dl_se->dl_server_active && dl_se->dl_runtime)
update_curr_dl_se(dl_se->rq, dl_se, delta_exec);
}
@@ -1849,6 +1834,11 @@ void dl_server_start(struct sched_dl_entity *dl_se)
if (!dl_se->dl_runtime || dl_se->dl_server_active)
return;
+ /*
+ * Update the current task to 'now'.
+ */
+ rq->curr->sched_class->update_curr(rq);
+
if (WARN_ON_ONCE(!cpu_online(cpu_of(rq))))
return;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 020a39fe0e7b3..7e5179189660b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1259,8 +1259,7 @@ static void update_curr(struct cfs_rq *cfs_rq)
* against fair_server such that it can account for this time
* and possibly avoid running this period.
*/
- if (dl_server_active(&rq->fair_server))
- dl_server_update(&rq->fair_server, delta_exec);
+ dl_server_update(&rq->fair_server, delta_exec);
}
account_cfs_rq_runtime(cfs_rq, delta_exec);
@@ -7114,12 +7113,8 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
goto enqueue_throttle;
}
- if (!rq_h_nr_queued && rq->cfs.h_nr_queued) {
- /* Account for idle runtime */
- if (!rq->nr_running)
- dl_server_update_idle_time(rq, rq->curr);
+ if (!rq_h_nr_queued && rq->cfs.h_nr_queued)
dl_server_start(&rq->fair_server);
- }
/* At this point se is NULL and we are at root level*/
add_nr_running(rq, 1);
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 1f0f0d9a5a5cf..a2ab252e7d53e 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -471,9 +471,11 @@ static void wakeup_preempt_idle(struct rq *rq, struct task_struct *p, int flags)
resched_curr(rq);
}
+static void update_curr_idle(struct rq *rq);
+
static void put_prev_task_idle(struct rq *rq, struct task_struct *prev, struct task_struct *next)
{
- dl_server_update_idle_time(rq, prev);
+ update_curr_idle(rq);
scx_update_idle(rq, false, true);
}
@@ -521,6 +523,7 @@ dequeue_task_idle(struct rq *rq, struct task_struct *p, int flags)
*/
static void task_tick_idle(struct rq *rq, struct task_struct *curr, int queued)
{
+ update_curr_idle(rq);
}
static void switched_to_idle(struct rq *rq, struct task_struct *p)
@@ -536,6 +539,17 @@ prio_changed_idle(struct rq *rq, struct task_struct *p, int oldprio)
static void update_curr_idle(struct rq *rq)
{
+ struct sched_entity *se = &rq->idle->se;
+ u64 now = rq_clock_task(rq);
+ s64 delta_exec;
+
+ delta_exec = now - se->exec_start;
+ if (unlikely(delta_exec <= 0))
+ return;
+
+ se->exec_start = now;
+
+ dl_server_update_idle(&rq->fair_server, delta_exec);
}
/*
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 5e788dc39f630..598dd26fe5a69 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -411,14 +411,13 @@ extern s64 dl_scaled_delta_exec(struct rq *rq, struct sched_dl_entity *dl_se, s6
* naturally thottled to once per period, avoiding high context switch
* workloads from spamming the hrtimer program/cancel paths.
*/
+extern void dl_server_update_idle(struct sched_dl_entity *dl_se, s64 delta_exec);
extern void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec);
extern void dl_server_start(struct sched_dl_entity *dl_se);
extern void dl_server_stop(struct sched_dl_entity *dl_se);
extern void dl_server_init(struct sched_dl_entity *dl_se, struct rq *rq,
dl_server_pick_f pick_task);
-extern void dl_server_update_idle_time(struct rq *rq,
- struct task_struct *p);
extern void fair_server_init(struct rq *rq);
extern void __dl_server_attach_root(struct sched_dl_entity *dl_se, struct rq *rq);
extern int dl_server_apply_params(struct sched_dl_entity *dl_se,
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 017/816] sched/deadline: Fix dl_server stop condition
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 016/816] sched/deadline: Fix dl_server time accounting Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 018/816] sched: Provide idle_rq() helper Greg Kroah-Hartman
` (803 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gabriele Monaco,
Peter Zijlstra (Intel), Florent Carli, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
commit f5a538c07df26f5c601e41f7b9c7ade3e1e75803 upstream.
Gabriel reported that the dl_server doesn't stop as expected.
The problem was found to be the fact that idle time and fair runtime are
treated equally. Both will count towards dl_server runtime and push the
activation forwards when it is in the zero-laxity wait state.
Notably:
dl_server_update_idle()
update_curr_dl_se()
if (dl_defer && dl_throttled && dl_runtime_exceeded())
hrtimer_try_to_cancel(); // stop timer
replenish_dl_new_period()
deadline = now + dl_deadline; // fwd period
runtime = dl_runtime;
start_dl_timer(); // restart timer
And while we do want idle time accounted towards the *current* activation of
the dl_server -- after all, a fair task could've ran if we had any -- we don't
necessarily want idle time to cause or push forward an activation.
Introduce dl_defer_idle to make this distinction. It will be set once idle time
pushed the activation forward, once set idle time will only be allowed to
consume any runtime but not push the activation. This will then cause
dl_server_timer() to fire, which will stop the dl_server.
Any non-idle time accounting during this phase will clear dl_defer_idle, so
only a full period of idle will cause the dl_server to stop.
Reported-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251101000057.GA2184199@noisy.programming.kicks-ass.net
Signed-off-by: Florent Carli <fcarli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sched.h | 15 +++++++++------
kernel/sched/deadline.c | 40 ++++++++++++++++++++++++++++++++++++++--
2 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1c584a1f0b835..7f0fb62df348e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -650,20 +650,22 @@ struct sched_dl_entity {
*
* @dl_server tells if this is a server entity.
*
- * @dl_defer tells if this is a deferred or regular server. For
- * now only defer server exists.
- *
- * @dl_defer_armed tells if the deferrable server is waiting
- * for the replenishment timer to activate it.
- *
* @dl_server_active tells if the dlserver is active(started).
* dlserver is started on first cfs enqueue on an idle runqueue
* and is stopped when a dequeue results in 0 cfs tasks on the
* runqueue. In other words, dlserver is active only when cpu's
* runqueue has atleast one cfs task.
*
+ * @dl_defer tells if this is a deferred or regular server. For
+ * now only defer server exists.
+ *
+ * @dl_defer_armed tells if the deferrable server is waiting
+ * for the replenishment timer to activate it.
+ *
* @dl_defer_running tells if the deferrable server is actually
* running, skipping the defer phase.
+ *
+ * @dl_defer_idle tracks idle state
*/
unsigned int dl_throttled : 1;
unsigned int dl_yielded : 1;
@@ -674,6 +676,7 @@ struct sched_dl_entity {
unsigned int dl_defer : 1;
unsigned int dl_defer_armed : 1;
unsigned int dl_defer_running : 1;
+ unsigned int dl_defer_idle : 1;
/*
* Bandwidth enforcement timer. Each -deadline task has its
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 2e3bd43afd535..ea64ab4364f77 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1223,6 +1223,11 @@ static enum hrtimer_restart dl_server_timer(struct hrtimer *timer, struct sched_
*/
rq->curr->sched_class->update_curr(rq);
+ if (dl_se->dl_defer_idle) {
+ dl_server_stop(dl_se);
+ return HRTIMER_NORESTART;
+ }
+
if (dl_se->dl_defer_armed) {
/*
* First check if the server could consume runtime in background.
@@ -1473,10 +1478,11 @@ s64 dl_scaled_delta_exec(struct rq *rq, struct sched_dl_entity *dl_se, s64 delta
}
static inline void
-update_stats_dequeue_dl(struct dl_rq *dl_rq, struct sched_dl_entity *dl_se,
- int flags);
+update_stats_dequeue_dl(struct dl_rq *dl_rq, struct sched_dl_entity *dl_se, int flags);
+
static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64 delta_exec)
{
+ bool idle = rq->curr == rq->idle;
s64 scaled_delta_exec;
if (unlikely(delta_exec <= 0)) {
@@ -1497,6 +1503,9 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64
dl_se->runtime -= scaled_delta_exec;
+ if (dl_se->dl_defer_idle && !idle)
+ dl_se->dl_defer_idle = 0;
+
/*
* The fair server can consume its runtime while throttled (not queued/
* running as regular CFS).
@@ -1506,6 +1515,29 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64
* starting a new period, pushing the activation.
*/
if (dl_se->dl_defer && dl_se->dl_throttled && dl_runtime_exceeded(dl_se)) {
+ /*
+ * Non-servers would never get time accounted while throttled.
+ */
+ WARN_ON_ONCE(!dl_server(dl_se));
+
+ /*
+ * While the server is marked idle, do not push out the
+ * activation further, instead wait for the period timer
+ * to lapse and stop the server.
+ */
+ if (dl_se->dl_defer_idle && idle) {
+ /*
+ * The timer is at the zero-laxity point, this means
+ * dl_server_stop() / dl_server_start() can happen
+ * while now < deadline. This means update_dl_entity()
+ * will not replenish. Additionally start_dl_timer()
+ * will be set for 'deadline - runtime'. Negative
+ * runtime will not do.
+ */
+ dl_se->runtime = 0;
+ return;
+ }
+
/*
* If the server was previously activated - the starving condition
* took place, it this point it went away because the fair scheduler
@@ -1518,6 +1550,9 @@ static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64
replenish_dl_new_period(dl_se, dl_se->rq);
+ if (idle)
+ dl_se->dl_defer_idle = 1;
+
/*
* Not being able to start the timer seems problematic. If it could not
* be started for whatever reason, we need to "unthrottle" the DL server
@@ -1857,6 +1892,7 @@ void dl_server_stop(struct sched_dl_entity *dl_se)
hrtimer_try_to_cancel(&dl_se->dl_timer);
dl_se->dl_defer_armed = 0;
dl_se->dl_throttled = 0;
+ dl_se->dl_defer_idle = 0;
dl_se->dl_server_active = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 018/816] sched: Provide idle_rq() helper
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 017/816] sched/deadline: Fix dl_server stop condition Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 019/816] sched/deadline: Fix server stopping with runnable tasks Greg Kroah-Hartman
` (802 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel),
Florent Carli, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
commit 1e0a2ba7afb1b60f02599093d84b72ce62ad11c0 upstream.
A fix for the dl_server 'requires' idle_cpu() usage, which made me
note that it and available_idle_cpu() are extern function calls.
And while idle_cpu() is used outside of kernel/sched/,
available_idle_cpu() is not.
This makes it hard to make idle_cpu() an inline helper, so provide
idle_rq() and implement idle_cpu() and available_idle_cpu() using
that.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
[ Florent: rq->ttwu_pending only exists with CONFIG_SMP in 6.12 ]
Signed-off-by: Florent Carli <fcarli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sched.h | 1 -
kernel/sched/sched.h | 28 ++++++++++++++++++++++++++++
kernel/sched/syscalls.c | 32 +-------------------------------
3 files changed, 29 insertions(+), 32 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7f0fb62df348e..efee6139c6af6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1895,7 +1895,6 @@ static inline int task_nice(const struct task_struct *p)
extern int can_nice(const struct task_struct *p, const int nice);
extern int task_curr(const struct task_struct *p);
extern int idle_cpu(int cpu);
-extern int available_idle_cpu(int cpu);
extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *);
extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *);
extern void sched_set_fifo(struct task_struct *p);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 598dd26fe5a69..27de9290235e7 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1390,6 +1390,34 @@ static inline u32 sched_rng(void)
#define cpu_curr(cpu) (cpu_rq(cpu)->curr)
#define raw_rq() raw_cpu_ptr(&runqueues)
+static inline bool idle_rq(struct rq *rq)
+{
+ if (rq->curr != rq->idle || rq->nr_running)
+ return false;
+#ifdef CONFIG_SMP
+ if (rq->ttwu_pending)
+ return false;
+#endif
+ return true;
+}
+
+/**
+ * available_idle_cpu - is a given CPU idle for enqueuing work.
+ * @cpu: the CPU in question.
+ *
+ * Return: 1 if the CPU is currently idle. 0 otherwise.
+ */
+static inline bool available_idle_cpu(int cpu)
+{
+ if (!idle_rq(cpu_rq(cpu)))
+ return 0;
+
+ if (vcpu_is_preempted(cpu))
+ return 0;
+
+ return 1;
+}
+
#ifdef CONFIG_SCHED_CORE
static inline struct cpumask *sched_group_span(struct sched_group *sg);
diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c
index b51b39a109e01..f31fcdcfe6734 100644
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.c
@@ -201,37 +201,7 @@ int task_prio(const struct task_struct *p)
*/
int idle_cpu(int cpu)
{
- struct rq *rq = cpu_rq(cpu);
-
- if (rq->curr != rq->idle)
- return 0;
-
- if (rq->nr_running)
- return 0;
-
-#ifdef CONFIG_SMP
- if (rq->ttwu_pending)
- return 0;
-#endif
-
- return 1;
-}
-
-/**
- * available_idle_cpu - is a given CPU idle for enqueuing work.
- * @cpu: the CPU in question.
- *
- * Return: 1 if the CPU is currently idle. 0 otherwise.
- */
-int available_idle_cpu(int cpu)
-{
- if (!idle_cpu(cpu))
- return 0;
-
- if (vcpu_is_preempted(cpu))
- return 0;
-
- return 1;
+ return idle_rq(cpu_rq(cpu));
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 019/816] sched/deadline: Fix server stopping with runnable tasks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 018/816] sched: Provide idle_rq() helper Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 020/816] xfs: only assert new size for datafork during truncate extents Greg Kroah-Hartman
` (801 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gabriele Monaco,
Peter Zijlstra (Intel), Florent Carli, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriele Monaco <gmonaco@redhat.com>
commit ca1e8eede4fc68ce85a9fdce1a6c13ad64933318 upstream.
The deadline server can currently stop due to idle although fair tasks
are runnable. This happens essentially when:
* the server is set to idle, a task wakes up, the server stops
* a task wakes up, the server sets itself to idle and stops right away
Address both cases by clearing the server idle flag whenever a fair task
wakes up and accounting also for pending tasks in the definition of idle.
Fixes: f5a538c07df2 ("sched/deadline: Fix dl_server stop condition")
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260113085159.114226-3-gmonaco@redhat.com
[ Florent: context conflict in dl_server_start(), which still
initializes the fair server in 6.12 ]
Signed-off-by: Florent Carli <fcarli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/deadline.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index ea64ab4364f77..2da68de709135 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1482,7 +1482,7 @@ update_stats_dequeue_dl(struct dl_rq *dl_rq, struct sched_dl_entity *dl_se, int
static void update_curr_dl_se(struct rq *rq, struct sched_dl_entity *dl_se, s64 delta_exec)
{
- bool idle = rq->curr == rq->idle;
+ bool idle = idle_rq(rq);
s64 scaled_delta_exec;
if (unlikely(delta_exec <= 0)) {
@@ -1663,8 +1663,8 @@ void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)
* | 8 | B:zero_laxity-wait | | |
* | | | <---+ |
* | +--------------------------------+ |
- * | | ^ ^ 2 |
- * | | 7 | 2 +--------------------+
+ * | | ^ ^ 2 |
+ * | | 7 | 2, 1 +----------------+
* | v |
* | +-------------+ |
* +-- | C:idle-wait | -+
@@ -1709,8 +1709,11 @@ void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)
* dl_defer_idle = 0
*
*
- * [1] A->B, A->D
+ * [1] A->B, A->D, C->B
* dl_server_start()
+ * dl_defer_idle = 0;
+ * if (dl_server_active)
+ * return; // [B]
* dl_server_active = 1;
* enqueue_dl_entity()
* update_dl_entity(WAKEUP)
@@ -1825,6 +1828,7 @@ void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)
* "B:zero_laxity-wait" -> "C:idle-wait" [label="7:dl_server_update_idle"]
* "B:zero_laxity-wait" -> "D:running" [label="3:dl_server_timer"]
* "C:idle-wait" -> "A:init" [label="8:dl_server_timer"]
+ * "C:idle-wait" -> "B:zero_laxity-wait" [label="1:dl_server_start"]
* "C:idle-wait" -> "B:zero_laxity-wait" [label="2:dl_server_update"]
* "C:idle-wait" -> "C:idle-wait" [label="7:dl_server_update_idle"]
* "D:running" -> "A:init" [label="4:pick_task_dl"]
@@ -1850,6 +1854,7 @@ void dl_server_start(struct sched_dl_entity *dl_se)
{
struct rq *rq = dl_se->rq;
+ dl_se->dl_defer_idle = 0;
/*
* XXX: the apply do not work fine at the init phase for the
* fair server because things are not yet set. We need to improve
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 020/816] xfs: only assert new size for datafork during truncate extents
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 019/816] sched/deadline: Fix server stopping with runnable tasks Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 021/816] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts" Greg Kroah-Hartman
` (800 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Darrick J. Wong, Long Li,
Carlos Maiolino, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Long Li <leo.lilong@huawei.com>
[ Upstream commit e942498385bf80f4d6d075b47174035545eb6a2e ]
The assertion functions properly because we currently only truncate the
attr to a zero size. Any other new size of the attr is not preempted.
Make this assertion is specific to the datafork, preparing for
subsequent patches to truncate the attribute to a non-zero size.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Long Li <leo.lilong@huawei.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/xfs_inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 3b487341348a0..5abdcf1f46c96 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1025,7 +1025,8 @@ xfs_itruncate_extents_flags(
xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
if (atomic_read(&VFS_I(ip)->i_count))
xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL);
- ASSERT(new_size <= XFS_ISIZE(ip));
+ if (whichfork == XFS_DATA_FORK)
+ ASSERT(new_size <= XFS_ISIZE(ip));
ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
ASSERT(ip->i_itemp != NULL);
ASSERT(ip->i_itemp->ili_lock_flags == 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 021/816] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts"
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 020/816] xfs: only assert new size for datafork during truncate extents Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 022/816] netrom: send the unacknowledged frames again when T1 or T4 expires Greg Kroah-Hartman
` (799 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 3bc8829ce42925dc384b4d5c4fb355e380ad1cb7.
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] 825+ messages in thread
* [PATCH 6.12 022/816] netrom: send the unacknowledged frames again when T1 or T4 expires
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 021/816] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts" Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 023/816] ax25: drop a message being reassembled when a new one starts Greg Kroah-Hartman
` (798 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
When T1 expires in state 3, nr_t1timer_expiry() moves the frames of the
ack queue back to the write queue with nr_requeue_frames(), but does not
call nr_kick(). nr_kick() only runs when a frame comes in from the peer
or when the application writes, so if the peer stays silent (one way
transfer, last frame or its acknowledgment lost) nothing is sent
again: after N2 expiries the circuit is cleared with ETIMEDOUT without
a single retransmission. The comment above nr_requeue_frames() says the
frames are "picked up by nr_kick called from the timer", but no timer
calls it.
T4 has the same gap: when the peer's busy condition times out, the
frames held back while it was choked stay queued until something else
calls nr_kick().
Call nr_kick() after nr_requeue_frames() in the T1 expiry, and after
clearing NR_COND_PEER_RX_BUSY in the T4 expiry. nr_kick() already does
nothing outside state 3 or while the peer is busy, and sends from V(A)
once the ack queue is empty, so the T1 retransmission resends the
window from the first unacknowledged frame. The N2 count and the time
at which the circuit is cleared are unchanged.
Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a
serial mkiss port: the guest under test runs netrom with T1 = 5 s,
N2 = 3 and T4 = 3 s; the other guest plays a NET/ROM node from user
space with an AX.25 socket and acknowledges nothing.
- three frames written on a circuit: before, each was sent once and
the circuit was cleared 20.7 s later; after, the three are sent
again at 5.4, 10.5 and 15.6 s and the circuit is still cleared
20.7 s later;
- the peer acknowledges the first frame with CHOKE, then a second
frame is written: before, it was never sent; after, it goes out when
T4 expires (3.1 s after the CHOKE), then again on T1.
No kernel report in either run.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit d07ed33f39eca24db1f1b15e00ef7c4447408a0d)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netrom/nr_subr.c | 6 +++---
net/netrom/nr_timer.c | 4 ++++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/netrom/nr_subr.c b/net/netrom/nr_subr.c
index c3bbd5880850b..144d9c5ea5b17 100644
--- a/net/netrom/nr_subr.c
+++ b/net/netrom/nr_subr.c
@@ -61,9 +61,9 @@ void nr_frames_acked(struct sock *sk, unsigned short nr)
}
/*
- * Requeue all the un-ack-ed frames on the output queue to be picked
- * up by nr_kick called from the timer. This arrangement handles the
- * possibility of an empty output queue.
+ * Requeue all the un-ack-ed frames on the output queue to be sent
+ * again by nr_kick(), which the T1 timer calls next. This arrangement
+ * handles the possibility of an empty output queue.
*/
void nr_requeue_frames(struct sock *sk)
{
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
index 5e3ca068f04e0..efa5cf6d7bf55 100644
--- a/net/netrom/nr_timer.c
+++ b/net/netrom/nr_timer.c
@@ -171,6 +171,8 @@ static void nr_t4timer_expiry(struct timer_list *t)
bh_lock_sock(sk);
nr_sk(sk)->condition &= ~NR_COND_PEER_RX_BUSY;
+ /* the peer is assumed ready again: send what was held back */
+ nr_kick(sk);
bh_unlock_sock(sk);
sock_put(sk);
}
@@ -238,6 +240,8 @@ static void nr_t1timer_expiry(struct timer_list *t)
} else {
nr->n2count++;
nr_requeue_frames(sk);
+ /* nothing else sends them if the peer stays silent */
+ nr_kick(sk);
}
break;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 023/816] ax25: drop a message being reassembled when a new one starts
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 022/816] netrom: send the unacknowledged frames again when T1 or T4 expires Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 024/816] rose: reset a call when a DATA packet arrives out of sequence Greg Kroah-Hartman
` (797 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
ax25_rx_fragment() only accepts, while a message is being reassembled
(fragno != 0), the segment numbered fragno - 1. A new first segment, or
a segment with another number, falls through to "return 0" and is
freed, but fragno keeps its value. Since every first segment is then
refused, and no segment can ever match fragno - 1 again, every later
segmented message of the connection is thrown away, until the
connection is closed. The I frames carrying them have already been
acknowledged, so the sender has no way to know.
This happens whenever the peer gives up a message half way, for
instance a station on an older kernel that interleaves the segments of
two messages, or one that fails to allocate a segment in the middle of
a message.
When a segment does not continue the message being reassembled, purge
the queue and reset fragno and fraglen. A first segment then starts a
new message; any other segment is dropped as before.
Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a
serial mkiss port; one guest builds the segments itself on an AX.25
socket with AX25_PIDINCL and sends: a 2 segment message, the first
segment of a 3 segment message and nothing more, a 2 segment message,
a 3 segment message without its second segment, a 2 segment message and
an unsegmented one. Before, the receiver got the first message and the
unsegmented one only; after, it gets the three complete segmented
messages and the unsegmented one. No kernel report.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit bb9180c5adfc874ec340caca45b5f3f4d448fcf8)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ax25/ax25_in.c | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index fd8669e5b7313..068f0c6c54cef 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -87,16 +87,26 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)
return 1;
}
}
- } else {
- /* First fragment received */
- if (*skb->data & AX25_SEG_FIRST) {
- skb_queue_purge(&ax25->frag_queue);
- ax25->fragno = *skb->data & AX25_SEG_REM;
- skb_pull(skb, 1); /* skip fragno */
- ax25->fraglen = skb->len;
- skb_queue_tail(&ax25->frag_queue, skb);
- return 1;
- }
+
+ /*
+ * A new first segment, or a segment out of order: the message
+ * being reassembled can no longer be completed. Drop it, or
+ * fragno would never come back to 0 and every later segmented
+ * message of this connection would be thrown away as well.
+ */
+ skb_queue_purge(&ax25->frag_queue);
+ ax25->fragno = 0;
+ ax25->fraglen = 0;
+ }
+
+ /* First fragment received */
+ if (*skb->data & AX25_SEG_FIRST) {
+ skb_queue_purge(&ax25->frag_queue);
+ ax25->fragno = *skb->data & AX25_SEG_REM;
+ skb_pull(skb, 1); /* skip fragno */
+ ax25->fraglen = skb->len;
+ skb_queue_tail(&ax25->frag_queue, skb);
+ return 1;
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 024/816] rose: reset a call when a DATA packet arrives out of sequence
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 023/816] ax25: drop a message being reassembled when a new one starts Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 025/816] ax25: end a REJ recovery count once frames are acknowledged Greg Kroah-Hartman
` (796 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
In state 3, rose_state3_machine() drops a DATA packet whose N(S) is not
the expected V(R) and says nothing about it: the packet is not queued,
and at most an RR with the unchanged N(R) goes out later. ROSE never
sends a DATA packet again, so once a packet has been lost on the way (a
relay dropped it, or a link was reset under it), every following packet
is dropped as well, the window of the sender fills up and the call
hangs until one side clears it.
X.25 resets the call when P(S) is not the one expected. Do the same:
acknowledge what arrived in sequence with rose_enquiry_response(), so
that the sender frees those packets, then send RESET REQUEST and go to
state 4, as the other error cases of this function already do. On the
RESET, the sender sends again the packets it still holds, from N(S) 0.
Tested in two QEMU guests (6.12.94, KASAN and lockdep) linked over a
serial mkiss port. The calling guest runs a rose module changed for the
bench only to drop the third DATA packet it sends, keeping it on its
ack queue as if a relay had lost it; it writes d0 to d5 on the call.
Before, the called guest received d0 and d1, and the caller still had
3840 bytes queued 25 s later; after, the called guest received d0 to d5
in order, without duplicates, and the caller's queue was empty. No
kernel report.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit e15162d237ddecc2c1215f49b76f4cba06bbc2c8)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/rose_in.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/net/rose/rose_in.c b/net/rose/rose_in.c
index 84025b4b498fe..980f82655c12e 100644
--- a/net/rose/rose_in.c
+++ b/net/rose/rose_in.c
@@ -193,6 +193,27 @@ static int rose_state3_machine(struct sock *sk, struct sk_buff *skb, int framety
if (atomic_read(&sk->sk_rmem_alloc) >
(sk->sk_rcvbuf >> 1))
rose->condition |= ROSE_COND_OWN_RX_BUSY;
+ } else {
+ /*
+ * A DATA packet was lost on the way: a relay dropped
+ * it, or a link was reset under it. ROSE never sends a
+ * DATA packet again, so the window of the sender would
+ * stay full and the call would hang. Acknowledge what
+ * arrived in sequence, then reset the call (X.25:
+ * invalid P(S)); the sender then sends its
+ * unacknowledged packets again.
+ */
+ rose_enquiry_response(sk);
+ rose_write_internal(sk, ROSE_RESET_REQUEST);
+ rose->condition = 0x00;
+ rose->vs = 0;
+ rose->vr = 0;
+ rose->va = 0;
+ rose->vl = 0;
+ rose->state = ROSE_STATE_4;
+ rose_start_t2timer(sk);
+ rose_stop_idletimer(sk);
+ break;
}
/*
* If the window is full, ack the frame, else start the
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 025/816] ax25: end a REJ recovery count once frames are acknowledged
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 024/816] rose: reset a call when a DATA packet arrives out of sequence Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 026/816] netrom: keep T1 running after answering a NAK Greg Kroah-Hartman
` (795 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
Commit a3aa611e37d4 ("ax25: bound REJ-driven fast retransmits with the
existing N2 counter") counts REJ-driven retransmits in n2count and
relies on an I frame received in sequence to reset it. A station that
only sends, such as a BBS forwarding mail, never receives I frames:
the peer acknowledges with RR. After a single REJ, n2count then stays
above zero for the rest of the connection, with two effects:
- ax25_calculate_rtt() no longer updates the round trip time (it
requires n2count == 0), and with the default linear backoff
ax25_calculate_t1() keeps T1 at (2 + 2 * n2count) * rtt instead of
2 * rtt;
- isolated REJs, even hours apart, add up, and the N2-th one sends
a healthy link into the state 4 enquiry.
An RR, RNR or REJ whose N(R) acknowledges new frames shows the link
is getting data through, so reset n2count when it moves V(A). A REJ
storm that makes no progress keeps the same N(R) and is still bounded
by N2. The reset is done after the acknowledgment is processed, so
the round trip of retransmitted frames is still not measured.
Fixes: a3aa611e37d4 ("ax25: bound REJ-driven fast retransmits with the existing N2 counter")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 6f10bf991bc130b56339200965d87512b443954a)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ax25/ax25_std_in.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/net/ax25/ax25_std_in.c b/net/ax25/ax25_std_in.c
index d0269ece4fc58..92d89d4df0f83 100644
--- a/net/ax25/ax25_std_in.c
+++ b/net/ax25/ax25_std_in.c
@@ -190,7 +190,12 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frame
if (type == AX25_COMMAND && pf)
ax25_std_enquiry_response(ax25);
if (ax25_validate_nr(ax25, nr)) {
+ int progress = nr != ax25->va;
+
ax25_check_iframes_acked(ax25, nr);
+ /* Frames got through: end any REJ recovery count. */
+ if (progress)
+ ax25->n2count = 0;
} else {
ax25_std_nr_error_recovery(ax25);
ax25->state = AX25_STATE_1;
@@ -202,8 +207,17 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frame
if (type == AX25_COMMAND && pf)
ax25_std_enquiry_response(ax25);
if (ax25_validate_nr(ax25, nr)) {
+ int progress = nr != ax25->va;
+
ax25_frames_acked(ax25, nr);
ax25_calculate_rtt(ax25);
+ /*
+ * Only REJs that make no progress count towards N2:
+ * a REJ whose N(R) acknowledges new frames shows the
+ * link is getting data through.
+ */
+ if (progress)
+ ax25->n2count = 0;
/*
* REJ triggers an immediate go-back-N retransmit,
* deliberately bypassing the T1/N2 backoff that
@@ -224,10 +238,11 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frame
* once N2 of them have failed to make it through,
* fall back to the normal paced state 4 enquiry
* (which will genuinely give up and disconnect after
- * N2 further tries if the link stays bad). A single
- * frame accepted in sequence resets the counter (see
- * the AX25_I case below), so an isolated REJ during
- * otherwise healthy traffic never gets close to N2.
+ * N2 further tries if the link stays bad). A frame
+ * accepted in sequence (see the AX25_I case below) or
+ * an RR/RNR/REJ that acknowledges new frames resets
+ * the counter, so an isolated REJ during otherwise
+ * healthy traffic never gets close to N2.
*/
if (ax25->n2count == ax25->n2) {
ax25->n2count = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 026/816] netrom: keep T1 running after answering a NAK
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 025/816] ax25: end a REJ recovery count once frames are acknowledged Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 027/816] netrom: give the sysctl timer limits in milliseconds Greg Kroah-Hartman
` (794 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
When an INFO or INFOACK frame carries the NAK flag, nr_send_nak_frame()
sends the frame at V(A) again and then stops T1, although that frame,
and any sent after it, are still waiting for an acknowledgment.
If this copy is lost too, no timer is left: nothing is sent again, and
the circuit is not cleared after N2 tries either. It stays stuck until
the peer sends something or the idle timer, if set, closes it.
Restart T1 instead, as nr_check_iframes_acked() does when part of the
window is acknowledged.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit e18a382a74b93a3c0ab52e0fedc8343d9d4facc9)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netrom/nr_out.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/netrom/nr_out.c b/net/netrom/nr_out.c
index 150cb4263d314..1c6b4386c86b4 100644
--- a/net/netrom/nr_out.c
+++ b/net/netrom/nr_out.c
@@ -135,7 +135,12 @@ void nr_send_nak_frame(struct sock *sk)
nr->condition &= ~NR_COND_ACK_PENDING;
nr->vl = nr->vr;
- nr_stop_t1timer(sk);
+ /*
+ * The frame just sent again, and any sent after it, still wait for
+ * an acknowledgment: keep T1 running so that losing this copy too
+ * is noticed.
+ */
+ nr_start_t1timer(sk);
}
void nr_kick(struct sock *sk)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 027/816] netrom: give the sysctl timer limits in milliseconds
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 026/816] netrom: keep T1 running after answering a NAK Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 028/816] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
` (793 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
Since commit 4d8937d0b113 ("[NETROM]: Eleminate HZ from NET/ROM kernel
interfaces") the NET/ROM timer sysctls hold milliseconds, converted
with msecs_to_jiffies() where they are used, but their limits were left
in jiffies: 5 * HZ to 600 * HZ for the transport timeout, 1 * HZ to
60 * HZ for the acknowledge delay, 1 * HZ to 1000 * HZ for the busy
delay, up to 65535 * HZ for the no activity timeout. They only match
with HZ=1000.
With HZ=100 the largest transport timeout that can be written is 60 s
while the default is 120 s, and the largest busy delay is 100 s while
the default is 180 s: once changed, a default can no longer be put
back. The smallest transport timeout accepted is 0.5 s instead of 5 s.
With HZ=250 the acknowledge delay is limited to 15 s instead of 60 s.
Seen on a Raspberry Pi node (HZ=100): writing back the current values
120000 to transport_timeout and 180000 to transport_busy_delay fails
with EINVAL, and 60000 is accepted.
Give the limits in milliseconds, as was done for ROSE. With HZ=1000
nothing changes.
Fixes: 4d8937d0b113 ("[NETROM]: Eleminate HZ from NET/ROM kernel interfaces")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit e59d8b990552be401ace7750a4617ffa07c86637)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netrom/sysctl_net_netrom.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c
index 7dc0fa628f2e7..bccc165a4a2ec 100644
--- a/net/netrom/sysctl_net_netrom.c
+++ b/net/netrom/sysctl_net_netrom.c
@@ -15,16 +15,17 @@
static int min_quality[] = {0}, max_quality[] = {255};
static int min_obs[] = {0}, max_obs[] = {255};
static int min_ttl[] = {0}, max_ttl[] = {255};
-static int min_t1[] = {5 * HZ};
-static int max_t1[] = {600 * HZ};
+/* The timers are given in milliseconds */
+static int min_t1[] = {5 * MSEC_PER_SEC};
+static int max_t1[] = {600 * MSEC_PER_SEC};
static int min_n2[] = {2}, max_n2[] = {127};
-static int min_t2[] = {1 * HZ};
-static int max_t2[] = {60 * HZ};
-static int min_t4[] = {1 * HZ};
-static int max_t4[] = {1000 * HZ};
+static int min_t2[] = {1 * MSEC_PER_SEC};
+static int max_t2[] = {60 * MSEC_PER_SEC};
+static int min_t4[] = {1 * MSEC_PER_SEC};
+static int max_t4[] = {1000 * MSEC_PER_SEC};
static int min_window[] = {1}, max_window[] = {127};
-static int min_idle[] = {0 * HZ};
-static int max_idle[] = {65535 * HZ};
+static int min_idle[] = {0 * MSEC_PER_SEC};
+static int max_idle[] = {65535 * MSEC_PER_SEC};
static int min_route[] = {0}, max_route[] = {1};
static int min_fails[] = {1}, max_fails[] = {10};
static int min_reset[] = {0}, max_reset[] = {1};
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 028/816] mm/ksm: fix userfaultfd protection during merge and unmerge
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 027/816] netrom: give the sysctl timer limits in milliseconds Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 029/816] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
` (792 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Samarth Narang, Lance Yang,
Andrew Morton, Lorenzo Stoakes (ARM), Kiryl Shutsemau (Meta),
David Hildenbrand (Arm), Mel Gorman, Chengming Zhou,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Jérôme Glisse,
Andrea Arcangeli, Peter Xu, Bobby Powers, Brian Geffon,
Denis Plotnikov, Doug Gilbert, Hugh Dickins, Johannes Weiner,
Martin Cracauer, Marty McFadden, Maya Gokhale, Pavel Emelyanov,
Rik van Riel, Shaohua Li, James Houghton, Jonathan Corbet,
Paolo Bonzini, Sean Christopherson, SJ Park, Zi Yan,
Mohammed EL Kadiri, Sasha Levin, Xu Xin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lance Yang <lance.yang@linux.dev>
[ Upstream commit 990d6c2194a938a19a8cf94c6cfd75171345089b ]
KSM loses userfaultfd protection when replace_page() builds a new PTE from
vma->vm_page_prot. Dropping its uffd bit lets a subsequent write go
through ordinary COW instead of userfaultfd write protection handling.
For RWP, a merged page also becomes readable without faulting.
Keeping the uffd bit and restoring PAGE_NONE fixes merging, but we also
have to handle unmerging. An existing KSM page can be protected with RWP
before MADV_UNMERGEABLE, so unmerging already needs fixing independently
of preserving RWP during merging.
Unsharing replaces a shared page with a private one and should leave
userfaultfd protection in place, as do_wp_page() already does for write
protection. Currently, an unshare fault reaches do_uffd_rwp() before it
can proceed to do_wp_page().
- With synchronous RWP, handle_userfault() returns VM_FAULT_SIGBUS.
break_ksm() then reports success with a KSM page still merged.
- With asynchronous RWP, protection is cleared before unsharing.
Preserve the uffd bit when merging, and restore PAGE_NONE for RWP. Let
FAULT_FLAG_UNSHARE skip RWP fault handling and keep PAGE_NONE on each
private copy as well. Unsharing can then complete with RWP still armed
for a subsequent access.
Link: https://lore.kernel.org/20261026130054.91461-1-lance.yang@linux.dev
Link: https://lore.kernel.org/all/20261019010934.697895-1-samarth.colleges@gmail.com/
Link: https://lore.kernel.org/all/20261020055518.36087-1-lance.yang@linux.dev/
Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
Fixes: 2d427bb01639 ("mm/userfaultfd: add RWP fault delivery and expose UFFDIO_REGISTER_MODE_RWP")
Signed-off-by: Samarth Narang <samarth.colleges@gmail.com>
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Co-developed-by: Samarth Narang <samarth.colleges@gmail.com>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Xu Xin <xu.xin@linux.dev>"
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Bobby Powers <bobbypowers@gmail.com>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Denis Plotnikov <dplotnikov@virtuozzo.com>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Martin Cracauer <cracauer@cons.org>
Cc: Marty McFadden <mcfadden8@llnl.gov>
Cc: Maya Gokhale <gokhale2@llnl.gov>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Shaohua Li <shli@fb.com>
Cc: James Houghton <jthoughton@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: SJ Park <sj@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Mohammed EL Kadiri <med08elkadiri@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/ksm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mm/ksm.c b/mm/ksm.c
index 9a98aa97317a4..6d7b21636f549 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1413,6 +1413,10 @@ static int replace_page(struct vm_area_struct *vma, struct page *page,
if (pte_soft_dirty(orig_pte))
newpte = pte_mksoft_dirty(newpte);
+ /* Preserve uffd-wp when replacing the page. */
+ if (pte_uffd_wp(orig_pte))
+ newpte = pte_mkuffd_wp(newpte);
+
flush_cache_page(vma, addr, pte_pfn(ptep_get(ptep)));
/*
* No need to notify as we are replacing a read only page with another
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 029/816] udf: validate VAT inode size for old VAT format
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 028/816] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 030/816] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
` (791 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
[ Upstream commit 5163e6ee1ea744d412fe516235bfd9cab15141dc ]
Validate VAT inode is large enough to contain at least the header for
pre-2.00 UDF media format.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/udf/super.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 8d3d758714da2..ea9cd593ffbbb 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1319,6 +1319,11 @@ static int udf_load_vat(struct super_block *sb, int p_index, int type1_index)
if (map->s_partition_type == UDF_VIRTUAL_MAP15) {
map->s_type_specific.s_virtual.s_start_offset = 0;
+ if (sbi->s_vat_inode->i_size < 36) {
+ udf_err(sb, "Too short VAT inode size %lld\n",
+ sbi->s_vat_inode->i_size);
+ return -EFSCORRUPTED;
+ }
map->s_type_specific.s_virtual.s_num_entries =
(sbi->s_vat_inode->i_size - 36) >> 2;
} else if (map->s_partition_type == UDF_VIRTUAL_MAP20) {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 030/816] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 029/816] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 031/816] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
` (790 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hui Peng, Jan Kara, Sasha Levin
6.12-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 ea9cd593ffbbb..09905f6c9ee1c 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1328,6 +1328,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;
@@ -1345,8 +1351,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] 825+ messages in thread
* [PATCH 6.12 031/816] io_uring: enable toggle of iowait usage when waiting on CQEs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 030/816] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 032/816] io_uring/napi: dont end the single NAPI busy poll early on need_resched() Greg Kroah-Hartman
` (789 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
Commit 07754bfd9aee59063f8549f6e4d455eae636ecc7 upstream.
By default, io_uring marks a waiting task as being in iowait, if it's
sleeping waiting on events and there are pending requests. This isn't
necessarily always useful, and may be confusing on non-storage setups
where iowait isn't expected. It can also cause extra power usage, by
preventing the CPU from entering lower sleep states.
This adds a new enter flag, IORING_ENTER_NO_IOWAIT. If set, then
io_uring will not account the sleeping task as being in iowait. If the
kernel supports this feature, then it will be marked by having the
IORING_FEAT_NO_IOWAIT feature flag set.
As the kernel currently does not support separating the iowait
accounting and CPU frequency boosting, the IORING_ENTER_NO_IOWAIT
controls both of these at the same time. In the future, if those do end
up being split, then it'd be possible to control them separately.
However, it seems more likely that the kernel will decouple iowait and
CPU frequency boosting anyway.
[ 6.12: only the NO_IOWAIT flag bits are added, the EXT_ARG_REG and
RW_ATTR bits before them don't exist here. io_get_ext_arg() has no
ctx argument. ]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/uapi/linux/io_uring.h | 2 ++
io_uring/io_uring.c | 31 +++++++++++++++++++------------
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index fdd7b931ea1d4..e777e6b128e85 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -518,6 +518,7 @@ struct io_cqring_offsets {
#define IORING_ENTER_EXT_ARG (1U << 3)
#define IORING_ENTER_REGISTERED_RING (1U << 4)
#define IORING_ENTER_ABS_TIMER (1U << 5)
+#define IORING_ENTER_NO_IOWAIT (1U << 7)
/*
* Passed in for io_uring_setup(2). Copied back with updated info on success
@@ -554,6 +555,7 @@ struct io_uring_params {
#define IORING_FEAT_REG_REG_RING (1U << 13)
#define IORING_FEAT_RECVSEND_BUNDLE (1U << 14)
#define IORING_FEAT_MIN_TIMEOUT (1U << 15)
+#define IORING_FEAT_NO_IOWAIT (1U << 17)
/*
* io_uring_register(2) opcodes and arguments
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 09551e3907f91..630b306a849f0 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2532,8 +2532,17 @@ static int io_cqring_schedule_timeout(struct io_wait_queue *iowq,
return READ_ONCE(iowq->hit_timeout) ? -ETIME : 0;
}
+struct ext_arg {
+ size_t argsz;
+ struct __kernel_timespec __user *ts;
+ const sigset_t __user *sig;
+ ktime_t min_time;
+ bool iowait;
+};
+
static int __io_cqring_wait_schedule(struct io_ring_ctx *ctx,
struct io_wait_queue *iowq,
+ struct ext_arg *ext_arg,
ktime_t start_time)
{
int ret = 0;
@@ -2543,7 +2552,7 @@ static int __io_cqring_wait_schedule(struct io_ring_ctx *ctx,
* can take into account that the task is waiting for IO - turns out
* to be important for low QD IO.
*/
- if (current_pending_io())
+ if (ext_arg->iowait && current_pending_io())
current->in_iowait = 1;
if (iowq->timeout != KTIME_MAX || iowq->min_timeout)
ret = io_cqring_schedule_timeout(iowq, ctx->clockid, start_time);
@@ -2556,6 +2565,7 @@ static int __io_cqring_wait_schedule(struct io_ring_ctx *ctx,
/* If this returns > 0, the caller should retry */
static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
struct io_wait_queue *iowq,
+ struct ext_arg *ext_arg,
ktime_t start_time)
{
if (unlikely(READ_ONCE(ctx->check_cq)))
@@ -2569,16 +2579,9 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
if (unlikely(io_should_wake(iowq)))
return 0;
- return __io_cqring_wait_schedule(ctx, iowq, start_time);
+ return __io_cqring_wait_schedule(ctx, iowq, ext_arg, start_time);
}
-struct ext_arg {
- size_t argsz;
- struct __kernel_timespec __user *ts;
- const sigset_t __user *sig;
- ktime_t min_time;
-};
-
/*
* Wait until events become available, if we don't already have some. The
* application must reap them itself, as they reside on the shared cq ring.
@@ -2660,7 +2663,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, u32 flags,
TASK_INTERRUPTIBLE);
}
- ret = io_cqring_wait_schedule(ctx, &iowq, start_time);
+ ret = io_cqring_wait_schedule(ctx, &iowq, ext_arg, start_time);
__set_current_state(TASK_RUNNING);
atomic_set(&ctx->cq_wait_nr, IO_CQ_WAKE_INIT);
@@ -3363,6 +3366,8 @@ static int io_get_ext_arg(unsigned flags, const void __user *argp,
{
struct io_uring_getevents_arg arg;
+ ext_arg->iowait = !(flags & IORING_ENTER_NO_IOWAIT);
+
/*
* If EXT_ARG isn't set, then we have no timespec and the argp pointer
* is just a pointer to the sigset_t.
@@ -3399,7 +3404,8 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
if (unlikely(flags & ~(IORING_ENTER_GETEVENTS | IORING_ENTER_SQ_WAKEUP |
IORING_ENTER_SQ_WAIT | IORING_ENTER_EXT_ARG |
IORING_ENTER_REGISTERED_RING |
- IORING_ENTER_ABS_TIMER)))
+ IORING_ENTER_ABS_TIMER |
+ IORING_ENTER_NO_IOWAIT)))
return -EINVAL;
/*
@@ -3786,7 +3792,8 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS |
IORING_FEAT_RSRC_TAGS | IORING_FEAT_CQE_SKIP |
IORING_FEAT_LINKED_FILE | IORING_FEAT_REG_REG_RING |
- IORING_FEAT_RECVSEND_BUNDLE | IORING_FEAT_MIN_TIMEOUT;
+ IORING_FEAT_RECVSEND_BUNDLE | IORING_FEAT_MIN_TIMEOUT |
+ IORING_FEAT_NO_IOWAIT;
if (copy_to_user(params, p, sizeof(*p))) {
ret = -EFAULT;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 032/816] io_uring/napi: dont end the single NAPI busy poll early on need_resched()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 031/816] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 033/816] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
` (788 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cinq Prairie, Jens Axboe,
Sasha Levin
6.12-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 628ced4b44b22..1cdfc5725e014 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -48,6 +48,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 bdae13367e0fc..ade35aff63752 100644
--- a/io_uring/napi.c
+++ b/io_uring/napi.c
@@ -107,19 +107,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)
{
@@ -129,8 +125,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;
@@ -157,13 +152,16 @@ static bool __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;
@@ -174,8 +172,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] 825+ messages in thread
* [PATCH 6.12 033/816] io_uring: fail soft links on negative IOU_COMPLETE results
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 032/816] io_uring/napi: dont end the single NAPI busy poll early on need_resched() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 034/816] io_uring/futex: fail soft links when cancelling a wait Greg Kroah-Hartman
` (787 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin
6.12-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>
[axboe: 6.12 has IOU_OK rather than IOU_COMPLETE]
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 630b306a849f0..3f8a0f7e84f62 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1789,9 +1789,11 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
}
if (ret == IOU_OK) {
- /* 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] 825+ messages in thread
* [PATCH 6.12 034/816] io_uring/futex: fail soft links when cancelling a wait
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 033/816] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 035/816] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
` (786 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin
6.12-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 990568baf393a..59b679e1e26f2 100644
--- a/io_uring/futex.c
+++ b/io_uring/futex.c
@@ -108,6 +108,7 @@ static bool __io_futex_cancel(struct io_ring_ctx *ctx, 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] 825+ messages in thread
* [PATCH 6.12 035/816] io_uring/rw: fail soft links on IOPOLL short or error IO
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 034/816] io_uring/futex: fail soft links when cancelling a wait Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 036/816] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
` (785 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Xiuwei, Jens Axboe, Sasha Levin
6.12-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 b18b10cdbb524..688ce923f6a3c 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -553,8 +553,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] 825+ messages in thread
* [PATCH 6.12 036/816] io_uring/timeout: dont rearm a multishot timeout on cancel
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 035/816] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 037/816] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
` (784 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cheng Yongkang, Jens Axboe,
Sasha Levin
6.12-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>
[axboe: 6.12 has no tw.cancel, use io_should_terminate_tw() like
io_req_task_link_timeout() does]
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 d71b0fdbb0663..e99709c4089db 100644
--- a/io_uring/timeout.c
+++ b/io_uring/timeout.c
@@ -72,7 +72,8 @@ static void io_timeout_complete(struct io_kiocb *req, struct io_tw_state *ts)
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 (!io_should_terminate_tw(ctx) &&
+ io_req_post_cqe(req, -ETIME, IORING_CQE_F_MORE)) {
/* re-arm timer */
spin_lock_irq(&ctx->timeout_lock);
list_add(&timeout->list, ctx->timeout_list.prev);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 037/816] io_uring/rsrc: keep the old file when a file update fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 036/816] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 038/816] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Greg Kroah-Hartman
` (783 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cheng Yongkang, Jens Axboe,
Sasha Levin
6.12-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>
[axboe: 6.12 has no rsrc nodes for files, the old file is queued for
removal with io_queue_rsrc_removal(), which can fail. Get and check the
new file first, and only remove the old one once that has succeeded]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/rsrc.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 168c6987435ed..5a3f3e4e3fa11 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -348,6 +348,7 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
return -EINVAL;
for (done = 0; done < nr_args; done++) {
+ struct file *file = NULL;
u64 tag = 0;
if ((tags && copy_from_user(&tag, &tags[done], sizeof(tag))) ||
@@ -365,17 +366,8 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
i = array_index_nospec(up->offset + done, ctx->nr_user_files);
file_slot = io_fixed_file_slot(&ctx->file_table, i);
- if (file_slot->file_ptr) {
- err = io_queue_rsrc_removal(data, i,
- io_slot_file(file_slot));
- if (err)
- break;
- file_slot->file_ptr = 0;
- io_file_bitmap_clear(&ctx->file_table, i);
- }
if (fd != -1) {
- struct file *file = fget(fd);
-
+ file = fget(fd);
if (!file) {
err = -EBADF;
break;
@@ -388,6 +380,19 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
err = -EBADF;
break;
}
+ }
+ if (file_slot->file_ptr) {
+ err = io_queue_rsrc_removal(data, i,
+ io_slot_file(file_slot));
+ if (err) {
+ if (file)
+ fput(file);
+ break;
+ }
+ file_slot->file_ptr = 0;
+ io_file_bitmap_clear(&ctx->file_table, i);
+ }
+ if (file) {
*io_get_tag_slot(data, i) = tag;
io_fixed_file_set(file_slot, file);
io_file_bitmap_set(&ctx->file_table, i);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 038/816] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 037/816] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 039/816] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
` (782 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Siddharth Chintamaneni, Jens Axboe,
Sasha Levin
6.12-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 da6b46244e6de..9d6b7c433eeaf 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -343,6 +343,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] 825+ messages in thread
* [PATCH 6.12 039/816] io_uring/io-wq: apply the current cpuset to new workers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 038/816] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 040/816] bpqether: reserve the Ethernet devices own header room on transmit Greg Kroah-Hartman
` (781 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mikhail Malyshev, Jens Axboe,
Sasha Levin
6.12-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 181eecdb32c04..91b83751795f2 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -687,6 +687,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;
@@ -748,8 +776,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);
}
}
@@ -799,9 +826,16 @@ void io_wq_worker_sleeping(struct task_struct *tsk)
static void io_init_new_worker(struct io_wq *wq, 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(&wq->lock);
hlist_nulls_add_head_rcu(&worker->nulls_node, &wq->free_list);
@@ -1269,7 +1303,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);
@@ -1453,7 +1487,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] 825+ messages in thread
* [PATCH 6.12 040/816] bpqether: reserve the Ethernet devices own header room on transmit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 039/816] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 041/816] bpqether: set both addresses or none in SIOCSBPQETHADDR Greg Kroah-Hartman
` (780 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
bpq_xmit() makes sure the frame has AX25_BPQ_HEADER_LEN (16) bytes of
headroom, then pushes the two length bytes and lets dev_hard_header()
of the underlying device build the link layer header. That covers a
plain Ethernet header, but not a longer one.
A VLAN device on top of an Ethernet device that cannot insert the tag
in hardware, with reorder_hdr turned off, pushes an 18 byte header
(VLAN tag, then the Ethernet header). A UI frame sent from an AX.25
datagram socket with 8 digipeaters reaches bpq_xmit() with 17 bytes of
headroom once the KISS byte is dropped: skb_cow() leaves it alone, 15
bytes remain after the length bytes, and eth_header() underflows the
skb:
skbuff: skb_under_panic: ... len:101 put:14 ... dev:eth0.5
kernel BUG at net/core/skbuff.c:209!
Call Trace:
eth_header
vlan_dev_hard_header
dev_hard_start_xmit
__dev_queue_xmit
ax25_sendmsg
__sys_sendto
No privilege is needed to open and bind such a socket, so any local
user can crash a host that runs bpqether over this kind of VLAN.
Look up the Ethernet device first and ask skb_cow() for
LL_RESERVED_SPACE() of that device plus the two length bytes.
Tested in a QEMU guest (6.12.94, KASAN) with bpq devices on eth0, on
eth0.6 (reorder_hdr on) and on eth0.5 (reorder_hdr off), eth0 being a
virtio-net port without VLAN tag insertion: UI frames with 0, 7 and 8
digipeaters on each. Before the change the 8 digipeater frame on
eth0.5 panicked the guest with 15 bytes of headroom left; after it,
79 bytes are left and all frames are sent, with no kernel report.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 6b7e0767b46d918b5c8a5a2fbb8a9c8a2531d698)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/hamradio/bpqether.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index f027205347d34..ea6bee45e2a4d 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -257,12 +257,24 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev)
skb_pull(skb, 1); /* Drop KISS byte */
size = skb->len;
+ bpq = netdev_priv(dev);
+
+ orig_dev = dev;
+ dev = bpq_get_ether_dev(dev);
+ if (!dev) {
+ orig_dev->stats.tx_dropped++;
+ kfree_skb(skb);
+ return NETDEV_TX_OK;
+ }
+
/*
* We're about to mess with the skb which may still shared with the
* generic networking code so unshare and ensure it's got enough
- * space for the BPQ headers.
+ * space for the length bytes and for the link layer header of the
+ * Ethernet device. That header can be longer than an Ethernet
+ * header, e.g. on a VLAN device that inserts the tag itself.
*/
- if (skb_cow(skb, AX25_BPQ_HEADER_LEN)) {
+ if (skb_cow(skb, LL_RESERVED_SPACE(dev) + 2)) {
if (net_ratelimit())
pr_err("bpqether: out of memory\n");
kfree_skb(skb);
@@ -275,15 +287,6 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev)
*ptr++ = (size + 5) % 256;
*ptr++ = (size + 5) / 256;
- bpq = netdev_priv(dev);
-
- orig_dev = dev;
- if ((dev = bpq_get_ether_dev(dev)) == NULL) {
- orig_dev->stats.tx_dropped++;
- kfree_skb(skb);
- return NETDEV_TX_OK;
- }
-
skb->protocol = ax25_type_trans(skb, dev);
skb_reset_network_header(skb);
dev_hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 041/816] bpqether: set both addresses or none in SIOCSBPQETHADDR
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 040/816] bpqether: reserve the Ethernet devices own header room on transmit Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 042/816] bpqether: keep a bpq device in step with its Ethernet device Greg Kroah-Hartman
` (779 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
SIOCSBPQETHADDR copies the destination address straight into the
device, then the accepted source address. When the second copy faults,
the ioctl returns -EFAULT but the destination address has already been
changed, and copy_from_user() has zero-filled the part of the accepted
address it could not read.
With the accepted address left as 00:00:00:00:00:00, bpq_rcv() drops
every frame whose source is not that address: the device silently
stops receiving although the ioctl reported a failure.
Copy the whole struct bpq_ethaddr to the stack first and only update
the device once it has been read in full.
Tested in a QEMU guest (6.12.94, KASAN) by placing the struct so that
its accept field falls in an unmapped page. Before the change
/proc/net/bpqether showed the new destination and an accepted address
of 00:00:00:00:00:00 after the -EFAULT; after it, both addresses are
unchanged, and a valid call still sets them.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 431bb7f4a7d347ccda32319aa346346664858289)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/hamradio/bpqether.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index ea6bee45e2a4d..4a04c3b4bdb93 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -319,8 +319,8 @@ static int bpq_set_mac_address(struct net_device *dev, void *addr)
static int bpq_siocdevprivate(struct net_device *dev, struct ifreq *ifr,
void __user *data, int cmd)
{
- struct bpq_ethaddr __user *ethaddr = data;
struct bpqdev *bpq = netdev_priv(dev);
+ struct bpq_ethaddr ethaddr;
struct bpq_req req;
if (!capable(CAP_NET_ADMIN))
@@ -340,10 +340,10 @@ static int bpq_siocdevprivate(struct net_device *dev, struct ifreq *ifr,
break;
case SIOCSBPQETHADDR:
- if (copy_from_user(bpq->dest_addr, ethaddr->destination, ETH_ALEN))
- return -EFAULT;
- if (copy_from_user(bpq->acpt_addr, ethaddr->accept, ETH_ALEN))
+ if (copy_from_user(ðaddr, data, sizeof(ethaddr)))
return -EFAULT;
+ memcpy(bpq->dest_addr, ethaddr.destination, ETH_ALEN);
+ memcpy(bpq->acpt_addr, ethaddr.accept, ETH_ALEN);
break;
default:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 042/816] bpqether: keep a bpq device in step with its Ethernet device
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 041/816] bpqether: set both addresses or none in SIOCSBPQETHADDR Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 043/816] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
` (778 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
When the Ethernet device goes down, bpq_device_event() closes the bpq
device on top of it. Two things are left over:
- bpq_open() does not look at the Ethernet device, so the bpq device
can be brought up again while the Ethernet device is still down.
Every frame sent then counts in the bpq device's tx_packets while
the Ethernet device drops it.
- when the Ethernet device comes back up, the bpq device stays down
and the AX.25 port has to be brought up again by hand.
Refuse to open a bpq device whose Ethernet device is not running, with
-ENETDOWN. Remember that a bpq device was closed because its Ethernet
device went down, and open it again on NETDEV_UP. A bpq device that
was already down, e.g. closed by the administrator, is left alone.
Tested in a QEMU guest (6.12.94, KASAN) with e1000 ports:
- bpq2 brought up with eth2 down: accepted before, and 5 frames
counted in tx_packets of bpq2 while eth2 dropped them; -ENETDOWN
after, nothing counted;
- eth3 down then up: bpq3 stayed down before, is up again after;
- bpq1 closed by hand, then eth1 down and up: bpq1 stays down,
before and after.
No kernel report in either case.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 888935e9c7aa8d8de66dd76111ef0875f8c90663)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/hamradio/bpqether.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 4a04c3b4bdb93..41b145693ff93 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -103,6 +103,7 @@ struct bpqdev {
struct net_device *axdev; /* bpq device (bpq#) */
char dest_addr[6]; /* ether destination address */
char acpt_addr[6]; /* accept ether frames from this address only */
+ bool reopen; /* closed because the ether device went down */
};
static LIST_HEAD(bpq_devices);
@@ -358,6 +359,11 @@ static int bpq_siocdevprivate(struct net_device *dev, struct ifreq *ifr,
*/
static int bpq_open(struct net_device *dev)
{
+ struct bpqdev *bpq = netdev_priv(dev);
+
+ if (!netif_running(bpq->ethdev))
+ return -ENETDOWN;
+
netif_start_queue(dev);
return 0;
}
@@ -532,6 +538,8 @@ static int bpq_device_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
+ struct net_device *axdev;
+ struct bpqdev *bpq;
if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;
@@ -540,14 +548,27 @@ static int bpq_device_event(struct notifier_block *this,
return NOTIFY_DONE;
switch (event) {
- case NETDEV_UP: /* new ethernet device -> new BPQ interface */
- if (bpq_get_ax25_dev(dev) == NULL)
+ case NETDEV_UP:
+ axdev = bpq_get_ax25_dev(dev);
+ if (!axdev) { /* new ethernet device -> new BPQ interface */
bpq_new_device(dev);
+ break;
+ }
+ /* reopen a BPQ interface closed when the device went down */
+ bpq = netdev_priv(axdev);
+ if (bpq->reopen) {
+ bpq->reopen = false;
+ dev_open(axdev, NULL);
+ }
break;
case NETDEV_DOWN: /* ethernet device closed -> close BPQ interface */
- if ((dev = bpq_get_ax25_dev(dev)) != NULL)
- dev_close(dev);
+ axdev = bpq_get_ax25_dev(dev);
+ if (axdev && netif_running(axdev)) {
+ dev_close(axdev);
+ bpq = netdev_priv(axdev);
+ bpq->reopen = true;
+ }
break;
case NETDEV_UNREGISTER: /* ethernet device removed -> free BPQ interface */
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 043/816] Input: destroy force-feedback device on input unregistration
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 042/816] bpqether: keep a bpq device in step with its Ethernet device Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 044/816] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
` (777 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gideon Heinz, Dmitry Torokhov,
Sasha Levin
6.12-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>
[ sashal: Dropped the ->stop removal hunks and adapted ml_ff_destroy() to the bare timer_shutdown_sync() end state, since this tree lacks the ->stop code and uses older mutex_unlock context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/input/ff-core.c | 2 +-
drivers/input/ff-memless.c | 10 +---------
drivers/input/input.c | 2 ++
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 609a5f01761bd..624f8defa5432 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -358,7 +358,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 c321cdabd2141..852ec2d4ddcda 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -486,15 +486,7 @@ static void ml_ff_destroy(struct ff_device *ff)
{
struct ml_device *ml = ff->private;
- /*
- * Even though we stop all playing effects when tearing down
- * an input device (via input_device_flush() that calls into
- * input_ff_flush() that stops and erases all effects), we
- * do not actually stop the timer, and therefore we should
- * do it here.
- */
- del_timer_sync(&ml->timer);
-
+ timer_shutdown_sync(&ml->timer);
kfree(ml->private);
}
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 05366b82f722e..0220b913b9ac4 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -2283,6 +2283,8 @@ static void __input_unregister_device(struct input_dev *dev)
mutex_unlock(&input_mutex);
device_del(&dev->dev);
+
+ input_ff_destroy(dev);
}
static void devm_input_device_unregister(struct device *dev, void *res)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 044/816] staging: media: atomisp: use array3_size() for overflow-safe allocation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 043/816] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 045/816] net/9p/fd: support ipv6 for trans=tcp Greg Kroah-Hartman
` (776 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Feng Ning, Sakari Ailus, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feng Ning <feng@innora.ai>
commit d178c7ca8fefc28115d35b94c3b1f4d653e34182 upstream.
Replace open-coded width * height * sizeof() multiplications with
array3_size() to prevent integer overflow in buffer allocations.
The atomisp driver computes DVS, morphing table, shading table and
statistics buffer sizes using unchecked arithmetic. When dimensions
are attacker-controlled or simply large, the product can silently wrap,
causing kvmalloc() to allocate an undersized buffer.
array3_size() saturates to SIZE_MAX on overflow, so kvmalloc() returns
NULL instead of succeeding with too few bytes.
Signed-off-by: Feng Ning <feng@innora.ai>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../media/atomisp/pci/sh_css_param_dvs.c | 11 +++---
.../media/atomisp/pci/sh_css_param_shading.c | 4 ++-
.../staging/media/atomisp/pci/sh_css_params.c | 35 +++++++++++--------
3 files changed, 31 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
index 5174bc210ae17..f70dd99030e9e 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_param_dvs.c
@@ -13,6 +13,7 @@
* more details.
*/
+#include <linux/overflow.h>
#include "sh_css_param_dvs.h"
#include <assert_support.h>
#include <type_support.h>
@@ -58,7 +59,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
}
/* Generate Y buffers */
- dvs_config->xcoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->xcoords_y = kvmalloc(array3_size(width_y, height_y, sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_y) {
IA_CSS_ERROR("out of memory");
@@ -66,7 +67,7 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
goto exit;
}
- dvs_config->ycoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->ycoords_y = kvmalloc(array3_size(width_y, height_y, sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_y) {
IA_CSS_ERROR("out of memory");
@@ -77,7 +78,8 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
/* Generate UV buffers */
IA_CSS_LOG("UV W %d H %d", width_uv, height_uv);
- dvs_config->xcoords_uv = kvmalloc(width_uv * height_uv * sizeof(uint32_t),
+ dvs_config->xcoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_uv) {
IA_CSS_ERROR("out of memory");
@@ -85,7 +87,8 @@ alloc_dvs_6axis_table(const struct ia_css_resolution *frame_res,
goto exit;
}
- dvs_config->ycoords_uv = kvmalloc(width_uv * height_uv * sizeof(uint32_t),
+ dvs_config->ycoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_uv) {
IA_CSS_ERROR("out of memory");
diff --git a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c
index 5b43cc6562690..0441d7f47a610 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_param_shading.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_param_shading.c
@@ -13,6 +13,7 @@
* more details.
*/
+#include <linux/overflow.h>
#include <linux/math.h>
#include <linux/slab.h>
@@ -348,7 +349,8 @@ ia_css_shading_table_alloc(
me->fraction_bits = 0;
for (i = 0; i < IA_CSS_SC_NUM_COLORS; i++) {
me->data[i] =
- kvmalloc(width * height * sizeof(*me->data[0]),
+ kvmalloc(array3_size(width, height,
+ sizeof(*me->data[0])),
GFP_KERNEL);
if (!me->data[i]) {
unsigned int j;
diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c
index b1feb6f6ebe89..76e0b475b12e9 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_params.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_params.c
@@ -13,6 +13,7 @@
* more details.
*/
+#include <linux/overflow.h>
#include "gdc_device.h" /* gdc_lut_store(), ... */
#include "isp.h" /* ISP_VEC_ELEMBITS */
#include "vamem.h"
@@ -1390,11 +1391,11 @@ struct ia_css_morph_table *ia_css_morph_table_allocate(
}
for (i = 0; i < IA_CSS_MORPH_TABLE_NUM_PLANES; i++) {
- me->coordinates_x[i] = kvmalloc(height * width *
- sizeof(*me->coordinates_x[i]),
+ me->coordinates_x[i] = kvmalloc(array3_size(height, width,
+ sizeof(*me->coordinates_x[i])),
GFP_KERNEL);
- me->coordinates_y[i] = kvmalloc(height * width *
- sizeof(*me->coordinates_y[i]),
+ me->coordinates_y[i] = kvmalloc(array3_size(height, width,
+ sizeof(*me->coordinates_y[i])),
GFP_KERNEL);
if ((!me->coordinates_x[i]) ||
@@ -4215,13 +4216,17 @@ ia_css_dvs_statistics_allocate(const struct ia_css_dvs_grid_info *grid)
goto err;
me->grid = *grid;
- me->hor_proj = kvmalloc(grid->height * IA_CSS_DVS_NUM_COEF_TYPES *
- sizeof(*me->hor_proj), GFP_KERNEL);
+ me->hor_proj = kvmalloc(array3_size(grid->height,
+ IA_CSS_DVS_NUM_COEF_TYPES,
+ sizeof(*me->hor_proj)),
+ GFP_KERNEL);
if (!me->hor_proj)
goto err;
- me->ver_proj = kvmalloc(grid->width * IA_CSS_DVS_NUM_COEF_TYPES *
- sizeof(*me->ver_proj), GFP_KERNEL);
+ me->ver_proj = kvmalloc(array3_size(grid->width,
+ IA_CSS_DVS_NUM_COEF_TYPES,
+ sizeof(*me->ver_proj)),
+ GFP_KERNEL);
if (!me->ver_proj)
goto err;
@@ -4488,24 +4493,26 @@ ia_css_dvs2_6axis_config_allocate(const struct ia_css_stream *stream)
params->pipe_dvs_6axis_config[IA_CSS_PIPE_ID_VIDEO]->height_uv;
IA_CSS_LOG("table Y: W %d H %d", width_y, height_y);
IA_CSS_LOG("table UV: W %d H %d", width_uv, height_uv);
- dvs_config->xcoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->xcoords_y = kvmalloc(array3_size(width_y, height_y,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_y)
goto err;
- dvs_config->ycoords_y = kvmalloc(width_y * height_y * sizeof(uint32_t),
+ dvs_config->ycoords_y = kvmalloc(array3_size(width_y, height_y,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_y)
goto err;
- dvs_config->xcoords_uv = kvmalloc(width_uv * height_uv *
- sizeof(uint32_t),
+ dvs_config->xcoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->xcoords_uv)
goto err;
- dvs_config->ycoords_uv = kvmalloc(width_uv * height_uv *
- sizeof(uint32_t),
+ dvs_config->ycoords_uv = kvmalloc(array3_size(width_uv, height_uv,
+ sizeof(uint32_t)),
GFP_KERNEL);
if (!dvs_config->ycoords_uv)
goto err;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 045/816] net/9p/fd: support ipv6 for trans=tcp
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 044/816] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 046/816] fs/fs_parse: Delete macro fsparam_u32hex() Greg Kroah-Hartman
` (775 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joshua Murphy, Dominique Martinet,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joshua Murphy <joshuamurphy@posteo.net>
[ Upstream commit a22a29655c42d0263a7a84d5d808bfd55f20c53a ]
Allows specifying an IPv6 address when mounting a remote 9p file system.
Signed-off-by: Joshua Murphy <joshuamurphy@posteo.net>
Message-ID: <20250118192122.327-2-joshuamurphy@posteo.net>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/9p/trans_fd.c | 56 ++++++++++++++++++++---------------------------
1 file changed, 24 insertions(+), 32 deletions(-)
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 5bdfc25689169..a516745f732f7 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -11,6 +11,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/in.h>
+#include <linux/in6.h>
#include <linux/module.h>
#include <linux/net.h>
#include <linux/ipv6.h>
@@ -950,64 +951,55 @@ static void p9_fd_close(struct p9_client *client)
kfree(ts);
}
-/*
- * stolen from NFS - maybe should be made a generic function?
- */
-static inline int valid_ipaddr4(const char *buf)
-{
- int rc, count, in[4];
-
- rc = sscanf(buf, "%d.%d.%d.%d", &in[0], &in[1], &in[2], &in[3]);
- if (rc != 4)
- return -EINVAL;
- for (count = 0; count < 4; count++) {
- if (in[count] > 255)
- return -EINVAL;
- }
- return 0;
-}
-
static int p9_bind_privport(struct socket *sock)
{
- struct sockaddr_in cl;
+ struct sockaddr_storage stor = { 0 };
int port, err = -EINVAL;
- memset(&cl, 0, sizeof(cl));
- cl.sin_family = AF_INET;
- cl.sin_addr.s_addr = htonl(INADDR_ANY);
+ stor.ss_family = sock->ops->family;
+ if (stor.ss_family == AF_INET)
+ ((struct sockaddr_in *)&stor)->sin_addr.s_addr = htonl(INADDR_ANY);
+ else
+ ((struct sockaddr_in6 *)&stor)->sin6_addr = in6addr_any;
for (port = p9_ipport_resv_max; port >= p9_ipport_resv_min; port--) {
- cl.sin_port = htons((ushort)port);
- err = kernel_bind(sock, (struct sockaddr *)&cl, sizeof(cl));
+ if (stor.ss_family == AF_INET)
+ ((struct sockaddr_in *)&stor)->sin_port = htons((ushort)port);
+ else
+ ((struct sockaddr_in6 *)&stor)->sin6_port = htons((ushort)port);
+ err = kernel_bind(sock, (struct sockaddr *)&stor, sizeof(stor));
if (err != -EADDRINUSE)
break;
}
return err;
}
-
static int
p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)
{
int err;
+ char port_str[6];
struct socket *csocket;
- struct sockaddr_in sin_server;
+ struct sockaddr_storage stor = { 0 };
struct p9_fd_opts opts;
err = parse_opts(args, &opts);
if (err < 0)
return err;
- if (addr == NULL || valid_ipaddr4(addr) < 0)
+ if (!addr)
return -EINVAL;
+ sprintf(port_str, "%u", opts.port);
+ err = inet_pton_with_scope(current->nsproxy->net_ns, AF_UNSPEC, addr,
+ port_str, &stor);
+ if (err < 0)
+ return err;
+
csocket = NULL;
client->trans_opts.tcp.port = opts.port;
client->trans_opts.tcp.privport = opts.privport;
- sin_server.sin_family = AF_INET;
- sin_server.sin_addr.s_addr = in_aton(addr);
- sin_server.sin_port = htons(opts.port);
- err = __sock_create(current->nsproxy->net_ns, PF_INET,
+ err = __sock_create(current->nsproxy->net_ns, stor.ss_family,
SOCK_STREAM, IPPROTO_TCP, &csocket, 1);
if (err) {
pr_err("%s (%d): problem creating socket\n",
@@ -1026,8 +1018,8 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)
}
err = READ_ONCE(csocket->ops)->connect(csocket,
- (struct sockaddr *)&sin_server,
- sizeof(struct sockaddr_in), 0);
+ (struct sockaddr *)&stor,
+ sizeof(stor), 0);
if (err < 0) {
pr_err("%s (%d): problem connecting socket to %s\n",
__func__, task_pid_nr(current), addr);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 046/816] fs/fs_parse: Delete macro fsparam_u32hex()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 045/816] net/9p/fd: support ipv6 for trans=tcp Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 047/816] fs/fs_parse: add back fsparam_u32hex Greg Kroah-Hartman
` (774 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zijun Hu, Jan Kara,
Christian Brauner, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <quic_zijuhu@quicinc.com>
[ Upstream commit 296b67059e3026125a1ca942f5506e6ca051749e ]
Delete macro fsparam_u32hex() since:
- it has no caller.
- it uses as type @fs_param_is_u32_hex which is never defined, so will
cause compile error when caller uses it.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/20250411-fix_fs-v2-1-5d3395c102e4@quicinc.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/filesystems/mount_api.rst | 1 -
include/linux/fs_parser.h | 2 --
2 files changed, 3 deletions(-)
diff --git a/Documentation/filesystems/mount_api.rst b/Documentation/filesystems/mount_api.rst
index d92c276f1575a..47dafbb7427e6 100644
--- a/Documentation/filesystems/mount_api.rst
+++ b/Documentation/filesystems/mount_api.rst
@@ -671,7 +671,6 @@ The members are as follows:
fsparam_bool() fs_param_is_bool
fsparam_u32() fs_param_is_u32
fsparam_u32oct() fs_param_is_u32_octal
- fsparam_u32hex() fs_param_is_u32_hex
fsparam_s32() fs_param_is_s32
fsparam_u64() fs_param_is_u64
fsparam_enum() fs_param_is_enum
diff --git a/include/linux/fs_parser.h b/include/linux/fs_parser.h
index 6cf713a7e6c6f..b093348613ddd 100644
--- a/include/linux/fs_parser.h
+++ b/include/linux/fs_parser.h
@@ -122,8 +122,6 @@ static inline bool fs_validate_description(const char *name,
#define fsparam_u32(NAME, OPT) __fsparam(fs_param_is_u32, NAME, OPT, 0, NULL)
#define fsparam_u32oct(NAME, OPT) \
__fsparam(fs_param_is_u32, NAME, OPT, 0, (void *)8)
-#define fsparam_u32hex(NAME, OPT) \
- __fsparam(fs_param_is_u32_hex, NAME, OPT, 0, (void *)16)
#define fsparam_s32(NAME, OPT) __fsparam(fs_param_is_s32, NAME, OPT, 0, NULL)
#define fsparam_u64(NAME, OPT) __fsparam(fs_param_is_u64, NAME, OPT, 0, NULL)
#define fsparam_enum(NAME, OPT, array) __fsparam(fs_param_is_enum, NAME, OPT, 0, array)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 047/816] fs/fs_parse: add back fsparam_u32hex
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 046/816] fs/fs_parse: Delete macro fsparam_u32hex() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 048/816] net/9p: move structures and macros to header files Greg Kroah-Hartman
` (773 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Sandeen, Dominique Martinet,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <sandeen@redhat.com>
[ Upstream commit 695f2ca1b4247724576d57eae7b74b90dc69ba3c ]
296b67059 removed fsparam_u32hex because there were no callers
(yet) and it didn't build due to using the nonexistent symbol
fs_param_is_u32_hex.
fs/9p will need this parser, so add it back with the appropriate
fix (use fs_param_is_u32).
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Message-ID: <20251010214222.1347785-2-sandeen@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/fs_parser.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/fs_parser.h b/include/linux/fs_parser.h
index b093348613ddd..7ce7bdcf5ae39 100644
--- a/include/linux/fs_parser.h
+++ b/include/linux/fs_parser.h
@@ -122,6 +122,8 @@ static inline bool fs_validate_description(const char *name,
#define fsparam_u32(NAME, OPT) __fsparam(fs_param_is_u32, NAME, OPT, 0, NULL)
#define fsparam_u32oct(NAME, OPT) \
__fsparam(fs_param_is_u32, NAME, OPT, 0, (void *)8)
+#define fsparam_u32hex(NAME, OPT) \
+ __fsparam(fs_param_is_u32, NAME, OPT, 0, (void *)16)
#define fsparam_s32(NAME, OPT) __fsparam(fs_param_is_s32, NAME, OPT, 0, NULL)
#define fsparam_u64(NAME, OPT) __fsparam(fs_param_is_u64, NAME, OPT, 0, NULL)
#define fsparam_enum(NAME, OPT, array) __fsparam(fs_param_is_enum, NAME, OPT, 0, array)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 048/816] net/9p: move structures and macros to header files
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 047/816] fs/fs_parse: add back fsparam_u32hex Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 049/816] 9p: create a v9fs_context structure to hold parsed options Greg Kroah-Hartman
` (772 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Sandeen, Dominique Martinet,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <sandeen@redhat.com>
[ Upstream commit c44393d84149d6fc91d94fa39321c9657e91b388 ]
With the new mount API all option parsing will need to happen
in fs/v9fs.c, so move some existing data structures and macros
to header files to facilitate this. Rename some to reflect
the transport they are used for (rdma, fd, etc), for clarity.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Message-ID: <20251010214222.1347785-3-sandeen@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/9p/client.h | 6 ++++++
include/net/9p/transport.h | 39 ++++++++++++++++++++++++++++++++++++++
net/9p/client.c | 6 ------
net/9p/trans_fd.c | 20 ++-----------------
net/9p/trans_rdma.c | 25 ++----------------------
5 files changed, 49 insertions(+), 47 deletions(-)
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 4f785098c67a1..2d46f8017bd57 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -16,6 +16,12 @@
/* Number of requests per row */
#define P9_ROW_MAXTAG 255
+/* DEFAULT MSIZE = 32 pages worth of payload + P9_HDRSZ +
+ * room for write (16 extra) or read (11 extra) operands.
+ */
+
+#define DEFAULT_MSIZE ((128 * 1024) + P9_IOHDRSZ)
+
/** enum p9_proto_versions - 9P protocol versions
* @p9_proto_legacy: 9P Legacy mode, pre-9P2000.u
* @p9_proto_2000u: 9P2000.u extension
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 766ec07c95999..88702953b1ef2 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -14,6 +14,45 @@
#define P9_DEF_MIN_RESVPORT (665U)
#define P9_DEF_MAX_RESVPORT (1023U)
+#define P9_FD_PORT 564
+
+#define P9_RDMA_PORT 5640
+#define P9_RDMA_SQ_DEPTH 32
+#define P9_RDMA_RQ_DEPTH 32
+#define P9_RDMA_TIMEOUT 30000 /* 30 seconds */
+
+/**
+ * struct p9_fd_opts - per-transport options for fd transport
+ * @rfd: file descriptor for reading (trans=fd)
+ * @wfd: file descriptor for writing (trans=fd)
+ * @port: port to connect to (trans=tcp)
+ * @privport: port is privileged
+ */
+
+struct p9_fd_opts {
+ int rfd;
+ int wfd;
+ u16 port;
+ bool privport;
+};
+
+/**
+ * struct p9_rdma_opts - Collection of mount options for rdma transport
+ * @port: port of connection
+ * @privport: Whether a privileged port may be used
+ * @sq_depth: The requested depth of the SQ. This really doesn't need
+ * to be any deeper than the number of threads used in the client
+ * @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth
+ * @timeout: Time to wait in msecs for CM events
+ */
+struct p9_rdma_opts {
+ short port;
+ bool privport;
+ int sq_depth;
+ int rq_depth;
+ long timeout;
+};
+
/**
* struct p9_trans_module - transport module interface
* @list: used to maintain a list of currently available transports
diff --git a/net/9p/client.c b/net/9p/client.c
index 17f7b1290f6b9..d7802d67724cd 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -29,12 +29,6 @@
#define CREATE_TRACE_POINTS
#include <trace/events/9p.h>
-/* DEFAULT MSIZE = 32 pages worth of payload + P9_HDRSZ +
- * room for write (16 extra) or read (11 extra) operands.
- */
-
-#define DEFAULT_MSIZE ((128 * 1024) + P9_IOHDRSZ)
-
/* Client Option Parsing (code inspired by NFS code)
* - a little lazy - parse all client options
*/
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index a516745f732f7..fdaebb549aa8f 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -31,28 +31,12 @@
#include <linux/syscalls.h> /* killme */
-#define P9_PORT 564
#define MAX_SOCK_BUF (1024*1024)
#define MAXPOLLWADDR 2
static struct p9_trans_module p9_tcp_trans;
static struct p9_trans_module p9_fd_trans;
-/**
- * struct p9_fd_opts - per-transport options
- * @rfd: file descriptor for reading (trans=fd)
- * @wfd: file descriptor for writing (trans=fd)
- * @port: port to connect to (trans=tcp)
- * @privport: port is privileged
- */
-
-struct p9_fd_opts {
- int rfd;
- int wfd;
- u16 port;
- bool privport;
-};
-
/*
* Option Parsing (code inspired by NFS code)
* - a little lazy - parse all fd-transport options
@@ -742,7 +726,7 @@ static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req)
static int p9_fd_show_options(struct seq_file *m, struct p9_client *clnt)
{
if (clnt->trans_mod == &p9_tcp_trans) {
- if (clnt->trans_opts.tcp.port != P9_PORT)
+ if (clnt->trans_opts.tcp.port != P9_FD_PORT)
seq_printf(m, ",port=%u", clnt->trans_opts.tcp.port);
} else if (clnt->trans_mod == &p9_fd_trans) {
if (clnt->trans_opts.fd.rfd != ~0)
@@ -768,7 +752,7 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
int option;
char *options, *tmp_options;
- opts->port = P9_PORT;
+ opts->port = P9_FD_PORT;
opts->rfd = ~0;
opts->wfd = ~0;
opts->privport = false;
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index d9f53f1da2c21..92b166a4a1e52 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -32,14 +32,10 @@
#include <rdma/ib_verbs.h>
#include <rdma/rdma_cm.h>
-#define P9_PORT 5640
-#define P9_RDMA_SQ_DEPTH 32
-#define P9_RDMA_RQ_DEPTH 32
#define P9_RDMA_SEND_SGE 4
#define P9_RDMA_RECV_SGE 4
#define P9_RDMA_IRD 0
#define P9_RDMA_ORD 0
-#define P9_RDMA_TIMEOUT 30000 /* 30 seconds */
#define P9_RDMA_MAXSIZE (1024*1024) /* 1MB */
/**
@@ -110,23 +106,6 @@ struct p9_rdma_context {
};
};
-/**
- * struct p9_rdma_opts - Collection of mount options
- * @port: port of connection
- * @privport: Whether a privileged port may be used
- * @sq_depth: The requested depth of the SQ. This really doesn't need
- * to be any deeper than the number of threads used in the client
- * @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth
- * @timeout: Time to wait in msecs for CM events
- */
-struct p9_rdma_opts {
- short port;
- bool privport;
- int sq_depth;
- int rq_depth;
- long timeout;
-};
-
/*
* Option Parsing (code inspired by NFS code)
*/
@@ -151,7 +130,7 @@ static int p9_rdma_show_options(struct seq_file *m, struct p9_client *clnt)
{
struct p9_trans_rdma *rdma = clnt->trans;
- if (rdma->port != P9_PORT)
+ if (rdma->port != P9_RDMA_PORT)
seq_printf(m, ",port=%u", rdma->port);
if (rdma->sq_depth != P9_RDMA_SQ_DEPTH)
seq_printf(m, ",sq=%u", rdma->sq_depth);
@@ -178,7 +157,7 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts)
int option;
char *options, *tmp_options;
- opts->port = P9_PORT;
+ opts->port = P9_RDMA_PORT;
opts->sq_depth = P9_RDMA_SQ_DEPTH;
opts->rq_depth = P9_RDMA_RQ_DEPTH;
opts->timeout = P9_RDMA_TIMEOUT;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 049/816] 9p: create a v9fs_context structure to hold parsed options
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 048/816] net/9p: move structures and macros to header files Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 050/816] 9p: convert to the new mount API Greg Kroah-Hartman
` (771 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Sandeen, Dominique Martinet,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <sandeen@redhat.com>
[ Upstream commit 075e8bd4127f007910fc302ad5c3c471d0be4799 ]
This patch creates a new v9fs_context structure which includes
new p9_session_opts and p9_client_opts structures, as well as
re-using the existing p9_fd_opts and p9_rdma_opts to store options
during parsing. The new structure will be used in the next
commit to pass all parsed options to the appropriate transports.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Message-ID: <20251010214222.1347785-4-sandeen@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/9p/client.h | 90 ++++++++++++++++++++++++++++++++++++++
include/net/9p/transport.h | 32 --------------
2 files changed, 90 insertions(+), 32 deletions(-)
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 2d46f8017bd57..cc18443f7d516 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -132,6 +132,96 @@ struct p9_client {
char name[__NEW_UTS_LEN + 1];
};
+/**
+ * struct p9_fd_opts - holds client options during parsing
+ * @msize: maximum data size negotiated by protocol
+ * @prot-Oversion: 9P protocol version to use
+ * @trans_mod: module API instantiated with this client
+ *
+ * These parsed options get transferred into client in
+ * apply_client_options()
+ */
+struct p9_client_opts {
+ unsigned int msize;
+ unsigned char proto_version;
+ struct p9_trans_module *trans_mod;
+};
+
+/**
+ * struct p9_fd_opts - per-transport options for fd transport
+ * @rfd: file descriptor for reading (trans=fd)
+ * @wfd: file descriptor for writing (trans=fd)
+ * @port: port to connect to (trans=tcp)
+ * @privport: port is privileged
+ */
+struct p9_fd_opts {
+ int rfd;
+ int wfd;
+ u16 port;
+ bool privport;
+};
+
+/**
+ * struct p9_rdma_opts - Collection of mount options for rdma transport
+ * @port: port of connection
+ * @privport: Whether a privileged port may be used
+ * @sq_depth: The requested depth of the SQ. This really doesn't need
+ * to be any deeper than the number of threads used in the client
+ * @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth
+ * @timeout: Time to wait in msecs for CM events
+ */
+struct p9_rdma_opts {
+ short port;
+ bool privport;
+ int sq_depth;
+ int rq_depth;
+ long timeout;
+};
+
+/**
+ * struct p9_session_opts - holds parsed options for v9fs_session_info
+ * @flags: session options of type &p9_session_flags
+ * @nodev: set to 1 to disable device mapping
+ * @debug: debug level
+ * @afid: authentication handle
+ * @cache: cache mode of type &p9_cache_bits
+ * @cachetag: the tag of the cache associated with this session
+ * @uname: string user name to mount hierarchy as
+ * @aname: mount specifier for remote hierarchy
+ * @dfltuid: default numeric userid to mount hierarchy as
+ * @dfltgid: default numeric groupid to mount hierarchy as
+ * @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy
+ * @session_lock_timeout: retry interval for blocking locks
+ *
+ * This strucure holds options which are parsed and will be transferred
+ * to the v9fs_session_info structure when mounted, and therefore largely
+ * duplicates struct v9fs_session_info.
+ */
+struct p9_session_opts {
+ unsigned int flags;
+ unsigned char nodev;
+ unsigned short debug;
+ unsigned int afid;
+ unsigned int cache;
+#ifdef CONFIG_9P_FSCACHE
+ char *cachetag;
+#endif
+ char *uname;
+ char *aname;
+ kuid_t dfltuid;
+ kgid_t dfltgid;
+ kuid_t uid;
+ long session_lock_timeout;
+};
+
+/* Used by mount API to store parsed mount options */
+struct v9fs_context {
+ struct p9_client_opts client_opts;
+ struct p9_fd_opts fd_opts;
+ struct p9_rdma_opts rdma_opts;
+ struct p9_session_opts session_opts;
+};
+
/**
* struct p9_fid - file system entity handle
* @clnt: back pointer to instantiating &p9_client
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 88702953b1ef2..ebbb4b50ee205 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -21,38 +21,6 @@
#define P9_RDMA_RQ_DEPTH 32
#define P9_RDMA_TIMEOUT 30000 /* 30 seconds */
-/**
- * struct p9_fd_opts - per-transport options for fd transport
- * @rfd: file descriptor for reading (trans=fd)
- * @wfd: file descriptor for writing (trans=fd)
- * @port: port to connect to (trans=tcp)
- * @privport: port is privileged
- */
-
-struct p9_fd_opts {
- int rfd;
- int wfd;
- u16 port;
- bool privport;
-};
-
-/**
- * struct p9_rdma_opts - Collection of mount options for rdma transport
- * @port: port of connection
- * @privport: Whether a privileged port may be used
- * @sq_depth: The requested depth of the SQ. This really doesn't need
- * to be any deeper than the number of threads used in the client
- * @rq_depth: The depth of the RQ. Should be greater than or equal to SQ depth
- * @timeout: Time to wait in msecs for CM events
- */
-struct p9_rdma_opts {
- short port;
- bool privport;
- int sq_depth;
- int rq_depth;
- long timeout;
-};
-
/**
* struct p9_trans_module - transport module interface
* @list: used to maintain a list of currently available transports
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 050/816] 9p: convert to the new mount API
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 049/816] 9p: create a v9fs_context structure to hold parsed options Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 051/816] net/9p: Replace strlen() strcpy() pair with strscpy() Greg Kroah-Hartman
` (770 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Sandeen, Dominique Martinet,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Sandeen <sandeen@redhat.com>
[ Upstream commit 1f3e4142c0eb178089ea0cbc97506a061470ad27 ]
Convert 9p to the new mount API. This patch consolidates all parsing
into fs/9p/v9fs.c, which stores all results into a filesystem context
which can be passed to the various transports as needed.
Some of the parsing helper functions such as get_cache_mode() have been
eliminated in favor of using the new mount API's enum param type,
for simplicity.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Message-ID: <20251010214222.1347785-5-sandeen@redhat.com>
[ Dominique: handled source explicitly as per follow-up discussion ]
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/9p/v9fs.c | 552 +++++++++++++++++++------------------
fs/9p/v9fs.h | 7 +-
fs/9p/vfs_super.c | 130 ++++++---
include/net/9p/client.h | 2 +-
include/net/9p/transport.h | 2 +-
net/9p/client.c | 148 +---------
net/9p/mod.c | 2 +-
net/9p/trans_fd.c | 109 +-------
net/9p/trans_rdma.c | 108 +-------
net/9p/trans_usbg.c | 4 +-
net/9p/trans_virtio.c | 8 +-
net/9p/trans_xen.c | 4 +-
12 files changed, 424 insertions(+), 652 deletions(-)
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 66b072152745a..213167f74a993 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -13,7 +13,8 @@
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/cred.h>
-#include <linux/parser.h>
+#include <linux/fs_parser.h>
+#include <linux/fs_context.h>
#include <linux/slab.h>
#include <linux/seq_file.h>
#include <linux/sysfs.h>
@@ -34,6 +35,10 @@ struct kmem_cache *v9fs_inode_cache;
*/
enum {
+ /* Mount-point source, we need to handle this explicitly because
+ * the code below accepts unknown args and the vfs layer only handles
+ * source if we rejected it as EINVAL */
+ Opt_source,
/* Options that take integer arguments */
Opt_debug, Opt_dfltuid, Opt_dfltgid, Opt_afid,
/* String options */
@@ -44,55 +49,81 @@ enum {
Opt_access, Opt_posixacl,
/* Lock timeout option */
Opt_locktimeout,
- /* Error token */
- Opt_err
+
+ /* Client options */
+ Opt_msize, Opt_trans, Opt_legacy, Opt_version,
+
+ /* fd transport options */
+ /* Options that take integer arguments */
+ Opt_rfdno, Opt_wfdno,
+ /* Options that take no arguments */
+
+ /* rdma transport options */
+ /* Options that take integer arguments */
+ Opt_rq_depth, Opt_sq_depth, Opt_timeout,
+
+ /* Options for both fd and rdma transports */
+ Opt_port, Opt_privport,
};
-static const match_table_t tokens = {
- {Opt_debug, "debug=%x"},
- {Opt_dfltuid, "dfltuid=%u"},
- {Opt_dfltgid, "dfltgid=%u"},
- {Opt_afid, "afid=%u"},
- {Opt_uname, "uname=%s"},
- {Opt_remotename, "aname=%s"},
- {Opt_nodevmap, "nodevmap"},
- {Opt_noxattr, "noxattr"},
- {Opt_directio, "directio"},
- {Opt_ignoreqv, "ignoreqv"},
- {Opt_cache, "cache=%s"},
- {Opt_cachetag, "cachetag=%s"},
- {Opt_access, "access=%s"},
- {Opt_posixacl, "posixacl"},
- {Opt_locktimeout, "locktimeout=%u"},
- {Opt_err, NULL}
+static const struct constant_table p9_versions[] = {
+ { "9p2000", p9_proto_legacy },
+ { "9p2000.u", p9_proto_2000u },
+ { "9p2000.L", p9_proto_2000L },
+ {}
};
-/* Interpret mount options for cache mode */
-static int get_cache_mode(char *s)
-{
- int version = -EINVAL;
-
- if (!strcmp(s, "loose")) {
- version = CACHE_SC_LOOSE;
- p9_debug(P9_DEBUG_9P, "Cache mode: loose\n");
- } else if (!strcmp(s, "fscache")) {
- version = CACHE_SC_FSCACHE;
- p9_debug(P9_DEBUG_9P, "Cache mode: fscache\n");
- } else if (!strcmp(s, "mmap")) {
- version = CACHE_SC_MMAP;
- p9_debug(P9_DEBUG_9P, "Cache mode: mmap\n");
- } else if (!strcmp(s, "readahead")) {
- version = CACHE_SC_READAHEAD;
- p9_debug(P9_DEBUG_9P, "Cache mode: readahead\n");
- } else if (!strcmp(s, "none")) {
- version = CACHE_SC_NONE;
- p9_debug(P9_DEBUG_9P, "Cache mode: none\n");
- } else if (kstrtoint(s, 0, &version) != 0) {
- version = -EINVAL;
- pr_info("Unknown Cache mode or invalid value %s\n", s);
- }
- return version;
-}
+static const struct constant_table p9_cache_mode[] = {
+ { "loose", CACHE_SC_LOOSE },
+ { "fscache", CACHE_SC_FSCACHE },
+ { "mmap", CACHE_SC_MMAP },
+ { "readahead", CACHE_SC_READAHEAD },
+ { "none", CACHE_SC_NONE },
+ {}
+};
+
+/*
+ * This structure contains all parameters used for the core code,
+ * the client, and all the transports.
+ */
+const struct fs_parameter_spec v9fs_param_spec[] = {
+ fsparam_string ("source", Opt_source),
+ fsparam_u32hex ("debug", Opt_debug),
+ fsparam_uid ("dfltuid", Opt_dfltuid),
+ fsparam_gid ("dfltgid", Opt_dfltgid),
+ fsparam_u32 ("afid", Opt_afid),
+ fsparam_string ("uname", Opt_uname),
+ fsparam_string ("aname", Opt_remotename),
+ fsparam_flag ("nodevmap", Opt_nodevmap),
+ fsparam_flag ("noxattr", Opt_noxattr),
+ fsparam_flag ("directio", Opt_directio),
+ fsparam_flag ("ignoreqv", Opt_ignoreqv),
+ fsparam_enum ("cache", Opt_cache, p9_cache_mode),
+ fsparam_string ("cachetag", Opt_cachetag),
+ fsparam_string ("access", Opt_access),
+ fsparam_flag ("posixacl", Opt_posixacl),
+ fsparam_u32 ("locktimeout", Opt_locktimeout),
+
+ /* client options */
+ fsparam_u32 ("msize", Opt_msize),
+ fsparam_flag ("noextend", Opt_legacy),
+ fsparam_string ("trans", Opt_trans),
+ fsparam_enum ("version", Opt_version, p9_versions),
+
+ /* fd transport options */
+ fsparam_u32 ("rfdno", Opt_rfdno),
+ fsparam_u32 ("wfdno", Opt_wfdno),
+
+ /* rdma transport options */
+ fsparam_u32 ("sq", Opt_sq_depth),
+ fsparam_u32 ("rq", Opt_rq_depth),
+ fsparam_u32 ("timeout", Opt_timeout),
+
+ /* fd and rdma transprt options */
+ fsparam_u32 ("port", Opt_port),
+ fsparam_flag ("privport", Opt_privport),
+ {}
+};
/*
* Display the mount options in /proc/mounts.
@@ -154,267 +185,252 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
}
/**
- * v9fs_parse_options - parse mount options into session structure
- * @v9ses: existing v9fs session information
- * @opts: The mount option string
+ * v9fs_parse_param - parse a mount option into the filesystem context
+ * @fc: the filesystem context
+ * @param: the parameter to parse
*
* Return 0 upon success, -ERRNO upon failure.
*/
-
-static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
+int v9fs_parse_param(struct fs_context *fc, struct fs_parameter *param)
{
- char *options, *tmp_options;
- substring_t args[MAX_OPT_ARGS];
- char *p;
- int option = 0;
+ struct v9fs_context *ctx = fc->fs_private;
+ struct fs_parse_result result;
char *s;
- int ret = 0;
-
- /* setup defaults */
- v9ses->afid = ~0;
- v9ses->debug = 0;
- v9ses->cache = CACHE_NONE;
-#ifdef CONFIG_9P_FSCACHE
- v9ses->cachetag = NULL;
-#endif
- v9ses->session_lock_timeout = P9_LOCK_TIMEOUT;
-
- if (!opts)
- return 0;
+ int r;
+ int opt;
+ struct p9_client_opts *clnt = &ctx->client_opts;
+ struct p9_fd_opts *fd_opts = &ctx->fd_opts;
+ struct p9_rdma_opts *rdma_opts = &ctx->rdma_opts;
+ struct p9_session_opts *session_opts = &ctx->session_opts;
+
+ opt = fs_parse(fc, v9fs_param_spec, param, &result);
+ if (opt < 0) {
+ /*
+ * We might like to report bad mount options here, but
+ * traditionally 9p has ignored unknown mount options
+ */
+ if (opt == -ENOPARAM)
+ return 0;
- tmp_options = kstrdup(opts, GFP_KERNEL);
- if (!tmp_options) {
- ret = -ENOMEM;
- goto fail_option_alloc;
+ return opt;
}
- options = tmp_options;
-
- while ((p = strsep(&options, ",")) != NULL) {
- int token, r;
-
- if (!*p)
- continue;
-
- token = match_token(p, tokens, args);
- switch (token) {
- case Opt_debug:
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- ret = r;
- } else {
- v9ses->debug = option;
+
+ switch (opt) {
+ case Opt_source:
+ if (fc->source) {
+ pr_info("p9: multiple sources not supported\n");
+ return -EINVAL;
+ }
+ fc->source = param->string;
+ param->string = NULL;
+ break;
+ case Opt_debug:
+ session_opts->debug = result.uint_32;
#ifdef CONFIG_NET_9P_DEBUG
- p9_debug_level = option;
+ p9_debug_level = result.uint_32;
#endif
- }
- break;
-
- case Opt_dfltuid:
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- ret = r;
- continue;
- }
- v9ses->dfltuid = make_kuid(current_user_ns(), option);
- if (!uid_valid(v9ses->dfltuid)) {
- p9_debug(P9_DEBUG_ERROR,
- "uid field, but not a uid?\n");
- ret = -EINVAL;
- }
- break;
- case Opt_dfltgid:
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- ret = r;
- continue;
- }
- v9ses->dfltgid = make_kgid(current_user_ns(), option);
- if (!gid_valid(v9ses->dfltgid)) {
- p9_debug(P9_DEBUG_ERROR,
- "gid field, but not a gid?\n");
- ret = -EINVAL;
- }
- break;
- case Opt_afid:
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- ret = r;
- } else {
- v9ses->afid = option;
- }
- break;
- case Opt_uname:
- kfree(v9ses->uname);
- v9ses->uname = match_strdup(&args[0]);
- if (!v9ses->uname) {
- ret = -ENOMEM;
- goto free_and_return;
- }
- break;
- case Opt_remotename:
- kfree(v9ses->aname);
- v9ses->aname = match_strdup(&args[0]);
- if (!v9ses->aname) {
- ret = -ENOMEM;
- goto free_and_return;
- }
- break;
- case Opt_nodevmap:
- v9ses->nodev = 1;
- break;
- case Opt_noxattr:
- v9ses->flags |= V9FS_NO_XATTR;
- break;
- case Opt_directio:
- v9ses->flags |= V9FS_DIRECT_IO;
- break;
- case Opt_ignoreqv:
- v9ses->flags |= V9FS_IGNORE_QV;
- break;
- case Opt_cachetag:
+ break;
+
+ case Opt_dfltuid:
+ session_opts->dfltuid = result.uid;
+ break;
+ case Opt_dfltgid:
+ session_opts->dfltgid = result.gid;
+ break;
+ case Opt_afid:
+ session_opts->afid = result.uint_32;
+ break;
+ case Opt_uname:
+ kfree(session_opts->uname);
+ session_opts->uname = param->string;
+ param->string = NULL;
+ break;
+ case Opt_remotename:
+ kfree(session_opts->aname);
+ session_opts->aname = param->string;
+ param->string = NULL;
+ break;
+ case Opt_nodevmap:
+ session_opts->nodev = 1;
+ break;
+ case Opt_noxattr:
+ session_opts->flags |= V9FS_NO_XATTR;
+ break;
+ case Opt_directio:
+ session_opts->flags |= V9FS_DIRECT_IO;
+ break;
+ case Opt_ignoreqv:
+ session_opts->flags |= V9FS_IGNORE_QV;
+ break;
+ case Opt_cachetag:
#ifdef CONFIG_9P_FSCACHE
- kfree(v9ses->cachetag);
- v9ses->cachetag = match_strdup(&args[0]);
- if (!v9ses->cachetag) {
- ret = -ENOMEM;
- goto free_and_return;
- }
+ kfree(session_opts->cachetag);
+ session_opts->cachetag = param->string;
+ param->string = NULL;
#endif
- break;
- case Opt_cache:
- s = match_strdup(&args[0]);
- if (!s) {
- ret = -ENOMEM;
- p9_debug(P9_DEBUG_ERROR,
- "problem allocating copy of cache arg\n");
- goto free_and_return;
- }
- r = get_cache_mode(s);
- if (r < 0)
- ret = r;
- else
- v9ses->cache = r;
-
- kfree(s);
- break;
-
- case Opt_access:
- s = match_strdup(&args[0]);
- if (!s) {
- ret = -ENOMEM;
- p9_debug(P9_DEBUG_ERROR,
- "problem allocating copy of access arg\n");
- goto free_and_return;
+ break;
+ case Opt_cache:
+ session_opts->cache = result.uint_32;
+ p9_debug(P9_DEBUG_9P, "Cache mode: %s\n", param->string);
+ break;
+ case Opt_access:
+ s = param->string;
+ session_opts->flags &= ~V9FS_ACCESS_MASK;
+ if (strcmp(s, "user") == 0) {
+ session_opts->flags |= V9FS_ACCESS_USER;
+ } else if (strcmp(s, "any") == 0) {
+ session_opts->flags |= V9FS_ACCESS_ANY;
+ } else if (strcmp(s, "client") == 0) {
+ session_opts->flags |= V9FS_ACCESS_CLIENT;
+ } else {
+ uid_t uid;
+
+ session_opts->flags |= V9FS_ACCESS_SINGLE;
+ r = kstrtouint(s, 10, &uid);
+ if (r) {
+ pr_info("Unknown access argument %s: %d\n",
+ param->string, r);
+ return r;
}
-
- v9ses->flags &= ~V9FS_ACCESS_MASK;
- if (strcmp(s, "user") == 0)
- v9ses->flags |= V9FS_ACCESS_USER;
- else if (strcmp(s, "any") == 0)
- v9ses->flags |= V9FS_ACCESS_ANY;
- else if (strcmp(s, "client") == 0) {
- v9ses->flags |= V9FS_ACCESS_CLIENT;
- } else {
- uid_t uid;
-
- v9ses->flags |= V9FS_ACCESS_SINGLE;
- r = kstrtouint(s, 10, &uid);
- if (r) {
- ret = r;
- pr_info("Unknown access argument %s: %d\n",
- s, r);
- kfree(s);
- continue;
- }
- v9ses->uid = make_kuid(current_user_ns(), uid);
- if (!uid_valid(v9ses->uid)) {
- ret = -EINVAL;
- pr_info("Unknown uid %s\n", s);
- }
+ session_opts->uid = make_kuid(current_user_ns(), uid);
+ if (!uid_valid(session_opts->uid)) {
+ pr_info("Unknown uid %s\n", s);
+ return -EINVAL;
}
+ }
+ break;
- kfree(s);
- break;
-
- case Opt_posixacl:
+ case Opt_posixacl:
#ifdef CONFIG_9P_FS_POSIX_ACL
- v9ses->flags |= V9FS_POSIX_ACL;
+ session_opts->flags |= V9FS_POSIX_ACL;
#else
- p9_debug(P9_DEBUG_ERROR,
- "Not defined CONFIG_9P_FS_POSIX_ACL. Ignoring posixacl option\n");
+ p9_debug(P9_DEBUG_ERROR,
+ "Not defined CONFIG_9P_FS_POSIX_ACL. Ignoring posixacl option\n");
#endif
- break;
-
- case Opt_locktimeout:
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- ret = r;
- continue;
- }
- if (option < 1) {
- p9_debug(P9_DEBUG_ERROR,
- "locktimeout must be a greater than zero integer.\n");
- ret = -EINVAL;
- continue;
- }
- v9ses->session_lock_timeout = (long)option * HZ;
- break;
+ break;
- default:
- continue;
+ case Opt_locktimeout:
+ if (result.uint_32 < 1) {
+ p9_debug(P9_DEBUG_ERROR,
+ "locktimeout must be a greater than zero integer.\n");
+ return -EINVAL;
+ }
+ session_opts->session_lock_timeout = (long)result.uint_32 * HZ;
+ break;
+
+ /* Options for client */
+ case Opt_msize:
+ if (result.uint_32 < 4096) {
+ p9_debug(P9_DEBUG_ERROR, "msize should be at least 4k\n");
+ return -EINVAL;
+ }
+ if (result.uint_32 > INT_MAX) {
+ p9_debug(P9_DEBUG_ERROR, "msize too big\n");
+ return -EINVAL;
}
+ clnt->msize = result.uint_32;
+ break;
+ case Opt_trans:
+ v9fs_put_trans(clnt->trans_mod);
+ clnt->trans_mod = v9fs_get_trans_by_name(param->string);
+ if (!clnt->trans_mod) {
+ pr_info("Could not find request transport: %s\n",
+ param->string);
+ return -EINVAL;
+ }
+ break;
+ case Opt_legacy:
+ clnt->proto_version = p9_proto_legacy;
+ break;
+ case Opt_version:
+ clnt->proto_version = result.uint_32;
+ p9_debug(P9_DEBUG_9P, "Protocol version: %s\n", param->string);
+ break;
+ /* Options for fd transport */
+ case Opt_rfdno:
+ fd_opts->rfd = result.uint_32;
+ break;
+ case Opt_wfdno:
+ fd_opts->wfd = result.uint_32;
+ break;
+ /* Options for rdma transport */
+ case Opt_sq_depth:
+ rdma_opts->sq_depth = result.uint_32;
+ break;
+ case Opt_rq_depth:
+ rdma_opts->rq_depth = result.uint_32;
+ break;
+ case Opt_timeout:
+ rdma_opts->timeout = result.uint_32;
+ break;
+ /* Options for both fd and rdma transports */
+ case Opt_port:
+ fd_opts->port = result.uint_32;
+ rdma_opts->port = result.uint_32;
+ break;
+ case Opt_privport:
+ fd_opts->privport = true;
+ rdma_opts->port = true;
+ break;
}
-free_and_return:
- kfree(tmp_options);
-fail_option_alloc:
- return ret;
+ return 0;
+}
+
+static void v9fs_apply_options(struct v9fs_session_info *v9ses,
+ struct fs_context *fc)
+{
+ struct v9fs_context *ctx = fc->fs_private;
+
+ v9ses->debug = ctx->session_opts.debug;
+ v9ses->dfltuid = ctx->session_opts.dfltuid;
+ v9ses->dfltgid = ctx->session_opts.dfltgid;
+ v9ses->afid = ctx->session_opts.afid;
+ v9ses->uname = ctx->session_opts.uname;
+ ctx->session_opts.uname = NULL;
+ v9ses->aname = ctx->session_opts.aname;
+ ctx->session_opts.aname = NULL;
+ v9ses->nodev = ctx->session_opts.nodev;
+ /*
+ * Note that we must |= flags here as session_init already
+ * set basic flags. This adds in flags from parsed options.
+ */
+ v9ses->flags |= ctx->session_opts.flags;
+#ifdef CONFIG_9P_FSCACHE
+ v9ses->cachetag = ctx->session_opts.cachetag;
+ ctx->session_opts.cachetag = NULL;
+#endif
+ v9ses->cache = ctx->session_opts.cache;
+ v9ses->uid = ctx->session_opts.uid;
+ v9ses->session_lock_timeout = ctx->session_opts.session_lock_timeout;
}
/**
* v9fs_session_init - initialize session
* @v9ses: session information structure
- * @dev_name: device being mounted
- * @data: options
+ * @fc: the filesystem mount context
*
*/
struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
- const char *dev_name, char *data)
+ struct fs_context *fc)
{
struct p9_fid *fid;
int rc = -ENOMEM;
- v9ses->uname = kstrdup(V9FS_DEFUSER, GFP_KERNEL);
- if (!v9ses->uname)
- goto err_names;
-
- v9ses->aname = kstrdup(V9FS_DEFANAME, GFP_KERNEL);
- if (!v9ses->aname)
- goto err_names;
init_rwsem(&v9ses->rename_sem);
- v9ses->uid = INVALID_UID;
- v9ses->dfltuid = V9FS_DEFUID;
- v9ses->dfltgid = V9FS_DEFGID;
-
- v9ses->clnt = p9_client_create(dev_name, data);
+ v9ses->clnt = p9_client_create(fc);
if (IS_ERR(v9ses->clnt)) {
rc = PTR_ERR(v9ses->clnt);
p9_debug(P9_DEBUG_ERROR, "problem initializing 9p client\n");
goto err_names;
}
+ /*
+ * Initialize flags on the real v9ses. v9fs_apply_options below
+ * will |= the additional flags from parsed options.
+ */
v9ses->flags = V9FS_ACCESS_USER;
if (p9_is_proto_dotl(v9ses->clnt)) {
@@ -424,9 +440,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
v9ses->flags |= V9FS_PROTO_2000U;
}
- rc = v9fs_parse_options(v9ses, data);
- if (rc < 0)
- goto err_clnt;
+ v9fs_apply_options(v9ses, fc);
v9ses->maxdata = v9ses->clnt->msize - P9_IOHDRSZ;
@@ -473,7 +487,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
#ifdef CONFIG_9P_FSCACHE
/* register the session for caching */
if (v9ses->cache & CACHE_FSCACHE) {
- rc = v9fs_cache_session_get_cookie(v9ses, dev_name);
+ rc = v9fs_cache_session_get_cookie(v9ses, fc->source);
if (rc < 0)
goto err_clnt;
}
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h
index 698c43dd5dc86..135598d5a68f2 100644
--- a/fs/9p/v9fs.h
+++ b/fs/9p/v9fs.h
@@ -10,6 +10,9 @@
#include <linux/backing-dev.h>
#include <linux/netfs.h>
+#include <linux/fs_parser.h>
+#include <net/9p/client.h>
+#include <net/9p/transport.h>
/**
* enum p9_session_flags - option flags for each 9P session
@@ -163,11 +166,13 @@ static inline struct fscache_volume *v9fs_session_cache(struct v9fs_session_info
#endif
}
+extern const struct fs_parameter_spec v9fs_param_spec[];
+extern int v9fs_parse_param(struct fs_context *fc, struct fs_parameter *param);
extern int v9fs_show_options(struct seq_file *m, struct dentry *root);
struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
- const char *dev_name, char *data);
+ struct fs_context *fc);
extern void v9fs_session_close(struct v9fs_session_info *v9ses);
extern void v9fs_session_cancel(struct v9fs_session_info *v9ses);
extern void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses);
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 489db161abc98..9d0875873fdb6 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -19,6 +19,7 @@
#include <linux/statfs.h>
#include <linux/magic.h>
#include <linux/fscache.h>
+#include <linux/fs_context.h>
#include <net/9p/9p.h>
#include <net/9p/client.h>
@@ -30,32 +31,10 @@
static const struct super_operations v9fs_super_ops, v9fs_super_ops_dotl;
-/**
- * v9fs_set_super - set the superblock
- * @s: super block
- * @data: file system specific data
- *
- */
-
-static int v9fs_set_super(struct super_block *s, void *data)
-{
- s->s_fs_info = data;
- return set_anon_super(s, data);
-}
-
-/**
- * v9fs_fill_super - populate superblock with info
- * @sb: superblock
- * @v9ses: session information
- * @flags: flags propagated from v9fs_mount()
- *
- */
-
-static int
-v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
- int flags)
+static int v9fs_fill_super(struct super_block *sb)
{
int ret;
+ struct v9fs_session_info *v9ses = v9ses = sb->s_fs_info;
sb->s_maxbytes = MAX_LFS_FILESIZE;
sb->s_blocksize_bits = fls(v9ses->maxdata - 1);
@@ -95,16 +74,12 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
}
/**
- * v9fs_mount - mount a superblock
- * @fs_type: file system type
- * @flags: mount flags
- * @dev_name: device name that was mounted
- * @data: mount options
+ * v9fs_get_tree - create the mountable root and superblock
+ * @fc: the filesystem context
*
*/
-static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
- const char *dev_name, void *data)
+static int v9fs_get_tree(struct fs_context *fc)
{
struct super_block *sb = NULL;
struct inode *inode = NULL;
@@ -117,20 +92,21 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
if (!v9ses)
- return ERR_PTR(-ENOMEM);
+ return -ENOMEM;
- fid = v9fs_session_init(v9ses, dev_name, data);
+ fid = v9fs_session_init(v9ses, fc);
if (IS_ERR(fid)) {
retval = PTR_ERR(fid);
goto free_session;
}
- sb = sget(fs_type, NULL, v9fs_set_super, flags, v9ses);
+ fc->s_fs_info = v9ses;
+ sb = sget_fc(fc, NULL, set_anon_super_fc);
if (IS_ERR(sb)) {
retval = PTR_ERR(sb);
goto clunk_fid;
}
- retval = v9fs_fill_super(sb, v9ses, flags);
+ retval = v9fs_fill_super(sb);
if (retval)
goto release_sb;
@@ -157,14 +133,15 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
v9fs_fid_add(root, &fid);
p9_debug(P9_DEBUG_VFS, " simple set mount, return 0\n");
- return dget(sb->s_root);
+ fc->root = dget(sb->s_root);
+ return 0;
clunk_fid:
p9_fid_put(fid);
v9fs_session_close(v9ses);
free_session:
kfree(v9ses);
- return ERR_PTR(retval);
+ return retval;
release_sb:
/*
@@ -175,7 +152,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
*/
p9_fid_put(fid);
deactivate_locked_super(sb);
- return ERR_PTR(retval);
+ return retval;
}
/**
@@ -301,11 +278,86 @@ static const struct super_operations v9fs_super_ops_dotl = {
.write_inode = v9fs_write_inode_dotl,
};
+static void v9fs_free_fc(struct fs_context *fc)
+{
+ struct v9fs_context *ctx = fc->fs_private;
+
+ if (!ctx)
+ return;
+
+ /* These should be NULL by now but guard against leaks */
+ kfree(ctx->session_opts.uname);
+ kfree(ctx->session_opts.aname);
+#ifdef CONFIG_9P_FSCACHE
+ kfree(ctx->session_opts.cachetag);
+#endif
+ if (ctx->client_opts.trans_mod)
+ v9fs_put_trans(ctx->client_opts.trans_mod);
+ kfree(ctx);
+}
+
+static const struct fs_context_operations v9fs_context_ops = {
+ .parse_param = v9fs_parse_param,
+ .get_tree = v9fs_get_tree,
+ .free = v9fs_free_fc,
+};
+
+static int v9fs_init_fs_context(struct fs_context *fc)
+{
+ struct v9fs_context *ctx;
+
+ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+ if (!ctx)
+ return -ENOMEM;
+
+ /* initialize core options */
+ ctx->session_opts.afid = ~0;
+ ctx->session_opts.cache = CACHE_NONE;
+ ctx->session_opts.session_lock_timeout = P9_LOCK_TIMEOUT;
+ ctx->session_opts.uname = kstrdup(V9FS_DEFUSER, GFP_KERNEL);
+ if (!ctx->session_opts.uname)
+ goto error;
+
+ ctx->session_opts.aname = kstrdup(V9FS_DEFANAME, GFP_KERNEL);
+ if (!ctx->session_opts.aname)
+ goto error;
+
+ ctx->session_opts.uid = INVALID_UID;
+ ctx->session_opts.dfltuid = V9FS_DEFUID;
+ ctx->session_opts.dfltgid = V9FS_DEFGID;
+
+ /* initialize client options */
+ ctx->client_opts.proto_version = p9_proto_2000L;
+ ctx->client_opts.msize = DEFAULT_MSIZE;
+
+ /* initialize fd transport options */
+ ctx->fd_opts.port = P9_FD_PORT;
+ ctx->fd_opts.rfd = ~0;
+ ctx->fd_opts.wfd = ~0;
+ ctx->fd_opts.privport = false;
+
+ /* initialize rdma transport options */
+ ctx->rdma_opts.port = P9_RDMA_PORT;
+ ctx->rdma_opts.sq_depth = P9_RDMA_SQ_DEPTH;
+ ctx->rdma_opts.rq_depth = P9_RDMA_RQ_DEPTH;
+ ctx->rdma_opts.timeout = P9_RDMA_TIMEOUT;
+ ctx->rdma_opts.privport = false;
+
+ fc->ops = &v9fs_context_ops;
+ fc->fs_private = ctx;
+
+ return 0;
+error:
+ fc->need_free = 1;
+ return -ENOMEM;
+}
+
struct file_system_type v9fs_fs_type = {
.name = "9p",
- .mount = v9fs_mount,
.kill_sb = v9fs_kill_super,
.owner = THIS_MODULE,
.fs_flags = FS_RENAME_DOES_D_MOVE,
+ .init_fs_context = v9fs_init_fs_context,
+ .parameters = v9fs_param_spec,
};
MODULE_ALIAS_FS("9p");
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index cc18443f7d516..838a94218b593 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -279,7 +279,7 @@ int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid,
const char *name);
int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
struct p9_fid *newdirfid, const char *new_name);
-struct p9_client *p9_client_create(const char *dev_name, char *options);
+struct p9_client *p9_client_create(struct fs_context *fc);
void p9_client_destroy(struct p9_client *clnt);
void p9_client_disconnect(struct p9_client *clnt);
void p9_client_begin_disconnect(struct p9_client *clnt);
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index ebbb4b50ee205..e53f312191b6e 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -53,7 +53,7 @@ struct p9_trans_module {
int def; /* this transport should be default */
struct module *owner;
int (*create)(struct p9_client *client,
- const char *devname, char *args);
+ struct fs_context *fc);
void (*close)(struct p9_client *client);
int (*request)(struct p9_client *client, struct p9_req_t *req);
int (*cancel)(struct p9_client *client, struct p9_req_t *req);
diff --git a/net/9p/client.c b/net/9p/client.c
index d7802d67724cd..40edb2383aaa6 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -20,8 +20,8 @@
#include <linux/uio.h>
#include <linux/netfs.h>
#include <net/9p/9p.h>
-#include <linux/parser.h>
#include <linux/seq_file.h>
+#include <linux/fs_context.h>
#include <net/9p/client.h>
#include <net/9p/transport.h>
#include "protocol.h"
@@ -33,22 +33,6 @@
* - a little lazy - parse all client options
*/
-enum {
- Opt_msize,
- Opt_trans,
- Opt_legacy,
- Opt_version,
- Opt_err,
-};
-
-static const match_table_t tokens = {
- {Opt_msize, "msize=%u"},
- {Opt_legacy, "noextend"},
- {Opt_trans, "trans=%s"},
- {Opt_version, "version=%s"},
- {Opt_err, NULL},
-};
-
inline int p9_is_proto_dotl(struct p9_client *clnt)
{
return clnt->proto_version == p9_proto_2000L;
@@ -97,124 +81,16 @@ static int safe_errno(int err)
return err;
}
-/* Interpret mount option for protocol version */
-static int get_protocol_version(char *s)
+static int apply_client_options(struct p9_client *clnt, struct fs_context *fc)
{
- int version = -EINVAL;
-
- if (!strcmp(s, "9p2000")) {
- version = p9_proto_legacy;
- p9_debug(P9_DEBUG_9P, "Protocol version: Legacy\n");
- } else if (!strcmp(s, "9p2000.u")) {
- version = p9_proto_2000u;
- p9_debug(P9_DEBUG_9P, "Protocol version: 9P2000.u\n");
- } else if (!strcmp(s, "9p2000.L")) {
- version = p9_proto_2000L;
- p9_debug(P9_DEBUG_9P, "Protocol version: 9P2000.L\n");
- } else {
- pr_info("Unknown protocol version %s\n", s);
- }
+ struct v9fs_context *ctx = fc->fs_private;
- return version;
-}
-
-/**
- * parse_opts - parse mount options into client structure
- * @opts: options string passed from mount
- * @clnt: existing v9fs client information
- *
- * Return 0 upon success, -ERRNO upon failure
- */
-
-static int parse_opts(char *opts, struct p9_client *clnt)
-{
- char *options, *tmp_options;
- char *p;
- substring_t args[MAX_OPT_ARGS];
- int option;
- char *s;
- int ret = 0;
-
- clnt->proto_version = p9_proto_2000L;
- clnt->msize = DEFAULT_MSIZE;
-
- if (!opts)
- return 0;
+ clnt->msize = ctx->client_opts.msize;
+ clnt->trans_mod = ctx->client_opts.trans_mod;
+ ctx->client_opts.trans_mod = NULL;
+ clnt->proto_version = ctx->client_opts.proto_version;
- tmp_options = kstrdup(opts, GFP_KERNEL);
- if (!tmp_options)
- return -ENOMEM;
- options = tmp_options;
-
- while ((p = strsep(&options, ",")) != NULL) {
- int token, r;
-
- if (!*p)
- continue;
- token = match_token(p, tokens, args);
- switch (token) {
- case Opt_msize:
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- ret = r;
- continue;
- }
- if (option < 4096) {
- p9_debug(P9_DEBUG_ERROR,
- "msize should be at least 4k\n");
- ret = -EINVAL;
- continue;
- }
- clnt->msize = option;
- break;
- case Opt_trans:
- s = match_strdup(&args[0]);
- if (!s) {
- ret = -ENOMEM;
- p9_debug(P9_DEBUG_ERROR,
- "problem allocating copy of trans arg\n");
- goto free_and_return;
- }
-
- v9fs_put_trans(clnt->trans_mod);
- clnt->trans_mod = v9fs_get_trans_by_name(s);
- if (!clnt->trans_mod) {
- pr_info("Could not find request transport: %s\n",
- s);
- ret = -EINVAL;
- }
- kfree(s);
- break;
- case Opt_legacy:
- clnt->proto_version = p9_proto_legacy;
- break;
- case Opt_version:
- s = match_strdup(&args[0]);
- if (!s) {
- ret = -ENOMEM;
- p9_debug(P9_DEBUG_ERROR,
- "problem allocating copy of version arg\n");
- goto free_and_return;
- }
- r = get_protocol_version(s);
- if (r < 0)
- ret = r;
- else
- clnt->proto_version = r;
- kfree(s);
- break;
- default:
- continue;
- }
- }
-
-free_and_return:
- if (ret)
- v9fs_put_trans(clnt->trans_mod);
- kfree(tmp_options);
- return ret;
+ return 0;
}
static int p9_fcall_init(struct p9_client *c, struct p9_fcall *fc,
@@ -970,7 +846,7 @@ static int p9_client_version(struct p9_client *c)
return err;
}
-struct p9_client *p9_client_create(const char *dev_name, char *options)
+struct p9_client *p9_client_create(struct fs_context *fc)
{
int err;
static atomic_t seqno = ATOMIC_INIT(0);
@@ -993,8 +869,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
idr_init(&clnt->fids);
idr_init(&clnt->reqs);
- err = parse_opts(options, clnt);
- if (err < 0)
+ err = apply_client_options(clnt, fc);
+ if (err)
goto free_client;
if (!clnt->trans_mod)
@@ -1010,7 +886,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
p9_debug(P9_DEBUG_MUX, "clnt %p trans %p msize %d protocol %d\n",
clnt, clnt->trans_mod, clnt->msize, clnt->proto_version);
- err = clnt->trans_mod->create(clnt, dev_name, options);
+ err = clnt->trans_mod->create(clnt, fc);
if (err)
goto put_trans;
diff --git a/net/9p/mod.c b/net/9p/mod.c
index 55576c1866fa6..85160b52da556 100644
--- a/net/9p/mod.c
+++ b/net/9p/mod.c
@@ -16,7 +16,6 @@
#include <linux/moduleparam.h>
#include <net/9p/9p.h>
#include <linux/fs.h>
-#include <linux/parser.h>
#include <net/9p/client.h>
#include <net/9p/transport.h>
#include <linux/list.h>
@@ -171,6 +170,7 @@ void v9fs_put_trans(struct p9_trans_module *m)
if (m)
module_put(m->owner);
}
+EXPORT_SYMBOL(v9fs_put_trans);
/**
* init_p9 - Initialize module
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index fdaebb549aa8f..8a03e62992508 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -22,7 +22,7 @@
#include <linux/uaccess.h>
#include <linux/inet.h>
#include <linux/file.h>
-#include <linux/parser.h>
+#include <linux/fs_context.h>
#include <linux/slab.h>
#include <linux/seq_file.h>
#include <net/9p/9p.h>
@@ -37,26 +37,6 @@
static struct p9_trans_module p9_tcp_trans;
static struct p9_trans_module p9_fd_trans;
-/*
- * Option Parsing (code inspired by NFS code)
- * - a little lazy - parse all fd-transport options
- */
-
-enum {
- /* Options that take integer arguments */
- Opt_port, Opt_rfdno, Opt_wfdno, Opt_err,
- /* Options that take no arguments */
- Opt_privport,
-};
-
-static const match_table_t tokens = {
- {Opt_port, "port=%u"},
- {Opt_rfdno, "rfdno=%u"},
- {Opt_wfdno, "wfdno=%u"},
- {Opt_privport, "privport"},
- {Opt_err, NULL},
-};
-
enum {
Rworksched = 1, /* read work scheduled or running */
Rpending = 2, /* can read */
@@ -737,73 +717,6 @@ static int p9_fd_show_options(struct seq_file *m, struct p9_client *clnt)
return 0;
}
-/**
- * parse_opts - parse mount options into p9_fd_opts structure
- * @params: options string passed from mount
- * @opts: fd transport-specific structure to parse options into
- *
- * Returns 0 upon success, -ERRNO upon failure
- */
-
-static int parse_opts(char *params, struct p9_fd_opts *opts)
-{
- char *p;
- substring_t args[MAX_OPT_ARGS];
- int option;
- char *options, *tmp_options;
-
- opts->port = P9_FD_PORT;
- opts->rfd = ~0;
- opts->wfd = ~0;
- opts->privport = false;
-
- if (!params)
- return 0;
-
- tmp_options = kstrdup(params, GFP_KERNEL);
- if (!tmp_options) {
- p9_debug(P9_DEBUG_ERROR,
- "failed to allocate copy of option string\n");
- return -ENOMEM;
- }
- options = tmp_options;
-
- while ((p = strsep(&options, ",")) != NULL) {
- int token;
- int r;
- if (!*p)
- continue;
- token = match_token(p, tokens, args);
- if ((token != Opt_err) && (token != Opt_privport)) {
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- continue;
- }
- }
- switch (token) {
- case Opt_port:
- opts->port = option;
- break;
- case Opt_rfdno:
- opts->rfd = option;
- break;
- case Opt_wfdno:
- opts->wfd = option;
- break;
- case Opt_privport:
- opts->privport = true;
- break;
- default:
- continue;
- }
- }
-
- kfree(tmp_options);
- return 0;
-}
-
static int p9_fd_open(struct p9_client *client, int rfd, int wfd)
{
struct p9_trans_fd *ts = kzalloc(sizeof(struct p9_trans_fd),
@@ -958,17 +871,18 @@ static int p9_bind_privport(struct socket *sock)
}
static int
-p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)
+p9_fd_create_tcp(struct p9_client *client, struct fs_context *fc)
{
+ const char *addr = fc->source;
+ struct v9fs_context *ctx = fc->fs_private;
int err;
char port_str[6];
struct socket *csocket;
struct sockaddr_storage stor = { 0 };
struct p9_fd_opts opts;
- err = parse_opts(args, &opts);
- if (err < 0)
- return err;
+ /* opts are already parsed in context */
+ opts = ctx->fd_opts;
if (!addr)
return -EINVAL;
@@ -1015,8 +929,9 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args)
}
static int
-p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
+p9_fd_create_unix(struct p9_client *client, struct fs_context *fc)
{
+ const char *addr = fc->source;
int err;
struct socket *csocket;
struct sockaddr_un sun_server;
@@ -1055,14 +970,12 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args)
}
static int
-p9_fd_create(struct p9_client *client, const char *addr, char *args)
+p9_fd_create(struct p9_client *client, struct fs_context *fc)
{
+ struct v9fs_context *ctx = fc->fs_private;
+ struct p9_fd_opts opts = ctx->fd_opts;
int err;
- struct p9_fd_opts opts;
- err = parse_opts(args, &opts);
- if (err < 0)
- return err;
client->trans_opts.fd.rfd = opts.rfd;
client->trans_opts.fd.wfd = opts.wfd;
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 92b166a4a1e52..4a779b3a56987 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -22,7 +22,7 @@
#include <linux/uaccess.h>
#include <linux/inet.h>
#include <linux/file.h>
-#include <linux/parser.h>
+#include <linux/fs_context.h>
#include <linux/semaphore.h>
#include <linux/slab.h>
#include <linux/seq_file.h>
@@ -106,26 +106,6 @@ struct p9_rdma_context {
};
};
-/*
- * Option Parsing (code inspired by NFS code)
- */
-enum {
- /* Options that take integer arguments */
- Opt_port, Opt_rq_depth, Opt_sq_depth, Opt_timeout,
- /* Options that take no argument */
- Opt_privport,
- Opt_err,
-};
-
-static match_table_t tokens = {
- {Opt_port, "port=%u"},
- {Opt_sq_depth, "sq=%u"},
- {Opt_rq_depth, "rq=%u"},
- {Opt_timeout, "timeout=%u"},
- {Opt_privport, "privport"},
- {Opt_err, NULL},
-};
-
static int p9_rdma_show_options(struct seq_file *m, struct p9_client *clnt)
{
struct p9_trans_rdma *rdma = clnt->trans;
@@ -143,77 +123,6 @@ static int p9_rdma_show_options(struct seq_file *m, struct p9_client *clnt)
return 0;
}
-/**
- * parse_opts - parse mount options into rdma options structure
- * @params: options string passed from mount
- * @opts: rdma transport-specific structure to parse options into
- *
- * Returns 0 upon success, -ERRNO upon failure
- */
-static int parse_opts(char *params, struct p9_rdma_opts *opts)
-{
- char *p;
- substring_t args[MAX_OPT_ARGS];
- int option;
- char *options, *tmp_options;
-
- opts->port = P9_RDMA_PORT;
- opts->sq_depth = P9_RDMA_SQ_DEPTH;
- opts->rq_depth = P9_RDMA_RQ_DEPTH;
- opts->timeout = P9_RDMA_TIMEOUT;
- opts->privport = false;
-
- if (!params)
- return 0;
-
- tmp_options = kstrdup(params, GFP_KERNEL);
- if (!tmp_options) {
- p9_debug(P9_DEBUG_ERROR,
- "failed to allocate copy of option string\n");
- return -ENOMEM;
- }
- options = tmp_options;
-
- while ((p = strsep(&options, ",")) != NULL) {
- int token;
- int r;
- if (!*p)
- continue;
- token = match_token(p, tokens, args);
- if ((token != Opt_err) && (token != Opt_privport)) {
- r = match_int(&args[0], &option);
- if (r < 0) {
- p9_debug(P9_DEBUG_ERROR,
- "integer field, but no integer?\n");
- continue;
- }
- }
- switch (token) {
- case Opt_port:
- opts->port = option;
- break;
- case Opt_sq_depth:
- opts->sq_depth = option;
- break;
- case Opt_rq_depth:
- opts->rq_depth = option;
- break;
- case Opt_timeout:
- opts->timeout = option;
- break;
- case Opt_privport:
- opts->privport = true;
- break;
- default:
- continue;
- }
- }
- /* RQ must be at least as large as the SQ */
- opts->rq_depth = max(opts->rq_depth, opts->sq_depth);
- kfree(tmp_options);
- return 0;
-}
-
static int
p9_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
{
@@ -622,14 +531,15 @@ static int p9_rdma_bind_privport(struct p9_trans_rdma *rdma)
/**
* rdma_create_trans - Transport method for creating a transport instance
* @client: client instance
- * @addr: IP address string
- * @args: Mount options string
+ * @fc: The filesystem context
*/
static int
-rdma_create_trans(struct p9_client *client, const char *addr, char *args)
+rdma_create_trans(struct p9_client *client, struct fs_context *fc)
{
+ const char *addr = fc->source;
+ struct v9fs_context *ctx = fc->fs_private;
+ struct p9_rdma_opts opts = ctx->rdma_opts;
int err;
- struct p9_rdma_opts opts;
struct p9_trans_rdma *rdma;
struct rdma_conn_param conn_param;
struct ib_qp_init_attr qp_attr;
@@ -637,10 +547,8 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args)
if (addr == NULL)
return -EINVAL;
- /* Parse the transport specific mount options */
- err = parse_opts(args, &opts);
- if (err < 0)
- return err;
+ /* options are already parsed, in the fs context */
+ opts = ctx->rdma_opts;
/* Create and initialize the RDMA transport structure */
rdma = alloc_rdma(&opts);
diff --git a/net/9p/trans_usbg.c b/net/9p/trans_usbg.c
index 938e3130ab81a..dd5d833f2c827 100644
--- a/net/9p/trans_usbg.c
+++ b/net/9p/trans_usbg.c
@@ -27,6 +27,7 @@
#include <linux/cleanup.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/fs_context.h>
#include <linux/usb/composite.h>
#include <linux/usb/func_utils.h>
@@ -392,8 +393,9 @@ enable_usb9pfs(struct usb_composite_dev *cdev, struct f_usb9pfs *usb9pfs)
return ret;
}
-static int p9_usbg_create(struct p9_client *client, const char *devname, char *args)
+static int p9_usbg_create(struct p9_client *client, struct fs_context *fc)
{
+ const char *devname = fc->source;
struct f_usb9pfs_dev *dev;
struct f_usb9pfs *usb9pfs;
int ret = -ENOENT;
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index d1a680f699115..6c2a134e7d85c 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -26,7 +26,7 @@
#include <linux/highmem.h>
#include <linux/slab.h>
#include <net/9p/9p.h>
-#include <linux/parser.h>
+#include <linux/fs_context.h>
#include <net/9p/client.h>
#include <net/9p/transport.h>
#include <linux/scatterlist.h>
@@ -684,8 +684,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
/**
* p9_virtio_create - allocate a new virtio channel
* @client: client instance invoking this transport
- * @devname: string identifying the channel to connect to (unused)
- * @args: args passed from sys_mount() for per-transport options (unused)
+ * @fc: the filesystem context
*
* This sets up a transport channel for 9p communication. Right now
* we only match the first available channel, but eventually we could look up
@@ -696,8 +695,9 @@ static int p9_virtio_probe(struct virtio_device *vdev)
*/
static int
-p9_virtio_create(struct p9_client *client, const char *devname, char *args)
+p9_virtio_create(struct p9_client *client, struct fs_context *fc)
{
+ const char *devname = fc->source;
struct virtio_chan *chan;
int ret = -ENOENT;
int found = 0;
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index ef9bac5f4a24a..95f314f0285ef 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/spinlock.h>
+#include <linux/fs_context.h>
#include <net/9p/9p.h>
#include <net/9p/client.h>
#include <net/9p/transport.h>
@@ -66,8 +67,9 @@ static int p9_xen_cancel(struct p9_client *client, struct p9_req_t *req)
return 1;
}
-static int p9_xen_create(struct p9_client *client, const char *addr, char *args)
+static int p9_xen_create(struct p9_client *client, struct fs_context *fc)
{
+ const char *addr = fc->source;
struct xen_9pfs_front_priv *priv;
if (addr == NULL)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 051/816] net/9p: Replace strlen() strcpy() pair with strscpy()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 050/816] 9p: convert to the new mount API Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 052/816] 9p: use fc->net_ns for network namespace in RDMA and socket transports Greg Kroah-Hartman
` (769 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Laight, Dominique Martinet,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Laight <david.laight.linux@gmail.com>
[ Upstream commit cc8b15a2c435bd1caf19741ba85286846a115764 ]
Use the result of strscpy() for the overflow check.
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Message-ID: <20260606202744.5113-3-david.laight.linux@gmail.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Stable-dep-of: 37dce65a0b43 ("9p: use fc->net_ns for network namespace in RDMA and socket transports")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/9p/trans_fd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 8a03e62992508..f31b2a81ef8bd 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -941,14 +941,12 @@ p9_fd_create_unix(struct p9_client *client, struct fs_context *fc)
if (!addr || !strlen(addr))
return -EINVAL;
- if (strlen(addr) >= UNIX_PATH_MAX) {
+ sun_server.sun_family = PF_UNIX;
+ if (strscpy(sun_server.sun_path, addr) < 0) {
pr_err("%s (%d): address too long: %s\n",
__func__, task_pid_nr(current), addr);
return -ENAMETOOLONG;
}
-
- sun_server.sun_family = PF_UNIX;
- strcpy(sun_server.sun_path, addr);
err = __sock_create(current->nsproxy->net_ns, PF_UNIX,
SOCK_STREAM, 0, &csocket, 1);
if (err < 0) {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 052/816] 9p: use fc->net_ns for network namespace in RDMA and socket transports
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 051/816] net/9p: Replace strlen() strcpy() pair with strscpy() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 053/816] net/9p/usbg: fix descriptor cleanup use-after-free Greg Kroah-Hartman
` (768 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 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
6.12-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 f31b2a81ef8bd..780d4ee397f86 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -888,8 +888,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;
@@ -897,8 +897,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));
@@ -947,8 +947,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 4a779b3a56987..e5c5575849d62 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] 825+ messages in thread
* [PATCH 6.12 053/816] net/9p/usbg: fix descriptor cleanup use-after-free
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 052/816] 9p: use fc->net_ns for network namespace in RDMA and socket transports Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 054/816] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx Greg Kroah-Hartman
` (767 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 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
6.12-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 dd5d833f2c827..1592b99ae00c7 100644
--- a/net/9p/trans_usbg.c
+++ b/net/9p/trans_usbg.c
@@ -753,8 +753,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);
@@ -762,6 +760,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] 825+ messages in thread
* [PATCH 6.12 054/816] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 053/816] net/9p/usbg: fix descriptor cleanup use-after-free Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 055/816] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
` (766 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 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
6.12-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 1592b99ae00c7..79735bbe739ac 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] 825+ messages in thread
* [PATCH 6.12 055/816] 9p: skip intermediate directory entry name copy in p9dirent_read()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 054/816] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 056/816] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
` (765 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haobin Wu, Christian Schoenebeck,
Dominique Martinet, Sasha Levin
6.12-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 838a94218b593..9f3079c6f3867 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -268,7 +268,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 0e6603b1ec906..0a97b4de243ab 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -771,7 +771,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;
@@ -786,15 +786,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] 825+ messages in thread
* [PATCH 6.12 056/816] xfrm: zero-initialise km_event in the replay-notify path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 055/816] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 057/816] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
` (764 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giovanni Vignone, Shubham Antil,
Steffen Klassert, Sasha Levin
6.12-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 235bbefc2abae..b8a55af7ca055 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] 825+ messages in thread
* [PATCH 6.12 057/816] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 056/816] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 058/816] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
` (763 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+a079f084653164a652d1,
Deepanshu Kartikey, Sven Eckelmann, Sasha Levin
6.12-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 dd1f88af5b961..cf6ff9848a7bc 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -1296,7 +1296,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] 825+ messages in thread
* [PATCH 6.12 058/816] wifi: ath9k_htc: start ANI when an AP interface begins to beacon
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 057/816] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 059/816] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
` (762 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mehmet Fide,
Toke Høiland-Jørgensen, Jeff Johnson, Sasha Levin
6.12-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 8a03bcc2789e8..afddfac699ce6 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1552,6 +1552,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] 825+ messages in thread
* [PATCH 6.12 059/816] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 058/816] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 060/816] scsi: scsi_debug: Drain target cleanup before module exit Greg Kroah-Hartman
` (761 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Imre Kaloz,
Martin K. Petersen (Oracle), Sasha Levin
6.12-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 d747d0b72a13a..989e8c9bda4ac 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] 825+ messages in thread
* [PATCH 6.12 060/816] scsi: scsi_debug: Drain target cleanup before module exit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 059/816] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 061/816] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
` (760 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli,
Martin K. Petersen (Oracle), Sasha Levin
6.12-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 27e882a6244d9..7a1ad88669eeb 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -8315,6 +8315,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] 825+ messages in thread
* [PATCH 6.12 061/816] scsi: aha1542: Remove unneeded scsi_dma_unmap() call
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 060/816] scsi: scsi_debug: Drain target cleanup before module exit Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 062/816] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
` (759 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurence Oberman, Matthew Whitehead,
Martin K. Petersen (Oracle), Sasha Levin
6.12-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 389499d3e00aa..4feea64ce24cb 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] 825+ messages in thread
* [PATCH 6.12 062/816] 9p: fall back to the normal open path for non-regular files
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 061/816] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 063/816] 9p: do not store the create fid on special files Greg Kroah-Hartman
` (758 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuanfu Xie, Dominique Martinet,
Sasha Levin
6.12-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 7cb3f4b89dcc3..f0c1805d60c42 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -821,6 +821,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 (err)
goto error;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 40a4fc65a5441..3f916a8d10540 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -317,6 +317,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] 825+ messages in thread
* [PATCH 6.12 063/816] 9p: do not store the create fid on special files
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 062/816] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 064/816] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
` (757 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuanfu Xie, Dominique Martinet,
Sasha Levin
6.12-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 3f916a8d10540..50327c01da430 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -333,16 +333,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] 825+ messages in thread
* [PATCH 6.12 064/816] wifi: ath10k: Stop unanswered temperature reads
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 063/816] 9p: do not store the create fid on special files Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 065/816] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
` (756 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Filippo Falezza, Loic Poulain,
Jeff Johnson, Sasha Levin
6.12-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 f9b51d98d20bb..e3dcf034c8725 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2979,6 +2979,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 8b15ec07b1071..9b81f9ae58d74 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] 825+ messages in thread
* [PATCH 6.12 065/816] seg6: fix transport header for inner IPv4 with IP options
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 064/816] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 066/816] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes Greg Kroah-Hartman
` (755 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hazley Samsudin, David Ahern,
Hangbin Liu, Andrea Mayer, Jakub Kicinski, Sasha Levin
6.12-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 9259b2d2da059..7c0d98a65c8b7 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;
};
@@ -969,6 +967,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)
{
@@ -998,14 +1030,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))
@@ -1015,7 +1051,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;
}
@@ -1150,16 +1186,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);
@@ -1171,11 +1215,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);
@@ -1186,7 +1225,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);
}
@@ -1199,9 +1238,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] 825+ messages in thread
* [PATCH 6.12 066/816] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 065/816] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 067/816] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
` (754 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Matt Coster,
Luigi Santivetti, Michal Wilczynski, Alessio Belle, Sasha Levin
6.12-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] 825+ messages in thread
* [PATCH 6.12 067/816] gpio: omap: Propagate runtime PM failures in probe and request
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 066/816] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 068/816] bpf: Fix jited line info off by the CFI preamble Greg Kroah-Hartman
` (753 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Bartosz Golaszewski,
Sasha Levin
6.12-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 595ef20084049..a808ddbd8773c 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -814,8 +814,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);
@@ -1465,7 +1468,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] 825+ messages in thread
* [PATCH 6.12 068/816] bpf: Fix jited line info off by the CFI preamble
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 067/816] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 069/816] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
` (752 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Alexei Starovoitov,
Jose Fernandez (Anthropic), Sasha Levin
6.12-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>
---
kernel/bpf/core.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 643ccb230ddda..df529db44f35c 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -199,7 +199,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:
@@ -213,7 +215,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,
@@ -241,7 +243,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] 825+ messages in thread
* [PATCH 6.12 069/816] btrfs: verity: propagate orphan insertion errors when enabling verity
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 068/816] bpf: Fix jited line info off by the CFI preamble Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 070/816] btrfs: fix fiemap merging compressed extents Greg Kroah-Hartman
` (751 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, guolingxing, Qu Wenruo, David Sterba,
Sasha Levin
6.12-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 fb0eb6c4fd221..65a17d7e4e53f 100644
--- a/fs/btrfs/verity.c
+++ b/fs/btrfs/verity.c
@@ -604,7 +604,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] 825+ messages in thread
* [PATCH 6.12 070/816] btrfs: fix fiemap merging compressed extents
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 069/816] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 071/816] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
` (750 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Filipe Manana,
David Sterba, Sasha Levin
6.12-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 7364bae6b1720..cf93318d14080 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] 825+ messages in thread
* [PATCH 6.12 071/816] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 070/816] btrfs: fix fiemap merging compressed extents Greg Kroah-Hartman
@ 2026-11-25 14:26 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 072/816] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
` (749 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:26 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Filipe Manana,
David Sterba, Sasha Levin
6.12-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 9afe36341d8a3..fc01ae2dcb69d 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3067,7 +3067,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));
@@ -3080,6 +3079,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] 825+ messages in thread
* [PATCH 6.12 072/816] btrfs: zoned: fix double free of bitmaps on clone failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2026-11-25 14:26 ` [PATCH 6.12 071/816] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 073/816] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3 Greg Kroah-Hartman
` (748 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Johannes Thumshirn, Thomas Fourier,
David Sterba, Sasha Levin
6.12-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 e417613ca9c60..b4bb02bd99ae5 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -615,6 +615,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] 825+ messages in thread
* [PATCH 6.12 073/816] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 072/816] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 074/816] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
` (747 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
Sasha Levin
6.12-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 8d95765a3813f..544bf35990c17 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -1939,7 +1939,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] 825+ messages in thread
* [PATCH 6.12 074/816] net: ethernet: mtk_wed: fix reset condition for rx wdma
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 073/816] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3 Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 075/816] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
` (746 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
Sasha Levin
6.12-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 544bf35990c17..c2c684fbbb164 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -250,7 +250,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] 825+ messages in thread
* [PATCH 6.12 075/816] net: ethernet: mtk_wed: free up rings during detach
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 074/816] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 076/816] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
` (745 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Zhi-Jun You, Jakub Kicinski,
Sasha Levin
6.12-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 c2c684fbbb164..005b653a7e3a9 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -942,6 +942,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] 825+ messages in thread
* [PATCH 6.12 076/816] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 075/816] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 077/816] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
` (744 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhi-Jun You, Jakub Kicinski,
Sasha Levin
6.12-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 005b653a7e3a9..a8a78ea9f2352 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -2346,7 +2346,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;
+ }
mtk_wed_hw_init(dev);
mtk_wed_configure_irq(dev, irq_mask);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 077/816] ptp: drain virtual clock sysfs operations before unregistering children
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 076/816] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 078/816] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
` (743 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vadim Fedorenko, James Hilliard,
Jakub Kicinski, Sasha Levin
6.12-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 03c17b1db7aac..52849072e4372 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -424,6 +424,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 f329263f33aa1..5ac416074ad26 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -167,6 +167,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 0d4b081daf639..998de4be08ebd 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] 825+ messages in thread
* [PATCH 6.12 078/816] ptp: unwind partially completed virtual clock creation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 077/816] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 079/816] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
` (742 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
Sasha Levin
6.12-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 998de4be08ebd..b07274b67294a 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] 825+ messages in thread
* [PATCH 6.12 079/816] ptp: vclock: propagate physical clock sampling errors
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 078/816] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 080/816] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
` (741 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
Sasha Levin
6.12-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 5ac416074ad26..104474956a844 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 b07274b67294a..de073b21f1f72 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 5e2730c73bc28..2016e2481580e 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(const 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(sizeof(*vclock), GFP_KERNEL);
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] 825+ messages in thread
* [PATCH 6.12 080/816] ptp: vclock: serialize extended samples with counter updates
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 079/816] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 081/816] net/smc: fix limit_smc_hs sysctl on big-endian architecture Greg Kroah-Hartman
` (740 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard, Jakub Kicinski,
Sasha Levin
6.12-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 2016e2481580e..c047a1222ea43 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] 825+ messages in thread
* [PATCH 6.12 081/816] net/smc: fix limit_smc_hs sysctl on big-endian architecture
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 080/816] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 082/816] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
` (739 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fernando Fernandez Mancera,
Jakub Kicinski, Sasha Levin
6.12-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 2fab6456f7654..7da98bd5287ae 100644
--- a/net/smc/smc_sysctl.c
+++ b/net/smc/smc_sysctl.c
@@ -93,11 +93,9 @@ static 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,
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 082/816] scsi: target: Validate REGISTER AND MOVE TransportID length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 081/816] net/smc: fix limit_smc_hs sysctl on big-endian architecture Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 083/816] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
` (738 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Martin K. Petersen (Oracle),
Sasha Levin
6.12-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 c7f16c2ccf1e4..25df74b2e3559 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -3220,10 +3220,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] 825+ messages in thread
* [PATCH 6.12 083/816] tipc: reject attaching bearer of different media to the same occupied device
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 082/816] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 084/816] net: ipa: Fix double free of the interrupt structure on config error Greg Kroah-Hartman
` (737 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiakai Xu, Tung Nguyen,
Jakub Kicinski, Sasha Levin
6.12-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 24dcb8aa32330..e057d0c6786c4 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] 825+ messages in thread
* [PATCH 6.12 084/816] net: ipa: Fix double free of the interrupt structure on config error
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 083/816] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 085/816] ALSA: memalloc: Free the new pages when WC DMA mapping fails Greg Kroah-Hartman
` (736 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Fourier, Alex Elder,
Jakub Kicinski, Sasha Levin
6.12-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 245a069970556..dc5315ce31d32 100644
--- a/drivers/net/ipa/ipa_interrupt.c
+++ b/drivers/net/ipa/ipa_interrupt.c
@@ -261,10 +261,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);
@@ -290,8 +288,6 @@ int ipa_interrupt_config(struct ipa *ipa)
goto err_disable_wakeup;
}
- ipa->interrupt = interrupt;
-
return 0;
err_disable_wakeup:
@@ -300,8 +296,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;
}
@@ -312,8 +306,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] 825+ messages in thread
* [PATCH 6.12 085/816] ALSA: memalloc: Free the new pages when WC DMA mapping fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 084/816] net: ipa: Fix double free of the interrupt structure on config error Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 086/816] netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit Greg Kroah-Hartman
` (735 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Takashi Iwai
6.12-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 b3853583d2ae1..e2887c9a24631 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] 825+ messages in thread
* [PATCH 6.12 086/816] netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 085/816] ALSA: memalloc: Free the new pages when WC DMA mapping fails Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 087/816] netfilter: nft_fwd_netdev: add device and headroom validate with neigh forwarding Greg Kroah-Hartman
` (734 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sebastian Andrzej Siewior,
Pablo Neira Ayuso, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[ Upstream commit f37ad91270397a6d053e8623bdb3cf79859691d2 ]
nf_dup_skb_recursion is a per-CPU variable and relies on disabled BH for its
locking. Without per-CPU locking in local_bh_disable() on PREEMPT_RT
this data structure requires explicit locking.
Move nf_dup_skb_recursion to struct netdev_xmit, provide wrappers.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: d6c18cadfc6c ("netfilter: nft_reject: prevent unbounded recursion in output hooks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/netdevice_xmit.h | 3 +++
net/netfilter/nf_dup_netdev.c | 22 ++++++++++++++++++----
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/include/linux/netdevice_xmit.h b/include/linux/netdevice_xmit.h
index 59726e6cd2cc6..cc232508e695e 100644
--- a/include/linux/netdevice_xmit.h
+++ b/include/linux/netdevice_xmit.h
@@ -18,6 +18,9 @@ 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;
+#endif
};
#endif
diff --git a/net/netfilter/nf_dup_netdev.c b/net/netfilter/nf_dup_netdev.c
index a8e2425e43b0d..fab8b9011098f 100644
--- a/net/netfilter/nf_dup_netdev.c
+++ b/net/netfilter/nf_dup_netdev.c
@@ -15,12 +15,26 @@
#define NF_RECURSION_LIMIT 2
-static DEFINE_PER_CPU(u8, nf_dup_skb_recursion);
+#ifndef CONFIG_PREEMPT_RT
+static u8 *nf_get_nf_dup_skb_recursion(void)
+{
+ return this_cpu_ptr(&softnet_data.xmit.nf_dup_skb_recursion);
+}
+#else
+
+static u8 *nf_get_nf_dup_skb_recursion(void)
+{
+ return ¤t->net_xmit.nf_dup_skb_recursion;
+}
+
+#endif
static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev,
enum nf_dev_hooks hook)
{
- if (__this_cpu_read(nf_dup_skb_recursion) > NF_RECURSION_LIMIT)
+ u8 *nf_dup_skb_recursion = nf_get_nf_dup_skb_recursion();
+
+ if (*nf_dup_skb_recursion > NF_RECURSION_LIMIT)
goto err;
if (hook == NF_NETDEV_INGRESS && skb_mac_header_was_set(skb)) {
@@ -32,9 +46,9 @@ static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev,
skb->dev = dev;
skb_clear_tstamp(skb);
- __this_cpu_inc(nf_dup_skb_recursion);
+ (*nf_dup_skb_recursion)++;
dev_queue_xmit(skb);
- __this_cpu_dec(nf_dup_skb_recursion);
+ (*nf_dup_skb_recursion)--;
return;
err:
kfree_skb(skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 087/816] netfilter: nft_fwd_netdev: add device and headroom validate with neigh forwarding
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 086/816] netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 088/816] netfilter: nft_fwd_netdev: use recursion counter in neigh egress path Greg Kroah-Hartman
` (733 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <pablo@netfilter.org>
[ Upstream commit 0a0b35f0bf10b4c2be607465f5c9c12c8681305b ]
The ttl field has been decremented already and evaluation of this rule
would proceed, just drop this packet instead if there is no destination
device to forwards this packet. This is exactly what nf_dup already does
in this case.
Moreover, check for headroom and call skb_expand_head() like in the IP
output path to ensure there is sufficient headroom when forwarding this
via neigh_xmit().
Fixes: d32de98ea70f ("netfilter: nft_fwd_netdev: allow to forward packets via neighbour layer")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: d6c18cadfc6c ("netfilter: nft_reject: prevent unbounded recursion in output hooks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nft_fwd_netdev.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/netfilter/nft_fwd_netdev.c b/net/netfilter/nft_fwd_netdev.c
index 4bce36c3a6a07..8468bed3e87d2 100644
--- a/net/netfilter/nft_fwd_netdev.c
+++ b/net/netfilter/nft_fwd_netdev.c
@@ -101,6 +101,7 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
unsigned int verdict = NF_STOLEN;
struct sk_buff *skb = pkt->skb;
struct net_device *dev;
+ unsigned int hh_len;
int neigh_table;
switch (priv->nfproto) {
@@ -152,8 +153,19 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
}
dev = dev_get_by_index_rcu(nft_net(pkt), oif);
- if (dev == NULL)
- return;
+ if (dev == NULL) {
+ verdict = NF_DROP;
+ goto out;
+ }
+
+ hh_len = LL_RESERVED_SPACE(dev);
+ if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
+ skb = skb_expand_head(skb, hh_len);
+ if (!skb) {
+ verdict = NF_STOLEN;
+ goto out;
+ }
+ }
skb->dev = dev;
skb_clear_tstamp(skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 088/816] netfilter: nft_fwd_netdev: use recursion counter in neigh egress path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 087/816] netfilter: nft_fwd_netdev: add device and headroom validate with neigh forwarding Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 089/816] netfilter: nf_dup_netdev: add nf_dev_xmit_recursion*() helpers and use them Greg Kroah-Hartman
` (732 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi,
Pablo Neira Ayuso, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <bestswngs@gmail.com>
[ Upstream commit 1d47b55b36d2ec73fe6901212c8b28a593c3b27c ]
nft_fwd_neigh can be used in egress chains (NF_NETDEV_EGRESS). When the
forwarding rule targets the same device or two devices forward to each
other, neigh_xmit() triggers dev_queue_xmit() which re-enters
nf_hook_egress(), causing infinite recursion and stack overflow.
Move the nf_get_nf_dup_skb_recursion() accessor and NF_RECURSION_LIMIT
to the shared header nf_dup_netdev.h as a static inline, so that
nft_fwd_netdev can use the recursion counter directly without exported
function call overhead. Guard neigh_xmit() with the same recursion
limit already used in nf_do_netdev_egress().
[ Updated to cache the nf_get_nf_dup_skb_recursion pointer. --pablo ]
Fixes: f87b9464d152 ("netfilter: nft_fwd_netdev: Support egress hook")
Reported-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: d6c18cadfc6c ("netfilter: nft_reject: prevent unbounded recursion in output hooks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netfilter/nf_dup_netdev.h | 13 +++++++++++++
net/netfilter/nf_dup_netdev.c | 16 ----------------
net/netfilter/nft_fwd_netdev.c | 8 ++++++++
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/include/net/netfilter/nf_dup_netdev.h b/include/net/netfilter/nf_dup_netdev.h
index b175d271aec95..609bcf422a9b3 100644
--- a/include/net/netfilter/nf_dup_netdev.h
+++ b/include/net/netfilter/nf_dup_netdev.h
@@ -3,10 +3,23 @@
#define _NF_DUP_NETDEV_H_
#include <net/netfilter/nf_tables.h>
+#include <linux/netdevice.h>
+#include <linux/sched.h>
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
+
+static inline u8 *nf_get_nf_dup_skb_recursion(void)
+{
+#ifndef CONFIG_PREEMPT_RT
+ return this_cpu_ptr(&softnet_data.xmit.nf_dup_skb_recursion);
+#else
+ return ¤t->net_xmit.nf_dup_skb_recursion;
+#endif
+}
+
struct nft_offload_ctx;
struct nft_flow_rule;
diff --git a/net/netfilter/nf_dup_netdev.c b/net/netfilter/nf_dup_netdev.c
index fab8b9011098f..a958a1b0c5bee 100644
--- a/net/netfilter/nf_dup_netdev.c
+++ b/net/netfilter/nf_dup_netdev.c
@@ -13,22 +13,6 @@
#include <net/netfilter/nf_tables_offload.h>
#include <net/netfilter/nf_dup_netdev.h>
-#define NF_RECURSION_LIMIT 2
-
-#ifndef CONFIG_PREEMPT_RT
-static u8 *nf_get_nf_dup_skb_recursion(void)
-{
- return this_cpu_ptr(&softnet_data.xmit.nf_dup_skb_recursion);
-}
-#else
-
-static u8 *nf_get_nf_dup_skb_recursion(void)
-{
- return ¤t->net_xmit.nf_dup_skb_recursion;
-}
-
-#endif
-
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 8468bed3e87d2..14c1ac9f20b6a 100644
--- a/net/netfilter/nft_fwd_netdev.c
+++ b/net/netfilter/nft_fwd_netdev.c
@@ -95,6 +95,7 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
struct nft_regs *regs,
const struct nft_pktinfo *pkt)
{
+ u8 *nf_dup_skb_recursion = nf_get_nf_dup_skb_recursion();
struct nft_fwd_neigh *priv = nft_expr_priv(expr);
void *addr = ®s->data[priv->sreg_addr];
int oif = regs->data[priv->sreg_dev];
@@ -152,6 +153,11 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
goto out;
}
+ if (*nf_dup_skb_recursion > NF_RECURSION_LIMIT) {
+ verdict = NF_DROP;
+ goto out;
+ }
+
dev = dev_get_by_index_rcu(nft_net(pkt), oif);
if (dev == NULL) {
verdict = NF_DROP;
@@ -169,7 +175,9 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
skb->dev = dev;
skb_clear_tstamp(skb);
+ (*nf_dup_skb_recursion)++;
neigh_xmit(neigh_table, dev, addr, skb);
+ (*nf_dup_skb_recursion)--;
out:
regs->verdict.code = verdict;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 089/816] netfilter: nf_dup_netdev: add nf_dev_xmit_recursion*() helpers and use them
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 088/816] netfilter: nft_fwd_netdev: use recursion counter in neigh egress path Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 090/816] netfilter: nft_reject: prevent unbounded recursion in output hooks Greg Kroah-Hartman
` (731 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <pablo@netfilter.org>
[ Upstream commit 2354e975932dabb06fad239f07a3b68fd1809737 ]
Update nft_dup and nft_fwd to use the nf_dev_xmit_recursion() helpers.
This patch also disables BH when transmitting the skb to address a
possible migration to different CPU leading to imbalanced decrementation
of the recursion counters.
This is modeled after Florian Westphal's dev_xmit_recursion*() API
available since commit 97cdcf37b57e ("net: place xmit recursion in
softnet data") according to its current state in the tree.
Fixes: 1d47b55b36d2 ("netfilter: nft_fwd_netdev: use recursion counter in neigh egress path")
Fixes: f37ad9127039 ("netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: d6c18cadfc6c ("netfilter: nft_reject: prevent unbounded recursion in output hooks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netfilter/nf_dup_netdev.h | 34 +++++++++++++++++++++++----
net/netfilter/nf_dup_netdev.c | 15 ++++++------
net/netfilter/nft_fwd_netdev.c | 17 ++++++++------
3 files changed, 47 insertions(+), 19 deletions(-)
diff --git a/include/net/netfilter/nf_dup_netdev.h b/include/net/netfilter/nf_dup_netdev.h
index 609bcf422a9b3..f6b05bd80c3fe 100644
--- a/include/net/netfilter/nf_dup_netdev.h
+++ b/include/net/netfilter/nf_dup_netdev.h
@@ -11,15 +11,39 @@ void nf_fwd_netdev_egress(const struct nft_pktinfo *pkt, int oif);
#define NF_RECURSION_LIMIT 2
-static inline u8 *nf_get_nf_dup_skb_recursion(void)
-{
#ifndef CONFIG_PREEMPT_RT
- return this_cpu_ptr(&softnet_data.xmit.nf_dup_skb_recursion);
+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
- return ¤t->net_xmit.nf_dup_skb_recursion;
-#endif
+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/net/netfilter/nf_dup_netdev.c b/net/netfilter/nf_dup_netdev.c
index a958a1b0c5bee..02d1880bab6b3 100644
--- a/net/netfilter/nf_dup_netdev.c
+++ b/net/netfilter/nf_dup_netdev.c
@@ -16,11 +16,6 @@
static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev,
enum nf_dev_hooks hook)
{
- u8 *nf_dup_skb_recursion = nf_get_nf_dup_skb_recursion();
-
- if (*nf_dup_skb_recursion > NF_RECURSION_LIMIT)
- goto err;
-
if (hook == NF_NETDEV_INGRESS && skb_mac_header_was_set(skb)) {
if (skb_cow_head(skb, skb->mac_len))
goto err;
@@ -30,9 +25,15 @@ static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev,
skb->dev = dev;
skb_clear_tstamp(skb);
- (*nf_dup_skb_recursion)++;
+ local_bh_disable();
+ if (nf_dev_xmit_recursion()) {
+ local_bh_enable();
+ goto err;
+ }
+ nf_dev_xmit_recursion_inc();
dev_queue_xmit(skb);
- (*nf_dup_skb_recursion)--;
+ nf_dev_xmit_recursion_dec();
+ local_bh_enable();
return;
err:
kfree_skb(skb);
diff --git a/net/netfilter/nft_fwd_netdev.c b/net/netfilter/nft_fwd_netdev.c
index 14c1ac9f20b6a..eceab479bd8c4 100644
--- a/net/netfilter/nft_fwd_netdev.c
+++ b/net/netfilter/nft_fwd_netdev.c
@@ -95,7 +95,6 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
struct nft_regs *regs,
const struct nft_pktinfo *pkt)
{
- u8 *nf_dup_skb_recursion = nf_get_nf_dup_skb_recursion();
struct nft_fwd_neigh *priv = nft_expr_priv(expr);
void *addr = ®s->data[priv->sreg_addr];
int oif = regs->data[priv->sreg_dev];
@@ -153,13 +152,15 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
goto out;
}
- if (*nf_dup_skb_recursion > NF_RECURSION_LIMIT) {
+ dev = dev_get_by_index_rcu(nft_net(pkt), oif);
+ if (!dev) {
verdict = NF_DROP;
goto out;
}
- dev = dev_get_by_index_rcu(nft_net(pkt), oif);
- if (dev == NULL) {
+ local_bh_disable();
+ if (nf_dev_xmit_recursion()) {
+ local_bh_enable();
verdict = NF_DROP;
goto out;
}
@@ -168,16 +169,18 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
skb = skb_expand_head(skb, hh_len);
if (!skb) {
- verdict = NF_STOLEN;
+ local_bh_enable();
goto out;
}
}
skb->dev = dev;
skb_clear_tstamp(skb);
- (*nf_dup_skb_recursion)++;
+
+ nf_dev_xmit_recursion_inc();
neigh_xmit(neigh_table, dev, addr, skb);
- (*nf_dup_skb_recursion)--;
+ nf_dev_xmit_recursion_dec();
+ local_bh_enable();
out:
regs->verdict.code = verdict;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 090/816] netfilter: nft_reject: prevent unbounded recursion in output hooks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 089/816] netfilter: nf_dup_netdev: add nf_dev_xmit_recursion*() helpers and use them Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 091/816] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
` (730 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yu Junzhe,
Fernando Fernandez Mancera, Pablo Neira Ayuso, Sasha Levin
6.12-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 29c70e92a1722..ccdbbae6ff513 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>
@@ -329,7 +330,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 7beb12046486f..6d897bf698abd 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>
@@ -396,7 +397,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 02d1880bab6b3..c47508b54ba9c 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 eceab479bd8c4..84ae30cd208b7 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] 825+ messages in thread
* [PATCH 6.12 091/816] spi: pic32-sqi: fail transfer when the BD ring is exhausted
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 090/816] netfilter: nft_reject: prevent unbounded recursion in output hooks Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 092/816] bpf: Avoid changing callchain in bpf_get_stack_pe Greg Kroah-Hartman
` (729 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hongjian Dai, Mark Brown,
Sasha Levin
6.12-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 569d1e55c8ca9..3cb7e407bf717 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] 825+ messages in thread
* [PATCH 6.12 092/816] bpf: Avoid changing callchain in bpf_get_stack_pe
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 091/816] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 093/816] bpf: Clamp the trace length in __bpf_get_stack() again Greg Kroah-Hartman
` (728 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Olsa, Andrii Nakryiko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <jolsa@kernel.org>
[ Upstream commit 347c1d722e3ea4ffa2850585f5c76c6e551eac83 ]
There's no need to modify the trace object bpf_get_stack_pe, we just
need to pass the needed callchain length in separate argument.
This way we can have callchain pointers const and remove the trace->nr
modification and restoration.
Assisted-by: Codex:GPT-5.5
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260803210149.296496-12-jolsa@kernel.org
Stable-dep-of: 007fd460798b ("bpf: Clamp the trace length in __bpf_get_stack() again")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/stackmap.c | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index a43b2d8b13e04..e57f092437800 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -408,7 +408,7 @@ const struct bpf_func_proto bpf_get_stackid_proto = {
.arg3_type = ARG_ANYTHING,
};
-static __u64 count_kernel_ip(struct perf_callchain_entry *trace)
+static __u64 count_kernel_ip(const struct perf_callchain_entry *trace)
{
__u64 nr_kernel = 0;
@@ -488,15 +488,15 @@ const struct bpf_func_proto bpf_get_stackid_proto_pe = {
.arg3_type = ARG_ANYTHING,
};
-static u32 callchain_store(struct perf_callchain_entry *trace, void *buf,
- u32 elem_size, u64 flags)
+static u32 callchain_store(const struct perf_callchain_entry *trace, u32 trace_nr,
+ void *buf, u32 elem_size, u64 flags)
{
bool user_build_id = flags & BPF_F_USER_BUILD_ID;
u32 skip = flags & BPF_F_SKIP_FIELD_MASK;
- u32 trace_nr, copy_len;
- u64 *ips;
+ const u64 *ips;
+ u32 copy_len;
- trace_nr = trace->nr - skip;
+ trace_nr = trace_nr - skip;
copy_len = trace_nr * elem_size;
ips = trace->ip + skip;
@@ -580,7 +580,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
goto err_fault;
}
- trace_nr = callchain_store(trace, 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)
@@ -684,8 +684,8 @@ const struct bpf_func_proto bpf_get_task_stack_sleepable_proto = {
.arg4_type = ARG_ANYTHING,
};
-static int __bpf_get_stack_pe(struct perf_callchain_entry *trace, void *buf, u32 size,
- u64 flags)
+static int __bpf_get_stack_pe(const struct perf_callchain_entry *trace, u32 trace_nr,
+ void *buf, u32 size, u64 flags)
{
bool user_build_id = flags & BPF_F_USER_BUILD_ID;
u64 skip = flags & BPF_F_SKIP_FIELD_MASK;
@@ -701,12 +701,12 @@ static int __bpf_get_stack_pe(struct perf_callchain_entry *trace, void *buf, u32
return -EINVAL;
max_depth = stack_map_calculate_max_depth(size, elem_size, flags);
- trace->nr = min_t(u32, trace->nr, max_depth);
+ trace_nr = min_t(u32, trace_nr, max_depth);
- if (trace->nr < skip)
+ if (trace_nr < skip)
return -EFAULT;
- nr_trace = callchain_store(trace, buf, elem_size, flags);
+ nr_trace = callchain_store(trace, trace_nr, buf, elem_size, flags);
return callchain_finalize(buf, size, nr_trace, elem_size, flags, false /* !may_fault */);
}
@@ -714,8 +714,8 @@ BPF_CALL_4(bpf_get_stack_pe, struct bpf_perf_event_data_kern *, ctx,
void *, buf, u32, size, u64, flags)
{
struct pt_regs *regs = (struct pt_regs *)(ctx->regs);
+ const struct perf_callchain_entry *trace;
struct perf_event *event = ctx->event;
- struct perf_callchain_entry *trace;
bool kernel, user;
int err = -EINVAL;
__u64 nr_kernel;
@@ -738,13 +738,7 @@ BPF_CALL_4(bpf_get_stack_pe, struct bpf_perf_event_data_kern *, ctx,
nr_kernel = count_kernel_ip(trace);
if (kernel) {
- __u64 nr = trace->nr;
-
- trace->nr = nr_kernel;
- err = __bpf_get_stack_pe(trace, buf, size, flags);
-
- /* restore nr */
- trace->nr = nr;
+ err = __bpf_get_stack_pe(trace, nr_kernel, buf, size, flags);
} else { /* user */
u64 skip = flags & BPF_F_SKIP_FIELD_MASK;
@@ -752,7 +746,7 @@ BPF_CALL_4(bpf_get_stack_pe, struct bpf_perf_event_data_kern *, ctx,
if (skip > BPF_F_SKIP_FIELD_MASK)
goto clear;
flags = (flags & ~BPF_F_SKIP_FIELD_MASK) | skip;
- err = __bpf_get_stack_pe(trace, buf, size, flags);
+ err = __bpf_get_stack_pe(trace, trace->nr, buf, size, flags);
}
clear:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 093/816] bpf: Clamp the trace length in __bpf_get_stack() again
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 092/816] bpf: Avoid changing callchain in bpf_get_stack_pe Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 094/816] bpf: Avoid changing callchain in bpf_get_stackid_pe Greg Kroah-Hartman
` (727 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-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 e57f092437800..d38d8e49a789d 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -573,14 +573,20 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
crosstask, false);
}
- 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 = callchain_store(trace, trace->nr, buf, elem_size, flags);
+ /*
+ * 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 should not be dereferenced after this point */
if (may_fault)
@@ -589,6 +595,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] 825+ messages in thread
* [PATCH 6.12 094/816] bpf: Avoid changing callchain in bpf_get_stackid_pe
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 093/816] bpf: Clamp the trace length in __bpf_get_stack() again Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 095/816] bpf: Clamp the trace length before the skip test in stackid_init() Greg Kroah-Hartman
` (726 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Olsa, Andrii Nakryiko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Olsa <jolsa@kernel.org>
[ Upstream commit a74594607a0b310c1533e713b9097cc1cbbb85bf ]
There's no need to modify the trace object bpf_get_stackid_pe, we just
need to pass the needed callchain length in separate argument.
This way we can have callchain pointers const and remove the trace->nr
modification and restoration.
Assisted-by: Codex:GPT-5.5
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260803210149.296496-13-jolsa@kernel.org
Stable-dep-of: a08ba2ab79df ("bpf: Clamp the trace length before the skip test in stackid_init()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/stackmap.c | 39 +++++++++++++++++----------------------
1 file changed, 17 insertions(+), 22 deletions(-)
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index d38d8e49a789d..43e27cd278c4a 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -253,7 +253,7 @@ get_callchain_entry_for_task(struct task_struct *task, u32 max_depth)
struct stackid {
struct stack_map_bucket *bucket;
- u64 *ips;
+ const u64 *ips;
u32 nr;
u32 len;
u32 hash;
@@ -262,21 +262,21 @@ struct stackid {
};
static int stackid_init(struct stackid *stackid, struct bpf_map *map,
- struct perf_callchain_entry *trace, u64 flags)
+ const struct perf_callchain_entry *trace, u32 trace_nr, u64 flags)
{
struct bpf_stack_map *smap = container_of(map, struct bpf_stack_map, map);
u32 skip = flags & BPF_F_SKIP_FIELD_MASK;
u32 max_depth;
- if (trace->nr <= skip)
+ 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 = min_t(u32, trace_nr - skip, max_depth - skip);
stackid->len = stackid->nr * sizeof(u64);
stackid->ips = trace->ip + skip;
- stackid->hash = jhash2((u32 *)stackid->ips, stackid->len / sizeof(u32), 0);
+ stackid->hash = jhash2((const u32 *)stackid->ips, stackid->len / sizeof(u32), 0);
stackid->id = stackid->hash & (smap->n_buckets - 1);
stackid->bucket = READ_ONCE(smap->buckets[stackid->id]);
stackid->hash_matches = stackid->bucket && stackid->bucket->hash == stackid->hash;
@@ -284,11 +284,12 @@ static int stackid_init(struct stackid *stackid, struct bpf_map *map,
}
static int stackid_fastpath(struct stackid *stackid, struct bpf_map *map,
- struct perf_callchain_entry *trace, u64 flags)
+ const struct perf_callchain_entry *trace, u32 trace_nr,
+ u64 flags)
{
int err;
- err = stackid_init(stackid, map, trace, flags);
+ err = stackid_init(stackid, map, trace, trace_nr, flags);
if (err)
return err;
@@ -387,7 +388,7 @@ 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, flags);
+ err = stackid_fastpath(&stackid, map, trace, trace->nr, flags);
if (err != -ENOENT)
return err;
@@ -423,12 +424,13 @@ static __u64 count_kernel_ip(const struct perf_callchain_entry *trace)
BPF_CALL_3(bpf_get_stackid_pe, struct bpf_perf_event_data_kern *, ctx,
struct bpf_map *, map, u64, flags)
{
+ const struct perf_callchain_entry *trace;
struct perf_event *event = ctx->event;
struct stack_map_bucket *new_bucket;
- struct perf_callchain_entry *trace;
struct stackid stackid;
bool kernel, user;
__u64 nr_kernel;
+ u32 trace_nr;
int ret;
/* perf_sample_data doesn't have callchain, use bpf_get_stackid */
@@ -448,13 +450,13 @@ BPF_CALL_3(bpf_get_stackid_pe, struct bpf_perf_event_data_kern *, ctx,
return -EFAULT;
nr_kernel = count_kernel_ip(trace);
- __u64 nr = trace->nr; /* save original */
if (kernel) {
- trace->nr = nr_kernel;
+ trace_nr = nr_kernel;
} else { /* user */
u64 skip = flags & BPF_F_SKIP_FIELD_MASK;
+ trace_nr = trace->nr;
skip += nr_kernel;
if (skip > BPF_F_SKIP_FIELD_MASK)
return -EFAULT;
@@ -462,21 +464,14 @@ BPF_CALL_3(bpf_get_stackid_pe, struct bpf_perf_event_data_kern *, ctx,
flags = (flags & ~BPF_F_SKIP_FIELD_MASK) | skip;
}
- ret = stackid_fastpath(&stackid, map, trace, flags);
+ ret = stackid_fastpath(&stackid, map, trace, trace_nr, flags);
if (ret != -ENOENT)
- goto out;
+ return ret;
new_bucket = stackid_new_bucket(&stackid, map);
- if (new_bucket) {
- trace->nr = nr;
+ if (new_bucket)
return stackid_install(&stackid, map, new_bucket, flags);
- }
- ret = -ENOMEM;
-
-out:
- /* restore nr */
- trace->nr = nr;
- return ret;
+ return -ENOMEM;
}
const struct bpf_func_proto bpf_get_stackid_proto_pe = {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 095/816] bpf: Clamp the trace length before the skip test in stackid_init()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 094/816] bpf: Avoid changing callchain in bpf_get_stackid_pe Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 096/816] bpf: Refuse to map an arena at address 0 Greg Kroah-Hartman
` (725 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 43e27cd278c4a..5baf657ccb785 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -268,12 +268,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);
@@ -388,7 +390,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] 825+ messages in thread
* [PATCH 6.12 096/816] bpf: Refuse to map an arena at address 0
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 095/816] bpf: Clamp the trace length before the skip test in stackid_init() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 097/816] bpf: Refuse an arena mmap() longer than max_entries pages Greg Kroah-Hartman
` (724 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 c62c6f261ca07..598920ac256dc 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -341,6 +341,9 @@ static unsigned long arena_get_unmapped_area(struct file *filp, unsigned long ad
ret = mm_get_unmapped_area(current->mm, 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] 825+ messages in thread
* [PATCH 6.12 097/816] bpf: Refuse an arena mmap() longer than max_entries pages
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 096/816] bpf: Refuse to map an arena at address 0 Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 098/816] bpf: Remove the WARN from arena_get_unmapped_area() Greg Kroah-Hartman
` (723 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 598920ac256dc..345c77f7cd2b5 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -325,7 +325,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 */
@@ -373,7 +373,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] 825+ messages in thread
* [PATCH 6.12 098/816] bpf: Remove the WARN from arena_get_unmapped_area()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 097/816] bpf: Refuse an arena mmap() longer than max_entries pages Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 099/816] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
` (722 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 345c77f7cd2b5..5daffb7167925 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -346,9 +346,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] 825+ messages in thread
* [PATCH 6.12 099/816] bpf: Require prog fd or capability for cgroup detach
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 098/816] bpf: Remove the WARN from arena_get_unmapped_area() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 100/816] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
` (721 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.12-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 bd47c4cb19910..f075f3a8cda30 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -1071,9 +1071,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] 825+ messages in thread
* [PATCH 6.12 100/816] bpf, cgroup: Keep the skb network offset signed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 099/816] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 101/816] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
` (720 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.12-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 f075f3a8cda30..03e31f1371715 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -1577,7 +1577,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;
@@ -1589,7 +1589,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);
@@ -1631,7 +1639,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] 825+ messages in thread
* [PATCH 6.12 101/816] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 100/816] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 102/816] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
` (719 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 648e5b22ea58c..0f621e152b09a 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3691,6 +3691,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] 825+ messages in thread
* [PATCH 6.12 102/816] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 101/816] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 103/816] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
` (718 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.12-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 0f621e152b09a..4dbc3f091513b 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6524,11 +6524,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] 825+ messages in thread
* [PATCH 6.12 103/816] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 102/816] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 104/816] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
` (717 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.12-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 4dbc3f091513b..e4930cd595350 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6776,6 +6776,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] 825+ messages in thread
* [PATCH 6.12 104/816] bpf: Dont look for the SRH again in the End.BPF helpers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 103/816] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 105/816] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
` (716 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 e4930cd595350..59db81c2438ba 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6621,12 +6621,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);
@@ -6639,8 +6640,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);
@@ -6759,13 +6759,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) +
@@ -6797,8 +6798,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] 825+ messages in thread
* [PATCH 6.12 105/816] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 104/816] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 106/816] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
` (715 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.12-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 59db81c2438ba..1cebf5d12e81e 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6756,6 +6756,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;
@@ -6781,20 +6782,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] 825+ messages in thread
* [PATCH 6.12 106/816] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 105/816] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 107/816] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
` (714 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 d80899233441d..4978dcf6ffc1d 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -642,6 +642,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] 825+ messages in thread
* [PATCH 6.12 107/816] ipv4: Convert ip_route_input_noref() to dscp_t.
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 106/816] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 108/816] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
` (713 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guillaume Nault, David Ahern,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <gnault@redhat.com>
[ Upstream commit 66fb6386d358a04edd5c640e38b4a02b323b89d8 ]
Pass a dscp_t variable to ip_route_input_noref(), instead of a plain
u8, to prevent accidental setting of ECN bits in ->flowi4_tos.
Callers of ip_route_input_noref() to consider are:
* arp_process() in net/ipv4/arp.c. This function sets the tos
parameter to 0, which is already a valid dscp_t value, so it
doesn't need to be adjusted for the new prototype.
* ip_route_input(), which already has a dscp_t variable to pass as
parameter. We just need to remove the inet_dscp_to_dsfield()
conversion.
* ipvlan_l3_rcv(), bpf_lwt_input_reroute(), ip_expire(),
ip_rcv_finish_core(), xfrm4_rcv_encap_finish() and
xfrm4_rcv_encap(), which get the DSCP directly from IPv4 headers
and can simply use the ip4h_dscp() helper.
While there, declare the IPv4 header pointers as const in
ipvlan_l3_rcv() and bpf_lwt_input_reroute().
Also, modify the declaration of ip_route_input_noref() in
include/net/route.h so that it matches the prototype of its
implementation in net/ipv4/route.c.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/a8a747bed452519c4d0cc06af32c7e7795d7b627.1727807926.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: b3ad42f61832 ("bpf: Reset skb->cb after an lwt prog pushes an IP header")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ipvlan/ipvlan_l3s.c | 6 ++++--
include/net/route.h | 7 +++----
net/core/lwt_bpf.c | 5 +++--
net/ipv4/ip_fragment.c | 4 ++--
net/ipv4/ip_input.c | 2 +-
net/ipv4/route.c | 6 +++---
net/ipv4/xfrm4_input.c | 2 +-
net/ipv4/xfrm4_protocol.c | 2 +-
8 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_l3s.c b/drivers/net/ipvlan/ipvlan_l3s.c
index ca35a50bb6405..7c017fe35522a 100644
--- a/drivers/net/ipvlan/ipvlan_l3s.c
+++ b/drivers/net/ipvlan/ipvlan_l3s.c
@@ -2,6 +2,8 @@
/* Copyright (c) 2014 Mahesh Bandewar <maheshb@google.com>
*/
+#include <net/ip.h>
+
#include "ipvlan.h"
static unsigned int ipvlan_netid __read_mostly;
@@ -48,11 +50,11 @@ static struct sk_buff *ipvlan_l3_rcv(struct net_device *dev,
switch (proto) {
case AF_INET:
{
- struct iphdr *ip4h = ip_hdr(skb);
+ const struct iphdr *ip4h = ip_hdr(skb);
int err;
err = ip_route_input_noref(skb, ip4h->daddr, ip4h->saddr,
- ip4h->tos, sdev);
+ ip4h_dscp(ip4h), sdev);
if (unlikely(err))
goto out;
break;
diff --git a/include/net/route.h b/include/net/route.h
index 76f526e051aa3..5df58eb5ecb10 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -201,8 +201,8 @@ static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4
int ip_mc_validate_source(struct sk_buff *skb, __be32 daddr, __be32 saddr,
u8 tos, struct net_device *dev,
struct in_device *in_dev, u32 *itag);
-int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src,
- u8 tos, struct net_device *devin);
+int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
+ dscp_t dscp, struct net_device *dev);
int ip_route_use_hint(struct sk_buff *skb, __be32 dst, __be32 src,
u8 tos, struct net_device *devin,
const struct sk_buff *hint);
@@ -213,8 +213,7 @@ static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src,
int err;
rcu_read_lock();
- err = ip_route_input_noref(skb, dst, src, inet_dscp_to_dsfield(dscp),
- devin);
+ err = ip_route_input_noref(skb, dst, src, dscp, devin);
if (!err) {
skb_dst_force(skb);
if (!skb_dst(skb))
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 4978dcf6ffc1d..58bf664d99ebd 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -10,6 +10,7 @@
#include <linux/bpf.h>
#include <net/lwtunnel.h>
#include <net/gre.h>
+#include <net/ip.h>
#include <net/ip6_route.h>
#include <net/ipv6_stubs.h>
#include <net/inet_dscp.h>
@@ -91,12 +92,12 @@ static int bpf_lwt_input_reroute(struct sk_buff *skb)
if (skb->protocol == htons(ETH_P_IP)) {
struct net_device *dev = skb_dst(skb)->dev;
- struct iphdr *iph = ip_hdr(skb);
+ const struct iphdr *iph = ip_hdr(skb);
dev_hold(dev);
skb_dst_drop(skb);
err = ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, dev);
+ ip4h_dscp(iph), dev);
dev_put(dev);
} else if (skb->protocol == htons(ETH_P_IPV6)) {
skb_dst_drop(skb);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 1fd7017300b3b..648e80c1f8df3 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -168,8 +168,8 @@ static void ip_expire(struct timer_list *t)
/* skb has no dst, perform route lookup again */
iph = ip_hdr(head);
- err = ip_route_input_noref(head, iph->daddr, iph->saddr,
- iph->tos, head->dev);
+ err = ip_route_input_noref(head, iph->daddr, iph->saddr, ip4h_dscp(iph),
+ head->dev);
if (err)
goto out;
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 7b092ba6f5779..9db51472c1e0f 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -363,7 +363,7 @@ static int ip_rcv_finish_core(struct net *net, struct sock *sk,
*/
if (!skb_valid_dst(skb)) {
err = ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, dev);
+ ip4h_dscp(iph), dev);
if (unlikely(err))
goto drop_error;
} else {
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f1b0ab77b443b..64fe59730ed8b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2529,14 +2529,14 @@ static int ip_route_input_rcu(struct sk_buff *skb, __be32 daddr, __be32 saddr,
}
int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
- u8 tos, struct net_device *dev)
+ dscp_t dscp, struct net_device *dev)
{
struct fib_result res;
int err;
- tos &= INET_DSCP_MASK;
rcu_read_lock();
- err = ip_route_input_rcu(skb, daddr, saddr, tos, dev, &res);
+ err = ip_route_input_rcu(skb, daddr, saddr, inet_dscp_to_dsfield(dscp),
+ dev, &res);
rcu_read_unlock();
return err;
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c
index 9deee1558e3d6..f6f2a8ef3f884 100644
--- a/net/ipv4/xfrm4_input.c
+++ b/net/ipv4/xfrm4_input.c
@@ -33,7 +33,7 @@ static inline int xfrm4_rcv_encap_finish(struct net *net, struct sock *sk,
const struct iphdr *iph = ip_hdr(skb);
if (ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, skb->dev))
+ ip4h_dscp(iph), skb->dev))
goto drop;
}
diff --git a/net/ipv4/xfrm4_protocol.c b/net/ipv4/xfrm4_protocol.c
index b146ce88c5d0c..4ee624d8e66fc 100644
--- a/net/ipv4/xfrm4_protocol.c
+++ b/net/ipv4/xfrm4_protocol.c
@@ -76,7 +76,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
const struct iphdr *iph = ip_hdr(skb);
if (ip_route_input_noref(skb, iph->daddr, iph->saddr,
- iph->tos, skb->dev))
+ ip4h_dscp(iph), skb->dev))
goto drop;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 108/816] bpf: Reset skb->cb after an lwt prog pushes an IP header
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 107/816] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 109/816] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
` (712 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Daniel Borkmann,
Alexei Starovoitov, Sasha Levin
6.12-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 58bf664d99ebd..7b669f206abd7 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -86,6 +86,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)
{
int err = -EINVAL;
@@ -118,6 +144,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;
@@ -126,6 +154,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);
}
@@ -305,6 +336,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] 825+ messages in thread
* [PATCH 6.12 109/816] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 108/816] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 110/816] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
` (711 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-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 7b669f206abd7..331d4fd271960 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -159,6 +159,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] 825+ messages in thread
* [PATCH 6.12 110/816] bpf: Move the transport header with the moved headers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 109/816] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 111/816] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
` (710 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.12-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 1cebf5d12e81e..359180c91d034 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3353,9 +3353,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
@@ -3366,8 +3382,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;
@@ -3375,7 +3391,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. */
@@ -3383,8 +3399,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] 825+ messages in thread
* [PATCH 6.12 111/816] bpf: Check the offset in bpf_skb_generic_{push,pop}()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 110/816] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 112/816] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
` (709 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Alexei Starovoitov,
Sasha Levin
6.12-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 359180c91d034..044595be4217a 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3320,6 +3320,10 @@ static void bpf_skb_change_protocol(struct sk_buff *skb, u16 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.
*/
@@ -3340,9 +3344,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] 825+ messages in thread
* [PATCH 6.12 112/816] spi: Fix ACPI SPI resources using relative path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 111/816] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 113/816] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
` (708 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alban Bedel, Mark Brown, Sasha Levin
6.12-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 c5cd38e295f56..5f58df273dc7b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2628,6 +2628,7 @@ EXPORT_SYMBOL_GPL(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;
@@ -2722,7 +2723,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);
@@ -2814,6 +2815,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] 825+ messages in thread
* [PATCH 6.12 113/816] spi: acpi: only look up the IRQ of confirmed SPI devices
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 112/816] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 114/816] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
` (707 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rosen Penev, Mark Brown, Sasha Levin
6.12-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 5f58df273dc7b..6b7702433c764 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2631,7 +2631,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;
@@ -2774,17 +2773,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
@@ -2809,6 +2816,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)
@@ -2816,7 +2824,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;
@@ -2839,6 +2846,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",
@@ -2852,7 +2872,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] 825+ messages in thread
* [PATCH 6.12 114/816] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 113/816] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 115/816] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
` (706 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuqiang Sun, Alexei Starovoitov,
Sasha Levin
6.12-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 331d4fd271960..261915d54d208 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -339,8 +339,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] 825+ messages in thread
* [PATCH 6.12 115/816] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 114/816] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 116/816] bnxt_en: Dont keep MSI-X vectors added before FW reserves them Greg Kroah-Hartman
` (705 subsequent siblings)
820 siblings, 0 replies; 825+ 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,
Simon Horman, Dave Miller, Sasha Levin
6.12-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 4a078113e292d..3d2473d9f3eac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -98,6 +98,7 @@ struct mlx5_fs_id {
refcount_t refcnt;
sci_t sci;
struct rhash_head hash;
+ struct rcu_head rcu;
};
struct mlx5_macsec_device {
@@ -688,7 +689,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] 825+ messages in thread
* [PATCH 6.12 116/816] bnxt_en: Dont keep MSI-X vectors added before FW reserves them
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 115/816] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 117/816] ipv6: fix fib6 walker UAF on NLM_F_REPLACE Greg Kroah-Hartman
` (704 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrew Preece, Vlad Poenaru,
Michael Chan, Dave Miller, Sasha Levin
6.12-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 f30777268a59a..5d6f24044fb63 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10947,6 +10947,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;
@@ -11124,8 +11125,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);
@@ -11151,6 +11167,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;
}
@@ -14181,6 +14201,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) {
@@ -14188,6 +14209,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] 825+ messages in thread
* [PATCH 6.12 117/816] ipv6: fix fib6 walker UAF on NLM_F_REPLACE
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 116/816] bnxt_en: Dont keep MSI-X vectors added before FW reserves them Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 118/816] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
` (703 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Cen Zhang (Microsoft), Ido Schimmel, Dave Miller, Sasha Levin
6.12-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 630b520f72410..aab1dddf1f59f 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);
@@ -1302,6 +1336,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)) {
@@ -1324,6 +1359,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;
fib6_purge_rt(iter, fn, info->nl_net);
@@ -1933,7 +1969,6 @@ static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
struct fib6_info __rcu **rtp, struct nl_info *info)
{
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;
@@ -1984,18 +2019,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] 825+ messages in thread
* [PATCH 6.12 118/816] tcp: do not let tcp_collapse() drive sk_forward_alloc negative
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 117/816] ipv6: fix fib6 walker UAF on NLM_F_REPLACE Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 119/816] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
` (702 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Octavian Purdila, Dave Miller, Sasha Levin
6.12-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 c11faca825ff9..e529ecb9b42b8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5534,6 +5534,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] 825+ messages in thread
* [PATCH 6.12 119/816] ata: libata-sata: allow re-enabling NCQ with the same queue_depth
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 118/816] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 120/816] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
` (701 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Pylypiv, Niklas Cassel,
Sasha Levin
6.12-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 0b6cfdfc27598..263a03e14b115 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] 825+ messages in thread
* [PATCH 6.12 120/816] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (118 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 119/816] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 121/816] net: stmmac: Set dma_sync_size to zero for discarded frames Greg Kroah-Hartman
` (700 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Pylypiv, Niklas Cassel,
Sasha Levin
6.12-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 b78aa5371c14c..e56735f189535 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -4014,8 +4014,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] 825+ messages in thread
* [PATCH 6.12 121/816] net: stmmac: Set dma_sync_size to zero for discarded frames
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 120/816] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 122/816] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
` (699 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Furong Xu, Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Furong Xu <0x1207@gmail.com>
[ Upstream commit 51cfbed198ca4aa140babde816387db0e71f09e7 ]
If a frame is going to be discarded by driver, this frame is never touched
by driver and the cache lines never become dirty obviously,
page_pool_recycle_direct() wastes CPU cycles on unnecessary calling of
page_pool_dma_sync_for_device() to sync entire frame.
page_pool_put_page() with sync_size setting to 0 is the proper method.
Signed-off-by: Furong Xu <0x1207@gmail.com>
Link: https://patch.msgid.link/20250103093733.3872939-1-0x1207@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 834ec9530832 ("net: stmmac: drop split frames on AF_XDP zero-copy RX")
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 d8988ca3d163f..3bfc2522b2fc3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5586,7 +5586,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
status);
}
if (unlikely(status == discard_frame)) {
- page_pool_recycle_direct(rx_q->page_pool, buf->page);
+ page_pool_put_page(rx_q->page_pool, buf->page, 0, true);
buf->page = NULL;
error = 1;
if (!priv->hwts_rx_en)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 122/816] net: stmmac: drop split frames on AF_XDP zero-copy RX
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 121/816] net: stmmac: Set dma_sync_size to zero for discarded frames Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 123/816] net: stmmac: copy XDP metadata in " Greg Kroah-Hartman
` (698 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, Lorenzo Bianconi,
Paolo Abeni, Sasha Levin
6.12-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 963579518405c..9833db1fed0c4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
@@ -210,7 +210,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 68a7cfcb1d8f3..c08846da03eb7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -77,7 +77,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 3bfc2522b2fc3..62527de9874e0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5387,18 +5387,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;
}
@@ -5407,8 +5410,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;
}
@@ -5585,7 +5589,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] 825+ messages in thread
* [PATCH 6.12 123/816] net: stmmac: copy XDP metadata in AF_XDP zero-copy RX
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 122/816] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 124/816] ata: libata-core: Check device support before querying power state Greg Kroah-Hartman
` (697 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Paolo Abeni,
Sasha Levin
6.12-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 62527de9874e0..a48c34dcbcd26 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5171,7 +5171,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] 825+ messages in thread
* [PATCH 6.12 124/816] ata: libata-core: Check device support before querying power state
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 123/816] net: stmmac: copy XDP metadata in " Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 125/816] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
` (696 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli, Niklas Cassel,
Sasha Levin
6.12-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 b1947e4e534f6..1424c90f8bead 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2045,6 +2045,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))
@@ -2063,10 +2067,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] 825+ messages in thread
* [PATCH 6.12 125/816] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 124/816] ata: libata-core: Check device support before querying power state Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 126/816] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
` (695 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Machon, Simon Horman,
Paolo Abeni, Sasha Levin
6.12-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 11a341fc45779..6dad3c019f01c 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] 825+ messages in thread
* [PATCH 6.12 126/816] drm/panel: visionox-r66451: Send the brightness value MSB first
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 125/816] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 127/816] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
` (694 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vladimir Zapolskiy, Neil Armstrong,
Sasha Levin
6.12-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 493f2a6076f8d..c2b53458a9698 100644
--- a/drivers/gpu/drm/panel/panel-visionox-r66451.c
+++ b/drivers/gpu/drm/panel/panel-visionox-r66451.c
@@ -254,7 +254,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] 825+ messages in thread
* [PATCH 6.12 127/816] drm/panel: visionox-r66451: Wait longer after the panel reset
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 126/816] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 128/816] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
` (693 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vladimir Zapolskiy, Neil Armstrong,
Sasha Levin
6.12-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 c2b53458a9698..5f2e0266373e1 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] 825+ messages in thread
* [PATCH 6.12 128/816] sfc: ptp: drop the stale frequency reset in efx_ptp_start()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 127/816] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 129/816] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
` (692 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Austin, Paolo Abeni,
Sasha Levin
6.12-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 aaacdcfa54ae1..5bbd3f1a07647 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] 825+ messages in thread
* [PATCH 6.12 129/816] sfc: ptp: serialize host and MC synchronization transactions
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 128/816] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 130/816] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
` (691 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alex Austin, Alejandro Lucero,
Pieter Jansen van Vuuren, Edward Cree, Paolo Abeni, Sasha Levin
6.12-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 5bbd3f1a07647..608bcba90c509 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;
}
@@ -2110,23 +2129,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);
@@ -2139,6 +2158,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,
@@ -2170,23 +2201,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] 825+ messages in thread
* [PATCH 6.12 130/816] sfc: ptp: avoid racing PPS timestamp updates
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 129/816] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 131/816] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
` (690 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alex Austin, Alejandro Lucero,
Pieter Jansen van Vuuren, Paolo Abeni, Sasha Levin
6.12-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 608bcba90c509..3aed327a5ec70 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);
}
@@ -1849,7 +1854,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] 825+ messages in thread
* [PATCH 6.12 131/816] vdpa_sim: serialize IOTLB updates with dataplane access
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 130/816] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
@ 2026-11-25 14:27 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 132/816] vdpa: invalidate DMA mappings before releasing memory Greg Kroah-Hartman
` (689 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:27 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.12-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 f7d346809e749..04dbdb8bf25a7 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -714,6 +714,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]);
@@ -722,6 +723,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;
}
@@ -734,6 +736,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]);
@@ -741,6 +744,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 33e3100b3836d..f222d58d9ff95 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] 825+ messages in thread
* [PATCH 6.12 132/816] vdpa: invalidate DMA mappings before releasing memory
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2026-11-25 14:27 ` [PATCH 6.12 131/816] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 133/816] vhost-scsi: preserve event ordering Greg Kroah-Hartman
` (688 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.12-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 66d5231f03c22..dd577f24bf753 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -3048,7 +3048,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 04dbdb8bf25a7..0e5e194a4558c 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -639,6 +639,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];
@@ -653,11 +654,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 f222d58d9ff95..d467422559cdc 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] 825+ messages in thread
* [PATCH 6.12 133/816] vhost-scsi: preserve event ordering
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 132/816] vdpa: invalidate DMA mappings before releasing memory Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 134/816] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
` (687 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Mike Christie,
Michael S. Tsirkin, Sasha Levin
6.12-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 c7773ff350ed4..5f7480db273a6 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -515,7 +515,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] 825+ messages in thread
* [PATCH 6.12 134/816] vhost-scsi: do not relock event vq mutex on send_evt fallback
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 133/816] vhost-scsi: preserve event ordering Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 135/816] virtio_pci: add missing newline to the pmcsr error message Greg Kroah-Hartman
` (686 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Mike Christie,
Michael S. Tsirkin, Sasha Levin
6.12-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 5f7480db273a6..b8a726e1a2c78 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -508,19 +508,26 @@ vhost_scsi_do_evt_work(struct vhost_scsi *vs, struct vhost_scsi_evt *evt)
vq_err(vq, "Faulted on vhost_scsi_send_event\n");
}
-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);
}
@@ -1595,7 +1602,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] 825+ messages in thread
* [PATCH 6.12 135/816] virtio_pci: add missing newline to the pmcsr error message
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 134/816] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 136/816] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
` (685 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Maoxia, Michael S. Tsirkin,
Sasha Levin
6.12-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 d88f62d0fb7a2..77f81a000637e 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -636,7 +636,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] 825+ messages in thread
* [PATCH 6.12 136/816] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 135/816] virtio_pci: add missing newline to the pmcsr error message Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 137/816] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
` (684 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, co+6dcbccedc9ec6452, Xiang Mei,
Michael S. Tsirkin, Paul Moses, Sasha Levin
6.12-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 0fb00c8bde5e3..c37c1fc940582 100644
--- a/drivers/vdpa/vdpa.c
+++ b/drivers/vdpa/vdpa.c
@@ -1311,15 +1311,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] 825+ messages in thread
* [PATCH 6.12 137/816] vhost: reject invalid IOTLB update permissions
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 136/816] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 138/816] irqbypass: Take ownership of producer/consumer token tracking Greg Kroah-Hartman
` (683 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.12-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 9d5ea96f67ce2..bacb48308b084 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1728,7 +1728,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] 825+ messages in thread
* [PATCH 6.12 138/816] irqbypass: Take ownership of producer/consumer token tracking
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 137/816] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 139/816] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
` (682 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Tian, Michael S. Tsirkin,
Alex Williamson, Sean Christopherson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit 2b521d86ee80a436a92445b8206d38d75aeb39ea ]
Move ownership of IRQ bypass token tracking into irqbypass.ko, and
explicitly require callers to pass an eventfd_ctx structure instead of a
completely opaque token. Relying on producers and consumers to set the
token appropriately is error prone, and hiding the fact that the token must
be an eventfd_ctx pointer (for all intents and purposes) unnecessarily
obfuscates the code and makes it more brittle.
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/r/20250516230734.2564775-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Stable-dep-of: c9c1c1b7b31f ("vhost-vdpa: drop the parent's vq callback before the call fd is released")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/x86.c | 4 +--
drivers/vfio/pci/vfio_pci_intrs.c | 9 +++----
drivers/vhost/vdpa.c | 8 +++---
include/linux/irqbypass.h | 35 +++++++++++++-----------
virt/kvm/eventfd.c | 7 +++--
virt/lib/irqbypass.c | 44 ++++++++++++++++++++-----------
6 files changed, 58 insertions(+), 49 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ee3b528ec1e27..5068282e20705 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -12850,8 +12850,8 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *cons,
ret = kvm_x86_call(pi_update_irte)(irqfd->kvm,
prod->irq, irqfd->gsi, 0);
if (ret)
- printk(KERN_INFO "irq bypass consumer (token %p) unregistration"
- " fails: %d\n", irqfd->consumer.token, ret);
+ printk(KERN_INFO "irq bypass consumer (eventfd %p) unregistration"
+ " fails: %d\n", irqfd->consumer.eventfd, ret);
spin_unlock_irq(&kvm->irqfds.lock);
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
index ed86747749e53..d867bced40bb7 100644
--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -512,15 +512,12 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_core_device *vdev,
if (ret)
goto out_put_eventfd_ctx;
- ctx->producer.token = trigger;
ctx->producer.irq = irq;
- ret = irq_bypass_register_producer(&ctx->producer);
+ ret = irq_bypass_register_producer(&ctx->producer, trigger);
if (unlikely(ret)) {
dev_info(&pdev->dev,
- "irq bypass producer (token %p) registration fails: %d\n",
- ctx->producer.token, ret);
-
- ctx->producer.token = NULL;
+ "irq bypass producer (eventfd %p) registration fails: %d\n",
+ trigger, ret);
}
ctx->trigger = trigger;
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index d467422559cdc..2e0dbfa0a141f 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -225,10 +225,10 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid)
return;
vq->call_ctx.producer.irq = irq;
- ret = irq_bypass_register_producer(&vq->call_ctx.producer);
+ ret = irq_bypass_register_producer(&vq->call_ctx.producer, vq->call_ctx.ctx);
if (unlikely(ret))
- dev_info(&v->dev, "vq %u, irq bypass producer (token %p) registration fails, ret = %d\n",
- qid, vq->call_ctx.producer.token, ret);
+ dev_info(&v->dev, "vq %u, irq bypass producer (eventfd %p) registration fails, ret = %d\n",
+ qid, vq->call_ctx.ctx, ret);
}
static void vhost_vdpa_unsetup_vq_irq(struct vhost_vdpa *v, u16 qid)
@@ -765,7 +765,6 @@ 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);
- vq->call_ctx.producer.token = NULL;
}
break;
}
@@ -806,7 +805,6 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
cb.callback = vhost_vdpa_virtqueue_cb;
cb.private = vq;
cb.trigger = vq->call_ctx.ctx;
- vq->call_ctx.producer.token = vq->call_ctx.ctx;
if (ops->get_status(vdpa) &
VIRTIO_CONFIG_S_DRIVER_OK)
vhost_vdpa_setup_vq_irq(v, idx);
diff --git a/include/linux/irqbypass.h b/include/linux/irqbypass.h
index 9bdb2a7818418..1b57d15ac4cf2 100644
--- a/include/linux/irqbypass.h
+++ b/include/linux/irqbypass.h
@@ -10,6 +10,7 @@
#include <linux/list.h>
+struct eventfd_ctx;
struct irq_bypass_consumer;
/*
@@ -18,20 +19,20 @@ struct irq_bypass_consumer;
* The IRQ bypass manager is a simple set of lists and callbacks that allows
* IRQ producers (ex. physical interrupt sources) to be matched to IRQ
* consumers (ex. virtualization hardware that allows IRQ bypass or offload)
- * via a shared token (ex. eventfd_ctx). Producers and consumers register
- * independently. When a token match is found, the optional @stop callback
- * will be called for each participant. The pair will then be connected via
- * the @add_* callbacks, and finally the optional @start callback will allow
- * any final coordination. When either participant is unregistered, the
- * process is repeated using the @del_* callbacks in place of the @add_*
- * callbacks. Match tokens must be unique per producer/consumer, 1:N pairings
- * are not supported.
+ * via a shared eventfd_ctx. Producers and consumers register independently.
+ * When a producer and consumer are paired, i.e. an eventfd match is found, the
+ * optional @stop callback will be called for each participant. The pair will
+ * then be connected via the @add_* callbacks, and finally the optional @start
+ * callback will allow any final coordination. When either participant is
+ * unregistered, the process is repeated using the @del_* callbacks in place of
+ * the @add_* callbacks. eventfds must be unique per producer/consumer, 1:N
+ * pairings are not supported.
*/
/**
* struct irq_bypass_producer - IRQ bypass producer definition
* @node: IRQ bypass manager private list management
- * @token: opaque token to match between producer and consumer (non-NULL)
+ * @eventfd: eventfd context used to match producers and consumers
* @irq: Linux IRQ number for the producer device
* @add_consumer: Connect the IRQ producer to an IRQ consumer (optional)
* @del_consumer: Disconnect the IRQ producer from an IRQ consumer (optional)
@@ -44,7 +45,7 @@ struct irq_bypass_consumer;
*/
struct irq_bypass_producer {
struct list_head node;
- void *token;
+ struct eventfd_ctx *eventfd;
int irq;
int (*add_consumer)(struct irq_bypass_producer *,
struct irq_bypass_consumer *);
@@ -57,7 +58,7 @@ struct irq_bypass_producer {
/**
* struct irq_bypass_consumer - IRQ bypass consumer definition
* @node: IRQ bypass manager private list management
- * @token: opaque token to match between producer and consumer (non-NULL)
+ * @eventfd: eventfd context used to match producers and consumers
* @add_producer: Connect the IRQ consumer to an IRQ producer
* @del_producer: Disconnect the IRQ consumer from an IRQ producer
* @stop: Perform any quiesce operations necessary prior to add/del (optional)
@@ -70,7 +71,7 @@ struct irq_bypass_producer {
*/
struct irq_bypass_consumer {
struct list_head node;
- void *token;
+ struct eventfd_ctx *eventfd;
int (*add_producer)(struct irq_bypass_consumer *,
struct irq_bypass_producer *);
void (*del_producer)(struct irq_bypass_consumer *,
@@ -79,9 +80,11 @@ struct irq_bypass_consumer {
void (*start)(struct irq_bypass_consumer *);
};
-int irq_bypass_register_producer(struct irq_bypass_producer *);
-void irq_bypass_unregister_producer(struct irq_bypass_producer *);
-int irq_bypass_register_consumer(struct irq_bypass_consumer *);
-void irq_bypass_unregister_consumer(struct irq_bypass_consumer *);
+int irq_bypass_register_producer(struct irq_bypass_producer *producer,
+ struct eventfd_ctx *eventfd);
+void irq_bypass_unregister_producer(struct irq_bypass_producer *producer);
+int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer,
+ struct eventfd_ctx *eventfd);
+void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer);
#endif /* IRQBYPASS_H */
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index c9c9ccdb0e7ec..43ecb8293e9b9 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -442,15 +442,14 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
#if IS_ENABLED(CONFIG_HAVE_KVM_IRQ_BYPASS)
if (kvm_arch_has_irq_bypass()) {
- irqfd->consumer.token = (void *)irqfd->eventfd;
irqfd->consumer.add_producer = kvm_arch_irq_bypass_add_producer;
irqfd->consumer.del_producer = kvm_arch_irq_bypass_del_producer;
irqfd->consumer.stop = kvm_arch_irq_bypass_stop;
irqfd->consumer.start = kvm_arch_irq_bypass_start;
- ret = irq_bypass_register_consumer(&irqfd->consumer);
+ ret = irq_bypass_register_consumer(&irqfd->consumer, irqfd->eventfd);
if (ret)
- pr_info("irq bypass consumer (token %p) registration fails: %d\n",
- irqfd->consumer.token, ret);
+ pr_info("irq bypass consumer (eventfd %p) registration fails: %d\n",
+ irqfd->eventfd, ret);
}
#endif
diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c
index 28fda42e471bb..cce0111b1fd4e 100644
--- a/virt/lib/irqbypass.c
+++ b/virt/lib/irqbypass.c
@@ -77,17 +77,19 @@ static void __disconnect(struct irq_bypass_producer *prod,
/**
* irq_bypass_register_producer - register IRQ bypass producer
* @producer: pointer to producer structure
+ * @eventfd: pointer to the eventfd context associated with the producer
*
* Add the provided IRQ producer to the list of producers and connect
- * with any matching token found on the IRQ consumers list.
+ * with any matching eventfd found on the IRQ consumers list.
*/
-int irq_bypass_register_producer(struct irq_bypass_producer *producer)
+int irq_bypass_register_producer(struct irq_bypass_producer *producer,
+ struct eventfd_ctx *eventfd)
{
struct irq_bypass_producer *tmp;
struct irq_bypass_consumer *consumer;
int ret;
- if (!producer->token)
+ if (WARN_ON_ONCE(producer->eventfd))
return -EINVAL;
might_sleep();
@@ -98,14 +100,14 @@ int irq_bypass_register_producer(struct irq_bypass_producer *producer)
mutex_lock(&lock);
list_for_each_entry(tmp, &producers, node) {
- if (tmp->token == producer->token) {
+ if (tmp->eventfd == eventfd) {
ret = -EBUSY;
goto out_err;
}
}
list_for_each_entry(consumer, &consumers, node) {
- if (consumer->token == producer->token) {
+ if (consumer->eventfd == eventfd) {
ret = __connect(producer, consumer);
if (ret)
goto out_err;
@@ -113,6 +115,7 @@ int irq_bypass_register_producer(struct irq_bypass_producer *producer)
}
}
+ producer->eventfd = eventfd;
list_add(&producer->node, &producers);
mutex_unlock(&lock);
@@ -137,7 +140,7 @@ void irq_bypass_unregister_producer(struct irq_bypass_producer *producer)
struct irq_bypass_producer *tmp;
struct irq_bypass_consumer *consumer;
- if (!producer->token)
+ if (!producer->eventfd)
return;
might_sleep();
@@ -148,21 +151,23 @@ void irq_bypass_unregister_producer(struct irq_bypass_producer *producer)
mutex_lock(&lock);
list_for_each_entry(tmp, &producers, node) {
- if (tmp->token != producer->token)
+ if (tmp->eventfd != producer->eventfd)
continue;
list_for_each_entry(consumer, &consumers, node) {
- if (consumer->token == producer->token) {
+ if (consumer->eventfd == producer->eventfd) {
__disconnect(producer, consumer);
break;
}
}
+ producer->eventfd = NULL;
list_del(&producer->node);
module_put(THIS_MODULE);
break;
}
+ WARN_ON_ONCE(producer->eventfd);
mutex_unlock(&lock);
module_put(THIS_MODULE);
@@ -172,18 +177,22 @@ EXPORT_SYMBOL_GPL(irq_bypass_unregister_producer);
/**
* irq_bypass_register_consumer - register IRQ bypass consumer
* @consumer: pointer to consumer structure
+ * @eventfd: pointer to the eventfd context associated with the consumer
*
* Add the provided IRQ consumer to the list of consumers and connect
- * with any matching token found on the IRQ producer list.
+ * with any matching eventfd found on the IRQ producer list.
*/
-int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
+int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer,
+ struct eventfd_ctx *eventfd)
{
struct irq_bypass_consumer *tmp;
struct irq_bypass_producer *producer;
int ret;
- if (!consumer->token ||
- !consumer->add_producer || !consumer->del_producer)
+ if (WARN_ON_ONCE(consumer->eventfd))
+ return -EINVAL;
+
+ if (!consumer->add_producer || !consumer->del_producer)
return -EINVAL;
might_sleep();
@@ -194,14 +203,14 @@ int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
mutex_lock(&lock);
list_for_each_entry(tmp, &consumers, node) {
- if (tmp->token == consumer->token || tmp == consumer) {
+ if (tmp->eventfd == eventfd) {
ret = -EBUSY;
goto out_err;
}
}
list_for_each_entry(producer, &producers, node) {
- if (producer->token == consumer->token) {
+ if (producer->eventfd == eventfd) {
ret = __connect(producer, consumer);
if (ret)
goto out_err;
@@ -209,6 +218,7 @@ int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
}
}
+ consumer->eventfd = eventfd;
list_add(&consumer->node, &consumers);
mutex_unlock(&lock);
@@ -233,7 +243,7 @@ void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer)
struct irq_bypass_consumer *tmp;
struct irq_bypass_producer *producer;
- if (!consumer->token)
+ if (!consumer->eventfd)
return;
might_sleep();
@@ -248,17 +258,19 @@ void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer)
continue;
list_for_each_entry(producer, &producers, node) {
- if (producer->token == consumer->token) {
+ if (producer->eventfd == consumer->eventfd) {
__disconnect(producer, consumer);
break;
}
}
+ consumer->eventfd = NULL;
list_del(&consumer->node);
module_put(THIS_MODULE);
break;
}
+ WARN_ON_ONCE(consumer->eventfd);
mutex_unlock(&lock);
module_put(THIS_MODULE);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 139/816] vhost-vdpa: drop the parents vq callback before the call fd is released
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (137 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 138/816] irqbypass: Take ownership of producer/consumer token tracking Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 140/816] virtio-blk: clamp max_segments to virtqueue ring size Greg Kroah-Hartman
` (681 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yu Zhang, Michael S. Tsirkin,
Sasha Levin
6.12-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 2e0dbfa0a141f..9e881c4d25ba3 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -765,13 +765,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] 825+ messages in thread
* [PATCH 6.12 140/816] virtio-blk: clamp max_segments to virtqueue ring size
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (138 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 139/816] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 141/816] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
` (680 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stjepan Poljak, Sergii Ushakov,
Michael S. Tsirkin, Sasha Levin
6.12-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 43884773dc3a8..81d9ac1c4869d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1021,6 +1021,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];
}
@@ -1247,7 +1271,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,
@@ -1261,6 +1285,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;
@@ -1460,6 +1501,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] 825+ messages in thread
* [PATCH 6.12 141/816] virtio_blk: Reset device on probe error paths after DRIVER_OK
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (139 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 140/816] virtio-blk: clamp max_segments to virtqueue ring size Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 142/816] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
` (679 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuho Choi, Stefan Hajnoczi,
Michael S. Tsirkin, Sasha Levin
6.12-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 81d9ac1c4869d..8b01011599a78 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1584,6 +1584,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] 825+ messages in thread
* [PATCH 6.12 142/816] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (140 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 141/816] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 143/816] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
` (678 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Konrad Dybcio,
Mark Brown, Sasha Levin
6.12-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 39297f7d81771..b2201d1bddc9f 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -1101,6 +1101,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 d66a0f61637e1..05fe8ba0e7663 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. */
@@ -1332,6 +1332,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;
@@ -2509,7 +2517,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;
@@ -2528,12 +2537,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] 825+ messages in thread
* [PATCH 6.12 143/816] net: sparx5/lan969x: release the in-flight slot of a stale TX skb
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (141 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 142/816] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 144/816] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev Greg Kroah-Hartman
` (677 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Machon, Simon Horman,
Paolo Abeni, Sasha Levin
6.12-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 6b2dbfbeef377..7e665e0892021 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
@@ -200,9 +200,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);
@@ -213,8 +214,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,
@@ -222,6 +226,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);
@@ -232,9 +237,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] 825+ messages in thread
* [PATCH 6.12 144/816] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (142 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 143/816] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 145/816] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
` (676 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
[ Upstream commit 2707a028c9b9c54a6dff22c9dcfebf3083ea095e ]
Instead of repeatedly dereferencing pdev, just store the address of the
embedded struct device in a local variable and use it instead for
improved readability.
While at it: rearrange variable declarations.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20241009162910.33477-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Stable-dep-of: 9e4b35c95fed ("gpio: mpc8xxx: Fix potential use-after-free of IRQ domain")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mpc8xxx.c | 48 +++++++++++++++++--------------------
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index 685ec31db409d..30f36f94ba1b8 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -300,14 +300,15 @@ static const struct of_device_id mpc8xxx_gpio_ids[] = {
static int mpc8xxx_probe(struct platform_device *pdev)
{
+ const struct mpc8xxx_gpio_devtype *devtype = NULL;
struct device_node *np = pdev->dev.of_node;
struct mpc8xxx_gpio_chip *mpc8xxx_gc;
- struct gpio_chip *gc;
- const struct mpc8xxx_gpio_devtype *devtype = NULL;
+ struct device *dev = &pdev->dev;
struct fwnode_handle *fwnode;
+ struct gpio_chip *gc;
int ret;
- mpc8xxx_gc = devm_kzalloc(&pdev->dev, sizeof(*mpc8xxx_gc), GFP_KERNEL);
+ mpc8xxx_gc = devm_kzalloc(dev, sizeof(*mpc8xxx_gc), GFP_KERNEL);
if (!mpc8xxx_gc)
return -ENOMEM;
@@ -320,32 +321,28 @@ static int mpc8xxx_probe(struct platform_device *pdev)
return PTR_ERR(mpc8xxx_gc->regs);
gc = &mpc8xxx_gc->gc;
- gc->parent = &pdev->dev;
-
- if (device_property_read_bool(&pdev->dev, "little-endian")) {
- ret = bgpio_init(gc, &pdev->dev, 4,
- mpc8xxx_gc->regs + GPIO_DAT,
- NULL, NULL,
- mpc8xxx_gc->regs + GPIO_DIR, NULL,
- BGPIOF_BIG_ENDIAN);
+ gc->parent = dev;
+
+ if (device_property_read_bool(dev, "little-endian")) {
+ ret = bgpio_init(gc, dev, 4, mpc8xxx_gc->regs + GPIO_DAT,
+ NULL, NULL, mpc8xxx_gc->regs + GPIO_DIR,
+ NULL, BGPIOF_BIG_ENDIAN);
if (ret)
return ret;
- dev_dbg(&pdev->dev, "GPIO registers are LITTLE endian\n");
+ dev_dbg(dev, "GPIO registers are LITTLE endian\n");
} else {
- ret = bgpio_init(gc, &pdev->dev, 4,
- mpc8xxx_gc->regs + GPIO_DAT,
- NULL, NULL,
- mpc8xxx_gc->regs + GPIO_DIR, NULL,
- BGPIOF_BIG_ENDIAN
+ ret = bgpio_init(gc, dev, 4, mpc8xxx_gc->regs + GPIO_DAT,
+ NULL, NULL, mpc8xxx_gc->regs + GPIO_DIR,
+ NULL, BGPIOF_BIG_ENDIAN
| BGPIOF_BIG_ENDIAN_BYTE_ORDER);
if (ret)
return ret;
- dev_dbg(&pdev->dev, "GPIO registers are BIG endian\n");
+ dev_dbg(dev, "GPIO registers are BIG endian\n");
}
mpc8xxx_gc->direction_output = gc->direction_output;
- devtype = device_get_match_data(&pdev->dev);
+ devtype = device_get_match_data(dev);
if (!devtype)
devtype = &mpc8xxx_gpio_devtype_default;
@@ -370,7 +367,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
* associated input enable must be set (GPIOxGPIE[IEn]=1) to propagate
* the port value to the GPIO Data Register.
*/
- fwnode = dev_fwnode(&pdev->dev);
+ fwnode = dev_fwnode(dev);
if (of_device_is_compatible(np, "fsl,qoriq-gpio") ||
of_device_is_compatible(np, "fsl,ls1028a-gpio") ||
of_device_is_compatible(np, "fsl,ls1088a-gpio") ||
@@ -381,9 +378,9 @@ static int mpc8xxx_probe(struct platform_device *pdev)
gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR);
}
- ret = devm_gpiochip_add_data(&pdev->dev, gc, mpc8xxx_gc);
+ ret = devm_gpiochip_add_data(dev, gc, mpc8xxx_gc);
if (ret) {
- dev_err(&pdev->dev,
+ dev_err(dev,
"GPIO chip registration failed with status %d\n", ret);
return ret;
}
@@ -404,18 +401,17 @@ static int mpc8xxx_probe(struct platform_device *pdev)
gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, 0xffffffff);
gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, 0);
- ret = devm_request_irq(&pdev->dev, mpc8xxx_gc->irqn,
+ ret = devm_request_irq(dev, mpc8xxx_gc->irqn,
mpc8xxx_gpio_irq_cascade,
IRQF_NO_THREAD | IRQF_SHARED, "gpio-cascade",
mpc8xxx_gc);
if (ret) {
- dev_err(&pdev->dev,
- "failed to devm_request_irq(%d), ret = %d\n",
+ dev_err(dev, "failed to devm_request_irq(%d), ret = %d\n",
mpc8xxx_gc->irqn, ret);
goto err;
}
- device_init_wakeup(&pdev->dev, true);
+ device_init_wakeup(dev, true);
return 0;
err:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 145/816] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (143 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 144/816] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 146/816] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
` (675 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Bartosz Golaszewski,
Sasha Levin
6.12-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 30f36f94ba1b8..b99917d834d6a 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -298,6 +298,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;
@@ -378,6 +386,11 @@ static int mpc8xxx_probe(struct platform_device *pdev)
gc->read_reg(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,
@@ -408,25 +421,20 @@ 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;
}
device_init_wakeup(dev, true);
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] 825+ messages in thread
* [PATCH 6.12 146/816] net/iucv: take a private, writable frame before rewriting it in place
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (144 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 145/816] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 147/816] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
` (674 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bryam Vargas, Simon Horman,
Paolo Abeni, Sasha Levin
6.12-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 c7017ab56b1e7..39f82cdbd1bb8 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -2071,11 +2071,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] 825+ messages in thread
* [PATCH 6.12 147/816] ASoC: meson: axg-fifo: request the irq with the clock enabled
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (145 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 146/816] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 148/816] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
` (673 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jerome Brunet, Mark Brown,
Sasha Levin
6.12-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] 825+ messages in thread
* [PATCH 6.12 148/816] Bluetooth: hci_core: Initialize IRK before publication
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (146 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 147/816] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 149/816] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
` (672 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 3a713084fd534..5d1acf534a796 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1353,9 +1353,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(sizeof(*irk), GFP_KERNEL);
if (!irk)
@@ -1364,12 +1365,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] 825+ messages in thread
* [PATCH 6.12 149/816] Bluetooth: hci_core: Initialize link key before publication
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (147 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 148/816] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 150/816] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
` (671 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 5d1acf534a796..ddd0bbaf247e0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1290,7 +1290,6 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
key = kzalloc(sizeof(*key), GFP_KERNEL);
if (!key)
return NULL;
- list_add_rcu(&key->list, &hdev->link_keys);
}
BT_DBG("%s key for %pMR type %u", hdev->name, bdaddr, type);
@@ -1314,6 +1313,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] 825+ messages in thread
* [PATCH 6.12 150/816] Bluetooth: hci_core: Initialize LTK before publication
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (148 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 149/816] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 151/816] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
` (670 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Binbin Deng, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 ddd0bbaf247e0..c7529bcc9f0e0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1337,7 +1337,6 @@ struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
key = kzalloc(sizeof(*key), GFP_KERNEL);
if (!key)
return NULL;
- list_add_rcu(&key->list, &hdev->long_term_keys);
}
bacpy(&key->bdaddr, bdaddr);
@@ -1349,6 +1348,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] 825+ messages in thread
* [PATCH 6.12 151/816] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (149 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 150/816] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 152/816] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
` (669 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+2344fb8002f3ef5b1712,
Akhil Arul, Luiz Augusto von Dentz, Sasha Levin
6.12-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 c7529bcc9f0e0..4890498036049 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2962,8 +2962,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;
}
@@ -2996,6 +3002,7 @@ int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
case HCI_ISODATA_PKT:
break;
default:
+ rcu_read_unlock();
kfree_skb(skb);
return -EINVAL;
}
@@ -3009,6 +3016,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 fdf073a8f8b9b..b29d996feab6b 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -5508,6 +5508,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] 825+ messages in thread
* [PATCH 6.12 152/816] Bluetooth: btintel: fix buffer over-read in fw payload
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (150 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 151/816] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 153/816] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
` (668 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Catherine L, Kiran K,
Luiz Augusto von Dentz, Sasha Levin
6.12-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 ceca209be40bf..7cbc9aaf85ce5 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -1081,7 +1081,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] 825+ messages in thread
* [PATCH 6.12 153/816] Bluetooth: hci_event: Clear explicit connect state on LE connection
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (151 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 152/816] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 154/816] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding Greg Kroah-Hartman
` (667 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 602b5be7eccc8..c1d1614581a29 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1450,8 +1450,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 bd30c00269698..533a534d78867 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5862,6 +5862,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;
+ }
+ }
}
unlock:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 154/816] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (152 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 153/816] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 155/816] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU Greg Kroah-Hartman
` (666 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hao Qin, Wenlong Tian, Chris Lu,
Luiz Augusto von Dentz, Sasha Levin
6.12-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 0444804a472cf..212177d7773ee 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>
@@ -1176,6 +1177,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;
@@ -1199,6 +1208,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] 825+ messages in thread
* [PATCH 6.12 155/816] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (153 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 154/816] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 156/816] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD Greg Kroah-Hartman
` (665 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hao Qin, Wenlong Tian, Chris Lu,
Luiz Augusto von Dentz, Sasha Levin
6.12-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 212177d7773ee..c1a73ace94938 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -1168,8 +1168,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;
@@ -1185,7 +1192,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;
@@ -1219,7 +1227,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] 825+ messages in thread
* [PATCH 6.12 156/816] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (154 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 155/816] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 157/816] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock Greg Kroah-Hartman
` (664 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Lu, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 c1a73ace94938..cff351968d610 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];
@@ -1352,7 +1352,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;
@@ -1367,7 +1367,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] 825+ messages in thread
* [PATCH 6.12 157/816] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (155 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 156/816] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 158/816] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
` (663 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 b29d996feab6b..ddfa09b8176a1 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2923,6 +2923,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)
{
@@ -2953,7 +2978,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;
@@ -3018,20 +3042,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();
@@ -3039,14 +3070,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] 825+ messages in thread
* [PATCH 6.12 158/816] Bluetooth: hci_sync: Protect resolving-list lookups
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (156 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 157/816] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 159/816] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
` (662 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 ddfa09b8176a1..c6ae135f1b3b6 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2491,15 +2491,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 (!use_ll_privacy(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;
@@ -2555,8 +2557,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 (!use_ll_privacy(hdev))
return 0;
@@ -2578,10 +2580,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] 825+ messages in thread
* [PATCH 6.12 159/816] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (157 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 158/816] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 160/816] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
` (661 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shuai Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 c883d3da19030..a9570bd4f33dd 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -303,6 +303,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;
@@ -5652,8 +5654,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] 825+ messages in thread
* [PATCH 6.12 160/816] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (158 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 159/816] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 161/816] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init() Greg Kroah-Hartman
` (660 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tobias Wilken,
Luiz Augusto von Dentz, Sasha Levin
6.12-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 a9570bd4f33dd..ec54d383510f4 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -305,6 +305,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] 825+ messages in thread
* [PATCH 6.12 161/816] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (159 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 160/816] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 162/816] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
` (659 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ismail Tarim, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 cff351968d610..a01cfbe72d224 100644
--- a/drivers/bluetooth/btmtk.c
+++ b/drivers/bluetooth/btmtk.c
@@ -1358,7 +1358,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) {
@@ -1370,6 +1372,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] 825+ messages in thread
* [PATCH 6.12 162/816] Bluetooth: hci_core: Keep link-key filtering inside RCU
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (160 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 161/816] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 163/816] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
` (658 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 4890498036049..d36493ab31329 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1111,17 +1111,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] 825+ messages in thread
* [PATCH 6.12 163/816] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (161 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 162/816] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 164/816] Bluetooth: MGMT: Clear disabled connection parameters when loading none Greg Kroah-Hartman
` (657 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 c6ae135f1b3b6..d0ae0e01c52f7 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2575,9 +2575,17 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
goto done;
}
+ 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);
@@ -2589,7 +2597,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] 825+ messages in thread
* [PATCH 6.12 164/816] Bluetooth: MGMT: Clear disabled connection parameters when loading none
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (162 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 163/816] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 165/816] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
` (656 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 ec54d383510f4..6405c41f8ceec 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -8243,7 +8243,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] 825+ messages in thread
* [PATCH 6.12 165/816] Bluetooth: hci_core: Initialize advertising RPA work only once
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (163 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 164/816] Bluetooth: MGMT: Clear disabled connection parameters when loading none Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 166/816] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
` (655 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 d36493ab31329..c8b4630bb5563 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1738,6 +1738,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;
@@ -1774,8 +1777,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] 825+ messages in thread
* [PATCH 6.12 166/816] Bluetooth: validate retained LE Create CIS command length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (164 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 165/816] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 167/816] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
` (654 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yifan Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 f846865db0ca4..b023f0870efaa 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2292,6 +2292,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 c8b4630bb5563..1ad2ea661e908 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3179,7 +3179,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;
@@ -3191,23 +3192,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 533a534d78867..e408c0e1d58bc 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4293,6 +4293,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);
@@ -4300,10 +4301,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] 825+ messages in thread
* [PATCH 6.12 167/816] Bluetooth: validate retained LE Set CIG Parameters command length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (165 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 166/816] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 168/816] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery Greg Kroah-Hartman
` (653 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yifan Zhang, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 e408c0e1d58bc..9e5b71786122e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3843,13 +3843,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] 825+ messages in thread
* [PATCH 6.12 168/816] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (166 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 167/816] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 169/816] mctp i3c: Fix locking in an error path Greg Kroah-Hartman
` (652 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 9e5b71786122e..1fb641656fe0a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1759,6 +1759,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) {
@@ -1788,10 +1790,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 &&
test_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks) &&
!test_bit(HCI_INQUIRY, &hdev->flags) &&
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index d0ae0e01c52f7..e51af37b10152 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) {
@@ -5763,11 +5773,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 {
@@ -6403,6 +6417,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 6405c41f8ceec..fa91db7dab4f4 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6320,12 +6320,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] 825+ messages in thread
* [PATCH 6.12 169/816] mctp i3c: Fix locking in an error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (167 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 168/816] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 170/816] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server Greg Kroah-Hartman
` (651 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leo Yang, Paolo Abeni, Jeremy Kerr,
Matt Johnston, netdev, Bart Van Assche, Sasha Levin
6.12-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 dd74f916e3172..7b8f41ec3012c 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] 825+ messages in thread
* [PATCH 6.12 170/816] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (168 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 169/816] mctp i3c: Fix locking in an error path Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 171/816] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
` (650 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aaditya Kansal, Namjae Jeon,
Steve French, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaditya Kansal <aadityakansal390@gmail.com>
[ Upstream commit e4442b2e95baf0901830c924d0a197b100aca970 ]
Add STATUS_INFO_LENGTH_MISMATCH mapping to EMSGSIZE.
Currently, STATUS_INFO_LENGTH_MISMATCH has no mapping to any error code,
making it difficult to distinguish between invalid parameters and length
mismatch.
Map STATUS_INFO_LENGTH_MISMATCH to EMSGSIZE while keeping the EINVAL for
invalid parameters. Although the buf_len check only checks for buf_size
being less than required, there was no error code for lower buf_size.
Hence, EMSGSIZE is used.
Signed-off-by: Aaditya Kansal <aadityakansal390@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Stable-dep-of: e49296d51ccb ("ksmbd: require NUL-terminated EA names")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index f5587687dd6a4..688f78254b7bf 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6714,7 +6714,6 @@ static int set_file_mode_info(struct ksmbd_file *fp,
* @share: ksmbd_share_config pointer
*
* Return: 0 on success, otherwise error
- * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH
*/
static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
struct smb2_set_info_req *req,
@@ -6727,14 +6726,14 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_BASIC_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_basic_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_basic_info(fp, (struct smb2_file_basic_info *)buffer, share);
}
case FILE_ALLOCATION_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_alloc_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_allocation_info(work, fp,
(struct smb2_file_alloc_info *)buffer);
@@ -6742,7 +6741,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_END_OF_FILE_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_eof_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_end_of_file_info(work, fp,
(struct smb2_file_eof_info *)buffer);
@@ -6750,7 +6749,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_RENAME_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_rename_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_rename_info(work, fp,
(struct smb2_file_rename_info *)buffer,
@@ -6761,7 +6760,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
struct smb2_file_link_info *file_info;
if (buf_len < sizeof(struct smb2_file_link_info))
- return -EINVAL;
+ return -EMSGSIZE;
file_info = (struct smb2_file_link_info *)buffer;
if (file_info->ReplaceIfExists && !(fp->daccess & FILE_DELETE_LE)) {
@@ -6776,7 +6775,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_DISPOSITION_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_disposition_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_disposition_info(work, fp,
(struct smb2_file_disposition_info *)buffer);
@@ -6790,7 +6789,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
}
if (buf_len < sizeof(struct smb2_ea_info))
- return -EINVAL;
+ return -EMSGSIZE;
return smb2_set_ea((struct smb2_ea_info *)buffer,
buf_len, &fp->filp->f_path, true);
@@ -6798,14 +6797,14 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
case FILE_POSITION_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_pos_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_position_info(fp, (struct smb2_file_pos_info *)buffer);
}
case FILE_MODE_INFORMATION:
{
if (buf_len < sizeof(struct smb2_file_mode_info))
- return -EINVAL;
+ return -EMSGSIZE;
return set_file_mode_info(fp, (struct smb2_file_mode_info *)buffer);
}
@@ -6913,6 +6912,8 @@ int smb2_set_info(struct ksmbd_work *work)
rsp->hdr.Status = STATUS_ACCESS_DENIED;
else if (rc == -EINVAL)
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
+ else if (rc == -EMSGSIZE)
+ rsp->hdr.Status = STATUS_INFO_LENGTH_MISMATCH;
else if (rc == -ESHARE)
rsp->hdr.Status = STATUS_SHARING_VIOLATION;
else if (rc == -ENOENT)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 171/816] ksmbd: require NUL-terminated EA names
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (169 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 170/816] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 172/816] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
` (649 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Yifan Zhang,
Sasha Levin
6.12-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 688f78254b7bf..e65fe5858a51d 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2460,6 +2460,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,
@@ -3924,6 +3929,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) {
@@ -6912,6 +6919,8 @@ int smb2_set_info(struct ksmbd_work *work)
rsp->hdr.Status = STATUS_ACCESS_DENIED;
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 == -ESHARE)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 172/816] soreuseport: annotate data-races around reuse->socks[] and num_socks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (170 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 171/816] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 173/816] power: sequencing: qcom-wcn: improve support for wcn6855 Greg Kroah-Hartman
` (648 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kuniyuki Iwashima, Eric Dumazet,
Jiayuan Chen, Paolo Abeni, Sasha Levin
6.12-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 4211710393a8a..d4b7caf86eee3 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] 825+ messages in thread
* [PATCH 6.12 173/816] power: sequencing: qcom-wcn: improve support for wcn6855
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (171 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 172/816] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 174/816] power: sequencing: qcom-wcn: increase WCN7850 power-up delay Greg Kroah-Hartman
` (647 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov,
Bartosz Golaszewski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
[ Upstream commit bd4c8bafcf50b6bd415c8bf04e98ebfba78071f9 ]
WCN6855 (also known as QCA6490) is similar to the already supported
QCA6390 but takes in two more supplies so add a new vregs list for it.
On sm8450-hdk it also requires a short assert of the xo-clk pin so add
handling for it in a dedicated unit.
As we now have a separate set of targets for this variant, store the
pointer to the targets struct associated with a model in the device
match data.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20241018-sc8280xp-pwrseq-v6-2-8da8310d9564@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Stable-dep-of: bd60a639b621 ("power: sequencing: qcom-wcn: increase WCN7850 power-up delay")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/sequencing/pwrseq-qcom-wcn.c | 101 ++++++++++++++++++++-
1 file changed, 98 insertions(+), 3 deletions(-)
diff --git a/drivers/power/sequencing/pwrseq-qcom-wcn.c b/drivers/power/sequencing/pwrseq-qcom-wcn.c
index 4fa129877d7e4..682a9beac69eb 100644
--- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
+++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
@@ -22,6 +22,7 @@ struct pwrseq_qcom_wcn_pdata {
size_t num_vregs;
unsigned int pwup_delay_ms;
unsigned int gpio_enable_delay_ms;
+ const struct pwrseq_target_data **targets;
};
struct pwrseq_qcom_wcn_ctx {
@@ -31,6 +32,7 @@ struct pwrseq_qcom_wcn_ctx {
struct regulator_bulk_data *regs;
struct gpio_desc *bt_gpio;
struct gpio_desc *wlan_gpio;
+ struct gpio_desc *xo_clk_gpio;
struct clk *clk;
unsigned long last_gpio_enable_jf;
};
@@ -98,6 +100,33 @@ static const struct pwrseq_unit_data *pwrseq_qcom_wcn_unit_deps[] = {
NULL
};
+static int pwrseq_qcom_wcn6855_clk_assert(struct pwrseq_device *pwrseq)
+{
+ struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
+
+ if (!ctx->xo_clk_gpio)
+ return 0;
+
+ msleep(1);
+
+ gpiod_set_value_cansleep(ctx->xo_clk_gpio, 1);
+ usleep_range(100, 200);
+
+ return 0;
+}
+
+static const struct pwrseq_unit_data pwrseq_qcom_wcn6855_xo_clk_assert = {
+ .name = "xo-clk-assert",
+ .enable = pwrseq_qcom_wcn6855_clk_assert,
+};
+
+static const struct pwrseq_unit_data *pwrseq_qcom_wcn6855_unit_deps[] = {
+ &pwrseq_qcom_wcn_vregs_unit_data,
+ &pwrseq_qcom_wcn_clk_unit_data,
+ &pwrseq_qcom_wcn6855_xo_clk_assert,
+ NULL
+};
+
static int pwrseq_qcom_wcn_bt_enable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
@@ -125,6 +154,13 @@ static const struct pwrseq_unit_data pwrseq_qcom_wcn_bt_unit_data = {
.disable = pwrseq_qcom_wcn_bt_disable,
};
+static const struct pwrseq_unit_data pwrseq_qcom_wcn6855_bt_unit_data = {
+ .name = "wlan-enable",
+ .deps = pwrseq_qcom_wcn6855_unit_deps,
+ .enable = pwrseq_qcom_wcn_bt_enable,
+ .disable = pwrseq_qcom_wcn_bt_disable,
+};
+
static int pwrseq_qcom_wcn_wlan_enable(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
@@ -152,6 +188,13 @@ static const struct pwrseq_unit_data pwrseq_qcom_wcn_wlan_unit_data = {
.disable = pwrseq_qcom_wcn_wlan_disable,
};
+static const struct pwrseq_unit_data pwrseq_qcom_wcn6855_wlan_unit_data = {
+ .name = "wlan-enable",
+ .deps = pwrseq_qcom_wcn6855_unit_deps,
+ .enable = pwrseq_qcom_wcn_wlan_enable,
+ .disable = pwrseq_qcom_wcn_wlan_disable,
+};
+
static int pwrseq_qcom_wcn_pwup_delay(struct pwrseq_device *pwrseq)
{
struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
@@ -162,6 +205,18 @@ static int pwrseq_qcom_wcn_pwup_delay(struct pwrseq_device *pwrseq)
return 0;
}
+static int pwrseq_qcom_wcn6855_xo_clk_deassert(struct pwrseq_device *pwrseq)
+{
+ struct pwrseq_qcom_wcn_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
+
+ if (ctx->xo_clk_gpio) {
+ usleep_range(2000, 5000);
+ gpiod_set_value_cansleep(ctx->xo_clk_gpio, 0);
+ }
+
+ return pwrseq_qcom_wcn_pwup_delay(pwrseq);
+}
+
static const struct pwrseq_target_data pwrseq_qcom_wcn_bt_target_data = {
.name = "bluetooth",
.unit = &pwrseq_qcom_wcn_bt_unit_data,
@@ -174,12 +229,30 @@ static const struct pwrseq_target_data pwrseq_qcom_wcn_wlan_target_data = {
.post_enable = pwrseq_qcom_wcn_pwup_delay,
};
+static const struct pwrseq_target_data pwrseq_qcom_wcn6855_bt_target_data = {
+ .name = "bluetooth",
+ .unit = &pwrseq_qcom_wcn6855_bt_unit_data,
+ .post_enable = pwrseq_qcom_wcn6855_xo_clk_deassert,
+};
+
+static const struct pwrseq_target_data pwrseq_qcom_wcn6855_wlan_target_data = {
+ .name = "wlan",
+ .unit = &pwrseq_qcom_wcn6855_wlan_unit_data,
+ .post_enable = pwrseq_qcom_wcn6855_xo_clk_deassert,
+};
+
static const struct pwrseq_target_data *pwrseq_qcom_wcn_targets[] = {
&pwrseq_qcom_wcn_bt_target_data,
&pwrseq_qcom_wcn_wlan_target_data,
NULL
};
+static const struct pwrseq_target_data *pwrseq_qcom_wcn6855_targets[] = {
+ &pwrseq_qcom_wcn6855_bt_target_data,
+ &pwrseq_qcom_wcn6855_wlan_target_data,
+ NULL
+};
+
static const char *const pwrseq_qca6390_vregs[] = {
"vddio",
"vddaon",
@@ -196,13 +269,28 @@ static const struct pwrseq_qcom_wcn_pdata pwrseq_qca6390_of_data = {
.num_vregs = ARRAY_SIZE(pwrseq_qca6390_vregs),
.pwup_delay_ms = 60,
.gpio_enable_delay_ms = 100,
+ .targets = pwrseq_qcom_wcn_targets,
+};
+
+static const char *const pwrseq_wcn6855_vregs[] = {
+ "vddio",
+ "vddaon",
+ "vddpmu",
+ "vddpmumx",
+ "vddpmucx",
+ "vddrfa0p95",
+ "vddrfa1p3",
+ "vddrfa1p9",
+ "vddpcie1p3",
+ "vddpcie1p9",
};
static const struct pwrseq_qcom_wcn_pdata pwrseq_wcn6855_of_data = {
- .vregs = pwrseq_qca6390_vregs,
- .num_vregs = ARRAY_SIZE(pwrseq_qca6390_vregs),
+ .vregs = pwrseq_wcn6855_vregs,
+ .num_vregs = ARRAY_SIZE(pwrseq_wcn6855_vregs),
.pwup_delay_ms = 50,
.gpio_enable_delay_ms = 5,
+ .targets = pwrseq_qcom_wcn6855_targets,
};
static const char *const pwrseq_wcn7850_vregs[] = {
@@ -219,6 +307,7 @@ 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,
+ .targets = pwrseq_qcom_wcn_targets,
};
static int pwrseq_qcom_wcn_match(struct pwrseq_device *pwrseq,
@@ -295,6 +384,12 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(ctx->wlan_gpio),
"Failed to get the WLAN enable GPIO\n");
+ ctx->xo_clk_gpio = devm_gpiod_get_optional(dev, "xo-clk",
+ GPIOD_OUT_LOW);
+ if (IS_ERR(ctx->xo_clk_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->xo_clk_gpio),
+ "Failed to get the XO_CLK GPIO\n");
+
/*
* Set direction to output but keep the current value in order to not
* disable the WLAN module accidentally if it's already powered on.
@@ -313,7 +408,7 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev)
config.owner = THIS_MODULE;
config.drvdata = ctx;
config.match = pwrseq_qcom_wcn_match;
- config.targets = pwrseq_qcom_wcn_targets;
+ config.targets = ctx->pdata->targets;
ctx->pwrseq = devm_pwrseq_device_register(dev, &config);
if (IS_ERR(ctx->pwrseq))
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 174/816] power: sequencing: qcom-wcn: increase WCN7850 power-up delay
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (172 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 173/816] power: sequencing: qcom-wcn: improve support for wcn6855 Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 175/816] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
` (646 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cheng Jiang, Shuai Zhang,
Dmitry Baryshkov, Bartosz Golaszewski, Sasha Levin
6.12-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 682a9beac69eb..63ffa4d74425c 100644
--- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
+++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
@@ -306,7 +306,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] 825+ messages in thread
* [PATCH 6.12 175/816] vhost-scsi: validate event queue descriptor direction
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (173 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 174/816] power: sequencing: qcom-wcn: increase WCN7850 power-up delay Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 176/816] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
` (645 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Jia, Linfeng Sun,
Michael S. Tsirkin, Sasha Levin
6.12-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 b8a726e1a2c78..c0129feba00fe 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -488,6 +488,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] 825+ messages in thread
* [PATCH 6.12 176/816] vhost-scsi: reject delayed virtqueue setup
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (174 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 175/816] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 177/816] vhost: reject backend enable without a kick file Greg Kroah-Hartman
` (644 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.12-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 c0129feba00fe..f072e0f7265cc 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1845,6 +1845,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);
@@ -2176,10 +2179,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] 825+ messages in thread
* [PATCH 6.12 177/816] vhost: reject backend enable without a kick file
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (175 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 176/816] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 178/816] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
` (643 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.12-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 42c955a5b2111..997f869284377 100644
--- a/drivers/vhost/test.c
+++ b/drivers/vhost/test.c
@@ -281,6 +281,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] 825+ messages in thread
* [PATCH 6.12 178/816] vhost-vdpa: initialize state before publishing cdev
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (176 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 177/816] vhost: reject backend enable without a kick file Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 179/816] virtio_balloon: initialize wakeup_lock before virtqueues are set up Greg Kroah-Hartman
` (642 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Michael S. Tsirkin,
Sasha Levin
6.12-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 9e881c4d25ba3..011e36847b4ee 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -1703,7 +1703,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;
@@ -1727,16 +1727,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] 825+ messages in thread
* [PATCH 6.12 179/816] virtio_balloon: initialize wakeup_lock before virtqueues are set up
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (177 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 178/816] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 180/816] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
` (641 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+13df72e0dc4be5c62215,
Mingbing Zhai, Michael S. Tsirkin, Sasha Levin
6.12-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 c67b29e5f7999..5a093d8786b7f 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -965,6 +965,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;
@@ -1070,8 +1071,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] 825+ messages in thread
* [PATCH 6.12 180/816] ext2: only flush DIRSYNC directories on every change
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (178 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 179/816] virtio_balloon: initialize wakeup_lock before virtqueues are set up Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 181/816] printk: Allow to use the printk kthread immediately even for 1st nbcon Greg Kroah-Hartman
` (640 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Bacik, Jan Kara, Sasha Levin
6.12-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 402fecf90a44b..9bb1c219c048e 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -441,6 +441,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] 825+ messages in thread
* [PATCH 6.12 181/816] printk: Allow to use the printk kthread immediately even for 1st nbcon
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (179 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 180/816] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 182/816] printk: Avoid multiple unregistration in unregister_console_locked() Greg Kroah-Hartman
` (639 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Cobb, John Ogness,
Petr Mladek, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petr Mladek <pmladek@suse.com>
[ Upstream commit cf5543870186d6f99b631faaeca27beaa996d52f ]
The kthreads for nbcon consoles are created by nbcon_alloc() at
the beginning of the console registration. But it currently works
only for the 2nd or later nbcon console because the code checks
@printk_kthreads_running.
The kthread for the 1st registered nbcon console is created at the very
end of register_console() by printk_kthreads_check_locked(). As a result,
the entire log is replayed synchronously when the "enabled" message
gets printed. It might block the boot for a long time with a slow serial
console.
Prevent the synchronous flush by creating the kthread even for the 1st
nbcon console when it is safe (kthreads ready and no boot consoles).
Also inform printk() to use the kthread by setting
@printk_kthreads_running. Note that the kthreads already must be
running when it is safe and this is not the 1st nbcon console.
Symmetrically, clear @printk_kthreads_running when the last nbcon
console was unregistered by nbcon_free(). This requires updating
@have_nbcon_console before nbcon_free() gets called.
Note that there is _no_ problem when the 1st nbcon console replaces boot
consoles. In this case, the kthread will be started at the end
of registration after the boot consoles are removed. But the console
does not reply the entire log buffer in this case. Note that
the flag CON_PRINTBUFFER is always cleared when the boot consoles are
removed and vice versa.
Closes: https://lore.kernel.org/r/20250514173514.2117832-1-mcobb@thegoodpenguin.co.uk
Tested-by: Michael Cobb <mcobb@thegoodpenguin.co.uk>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Link: https://patch.msgid.link/20250604142045.253301-1-pmladek@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
Stable-dep-of: 8a7f26aa072a ("printk: Avoid multiple unregistration in unregister_console_locked()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/printk/internal.h | 2 ++
kernel/printk/nbcon.c | 26 ++++++++++++++++++++++++--
kernel/printk/printk.c | 20 +++++++++++---------
3 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h
index 53c4b3438a1c6..5dffc4f53e665 100644
--- a/kernel/printk/internal.h
+++ b/kernel/printk/internal.h
@@ -62,6 +62,7 @@ struct dev_printk_info;
extern struct printk_ringbuffer *prb;
extern bool printk_kthreads_running;
+extern bool printk_kthreads_ready;
extern bool debug_non_panic_cpus;
__printf(4, 0)
@@ -177,6 +178,7 @@ static inline void nbcon_kthread_wake(struct console *con)
#define PRINTKRB_RECORD_MAX 0
#define printk_kthreads_running (false)
+#define printk_kthreads_ready (false)
/*
* In !PRINTK builds we still export console_sem
diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index a947b1a75cce3..8cee780155c2e 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -1690,6 +1690,9 @@ bool nbcon_alloc(struct console *con)
{
struct nbcon_state state = { };
+ /* Synchronize the kthread start. */
+ lockdep_assert_console_list_lock_held();
+
/* The write_thread() callback is mandatory. */
if (WARN_ON(!con->write_thread))
return false;
@@ -1720,12 +1723,15 @@ bool nbcon_alloc(struct console *con)
return false;
}
- if (printk_kthreads_running) {
+ if (printk_kthreads_ready && !have_boot_console) {
if (!nbcon_kthread_create(con)) {
kfree(con->pbufs);
con->pbufs = NULL;
return false;
}
+
+ /* Might be the first kthread. */
+ printk_kthreads_running = true;
}
}
@@ -1735,14 +1741,30 @@ bool nbcon_alloc(struct console *con)
/**
* nbcon_free - Free and cleanup the nbcon console specific data
* @con: Console to free/cleanup nbcon data
+ *
+ * Important: @have_nbcon_console must be updated before calling
+ * this function. In particular, it can be set only when there
+ * is still another nbcon console registered.
*/
void nbcon_free(struct console *con)
{
struct nbcon_state state = { };
- if (printk_kthreads_running)
+ /* Synchronize the kthread stop. */
+ lockdep_assert_console_list_lock_held();
+
+ if (printk_kthreads_running) {
nbcon_kthread_stop(con);
+ /* Might be the last nbcon console.
+ *
+ * Do not rely on printk_kthreads_check_locked(). It is not
+ * called in some code paths, see nbcon_free() callers.
+ */
+ if (!have_nbcon_console)
+ printk_kthreads_running = false;
+ }
+
nbcon_state_set(con, &state);
/* Boot consoles share global printk buffers. */
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 72845f87089b6..def877601a867 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3564,7 +3564,7 @@ EXPORT_SYMBOL(console_start);
static int unregister_console_locked(struct console *console);
/* True when system boot is far enough to create printer threads. */
-static bool printk_kthreads_ready __ro_after_init;
+bool printk_kthreads_ready __ro_after_init;
static struct task_struct *printk_legacy_kthread;
@@ -3708,6 +3708,7 @@ static void printk_kthreads_check_locked(void)
if (!printk_kthreads_ready)
return;
+ /* Start or stop the legacy kthread when needed. */
if (have_legacy_console || have_boot_console) {
if (!printk_legacy_kthread &&
force_legacy_kthread() &&
@@ -4199,14 +4200,6 @@ static int unregister_console_locked(struct console *console)
*/
synchronize_srcu(&console_srcu);
- if (console->flags & CON_NBCON)
- nbcon_free(console);
-
- console_sysfs_notify();
-
- if (console->exit)
- res = console->exit(console);
-
/*
* With this console gone, the global flags tracking registered
* console types may have changed. Update them.
@@ -4227,6 +4220,15 @@ static int unregister_console_locked(struct console *console)
if (!found_nbcon_con)
have_nbcon_console = found_nbcon_con;
+ /* @have_nbcon_console must be updated before calling nbcon_free(). */
+ if (console->flags & CON_NBCON)
+ nbcon_free(console);
+
+ console_sysfs_notify();
+
+ if (console->exit)
+ res = console->exit(console);
+
/* Changed console list, may require printer threads to start/stop. */
printk_kthreads_check_locked();
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 182/816] printk: Avoid multiple unregistration in unregister_console_locked()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (180 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 181/816] printk: Allow to use the printk kthread immediately even for 1st nbcon Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 183/816] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
` (638 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, John Ogness, Petr Mladek,
Derek Barbosa, Sasha Levin
6.12-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 def877601a867..f3d897ca6d615 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3696,6 +3696,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)
@@ -4137,7 +4144,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;
@@ -4229,9 +4249,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;
}
@@ -4240,7 +4257,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;
}
@@ -4359,6 +4381,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] 825+ messages in thread
* [PATCH 6.12 183/816] virtio-blk: Fix zone append sector reporting in batched completion
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (181 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 182/816] printk: Avoid multiple unregistration in unregister_console_locked() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 184/816] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
` (637 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Michael S. Tsirkin,
Stefan Hajnoczi, Christoph Hellwig, Jens Axboe, Sasha Levin
6.12-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 8b01011599a78..d4322992debef 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -332,18 +332,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);
}
@@ -1213,8 +1220,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] 825+ messages in thread
* [PATCH 6.12 184/816] block: partitions: reject GPT entries with starting_lba > ending_lba
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (182 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 183/816] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 185/816] block: Replace sprintf() with sysfs_emit() Greg Kroah-Hartman
` (636 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zizhi Wo, Christoph Hellwig,
Jens Axboe, Sasha Levin
6.12-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 7acba66eed481..d88321f6400ab 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -461,6 +461,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] 825+ messages in thread
* [PATCH 6.12 185/816] block: Replace sprintf() with sysfs_emit()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (183 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 184/816] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 186/816] block: report the correct discard alignment in sysfs Greg Kroah-Hartman
` (635 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, zhangguopeng, Christoph Hellwig,
Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: zhangguopeng <zhangguopeng@kylinos.cn>
[ Upstream commit 8e71afb94d6ed59055b67dadbc423c70104f21a9 ]
Per Documentation/filesystems/sysfs.rst, show() should only use
sysfs_emit() or sysfs_emit_at() when formatting the value to be
returned to user space.
No functional change intended.
Signed-off-by: zhangguopeng <zhangguopeng@kylinos.cn>
Suggested-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241107104258.29742-1-zhangguopeng@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 2516f0413f87 ("block: report the correct discard alignment in sysfs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-sysfs.c | 24 ++++++++++++------------
block/genhd.c | 30 +++++++++++++++---------------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index d53ffff112ff2..f21de1898ff15 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -32,7 +32,7 @@ struct queue_sysfs_entry {
static ssize_t
queue_var_show(unsigned long var, char *page)
{
- return sprintf(page, "%lu\n", var);
+ return sysfs_emit(page, "%lu\n", var);
}
static ssize_t
@@ -123,7 +123,7 @@ QUEUE_SYSFS_LIMIT_SHOW(atomic_write_unit_max)
#define QUEUE_SYSFS_LIMIT_SHOW_SECTORS_TO_BYTES(_field) \
static ssize_t queue_##_field##_show(struct gendisk *disk, char *page) \
{ \
- return sprintf(page, "%llu\n", \
+ return sysfs_emit(page, "%llu\n", \
(unsigned long long)disk->queue->limits._field << \
SECTOR_SHIFT); \
}
@@ -146,7 +146,7 @@ QUEUE_SYSFS_LIMIT_SHOW_SECTORS_TO_KB(max_hw_sectors)
#define QUEUE_SYSFS_SHOW_CONST(_name, _val) \
static ssize_t queue_##_name##_show(struct gendisk *disk, char *page) \
{ \
- return sprintf(page, "%d\n", _val); \
+ return sysfs_emit(page, "%d\n", _val); \
}
/* deprecated fields */
@@ -221,7 +221,7 @@ static ssize_t queue_feature_store(struct gendisk *disk, const char *page,
#define QUEUE_SYSFS_FEATURE(_name, _feature) \
static ssize_t queue_##_name##_show(struct gendisk *disk, char *page) \
{ \
- return sprintf(page, "%u\n", \
+ return sysfs_emit(page, "%u\n", \
!!(disk->queue->limits.features & _feature)); \
} \
static int queue_##_name##_store(struct gendisk *disk, \
@@ -238,7 +238,7 @@ QUEUE_SYSFS_FEATURE(stable_writes, BLK_FEAT_STABLE_WRITES);
#define QUEUE_SYSFS_FEATURE_SHOW(_name, _feature) \
static ssize_t queue_##_name##_show(struct gendisk *disk, char *page) \
{ \
- return sprintf(page, "%u\n", \
+ return sysfs_emit(page, "%u\n", \
!!(disk->queue->limits.features & _feature)); \
}
@@ -256,8 +256,8 @@ static ssize_t queue_poll_show(struct gendisk *disk, char *page)
static ssize_t queue_zoned_show(struct gendisk *disk, char *page)
{
if (blk_queue_is_zoned(disk->queue))
- return sprintf(page, "host-managed\n");
- return sprintf(page, "none\n");
+ return sysfs_emit(page, "host-managed\n");
+ return sysfs_emit(page, "none\n");
}
static ssize_t queue_nr_zones_show(struct gendisk *disk, char *page)
@@ -342,7 +342,7 @@ static ssize_t queue_poll_store(struct gendisk *disk, const char *page,
static ssize_t queue_io_timeout_show(struct gendisk *disk, char *page)
{
- return sprintf(page, "%u\n", jiffies_to_msecs(disk->queue->rq_timeout));
+ return sysfs_emit(page, "%u\n", jiffies_to_msecs(disk->queue->rq_timeout));
}
static ssize_t queue_io_timeout_store(struct gendisk *disk, const char *page,
@@ -363,8 +363,8 @@ static ssize_t queue_io_timeout_store(struct gendisk *disk, const char *page,
static ssize_t queue_wc_show(struct gendisk *disk, char *page)
{
if (blk_queue_write_cache(disk->queue))
- return sprintf(page, "write back\n");
- return sprintf(page, "write through\n");
+ return sysfs_emit(page, "write back\n");
+ return sysfs_emit(page, "write through\n");
}
static int queue_wc_store(struct gendisk *disk, const char *page,
@@ -495,9 +495,9 @@ static ssize_t queue_wb_lat_show(struct gendisk *disk, char *page)
return -EINVAL;
if (wbt_disabled(disk->queue))
- return sprintf(page, "0\n");
+ return sysfs_emit(page, "0\n");
- return sprintf(page, "%llu\n",
+ return sysfs_emit(page, "%llu\n",
div_u64(wbt_get_min_lat(disk->queue), 1000));
}
diff --git a/block/genhd.c b/block/genhd.c
index 4063ee78c27bd..f5d082b39fd12 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -772,7 +772,7 @@ static ssize_t disk_badblocks_show(struct device *dev,
struct gendisk *disk = dev_to_disk(dev);
if (!disk->bb)
- return sprintf(page, "\n");
+ return sysfs_emit(page, "\n");
return badblocks_show(disk->bb, page, 0);
}
@@ -932,7 +932,7 @@ static ssize_t disk_range_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", disk->minors);
+ return sysfs_emit(buf, "%d\n", disk->minors);
}
static ssize_t disk_ext_range_show(struct device *dev,
@@ -940,7 +940,7 @@ static ssize_t disk_ext_range_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n",
+ return sysfs_emit(buf, "%d\n",
(disk->flags & GENHD_FL_NO_PART) ? 1 : DISK_MAX_PARTS);
}
@@ -949,7 +949,7 @@ static ssize_t disk_removable_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n",
+ return sysfs_emit(buf, "%d\n",
(disk->flags & GENHD_FL_REMOVABLE ? 1 : 0));
}
@@ -958,7 +958,7 @@ static ssize_t disk_hidden_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n",
+ return sysfs_emit(buf, "%d\n",
(disk->flags & GENHD_FL_HIDDEN ? 1 : 0));
}
@@ -967,13 +967,13 @@ static ssize_t disk_ro_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", get_disk_ro(disk) ? 1 : 0);
+ return sysfs_emit(buf, "%d\n", get_disk_ro(disk) ? 1 : 0);
}
ssize_t part_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return sprintf(buf, "%llu\n", bdev_nr_sectors(dev_to_bdev(dev)));
+ return sysfs_emit(buf, "%llu\n", bdev_nr_sectors(dev_to_bdev(dev)));
}
ssize_t part_stat_show(struct device *dev,
@@ -990,7 +990,7 @@ ssize_t part_stat_show(struct device *dev,
part_stat_unlock();
}
part_stat_read_all(bdev, &stat);
- return sprintf(buf,
+ return sysfs_emit(buf,
"%8lu %8lu %8llu %8u "
"%8lu %8lu %8llu %8u "
"%8u %8u %8u "
@@ -1032,14 +1032,14 @@ ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr,
else
part_in_flight_rw(bdev, inflight);
- return sprintf(buf, "%8u %8u\n", inflight[0], inflight[1]);
+ return sysfs_emit(buf, "%8u %8u\n", inflight[0], inflight[1]);
}
static ssize_t disk_capability_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
dev_warn_once(dev, "the capability attribute has been deprecated.\n");
- return sprintf(buf, "0\n");
+ return sysfs_emit(buf, "0\n");
}
static ssize_t disk_alignment_offset_show(struct device *dev,
@@ -1048,7 +1048,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
+ return sysfs_emit(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
@@ -1057,7 +1057,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
+ return sysfs_emit(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
@@ -1065,13 +1065,13 @@ static ssize_t diskseq_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%llu\n", disk->diskseq);
+ return sysfs_emit(buf, "%llu\n", disk->diskseq);
}
static ssize_t partscan_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return sprintf(buf, "%u\n", disk_has_partscan(dev_to_disk(dev)));
+ return sysfs_emit(buf, "%u\n", disk_has_partscan(dev_to_disk(dev)));
}
static DEVICE_ATTR(range, 0444, disk_range_show, NULL);
@@ -1093,7 +1093,7 @@ static DEVICE_ATTR(partscan, 0444, partscan_show, NULL);
ssize_t part_fail_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- return sprintf(buf, "%d\n",
+ return sysfs_emit(buf, "%d\n",
bdev_test_flag(dev_to_bdev(dev), BD_MAKE_IT_FAIL));
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 186/816] block: report the correct discard alignment in sysfs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (184 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 185/816] block: Replace sprintf() with sysfs_emit() Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 187/816] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
` (634 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Christoph Hellwig,
Jens Axboe, Sasha Levin
6.12-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 f5d082b39fd12..4d396b194a270 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1057,7 +1057,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] 825+ messages in thread
* [PATCH 6.12 187/816] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (185 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 186/816] block: report the correct discard alignment in sysfs Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 188/816] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
` (633 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nguyen Dinh Phi, Stefano Garzarella,
Bobby Eshleman, Paolo Abeni, Sasha Levin
6.12-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 999cccb323f79..4a790db5d01b3 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1941,7 +1941,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] 825+ messages in thread
* [PATCH 6.12 188/816] null_blk: fix opening closed zones at the active zone limit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (186 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 187/816] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 189/816] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
` (632 subsequent siblings)
820 siblings, 0 replies; 825+ 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,
Jens Axboe, Sasha Levin
6.12-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 887915340fa8e..badedb4769220 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] 825+ messages in thread
* [PATCH 6.12 189/816] null_blk: dont finish zones to set them read-only or offline
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (187 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 188/816] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 190/816] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
` (631 subsequent siblings)
820 siblings, 0 replies; 825+ 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,
Jens Axboe, Sasha Levin
6.12-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 badedb4769220..512e3181d5b5a 100644
--- a/drivers/block/null_blk/zoned.c
+++ b/drivers/block/null_blk/zoned.c
@@ -731,6 +731,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.
*/
@@ -747,8 +774,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;
@@ -756,9 +783,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] 825+ messages in thread
* [PATCH 6.12 190/816] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (188 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 189/816] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 191/816] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
` (630 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jiayuan Chen, Kuniyuki Iwashima, Paolo Abeni, Sasha Levin
6.12-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 b42630611afc7..b92f040a3eaab 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -3681,6 +3681,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
@@ -3695,9 +3696,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] 825+ messages in thread
* [PATCH 6.12 191/816] net: dsa: b53: Enable IGMP and MLD control packet CPU copies
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (189 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 190/816] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
@ 2026-11-25 14:28 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 192/816] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
` (629 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:28 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Paolo Abeni,
Sasha Levin
6.12-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 04027cbefddba..1bc00288612c5 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -770,6 +770,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;
@@ -1261,6 +1314,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 e908397e8b9a0..f981537bc0a1b 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -336,6 +336,7 @@ static inline int 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 2dca7dd76eb6b..628fdfae47c84 100644
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -262,6 +262,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 e680fff7d23fb..99b44e20c6fee 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] 825+ messages in thread
* [PATCH 6.12 192/816] net: ethernet: mediatek: preserve sibling PPE bindings
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (190 preceding siblings ...)
2026-11-25 14:28 ` [PATCH 6.12 191/816] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 193/816] nvmet-tcp: ask for the TLS record type on every receive Greg Kroah-Hartman
` (628 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Goodkind, Simon Horman,
Paolo Abeni, Sasha Levin
6.12-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 bb01a7355932a..fc1362cd821cd 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] 825+ messages in thread
* [PATCH 6.12 193/816] nvmet-tcp: ask for the TLS record type on every receive
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (191 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 192/816] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 194/816] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
` (627 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 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
6.12-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 afcc55d5af661..d61b1efbddfa0 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -1346,6 +1346,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] 825+ messages in thread
* [PATCH 6.12 194/816] nvmet-rdma: disconnect only established queues
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (192 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 193/816] nvmet-tcp: ask for the TLS record type on every receive Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 195/816] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
` (626 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.12-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 7e715d0436f8b..7db9812c4e16b 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1689,7 +1689,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);
@@ -1708,6 +1708,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;
@@ -1717,7 +1718,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] 825+ messages in thread
* [PATCH 6.12 195/816] nvmet-tcp: limit the connections accepted per work run
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (193 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 194/816] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 196/816] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
` (625 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 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
6.12-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 d61b1efbddfa0..ab74d36438888 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -86,6 +86,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,
@@ -2090,9 +2091,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)
@@ -2101,6 +2102,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] 825+ messages in thread
* [PATCH 6.12 196/816] nvmet-rdma: take a device off the list last
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (194 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 195/816] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 197/816] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
` (624 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.12-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 7db9812c4e16b..cff39abc4f981 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1198,13 +1198,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] 825+ messages in thread
* [PATCH 6.12 197/816] nvmet-rdma: queue the release work under the mutex
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (195 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 196/816] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 198/816] nvme: fix various comment typos Greg Kroah-Hartman
` (623 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.12-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 cff39abc4f981..78b541a6fb089 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1740,17 +1740,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] 825+ messages in thread
* [PATCH 6.12 198/816] nvme: fix various comment typos
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (196 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 197/816] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 199/816] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
` (622 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bjorn Helgaas, Chaitanya Kulkarni,
Christoph Hellwig, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Helgaas <bhelgaas@google.com>
[ Upstream commit 367c240b0a99c7ada700a44345dd3144a02b6164 ]
Fix typos in comments.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stable-dep-of: a4387799d422 ("nvmet-rdma: disconnect a queue on device removal")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/fc.c | 4 ++--
drivers/nvme/host/tcp.c | 2 +-
drivers/nvme/target/fc.c | 6 +++---
drivers/nvme/target/rdma.c | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 7eb566c6fc557..1cd4bc001f1e6 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -1364,7 +1364,7 @@ nvme_fc_disconnect_assoc_done(struct nvmefc_ls_req *lsreq, int status)
* down, and the related FC-NVME Association ID and Connection IDs
* become invalid.
*
- * The behavior of the fc-nvme initiator is such that it's
+ * The behavior of the fc-nvme initiator is such that its
* understanding of the association and connections will implicitly
* be torn down. The action is implicit as it may be due to a loss of
* connectivity with the fc-nvme target, so you may never get a
@@ -2779,7 +2779,7 @@ nvme_fc_queue_rq(struct blk_mq_hw_ctx *hctx,
* as WRITE ZEROES will return a non-zero rq payload_bytes yet
* there is no actual payload to be transferred.
* To get it right, key data transmission on there being 1 or
- * more physical segments in the sg list. If there is no
+ * more physical segments in the sg list. If there are no
* physical segments, there is no payload.
*/
if (blk_rq_nr_phys_segments(rq)) {
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index c5b0e688fd9af..f6bc2a90592cf 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2438,7 +2438,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
/*
* Only start IO queues for which we have allocated the tagset
- * and limitted it to the available queues. On reconnects, the
+ * and limited it to the available queues. On reconnects, the
* queue number might have changed.
*/
nr_queues = min(ctrl->tagset->nr_hw_queues + 1, ctrl->queue_count);
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index bd2a7f4accfa7..4d77615b55e4a 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -459,7 +459,7 @@ nvmet_fc_disconnect_assoc_done(struct nvmefc_ls_req *lsreq, int status)
* down, and the related FC-NVME Association ID and Connection IDs
* become invalid.
*
- * The behavior of the fc-nvme target is such that it's
+ * The behavior of the fc-nvme target is such that its
* understanding of the association and connections will implicitly
* be torn down. The action is implicit as it may be due to a loss of
* connectivity with the fc-nvme host, so the target may never get a
@@ -2294,7 +2294,7 @@ nvmet_fc_transfer_fcp_data(struct nvmet_fc_tgtport *tgtport,
ret = tgtport->ops->fcp_op(&tgtport->fc_target_port, fod->fcpreq);
if (ret) {
/*
- * should be ok to set w/o lock as its in the thread of
+ * should be ok to set w/o lock as it's in the thread of
* execution (not an async timer routine) and doesn't
* contend with any clearing action
*/
@@ -2612,7 +2612,7 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
* and the api of the FC LLDD which may issue a hw command to send the
* response, but the LLDD may not get the hw completion for that command
* and upcall the nvmet_fc layer before a new command may be
- * asynchronously received - its possible for a command to be received
+ * asynchronously received - it's possible for a command to be received
* before the LLDD and nvmet_fc have recycled the job structure. It gives
* the appearance of more commands received than fits in the sq.
* To alleviate this scenario, a temporary queue is maintained in the
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 78b541a6fb089..970452397b5d5 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1780,7 +1780,7 @@ static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
* 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 implicitely by returning a non-zero rc to the callout.
+ * 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)
@@ -1791,7 +1791,7 @@ static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
/*
* This is a queue cm_id. we have registered
* an ib_client to handle queues removal
- * so don't interfear and just return.
+ * so don't interfere and just return.
*/
return 0;
}
@@ -1809,7 +1809,7 @@ static int nvmet_rdma_device_removal(struct rdma_cm_id *cm_id,
/*
* We need to return 1 so that the core will destroy
- * it's own ID. What a great API design..
+ * its own ID. What a great API design..
*/
return 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 199/816] nvmet-rdma: disconnect a queue on device removal
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (197 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 198/816] nvme: fix various comment typos Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 200/816] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
` (621 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Sagi Grimberg,
Chaitanya Kulkarni, Chris Mason, Jens Axboe, Keith Busch,
Sasha Levin
6.12-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 970452397b5d5..079342828173a 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1777,10 +1777,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)
@@ -1788,11 +1791,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] 825+ messages in thread
* [PATCH 6.12 200/816] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (198 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 199/816] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 201/816] isofs: handle Rock Ridge long-form dates before 1900 Greg Kroah-Hartman
` (620 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Clark, Jacob Keller,
Dave Miller, Sasha Levin
6.12-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 8ffbfaa3ab18c..2e2c22dbb8f93 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] 825+ messages in thread
* [PATCH 6.12 201/816] isofs: handle Rock Ridge long-form dates before 1900
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (199 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 200/816] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 202/816] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
` (619 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Jan Kara, Sasha Levin
6.12-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] 825+ messages in thread
* [PATCH 6.12 202/816] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer.
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (200 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 201/816] isofs: handle Rock Ridge long-form dates before 1900 Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 203/816] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
` (618 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tom Williams, Guillaume Nault,
Kuniyuki Iwashima, Neal Cardwell, Eric Dumazet, Paolo Abeni,
Sasha Levin
6.12-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 e529ecb9b42b8..547adefba7ea9 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -104,7 +104,8 @@ int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
#define FLAG_DSACK_TLP 0x20000 /* DSACK for tail loss probe */
#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)
@@ -3717,11 +3718,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.
@@ -4036,7 +4037,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] 825+ messages in thread
* [PATCH 6.12 203/816] net: skbuff: reject zero MPLS TTL before decrementing
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (201 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 202/816] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 204/816] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
` (617 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Xia Yan, Simon Horman,
Paolo Abeni, Sasha Levin
6.12-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 8bcf153977fb1..fb95a9c627b61 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6643,7 +6643,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] 825+ messages in thread
* [PATCH 6.12 204/816] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (202 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 203/816] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 205/816] ipv6: Flush exception route while replacing nexthop Greg Kroah-Hartman
` (616 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhou Minqiang, Rafael J. Wysocki,
Sasha Levin
6.12-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 291941c22d959..68a871a517bd9 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1887,7 +1887,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] 825+ messages in thread
* [PATCH 6.12 205/816] ipv6: Flush exception route while replacing nexthop.
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (203 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 204/816] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 206/816] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
` (615 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason Zhang, Kuniyuki Iwashima,
Ido Schimmel, Paolo Abeni, Sasha Levin
6.12-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 3af35b9728459..ced56c191dd73 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3721,9 +3721,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);
@@ -3732,7 +3733,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);
@@ -3742,6 +3742,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] 825+ messages in thread
* [PATCH 6.12 206/816] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow().
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (204 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 205/816] ipv6: Flush exception route while replacing nexthop Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 207/816] inet: reduce inet_csk_clone_lock() indent level Greg Kroah-Hartman
` (614 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason Zhang, Kuniyuki Iwashima,
Ido Schimmel, Paolo Abeni, Sasha Levin
6.12-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 64fe59730ed8b..9706d36c8388c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2441,6 +2441,8 @@ out: return err;
if (unlikely(!rt_cache_route(nhc, rth)))
rt_add_uncached_list(rth);
+ } else {
+ rt_add_uncached_list(rth);
}
skb_dst_set(skb, &rth->dst);
err = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 207/816] inet: reduce inet_csk_clone_lock() indent level
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (205 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 206/816] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 208/816] inet: consolidate inet_csk_clone_lock() Greg Kroah-Hartman
` (613 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 55250b83b02aa5ffe602987adb2c05178c87ac63 ]
Return early from inet_csk_clone_lock() if the socket
allocation failed, to reduce the indentation level.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250212131328.1514243-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 8e069fd3fd39 ("tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/inet_connection_sock.c | 50 ++++++++++++++++++---------------
1 file changed, 27 insertions(+), 23 deletions(-)
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 61fbcaa913b35..c78291ea4ff6f 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -1257,39 +1257,43 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
const gfp_t priority)
{
struct sock *newsk = sk_clone_lock(sk, priority);
+ struct inet_connection_sock *newicsk;
- if (newsk) {
- struct inet_connection_sock *newicsk = inet_csk(newsk);
+ if (!newsk)
+ return NULL;
- inet_sk_set_state(newsk, TCP_SYN_RECV);
- newicsk->icsk_bind_hash = NULL;
- newicsk->icsk_bind2_hash = NULL;
+ newicsk = inet_csk(newsk);
- inet_sk(newsk)->inet_dport = inet_rsk(req)->ir_rmt_port;
- inet_sk(newsk)->inet_num = inet_rsk(req)->ir_num;
- inet_sk(newsk)->inet_sport = htons(inet_rsk(req)->ir_num);
+ inet_sk_set_state(newsk, TCP_SYN_RECV);
+ newicsk->icsk_bind_hash = NULL;
+ newicsk->icsk_bind2_hash = NULL;
- /* listeners have SOCK_RCU_FREE, not the children */
- sock_reset_flag(newsk, SOCK_RCU_FREE);
+ inet_sk(newsk)->inet_dport = inet_rsk(req)->ir_rmt_port;
+ inet_sk(newsk)->inet_num = inet_rsk(req)->ir_num;
+ inet_sk(newsk)->inet_sport = htons(inet_rsk(req)->ir_num);
- inet_sk(newsk)->mc_list = NULL;
+ /* listeners have SOCK_RCU_FREE, not the children */
+ sock_reset_flag(newsk, SOCK_RCU_FREE);
- newsk->sk_mark = inet_rsk(req)->ir_mark;
- atomic64_set(&newsk->sk_cookie,
- atomic64_read(&inet_rsk(req)->ir_cookie));
+ inet_sk(newsk)->mc_list = NULL;
- newicsk->icsk_retransmits = 0;
- newicsk->icsk_backoff = 0;
- newicsk->icsk_probes_out = 0;
- newicsk->icsk_probes_tstamp = 0;
+ newsk->sk_mark = inet_rsk(req)->ir_mark;
+ atomic64_set(&newsk->sk_cookie,
+ atomic64_read(&inet_rsk(req)->ir_cookie));
- /* Deinitialize accept_queue to trap illegal accesses. */
- memset(&newicsk->icsk_accept_queue, 0, sizeof(newicsk->icsk_accept_queue));
+ newicsk->icsk_retransmits = 0;
+ newicsk->icsk_backoff = 0;
+ newicsk->icsk_probes_out = 0;
+ newicsk->icsk_probes_tstamp = 0;
- inet_clone_ulp(req, newsk, priority);
+ /* Deinitialize accept_queue to trap illegal accesses. */
+ memset(&newicsk->icsk_accept_queue, 0,
+ sizeof(newicsk->icsk_accept_queue));
+
+ inet_clone_ulp(req, newsk, priority);
+
+ security_inet_csk_clone(newsk, req);
- security_inet_csk_clone(newsk, req);
- }
return newsk;
}
EXPORT_SYMBOL_GPL(inet_csk_clone_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 208/816] inet: consolidate inet_csk_clone_lock()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (206 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 207/816] inet: reduce inet_csk_clone_lock() indent level Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 209/816] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() Greg Kroah-Hartman
` (612 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit a3a128f611a965fddf8a02dd45716f96e0738e00 ]
Current inet_sock_set_state trace from inet_csk_clone_lock() is missing
many details :
... sock:inet_sock_set_state: family=AF_INET6 protocol=IPPROTO_TCP \
sport=4901 dport=0 \
saddr=127.0.0.6 daddr=0.0.0.0 \
saddrv6=:: daddrv6=:: \
oldstate=TCP_LISTEN newstate=TCP_SYN_RECV
Only the sport gives the listener port, no other parts of the n-tuple are correct.
In this patch, I initialize relevant fields of the new socket before
calling inet_sk_set_state(newsk, TCP_SYN_RECV).
We now have a trace including all the source/destination bits.
... sock:inet_sock_set_state: family=AF_INET6 protocol=IPPROTO_TCP \
sport=4901 dport=47648 \
saddr=127.0.0.6 daddr=127.0.0.6 \
saddrv6=2002:a05:6830:1f85:: daddrv6=2001:4860:f803:65::3 \
oldstate=TCP_LISTEN newstate=TCP_SYN_RECV
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250212131328.1514243-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 8e069fd3fd39 ("tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/dccp/ipv4.c | 3 ---
net/dccp/ipv6.c | 9 +++------
net/ipv4/inet_connection_sock.c | 24 ++++++++++++++++++++----
net/ipv4/tcp_ipv4.c | 4 ----
net/ipv6/tcp_ipv6.c | 8 ++------
5 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index b8f5e20368ec5..bf1ac878009d5 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -427,9 +427,6 @@ struct sock *dccp_v4_request_recv_sock(const struct sock *sk,
newinet = inet_sk(newsk);
ireq = inet_rsk(req);
- sk_daddr_set(newsk, ireq->ir_rmt_addr);
- sk_rcv_saddr_set(newsk, ireq->ir_loc_addr);
- newinet->inet_saddr = ireq->ir_loc_addr;
RCU_INIT_POINTER(newinet->inet_opt, rcu_dereference(ireq->ireq_opt));
newinet->mc_index = inet_iif(skb);
newinet->mc_ttl = ip_hdr(skb)->ttl;
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 3c43dd8561f8e..b4c30bc2431c7 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -365,6 +365,9 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
ireq = inet_rsk(req);
ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr;
ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
+ ireq->ir_rmt_addr = LOOPBACK4_IPV6;
+ ireq->ir_loc_addr = LOOPBACK4_IPV6;
+
ireq->ireq_family = AF_INET6;
ireq->ir_mark = inet_request_mark(sk, skb);
@@ -507,10 +510,7 @@ static struct sock *dccp_v6_request_recv_sock(const struct sock *sk,
memcpy(newnp, np, sizeof(struct ipv6_pinfo));
- newsk->sk_v6_daddr = ireq->ir_v6_rmt_addr;
newnp->saddr = ireq->ir_v6_loc_addr;
- newsk->sk_v6_rcv_saddr = ireq->ir_v6_loc_addr;
- newsk->sk_bound_dev_if = ireq->ir_iif;
/* Now IPv6 options...
@@ -549,9 +549,6 @@ static struct sock *dccp_v6_request_recv_sock(const struct sock *sk,
dccp_sync_mss(newsk, dst_mtu(dst));
- newinet->inet_daddr = newinet->inet_saddr = LOOPBACK4_IPV6;
- newinet->inet_rcv_saddr = LOOPBACK4_IPV6;
-
if (__inet_inherit_port(sk, newsk) < 0) {
inet_csk_prepare_forced_close(newsk);
dccp_done(newsk);
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index c78291ea4ff6f..64093410f6d52 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -1258,19 +1258,33 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
{
struct sock *newsk = sk_clone_lock(sk, priority);
struct inet_connection_sock *newicsk;
+ struct inet_request_sock *ireq;
+ struct inet_sock *newinet;
if (!newsk)
return NULL;
newicsk = inet_csk(newsk);
+ newinet = inet_sk(newsk);
+ ireq = inet_rsk(req);
- inet_sk_set_state(newsk, TCP_SYN_RECV);
newicsk->icsk_bind_hash = NULL;
newicsk->icsk_bind2_hash = NULL;
- inet_sk(newsk)->inet_dport = inet_rsk(req)->ir_rmt_port;
- inet_sk(newsk)->inet_num = inet_rsk(req)->ir_num;
- inet_sk(newsk)->inet_sport = htons(inet_rsk(req)->ir_num);
+ newinet->inet_dport = ireq->ir_rmt_port;
+ newinet->inet_num = ireq->ir_num;
+ newinet->inet_sport = htons(ireq->ir_num);
+
+ newsk->sk_bound_dev_if = ireq->ir_iif;
+
+ newsk->sk_daddr = ireq->ir_rmt_addr;
+ newsk->sk_rcv_saddr = ireq->ir_loc_addr;
+ newinet->inet_saddr = ireq->ir_loc_addr;
+
+#if IS_ENABLED(CONFIG_IPV6)
+ newsk->sk_v6_daddr = ireq->ir_v6_rmt_addr;
+ newsk->sk_v6_rcv_saddr = ireq->ir_v6_loc_addr;
+#endif
/* listeners have SOCK_RCU_FREE, not the children */
sock_reset_flag(newsk, SOCK_RCU_FREE);
@@ -1290,6 +1304,8 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
memset(&newicsk->icsk_accept_queue, 0,
sizeof(newicsk->icsk_accept_queue));
+ inet_sk_set_state(newsk, TCP_SYN_RECV);
+
inet_clone_ulp(req, newsk, priority);
security_inet_csk_clone(newsk, req);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index b92f040a3eaab..4d1b3c4602a36 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1770,10 +1770,6 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
newtp = tcp_sk(newsk);
newinet = inet_sk(newsk);
ireq = inet_rsk(req);
- sk_daddr_set(newsk, ireq->ir_rmt_addr);
- sk_rcv_saddr_set(newsk, ireq->ir_loc_addr);
- newsk->sk_bound_dev_if = ireq->ir_iif;
- newinet->inet_saddr = ireq->ir_loc_addr;
inet_opt = rcu_dereference(ireq->ireq_opt);
RCU_INIT_POINTER(newinet->inet_opt, inet_opt);
newinet->mc_index = inet_iif(skb);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index ae2a91e3f15c9..ee4712f7d9708 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -798,6 +798,8 @@ static void tcp_v6_init_req(struct request_sock *req,
ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr;
ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
+ ireq->ir_rmt_addr = LOOPBACK4_IPV6;
+ ireq->ir_loc_addr = LOOPBACK4_IPV6;
/* So that link locals have meaning */
if ((!sk_listener->sk_bound_dev_if || l3_slave) &&
@@ -1439,10 +1441,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
ip6_dst_store(newsk, dst, NULL, false);
- newsk->sk_v6_daddr = ireq->ir_v6_rmt_addr;
newnp->saddr = ireq->ir_v6_loc_addr;
- newsk->sk_v6_rcv_saddr = ireq->ir_v6_loc_addr;
- newsk->sk_bound_dev_if = ireq->ir_iif;
/* Now IPv6 options...
@@ -1493,9 +1492,6 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
tcp_initialize_rcv_mss(newsk);
- newinet->inet_daddr = newinet->inet_saddr = LOOPBACK4_IPV6;
- newinet->inet_rcv_saddr = LOOPBACK4_IPV6;
-
#ifdef CONFIG_TCP_MD5SIG
l3index = l3mdev_master_ifindex_by_index(sock_net(sk), ireq->ir_iif);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 209/816] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (207 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 208/816] inet: consolidate inet_csk_clone_lock() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 210/816] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
` (611 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 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
6.12-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 eb7e36a130cad..00ea96fec2273 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -171,6 +171,9 @@ struct tcp_request_sock {
u8 ao_rcv_next;
bool used_tcp_ao;
#endif
+#if IS_ENABLED(CONFIG_IPV6)
+ __be32 syn_flowlabel;
+#endif
};
static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index ee4712f7d9708..5bd82a5d87960 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -546,8 +546,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) |
@@ -800,6 +800,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] 825+ messages in thread
* [PATCH 6.12 210/816] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (208 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 209/816] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 211/816] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
` (610 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nathan Blomquist, Alex Deucher,
Mario Limonciello, Sasha Levin
6.12-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 7fda517245247..54ab8eb006a86 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
@@ -1549,7 +1549,25 @@ int smu_v11_0_set_azalia_d3_pme(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] 825+ messages in thread
* [PATCH 6.12 211/816] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (209 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 210/816] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 212/816] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
` (609 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Mark Brown,
Sasha Levin
6.12-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 ff1d0793a7ca0..6191cce9a66fe 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -2706,6 +2706,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);
@@ -2750,6 +2751,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] 825+ messages in thread
* [PATCH 6.12 212/816] ACPI: scan: Print the offline failure message in acpi_bus_offline()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (210 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 211/816] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 213/816] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
` (608 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin,
Rafael J. Wysocki
6.12-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 78daad7209a59..440cb9b74a9e2 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -164,8 +164,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;
}
@@ -234,7 +235,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] 825+ messages in thread
* [PATCH 6.12 213/816] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (211 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 212/816] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 214/816] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
` (607 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+cea7285bc17b76ffe39f,
syzbot+a265816368571f78ab88, Sasha Levin, Rafael J. Wysocki
6.12-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 440cb9b74a9e2..477c988a7f330 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -113,11 +113,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) && !pn->dev->offline) {
@@ -132,6 +128,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)
{
@@ -139,6 +188,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;
@@ -151,26 +201,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);
@@ -182,18 +249,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 0f1a84481279e..1aa18a4e846fb 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -363,6 +363,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] 825+ messages in thread
* [PATCH 6.12 214/816] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (212 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 213/816] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 215/816] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
` (606 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Mark Brown,
Sasha Levin
6.12-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 5d5d1c0c9b936..594f9892440fc 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -43,6 +43,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__)
@@ -627,6 +630,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] 825+ messages in thread
* [PATCH 6.12 215/816] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (213 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 214/816] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 216/816] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
` (605 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zijun Hu, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 c1d1614581a29..56276caf655a6 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -331,8 +331,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:
@@ -357,8 +359,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:
@@ -388,8 +392,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] 825+ messages in thread
* [PATCH 6.12 216/816] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (214 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 215/816] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 217/816] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
` (604 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhao Li, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 bab8caf18f204..275454b34366e 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3882,6 +3882,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)
@@ -5137,10 +5138,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
@@ -5370,10 +5371,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] 825+ messages in thread
* [PATCH 6.12 217/816] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (215 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 216/816] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 218/816] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
` (603 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Simon Horman,
Paolo Abeni, Sasha Levin
6.12-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 78f7862ca0066..e6beddeaa8c1c 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 ece93043c506e..c4ee811afb9e6 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1429,11 +1429,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] 825+ messages in thread
* [PATCH 6.12 218/816] net: dsa: b53: restore the NSP IMP port 2 Gbps mode
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (216 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 217/816] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 219/816] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
` (602 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli, Simon Horman,
Paolo Abeni, Sasha Levin
6.12-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 1bc00288612c5..0ad48ef3ecfc9 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1654,9 +1654,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] 825+ messages in thread
* [PATCH 6.12 219/816] Bluetooth: Fix not updating of hdev->commands[] after reset
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (217 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 218/816] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 220/816] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
` (601 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin
6.12-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 1fb641656fe0a..3eea2343f1977 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -781,9 +781,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] 825+ messages in thread
* [PATCH 6.12 220/816] spi: cadence-quadspi: Fix race between DMA completion and transfer start
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (218 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 219/816] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 221/816] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
` (600 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frederic Konrad, Srikanth Boyapally,
Radhey Shyam Pandey, Mark Brown, Sasha Levin
6.12-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 0e387dee17323..90f3a9604ab30 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -932,11 +932,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] 825+ messages in thread
* [PATCH 6.12 221/816] drm/nouveau/fifo: map Kepler video engine contexts non-privileged
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (219 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 220/816] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 222/816] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
` (599 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rosen Penev, Dave Airlie,
Sasha Levin
6.12-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 d8a4d773a58ca..1a5e54f5636ed 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] 825+ messages in thread
* [PATCH 6.12 222/816] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (220 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 221/816] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 223/816] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
` (598 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Munique Feitoza, Dave Airlie,
Sasha Levin
6.12-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 904e236ed5104..38d01bd5f0c82 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -320,6 +320,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;
@@ -332,7 +333,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] 825+ messages in thread
* [PATCH 6.12 223/816] ALSA: hda/core: Stop capability walk on empty capability header
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (221 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 222/816] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 224/816] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
` (597 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michał Kopeć, Takashi Iwai,
Sasha Levin
6.12-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/hdac_controller.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
index b5c833b9f8b9c..5ec0cc3c93abb 100644
--- a/sound/hda/hdac_controller.c
+++ b/sound/hda/hdac_controller.c
@@ -438,6 +438,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");
@@ -468,7 +475,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] 825+ messages in thread
* [PATCH 6.12 224/816] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (222 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 223/816] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 225/816] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
` (596 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Takashi Iwai,
Sasha Levin
6.12-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/pci/hda/cs35l56_hda.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
index 8663de44d97f7..938d49c0b992a 100644
--- a/sound/pci/hda/cs35l56_hda.c
+++ b/sound/pci/hda/cs35l56_hda.c
@@ -742,6 +742,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->base.fw_patched)
cs_dsp_power_down(&cs35l56->cs_dsp);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 225/816] net: 8139cp: keep Rx masked while NAPI is scheduled
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (223 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 224/816] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 226/816] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
` (595 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Colton Pawielski, Daniel Machon,
Paolo Abeni, Sasha Levin
6.12-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] 825+ messages in thread
* [PATCH 6.12 226/816] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (224 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 225/816] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 227/816] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
` (594 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Timur Stukan, Hangbin Liu,
Paolo Abeni, Sasha Levin
6.12-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 4c11fcc2a99fa..75332e50fcc51 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4034,18 +4034,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] 825+ messages in thread
* [PATCH 6.12 227/816] ip6mr: Serialize multicast router socket ownership
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (225 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 226/816] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 228/816] net: stmmac: Unexport stmmac_rx_offset() from stmmac.h Greg Kroah-Hartman
` (593 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Ido Schimmel, Paolo Abeni,
Sasha Levin
6.12-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 0ecb6af344fbc..c608fc0a771aa 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1575,12 +1575,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;
@@ -1596,6 +1604,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;
@@ -1694,7 +1703,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);
@@ -1815,16 +1824,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] 825+ messages in thread
* [PATCH 6.12 228/816] net: stmmac: Unexport stmmac_rx_offset() from stmmac.h
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (226 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 227/816] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 229/816] net: stmmac: Switch to zero-copy in non-XDP RX path Greg Kroah-Hartman
` (592 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Furong Xu, Andrew Lunn, Paolo Abeni,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Furong Xu <0x1207@gmail.com>
[ Upstream commit e62de01008bd6581788aa155ada043cba0261332 ]
stmmac_rx_offset() is referenced in stmmac_main.c only,
let's move it to stmmac_main.c.
Drop the inline keyword by the way, it is better to let the compiler
to decide.
Compile tested only.
No functional change intended.
Signed-off-by: Furong Xu <0x1207@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250107075448.4039925-1-0x1207@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 6d9b7c85af57 ("net: stmmac: set XDP metadata length on the page_pool RX path")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 8 --------
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++++
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 8d6507cef53a9..c087accd72726 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -423,14 +423,6 @@ static inline bool stmmac_xdp_is_enabled(struct stmmac_priv *priv)
return !!priv->xdp_prog;
}
-static inline unsigned int stmmac_rx_offset(struct stmmac_priv *priv)
-{
- if (stmmac_xdp_is_enabled(priv))
- return XDP_PACKET_HEADROOM;
-
- return 0;
-}
-
void stmmac_disable_rx_queue(struct stmmac_priv *priv, u32 queue);
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue);
void stmmac_disable_tx_queue(struct stmmac_priv *priv, u32 queue);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a48c34dcbcd26..c420a449459ed 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1324,6 +1324,14 @@ static void stmmac_display_rings(struct stmmac_priv *priv,
stmmac_display_tx_rings(priv, dma_conf);
}
+static unsigned int stmmac_rx_offset(struct stmmac_priv *priv)
+{
+ if (stmmac_xdp_is_enabled(priv))
+ return XDP_PACKET_HEADROOM;
+
+ return 0;
+}
+
static int stmmac_set_bfsize(int mtu, int bufsize)
{
int ret = bufsize;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 229/816] net: stmmac: Switch to zero-copy in non-XDP RX path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (227 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 228/816] net: stmmac: Unexport stmmac_rx_offset() from stmmac.h Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 230/816] net: stmmac: set XDP metadata length on the page_pool " Greg Kroah-Hartman
` (591 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Furong Xu, Alexander Lobakin,
Larysa Zaremba, Yanteng Si, Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Furong Xu <0x1207@gmail.com>
[ Upstream commit df542f669307918f054a17878ff6dd1ddbb2fe18 ]
Avoid memcpy in non-XDP RX path by marking all allocated SKBs to
be recycled in the upper network stack.
This patch brings ~11.5% driver performance improvement in a TCP RX
throughput test with iPerf tool on a single isolated Cortex-A65 CPU
core, from 2.18 Gbits/sec increased to 2.43 Gbits/sec.
Signed-off-by: Furong Xu <0x1207@gmail.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Yanteng Si <si.yanteng@linux.dev>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 6d9b7c85af57 ("net: stmmac: set XDP metadata length on the page_pool RX path")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 +
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 26 ++++++++++++-------
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index c087accd72726..dcdc4e24002ed 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -125,6 +125,7 @@ struct stmmac_rx_queue {
unsigned int cur_rx;
unsigned int dirty_rx;
unsigned int buf_alloc_num;
+ unsigned int napi_skb_frag_size;
dma_addr_t dma_rx_phy;
u32 rx_tail_addr;
unsigned int state_saved;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c420a449459ed..818722d5dbcba 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1329,7 +1329,7 @@ static unsigned int stmmac_rx_offset(struct stmmac_priv *priv)
if (stmmac_xdp_is_enabled(priv))
return XDP_PACKET_HEADROOM;
- return 0;
+ return NET_SKB_PAD;
}
static int stmmac_set_bfsize(int mtu, int bufsize)
@@ -2030,17 +2030,21 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv,
struct stmmac_channel *ch = &priv->channel[queue];
bool xdp_prog = stmmac_xdp_is_enabled(priv);
struct page_pool_params pp_params = { 0 };
- unsigned int num_pages;
+ unsigned int dma_buf_sz_pad, num_pages;
unsigned int napi_id;
int ret;
+ dma_buf_sz_pad = stmmac_rx_offset(priv) + dma_conf->dma_buf_sz +
+ SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+ num_pages = DIV_ROUND_UP(dma_buf_sz_pad, PAGE_SIZE);
+
rx_q->queue_index = queue;
rx_q->priv_data = priv;
+ rx_q->napi_skb_frag_size = num_pages * PAGE_SIZE;
pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
pp_params.pool_size = dma_conf->dma_rx_size;
- num_pages = DIV_ROUND_UP(dma_conf->dma_buf_sz, PAGE_SIZE);
- pp_params.order = ilog2(num_pages);
+ pp_params.order = order_base_2(num_pages);
pp_params.nid = dev_to_node(priv->device);
pp_params.dev = priv->device;
pp_params.dma_dir = xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE;
@@ -5696,22 +5700,26 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
}
if (!skb) {
+ unsigned int head_pad_len;
+
/* XDP program may expand or reduce tail */
buf1_len = ctx.xdp.data_end - ctx.xdp.data;
- skb = napi_alloc_skb(&ch->rx_napi, buf1_len);
+ skb = napi_build_skb(page_address(buf->page),
+ rx_q->napi_skb_frag_size);
if (!skb) {
+ page_pool_recycle_direct(rx_q->page_pool,
+ buf->page);
rx_dropped++;
count++;
goto drain_data;
}
/* XDP program may adjust header */
- skb_copy_to_linear_data(skb, ctx.xdp.data, buf1_len);
+ head_pad_len = ctx.xdp.data - ctx.xdp.data_hard_start;
+ skb_reserve(skb, head_pad_len);
skb_put(skb, buf1_len);
-
- /* Data payload copied into SKB, page ready for recycle */
- page_pool_recycle_direct(rx_q->page_pool, buf->page);
+ skb_mark_for_recycle(skb);
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] 825+ messages in thread
* [PATCH 6.12 230/816] net: stmmac: set XDP metadata length on the page_pool RX path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (228 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 229/816] net: stmmac: Switch to zero-copy in non-XDP RX path Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 231/816] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
` (590 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Daniel Machon,
Nicolai Buchwitz, Maxime Chevallier, Paolo Abeni, Sasha Levin
6.12-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 818722d5dbcba..16eec53ee9222 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5700,7 +5700,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;
@@ -5716,10 +5716,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] 825+ messages in thread
* [PATCH 6.12 231/816] net: bridge: disable MRP ports before the FDB flush in del_nbp()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (229 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 230/816] net: stmmac: set XDP metadata length on the page_pool " Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 232/816] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
` (589 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ido Schimmel, Cheng Yongkang,
Paolo Abeni, Sasha Levin
6.12-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 eee6ceb7cddab..82447f7071312 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -339,13 +339,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] 825+ messages in thread
* [PATCH 6.12 232/816] tcp: initialize send sequence numbers before deferring TFO
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (230 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 231/816] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 233/816] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
` (588 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qingfang Deng, Eric Dumazet,
Kuniyuki Iwashima, Neal Cardwell, Paolo Abeni, Sasha Levin
6.12-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 fbcd7d8c8d99e..ac4fa51240290 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -455,6 +455,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] 825+ messages in thread
* [PATCH 6.12 233/816] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (231 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 232/816] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 234/816] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
` (587 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laveesh Bansal, Pablo Neira Ayuso,
Sasha Levin
6.12-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 b17962672ebfc..e7603a144538c 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -359,7 +359,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] 825+ messages in thread
* [PATCH 6.12 234/816] netfilter: x_tables: check target name before accessing verdict
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (232 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 233/816] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 235/816] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
` (586 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, VEGA, Fernando Fernandez Mancera,
Pablo Neira Ayuso, Sasha Levin
6.12-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 c68ffde6d615d..9c7c53b22d1bd 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -372,11 +372,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 2411ef91d2962..4320f67df7baa 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 551d3ca1036d7..fb375ce7f916d 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] 825+ messages in thread
* [PATCH 6.12 235/816] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (233 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 234/816] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 236/816] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
` (585 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Fernando Fernandez Mancera, Pablo Neira Ayuso, Sasha Levin
6.12-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 449a6e53feae4..12b8c7fcca640 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -707,9 +707,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] 825+ messages in thread
* [PATCH 6.12 236/816] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (234 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 235/816] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 237/816] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
` (584 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xingyuan Mo, Pablo Neira Ayuso,
Sasha Levin
6.12-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 4b6cb990ab743..7553ebdced1d8 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -599,16 +599,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);
@@ -616,6 +606,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;
}
@@ -4225,8 +4223,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 196dd3c00ad05..7629829c9336e 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] 825+ messages in thread
* [PATCH 6.12 237/816] netfilter: nat: zero newrange before filling it in
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (235 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 236/816] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 238/816] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
` (583 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Westphal, Pablo Neira Ayuso,
Sasha Levin
6.12-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 1a506b0c6511a..2506aace39bcf 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;
@@ -259,6 +258,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 cb2ee80d84fa8..591a6af6c61fa 100644
--- a/net/netfilter/xt_NETMAP.c
+++ b/net/netfilter/xt_NETMAP.c
@@ -42,6 +42,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;
@@ -89,8 +90,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] 825+ messages in thread
* [PATCH 6.12 238/816] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (236 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 237/816] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 239/816] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
` (582 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 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
6.12-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 5bd82a5d87960..431d958272b8d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -575,7 +575,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] 825+ messages in thread
* [PATCH 6.12 239/816] MIPS: Avoid dead code/data elimination when using recordmcount
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (237 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 238/816] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 240/816] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC Greg Kroah-Hartman
` (581 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Thomas Bogendoerfer,
Sasha Levin
6.12-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 b107ce720279a..2df298fcc027d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -80,7 +80,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] 825+ messages in thread
* [PATCH 6.12 240/816] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (238 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 239/816] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 241/816] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
` (580 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Imre Kaloz, Thomas Bogendoerfer,
Sasha Levin
6.12-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 178d61645ceaf..83f49711437cb 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
@@ -130,11 +129,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
@@ -163,17 +165,14 @@ 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_FCRYPT=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_TWOFISH=m
-CONFIG_CRYPTO_CTS=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_VMAC=m
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 241/816] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (239 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 240/816] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 242/816] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
` (579 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli,
Thomas Bogendoerfer, Sasha Levin
6.12-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] 825+ messages in thread
* [PATCH 6.12 242/816] MIPS: SB1250: Validate and update IRQ affinity
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (240 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 241/816] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 243/816] libfs: end offset readdir at positions past DIR_OFFSET_EOD Greg Kroah-Hartman
` (578 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fainelli,
Thomas Bogendoerfer, Sasha Levin
6.12-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] 825+ messages in thread
* [PATCH 6.12 243/816] libfs: end offset readdir at positions past DIR_OFFSET_EOD
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (241 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 242/816] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 244/816] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
` (577 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever,
Christian Brauner (Amutable), Sasha Levin
6.12-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 028f2cf729d5d..b4664a864689d 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -559,7 +559,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] 825+ messages in thread
* [PATCH 6.12 244/816] initrd: flush deferred fput() before mounting root
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (242 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 243/816] libfs: end offset readdir at positions past DIR_OFFSET_EOD Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 245/816] iov_iter: take an unsigned long segment count in import_iovec() Greg Kroah-Hartman
` (576 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abbott Liu,
Christian Brauner (Amutable), Sasha Levin
6.12-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 ac021ae6e6fa7..285afe68dbc76 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -270,6 +270,11 @@ int __init rd_load_image(char *from)
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] 825+ messages in thread
* [PATCH 6.12 245/816] iov_iter: take an unsigned long segment count in import_iovec()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (243 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 244/816] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 246/816] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
` (575 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrea Parri, Jan Kara,
Christian Brauner (Amutable), Sasha Levin
6.12-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 853f9de5aa05a..227b726cb557f 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -355,11 +355,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 6f2f83c0358f1..5944e2721231c 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1444,8 +1444,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;
@@ -1516,7 +1516,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] 825+ messages in thread
* [PATCH 6.12 246/816] vfs: preserve subsecond timestamps at filesystem time limits
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (244 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 245/816] iov_iter: take an unsigned long segment count in import_iovec() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 247/816] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
` (574 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Jeff Layton,
Christian Brauner (Amutable), Sasha Levin
6.12-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 87396234d1e25..a9a038c863d3a 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2621,9 +2621,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] 825+ messages in thread
* [PATCH 6.12 247/816] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (245 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 246/816] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 248/816] fs/read_write: make default_llseek() killable Greg Kroah-Hartman
` (573 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jan Kara, Jeff Layton,
Christoph Hellwig, Christian Brauner (Amutable), Sasha Levin
6.12-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 5aa8f296e8ee5..23de8d02654f9 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -681,8 +681,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);
@@ -690,7 +689,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 3d900c86981c5..0f77837ef6ef3 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -67,4 +67,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] 825+ messages in thread
* [PATCH 6.12 248/816] fs/read_write: make default_llseek() killable
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (246 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 247/816] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 249/816] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek() Greg Kroah-Hartman
` (572 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Max Kellermann, Christian Brauner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Kellermann <max.kellermann@ionos.com>
[ Upstream commit 2e1a8fbff51bb9bdf0fe9c6602855e308efcfcdb ]
Allows killing processes that are waiting for the inode lock.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Link: https://lore.kernel.org/20250513150327.1373061-4-max.kellermann@ionos.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Stable-dep-of: 7a5783cfac71 ("fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/read_write.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/read_write.c b/fs/read_write.c
index d908478b7e833..87246e7c2ee83 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -327,7 +327,9 @@ loff_t default_llseek(struct file *file, loff_t offset, int whence)
struct inode *inode = file_inode(file);
loff_t retval;
- inode_lock(inode);
+ retval = inode_lock_killable(inode);
+ if (retval)
+ return retval;
switch (whence) {
case SEEK_END:
offset += i_size_read(inode);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 249/816] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (247 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 248/816] fs/read_write: make default_llseek() killable Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 250/816] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
` (571 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Siddharth Chintamaneni, Jan Kara,
Christian Brauner (Amutable), Sasha Levin
6.12-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 87246e7c2ee83..1e7505662f8f2 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -326,13 +326,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) {
@@ -347,7 +349,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;
}
@@ -358,11 +360,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] 825+ messages in thread
* [PATCH 6.12 250/816] sched/pelt: Fix u32 truncation of the PELT period count
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (248 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 249/816] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek() Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 251/816] sched/topology: Balance cluster static-key updates Greg Kroah-Hartman
` (570 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hui Su, Peter Zijlstra (Intel),
Ingo Molnar, Vincent Guittot, Kayra Cizmeci, Sasha Levin
6.12-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 8189a35e53fe1..2bd7d9448d0cb 100644
--- a/kernel/sched/pelt.c
+++ b/kernel/sched/pelt.c
@@ -98,7 +98,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] 825+ messages in thread
* [PATCH 6.12 251/816] sched/topology: Balance cluster static-key updates
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (249 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 250/816] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
@ 2026-11-25 14:29 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 252/816] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
` (569 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:29 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hui Su, Peter Zijlstra (Intel),
Ingo Molnar, K Prateek Nayak, Kayra Cizmeci, Sasha Levin
6.12-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 bd8b2b3015709..b909f56dcaecf 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -2635,13 +2635,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] 825+ messages in thread
* [PATCH 6.12 252/816] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (250 preceding siblings ...)
2026-11-25 14:29 ` [PATCH 6.12 251/816] sched/topology: Balance cluster static-key updates Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 253/816] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
` (568 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Eric Dumazet,
Paolo Abeni, Sasha Levin
6.12-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 77f6c40ead438..23f619a1b41a6 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1312,6 +1312,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 044595be4217a..9c53e79d87501 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -5415,11 +5415,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;
tp->snd_ssthresh = val;
break;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ba4e7ffa18761..242efac9123bc 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -451,7 +451,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 ef81765a0831d..ecec29fec56c2 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] 825+ messages in thread
* [PATCH 6.12 253/816] net/mlx5e: TC, Fix double free of branch in failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (251 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 252/816] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 254/816] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
` (567 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Fourier, Tariq Toukan,
Dave Miller, Sasha Levin
6.12-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 a5ae179310672..531127dbe800e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -4009,6 +4009,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] 825+ messages in thread
* [PATCH 6.12 254/816] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (252 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 253/816] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 255/816] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
` (566 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 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
6.12-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 75a6f6133866d..2f2718a278a54 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] 825+ messages in thread
* [PATCH 6.12 255/816] locking/osq: Fix unlink queue corruption
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (253 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 254/816] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 256/816] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
` (565 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 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
6.12-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 2f2718a278a54..6d584aa89afec 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] 825+ messages in thread
* [PATCH 6.12 256/816] perf/x86/amd/uncore: Avoid context migration from non-owners
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (254 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 255/816] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 257/816] perf/core: Simplify the perf_pmu_register() error path Greg Kroah-Hartman
` (564 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sandipan Das, Peter Zijlstra (Intel),
Sasha Levin
6.12-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 06c5e485fd6e0..78f7dbb8b181c 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -548,7 +548,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] 825+ messages in thread
* [PATCH 6.12 257/816] perf/core: Simplify the perf_pmu_register() error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (255 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 256/816] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 258/816] perf/core: Simplify perf_pmu_register() Greg Kroah-Hartman
` (563 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel), Ingo Molnar,
Ravi Bangoria, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 8f4c4963d28349cbf1920ab71edea8276f6ac4c5 ]
The error path of perf_pmu_register() is of course very similar to a
subset of perf_pmu_unregister(). Extract this common part in
perf_pmu_free() and simplify things.
[ mingo: Forward ported it ]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20241104135518.090915501@infradead.org
Stable-dep-of: 3bbd85b2f67a ("perf: Fix racy update of cpc->hrtimer_interval")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 67 ++++++++++++++++++++------------------------
1 file changed, 30 insertions(+), 37 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 21a54cedd854b..5a200b3c770d9 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -11651,11 +11651,6 @@ static int perf_event_idx_default(struct perf_event *event)
return 0;
}
-static void free_pmu_context(struct pmu *pmu)
-{
- free_percpu(pmu->cpu_pmu_context);
-}
-
/*
* Let userspace know that this PMU supports address range filtering:
*/
@@ -11861,6 +11856,7 @@ static int pmu_dev_alloc(struct pmu *pmu)
free_dev:
put_device(pmu->dev);
+ pmu->dev = NULL;
goto out;
}
@@ -11882,25 +11878,38 @@ static bool idr_cmpxchg(struct idr *idr, unsigned long id, void *old, void *new)
return true;
}
+static void perf_pmu_free(struct pmu *pmu)
+{
+ free_percpu(pmu->pmu_disable_count);
+ if (pmu_bus_running && pmu->dev && pmu->dev != PMU_NULL_DEV) {
+ if (pmu->nr_addr_filters)
+ device_remove_file(pmu->dev, &dev_attr_nr_addr_filters);
+ device_del(pmu->dev);
+ put_device(pmu->dev);
+ }
+ free_percpu(pmu->cpu_pmu_context);
+}
+
int perf_pmu_register(struct pmu *pmu, const char *name, int type)
{
int cpu, ret, max = PERF_TYPE_MAX;
+ pmu->type = -1;
+
mutex_lock(&pmus_lock);
ret = -ENOMEM;
pmu->pmu_disable_count = alloc_percpu(int);
if (!pmu->pmu_disable_count)
goto unlock;
- pmu->type = -1;
if (WARN_ONCE(!name, "Can not register anonymous pmu.\n")) {
ret = -EINVAL;
- goto free_pdc;
+ goto free;
}
if (WARN_ONCE(pmu->scope >= PERF_PMU_MAX_SCOPE, "Can not register a pmu with an invalid scope.\n")) {
ret = -EINVAL;
- goto free_pdc;
+ goto free;
}
pmu->name = name;
@@ -11910,24 +11919,23 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)
ret = idr_alloc(&pmu_idr, NULL, max, 0, GFP_KERNEL);
if (ret < 0)
- goto free_pdc;
+ goto free;
WARN_ON(type >= 0 && ret != type);
- type = ret;
- pmu->type = type;
+ pmu->type = ret;
atomic_set(&pmu->exclusive_cnt, 0);
if (pmu_bus_running && !pmu->dev) {
ret = pmu_dev_alloc(pmu);
if (ret)
- goto free_idr;
+ goto free;
}
ret = -ENOMEM;
pmu->cpu_pmu_context = alloc_percpu(struct perf_cpu_pmu_context);
if (!pmu->cpu_pmu_context)
- goto free_dev;
+ goto free;
for_each_possible_cpu(cpu) {
struct perf_cpu_pmu_context *cpc;
@@ -11968,8 +11976,10 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)
/*
* Now that the PMU is complete, make it visible to perf_try_init_event().
*/
- if (!idr_cmpxchg(&pmu_idr, pmu->type, NULL, pmu))
- goto free_context;
+ if (!idr_cmpxchg(&pmu_idr, pmu->type, NULL, pmu)) {
+ ret = -EINVAL;
+ goto free;
+ }
list_add_rcu(&pmu->entry, &pmus);
ret = 0;
@@ -11978,20 +11988,10 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)
return ret;
-free_context:
- free_percpu(pmu->cpu_pmu_context);
-
-free_dev:
- if (pmu->dev && pmu->dev != PMU_NULL_DEV) {
- device_del(pmu->dev);
- put_device(pmu->dev);
- }
-
-free_idr:
- idr_remove(&pmu_idr, pmu->type);
-
-free_pdc:
- free_percpu(pmu->pmu_disable_count);
+free:
+ if (pmu->type >= 0)
+ idr_remove(&pmu_idr, pmu->type);
+ perf_pmu_free(pmu);
goto unlock;
}
EXPORT_SYMBOL_GPL(perf_pmu_register);
@@ -12010,14 +12010,7 @@ void perf_pmu_unregister(struct pmu *pmu)
synchronize_srcu(&pmus_srcu);
synchronize_rcu();
- free_percpu(pmu->pmu_disable_count);
- if (pmu_bus_running && pmu->dev && pmu->dev != PMU_NULL_DEV) {
- if (pmu->nr_addr_filters)
- device_remove_file(pmu->dev, &dev_attr_nr_addr_filters);
- device_del(pmu->dev);
- put_device(pmu->dev);
- }
- free_pmu_context(pmu);
+ perf_pmu_free(pmu);
}
EXPORT_SYMBOL_GPL(perf_pmu_unregister);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 258/816] perf/core: Simplify perf_pmu_register()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (256 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 257/816] perf/core: Simplify the perf_pmu_register() error path Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 259/816] perf/core: Merge struct pmu::pmu_disable_count into struct perf_cpu_pmu_context::pmu_disable_count Greg Kroah-Hartman
` (562 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel), Ingo Molnar,
Ravi Bangoria, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 6c8b0b835f003647e593c08331a4dd2150d5eb0e ]
Using the previously introduced perf_pmu_free() and a new IDR helper,
simplify the perf_pmu_register error paths.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20241104135518.198937277@infradead.org
Stable-dep-of: 3bbd85b2f67a ("perf: Fix racy update of cpc->hrtimer_interval")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/idr.h | 17 +++++++++++
kernel/events/core.c | 71 ++++++++++++++++++--------------------------
2 files changed, 46 insertions(+), 42 deletions(-)
diff --git a/include/linux/idr.h b/include/linux/idr.h
index da5f5fa4a3a6a..cd729be369b36 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -15,6 +15,7 @@
#include <linux/radix-tree.h>
#include <linux/gfp.h>
#include <linux/percpu.h>
+#include <linux/cleanup.h>
struct idr {
struct radix_tree_root idr_rt;
@@ -124,6 +125,22 @@ void *idr_get_next_ul(struct idr *, unsigned long *nextid);
void *idr_replace(struct idr *, void *, unsigned long id);
void idr_destroy(struct idr *);
+struct __class_idr {
+ struct idr *idr;
+ int id;
+};
+
+#define idr_null ((struct __class_idr){ NULL, -1 })
+#define take_idr_id(id) __get_and_null(id, idr_null)
+
+DEFINE_CLASS(idr_alloc, struct __class_idr,
+ if (_T.id >= 0) idr_remove(_T.idr, _T.id),
+ ((struct __class_idr){
+ .idr = idr,
+ .id = idr_alloc(idr, ptr, start, end, gfp),
+ }),
+ struct idr *idr, void *ptr, int start, int end, gfp_t gfp);
+
/**
* idr_init_base() - Initialise an IDR.
* @idr: IDR handle.
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 5a200b3c770d9..d7df3a9749433 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -11890,52 +11890,49 @@ static void perf_pmu_free(struct pmu *pmu)
free_percpu(pmu->cpu_pmu_context);
}
-int perf_pmu_register(struct pmu *pmu, const char *name, int type)
+DEFINE_FREE(pmu_unregister, struct pmu *, if (_T) perf_pmu_free(_T))
+
+int perf_pmu_register(struct pmu *_pmu, const char *name, int type)
{
- int cpu, ret, max = PERF_TYPE_MAX;
+ int cpu, max = PERF_TYPE_MAX;
- pmu->type = -1;
+ struct pmu *pmu __free(pmu_unregister) = _pmu;
+ guard(mutex)(&pmus_lock);
- mutex_lock(&pmus_lock);
- ret = -ENOMEM;
pmu->pmu_disable_count = alloc_percpu(int);
if (!pmu->pmu_disable_count)
- goto unlock;
+ return -ENOMEM;
- if (WARN_ONCE(!name, "Can not register anonymous pmu.\n")) {
- ret = -EINVAL;
- goto free;
- }
+ if (WARN_ONCE(!name, "Can not register anonymous pmu.\n"))
+ return -EINVAL;
- if (WARN_ONCE(pmu->scope >= PERF_PMU_MAX_SCOPE, "Can not register a pmu with an invalid scope.\n")) {
- ret = -EINVAL;
- goto free;
- }
+ if (WARN_ONCE(pmu->scope >= PERF_PMU_MAX_SCOPE,
+ "Can not register a pmu with an invalid scope.\n"))
+ return -EINVAL;
pmu->name = name;
if (type >= 0)
max = type;
- ret = idr_alloc(&pmu_idr, NULL, max, 0, GFP_KERNEL);
- if (ret < 0)
- goto free;
+ CLASS(idr_alloc, pmu_type)(&pmu_idr, NULL, max, 0, GFP_KERNEL);
+ if (pmu_type.id < 0)
+ return pmu_type.id;
- WARN_ON(type >= 0 && ret != type);
+ WARN_ON(type >= 0 && pmu_type.id != type);
- pmu->type = ret;
+ pmu->type = pmu_type.id;
atomic_set(&pmu->exclusive_cnt, 0);
if (pmu_bus_running && !pmu->dev) {
- ret = pmu_dev_alloc(pmu);
+ int ret = pmu_dev_alloc(pmu);
if (ret)
- goto free;
+ return ret;
}
- ret = -ENOMEM;
pmu->cpu_pmu_context = alloc_percpu(struct perf_cpu_pmu_context);
if (!pmu->cpu_pmu_context)
- goto free;
+ return -ENOMEM;
for_each_possible_cpu(cpu) {
struct perf_cpu_pmu_context *cpc;
@@ -11976,32 +11973,22 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)
/*
* Now that the PMU is complete, make it visible to perf_try_init_event().
*/
- if (!idr_cmpxchg(&pmu_idr, pmu->type, NULL, pmu)) {
- ret = -EINVAL;
- goto free;
- }
+ if (!idr_cmpxchg(&pmu_idr, pmu->type, NULL, pmu))
+ return -EINVAL;
list_add_rcu(&pmu->entry, &pmus);
- ret = 0;
-unlock:
- mutex_unlock(&pmus_lock);
-
- return ret;
-
-free:
- if (pmu->type >= 0)
- idr_remove(&pmu_idr, pmu->type);
- perf_pmu_free(pmu);
- goto unlock;
+ take_idr_id(pmu_type);
+ _pmu = no_free_ptr(pmu); // let it rip
+ return 0;
}
EXPORT_SYMBOL_GPL(perf_pmu_register);
void perf_pmu_unregister(struct pmu *pmu)
{
- mutex_lock(&pmus_lock);
- list_del_rcu(&pmu->entry);
- idr_remove(&pmu_idr, pmu->type);
- mutex_unlock(&pmus_lock);
+ scoped_guard (mutex, &pmus_lock) {
+ list_del_rcu(&pmu->entry);
+ idr_remove(&pmu_idr, pmu->type);
+ }
/*
* We dereference the pmu list under both SRCU and regular RCU, so
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 259/816] perf/core: Merge struct pmu::pmu_disable_count into struct perf_cpu_pmu_context::pmu_disable_count
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (257 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 258/816] perf/core: Simplify perf_pmu_register() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 260/816] perf/core: Add this_cpc() helper Greg Kroah-Hartman
` (561 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel), Ingo Molnar,
Ravi Bangoria, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 4baeb0687abf5eca3f7ab8b147c27cce82ec49ea ]
Because it makes no sense to have two per-cpu allocations per pmu.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20241104135518.518730578@infradead.org
Stable-dep-of: 3bbd85b2f67a ("perf: Fix racy update of cpc->hrtimer_interval")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/perf_event.h | 2 +-
kernel/events/core.c | 12 ++++--------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index afb23be1c0b47..58f7d4fe72819 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -344,7 +344,6 @@ struct pmu {
*/
unsigned int scope;
- int __percpu *pmu_disable_count;
struct perf_cpu_pmu_context __percpu *cpu_pmu_context;
atomic_t exclusive_cnt; /* < 0: cpu; > 0: tsk */
int task_ctx_nr;
@@ -1031,6 +1030,7 @@ struct perf_cpu_pmu_context {
int active_oncpu;
int exclusive;
+ int pmu_disable_count;
raw_spinlock_t hrtimer_lock;
struct hrtimer hrtimer;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index d7df3a9749433..564629cef73fe 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1192,21 +1192,22 @@ static int perf_mux_hrtimer_restart_ipi(void *arg)
void perf_pmu_disable(struct pmu *pmu)
{
- int *count = this_cpu_ptr(pmu->pmu_disable_count);
+ int *count = &this_cpu_ptr(pmu->cpu_pmu_context)->pmu_disable_count;
if (!(*count)++)
pmu->pmu_disable(pmu);
}
void perf_pmu_enable(struct pmu *pmu)
{
- int *count = this_cpu_ptr(pmu->pmu_disable_count);
+ int *count = &this_cpu_ptr(pmu->cpu_pmu_context)->pmu_disable_count;
if (!--(*count))
pmu->pmu_enable(pmu);
}
static void perf_assert_pmu_disabled(struct pmu *pmu)
{
- WARN_ON_ONCE(*this_cpu_ptr(pmu->pmu_disable_count) == 0);
+ int *count = &this_cpu_ptr(pmu->cpu_pmu_context)->pmu_disable_count;
+ WARN_ON_ONCE(*count == 0);
}
static inline void perf_pmu_read(struct perf_event *event)
@@ -11880,7 +11881,6 @@ static bool idr_cmpxchg(struct idr *idr, unsigned long id, void *old, void *new)
static void perf_pmu_free(struct pmu *pmu)
{
- free_percpu(pmu->pmu_disable_count);
if (pmu_bus_running && pmu->dev && pmu->dev != PMU_NULL_DEV) {
if (pmu->nr_addr_filters)
device_remove_file(pmu->dev, &dev_attr_nr_addr_filters);
@@ -11899,10 +11899,6 @@ int perf_pmu_register(struct pmu *_pmu, const char *name, int type)
struct pmu *pmu __free(pmu_unregister) = _pmu;
guard(mutex)(&pmus_lock);
- pmu->pmu_disable_count = alloc_percpu(int);
- if (!pmu->pmu_disable_count)
- return -ENOMEM;
-
if (WARN_ONCE(!name, "Can not register anonymous pmu.\n"))
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 260/816] perf/core: Add this_cpc() helper
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (258 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 259/816] perf/core: Merge struct pmu::pmu_disable_count into struct perf_cpu_pmu_context::pmu_disable_count Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 261/816] perf/core: Detach struct perf_cpu_pmu_context and struct pmu lifetimes Greg Kroah-Hartman
` (560 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel), Ingo Molnar,
Ravi Bangoria, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit b2996f56556e389a13377158904c218da6fffa91 ]
As a preparation for adding yet another indirection.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20241104135518.650051565@infradead.org
Stable-dep-of: 3bbd85b2f67a ("perf: Fix racy update of cpc->hrtimer_interval")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 564629cef73fe..ba6603bd03428 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1190,23 +1190,28 @@ static int perf_mux_hrtimer_restart_ipi(void *arg)
return perf_mux_hrtimer_restart(arg);
}
+static __always_inline struct perf_cpu_pmu_context *this_cpc(struct pmu *pmu)
+{
+ return this_cpu_ptr(pmu->cpu_pmu_context);
+}
+
void perf_pmu_disable(struct pmu *pmu)
{
- int *count = &this_cpu_ptr(pmu->cpu_pmu_context)->pmu_disable_count;
+ int *count = &this_cpc(pmu)->pmu_disable_count;
if (!(*count)++)
pmu->pmu_disable(pmu);
}
void perf_pmu_enable(struct pmu *pmu)
{
- int *count = &this_cpu_ptr(pmu->cpu_pmu_context)->pmu_disable_count;
+ int *count = &this_cpc(pmu)->pmu_disable_count;
if (!--(*count))
pmu->pmu_enable(pmu);
}
static void perf_assert_pmu_disabled(struct pmu *pmu)
{
- int *count = &this_cpu_ptr(pmu->cpu_pmu_context)->pmu_disable_count;
+ int *count = &this_cpc(pmu)->pmu_disable_count;
WARN_ON_ONCE(*count == 0);
}
@@ -2322,7 +2327,7 @@ static void
event_sched_out(struct perf_event *event, struct perf_event_context *ctx)
{
struct perf_event_pmu_context *epc = event->pmu_ctx;
- struct perf_cpu_pmu_context *cpc = this_cpu_ptr(epc->pmu->cpu_pmu_context);
+ struct perf_cpu_pmu_context *cpc = this_cpc(epc->pmu);
enum perf_event_state state = PERF_EVENT_STATE_INACTIVE;
// XXX cpc serialization, probably per-cpu IRQ disabled
@@ -2467,9 +2472,8 @@ __perf_remove_from_context(struct perf_event *event,
pmu_ctx->rotate_necessary = 0;
if (ctx->task && ctx->is_active) {
- struct perf_cpu_pmu_context *cpc;
+ struct perf_cpu_pmu_context *cpc = this_cpc(pmu_ctx->pmu);
- cpc = this_cpu_ptr(pmu_ctx->pmu->cpu_pmu_context);
WARN_ON_ONCE(cpc->task_epc && cpc->task_epc != pmu_ctx);
cpc->task_epc = NULL;
}
@@ -2622,7 +2626,7 @@ static int
event_sched_in(struct perf_event *event, struct perf_event_context *ctx)
{
struct perf_event_pmu_context *epc = event->pmu_ctx;
- struct perf_cpu_pmu_context *cpc = this_cpu_ptr(epc->pmu->cpu_pmu_context);
+ struct perf_cpu_pmu_context *cpc = this_cpc(epc->pmu);
int ret = 0;
WARN_ON_ONCE(event->ctx != ctx);
@@ -2729,7 +2733,7 @@ group_sched_in(struct perf_event *group_event, struct perf_event_context *ctx)
static int group_can_go_on(struct perf_event *event, int can_add_hw)
{
struct perf_event_pmu_context *epc = event->pmu_ctx;
- struct perf_cpu_pmu_context *cpc = this_cpu_ptr(epc->pmu->cpu_pmu_context);
+ struct perf_cpu_pmu_context *cpc = this_cpc(epc->pmu);
/*
* Groups consisting entirely of software events can always go on.
@@ -3352,9 +3356,8 @@ static void __pmu_ctx_sched_out(struct perf_event_pmu_context *pmu_ctx,
struct pmu *pmu = pmu_ctx->pmu;
if (ctx->task && !(ctx->is_active & EVENT_ALL)) {
- struct perf_cpu_pmu_context *cpc;
+ struct perf_cpu_pmu_context *cpc = this_cpc(pmu);
- cpc = this_cpu_ptr(pmu->cpu_pmu_context);
WARN_ON_ONCE(cpc->task_epc && cpc->task_epc != pmu_ctx);
cpc->task_epc = NULL;
}
@@ -3602,7 +3605,7 @@ static void perf_ctx_sched_task_cb(struct perf_event_context *ctx,
struct perf_cpu_pmu_context *cpc;
list_for_each_entry(pmu_ctx, &ctx->pmu_ctx_list, pmu_ctx_entry) {
- cpc = this_cpu_ptr(pmu_ctx->pmu->cpu_pmu_context);
+ cpc = this_cpc(pmu_ctx->pmu);
if (cpc->task_epc != pmu_ctx)
continue;
@@ -3714,7 +3717,7 @@ static DEFINE_PER_CPU(int, perf_sched_cb_usages);
void perf_sched_cb_dec(struct pmu *pmu)
{
- struct perf_cpu_pmu_context *cpc = this_cpu_ptr(pmu->cpu_pmu_context);
+ struct perf_cpu_pmu_context *cpc = this_cpc(pmu);
this_cpu_dec(perf_sched_cb_usages);
barrier();
@@ -3726,7 +3729,7 @@ void perf_sched_cb_dec(struct pmu *pmu)
void perf_sched_cb_inc(struct pmu *pmu)
{
- struct perf_cpu_pmu_context *cpc = this_cpu_ptr(pmu->cpu_pmu_context);
+ struct perf_cpu_pmu_context *cpc = this_cpc(pmu);
if (!cpc->sched_cb_usage++)
list_add(&cpc->sched_cb_entry, this_cpu_ptr(&sched_cb_list));
@@ -3853,7 +3856,7 @@ static void __link_epc(struct perf_event_pmu_context *pmu_ctx)
if (!pmu_ctx->ctx->task)
return;
- cpc = this_cpu_ptr(pmu_ctx->pmu->cpu_pmu_context);
+ cpc = this_cpc(pmu_ctx->pmu);
WARN_ON_ONCE(cpc->task_epc && cpc->task_epc != pmu_ctx);
cpc->task_epc = pmu_ctx;
}
@@ -3982,10 +3985,9 @@ static int merge_sched_in(struct perf_event *event, void *data)
perf_cgroup_event_disable(event, ctx);
perf_event_set_state(event, PERF_EVENT_STATE_ERROR);
} else {
- struct perf_cpu_pmu_context *cpc;
+ struct perf_cpu_pmu_context *cpc = this_cpc(event->pmu_ctx->pmu);
event->pmu_ctx->rotate_necessary = 1;
- cpc = this_cpu_ptr(event->pmu_ctx->pmu->cpu_pmu_context);
perf_mux_hrtimer_restart(cpc);
group_update_userpage(event);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 261/816] perf/core: Detach struct perf_cpu_pmu_context and struct pmu lifetimes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (259 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 260/816] perf/core: Add this_cpc() helper Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 262/816] perf: Fix racy update of cpc->hrtimer_interval Greg Kroah-Hartman
` (559 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel), Ingo Molnar,
Ravi Bangoria, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 4eabf533fb1886089ef57e0c8ec52048b1741e39 ]
In prepration for being able to unregister a PMU with existing events,
it becomes important to detach struct perf_cpu_pmu_context lifetimes
from that of struct pmu.
Notably struct perf_cpu_pmu_context embeds a struct perf_event_pmu_context
that can stay referenced until the last event goes.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20241104135518.760214287@infradead.org
Stable-dep-of: 3bbd85b2f67a ("perf: Fix racy update of cpc->hrtimer_interval")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/perf_event.h | 4 +--
kernel/events/core.c | 56 ++++++++++++++++++++++++++++++++------
2 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 58f7d4fe72819..d88c0091e57dd 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -344,7 +344,7 @@ struct pmu {
*/
unsigned int scope;
- struct perf_cpu_pmu_context __percpu *cpu_pmu_context;
+ struct perf_cpu_pmu_context __percpu **cpu_pmu_context;
atomic_t exclusive_cnt; /* < 0: cpu; > 0: tsk */
int task_ctx_nr;
int hrtimer_interval_ms;
@@ -922,7 +922,7 @@ struct perf_event_pmu_context {
struct list_head pinned_active;
struct list_head flexible_active;
- /* Used to avoid freeing per-cpu perf_event_pmu_context */
+ /* Used to identify the per-cpu perf_event_pmu_context */
unsigned int embedded : 1;
unsigned int nr_events;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index ba6603bd03428..45b7a1fdc964d 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1192,7 +1192,7 @@ static int perf_mux_hrtimer_restart_ipi(void *arg)
static __always_inline struct perf_cpu_pmu_context *this_cpc(struct pmu *pmu)
{
- return this_cpu_ptr(pmu->cpu_pmu_context);
+ return *this_cpu_ptr(pmu->cpu_pmu_context);
}
void perf_pmu_disable(struct pmu *pmu)
@@ -5006,11 +5006,14 @@ find_get_pmu_context(struct pmu *pmu, struct perf_event_context *ctx,
*/
struct perf_cpu_pmu_context *cpc;
- cpc = per_cpu_ptr(pmu->cpu_pmu_context, event->cpu);
+ cpc = *per_cpu_ptr(pmu->cpu_pmu_context, event->cpu);
epc = &cpc->epc;
raw_spin_lock_irq(&ctx->lock);
if (!epc->ctx) {
- atomic_set(&epc->refcount, 1);
+ /*
+ * One extra reference for the pmu; see perf_pmu_free().
+ */
+ atomic_set(&epc->refcount, 2);
epc->embedded = 1;
list_add(&epc->pmu_ctx_entry, &ctx->pmu_ctx_list);
epc->ctx = ctx;
@@ -5086,6 +5089,15 @@ static void get_pmu_ctx(struct perf_event_pmu_context *epc)
WARN_ON_ONCE(!atomic_inc_not_zero(&epc->refcount));
}
+static void free_cpc_rcu(struct rcu_head *head)
+{
+ struct perf_cpu_pmu_context *cpc =
+ container_of(head, typeof(*cpc), epc.rcu_head);
+
+ kfree(cpc->epc.task_ctx_data);
+ kfree(cpc);
+}
+
static void free_epc_rcu(struct rcu_head *head)
{
struct perf_event_pmu_context *epc = container_of(head, typeof(*epc), rcu_head);
@@ -5120,8 +5132,10 @@ static void put_pmu_ctx(struct perf_event_pmu_context *epc)
raw_spin_unlock_irqrestore(&ctx->lock, flags);
- if (epc->embedded)
+ if (epc->embedded) {
+ call_rcu(&epc->rcu_head, free_cpc_rcu);
return;
+ }
call_rcu(&epc->rcu_head, free_epc_rcu);
}
@@ -11716,7 +11730,7 @@ perf_event_mux_interval_ms_store(struct device *dev,
cpus_read_lock();
for_each_online_cpu(cpu) {
struct perf_cpu_pmu_context *cpc;
- cpc = per_cpu_ptr(pmu->cpu_pmu_context, cpu);
+ 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);
@@ -11889,7 +11903,25 @@ static void perf_pmu_free(struct pmu *pmu)
device_del(pmu->dev);
put_device(pmu->dev);
}
- free_percpu(pmu->cpu_pmu_context);
+
+ if (pmu->cpu_pmu_context) {
+ int cpu;
+
+ for_each_possible_cpu(cpu) {
+ struct perf_cpu_pmu_context *cpc;
+
+ cpc = *per_cpu_ptr(pmu->cpu_pmu_context, cpu);
+ if (!cpc)
+ continue;
+ if (cpc->epc.embedded) {
+ /* refcount managed */
+ put_pmu_ctx(&cpc->epc);
+ continue;
+ }
+ kfree(cpc);
+ }
+ free_percpu(pmu->cpu_pmu_context);
+ }
}
DEFINE_FREE(pmu_unregister, struct pmu *, if (_T) perf_pmu_free(_T))
@@ -11928,14 +11960,20 @@ int perf_pmu_register(struct pmu *_pmu, const char *name, int type)
return ret;
}
- pmu->cpu_pmu_context = alloc_percpu(struct perf_cpu_pmu_context);
+ pmu->cpu_pmu_context = alloc_percpu(struct perf_cpu_pmu_context *);
if (!pmu->cpu_pmu_context)
return -ENOMEM;
for_each_possible_cpu(cpu) {
- struct perf_cpu_pmu_context *cpc;
+ struct perf_cpu_pmu_context *cpc =
+ kmalloc_node(sizeof(struct perf_cpu_pmu_context),
+ GFP_KERNEL | __GFP_ZERO,
+ cpu_to_node(cpu));
+
+ if (!cpc)
+ return -ENOMEM;
- cpc = per_cpu_ptr(pmu->cpu_pmu_context, cpu);
+ *per_cpu_ptr(pmu->cpu_pmu_context, cpu) = cpc;
__perf_init_event_pmu_context(&cpc->epc, pmu);
__perf_mux_hrtimer_init(cpc, cpu);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 262/816] perf: Fix racy update of cpc->hrtimer_interval
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (260 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 261/816] perf/core: Detach struct perf_cpu_pmu_context and struct pmu lifetimes Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 263/816] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Greg Kroah-Hartman
` (558 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ben Segall,
Peter Zijlstra (Intel), Sasha Levin
6.12-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 45b7a1fdc964d..104064992b760 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1185,14 +1185,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)
@@ -11728,13 +11733,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] 825+ messages in thread
* [PATCH 6.12 263/816] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (261 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 262/816] perf: Fix racy update of cpc->hrtimer_interval Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 264/816] cpufreq: staticize cpufreq_boost_trigger_state() Greg Kroah-Hartman
` (557 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dheeraj Kumar Srivastava, Ankit Soni,
Vasant Hegde, Joerg Roedel, Sasha Levin
6.12-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 835b24524aa8d..b415a6fecd32e 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3324,6 +3324,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] 825+ messages in thread
* [PATCH 6.12 264/816] cpufreq: staticize cpufreq_boost_trigger_state()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (262 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 263/816] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 265/816] cpufreq: Force sync policy boost with global boost on sysfs update Greg Kroah-Hartman
` (556 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Viresh Kumar, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar@linaro.org>
[ Upstream commit 1f04815057a4c1ca557448b56ad5ab536978540e ]
cpufreq_boost_trigger_state() is only used by cpufreq core, mark it
static.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Stable-dep-of: 3d5720dff09f ("cpufreq: Serialize global boost updates")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 3 ++-
include/linux/cpufreq.h | 5 -----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 99528144865e8..392f15173038a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -87,6 +87,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
struct cpufreq_governor *new_gov,
unsigned int new_pol);
static bool cpufreq_boost_supported(void);
+static int cpufreq_boost_trigger_state(int state);
/*
* Two notifier lists: the "policy" list is involved in the
@@ -2818,7 +2819,7 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state)
return 0;
}
-int cpufreq_boost_trigger_state(int state)
+static int cpufreq_boost_trigger_state(int state)
{
struct cpufreq_policy *policy;
unsigned long flags;
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 794e38320f568..1e87507ea16ff 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -781,7 +781,6 @@ int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy,
ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
#ifdef CONFIG_CPU_FREQ
-int cpufreq_boost_trigger_state(int state);
bool cpufreq_boost_enabled(void);
int cpufreq_enable_boost_support(void);
bool policy_has_boost_freq(struct cpufreq_policy *policy);
@@ -1178,10 +1177,6 @@ static inline int of_perf_domain_get_sharing_cpumask(int pcpu, const char *list_
return 0;
}
#else
-static inline int cpufreq_boost_trigger_state(int state)
-{
- return 0;
-}
static inline bool cpufreq_boost_enabled(void)
{
return false;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 265/816] cpufreq: Force sync policy boost with global boost on sysfs update
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (263 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 264/816] cpufreq: staticize cpufreq_boost_trigger_state() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 266/816] cpufreq: Serialize global boost updates Greg Kroah-Hartman
` (555 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lifeng Zheng, Viresh Kumar,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar@linaro.org>
[ Upstream commit 121baab7b88ed865532dadb7ef1aee6e2bea86f5 ]
If the global boost flag is enabled and policy boost flag is disabled, a
call to `cpufreq_boost_trigger_state(true)` must enable the policy's
boost state.
The current code misses that because of an optimization. Fix it.
Suggested-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/852ff11c589e6300730d207baac195b2d9d8b95f.1745511526.git.viresh.kumar@linaro.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 3d5720dff09f ("cpufreq: Serialize global boost updates")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 392f15173038a..c4672b95e32e1 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2825,8 +2825,10 @@ static int cpufreq_boost_trigger_state(int state)
unsigned long flags;
int ret = 0;
- if (cpufreq_driver->boost_enabled == state)
- return 0;
+ /*
+ * Don't compare 'cpufreq_driver->boost_enabled' with 'state' here to
+ * make sure all policies are in sync with global boost flag.
+ */
write_lock_irqsave(&cpufreq_driver_lock, flags);
cpufreq_driver->boost_enabled = state;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 266/816] cpufreq: Serialize global boost updates
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (264 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 265/816] cpufreq: Force sync policy boost with global boost on sysfs update Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 267/816] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
` (554 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Loehle, Pengjie Zhang,
Zhongqiu Han, Sumit Gupta, Rafael J. Wysocki, Sasha Levin
6.12-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 c4672b95e32e1..fb04ab5379062 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2819,12 +2819,16 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state)
return 0;
}
+static DEFINE_MUTEX(cpufreq_boost_mutex);
+
static int cpufreq_boost_trigger_state(int state)
{
struct cpufreq_policy *policy;
unsigned long flags;
int ret = 0;
+ 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] 825+ messages in thread
* [PATCH 6.12 267/816] Bluetooth: reject invalid LE supervision timeout relationships
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (265 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 266/816] cpufreq: Serialize global boost updates Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 268/816] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
` (553 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Pepper, Luiz Augusto von Dentz,
Sasha Levin
6.12-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 b023f0870efaa..d247e088ebd01 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2233,8 +2233,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;
@@ -2260,19 +2258,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] 825+ messages in thread
* [PATCH 6.12 268/816] net/mlx5e: IPoIB, Fix QPN lookup race
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (266 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 267/816] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 269/816] netlink: Do not call the unbind callback with the table locked Greg Kroah-Hartman
` (552 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Prathamesh Deshpande, Tariq Toukan,
Jakub Kicinski, Sasha Levin
6.12-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 2ab6437a1c49f..944549f8c2f60 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 028a76944d82d..dd42633c52301 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] 825+ messages in thread
* [PATCH 6.12 269/816] netlink: Do not call the unbind callback with the table locked
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (267 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 268/816] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 270/816] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum Greg Kroah-Hartman
` (551 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anil Kaushik, Simon Horman,
Jakub Kicinski, Sasha Levin
6.12-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 8977798d42322..9cc71da6dd966 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1031,8 +1031,9 @@ static int netlink_bind(struct socket *sock, struct sockaddr *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] 825+ messages in thread
* [PATCH 6.12 270/816] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (268 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 269/816] netlink: Do not call the unbind callback with the table locked Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 271/816] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
` (550 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Or Har-Toov, Maher Sanalla,
Tariq Toukan, Jakub Kicinski, Sasha Levin
6.12-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 e07e2f5f84435..070a809dfa609 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] 825+ messages in thread
* [PATCH 6.12 271/816] calipso: do not charge request socket options to the listener
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (269 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 270/816] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 272/816] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
` (549 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Eric Dumazet,
Kuniyuki Iwashima, Paul Moore, Jakub Kicinski, Sasha Levin
6.12-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 78a96469d6c8e..9e32a732ecbff 100644
--- a/net/ipv6/calipso.c
+++ b/net/ipv6/calipso.c
@@ -1220,7 +1220,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);
@@ -1228,10 +1228,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;
}
@@ -1261,14 +1259,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 c4c541b1ef5d8..23dce6f57576a 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -1285,7 +1285,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,
@@ -1313,7 +1313,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] 825+ messages in thread
* [PATCH 6.12 272/816] ipv6: Check the Home Address option again before its address is used
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (270 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 271/816] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 273/816] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
` (548 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Ido Schimmel,
Jakub Kicinski, Sasha Levin
6.12-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 ce3724f49e33a..f5b6e25580e83 100644
--- a/net/ipv6/exthdrs_core.c
+++ b/net/ipv6/exthdrs_core.c
@@ -135,9 +135,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;
@@ -150,6 +147,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 229ae205450d3..91fd25cff0ac0 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -345,7 +345,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] 825+ messages in thread
* [PATCH 6.12 273/816] ata: libata-scsi: fix MODE SELECT handling of data after the mode page
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (271 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 272/816] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 274/816] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
` (547 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.12-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 9419df80f39b4..d6b1cdf4dec27 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4371,6 +4371,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) {
@@ -4393,13 +4404,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] 825+ messages in thread
* [PATCH 6.12 274/816] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (272 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 273/816] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 275/816] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
` (546 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.12-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 d6b1cdf4dec27..2f70f1c228945 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4344,19 +4344,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] 825+ messages in thread
* [PATCH 6.12 275/816] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (273 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 274/816] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 276/816] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
` (545 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Niklas Cassel, Sasha Levin
6.12-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 2f70f1c228945..442f45099f0da 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4329,7 +4329,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] 825+ messages in thread
* [PATCH 6.12 276/816] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (274 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 275/816] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 277/816] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
` (544 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.12-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 442f45099f0da..05aad48ccf5aa 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4365,8 +4365,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] 825+ messages in thread
* [PATCH 6.12 277/816] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (275 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 276/816] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 278/816] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
` (543 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.12-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 05aad48ccf5aa..98a18510db98f 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4314,7 +4314,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] 825+ messages in thread
* [PATCH 6.12 278/816] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (276 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 277/816] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 279/816] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
` (542 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Sasha Levin
6.12-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 98a18510db98f..7f093456fa3b7 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4067,14 +4067,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)
@@ -4085,26 +4093,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;
}
@@ -4118,8 +4119,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)
@@ -4129,26 +4148,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;
}
@@ -4160,9 +4172,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)
@@ -4171,17 +4201,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");
@@ -4203,7 +4229,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;
}
@@ -4219,15 +4245,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)
@@ -4339,17 +4374,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] 825+ messages in thread
* [PATCH 6.12 279/816] ata: libata-scsi: set the field pointer when rejecting CDL
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (277 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 278/816] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 280/816] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
` (541 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Damien Le Moal,
Niklas Cassel, Sasha Levin
6.12-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 7f093456fa3b7..5be76156f1dc1 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4222,6 +4222,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] 825+ messages in thread
* [PATCH 6.12 280/816] tracing/probes: bound symstr stores to reserved length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (278 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 279/816] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 281/816] drm/xe: Rebind BOs evicted before the first LR queue Greg Kroah-Hartman
` (540 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yifan Zhang,
Masami Hiramatsu (Google), Sasha Levin
6.12-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 2caf0d2afb322..6991ab3b9e0b9 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] 825+ messages in thread
* [PATCH 6.12 281/816] drm/xe: Rebind BOs evicted before the first LR queue
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (279 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 280/816] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 282/816] drm/xe: Toggle the D3Cold enable flag at runtime resume Greg Kroah-Hartman
` (539 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 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
6.12-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 310178a5652a3..7fb407d9e9caf 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -273,8 +273,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_sw_signaling(pfence);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 282/816] drm/xe: Toggle the D3Cold enable flag at runtime resume
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (280 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 281/816] drm/xe: Rebind BOs evicted before the first LR queue Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 283/816] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
` (538 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Auld, Karthik Poosa,
Vinay Belgaumkar, Matthew Brost, Dave Airlie, Sasha Levin
6.12-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 9d807d9a0807a..27c11082958c3 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -983,6 +983,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] 825+ messages in thread
* [PATCH 6.12 283/816] gpiolib: of: return -ENOENT from of_gpio_count() stub
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (281 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 282/816] drm/xe: Toggle the D3Cold enable flag at runtime resume Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 284/816] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
` (537 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko, Dmitry Torokhov,
Bartosz Golaszewski, Sasha Levin
6.12-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 16d6ac8cb156c..a90fd075d9569 100644
--- a/drivers/gpio/gpiolib-of.h
+++ b/drivers/gpio/gpiolib-of.h
@@ -36,7 +36,7 @@ static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
static inline int of_gpio_count(const struct fwnode_handle *fwnode,
const char *con_id)
{
- return 0;
+ return -ENOENT;
}
#endif /* CONFIG_OF_GPIO */
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 284/816] ASoC: soc-core: copy the DAI link names into the card
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (282 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 283/816] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 285/816] ASoC: SOF: amd: remove else condition in resume sequence Greg Kroah-Hartman
` (536 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tyler Baker, Mark Brown, Sasha Levin
6.12-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 5097b287b889a..eb76d71de65e9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3674,6 +3674,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
@@ -3703,6 +3715,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;
}
@@ -3758,6 +3772,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] 825+ messages in thread
* [PATCH 6.12 285/816] ASoC: SOF: amd: remove else condition in resume sequence
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (283 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 284/816] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 286/816] ASoC: SOF: amd: add ACP7.1 platform support Greg Kroah-Hartman
` (535 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Ranjani Sridharan,
Bard Liao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit e46da64f333ede33adc3a1903821a73ed6c018a6 ]
Else condition is not required after break/return statement.
Remove else condition in resume callback.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250502154445.3008598-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 34ea81a7f284 ("ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/acp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 35eb23d2a056d..7f8ee9f356452 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -649,9 +649,9 @@ int amd_sof_acp_resume(struct snd_sof_dev *sdev)
return ret;
}
return acp_memory_init(sdev);
- } else {
- return acp_dsp_reset(sdev);
}
+
+ return acp_dsp_reset(sdev);
}
EXPORT_SYMBOL_NS(amd_sof_acp_resume, SND_SOC_SOF_AMD_COMMON);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 286/816] ASoC: SOF: amd: add ACP7.1 platform support
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (284 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 285/816] ASoC: SOF: amd: remove else condition in resume sequence Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 287/816] ASoC: SOF: amd: enable ACP_PME_EN register for ACP7.0 & ACP7.1 platforms Greg Kroah-Hartman
` (534 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Ranjani Sridharan,
Bard Liao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit 451bd0e7b91c83f817b741557c9be0f133d3836d ]
Add SOF support for ACP7.1 platform.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250502154445.3008598-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 34ea81a7f284 ("ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/Kconfig | 6 +++---
sound/soc/sof/amd/acp.c | 10 +++++++++-
sound/soc/sof/amd/acp.h | 1 +
sound/soc/sof/amd/pci-acp70.c | 7 ++++++-
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/sound/soc/sof/amd/Kconfig b/sound/soc/sof/amd/Kconfig
index f4cafe8010178..12e9492d21429 100644
--- a/sound/soc/sof/amd/Kconfig
+++ b/sound/soc/sof/amd/Kconfig
@@ -90,12 +90,12 @@ config SND_SOC_SOF_AMD_ACP63
If unsure select "N".
config SND_SOC_SOF_AMD_ACP70
- tristate "SOF support for ACP7.0 platform"
+ tristate "SOF support for ACP7.0/ACP7.1 platforms"
depends on SND_SOC_SOF_PCI
select SND_SOC_SOF_AMD_COMMON
help
Select this option for SOF support on
- AMD ACP7.0 version based platforms.
- Say Y if you want to enable SOF on ACP7.0 based platform.
+ AMD ACP7.0/ACP7.1 version based platforms.
+ Say Y if you want to enable SOF on ACP7.0/ACP7.1 based platforms.
endif
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 7f8ee9f356452..64f7562c5486a 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -74,6 +74,7 @@ static void init_dma_descriptor(struct acp_dev_data *adata)
switch (acp_data->pci_rev) {
case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
acp_dma_desc_base_addr = ACP70_DMA_DESC_BASE_ADDR;
acp_dma_desc_max_num_dscr = ACP70_DMA_DESC_MAX_NUM_DSCR;
break;
@@ -113,6 +114,7 @@ static int config_dma_channel(struct acp_dev_data *adata, unsigned int ch,
switch (acp_data->pci_rev) {
case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
acp_dma_cntl_0 = ACP70_DMA_CNTL_0;
acp_dma_ch_rst_sts = ACP70_DMA_CH_RST_STS;
acp_dma_dscr_err_sts_0 = ACP70_DMA_ERR_STS_0;
@@ -348,6 +350,7 @@ int acp_dma_status(struct acp_dev_data *adata, unsigned char ch)
switch (adata->pci_rev) {
case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
acp_dma_ch_sts = ACP70_DMA_CH_STS;
break;
default:
@@ -498,6 +501,7 @@ static int acp_power_on(struct snd_sof_dev *sdev)
acp_pgfsm_cntl_mask = ACP6X_PGFSM_CNTL_POWER_ON_MASK;
break;
case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
acp_pgfsm_status_mask = ACP70_PGFSM_STATUS_MASK;
acp_pgfsm_cntl_mask = ACP70_PGFSM_CNTL_POWER_ON_MASK;
break;
@@ -628,8 +632,12 @@ int amd_sof_acp_suspend(struct snd_sof_dev *sdev, u32 target_state)
dev_err(sdev->dev, "ACP Reset failed\n");
return ret;
}
- if (acp_data->pci_rev == ACP70_PCI_ID)
+ switch (acp_data->pci_rev) {
+ case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
enable = true;
+ break;
+ }
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP_CONTROL, enable);
return 0;
diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h
index 2a19d82d62002..dde04ecadbd85 100644
--- a/sound/soc/sof/amd/acp.h
+++ b/sound/soc/sof/amd/acp.h
@@ -74,6 +74,7 @@
#define ACP_RMB_PCI_ID 0x6F
#define ACP63_PCI_ID 0x63
#define ACP70_PCI_ID 0x70
+#define ACP71_PCI_ID 0x71
#define HOST_BRIDGE_CZN 0x1630
#define HOST_BRIDGE_VGH 0x1645
diff --git a/sound/soc/sof/amd/pci-acp70.c b/sound/soc/sof/amd/pci-acp70.c
index fe2ad0395f5d3..2b1ca22130e62 100644
--- a/sound/soc/sof/amd/pci-acp70.c
+++ b/sound/soc/sof/amd/pci-acp70.c
@@ -72,8 +72,13 @@ static int acp70_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_
{
unsigned int flag;
- if (pci->revision != ACP70_PCI_ID)
+ switch (pci->revision) {
+ case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
+ break;
+ default:
return -ENODEV;
+ }
flag = snd_amd_acp_find_config(pci);
if (flag != FLAG_AMD_SOF && flag != FLAG_AMD_SOF_ONLY_DMIC)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 287/816] ASoC: SOF: amd: enable ACP_PME_EN register for ACP7.0 & ACP7.1 platforms
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (285 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 286/816] ASoC: SOF: amd: add ACP7.1 platform support Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 288/816] ASoC: SOF: amd: enable soundwire host wake irq mask Greg Kroah-Hartman
` (533 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Ranjani Sridharan,
Bard Liao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit cc489cced17b2e32170ee87a3b64aaa3c7c6fddb ]
As per design flow for ACP7.0 & ACP7.1 platforms, enable ACP_PME_EN
register for below scenarios.
1. During acp init sequence
2. During resume sequence for SoundWire ClockStop power mode.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250502154445.3008598-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 34ea81a7f284 ("ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/acp-dsp-offset.h | 1 +
sound/soc/sof/amd/acp.c | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/amd/acp-dsp-offset.h b/sound/soc/sof/amd/acp-dsp-offset.h
index ecdcae07ace7f..414151187b449 100644
--- a/sound/soc/sof/amd/acp-dsp-offset.h
+++ b/sound/soc/sof/amd/acp-dsp-offset.h
@@ -130,4 +130,5 @@
#define ACP_SW0_EN 0x3000
#define ACP_SW1_EN 0x3C00
+#define ACP70_PME_EN 0x1400
#endif
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 64f7562c5486a..e5a36dc6583cb 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -582,9 +582,11 @@ static int acp_dsp_reset(struct snd_sof_dev *sdev)
static int acp_init(struct snd_sof_dev *sdev)
{
+ struct acp_dev_data *acp_data;
int ret;
/* power on */
+ acp_data = sdev->pdata->hw_pdata;
ret = acp_power_on(sdev);
if (ret) {
dev_err(sdev->dev, "ACP power on failed\n");
@@ -593,7 +595,16 @@ static int acp_init(struct snd_sof_dev *sdev)
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP_CONTROL, 0x01);
/* Reset */
- return acp_reset(sdev);
+ ret = acp_reset(sdev);
+ if (ret)
+ return ret;
+ switch (acp_data->pci_rev) {
+ case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP70_PME_EN, 1);
+ break;
+ }
+ return 0;
}
static bool check_acp_sdw_enable_status(struct snd_sof_dev *sdev)
@@ -658,6 +669,12 @@ int amd_sof_acp_resume(struct snd_sof_dev *sdev)
}
return acp_memory_init(sdev);
}
+ switch (acp_data->pci_rev) {
+ case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP70_PME_EN, 1);
+ break;
+ }
return acp_dsp_reset(sdev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 288/816] ASoC: SOF: amd: enable soundwire host wake irq mask
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (286 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 287/816] ASoC: SOF: amd: enable ACP_PME_EN register for ACP7.0 & ACP7.1 platforms Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 289/816] ASoC: SOF: amd: add soundwire wake irq handling Greg Kroah-Hartman
` (532 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Ranjani Sridharan,
Bard Liao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit a536f3c51edb63900b3340978d38da3aabc1fb2f ]
Enable SoundWire host wake interrupt mask during acp init
sequence based on wake enable checks for each SoundWire manager
instance for ACP7.0 & ACP7.1 platforms.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250502154445.3008598-8-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 34ea81a7f284 ("ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/acp-dsp-offset.h | 5 +++++
sound/soc/sof/amd/acp.c | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/sound/soc/sof/amd/acp-dsp-offset.h b/sound/soc/sof/amd/acp-dsp-offset.h
index 414151187b449..e77554f74c20d 100644
--- a/sound/soc/sof/amd/acp-dsp-offset.h
+++ b/sound/soc/sof/amd/acp-dsp-offset.h
@@ -131,4 +131,9 @@
#define ACP_SW0_EN 0x3000
#define ACP_SW1_EN 0x3C00
#define ACP70_PME_EN 0x1400
+#define ACP70_EXTERNAL_INTR_CNTL1 0x1A08
+#define ACP70_SW0_WAKE_EN 0x1458
+#define ACP70_SW1_WAKE_EN 0x1460
+#define ACP70_SDW_HOST_WAKE_MASK 0x0C00000
+
#endif
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index e5a36dc6583cb..244a9e0a8665e 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -583,6 +583,7 @@ static int acp_dsp_reset(struct snd_sof_dev *sdev)
static int acp_init(struct snd_sof_dev *sdev)
{
struct acp_dev_data *acp_data;
+ unsigned int sdw0_wake_en, sdw1_wake_en;
int ret;
/* power on */
@@ -601,6 +602,12 @@ static int acp_init(struct snd_sof_dev *sdev)
switch (acp_data->pci_rev) {
case ACP70_PCI_ID:
case ACP71_PCI_ID:
+ sdw0_wake_en = snd_sof_dsp_read(sdev, ACP_DSP_BAR, ACP70_SW0_WAKE_EN);
+ sdw1_wake_en = snd_sof_dsp_read(sdev, ACP_DSP_BAR, ACP70_SW1_WAKE_EN);
+ if (sdw0_wake_en || sdw1_wake_en)
+ snd_sof_dsp_update_bits(sdev, ACP_DSP_BAR, ACP70_EXTERNAL_INTR_CNTL1,
+ ACP70_SDW_HOST_WAKE_MASK, ACP70_SDW_HOST_WAKE_MASK);
+
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP70_PME_EN, 1);
break;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 289/816] ASoC: SOF: amd: add soundwire wake irq handling
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (287 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 288/816] ASoC: SOF: amd: enable soundwire host wake irq mask Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 290/816] ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler Greg Kroah-Hartman
` (531 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Ranjani Sridharan,
Bard Liao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit 1f41bf67bfe3721a4d4d36695302801cf70b5a70 ]
Add SoundWire wake interrupt handling for ACP7.0 & ACP7.1
platforms.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250502154445.3008598-9-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 34ea81a7f284 ("ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/acp-dsp-offset.h | 4 ++
sound/soc/sof/amd/acp.c | 73 +++++++++++++++++++++++++++++-
sound/soc/sof/amd/acp.h | 4 ++
3 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sof/amd/acp-dsp-offset.h b/sound/soc/sof/amd/acp-dsp-offset.h
index e77554f74c20d..08583a91afbc4 100644
--- a/sound/soc/sof/amd/acp-dsp-offset.h
+++ b/sound/soc/sof/amd/acp-dsp-offset.h
@@ -135,5 +135,9 @@
#define ACP70_SW0_WAKE_EN 0x1458
#define ACP70_SW1_WAKE_EN 0x1460
#define ACP70_SDW_HOST_WAKE_MASK 0x0C00000
+#define ACP70_SDW0_HOST_WAKE_STAT BIT(24)
+#define ACP70_SDW1_HOST_WAKE_STAT BIT(25)
+#define ACP70_SDW0_PME_STAT BIT(26)
+#define ACP70_SDW1_PME_STAT BIT(27)
#endif
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 244a9e0a8665e..33eb03051a7b2 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -398,6 +398,69 @@ static int acp_memory_init(struct snd_sof_dev *sdev)
return 0;
}
+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);
+ 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);
+ adata->acp70_sdw1_wake_event = 0;
+ }
+}
+
+static int amd_sof_check_and_handle_acp70_sdw_wake_irq(struct snd_sof_dev *sdev)
+{
+ const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata);
+ struct acp_dev_data *adata = sdev->pdata->hw_pdata;
+ u32 ext_intr_stat1;
+ int irq_flag = 0;
+ bool sdw_wake_irq = false;
+
+ ext_intr_stat1 = snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->ext_intr_stat1);
+ if (ext_intr_stat1 & ACP70_SDW0_HOST_WAKE_STAT) {
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_stat1,
+ ACP70_SDW0_HOST_WAKE_STAT);
+ adata->acp70_sdw0_wake_event = true;
+ sdw_wake_irq = true;
+ }
+
+ if (ext_intr_stat1 & ACP70_SDW1_HOST_WAKE_STAT) {
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_stat1,
+ ACP70_SDW1_HOST_WAKE_STAT);
+ adata->acp70_sdw1_wake_event = true;
+ sdw_wake_irq = true;
+ }
+
+ if (ext_intr_stat1 & ACP70_SDW0_PME_STAT) {
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP70_SW0_WAKE_EN, 0);
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_stat1, ACP70_SDW0_PME_STAT);
+ adata->acp70_sdw0_wake_event = true;
+ sdw_wake_irq = true;
+ }
+
+ if (ext_intr_stat1 & ACP70_SDW1_PME_STAT) {
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP70_SW1_WAKE_EN, 0);
+ snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->ext_intr_stat1, ACP70_SDW1_PME_STAT);
+ adata->acp70_sdw1_wake_event = true;
+ sdw_wake_irq = true;
+ }
+
+ if (sdw_wake_irq) {
+ amd_sof_handle_acp70_sdw_wake_event(adata);
+ irq_flag = 1;
+ }
+ return irq_flag;
+}
+
static irqreturn_t acp_irq_thread(int irq, void *context)
{
struct snd_sof_dev *sdev = context;
@@ -430,7 +493,7 @@ static irqreturn_t acp_irq_handler(int irq, void *dev_id)
struct acp_dev_data *adata = sdev->pdata->hw_pdata;
unsigned int base = desc->dsp_intr_base;
unsigned int val;
- int irq_flag = 0;
+ int irq_flag = 0, wake_irq_flag = 0;
val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, base + DSP_SW_INTR_STAT_OFFSET);
if (val & ACP_DSP_TO_HOST_IRQ) {
@@ -468,8 +531,14 @@ static irqreturn_t acp_irq_handler(int irq, void *dev_id)
schedule_work(&amd_manager->amd_sdw_irq_thread);
irq_flag = 1;
}
+ switch (adata->pci_rev) {
+ case ACP70_PCI_ID:
+ case ACP71_PCI_ID:
+ wake_irq_flag = amd_sof_check_and_handle_acp70_sdw_wake_irq(sdev);
+ break;
+ }
}
- if (irq_flag)
+ if (irq_flag || wake_irq_flag)
return IRQ_HANDLED;
else
return IRQ_NONE;
diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h
index dde04ecadbd85..3380a761dcf67 100644
--- a/sound/soc/sof/amd/acp.h
+++ b/sound/soc/sof/amd/acp.h
@@ -263,6 +263,10 @@ struct acp_dev_data {
bool is_dram_in_use;
bool is_sram_in_use;
bool sdw_en_stat;
+ /* acp70_sdw0_wake_event flag set to true when wake irq asserted for SW0 instance */
+ bool acp70_sdw0_wake_event;
+ /* acp70_sdw1_wake_event flag set to true when wake irq asserted for SW1 instance */
+ bool acp70_sdw1_wake_event;
unsigned int pci_rev;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 290/816] ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (288 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 289/816] ASoC: SOF: amd: add soundwire wake irq handling Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 291/816] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output Greg Kroah-Hartman
` (530 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Mark Brown,
Sasha Levin
6.12-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 33eb03051a7b2..a2abcb6d090ce 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -403,16 +403,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;
}
}
@@ -504,10 +508,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;
}
@@ -524,11 +530,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] 825+ messages in thread
* [PATCH 6.12 291/816] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (289 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 290/816] ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 292/816] btrfs: zoned: only change active zone counter on successful (de)activation Greg Kroah-Hartman
` (529 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Samuel Leyva, Mark Brown,
Sasha Levin
6.12-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 d39907b65afd2..47cc0b1c71e13 100644
--- a/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
+++ b/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
@@ -19,6 +19,7 @@
#include <linux/input.h>
#include <linux/io.h>
#include <linux/acpi.h>
+#include <linux/delay.h>
#include <linux/dmi.h>
#include "../acp-mach.h"
#include "acp3x-es83xx.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"},
};
@@ -184,10 +183,13 @@ static int acp3x_es83xx_speaker_power_event(struct snd_soc_dapm_widget *w,
struct acp3x_es83xx_private *priv = get_mach_priv(w->dapm->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] 825+ messages in thread
* [PATCH 6.12 292/816] btrfs: zoned: only change active zone counter on successful (de)activation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (290 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 291/816] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 293/816] btrfs: zoned: dont wait for ordered extents in do_zone_finish() Greg Kroah-Hartman
` (528 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Vacek, Johannes Thumshirn,
David Sterba, Sasha Levin
6.12-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 b4bb02bd99ae5..e0917a37e4cc6 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1095,11 +1095,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;
@@ -1111,23 +1113,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,
@@ -2340,6 +2348,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))
@@ -2390,12 +2399,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--;
}
@@ -2454,6 +2463,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)
@@ -2475,9 +2485,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] 825+ messages in thread
* [PATCH 6.12 293/816] btrfs: zoned: dont wait for ordered extents in do_zone_finish()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (291 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 292/816] btrfs: zoned: only change active zone counter on successful (de)activation Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 294/816] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
` (527 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Naohiro Aota, Johannes Thumshirn,
David Sterba, Sasha Levin
6.12-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 e0917a37e4cc6..ead999f072816 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -2535,9 +2535,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] 825+ messages in thread
* [PATCH 6.12 294/816] NFSv4.1: retain MDS I/O until both thresholds are met
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (292 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 293/816] btrfs: zoned: dont wait for ordered extents in do_zone_finish() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 295/816] NFS: honor UTIME_NOW atime with explicit mtime Greg Kroah-Hartman
` (526 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 33e8f8e816bd5..b48be785ebd5a 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2059,7 +2059,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] 825+ messages in thread
* [PATCH 6.12 295/816] NFS: honor UTIME_NOW atime with explicit mtime
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (293 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 294/816] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 296/816] nfs: fix utimensat() for atime with delegated timestamps Greg Kroah-Hartman
` (525 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 a1e65cf3d8c9a..28f7acecb3f82 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -656,7 +656,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] 825+ messages in thread
* [PATCH 6.12 296/816] nfs: fix utimensat() for atime with delegated timestamps
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (294 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 295/816] NFS: honor UTIME_NOW atime with explicit mtime Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 297/816] NFS: update ctime for atime-only UTIME_NOW requests Greg Kroah-Hartman
` (524 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Olga Kornievskaia, Jeff Layton,
Trond Myklebust, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@kernel.org>
[ Upstream commit 16d99dce938ecbbc703843a31fb951acca46af27 ]
xfstest generic/221 is failing with delegated timestamps enabled. When
the client holds a WRITE_ATTRS_DELEG delegation, and a userland process
does a utimensat() for only the atime, the ctime is not properly
updated. The problem is that the client tries to cache the atime update,
but there is no mtime update, so the delegated attribute update never
updates the ctime.
Delegated timestamps don't have a mechanism to update the ctime in
accordance with atime-only changes due to utimensat() and the like.
Change the client to issue an RPC in this case, so that the ctime gets
properly updated alongside the atime.
Fixes: 40f45ab3814f ("NFS: Further fixes to attribute delegation a/mtime changes")
Reported-by: Olga Kornievskaia <aglo@umich.edu>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Stable-dep-of: a38d7cc8c90f ("NFS: update ctime for atime-only UTIME_NOW requests")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/inode.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 28f7acecb3f82..f29c4ff16b29f 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -747,14 +747,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 (uid_eq(task_uid, owner_uid)) {
- spin_lock(&inode->i_lock);
- nfs_set_timestamps_to_ts(inode, attr);
- spin_unlock(&inode->i_lock);
- attr->ia_valid &= ~(ATTR_ATIME|ATTR_ATIME_SET);
- }
- } else {
+ if (!(attr->ia_valid & ATTR_ATIME_SET)) {
nfs_update_delegated_atime(inode);
attr->ia_valid &= ~ATTR_ATIME;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 297/816] NFS: update ctime for atime-only UTIME_NOW requests
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (295 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 296/816] nfs: fix utimensat() for atime with delegated timestamps Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 298/816] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
` (523 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 f29c4ff16b29f..016c19906bf1e 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -747,7 +747,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] 825+ messages in thread
* [PATCH 6.12 298/816] NFS: Fix inverted cross-directory rename check
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (296 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 297/816] NFS: update ctime for atime-only UTIME_NOW requests Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 299/816] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
` (522 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 3b07cda9a8f43..1824cc9040d02 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2701,7 +2701,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] 825+ messages in thread
* [PATCH 6.12 299/816] NFS: restore directory index when resuming readdir
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (297 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 298/816] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 300/816] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
` (521 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 1824cc9040d02..2026cab075817 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] 825+ messages in thread
* [PATCH 6.12 300/816] SUNRPC: wake poll waiters when an empty pipe is unlinked
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (298 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 299/816] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 301/816] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
` (520 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Jeff Layton, NeilBrown,
Anna Schumaker, Sasha Levin
6.12-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 76a9d86ab8ac7..45926b8798862 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -190,6 +190,7 @@ rpc_close_pipes(struct inode *inode)
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] 825+ messages in thread
* [PATCH 6.12 301/816] SUNRPC: preserve timeout policy when cloning clients
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (299 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 300/816] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 302/816] SUNRPC: preserve transport security " Greg Kroah-Hartman
` (519 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 f23a17ebd0391..bda5f8331b9fb 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -651,6 +651,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] 825+ messages in thread
* [PATCH 6.12 302/816] SUNRPC: preserve transport security policy when cloning clients
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (300 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 301/816] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 303/816] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
` (518 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 bda5f8331b9fb..80a4e2ca323c5 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -651,6 +651,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] 825+ messages in thread
* [PATCH 6.12 303/816] SUNRPC: Balance switch queue length on transport removal
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (301 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 302/816] SUNRPC: preserve transport security " Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 304/816] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
` (517 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 80a4e2ca323c5..81e5e756d8ffa 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2241,6 +2241,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] 825+ messages in thread
* [PATCH 6.12 304/816] SUNRPC: Balance queue accounting when relocating a task
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (302 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 303/816] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 305/816] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
` (516 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss, Anna Schumaker,
Sasha Levin
6.12-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 81e5e756d8ffa..745123c75cf5f 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1188,7 +1188,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] 825+ messages in thread
* [PATCH 6.12 305/816] ublk: publish a new device by its id only once it is set up
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (303 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 304/816] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 306/816] net: skbuff: preserve fclone lifetime when freeing stolen heads Greg Kroah-Hartman
` (515 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Korenberg, Ming Lei, Jens Axboe,
Sasha Levin
6.12-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 f89b36017d979..ae954ee1e3529 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -2221,14 +2221,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);
@@ -2239,6 +2243,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);
@@ -2658,6 +2675,8 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd)
* 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_free_tag_set:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 306/816] net: skbuff: preserve fclone lifetime when freeing stolen heads
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (304 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 305/816] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 307/816] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
` (514 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jakub Kicinski,
Sasha Levin
6.12-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 fb95a9c627b61..a203cc89d33fa 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1488,6 +1488,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);
}
@@ -6056,7 +6060,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] 825+ messages in thread
* [PATCH 6.12 307/816] i40e: xsk: fix multi-buffer XDP_PASS skb construction
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (305 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 306/816] net: skbuff: preserve fclone lifetime when freeing stolen heads Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 308/816] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
` (513 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 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
6.12-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 4e885df789ef4..a1892373e9216 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
@@ -317,22 +317,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] 825+ messages in thread
* [PATCH 6.12 308/816] af_unix: Remove gc_in_progress check in unix_peek_fpl().
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (306 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 307/816] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 309/816] net/mlx5: Bridge, fix bogus MDB offload errors Greg Kroah-Hartman
` (512 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qihang Tang, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.12-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 338769200065e..9c1afd8507c57 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -317,9 +317,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] 825+ messages in thread
* [PATCH 6.12 309/816] net/mlx5: Bridge, fix bogus MDB offload errors
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (307 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 308/816] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 310/816] ipv6: ignore link state in gateway check Greg Kroah-Hartman
` (511 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gal Pressman, Jianbo Liu,
Cosmin Ratiu, Tariq Toukan, Jakub Kicinski, Sasha Levin
6.12-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 684154914cf83..a89518ed75264 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
@@ -1864,26 +1864,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] 825+ messages in thread
* [PATCH 6.12 310/816] ipv6: ignore link state in gateway check
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (308 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 309/816] net/mlx5: Bridge, fix bogus MDB offload errors Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 311/816] team: Add matching error label for failed action Greg Kroah-Hartman
` (510 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yaroslav Dudkov, Hangbin Liu,
Ido Schimmel, Jakub Kicinski, Sasha Levin
6.12-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 ced56c191dd73..281975e0887fd 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3449,9 +3449,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] 825+ messages in thread
* [PATCH 6.12 311/816] team: Add matching error label for failed action
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (309 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 310/816] ipv6: ignore link state in gateway check Greg Kroah-Hartman
@ 2026-11-25 14:30 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 312/816] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
` (509 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:30 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nikola Z. Ivanov, Simon Horman,
Jiri Pirko, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikola Z. Ivanov <zlatistiv@gmail.com>
[ Upstream commit aee0f01b4f118844cb126a5f27e91c2adf087c59 ]
Follow the "action" - "err_action" pairing of labels
found across the source code of team net device.
Currently in team_port_add the err_set_slave_promisc
label is reused for exiting on error when setting
allmulti level of the new slave.
Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://patch.msgid.link/20251128072544.223645-1-zlatistiv@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: ff618cb00a64 ("team: fix promisc/allmulti leak in team_port_add error path")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/team/team_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
index 479d5a51152ef..a688f122661d2 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -1316,7 +1316,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
if (err) {
if (dev->flags & IFF_PROMISC)
dev_set_promiscuity(port_dev, -1);
- goto err_set_slave_promisc;
+ goto err_set_slave_allmulti;
}
}
@@ -1343,6 +1343,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
return 0;
err_set_dev_type:
+err_set_slave_allmulti:
err_set_slave_promisc:
__team_option_inst_del_port(team, port);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 312/816] team: fix promisc/allmulti leak in team_port_add error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (310 preceding siblings ...)
2026-11-25 14:30 ` [PATCH 6.12 311/816] team: Add matching error label for failed action Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 313/816] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
` (508 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Hangbin Liu,
Jakub Kicinski, Sasha Levin
6.12-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 a688f122661d2..5a798a2134fbd 100644
--- a/drivers/net/team/team_core.c
+++ b/drivers/net/team/team_core.c
@@ -1313,11 +1313,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);
@@ -1343,7 +1340,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] 825+ messages in thread
* [PATCH 6.12 313/816] net/mlx5: Lag, free steering resources on LAG destroy failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (311 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 312/816] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 314/816] net: protect negative destination advice with RCU Greg Kroah-Hartman
` (507 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Bloch, Shay Drori, Tariq Toukan,
Jakub Kicinski, Sasha Levin
6.12-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 f055aac1b436a..dd0da4081bad1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
@@ -734,7 +734,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)) {
@@ -744,7 +743,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] 825+ messages in thread
* [PATCH 6.12 314/816] net: protect negative destination advice with RCU
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (312 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 313/816] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 315/816] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
` (506 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jiayuan Chen, Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.12-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 79e409bf3d13a..6f1da04c9794b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2135,10 +2135,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] 825+ messages in thread
* [PATCH 6.12 315/816] net: require a full socket in sock_confirm_neigh()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (313 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 314/816] net: protect negative destination advice with RCU Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 316/816] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
` (505 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.12-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 6f1da04c9794b..0c08d70490e31 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2190,6 +2190,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))
@@ -2201,7 +2209,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);
}
@@ -2832,14 +2841,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] 825+ messages in thread
* [PATCH 6.12 316/816] ipvlan: make outbound skb headers writable
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (314 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 315/816] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 317/816] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
` (504 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jakub Kicinski, Sasha Levin
6.12-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 268ea41a17d52..fea77f2855e8c 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -425,7 +425,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);
@@ -491,7 +492,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] 825+ messages in thread
* [PATCH 6.12 317/816] wifi: mac80211: mesh: dont linearize SKBs unnecessarily
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (315 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 316/816] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 318/816] wifi: mac80211: abort chanswitch when leaving an IBSS Greg Kroah-Hartman
` (503 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.12-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 1af24cd4d88f4..415d16ed08084 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2795,9 +2795,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) {
@@ -2808,6 +2805,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] 825+ messages in thread
* [PATCH 6.12 318/816] wifi: mac80211: abort chanswitch when leaving an IBSS
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (316 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 317/816] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 319/816] net: fix mac_len of skbs copied by generic XDP Greg Kroah-Hartman
` (502 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luka Gejak, Mehmet Fide,
Johannes Berg, Sasha Levin
6.12-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 9df43cd76979e..96fad8c057e7c 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -683,6 +683,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] 825+ messages in thread
* [PATCH 6.12 319/816] net: fix mac_len of skbs copied by generic XDP
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (317 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 318/816] wifi: mac80211: abort chanswitch when leaving an IBSS Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 320/816] ovl: allow idmapping overlay mounts Greg Kroah-Hartman
` (501 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tianyi Gao,
Toke Høiland-Jørgensen, Paolo Abeni, Sasha Levin
6.12-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 a203cc89d33fa..5c7af2ce14a80 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -964,6 +964,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] 825+ messages in thread
* [PATCH 6.12 320/816] ovl: allow idmapping overlay mounts
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (318 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 319/816] net: fix mac_len of skbs copied by generic XDP Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 321/816] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
` (500 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Amir Goldstein,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit adedb6a00a1e4c77b1de9ea1f63b5008ad0c21f5 ]
Now that every overlay inode operation honors the overlay mount idmap,
allow the merged overlay mount itself to be idmapped by setting
FS_ALLOW_IDMAP on ovl_fs_type. mount_setattr(MOUNT_ATTR_IDMAP) can
then apply an idmapping to an overlay mount, exposing the merged tree
under a different ownership view.
The composition is clean because overlayfs already normalizes every
underlying id through the relevant layer idmap when it copies
attributes into the overlay inode (ovl_copyattr()); the overlay inode's
i_{u,g}id are thus "overlay-final" ids. The overlay mount idmap
composes on top of that pivot: it is applied to (getattr) and removed
from (setattr, create) those ids at the overlay-inode boundary -
permission, getattr, setattr, ACL owner checks and inode_init_owner() -
while the underlying layers keep being accessed with the mounter's
credentials through their own, possibly idmapped, mounts. The mount
idmap therefore only changes how the caller sees the overlay inode and
never widens the mounter's access to the layers.
This is deliberately the final code patch of the series: only once
every operation honors the mount idmap is it safe to make overlay
mounts idmappable.
Link: https://patch.msgid.link/20260615-work-idmapped-overlayfs-v1-6-7381632aa402@kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: cb6c084182d4 ("ovl: release the upperdir/workdir in-use locks before the umount sync")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index b0cf671b4200d..6a9db5b742598 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1491,7 +1491,7 @@ struct file_system_type ovl_fs_type = {
.name = "overlay",
.init_fs_context = ovl_init_fs_context,
.parameters = ovl_parameter_spec,
- .fs_flags = FS_USERNS_MOUNT,
+ .fs_flags = FS_USERNS_MOUNT | FS_ALLOW_IDMAP,
.kill_sb = kill_anon_super,
};
MODULE_ALIAS_FS("overlay");
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 321/816] ovl: release the upperdir/workdir in-use locks before the umount sync
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (319 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 320/816] ovl: allow idmapping overlay mounts Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 322/816] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
` (499 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miklos Szeredi, Amir Goldstein,
Pavel Tikhomirov, Denis V. Lunev, Sasha Levin
6.12-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 53d1f0e0c924a..a6fd11315a6e7 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -548,6 +548,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 d8b1a43375038..17656a6d183ff 100644
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -742,15 +742,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 6a9db5b742598..b847c475f62ba 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1486,13 +1486,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 4c0881f0b75e0..b8adda549c473 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -1042,6 +1042,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] 825+ messages in thread
* [PATCH 6.12 322/816] bonding: fix slave_cnt leak on XDP enslave failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (320 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 321/816] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 323/816] NFSv4: wake blocking lock waiters when a delegated lock is released Greg Kroah-Hartman
` (498 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jakub Kicinski,
Sasha Levin
6.12-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 75332e50fcc51..ee95b5a9fb8ec 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2363,7 +2363,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 = {
@@ -2377,14 +2377,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);
@@ -2406,6 +2406,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] 825+ messages in thread
* [PATCH 6.12 323/816] NFSv4: wake blocking lock waiters when a delegated lock is released
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (321 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 322/816] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 324/816] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
` (497 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Olga Kornievskaia, Anna Schumaker,
Sasha Levin
6.12-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 cc14a62a23d74..32a129d86925d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7273,8 +7273,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;
@@ -7696,8 +7703,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] 825+ messages in thread
* [PATCH 6.12 324/816] tun: delete the flow entries of the moved queue on detach
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (322 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 323/816] NFSv4: wake blocking lock waiters when a delegated lock is released Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 325/816] fbnic: Wait for the outbound flush to complete on mailbox teardown Greg Kroah-Hartman
` (496 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Umang Pokhriyal, Willem de Bruijn,
Jakub Kicinski, Sasha Levin
6.12-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 461b02721aab9..2ae337ff384e8 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -671,7 +671,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);
tun_set_real_num_queues(tun);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 325/816] fbnic: Wait for the outbound flush to complete on mailbox teardown
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (323 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 324/816] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 326/816] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist Greg Kroah-Hartman
` (495 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Duyck, Jakub Kicinski,
Sasha Levin
6.12-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 2da0f5f8882bc..24e29755211e9 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_csr.h
@@ -699,6 +699,10 @@ enum {
#define FBNIC_MAC_STAT_TX_BROADCAST_H 0x11a4d /* 0x46934 */
/* 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 175ad17bd47b5..0bc6d495bfb59 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"
@@ -173,10 +174,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] 825+ messages in thread
* [PATCH 6.12 326/816] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (324 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 325/816] fbnic: Wait for the outbound flush to complete on mailbox teardown Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 327/816] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
` (494 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Duyck, Willem de Bruijn,
Jakub Kicinski, Sasha Levin
6.12-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 b0e328fc8adf6..bd1b0f10d9374 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3791,6 +3791,18 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
if (!skb_frags_readable(skb))
goto out_kfree_skb;
+ /* 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] 825+ messages in thread
* [PATCH 6.12 327/816] net/mlx5: macsec: Dont remove fs_id when adding a rule fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (325 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 326/816] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 328/816] dpll: notify about a reference sync pair only if it was added Greg Kroah-Hartman
` (493 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Changyul Lee, Tariq Toukan,
Jakub Kicinski, Sasha Levin
6.12-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 3d2473d9f3eac..41cf27867fa85 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -768,13 +768,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;
@@ -795,6 +791,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 *
@@ -887,7 +892,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);
@@ -1652,15 +1657,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]);
@@ -1678,6 +1679,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,
@@ -1837,7 +1847,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] 825+ messages in thread
* [PATCH 6.12 328/816] dpll: notify about a reference sync pair only if it was added
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (326 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 327/816] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 329/816] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
` (492 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ivan Vecera, Vadim Fedorenko,
Petr Oros, Jakub Kicinski, Sasha Levin
6.12-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 0a8db4dc25786..aaa576562ae42 100644
--- a/drivers/dpll/dpll_core.c
+++ b/drivers/dpll/dpll_core.c
@@ -999,7 +999,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] 825+ messages in thread
* [PATCH 6.12 329/816] ipv4: route: dont blackhole in-use routes when retiring fnhe routes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (327 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 328/816] dpll: notify about a reference sync pair only if it was added Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 330/816] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
` (491 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Chase Hiltz,
Ido Schimmel, Jakub Kicinski, Sasha Levin
6.12-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 9706d36c8388c..6bfac6239fff8 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -571,6 +571,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;
@@ -578,14 +589,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);
}
}
@@ -1498,10 +1507,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] 825+ messages in thread
* [PATCH 6.12 330/816] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (328 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 329/816] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 331/816] net: skbuff: uncharge trimmed zerocopy frags on error Greg Kroah-Hartman
` (490 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yuho Choi, Jakub Kicinski,
Sasha Levin
6.12-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] 825+ messages in thread
* [PATCH 6.12 331/816] net: skbuff: uncharge trimmed zerocopy frags on error
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (329 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 330/816] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 332/816] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
` (489 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Chris Mason,
Willem de Bruijn, Jakub Kicinski, Sasha Levin
6.12-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 5c7af2ce14a80..341cc822933f1 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1886,6 +1886,7 @@ int skb_zerocopy_iter_stream(struct sock *sk, struct sk_buff *skb,
struct msghdr *msg, int len,
struct ubuf_info *uarg)
{
+ unsigned int orig_truesize = skb->truesize;
int err, orig_len = skb->len;
if (uarg->ops->link_skb) {
@@ -1905,12 +1906,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);
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] 825+ messages in thread
* [PATCH 6.12 332/816] net/mlx5e: Serialize TC and IPsec offload exclusion counters
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (330 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 331/816] net: skbuff: uncharge trimmed zerocopy frags on error Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 333/816] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
` (488 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Jianbo Liu,
Dragos Tatulea, Tariq Toukan, Jakub Kicinski, Sasha Levin
6.12-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 c48eeb399a422..e21c4f3c52967 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
@@ -2122,45 +2122,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 531127dbe800e..05a4d791d21b2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -4793,16 +4793,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)
@@ -4810,7 +4813,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 0496f2e3f2a23..2c3a742ba2477 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1839,6 +1839,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 aa38f0f281503..74a7e16324487 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -825,8 +825,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] 825+ messages in thread
* [PATCH 6.12 333/816] fou: gue: check IP version of held packets for direct IP encapsulation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (331 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 332/816] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 334/816] net: rfs: add sock_rps_delete_flow() helper Greg Kroah-Hartman
` (487 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jakub Kicinski, Sasha Levin
6.12-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 f1cfd5381e45b..37cfbece08c54 100644
--- a/net/ipv4/fou_core.c
+++ b/net/ipv4/fou_core.c
@@ -365,6 +365,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] 825+ messages in thread
* [PATCH 6.12 334/816] net: rfs: add sock_rps_delete_flow() helper
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (332 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 333/816] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 335/816] tcp: Do not allow buggy transitions between ehash and lhash2 Greg Kroah-Hartman
` (486 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Octavian Purdila,
Neal Cardwell, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 9cd5ef0b8c04c46a15c8f5d002f02ea0d0477790 ]
RFS can exhibit lower performance for workloads using short-lived
flows and a small set of 4-tuple.
This is often the case for load-testers, using a pair of hosts,
if the server has a single listener port.
Typical use case :
Server : tcp_crr -T128 -F1000 -6 -U -l30 -R 14250
Client : tcp_crr -T128 -F1000 -6 -U -l30 -c -H server | grep local_throughput
This is because RFS global hash table contains stale information,
when the same RSS key is recycled for another socket and another cpu.
Make sure to undo the changes and go back to initial state when
a flow is disconnected.
Performance of the above test is increased by 22 %,
going from 372604 transactions per second to 457773.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Octavian Purdila <tavip@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20250515100354.3339920-1-edumazet@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/rps.h | 24 ++++++++++++++++++++++++
net/ipv4/inet_hashtables.c | 6 ++++--
net/ipv4/udp.c | 2 ++
net/sctp/socket.c | 2 +-
4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/include/net/rps.h b/include/net/rps.h
index a93401d23d66e..6e98aa7655afe 100644
--- a/include/net/rps.h
+++ b/include/net/rps.h
@@ -122,6 +122,30 @@ static inline void sock_rps_record_flow(const struct sock *sk)
#endif
}
+static inline void sock_rps_delete_flow(const struct sock *sk)
+{
+#ifdef CONFIG_RPS
+ struct rps_sock_flow_table *table;
+ u32 hash, index;
+
+ if (!static_branch_unlikely(&rfs_needed))
+ return;
+
+ hash = READ_ONCE(sk->sk_rxhash);
+ if (!hash)
+ return;
+
+ rcu_read_lock();
+ table = rcu_dereference(net_hotdata.rps_sock_flow_table);
+ if (table) {
+ index = hash & table->mask;
+ if (READ_ONCE(table->ents[index]) != RPS_NO_CPU)
+ WRITE_ONCE(table->ents[index], RPS_NO_CPU);
+ }
+ rcu_read_unlock();
+#endif
+}
+
static inline u32 rps_input_queue_tail_incr(struct softnet_data *sd)
{
#ifdef CONFIG_RPS
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index e7b312f7cd98f..7035e35bea5e1 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -23,11 +23,12 @@
#if IS_ENABLED(CONFIG_IPV6)
#include <net/inet6_hashtables.h>
#endif
-#include <net/secure_seq.h>
#include <net/hotdata.h>
#include <net/ip.h>
-#include <net/tcp.h>
+#include <net/rps.h>
+#include <net/secure_seq.h>
#include <net/sock_reuseport.h>
+#include <net/tcp.h>
u32 inet_ehashfn(const struct net *net, const __be32 laddr,
const __u16 lport, const __be32 faddr,
@@ -783,6 +784,7 @@ void inet_unhash(struct sock *sk)
if (sk_unhashed(sk))
return;
+ sock_rps_delete_flow(sk);
if (sk->sk_state == TCP_LISTEN) {
struct inet_listen_hashbucket *ilb2;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 22eee4fdd5d8d..4fc8263286f2e 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -119,6 +119,7 @@
#if IS_ENABLED(CONFIG_IPV6)
#include <net/ipv6_stubs.h>
#endif
+#include <net/rps.h>
struct udp_table udp_table __read_mostly;
EXPORT_SYMBOL(udp_table);
@@ -2050,6 +2051,7 @@ void udp_lib_unhash(struct sock *sk)
struct udp_table *udptable = udp_get_table_prot(sk);
struct udp_hslot *hslot, *hslot2;
+ sock_rps_delete_flow(sk);
hslot = udp_hashslot(udptable, sock_net(sk),
udp_sk(sk)->udp_port_hash);
hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash);
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 7734ca92335aa..3c8b9b8b07e03 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -8390,7 +8390,7 @@ static int sctp_hash(struct sock *sk)
static void sctp_unhash(struct sock *sk)
{
- /* STUB */
+ sock_rps_delete_flow(sk);
}
/* Check if port is acceptable. Possibly find first available port.
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 335/816] tcp: Do not allow buggy transitions between ehash and lhash2.
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (333 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 334/816] net: rfs: add sock_rps_delete_flow() helper Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 336/816] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF Greg Kroah-Hartman
` (485 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Michal Luczaj,
Hyunwoo Kim, Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.12-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 e8ee9164ec5ac..2ff01a8fbef2b 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -101,6 +101,7 @@ struct inet_connection_sock {
__u32 icsk_rto_min;
__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 64093410f6d52..5b6436e6f242c 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -1304,6 +1304,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 7035e35bea5e1..a597c176a5e45 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -744,6 +744,11 @@ int __inet_hash(struct sock *sk, struct sock *osk)
return 0;
}
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);
@@ -785,6 +790,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;
@@ -1017,6 +1025,9 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
int step, l3mdev;
u32 index;
+ if (unlikely(inet_csk(sk)->unhashed_state == TCP_LISTEN))
+ return -EINVAL;
+
if (port) {
local_bh_disable();
ret = check_established(death_row, sk, port, NULL);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 336/816] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (334 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 335/816] tcp: Do not allow buggy transitions between ehash and lhash2 Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 337/816] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
` (484 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Jiayuan Chen, Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.12-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 d4b7caf86eee3..eb8d24964e2f6 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] 825+ messages in thread
* [PATCH 6.12 337/816] udp: do not use a cross-family sk_rx_dst in early demux
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (335 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 336/816] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 338/816] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
` (483 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.12-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 4fc8263286f2e..af7afbf7a0c64 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2678,8 +2678,11 @@ int 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 db67fc05ca51a..296ea0bb36369 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1180,8 +1180,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] 825+ messages in thread
* [PATCH 6.12 338/816] net: gro: compare skb->protocol in gro_list_prepare()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (336 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 337/816] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 339/816] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
` (482 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Willem de Bruijn,
Eric Dumazet, Jakub Kicinski, Sasha Levin
6.12-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 6a730b4593e1c..f0817aa5294c3 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -379,6 +379,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] 825+ messages in thread
* [PATCH 6.12 339/816] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (337 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 338/816] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 340/816] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
` (481 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anandu Padinhare, Lorenzo Bianconi,
Jakub Kicinski, Sasha Levin
6.12-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 16eec53ee9222..e17a203290552 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5230,7 +5230,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] 825+ messages in thread
* [PATCH 6.12 340/816] udp: check frag_list IP family before using skb_segment_list()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (338 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 339/816] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 341/816] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
` (480 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Willem de Bruijn, Dave Miller, Sasha Levin
6.12-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 04246d1f8b3e7..24f2cd86bbb5b 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -359,9 +359,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] 825+ messages in thread
* [PATCH 6.12 341/816] drm/bridge: sii902x: validate I2S data lane values
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (339 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 340/816] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 342/816] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
` (479 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Luca Ceresoli,
Sasha Levin
6.12-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 7f91b0db161ed..eaa35134c4f2e 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -875,9 +875,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] 825+ messages in thread
* [PATCH 6.12 342/816] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (340 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 341/816] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 343/816] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
` (478 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kavitha Daula, Juergen Gross,
Sasha Levin
6.12-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 04a6b470b15df..51df0772f989d 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>
@@ -1360,12 +1361,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] 825+ messages in thread
* [PATCH 6.12 343/816] ASoC: max98090: keep the MIC boost across mic input power-up
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (341 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 342/816] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 344/816] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
` (477 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, LiangCheng Wang, Mark Brown,
Sasha Levin
6.12-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 9253707bccde9..8d5a8bfde13b9 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;
@@ -1108,11 +1108,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] 825+ messages in thread
* [PATCH 6.12 344/816] tcp: Drop any segments if DEFER_CONNECT is set.
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (342 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 343/816] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 345/816] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
` (476 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.12-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 547adefba7ea9..eb8f824254866 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6832,6 +6832,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 4d1b3c4602a36..293a3b2bdd9e3 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -539,7 +539,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 431d958272b8d..d8d3a688c0104 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -418,7 +418,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] 825+ messages in thread
* [PATCH 6.12 345/816] amt: tear down every amt device on an unregistering lower
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (343 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 344/816] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 346/816] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
` (475 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Omar Ramadan, Simon Horman,
Jakub Kicinski, Sasha Levin
6.12-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 a4255eb000840..589d44b31c381 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -3379,22 +3379,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)
{
@@ -3404,26 +3388,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] 825+ messages in thread
* [PATCH 6.12 346/816] net: ena: Keep the RX buffer mapped if skb allocation fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (344 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 345/816] 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 6.12 347/816] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
` (474 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 10e3e8e1898fc..729fd2b12c63e 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1032,6 +1032,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);
@@ -1039,10 +1043,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] 825+ messages in thread
* [PATCH 6.12 347/816] net: ena: avoid RX copybreak for multi-descriptor packets
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (345 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 346/816] 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 6.12 348/816] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
` (473 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 729fd2b12c63e..6253b86c52779 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1009,7 +1009,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;
@@ -1316,7 +1316,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] 825+ messages in thread
* [PATCH 6.12 348/816] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (346 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 347/816] 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 6.12 349/816] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
` (472 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 2ae337ff384e8..893746d4c8d0f 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -3264,6 +3264,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] 825+ messages in thread
* [PATCH 6.12 349/816] tls: fix async encryption race on weakly ordered architectures
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (347 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 348/816] 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 6.12 350/816] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
` (471 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 dad093a3a793d..bc2848d79c7d8 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] 825+ messages in thread
* [PATCH 6.12 350/816] igmp: use the joined device when leaving a multicast group
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (348 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 349/816] 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 6.12 351/816] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
` (470 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 e827537ec15b0..c2105be6b2e69 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2355,6 +2355,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] 825+ messages in thread
* [PATCH 6.12 351/816] net/mlx5: Lag, Return error when enabling MPESW without LAG support
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (349 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 350/816] 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 6.12 352/816] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
` (469 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 b0a60d2433e50..36009fb4ea5fd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
@@ -165,7 +165,7 @@ static int mlx5_lag_mpesw_queue_work(struct mlx5_core_dev *dev,
int err = 0;
if (!ldev)
- return 0;
+ return -EOPNOTSUPP;
work = kzalloc(sizeof(*work), GFP_KERNEL);
if (!work)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 352/816] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req().
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (350 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 351/816] 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 6.12 353/816] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
` (468 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 a43f082b871ed..567710d43c13f 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -900,7 +900,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] 825+ messages in thread
* [PATCH 6.12 353/816] amt: use ipv6_hdr() in amt_mldv1_leave_handler()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (351 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 352/816] 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 6.12 354/816] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
` (467 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 589d44b31c381..3d560d5dc981f 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -2129,13 +2129,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] 825+ messages in thread
* [PATCH 6.12 354/816] net: usb: cdc_ncm: dont underflow the NDP room check
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (352 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 353/816] 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 6.12 355/816] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
` (466 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 65a156ffdde96..48cb2bbec2561 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1126,7 +1126,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 */
@@ -1181,7 +1181,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] 825+ messages in thread
* [PATCH 6.12 355/816] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (353 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 354/816] 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 6.12 356/816] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
` (465 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 e21c4f3c52967..573895aa9b240 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
@@ -1739,7 +1739,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:
@@ -1752,6 +1751,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] 825+ messages in thread
* [PATCH 6.12 356/816] net: phy: c45: select BASE-T1 type for the forced speed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (354 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 355/816] 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 6.12 357/816] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
` (464 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 5695935fdce97..a5415c81a92ec 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -102,6 +102,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
@@ -164,6 +194,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;
@@ -177,12 +217,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 f0d3f268240d8..4ccd50ec9fd54 100644
--- a/include/uapi/linux/mdio.h
+++ b/include/uapi/linux/mdio.h
@@ -382,8 +382,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] 825+ messages in thread
* [PATCH 6.12 357/816] nsh: limit recursion in nsh_gso_segment()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (355 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 356/816] 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 6.12 358/816] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
` (463 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 358/816] tracing: skip boot kprobe setup when no events were requested
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (356 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 357/816] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 359/816] docs, kprobes: Fix bracket Greg Kroah-Hartman
` (462 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 b273611c5026c..ffc9dffe1e86c 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1985,6 +1985,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] 825+ messages in thread
* [PATCH 6.12 359/816] docs, kprobes: Fix bracket
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (357 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 358/816] 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 6.12 360/816] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
` (461 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 360/816] KEYS: do not let an unmatched key decide the search result
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (358 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 359/816] docs, kprobes: Fix bracket Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 361/816] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
` (460 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 74ed1372d22cf..c339b4073ea02 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] 825+ messages in thread
* [PATCH 6.12 361/816] ALSA: aw2-alsa: select SND_PCM
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (359 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 360/816] 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 6.12 362/816] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
` (459 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 787868c9e91b0..cb8af8b54b280 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] 825+ messages in thread
* [PATCH 6.12 362/816] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (360 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 361/816] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 363/816] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps Greg Kroah-Hartman
` (458 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 51df0772f989d..90af7a9fd6cf4 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1096,6 +1096,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;
}
@@ -1129,7 +1147,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] 825+ messages in thread
* [PATCH 6.12 363/816] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (361 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 362/816] 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 6.12 364/816] s390/zcrypt: Make apfs a real unsigned int field Greg Kroah-Hartman
` (457 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Nesterov,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit a58d647acfdc62561f3570d114025b3bf38ae41b ]
TIF_NOTIFY_SIGNAL is used to kick a task in uninterruptible sleep to
return to userspace and run task work and then go back to sleep. This
mechanism works well but breaks coredumps. dump_interrupted() only
allows fatal signals to interrupt a coredump and the whole regular write
path going to actual filesystems is impervious to TIF_NOTIFY_SIGNAL as
well.
However, both the usermodehelper pipe and the coredump socket will bail
early on TIF_NOTIFY_SIGNAL. This affects the following codepaths:
- coredump_sock_recv() -> unix_stream_read_generic()
The request/ack handshake is abandoned before any coredump data is
sent.
- anon_pipe_write() returning -ERESTARTSYS
Once the pipe is full this truncates the coredump.
- unix_stream_sendmsg() returning -ERESTARTSYS
Once the send buffer is full this truncates the coredump.
- coredump_sock_wait() -> __kernel_read()
This reports a failure that didn't happen.
- wait_for_dump_helpers() -> wait_event_interruptible()
This stops waiting for the coredump helpers.
Such truncation is entirely invisible to userspace and all uapi bits
still indicate that a successful coredump happened. A crashing process
with a bunch of file backed mappings and io_uring thrown in loses most
of the coredump data. If the NT_FILE note goes past PAGE_SIZE mappings
it's gonzo.
TIF_NOTIFY_SIGNAL is sent by io_uring for the common case. And it uses
poll without sleeping so a completion callback runs task_work_add() from
interrupt context against the task that submitted the request. This is
the task that is running the coredump. Since that task hasn't set
work_exited (it hasn't exited yet after all) TIF_NOTIFY_SIGNAL keeps
reappearing.
A coredumping task doesn't return to userspace. The task work is run at
exit. So interrupting it doesn't buy anything and just loses the
coredump which is quite valuable.
Note that this isn't specific to io_uring. There's also
klp_send_signals(), bpf_task_work_schedule_signal(), landlock's tsync
and then technically, kthread_stop() and the printk kunit test set the
bit raw.
Link: https://patch.msgid.link/20260824-work-tif_notify_signal-v2-2-6609e42b3157@kernel.org
Fixes: 12db8b690010 ("entry: Add support for TIF_NOTIFY_SIGNAL")
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Replaced the upstream guard(no_notify_signal)() in vfs_coredump() with explicit no_notify_signal_save()/no_notify_signal_restore() calls in the older monolithic do_coredump(), because its gotos would jump over a guard. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/coredump.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/coredump.c b/fs/coredump.c
index d23c57eb2e058..6d7b9b8b0a818 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -582,6 +582,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
struct linux_binfmt * binfmt;
const struct cred *old_cred;
struct cred *cred;
+ unsigned int notify_flags;
int retval = 0;
int ispipe;
size_t *argv = NULL;
@@ -630,6 +631,9 @@ void do_coredump(const kernel_siginfo_t *siginfo)
if (retval < 0)
goto fail_creds;
+ /* Task work must not cut the dump short, see signal_pending(). */
+ notify_flags = no_notify_signal_save();
+
old_cred = override_creds(cred);
ispipe = format_corename(&cn, &cprm, &argv, &argc);
@@ -836,6 +840,7 @@ void do_coredump(const kernel_siginfo_t *siginfo)
kfree(cn.corename);
coredump_finish(core_dumped);
revert_creds(old_cred);
+ no_notify_signal_restore(notify_flags);
fail_creds:
put_cred(cred);
fail:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 364/816] s390/zcrypt: Make apfs a real unsigned int field
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (362 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 363/816] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 365/816] s390/zcrypt: Fix and improve zcrypt reply message verification checks Greg Kroah-Hartman
` (456 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Holger Dengler, Harald Freudenberger,
Heiko Carstens, Vasily Gorbik, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <freude@linux.ibm.com>
[ Upstream commit ecd2fd113e89978ca750a81dea033a2e9f3347df ]
Slight rework on the apfs field: Instead of unsigned char[4]
make this a real 32 bit unsigned int field. With that done,
some assignments and some printouts can be simplified.
With that comes a slight move of the anonymous struct covering
the message type 86 header to dedupe some code lines.
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Stable-dep-of: 5e9b339f3232 ("s390/zcrypt: Fix and improve zcrypt reply message verification checks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/crypto/zcrypt_error.h | 28 ++++++++++-----------------
drivers/s390/crypto/zcrypt_msgtype6.c | 2 +-
drivers/s390/crypto/zcrypt_msgtype6.h | 4 ++--
3 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/drivers/s390/crypto/zcrypt_error.h b/drivers/s390/crypto/zcrypt_error.h
index 46e27b43a8afe..fd10302e68d36 100644
--- a/drivers/s390/crypto/zcrypt_error.h
+++ b/drivers/s390/crypto/zcrypt_error.h
@@ -78,9 +78,13 @@ struct error_hdr {
static inline int convert_error(struct zcrypt_queue *zq,
struct ap_message *reply)
{
- struct error_hdr *ehdr = reply->msg;
- int card = AP_QID_CARD(zq->queue->qid);
int queue = AP_QID_QUEUE(zq->queue->qid);
+ int card = AP_QID_CARD(zq->queue->qid);
+ struct error_hdr *ehdr = reply->msg;
+ struct {
+ struct type86_hdr hdr;
+ struct type86_fmt2_ext fmt2;
+ } __packed * t86hdr = reply->msg;
switch (ehdr->reply_code) {
case REP82_ERROR_INVALID_MSG_LEN: /* 0x23 */
@@ -100,19 +104,12 @@ static inline int convert_error(struct zcrypt_queue *zq,
/* RY indicates malformed request */
if (ehdr->reply_code == REP82_ERROR_FILTERED_BY_HYPERVISOR &&
ehdr->type == TYPE86_RSP_CODE) {
- struct {
- struct type86_hdr hdr;
- struct type86_fmt2_ext fmt2;
- } __packed * head = reply->msg;
- unsigned int apfs = *((u32 *)head->fmt2.apfs);
-
ZCRYPT_DBF_WARN("%s dev=%02x.%04x RY=0x%02x apfs=0x%x => rc=EINVAL\n",
__func__, card, queue,
- ehdr->reply_code, apfs);
+ ehdr->reply_code, t86hdr->fmt2.apfs);
} else {
ZCRYPT_DBF_WARN("%s dev=%02x.%04x RY=0x%02x => rc=EINVAL\n",
- __func__, card, queue,
- ehdr->reply_code);
+ __func__, card, queue, ehdr->reply_code);
}
return -EINVAL;
case REP82_ERROR_MACHINE_FAILURE: /* 0x10 */
@@ -125,15 +122,10 @@ static inline int convert_error(struct zcrypt_queue *zq,
/* For type 86 response show the apfs value (failure reason) */
if (ehdr->reply_code == REP82_ERROR_TRANSPORT_FAIL &&
ehdr->type == TYPE86_RSP_CODE) {
- struct {
- struct type86_hdr hdr;
- struct type86_fmt2_ext fmt2;
- } __packed * head = reply->msg;
- unsigned int apfs = *((u32 *)head->fmt2.apfs);
-
ZCRYPT_DBF_WARN(
"%s dev=%02x.%04x RY=0x%02x apfs=0x%x => bus rescan, rc=EAGAIN\n",
- __func__, card, queue, ehdr->reply_code, apfs);
+ __func__, card, queue, ehdr->reply_code,
+ t86hdr->fmt2.apfs);
} else {
ZCRYPT_DBF_WARN("%s dev=%02x.%04x RY=0x%02x => bus rescan, rc=EAGAIN\n",
__func__, card, queue,
diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index 2578384705592..2724a75a558e8 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -754,7 +754,7 @@ static int convert_response_xcrb(bool userspace, struct zcrypt_queue *zq,
return convert_error(zq, reply);
case TYPE86_RSP_CODE:
if (msg->hdr.reply_code) {
- memcpy(&xcrb->status, msg->fmt2.apfs, sizeof(u32));
+ xcrb->status = msg->fmt2.apfs;
return convert_error(zq, reply);
}
if (msg->cprbx.cprb_ver_id == 0x02)
diff --git a/drivers/s390/crypto/zcrypt_msgtype6.h b/drivers/s390/crypto/zcrypt_msgtype6.h
index 9cbe6e2b2d33c..8cc227df55c88 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.h
+++ b/drivers/s390/crypto/zcrypt_msgtype6.h
@@ -34,7 +34,7 @@ struct type6_hdr {
unsigned char right[4]; /* 0x00000000 */
unsigned char reserved3[2]; /* 0x0000 */
unsigned char reserved4[2]; /* 0x0000 */
- unsigned char apfs[4]; /* 0x00000000 */
+ unsigned int apfs; /* 0x00000000 */
unsigned int offset1; /* 0x00000058 (offset to CPRB) */
unsigned int offset2; /* 0x00000000 */
unsigned int offset3; /* 0x00000000 */
@@ -83,7 +83,7 @@ struct type86_hdr {
struct type86_fmt2_ext {
unsigned char reserved[4]; /* 0x00000000 */
- unsigned char apfs[4]; /* final status */
+ unsigned int apfs; /* final status */
unsigned int count1; /* length of CPRB + parameters */
unsigned int offset1; /* offset to CPRB */
unsigned int count2; /* 0x00000000 */
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 365/816] s390/zcrypt: Fix and improve zcrypt reply message verification checks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (363 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 364/816] s390/zcrypt: Make apfs a real unsigned int field Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 366/816] mm: khugepaged: fix folio is used after pte_unmap_unlock() Greg Kroah-Hartman
` (455 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Harald Freudenberger, Holger Dengler,
Heiko Carstens, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harald Freudenberger <freude@linux.ibm.com>
[ Upstream commit 5e9b339f323216d71f3ede8a0a427abf7859c486 ]
Add or improve checks related to buffer sizes and reply sizes to the
handling of replies from the crypto cards for CCA, EP11 (AP message
type 6) and ICA (AP type 50) messages. The verification code related
to reply field length was not designed well and thus firmware
deficiencies could lead to unexpected behavior in the zcrypt device
driver. Thus improve the code to more closely inspect especially
length fields at message replies.
Add length validation before accessing reply message structures in
zcrypt_msgtype6_receive(), zcrypt_msgtype6_receive_ep11(), and
zcrypt_msgtype50_receive() to prevent out-of-bounds reads and
potential kernel memory disclosure.
Also rework these three functions to validate reply lengths more
carefully before copying data back into the request buffer. Use size_t
for length calculations, reject inconsistent reply sizes, and add
defensive handling for short invalid replies. For XCRB replies,
validate both reply segments and derive the effective message length
from the covered range instead of trusting only the second segment.
Additionally improve some of the later invoked evaluation functions
which further check the payload. Add comments about length assumptions
and for the type50 processing rework the payload processing completely
with removing a misplaced BUG_ON().
Fixes: 5e55a488c87a ("s390/zcrypt: Separate msgtype implementation from card modules.")
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Cc: stable@vger.kernel.org
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/crypto/zcrypt_msgtype50.c | 95 ++++++++----
drivers/s390/crypto/zcrypt_msgtype6.c | 202 ++++++++++++++++++-------
2 files changed, 218 insertions(+), 79 deletions(-)
diff --git a/drivers/s390/crypto/zcrypt_msgtype50.c b/drivers/s390/crypto/zcrypt_msgtype50.c
index fc0a2a053dc22..fecc93f73b454 100644
--- a/drivers/s390/crypto/zcrypt_msgtype50.c
+++ b/drivers/s390/crypto/zcrypt_msgtype50.c
@@ -153,6 +153,11 @@ struct type80_hdr {
unsigned char reserved3[8];
} __packed;
+struct type80_reply {
+ struct type80_hdr hdr;
+ char data[];
+} __packed;
+
int get_rsa_modex_fc(struct ica_rsa_modexpo *mex, int *fcode)
{
if (!mex->inputdatalength)
@@ -341,32 +346,43 @@ static int ICACRT_msg_to_type50CRT_msg(struct zcrypt_queue *zq,
* @data: pointer to user output data
* @length: size of user output data
*
- * Returns 0 on success or -EFAULT.
+ * Returns 0 on success or neg. errno value on failure.
*/
static int convert_type80(struct zcrypt_queue *zq,
struct ap_message *reply,
char __user *outputdata,
unsigned int outputdatalength)
{
- struct type80_hdr *t80h = reply->msg;
- unsigned char *data;
+ struct type80_reply *msg = reply->msg;
+ size_t payload_len;
+
+ /*
+ * reply->len is always >= sizeof(struct type80_reply) here and
+ * outputdatalength (the modulus size) is guaranteed to be equal to
+ * inputdatalength and 0 < outputdatalength <= CEX3A_MAX_MOD_SIZE,
+ * also payload size may be >= outputdatalength.
+ */
+
+ payload_len = reply->len - sizeof(msg->hdr);
- if (t80h->len < sizeof(*t80h) + outputdatalength) {
- /* The result is too short, the CEXxA card may not do that.. */
+ if (outputdatalength > payload_len) {
+ /* We expect at least outputdatalength bytes, broken card ? */
zq->online = 0;
pr_err("Crypto dev=%02x.%04x code=0x%02x => online=0 rc=EAGAIN\n",
AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid), t80h->code);
+ AP_QID_QUEUE(zq->queue->qid), msg->hdr.code);
ZCRYPT_DBF_ERR("%s dev=%02x.%04x code=0x%02x => online=0 rc=EAGAIN\n",
__func__, AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid), t80h->code);
+ AP_QID_QUEUE(zq->queue->qid), msg->hdr.code);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
return -EAGAIN;
}
- BUG_ON(t80h->len > CEX3A_MAX_RESPONSE_SIZE);
- data = reply->msg + t80h->len - outputdatalength;
- if (copy_to_user(outputdata, data, outputdatalength))
+
+ if (copy_to_user(outputdata,
+ msg->data + payload_len - outputdatalength,
+ outputdatalength))
return -EFAULT;
+
return 0;
}
@@ -375,14 +391,19 @@ static int convert_response(struct zcrypt_queue *zq,
char __user *outputdata,
unsigned int outputdatalength)
{
- /* Response type byte is the second byte in the response. */
- unsigned char rtype = ((unsigned char *)reply->msg)[1];
+ struct type80_reply *msg = reply->msg;
+
+ /* reply->len is always >= sizeof(struct error_hdr) here */
- switch (rtype) {
+ switch (msg->hdr.type) {
case TYPE82_RSP_CODE:
case TYPE88_RSP_CODE:
return convert_error(zq, reply);
case TYPE80_RSP_CODE:
+ if (msg->hdr.code)
+ return convert_error(zq, reply);
+ if (reply->len < sizeof(struct type80_reply))
+ return -EINVAL;
return convert_type80(zq, reply,
outputdata, outputdatalength);
default: /* Unknown response type, this should NEVER EVER happen */
@@ -390,11 +411,11 @@ static int convert_response(struct zcrypt_queue *zq,
pr_err("Crypto dev=%02x.%04x unknown response type 0x%02x => online=0 rc=EAGAIN\n",
AP_QID_CARD(zq->queue->qid),
AP_QID_QUEUE(zq->queue->qid),
- (int)rtype);
+ (int)msg->hdr.type);
ZCRYPT_DBF_ERR(
"%s dev=%02x.%04x unknown response type 0x%02x => online=0 rc=EAGAIN\n",
__func__, AP_QID_CARD(zq->queue->qid),
- AP_QID_QUEUE(zq->queue->qid), (int)rtype);
+ AP_QID_QUEUE(zq->queue->qid), (int)msg->hdr.type);
ap_send_online_uevent(&zq->queue->ap_dev, zq->online);
return -EAGAIN;
}
@@ -417,26 +438,46 @@ static void zcrypt_msgtype50_receive(struct ap_queue *aq,
.reply_code = REP82_ERROR_MACHINE_FAILURE,
};
struct type80_hdr *t80h;
- int len;
+ size_t len;
/* Copy the reply message to the request message buffer. */
if (!reply)
goto out; /* ap_msg->rc indicates the error */
+
t80h = reply->msg;
- if (t80h->type == TYPE80_RSP_CODE) {
- len = t80h->len;
- if (len > reply->bufsize || len > msg->bufsize ||
- len != reply->len) {
- pr_debug("len mismatch => EMSGSIZE\n");
- msg->rc = -EMSGSIZE;
+
+ if (reply->len < sizeof(*t80h) ||
+ t80h->type != TYPE80_RSP_CODE) {
+ if (reply->len < sizeof(error_reply)) {
+ /* total broken reply, use static error reply instead */
+ memcpy(msg->msg, &error_reply, sizeof(error_reply));
+ msg->len = sizeof(error_reply);
goto out;
+ } else {
+ /* malformed reply, convert function will handle this */
+ len = reply->len;
+ goto copy_len_and_out;
}
- memcpy(msg->msg, reply->msg, len);
- msg->len = len;
- } else {
- memcpy(msg->msg, reply->msg, sizeof(error_reply));
- msg->len = sizeof(error_reply);
}
+
+ len = t80h->len;
+
+copy_len_and_out:
+ if (len != reply->len) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("len %zu rpl.len %zu mismatch, msg.rc=%d\n",
+ len, reply->len, msg->rc);
+ goto out;
+ }
+ if (len > reply->bufsize || len > msg->bufsize) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("len %zu exceeds buf %zu/%zu, msg.rc=%d\n",
+ len, reply->bufsize, msg->bufsize, msg->rc);
+ goto out;
+ }
+ memcpy(msg->msg, reply->msg, len);
+ msg->len = len;
+
out:
complete(&msg->response.work);
}
diff --git a/drivers/s390/crypto/zcrypt_msgtype6.c b/drivers/s390/crypto/zcrypt_msgtype6.c
index 2724a75a558e8..90b37d27dd8c8 100644
--- a/drivers/s390/crypto/zcrypt_msgtype6.c
+++ b/drivers/s390/crypto/zcrypt_msgtype6.c
@@ -693,6 +693,15 @@ static int convert_type86_rng(struct zcrypt_queue *zq,
if (msg->cprbx.ccp_rtcode != 0 || msg->cprbx.ccp_rscode != 0)
return -EINVAL;
+ /*
+ * Note that offset2 and count2 have already been checked in
+ * zcrypt_msgtype6_receive(). So only check for valid count2
+ * and for not exceeding the hard coded rng buffer size.
+ */
+ if (!msg->fmt2.count2)
+ return -EINVAL;
+ if (msg->fmt2.count2 > ZCRYPT_RNG_BUFFER_SIZE)
+ return -EMSGSIZE;
memcpy(buffer, data + msg->fmt2.offset2, msg->fmt2.count2);
return msg->fmt2.count2;
}
@@ -704,11 +713,17 @@ static int convert_response_ica(struct zcrypt_queue *zq,
{
struct type86x_reply *msg = reply->msg;
+ /* reply->len is always >= sizeof(struct error_hdr) here */
+
switch (msg->hdr.type) {
case TYPE82_RSP_CODE:
case TYPE88_RSP_CODE:
return convert_error(zq, reply);
case TYPE86_RSP_CODE:
+ if (msg->hdr.reply_code)
+ return convert_error(zq, reply);
+ if (reply->len < sizeof(struct type86x_reply))
+ return -EINVAL;
if (msg->cprbx.ccp_rtcode &&
msg->cprbx.ccp_rscode == 0x14f &&
outputdatalength > 256) {
@@ -719,8 +734,6 @@ static int convert_response_ica(struct zcrypt_queue *zq,
return -EINVAL;
}
}
- if (msg->hdr.reply_code)
- return convert_error(zq, reply);
if (msg->cprbx.cprb_ver_id == 0x02)
return convert_type86_ica(zq, reply,
outputdata, outputdatalength);
@@ -747,6 +760,8 @@ static int convert_response_xcrb(bool userspace, struct zcrypt_queue *zq,
{
struct type86x_reply *msg = reply->msg;
+ /* reply->len is always >= sizeof(struct error_hdr) here */
+
switch (msg->hdr.type) {
case TYPE82_RSP_CODE:
case TYPE88_RSP_CODE:
@@ -754,9 +769,16 @@ static int convert_response_xcrb(bool userspace, struct zcrypt_queue *zq,
return convert_error(zq, reply);
case TYPE86_RSP_CODE:
if (msg->hdr.reply_code) {
- xcrb->status = msg->fmt2.apfs;
+ if (reply->len < sizeof(struct type86_fmt2_msg))
+ xcrb->status = 0x0008044DL;
+ else
+ xcrb->status = msg->fmt2.apfs;
return convert_error(zq, reply);
}
+ if (reply->len < sizeof(struct type86_fmt2_msg) +
+ offsetof(struct CPRBX, cprb_ver_id) +
+ sizeof(msg->cprbx.cprb_ver_id))
+ return -EINVAL;
if (msg->cprbx.cprb_ver_id == 0x02)
return convert_type86_xcrb(userspace, zq, reply, xcrb);
fallthrough; /* wrong cprb version is an unknown response */
@@ -781,6 +803,8 @@ static int convert_response_ep11_xcrb(bool userspace, struct zcrypt_queue *zq,
{
struct type86_ep11_reply *msg = reply->msg;
+ /* reply->len is always >= sizeof(struct error_hdr) here */
+
switch (msg->hdr.type) {
case TYPE82_RSP_CODE:
case TYPE87_RSP_CODE:
@@ -788,6 +812,8 @@ static int convert_response_ep11_xcrb(bool userspace, struct zcrypt_queue *zq,
case TYPE86_RSP_CODE:
if (msg->hdr.reply_code)
return convert_error(zq, reply);
+ if (reply->len < sizeof(struct type86_ep11_reply))
+ return -EINVAL;
if (msg->cprbx.cprb_ver_id == 0x04)
return convert_type86_ep11_xcrb(userspace, zq, reply, xcrb);
fallthrough; /* wrong cprb version is an unknown resp */
@@ -812,6 +838,8 @@ static int convert_response_rng(struct zcrypt_queue *zq,
{
struct type86x_reply *msg = reply->msg;
+ /* reply->len is always >= sizeof(struct error_hdr) here */
+
switch (msg->hdr.type) {
case TYPE82_RSP_CODE:
case TYPE88_RSP_CODE:
@@ -819,6 +847,8 @@ static int convert_response_rng(struct zcrypt_queue *zq,
case TYPE86_RSP_CODE:
if (msg->hdr.reply_code)
return -EINVAL;
+ if (reply->len < sizeof(struct type86x_reply))
+ return -EINVAL;
if (msg->cprbx.cprb_ver_id == 0x02)
return convert_type86_rng(zq, reply, data);
fallthrough; /* wrong cprb version is an unknown response */
@@ -855,48 +885,85 @@ static void zcrypt_msgtype6_receive(struct ap_queue *aq,
};
struct ap_response_type *resp_type = &msg->response;
struct type86x_reply *t86r;
- int len;
+ size_t minlen, len;
/* Copy the reply message to the request message buffer. */
if (!reply)
goto out; /* ap_msg->rc indicates the error */
+
t86r = reply->msg;
- if (t86r->hdr.type == TYPE86_RSP_CODE &&
- t86r->cprbx.cprb_ver_id == 0x02) {
- switch (resp_type->type) {
- case CEXXC_RESPONSE_TYPE_ICA:
- len = sizeof(struct type86x_reply) + t86r->length;
- if (len > reply->bufsize || len > msg->bufsize ||
- len != reply->len) {
- pr_debug("len mismatch => EMSGSIZE\n");
- msg->rc = -EMSGSIZE;
- goto out;
- }
- memcpy(msg->msg, reply->msg, len);
- msg->len = len;
- break;
- case CEXXC_RESPONSE_TYPE_XCRB:
- if (t86r->fmt2.count2)
- len = t86r->fmt2.offset2 + t86r->fmt2.count2;
- else
- len = t86r->fmt2.offset1 + t86r->fmt2.count1;
- if (len > reply->bufsize || len > msg->bufsize ||
- len != reply->len) {
- pr_debug("len mismatch => EMSGSIZE\n");
+ minlen = sizeof(t86r->hdr) + sizeof(t86r->fmt2) +
+ offsetof(struct CPRBX, cprb_ver_id) +
+ sizeof(t86r->cprbx.cprb_ver_id);
+
+ if (reply->len < minlen ||
+ t86r->hdr.type != TYPE86_RSP_CODE ||
+ t86r->cprbx.cprb_ver_id != 0x02) {
+ if (reply->len < sizeof(error_reply)) {
+ /* total broken reply, use static error reply instead */
+ memcpy(msg->msg, &error_reply, sizeof(error_reply));
+ msg->len = sizeof(error_reply);
+ goto out;
+ } else {
+ /* malformed reply, convert function will handle this */
+ len = reply->len;
+ goto copy_len_and_out;
+ }
+ }
+
+ switch (resp_type->type) {
+ case CEXXC_RESPONSE_TYPE_ICA:
+ if (reply->len < sizeof(struct type86x_reply)) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("rpl.len %zu < struct type86_reply, msg.rc=%d\n",
+ reply->len, msg->rc);
+ goto out;
+ }
+ len = sizeof(struct type86x_reply) + (size_t)t86r->length;
+ break;
+ case CEXXC_RESPONSE_TYPE_XCRB:
+ len = (size_t)t86r->fmt2.offset1 + (size_t)t86r->fmt2.count1;
+ if (len > reply->len) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("offset1 %u count1 %u rpl.len %zu mismatch, msg.rc=%d\n",
+ t86r->fmt2.offset1, t86r->fmt2.count1,
+ reply->len, msg->rc);
+ goto out;
+ }
+ if (t86r->fmt2.count2) {
+ len = (size_t)t86r->fmt2.offset2 +
+ (size_t)t86r->fmt2.count2;
+ if (len > reply->len) {
msg->rc = -EMSGSIZE;
+ pr_debug("offset2 %u count2 %u rpl.len %zu mismatch, msg.rc=%d\n",
+ t86r->fmt2.offset2, t86r->fmt2.count2,
+ reply->len, msg->rc);
goto out;
}
- memcpy(msg->msg, reply->msg, len);
- msg->len = len;
- break;
- default:
- memcpy(msg->msg, &error_reply, sizeof(error_reply));
- msg->len = sizeof(error_reply);
}
- } else {
- memcpy(msg->msg, reply->msg, sizeof(error_reply));
+ break;
+ default:
+ memcpy(msg->msg, &error_reply, sizeof(error_reply));
msg->len = sizeof(error_reply);
+ goto out;
+ }
+
+copy_len_and_out:
+ if (len != reply->len) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("len %zu rpl.len %zu mismatch, msg.rc=%d\n",
+ len, reply->len, msg->rc);
+ goto out;
+ }
+ if (len > reply->bufsize || len > msg->bufsize) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("len %zu exceeds buf %zu/%zu, msg.rc=%d\n",
+ len, reply->bufsize, msg->bufsize, msg->rc);
+ goto out;
}
+ memcpy(msg->msg, reply->msg, len);
+ msg->len = len;
+
out:
complete(&resp_type->work);
}
@@ -919,34 +986,65 @@ static void zcrypt_msgtype6_receive_ep11(struct ap_queue *aq,
};
struct ap_response_type *resp_type = &msg->response;
struct type86_ep11_reply *t86r;
- int len;
+ size_t minlen, len;
/* Copy the reply message to the request message buffer. */
if (!reply)
goto out; /* ap_msg->rc indicates the error */
+
t86r = reply->msg;
- if (t86r->hdr.type == TYPE86_RSP_CODE &&
- t86r->cprbx.cprb_ver_id == 0x04) {
- switch (resp_type->type) {
- case CEXXC_RESPONSE_TYPE_EP11:
- len = t86r->fmt2.offset1 + t86r->fmt2.count1;
- if (len > reply->bufsize || len > msg->bufsize ||
- len != reply->len) {
- pr_debug("len mismatch => EMSGSIZE\n");
- msg->rc = -EMSGSIZE;
- goto out;
- }
- memcpy(msg->msg, reply->msg, len);
- msg->len = len;
- break;
- default:
+ minlen = sizeof(t86r->hdr) + sizeof(t86r->fmt2) +
+ offsetof(struct ep11_cprb, cprb_ver_id) +
+ sizeof(t86r->cprbx.cprb_ver_id);
+
+ if (reply->len < minlen ||
+ t86r->hdr.type != TYPE86_RSP_CODE ||
+ t86r->cprbx.cprb_ver_id != 0x04) {
+ if (reply->len < sizeof(error_reply)) {
+ /* total broken reply, use static error reply instead */
memcpy(msg->msg, &error_reply, sizeof(error_reply));
msg->len = sizeof(error_reply);
+ goto out;
+ } else {
+ /* malformed reply, convert function will handle this */
+ len = reply->len;
+ goto copy_len_and_out;
}
- } else {
- memcpy(msg->msg, reply->msg, sizeof(error_reply));
+ }
+
+ switch (resp_type->type) {
+ case CEXXC_RESPONSE_TYPE_EP11:
+ len = (size_t)t86r->fmt2.offset1 + (size_t)t86r->fmt2.count1;
+ if (len > reply->len) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("offset1 %u count1 %u rpl.len %zu mismatch, msg.rc=%d\n",
+ t86r->fmt2.offset1, t86r->fmt2.count1,
+ reply->len, msg->rc);
+ goto out;
+ }
+ break;
+ default:
+ memcpy(msg->msg, &error_reply, sizeof(error_reply));
msg->len = sizeof(error_reply);
+ goto out;
+ }
+
+copy_len_and_out:
+ if (len != reply->len) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("len %zu rpl.len %zu mismatch, msg.rc=%d\n",
+ len, reply->len, msg->rc);
+ goto out;
+ }
+ if (len > reply->bufsize || len > msg->bufsize) {
+ msg->rc = -EMSGSIZE;
+ pr_debug("len %zu exceeds buf %zu/%zu, msg.rc=%d\n",
+ len, reply->bufsize, msg->bufsize, msg->rc);
+ goto out;
}
+ memcpy(msg->msg, reply->msg, len);
+ msg->len = len;
+
out:
complete(&resp_type->work);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 366/816] mm: khugepaged: fix folio is used after pte_unmap_unlock()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (364 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 365/816] s390/zcrypt: Fix and improve zcrypt reply message verification checks Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 367/816] smb: client: reclaim credits for decrypted reads with no matching mid Greg Kroah-Hartman
` (454 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vernon Yang, Andrew Morton,
David Hildenbrand (Arm), Lorenzo Stoakes (ARM), Barry Song,
Dev Jain, Lance Yang, Ryan Roberts, Zach OKeefe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vernon Yang <yanglincheng@kylinos.cn>
[ Upstream commit ba2f1f92ddfabd340c9248fd2380104f717ee8b1 ]
After the page table lock has dropped, the folio can be freed
concurrently. The trace_mm_khugepaged_scan_pmd() is left with a dangling
folio pointer.
So using the folio_pfn() before dropping the page table lock, closing
use-after-free window.
And other pre-existing bug, When the `for (i = 0; i < HPAGE_PMD_NR; i++)`
iteration to terminate and the folio operation preceding is normal, but
pfn will be incorrect. so we really only trace the PFN if it really was
problematic.
Link: https://lore.kernel.org/20260909025804.3233645-3-vernon2gm@gmail.com
Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages")
Signed-off-by: Vernon Yang <yanglincheng@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Cc: Barry Song <baohua@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Cc: <stable@vger.kernel.org>
[ sashal: Replaced the &folio->page argument with a failed_pfn set at each folio failure site, using older helper names and keeping the tracepoint's extra writable argument, and dropped the lazyfree hunk. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/trace/events/huge_memory.h | 6 +++---
mm/khugepaged.c | 9 ++++++++-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h
index 8f63af61c3ccb..7fd5c30c713e1 100644
--- a/include/trace/events/huge_memory.h
+++ b/include/trace/events/huge_memory.h
@@ -55,10 +55,10 @@ SCAN_STATUS
TRACE_EVENT(mm_khugepaged_scan_pmd,
- TP_PROTO(struct mm_struct *mm, struct page *page, bool writable,
+ TP_PROTO(struct mm_struct *mm, unsigned long pfn, bool writable,
int referenced, int none_or_zero, int status, int unmapped),
- TP_ARGS(mm, page, writable, referenced, none_or_zero, status, unmapped),
+ TP_ARGS(mm, pfn, writable, referenced, none_or_zero, status, unmapped),
TP_STRUCT__entry(
__field(struct mm_struct *, mm)
@@ -72,7 +72,7 @@ TRACE_EVENT(mm_khugepaged_scan_pmd,
TP_fast_assign(
__entry->mm = mm;
- __entry->pfn = page ? page_to_pfn(page) : -1;
+ __entry->pfn = pfn;
__entry->writable = writable;
__entry->referenced = referenced;
__entry->none_or_zero = none_or_zero;
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index ea94f66cd0377..8649ea2772c36 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1265,6 +1265,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
int none_or_zero = 0, shared = 0;
struct page *page = NULL;
struct folio *folio = NULL;
+ unsigned long failed_pfn = -1;
unsigned long _address;
spinlock_t *ptl;
int node = NUMA_NO_NODE, unmapped = 0;
@@ -1344,6 +1345,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
if (!folio_test_anon(folio)) {
result = SCAN_PAGE_ANON;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
@@ -1358,6 +1360,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
if (cc->is_khugepaged &&
shared > khugepaged_max_ptes_shared) {
result = SCAN_EXCEED_SHARED_PTE;
+ failed_pfn = folio_pfn(folio);
count_vm_event(THP_SCAN_EXCEED_SHARED_PTE);
goto out_unmap;
}
@@ -1372,15 +1375,18 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
node = folio_nid(folio);
if (hpage_collapse_scan_abort(node, cc)) {
result = SCAN_SCAN_ABORT;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
cc->node_load[node]++;
if (!folio_test_lru(folio)) {
result = SCAN_PAGE_LRU;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
if (folio_test_locked(folio)) {
result = SCAN_PAGE_LOCK;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
@@ -1396,6 +1402,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
*/
if (!is_refcount_suitable(folio)) {
result = SCAN_PAGE_COUNT;
+ failed_pfn = folio_pfn(folio);
goto out_unmap;
}
@@ -1427,7 +1434,7 @@ static int hpage_collapse_scan_pmd(struct mm_struct *mm,
*mmap_locked = false;
}
out:
- trace_mm_khugepaged_scan_pmd(mm, &folio->page, writable, referenced,
+ trace_mm_khugepaged_scan_pmd(mm, failed_pfn, writable, referenced,
none_or_zero, result, unmapped);
return result;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 367/816] smb: client: reclaim credits for decrypted reads with no matching mid
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (365 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 366/816] mm: khugepaged: fix folio is used after pte_unmap_unlock() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 368/816] smb: client: validate NT transaction response layout and offsets Greg Kroah-Hartman
` (453 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paulo Alcantara, David Howells,
Namjae Jeon, Ronnie Sahlberg, Shyam Prasad N, Tom Talpey,
Bharath SM, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
[ Upstream commit 78f73985846465a25a7bd1d89904053661f3ca92 ]
When a decrypted SMB2 READ response carries a MessageId that matches no
outstanding request, both the inline receive_encrypted_read() and the
offloaded smb2_decrypt_offload() paths drop the frame without accounting
the credits the server granted in it. The plaintext unknown-frame path in
cifs_demultiplex_thread() already reclaims them with
smb2_add_credits_from_hdr(), so encrypted reads leak credits that the
plaintext path would not.
This also happens for legitimate frames - e.g. a reply that arrives after
the client has timed out and dropped the mid - so over a long-lived
connection the client's credit count drifts down and can eventually starve
it of the ability to issue requests. The frame is AEAD-authenticated, so
the granted credits in the decrypted header come from the real server and
are safe to apply.
Reclaim the credits from the decrypted header before dropping the frame,
and export smb2_add_credits_from_hdr() so the SMB2 receive paths can use it.
Fixes: c42a6abe3012 ("CIFS: Add capability to decrypt big read responses")
Fixes: 35cf94a39728 ("smb3: allow parallelizing decryption of reads")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
[ sashal: adjusted context in cifsproto.h, since this tree still declares prototypes with extern, while the code changes match upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/cifsproto.h | 1 +
fs/smb/client/connect.c | 3 +--
fs/smb/client/smb2ops.c | 6 ++++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h
index e2a7d55a2502d..4dfaa59b152b7 100644
--- a/fs/smb/client/cifsproto.h
+++ b/fs/smb/client/cifsproto.h
@@ -145,6 +145,7 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
bool mark_smb_session);
extern int cifs_reconnect(struct TCP_Server_Info *server,
bool mark_smb_session);
+void smb2_add_credits_from_hdr(char *buffer, struct TCP_Server_Info *server);
extern int checkSMB(char *buf, unsigned int len, struct TCP_Server_Info *srvr);
extern bool is_valid_oplock_break(char *, struct TCP_Server_Info *);
extern bool backup_cred(struct cifs_sb_info *);
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 82a70370a60f8..162dededef392 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -1153,8 +1153,7 @@ cifs_handle_standard(struct TCP_Server_Info *server, struct mid_q_entry *mid)
return 0;
}
-static void
-smb2_add_credits_from_hdr(char *buffer, struct TCP_Server_Info *server)
+void smb2_add_credits_from_hdr(char *buffer, struct TCP_Server_Info *server)
{
struct smb2_hdr *shdr = (struct smb2_hdr *)buffer;
int scredits, in_flight;
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index b1a2ada2b5c77..8dadf5f1e20f0 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -5165,9 +5165,10 @@ static void smb2_decrypt_offload(struct work_struct *work)
dw->server->lstrp = jiffies;
mid = smb2_find_dequeue_mid(dw->server, dw->buf);
- if (mid == NULL)
+ if (mid == NULL) {
cifs_dbg(FYI, "mid not found\n");
- else {
+ smb2_add_credits_from_hdr(dw->buf, dw->server);
+ } else {
mid->decrypted = true;
rc = handle_read_data(dw->server, mid, dw->buf,
dw->server->vals->read_rsp_size,
@@ -5290,6 +5291,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid,
*mid = smb2_find_mid(server, buf);
if (*mid == NULL) {
cifs_dbg(FYI, "mid not found\n");
+ smb2_add_credits_from_hdr(buf, server);
rc = -1;
} else {
cifs_dbg(FYI, "mid found\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 368/816] smb: client: validate NT transaction response layout and offsets
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (366 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 367/816] smb: client: reclaim credits for decrypted reads with no matching mid Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 369/816] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data() Greg Kroah-Hartman
` (452 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ratnaker Gautam, Namjae Jeon,
Paulo Alcantara, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ratnaker Gautam <ratnaker.gautam@kuleuven.be>
[ Upstream commit 83d0d5e0ca22233c75daf139ec0063b9d2ff1ac7 ]
validate_ntransact() assumes that the response uses the fixed 18-word NT
transaction layout. A different WordCount makes get_bcc() locate the byte
count at a different offset from pSMBr->ByteCount, allowing the subsequent
bounds checks to use inconsistent response boundaries.
The function also turns the 32-bit ParameterOffset and DataOffset fields
into pointers before checking their bounds. On a 32-bit client, a large
offset can wrap the pointer below end_of_smb and pass the one-sided pointer
comparison. The caller then dereferences the parameter pointer or copies
from the data pointer.
Require the expected WordCount before reading the byte count. Check each
offset and count against the received SMB length as integers before forming
either pointer. Use subtraction after validating the offset so that the
range checks cannot overflow.
Reported-by: Ratnaker Gautam <ratnaker.gautam@kuleuven.be>
Fixes: 0a4b92c05ed0 ("[CIFS] Add worker function for Get ACL cifs style")
Cc: stable@vger.kernel.org
Signed-off-by: Ratnaker Gautam <ratnaker.gautam@kuleuven.be>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/cifssmb.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c
index c893b9fed8a02..6f3f707e20810 100644
--- a/fs/smb/client/cifssmb.c
+++ b/fs/smb/client/cifssmb.c
@@ -3408,9 +3408,10 @@ static int
validate_ntransact(char *buf, char **ppparm, char **ppdata,
__u32 *pparmlen, __u32 *pdatalen)
{
- char *end_of_smb;
__u32 data_count, data_offset, parm_count, parm_offset;
struct smb_com_ntransact_rsp *pSMBr;
+ size_t buflen;
+ char *end_buf;
u16 bcc;
*pdatalen = 0;
@@ -3421,37 +3422,42 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
pSMBr = (struct smb_com_ntransact_rsp *)buf;
+ if (pSMBr->hdr.WordCount != 18) {
+ cifs_dbg(FYI, "invalid NT transaction WordCount %u\n",
+ pSMBr->hdr.WordCount);
+ return -EINVAL;
+ }
+
bcc = get_bcc(&pSMBr->hdr);
- end_of_smb = 2 /* sizeof byte count */ + bcc +
- (char *)&pSMBr->ByteCount;
+ end_buf = 2 /* sizeof byte count */ + bcc + (char *)&pSMBr->ByteCount;
+ buflen = end_buf - buf;
data_offset = le32_to_cpu(pSMBr->DataOffset);
data_count = le32_to_cpu(pSMBr->DataCount);
parm_offset = le32_to_cpu(pSMBr->ParameterOffset);
parm_count = le32_to_cpu(pSMBr->ParameterCount);
- *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset;
- *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset;
-
/* should we also check that parm and data areas do not overlap? */
- if (*ppparm > end_of_smb) {
+ if (parm_offset > buflen) {
cifs_dbg(FYI, "parms start after end of smb\n");
return -EINVAL;
- } else if (parm_count + *ppparm > end_of_smb) {
+ } else if (parm_count > buflen - parm_offset) {
cifs_dbg(FYI, "parm end after end of smb\n");
return -EINVAL;
- } else if (*ppdata > end_of_smb) {
+ } else if (data_offset > buflen) {
cifs_dbg(FYI, "data starts after end of smb\n");
return -EINVAL;
- } else if (data_count + *ppdata > end_of_smb) {
- cifs_dbg(FYI, "data %p + count %d (%p) past smb end %p start %p\n",
- *ppdata, data_count, (data_count + *ppdata),
- end_of_smb, pSMBr);
+ } else if (data_count > buflen - data_offset) {
+ cifs_dbg(FYI, "data offset %u + count %u past smb length %zu\n",
+ data_offset, data_count, buflen);
return -EINVAL;
} else if (parm_count + data_count > bcc) {
cifs_dbg(FYI, "parm count and data count larger than SMB\n");
return -EINVAL;
}
+
+ *ppparm = buf + parm_offset;
+ *ppdata = buf + data_offset;
*pdatalen = data_count;
*pparmlen = parm_count;
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 369/816] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (367 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 368/816] smb: client: validate NT transaction response layout and offsets Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 370/816] x86/cpuid: Mark CPUID function 0x23 as being indexed Greg Kroah-Hartman
` (451 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Laight, David Howells,
Marc Dionne, Eric Dumazet, David S. Miller, Jakub Kicinski,
Paolo Abeni, Simon Horman, linux-afs, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells@redhat.com>
[ Upstream commit af208f36ae22440cf6011a43cb3064fd525d85b4 ]
Fix rxrpc_kernel_send_data() to loop around if it detects a short send.
David Laight suggested doing it here rather than wrapping all the calls in
loops. Further, remove the len argument and use the iterator count instead
and return 0 on success, not the amount copied.
Note this is also a prerequisite for changing the way rxrpc_send_data()
works to return a short send rather than an error if some data was
buffered.
Fixes: 651350d10f93 ("[AF_RXRPC]: Add an interface to the AF_RXRPC module for the AFS filesystem to use")
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824091645.415423-1-dhowells%40redhat.com
Suggested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261006133011.531806-5-dhowells@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Dropped the len argument from the rxrpc_kernel_send_data() calls in afs_send_empty_reply() and afs_send_simple_reply() while keeping the branch's existing abort-on-send-error handling instead of upstream's rewritten switch/-ENOMEM logic. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/networking/rxrpc.rst | 8 +++++---
fs/afs/rxrpc.c | 8 +++-----
include/net/af_rxrpc.h | 5 ++---
net/rxrpc/rxperf.c | 25 ++++++++++---------------
net/rxrpc/sendmsg.c | 27 +++++++++++++++++++--------
5 files changed, 39 insertions(+), 34 deletions(-)
diff --git a/Documentation/networking/rxrpc.rst b/Documentation/networking/rxrpc.rst
index bb699ff4fe942..282b4933deb3b 100644
--- a/Documentation/networking/rxrpc.rst
+++ b/Documentation/networking/rxrpc.rst
@@ -873,7 +873,6 @@ The kernel interface functions are as follows:
int rxrpc_kernel_send_data(struct socket *sock,
struct rxrpc_call *call,
struct msghdr *msg,
- size_t len,
rxrpc_notify_end_tx_t notify_end_rx);
This is used to supply either the request part of a client call or the
@@ -882,14 +881,17 @@ The kernel interface functions are as follows:
exclusively to in-kernel virtual addresses. msg.msg_flags may be given
MSG_MORE if there will be subsequent data sends for this call.
- The msg must not specify a destination address, control data or any flags
- other than MSG_MORE. len is the total amount of data to transmit.
+ msg must not specify a destination address, control data or any flags
+ other than MSG_MORE or MSG_WAITALL.
notify_end_rx can be NULL or it can be used to specify a function to be
called when the call changes state to end the Tx phase. This function is
called with a spinlock held to prevent the last DATA packet from being
transmitted until the function returns.
+ It returns 0 if all the provided data has been buffered and a negative
+ error code on failure.
+
(#) Receive data from a call::
int rxrpc_kernel_recv_data(struct socket *sock,
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c
index 934667e547dc2..2d13a9060ceaf 100644
--- a/fs/afs/rxrpc.c
+++ b/fs/afs/rxrpc.c
@@ -411,8 +411,7 @@ void afs_make_call(struct afs_call *call, gfp_t gfp)
msg.msg_controllen = 0;
msg.msg_flags = MSG_WAITALL | (call->write_iter ? MSG_MORE : 0);
- ret = rxrpc_kernel_send_data(call->net->socket, rxcall,
- &msg, call->request_size,
+ ret = rxrpc_kernel_send_data(call->net->socket, rxcall, &msg,
afs_notify_end_request_tx);
if (ret < 0)
goto error_do_abort;
@@ -424,7 +423,6 @@ void afs_make_call(struct afs_call *call, gfp_t gfp)
ret = rxrpc_kernel_send_data(call->net->socket,
call->rxcall, &msg,
- iov_iter_count(&msg.msg_iter),
afs_notify_end_request_tx);
*call->write_iter = msg.msg_iter;
@@ -864,7 +862,7 @@ void afs_send_empty_reply(struct afs_call *call)
msg.msg_controllen = 0;
msg.msg_flags = 0;
- ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, 0,
+ ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg,
afs_notify_end_reply_tx);
if (ret < 0) {
rxrpc_kernel_abort_call(net->socket, call->rxcall,
@@ -897,7 +895,7 @@ void afs_send_simple_reply(struct afs_call *call, const void *buf, size_t len)
msg.msg_controllen = 0;
msg.msg_flags = 0;
- ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg, len,
+ ret = rxrpc_kernel_send_data(net->socket, call->rxcall, &msg,
afs_notify_end_reply_tx);
if (ret < 0) {
rxrpc_kernel_abort_call(net->socket, call->rxcall,
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index ebb6092c488b5..e1c3f1f3c2ab0 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -58,9 +58,8 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
bool upgrade,
enum rxrpc_interruptibility interruptibility,
unsigned int debug_id);
-int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *,
- struct msghdr *, size_t,
- rxrpc_notify_end_tx_t);
+int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
+ struct msghdr *msg, rxrpc_notify_end_tx_t notify_end_tx);
int rxrpc_kernel_recv_data(struct socket *, struct rxrpc_call *,
struct iov_iter *, size_t *, bool, u32 *, u16 *);
bool rxrpc_kernel_abort_call(struct socket *, struct rxrpc_call *,
diff --git a/net/rxrpc/rxperf.c b/net/rxrpc/rxperf.c
index 25903cd294637..c16afe540d09c 100644
--- a/net/rxrpc/rxperf.c
+++ b/net/rxrpc/rxperf.c
@@ -512,8 +512,8 @@ static int rxperf_process_call(struct rxperf_call *call)
struct msghdr msg = {};
struct bio_vec bv;
struct kvec iov[1];
- ssize_t n;
size_t reply_len = call->reply_len, len;
+ int ret;
rxrpc_kernel_set_tx_length(rxperf_socket, call->rxcall,
reply_len + sizeof(rxperf_magic_cookie));
@@ -523,13 +523,11 @@ static int rxperf_process_call(struct rxperf_call *call)
bvec_set_page(&bv, ZERO_PAGE(0), len, 0);
iov_iter_bvec(&msg.msg_iter, WRITE, &bv, 1, len);
msg.msg_flags = MSG_MORE;
- n = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
- len, rxperf_notify_end_reply_tx);
- if (n < 0)
- return n;
- if (n == 0)
- return -EIO;
- reply_len -= n;
+ ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
+ rxperf_notify_end_reply_tx);
+ if (ret < 0)
+ return ret;
+ reply_len -= len;
}
len = sizeof(rxperf_magic_cookie);
@@ -537,16 +535,13 @@ static int rxperf_process_call(struct rxperf_call *call)
iov[0].iov_len = len;
iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, len);
msg.msg_flags = 0;
- n = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg, len,
- rxperf_notify_end_reply_tx);
- if (n >= 0)
- return 0; /* Success */
-
- if (n == -ENOMEM)
+ ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
+ rxperf_notify_end_reply_tx);
+ if (ret == -ENOMEM)
rxrpc_kernel_abort_call(rxperf_socket, call->rxcall,
RXGEN_SS_MARSHAL, -ENOMEM,
rxperf_abort_oom);
- return n;
+ return ret;
}
/*
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index 9d68e58dace9c..ea649144c49f0 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -737,7 +737,6 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
* @sock: The socket the call is on
* @call: The call to send data through
* @msg: The data to send
- * @len: The amount of data to send
* @notify_end_tx: Notification that the last packet is queued.
*
* Allow a kernel service to send data on a call. The call must be in an state
@@ -748,8 +747,7 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
* Return: %0 if successful and a negative error code otherwise.
*/
int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
- struct msghdr *msg, size_t len,
- rxrpc_notify_end_tx_t notify_end_tx)
+ struct msghdr *msg, rxrpc_notify_end_tx_t notify_end_tx)
{
int ret;
@@ -758,12 +756,25 @@ int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call,
ASSERTCMP(msg->msg_name, ==, NULL);
ASSERTCMP(msg->msg_control, ==, NULL);
- mutex_lock(&call->user_mutex);
+ for (;;) {
+ mutex_lock(&call->user_mutex);
+
+ ret = rxrpc_send_data(rxrpc_sk(sock->sk), call, msg,
+ msg_data_left(msg), notify_end_tx);
+ if (ret == -ESHUTDOWN)
+ ret = call->error;
+ if (ret < 0)
+ break;
+ if (msg_data_left(msg) == 0) {
+ ret = 0;
+ break;
+ }
+ if (ret == 0) {
+ ret = -EIO;
+ break;
+ }
+ }
- ret = rxrpc_send_data(rxrpc_sk(sock->sk), call, msg, len,
- notify_end_tx);
- if (ret == -ESHUTDOWN)
- ret = call->error;
_leave(" = %d", ret);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 370/816] x86/cpuid: Mark CPUID function 0x23 as being indexed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (368 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 369/816] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data() Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 371/816] media: rc: Replace open coded krealloc() for keymap Greg Kroah-Hartman
` (450 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rick Edgecombe, Sean Christopherson,
Borislav Petkov (AMD), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit 108775fa28fe04a16f19a828a779689f3d0ea9f0 ]
Add function 0x23 to the set of CPUID functions that are indexed, as per
the SDM and the many sub-leafs defined in leaf_types.h.
Closes: https://lore.kernel.org/all/213d614fe73e183a230c8f4e0c8fa1cc3d45df39.camel@intel.com
Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261022210134.612848-2-seanjc@google.com
[ sashal: Applied the new case to cpuid_function_is_indexed() in asm/cpuid.h, since the cpuid/api.h header from upstream does not exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/cpuid.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/cpuid.h b/arch/x86/include/asm/cpuid.h
index ca4243318aadc..3d37bcf6ac2d3 100644
--- a/arch/x86/include/asm/cpuid.h
+++ b/arch/x86/include/asm/cpuid.h
@@ -179,6 +179,7 @@ static __always_inline bool cpuid_function_is_indexed(u32 function)
case 0x1d:
case 0x1e:
case 0x1f:
+ case 0x23:
case 0x24:
case 0x8000001d:
return true;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 371/816] media: rc: Replace open coded krealloc() for keymap
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (369 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 370/816] x86/cpuid: Mark CPUID function 0x23 as being indexed Greg Kroah-Hartman
@ 2026-11-25 14:31 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 372/816] media: rc: Add missing locking " Greg Kroah-Hartman
` (449 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sean Young, Hans Verkuil,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Young <sean@mess.org>
[ Upstream commit e4b4aa413cc2e48a261c8c513ced964a3390c0cf ]
Replace open coded krealloc() and remove superfluous member of struct
rc_map - we don't need to track both the size in bytes and entries.
Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Stable-dep-of: ab9567336171 ("media: rc: Add missing locking for keymap")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/rc/rc-main.c | 45 +++++++++++++++++++-------------------
include/media/rc-map.h | 2 --
2 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index eb19ee6765dfb..63b536571d442 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -17,9 +17,8 @@
#include <linux/module.h>
#include "rc-core-priv.h"
-/* Sizes are in bytes, 256 bytes allows for 32 entries on x64 */
-#define IR_TAB_MIN_SIZE 256
-#define IR_TAB_MAX_SIZE 8192
+#define IR_TAB_MIN_ENTRIES 32
+#define IR_TAB_MAX_ENTRIES 1024
static const struct {
const char *name;
@@ -214,21 +213,23 @@ static int scancode_to_u64(const struct input_keymap_entry *ke, u64 *scancode)
static int ir_create_table(struct rc_dev *dev, struct rc_map *rc_map,
const char *name, u64 rc_proto, size_t size)
{
+ unsigned int alloc;
rc_map->name = kstrdup(name, GFP_KERNEL);
if (!rc_map->name)
return -ENOMEM;
+ alloc = roundup_pow_of_two(size);
rc_map->rc_proto = rc_proto;
- rc_map->alloc = roundup_pow_of_two(size * sizeof(struct rc_map_table));
- rc_map->size = rc_map->alloc / sizeof(struct rc_map_table);
- rc_map->scan = kmalloc(rc_map->alloc, GFP_KERNEL);
+ rc_map->len = 0;
+ rc_map->size = alloc;
+ rc_map->scan = kmalloc_objs(struct rc_map_table, alloc, GFP_KERNEL);
if (!rc_map->scan) {
kfree(rc_map->name);
rc_map->name = NULL;
return -ENOMEM;
}
- dev_dbg(&dev->dev, "Allocated space for %u keycode entries (%u bytes)\n",
- rc_map->size, rc_map->alloc);
+ dev_dbg(&dev->dev, "Allocated space for %u keycode entries (%zu bytes)\n",
+ alloc, alloc * sizeof(struct rc_map_table));
return 0;
}
@@ -262,38 +263,36 @@ static void ir_free_table(struct rc_map *rc_map)
static int ir_resize_table(struct rc_dev *dev, struct rc_map *rc_map,
gfp_t gfp_flags)
{
- unsigned int oldalloc = rc_map->alloc;
- unsigned int newalloc = oldalloc;
- struct rc_map_table *oldscan = rc_map->scan;
+ unsigned int newsize = rc_map->size;
struct rc_map_table *newscan;
if (rc_map->size == rc_map->len) {
/* All entries in use -> grow keytable */
- if (rc_map->alloc >= IR_TAB_MAX_SIZE)
+ if (newsize >= IR_TAB_MAX_ENTRIES)
return -ENOMEM;
- newalloc *= 2;
- dev_dbg(&dev->dev, "Growing table to %u bytes\n", newalloc);
+ newsize *= 2;
+
+ dev_dbg(&dev->dev, "Growing table to %u entries\n", newsize);
}
- if ((rc_map->len * 3 < rc_map->size) && (oldalloc > IR_TAB_MIN_SIZE)) {
+ if (rc_map->len * 3 < rc_map->size && rc_map->size > IR_TAB_MIN_ENTRIES) {
/* Less than 1/3 of entries in use -> shrink keytable */
- newalloc /= 2;
- dev_dbg(&dev->dev, "Shrinking table to %u bytes\n", newalloc);
+ newsize /= 2;
+ dev_dbg(&dev->dev, "Shrinking table to %u entries\n", newsize);
}
- if (newalloc == oldalloc)
+ if (newsize == rc_map->size)
return 0;
- newscan = kmalloc(newalloc, gfp_flags);
+ newscan = krealloc_array(rc_map->scan, newsize,
+ sizeof(struct rc_map_table), gfp_flags);
if (!newscan)
return -ENOMEM;
- memcpy(newscan, rc_map->scan, rc_map->len * sizeof(struct rc_map_table));
rc_map->scan = newscan;
- rc_map->alloc = newalloc;
- rc_map->size = rc_map->alloc / sizeof(struct rc_map_table);
- kfree(oldscan);
+ rc_map->size = newsize;
+
return 0;
}
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index ab8c1b82dff6a..c84b4ef70a841 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -148,7 +148,6 @@ struct rc_map_table {
* @scan: pointer to struct &rc_map_table
* @size: Max number of entries
* @len: Number of entries that are in use
- * @alloc: size of \*scan, in bytes
* @rc_proto: type of the remote controller protocol, as defined at
* enum &rc_proto
* @name: name of the key map table
@@ -158,7 +157,6 @@ struct rc_map {
struct rc_map_table *scan;
unsigned int size;
unsigned int len;
- unsigned int alloc;
enum rc_proto rc_proto;
const char *name;
spinlock_t lock;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 372/816] media: rc: Add missing locking for keymap
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (370 preceding siblings ...)
2026-11-25 14:31 ` [PATCH 6.12 371/816] media: rc: Replace open coded krealloc() for keymap Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 373/816] wifi: mt76: take rcu_read_lock in the USB/SDIO tx completion path Greg Kroah-Hartman
` (448 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sean Young, Hans Verkuil,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Young <sean@mess.org>
[ Upstream commit ab9567336171e46ce9e03ee126902b3fd7901baa ]
When the rc_map for an rc_dev gets updated, locking is required but is
missing in places. A concurrent scancode lookup and a call to
rc_{register,unregistered}_device() could result in a use-after-free;
this could happen if IR is decoded during those function calls.
Add lockdep assertions where locks are required.
ir_free_table() should only be called for non-TX devices else we will
use a spinlock without iniitializing it.
Fixes: dccc0c3ddf8f ("media: rc: fix race between unregister and urb/irq callbacks")
Signed-off-by: Sean Young <sean@mess.org>
Cc: stable@vger.kernel.org
Acked-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/rc/rc-main.c | 86 +++++++++++++++++++++++++-------------
1 file changed, 57 insertions(+), 29 deletions(-)
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 63b536571d442..22848d7d3e4f0 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -104,7 +104,6 @@ static struct rc_map_list *seek_rc_map(const char *name)
struct rc_map *rc_map_get(const char *name)
{
-
struct rc_map_list *map;
map = seek_rc_map(name);
@@ -201,7 +200,7 @@ static int scancode_to_u64(const struct input_keymap_entry *ke, u64 *scancode)
* ir_create_table() - initializes a scancode table
* @dev: the rc_dev device
* @rc_map: the rc_map to initialize
- * @name: name to assign to the table
+ * @map_name: name to assign to the table
* @rc_proto: ir type to assign to the new table
* @size: initial size of the table
*
@@ -211,23 +210,31 @@ static int scancode_to_u64(const struct input_keymap_entry *ke, u64 *scancode)
* return: zero on success or a negative error code
*/
static int ir_create_table(struct rc_dev *dev, struct rc_map *rc_map,
- const char *name, u64 rc_proto, size_t size)
+ const char *map_name, u64 rc_proto, size_t size)
{
+ struct rc_map_table *scan;
unsigned int alloc;
- rc_map->name = kstrdup(name, GFP_KERNEL);
- if (!rc_map->name)
+ char *name;
+
+ name = kstrdup(map_name, GFP_KERNEL);
+ if (!name)
return -ENOMEM;
+
alloc = roundup_pow_of_two(size);
- rc_map->rc_proto = rc_proto;
- rc_map->len = 0;
- rc_map->size = alloc;
- rc_map->scan = kmalloc_objs(struct rc_map_table, alloc, GFP_KERNEL);
- if (!rc_map->scan) {
- kfree(rc_map->name);
- rc_map->name = NULL;
+ scan = kmalloc_objs(struct rc_map_table, alloc, GFP_KERNEL);
+ if (!scan) {
+ kfree(name);
return -ENOMEM;
}
+ scoped_guard(spinlock_irqsave, &rc_map->lock) {
+ rc_map->name = name;
+ rc_map->scan = scan;
+ rc_map->rc_proto = rc_proto;
+ rc_map->len = 0;
+ rc_map->size = alloc;
+ }
+
dev_dbg(&dev->dev, "Allocated space for %u keycode entries (%zu bytes)\n",
alloc, alloc * sizeof(struct rc_map_table));
return 0;
@@ -237,16 +244,26 @@ static int ir_create_table(struct rc_dev *dev, struct rc_map *rc_map,
* ir_free_table() - frees memory allocated by a scancode table
* @rc_map: the table whose mappings need to be freed
*
- * This routine will free memory alloctaed for key mappings used by given
+ * This routine will free memory allocated for key mappings used by given
* scancode table.
*/
static void ir_free_table(struct rc_map *rc_map)
{
- rc_map->size = 0;
- kfree(rc_map->name);
- rc_map->name = NULL;
- kfree(rc_map->scan);
- rc_map->scan = NULL;
+ struct rc_map_table *scan;
+ const char *name;
+
+ scoped_guard(spinlock_irqsave, &rc_map->lock) {
+ name = rc_map->name;
+ scan = rc_map->scan;
+
+ rc_map->size = 0;
+ rc_map->len = 0;
+ rc_map->name = NULL;
+ rc_map->scan = NULL;
+ }
+
+ kfree(name);
+ kfree(scan);
}
/**
@@ -266,6 +283,8 @@ static int ir_resize_table(struct rc_dev *dev, struct rc_map *rc_map,
unsigned int newsize = rc_map->size;
struct rc_map_table *newscan;
+ lockdep_assert_held(&rc_map->lock);
+
if (rc_map->size == rc_map->len) {
/* All entries in use -> grow keytable */
if (newsize >= IR_TAB_MAX_ENTRIES)
@@ -317,6 +336,8 @@ static unsigned int ir_update_mapping(struct rc_dev *dev,
int old_keycode = rc_map->scan[index].keycode;
int i;
+ lockdep_assert_held(&rc_map->lock);
+
/* Did the user wish to remove the mapping? */
if (new_keycode == KEY_RESERVED || new_keycode == KEY_UNKNOWN) {
dev_dbg(&dev->dev, "#%d: Deleting scan 0x%04llx\n",
@@ -372,6 +393,8 @@ static unsigned int ir_establish_scancode(struct rc_dev *dev,
{
unsigned int i;
+ lockdep_assert_held(&rc_map->lock);
+
/*
* Unfortunately, some hardware-based IR decoders don't provide
* all bits for the complete IR code. In general, they provide only
@@ -396,7 +419,7 @@ static unsigned int ir_establish_scancode(struct rc_dev *dev,
/* No previous mapping found, we might need to grow the table */
if (rc_map->size == rc_map->len) {
if (!resize || ir_resize_table(dev, rc_map, GFP_ATOMIC))
- return -1U;
+ return UINT_MAX;
}
/* i is the proper index to insert our new keycode */
@@ -478,16 +501,18 @@ static int ir_setkeytable(struct rc_dev *dev, const struct rc_map *from)
if (rc)
return rc;
- for (i = 0; i < from->size; i++) {
- index = ir_establish_scancode(dev, rc_map,
- from->scan[i].scancode, false);
- if (index >= rc_map->len) {
- rc = -ENOMEM;
- break;
- }
+ scoped_guard(spinlock_irqsave, &rc_map->lock) {
+ for (i = 0; i < from->size; i++) {
+ index = ir_establish_scancode(dev, rc_map,
+ from->scan[i].scancode, false);
+ if (index >= rc_map->len) {
+ rc = -ENOMEM;
+ break;
+ }
- ir_update_mapping(dev, rc_map, index,
- from->scan[i].keycode);
+ ir_update_mapping(dev, rc_map, index,
+ from->scan[i].keycode);
+ }
}
if (rc)
@@ -523,6 +548,8 @@ static unsigned int ir_lookup_by_scancode(const struct rc_map *rc_map,
{
struct rc_map_table *res;
+ lockdep_assert_held(&rc_map->lock);
+
res = bsearch(&scancode, rc_map->scan, rc_map->len,
sizeof(struct rc_map_table), rc_map_cmp);
if (!res)
@@ -1988,7 +2015,8 @@ int rc_register_device(struct rc_dev *dev)
scoped_guard(mutex, &dev->lock)
dev->registered = false;
out_free_table:
- ir_free_table(&dev->rc_map);
+ if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
+ ir_free_table(&dev->rc_map);
out_raw:
ir_raw_event_free(dev);
out_minor:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 373/816] wifi: mt76: take rcu_read_lock in the USB/SDIO tx completion path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (371 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 372/816] media: rc: Add missing locking " Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 374/816] misc: fastrpc: Allocate entire reserved memory for Audio PD in probe Greg Kroah-Hartman
` (447 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit a7871a7ae5a8625f0ba0a89454ac734c383dd538 ]
The USB and SDIO completion path reads a station pointer that RCU
protects, without holding the read lock. Lockdep catches it on the
first association:
mt76.h:1305 suspicious rcu_dereference_check() usage!
no locks held by mt76-usb-status/1254.
mt7925_usb_sdio_tx_complete_skb+0x119/0x130 [mt7925_common]
mt76_queue_tx_complete+0x27/0x60 [mt76]
mt76u_status_worker+0xed/0x1e0 [mt76_usb]
mt7925/mac.c:856 suspicious rcu_dereference_check() usage!
mt7925_tx_check_aggr.part.0+0xc2/0xe0 [mt7925_common]
mt7925_usb_sdio_tx_complete_skb+0xa0/0x130 [mt7925_common]
mt7921 does the same, and warns once instead of twice because its
aggregation check reads the default link directly. The DMA path makes
the same reads but completes from softirq, so it stays quiet.
Take the read lock around the lookup and the check.
Tested on 7.2-rc5 with lockdep, fresh module load per arm, 4000
packets each and no change to the link:
splats before after
MT7925 Netgear A9000 2 0
MT7921 Alfa 1 0
mt7921e same kernel 0 0
Fixes: dc66a129adf1 ("wifi: mt76: add a wrapper for wcid access with validation")
Fixes: c22769de2509 ("wifi: mt76: mt7925u: use connac3 tx aggr check in tx complete")
Cc: stable@vger.kernel.org
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20261003233056.94497-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 3 +++
drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index 6da67054e521d..89df72e20598b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -832,11 +832,14 @@ void mt7921_usb_sdio_tx_complete_skb(struct mt76_dev *mdev,
u16 idx;
idx = le32_get_bits(txwi[1], MT_TXD1_WLAN_IDX);
+
+ rcu_read_lock();
wcid = rcu_dereference(mdev->wcid[idx]);
sta = wcid_to_sta(wcid);
if (sta && likely(e->skb->protocol != cpu_to_be16(ETH_P_PAE)))
mt76_connac2_tx_check_aggr(sta, txwi);
+ rcu_read_unlock();
skb_pull(e->skb, headroom);
mt76_tx_complete_skb(mdev, e->wcid, e->skb);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index a8d0cd09184e3..876236888519f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -1482,11 +1482,14 @@ void mt7925_usb_sdio_tx_complete_skb(struct mt76_dev *mdev,
u16 idx;
idx = le32_get_bits(txwi[1], MT_TXD1_WLAN_IDX);
+
+ rcu_read_lock();
wcid = rcu_dereference(mdev->wcid[idx]);
sta = wcid_to_sta(wcid);
if (sta && likely(e->skb->protocol != cpu_to_be16(ETH_P_PAE)))
mt7925_tx_check_aggr(sta, e->skb, wcid);
+ rcu_read_unlock();
skb_pull(e->skb, headroom);
mt76_tx_complete_skb(mdev, e->wcid, e->skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 374/816] misc: fastrpc: Allocate entire reserved memory for Audio PD in probe
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (372 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 373/816] wifi: mt76: take rcu_read_lock in the USB/SDIO tx completion path Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 375/816] power: supply: Correct multiple typos in comments Greg Kroah-Hartman
` (446 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jianping Li, Ekansh Gupta,
Srinivas Kandagatla, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianping Li <jianping.li@oss.qualcomm.com>
[ Upstream commit 9e47ad9c562e82cabfbb9afa6c2b0dcdf2702a39 ]
Allocating and freeing Audio PD memory from userspace is unsafe because
the kernel cannot reliably determine when the DSP has finished using the
memory. Userspace may free buffers while they are still in use by the DSP,
and remote free requests cannot be safely trusted.
Additionally, the current implementation allows userspace to repeatedly
grow the Audio PD heap, but does not support shrinking it. This can lead
to unbounded memory usage over time, effectively causing a memory leak.
Fix this by allocating the entire Audio PD reserved-memory region during
rpmsg probe and tying its lifetime to the rpmsg channel. This removes
userspace-controlled alloc/free and ensures that memory is reclaimed only
when the DSP process is torn down.
The reserved-memory region is now mandatory for the Audio PD domain.
Rather than failing rpmsg probe when it is missing, validate it in
fastrpc_init_create_static_process() and reject only the static-process
creation. This keeps the fastrpc device probing for all other domains
even on a misconfigured device tree.
Fixes: 0871561055e66 ("misc: fastrpc: Add support for audiopd")
Cc: stable@kernel.org
Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
Reviewed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
Link: https://lore.kernel.org/all/20260814101955.234238-1-jianping.li@oss.qualcomm.com/
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20261002101220.1084101-3-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ sashal: Replaced of_reserved_mem_region_to_resource() with of_parse_phandle()/of_reserved_mem_lookup(), and used the existing fdev_error label instead of err_free_data. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/misc/fastrpc.c | 198 ++++++++++++++++++++++-------------------
1 file changed, 106 insertions(+), 92 deletions(-)
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index a4577ef5a3946..9c016ef288200 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -47,8 +47,6 @@
#define ADSP_MMAP_HEAP_ADDR 4
/* MAP static DMA buffer on DSP User PD */
#define ADSP_MMAP_DMA_BUFFER 6
-/* Add memory to static PD pool protection thru hypervisor */
-#define ADSP_MMAP_REMOTE_HEAP_ADDR 8
/* Add memory to userPD pool, for user heap */
#define ADSP_MMAP_ADD_PAGES 0x1000
/* Add memory to userPD pool, for LLC heap */
@@ -273,10 +271,14 @@ struct fastrpc_channel_ctx {
struct kref refcount;
/* Flag if dsp attributes are cached */
bool valid_attributes;
+ /* Flag if audio PD init mem was allocated */
+ bool audio_init_mem;
+ /* Audio PD reserved remote heap region */
+ phys_addr_t remote_heap_addr;
+ u64 remote_heap_size;
u32 dsp_attributes[FASTRPC_MAX_DSP_ATTRIBUTES];
struct fastrpc_device *secure_fdevice;
struct fastrpc_device *fdevice;
- struct fastrpc_buf *remote_heap;
struct list_head invoke_interrupted_mmaps;
bool secure;
bool unsigned_support;
@@ -1320,15 +1322,24 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
struct fastrpc_init_create_static init;
struct fastrpc_invoke_args *args;
struct fastrpc_phy_page pages[1];
+ struct fastrpc_channel_ctx *cctx = fl->cctx;
char *name;
int err;
- bool scm_done = false;
struct {
int pgid;
u32 namelen;
u32 pageslen;
} inbuf;
u32 sc;
+ unsigned long flags;
+ bool sent_heap = false;
+
+ if (!cctx->remote_heap_addr || !cctx->remote_heap_size) {
+ err = -ENOMEM;
+ dev_err(fl->sctx->dev,
+ "remote heap memory region is not added\n");
+ return err;
+ }
args = kcalloc(FASTRPC_CREATE_STATIC_PROCESS_NARGS, sizeof(*args), GFP_KERNEL);
if (!args)
@@ -1350,31 +1361,6 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
goto err;
}
- if (!fl->cctx->remote_heap) {
- err = fastrpc_remote_heap_alloc(fl, fl->sctx->dev, init.memlen,
- &fl->cctx->remote_heap);
- if (err)
- goto err_name;
-
- /* Map if we have any heap VMIDs associated with this ADSP Static Process. */
- if (fl->cctx->vmcount) {
- u64 src_perms = BIT(QCOM_SCM_VMID_HLOS);
-
- err = qcom_scm_assign_mem(fl->cctx->remote_heap->dma_addr,
- (u64)fl->cctx->remote_heap->size,
- &src_perms,
- fl->cctx->vmperms, fl->cctx->vmcount);
- if (err) {
- dev_err(fl->sctx->dev,
- "Failed to assign memory with dma_addr %pad size 0x%llx err %d\n",
- &fl->cctx->remote_heap->dma_addr,
- fl->cctx->remote_heap->size, err);
- goto err_map;
- }
- scm_done = true;
- }
- }
-
inbuf.pgid = fl->tgid;
inbuf.namelen = init.namelen;
inbuf.pageslen = 0;
@@ -1388,8 +1374,25 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
args[1].length = inbuf.namelen;
args[1].fd = -1;
- pages[0].addr = fl->cctx->remote_heap->dma_addr;
- pages[0].size = fl->cctx->remote_heap->size;
+ /*
+ * Audio PD is a static PD and retains the remote heap
+ * information across daemon restarts. Therefore only
+ * the first attach should provide heap information to
+ * DSP. Subsequent attaches reuse the previously
+ * initialized memory pool.
+ */
+ spin_lock_irqsave(&cctx->lock, flags);
+ if (!cctx->audio_init_mem) {
+ pages[0].addr = cctx->remote_heap_addr;
+ pages[0].size = cctx->remote_heap_size;
+ cctx->audio_init_mem = true;
+ inbuf.pageslen = 1;
+ sent_heap = true;
+ } else {
+ pages[0].addr = 0;
+ pages[0].size = 0;
+ }
+ spin_unlock_irqrestore(&cctx->lock, flags);
args[2].ptr = (u64)(uintptr_t) pages;
args[2].length = sizeof(*pages);
@@ -1407,27 +1410,11 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
return 0;
err_invoke:
- if (fl->cctx->vmcount && scm_done) {
- u64 src_perms = 0;
- struct qcom_scm_vmperm dst_perms;
- u32 i;
-
- for (i = 0; i < fl->cctx->vmcount; i++)
- src_perms |= BIT(fl->cctx->vmperms[i].vmid);
-
- dst_perms.vmid = QCOM_SCM_VMID_HLOS;
- dst_perms.perm = QCOM_SCM_PERM_RWX;
- err = qcom_scm_assign_mem(fl->cctx->remote_heap->dma_addr,
- (u64)fl->cctx->remote_heap->size,
- &src_perms, &dst_perms, 1);
- if (err)
- dev_err(fl->sctx->dev, "Failed to assign memory dma_addr %pad size 0x%llx err %d\n",
- &fl->cctx->remote_heap->dma_addr, fl->cctx->remote_heap->size, err);
+ if (sent_heap) {
+ spin_lock_irqsave(&cctx->lock, flags);
+ cctx->audio_init_mem = false;
+ spin_unlock_irqrestore(&cctx->lock, flags);
}
-err_map:
- fastrpc_buf_free(fl->cctx->remote_heap);
- fl->cctx->remote_heap = NULL;
-err_name:
kfree(name);
err:
kfree(args);
@@ -1937,7 +1924,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
if (copy_from_user(&req, argp, sizeof(req)))
return -EFAULT;
- if (req.flags != ADSP_MMAP_ADD_PAGES && req.flags != ADSP_MMAP_REMOTE_HEAP_ADDR) {
+ if (req.flags != ADSP_MMAP_ADD_PAGES) {
dev_err(dev, "flag not supported 0x%x\n", req.flags);
return -EINVAL;
@@ -1948,10 +1935,7 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
return -EINVAL;
}
- if (req.flags == ADSP_MMAP_REMOTE_HEAP_ADDR)
- err = fastrpc_remote_heap_alloc(fl, dev, req.size, &buf);
- else
- err = fastrpc_buf_alloc(fl, dev, req.size, &buf);
+ err = fastrpc_buf_alloc(fl, dev, req.size, &buf);
if (err) {
dev_err(dev, "failed to allocate buffer\n");
@@ -1990,20 +1974,6 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp)
/* let the client know the address to use */
req.vaddrout = rsp_msg.vaddr;
- /* Add memory to static PD pool, protection thru hypervisor */
- if (req.flags == ADSP_MMAP_REMOTE_HEAP_ADDR && fl->cctx->vmcount) {
- u64 src_perms = BIT(QCOM_SCM_VMID_HLOS);
-
- err = qcom_scm_assign_mem(buf->dma_addr, (u64)buf->size,
- &src_perms, fl->cctx->vmperms, fl->cctx->vmcount);
- if (err) {
- dev_err(fl->sctx->dev,
- "Failed to assign memory dma_addr %pad size 0x%llx err %d",
- &buf->dma_addr, buf->size, err);
- goto err_assign;
- }
- }
-
spin_lock(&fl->lock);
list_add_tail(&buf->node, &fl->mmaps);
spin_unlock(&fl->lock);
@@ -2323,6 +2293,50 @@ static int fastrpc_device_register(struct device *dev, struct fastrpc_channel_ct
return err;
}
+static int fastrpc_init_reserved_mem(struct fastrpc_channel_ctx *cctx,
+ struct device *rdev, u32 domain_id)
+{
+ struct device_node *rmem_node;
+ struct reserved_mem *rmem;
+ u64 src_perms;
+
+ /* Only SDSP and ADSP domains use a reserved remote heap region */
+ if (domain_id != SDSP_DOMAIN_ID && domain_id != ADSP_DOMAIN_ID)
+ return 0;
+
+ rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
+ if (!rmem_node) {
+ /*
+ * The reserved-memory region is optional at probe time. For
+ * the Audio PD (ADSP) domain its absence is validated later in
+ * fastrpc_init_create_static_process(), so keep probing here.
+ */
+ return 0;
+ }
+
+ rmem = of_reserved_mem_lookup(rmem_node);
+ of_node_put(rmem_node);
+ if (!rmem)
+ return 0;
+
+ /*
+ * Audio PD (ADSP) is a static PD: cache the region so its lifetime
+ * is tied to the rpmsg channel instead of being controlled by
+ * userspace.
+ */
+ if (domain_id == ADSP_DOMAIN_ID) {
+ cctx->remote_heap_addr = rmem->base;
+ cctx->remote_heap_size = rmem->size;
+ }
+
+ if (!cctx->vmcount)
+ return 0;
+
+ src_perms = BIT(QCOM_SCM_VMID_HLOS);
+ return qcom_scm_assign_mem(rmem->base, rmem->size, &src_perms,
+ cctx->vmperms, cctx->vmcount);
+}
+
static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
{
struct device *rdev = &rpdev->dev;
@@ -2330,8 +2344,6 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
int i, err, domain_id = -1, vmcount;
const char *domain;
bool secure_dsp;
- struct device_node *rmem_node;
- struct reserved_mem *rmem;
unsigned int vmids[FASTRPC_MAX_VMIDS];
err = of_property_read_string(rdev->of_node, "label", &domain);
@@ -2374,24 +2386,9 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
}
}
- rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0);
- if (domain_id == SDSP_DOMAIN_ID && rmem_node) {
- u64 src_perms;
-
- rmem = of_reserved_mem_lookup(rmem_node);
- if (!rmem) {
- err = -EINVAL;
- goto fdev_error;
- }
-
- src_perms = BIT(QCOM_SCM_VMID_HLOS);
-
- err = qcom_scm_assign_mem(rmem->base, rmem->size, &src_perms,
- data->vmperms, data->vmcount);
- if (err)
- goto fdev_error;
-
- }
+ err = fastrpc_init_reserved_mem(data, rdev, domain_id);
+ if (err)
+ goto fdev_error;
secure_dsp = !(of_property_read_bool(rdev->of_node, "qcom,non-secure-domain"));
data->secure = secure_dsp;
@@ -2487,8 +2484,25 @@ static void fastrpc_rpmsg_remove(struct rpmsg_device *rpdev)
list_for_each_entry_safe(buf, b, &cctx->invoke_interrupted_mmaps, node)
list_del(&buf->node);
- if (cctx->remote_heap)
- fastrpc_buf_free(cctx->remote_heap);
+ if (cctx->remote_heap_size && cctx->vmcount) {
+ u64 src_perms = 0;
+ int err, i;
+ struct qcom_scm_vmperm dst_perms;
+
+ for (i = 0; i < cctx->vmcount; i++)
+ src_perms |= BIT(cctx->vmperms[i].vmid);
+
+ dst_perms.vmid = QCOM_SCM_VMID_HLOS;
+ dst_perms.perm = QCOM_SCM_PERM_RWX;
+
+ err = qcom_scm_assign_mem(cctx->remote_heap_addr,
+ cctx->remote_heap_size, &src_perms,
+ &dst_perms, 1);
+ if (err)
+ dev_err(&rpdev->dev,
+ "Failed to assign memory back to HLOS: addr %pa size %#llx err %d\n",
+ &cctx->remote_heap_addr, cctx->remote_heap_size, err);
+ }
of_platform_depopulate(&rpdev->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 375/816] power: supply: Correct multiple typos in comments
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (373 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 374/816] misc: fastrpc: Allocate entire reserved memory for Audio PD in probe Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 376/816] power: supply: qcom_smbx: set the charge enable after software control Greg Kroah-Hartman
` (445 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shen Lichuan, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shen Lichuan <shenlichuan@vivo.com>
[ Upstream commit 570c2234d5d62d52be7e8e35169b96d98378a7ce ]
Fixed some spelling errors, the details are as follows:
-in the code comments:
dettached->detached
meausered->measured
meausurement->measurement
sholuld->should
Tempreture->Temperature
measuremnts->measurements
detecing->detecting
persent->percent
Parallell->Parallel
Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://lore.kernel.org/r/20240914085415.3886-1-shenlichuan@vivo.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Stable-dep-of: 1fba78714201 ("power: supply: qcom_smbx: set the charge enable after software control")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/88pm860x_battery.c | 4 ++--
drivers/power/supply/ab8500_btemp.c | 2 +-
drivers/power/supply/charger-manager.c | 2 +-
drivers/power/supply/da9030_battery.c | 4 ++--
drivers/power/supply/max8925_power.c | 2 +-
drivers/power/supply/qcom_battmgr.c | 2 +-
drivers/power/supply/qcom_smbx.c | 2 +-
7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/power/supply/88pm860x_battery.c b/drivers/power/supply/88pm860x_battery.c
index 34619c4d4eced..b7938fbb24a51 100644
--- a/drivers/power/supply/88pm860x_battery.c
+++ b/drivers/power/supply/88pm860x_battery.c
@@ -422,7 +422,7 @@ static irqreturn_t pm860x_batt_handler(int irq, void *data)
info->temp_type = PM860X_TEMP_TINT;
}
mutex_unlock(&info->lock);
- /* clear ccnt since battery is attached or dettached */
+ /* clear ccnt since battery is attached or detached */
clear_ccnt(info, &ccnt_data);
return IRQ_HANDLED;
}
@@ -566,7 +566,7 @@ static int measure_temp(struct pm860x_battery_info *info, int *data)
ret = measure_12bit_voltage(info, PM8607_GPADC1_MEAS1, data);
if (ret)
return ret;
- /* meausered Vtbat(mV) / Ibias_current(11uA)*/
+ /* measured Vtbat(mV) / Ibias_current(11uA)*/
*data = (*data * 1000) / GPBIAS2_GPADC1_UA;
if (*data > TBAT_NEG_25D) {
diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c
index 082bd09cbedfd..769d28ebca105 100644
--- a/drivers/power/supply/ab8500_btemp.c
+++ b/drivers/power/supply/ab8500_btemp.c
@@ -283,7 +283,7 @@ static void ab8500_btemp_periodic_work(struct work_struct *work)
dev_warn(di->dev, "failed to identify the battery\n");
}
- /* Failover if a reading is erroneous, use last meausurement */
+ /* Failover if a reading is erroneous, use last measurement */
ret = thermal_zone_get_temp(di->tz, &bat_temp);
if (ret) {
dev_err(di->dev, "error reading temperature\n");
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 272f963b69130..8d2c5de1603af 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -221,7 +221,7 @@ static bool is_charging(struct charger_manager *cm)
/* If at least one of the charger is charging, return yes */
for (i = 0; cm->desc->psy_charger_stat[i]; i++) {
- /* 1. The charger sholuld not be DISABLED */
+ /* 1. The charger should not be DISABLED */
if (cm->emergency_stop)
continue;
if (!cm->charger_enabled)
diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c
index 04e0f4162d42b..b89604a8c0199 100644
--- a/drivers/power/supply/da9030_battery.c
+++ b/drivers/power/supply/da9030_battery.c
@@ -269,7 +269,7 @@ static void da9030_charger_check_state(struct da9030_charger *charger)
}
if (charger->adc.vchmax_res > charger->thresholds.vcharge_max ||
charger->adc.vchmin_res < charger->thresholds.vcharge_min ||
- /* Tempreture readings are negative */
+ /* Temperature readings are negative */
charger->adc.tbat_res < charger->thresholds.tbat_high ||
charger->adc.tbat_res > charger->thresholds.tbat_low) {
/* disable charger */
@@ -470,7 +470,7 @@ static int da9030_battery_charger_init(struct da9030_charger *charger)
if (ret)
return ret;
- /* enable auto ADC measuremnts */
+ /* enable auto ADC measurements */
return da903x_write(charger->master, DA9030_ADC_AUTO_CONTROL,
DA9030_ADC_TBAT_ENABLE | DA9030_ADC_VBAT_IN_TXON |
DA9030_ADC_VCH_ENABLE | DA9030_ADC_ICH_ENABLE |
diff --git a/drivers/power/supply/max8925_power.c b/drivers/power/supply/max8925_power.c
index 621a006d52a96..fc24a6d3b63d8 100644
--- a/drivers/power/supply/max8925_power.c
+++ b/drivers/power/supply/max8925_power.c
@@ -73,7 +73,7 @@ struct max8925_power_info {
unsigned usb_online:1;
unsigned bat_online:1;
unsigned chg_mode:2;
- unsigned batt_detect:1; /* detecing MB by ID pin */
+ unsigned batt_detect:1; /* detecting MB by ID pin */
unsigned topoff_threshold:2;
unsigned fast_charge:3;
unsigned no_temp_support:1;
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index 81ec6ab7e1ad0..2c34cda87d07b 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -153,7 +153,7 @@ struct qcom_battmgr_message {
__le32 capacity_low;
__le32 capacity_warning;
__le32 cycle_count;
- /* thousandth of persent */
+ /* thousandth of percent */
__le32 accuracy;
__le32 max_sample_time_ms;
__le32 min_sample_time_ms;
diff --git a/drivers/power/supply/qcom_smbx.c b/drivers/power/supply/qcom_smbx.c
index 099d1385ea12d..1f35416b0d939 100644
--- a/drivers/power/supply/qcom_smbx.c
+++ b/drivers/power/supply/qcom_smbx.c
@@ -837,7 +837,7 @@ static const struct smb_init_register smb_init_seq[] = {
AUTO_RECHG_BIT | EN_ANALOG_DROP_IN_VBATT_BIT |
CHARGER_INHIBIT_BIT,
.val = CHARGER_INHIBIT_BIT },
- /* STAT pin software override, match downstream. Parallell charging? */
+ /* STAT pin software override, match downstream. Parallel charging? */
{ .addr = STAT_CFG,
.mask = STAT_SW_OVERRIDE_CFG_BIT,
.val = STAT_SW_OVERRIDE_CFG_BIT },
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 376/816] power: supply: qcom_smbx: set the charge enable after software control
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (374 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 375/816] power: supply: Correct multiple typos in comments Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 377/816] ALSA: ua101: Bound packet copies by the PCM buffer size Greg Kroah-Hartman
` (444 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fabricio Akio, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabricio Akio <fabricioakio@gmail.com>
[ Upstream commit 1fba787142011145e1071cee9448b3677fb2323d ]
The init sequence sets CHARGING_ENABLE_CMD before CHGR_CFG2 selects
software control of the charge enable.
The Motorola Moto X4's bootloader leaves the charger watchdog armed to
disable charging when it bites, which it does after a few minutes in
fastboot. Charging then stays disabled in the next boot until the cable
is replugged. Setting the command after CHGR_CFG2 re-enables it.
Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Cc: stable@vger.kernel.org
Signed-off-by: Fabricio Akio <fabricioakio@gmail.com>
Link: https://patch.msgid.link/20261002-qcom-smbx-enable-order-v1-1-7df92bd809db@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/qcom_smbx.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/power/supply/qcom_smbx.c b/drivers/power/supply/qcom_smbx.c
index 1f35416b0d939..772198e792dc4 100644
--- a/drivers/power/supply/qcom_smbx.c
+++ b/drivers/power/supply/qcom_smbx.c
@@ -812,11 +812,7 @@ static const struct smb_init_register smb_init_seq[] = {
.mask = SOC_LT_CHG_RECHARGE_THRESH_SEL_BIT |
VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT,
.val = VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT },
- /* Enable charging */
{ .addr = USBIN_OPTIONS_1_CFG, .mask = HVDCP_EN_BIT, .val = 0 },
- { .addr = CHARGING_ENABLE_CMD,
- .mask = CHARGING_ENABLE_CMD_BIT,
- .val = CHARGING_ENABLE_CMD_BIT },
/*
* Match downstream defaults
* CHG_EN_SRC_BIT - charger enable is controlled by software
@@ -837,6 +833,13 @@ static const struct smb_init_register smb_init_seq[] = {
AUTO_RECHG_BIT | EN_ANALOG_DROP_IN_VBATT_BIT |
CHARGER_INHIBIT_BIT,
.val = CHARGER_INHIBIT_BIT },
+ /*
+ * Set the enable command only once CHGR_CFG2 has selected software
+ * control, or a charger its watchdog has disabled stays disabled.
+ */
+ { .addr = CHARGING_ENABLE_CMD,
+ .mask = CHARGING_ENABLE_CMD_BIT,
+ .val = CHARGING_ENABLE_CMD_BIT },
/* STAT pin software override, match downstream. Parallel charging? */
{ .addr = STAT_CFG,
.mask = STAT_SW_OVERRIDE_CFG_BIT,
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 377/816] ALSA: ua101: Bound packet copies by the PCM buffer size
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (375 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 376/816] power: supply: qcom_smbx: set the charge enable after software control Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 378/816] nvmet-tcp: validate the TLS handshake timeout Greg Kroah-Hartman
` (443 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sinan Turunc, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sinan Turunc <enscrpt@pm.me>
[ Upstream commit 493a77a9f20fca07ca5654f61c1b03bef035df25 ]
copy_capture_data() and copy_playback_data() wrap the ring buffer
position once and split the memcpy() in two at the buffer end, which is
only correct when one packet holds at most buffer_size frames. The
capture packet size is the device's (actual_length up to wMaxPacketSize,
divided by 3 * bNrChannels from its own descriptor), the playback packet
size is taken from the capture packets, and set_stream_hw() lets the
PCM client pick period_bytes_min 1, periods_min 2 and a period time of
1.5 packet intervals: 9 frames at 44.1 kHz high speed, an 18-frame
buffer. A device sending 672-byte mono 24-bit packets delivers 224
frames per packet.
After the first packet buffer_pos is 206 and stays beyond buffer_size.
On the next packet frames1 = buffer_size - buffer_pos wraps and memcpy()
runs away:
snd-ua101 2-1:1.0: invalid position: , pos = 206, buffer size = 18,
period size = 9
BUG: KASAN: slab-out-of-bounds in capture_urb_complete+0x9eb/0xcb0
Read of size 4294966732 at addr ffff88800d73e7e0 by task vhci_rx/81
and for playback:
BUG: KASAN: vmalloc-out-of-bounds in playback_work+0x789/0xac0
Read of size 4294966732 at addr ffffc9000002626a by task kworker/0:1H/80
Clamp the capture copy to buffer_size. On playback, copy at most one
buffer and fill the rest of the packet with silence, so the URB length,
the delay accounting and the data sent stay consistent. With that bound
the single wrap and both memcpy() halves stay inside the buffer. A
device whose packets do not fit the buffer never played correctly
anyway.
Reproduced on 7.3-rc7 with a USB/IP device presenting the UA-101
interface layout and a 672-byte isochronous endpoint.
Fixes: 63978ab3e3e9 ("sound: add Edirol UA-101 support")
Cc: stable@vger.kernel.org
Signed-off-by: Sinan Turunc <enscrpt@pm.me>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261026223543.620-3-enscrpt@pm.me
[ sashal: Adapted the playback_work() hunk to the older code: no scoped_guard indentation, and urb->urb.* / &urb->urb access via the struct ua101_urb wrapper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/misc/ua101.c | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index c43f4e4a8d670..db9dd58b20322 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -285,13 +285,29 @@ static void playback_work(struct work_struct *work)
/* fill packet with data or silence */
urb->urb.iso_frame_desc[0].length =
frames * ua->playback.frame_bytes;
- if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states))
+ if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) {
+ /*
+ * The packet size comes from the capture stream,
+ * i.e. from the device, while the ring buffer can
+ * be as small as two tiny periods. The single wrap
+ * in copy_playback_data() is only valid for
+ * frames <= buffer_size, so copy at most one
+ * buffer and send silence for the rest.
+ */
+ unsigned int copy_frames = min(frames,
+ ua->playback.substream->runtime->buffer_size);
+
do_period_elapsed |= copy_playback_data(&ua->playback,
&urb->urb,
- frames);
- else
+ copy_frames);
+ memset(urb->urb.transfer_buffer +
+ copy_frames * ua->playback.frame_bytes, 0,
+ (frames - copy_frames) *
+ ua->playback.frame_bytes);
+ } else {
memset(urb->urb.transfer_buffer, 0,
urb->urb.iso_frame_desc[0].length);
+ }
/* and off you go ... */
err = usb_submit_urb(&urb->urb, GFP_ATOMIC);
@@ -320,6 +336,13 @@ static bool copy_capture_data(struct ua101_stream *stream, struct urb *urb,
runtime = stream->substream->runtime;
frame_bytes = stream->frame_bytes;
+ /*
+ * A packet can carry up to max_packet_bytes, the device's
+ * wMaxPacketSize, which may exceed the whole ring buffer; keep what
+ * fits so the single wrap below stays valid.
+ */
+ if (unlikely(frames > runtime->buffer_size))
+ frames = runtime->buffer_size;
dest = runtime->dma_area + stream->buffer_pos * frame_bytes;
if (stream->buffer_pos + frames <= runtime->buffer_size) {
memcpy(dest, urb->transfer_buffer, frames * frame_bytes);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 378/816] nvmet-tcp: validate the TLS handshake timeout
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (376 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 377/816] ALSA: ua101: Bound packet copies by the PCM buffer size Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 379/816] drm/i915/psr: Disable linked plane sel fetch as well Greg Kroah-Hartman
` (442 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hannes Reinecke, Christoph Hellwig,
Yingjie Wang, Keith Busch, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <1075151112@qq.com>
[ Upstream commit e3e7a85730a4b17efa1e2ff4088443c4753be683 ]
tls_handshake_timeout is writable but stored as a signed int. Multiplying
the value by MSEC_PER_SEC and HZ therefore uses signed arithmetic.
With HZ=1000, setting it to 2147484 overflows both multiplications. If
the handshake request is accepted and remains pending, the timer wheel
treats the jiffies delay as already expired and queues the timeout work
on its next advance, while the handshake agent was given about 24.9
days. Negative values such as -1 cause the same immediate kernel-side
timeout.
Store the parameter as an unsigned int and reject values that cannot be
represented both by tls_handshake_args::ta_timeout_ms and by a safe
jiffies delay. Take one snapshot so a concurrent parameter update cannot
give the handshake agent and delayed work different timeouts. Document
the accepted range for built-in use.
Negative and oversized values now fail with -EINVAL. Keep zero valid,
preserving the existing immediate-timeout behavior.
Fixes: 675b453e0241 ("nvmet-tcp: enable TLS handshake upcall")
Cc: stable@vger.kernel.org
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Yingjie Wang <1075151112@qq.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../admin-guide/kernel-parameters.txt | 5 ++++
drivers/nvme/target/tcp.c | 26 ++++++++++++++++---
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index c0748a3c5aa6e..5f2ecf40fad58 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4219,6 +4219,11 @@
Valid values range from 0 to the smaller of
UINT_MAX / 1000 and MAX_JIFFY_OFFSET / HZ. Default: 10
+ nvmet_tcp.tls_handshake_timeout=
+ [NVME] NVMe/TCP target TLS handshake timeout in seconds.
+ Valid values range from 0 to the smaller of
+ UINT_MAX / 1000 and MAX_JIFFY_OFFSET / HZ. Default: 10
+
ohci1394_dma=early [HW,EARLY] enable debugging via the ohci1394 driver.
See Documentation/core-api/debugging-via-ohci1394.rst for more
info.
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index ab74d36438888..b46b022a68bc2 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -6,6 +6,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/key.h>
@@ -77,8 +78,24 @@ MODULE_PARM_DESC(idle_poll_period_usecs,
/*
* TLS handshake timeout
*/
-static int tls_handshake_timeout = 10;
-module_param(tls_handshake_timeout, int, 0644);
+static unsigned int tls_handshake_timeout = 10;
+
+static int tls_handshake_timeout_set(const char *val,
+ const struct kernel_param *kp)
+{
+ return param_set_uint_minmax(val, kp, 0,
+ min_t(unsigned long, UINT_MAX / MSEC_PER_SEC,
+ MAX_JIFFY_OFFSET / HZ));
+}
+
+static const struct kernel_param_ops tls_handshake_timeout_ops = {
+ .set = tls_handshake_timeout_set,
+ .get = param_get_uint,
+};
+
+module_param_cb(tls_handshake_timeout, &tls_handshake_timeout_ops,
+ &tls_handshake_timeout, 0644);
+__MODULE_PARM_TYPE(tls_handshake_timeout, "uint");
MODULE_PARM_DESC(tls_handshake_timeout,
"nvme TLS handshake timeout in seconds (default 10)");
#endif
@@ -1948,6 +1965,7 @@ static int nvmet_tcp_tls_handshake(struct nvmet_tcp_queue *queue)
{
int ret = -EOPNOTSUPP;
struct tls_handshake_args args;
+ unsigned int timeout = READ_ONCE(tls_handshake_timeout);
if (queue->state != NVMET_TCP_Q_TLS_HANDSHAKE) {
pr_warn("cannot start TLS in state %d\n", queue->state);
@@ -1961,7 +1979,7 @@ static int nvmet_tcp_tls_handshake(struct nvmet_tcp_queue *queue)
args.ta_done = nvmet_tcp_tls_handshake_done;
args.ta_data = queue;
args.ta_keyring = key_serial(queue->port->nport->keyring);
- args.ta_timeout_ms = tls_handshake_timeout * 1000;
+ args.ta_timeout_ms = timeout * MSEC_PER_SEC;
ret = tls_server_hello_psk(&args, GFP_KERNEL);
if (ret) {
@@ -1969,7 +1987,7 @@ static int nvmet_tcp_tls_handshake(struct nvmet_tcp_queue *queue)
pr_err("failed to start TLS, err=%d\n", ret);
} else {
queue_delayed_work(nvmet_wq, &queue->tls_handshake_tmo_work,
- tls_handshake_timeout * HZ);
+ (unsigned long)timeout * HZ);
}
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 379/816] drm/i915/psr: Disable linked plane sel fetch as well
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (377 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 378/816] nvmet-tcp: validate the TLS handshake timeout Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 380/816] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks Greg Kroah-Hartman
` (441 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jouni Högander, Mika Kahola,
Joonas Lahtinen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <jouni.hogander@intel.com>
[ Upstream commit b56721c32eb3ad0f086fdc0f33479be395e43bb9 ]
Currently we are not setting linked plane selective area when selective
fetch is about to be disabled for the UV plane. Fix this by simplifying the
loop by just handling plane selective fetch disable and area setting same
way.
Also set the update_planes bit based on comparing old and new plane
selective fetch area. This way both the plane and its linked Y plane are
updated only when their selective fetch area changed.
Fixes: a4f477e6ac17 ("drm/i915/psr: Add proper handling for disabling sel fetch for planes")
Cc: <stable@vger.kernel.org> # v6.8+
Assisted-by: GitHub-Copilot:claude-opus-5
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20260929094434.77129-4-jouni.hogander@intel.com
(cherry picked from commit b10c83af60cbc00ce4112742fd297581233e43cd)
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 | 27 ++++++++++++------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 929113fc12e60..7a9b1baaa4435 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2724,21 +2724,14 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
inter = crtc_state->psr2_su_area;
sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
- if (!drm_rect_intersect(&inter, &new_plane_state->uapi.dst)) {
- /*
- * if plane sel fetch was previously enabled ->
- * disable it
- */
- if (drm_rect_height(&old_plane_state->psr2_sel_fetch_area) > 0)
- crtc_state->update_planes |= BIT(plane->id);
-
- continue;
+ if (drm_rect_intersect(&inter, &new_plane_state->uapi.dst)) {
+ sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
+ sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1;
}
- sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
- sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
- sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1;
- crtc_state->update_planes |= BIT(plane->id);
+ if (!drm_rect_equals(&old_plane_state->psr2_sel_fetch_area,
+ sel_fetch_area))
+ crtc_state->update_planes |= BIT(plane->id);
/*
* Sel_fetch_area is calculated for UV plane. Use
@@ -2746,16 +2739,22 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
*/
if (linked) {
struct intel_plane_state *linked_new_plane_state;
+ struct intel_plane_state *linked_old_plane_state;
struct drm_rect *linked_sel_fetch_area;
linked_new_plane_state = intel_atomic_get_new_plane_state(state, linked);
if (!linked_new_plane_state)
return -EINVAL;
+ linked_old_plane_state = intel_atomic_get_old_plane_state(state, linked);
+
linked_sel_fetch_area = &linked_new_plane_state->psr2_sel_fetch_area;
linked_sel_fetch_area->y1 = sel_fetch_area->y1;
linked_sel_fetch_area->y2 = sel_fetch_area->y2;
- crtc_state->update_planes |= BIT(linked->id);
+
+ if (!drm_rect_equals(&linked_old_plane_state->psr2_sel_fetch_area,
+ linked_sel_fetch_area))
+ crtc_state->update_planes |= BIT(linked->id);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 380/816] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (378 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 379/816] drm/i915/psr: Disable linked plane sel fetch as well Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 381/816] can: skb: make echo skb freeing safe in any IRQ context Greg Kroah-Hartman
` (440 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daejun Park, Christoph Hellwig,
Carlos Maiolino, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daejun Park <daejun7.park@samsung.com>
[ Upstream commit bcf0b7f18ad11e1d410e82ffef678705eff0a317 ]
A client can commit a hole in a LAYOUTCOMMIT, because nfsd does not
check the extents against its layouts. xfs_iomap_write_unwritten() then
allocates written blocks there. A large hole overruns the block
reservation and shuts XFS down. A small one exposes stale data.
Refuse such a range with -EIO, using XFS_BMAPI_CONVERT_ONLY.
Link: https://lore.kernel.org/r/20261014130834.GB15773@lst.de
Fixes: 527851124d10 ("xfs: implement pNFS export operations")
Cc: stable@vger.kernel.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
[ sashal: Replaced the upstream xfs_ioend.c hunk with the same one-line change (extra trailing argument 0) in xfs_aops.c's xfs_end_ioend(), since xfs_ioend.c doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/xfs_aops.c | 2 +-
fs/xfs/xfs_file.c | 2 +-
fs/xfs/xfs_iomap.c | 20 +++++++++++++++++---
fs/xfs/xfs_iomap.h | 3 ++-
fs/xfs/xfs_pnfs.c | 9 ++++++++-
5 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index ba6b4a180e808..041d83a95d012 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -129,7 +129,7 @@ xfs_end_ioend(
if (ioend->io_flags & IOMAP_F_SHARED)
error = xfs_reflink_end_cow(ip, offset, size);
else if (ioend->io_type == IOMAP_UNWRITTEN)
- error = xfs_iomap_write_unwritten(ip, offset, size, false);
+ error = xfs_iomap_write_unwritten(ip, offset, size, false, 0);
if (!error && xfs_ioend_is_append(ioend))
error = xfs_setfilesize(ip, ioend->io_offset, ioend->io_size);
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index aba54e3c58366..e05289776090d 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -539,7 +539,7 @@ xfs_dio_write_end_io(
* they are converted.
*/
if (flags & IOMAP_DIO_UNWRITTEN) {
- error = xfs_iomap_write_unwritten(ip, offset, size, true);
+ error = xfs_iomap_write_unwritten(ip, offset, size, true, 0);
goto out;
}
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index afd655d8f2ae4..70d7bf0dc4377 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -571,7 +571,8 @@ xfs_iomap_write_unwritten(
xfs_inode_t *ip,
xfs_off_t offset,
xfs_off_t count,
- bool update_isize)
+ bool update_isize,
+ uint32_t bmapi_flags)
{
xfs_mount_t *mp = ip->i_mount;
xfs_fileoff_t offset_fsb;
@@ -633,8 +634,21 @@ xfs_iomap_write_unwritten(
*/
nimaps = 1;
error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
- XFS_BMAPI_CONVERT, resblks, &imap,
- &nimaps);
+ XFS_BMAPI_CONVERT | bmapi_flags,
+ resblks, &imap, &nimaps);
+ if (error == -ENOSR && (bmapi_flags & XFS_BMAPI_CONVERT_ONLY)) {
+ /*
+ * Nothing was mapped: the rest of the range starts
+ * with a hole or a delalloc extent. Nothing was
+ * changed either, but xfs_iext_count_extend() may
+ * have logged the inode, and cancelling a dirty
+ * transaction shuts the filesystem down. Commit it,
+ * as xfs_alloc_file_space() does on -ENOSR.
+ */
+ error = xfs_trans_commit(tp);
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
+ return error ? error : -EIO;
+ }
if (error)
goto error_on_bmapi_transaction;
diff --git a/fs/xfs/xfs_iomap.h b/fs/xfs/xfs_iomap.h
index 4da13440bae9b..eb70f1653776a 100644
--- a/fs/xfs/xfs_iomap.h
+++ b/fs/xfs/xfs_iomap.h
@@ -14,7 +14,8 @@ struct xfs_bmbt_irec;
int xfs_iomap_write_direct(struct xfs_inode *ip, xfs_fileoff_t offset_fsb,
xfs_fileoff_t count_fsb, unsigned int flags,
struct xfs_bmbt_irec *imap, u64 *sequence);
-int xfs_iomap_write_unwritten(struct xfs_inode *, xfs_off_t, xfs_off_t, bool);
+int xfs_iomap_write_unwritten(struct xfs_inode *ip, xfs_off_t offset,
+ xfs_off_t count, bool update_isize, uint32_t bmapi_flags);
xfs_fileoff_t xfs_iomap_eof_align_last_fsb(struct xfs_inode *ip,
xfs_fileoff_t end_fsb);
diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
index fa027574d6de1..4cc5c8b0f935c 100644
--- a/fs/xfs/xfs_pnfs.c
+++ b/fs/xfs/xfs_pnfs.c
@@ -315,7 +315,14 @@ xfs_fs_commit_blocks(
(end - 1) >> PAGE_SHIFT);
WARN_ON_ONCE(error);
- error = xfs_iomap_write_unwritten(ip, start, length, false);
+ /*
+ * A client may only write to blocks that a layout handed out,
+ * and xfs_fs_map_blocks() allocates blocks for any hole in a
+ * write layout, so refuse to allocate blocks for a hole or a
+ * delalloc extent in the committed range.
+ */
+ error = xfs_iomap_write_unwritten(ip, start, length, false,
+ XFS_BMAPI_CONVERT_ONLY);
if (error)
goto out_drop_iolock;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 381/816] can: skb: make echo skb freeing safe in any IRQ context
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (379 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 380/816] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 382/816] mm/userfaultfd: wake all waiters on unregister Greg Kroah-Hartman
` (439 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cunhao Lu, stable, Marc Kleine-Budde,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cunhao Lu <1579567540@qq.com>
[ Upstream commit d743071964920c92af598c87a9e6f4369263ee09 ]
can_put_echo_skb() can be called with hardware interrupts disabled. Its
direct drop paths use kfree_skb(), while can_create_echo_skb() uses
kfree_skb() when cloning fails and consume_skb() after a successful clone.
None of these helpers is safe in every IRQ context.
Use dev_kfree_skb_any() for all drop paths and dev_consume_skb_any() when
consuming a successfully cloned skb. This preserves the respective skb drop
and consumed semantics regardless of the caller IRQ context.
Signed-off-by: Cunhao Lu <1579567540@qq.com>
Link: https://patch.msgid.link/tencent_E84809CF236D0137885E7E4E4D58340B3208@qq.com
Cc: stable@kernel.org
Fixes: ae64438be192 ("can: dev: fix skb drop check")
Fixes: 0ae89beb283a ("can: add destructor for self generated skbs")
Fixes: 3ccd4c6167d3 ("can: Unify droping of invalid tx skbs and netdev stats")
Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface")
[mkl: also convert can_dropped_invalid_skb(), can_dev_dropped_skb()]
[mkl: add stable on Cc + add Fixes tags]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/can/dev/skb.c | 6 +++---
include/linux/can/dev.h | 2 +-
include/linux/can/skb.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/can/dev/skb.c b/drivers/net/can/dev/skb.c
index b643995fc5369..a39cfdce341ce 100644
--- a/drivers/net/can/dev/skb.c
+++ b/drivers/net/can/dev/skb.c
@@ -61,7 +61,7 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
(skb->protocol != htons(ETH_P_CAN) &&
skb->protocol != htons(ETH_P_CANFD) &&
skb->protocol != htons(ETH_P_CANXL))) {
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return 0;
}
@@ -87,7 +87,7 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
} else {
/* locking problem with netif_stop_queue() ?? */
netdev_err(dev, "%s: BUG! echo_skb %d is occupied!\n", __func__, idx);
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return -EBUSY;
}
@@ -368,7 +368,7 @@ bool can_dropped_invalid_skb(struct net_device *dev, struct sk_buff *skb)
return false;
inval_skb:
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
return true;
}
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 23492213ea359..30a3512139cb9 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -160,7 +160,7 @@ static inline bool can_dev_dropped_skb(struct net_device *dev, struct sk_buff *s
if (priv->ctrlmode & CAN_CTRLMODE_LISTENONLY) {
netdev_info_once(dev,
"interface in listen only mode, dropping skb\n");
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
dev->stats.tx_dropped++;
return true;
}
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h
index 27d0ca115c6c1..1f0c3e8cde907 100644
--- a/include/linux/can/skb.h
+++ b/include/linux/can/skb.h
@@ -92,12 +92,12 @@ static inline struct sk_buff *can_create_echo_skb(struct sk_buff *skb)
nskb = skb_clone(skb, GFP_ATOMIC);
if (unlikely(!nskb)) {
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return NULL;
}
can_skb_set_owner(nskb, skb->sk);
- consume_skb(skb);
+ dev_consume_skb_any(skb);
return nskb;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 382/816] mm/userfaultfd: wake all waiters on unregister
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (380 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 381/816] can: skb: make echo skb freeing safe in any IRQ context Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 383/816] ALSA: hda/realtek: Enable mute and mic-mute LEDs on HP ENVY 17-cr0xxx Greg Kroah-Hartman
` (438 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik,
Mike Rapoport (Microsoft), Lorenzo Stoakes (ARM),
Muhammad Usama Anjum, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 3afb19d68cc5e7851fdb1069c8094af97bd80417 ]
UFFDIO_UNREGISTER only wakes pending faults if VM_UFFD_MISSING is set.
Threads waiting on write-protect, minor or RWP faults can therefore remain
asleep after unregistering a range that does not track missing faults.
Wake pending faults regardless of the registration mode so they can retry
without an explicit UFFDIO_WAKE or closing the userfaultfd. This matches
the existing behavior for missing faults, including removing unread fault
messages for the woken waiters.
Fix generated by an LLM and sent by Josef Bacik in private.
Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
[ david: rebase; simplify description ]
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-24-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Wake target kept as the VMA's own userfaultfd ctx instead of upstream's ctx argument, since this tree lacks the check that rejects unregistering another ctx's VMA; the file path also differs. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/userfaultfd.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index e1b1a5b1a757a..77b295cb39906 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1491,6 +1491,8 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
ret = 0;
for_each_vma_range(vmi, vma, end) {
+ struct userfaultfd_wake_range range;
+
cond_resched();
BUG_ON(!vma_can_userfault(vma, vma->vm_flags, wp_async));
@@ -1511,18 +1513,14 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
/* Prevent new userfaults from being queued after the wakeup. */
vma_start_write(vma);
- if (userfaultfd_missing(vma)) {
- /*
- * Wake any concurrent pending userfault while
- * we unregister, so they will not hang
- * permanently and it avoids userland to call
- * UFFDIO_WAKE explicitly.
- */
- struct userfaultfd_wake_range range;
- range.start = start;
- range.len = vma_end - start;
- wake_userfault(vma->vm_userfaultfd_ctx.ctx, &range);
- }
+ /*
+ * Wake any concurrent pending userfault while we unregister,
+ * so they will not hang permanently and it avoids userland to
+ * call UFFDIO_WAKE explicitly.
+ */
+ range.start = start;
+ range.len = vma_end - start;
+ wake_userfault(vma->vm_userfaultfd_ctx.ctx, &range);
vma = userfaultfd_clear_vma(&vmi, prev, vma,
start, vma_end);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 383/816] ALSA: hda/realtek: Enable mute and mic-mute LEDs on HP ENVY 17-cr0xxx
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (381 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 382/816] mm/userfaultfd: wake all waiters on unregister Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 384/816] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations Greg Kroah-Hartman
` (437 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexandr, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandr <youdoit@mail.ru>
[ Upstream commit cf79cc4996bf936fe159af2a600519b3ebd4ccb7 ]
The HP ENVY Laptop 17-cr0xxx (subsystem ID 103c:8a2e) has mute and
mic-mute LEDs on the F8 and F5 keys that never light up on Linux: the
existing quirk entry only sets up the CS35L41 amplifiers.
The board uses the same LED wiring as the HP ENVY x360 15-ey0xxx
(103c:8a31): the mute LED is driven by COEF 0x0b bits 3:2 and the
mic-mute LED by GPIO2 with inverted polarity. Both were verified with
hda-verb on the actual hardware. Switch the entry to
ALC287_FIXUP_CS35L41_I2C_2_HP_MUTE_LEDS, which chains the amplifier
setup with ALC245_FIXUP_HP_X360_MUTE_LEDS, and use the DMI product name
of the board.
Fixes: aa8e3ef4fe53 ("ALSA: hda/realtek: Add quirks for various HP ENVY models")
Cc: <stable@vger.kernel.org>
Signed-off-by: Alexandr <youdoit@mail.ru>
Link: https://patch.msgid.link/20261103142121.74032-1-youdoit@mail.ru
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/patch_realtek.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1a68e683801b1..bfc75a1733fb5 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -11089,7 +11089,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8a2b, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8a2c, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8a2d, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
- SND_PCI_QUIRK(0x103c, 0x8a2e, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
+ SND_PCI_QUIRK(0x103c, 0x8a2e, "HP ENVY Laptop 17-cr0xxx", ALC287_FIXUP_CS35L41_I2C_2_HP_MUTE_LEDS),
SND_PCI_QUIRK(0x103c, 0x8a30, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8a31, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8a4f, "HP Victus 15-fa0xxx (MB 8A4F)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 384/816] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (382 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 383/816] ALSA: hda/realtek: Enable mute and mic-mute LEDs on HP ENVY 17-cr0xxx Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 385/816] perf evsel: Restrict incremental open error unwind Greg Kroah-Hartman
` (436 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Salvatore Dipietro, Andrew Morton,
Vlastimil Babka (SUSE), Zi Yan, Johannes Weiner,
Christoph Hellwig, David Hildenbrand, Michal Hocko,
Matthew Wilcox, Dave Chinner, Ritesh Harjani, Dmitry Ilvokhin,
Hazem Mohamed Abuelfotoh, Ali Saidi, Geoff Blake,
Christian Brauner, dipietro.salvatore, Darrick J. Wong,
Brendan Jackman, rvvandan, Suren Baghdasaryan, Garg, Shivank,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Salvatore Dipietro <dipiets@amazon.it>
[ Upstream commit 0e05a469c29400eb6e35448ce7318581688a1806 ]
Commit 5d8edfb900d5 ("iomap: Copy larger chunks from userspace")
introduced high-order folio allocations in the iomap buffered write path.
When memory is fragmented, each failed costly-order allocation enters
__alloc_pages_slowpath() which runs direct reclaim, direct compaction and
drain_all_pages(), causing a 0.38x throughput drop on PostgreSQL pgbench
(simple-update) with 1024 clients on a 96-vCPU arm64 system.
The root issue is that direct reclaim and direct compaction are too
expensive for hot allocation paths that have fallbacks to smaller
allocations. __filemap_get_folio_mpol() already marks higher-order
allocations with __GFP_NORETRY | __GFP_NOWARN, signalling that the caller
can handle failure. However, the page allocator still enters the full
blocking slowpath for costly orders with __GFP_NORETRY, which is
unnecessarily aggressive when the caller will simply retry at a lower
order.
For costly-order allocations with __GFP_NORETRY, clear
__GFP_DIRECT_RECLAIM at the very start of the slowpath, before
can_direct_reclaim, can_compact and the nofail checks are evaluated. This
makes the entire slowpath treat the request as non-blocking: no direct
reclaim, no direct compaction and no drain_all_pages() IPI across every
CPU. Reclaim and compaction move to the background instead: kswapd is
still woken for reclaim, and it wakes kcompactd for defragmentation. The
system keeps its long-term health while the latency-critical direct
allocation path no longer stalls.
Allocations that also request __GFP_THISNODE are exempted. That flag
pairing identifies the local-node-first THP attempt issued by
alloc_pages_mpol() (mempolicy.c), which relies on direct compaction to
form transparent huge pages.
Clearing __GFP_DIRECT_RECLAIM makes these allocations reach the
!can_direct_reclaim bailout, which since commit 4c0ed883e051
("mm/page_alloc: fix defrag_mode for non-reclaimable allocations") drops
ALLOC_NOFRAGMENT and retries instead of failing when defrag_mode is on.
With vm.defrag_mode=1 a __GFP_NORETRY allocation could therefore succeed
by fragmenting another migratetype's pageblock. That is the wrong trade
for a caller that has already communicated it can handle failure and has a
cheap lower-order fallback, so exclude __GFP_NORETRY from the relaxation.
The exclusion is not restricted to costly orders: any __GFP_NORETRY caller
has said it can cope with failure, so failing is preferable to fragmenting
for all of them.
Test environment:
Hardware: AWS EC2 m8g.24xlarge (96 vCPU, arm64)
12x 1TB IO2 32000 IOPS RAID0 XFS
OS: AL2023
Kernel: v7.3-rc1
Database: PostgreSQL 18.4
Workload: pgbench simple-update, 1024 clients, 96 threads, 1200s
Results (average of 3 runs, TPS):
Config Avg TPS % vs baseline
v7.3-rc1 baseline (vm.defrag_mode=0) 58,602 -
v7.3-rc1 + this patch (vm.defrag_mode=0) 157,246 +168.3%
v7.3-rc1 baseline (vm.defrag_mode=1) 109,012 -
v7.3-rc1 + this patch (vm.defrag_mode=1) 157,778 +44.7%
Link: https://lore.kernel.org/20261001082152.2879289-1-dipiets@amazon.it
Link: https://lore.kernel.org/all/20260403193535.9970-1-dipiets@amazon.it/T/#t [v1]
Link: https://lore.kernel.org/linux-mm/20260420161404.642-1-dipiets@amazon.it/T/#u [v2]
Link: https://lore.kernel.org/all/20260710143437.12379-1-dipiets@amazon.it/T/#u [v3]
Link: https://lore.kernel.org/all/20260904115629.3993331-1-dipiets@amazon.it/T/#u [v4]
Link: https://lore.kernel.org/all/20260911142102.2294202-1-dipiets@amazon.it/T/#u [v5]
Fixes: 5d8edfb900d5 ("iomap: Copy larger chunks from userspace")
Signed-off-by: Salvatore Dipietro <dipiets@amazon.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: David Hildenbrand <david@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Dave Chinner <dgc@kernel.org>
Cc: Ritesh Harjani <ritesh.list@gmail.com>
Cc: Dmitry Ilvokhin <d@ilvokhin.com>
Cc: Hazem Mohamed Abuelfotoh <abuehaze@amazon.com>
Cc: Ali Saidi <alisaidi@amazon.com>
Cc: Geoff Blake <blakgeof@amazon.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: <dipietro.salvatore@gmail.com>
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: <rvvandan@amazon.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: "Garg, Shivank" <shivankg@amd.com>
introduced high-order folio allocations in the iomap buffered write path.
When memory is fragmented, each failed costly-order allocation enters
__alloc_pages_slowpath() which runs direct reclaim, direct compaction and
drain_all_pages(), causing a 0.38x throughput drop on PostgreSQL pgbench
(simple-update) with 1024 clients on a 96-vCPU arm64 system.
The root issue is that direct reclaim and direct compaction are too
expensive for hot allocation paths that have fallbacks to smaller
allocations. __filemap_get_folio_mpol() already marks higher-order
allocations with __GFP_NORETRY | __GFP_NOWARN, signalling that the caller
can handle failure. However, the page allocator still enters the full
blocking slowpath for costly orders with __GFP_NORETRY, which is
unnecessarily aggressive when the caller will simply retry at a lower
order.
For costly-order allocations with __GFP_NORETRY, clear
__GFP_DIRECT_RECLAIM at the very start of the slowpath, before
can_direct_reclaim, can_compact and the nofail checks are evaluated. This
makes the entire slowpath treat the request as non-blocking: no direct
reclaim, no direct compaction and no drain_all_pages() IPI across every
CPU. Reclaim and compaction move to the background instead: kswapd is
still woken for reclaim, and it wakes kcompactd for defragmentation. The
system keeps its long-term health while the latency-critical direct
allocation path no longer stalls.
Allocations that also request __GFP_THISNODE are exempted. That flag
pairing identifies the local-node-first THP attempt issued by
alloc_pages_mpol() (mempolicy.c), which relies on direct compaction to
form transparent huge pages.
Clearing __GFP_DIRECT_RECLAIM makes these allocations reach the
!can_direct_reclaim bailout, which since commit 4c0ed883e051
("mm/page_alloc: fix defrag_mode for non-reclaimable allocations") drops
ALLOC_NOFRAGMENT and retries instead of failing when defrag_mode is on.
With vm.defrag_mode=1 a __GFP_NORETRY allocation could therefore succeed
by fragmenting another migratetype's pageblock. That is the wrong trade
for a caller that has already communicated it can handle failure and has a
cheap lower-order fallback, so exclude __GFP_NORETRY from the relaxation.
[ sashal: Dropped the defrag_mode hunk and kept can_compact = gfp_compaction_allowed(gfp_mask) without can_direct_reclaim &&, since this tree lacks the earlier defrag_mode change. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 51a1aad29d5a8..997d844ac0de0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4291,10 +4291,10 @@ static inline struct page *
__alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
struct alloc_context *ac)
{
- bool can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
- bool can_compact = gfp_compaction_allowed(gfp_mask);
- bool nofail = gfp_mask & __GFP_NOFAIL;
const bool costly_order = order > PAGE_ALLOC_COSTLY_ORDER;
+ bool can_direct_reclaim;
+ bool can_compact;
+ bool nofail;
struct page *page = NULL;
unsigned int alloc_flags;
unsigned long did_some_progress;
@@ -4306,6 +4306,18 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
unsigned int zonelist_iter_cookie;
int reserve_flags;
+ /*
+ * Costly __GFP_NORETRY callers have a cheap fallback, so don't stall
+ * them in reclaim or compaction. __GFP_THISNODE callers are exempt.
+ */
+ if (costly_order && (gfp_mask & __GFP_NORETRY) &&
+ !(gfp_mask & __GFP_THISNODE))
+ gfp_mask &= ~__GFP_DIRECT_RECLAIM;
+
+ can_direct_reclaim = gfp_mask & __GFP_DIRECT_RECLAIM;
+ can_compact = gfp_compaction_allowed(gfp_mask);
+ nofail = gfp_mask & __GFP_NOFAIL;
+
if (unlikely(nofail)) {
/*
* We most definitely don't want callers attempting to
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 385/816] perf evsel: Restrict incremental open error unwind
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (383 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 384/816] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 386/816] nvme-tcp: Validate the queue state under the queue lock in the address attribute Greg Kroah-Hartman
` (435 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Hui Su, Namhyung Kim,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Su <sh_def@163.com>
[ Upstream commit d023b2110d0d7232ba952a486c497ba8817f6f66 ]
evsel__open_cpu(), evsel__tool_pmu_open() and
evsel__hwmon_pmu_open() support opening a subrange of a CPU map, bounded
by [start_cpu_map_idx, end_cpu_map_idx).
Their error paths, however, unwind using "while (--idx >= 0)" all the way
back to CPU index 0 regardless of start_cpu_map_idx. If lower CPU indices
were opened by an earlier invocation, a later incremental open failure
therefore closes those existing file descriptors and overwrites their
slots with -1.
Before this fix, running the new incremental open test demonstrates this
corruption:
$ perf test -v "Tool PMU"
12: Tool PMU:
12.1: Tool PMU : Ok
12.2: Tool PMU leader : Ok
12.3: Incremental open error unwind boundary:
FAILED: CPU 0 FD overwritten: FD(evsel, 0, 0)=-1, expected 4
FAILED!
Stop the unwind at start_cpu_map_idx so that only file descriptors
opened by the current invocation are rolled back.
After this fix:
$ perf test -v "Tool PMU"
12: Tool PMU:
12.1: Tool PMU : Ok
12.2: Tool PMU leader : Ok
12.3: Incremental open error unwind boundary : Ok
Fixes: 4804e0111662d7d8 ("perf stat: Use affinity for opening events")
Fixes: 240505b2d0adcdc8 ("perf tool_pmu: Factor tool events into their own PMU")
Fixes: 53cc0b351ec99278 ("perf hwmon_pmu: Add a tool PMU exposing events from hwmon in sysfs")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Hui Su <sh_def@163.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Dropped the tool_pmu.c, hwmon_pmu.c and tests/tool_pmu.c hunks because those files don't exist here, leaving only the one-line unwind bound in evsel__open_cpu(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/evsel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index e84dacb5627b6..6798db83bf7cc 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2483,7 +2483,7 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
FD(evsel, idx, thread) = -1;
}
thread = nthreads;
- } while (--idx >= 0);
+ } while (--idx >= start_cpu_map_idx);
errno = old_errno;
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 386/816] nvme-tcp: Validate the queue state under the queue lock in the address attribute
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (384 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 385/816] perf evsel: Restrict incremental open error unwind Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 387/816] nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl() Greg Kroah-Hartman
` (434 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixin Liu, Nilay Shroff,
Keith Busch, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <kanie@linux.alibaba.com>
[ Upstream commit 2eeeaa9c1ff0c429096acc2947c296db6a56f96d ]
Reading the "address" sysfs attribute calls kernel_getsockname() on the
admin queue socket, which can race with the queue teardown during
connection error recovery: a reader can observe NVME_TCP_Q_LIVE set,
then block on the queue lock while nvme_tcp_free_queue() releases the
socket and clears queue->sock without holding the lock. Once the
reader acquires the lock it dereferences the NULL socket pointer.
Commit 76d54bf20cdc ("nvme-tcp: don't access released socket during
error recovery") had the queue liveness check inside the lock.
Commit 782373ba2766 ("nvme: tcp: avoid race between queue_lock lock
and destroy") moved it back out because the lock itself is destroyed
in nvme_tcp_free_queue(), so a reader arriving late trips
mutex_destroy().
Check the queue liveness inside the queue lock, and clear queue->sock
under the same lock. The teardown clears NVME_TCP_Q_LIVE under the
lock well before the socket is released, so a reader either sees the
bit cleared or a socket that cannot be released while it holds the
lock. To also close the lock lifetime race, the queue locks are now
owned by the controller: they are initialized with the queue array and
only destroyed when the controller is freed, which cannot happen while
a sysfs attribute read is still in progress. The queue count is
computed by the NVME_TCP_OPT_NR_QUEUES() macro from the original
connect options for both initialization and destruction, as reconnects
may shrink ctrl->queue_count.
Fixes: 782373ba2766 ("nvme: tcp: avoid race between queue_lock lock and destroy")
Cc: stable@vger.kernel.org
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
[ sashal: Moved queue_lock init and destroy to controller alloc and free, and kept the older fput(), memalloc_noreclaim and per-queue pf_cache_lock code instead of upstream's newer helpers. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/tcp.c | 53 ++++++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 16 deletions(-)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index f6bc2a90592cf..4d9cd0e34b7b8 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -155,6 +155,9 @@ enum nvme_tcp_queue_flags {
NVME_TCP_Q_IO_CPU_SET = 3,
};
+#define NVME_TCP_OPT_NR_QUEUES(opts) ((opts)->nr_io_queues + \
+ (opts)->nr_write_queues + (opts)->nr_poll_queues + 1)
+
enum nvme_tcp_recv_state {
NVME_TCP_RECV_PDU = 0,
NVME_TCP_RECV_DATA,
@@ -1581,14 +1584,22 @@ static void nvme_tcp_free_queue(struct nvme_ctrl *nctrl, int qid)
page_frag_cache_drain(&queue->pf_cache);
noreclaim_flag = memalloc_noreclaim_save();
+ /*
+ * Clear queue->sock under the queue lock so that a sysfs reader in
+ * nvme_tcp_get_address() either observes the NVME_TCP_Q_LIVE bit
+ * cleared or a still valid socket. The queue lock itself is owned
+ * by the controller and only destroyed when the controller is
+ * freed, so readers blocked on it cannot race its teardown.
+ */
+ mutex_lock(&queue->queue_lock);
/* ->sock will be released by fput() */
fput(queue->sock->file);
queue->sock = NULL;
+ mutex_unlock(&queue->queue_lock);
memalloc_noreclaim_restore(noreclaim_flag);
kfree(queue->pdu);
mutex_destroy(&queue->send_mutex);
- mutex_destroy(&queue->queue_lock);
mutex_destroy(&queue->pf_cache_lock);
}
@@ -2020,7 +2031,6 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
int ret, rcv_pdu_size;
struct file *sock_file;
- mutex_init(&queue->queue_lock);
queue->ctrl = ctrl;
init_llist_head(&queue->req_list);
INIT_LIST_HEAD(&queue->send_list);
@@ -2168,7 +2178,6 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
queue->sock = NULL;
err_destroy_mutex:
mutex_destroy(&queue->send_mutex);
- mutex_destroy(&queue->queue_lock);
mutex_destroy(&queue->pf_cache_lock);
return ret;
}
@@ -2773,6 +2782,9 @@ static void nvme_tcp_stop_ctrl(struct nvme_ctrl *ctrl)
static void nvme_tcp_free_ctrl(struct nvme_ctrl *nctrl)
{
struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
+ /* the same count used to size and initialize the queue array */
+ unsigned int nr_queues = NVME_TCP_OPT_NR_QUEUES(nctrl->opts);
+ unsigned int i;
if (list_empty(&ctrl->list))
goto free_ctrl;
@@ -2784,6 +2796,8 @@ static void nvme_tcp_free_ctrl(struct nvme_ctrl *nctrl)
nvmf_free_options(nctrl->opts);
free_ctrl:
put_net(ctrl->net);
+ for (i = 0; i < nr_queues; i++)
+ mutex_destroy(&ctrl->queues[i].queue_lock);
kfree(ctrl->queues);
kfree(ctrl);
}
@@ -3036,17 +3050,18 @@ static int nvme_tcp_get_address(struct nvme_ctrl *ctrl, char *buf, int size)
len = nvmf_get_address(ctrl, buf, size);
- if (!test_bit(NVME_TCP_Q_LIVE, &queue->flags))
- return len;
-
mutex_lock(&queue->queue_lock);
- ret = kernel_getsockname(queue->sock, (struct sockaddr *)&src_addr);
- if (ret > 0) {
- if (len > 0)
- len--; /* strip trailing newline */
- len += scnprintf(buf + len, size - len, "%ssrc_addr=%pISc\n",
- (len) ? "," : "", &src_addr);
+ if (test_bit(NVME_TCP_Q_LIVE, &queue->flags)) {
+ ret = kernel_getsockname(queue->sock,
+ (struct sockaddr *)&src_addr);
+ if (ret > 0) {
+ if (len > 0)
+ len--; /* strip trailing newline */
+ len += scnprintf(buf + len, size - len,
+ "%ssrc_addr=%pISc\n",
+ (len) ? "," : "", &src_addr);
+ }
}
mutex_unlock(&queue->queue_lock);
@@ -3111,7 +3126,7 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,
struct nvmf_ctrl_options *opts)
{
struct nvme_tcp_ctrl *ctrl;
- int ret;
+ int i, ret;
ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
if (!ctrl)
@@ -3119,8 +3134,7 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,
INIT_LIST_HEAD(&ctrl->list);
ctrl->ctrl.opts = opts;
- ctrl->ctrl.queue_count = opts->nr_io_queues + opts->nr_write_queues +
- opts->nr_poll_queues + 1;
+ ctrl->ctrl.queue_count = NVME_TCP_OPT_NR_QUEUES(opts);
ctrl->ctrl.sqsize = opts->queue_size - 1;
ctrl->ctrl.kato = opts->kato;
@@ -3179,8 +3193,15 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,
goto out_free_ctrl;
}
- ctrl->net = get_net(current->nsproxy->net_ns);
+ /*
+ * The queue locks are owned by the controller, not the queues:
+ * they outlive the per-queue connect/disconnect cycles so that
+ * sysfs readers can never race their destruction.
+ */
+ for (i = 0; i < ctrl->ctrl.queue_count; i++)
+ mutex_init(&ctrl->queues[i].queue_lock);
+ ctrl->net = get_net(current->nsproxy->net_ns);
ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_tcp_ctrl_ops, 0);
if (ret)
goto out_kfree_queues;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 387/816] nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (385 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 386/816] nvme-tcp: Validate the queue state under the queue lock in the address attribute Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 388/816] drm/panthor: Revisit reqs_lock handling in flush/reset paths Greg Kroah-Hartman
` (433 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nilay Shroff,
Christian Aurich Zanettini Martins, Keith Busch, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
[ Upstream commit b1d1f6b1ee03285690f12c2ebf23616416e6d881 ]
nvme_tcp_free_ctrl() reads ctrl->ctrl.opts to know how many queue
mutexes to destroy. When creating the controller fails,
nvmf_create_ctrl() frees opts as soon as nvme_tcp_create_ctrl()
returns, but a concurrent open of the character device can hold the
last reference to the controller. With CONFIG_DEBUG_KOBJECT_RELEASE,
which delays the release, every failed connect reads freed memory:
BUG: KASAN: slab-use-after-free in nvme_tcp_free_ctrl+0x38b/0x430
Read of size 4 at addr ffff888005b93740 by task kworker/2:1/51
Keep the size of the queue array in the controller and use it instead.
Fixes: 2eeeaa9c1ff0 ("nvme-tcp: Validate the queue state under the queue lock in the address attribute")
Cc: stable@vger.kernel.org
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
[ sashal: Replaced nvme_tcp_init_queue()/nvme_tcp_exit_queue() and kzalloc_objs() with the branch's open-coded mutex_init()/mutex_destroy() loops and kcalloc(), using the new nr_allocated_queues bound. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/tcp.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 4d9cd0e34b7b8..5c051f5644cc8 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -225,6 +225,7 @@ struct nvme_tcp_ctrl {
struct delayed_work connect_work;
struct nvme_tcp_request async_req;
u32 io_queues[HCTX_MAX_TYPES];
+ unsigned int nr_allocated_queues;
struct net *net;
};
@@ -2782,8 +2783,6 @@ static void nvme_tcp_stop_ctrl(struct nvme_ctrl *ctrl)
static void nvme_tcp_free_ctrl(struct nvme_ctrl *nctrl)
{
struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
- /* the same count used to size and initialize the queue array */
- unsigned int nr_queues = NVME_TCP_OPT_NR_QUEUES(nctrl->opts);
unsigned int i;
if (list_empty(&ctrl->list))
@@ -2796,7 +2795,7 @@ static void nvme_tcp_free_ctrl(struct nvme_ctrl *nctrl)
nvmf_free_options(nctrl->opts);
free_ctrl:
put_net(ctrl->net);
- for (i = 0; i < nr_queues; i++)
+ for (i = 0; i < ctrl->nr_allocated_queues; i++)
mutex_destroy(&ctrl->queues[i].queue_lock);
kfree(ctrl->queues);
kfree(ctrl);
@@ -3186,7 +3185,8 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,
goto out_free_ctrl;
}
- ctrl->queues = kcalloc(ctrl->ctrl.queue_count, sizeof(*ctrl->queues),
+ ctrl->nr_allocated_queues = ctrl->ctrl.queue_count;
+ ctrl->queues = kcalloc(ctrl->nr_allocated_queues, sizeof(*ctrl->queues),
GFP_KERNEL);
if (!ctrl->queues) {
ret = -ENOMEM;
@@ -3198,7 +3198,7 @@ static struct nvme_tcp_ctrl *nvme_tcp_alloc_ctrl(struct device *dev,
* they outlive the per-queue connect/disconnect cycles so that
* sysfs readers can never race their destruction.
*/
- for (i = 0; i < ctrl->ctrl.queue_count; i++)
+ for (i = 0; i < ctrl->nr_allocated_queues; i++)
mutex_init(&ctrl->queues[i].queue_lock);
ctrl->net = get_net(current->nsproxy->net_ns);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 388/816] drm/panthor: Revisit reqs_lock handling in flush/reset paths
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (386 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 387/816] nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 389/816] cxl/test: Map mock device nodes to an online node Greg Kroah-Hartman
` (432 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Boris Brezillon, Nicolas Frattaroli,
Liviu Dudau, Steven Price, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
[ Upstream commit 4fd08b3d1da78e33cb5939f0086e61f9d660cd6c ]
panthor_gpu_flush_caches() and panthor_gpu_soft_reset() acquire their
reqs_lock spinlock with the IRQ-disabling variants of the spinlocking
functions. This isn't necessary, as the lock is never taken from an
atomic context, as Panthor uses threaded interrupt handlers. The result
of this overly strict locking is that IRQs may be disabled more
frequently and for longer than they should be, resulting in increased
system latency.
Switch the locking to use non-IRQ-disabling scoped_guard statements for
locking. The wait_event_timeout read of pending_reqs outside of the
spinlock is fine as wait_event_timeout is a memory barrier according to
the Linux Memory Model.
Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260812-panthor-cache-flush-fix-v4-2-751e32901898@collabora.com
[ sashal: Dropped the cache-flush tracepoint code and kept the older gpu_read()/gpu_write() register accessors while converting reqs_lock to scoped_guard. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panthor/panthor_gpu.c | 61 ++++++++++++---------------
1 file changed, 28 insertions(+), 33 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
index 038f59df38d95..7bb319664e8b6 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu.c
+++ b/drivers/gpu/drm/panthor/panthor_gpu.c
@@ -384,34 +384,30 @@ int panthor_gpu_l2_power_on(struct panthor_device *ptdev)
int panthor_gpu_flush_caches(struct panthor_device *ptdev,
u32 l2, u32 lsc, u32 other)
{
- unsigned long flags;
int ret = 0;
/* Serialize cache flush operations. */
guard(mutex)(&ptdev->gpu->cache_flush_lock);
- spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags);
- if (!(ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED)) {
- ptdev->gpu->pending_reqs |= GPU_IRQ_CLEAN_CACHES_COMPLETED;
- gpu_write(ptdev, GPU_CMD, GPU_FLUSH_CACHES(l2, lsc, other));
- } else {
- ret = -EIO;
+ scoped_guard(spinlock, &ptdev->gpu->reqs_lock) {
+ if (!(ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED)) {
+ ptdev->gpu->pending_reqs |= GPU_IRQ_CLEAN_CACHES_COMPLETED;
+ gpu_write(ptdev, GPU_CMD, GPU_FLUSH_CACHES(l2, lsc, other));
+ } else {
+ return -EIO;
+ }
}
- spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags);
-
- if (ret)
- return ret;
if (!wait_event_timeout(ptdev->gpu->reqs_acked,
!(ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED),
msecs_to_jiffies(100))) {
- spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags);
- if ((ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED) != 0 &&
- !(gpu_read(ptdev, GPU_INT_RAWSTAT) & GPU_IRQ_CLEAN_CACHES_COMPLETED))
- ret = -ETIMEDOUT;
- else
- ptdev->gpu->pending_reqs &= ~GPU_IRQ_CLEAN_CACHES_COMPLETED;
- spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags);
+ scoped_guard(spinlock, &ptdev->gpu->reqs_lock) {
+ if ((ptdev->gpu->pending_reqs & GPU_IRQ_CLEAN_CACHES_COMPLETED) != 0 &&
+ !(gpu_read(ptdev, GPU_INT_RAWSTAT) & GPU_IRQ_CLEAN_CACHES_COMPLETED))
+ ret = -ETIMEDOUT;
+ else
+ ptdev->gpu->pending_reqs &= ~GPU_IRQ_CLEAN_CACHES_COMPLETED;
+ }
}
if (ret) {
@@ -431,27 +427,26 @@ int panthor_gpu_flush_caches(struct panthor_device *ptdev,
int panthor_gpu_soft_reset(struct panthor_device *ptdev)
{
bool timedout = false;
- unsigned long flags;
- spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags);
- if (!drm_WARN_ON(&ptdev->base,
- ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED)) {
- ptdev->gpu->pending_reqs |= GPU_IRQ_RESET_COMPLETED;
- gpu_write(ptdev, GPU_INT_CLEAR, GPU_IRQ_RESET_COMPLETED);
- gpu_write(ptdev, GPU_CMD, GPU_SOFT_RESET);
+ scoped_guard(spinlock, &ptdev->gpu->reqs_lock) {
+ if (!drm_WARN_ON(&ptdev->base,
+ ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED)) {
+ ptdev->gpu->pending_reqs |= GPU_IRQ_RESET_COMPLETED;
+ gpu_write(ptdev, GPU_INT_CLEAR, GPU_IRQ_RESET_COMPLETED);
+ gpu_write(ptdev, GPU_CMD, GPU_SOFT_RESET);
+ }
}
- spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags);
if (!wait_event_timeout(ptdev->gpu->reqs_acked,
!(ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED),
msecs_to_jiffies(100))) {
- spin_lock_irqsave(&ptdev->gpu->reqs_lock, flags);
- if ((ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED) != 0 &&
- !(gpu_read(ptdev, GPU_INT_RAWSTAT) & GPU_IRQ_RESET_COMPLETED))
- timedout = true;
- else
- ptdev->gpu->pending_reqs &= ~GPU_IRQ_RESET_COMPLETED;
- spin_unlock_irqrestore(&ptdev->gpu->reqs_lock, flags);
+ scoped_guard(spinlock, &ptdev->gpu->reqs_lock) {
+ if ((ptdev->gpu->pending_reqs & GPU_IRQ_RESET_COMPLETED) != 0 &&
+ !(gpu_read(ptdev, GPU_INT_RAWSTAT) & GPU_IRQ_RESET_COMPLETED))
+ timedout = true;
+ else
+ ptdev->gpu->pending_reqs &= ~GPU_IRQ_RESET_COMPLETED;
+ }
}
if (timedout) {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 389/816] cxl/test: Map mock device nodes to an online node
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (387 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 388/816] drm/panthor: Revisit reqs_lock handling in flush/reset paths Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 390/816] fuse: dont bump attr_version for async direct read completion Greg Kroah-Hartman
` (431 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Davidlohr Bueso, Dave Jiang,
Alison Schofield, Shaikh Kamaluddin, Gregory Price (Meta),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Davidlohr Bueso <dave@stgolabs.net>
[ Upstream commit 6f057dea152574dd044382fd0ba5ed19e3ecba25 ]
cxl_type3_mem_init() and cxl_type2_mem_init() assign alternating NUMA
nodes to the mock memdevs to model multi-node topologies. On a
single-node host node 1 has no pgdat, and the first node-aware
allocation in an odd device's probe faults on a NULL zonelist:
Oops: general protection fault, probably for non-canonical address 0xdffffc00000006e3
KASAN: probably user-memory-access in range [0x0000000000003718-0x000000000000371f]
Workqueue: async async_run_entry_fn
RIP: __alloc_frozen_pages_noprof+0x288
new_slab
___slab_alloc
__kmalloc_node_track_caller_noprof
devm_kmalloc
cxl_mock_mem_probe
Map the requested node to an online one, as dax_hmem already does
for its target node.
Fixes: cf1f6877b088 ("cxl/memdev: Add numa_node attribute")
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Shaikh Kamaluddin <shaikhkamal2012@gmail.com>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20260831175119.3247915-1-dave@stgolabs.net
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: adapted the three set_dev_node() call sites in the single cxl_mem_init() since the type2/type3 init helpers don't exist here, and dropped the fourth upstream site ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/cxl/test/cxl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
index 49e8b82004cb5..2432892dfcad2 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -1274,7 +1274,7 @@ static int cxl_mem_init(void)
if (!pdev)
goto err_mem;
pdev->dev.parent = &dport->dev;
- set_dev_node(&pdev->dev, i % 2);
+ set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
rc = cxl_mock_platform_device_add(pdev, &cxl_mem[i]);
if (rc)
@@ -1289,7 +1289,7 @@ static int cxl_mem_init(void)
if (!pdev)
goto err_single;
pdev->dev.parent = &dport->dev;
- set_dev_node(&pdev->dev, i % 2);
+ set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
rc = cxl_mock_platform_device_add(pdev, &cxl_mem_single[i]);
if (rc)
@@ -1305,7 +1305,7 @@ static int cxl_mem_init(void)
if (!pdev)
goto err_rcd;
pdev->dev.parent = &rch->dev;
- set_dev_node(&pdev->dev, i % 2);
+ set_dev_node(&pdev->dev, numa_map_to_online_node(i % 2));
rc = cxl_mock_platform_device_add(pdev, &cxl_rcd[i]);
if (rc)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 390/816] fuse: dont bump attr_version for async direct read completion
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (388 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 389/816] cxl/test: Map mock device nodes to an online node Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 391/816] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Greg Kroah-Hartman
` (430 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Horst Birthelmer, Jingbo Xu,
Miklos Szeredi, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jingbo Xu <jefflexu@linux.alibaba.com>
[ Upstream commit fc60668db85584da911e5d0a65c8698628f98bba ]
The attr_version counter should only be incremented when cached
attributes are actually modified (as documented in commit 1fb69e781729
("fuse: fix race between getattr and write")). Async direct reads do not
modify any cached inode attributes (size, mtime, ctime), so bumping
attr_version in fuse_aio_complete() for reads is incorrect.
This unconditional bump causes a livelock when auto_inval_data is
enabled together with writeback_cache: fuse_cache_read_iter() issues a
FUSE_GETATTR before every read, but by the time the response arrives,
an async DIO read completion has already incremented fi->attr_version
past the snapshot taken before the request. The GETATTR result is then
discarded (attr_version race), fi->i_time is never refreshed, and every
subsequent read triggers yet another GETATTR -- creating an infinite
loop of useless round-trips.
Fix this by only bumping attr_version for write completions, consistent
with the synchronous DIO write path (fuse_write_update_attr) and the
cached write path.
Fixes: 01e9d11a3e79 ("fuse: add support of async IO")
Reviewed-by: Horst Birthelmer <hbirthelmer@ddn.com>
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
[ sashal: Only the if condition line differs in context: inode is declared inside the if (res >= 0) block and there is no mapping variable, so the one-line condition change was applied to that layout. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fuse/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index f733a0f781146..89b6021a428eb 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -735,7 +735,7 @@ static void fuse_aio_complete(struct fuse_io_priv *io, int err, ssize_t pos)
if (!left && !io->blocking) {
ssize_t res = fuse_get_res_by_io(io);
- if (res >= 0) {
+ if (res >= 0 && io->write) {
struct inode *inode = file_inode(io->iocb->ki_filp);
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 391/816] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (389 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 390/816] fuse: dont bump attr_version for async direct read completion Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 392/816] wifi: mac80211: dont seed an S1G stas last_rate Greg Kroah-Hartman
` (429 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miaoqing Pan, Baochen Qiang,
Rameshkumar Sundaram, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
[ Upstream commit 1a7bcf5324c8e2de6512eca5b028b6b283181d3f ]
On WCN6750, if QMI messages never arrive (for example when qrtr_smd
is not ready), WLAN initialization stops before the device is fully
registered. In this case ATH11K_FLAG_QMI_FAIL is not set because no
QMI event handler is executed.
When the driver is removed, ath11k_ahb_remove() still calls
ath11k_core_deinit(), which eventually triggers
ath11k_ce_cleanup_pipes() on uninitialized CE pipes and results in a
NULL pointer dereference in ath11k_hal_srng_access_begin():
ath11k_hal_srng_access_begin+0x14/0x68 [ath11k]
ath11k_ce_cleanup_pipes+0x184/0x190 [ath11k]
ath11k_pcic_stop+0x24/0x38 [ath11k]
ath11k_core_deinit+0xfc/0x1c0 [ath11k]
ath11k_ahb_remove+0x38/0xa0 [ath11k_ahb]
Fix this by invoking ath11k_ahb_remove_prepare() before the state
check and skipping ath11k_core_deinit() if ATH11K_FLAG_REGISTERED
is not set, core initialization did not complete and CE pipes may
remain uninitialized, making ath11k_core_deinit() unsafe.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00204-QCAMSLSWPLZ-1
Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260806101331.484063-3-miaoqing.pan@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[ sashal: Changed the ath11k_ahb_power_down(ab, false) call to ath11k_ahb_power_down(ab), since the function takes no second argument here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/ahb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index b9bf1c5a934cd..e701eadcf1dda 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1310,14 +1310,15 @@ static void ath11k_ahb_remove(struct platform_device *pdev)
{
struct ath11k_base *ab = platform_get_drvdata(pdev);
- if (test_bit(ATH11K_FLAG_QMI_FAIL, &ab->dev_flags)) {
+ ath11k_ahb_remove_prepare(ab);
+
+ if (!test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) {
ath11k_ahb_power_down(ab);
ath11k_debugfs_soc_destroy(ab);
ath11k_qmi_deinit_service(ab);
goto qmi_fail;
}
- ath11k_ahb_remove_prepare(ab);
ath11k_core_deinit(ab);
qmi_fail:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 392/816] wifi: mac80211: dont seed an S1G stas last_rate
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (390 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 391/816] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 393/816] ACPI: APEI: GHES: Validate memory error section length before payload access Greg Kroah-Hartman
` (428 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lachlan Hodges, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lachlan Hodges <lachlan.hodges@morsemicro.com>
[ Upstream commit 00f623647c331d31df8629af958f7582a7fc874c ]
When initialising the rate control system, ieee80211_s1g_sta_rate_init()
is called for S1G stations during association where it initialises a
last rate of type STA_STATS_RATE_TYPE_S1G but does not initialise
nss, mcs bw etc. Since the last_rate no longer has a value equivalent
to STA_STATS_RATE_INVALID, the invalid rate will be decoded and
the NL80211_STA_INFO_RX_BITRATE flag will be set.
As a result, there is a period during association before the first
data frame is rx'ed where the seeded value is overwritten by
ieee80211_rx_h_sta_process() while this invalid last_rate lives. If
the sta is desroyed during this process, nl80211_put_sta_rate() will
call into cfg80211_calculate_bitrate() and attempt to calculate
the bitrate using the invalid last_rate leading to a WARN:
4,336,675067400,-;------------[ cut here ]------------
4,337,675067524,-;WARNING: net/wireless/util.c:1960 at cfg80211_calculate_bitrate+0x4d8/0x8b0 [cfg80211], CPU#3: kworker/u16:3/874
4,338,675068176,-;invalid rate bw=0, mcs=0, nss=0
[snip loaded modules]
4,341,675068954,-;Hardware name: BCM2711
4,342,675068961,-;Workqueue: events_unbound cfg80211_wiphy_work [cfg80211]
4,343,675069386,-;Call trace:
4,344,675069392,-; unwind_backtrace from show_stack+0x10/0x14
4,345,675069440,-; show_stack from dump_stack_lvl+0xa8/0xb8
4,346,675069475,-; dump_stack_lvl from __warn+0x90/0x224
4,347,675069517,-; __warn from warn_slowpath_fmt+0x130/0x1a8
4,348,675069559,-; warn_slowpath_fmt from cfg80211_calculate_bitrate+0x4d8/0x8b0 [cfg80211]
4,349,675070005,-; cfg80211_calculate_bitrate [cfg80211] from nl80211_put_sta_rate+0x48/0x590 [cfg80211]
4,350,675070819,-; nl80211_put_sta_rate [cfg80211] from nl80211_put_sta_info_common+0x4f4/0xd50 [cfg80211]
4,351,675071616,-; nl80211_put_sta_info_common [cfg80211] from nl80211_send_station.constprop.0+0x114/0x424 [cfg80211]
4,352,675072427,-; nl80211_send_station.constprop.0 [cfg80211] from cfg80211_del_sta_sinfo+0xc4/0x368 [cfg80211]
4,353,675073222,-; cfg80211_del_sta_sinfo [cfg80211] from __sta_info_destroy_part2+0x108/0x2c0 [mac80211]
4,354,675074178,-; __sta_info_destroy_part2 [mac80211] from sta_info_destroy_addr+0x4c/0x88 [mac80211]
4,355,675075243,-; sta_info_destroy_addr [mac80211] from ieee80211_destroy_assoc_data+0x194/0x2d8 [mac80211]
4,356,675075920,-; ieee80211_destroy_assoc_data [mac80211] from ieee80211_rx_mgmt_assoc_resp+0x220/0x1d4c [mac80211]
4,357,675076558,-; ieee80211_rx_mgmt_assoc_resp [mac80211] from ieee80211_iface_work+0x1c0/0x5d0 [mac80211]
4,358,675077187,-; ieee80211_iface_work [mac80211] from cfg80211_wiphy_work+0x110/0x368 [cfg80211]
4,359,675077763,-; cfg80211_wiphy_work [cfg80211] from process_one_work+0x260/0x868
4,360,675078022,-; process_one_work from worker_thread+0x1bc/0x3ec
4,361,675078042,-; worker_thread from kthread+0x120/0x154
4,362,675078060,-; kthread from ret_from_fork+0x14/0x20
4,363,675078074,-;Exception stack(0xf0ac1fb0 to 0xf0ac1ff8)
4,364,675078081,-;1fa0: 00000000 00000000 00000000 00000000
4,365,675078088,-;1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
4,366,675078093,-;1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
4,367,675080226,-;irq event stamp: 15780967
4,368,675080287,-;hardirqs last enabled at (15780975): [<c050c154>] __up_console_sem+0x50/0x60
4,369,675080395,-;hardirqs last disabled at (15780982): [<c050c140>] __up_console_sem+0x3c/0x60
4,370,675080497,-;softirqs last enabled at (15780966): [<c0476f14>] handle_softirqs+0x398/0x650
4,371,675080608,-;softirqs last disabled at (15780939): [<c0477388>] __irq_exit_rcu+0x150/0x1f0
4,372,675080715,-;---[ end trace 0000000000000000 ]---
To fix, we can simply not seed this psuedo rate. It was originally
implemented to avoid errornous paths that S1G shouldn't take, but those
have since been fixed / cleaned up. While we are here, we also don't
need to initialise the tx side's last rate with
IEEE80211_TX_RC_S1G_MCS (which is equivalent to
IEEE80211_TX_RC_VHT_MCS). The entire tx reporting side does not
support S1G widths and is assumed to be handled by the driver so
we can just remove the entire function.
Fixes: 12bf8fad4ca3 ("mac80211: initialize last_rate for S1G STAs")
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
Link: https://patch.msgid.link/20260827054456.254573-1-lachlan.hodges@morsemicro.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ sashal: dropped the ml_reconf_resp caller hunk since that function doesn't exist here, and adjusted the rate_control_rate_init() hunk to use struct sta_info *sta instead of struct link_sta_info *. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/ieee80211_i.h | 1 -
net/mac80211/mlme.c | 12 ++++--------
net/mac80211/rate.c | 1 -
net/mac80211/s1g.c | 8 --------
4 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c4dc2553454d1..09ef315c9c3f5 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2250,7 +2250,6 @@ ieee80211_he_op_ie_to_bss_conf(struct ieee80211_vif *vif,
const struct ieee80211_he_operation *he_op_ie_elem);
/* S1G */
-void ieee80211_s1g_sta_rate_init(struct sta_info *sta);
bool ieee80211_s1g_is_twt_setup(struct sk_buff *skb);
void ieee80211_s1g_rx_twt_action(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 7fd8fbe3400d3..3a08bb4dfca50 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -5044,7 +5044,6 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link,
}
static int ieee80211_mgd_setup_link_sta(struct ieee80211_link_data *link,
- struct sta_info *sta,
struct link_sta_info *link_sta,
struct cfg80211_bss *cbss)
{
@@ -5059,11 +5058,9 @@ static int ieee80211_mgd_setup_link_sta(struct ieee80211_link_data *link,
memcpy(link_sta->addr, cbss->bssid, ETH_ALEN);
memcpy(link_sta->pub->addr, cbss->bssid, ETH_ALEN);
- /* TODO: S1G Basic Rate Set is expressed elsewhere */
- if (cbss->channel->band == NL80211_BAND_S1GHZ) {
- ieee80211_s1g_sta_rate_init(sta);
+ /* S1G does not use basic rates */
+ if (cbss->channel->band == NL80211_BAND_S1GHZ)
return 0;
- }
sband = local->hw.wiphy->bands[cbss->channel->band];
@@ -5676,7 +5673,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
}
}
- err = ieee80211_mgd_setup_link_sta(link, sta, link_sta,
+ err = ieee80211_mgd_setup_link_sta(link, link_sta,
assoc_data->link[link_id].bss);
if (err)
goto out_err;
@@ -8270,8 +8267,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
goto out_err;
}
- err = ieee80211_mgd_setup_link_sta(link, new_sta,
- link_sta, cbss);
+ err = ieee80211_mgd_setup_link_sta(link, link_sta, cbss);
if (err) {
rcu_read_unlock();
sta_info_free(local, new_sta);
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 1b045b62961f5..3ce47278eae24 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -54,7 +54,6 @@ void rate_control_rate_init(struct sta_info *sta)
/* TODO: check for minstrel_s1g ? */
if (sband->band == NL80211_BAND_S1GHZ) {
- ieee80211_s1g_sta_rate_init(sta);
rcu_read_unlock();
return;
}
diff --git a/net/mac80211/s1g.c b/net/mac80211/s1g.c
index 657f281adf10a..f8877f78541e1 100644
--- a/net/mac80211/s1g.c
+++ b/net/mac80211/s1g.c
@@ -9,14 +9,6 @@
#include "ieee80211_i.h"
#include "driver-ops.h"
-void ieee80211_s1g_sta_rate_init(struct sta_info *sta)
-{
- /* avoid indicating legacy bitrates for S1G STAs */
- sta->deflink.tx_stats.last_rate.flags |= IEEE80211_TX_RC_S1G_MCS;
- sta->deflink.rx_stats.last_rate =
- STA_STATS_FIELD(TYPE, STA_STATS_RATE_TYPE_S1G);
-}
-
bool ieee80211_s1g_is_twt_setup(struct sk_buff *skb)
{
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 393/816] ACPI: APEI: GHES: Validate memory error section length before payload access
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (391 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 392/816] wifi: mac80211: dont seed an S1G stas last_rate Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 394/816] ASoC: sta32x: make power restoration transactional Greg Kroah-Hartman
` (427 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Hanjun Guo, Shuai Xue,
Dave Jiang, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 10338c9085b4939a428a8dc78d2bbf62c161278b ]
ghes_do_proc() hands the CPER_SEC_PLATFORM_MEM payload to the report chain,
arch_apei_report_mem_error() and ghes_handle_memory_failure() without
checking gdata->error_data_length. All three read validation_bits and
physical_addr, at offsets 0 and 16, so a shorter section reads past the
record.
Check the length once in ghes_do_proc(), before any consumer runs. Take the
73-byte struct cper_sec_mem_err_old as the floor: older firmware
legitimately emits that UEFI 2.1/2.2 layout, and it makes validation_bits
safe to read.
The fields from "extended" on are absent from that layout, so also require
whatever length the validation bits claim. Derive it per field rather than
demanding the full 80 bytes: rank needs only 76, and the BANK_GROUP and
BANK_ADDRESS bits describe "bank" at offset 38, which every record carries.
Testing the whole mask against one size, as cper_print_mem() does, gets it
wrong both ways.
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260714231835.303081-1-dave.jiang@intel.com?part=7
Fixes: ca104edc1784 ("ACPI, APEI, GHES: Cleanup ghes memory error handling")
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260904172337.1409775-12-dave.jiang@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: Placed the helper before ghes_do_proc() since ghes_log_hwerr() is absent here, leaving the helper and both length checks unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/apei/ghes.c | 41 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index dd9ea631f6f60..7699a36adfd8b 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -787,6 +787,28 @@ int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd)
}
EXPORT_SYMBOL_NS_GPL(cxl_cper_kfifo_get, CXL);
+/*
+ * The fields from "extended" on are absent from the 73-byte UEFI 2.1/2.2
+ * layout that older firmware still emits. Return the length needed for the
+ * fields the validation bits claim, so over-claiming is rejected without
+ * rejecting an honest short record.
+ */
+static u32 ghes_mem_err_min_len(u64 validation_bits)
+{
+ u32 len = sizeof(struct cper_sec_mem_err_old);
+
+ if (validation_bits & (CPER_MEM_VALID_ROW_EXT | CPER_MEM_VALID_CHIP_ID))
+ len = offsetof(struct cper_sec_mem_err, rank);
+ if (validation_bits & CPER_MEM_VALID_RANK_NUMBER)
+ len = offsetof(struct cper_sec_mem_err, mem_array_handle);
+ if (validation_bits & CPER_MEM_VALID_CARD_HANDLE)
+ len = offsetof(struct cper_sec_mem_err, mem_dev_handle);
+ if (validation_bits & CPER_MEM_VALID_MODULE_HANDLE)
+ len = sizeof(struct cper_sec_mem_err);
+
+ return len;
+}
+
static bool ghes_do_proc(struct ghes *ghes,
const struct acpi_hest_generic_status *estatus)
{
@@ -811,6 +833,25 @@ static bool ghes_do_proc(struct ghes *ghes,
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
struct cper_sec_mem_err *mem_err = acpi_hest_get_payload(gdata);
+ /*
+ * Check once for all three consumers below. The 73-byte
+ * UEFI 2.1/2.2 layout is the floor, matching
+ * cper_estatus_print_section() and making
+ * validation_bits safe to read.
+ */
+ if (gdata->error_data_length <
+ sizeof(struct cper_sec_mem_err_old))
+ continue;
+
+ /* Then require what the claimed fields actually need. */
+ if (gdata->error_data_length <
+ ghes_mem_err_min_len(mem_err->validation_bits)) {
+ pr_warn_ratelimited(FW_WARN GHES_PFX
+ "memory error section too small (%u) for the fields it claims\n",
+ gdata->error_data_length);
+ continue;
+ }
+
atomic_notifier_call_chain(&ghes_report_chain, sev, mem_err);
arch_apei_report_mem_error(sev, mem_err);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 394/816] ASoC: sta32x: make power restoration transactional
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (392 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 393/816] ACPI: APEI: GHES: Validate memory error section length before payload access Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 395/816] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure Greg Kroah-Hartman
` (426 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 3e71dc4508bc84862dc3644e3b6a5b966bff22ad ]
sta32x_set_bias_level() enables the codec supplies, restores the
coefficient and register state, and then starts the watchdog. Register
access errors in the mute and coefficient helpers and the cache replay
are discarded, allowing DAPM to publish STANDBY for a partially restored
codec.
Propagate every operation in the local restore transaction, including
the final standby-state write. Start the watchdog only after that write
succeeds. On failure, hold reset, mark the cache dirty, disable the
supplies and report a cleanup failure while preserving the primary
error. The DAPM bias callback consumes the returned error independently
of component resume handling.
Fixes: 54dc6cabe684 ("ASoC: sta32x: preserve coefficient RAM")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260830141521.33246-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Adapted the hunks to this tree's offsets and dropped the dapm context line, since the function has no dapm local here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/sta32x.c | 101 +++++++++++++++++++++++++++++---------
1 file changed, 77 insertions(+), 24 deletions(-)
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 122f832d90e05..5a4afd79fc0c7 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -345,27 +345,48 @@ static int sta32x_sync_coef_shadow(struct snd_soc_component *component)
{
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
unsigned int cfud;
- int i;
+ int i, ret;
/* preserve reserved bits in STA32X_CFUD */
- regmap_read(sta32x->regmap, STA32X_CFUD, &cfud);
+ ret = regmap_read(sta32x->regmap, STA32X_CFUD, &cfud);
+ if (ret)
+ return ret;
+
cfud &= 0xf0;
for (i = 0; i < STA32X_COEF_COUNT; i++) {
- regmap_write(sta32x->regmap, STA32X_CFADDR2, i);
- regmap_write(sta32x->regmap, STA32X_B1CF1,
- (sta32x->coef_shadow[i] >> 16) & 0xff);
- regmap_write(sta32x->regmap, STA32X_B1CF2,
- (sta32x->coef_shadow[i] >> 8) & 0xff);
- regmap_write(sta32x->regmap, STA32X_B1CF3,
- (sta32x->coef_shadow[i]) & 0xff);
+ ret = regmap_write(sta32x->regmap, STA32X_CFADDR2, i);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_B1CF1,
+ (sta32x->coef_shadow[i] >> 16) & 0xff);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_B1CF2,
+ (sta32x->coef_shadow[i] >> 8) & 0xff);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_B1CF3,
+ sta32x->coef_shadow[i] & 0xff);
+ if (ret)
+ return ret;
+
/*
* chip documentation does not say if the bits are
* self-clearing, so do it explicitly
*/
- regmap_write(sta32x->regmap, STA32X_CFUD, cfud);
- regmap_write(sta32x->regmap, STA32X_CFUD, cfud | 0x01);
+ ret = regmap_write(sta32x->regmap, STA32X_CFUD, cfud);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_CFUD, cfud | 0x01);
+ if (ret)
+ return ret;
}
+
return 0;
}
@@ -373,15 +394,24 @@ static int sta32x_cache_sync(struct snd_soc_component *component)
{
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
unsigned int mute;
- int rc;
+ int restore_ret, ret;
/* mute during register sync */
- regmap_read(sta32x->regmap, STA32X_MMUTE, &mute);
- regmap_write(sta32x->regmap, STA32X_MMUTE, mute | STA32X_MMUTE_MMUTE);
- sta32x_sync_coef_shadow(component);
- rc = regcache_sync(sta32x->regmap);
- regmap_write(sta32x->regmap, STA32X_MMUTE, mute);
- return rc;
+ ret = regmap_read(sta32x->regmap, STA32X_MMUTE, &mute);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(sta32x->regmap, STA32X_MMUTE,
+ mute | STA32X_MMUTE_MMUTE);
+ if (ret)
+ return ret;
+
+ ret = sta32x_sync_coef_shadow(component);
+ if (!ret)
+ ret = regcache_sync(sta32x->regmap);
+
+ restore_ret = regmap_write(sta32x->regmap, STA32X_MMUTE, mute);
+ return ret ?: restore_ret;
}
/* work around ESD issue where sta32x resets and loses all configuration */
@@ -797,8 +827,8 @@ static int sta32x_startup_sequence(struct sta32x_priv *sta32x)
static int sta32x_set_bias_level(struct snd_soc_component *component,
enum snd_soc_bias_level level)
{
- int ret;
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
+ int cleanup_ret, ret;
dev_dbg(component->dev, "level = %d\n", level);
switch (level) {
@@ -822,15 +852,28 @@ static int sta32x_set_bias_level(struct snd_soc_component *component,
return ret;
}
- sta32x_startup_sequence(sta32x);
- sta32x_cache_sync(component);
+ ret = sta32x_startup_sequence(sta32x);
+ if (!ret)
+ ret = sta32x_cache_sync(component);
+ if (ret)
+ goto restore_failed;
+
+ ret = regmap_update_bits(sta32x->regmap, STA32X_CONFF,
+ STA32X_CONFF_PWDN | STA32X_CONFF_EAPD,
+ 0);
+ if (ret)
+ goto restore_failed;
+
sta32x_watchdog_start(sta32x);
+ break;
}
/* Power down */
- regmap_update_bits(sta32x->regmap, STA32X_CONFF,
- STA32X_CONFF_PWDN | STA32X_CONFF_EAPD,
- 0);
+ ret = regmap_update_bits(sta32x->regmap, STA32X_CONFF,
+ STA32X_CONFF_PWDN | STA32X_CONFF_EAPD,
+ 0);
+ if (ret)
+ return ret;
break;
@@ -848,6 +891,16 @@ static int sta32x_set_bias_level(struct snd_soc_component *component,
break;
}
return 0;
+
+restore_failed:
+ gpiod_set_value(sta32x->gpiod_nreset, 0);
+ regcache_mark_dirty(sta32x->regmap);
+ cleanup_ret = regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies),
+ sta32x->supplies);
+ if (cleanup_ret)
+ dev_warn(component->dev, "Failed to disable supplies: %d\n",
+ cleanup_ret);
+ return ret;
}
static const struct snd_soc_dai_ops sta32x_dai_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 395/816] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (393 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 394/816] ASoC: sta32x: make power restoration transactional Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 396/816] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v " Greg Kroah-Hartman
` (425 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Golla Nagendra, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Golla Nagendra <nagendra.golla@amd.com>
[ Upstream commit f2f44b952ea6e0c600e92ea21fcaa83cafeedf6e ]
If sw_desc_pool allocation fails after pm_runtime_resume_and_get()
succeeds in zynqmp_dma_alloc_chan_resources(), the error path returns
without dropping the runtime PM reference.
Route that failure path through err_pm so the runtime PM reference is
balanced before returning the error.
Fixes: 8982d48af36d ("dmaengine: zynqmp_dma: Fix PM reference leak in zynqmp_dma_alloc_chan_resourc()")
Signed-off-by: Golla Nagendra <nagendra.golla@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260814045616.1661199-2-nagendra.golla@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[ sashal: Kept this branch's older kcalloc() call instead of upstream's kzalloc_objs() context line, and applied the err_pm rollback change unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/zynqmp_dma.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 235c60e1e320e..594086b264941 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -484,8 +484,10 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
chan->sw_desc_pool = kcalloc(ZYNQMP_DMA_NUM_DESCS, sizeof(*desc),
GFP_KERNEL);
- if (!chan->sw_desc_pool)
- return -ENOMEM;
+ if (!chan->sw_desc_pool) {
+ ret = -ENOMEM;
+ goto err_pm;
+ }
chan->idle = true;
chan->desc_free_cnt = ZYNQMP_DMA_NUM_DESCS;
@@ -517,6 +519,10 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
}
return ZYNQMP_DMA_NUM_DESCS;
+
+err_pm:
+ pm_runtime_put_autosuspend(chan->dev);
+ return ret;
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 396/816] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v alloc failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (394 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 395/816] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 397/816] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor Greg Kroah-Hartman
` (424 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Golla Nagendra, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Golla Nagendra <nagendra.golla@amd.com>
[ Upstream commit 4ea99b14b3bd955d768666941e2e03ba186b52f5 ]
In zynqmp_dma_alloc_chan_resources(), sw_desc_pool is allocated before
desc_pool_v. If dma_alloc_coherent() for desc_pool_v fails, the function
currently exits through the runtime PM rollback path but leaves the
already allocated sw_desc_pool behind.
Add a dedicated err_free_sw_desc_pool label for the desc_pool_v failure
path, free sw_desc_pool there, then fall through to err_pm for
pm_runtime_put_autosuspend().
This keeps the error unwind symmetric and avoids leaking the software
descriptor pool on coherent descriptor allocation failure.
Fixes: b0cc417c1637 ("dmaengine: Add Xilinx zynqmp dma engine driver support")
Signed-off-by: Golla Nagendra <nagendra.golla@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260814045616.1661199-3-nagendra.golla@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/zynqmp_dma.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 594086b264941..1d6a12c7b58ef 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -505,8 +505,10 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
(2 * ZYNQMP_DMA_DESC_SIZE(chan) *
ZYNQMP_DMA_NUM_DESCS),
&chan->desc_pool_p, GFP_KERNEL);
- if (!chan->desc_pool_v)
- return -ENOMEM;
+ if (!chan->desc_pool_v) {
+ ret = -ENOMEM;
+ goto err_free_sw_desc_pool;
+ }
for (i = 0; i < ZYNQMP_DMA_NUM_DESCS; i++) {
desc = chan->sw_desc_pool + i;
@@ -520,6 +522,9 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
return ZYNQMP_DMA_NUM_DESCS;
+err_free_sw_desc_pool:
+ kfree(chan->sw_desc_pool);
+ chan->sw_desc_pool = NULL;
err_pm:
pm_runtime_put_autosuspend(chan->dev);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 397/816] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (395 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 396/816] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v " Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 398/816] sit: charge ip_tunnel_prl_entry allocations to memcg Greg Kroah-Hartman
` (423 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Baochen Qiang, Rameshkumar Sundaram,
Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
[ Upstream commit 979ecb88ed3528e08dd7f87b90b029374226ca84 ]
ath12k_wifi7_hal_tx_cmd_ext_desc_setup() programs the low 32 bits of the
TX buffer physical address into HAL_TX_MSDU_EXT_INFO0_BUF_PTR_LO but
hardcodes the high bits field HAL_TX_MSDU_EXT_INFO1_BUF_PTR_HI to 0x0.
dma_addr_t is 64-bit on platforms with CONFIG_ARCH_DMA_ADDR_T_64BIT, so
whenever a TX buffer is mapped above the 4 GB boundary the upper bits of
paddr are dropped and the firmware is handed a truncated address,
leading to potential TX failures.
Write the upper bits of paddr into BUF_PTR_HI to fix this issue.
Issue found during code review, compile tested only.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260818-ath12k-truncated-tx-dma-addr-v1-1-ead978969371@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[ sashal: Applied the same one-line BUF_PTR_HI change to dp_tx.c and the ath12k_hal_tx_cmd_ext_desc_setup() name, since this tree has no wifi7 subdirectory or function prefix. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath12k/dp_tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index f08ab5a4112c0..2e2f228b74c88 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -111,7 +111,7 @@ static void ath12k_hal_tx_cmd_ext_desc_setup(struct ath12k_base *ab,
{
tcl_ext_cmd->info0 = le32_encode_bits(ti->paddr,
HAL_TX_MSDU_EXT_INFO0_BUF_PTR_LO);
- tcl_ext_cmd->info1 = le32_encode_bits(0x0,
+ tcl_ext_cmd->info1 = le32_encode_bits((u64)ti->paddr >> HAL_ADDR_MSB_REG_SHIFT,
HAL_TX_MSDU_EXT_INFO1_BUF_PTR_HI) |
le32_encode_bits(ti->data_len,
HAL_TX_MSDU_EXT_INFO1_BUF_LEN);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 398/816] sit: charge ip_tunnel_prl_entry allocations to memcg
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (396 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 397/816] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 399/816] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Greg Kroah-Hartman
` (422 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Lorenzo Bianconi,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 40a2b90f5190fcc7b083809fa93f2799abefeeb1 ]
ipip6_tunnel_add_prl() allocates struct ip_tunnel_prl_entry for each
potential router entry added via SIOCADDPRL.
An unprivileged user with CAP_NET_ADMIN in a user namespace can add
an unbounded number of entries, consuming uncharged kernel memory.
Commit 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on
ip_tunnel_prl structs allocation") added accounting to the temporary
buffer in ipip6_tunnel_get_prl(), but missed the entry allocations
in ipip6_tunnel_add_prl().
Use GFP_KERNEL_ACCOUNT when allocating struct ip_tunnel_prl_entry.
Fixes: 1b51d8271973 ("memcg: ipv6/sit: account and don't WARN on ip_tunnel_prl structs allocation")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260907075846.2913645-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Changed GFP_KERNEL to GFP_KERNEL_ACCOUNT on the existing kzalloc() call, since the kzalloc_obj() helper used by the upstream patch doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/sit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index eb42d3075e77d..c1617f3e09d91 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -394,7 +394,7 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg)
goto out;
}
- p = kzalloc(sizeof(struct ip_tunnel_prl_entry), GFP_KERNEL);
+ p = kzalloc(sizeof(struct ip_tunnel_prl_entry), GFP_KERNEL_ACCOUNT);
if (!p) {
err = -ENOBUFS;
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 399/816] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (397 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 398/816] sit: charge ip_tunnel_prl_entry allocations to memcg Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 400/816] ACPI: glue: Reduce debug noise from acpi_device_notify() Greg Kroah-Hartman
` (421 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Antoine Tenart, Thomas Huth,
Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Huth <thuth@redhat.com>
[ Upstream commit 5c87bcb2f98dbfe08efa016af037b0f9701ba381 ]
key_tmp[] in safexcel_xcbcmac_setkey() and consts[] / _const[] in
safexcel_cmac_setkey() contain crypto key material that should not
get exposed to the outside once the function is done. Scrub the
arrays with memzero_explicit() to avoid that the data could leak
via the stack.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260813134953.979481-1-thuth%40redhat.com
Fixes: 38f21b4bab11f ("crypto: inside-secure - Added support for the AES XCBC ahash")
Fixes: 7a627db9cafdb ("crypto: inside-secure - Added support for the AES-CMAC ahash")
Acked-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ sashal: Replaced the newer aes_prepareenckey() context line with this tree's aes_expandkey() call in the xcbcmac hunk; the added memzero_explicit() lines match upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/inside-secure/safexcel_hash.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c
index af4b978189e51..af2b97fcb27f4 100644
--- a/drivers/crypto/inside-secure/safexcel_hash.c
+++ b/drivers/crypto/inside-secure/safexcel_hash.c
@@ -2081,6 +2081,7 @@ static int safexcel_xcbcmac_setkey(struct crypto_ahash *tfm, const u8 *key,
ret = aes_expandkey(ctx->aes,
(u8 *)key_tmp + 2 * AES_BLOCK_SIZE,
AES_MIN_KEY_SIZE);
+ memzero_explicit(key_tmp, sizeof(key_tmp));
if (ret)
return ret;
@@ -2192,6 +2193,8 @@ static int safexcel_cmac_setkey(struct crypto_ahash *tfm, const u8 *key,
}
ctx->cbcmac = false;
+ memzero_explicit(consts, sizeof(consts));
+ memzero_explicit(_const, sizeof(_const));
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 400/816] ACPI: glue: Reduce debug noise from acpi_device_notify()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (398 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 399/816] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 401/816] ACPI: glue: Rework the success message in acpi_device_notify() Greg Kroah-Hartman
` (420 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Andy Shevchenko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 5bc1e72f80da4c20ce8b57851be4fad67e855ebd ]
When debug is enabled in the ACPI glue code that handles binding
devices to ACPI companions, acpi_device_notify() produces a lot of
message noise related to devices that have no ACPI companions.
Reduce that noise by checking the most obvious case, ACPI device
objects, directly and returning from acpi_device_notify() in that
case without printing any debug messages. Also avoid printing a
debug message when there is no matching ACPI bus type definition for
the given device, which is the case for the vast majority of devices.
Additionally, make the debug messages that get printed more informative.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/6325978.lOV4Wx5bFT@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: c94619c8a5b5 ("ACPI: glue: Carry out companion lookup under bus_type_sem")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index cc9ee8cb820fc..54cc709be3166 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -356,22 +356,27 @@ void acpi_device_notify(struct device *dev)
struct acpi_device *adev;
int ret;
+ /* ACPI devices have no ACPI companions. */
+ if (dev->bus == &acpi_bus_type)
+ return;
+
ret = acpi_bind_one(dev, NULL);
if (ret) {
struct acpi_bus_type *type = acpi_get_bus_type(dev);
if (!type)
- goto err;
+ return;
adev = type->find_companion(dev);
if (!adev) {
dev_dbg(dev, "ACPI companion not found\n");
- goto err;
+ return;
}
ret = acpi_bind_one(dev, adev);
- if (ret)
- goto err;
-
+ if (ret) {
+ dev_dbg(dev, "Binding to ACPI companion failed\n");
+ return;
+ }
if (type->setup) {
type->setup(dev);
goto done;
@@ -393,11 +398,6 @@ void acpi_device_notify(struct device *dev)
done:
acpi_handle_debug(ACPI_HANDLE(dev), "Bound to device %s\n",
dev_name(dev));
-
- return;
-
-err:
- dev_dbg(dev, "No ACPI support\n");
}
void acpi_device_notify_remove(struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 401/816] ACPI: glue: Rework the success message in acpi_device_notify()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (399 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 400/816] ACPI: glue: Reduce debug noise from acpi_device_notify() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 402/816] ACPI: glue: Carry out companion lookup under bus_type_sem Greg Kroah-Hartman
` (419 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Andy Shevchenko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit aef7792cddcac7ab400912c2947a595401d4a7e8 ]
Using an ACPI handle in the acpi_device_notify() success message is
somewhat misleading because the "physical" device is not bound to an
ACPI namespace object in that function, but to an ACPI device object
attached to it. Moreover, the message is outright confusing for the
"physical" devices bound to ACPI devices without ACPI namespace
objects (for example, fixed event buttons).
Address this by turning that message into a dev_dbg() one printed for
the "physical" device and mentioning the name of the ACPI companion.
Fixes: ab06eb920401 ("ACPI: scan: Register platform devices for fixed event buttons")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/2448150.ElGaqSPkdT@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: c94619c8a5b5 ("ACPI: glue: Carry out companion lookup under bus_type_sem")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 54cc709be3166..c01ebf20a9318 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -396,8 +396,7 @@ void acpi_device_notify(struct device *dev)
adev->handler->bind(dev);
done:
- acpi_handle_debug(ACPI_HANDLE(dev), "Bound to device %s\n",
- dev_name(dev));
+ dev_dbg(dev, "Bound to ACPI device %s\n", acpi_dev_name(adev));
}
void acpi_device_notify_remove(struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 402/816] ACPI: glue: Carry out companion lookup under bus_type_sem
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (400 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 401/816] ACPI: glue: Rework the success message in acpi_device_notify() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 403/816] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage Greg Kroah-Hartman
` (418 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit c94619c8a5b5d3b980433d247ac87a2d1c827cb6 ]
When acpi_device_notify() looks up an ACPI companion for the given
device, it invokes callbacks from struct acpi_bus_type() without
synchronization which may lead to a use-after-free if the driver
module containing those callbacks is unloaded at the same time.
Address this by holding bus_type_sem throughout the entire ACPI
companion lookup and the execution of the .setup() callback in
struct acpi_bus_type (if present) instead of dropping the semaphore
(prematurely) after finding a matching struct acpi_bus_type.
For this purpose, rename acpi_get_bus_type() to acpi_companion_lookup(),
make it return a struct acpi_device pointer, and move the relevant code
from acpi_device_notify() to it.
Also notice that the only case in which the .bind() callback from an
ACPI scan handler may need to be invoked is when the given device is
a platform one, so adjust acpi_device_notify() accordingly and drop
the "done" label that is not used any more from it.
Fixes: 2ef5236660b6 ("ACPI: glue: Look for ACPI bus type only if ACPI companion is not known")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3089807.e9J7NaK4W3@rafael.j.wysocki
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 61 +++++++++++++++++++++------------------------
1 file changed, 29 insertions(+), 32 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index c01ebf20a9318..e2a40847d24b6 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -59,19 +59,34 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type)
}
EXPORT_SYMBOL_GPL(unregister_acpi_bus_type);
-static struct acpi_bus_type *acpi_get_bus_type(struct device *dev)
+static struct acpi_device *acpi_companion_lookup(struct device *dev)
{
- struct acpi_bus_type *tmp, *ret = NULL;
+ struct acpi_bus_type *type;
- down_read(&bus_type_sem);
- list_for_each_entry(tmp, &bus_type_list, list) {
- if (tmp->match(dev)) {
- ret = tmp;
- break;
+ guard(rwsem_read)(&bus_type_sem);
+
+ list_for_each_entry(type, &bus_type_list, list) {
+ struct acpi_device *adev;
+
+ if (!type->match(dev))
+ continue;
+
+ adev = type->find_companion(dev);
+ if (!adev) {
+ dev_dbg(dev, "ACPI companion not found\n");
+ return NULL;
}
+ if (acpi_bind_one(dev, adev)) {
+ dev_dbg(dev, "Binding to ACPI companion failed\n");
+ return NULL;
+ }
+ if (type->setup)
+ type->setup(dev);
+
+ return adev;
}
- up_read(&bus_type_sem);
- return ret;
+
+ return NULL;
}
#define FIND_CHILD_MIN_SCORE 1
@@ -362,40 +377,22 @@ void acpi_device_notify(struct device *dev)
ret = acpi_bind_one(dev, NULL);
if (ret) {
- struct acpi_bus_type *type = acpi_get_bus_type(dev);
-
- if (!type)
+ adev = acpi_companion_lookup(dev);
+ if (!adev)
return;
-
- adev = type->find_companion(dev);
- if (!adev) {
- dev_dbg(dev, "ACPI companion not found\n");
- return;
- }
- ret = acpi_bind_one(dev, adev);
- if (ret) {
- dev_dbg(dev, "Binding to ACPI companion failed\n");
- return;
- }
- if (type->setup) {
- type->setup(dev);
- goto done;
- }
} else {
adev = ACPI_COMPANION(dev);
if (dev_is_pci(dev)) {
pci_acpi_setup(dev, adev);
- goto done;
} else if (dev_is_platform(dev)) {
acpi_configure_pmsi_domain(dev);
+
+ if (adev->handler && adev->handler->bind)
+ adev->handler->bind(dev);
}
}
- if (adev->handler && adev->handler->bind)
- adev->handler->bind(dev);
-
-done:
dev_dbg(dev, "Bound to ACPI device %s\n", acpi_dev_name(adev));
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 403/816] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (401 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 402/816] ACPI: glue: Carry out companion lookup under bus_type_sem Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 404/816] phy: samsung: usbdrd: propagate GS101 PIPE3 lock failures Greg Kroah-Hartman
` (417 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit fcfb2b562115632e0a60a0928dca495f98eb335c ]
Rearange the code in acpi_bind_one() to avoid situations in which the
existing ACPI companion of the given device would be replaced with NULL
due to a memory allocation error or because somebody tries to bind a
physical device with an ACPI companion to a different ACPI device
erroneously.
Fixes: 7b1998116bbb ("ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ rjw: Merged two conditionals to avoid redundant check ]
Link: https://patch.msgid.link/3465482.44csPzL39Z@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: Adapted the context to this tree's kzalloc(sizeof(*physical_node), GFP_KERNEL) in place of kzalloc_obj(*physical_node), including the re-added allocation after the list walk. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 58 +++++++++++++++++++--------------------------
1 file changed, 24 insertions(+), 34 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index e2a40847d24b6..f915a7c0e7cca 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -243,31 +243,25 @@ static void acpi_physnode_link_name(char *buf, unsigned int node_id)
int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
{
struct acpi_device_physical_node *physical_node, *pn;
+ struct acpi_device *comp_dev = ACPI_COMPANION(dev);
char physical_node_name[PHYSICAL_NODE_NAME_SIZE];
struct list_head *physnode_list;
unsigned int node_id;
int retval = -EINVAL;
- if (has_acpi_companion(dev)) {
- if (acpi_dev) {
- dev_warn(dev, "ACPI companion already set\n");
+ if (!acpi_dev) {
+ if (!comp_dev)
return -EINVAL;
- } else {
- acpi_dev = ACPI_COMPANION(dev);
- }
- }
- if (!acpi_dev)
- return -EINVAL;
- acpi_dev_get(acpi_dev);
- get_device(dev);
- physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL);
- if (!physical_node) {
- retval = -ENOMEM;
- goto err;
+ /* If the companion has been set upfront, pick it up. */
+ acpi_dev = comp_dev;
+ } else if (comp_dev && acpi_dev != comp_dev) {
+ dev_warn(dev, "ACPI companion already set to %s which is not %s\n",
+ acpi_dev_name(comp_dev), acpi_dev_name(acpi_dev));
+ return -EEXIST;
}
- mutex_lock(&acpi_dev->physical_node_lock);
+ guard(mutex)(&acpi_dev->physical_node_lock);
/*
* Keep the list sorted by node_id so that the IDs of removed nodes can
@@ -278,15 +272,12 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
list_for_each_entry(pn, &acpi_dev->physical_node_list, node) {
/* Sanity check. */
if (pn->dev == dev) {
- mutex_unlock(&acpi_dev->physical_node_lock);
-
- dev_warn(dev, "Already associated with ACPI node\n");
- kfree(physical_node);
- if (ACPI_COMPANION(dev) != acpi_dev)
- goto err;
-
- put_device(dev);
- acpi_dev_put(acpi_dev);
+ if (!comp_dev) {
+ /* Really unexpected. */
+ ACPI_COMPANION_SET(dev, acpi_dev);
+ dev_warn(&acpi_dev->dev,
+ "Physical device list corruption fixed up\n");
+ }
return 0;
}
if (pn->node_id == node_id) {
@@ -295,12 +286,19 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
}
}
+ physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL);
+ if (!physical_node)
+ return -ENOMEM;
+
+ acpi_dev_get(acpi_dev);
+ get_device(dev);
+
physical_node->node_id = node_id;
physical_node->dev = dev;
list_add(&physical_node->node, physnode_list);
acpi_dev->physical_node_count++;
- if (!has_acpi_companion(dev))
+ if (!comp_dev)
ACPI_COMPANION_SET(dev, acpi_dev);
acpi_physnode_link_name(physical_node_name, node_id);
@@ -316,18 +314,10 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
dev_err(dev, "Failed to create link firmware_node (%d)\n",
retval);
- mutex_unlock(&acpi_dev->physical_node_lock);
-
if (acpi_dev->wakeup.flags.valid)
device_set_wakeup_capable(dev, true);
return 0;
-
- err:
- ACPI_COMPANION_SET(dev, NULL);
- put_device(dev);
- acpi_dev_put(acpi_dev);
- return retval;
}
EXPORT_SYMBOL_GPL(acpi_bind_one);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 404/816] phy: samsung: usbdrd: propagate GS101 PIPE3 lock failures
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (402 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 403/816] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 405/816] cxl/hdm: Restore commit_end when decoder enumeration fails Greg Kroah-Hartman
` (416 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Manivannan Sadhasivam,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 2ef1e78ef7223eb16d9cf20814a1b2873456f671 ]
The GS101 PIPE3 initialization checks the PMA PLL lock and then checks
the CDR lock. The PLL helper returns an error, but the GS101 PIPE3 init
path dropped that result. The CDR helper only logged a timeout. PHY
initialization could therefore still return success after either the PLL
or the selected receive lane had not locked.
Make the in-file SoC-specific phy_init hook return an int so helpers
with real failure results can propagate them through the existing PHY
init paths. Keep the register-only helpers returning success and use the
new return path to report the GS101 CDR wait failure. Other SoC helper
paths keep their previous success behavior.
Fixes: 32267c29bc7d ("phy: exynos5-usbdrd: support Exynos USBDRD 3.1 combo phy (HS & SS)")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260623135349.42739-1-pengpeng@iscas.ac.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[ sashal: Dropped the exynos7870, exynos2200 and exynosautov920 phy_init conversions (SoCs not present), and adapted the CDR helper and exynos850 phy_init to the older code without phy_mutex or scoped_guard. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/samsung/phy-exynos5-usbdrd.c | 51 +++++++++++++++++-------
1 file changed, 37 insertions(+), 14 deletions(-)
diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
index 28d02ae60cc14..ad4a7dfa1ab32 100644
--- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
+++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
@@ -355,7 +355,7 @@ struct exynos5_usbdrd_phy;
struct exynos5_usbdrd_phy_config {
u32 id;
void (*phy_isol)(struct phy_usb_instance *inst, bool isolate);
- void (*phy_init)(struct exynos5_usbdrd_phy *phy_drd);
+ int (*phy_init)(struct exynos5_usbdrd_phy *phy_drd);
unsigned int (*set_refclk)(struct phy_usb_instance *inst);
};
@@ -579,7 +579,7 @@ exynos5_usbdrd_apply_phy_tunes(struct exynos5_usbdrd_phy *phy_drd,
}
}
-static void exynos5_usbdrd_pipe3_init(struct exynos5_usbdrd_phy *phy_drd)
+static int exynos5_usbdrd_pipe3_init(struct exynos5_usbdrd_phy *phy_drd)
{
u32 reg;
@@ -592,6 +592,8 @@ static void exynos5_usbdrd_pipe3_init(struct exynos5_usbdrd_phy *phy_drd)
reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYTEST);
reg &= ~PHYTEST_POWERDOWN_SSP;
writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYTEST);
+
+ return 0;
}
static void
@@ -686,7 +688,7 @@ exynos5_usbdrd_usbdp_g2_v4_pma_check_pll_lock(struct exynos5_usbdrd_phy *phy_drd
return err;
}
-static void
+static int
exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lock(struct exynos5_usbdrd_phy *phy_drd)
{
static const unsigned int timeout_us = 40000;
@@ -703,7 +705,7 @@ exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lock(struct exynos5_usbdrd_phy *phy_drd
phy_drd->reg_pma + EXYNOS9_PMA_USBDP_TRSV_REG03C3,
reg, (reg & locked) == locked, sleep_us, timeout_us);
if (!err)
- return;
+ return 0;
dev_err(phy_drd->dev,
"timed out waiting for CDR lock (l0): %#.8x, retrying\n", reg);
@@ -715,9 +717,11 @@ exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lock(struct exynos5_usbdrd_phy *phy_drd
if (err)
dev_err(phy_drd->dev,
"timed out waiting for CDR lock (l2): %#.8x\n", reg);
+
+ return err;
}
-static void exynos5_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
+static int exynos5_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
{
u32 reg;
@@ -739,6 +743,8 @@ static void exynos5_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
reg = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYTEST);
reg &= ~PHYTEST_POWERDOWN_HSP;
writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYTEST);
+
+ return 0;
}
static int exynos5_usbdrd_phy_init(struct phy *phy)
@@ -775,7 +781,9 @@ static int exynos5_usbdrd_phy_init(struct phy *phy)
writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYUTMICLKSEL);
/* UTMI or PIPE3 specific init */
- inst->phy_cfg->phy_init(phy_drd);
+ ret = inst->phy_cfg->phy_init(phy_drd);
+ if (ret)
+ goto disable_clks;
/* reference clock settings */
reg = inst->phy_cfg->set_refclk(inst);
@@ -798,9 +806,10 @@ static int exynos5_usbdrd_phy_init(struct phy *phy)
reg &= ~PHYCLKRST_PORTRESET;
writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYCLKRST);
+disable_clks:
clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks);
- return 0;
+ return ret;
}
static int exynos5_usbdrd_phy_exit(struct phy *phy)
@@ -1067,7 +1076,7 @@ exynos5_usbdrd_usb_v3p1_pipe_override(struct exynos5_usbdrd_phy *phy_drd)
writel(reg, regs_base + EXYNOS850_DRD_SECPMACTL);
}
-static void exynos850_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
+static int exynos850_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
{
void __iomem *regs_base = phy_drd->reg_phy;
u32 reg;
@@ -1171,6 +1180,8 @@ static void exynos850_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
if (ss_ports)
exynos5_usbdrd_usb_v3p1_pipe_override(phy_drd);
+
+ return 0;
}
static int exynos850_usbdrd_phy_init(struct phy *phy)
@@ -1184,11 +1195,11 @@ static int exynos850_usbdrd_phy_init(struct phy *phy)
return ret;
/* UTMI or PIPE3 specific init */
- inst->phy_cfg->phy_init(phy_drd);
+ ret = inst->phy_cfg->phy_init(phy_drd);
clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks);
- return 0;
+ return ret;
}
static int exynos850_usbdrd_phy_exit(struct phy *phy)
@@ -1235,11 +1246,12 @@ static const struct phy_ops exynos850_usbdrd_phy_ops = {
.owner = THIS_MODULE,
};
-static void exynos5_usbdrd_gs101_pipe3_init(struct exynos5_usbdrd_phy *phy_drd)
+static int exynos5_usbdrd_gs101_pipe3_init(struct exynos5_usbdrd_phy *phy_drd)
{
void __iomem *regs_pma = phy_drd->reg_pma;
void __iomem *regs_phy = phy_drd->reg_phy;
u32 reg;
+ int ret;
exynos5_usbdrd_usbdp_g2_v4_ctrl_pma_ready(phy_drd);
@@ -1261,8 +1273,11 @@ static void exynos5_usbdrd_gs101_pipe3_init(struct exynos5_usbdrd_phy *phy_drd)
SECPMACTL_PMA_INIT_SW_RST);
writel(reg, regs_phy + EXYNOS850_DRD_SECPMACTL);
- if (!exynos5_usbdrd_usbdp_g2_v4_pma_check_pll_lock(phy_drd))
- exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lock(phy_drd);
+ ret = exynos5_usbdrd_usbdp_g2_v4_pma_check_pll_lock(phy_drd);
+ if (ret)
+ return ret;
+
+ return exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lock(phy_drd);
}
static int exynos5_usbdrd_gs101_phy_init(struct phy *phy)
@@ -1287,7 +1302,15 @@ static int exynos5_usbdrd_gs101_phy_init(struct phy *phy)
*/
exynos5_usbdrd_phy_isol(inst, false);
- return exynos850_usbdrd_phy_init(phy);
+ ret = exynos850_usbdrd_phy_init(phy);
+ if (ret) {
+ exynos5_usbdrd_phy_isol(inst, true);
+ if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI)
+ regulator_bulk_disable(phy_drd->drv_data->n_regulators,
+ phy_drd->regulators);
+ }
+
+ return ret;
}
static int exynos5_usbdrd_gs101_phy_exit(struct phy *phy)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 405/816] cxl/hdm: Restore commit_end when decoder enumeration fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (403 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 404/816] phy: samsung: usbdrd: propagate GS101 PIPE3 lock failures Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 406/816] cxl/port: Bound switch decoder target array access by nr_targets Greg Kroah-Hartman
` (415 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jonathan Cameron, Dave Jiang,
Li Ming, Richard Cheng, Alison Schofield, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alison Schofield <alison.schofield@intel.com>
[ Upstream commit 7dae18c39e99813461db6ef3fc13f077452109ce ]
commit_end tracks the highest committed decoder on a port. It gets
advanced before decoder enumeration is complete, so a later failure
leaves it pointing at a decoder that was never added. The next probe
then rejects decoder0 as out of order and enumeration fails.
Reset commit_end to the uncommitted baseline once the decoders are
torn down, so a subsequent probe rebuilds it from scratch. Register
the reset before the decoders are added so that on unwind it runs
after every decoder has been unregistered. This prevents commit_end
from dropping below the highest committed decoder still registered and
exposing an inconsistent value to a concurrent reader.
Protect the commit_end advance in the DVSEC emulation path against
concurrent readers, matching the register-programmed path.
Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware")
Fixes: b777e9bec960 ("cxl/hdm: Emulate HDM decoder from DVSEC range registers")
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/4802c5abc906b858a4754bfc4fa3e4c2c455d0c3.1786143520.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: Replaced cxl_rwsem.region with the standalone cxl_region_rwsem lock in the two new write-guard sites, since the newer lock struct doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/hdm.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 24873dbb900c0..6fc4068d2566f 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -808,7 +808,8 @@ static int cxl_setup_hdm_decoder_from_dvsec(
* change the range registers at run time.
*/
cxld->flags |= CXL_DECODER_F_ENABLE | CXL_DECODER_F_LOCK;
- port->commit_end = cxld->id;
+ scoped_guard(rwsem_write, &cxl_region_rwsem)
+ port->commit_end = cxld->id;
rc = devm_cxl_dpa_reserve(cxled, *dpa_base, len, 0);
if (rc) {
@@ -1011,6 +1012,14 @@ static void cxl_settle_decoders(struct cxl_hdm *cxlhdm)
msleep(20);
}
+static void cxl_reset_commit_end(void *data)
+{
+ struct cxl_port *port = data;
+
+ guard(rwsem_write)(&cxl_region_rwsem);
+ port->commit_end = -1;
+}
+
/**
* devm_cxl_enumerate_decoders - add decoder objects per HDM register set
* @cxlhdm: Structure to populate with HDM capabilities
@@ -1021,8 +1030,8 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
{
void __iomem *hdm = cxlhdm->regs.hdm_decoder;
struct cxl_port *port = cxlhdm->port;
- int i;
u64 dpa_base = 0;
+ int i, rc;
/*
* Per CXL 4.0 8.2.4.20.1 Target Count is the number of target ports
@@ -1038,8 +1047,16 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
cxl_settle_decoders(cxlhdm);
+ /*
+ * Reset commit_end after all decoders have been torn down so a
+ * subsequent probe rebuilds it from scratch.
+ */
+ rc = devm_add_action(&port->dev, cxl_reset_commit_end, port);
+ if (rc)
+ return rc;
+
for (i = 0; i < cxlhdm->decoder_count; i++) {
- int rc, target_count = cxlhdm->target_count;
+ int target_count = cxlhdm->target_count;
struct cxl_decoder *cxld;
if (is_cxl_endpoint(port)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 406/816] cxl/port: Bound switch decoder target array access by nr_targets
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (404 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 405/816] cxl/hdm: Restore commit_end when decoder enumeration fails Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 407/816] ASoC: rt1015: make control calibration failures observable Greg Kroah-Hartman
` (414 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alison Schofield, Li Ming,
Dave Jiang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alison Schofield <alison.schofield@intel.com>
[ Upstream commit 4e42c398af136d62fac8c19c9f410ec83a8dd34a ]
Switch decoder target lookups walk the target array using interleave
ways as the bound. The array is allocated with nr_targets entries, so a
decoder whose interleave ways exceeds nr_targets reads and writes past
the end of it. That happens during dport activation, during decoder
target population, and when userspace reads the target_list attribute.
Bounding by nr_targets alone is not correct either. Commit d6488fee6647
("cxl/port: Fix decoder initialization when nr_targets > interleave_ways")
moved target population to interleave ways precisely so that targets a
decoder does not use are left unpopulated. Neither field alone is a safe
bound, so add a helper that returns the minimum of the two and use it at
every walk of the target array.
Valid configurations keep interleave ways within nr_targets, so this is
not a behavior change for them.
Fixes: 40ba17afdfab ("cxl/acpi: Introduce cxl_decoder objects")
Fixes: d6488fee6647 ("cxl/port: Fix decoder initialization when nr_targets > interleave_ways")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Link: https://patch.msgid.link/d7577652cc6d414e1de0ee4045d4d6b2808172ce.1786143520.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: Dropped the update_decoder_targets() hunk since that function doesn't exist here, and used cxl_region_rwsem in place of cxl_rwsem.region for the locking context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/port.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index e78f8ebe50e81..56a4f0e14b33f 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -144,20 +144,29 @@ static ssize_t target_type_show(struct device *dev,
}
static DEVICE_ATTR_RO(target_type);
+/*
+ * Interleave ways selects how many targets a decoder uses, but the target
+ * array is only nr_targets long. Bound array access by both.
+ */
+static int cxlsd_nr_used_targets(struct cxl_switch_decoder *cxlsd)
+{
+ return min(cxlsd->cxld.interleave_ways, cxlsd->nr_targets);
+}
+
static ssize_t emit_target_list(struct cxl_switch_decoder *cxlsd, char *buf)
{
- struct cxl_decoder *cxld = &cxlsd->cxld;
+ int nr_used = cxlsd_nr_used_targets(cxlsd);
ssize_t offset = 0;
int i, rc = 0;
- for (i = 0; i < cxld->interleave_ways; i++) {
+ for (i = 0; i < nr_used; i++) {
struct cxl_dport *dport = cxlsd->target[i];
struct cxl_dport *next = NULL;
if (!dport)
break;
- if (i + 1 < cxld->interleave_ways)
+ if (i + 1 < nr_used)
next = cxlsd->target[i + 1];
rc = sysfs_emit_at(buf, offset, "%d%s", dport->port_id,
next ? "," : "");
@@ -1718,7 +1727,7 @@ static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
struct cxl_port *port)
{
struct cxl_decoder *cxld = &cxlsd->cxld;
- int i;
+ int i, nr_used;
device_lock_assert(&port->dev);
@@ -1726,7 +1735,8 @@ static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
return -EINVAL;
guard(rwsem_write)(&cxl_region_rwsem);
- for (i = 0; i < cxlsd->cxld.interleave_ways; i++) {
+ nr_used = cxlsd_nr_used_targets(cxlsd);
+ for (i = 0; i < nr_used; i++) {
struct cxl_dport *dport = find_dport(port, cxld->target_map[i]);
if (!dport)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 407/816] ASoC: rt1015: make control calibration failures observable
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (405 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 406/816] cxl/port: Bound switch decoder target array access by nr_targets Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 408/816] kernfs: dont repeat or skip an entry when readdir resumes Greg Kroah-Hartman
` (413 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 98fe8aab04cec6fcadeb10a757235225d550be36 ]
The bypass-boost control runs a hardware calibration while bypassing the
register cache. It ignores every register access and cache restore
failure, then publishes both the requested mode and calibration
completion.
Return failures from the complete calibration sequence, always restore
normal cache operation and unlock DAPM, and only publish the control
state after the calibration and final mode write both succeed. The mixer
control callback is an effective error consumer, independent of deferred
component resume.
Fixes: da145172b236 ("ASoC: rt1015: Fix DC calibration on bypass boost mode")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260830142118.36668-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Replaced the snd_soc_component_to_dapm() local dapm with &component->dapm in the DAPM mutex lock/unlock calls, since that helper is missing here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1015.c | 81 +++++++++++++++++++++++++++++++--------
1 file changed, 65 insertions(+), 16 deletions(-)
diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c
index 0f806dde9c39c..02052bdbf5aec 100644
--- a/sound/soc/codecs/rt1015.c
+++ b/sound/soc/codecs/rt1015.c
@@ -491,34 +491,71 @@ static int rt1015_bypass_boost_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static void rt1015_calibrate(struct rt1015_priv *rt1015)
+static int rt1015_calibrate(struct rt1015_priv *rt1015)
{
struct snd_soc_component *component = rt1015->component;
struct regmap *regmap = rt1015->regmap;
+ int ret, sync_ret;
snd_soc_dapm_mutex_lock(&component->dapm);
regcache_cache_bypass(regmap, true);
- regmap_write(regmap, RT1015_CLK_DET, 0x0000);
- regmap_write(regmap, RT1015_PWR4, 0x00B2);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0009);
+ ret = regmap_write(regmap, RT1015_CLK_DET, 0x0000);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_PWR4, 0x00B2);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0009);
+ if (ret)
+ goto restore_cache;
+
msleep(100);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000A);
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000A);
+ if (ret)
+ goto restore_cache;
+
msleep(100);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000C);
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000C);
+ if (ret)
+ goto restore_cache;
+
msleep(100);
- regmap_write(regmap, RT1015_CLSD_INTERNAL8, 0x2028);
- regmap_write(regmap, RT1015_CLSD_INTERNAL9, 0x0140);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000D);
+ ret = regmap_write(regmap, RT1015_CLSD_INTERNAL8, 0x2028);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_CLSD_INTERNAL9, 0x0140);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x000D);
+ if (ret)
+ goto restore_cache;
+
msleep(300);
- regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008);
- regmap_write(regmap, RT1015_SYS_RST1, 0x05F5);
- regmap_write(regmap, RT1015_CLK_DET, 0x8000);
+ ret = regmap_write(regmap, RT1015_PWR_STATE_CTRL, 0x0008);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_SYS_RST1, 0x05F5);
+ if (ret)
+ goto restore_cache;
+
+ ret = regmap_write(regmap, RT1015_CLK_DET, 0x8000);
+
+restore_cache:
regcache_cache_bypass(regmap, false);
regcache_mark_dirty(regmap);
- regcache_sync(regmap);
+ sync_ret = regcache_sync(regmap);
+ if (!ret)
+ ret = sync_ret;
snd_soc_dapm_mutex_unlock(&component->dapm);
+
+ return ret;
}
static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
@@ -528,6 +565,8 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
snd_soc_kcontrol_component(kcontrol);
struct rt1015_priv *rt1015 =
snd_soc_component_get_drvdata(component);
+ int bypass_boost = rt1015->bypass_boost;
+ int ret;
if (rt1015->dac_is_used) {
dev_err(component->dev, "DAC is being used!\n");
@@ -537,13 +576,23 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol,
rt1015->bypass_boost = ucontrol->value.integer.value[0];
if (rt1015->bypass_boost == RT1015_Bypass_Boost &&
!rt1015->cali_done) {
- rt1015_calibrate(rt1015);
- rt1015->cali_done = 1;
+ ret = rt1015_calibrate(rt1015);
+ if (ret)
+ goto restore_boost;
+
+ ret = regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL,
+ 0x0010);
+ if (ret)
+ goto restore_boost;
- regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010);
+ rt1015->cali_done = 1;
}
return 0;
+
+restore_boost:
+ rt1015->bypass_boost = bypass_boost;
+ return ret;
}
static const char * const rt1015_dac_output_vol_select[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 408/816] kernfs: dont repeat or skip an entry when readdir resumes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (406 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 407/816] ASoC: rt1015: make control calibration failures observable Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 409/816] ASoC: SOF: amd: fix amd_sof_acp_remove() teardown ordering Greg Kroah-Hartman
` (412 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Shakeel Butt,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shakeel Butt <shakeel.butt@linux.dev>
[ Upstream commit 5ebcb578adeec7407dd501108ab2f423ca8e3e55 ]
readdir keeps its place as a name hash in ctx->pos and pins the entry in
file->private_data. If that entry is gone when the listing comes back,
kernfs_dir_pos() searches the rbtree for the hash and keeps whatever
node the descent stopped on. That is the entry before or after the
missing one, depending on the shape of the tree.
Landing before it repeats an entry the previous getdents(2) call already
reported. Landing after it, kernfs_dir_next_pos() calls rb_next() and
steps over an unreported entry.
With children A(10), B(20), C(30):
report A, ctx->pos = 10
A removed
kernfs_dir_next_pos(10, A)
A is gone, the search for 10 stops at B
rb_next(B) -> C, so B is never reported
Only the repeat happens today, between two getdents(2) calls. The skip
needs the pinned entry to go away inside one call, which the next patch
allows when it drops kernfs_rwsem around dir_emit().
Before the commit 4e4d6d860b93 the descent kept a node only on the way
left, which is a search for the first entry at or after the hash. That
commit moved the assignment to the top of the loop, where it runs on
right turns too. Restore that search, and step forward only when the
pinned entry is still there rather than when the hash matches, since two
entries in one directory can share a hash.
While here, kernfs_dir_next_pos() called the hash @ino. It is never an
inode number, so name it @hash.
Fixes: 4e4d6d860b93 ("sysfs: Add s_hash to sysfs_dirent and order directory entries by hash")
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20260911182815.1992483-2-shakeel.butt@linux.dev
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Adapted to the older base by using const void *ns, direct pos->parent and pos->name access, and dropping the ns_id comparisons that don't exist there. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/kernfs/dir.c | 38 ++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index c9ba69bc48730..f74dc32f9d3a1 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -1796,27 +1796,42 @@ static int kernfs_dir_fop_release(struct inode *inode, struct file *filp)
return 0;
}
+/*
+ * Find where a listing left off. @resumed says whether @pos is still that
+ * entry; if not, the first entry at or after @hash is returned instead.
+ */
static struct kernfs_node *kernfs_dir_pos(const void *ns,
- struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos)
+ struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos,
+ bool *resumed)
{
+ if (resumed)
+ *resumed = false;
if (pos) {
int valid = kernfs_active(pos) &&
pos->parent == parent && hash == pos->hash;
kernfs_put(pos);
if (!valid)
pos = NULL;
+ else if (resumed)
+ *resumed = true;
}
if (!pos && (hash > 1) && (hash < INT_MAX)) {
struct rb_node *node = parent->dir.children.rb_node;
+
+ /*
+ * Keep a node only on the way left, so the search ends on the
+ * first entry at or after @hash. The empty name sorts before
+ * every entry sharing the hash, so it lands on the first.
+ */
while (node) {
- pos = rb_to_kn(node);
+ struct kernfs_node *kn = rb_to_kn(node);
- if (hash < pos->hash)
+ if (kernfs_name_compare(hash, "", ns, kn) < 0) {
+ pos = kn;
node = node->rb_left;
- else if (hash > pos->hash)
+ } else {
node = node->rb_right;
- else
- break;
+ }
}
}
/* Skip over entries which are dying/dead or in the wrong namespace */
@@ -1831,10 +1846,13 @@ static struct kernfs_node *kernfs_dir_pos(const void *ns,
}
static struct kernfs_node *kernfs_dir_next_pos(const void *ns,
- struct kernfs_node *parent, ino_t ino, struct kernfs_node *pos)
+ struct kernfs_node *parent, loff_t hash, struct kernfs_node *pos)
{
- pos = kernfs_dir_pos(ns, parent, ino, pos);
- if (pos) {
+ bool resumed;
+
+ pos = kernfs_dir_pos(ns, parent, hash, pos, &resumed);
+ /* Step over @pos only if it survived; two entries can share a hash. */
+ if (pos && resumed) {
do {
struct rb_node *node = rb_next(&pos->rb);
if (!node)
@@ -1863,7 +1881,7 @@ static int kernfs_fop_readdir(struct file *file, struct dir_context *ctx)
if (kernfs_ns_enabled(parent))
ns = kernfs_info(dentry->d_sb)->ns;
- for (pos = kernfs_dir_pos(ns, parent, ctx->pos, pos);
+ for (pos = kernfs_dir_pos(ns, parent, ctx->pos, pos, NULL);
pos;
pos = kernfs_dir_next_pos(ns, parent, ctx->pos, pos)) {
const char *name = pos->name;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 409/816] ASoC: SOF: amd: fix amd_sof_acp_remove() teardown ordering
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (407 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 408/816] kernfs: dont repeat or skip an entry when readdir resumes Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 410/816] ASoC: SOF: amd: fix amd_sof_acp_probe() error unwind ordering Greg Kroah-Hartman
` (411 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit db2167f2e3f72db64d01356cc9f2924d32fd5a51 ]
Call free_irq() before amd_sof_sdw_exit() in amd_sof_acp_remove().
amd_sof_sdw_exit() sets adata->sdw to NULL; if an IRQ fires between
that point and the subsequent free_irq(), acp_irq_handler() may
dereference the now-NULL pdev[] pointer, causing a use-after-free.
Fixes: d948218424bf ("ASoC: SOF: amd: add code for invoking soundwire manager helper functions")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20260910132251.1171943-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Context lines differ because the older tree still has the smn_dev pci_dev_put() at the top of amd_sof_acp_remove(); the free_irq()/amd_sof_sdw_exit() swap itself is identical. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/acp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index a2abcb6d090ce..919c7bc98bf2b 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -970,12 +970,12 @@ void amd_sof_acp_remove(struct snd_sof_dev *sdev)
if (adata->smn_dev)
pci_dev_put(adata->smn_dev);
- if (adata->sdw)
- amd_sof_sdw_exit(sdev);
-
if (sdev->ipc_irq)
free_irq(sdev->ipc_irq, sdev);
+ if (adata->sdw)
+ amd_sof_sdw_exit(sdev);
+
if (adata->dmic_dev)
platform_device_unregister(adata->dmic_dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 410/816] ASoC: SOF: amd: fix amd_sof_acp_probe() error unwind ordering
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (408 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 409/816] ASoC: SOF: amd: fix amd_sof_acp_remove() teardown ordering Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 411/816] cxl/cdat: Fix uninitialized stack use in bandwidth gathering Greg Kroah-Hartman
` (410 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vijendar Mukunda, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
[ Upstream commit b6aaef8ca8c305170de83e621c7e16d56731312a ]
Call amd_sof_sdw_exit() after free_irq() in the free_ipc_irq error
label of amd_sof_acp_probe(). Without this, an IRQ that fires between
sdw context teardown and free_irq() can dereference freed SoundWire
resources.
Fixes: d948218424bf ("ASoC: SOF: amd: add code for invoking soundwire manager helper functions")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://patch.msgid.link/20260910132251.1171943-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Moved the amd_sof_sdw_exit() call after free_irq() in the probe error path, with context adjusted for the extra free_smn_dev label in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/amd/acp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index 919c7bc98bf2b..3de1c700a5a9e 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -955,6 +955,8 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev)
free_ipc_irq:
free_irq(sdev->ipc_irq, sdev);
+ if (adata->sdw)
+ amd_sof_sdw_exit(sdev);
free_smn_dev:
pci_dev_put(adata->smn_dev);
unregister_dev:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 411/816] cxl/cdat: Fix uninitialized stack use in bandwidth gathering
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (409 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 410/816] ASoC: SOF: amd: fix amd_sof_acp_probe() error unwind ordering Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 412/816] cxl/region: Unregister the pmem region when the bridge is unbound Greg Kroah-Hartman
` (409 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixin Liu, Richard Cheng,
Dave Jiang, Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <kanie@linux.alibaba.com>
[ Upstream commit 97b74de26c81885a6447f5fe87641a2a136f8c7c ]
cxl_endpoint_gather_bandwidth() and cxl_switch_gather_bandwidth() declare
access_coordinate arrays on the stack and rely on their helpers to fill
them. The helpers assign only the bandwidth members, and the combine step
assigns even those only when both inputs are non-zero. The latency members
are summed from stack residue on every call, and the bandwidth members
keep that residue into the region access coordinate sysfs attributes when
the endpoint CDAT reports no bandwidth.
Zero initialize the arrays. Zero is the value this code already uses for
"not reported", so an unset member now reads back as unknown rather than as
a plausible number.
Found by code inspection. Tested on a QEMU CXL topology with two endpoints
sharing a switch upstream link and HMAT generic-port coordinates for the
host bridge, which the calculation requires to run at all: with temporary
printk at the combine sites, the unpatched kernel summed 0xfefefefe, the
CONFIG_INIT_STACK_ALL_PATTERN stack filler, into the latency members, while
the patched kernel reports the CDAT latency values there.
Fixes: a5ab0de0ebaa ("cxl: Calculate region bandwidth of targets with shared upstream link")
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Link: https://patch.msgid.link/20260831092216.540644-2-kanie@linux.alibaba.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: Kept the tree's existing kzalloc(sizeof(*res_xa), GFP_KERNEL) context line instead of upstream's kzalloc_obj, and applied the same = { } initializer changes. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/cdat.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c
index e9cd7939c407a..0bf7819e8a750 100644
--- a/drivers/cxl/core/cdat.c
+++ b/drivers/cxl/core/cdat.c
@@ -629,9 +629,9 @@ static int cxl_endpoint_gather_bandwidth(struct cxl_region *cxlr,
struct cxl_port *endpoint = to_cxl_port(cxled->cxld.dev.parent);
struct cxl_port *parent_port = to_cxl_port(endpoint->dev.parent);
struct cxl_port *gp_port = to_cxl_port(parent_port->dev.parent);
- struct access_coordinate pci_coord[ACCESS_COORDINATE_MAX];
- struct access_coordinate sw_coord[ACCESS_COORDINATE_MAX];
- struct access_coordinate ep_coord[ACCESS_COORDINATE_MAX];
+ struct access_coordinate pci_coord[ACCESS_COORDINATE_MAX] = { };
+ struct access_coordinate sw_coord[ACCESS_COORDINATE_MAX] = { };
+ struct access_coordinate ep_coord[ACCESS_COORDINATE_MAX] = { };
struct cxl_memdev *cxlmd = cxled_to_memdev(cxled);
struct cxl_dev_state *cxlds = cxlmd->cxlds;
struct pci_dev *pdev = to_pci_dev(cxlds->dev);
@@ -754,7 +754,7 @@ static struct xarray *cxl_switch_gather_bandwidth(struct cxl_region *cxlr,
{
struct xarray *res_xa __free(free_perf_xa) =
kzalloc(sizeof(*res_xa), GFP_KERNEL);
- struct access_coordinate coords[ACCESS_COORDINATE_MAX];
+ struct access_coordinate coords[ACCESS_COORDINATE_MAX] = { };
struct cxl_perf_ctx *ctx, *us_ctx;
unsigned long index, us_index;
int dev_count = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 412/816] cxl/region: Unregister the pmem region when the bridge is unbound
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (410 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 411/816] cxl/cdat: Fix uninitialized stack use in bandwidth gathering Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 413/816] drm/connector: hdmi: Handle reset() state allocation failure Greg Kroah-Hartman
` (408 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixin Liu, Richard Cheng, Li Ming,
Dave Jiang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <kanie@linux.alibaba.com>
[ Upstream commit bb26797c08d408ea7e8d3625045f0fe28714a425 ]
Removing cxl_acpi unbinds the nvdimm bridge before the regions it
serves. A region probe can therefore register its cxl_pmem_region and
only then find the bridge unbound, which leaves the new device with
nothing to remove it.
The orphan outlives the teardown and pins its region and its memdevs, so
a later cxl_acpi bind renumbers the root port, ports, endpoints,
decoders and the memdev.
Unregister the cxl_pmem_region when the bridge is unbound.
Found by code inspection. Racing a cxl_region bind against a cxl_acpi
unbind leaked a pmem_region device on 12 of 12 attempts, and none with
this patch.
Fixes: f17b558d6663 ("cxl/pmem: Refactor nvdimm device registration, delete the workqueue")
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260831061120.200790-1-kanie@linux.alibaba.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[ sashal: adjusted the patch to apply to devm_cxl_add_pmem_region() in core/region.c, since the separate region_pmem.c file doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/region.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index e1c9e121b7c64..87923ef92094a 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -3170,12 +3170,14 @@ static int devm_cxl_add_pmem_region(struct cxl_region *cxlr)
dev_name(dev));
scoped_guard(device, &cxl_nvb->dev) {
- if (cxl_nvb->dev.driver)
+ if (cxl_nvb->dev.driver) {
rc = devm_add_action_or_reset(&cxl_nvb->dev,
cxlr_pmem_unregister,
cxlr_pmem);
- else
+ } else {
rc = -ENXIO;
+ cxlr_pmem_unregister(cxlr_pmem);
+ }
}
if (rc)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 413/816] drm/connector: hdmi: Handle reset() state allocation failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (411 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 412/816] cxl/region: Unregister the pmem region when the bridge is unbound Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 414/816] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt Greg Kroah-Hartman
` (407 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Maxime Ripard,
Robin Räber, Cristian Ciocaltea, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
[ Upstream commit 54acd0c74eba2a2c9a726856f5fdc6f9e74ea2e1 ]
In drmm_connector_hdmi_init(), if the reset callback fails to allocate
memory, e.g. inside drm_atomic_helper_connector_reset(),
connector->state will remain NULL. This is unconditionally passed to
drm_connector_attach_max_bpc_property(), leading to a NULL pointer
dereference.
Bail out with -ENOMEM if the reset callback leaves connector->state
unset.
Fixes: aadb3e16b8f3 ("drm/connector: hdmi: Add output BPC to the connector state")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260723015306.C94241F000E9@smtp.kernel.org/
Link: https://lore.kernel.org/all/20260723015306.C94241F000E9@smtp.kernel.org/
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Igor Paunovic <royalnet026@gmail.com> # RK3588 Orange Pi 5 Plus, dual HDMI
Tested-by: Robin Räber <robin.raebi@gmail.com>
Link: https://patch.msgid.link/20260901-dw-hdmi-qp-scramb-v11-2-bc12954a0688@collabora.com
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
[ sashal: Added a NULL check after reset() returning -ENOMEM, with braces added around the single reset() call because the older code lacks the newer state-allocation structure. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_connector.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 6c1a49fe9fc66..8814c9b6907a3 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -526,8 +526,11 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
* drm_connector_attach_max_bpc_property() requires the
* connector to have a state.
*/
- if (connector->funcs->reset)
+ if (connector->funcs->reset) {
connector->funcs->reset(connector);
+ if (!connector->state)
+ return -ENOMEM;
+ }
drm_connector_attach_max_bpc_property(connector, 8, max_bpc);
connector->max_bpc = max_bpc;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 414/816] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (412 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 413/816] drm/connector: hdmi: Handle reset() state allocation failure Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 415/816] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() Greg Kroah-Hartman
` (406 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Hunter, Frank Li,
Alexandre Belloni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <adrian.hunter@intel.com>
[ Upstream commit 5fbd0790af9484c251341e3ba2ebbb2887c570c8 ]
INTR_IBI_READY indicates that one or more IBI Status Descriptors are
present in the IBI ring. After clearing interrupt status, the interrupt
handler processes only a single IBI even though additional IBIs may
already be queued.
The controller does not reassert INTR_IBI_READY solely because entries
remain in the ring after interrupt status has been cleared. Consequently,
the remaining IBIs are not processed until some later interrupt occurs,
and can accumulate if IBIs arrive more often than the interrupt handler
runs.
Process all IBIs that are pending when the handler runs: capture the IBI
enqueue pointer up front and continue until the dequeue pointer reaches
that position.
Fixes: 9ad9a52cce28 ("i3c/master: introduce the mipi-i3c-hci driver")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260920151248.46936-10-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[ sashal: Kept the tree's DBG() and the rh->lock around the IBI dequeue-pointer update, re-reading RING_OPERATION1 under the lock instead of writing back the cached value. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i3c/master/mipi-i3c-hci/dma.c | 40 +++++++++++++++++----------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c
index d61d88b3a47a6..90bc62bacbebe 100644
--- a/drivers/i3c/master/mipi-i3c-hci/dma.c
+++ b/drivers/i3c/master/mipi-i3c-hci/dma.c
@@ -603,24 +603,23 @@ static void hci_dma_recycle_ibi_slot(struct i3c_hci *hci,
i3c_generic_ibi_recycle_slot(dev_ibi->pool, slot);
}
-static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
+static bool hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh,
+ u32 *op1_val, unsigned int enq_ptr)
{
struct i3c_dev_desc *dev;
struct i3c_hci_dev_data *dev_data;
struct hci_dma_dev_ibi_data *dev_ibi;
struct i3c_ibi_slot *slot;
- u32 op1_val, op2_val, ibi_status_error;
- unsigned int ptr, enq_ptr, deq_ptr;
+ u32 ibi_status_error;
+ unsigned int ptr, deq_ptr;
unsigned int ibi_size, ibi_chunks, ibi_data_offset, first_part;
int ibi_addr, last_ptr;
void *ring_ibi_data;
dma_addr_t ring_ibi_data_dma;
- op1_val = rh_reg_read(RING_OPERATION1);
- deq_ptr = FIELD_GET(RING_OP1_IBI_DEQ_PTR, op1_val);
-
- op2_val = rh_reg_read(RING_OPERATION2);
- enq_ptr = FIELD_GET(RING_OP2_IBI_ENQ_PTR, op2_val);
+ deq_ptr = FIELD_GET(RING_OP1_IBI_DEQ_PTR, *op1_val);
+ if (deq_ptr == enq_ptr)
+ return false;
ibi_status_error = 0;
ibi_addr = -1;
@@ -668,7 +667,7 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
if (last_ptr == -1) {
/* this IBI sequence is not yet complete */
DBG("no LAST_STATUS available (e=%d d=%d)", enq_ptr, deq_ptr);
- return;
+ return false;
}
deq_ptr = last_ptr + 1;
deq_ptr %= rh->ibi_status_entries;
@@ -741,10 +740,10 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
done:
/* take care to update the ibi dequeue pointer atomically */
spin_lock(&rh->lock);
- op1_val = rh_reg_read(RING_OPERATION1);
- op1_val &= ~RING_OP1_IBI_DEQ_PTR;
- op1_val |= FIELD_PREP(RING_OP1_IBI_DEQ_PTR, deq_ptr);
- rh_reg_write(RING_OPERATION1, op1_val);
+ *op1_val = rh_reg_read(RING_OPERATION1);
+ *op1_val &= ~RING_OP1_IBI_DEQ_PTR;
+ *op1_val |= FIELD_PREP(RING_OP1_IBI_DEQ_PTR, deq_ptr);
+ rh_reg_write(RING_OPERATION1, *op1_val);
spin_unlock(&rh->lock);
/* update the chunk pointer */
@@ -753,6 +752,19 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
/* and tell the hardware about freed chunks */
rh_reg_write(CHUNK_CONTROL, rh_reg_read(CHUNK_CONTROL) + ibi_chunks);
+
+ return true;
+}
+
+static void hci_dma_drain_ibi_ring(struct i3c_hci *hci, struct hci_rh_data *rh)
+{
+ u32 op1_val = rh_reg_read(RING_OPERATION1);
+ u32 op2_val = rh_reg_read(RING_OPERATION2);
+ unsigned int enq_ptr = FIELD_GET(RING_OP2_IBI_ENQ_PTR, op2_val);
+
+ /* Loop is bounded by enq_ptr. Further IBIs will re-assert INTR_IBI_READY */
+ while (hci_dma_process_ibi(hci, rh, &op1_val, enq_ptr))
+ ;
}
static bool hci_dma_irq_handler(struct i3c_hci *hci, unsigned int mask)
@@ -777,7 +789,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci, unsigned int mask)
rh_reg_write(INTR_STATUS, status);
if (status & INTR_IBI_READY)
- hci_dma_process_ibi(hci, rh);
+ hci_dma_drain_ibi_ring(hci, rh);
if (status & (INTR_TRANSFER_COMPLETION | INTR_TRANSFER_ERR))
hci_dma_xfer_done(hci, rh);
if (status & INTR_RING_OP)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 415/816] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (413 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 414/816] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 416/816] wifi: rtl8xxxu: unwind incomplete receive startup Greg Kroah-Hartman
` (405 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrew Morton, David Hildenbrand,
Jason Gunthorpe, John Hubbard, Peter Xu, Lance Yang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit da01399b90a73cd00b502f7903fa5acbfac4a103 ]
The !CONFIG_MMU implementation of __get_user_pages_locked() takes a bare
get_page() reference for each page regardless of foll_flags:
if (pages[i])
get_page(pages[i]);
This is reached from pin_user_pages*() with FOLL_PIN set.
unpin_user_page() is shared between MMU and NOMMU configurations and
unconditionally calls gup_put_folio(..., FOLL_PIN), which subtracts
GUP_PIN_COUNTING_BIAS (1024) from the folio refcount.
This means that pin adds 1, and then unpin will subtract 1024.
If a user maps a page (refcount 1), registers it 1023 times as an
io_uring fixed buffer (1023 pin_user_pages calls -> refcount 1024), then
unregisters: the first unpin_user_page subtracts 1024, refcount hits 0,
the page is freed and returned to the buddy allocator. The remaining
1022 unpins write into whatever was reallocated, and the user's VMA
still maps the freed page (NOMMU has no MMU to invalidate it).
Reallocating the page for an io_uring pbuf_ring then lets userspace
corrupt the new owner's data through the stale mapping.
Use try_grab_folio() which adds GUP_PIN_COUNTING_BIAS for FOLL_PIN and 1
for FOLL_GET, mirroring the CONFIG_MMU path so pin and unpin are
symmetric. Keep supporting the traditional behavior where users specify
a pages array but don't set FOLL_GET.
While at it, don't return NULL pointers in the page array,
as this is really not expected for GUP users; instead, just fail and return
-EFAULT.
[ david: support traditional behavior with no FOLL_GET, extend
description ]
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Lance Yang <lance.yang@linux.dev>
Reported-by: Anthropic
Fixes: 3faa52c03f44 ("mm/gup: track FOLL_PIN pages")
Assisted-by: gkh_clanker_t1000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Lance Yang <lance.yang@linux.dev>
Link: https://patch.msgid.link/20260921-nommu_gup_pin-v4-1-c410041cc479@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Kept unsigned long vm_flags; in the declaration context instead of upstream's vm_flags_t vm_flags;, since this branch never got the typedef conversion, and added the new int ret, err = -EFAULT; below it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/gup.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/mm/gup.c b/mm/gup.c
index d9107eb461a02..01a6408055102 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2058,6 +2058,7 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
struct vm_area_struct *vma;
bool must_unlock = false;
unsigned long vm_flags;
+ int ret, err = -EFAULT;
long i;
if (!nr_pages)
@@ -2074,6 +2075,10 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
*locked = 1;
}
+ /* See the MMU variant: support the traditional behavior. */
+ if (pages && !(foll_flags & FOLL_PIN))
+ foll_flags |= FOLL_GET;
+
/* calculate required read or write permissions.
* If FOLL_FORCE is set, we only require the "MAY" flags.
*/
@@ -2094,8 +2099,14 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
if (pages) {
pages[i] = virt_to_page((void *)start);
- if (pages[i])
- get_page(pages[i]);
+ if (!pages[i])
+ break;
+ ret = try_grab_folio(page_folio(pages[i]), 1, foll_flags);
+ if (unlikely(ret)) {
+ pages[i] = NULL;
+ err = ret;
+ break;
+ }
}
start = (start + PAGE_SIZE) & PAGE_MASK;
@@ -2106,7 +2117,7 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start,
*locked = 0;
}
- return i ? : -EFAULT;
+ return i ? : err;
}
#endif /* !CONFIG_MMU */
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 416/816] wifi: rtl8xxxu: unwind incomplete receive startup
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (414 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 415/816] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 417/816] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors Greg Kroah-Hartman
` (404 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ping-Ke Shih, Kim Wooseok,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kim Wooseok <5mghybrid@khu.ac.kr>
[ Upstream commit 4c58fb8944a2cfbe5506534de0cf58646408d31a ]
rtl8xxxu_start() allocates and submits RX URBs one at a time. If a later
allocation fails, the error path frees the TX pool but leaves earlier RX
requests active. A partial TX or RX allocation failure can also leave
ret at zero, so start reports success despite the incomplete setup.
Allocate the RX pool before submitting any of it, and return ENOMEM
whenever a pool allocation fails. Pass start errors through
rtl8xxxu_stop(), including interrupt URB submission failures, so the
existing stop path cancels work and releases both active requests and
partially allocated pools.
Share the submission loop with the RX worker. Both callers keep requests
that fail with ENOMEM/EAGAIN. For a fatal error during startup, free the
rest of the unsubmitted batch and return the error so start can unwind.
In the worker, free only the failed request and continue with the rest
of the batch.
Keep the allocation loop in a small helper so the setup and error paths
in start remain easy to follow.
On an RTL8192EU, I exercised every error exit in rtl8xxxu_start()
except interrupt-URB allocation and submission failures, which this
adapter does not use.
Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
Assisted-by: GPT-6 Astra
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260921-codex-rtl-rx-v3-submit-v4-2-eeb09fe8f791@khu.ac.kr
[ sashal: Replaced kmalloc_obj(struct X) with kmalloc(sizeof(struct X), GFP_KERNEL) at three sites, and adjusted hunk context for line offsets. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/realtek/rtl8xxxu/core.c | 96 +++++++++++---------
1 file changed, 54 insertions(+), 42 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c
index cce0aae3d103d..d9ef95f08911f 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
@@ -61,6 +61,7 @@ MODULE_PARM_DESC(dma_agg_pages, "Set DMA aggregation pages (range 1-127, 0 to di
#define RTL8XXXU_TX_URB_LOW_WATER 25
#define RTL8XXXU_TX_URB_HIGH_WATER 32
+static void rtl8xxxu_stop(struct ieee80211_hw *hw, bool suspend);
static int rtl8xxxu_submit_rx_urb(struct rtl8xxxu_priv *priv,
struct rtl8xxxu_rx_urb *rx_urb);
@@ -5858,6 +5859,28 @@ static void rtl8xxxu_free_rx_resources(struct rtl8xxxu_priv *priv)
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
}
+static int rtl8xxxu_alloc_rx_urbs(struct rtl8xxxu_priv *priv)
+{
+ struct rtl8xxxu_rx_urb *rx_urb;
+ int i;
+
+ /* No RX work is active until the complete pool has been allocated. */
+ for (i = 0; i < RTL8XXXU_RX_URBS; i++) {
+ rx_urb = kmalloc(sizeof(struct rtl8xxxu_rx_urb), GFP_KERNEL);
+ if (!rx_urb)
+ return -ENOMEM;
+
+ usb_init_urb(&rx_urb->urb);
+ INIT_LIST_HEAD(&rx_urb->list);
+ rx_urb->hw = priv->hw;
+
+ list_add_tail(&rx_urb->list, &priv->rx_urb_pending_list);
+ priv->rx_urb_pending_count++;
+ }
+
+ return 0;
+}
+
static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
struct rtl8xxxu_rx_urb *rx_urb)
{
@@ -5885,32 +5908,21 @@ static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
}
-static void rtl8xxxu_rx_urb_work(struct work_struct *work)
+static int rtl8xxxu_submit_rx_urbs(struct rtl8xxxu_priv *priv, bool startup)
{
- struct rtl8xxxu_priv *priv;
struct rtl8xxxu_rx_urb *rx_urb, *tmp;
- struct list_head local;
unsigned long flags;
+ LIST_HEAD(local);
int ret;
- priv = container_of(work, struct rtl8xxxu_priv, rx_urb_wq);
- INIT_LIST_HEAD(&local);
-
spin_lock_irqsave(&priv->rx_urb_lock, flags);
-
list_splice_init(&priv->rx_urb_pending_list, &local);
priv->rx_urb_pending_count = 0;
-
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
list_for_each_entry_safe(rx_urb, tmp, &local, list) {
list_del_init(&rx_urb->list);
ret = rtl8xxxu_submit_rx_urb(priv, rx_urb);
- /*
- * If out of memory or temporary error, put it back on the
- * queue and try again. Otherwise the device is dead/gone
- * and we should drop it.
- */
switch (ret) {
case 0:
break;
@@ -5919,11 +5931,29 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)
rtl8xxxu_queue_rx_urb(priv, rx_urb);
break;
default:
+ usb_free_urb(&rx_urb->urb);
+ if (startup)
+ goto free_remaining;
dev_warn(&priv->udev->dev,
"failed to requeue urb with error %i\n", ret);
- usb_free_urb(&rx_urb->urb);
}
}
+
+ return 0;
+
+free_remaining:
+ list_for_each_entry_safe(rx_urb, tmp, &local, list) {
+ list_del(&rx_urb->list);
+ usb_free_urb(&rx_urb->urb);
+ }
+ return ret;
+}
+
+static void rtl8xxxu_rx_urb_work(struct work_struct *work)
+{
+ struct rtl8xxxu_priv *priv = container_of(work, struct rtl8xxxu_priv, rx_urb_wq);
+
+ rtl8xxxu_submit_rx_urbs(priv, false);
}
/*
@@ -7429,7 +7459,6 @@ static void rtl8xxxu_watchdog_callback(struct work_struct *work)
static int rtl8xxxu_start(struct ieee80211_hw *hw)
{
struct rtl8xxxu_priv *priv = hw->priv;
- struct rtl8xxxu_rx_urb *rx_urb;
struct rtl8xxxu_tx_urb *tx_urb;
unsigned long flags;
int ret, i;
@@ -7444,14 +7473,13 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
if (priv->usb_interrupts) {
ret = rtl8xxxu_submit_int_urb(hw);
if (ret)
- goto exit;
+ goto error_out;
}
for (i = 0; i < RTL8XXXU_TX_URBS; i++) {
tx_urb = kmalloc(sizeof(struct rtl8xxxu_tx_urb), GFP_KERNEL);
if (!tx_urb) {
- if (!i)
- ret = -ENOMEM;
+ ret = -ENOMEM;
goto error_out;
}
@@ -7462,31 +7490,21 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
priv->tx_urb_free_count++;
}
+ ret = rtl8xxxu_alloc_rx_urbs(priv);
+ if (ret)
+ goto error_out;
+
priv->tx_stopped = false;
spin_lock_irqsave(&priv->rx_urb_lock, flags);
priv->shutdown = false;
spin_unlock_irqrestore(&priv->rx_urb_lock, flags);
- for (i = 0; i < RTL8XXXU_RX_URBS; i++) {
- rx_urb = kmalloc(sizeof(struct rtl8xxxu_rx_urb), GFP_KERNEL);
- if (!rx_urb) {
- if (!i)
- ret = -ENOMEM;
-
- goto error_out;
- }
- usb_init_urb(&rx_urb->urb);
- INIT_LIST_HEAD(&rx_urb->list);
- rx_urb->hw = hw;
-
- ret = rtl8xxxu_submit_rx_urb(priv, rx_urb);
- if (ret)
- rtl8xxxu_queue_rx_urb(priv, rx_urb);
- }
+ ret = rtl8xxxu_submit_rx_urbs(priv, true);
+ if (ret)
+ goto error_out;
schedule_delayed_work(&priv->ra_watchdog, 2 * HZ);
-exit:
/*
* Accept all data and mgmt frames
*/
@@ -7499,13 +7517,7 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
return ret;
error_out:
- rtl8xxxu_free_tx_resources(priv);
- /*
- * Disable all data and mgmt frames
- */
- rtl8xxxu_write16(priv, REG_RXFLTMAP2, 0x0000);
- rtl8xxxu_write16(priv, REG_RXFLTMAP0, 0x0000);
-
+ rtl8xxxu_stop(hw, false);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 417/816] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (415 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 416/816] wifi: rtl8xxxu: unwind incomplete receive startup Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 418/816] crypto: qat - hold cfg->lock when accessing config sections Greg Kroah-Hartman
` (403 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kim Wooseok, Ping-Ke Shih,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kim Wooseok <5mghybrid@khu.ac.kr>
[ Upstream commit 2f77c66694108785a1f6ae6c5de06453e7f7a91f ]
rtl8xxxu resubmits completed RX requests when more than eight URBs are
waiting on the pending list. It starts with 32 URBs, but frees them on
completion errors. After enough errors, the remaining pool can no longer
reach the submission threshold. Reception then stays stopped even after
the errors end. Temporary submission failures can leave a small batch
waiting with no further work scheduled, too.
Keep the URB when a completion reports EPROTO, EILSEQ, ETIME, EOVERFLOW,
ECOMM or ENOSR. Free its receive buffer and return the request to the
same pending list used by normal completions. ENOMEM/EAGAIN from startup
or worker submission uses this path as well, so a submission failure
cannot strand a request during recovery.
Use one delayed work item to submit the pending requests. An error
queues a retry after 100 ms without moving an existing reservation back.
If a normal completion takes the pending count above eight,
mod_delayed_work(..., 0) brings the work forward. This limits repeated
retries when reception is not progressing, while allowing normal traffic
to replenish the pool promptly. The 100 ms delay is therefore not a
minimum wait for each failed URB.
Keep the shutdown check, queue insertion and scheduling under the RX
lock. Stop sets shutdown under that lock, cancels the delayed work
synchronously, then drains active and pending requests. Cancellation and
device removal continue to free their URBs.
Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
Assisted-by: GPT-6 Astra
Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260921-codex-rtl-rx-v3-submit-v4-3-eeb09fe8f791@khu.ac.kr
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/realtek/rtl8xxxu/core.c | 46 ++++++++++++-------
.../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 +-
2 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c
index d9ef95f08911f..e124519d77c09 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
@@ -57,6 +57,7 @@ MODULE_PARM_DESC(dma_agg_pages, "Set DMA aggregation pages (range 1-127, 0 to di
#define USB_VENDOR_ID_REALTEK 0x0bda
#define RTL8XXXU_RX_URBS 32
#define RTL8XXXU_RX_URB_PENDING_WATER 8
+#define RTL8XXXU_RX_URB_RETRY_DELAY_MS 100
#define RTL8XXXU_TX_URBS 64
#define RTL8XXXU_TX_URB_LOW_WATER 25
#define RTL8XXXU_TX_URB_HIGH_WATER 32
@@ -5882,9 +5883,8 @@ static int rtl8xxxu_alloc_rx_urbs(struct rtl8xxxu_priv *priv)
}
static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
- struct rtl8xxxu_rx_urb *rx_urb)
+ struct rtl8xxxu_rx_urb *rx_urb, bool defer_schedule)
{
- struct sk_buff *skb;
unsigned long flags;
spin_lock_irqsave(&priv->rx_urb_lock, flags);
@@ -5892,16 +5892,13 @@ static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,
if (!priv->shutdown) {
list_add_tail(&rx_urb->list, &priv->rx_urb_pending_list);
priv->rx_urb_pending_count++;
- /*
- * Arm the worker under rx_urb_lock so this is atomic with the
- * shutdown check: moving it out of the lock would let a
- * completion arm the work after rtl8xxxu_stop() canceled it.
- */
- if (priv->rx_urb_pending_count > RTL8XXXU_RX_URB_PENDING_WATER)
- schedule_work(&priv->rx_urb_wq);
+ /* Serialize scheduling with the shutdown check and cancellation. */
+ if (defer_schedule)
+ schedule_delayed_work(&priv->rx_urb_wq,
+ msecs_to_jiffies(RTL8XXXU_RX_URB_RETRY_DELAY_MS));
+ else if (priv->rx_urb_pending_count > RTL8XXXU_RX_URB_PENDING_WATER)
+ mod_delayed_work(system_percpu_wq, &priv->rx_urb_wq, 0);
} else {
- skb = (struct sk_buff *)rx_urb->urb.context;
- dev_kfree_skb_irq(skb);
usb_free_urb(&rx_urb->urb);
}
@@ -5928,7 +5925,7 @@ static int rtl8xxxu_submit_rx_urbs(struct rtl8xxxu_priv *priv, bool startup)
break;
case -ENOMEM:
case -EAGAIN:
- rtl8xxxu_queue_rx_urb(priv, rx_urb);
+ rtl8xxxu_queue_rx_urb(priv, rx_urb, true);
break;
default:
usb_free_urb(&rx_urb->urb);
@@ -5951,7 +5948,8 @@ static int rtl8xxxu_submit_rx_urbs(struct rtl8xxxu_priv *priv, bool startup)
static void rtl8xxxu_rx_urb_work(struct work_struct *work)
{
- struct rtl8xxxu_priv *priv = container_of(work, struct rtl8xxxu_priv, rx_urb_wq);
+ struct rtl8xxxu_priv *priv = container_of(to_delayed_work(work),
+ struct rtl8xxxu_priv, rx_urb_wq);
rtl8xxxu_submit_rx_urbs(priv, false);
}
@@ -6607,10 +6605,24 @@ static void rtl8xxxu_rx_complete(struct urb *urb)
skb = NULL;
rx_urb->urb.context = NULL;
- rtl8xxxu_queue_rx_urb(priv, rx_urb);
+ rtl8xxxu_queue_rx_urb(priv, rx_urb, false);
} else {
dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
- goto cleanup;
+
+ switch (urb->status) {
+ case -EPROTO:
+ case -EILSEQ:
+ case -ETIME:
+ case -EOVERFLOW:
+ case -ECOMM:
+ case -ENOSR:
+ dev_kfree_skb(skb);
+ urb->context = NULL;
+ rtl8xxxu_queue_rx_urb(priv, rx_urb, true);
+ return;
+ default:
+ goto cleanup;
+ }
}
return;
@@ -7540,7 +7552,7 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw, bool suspend)
* it drained via rtl8xxxu_submit_rx_urb(), so a worker still running
* after the kill could submit a URB that escapes it.
*/
- cancel_work_sync(&priv->rx_urb_wq);
+ cancel_delayed_work_sync(&priv->rx_urb_wq);
usb_kill_anchored_urbs(&priv->rx_anchor);
usb_kill_anchored_urbs(&priv->tx_anchor);
@@ -7853,7 +7865,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
spin_lock_init(&priv->tx_urb_lock);
INIT_LIST_HEAD(&priv->rx_urb_pending_list);
spin_lock_init(&priv->rx_urb_lock);
- INIT_WORK(&priv->rx_urb_wq, rtl8xxxu_rx_urb_work);
+ INIT_DELAYED_WORK(&priv->rx_urb_wq, rtl8xxxu_rx_urb_work);
INIT_DELAYED_WORK(&priv->ra_watchdog, rtl8xxxu_watchdog_callback);
INIT_DELAYED_WORK(&priv->update_beacon_work, rtl8xxxu_update_beacon_work_callback);
skb_queue_head_init(&priv->c2hcmd_queue);
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index f42463e595cc2..c6a4a58a92512 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -1803,7 +1803,7 @@ struct rtl8xxxu_priv {
struct list_head rx_urb_pending_list;
int rx_urb_pending_count;
bool shutdown;
- struct work_struct rx_urb_wq;
+ struct delayed_work rx_urb_wq;
u8 mac_addr[ETH_ALEN];
char chip_name[8];
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 418/816] crypto: qat - hold cfg->lock when accessing config sections
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (416 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 417/816] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 419/816] serial: sh-sci: Unregister UART on sysfs setup failure Greg Kroah-Hartman
` (402 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahsan Atta, Giovanni Cabiddu,
Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahsan Atta <ahsan.atta@intel.com>
[ Upstream commit cb3a1364fed9ea7b063e3ae026177a145abb5940 ]
adf_cfg_sec_find() walks the per-device section list without holding
cfg->lock, and the returned section pointer is used later under the
lock. A concurrent section deletion under cfg->lock
(adf_cfg_del_all_except() on device down, or adf_cfg_dev_remove() on
removal) can free the section first, leading to a use-after-free.
The debugfs dev_cfg reader has the same problem: qat_dev_cfg_show()
walks both the section list and each section's param_head under the
global qat_cfg_read_lock mutex, not the per-device cfg->lock used by the
add and delete paths, so the two do not serialise. Updating an existing
key frees the old key_val under cfg->lock, so even a config write
concurrent with an open dev_cfg read can free an entry mid-walk, a wider
window than section deletion alone.
Take cfg->lock around the section lookup in adf_cfg_add_key_value_param()
and around the lookup and insert in adf_cfg_section_add(), and use
down_read()/up_read(&cfg->lock) in the debugfs start/stop callbacks.
Remove the now-unused qat_cfg_read_lock.
While here, return -ENOENT rather than -EFAULT when the section is not
found; EFAULT (bad userspace address) is not meaningful for this case.
Fixes: d8cba25d2c68 ("crypto: qat - Intel(R) QAT driver framework")
Signed-off-by: Ahsan Atta <ahsan.atta@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ sashal: Used kzalloc(sizeof(*sec), GFP_KERNEL) and the three-argument strscpy instead of upstream's kzalloc_obj(*sec) and two-argument strscpy, since this branch lacks those helpers. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/intel/qat/qat_common/adf_cfg.c | 49 +++++++++++--------
1 file changed, 29 insertions(+), 20 deletions(-)
diff --git a/drivers/crypto/intel/qat/qat_common/adf_cfg.c b/drivers/crypto/intel/qat/qat_common/adf_cfg.c
index 97273da40b438..8db87e4e4824b 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_cfg.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_cfg.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
/* Copyright(c) 2014 - 2020 Intel Corporation */
-#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/seq_file.h>
@@ -8,13 +7,11 @@
#include "adf_cfg.h"
#include "adf_common_drv.h"
-static DEFINE_MUTEX(qat_cfg_read_lock);
-
static void *qat_dev_cfg_start(struct seq_file *sfile, loff_t *pos)
{
struct adf_cfg_device_data *dev_cfg = sfile->private;
- mutex_lock(&qat_cfg_read_lock);
+ down_read(&dev_cfg->lock);
return seq_list_start(&dev_cfg->sec_list, *pos);
}
@@ -42,7 +39,9 @@ static void *qat_dev_cfg_next(struct seq_file *sfile, void *v, loff_t *pos)
static void qat_dev_cfg_stop(struct seq_file *sfile, void *v)
{
- mutex_unlock(&qat_cfg_read_lock);
+ struct adf_cfg_device_data *dev_cfg = sfile->private;
+
+ up_read(&dev_cfg->lock);
}
static const struct seq_operations qat_dev_cfg_sops = {
@@ -271,13 +270,10 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev,
enum adf_cfg_val_type type)
{
struct adf_cfg_device_data *cfg = accel_dev->cfg;
+ struct adf_cfg_section *section;
struct adf_cfg_key_val *key_val;
- struct adf_cfg_section *section = adf_cfg_sec_find(accel_dev,
- section_name);
char temp_val[ADF_CFG_MAX_VAL_LEN_IN_BYTES];
-
- if (!section)
- return -EFAULT;
+ int ret = 0;
key_val = kzalloc(sizeof(*key_val), GFP_KERNEL);
if (!key_val)
@@ -310,20 +306,28 @@ int adf_cfg_add_key_value_param(struct adf_accel_dev *accel_dev,
* anything (the newly created key_val is freed).
*/
down_write(&cfg->lock);
+
+ section = adf_cfg_sec_find(accel_dev, section_name);
+ if (!section) {
+ kfree(key_val);
+ ret = -ENOENT;
+ goto unlock;
+ }
+
if (!adf_cfg_key_val_get(accel_dev, section_name, key, temp_val)) {
if (strncmp(temp_val, key_val->val, sizeof(temp_val))) {
adf_cfg_keyval_remove(key, section);
} else {
kfree(key_val);
- goto out;
+ goto unlock;
}
}
adf_cfg_keyval_add(key_val, section);
-out:
+unlock:
up_write(&cfg->lock);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(adf_cfg_add_key_value_param);
@@ -341,21 +345,26 @@ EXPORT_SYMBOL_GPL(adf_cfg_add_key_value_param);
int adf_cfg_section_add(struct adf_accel_dev *accel_dev, const char *name)
{
struct adf_cfg_device_data *cfg = accel_dev->cfg;
- struct adf_cfg_section *sec = adf_cfg_sec_find(accel_dev, name);
+ struct adf_cfg_section *sec;
+ int ret = 0;
- if (sec)
- return 0;
+ down_write(&cfg->lock);
+
+ if (adf_cfg_sec_find(accel_dev, name))
+ goto unlock;
sec = kzalloc(sizeof(*sec), GFP_KERNEL);
- if (!sec)
- return -ENOMEM;
+ if (!sec) {
+ ret = -ENOMEM;
+ goto unlock;
+ }
strscpy(sec->name, name, sizeof(sec->name));
INIT_LIST_HEAD(&sec->param_head);
- down_write(&cfg->lock);
list_add_tail(&sec->list, &cfg->sec_list);
+unlock:
up_write(&cfg->lock);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(adf_cfg_section_add);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 419/816] serial: sh-sci: Unregister UART on sysfs setup failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (417 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 418/816] crypto: qat - hold cfg->lock when accessing config sections Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 420/816] bpf: Keep target extended until its last freplace link detaches Greg Kroah-Hartman
` (401 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit c5b33c86d86da3ccff8c05e2a28719e3ec933f70 ]
sci_probe_single() registers the UART port before sci_probe() creates
the RX FIFO tuning attributes. If either device_create_file() call
fails, probe returns an error without removing the port from the serial
core. Device-managed resources are then released while the port remains
registered.
Unregister the UART port before returning either sysfs creation error.
If the second attribute fails, remove the first attribute before
unregistering the port. Keep the existing probe failure policy and leave
the successful initialization path unchanged.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260911031500.5745-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ sashal: Kept this tree's separate timeout-attribute block and its fifosize>1 cleanup condition, changing only the two error exits to goto the new err_remove_port label. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/sh-sci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index ae16800ef7d44..9cf20e81eed41 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3542,7 +3542,7 @@ static int sci_probe(struct platform_device *dev)
if (sp->port.fifosize > 1) {
ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_trigger);
if (ret)
- return ret;
+ goto err_remove_port;
}
if (sp->port.type == PORT_SCIFA || sp->port.type == PORT_SCIFB ||
sp->port.type == PORT_HSCIF) {
@@ -3552,7 +3552,7 @@ static int sci_probe(struct platform_device *dev)
device_remove_file(&dev->dev,
&dev_attr_rx_fifo_trigger);
}
- return ret;
+ goto err_remove_port;
}
}
@@ -3562,6 +3562,10 @@ static int sci_probe(struct platform_device *dev)
sci_ports_in_use |= BIT(dev_id);
return 0;
+
+err_remove_port:
+ uart_remove_one_port(&sci_uart_driver, &sp->port);
+ return ret;
}
static void sci_console_save(struct sci_port *s)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 420/816] bpf: Keep target extended until its last freplace link detaches
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (418 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 419/816] serial: sh-sci: Unregister UART on sysfs setup failure Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 421/816] bpf: Check fastcall stack contract once for all stack accesses Greg Kroah-Hartman
` (400 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Chen, Jiri Olsa,
Kumar Kartikeya Dwivedi, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuan Chen <chenyuan@kylinos.cn>
[ Upstream commit c43c348a84460b003fa757dd43d8c89848ae220d ]
The is_extended / prog_array_member_cnt protocol introduced by commit
d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace")
keeps a prog extended by a freplace program out of prog_array maps, and
vice versa: once a tail call re-enters an extended subprogram, its
tail_call_cnt resets on every execution and the loop never terminates.
But is_extended is a plain boolean, while one target prog can carry
several freplace links at the same time, one on its entry and one on a
global subprogram. __bpf_trampoline_unlink_prog() cleared is_extended
whenever *any* freplace link detached, so detaching one of two links
re-armed the unbounded loop through the remaining one.
Replace the is_extended boolean with a count of the freplace links
attached to each target prog, so the target stays extended until its
last link detaches. Also rename bpf_freplace_check_tgt_prog() to
bpf_freplace_link_tgt_prog(), as the helper has never been a pure
check: it reserves the target prog on success.
Fixes: d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace")
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20260924023737.1140521-2-chenyuan_fl@163.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[ sashal: adjusted bpf.h context for the older struct layout and changed bpf_tramp_node usage to the older bpf_tramp_link API in the trampoline context, with the changed lines identical. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/bpf.h | 4 ++--
kernel/bpf/arraymap.c | 2 +-
kernel/bpf/trampoline.c | 8 ++++----
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 16fe36438173a..59661363d08f6 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1513,10 +1513,9 @@ struct bpf_prog_aux {
bool xdp_has_frags;
bool exception_cb;
bool exception_boundary;
- bool is_extended; /* true if extended by freplace program */
bool changes_pkt_data;
u64 prog_array_member_cnt; /* counts how many times as member of prog_array */
- struct mutex ext_mutex; /* mutex for is_extended and prog_array_member_cnt */
+ struct mutex ext_mutex; /* mutex for freplace_link_cnt and prog_array_member_cnt */
struct bpf_arena *arena;
/* BTF_KIND_FUNC_PROTO for valid attach_btf_id */
const struct btf_type *attach_func_proto;
@@ -1544,6 +1543,7 @@ struct bpf_prog_aux {
struct bpf_map *cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE];
char name[BPF_OBJ_NAME_LEN];
u64 (*bpf_exception_cb)(u64 cookie, u64 sp, u64 bp, u64, u64);
+ u16 freplace_link_cnt; /* counts freplace links extending this prog */
#ifdef CONFIG_SECURITY
void *security;
#endif
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index fcc0ca7ee8831..5c70ff1e7d4ac 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -957,7 +957,7 @@ static void *prog_fd_array_get_ptr(struct bpf_map *map,
}
mutex_lock(&prog->aux->ext_mutex);
- is_extended = prog->aux->is_extended;
+ is_extended = prog->aux->freplace_link_cnt > 0;
if (!is_extended)
prog->aux->prog_array_member_cnt++;
mutex_unlock(&prog->aux->ext_mutex);
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index 76fdd4ee9225a..a85e6491fbd1b 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -532,7 +532,7 @@ static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog)
}
}
-static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog)
+static int bpf_freplace_link_tgt_prog(struct bpf_prog *tgt_prog)
{
struct bpf_prog_aux *aux = tgt_prog->aux;
@@ -546,7 +546,7 @@ static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog)
*/
return -EBUSY;
- aux->is_extended = true;
+ aux->freplace_link_cnt++;
return 0;
}
@@ -573,7 +573,7 @@ static int __bpf_trampoline_link_prog(struct bpf_tramp_link *link,
/* Cannot attach extension if fentry/fexit are in use. */
if (cnt)
return -EBUSY;
- err = bpf_freplace_check_tgt_prog(tgt_prog);
+ err = bpf_freplace_link_tgt_prog(tgt_prog);
if (err)
return err;
tr->extension_prog = link->link.prog;
@@ -628,7 +628,7 @@ static int __bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
tr->extension_prog->bpf_func, NULL);
tr->extension_prog = NULL;
guard(mutex)(&tgt_prog->aux->ext_mutex);
- tgt_prog->aux->is_extended = false;
+ tgt_prog->aux->freplace_link_cnt--;
return err;
}
hlist_del_init(&link->tramp_hlist);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 421/816] bpf: Check fastcall stack contract once for all stack accesses
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (419 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 420/816] bpf: Keep target extended until its last freplace link detaches Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 422/816] bpf: Look at frame 0 when telling async callback entries apart Greg Kroah-Hartman
` (399 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kumar Kartikeya Dwivedi,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[ Upstream commit ec3a69e7c021cd826be8886ba6af4ee3147788fb ]
When the verifier inlines a bpf_fastcall helper or kfunc, it removes the
spill/fill pairs that clang emitted around the call and lowers the
subprogram's stack depth so that their slots are no longer part of the
frame. This is only safe if nothing else accesses those slots or any slot
below them. check_fastcall_stack_contract() enforces this: an access to
that region from outside a fastcall pattern disables the rewrite for the
subprogram. It is called from the four stack load and store paths, and
two kinds of access escape it.
Stack buffers passed to helpers and kfuncs are validated by
check_stack_range_initialized(), which does not call it. If such a buffer
is the only other access to the region, the rewrite is still applied, the
JIT reserves a frame that does not contain the buffer, and the helper
reads or writes live kernel stack below the program's frame. For example,
without CAP_PERFMON:
*(u64 *)(r10 - 8) = r1;
call bpf_get_smp_processor_id;
r1 = *(u64 *)(r10 - 8);
r2 = 0;
r3 = r10;
r3 += -64;
r4 = 8;
call bpf_skb_load_bytes;
is accepted with a stack depth of 0 instead of 64.
Some buffers got the check indirectly. For constant-sized outputs in raw
mode, mark_raw_stack() marks the buffer initialized through ordinary
byte stores, which call the check. Commit 5da4a9f26fca ("bpf: Preserve
stack initialization for generic output buffers") limited raw mode to
programs that may read uninitialized stack, so outputs of programs
without CAP_PERFMON lost the check, as in the example above. Buffers
that never used raw mode have lacked the check since fastcall support
was added: helper inputs such as a map key whose only store is a fastcall
spill, variable-sized outputs, and buffers at a variable stack offset.
check_stack_read_fixed_off() applies the check to the current frame,
even when the pointer targets a caller's stack. A callee can therefore
read a caller's fastcall spill slot without disabling the caller's
rewrite:
caller:
r1 = 1;
*(u64 *)(r10 - 8) = r1;
call bpf_get_smp_processor_id;
r1 = *(u64 *)(r10 - 8);
r1 = r10;
r1 += -8;
call callee;
callee:
r0 = *(u64 *)(r1 + 0);
The caller's spill and fill are removed and its stack depth drops to 0,
but the verifier still tracks the slot as holding the spilled constant.
The callee's load then reads kernel stack outside the caller's frame,
while the verifier assumes r0 is 1.
Every stack access first goes through check_stack_access_within_bounds():
loads and stores from check_mem_access(), helper and kfunc buffers from
check_stack_range_initialized(), and the dynptr, iterator and irq flag
slots that kfuncs initialize, whose handlers use check_mem_access(). It
resolves the frame that owns the slots and the lowest offset the access
can touch, and it is the only place where a frame's stack depth grows.
Check the contract there, once for every access, and drop the calls from
the stack read and write paths. Zero-sized buffers touch no stack and
leave the rewrite enabled.
Fixes: 5b5f51bff1b6 ("bpf: no_caller_saved_registers attribute for helper calls")
Fixes: 5da4a9f26fca ("bpf: Preserve stack initialization for generic output buffers")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/85f9995a43edb70c76615280e103dc5325742e88330f36c97962ee35f17e3e32@mail.kernel.org
Link: https://patch.msgid.link/20260924075352.2343553-2-memxor@gmail.com
[ sashal: Removed the four per-path fastcall stack contract calls and added one check in the stack bounds function, with context adjusted since the surrounding verifier code differs. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index e6e31bddb56a6..85f6f6b121dd6 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -4853,7 +4853,6 @@ static int check_stack_write_fixed_off(struct bpf_verifier_env *env,
if (err)
return err;
- check_fastcall_stack_contract(env, state, insn_idx, off);
mark_stack_slot_scratched(env, spi);
if (reg && !(off % BPF_REG_SIZE) && reg->type == SCALAR_VALUE && env->bpf_capable) {
bool reg_value_fits;
@@ -4983,7 +4982,6 @@ static int check_stack_write_var_off(struct bpf_verifier_env *env,
return err;
}
- check_fastcall_stack_contract(env, state, insn_idx, min_off);
/* Variable offset writes destroy any spilled pointers in range. */
for (i = min_off; i < max_off; i++) {
u8 new_type, *stype;
@@ -5127,7 +5125,6 @@ static int check_stack_read_fixed_off(struct bpf_verifier_env *env,
reg = ®_state->stack[spi].spilled_ptr;
mark_stack_slot_scratched(env, spi);
- check_fastcall_stack_contract(env, state, env->insn_idx, off);
if (is_spilled_reg(®_state->stack[spi])) {
u8 spill_size = 1;
@@ -5288,7 +5285,6 @@ static int check_stack_read_var_off(struct bpf_verifier_env *env,
min_off = reg->smin_value + off;
max_off = reg->smax_value + off;
mark_reg_stack_read(env, ptr_state, min_off, max_off + size, dst_regno);
- check_fastcall_stack_contract(env, ptr_state, env->insn_idx, min_off);
return 0;
}
@@ -7228,6 +7224,15 @@ static int check_stack_access_within_bounds(
return err;
}
+ /*
+ * Every stack access passes through here, including buffers passed to
+ * helpers and kfuncs and accesses into a caller's frame, so check the
+ * fastcall contract of the frame that owns the slots once for all of
+ * them. Zero-sized accesses touch no stack and keep the rewrite enabled.
+ */
+ if (access_size)
+ check_fastcall_stack_contract(env, state, env->insn_idx, min_off);
+
/* Note that there is no stack access with offset zero, so the needed stack
* size is -min_off, not -min_off+1.
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 422/816] bpf: Look at frame 0 when telling async callback entries apart
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (420 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 421/816] bpf: Check fastcall stack contract once for all stack accesses Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 423/816] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register Greg Kroah-Hartman
` (398 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Puranjay Mohan, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Puranjay Mohan <puranjay@kernel.org>
[ Upstream commit e55220162aae99622d9e80d4700e51c13a6f2a16 ]
push_async_cb() sets in_async_callback_fn and async_entry_cnt on the
callback's own frame, which is frame 0 of the fresh state it starts, and
setup_func_entry() copies neither, so a subprog called by the callback
carries neither. Two places read them from the innermost frame instead.
is_state_visited() skips the infinite loop check when two states differ
in async_entry_cnt, because seeing the same state on a second entry into
an async callback is not a loop. A callback which re-arms itself and
calls a subprog therefore compares the two entries at a loop inside that
subprog, where the innermost frame is the subprog's and has no flag set,
and the state is rejected:
infinite loop detected at insn 60
push_callback_call() numbers a new entry as the caller's count plus one.
When the callback re-arms itself from a subprog, the caller is that
subprog's frame with a count of 0, so every entry is numbered 1, the
check above never sees a difference, and a loop anywhere in such a
callback is rejected the same way.
Read the flag and the count from frame 0 in both places. A loop within a
single entry still has a matching count and is still caught, and frame 0
of a non-async state does not have the flag set, so nothing else changes.
The two other readers are already correct: check_return_code() reads
frame[0], and the one in do_check() is reached only after an early return
for curframe != 0.
Fixes: bfc6bb74e4f1 ("bpf: Implement verifier support for validation of async callbacks.")
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260924162609.1746610-2-puranjay@kernel.org
[ sashal: Applied the states.c hunk by hand to is_state_visited() in verifier.c, since this tree has no states.c file. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 85f6f6b121dd6..17f3f39df27c0 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -10164,7 +10164,7 @@ static int push_callback_call(struct bpf_verifier_env *env, struct bpf_insn *ins
if (IS_ERR(async_cb))
return PTR_ERR(async_cb);
callee = async_cb->frame[0];
- callee->async_entry_cnt = caller->async_entry_cnt + 1;
+ callee->async_entry_cnt = state->frame[0]->async_entry_cnt + 1;
/* Convert bpf_timer_set_callback() args into timer callback args */
err = set_callee_state_cb(env, caller, callee, insn_idx);
@@ -18604,10 +18604,10 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
goto next;
if (sl->state.branches) {
- struct bpf_func_state *frame = sl->state.frame[sl->state.curframe];
+ struct bpf_func_state *frame = sl->state.frame[0];
if (frame->in_async_callback_fn &&
- frame->async_entry_cnt != cur->frame[cur->curframe]->async_entry_cnt) {
+ frame->async_entry_cnt != cur->frame[0]->async_entry_cnt) {
/* Different async_entry_cnt means that the verifier is
* processing another entry into async callback.
* Seeing the same state is not an indication of infinite
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 423/816] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (421 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 422/816] bpf: Look at frame 0 when telling async callback entries apart Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 424/816] bpf: Adjust pc-relative insn copied into its own patch Greg Kroah-Hartman
` (397 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
AngeloGioacchino Del Regno, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 6cddf6e56d2539fd13c0ee9dd817c4e06a967173 ]
devm_add_action_or_reset() is called after the loop that registers gate
clocks. If kzalloc() fails mid-loop, the function returns -ENOMEM before
that call, so cleanup is never registered and all previously registered
clocks leak permanently.
Move devm_add_action_or_reset() before the loop so cleanup is always
scheduled. The clock from the current (failing) iteration is not yet
stored in afe_priv->lookup[i], so it still needs an explicit
clk_unregister_gate() call.
Fixes: fd67a7a1a22c ("ASoC: mediatek: mt8188: fix use-after-free in driver remove path")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260907120310.135693-8-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Replaced kzalloc_obj(*cl) with kzalloc(sizeof(*cl), GFP_KERNEL) because the older base lacks the newer allocator helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
index c796ad8b62eea..fd73f9d9f41a1 100644
--- a/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
+++ b/sound/soc/mediatek/mt8188/mt8188-audsys-clk.c
@@ -166,7 +166,7 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
struct mt8188_afe_private *afe_priv = afe->platform_priv;
struct clk *clk;
struct clk_lookup *cl;
- int i;
+ int i, ret;
afe_priv->lookup = devm_kcalloc(afe->dev, CLK_AUD_NR_CLK,
sizeof(*afe_priv->lookup),
@@ -175,6 +175,10 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
if (!afe_priv->lookup)
return -ENOMEM;
+ ret = devm_add_action_or_reset(afe->dev, mt8188_audsys_clk_unregister, afe);
+ if (ret)
+ return ret;
+
for (i = 0; i < ARRAY_SIZE(aud_clks); i++) {
const struct afe_gate *gate = &aud_clks[i];
@@ -190,8 +194,10 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
/* add clk_lookup for devm_clk_get(SND_SOC_DAPM_CLOCK_SUPPLY) */
cl = kzalloc(sizeof(*cl), GFP_KERNEL);
- if (!cl)
+ if (!cl) {
+ clk_unregister_gate(clk);
return -ENOMEM;
+ }
cl->clk = clk;
cl->con_id = gate->name;
@@ -202,5 +208,5 @@ int mt8188_audsys_clk_register(struct mtk_base_afe *afe)
afe_priv->lookup[i] = cl;
}
- return devm_add_action_or_reset(afe->dev, mt8188_audsys_clk_unregister, afe);
+ return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 424/816] bpf: Adjust pc-relative insn copied into its own patch
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (422 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 423/816] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 425/816] bpf: Fix overflow of jump offset in may_goto expansion Greg Kroah-Hartman
` (396 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 67a3b916a7ae7c1a6bed08555417d444de6f5838 ]
bpf_do_misc_fixups() inits may_goto count by patching the first insn
of a subprog with [ST, ST, first insn]. bpf_convert_ctx_accesses()
patches insn that needs a barrier with [nospec, insn].
bpf_adj_branches() doesn't adjust insns inside the patch, so when
the copy is a call, ld_imm64 of a func or a jump that points backward
its target is off by the number of insns in front of it:
static int A(void) { return 1; }
static int A2(void) { return 2; }
static int B(void)
{
int i, ret = A();
for (i = 0; i < 10 && can_loop; i++)
...
return ret;
}
When A is placed in front of B and may_goto is timed 'call A' becomes
call of A + 2. B returns 2 when A + 2 is the start of A2. Otherwise
the prog is rejected with "verifier bug: No program to jit at insn".
Add bpf_adj_moved_insn() and use it for both copies.
Fixes: 011832b97b31 ("bpf: Introduce may_goto instruction")
Fixes: d6f1c85f2253 ("bpf: Fall back to nospec for Spectre v1")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260924233130.1213812-4-alexei.starovoitov@gmail.com
[ sashal: Ported the fix into the monolithic verifier file and dropped the nospec hunk, since the original insn stays at index 0 in this tree's patch layout. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 44 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 17f3f39df27c0..ab7cf92771d81 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19952,6 +19952,44 @@ static struct bpf_prog *bpf_patch_insn_data(struct bpf_verifier_env *env, u32 of
return new_prog;
}
+/*
+ * insn was moved down by delta insns inside its own patch. Operands relative
+ * to the pc that point in front of the old position did not move with it.
+ */
+static int bpf_adj_moved_insn(struct bpf_insn *insn, u32 delta)
+{
+ u8 class = BPF_CLASS(insn->code), op = BPF_OP(insn->code);
+ s64 off = insn->imm, off_min = S32_MIN;
+ bool is_imm = true;
+
+ if (bpf_pseudo_func(insn) || bpf_pseudo_call(insn)) {
+ /* subprog that started at the old position starts with the patch */
+ if (off >= 0)
+ return 0;
+ } else if ((class == BPF_JMP || class == BPF_JMP32) &&
+ op != BPF_CALL && op != BPF_EXIT) {
+ if (insn->code != (BPF_JMP32 | BPF_JA)) {
+ off = insn->off;
+ off_min = S16_MIN;
+ is_imm = false;
+ }
+ /* jump to itself stays */
+ if (off >= -1)
+ return 0;
+ } else {
+ return 0;
+ }
+
+ off -= delta;
+ if (off < off_min)
+ return -ERANGE;
+ if (is_imm)
+ insn->imm = off;
+ else
+ insn->off = off;
+ return 0;
+}
+
/*
* For all jmp insns in a given 'prog' that point to 'tgt_idx' insn adjust the
* jump offset by 'delta'.
@@ -21959,6 +21997,12 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
-subprogs[i].stack_depth, BPF_MAX_LOOPS);
/* Copy first actual insn to preserve it */
insn_buf[1] = env->prog->insnsi[subprog_start];
+ ret = bpf_adj_moved_insn(&insn_buf[1], 1);
+ if (ret) {
+ verbose(env, "insn %d cannot be patched due to 16-bit range\n",
+ env->insn_aux_data[subprog_start].orig_idx);
+ return ret;
+ }
new_prog = bpf_patch_insn_data(env, subprog_start, insn_buf, 2);
if (!new_prog)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 425/816] bpf: Fix overflow of jump offset in may_goto expansion
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (423 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 424/816] bpf: Adjust pc-relative insn copied into its own patch Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 426/816] bpf: Dont converge a loop on an iterator that was created anew Greg Kroah-Hartman
` (395 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 8a12a00f6c5dba70a6d908fe27a3c980d42b9515 ]
may_goto is expanded into 'if AX == 0 goto off + 5' when it's timed,
off + 2 when it's not and off - 1 when it jumps backward. The sum is
stored into 16-bit off without a range check, so may_goto +32763
turns into:
if r12 == 0x0 goto pc-32768
and the prog jumps backward when may_goto expires.
Emit 'if AX != 0 goto +1; gotol' when the offset doesn't fit and
compute the offset from the number of insns in the expansion.
JITs that don't support gotol will reject such prog.
Fixes: 011832b97b31 ("bpf: Introduce may_goto instruction")
Fixes: e723608bf428 ("bpf: Add verifier support for timed may_goto")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260924233130.1213812-6-alexei.starovoitov@gmail.com
[ sashal: Moved may_goto expansion into a new may_goto_expand() helper in verifier.c's do_misc_fixups(), since fixups.c doesn't exist here, and dropped the timed may_goto hunk, which has no counterpart. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 38 ++++++++++++++++++++++++++++++--------
1 file changed, 30 insertions(+), 8 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index ab7cf92771d81..86482f36329dd 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -21156,6 +21156,30 @@ static int add_hidden_subprog(struct bpf_verifier_env *env, struct bpf_insn *pat
return 0;
}
+/*
+ * Expand may_goto: load the count from the stack, jump to the target of
+ * may_goto when it is zero, then the tail that updates the count.
+ * Use gotol when the target is too far for 16-bit offset of a conditional jump.
+ */
+static int may_goto_expand(struct bpf_insn *insn_buf, int off, int stack_off,
+ const struct bpf_insn *tail, int tail_cnt)
+{
+ int cnt = 0;
+
+ /* Forward jump has to step over the tail */
+ off = off >= 0 ? off + tail_cnt : off - 1;
+
+ insn_buf[cnt++] = BPF_LDX_MEM(BPF_DW, BPF_REG_AX, BPF_REG_10, stack_off);
+ if (off == (s16)off) {
+ insn_buf[cnt++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_AX, 0, off);
+ } else {
+ insn_buf[cnt++] = BPF_JMP_IMM(BPF_JNE, BPF_REG_AX, 0, 1);
+ insn_buf[cnt++] = BPF_JMP32_A(off >= 0 ? off : off - 1);
+ }
+ memcpy(insn_buf + cnt, tail, tail_cnt * sizeof(*tail));
+ return cnt + tail_cnt;
+}
+
/* Do various post-verification rewrites in a single program pass.
* These rewrites simplify JIT and interpreter implementations.
*/
@@ -21443,16 +21467,14 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
if (is_may_goto_insn(insn)) {
int stack_off = -stack_depth - 8;
+ struct bpf_insn tail[] = {
+ BPF_ALU64_IMM(BPF_SUB, BPF_REG_AX, 1),
+ BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_AX, stack_off),
+ };
stack_depth_extra = 8;
- insn_buf[0] = BPF_LDX_MEM(BPF_DW, BPF_REG_AX, BPF_REG_10, stack_off);
- if (insn->off >= 0)
- insn_buf[1] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_AX, 0, insn->off + 2);
- else
- insn_buf[1] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_AX, 0, insn->off - 1);
- insn_buf[2] = BPF_ALU64_IMM(BPF_SUB, BPF_REG_AX, 1);
- insn_buf[3] = BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_AX, stack_off);
- cnt = 4;
+ cnt = may_goto_expand(insn_buf, insn->off, stack_off,
+ tail, ARRAY_SIZE(tail));
new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt);
if (!new_prog)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 426/816] bpf: Dont converge a loop on an iterator that was created anew
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (424 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 425/816] bpf: Fix overflow of jump offset in may_goto expansion Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 427/816] bpf: Fix uninit read for non-fetch atomics on partially spilled slots Greg Kroah-Hartman
` (394 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 6f3ee3516305da3043f1787e3890381a54151730 ]
When the verifier reaches bpf_iter_*_next() in a state that is equal to
a state that is still being explored it concludes that the loop
converged, since an active iterator will be drained eventually.
states_equal() matches ids through idmap, so the same is concluded for
an iterator that was destroyed and created again since the old state:
bpf_iter_num_new(&it, 0, 10);
loop:
if (bpf_ktime_get_ns())
goto remake;
next:
if (!bpf_iter_num_next(&it))
goto out;
goto loop;
remake:
bpf_iter_num_destroy(&it);
bpf_iter_num_new(&it, 0, 10);
goto next;
Such prog is accepted when the call of bpf_iter_num_next() is the first
prune point after bpf_iter_num_new() and it never returns. Otherwise
it's rejected with "infinite loop detected".
Require the iterator to have the same id in both states.
Fixes: 06accc8779c1 ("bpf: add support for open-coded iterator loops")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260924233130.1213812-8-alexei.starovoitov@gmail.com
[ sashal: Applied the hunk to is_state_visited() in verifier.c since states.c doesn't exist here, using open-coded frame/stack lookups and comparing ref_obj_id instead of id because iterator slots never set id. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 86482f36329dd..b66d0487444f1 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -18659,8 +18659,9 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
*/
if (is_iter_next_insn(env, insn_idx)) {
if (states_equal(env, &sl->state, cur, RANGE_WITHIN)) {
- struct bpf_func_state *cur_frame;
+ struct bpf_func_state *cur_frame, *old_frame;
struct bpf_reg_state *iter_state, *iter_reg;
+ struct bpf_reg_state *old_iter;
int spi;
cur_frame = cur->frame[cur->curframe];
@@ -18674,7 +18675,16 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
*/
spi = __get_spi(iter_reg->off + iter_reg->var_off.value);
iter_state = &func(env, iter_reg)->stack[spi].spilled_ptr;
- if (iter_state->iter.state == BPF_ITER_STATE_ACTIVE) {
+ old_frame = sl->state.frame[iter_reg->frameno];
+ old_iter = &old_frame->stack[spi].spilled_ptr;
+ /*
+ * states_equal() matches ids through idmap.
+ * The loop converged only if it's the same
+ * iterator. The one that was destroyed and
+ * created again starts from the beginning.
+ */
+ if (iter_state->iter.state == BPF_ITER_STATE_ACTIVE &&
+ iter_state->ref_obj_id == old_iter->ref_obj_id) {
update_loop_entry(cur, &sl->state);
goto hit;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 427/816] bpf: Fix uninit read for non-fetch atomics on partially spilled slots
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (425 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 426/816] bpf: Dont converge a loop on an iterator that was created anew Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 428/816] bpf: Fix uninit read for helper mem args " Greg Kroah-Hartman
` (393 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hao Sun, Kumar Kartikeya Dwivedi,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Sun <sunhao.th@gmail.com>
[ Upstream commit 5a84b4424db8ae07f0ac682ab031c37a91dce50b ]
check_stack_read_fixed_off() skips partial spill checks for non-fetch
atomics; the following prog can be loaded:
0: (b7) r1 = 1 ; R1=1
1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1
2: (db) lock *(u64 *)(r10 -8) += r1 ; R1=1 R10=fp0 fp-8=mmmmmmmm
3: (79) r0 = *(u64 *)(r10 -8) ; R0=scalar() R10=fp0 fp-8=mmmmmmmm
4: (77) r0 >>= 32 ; R0=scalar(smin=0,smax=umax=0xffffffff,var_off=(0x0; 0xffffffff))
5: (95) exit
When test run:
retval=4294967295
Note fp-8 is ????1 at #1, yet it becomes fp-8=mmmmmmmm after the
non-fetching atomic add at #2; hence the high 32 bits are leaked.
Fix by applying the partial load check; after the patch, the
prog is rejected:
Verification failed: Memory Safety: Uninitialized stack read
Reason:
This rejected read uses 8 bytes at stack offset -8, but byte 4 in that range is uninitialized on
this path. Programs loaded with CAP_PERFMON can be allowed to read uninitialized stack bytes, but
this program is being rejected without that allowance.
At:
...
0 | (b7) r1 = 1
1 | (63) *(u32 *)(r10 -8) = r1
>>> 2 | (db) lock *(u64 *)(r10 -8) += r1
3 | (79) r0 = *(u64 *)(r10 -8)
4 | (77) r0 >>= 32
This affects CAP_BPF only.
Fixes: 354e8f1970f8 ("bpf: Support <8-byte scalar spill and refill")
Signed-off-by: Hao Sun <sunhao.th@gmail.com>
Link: https://lore.kernel.org/bpf/20260924131342.934290-1-sunhao.th@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[ sashal: Moved the dst_regno < 0 early return after the partial-spill checks, keeping the existing mark_reg_read() and copy_register_state()/subreg_def code and splitting the subreg_def declaration. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index b66d0487444f1..63bb703e0a64d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5140,15 +5140,18 @@ static int check_stack_read_fixed_off(struct bpf_verifier_env *env,
}
mark_reg_read(env, reg, reg->parent, REG_LIVE_READ64);
- if (dst_regno < 0)
- return 0;
if (size <= spill_size &&
bpf_stack_narrow_access_ok(off, size, spill_size)) {
+ s32 subreg_def;
+
+ if (dst_regno < 0)
+ return 0;
+
/* The earlier check_reg_arg() has decided the
* subreg_def for this insn. Save it first.
*/
- s32 subreg_def = state->regs[dst_regno].subreg_def;
+ subreg_def = state->regs[dst_regno].subreg_def;
copy_register_state(&state->regs[dst_regno], reg);
state->regs[dst_regno].subreg_def = subreg_def;
@@ -5180,6 +5183,9 @@ static int check_stack_read_fixed_off(struct bpf_verifier_env *env,
return -EACCES;
}
+ if (dst_regno < 0)
+ return 0;
+
if (spill_cnt == size &&
tnum_is_const(reg->var_off) && reg->var_off.value == 0) {
__mark_reg_const_zero(env, &state->regs[dst_regno]);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 428/816] bpf: Fix uninit read for helper mem args on partially spilled slots
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (426 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 427/816] bpf: Fix uninit read for non-fetch atomics on partially spilled slots Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 429/816] perf llvm: Fix memory leak of args->fileloc in symbol__disassemble_llvm() Greg Kroah-Hartman
` (392 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kumar Kartikeya Dwivedi, Hao Sun,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Sun <sunhao.th@gmail.com>
[ Upstream commit b3861495d2b2f7459cddf49e63fa0758ba430583 ]
check_stack_range_initialized() takes the spilled register path when
bpf_is_spilled_reg(ss) holds, which, however, only looks at the last
byte of the slot. Hence, a partially spilled scalar (on the lower part)
bypasses the check and the following loads:
0: (b7) r1 = 1 ; R1=1
1: (63) *(u32 *)(r10 -8) = r1 ; R1=1 R10=fp0 fp-8=????1
2: (18) r1 = 0x0 ; R1=map_ptr(map=rb,ks=0,vs=0)
4: (bf) r2 = r10 ; R2=fp0 R10=fp0
5: (07) r2 += -8 ; R2=fp-8
6: (b7) r3 = 8 ; R3=8
7: (b7) r4 = 0 ; R4=0
8: (85) call bpf_ringbuf_output#130
...
When executed, it dumps the uninit four bytes:
RINGBUF: 01 00 00 00 ff ff ff ff
This is the same root cause as the non-fetch atomic case fixed in
commit 5a84b4424db8 ("bpf: Fix uninit read for non-fetch atomics on
partially spilled slots").
Fix by only taking the spilled register path for the bytes marked
STACK_SPILL, so the rest of the slot goes through the usual checks.
Fixes: 354e8f1970f8 ("bpf: Support <8-byte scalar spill and refill")
Suggested-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Hao Sun <sunhao.th@gmail.com>
Link: https://lore.kernel.org/bpf/20260925082814.1554771-1-sunhao.th@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 63bb703e0a64d..8666fb0ea3b75 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -7812,7 +7812,12 @@ static int check_stack_range_initialized(
goto mark;
}
- if (is_spilled_reg(&state->stack[spi]) &&
+ /*
+ * Only the bytes marked STACK_SPILL hold the spilled register.
+ * The rest of a narrowly spilled slot keeps its previous type
+ * and must be initialized on its own.
+ */
+ if (*stype == STACK_SPILL &&
(state->stack[spi].spilled_ptr.type == SCALAR_VALUE ||
env->allow_ptr_leaks)) {
if (clobber) {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 429/816] perf llvm: Fix memory leak of args->fileloc in symbol__disassemble_llvm()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (427 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 428/816] bpf: Fix uninit read for helper mem args " Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 430/816] sysctl: unregister tables before freeing bitmap Greg Kroah-Hartman
` (391 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Tengda Wu,
Steinar H. Gunderson, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tengda Wu <wutengda@huaweicloud.com>
[ Upstream commit fe529886843f451ad6da7e65d53325432e0f80fb ]
In symbol__disassemble_llvm(), after calling llvm_addr2line(), if the
subsequent disasm_line__new() fails, the code directly jumps to 'err'
without freeing args->fileloc, leading to a memory leak.
Fix this by explicitly calling free(args->fileloc) before jumping to the
error handling path when disasm_line__new() fails.
Fixes: 04885681788855bb ("perf annotate: LLVM-based disassembler")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>
Cc: Steinar H. Gunderson <sesse@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Applied the fix by hand to symbol__disassemble_llvm() in disasm.c, since the llvm.c file the upstream patch touches doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/disasm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index 8f35232f7f22c..300acc905901c 100644
--- a/tools/perf/util/disasm.c
+++ b/tools/perf/util/disasm.c
@@ -1980,8 +1980,10 @@ static int symbol__disassemble_llvm(char *filename, struct symbol *sym,
(unsigned int *)&args->line_nr, false, NULL);
dl = disasm_line__new(args);
- if (dl == NULL)
+ if (dl == NULL) {
+ free(args->fileloc);
goto err;
+ }
annotation_line__add(&dl->al, ¬es->src->source);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 430/816] sysctl: unregister tables before freeing bitmap
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (428 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 429/816] perf llvm: Fix memory leak of args->fileloc in symbol__disassemble_llvm() Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 431/816] arm64: dts: qcom: x1-crd: Mark the EC reset gpio as reserved Greg Kroah-Hartman
` (390 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yibo Tan, Joel Granados, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yibo Tan <lhfff@tju.edu.cn>
[ Upstream commit 238dfe02fb0a9f72d7fd275d74ce80f13923ef31 ]
The table registered for bitmap_0001 retains a pointer to
test_data.bitmap_0001. unregister_sysctl_table() prevents new handlers
from starting and waits for active handlers to finish.
test_sysctl_exit() currently frees the bitmap before unregistering the
table. A concurrent read during module removal can therefore enter
proc_do_large_bitmap() while the bitmap is freed. KASAN reports a
slab-use-after-free in _find_next_bit().
Unregister all tables before freeing the bitmap so the unregister rundown
provides the required lifetime boundary.
The unmodified module reproduced the use-after-free in three KASAN runs.
With this change, three runs each completed 100 load, read and unload race
rounds without a kernel diagnostic.
Fixes: 2ea622b887e7 ("tools/testing/selftests/sysctl/sysctl.sh: add proc_do_large_bitmap() test case")
Assisted-by: LLM
Signed-off-by: Yibo Tan <lhfff@tju.edu.cn>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/test_sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_sysctl.c b/lib/test_sysctl.c
index b6696fa1d4262..a043e27287db1 100644
--- a/lib/test_sysctl.c
+++ b/lib/test_sysctl.c
@@ -264,7 +264,6 @@ module_init(test_sysctl_init);
static void __exit test_sysctl_exit(void)
{
- kfree(test_data.bitmap_0001);
if (sysctl_test_headers.test_h_setup_node)
unregister_sysctl_table(sysctl_test_headers.test_h_setup_node);
if (sysctl_test_headers.test_h_mnt)
@@ -275,6 +274,7 @@ static void __exit test_sysctl_exit(void)
unregister_sysctl_table(sysctl_test_headers.empty);
if (sysctl_test_headers.empty_add)
unregister_sysctl_table(sysctl_test_headers.empty_add);
+ kfree(test_data.bitmap_0001);
}
module_exit(test_sysctl_exit);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 431/816] arm64: dts: qcom: x1-crd: Mark the EC reset gpio as reserved
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (429 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 430/816] sysctl: unregister tables before freeing bitmap Greg Kroah-Hartman
@ 2026-11-25 14:32 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 432/816] arm64: dts: qcom: x1e78100-t14s: " Greg Kroah-Hartman
` (389 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Abel Vesa, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit 099cd579fa73c142fde2f7e3ea473f334792a249 ]
GPIO 65 from TLMM is connected to the embedded controller's active-high
reset line. Asserting it causes the fans to run at full speed during
reset and leaves the keyboard non-functional afterwards.
Reserve it to prevent Linux from requesting or reconfiguring it.
Fixes: bd50b1f5b6f3 ("arm64: dts: qcom: x1e80100: Add Compute Reference Device")
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260922-dts-qcom-hamoa-reserve-ec-reset-gpio-v3-1-fde7f8a53382@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
[ sashal: Applied the one-line gpio-reserved-ranges addition to the CRD board file, since the shared include file the original patch edits doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
index e5d0d7d898c38..e44ea4d686822 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
@@ -1000,6 +1000,7 @@ right_tweeter: speaker@0,1 {
&tlmm {
gpio-reserved-ranges = <34 2>, /* Unused */
<44 4>, /* SPI (TPM) */
+ <65 1>, /* EC reset */
<238 1>; /* UFS Reset */
edp_reg_en: edp-reg-en-state {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 432/816] arm64: dts: qcom: x1e78100-t14s: Mark the EC reset gpio as reserved
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (430 preceding siblings ...)
2026-11-25 14:32 ` [PATCH 6.12 431/816] arm64: dts: qcom: x1-crd: Mark the EC reset gpio as reserved Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 433/816] arm64: dts: qcom: x1-asus-vivobook-s15: " Greg Kroah-Hartman
` (388 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Abel Vesa, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit 07321595ce693eea5854120869a8b1560d7b14d6 ]
GPIO 65 from TLMM is used by the embedded controller as its reset line.
On some devices, toggling the embedded controller reset line makes the
device not power up at all, unless the battery is unplugged.
So reserve it in order to prevent Linux from requesting or
reconfiguring it.
Fixes: 7d1cbe2f4985 ("arm64: dts: qcom: Add X1E78100 ThinkPad T14s Gen 6")
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260922-dts-qcom-hamoa-reserve-ec-reset-gpio-v3-3-fde7f8a53382@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
[ sashal: Applied the one-line gpio-reserved-ranges addition to the T14s board file, since the shared include file the original patch edits doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dts b/arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dts
index 02ae736a2205d..fa7371ba601b7 100644
--- a/arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dts
+++ b/arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dts
@@ -641,6 +641,7 @@ &smb2360_1_eusb2_repeater {
&tlmm {
gpio-reserved-ranges = <34 2>, /* Unused */
<44 4>, /* SPI (TPM) */
+ <65 1>, /* EC reset */
<72 2>, /* Secure EC I2C connection (?) */
<238 1>; /* UFS Reset */
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 433/816] arm64: dts: qcom: x1-asus-vivobook-s15: Mark the EC reset gpio as reserved
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (431 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 432/816] arm64: dts: qcom: x1e78100-t14s: " Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 434/816] ACPI: PCC: Free channel on OpRegion deactivation Greg Kroah-Hartman
` (387 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Abel Vesa, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit 94a0d3a2595821878de98d495e89691f694a2083 ]
GPIO 65 from TLMM is used by the embedded controller as its reset line.
On some devices, toggling the embedded controller reset line makes the
device not power up at all, unless the battery is unplugged.
So reserve it in order to prevent Linux from requesting or
reconfiguring it.
Fixes: d0e2f8f62dff ("arm64: dts: qcom: Add device tree for ASUS Vivobook S 15")
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260922-dts-qcom-hamoa-reserve-ec-reset-gpio-v3-9-fde7f8a53382@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
[ sashal: Applied the one-line GPIO 65 reservation to the single x1e80100-asus-vivobook-s15.dts file, since the upstream split dtsi file doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/x1e80100-asus-vivobook-s15.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/x1e80100-asus-vivobook-s15.dts b/arch/arm64/boot/dts/qcom/x1e80100-asus-vivobook-s15.dts
index ce3fa29de7b4a..62a36017616a6 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-asus-vivobook-s15.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-asus-vivobook-s15.dts
@@ -506,6 +506,7 @@ &smb2360_1_eusb2_repeater {
&tlmm {
gpio-reserved-ranges = <34 2>, /* Unused */
<44 4>, /* SPI (TPM) */
+ <65 1>, /* EC reset */
<238 1>; /* UFS Reset */
edp_reg_en: edp-reg-en-state {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 434/816] ACPI: PCC: Free channel on OpRegion deactivation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (432 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 433/816] arm64: dts: qcom: x1-asus-vivobook-s15: " Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 435/816] x86/fpu: Fix potential underflow in xstate_calculate_size() Greg Kroah-Hartman
` (386 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Huisong Li, Sudeep Holla,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
[ Upstream commit fa9c7ee692988edddc1da74bc5257d53dd3c7130 ]
ACPICA calls the address space setup callback with
ACPI_REGION_DEACTIVATE when a PCC OperationRegion is torn down.
The PCC setup callback currently allocates a fresh pcc_data and requests
the mailbox channel before looking at the function argument. If ACPICA
deactivates a region, this can leave the existing region context and
mailbox channel unreleased, and may also request a channel during
teardown.
Handle ACPI_REGION_DEACTIVATE before allocation. Free the PCC mailbox
channel, release the region context and clear the context pointer.
Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype")
Reviewed-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://patch.msgid.link/20260922144302.3847593-4-sudeep.holla@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: kept the tree's existing kzalloc(sizeof(*data), GFP_KERNEL) allocation line instead of upstream's kzalloc_obj(*data) to resolve the context mismatch. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpi_pcc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
index 683924a708ba0..04bb232603965 100644
--- a/drivers/acpi/acpi_pcc.c
+++ b/drivers/acpi/acpi_pcc.c
@@ -55,6 +55,19 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
struct pcc_mbox_chan *pcc_chan;
acpi_status ret;
+ if (function == ACPI_REGION_DEACTIVATE) {
+ data = *region_context;
+ if (data) {
+ pcc_mbox_free_channel(data->pcc_chan);
+ kfree(data);
+ *region_context = NULL;
+ }
+ return AE_OK;
+ }
+
+ if (function != ACPI_REGION_ACTIVATE)
+ return AE_BAD_PARAMETER;
+
data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data)
return AE_NO_MEMORY;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 435/816] x86/fpu: Fix potential underflow in xstate_calculate_size()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (433 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 434/816] ACPI: PCC: Free channel on OpRegion deactivation Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 436/816] bpf: Rebase the exception callback subprog when dead subprogs are removed Greg Kroah-Hartman
` (385 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrei Vagin, Borislav Petkov (AMD),
Alexander Mikhalitsyn, Chang S. Bae, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrei Vagin <avagin@google.com>
[ Upstream commit f1751b220bc8a9bd2dc38ecf61f5c29f3826ace0 ]
xstate_calculate_size() calculates the size required for a given set of
xfeatures. It determines the topmost feature by finding the most
significant bit in xfeatures using fls64(xfeatures) - 1.
If xfeatures is 0, fls64(0) returns 0, and topmost becomes -1.
Previously, topmost was unsigned int, so -1 underflowed to UINT_MAX.
This caused the subsequent check `topmost <= XFEATURE_SSE` to fail, and
the code proceeded to access xstate arrays using topmost (UINT_MAX) as
an index, leading to an out-of-bounds access.
[ bp: Remove text explaining what the patch does. ]
Fixes: d6d6d50f1e80 ("x86/fpu/xstate: Consolidate size calculations")
Signed-off-by: Andrei Vagin <avagin@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Alexander Mikhalitsyn <alexander@mihalicyn.com>
Reviewed-by: Chang S. Bae <chang.seok.bae@intel.com>
Link: https://patch.msgid.link/20260925162454.1403405-6-avagin@google.com
[ sashal: Moved the xfeatures early-return check ahead of the topmost and offset initialization, and dropped the missing i variable and loop context, keeping the unbraced if (compacted). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/fpu/xstate.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index aacb59c4a35c3..1a751da3313b4 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -562,12 +562,14 @@ static bool __init check_xstate_against_struct(int nr)
static unsigned int xstate_calculate_size(u64 xfeatures, bool compacted)
{
- unsigned int topmost = fls64(xfeatures) - 1;
- unsigned int offset = xstate_offsets[topmost];
+ unsigned int topmost, offset;
- if (topmost <= XFEATURE_SSE)
+ if (!(xfeatures & ~XFEATURE_MASK_FPSSE))
return sizeof(struct xregs_state);
+ topmost = fls64(xfeatures) - 1;
+ offset = xstate_offsets[topmost];
+
if (compacted)
offset = xfeature_get_offset(xfeatures, topmost);
return offset + xstate_sizes[topmost];
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 436/816] bpf: Rebase the exception callback subprog when dead subprogs are removed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (434 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 435/816] x86/fpu: Fix potential underflow in xstate_calculate_size() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 437/816] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit Greg Kroah-Hartman
` (384 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Borkmann, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <daniel@iogearbox.net>
[ Upstream commit 8608ec8e981974b18834e2d67ed39638a9ec2e63 ]
adjust_subprog_starts_after_remove() compacts subprog_info[] and the
func_info when whole subprograms are removed as dead code, but leaves
env->exception_callback_subprog alone, so an exception callback declared
through the exception_callback decl tag which sits behind a removed
subprogram keeps its old index. jit_subprogs() then takes the exception
callback from func[] at that index, which is past the end when the
callback was the last subprogram, or another subprogram otherwise.
Rebase the index along with the entries it refers to.
Fixes: b9ae0c9dd0ac ("bpf: Add support for custom exception callbacks")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260925175244.1136329-4-daniel@iogearbox.net
[ sashal: Applied the hunk to the fixup code in its older location, with the surrounding context adjusted because this tree lacks the later func_info_aux handling. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 8666fb0ea3b75..ffd1f13925c29 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -20092,6 +20092,9 @@ static int adjust_subprog_starts_after_remove(struct bpf_verifier_env *env,
* in adjust_btf_func() - no need to adjust
*/
}
+ /* The exception callback is live, so it cannot sit inside the removed range. */
+ if (env->exception_callback_subprog >= j)
+ env->exception_callback_subprog -= j - i;
} else {
/* convert i from "first prog to remove" to "first to adjust" */
if (env->subprog_info[i].start == off)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 437/816] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (435 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 436/816] bpf: Rebase the exception callback subprog when dead subprogs are removed Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 438/816] netfilter: nfnetlink: Fix for interrupted hook dumps Greg Kroah-Hartman
` (383 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Danish Khateeb,
Thomas Weißschuh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danish Khateeb <danishkhateeb03@gmail.com>
[ Upstream commit 929ea5b3481fdbbb419f3986703280fb2b819504 ]
Since commit feaf75658783 ("nolibc: fix fd_set type"), an fd_set is an
array of unsigned long, but the FD_* macros still build their masks as
an int or an unsigned int: 1 << n in FD_SET(), 1U << n in FD_CLR() and
FD_ISSET(), where n is the fd modulo 64 on 64-bit architectures. So:
- FD_SET() of an fd with n == 31 sets the bits for n = 31-63, as
1 << 31 is negative and gets sign-extended.
- For n >= 32 the shifts are undefined. x86-64, for instance, masks
the shift count, so FD_SET(40) and FD_ISSET(40) use the bit of fd 8.
- FD_CLR() zero-extends ~(1U << n), so it also clears the bits for
n = 32-63, whichever fd it is given.
select() on fd 40, for instance, fails with EBADF, or watches fd 8
instead if that one is open.
Build the masks from 1UL.
Fixes: feaf75658783 ("nolibc: fix fd_set type")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Link: https://patch.msgid.link/20260925211600.119116-3-danishkhateeb03@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
[ sashal: Edited the FD_* macros in types.h instead of sys/select.h, since this tree has no sys/ directory; the three edits are otherwise identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/nolibc/types.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index 30cc9fad57ecf..ba8668a5f567d 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -127,7 +127,7 @@ typedef struct {
int __fd = (fd); \
if (__fd >= 0) \
__set->fds[__fd / FD_SETIDXMASK] &= \
- ~(1U << (__fd & FD_SETBITMASK)); \
+ ~(1UL << (__fd & FD_SETBITMASK)); \
} while (0)
#define FD_SET(fd, set) do { \
@@ -135,7 +135,7 @@ typedef struct {
int __fd = (fd); \
if (__fd >= 0) \
__set->fds[__fd / FD_SETIDXMASK] |= \
- 1 << (__fd & FD_SETBITMASK); \
+ 1UL << (__fd & FD_SETBITMASK); \
} while (0)
#define FD_ISSET(fd, set) ({ \
@@ -144,7 +144,7 @@ typedef struct {
int __r = 0; \
if (__fd >= 0) \
__r = !!(__set->fds[__fd / FD_SETIDXMASK] & \
-1U << (__fd & FD_SETBITMASK)); \
+1UL << (__fd & FD_SETBITMASK)); \
__r; \
})
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 438/816] netfilter: nfnetlink: Fix for interrupted hook dumps
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (436 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 437/816] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 439/816] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access Greg Kroah-Hartman
` (382 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Phil Sutter, Pablo Neira Ayuso,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Sutter <phil@nwl.cc>
[ Upstream commit d3950004ba90350bcdf414c5f804da277178564a ]
Handling of concurrent hook changes with a dump in progress was
problematic in nfnl_hook_dump and entirely broken in nfnl_hook_dump_nat.
Address all issues in a single patch to please the review LLM.
Introduce sequence numbers in struct netns_nf to replace pointer
value-based modification detection which may fail due to memory buffer
reuse. This also eliminates the need for most manual cb->seq updates and
excessive array index value checks.
Since nat hook updates are protected by a different mutex than others,
they have to bump their own sequence number. nfnl_hook_dump_nat
therefore open-codes what nl_dump_check_consistent does but bumps
cb->seq instead of setting NLM_F_DUMP_INTR flag.
Dumps of many nat hooks was entirely broken since the array index was
not (re)stored. Use cb->args[1] for that and make sure it is reset upon
completion as the same dump may loop over multiple arrays of nat hooks.
In nfnl_hook_dump, don't signal NLM_F_DUMP_INTR if
nfnl_hook_entries_head returns error: This is a permanent condition
which does not change during a dump. It is already caught by
nfnl_hook_dump_start though, so should not happen anyway.
In general, access ops array pointer values using READ_ONCE since they
are assigned to using WRITE_ONCE.
Avoid setting NLM_F_DUMP_INTR flag in garbage memory by calling
nl_dump_check_consistent only for non-empty skbs. If not a single
netlink message was created, nfnetlink code will take care of setting
the flag.
Fixes: e2cf17d3774c ("netfilter: add new hook nfnl subsystem")
Fixes: b010e2a4a9ac ("netfilter: nfnetlink_hook: Dump nat type chains")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[ sashal: Dropped the NAT-hook parts (nat_hook_base_seq, bump_nat_hook_base_seq, nfnl_hook_dump_nat rewrite) since the NAT dump feature isn't in this tree, keeping only the non-NAT sequence-number fix. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netns/netfilter.h | 1 +
net/netfilter/core.c | 17 ++++++++++++++++-
net/netfilter/nfnetlink_hook.c | 20 +++++---------------
3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/include/net/netns/netfilter.h b/include/net/netns/netfilter.h
index a6a0bf4a247e5..6de1006a48655 100644
--- a/include/net/netns/netfilter.h
+++ b/include/net/netns/netfilter.h
@@ -33,5 +33,6 @@ struct netns_nf {
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
unsigned int defrag_ipv6_users;
#endif
+ unsigned int hook_base_seq;
};
#endif
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index b9f551f02c813..f8346fee36b6b 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -393,6 +393,15 @@ static void nf_static_key_dec(const struct nf_hook_ops *reg, int pf)
#endif
}
+static void bump_hook_base_seq(struct net *net)
+{
+ unsigned int base_seq = READ_ONCE(net->nf.hook_base_seq);
+
+ while (++base_seq == 0)
+ ;
+ smp_store_release(&net->nf.hook_base_seq, base_seq);
+}
+
static int __nf_register_net_hook(struct net *net, int pf,
const struct nf_hook_ops *reg)
{
@@ -437,6 +446,7 @@ static int __nf_register_net_hook(struct net *net, int pf,
if (!IS_ERR(new_hooks)) {
hooks_validate(new_hooks);
rcu_assign_pointer(*pp, new_hooks);
+ bump_hook_base_seq(net);
}
mutex_unlock(&nf_hook_mutex);
@@ -490,6 +500,7 @@ static void __nf_unregister_net_hook(struct net *net, int pf,
{
struct nf_hook_entries __rcu **pp;
struct nf_hook_entries *p;
+ bool found;
pp = nf_hook_entry_head(net, pf, reg->hooknum, reg->dev);
if (!pp)
@@ -503,7 +514,8 @@ static void __nf_unregister_net_hook(struct net *net, int pf,
return;
}
- if (nf_remove_net_hook(p, reg)) {
+ found = nf_remove_net_hook(p, reg);
+ if (found) {
#ifdef CONFIG_NETFILTER_INGRESS
if (nf_ingress_hook(reg, pf))
net_dec_ingress_queue();
@@ -518,6 +530,8 @@ static void __nf_unregister_net_hook(struct net *net, int pf,
}
p = __nf_hook_entries_try_shrink(p, pp);
+ if (found)
+ bump_hook_base_seq(net);
mutex_unlock(&nf_hook_mutex);
if (!p)
return;
@@ -791,6 +805,7 @@ static int __net_init netfilter_net_init(struct net *net)
return -ENOMEM;
}
#endif
+ net->nf.hook_base_seq = 1;
return 0;
}
diff --git a/net/netfilter/nfnetlink_hook.c b/net/netfilter/nfnetlink_hook.c
index ade8ee1988b1e..9d9468ec700de 100644
--- a/net/netfilter/nfnetlink_hook.c
+++ b/net/netfilter/nfnetlink_hook.c
@@ -54,7 +54,6 @@ static int nf_netlink_dump_start_rcu(struct sock *nlsk, struct sk_buff *skb,
struct nfnl_dump_hook_data {
char devname[IFNAMSIZ];
- unsigned long headv;
u8 hook;
};
@@ -311,30 +310,24 @@ static int nfnl_hook_dump(struct sk_buff *nlskb,
unsigned int i = cb->args[0];
rcu_read_lock();
+ cb->seq = smp_load_acquire(&net->nf.hook_base_seq);
e = nfnl_hook_entries_head(family, ctx->hook, net, ctx->devname);
- if (!e)
+ if (!e || IS_ERR(e))
goto done;
- if (IS_ERR(e)) {
- cb->seq++;
- goto done;
- }
-
- if ((unsigned long)e != ctx->headv || i >= e->num_hook_entries)
- cb->seq++;
-
ops = nf_hook_entries_get_hook_ops(e);
for (; i < e->num_hook_entries; i++) {
- err = nfnl_hook_dump_one(nlskb, ctx, ops[i], family,
+ err = nfnl_hook_dump_one(nlskb, ctx, READ_ONCE(ops[i]), family,
cb->nlh->nlmsg_seq);
if (err)
break;
}
done:
- nl_dump_check_consistent(cb, nlmsg_hdr(nlskb));
+ if (nlskb->len > 0)
+ nl_dump_check_consistent(cb, nlmsg_hdr(nlskb));
rcu_read_unlock();
cb->args[0] = i;
return nlskb->len;
@@ -375,10 +368,7 @@ static int nfnl_hook_dump_start(struct netlink_callback *cb)
return -ENOMEM;
strscpy(ctx->devname, name, sizeof(ctx->devname));
- ctx->headv = (unsigned long)head;
ctx->hook = hooknum;
-
- cb->seq = 1;
cb->data = ctx;
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 439/816] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (437 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 438/816] netfilter: nfnetlink: Fix for interrupted hook dumps Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 440/816] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent Greg Kroah-Hartman
` (381 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 89abac4b60b708037595255ea2614b6967c86ee5 ]
pvrdma embeds a pvrdma_ring_state header directly inside the QP and SRQ
ring buffers, and the hypervisor writes cons_head into that header.
Pinning with access=0 does not force a private page copy (no
FOLL_WRITE), so the hypervisor may write into a shared page.
Pass IB_ACCESS_LOCAL_WRITE for all three rings. The SRQ ring_state is
not currently used by the driver but is pinned writable for consistency.
Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-4-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Replaced ib_umem_get_va() with ib_umem_get() in the three ring-pinning calls and re-wrapped the arguments and continuation indentation to fit. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 6 ++++--
drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
index 98b2a0090bf2a..3017a4080235d 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
@@ -270,7 +270,8 @@ int pvrdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
/* set qp->sq.wqe_cnt, shift, buf_size.. */
qp->rumem = ib_umem_get(ibqp->device,
ucmd.rbuf_addr,
- ucmd.rbuf_size, 0);
+ ucmd.rbuf_size,
+ IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(qp->rumem)) {
ret = PTR_ERR(qp->rumem);
goto err_qp;
@@ -282,7 +283,8 @@ int pvrdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
}
qp->sumem = ib_umem_get(ibqp->device, ucmd.sbuf_addr,
- ucmd.sbuf_size, 0);
+ ucmd.sbuf_size,
+ IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(qp->sumem)) {
if (!is_srq)
ib_umem_release(qp->rumem);
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
index bdc2703532c6c..99748f0f296dd 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c
@@ -146,7 +146,8 @@ int pvrdma_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init_attr,
goto err_srq;
}
- srq->umem = ib_umem_get(ibsrq->device, ucmd.buf_addr, ucmd.buf_size, 0);
+ srq->umem = ib_umem_get(ibsrq->device, ucmd.buf_addr, ucmd.buf_size,
+ IB_ACCESS_LOCAL_WRITE);
if (IS_ERR(srq->umem)) {
ret = PTR_ERR(srq->umem);
goto err_srq;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 440/816] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (438 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 439/816] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 441/816] RDMA/mlx5: Set QP event handler before firmware QPC insertion Greg Kroah-Hartman
` (380 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 4354ab7a85d1ddd45a8a3337227fad5b37b44902 ]
mlx5_ib_dev_res_init() returns -EOPNOTSUPP when the firmware XRC
capability is absent, failing driver probe on XRC-less devices.
Make XRC optional throughout the devr resource path: initialize cq_lock
and srq_lock unconditionally (needed for every QP creation), skip xrcd
allocation and the XRC-type placeholder SRQ (s0) when xrc=0, and guard
their cleanup paths accordingly.
Fixes: f4375443b786 ("RDMA/mlx5: Get XRCD number directly for the internal use")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-9-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Wrapped SRQ 0 creation in an XRC capability check as upstream does, but kept this tree's older err=%d, ret error message format instead of upstream's err=%pe. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/main.c | 52 +++++++++++++++++++------------
1 file changed, 32 insertions(+), 20 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 95d65d74dc912..ee58dc153eedc 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3101,7 +3101,7 @@ int mlx5_ib_dev_res_srq_init(struct mlx5_ib_dev *dev)
{
struct mlx5_ib_resources *devr = &dev->devr;
struct ib_srq_init_attr attr;
- struct ib_srq *s0, *s1;
+ struct ib_srq *s0 = NULL, *s1;
int ret = 0;
/*
@@ -3119,17 +3119,25 @@ int mlx5_ib_dev_res_srq_init(struct mlx5_ib_dev *dev)
if (ret)
goto unlock;
- memset(&attr, 0, sizeof(attr));
- attr.attr.max_sge = 1;
- attr.attr.max_wr = 1;
- attr.srq_type = IB_SRQT_XRC;
- attr.ext.cq = devr->c0;
-
- s0 = ib_create_srq(devr->p0, &attr);
- if (IS_ERR(s0)) {
- ret = PTR_ERR(s0);
- mlx5_ib_err(dev, "Couldn't create SRQ 0 for res init, err=%d\n", ret);
- goto unlock;
+ /*
+ * s0 is an XRC-type placeholder SRQ used as the default XRQN for
+ * XRC QPs. Skip it when XRC is absent; all devr->s0 accesses in
+ * qp.c are inside XRC QP paths that the verbs layer blocks before
+ * reaching this driver when xrc=0, so NULL is safe.
+ */
+ if (MLX5_CAP_GEN(dev->mdev, xrc)) {
+ memset(&attr, 0, sizeof(attr));
+ attr.attr.max_sge = 1;
+ attr.attr.max_wr = 1;
+ attr.srq_type = IB_SRQT_XRC;
+ attr.ext.cq = devr->c0;
+
+ s0 = ib_create_srq(devr->p0, &attr);
+ if (IS_ERR(s0)) {
+ ret = PTR_ERR(s0);
+ mlx5_ib_err(dev, "Couldn't create SRQ 0 for res init, err=%d\n", ret);
+ goto unlock;
+ }
}
memset(&attr, 0, sizeof(attr));
@@ -3141,7 +3149,8 @@ int mlx5_ib_dev_res_srq_init(struct mlx5_ib_dev *dev)
if (IS_ERR(s1)) {
ret = PTR_ERR(s1);
mlx5_ib_err(dev, "Couldn't create SRQ 1 for res init, err=%d\n", ret);
- ib_destroy_srq(s0);
+ if (s0)
+ ib_destroy_srq(s0);
goto unlock;
}
@@ -3158,8 +3167,11 @@ static int mlx5_ib_dev_res_init(struct mlx5_ib_dev *dev)
struct mlx5_ib_resources *devr = &dev->devr;
int ret;
+ mutex_init(&devr->cq_lock);
+ mutex_init(&devr->srq_lock);
+
if (!MLX5_CAP_GEN(dev->mdev, xrc))
- return -EOPNOTSUPP;
+ return 0;
ret = mlx5_cmd_xrcd_alloc(dev->mdev, &devr->xrcdn0, 0);
if (ret)
@@ -3171,9 +3183,6 @@ static int mlx5_ib_dev_res_init(struct mlx5_ib_dev *dev)
return ret;
}
- mutex_init(&devr->cq_lock);
- mutex_init(&devr->srq_lock);
-
return 0;
}
@@ -3184,10 +3193,13 @@ static void mlx5_ib_dev_res_cleanup(struct mlx5_ib_dev *dev)
/* After s0/s1 init, they are not unset during the device lifetime. */
if (devr->s1) {
ib_destroy_srq(devr->s1);
- ib_destroy_srq(devr->s0);
+ if (devr->s0)
+ ib_destroy_srq(devr->s0);
+ }
+ if (MLX5_CAP_GEN(dev->mdev, xrc)) {
+ mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn1, 0);
+ mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn0, 0);
}
- mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn1, 0);
- mlx5_cmd_xrcd_dealloc(dev->mdev, devr->xrcdn0, 0);
/* After p0/c0 init, they are not unset during the device lifetime. */
if (devr->c0) {
ib_destroy_cq(devr->c0);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 441/816] RDMA/mlx5: Set QP event handler before firmware QPC insertion
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (439 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 440/816] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 442/816] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard Greg Kroah-Hartman
` (379 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 05a078c97eb0bb7158526dae414b853737692485 ]
Four QP creation paths assigned base->container_mibqp and
base->mqp.event after the firmware create call that inserts the QP into
dev->qp_table.tree. A firmware error EQE in that window reaches
qp->event() with a NULL pointer.
Move both assignments before the firmware call.
Also set ibqp.qp_num inside mlx5_qpc_create_qp() before
create_resource_common() so an EQE arriving early does not observe
qp_num==0.
In addition, add a WARN_ON_ONCE(!qp->event) guard in
rsc_event_notifier() as a safeguard for future regressions.
Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-14-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: adjusted one context line in create_raw_packet_qp() to match this branch's create_raw_packet_qp_sq() call, which has no attrs argument; the inserted lines are unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/qp.c | 22 ++++++++++------------
drivers/infiniband/hw/mlx5/qpc.c | 10 ++++++++++
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 2a71aed3b25ac..62e1302c7cd58 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1599,6 +1599,8 @@ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
if (err)
return err;
+ sq->base.container_mibqp = qp;
+ sq->base.mqp.event = mlx5_ib_qp_event;
err = create_raw_packet_qp_sq(dev, udata, sq, in, pd,
to_mcq(init_attr->send_cq));
if (err)
@@ -1610,9 +1612,6 @@ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
resp->sqn = sq->base.mqp.qpn;
resp->comp_mask |= MLX5_IB_CREATE_QP_RESP_MASK_SQN;
}
-
- sq->base.container_mibqp = qp;
- sq->base.mqp.event = mlx5_ib_qp_event;
}
if (qp->rq.wqe_cnt) {
@@ -2058,13 +2057,13 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
}
base = &qp->trans_qp.base;
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
kvfree(in);
if (err)
return err;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
if (MLX5_CAP_GEN(mdev, ece_support))
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
@@ -2202,14 +2201,14 @@ static int create_dci(struct mlx5_ib_dev *dev, struct ib_pd *pd,
qp->flags &= ~IB_QP_CREATE_PCI_WRITE_END_PADDING;
}
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
kvfree(in);
if (err)
goto err_create;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
if (MLX5_CAP_GEN(mdev, ece_support))
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
@@ -2398,6 +2397,8 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
qp->flags &= ~IB_QP_CREATE_PCI_WRITE_END_PADDING;
}
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
if (init_attr->qp_type == IB_QPT_RAW_PACKET ||
qp->flags & IB_QP_CREATE_SOURCE_QPN) {
qp->raw_packet_qp.sq.ubuffer.buf_addr = ucmd->sq_buf_addr;
@@ -2411,8 +2412,6 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
if (err)
goto err_create;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
if (MLX5_CAP_GEN(mdev, ece_support))
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
@@ -2541,14 +2540,13 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
MLX5_CAP_GEN(mdev, go_back_n))
MLX5_SET(qpc, qpc, retry_mode, MLX5_QP_RM_GO_BACK_N);
+ base->container_mibqp = qp;
+ base->mqp.event = mlx5_ib_qp_event;
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
kvfree(in);
if (err)
goto err_create;
- base->container_mibqp = qp;
- base->mqp.event = mlx5_ib_qp_event;
-
get_cqs(qp->type, attr->send_cq, attr->recv_cq,
&send_cq, &recv_cq);
spin_lock_irqsave(&dev->reset_flow_resource_lock, flags);
diff --git a/drivers/infiniband/hw/mlx5/qpc.c b/drivers/infiniband/hw/mlx5/qpc.c
index 67ed45f3ae17f..9272e1ef81135 100644
--- a/drivers/infiniband/hw/mlx5/qpc.c
+++ b/drivers/infiniband/hw/mlx5/qpc.c
@@ -146,6 +146,8 @@ static int rsc_event_notifier(struct notifier_block *nb,
case MLX5_RES_RQ:
case MLX5_RES_SQ:
qp = (struct mlx5_core_qp *)common;
+ if (WARN_ON_ONCE(!qp->event))
+ goto out;
qp->event(qp, event_type);
/* Need to put resource in event handler */
return NOTIFY_OK;
@@ -258,6 +260,14 @@ int mlx5_qpc_create_qp(struct mlx5_ib_dev *dev, struct mlx5_core_qp *qp,
qp->uid = MLX5_GET(create_qp_in, in, uid);
qp->qpn = MLX5_GET(create_qp_out, out, qpn);
+ /* Set ibqp.qp_num before create_resource_common() inserts the QP into
+ * the radix tree and makes it visible to EQE processing. The
+ * assignment in create_qp() happens only after this function returns,
+ * leaving a window where an arriving EQE would observe qp_num == 0.
+ * create_qp() still overrides this with 0/1 for QP0/QP1, and sets it
+ * independently for DCT (which does not go through this function).
+ */
+ to_mibqp(qp)->ibqp.qp_num = qp->qpn;
err = create_resource_common(dev, qp, MLX5_RES_QP);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 442/816] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (440 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 441/816] RDMA/mlx5: Set QP event handler before firmware QPC insertion Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 443/816] perf evsel: Clamp sample_id size for ksymbol, bpf, and text_poke events Greg Kroah-Hartman
` (378 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Venkat Rao Bagalkote,
Mukesh Kumar Chaurasiya, Shrikanth Hegde, Madhavan Srinivasan,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
[ Upstream commit 644ffb02746690c0ebfe143e066f81c9bde2975e ]
radix_enabled() uses a jump label which is only valid after
setup_feature_keys() is called. Before that point, on a pSeries
hash guest, early_check_vec5() clears MMU_FTR_TYPE_RADIX in
cur_cpu_spec->mmu_features, but the jump label has not yet been patched,
so radix_enabled() incorrectly returns true.
The dangerous usage window where it goes wrong in early_setup():
early_setup:
configure_exceptions();
<exceptions can happen now, and handler enter/exit can be invoked>
<those could use radix_enabled(), which returns stale true>
setup_feature_keys();
<jump labels set up; post this it is safe to use radix_enabled()>
If an NMI occurs in this window, !radix_enabled() evaluates to false in
DEFINE_INTERRUPT_HANDLER_NMI. The handler fails to skip NMI entry in real
mode and attempts to access memory outside the Real Mode Area (RMA),
hanging the boot.
Since common interrupt wrappers do not have the context of early or late,
using early_radix_enabled() is the safer option. It does a plain bitmask
check against cur_cpu_spec->mmu_features and is correct at all times.
Console logs from a pSeries HASH guest showing values across boot stages:
[ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=0 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!)
[ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=0 radix_enabled=1
[ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=0 radix_enabled=0 (should now match!)
[ 0.057124] DEBUG: post secondary CPU bringup: early_radix_enabled=0 radix_enabled=0 (should match!)
Console logs from a RADIX guest showing values across boot stages:
[ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=1 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!)
[ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=1 radix_enabled=1
[ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=1 radix_enabled=1 (should now match!)
[ 0.057016] DEBUG: post secondary CPU bringup: early_radix_enabled=1 radix_enabled=1 (should match!)
Add the missing #include <asm/mmu.h> in alphabetical order since
early_radix_enabled() is declared there.
Fixes: 8d0e21012743 ("powerpc/mce: Avoid nmi_enter/exit in real mode on pseries hash")
Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Reviewed-by: Mukesh Kumar Chaurasiya <mkchauras@gmail.com>
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260909123240.58786-1-venkat88@linux.ibm.com
[ sashal: Moved the pseries-hash real-mode NMI guards from the upstream DEFINE_INTERRUPT_HANDLER_NMI macro to the two static inline functions interrupt_nmi_enter_prepare() and interrupt_nmi_exit_prepare(), with the include context adjusted. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/include/asm/interrupt.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
index 23638d4e73ac0..bf25db6848ce8 100644
--- a/arch/powerpc/include/asm/interrupt.h
+++ b/arch/powerpc/include/asm/interrupt.h
@@ -72,6 +72,7 @@
#include <asm/firmware.h>
#include <asm/ftrace.h>
#include <asm/kprobes.h>
+#include <asm/mmu.h>
#include <asm/runlatch.h>
#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
@@ -326,7 +327,7 @@ static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct inte
*/
if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) &&
firmware_has_feature(FW_FEATURE_LPAR) &&
- !radix_enabled())
+ !early_radix_enabled())
return;
/*
@@ -355,7 +356,7 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
nmi_exit();
} else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) &&
firmware_has_feature(FW_FEATURE_LPAR) &&
- !radix_enabled()) {
+ !early_radix_enabled()) {
// no nmi_exit for a pseries hash guest taking a real mode exception
} else if (IS_ENABLED(CONFIG_KASAN)) {
// no nmi_exit for KASAN in real mode
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 443/816] perf evsel: Clamp sample_id size for ksymbol, bpf, and text_poke events
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (441 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 442/816] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 444/816] ALSA: usb-audio: Fix UAC2 mixer unit request handling Greg Kroah-Hartman
` (377 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Adrian Hunter, Song Liu,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 7c89ea1bd4c612eb5cc2e6c01f77ebfc21d5c95d ]
On kernels without the fix ("perf/core: Restore header fields in
sideband output callbacks") to restore event_id.header.size in
perf_event_ksymbol_output(), perf_event_bpf_output(), and
perf_event_text_poke_output(), concurrent perf sessions cause those
sideband records to be emitted with header.size inflated by multiple
id_header_size increments while the single id_sample is written
immediately after the event payload. Indexing backwards from
event->header.size reads uninitialized ring-buffer bytes at the end of
the record, causing evlist__event2evsel() to fail with -EFAULT.
Add evsel__event_size() to clamp the effective size used to locate the
trailing id_sample for PERF_RECORD_KSYMBOL, PERF_RECORD_BPF_EVENT, and
PERF_RECORD_TEXT_POKE to payload + id_hdr_size while leaving
event->header.size intact for advancing the ring-buffer/file stream.
Fixes: 9aa0bfa370b278a5 ("perf tools: Handle PERF_RECORD_KSYMBOL")
Fixes: 45178a928a4b7c60 ("perf tools: Handle PERF_RECORD_BPF_EVENT")
Fixes: 246eba8e9041c477 ("perf tools: Add support for PERF_RECORD_TEXT_POKE")
Link: https://lore.kernel.org/r/20260929014206.4175245-1-irogers@google.com
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Song Liu <songliubraving@fb.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Adapted to older code by using the evlist->id_pos/is_pos fields and the pointer-walking loop in perf_evsel__parse_id_sample(), swapping in evsel__event_size() for header.size. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/evlist.c | 6 ++--
tools/perf/util/evsel.c | 59 +++++++++++++++++++++++++++++++++++++++-
tools/perf/util/evsel.h | 1 +
3 files changed, 63 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index dac87dccaaaa5..bdf923e6570af 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -701,13 +701,15 @@ static int evlist__event2id(struct evlist *evlist, union perf_event *event, u64
const __u64 *array = event->sample.array;
ssize_t n;
- n = (event->header.size - sizeof(event->header)) >> 3;
-
if (event->header.type == PERF_RECORD_SAMPLE) {
+ n = (event->header.size - sizeof(event->header)) >> 3;
if (evlist->id_pos >= n)
return -1;
*id = array[evlist->id_pos];
} else {
+ u16 size = evsel__event_size(evlist__first(evlist), event);
+
+ n = (size - sizeof(event->header)) >> 3;
if (evlist->is_pos > n)
return -1;
n -= evlist->is_pos;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 6798db83bf7cc..0cb488017bbbe 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2524,7 +2524,7 @@ static int perf_evsel__parse_id_sample(const struct evsel *evsel,
bool swapped = evsel->needs_swap;
union u64_swap u;
- array += ((event->header.size -
+ array += ((evsel__event_size(evsel, event) -
sizeof(event->header)) / sizeof(u64)) - 1;
if (type & PERF_SAMPLE_IDENTIFIER) {
@@ -3109,6 +3109,63 @@ u16 evsel__id_hdr_size(const struct evsel *evsel)
return size;
}
+/*
+ * Prior to kernel fix, perf_event_ksymbol_output(), perf_event_bpf_output(),
+ * and perf_event_text_poke_output() in kernel/events/core.c did not save and
+ * restore event_id.header.size across perf_iterate_sb() iterations. When
+ * multiple perf_events had attr.ksymbol, attr.bpf_event, or attr.text_poke
+ * enabled, header.size was incremented by id_header_size for each matching
+ * event while only a single id_sample was written immediately after the event
+ * payload. Clamp the effective size used to locate the trailing id_sample to
+ * payload + id_hdr_size so events recorded on unpatched kernels can be parsed
+ * without reading uninitialized ring-buffer bytes.
+ */
+u16 evsel__event_size(const struct evsel *evsel, const union perf_event *event)
+{
+ u16 size = event->header.size;
+ u16 id_hdr_size;
+ size_t payload;
+
+ if (!evsel->core.attr.sample_id_all)
+ return size;
+
+ switch (event->header.type) {
+ case PERF_RECORD_KSYMBOL: {
+ const char *name = event->ksymbol.name;
+ size_t fixed = offsetof(struct perf_record_ksymbol, name);
+ size_t max_len, len;
+
+ if (size <= fixed)
+ return size;
+ max_len = size - fixed;
+ len = strnlen(name, max_len);
+ if (len == max_len)
+ return size;
+ payload = fixed + PERF_ALIGN(len + 1, sizeof(u64));
+ break;
+ }
+ case PERF_RECORD_BPF_EVENT:
+ payload = sizeof(struct perf_record_bpf_event);
+ break;
+ case PERF_RECORD_TEXT_POKE: {
+ size_t fixed = offsetof(struct perf_record_text_poke_event, bytes);
+
+ if (size < fixed)
+ return size;
+ payload = PERF_ALIGN(fixed + (size_t)event->text_poke.old_len +
+ event->text_poke.new_len, sizeof(u64));
+ break;
+ }
+ default:
+ return size;
+ }
+
+ id_hdr_size = evsel__id_hdr_size(evsel);
+ if (payload + id_hdr_size < size)
+ return payload + id_hdr_size;
+ return size;
+}
+
#ifdef HAVE_LIBTRACEEVENT
struct tep_format_field *evsel__field(struct evsel *evsel, const char *name)
{
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index dc0d300776f16..7f2f5d85edf70 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -435,6 +435,7 @@ int evsel__parse_sample_timestamp(struct evsel *evsel, union perf_event *event,
u64 *timestamp);
u16 evsel__id_hdr_size(const struct evsel *evsel);
+u16 evsel__event_size(const struct evsel *evsel, const union perf_event *event);
static inline struct evsel *evsel__next(struct evsel *evsel)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 444/816] ALSA: usb-audio: Fix UAC2 mixer unit request handling
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (442 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 443/816] perf evsel: Clamp sample_id size for ksymbol, bpf, and text_poke events Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 445/816] s390/ism: Zerorize dmb at allocation Greg Kroah-Hartman
` (376 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zipdox, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 0458d97859840506c3688a963dcd4f72b4a23083 ]
For a request for a Mixer Unit on UAC2 (also UAC3), the wValue is
different from UAC1 and an incompatible value must be passed.
Namely, UAC1 takes a word consisting of 1-based input channel in the
high byte and 1-based output channel in the low byte.
Meanwhile, UAC2/3 takes UAC2_MU_MIXER in the high byte and a MCN
(0-based bit position of input/output channels) in the low byte.
The current driver implementation blindly assumes the UAC1 way, hence
it would cause a firmware error.
This patch attempts to implement the conversion to UAC2 MCN at
get_ctl_value_v2() and snd_usb_mixer_set_ctl_value() for mixer units.
At the points above, the old wValue containing ICN and OCN is
converted to the corresponding MCN, and it's used as the proper
wValue.
Reported-by: Zipdox <zipdox@zipdox.net>
Closes: https://lore.kernel.org/d46fcac6-bd7e-4fc4-95e1-4e8d39f92ad3@zipdox.net
Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260930155356.348608-3-tiwai@suse.de
[ sashal: Context differs: the tail of get_ctl_value_v1() and the neighboring struct field (no get_cur_broken) are older here, but the patch hunks themselves are identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/mixer.c | 23 +++++++++++++++++++++++
sound/usb/mixer.h | 2 ++
2 files changed, 25 insertions(+)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index ae311c95ac023..394d3f1193838 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -340,6 +340,17 @@ static int get_ctl_value_v1(struct usb_mixer_elem_info *cval, int request,
return err;
}
+/* convert the given UAC1 wValue (ICN|OCN) to UAC2 MCN */
+static unsigned char to_mcn(const struct usb_mixer_elem_info *cval,
+ unsigned int validx)
+{
+ unsigned char m = (validx >> 8) & 0xff; /* 1-based input channel */
+ unsigned char v = validx & 0xff; /* 1-based output channel */
+
+ /* num_inputs * num_outputs is guaranteed to be < 256 */
+ return (m - 1) * cval->num_outputs + (v - 1);
+}
+
static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request,
int validx, int *value_ret)
{
@@ -352,6 +363,10 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request,
val_size = uac2_ctl_value_size(cval->val_type);
+ /* correct wValue for UAC2 mixer control with MCN */
+ if (cval->v2_mixer)
+ validx = (UAC2_MU_MIXER << 8) | to_mcn(cval, validx);
+
if (request == UAC_GET_CUR) {
bRequest = UAC2_CS_CUR;
size = val_size;
@@ -476,6 +491,10 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
}
request = UAC2_CS_CUR;
+
+ /* correct wValue for UAC2 mixer control with MCN */
+ if (cval->v2_mixer)
+ validx = (UAC2_MU_MIXER << 8) | to_mcn(cval, validx);
}
value_set = convert_bytes_value(cval, value_set);
@@ -2208,6 +2227,10 @@ static void build_mixer_unit_ctl(struct mixer_build *state,
snd_usb_mixer_elem_init_std(&cval->head, state->mixer, unitid);
cval->control = in_ch + 1; /* based on 1 */
+ if (state->mixer->protocol == UAC_VERSION_2 ||
+ state->mixer->protocol == UAC_VERSION_3)
+ cval->v2_mixer = true;
+ cval->num_outputs = num_outs;
cval->val_type = USB_MIXER_S16;
for (i = 0; i < num_outs; i++) {
__u8 *c = uac_mixer_unit_bmControls(desc, state->mixer->protocol);
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
index 8e5e8da6d480f..00ffefb751d2a 100644
--- a/sound/usb/mixer.h
+++ b/sound/usb/mixer.h
@@ -97,6 +97,8 @@ struct usb_mixer_elem_info {
int cache_val[MAX_CHANNELS];
u8 initialized;
u8 min_mute;
+ u8 num_outputs;
+ bool v2_mixer;
void *private_data;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 445/816] s390/ism: Zerorize dmb at allocation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (443 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 444/816] ALSA: usb-audio: Fix UAC2 mixer unit request handling Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 446/816] mei: vsc-tp: initialize IRQ state before requesting interrupt Greg Kroah-Hartman
` (375 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandra Winter, Julian Ruess,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandra Winter <wintera@linux.ibm.com>
[ Upstream commit a0227fa24e8a2a0397cc4eb669731ff8d9161bbd ]
Sashiko reported [1] that 'Missing __GFP_ZERO in folio_alloc() causes
uninitialized kernel memory to be exposed in the receive message buffer'.
An ism dmb is receive-only, so the data is not leaked to a remote peer.
In general the smc kernel module (dibs client) will only push newly
received data to userspace. We still should not have uninitialized data
in a receive buffer.
Since
commit 750afb08ca71 ("cross-tree: phase out dma_zalloc_coherent()")
dma_alloc_coherent no longer required the __GFP_ZERO flag, but when
commit 83781384a96b ("s390/ism: Properly fix receive message buffer allocation")
switched to folio_alloc(), it should have added back the __GFP_ZERO flag.
Add __GFP_ZERO flag and state in dibs.h that register_dbm() provides
a zerorized buffer (dibs_lo already does).
Link: https://lore.kernel.org/linux-s390/20260903143746.A5CC41F00A3A@smtp.kernel.org/ [1]
Fixes: 83781384a96b ("s390/ism: Properly fix receive message buffer allocation")
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Julian Ruess <julianr@linux.ibm.com>
Link: https://patch.msgid.link/20260928151420.383105-1-wintera@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Dropped the include/linux/dibs.h comment hunk because that file doesn't exist here, and applied the __GFP_ZERO change to folio_alloc() at a different offset with older ISM context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/net/ism_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c
index c728095fc5059..0125168a45cb7 100644
--- a/drivers/s390/net/ism_drv.c
+++ b/drivers/s390/net/ism_drv.c
@@ -328,7 +328,8 @@ static int ism_alloc_dmb(struct ism_dev *ism, struct ism_dmb *dmb)
return -EINVAL;
folio = folio_alloc(GFP_KERNEL | __GFP_NOWARN | __GFP_NOMEMALLOC |
- __GFP_NORETRY, get_order(dmb->dmb_len));
+ __GFP_NORETRY | __GFP_ZERO,
+ get_order(dmb->dmb_len));
if (!folio) {
rc = -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 446/816] mei: vsc-tp: initialize IRQ state before requesting interrupt
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (444 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 445/816] s390/ism: Zerorize dmb at allocation Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 447/816] debugfs: make debugfs_create_str() read-only Greg Kroah-Hartman
` (374 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Runyu Xiao, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Runyu Xiao <runyu.xiao@seu.edu.cn>
[ Upstream commit 7754a2924604ea442ef03ed8fc12ccc9221a2e98 ]
request_threaded_irq() enables the interrupt before returning, so the
threaded handler may schedule work while the probe is still initializing
its mutexes and work item. Initialize that state first and only free the
IRQ on paths where the request succeeded.
Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
Assisted-by: LLM
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Link: https://patch.msgid.link/20260929132245.2152433-1-runyu.xiao@seu.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ sashal: Dropped the event_work/INIT_WORK and cancel_work_sync parts that don't exist in this tree, and kept the existing vsc_tp_isr/vsc_tp_thread_isr arguments, so only the mutex_init reordering and err_free_irq unwind were applied. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/misc/mei/vsc-tp.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c
index 1fe760adb2e4f..d351f8af976b2 100644
--- a/drivers/misc/mei/vsc-tp.c
+++ b/drivers/misc/mei/vsc-tp.c
@@ -527,29 +527,29 @@ static int vsc_tp_probe(struct spi_device *spi)
init_waitqueue_head(&tp->xfer_wait);
tp->spi = spi;
+ mutex_init(&tp->mutex);
+ mutex_init(&tp->event_notify_mutex);
+
irq_set_status_flags(spi->irq, IRQ_DISABLE_UNLAZY);
ret = request_threaded_irq(spi->irq, vsc_tp_isr, vsc_tp_thread_isr,
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
dev_name(dev), tp);
if (ret)
- return ret;
-
- mutex_init(&tp->mutex);
- mutex_init(&tp->event_notify_mutex);
+ goto err_destroy_lock;
/* only one child acpi device */
ret = acpi_dev_for_each_child(ACPI_COMPANION(dev),
vsc_tp_match_any, &adev);
if (!ret) {
ret = -ENODEV;
- goto err_destroy_lock;
+ goto err_free_irq;
}
pinfo.fwnode = acpi_fwnode_handle(adev);
pdev = platform_device_register_full(&pinfo);
if (IS_ERR(pdev)) {
ret = PTR_ERR(pdev);
- goto err_destroy_lock;
+ goto err_free_irq;
}
tp->pdev = pdev;
@@ -557,9 +557,10 @@ static int vsc_tp_probe(struct spi_device *spi)
return 0;
-err_destroy_lock:
+err_free_irq:
free_irq(spi->irq, tp);
+err_destroy_lock:
mutex_destroy(&tp->event_notify_mutex);
mutex_destroy(&tp->mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 447/816] debugfs: make debugfs_create_str() read-only
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (445 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 446/816] mei: vsc-tp: initialize IRQ state before requesting interrupt Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 448/816] riscv: dts: starfive: jh7110-common: revised device node Greg Kroah-Hartman
` (373 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yichong Chen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yichong Chen <chenyichong@uniontech.com>
[ Upstream commit 5ec78be9552035e1e71de218f968c03c44181bf0 ]
debugfs_create_str() supports replacing the backing string from userspace.
Concurrent writers can race and free the same old string twice.
All writable in-tree users have been converted to local file operations.
Remove the generic write support from debugfs_create_str(), and refuse to
create a file when the caller passes write permission bits.
This makes unsupported writable use visible instead of silently creating a
file with different permissions.
Fixes: 86b5488121db ("debugfs: Add write support to debugfs_create_str()")
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Link: https://patch.msgid.link/20260807100053.1089834-4-chenyichong@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/debugfs/file.c | 81 ++++++-----------------------------------------
1 file changed, 10 insertions(+), 71 deletions(-)
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index cc9587a1c9a9f..b1940faa4020d 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -992,98 +992,37 @@ ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf,
return ret;
}
-static ssize_t debugfs_write_file_str(struct file *file, const char __user *user_buf,
- size_t count, loff_t *ppos)
-{
- struct dentry *dentry = F_DENTRY(file);
- char *old, *new = NULL;
- int pos = *ppos;
- int r;
-
- r = debugfs_file_get(dentry);
- if (unlikely(r))
- return r;
-
- old = *(char **)file->private_data;
-
- /* only allow strict concatenation */
- r = -EINVAL;
- if (pos && pos != strlen(old))
- goto error;
-
- r = -E2BIG;
- if (pos + count + 1 > PAGE_SIZE)
- goto error;
-
- r = -ENOMEM;
- new = kmalloc(pos + count + 1, GFP_KERNEL);
- if (!new)
- goto error;
-
- if (pos)
- memcpy(new, old, pos);
-
- r = -EFAULT;
- if (copy_from_user(new + pos, user_buf, count))
- goto error;
-
- new[pos + count] = '\0';
- strim(new);
-
- rcu_assign_pointer(*(char __rcu **)file->private_data, new);
- synchronize_rcu();
- kfree(old);
-
- debugfs_file_put(dentry);
- return count;
-
-error:
- kfree(new);
- debugfs_file_put(dentry);
- return r;
-}
-
static const struct file_operations fops_str = {
.read = debugfs_read_file_str,
- .write = debugfs_write_file_str,
- .open = simple_open,
- .llseek = default_llseek,
-};
-
-static const struct file_operations fops_str_ro = {
- .read = debugfs_read_file_str,
- .open = simple_open,
- .llseek = default_llseek,
-};
-
-static const struct file_operations fops_str_wo = {
- .write = debugfs_write_file_str,
.open = simple_open,
.llseek = default_llseek,
};
/**
- * debugfs_create_str - create a debugfs file that is used to read and write a string value
+ * debugfs_create_str - create a debugfs file that is used to read a string value
* @name: a pointer to a string containing the name of the file to create.
* @mode: the permission that the file should have
* @parent: a pointer to the parent dentry for this file. This should be a
* directory dentry if set. If this parameter is %NULL, then the
* file will be created in the root of the debugfs filesystem.
- * @value: a pointer to the variable that the file should read to and write
- * from. This pointer and the string it points to must not be %NULL.
+ * @value: a pointer to the variable that the file should read from. This
+ * pointer and the string it points to must not be %NULL.
*
* This function creates a file in debugfs with the given name that
- * contains the value of the variable @value. If the @mode variable is so
- * set, it can be read from, and written to.
+ * contains the value of the variable @value. The file can be read from.
+ * Writable files are not supported; if @mode contains write permission bits,
+ * no file is created.
*/
void debugfs_create_str(const char *name, umode_t mode,
struct dentry *parent, char **value)
{
if (WARN_ON(!value || !*value))
return;
+ if (WARN(mode & 0222,
+ "%s() does not support writable files\n", __func__))
+ return;
- debugfs_create_mode_unsafe(name, mode, parent, value, &fops_str,
- &fops_str_ro, &fops_str_wo);
+ debugfs_create_file_unsafe(name, mode, parent, value, &fops_str);
}
EXPORT_SYMBOL_GPL(debugfs_create_str);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 448/816] riscv: dts: starfive: jh7110-common: revised device node
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (446 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 447/816] debugfs: make debugfs_create_str() read-only Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 449/816] riscv: dts: starfive: Correct pwm nodes Greg Kroah-Hartman
` (372 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alex Elder, Guodong Xu,
Emil Renner Berthing, Conor Dooley, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guodong Xu <guodong@riscstar.com>
[ Upstream commit 5a5001d27065126d815eb54e12744b08322e3d31 ]
Earlier this year a new DTSI file was created to define common
properties for the StarFive VisionFive 2 and Milk-V Mars boards,
both of which use the StarFive JH7110 SoC. The Pine64 Star64
board has also been added since that time.
Some of the nodes defined in "jh7110-common.dtsi" are enabled in
that file because all of the boards including it "want" them
enabled.
An upcoming patch enables another JH7110 board, but for that
board not all of these common nodes should be enabled. Prepare
for supporting the new board by avoiding enabling these nodes in
"jh7110-common.dtsi", and enable them instead in these files:
jh7110-milkv-mars.dts
jh7110-pine64-star64.dts
jh7110-starfive-visionfive-2.dtsi
Signed-off-by: Alex Elder <elder@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Stable-dep-of: 2186ec5f59c2 ("riscv: dts: starfive: Correct pwm nodes")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../boot/dts/starfive/jh7110-common.dtsi | 5 -----
.../boot/dts/starfive/jh7110-milkv-mars.dts | 17 ++++++++++++++++
.../dts/starfive/jh7110-pine64-star64.dts | 17 ++++++++++++++++
.../jh7110-starfive-visionfive-2.dtsi | 20 +++++++++++++++++++
4 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
index d6c55f1cc96a9..82edf8134d93f 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
@@ -174,7 +174,6 @@ csi2rx_to_camss: endpoint {
&gmac0 {
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
- status = "okay";
mdio {
#address-cells = <1>;
@@ -194,7 +193,6 @@ &i2c0 {
i2c-scl-falling-time-ns = <510>;
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
- status = "okay";
};
&i2c2 {
@@ -309,7 +307,6 @@ &pcie1 {
&pwmdac {
pinctrl-names = "default";
pinctrl-0 = <&pwmdac_pins>;
- status = "okay";
};
&qspi {
@@ -348,13 +345,11 @@ uboot@100000 {
&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm_pins>;
- status = "okay";
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;
- status = "okay";
spi_dev0: spi@0 {
compatible = "rohm,dh2228fv";
diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
index 5cb9e99e1dacd..66ad3eb2fd665 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
@@ -15,6 +15,11 @@ &gmac0 {
starfive,tx-use-rgmii-clk;
assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
+ status = "okay";
+};
+
+&i2c0 {
+ status = "okay";
};
&pcie0 {
@@ -35,3 +40,15 @@ &phy0 {
rx-internal-delay-ps = <1500>;
tx-internal-delay-ps = <1500>;
};
+
+&pwm {
+ status = "okay";
+};
+
+&pwmdac {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+};
diff --git a/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts b/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts
index 8e39fdc73ecb8..25cf14b33518e 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts
@@ -18,6 +18,7 @@ &gmac0 {
starfive,tx-use-rgmii-clk;
assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
+ status = "okay";
};
&gmac1 {
@@ -39,6 +40,10 @@ phy1: ethernet-phy@1 {
};
};
+&i2c0 {
+ status = "okay";
+};
+
&pcie1 {
status = "okay";
};
@@ -62,3 +67,15 @@ &phy1 {
motorcomm,tx-clk-10-inverted;
motorcomm,tx-clk-100-inverted;
};
+
+&pwm {
+ status = "okay";
+};
+
+&pwmdac {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+};
diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
index 18f38fc790a4d..ef93a394bb2f1 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
@@ -13,6 +13,10 @@ aliases {
};
};
+&gmac0 {
+ status = "okay";
+};
+
&gmac1 {
phy-handle = <&phy1>;
phy-mode = "rgmii-id";
@@ -29,6 +33,10 @@ phy1: ethernet-phy@1 {
};
};
+&i2c0 {
+ status = "okay";
+};
+
&mmc0 {
non-removable;
};
@@ -40,3 +48,15 @@ &pcie0 {
&pcie1 {
status = "okay";
};
+
+&pwm {
+ status = "okay";
+};
+
+&pwmdac {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+};
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 449/816] riscv: dts: starfive: Correct pwm nodes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (447 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 448/816] riscv: dts: starfive: jh7110-common: revised device node Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 450/816] bpf: Roll back freplace link state when bpf_arch_text_poke() fails Greg Kroah-Hartman
` (371 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hal Feng, Maud Spierings,
Conor Dooley, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hal Feng <hal.feng@starfivetech.com>
[ Upstream commit 2186ec5f59c23fcf0bf896ca0543b6a1135d7bb5 ]
Each of the StarFive JH7100/JH7110 SoCs has 8 OpenCores PTC IP
cores. One OpenCores PTC IP core can output one PWM channel.
Change the register size to 0x10, since an OpenCores PTC IP
has only 4 32-bit registers: CNTR, HRC, LRC and CTRL.
Fixes: 8d01f741a046 ("riscv: dts: starfive: jh7110: Add PWM node and pins configuration")
Fixes: 5e598b99fedf ("riscv: dts: starfive: jh7100: Add PWM node and pins configuration")
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Tested-by: Maud Spierings <maud_spierings@hotmail.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
[ sashal: Dropped the two board dtsi files that don't exist in this tree (milkv-marscm and visionfive-2-lite), since the commits adding them were skipped; everything else is identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../boot/dts/starfive/jh7100-common.dtsi | 28 ++++++--
arch/riscv/boot/dts/starfive/jh7100.dtsi | 67 ++++++++++++++++++-
.../boot/dts/starfive/jh7110-common.dtsi | 27 ++++++--
.../boot/dts/starfive/jh7110-milkv-mars.dts | 6 +-
.../dts/starfive/jh7110-pine64-star64.dts | 6 +-
.../jh7110-starfive-visionfive-2.dtsi | 6 +-
arch/riscv/boot/dts/starfive/jh7110.dtsi | 67 ++++++++++++++++++-
7 files changed, 188 insertions(+), 19 deletions(-)
diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi
index ae1a6aeb0aeaa..85106545090ea 100644
--- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi
@@ -199,13 +199,23 @@ GPO_I2C2_PAD_SDA_OEN,
};
};
- pwm_pins: pwm-0 {
- pwm-pins {
+ pwm0_pins: pwm0-0 {
+ pwm0-pins {
pinmux = <GPIOMUX(7,
GPO_PWM_PAD_OUT_BIT0,
GPO_PWM_PAD_OE_N_BIT0,
- GPI_NONE)>,
- <GPIOMUX(5,
+ GPI_NONE)>;
+ bias-disable;
+ drive-strength = <35>;
+ input-disable;
+ input-schmitt-disable;
+ slew-rate = <0>;
+ };
+ };
+
+ pwm1_pins: pwm1-0 {
+ pwm1-pins {
+ pinmux = <GPIOMUX(5,
GPO_PWM_PAD_OUT_BIT1,
GPO_PWM_PAD_OE_N_BIT1,
GPI_NONE)>;
@@ -359,9 +369,15 @@ &osc_aud {
clock-frequency = <27000000>;
};
-&pwm {
+&pwm0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm0_pins>;
+ status = "okay";
+};
+
+&pwm1 {
pinctrl-names = "default";
- pinctrl-0 = <&pwm_pins>;
+ pinctrl-0 = <&pwm1_pins>;
status = "okay";
};
diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts/starfive/jh7100.dtsi
index 7de0732b8eabe..90438df1f74d3 100644
--- a/arch/riscv/boot/dts/starfive/jh7100.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi
@@ -360,9 +360,72 @@ watchdog@12480000 {
<&rstgen JH7100_RSTN_WDT>;
};
- pwm: pwm@12490000 {
+ pwm0: pwm@12490000 {
compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
- reg = <0x0 0x12490000 0x0 0x10000>;
+ reg = <0x0 0x12490000 0x0 0x10>;
+ clocks = <&clkgen JH7100_CLK_PWM_APB>;
+ resets = <&rstgen JH7100_RSTN_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm1: pwm@12490010 {
+ compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x12490010 0x0 0x10>;
+ clocks = <&clkgen JH7100_CLK_PWM_APB>;
+ resets = <&rstgen JH7100_RSTN_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm2: pwm@12490020 {
+ compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x12490020 0x0 0x10>;
+ clocks = <&clkgen JH7100_CLK_PWM_APB>;
+ resets = <&rstgen JH7100_RSTN_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm3: pwm@12490030 {
+ compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x12490030 0x0 0x10>;
+ clocks = <&clkgen JH7100_CLK_PWM_APB>;
+ resets = <&rstgen JH7100_RSTN_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm4: pwm@12498000 {
+ compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x12498000 0x0 0x10>;
+ clocks = <&clkgen JH7100_CLK_PWM_APB>;
+ resets = <&rstgen JH7100_RSTN_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm5: pwm@12498010 {
+ compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x12498010 0x0 0x10>;
+ clocks = <&clkgen JH7100_CLK_PWM_APB>;
+ resets = <&rstgen JH7100_RSTN_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm6: pwm@12498020 {
+ compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x12498020 0x0 0x10>;
+ clocks = <&clkgen JH7100_CLK_PWM_APB>;
+ resets = <&rstgen JH7100_RSTN_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm7: pwm@12498030 {
+ compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x12498030 0x0 0x10>;
clocks = <&clkgen JH7100_CLK_PWM_APB>;
resets = <&rstgen JH7100_RSTN_PWM_APB>;
#pwm-cells = <3>;
diff --git a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
index 82edf8134d93f..a75d267a0ea2f 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
@@ -342,9 +342,14 @@ uboot@100000 {
};
};
-&pwm {
+&pwm0 {
pinctrl-names = "default";
- pinctrl-0 = <&pwm_pins>;
+ pinctrl-0 = <&pwm0_pins>;
+};
+
+&pwm1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm1_pins>;
};
&spi0 {
@@ -550,12 +555,22 @@ GPOEN_ENABLE,
};
};
- pwm_pins: pwm-0 {
- pwm-pins {
+ pwm0_pins: pwm0-0 {
+ pwm0-pins {
pinmux = <GPIOMUX(46, GPOUT_SYS_PWM_CHANNEL0,
GPOEN_SYS_PWM0_CHANNEL0,
- GPI_NONE)>,
- <GPIOMUX(59, GPOUT_SYS_PWM_CHANNEL1,
+ GPI_NONE)>;
+ bias-disable;
+ drive-strength = <12>;
+ input-disable;
+ input-schmitt-disable;
+ slew-rate = <0>;
+ };
+ };
+
+ pwm1_pins: pwm1-0 {
+ pwm1-pins {
+ pinmux = <GPIOMUX(59, GPOUT_SYS_PWM_CHANNEL1,
GPOEN_SYS_PWM0_CHANNEL1,
GPI_NONE)>;
bias-disable;
diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
index 66ad3eb2fd665..454d40ac64566 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
@@ -41,7 +41,11 @@ &phy0 {
tx-internal-delay-ps = <1500>;
};
-&pwm {
+&pwm0 {
+ status = "okay";
+};
+
+&pwm1 {
status = "okay";
};
diff --git a/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts b/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts
index 25cf14b33518e..95563bc271353 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts
@@ -68,7 +68,11 @@ &phy1 {
motorcomm,tx-clk-100-inverted;
};
-&pwm {
+&pwm0 {
+ status = "okay";
+};
+
+&pwm1 {
status = "okay";
};
diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
index ef93a394bb2f1..03c6148ef8779 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
@@ -49,7 +49,11 @@ &pcie1 {
status = "okay";
};
-&pwm {
+&pwm0 {
+ status = "okay";
+};
+
+&pwm1 {
status = "okay";
};
diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
index 0d8339357bad3..5add1a3d21eb4 100644
--- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
@@ -835,9 +835,72 @@ i2stx1: i2s@120c0000 {
status = "disabled";
};
- pwm: pwm@120d0000 {
+ pwm0: pwm@120d0000 {
compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
- reg = <0x0 0x120d0000 0x0 0x10000>;
+ reg = <0x0 0x120d0000 0x0 0x10>;
+ clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
+ resets = <&syscrg JH7110_SYSRST_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm1: pwm@120d0010 {
+ compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x120d0010 0x0 0x10>;
+ clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
+ resets = <&syscrg JH7110_SYSRST_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm2: pwm@120d0020 {
+ compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x120d0020 0x0 0x10>;
+ clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
+ resets = <&syscrg JH7110_SYSRST_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm3: pwm@120d0030 {
+ compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x120d0030 0x0 0x10>;
+ clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
+ resets = <&syscrg JH7110_SYSRST_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm4: pwm@120d8000 {
+ compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x120d8000 0x0 0x10>;
+ clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
+ resets = <&syscrg JH7110_SYSRST_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm5: pwm@120d8010 {
+ compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x120d8010 0x0 0x10>;
+ clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
+ resets = <&syscrg JH7110_SYSRST_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm6: pwm@120d8020 {
+ compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x120d8020 0x0 0x10>;
+ clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
+ resets = <&syscrg JH7110_SYSRST_PWM_APB>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
+ pwm7: pwm@120d8030 {
+ compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
+ reg = <0x0 0x120d8030 0x0 0x10>;
clocks = <&syscrg JH7110_SYSCLK_PWM_APB>;
resets = <&syscrg JH7110_SYSRST_PWM_APB>;
#pwm-cells = <3>;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 450/816] bpf: Roll back freplace link state when bpf_arch_text_poke() fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (448 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 449/816] riscv: dts: starfive: Correct pwm nodes Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 451/816] scsi: scsi_debug: Avoid 32-bit overflow in WRITE SCATTERED offsets Greg Kroah-Hartman
` (370 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Yuan Chen,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuan Chen <chenyuan@kylinos.cn>
[ Upstream commit 5ec398d9ec8fe13f8058af9a2e5f5e8f46e0a35a ]
A freplace attach claims the target prog by bumping
tgt_prog->aux->freplace_link_cnt and setting tr->extension_prog.
bpf_arch_text_poke() then makes the extension take effect. If the
poke fails, the claims are never released: the attach unwinds
through bpf_link_cleanup(), which clears link->prog, so
bpf_trampoline_unlink_prog() never runs.
Drop the link count under ext_mutex on the error path, and set
tr->extension_prog only after the poke succeeded. The count is
still bumped before the poke: it blocks prog_array updates while
the entry is patched.
Fixes: d6083f040d5d ("bpf: Prevent tailcall infinite loop caused by freplace")
Fixes: be8704ff07d2 ("bpf: Introduce dynamic program extensions")
Suggested-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://patch.msgid.link/20260928091121.219333-1-chenyuan_fl@163.com
[ sashal: adapted to the older tramp_link naming (link->link.prog) and the four-argument bpf_arch_text_poke() signature, without the extra BPF_MOD_NOP argument. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/trampoline.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index a85e6491fbd1b..ffd150e5027b3 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -576,9 +576,16 @@ static int __bpf_trampoline_link_prog(struct bpf_tramp_link *link,
err = bpf_freplace_link_tgt_prog(tgt_prog);
if (err)
return err;
+ err = bpf_arch_text_poke(tr->func.addr, BPF_MOD_JUMP, NULL,
+ link->link.prog->bpf_func);
+ if (err) {
+ /* Undo the claim from bpf_freplace_link_tgt_prog(). */
+ guard(mutex)(&tgt_prog->aux->ext_mutex);
+ tgt_prog->aux->freplace_link_cnt--;
+ return err;
+ }
tr->extension_prog = link->link.prog;
- return bpf_arch_text_poke(tr->func.addr, BPF_MOD_JUMP, NULL,
- link->link.prog->bpf_func);
+ return 0;
}
if (cnt >= BPF_MAX_TRAMP_LINKS)
return -E2BIG;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 451/816] scsi: scsi_debug: Avoid 32-bit overflow in WRITE SCATTERED offsets
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (449 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 450/816] bpf: Roll back freplace link state when bpf_arch_text_poke() fails Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 452/816] scsi: scsi_debug: Enforce physical block alignment of zoned writes Greg Kroah-Hartman
` (369 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niklas Cassel, Damien Le Moal,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 92feb036a2d33c7b78b8daa2384f5c70d6679a91 ]
resp_write_scat() computes the length of an LBA range in bytes as a 32-bit
product, num_by = num * lb_size, and adds it to sg_off, the 32-bit offset
of the next range in the data-out buffer. The product wraps for a range of
4 GiB or more, which check_device_access_params() allows once the store is
that large, and sg_off wraps once the ranges add up to 4 GiB, which neither
their number nor their overlap prevents. The ranges that follow are then
written from the wrong offset in the buffer.
Make num_by and sg_off 64-bit, and pass do_device_access() sg_off capped at
the length of the buffer. An offset at the end of the buffer copies
nothing, and sg_copy_buffer(), which takes it as an off_t, is never given
one larger than the buffer that it copies.
Assisted-by: LLM
Fixes: 481b5e5c7949 ("scsi: scsi_debug: add resp_write_scat function")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-21-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
[ sashal: Kept the older branch's __func__ in the verbose printk format string and applied only the %u to %llu change for sg_off. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 7a1ad88669eeb..5529dcbd9eeba 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4613,7 +4613,8 @@ static int resp_write_scat(struct scsi_cmnd *scp,
struct sdeb_store_info *sip = devip2sip(devip, true);
u8 wrprotect;
u16 lbdof, num_lrd, k;
- u32 num, num_by, bt_len, lbdof_blen, sg_off, cum_lb;
+ u32 num, bt_len, lbdof_blen, cum_lb;
+ u64 num_by, sg_off;
u32 lb_size = sdebug_sector_size;
u32 ei_lba;
u64 lba;
@@ -4691,14 +4692,14 @@ static int resp_write_scat(struct scsi_cmnd *scp,
num = get_unaligned_be32(up + 8);
if (sdebug_verbose)
sdev_printk(KERN_INFO, scp->device,
- "%s: %s: k=%d LBA=0x%llx num=%u sg_off=%u\n",
+ "%s: %s: k=%d LBA=0x%llx num=%u sg_off=%llu\n",
my_name, __func__, k, lba, num, sg_off);
if (num == 0)
continue;
ret = check_device_access_params(scp, lba, num, true);
if (ret)
goto err_out_unlock;
- num_by = num * lb_size;
+ num_by = (u64)num * lb_size;
ei_lba = is_16 ? 0 : get_unaligned_be32(up + 12);
if ((cum_lb + num) > bt_len) {
@@ -4729,7 +4730,9 @@ static int resp_write_scat(struct scsi_cmnd *scp,
* Write ranges atomically to keep as close to pre-atomic
* writes behaviour as possible.
*/
- ret = do_device_access(sip, scp, sg_off, lba, num, group, true, true);
+ ret = do_device_access(sip, scp,
+ min_t(u64, sg_off, scsi_bufflen(scp)),
+ lba, num, group, true, true);
/* If ZBC zone then bump its write pointer */
if (sdebug_dev_is_zoned(devip))
zbc_inc_wp(devip, lba, num);
@@ -4740,7 +4743,7 @@ static int resp_write_scat(struct scsi_cmnd *scp,
goto err_out_unlock;
} else if (unlikely(sdebug_verbose && (ret < num_by)))
sdev_printk(KERN_INFO, scp->device,
- "%s: write: cdb indicated=%u, IO sent=%d bytes\n",
+ "%s: write: cdb indicated=%llu, IO sent=%d bytes\n",
my_name, num_by, ret);
if (unlikely((sdebug_opts & SDEBUG_OPT_RECOV_DIF_DIX) &&
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 452/816] scsi: scsi_debug: Enforce physical block alignment of zoned writes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (450 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 451/816] scsi: scsi_debug: Avoid 32-bit overflow in WRITE SCATTERED offsets Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 453/816] scsi: scsi_debug: Advance the write pointer over the data written Greg Kroah-Hartman
` (368 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 63cb3900be261fccc05cadcf3402058418a5fada ]
ZBC-3 r06 (T10/BSR INCITS 579), 4.5.3.3.2, requires a write to a sequential
write required zone to be terminated with ILLEGAL REQUEST / UNALIGNED WRITE
COMMAND both when it does not start at the write pointer and when it does
not end on a physical block boundary. That is why sd_zbc_read_zones() sets
the zone_write_granularity queue limit to the physical block size of a
host-managed device.
check_zbc_access_params() implements the first condition but not the
second. So with zbc=managed sector_size=512 physblk_exp=3, a write of a
single logical block at the write pointer is accepted and advances the
write pointer by one logical block, leaving it off the granularity that was
advertised: nothing can write at it any more, and the zone can only be used
again after being reset.
Check the ending LBA as well, with the same sense data, as the standard
gives both conditions the same. An entire medium write same command, which
the standard excludes, needs no special case: the preceding check already
terminates it with WRITE BOUNDARY VIOLATION. Sequential write preferred
zones are left alone, as writes to them need not be sequential, and with
the default physblk_exp=0 the check is a no-op.
Assisted-by: LLM
Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-23-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
[ sashal: Replaced the two-argument mk_sense_buffer(scp, key, UNALIGNED_WRITE_COMMAND) call with the four-argument form LBA_OUT_OF_RANGE, UNALIGNED_WRITE_ASCQ, since this tree lacks the combined constant. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 5529dcbd9eeba..ac8f313172e06 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3571,6 +3571,17 @@ static int check_zbc_access_params(struct scsi_cmnd *scp,
UNALIGNED_WRITE_ASCQ);
return check_condition_result;
}
+ /*
+ * Writes must end on a physical block boundary, that is, the
+ * transfer length must be a multiple of the physical block
+ * size.
+ */
+ if (!IS_ALIGNED(lba + num, 1U << sdebug_physblk_exp)) {
+ mk_sense_buffer(scp, ILLEGAL_REQUEST,
+ LBA_OUT_OF_RANGE,
+ UNALIGNED_WRITE_ASCQ);
+ return check_condition_result;
+ }
}
/* Handle implicit open of closed and empty zones */
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 453/816] scsi: scsi_debug: Advance the write pointer over the data written
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (451 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 452/816] scsi: scsi_debug: Enforce physical block alignment of zoned writes Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 454/816] phy: rockchip: naneng-combphy: Add SoC prefix to register definitions Greg Kroah-Hartman
` (367 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit cb2d2a7c80c62d1e5e476609706f29dd9584d0e0 ]
resp_write_dt0() and resp_write_scat() advance the write pointer of a
sequential write required zone by the transfer length of the command
without looking at what do_device_access() returned, which is -1 when the
data direction of the command does not match the operation, and a short
byte count when the data-out buffer is smaller than the transfer length. An
initiator can produce both with SG_IO.
The zone then describes more data than is on the medium, and a write at the
position where the data really ends is terminated with UNALIGNED WRITE
COMMAND, so the zone has to be reset before it can be written to again.
Advance the write pointer over the data that was written instead. As
do_device_access() does not write a partial physical block to such a zone,
that leaves the write pointer where a write can end.
Assisted-by: LLM
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-25-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index ac8f313172e06..baef720719bc5 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4577,9 +4577,9 @@ static int resp_write_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
if (unlikely(scsi_debug_lbp()))
map_region(sip, lba, num);
- /* If ZBC zone then bump its write pointer */
- if (sdebug_dev_is_zoned(devip))
- zbc_inc_wp(devip, lba, num);
+ /* If ZBC zone then bump its write pointer over the data written */
+ if (sdebug_dev_is_zoned(devip) && ret > 0)
+ zbc_inc_wp(devip, lba, ret >> ilog2(sdebug_sector_size));
if (meta_data_locked)
sdeb_meta_write_unlock(sip);
@@ -4744,9 +4744,10 @@ static int resp_write_scat(struct scsi_cmnd *scp,
ret = do_device_access(sip, scp,
min_t(u64, sg_off, scsi_bufflen(scp)),
lba, num, group, true, true);
- /* If ZBC zone then bump its write pointer */
- if (sdebug_dev_is_zoned(devip))
- zbc_inc_wp(devip, lba, num);
+ /* If ZBC zone then bump its write pointer over the data written */
+ if (sdebug_dev_is_zoned(devip) && ret > 0)
+ zbc_inc_wp(devip, lba,
+ ret >> ilog2(sdebug_sector_size));
if (unlikely(scsi_debug_lbp()))
map_region(sip, lba, num);
if (unlikely(-1 == ret)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 454/816] phy: rockchip: naneng-combphy: Add SoC prefix to register definitions
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (452 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 453/816] scsi: scsi_debug: Advance the write pointer over the data written Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 455/816] phy: rockchip: naneng-combphy: Fix TX detect RX termination errata Greg Kroah-Hartman
` (366 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yao Zi, Heiko Stuebner,
Neil Armstrong, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yao Zi <ziyao@disroot.org>
[ Upstream commit b3bbc6afcff50e2fd4d51dd64929e62d66fdc814 ]
All supported variants of naneng-combphy follow a register layout
similar to the RK3568 variant with some exceptions of SoC-specific
registers.
Add RK3568 prefix for the common set of registers and the corresponding
SoC prefix for SoC-specific registers, making usage of definitions clear
and preparing for future COMBPHY variants with a different register
layout.
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250728102947.38984-6-ziyao@disroot.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: d68e47a06c5c ("phy: rockchip: naneng-combphy: Fix TX detect RX termination errata")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../rockchip/phy-rockchip-naneng-combphy.c | 301 +++++++++---------
1 file changed, 151 insertions(+), 150 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
index fbaeb7ca600d1..11b5e43993fea 100644
--- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
@@ -21,64 +21,65 @@
#define REF_CLOCK_100MHz (100 * HZ_PER_MHZ)
/* COMBO PHY REG */
-#define PHYREG6 0x14
-#define PHYREG6_PLL_DIV_MASK GENMASK(7, 6)
-#define PHYREG6_PLL_DIV_SHIFT 6
-#define PHYREG6_PLL_DIV_2 1
-
-#define PHYREG7 0x18
-#define PHYREG7_TX_RTERM_MASK GENMASK(7, 4)
-#define PHYREG7_TX_RTERM_SHIFT 4
-#define PHYREG7_TX_RTERM_50OHM 8
-#define PHYREG7_RX_RTERM_MASK GENMASK(3, 0)
-#define PHYREG7_RX_RTERM_SHIFT 0
-#define PHYREG7_RX_RTERM_44OHM 15
-
-#define PHYREG8 0x1C
-#define PHYREG8_SSC_EN BIT(4)
-
-#define PHYREG11 0x28
-#define PHYREG11_SU_TRIM_0_7 0xF0
-
-#define PHYREG12 0x2C
-#define PHYREG12_PLL_LPF_ADJ_VALUE 4
-
-#define PHYREG13 0x30
-#define PHYREG13_RESISTER_MASK GENMASK(5, 4)
-#define PHYREG13_RESISTER_SHIFT 0x4
-#define PHYREG13_RESISTER_HIGH_Z 3
-#define PHYREG13_CKRCV_AMP0 BIT(7)
-
-#define PHYREG14 0x34
-#define PHYREG14_CKRCV_AMP1 BIT(0)
-
-#define PHYREG15 0x38
-#define PHYREG15_CTLE_EN BIT(0)
-#define PHYREG15_SSC_CNT_MASK GENMASK(7, 6)
-#define PHYREG15_SSC_CNT_SHIFT 6
-#define PHYREG15_SSC_CNT_VALUE 1
-
-#define PHYREG16 0x3C
-#define PHYREG16_SSC_CNT_VALUE 0x5f
-
-#define PHYREG18 0x44
-#define PHYREG18_PLL_LOOP 0x32
-
-#define PHYREG27 0x6C
-#define PHYREG27_RX_TRIM_RK3588 0x4C
-
-#define PHYREG32 0x7C
-#define PHYREG32_SSC_MASK GENMASK(7, 4)
-#define PHYREG32_SSC_DIR_SHIFT 4
-#define PHYREG32_SSC_UPWARD 0
-#define PHYREG32_SSC_DOWNWARD 1
-#define PHYREG32_SSC_OFFSET_SHIFT 6
-#define PHYREG32_SSC_OFFSET_500PPM 1
-
-#define PHYREG33 0x80
-#define PHYREG33_PLL_KVCO_MASK GENMASK(4, 2)
-#define PHYREG33_PLL_KVCO_SHIFT 2
-#define PHYREG33_PLL_KVCO_VALUE 2
+#define RK3568_PHYREG6 0x14
+#define RK3568_PHYREG6_PLL_DIV_MASK GENMASK(7, 6)
+#define RK3568_PHYREG6_PLL_DIV_SHIFT 6
+#define RK3568_PHYREG6_PLL_DIV_2 1
+
+#define RK3568_PHYREG7 0x18
+#define RK3568_PHYREG7_TX_RTERM_MASK GENMASK(7, 4)
+#define RK3568_PHYREG7_TX_RTERM_SHIFT 4
+#define RK3568_PHYREG7_TX_RTERM_50OHM 8
+#define RK3568_PHYREG7_RX_RTERM_MASK GENMASK(3, 0)
+#define RK3568_PHYREG7_RX_RTERM_SHIFT 0
+#define RK3568_PHYREG7_RX_RTERM_44OHM 15
+
+#define RK3568_PHYREG8 0x1C
+#define RK3568_PHYREG8_SSC_EN BIT(4)
+
+#define RK3568_PHYREG11 0x28
+#define RK3568_PHYREG11_SU_TRIM_0_7 0xF0
+
+#define RK3568_PHYREG12 0x2C
+#define RK3568_PHYREG12_PLL_LPF_ADJ_VALUE 4
+
+#define RK3568_PHYREG13 0x30
+#define RK3568_PHYREG13_RESISTER_MASK GENMASK(5, 4)
+#define RK3568_PHYREG13_RESISTER_SHIFT 0x4
+#define RK3568_PHYREG13_RESISTER_HIGH_Z 3
+#define RK3568_PHYREG13_CKRCV_AMP0 BIT(7)
+
+#define RK3568_PHYREG14 0x34
+#define RK3568_PHYREG14_CKRCV_AMP1 BIT(0)
+
+#define RK3568_PHYREG15 0x38
+#define RK3568_PHYREG15_CTLE_EN BIT(0)
+#define RK3568_PHYREG15_SSC_CNT_MASK GENMASK(7, 6)
+#define RK3568_PHYREG15_SSC_CNT_SHIFT 6
+#define RK3568_PHYREG15_SSC_CNT_VALUE 1
+
+#define RK3568_PHYREG16 0x3C
+#define RK3568_PHYREG16_SSC_CNT_VALUE 0x5f
+
+#define RK3568_PHYREG18 0x44
+#define RK3568_PHYREG18_PLL_LOOP 0x32
+
+#define RK3568_PHYREG32 0x7C
+#define RK3568_PHYREG32_SSC_MASK GENMASK(7, 4)
+#define RK3568_PHYREG32_SSC_DIR_SHIFT 4
+#define RK3568_PHYREG32_SSC_UPWARD 0
+#define RK3568_PHYREG32_SSC_DOWNWARD 1
+#define RK3568_PHYREG32_SSC_OFFSET_SHIFT 6
+#define RK3568_PHYREG32_SSC_OFFSET_500PPM 1
+
+#define RK3568_PHYREG33 0x80
+#define RK3568_PHYREG33_PLL_KVCO_MASK GENMASK(4, 2)
+#define RK3568_PHYREG33_PLL_KVCO_SHIFT 2
+#define RK3568_PHYREG33_PLL_KVCO_VALUE 2
+
+/* RK3588 COMBO PHY registers */
+#define RK3588_PHYREG27 0x6C
+#define RK3588_PHYREG27_RX_TRIM 0x4C
struct rockchip_combphy_priv;
@@ -392,9 +393,9 @@ static int rk3568_combphy_cfg(struct rockchip_combphy_priv *priv)
switch (priv->type) {
case PHY_TYPE_PCIE:
/* Set SSC downward spread spectrum. */
- rockchip_combphy_updatel(priv, PHYREG32_SSC_MASK,
- PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT,
- PHYREG32);
+ rockchip_combphy_updatel(priv, RK3568_PHYREG32_SSC_MASK,
+ RK3568_PHYREG32_SSC_DOWNWARD << RK3568_PHYREG32_SSC_DIR_SHIFT,
+ RK3568_PHYREG32);
rockchip_combphy_param_write(priv->phy_grf, &cfg->con0_for_pcie, true);
rockchip_combphy_param_write(priv->phy_grf, &cfg->con1_for_pcie, true);
@@ -404,30 +405,30 @@ static int rk3568_combphy_cfg(struct rockchip_combphy_priv *priv)
case PHY_TYPE_USB3:
/* Set SSC downward spread spectrum. */
- rockchip_combphy_updatel(priv, PHYREG32_SSC_MASK,
- PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT,
- PHYREG32);
+ rockchip_combphy_updatel(priv, RK3568_PHYREG32_SSC_MASK,
+ RK3568_PHYREG32_SSC_DOWNWARD << RK3568_PHYREG32_SSC_DIR_SHIFT,
+ RK3568_PHYREG32);
/* Enable adaptive CTLE for USB3.0 Rx. */
- val = readl(priv->mmio + PHYREG15);
- val |= PHYREG15_CTLE_EN;
- writel(val, priv->mmio + PHYREG15);
+ val = readl(priv->mmio + RK3568_PHYREG15);
+ val |= RK3568_PHYREG15_CTLE_EN;
+ writel(val, priv->mmio + RK3568_PHYREG15);
/* Set PLL KVCO fine tuning signals. */
- rockchip_combphy_updatel(priv, PHYREG33_PLL_KVCO_MASK,
- PHYREG33_PLL_KVCO_VALUE << PHYREG33_PLL_KVCO_SHIFT,
- PHYREG33);
+ rockchip_combphy_updatel(priv, RK3568_PHYREG33_PLL_KVCO_MASK,
+ RK3568_PHYREG33_PLL_KVCO_VALUE << RK3568_PHYREG33_PLL_KVCO_SHIFT,
+ RK3568_PHYREG33);
/* Enable controlling random jitter. */
- writel(PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + PHYREG12);
+ writel(RK3568_PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + RK3568_PHYREG12);
/* Set PLL input clock divider 1/2. */
- rockchip_combphy_updatel(priv, PHYREG6_PLL_DIV_MASK,
- PHYREG6_PLL_DIV_2 << PHYREG6_PLL_DIV_SHIFT,
- PHYREG6);
+ rockchip_combphy_updatel(priv, RK3568_PHYREG6_PLL_DIV_MASK,
+ RK3568_PHYREG6_PLL_DIV_2 << RK3568_PHYREG6_PLL_DIV_SHIFT,
+ RK3568_PHYREG6);
- writel(PHYREG18_PLL_LOOP, priv->mmio + PHYREG18);
- writel(PHYREG11_SU_TRIM_0_7, priv->mmio + PHYREG11);
+ writel(RK3568_PHYREG18_PLL_LOOP, priv->mmio + RK3568_PHYREG18);
+ writel(RK3568_PHYREG11_SU_TRIM_0_7, priv->mmio + RK3568_PHYREG11);
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_sel_usb, true);
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_txcomp_sel, false);
@@ -445,16 +446,16 @@ static int rk3568_combphy_cfg(struct rockchip_combphy_priv *priv)
case PHY_TYPE_SATA:
/* Enable adaptive CTLE for SATA Rx. */
- val = readl(priv->mmio + PHYREG15);
- val |= PHYREG15_CTLE_EN;
- writel(val, priv->mmio + PHYREG15);
+ val = readl(priv->mmio + RK3568_PHYREG15);
+ val |= RK3568_PHYREG15_CTLE_EN;
+ writel(val, priv->mmio + RK3568_PHYREG15);
/*
* Set tx_rterm=50ohm and rx_rterm=44ohm for SATA.
* 0: 60ohm, 8: 50ohm 15: 44ohm (by step abort 1ohm)
*/
- val = PHYREG7_TX_RTERM_50OHM << PHYREG7_TX_RTERM_SHIFT;
- val |= PHYREG7_RX_RTERM_44OHM << PHYREG7_RX_RTERM_SHIFT;
- writel(val, priv->mmio + PHYREG7);
+ val = RK3568_PHYREG7_TX_RTERM_50OHM << RK3568_PHYREG7_TX_RTERM_SHIFT;
+ val |= RK3568_PHYREG7_RX_RTERM_44OHM << RK3568_PHYREG7_RX_RTERM_SHIFT;
+ writel(val, priv->mmio + RK3568_PHYREG7);
rockchip_combphy_param_write(priv->phy_grf, &cfg->con0_for_sata, true);
rockchip_combphy_param_write(priv->phy_grf, &cfg->con1_for_sata, true);
@@ -489,11 +490,11 @@ static int rk3568_combphy_cfg(struct rockchip_combphy_priv *priv)
case REF_CLOCK_24MHz:
if (priv->type == PHY_TYPE_USB3 || priv->type == PHY_TYPE_SATA) {
/* Set ssc_cnt[9:0]=0101111101 & 31.5KHz. */
- val = PHYREG15_SSC_CNT_VALUE << PHYREG15_SSC_CNT_SHIFT;
- rockchip_combphy_updatel(priv, PHYREG15_SSC_CNT_MASK,
- val, PHYREG15);
+ val = RK3568_PHYREG15_SSC_CNT_VALUE << RK3568_PHYREG15_SSC_CNT_SHIFT;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG15_SSC_CNT_MASK,
+ val, RK3568_PHYREG15);
- writel(PHYREG16_SSC_CNT_VALUE, priv->mmio + PHYREG16);
+ writel(RK3568_PHYREG16_SSC_CNT_VALUE, priv->mmio + RK3568_PHYREG16);
}
break;
@@ -505,24 +506,24 @@ static int rk3568_combphy_cfg(struct rockchip_combphy_priv *priv)
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_clk_100m, true);
if (priv->type == PHY_TYPE_PCIE) {
/* PLL KVCO fine tuning. */
- val = PHYREG33_PLL_KVCO_VALUE << PHYREG33_PLL_KVCO_SHIFT;
- rockchip_combphy_updatel(priv, PHYREG33_PLL_KVCO_MASK,
- val, PHYREG33);
+ val = RK3568_PHYREG33_PLL_KVCO_VALUE << RK3568_PHYREG33_PLL_KVCO_SHIFT;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG33_PLL_KVCO_MASK,
+ val, RK3568_PHYREG33);
/* Enable controlling random jitter. */
- writel(PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + PHYREG12);
+ writel(RK3568_PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + RK3568_PHYREG12);
- val = PHYREG6_PLL_DIV_2 << PHYREG6_PLL_DIV_SHIFT;
- rockchip_combphy_updatel(priv, PHYREG6_PLL_DIV_MASK,
- val, PHYREG6);
+ val = RK3568_PHYREG6_PLL_DIV_2 << RK3568_PHYREG6_PLL_DIV_SHIFT;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG6_PLL_DIV_MASK,
+ val, RK3568_PHYREG6);
- writel(PHYREG18_PLL_LOOP, priv->mmio + PHYREG18);
- writel(PHYREG11_SU_TRIM_0_7, priv->mmio + PHYREG11);
+ writel(RK3568_PHYREG18_PLL_LOOP, priv->mmio + RK3568_PHYREG18);
+ writel(RK3568_PHYREG11_SU_TRIM_0_7, priv->mmio + RK3568_PHYREG11);
} else if (priv->type == PHY_TYPE_SATA) {
/* downward spread spectrum +500ppm */
- val = PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT;
- val |= PHYREG32_SSC_OFFSET_500PPM << PHYREG32_SSC_OFFSET_SHIFT;
- rockchip_combphy_updatel(priv, PHYREG32_SSC_MASK, val, PHYREG32);
+ val = RK3568_PHYREG32_SSC_DOWNWARD << RK3568_PHYREG32_SSC_DIR_SHIFT;
+ val |= RK3568_PHYREG32_SSC_OFFSET_500PPM << RK3568_PHYREG32_SSC_OFFSET_SHIFT;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG32_SSC_MASK, val, RK3568_PHYREG32);
}
break;
@@ -534,20 +535,20 @@ static int rk3568_combphy_cfg(struct rockchip_combphy_priv *priv)
if (priv->ext_refclk) {
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_clk_ext, true);
if (priv->type == PHY_TYPE_PCIE && rate == REF_CLOCK_100MHz) {
- val = PHYREG13_RESISTER_HIGH_Z << PHYREG13_RESISTER_SHIFT;
- val |= PHYREG13_CKRCV_AMP0;
- rockchip_combphy_updatel(priv, PHYREG13_RESISTER_MASK, val, PHYREG13);
+ val = RK3568_PHYREG13_RESISTER_HIGH_Z << RK3568_PHYREG13_RESISTER_SHIFT;
+ val |= RK3568_PHYREG13_CKRCV_AMP0;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG13_RESISTER_MASK, val, RK3568_PHYREG13);
- val = readl(priv->mmio + PHYREG14);
- val |= PHYREG14_CKRCV_AMP1;
- writel(val, priv->mmio + PHYREG14);
+ val = readl(priv->mmio + RK3568_PHYREG14);
+ val |= RK3568_PHYREG14_CKRCV_AMP1;
+ writel(val, priv->mmio + RK3568_PHYREG14);
}
}
if (priv->enable_ssc) {
- val = readl(priv->mmio + PHYREG8);
- val |= PHYREG8_SSC_EN;
- writel(val, priv->mmio + PHYREG8);
+ val = readl(priv->mmio + RK3568_PHYREG8);
+ val |= RK3568_PHYREG8_SSC_EN;
+ writel(val, priv->mmio + RK3568_PHYREG8);
}
return 0;
@@ -622,30 +623,30 @@ static int rk3588_combphy_cfg(struct rockchip_combphy_priv *priv)
break;
case PHY_TYPE_USB3:
/* Set SSC downward spread spectrum */
- rockchip_combphy_updatel(priv, PHYREG32_SSC_MASK,
- PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT,
- PHYREG32);
+ rockchip_combphy_updatel(priv, RK3568_PHYREG32_SSC_MASK,
+ RK3568_PHYREG32_SSC_DOWNWARD << RK3568_PHYREG32_SSC_DIR_SHIFT,
+ RK3568_PHYREG32);
/* Enable adaptive CTLE for USB3.0 Rx. */
- val = readl(priv->mmio + PHYREG15);
- val |= PHYREG15_CTLE_EN;
- writel(val, priv->mmio + PHYREG15);
+ val = readl(priv->mmio + RK3568_PHYREG15);
+ val |= RK3568_PHYREG15_CTLE_EN;
+ writel(val, priv->mmio + RK3568_PHYREG15);
/* Set PLL KVCO fine tuning signals. */
- rockchip_combphy_updatel(priv, PHYREG33_PLL_KVCO_MASK,
- PHYREG33_PLL_KVCO_VALUE << PHYREG33_PLL_KVCO_SHIFT,
- PHYREG33);
+ rockchip_combphy_updatel(priv, RK3568_PHYREG33_PLL_KVCO_MASK,
+ RK3568_PHYREG33_PLL_KVCO_VALUE << RK3568_PHYREG33_PLL_KVCO_SHIFT,
+ RK3568_PHYREG33);
/* Enable controlling random jitter. */
- writel(PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + PHYREG12);
+ writel(RK3568_PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + RK3568_PHYREG12);
/* Set PLL input clock divider 1/2. */
- rockchip_combphy_updatel(priv, PHYREG6_PLL_DIV_MASK,
- PHYREG6_PLL_DIV_2 << PHYREG6_PLL_DIV_SHIFT,
- PHYREG6);
+ rockchip_combphy_updatel(priv, RK3568_PHYREG6_PLL_DIV_MASK,
+ RK3568_PHYREG6_PLL_DIV_2 << RK3568_PHYREG6_PLL_DIV_SHIFT,
+ RK3568_PHYREG6);
- writel(PHYREG18_PLL_LOOP, priv->mmio + PHYREG18);
- writel(PHYREG11_SU_TRIM_0_7, priv->mmio + PHYREG11);
+ writel(RK3568_PHYREG18_PLL_LOOP, priv->mmio + RK3568_PHYREG18);
+ writel(RK3568_PHYREG11_SU_TRIM_0_7, priv->mmio + RK3568_PHYREG11);
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_txcomp_sel, false);
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_txelec_sel, false);
@@ -653,16 +654,16 @@ static int rk3588_combphy_cfg(struct rockchip_combphy_priv *priv)
break;
case PHY_TYPE_SATA:
/* Enable adaptive CTLE for SATA Rx. */
- val = readl(priv->mmio + PHYREG15);
- val |= PHYREG15_CTLE_EN;
- writel(val, priv->mmio + PHYREG15);
+ val = readl(priv->mmio + RK3568_PHYREG15);
+ val |= RK3568_PHYREG15_CTLE_EN;
+ writel(val, priv->mmio + RK3568_PHYREG15);
/*
* Set tx_rterm=50ohm and rx_rterm=44ohm for SATA.
* 0: 60ohm, 8: 50ohm 15: 44ohm (by step abort 1ohm)
*/
- val = PHYREG7_TX_RTERM_50OHM << PHYREG7_TX_RTERM_SHIFT;
- val |= PHYREG7_RX_RTERM_44OHM << PHYREG7_RX_RTERM_SHIFT;
- writel(val, priv->mmio + PHYREG7);
+ val = RK3568_PHYREG7_TX_RTERM_50OHM << RK3568_PHYREG7_TX_RTERM_SHIFT;
+ val |= RK3568_PHYREG7_RX_RTERM_44OHM << RK3568_PHYREG7_RX_RTERM_SHIFT;
+ writel(val, priv->mmio + RK3568_PHYREG7);
rockchip_combphy_param_write(priv->phy_grf, &cfg->con0_for_sata, true);
rockchip_combphy_param_write(priv->phy_grf, &cfg->con1_for_sata, true);
@@ -684,11 +685,11 @@ static int rk3588_combphy_cfg(struct rockchip_combphy_priv *priv)
case REF_CLOCK_24MHz:
if (priv->type == PHY_TYPE_USB3 || priv->type == PHY_TYPE_SATA) {
/* Set ssc_cnt[9:0]=0101111101 & 31.5KHz. */
- val = PHYREG15_SSC_CNT_VALUE << PHYREG15_SSC_CNT_SHIFT;
- rockchip_combphy_updatel(priv, PHYREG15_SSC_CNT_MASK,
- val, PHYREG15);
+ val = RK3568_PHYREG15_SSC_CNT_VALUE << RK3568_PHYREG15_SSC_CNT_SHIFT;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG15_SSC_CNT_MASK,
+ val, RK3568_PHYREG15);
- writel(PHYREG16_SSC_CNT_VALUE, priv->mmio + PHYREG16);
+ writel(RK3568_PHYREG16_SSC_CNT_VALUE, priv->mmio + RK3568_PHYREG16);
}
break;
@@ -699,23 +700,23 @@ static int rk3588_combphy_cfg(struct rockchip_combphy_priv *priv)
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_clk_100m, true);
if (priv->type == PHY_TYPE_PCIE) {
/* PLL KVCO fine tuning. */
- val = 4 << PHYREG33_PLL_KVCO_SHIFT;
- rockchip_combphy_updatel(priv, PHYREG33_PLL_KVCO_MASK,
- val, PHYREG33);
+ val = 4 << RK3568_PHYREG33_PLL_KVCO_SHIFT;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG33_PLL_KVCO_MASK,
+ val, RK3568_PHYREG33);
/* Enable controlling random jitter. */
- writel(PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + PHYREG12);
+ writel(RK3568_PHYREG12_PLL_LPF_ADJ_VALUE, priv->mmio + RK3568_PHYREG12);
/* Set up rx_trim: PLL LPF C1 85pf R1 1.25kohm */
- writel(PHYREG27_RX_TRIM_RK3588, priv->mmio + PHYREG27);
+ writel(RK3588_PHYREG27_RX_TRIM, priv->mmio + RK3588_PHYREG27);
/* Set up su_trim: */
- writel(PHYREG11_SU_TRIM_0_7, priv->mmio + PHYREG11);
+ writel(RK3568_PHYREG11_SU_TRIM_0_7, priv->mmio + RK3568_PHYREG11);
} else if (priv->type == PHY_TYPE_SATA) {
/* downward spread spectrum +500ppm */
- val = PHYREG32_SSC_DOWNWARD << PHYREG32_SSC_DIR_SHIFT;
- val |= PHYREG32_SSC_OFFSET_500PPM << PHYREG32_SSC_OFFSET_SHIFT;
- rockchip_combphy_updatel(priv, PHYREG32_SSC_MASK, val, PHYREG32);
+ val = RK3568_PHYREG32_SSC_DOWNWARD << RK3568_PHYREG32_SSC_DIR_SHIFT;
+ val |= RK3568_PHYREG32_SSC_OFFSET_500PPM << RK3568_PHYREG32_SSC_OFFSET_SHIFT;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG32_SSC_MASK, val, RK3568_PHYREG32);
}
break;
default:
@@ -726,20 +727,20 @@ static int rk3588_combphy_cfg(struct rockchip_combphy_priv *priv)
if (priv->ext_refclk) {
rockchip_combphy_param_write(priv->phy_grf, &cfg->pipe_clk_ext, true);
if (priv->type == PHY_TYPE_PCIE && rate == REF_CLOCK_100MHz) {
- val = PHYREG13_RESISTER_HIGH_Z << PHYREG13_RESISTER_SHIFT;
- val |= PHYREG13_CKRCV_AMP0;
- rockchip_combphy_updatel(priv, PHYREG13_RESISTER_MASK, val, PHYREG13);
+ val = RK3568_PHYREG13_RESISTER_HIGH_Z << RK3568_PHYREG13_RESISTER_SHIFT;
+ val |= RK3568_PHYREG13_CKRCV_AMP0;
+ rockchip_combphy_updatel(priv, RK3568_PHYREG13_RESISTER_MASK, val, RK3568_PHYREG13);
- val = readl(priv->mmio + PHYREG14);
- val |= PHYREG14_CKRCV_AMP1;
- writel(val, priv->mmio + PHYREG14);
+ val = readl(priv->mmio + RK3568_PHYREG14);
+ val |= RK3568_PHYREG14_CKRCV_AMP1;
+ writel(val, priv->mmio + RK3568_PHYREG14);
}
}
if (priv->enable_ssc) {
- val = readl(priv->mmio + PHYREG8);
- val |= PHYREG8_SSC_EN;
- writel(val, priv->mmio + PHYREG8);
+ val = readl(priv->mmio + RK3568_PHYREG8);
+ val |= RK3568_PHYREG8_SSC_EN;
+ writel(val, priv->mmio + RK3568_PHYREG8);
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 455/816] phy: rockchip: naneng-combphy: Fix TX detect RX termination errata
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (453 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 454/816] phy: rockchip: naneng-combphy: Add SoC prefix to register definitions Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 456/816] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node Greg Kroah-Hartman
` (365 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shawn Lin, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shawn Lin <shawn.lin@rock-chips.com>
[ Upstream commit d68e47a06c5cdc90cbd29ce2e74fa61eab5d47cc ]
Some PHY revisions may fail to detect the peer RX's termination
resistor (RTERM) under certain critical temperature conditions.
This causes TX detection failures on PCIe links.
Add a workaround to force the RTERM detection ready signal for
affected PHY revisions. This ensures reliable TX-to-RX termination
detection across all operating temperature ranges.
The fix applies to RK3562, RK3568, RK3576 and RK3588 SoCs which share
the same PHY IP with this hardware errata.
Fixes: 7160820d742a ("phy: rockchip: add naneng combo phy for RK3568")
Fixes: f13bff25161b ("phy: rockchip-naneng-combo: Support rk3562")
Fixes: ba8ad7eece66 ("phy: rockchip-naneng-combo: add rk3576 support")
Fixes: a03c44277253 ("phy: rockchip: Add naneng combo phy support for RK3588")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Link: https://patch.msgid.link/1788158204-161347-1-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[ sashal: Dropped the RK3562 and RK3576 .force_rxterm_det_rdy hunks since those SoC configs don't exist here, and adjusted the context lines for the prefixed register-define layout. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../phy/rockchip/phy-rockchip-naneng-combphy.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
index 11b5e43993fea..0fd9b5463f0ab 100644
--- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
@@ -64,6 +64,9 @@
#define RK3568_PHYREG18 0x44
#define RK3568_PHYREG18_PLL_LOOP 0x32
+#define RK3568_PHYREG26 0x64
+#define RK3568_PHYREG26_FORCE_RTERM_DET_RDY BIT(5)
+
#define RK3568_PHYREG32 0x7C
#define RK3568_PHYREG32_SSC_MASK GENMASK(7, 4)
#define RK3568_PHYREG32_SSC_DIR_SHIFT 4
@@ -131,6 +134,7 @@ struct rockchip_combphy_cfg {
unsigned int num_phys;
unsigned int phy_ids[3];
const struct rockchip_combphy_grfcfg *grfcfg;
+ bool force_rxterm_det_rdy;
int (*combphy_cfg)(struct rockchip_combphy_priv *priv);
};
@@ -202,6 +206,17 @@ static int rockchip_combphy_init(struct phy *phy)
switch (priv->type) {
case PHY_TYPE_PCIE:
+ /*
+ * Hardware Errata: TX fails to detect peer RX termination.
+ * Some PHY revisions may fail to detect remote RX's RTERM
+ * (receiver termination resistor) under certain critical
+ * temperature conditions. Set force rterm detect ready to
+ * fix it.
+ */
+ if (priv->cfg->force_rxterm_det_rdy)
+ rockchip_combphy_updatel(priv, RK3568_PHYREG26_FORCE_RTERM_DET_RDY,
+ RK3568_PHYREG26_FORCE_RTERM_DET_RDY, RK3568_PHYREG26);
+ fallthrough;
case PHY_TYPE_USB3:
case PHY_TYPE_SATA:
case PHY_TYPE_SGMII:
@@ -598,6 +613,7 @@ static const struct rockchip_combphy_cfg rk3568_combphy_cfgs = {
},
.grfcfg = &rk3568_combphy_grfcfgs,
.combphy_cfg = rk3568_combphy_cfg,
+ .force_rxterm_det_rdy = true,
};
static int rk3588_combphy_cfg(struct rockchip_combphy_priv *priv)
@@ -784,6 +800,7 @@ static const struct rockchip_combphy_cfg rk3588_combphy_cfgs = {
},
.grfcfg = &rk3588_combphy_grfcfgs,
.combphy_cfg = rk3588_combphy_cfg,
+ .force_rxterm_det_rdy = true,
};
static const struct of_device_id rockchip_combphy_of_match[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 456/816] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (454 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 455/816] phy: rockchip: naneng-combphy: Fix TX detect RX termination errata Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 457/816] ASoC: aw88399: skip BSTS check when boost converter is bypassed Greg Kroah-Hartman
` (364 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolin Chen, Mostafa Saleh,
Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolin Chen <nicolinc@nvidia.com>
[ Upstream commit 2888520bdcbe0599cfc77b2fad8dc6c95505a3cb ]
arm_smmu_insert_master() skips inserting a stream whose StreamID duplicates
one the same master already owns (bridged PCI devices can present duplicate
IDs), leaving that master->streams[i].node zeroed and unlinked from the
smmu->streams rb-tree.
Both the insert error-rollback loop and arm_smmu_remove_master() then call
rb_erase() on every master->streams[i].node unconditionally. rb_erase() on
a zeroed node sees a NULL parent, treats the node as the tree root and sets
root->rb_node = NULL, silently emptying the whole SID tree and breaking SID
lookups (and DMA) for every other master on the SMMU.
Mark each node with RB_CLEAR_NODE() after sort_nonatomic() reorders the
array, since sorting relocates the entries and would leave the earlier
self-referential RB_CLEAR_NODE() pointer stale. An un-inserted node then
stays RB_EMPTY_NODE() and is skipped in both erase loops; inserted nodes
are linked by rb_find_add() and erased as before.
Fixes: b00d24997a11 ("iommu/arm-smmu-v3: Fix iommu_device_probe bug due to duplicated stream ids")
Assisted-by: LLM
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
[ sashal: Dropped the upstream ordering comment and placed the RB_CLEAR_NODE() loop before mutex_lock(), since this tree has no build_invs allocation or sort step. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index af3070db47460..5e19fce65e2ba 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -3242,6 +3242,9 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
return -ENOMEM;
master->num_streams = fwspec->num_ids;
+ for (i = 0; i < fwspec->num_ids; i++)
+ RB_CLEAR_NODE(&master->streams[i].node);
+
mutex_lock(&smmu->streams_mutex);
for (i = 0; i < fwspec->num_ids; i++) {
struct arm_smmu_stream *new_stream = &master->streams[i];
@@ -3277,7 +3280,9 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
if (ret) {
for (i--; i >= 0; i--)
- rb_erase(&master->streams[i].node, &smmu->streams);
+ if (!RB_EMPTY_NODE(&master->streams[i].node))
+ rb_erase(&master->streams[i].node,
+ &smmu->streams);
kfree(master->streams);
}
mutex_unlock(&smmu->streams_mutex);
@@ -3296,7 +3301,8 @@ static void arm_smmu_remove_master(struct arm_smmu_master *master)
mutex_lock(&smmu->streams_mutex);
for (i = 0; i < fwspec->num_ids; i++)
- rb_erase(&master->streams[i].node, &smmu->streams);
+ if (!RB_EMPTY_NODE(&master->streams[i].node))
+ rb_erase(&master->streams[i].node, &smmu->streams);
mutex_unlock(&smmu->streams_mutex);
kfree(master->streams);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 457/816] ASoC: aw88399: skip BSTS check when boost converter is bypassed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (455 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 456/816] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 458/816] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU Greg Kroah-Hartman
` (363 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Marco Giunta, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marco Giunta <marco_giunta@outlook.it>
[ Upstream commit 664824782df63013ba8686b649c625cac4793248 ]
The sysst check in aw_dev_check_sysst() requires BSTS (boost finished)
to assert, but on hardware where the boost converter is bypassed via
external power supply (BSTCTRL10 register 0x69, EN_HVBAT bit 2 set),
BSTS (SYSST register 0x01, bit 9) will never assert.
The vendor's generic driver (aw883xx) handles this by reading EN_HVBAT and
conditionally masking out BSTS from the sysst check. The in-tree driver
missed this logic when the original code was ported upstream.
Add the same conditional check, matching the vendor driver's
aw_dev_sysst_check() implementation.
Fixes: 8ade6cc7e261 ("ASoC: codecs: Add aw88399 amplifier driver")
Signed-off-by: Marco Giunta <marco_giunta@outlook.it>
Link: https://patch.msgid.link/SN6PR19MB2303FF1922BF5F876378066FFC8F2@SN6PR19MB2303.namprd19.prod.outlook.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Ported to the single-file driver layout: the EPS_EN defines went into the local header and the BSTS-skip check into aw_dev_check_sysst(), since the upstream bsts_unreliable context is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/aw88399.c | 13 +++++++++++++
sound/soc/codecs/aw88399.h | 5 +++++
2 files changed, 18 insertions(+)
diff --git a/sound/soc/codecs/aw88399.c b/sound/soc/codecs/aw88399.c
index bba59885242d0..63c849a19da72 100644
--- a/sound/soc/codecs/aw88399.c
+++ b/sound/soc/codecs/aw88399.c
@@ -285,6 +285,19 @@ static int aw_dev_check_sysst(struct aw_device *aw_dev)
else
check_val = AW88399_BIT_SYSST_SWS_CHECK;
+ /*
+ * When an external power supply (EPS) is used to feed the amplifier
+ * (EN_HVBAT bit in BSTCTRL10 set), the boost converter is bypassed,
+ * and BSTS (boost finished) will never assert. Skip the BSTS check in
+ * this case, matching the vendor driver's behavior.
+ */
+ ret = regmap_read(aw_dev->regmap, AW88399_BSTCTRL10_REG, ®_val);
+ if (ret)
+ return ret;
+
+ if (reg_val & (~AW88399_EPS_EN_MASK))
+ check_val &= ~AW88399_BSTS_FINISHED_VALUE;
+
for (i = 0; i < AW88399_DEV_SYSST_CHECK_MAX; i++) {
ret = regmap_read(aw_dev->regmap, AW88399_SYSST_REG, ®_val);
if (ret)
diff --git a/sound/soc/codecs/aw88399.h b/sound/soc/codecs/aw88399.h
index 5e9cdf725d3dd..1e9fab17f28c3 100644
--- a/sound/soc/codecs/aw88399.h
+++ b/sound/soc/codecs/aw88399.h
@@ -446,6 +446,11 @@
#define AW88399_NOISE_GATE_EN_MASK \
(~(((1<<AW88399_NOISE_GATE_EN_BITS_LEN)-1) << AW88399_NOISE_GATE_EN_START_BIT))
+#define AW88399_EPS_EN_START_BIT (2)
+#define AW88399_EPS_EN_BITS_LEN (1)
+#define AW88399_EPS_EN_MASK \
+ (~(((1 << AW88399_EPS_EN_BITS_LEN) - 1) << AW88399_EPS_EN_START_BIT))
+
#define AW88399_WDT_CNT_START_BIT (0)
#define AW88399_WDT_CNT_BITS_LEN (8)
#define AW88399_WDT_CNT_MASK \
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 458/816] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (456 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 457/816] ASoC: aw88399: skip BSTS check when boost converter is bypassed Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 459/816] dlm: validate node weights before building member array Greg Kroah-Hartman
` (362 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Konrad Dybcio,
Rob Clark, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
[ Upstream commit 77e3ffcf69065c4ce92c725540e0b4db14f43ad7 ]
Only a530/a540 have a GPMU. On the other a5xx parts, reading the
0xa800-0xac60 GPMU aperture during a crashdump resets the board -- on
sda660 (a512) a GPU hang thus reboots the SoC instead of recovering.
Split the GPMU block into its own array and collect it only when a GPMU
is present.
Fixes: e20c9284c8f2 ("drm/msm/adreno: Add support for Adreno 510 GPU")
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/754867/
Message-ID: <20260920-a5xx-no-gpmu-v1-1-714200254f76@oss.qualcomm.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
[ sashal: Kept the older kzalloc(sizeof(*a5xx_state), GFP_KERNEL) allocation as context and added the new adreno_gpu declaration above it, instead of upstream's kzalloc_obj() form. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 49 +++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index e09044930547f..65c6d14d54248 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1336,9 +1336,14 @@ static const u32 a5xx_registers[] = {
0xE800, 0xE806, 0xE810, 0xE89A, 0xE8A0, 0xE8A4, 0xE8AA, 0xE8EB,
0xE900, 0xE905, 0xEB80, 0xEB8F, 0xEBB0, 0xEBB0, 0xEC00, 0xEC05,
0xEC08, 0xECE9, 0xECF0, 0xECF0, 0xEA80, 0xEA80, 0xEA82, 0xEAA3,
- 0xEAA5, 0xEAC2, 0xA800, 0xA800, 0xA820, 0xA828, 0xA840, 0xA87D,
- 0XA880, 0xA88D, 0xA890, 0xA8A3, 0xA8D0, 0xA8D8, 0xA8E0, 0xA8F5,
- 0xAC60, 0xAC60, ~0,
+ 0xEAA5, 0xEAC2, ~0,
+};
+
+/* GPMU registers, only valid on parts with a GPMU (a530/a540) */
+static const u32 a5xx_gpmu_registers[] = {
+ 0xA800, 0xA800, 0xA820, 0xA828, 0xA840, 0xA87D, 0xA880, 0xA88D,
+ 0xA890, 0xA8A3, 0xA8D0, 0xA8D8, 0xA8E0, 0xA8F5, 0xAC60, 0xAC60,
+ ~0,
};
static void a5xx_dump(struct msm_gpu *gpu)
@@ -1449,6 +1454,7 @@ struct a5xx_crashdumper {
struct a5xx_gpu_state {
struct msm_gpu_state base;
u32 *hlsqregs;
+ u32 *gpmuregs;
};
static int a5xx_crashdumper_init(struct msm_gpu *gpu,
@@ -1566,8 +1572,30 @@ static void a5xx_gpu_state_get_hlsq_regs(struct msm_gpu *gpu,
msm_gem_kernel_put(dumper.bo, gpu->aspace);
}
+static void a5xx_gpu_state_get_gpmu_regs(struct msm_gpu *gpu,
+ struct a5xx_gpu_state *a5xx_state)
+{
+ u32 count = 0, pos = 0;
+ int i;
+
+ for (i = 0; a5xx_gpmu_registers[i] != ~0; i += 2)
+ count += a5xx_gpmu_registers[i + 1] - a5xx_gpmu_registers[i] + 1;
+
+ a5xx_state->gpmuregs = kcalloc(count, sizeof(u32), GFP_KERNEL);
+ if (!a5xx_state->gpmuregs)
+ return;
+
+ for (i = 0; a5xx_gpmu_registers[i] != ~0; i += 2) {
+ u32 addr;
+
+ for (addr = a5xx_gpmu_registers[i]; addr <= a5xx_gpmu_registers[i + 1]; addr++)
+ a5xx_state->gpmuregs[pos++] = gpu_read(gpu, addr);
+ }
+}
+
static struct msm_gpu_state *a5xx_gpu_state_get(struct msm_gpu *gpu)
{
+ struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct a5xx_gpu_state *a5xx_state = kzalloc(sizeof(*a5xx_state),
GFP_KERNEL);
bool stalled = !!(gpu_read(gpu, REG_A5XX_RBBM_STATUS3) & BIT(24));
@@ -1583,6 +1611,9 @@ static struct msm_gpu_state *a5xx_gpu_state_get(struct msm_gpu *gpu)
a5xx_state->base.rbbm_status = gpu_read(gpu, REG_A5XX_RBBM_STATUS);
+ if (adreno_is_a530(adreno_gpu) || adreno_is_a540(adreno_gpu))
+ a5xx_gpu_state_get_gpmu_regs(gpu, a5xx_state);
+
/*
* Get the HLSQ regs with the help of the crashdumper, but only if
* we are not stalled in an iommu fault (in which case the crashdumper
@@ -1604,6 +1635,7 @@ static void a5xx_gpu_state_destroy(struct kref *kref)
struct a5xx_gpu_state, base);
kfree(a5xx_state->hlsqregs);
+ kfree(a5xx_state->gpmuregs);
adreno_gpu_state_destroy(state);
kfree(a5xx_state);
@@ -1632,6 +1664,17 @@ static void a5xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
adreno_show(gpu, state, p);
+ if (a5xx_state->gpmuregs) {
+ u32 o, pos = 0;
+
+ drm_printf(p, "registers-gpmu:\n");
+
+ for (i = 0; a5xx_gpmu_registers[i] != ~0; i += 2)
+ for (o = a5xx_gpmu_registers[i]; o <= a5xx_gpmu_registers[i + 1]; o++)
+ drm_printf(p, " - { offset: 0x%04x, value: 0x%08x }\n",
+ o << 2, a5xx_state->gpmuregs[pos++]);
+ }
+
/* Dump the additional a5xx HLSQ registers */
if (!a5xx_state->hlsqregs)
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 459/816] dlm: validate node weights before building member array
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (457 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 458/816] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 460/816] drm/msm/a6xx: check pm_runtime_resume_and_get during resume Greg Kroah-Hartman
` (361 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qing Ming, Alexander Aring,
David Teigland, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qing Ming <a0yami@mailbox.org>
[ Upstream commit 7f662eb1807ed732ac7d5e119753c8185f241bb8 ]
DLM node weights are parsed as signed integers and copied into the member
list. make_member_array() uses their sum as the allocation count, but only
positive weights contribute entries to the array. A negative weight can
therefore reduce the allocation without reducing the number of writes.
The issue was found through static analysis of the configfs input and
member array construction. With two recovery members weighted -31 and 32,
the sum is 1, so recovery allocates one int and then writes the positive
member's node ID 32 times. A reproducer using dlm_controld and dlm_tool
triggered the same report on a KASAN kernel:
BUG: KASAN: slab-out-of-bounds in dlm_recover_members [dlm]
Write of size 4 by task dlm_recoverd
Call Trace:
dlm_recover_members
dlm_recoverd
kthread
ret_from_fork
Reject negative weights at the configfs input boundary. Also detect
overflow when adding non-negative weights to the signed allocation count,
and propagate array construction errors to the recovery path.
Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM")
Signed-off-by: Qing Ming <a0yami@mailbox.org>
Assisted-by: Codex:gpt-5
Acked-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
[ sashal: Replaced kmalloc_objs() with kmalloc_array() in make_member_array() since the older tree lacks the newer allocator helper, and dropped the early ls_total_weight assignment. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dlm/config.c | 9 ++++++++-
fs/dlm/member.c | 17 +++++++++++------
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index a523df1a1a735..e2228096f2a18 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -823,10 +823,17 @@ static ssize_t node_weight_show(struct config_item *item, char *buf)
static ssize_t node_weight_store(struct config_item *item, const char *buf,
size_t len)
{
- int rc = kstrtoint(buf, 0, &config_item_to_node(item)->weight);
+ struct dlm_node *node = config_item_to_node(item);
+ int weight;
+ int rc;
+ rc = kstrtoint(buf, 0, &weight);
if (rc)
return rc;
+ if (weight < 0)
+ return -EINVAL;
+
+ node->weight = weight;
return len;
}
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index c9661906568a1..3a3cc358af37f 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -406,7 +406,7 @@ void dlm_clear_members_gone(struct dlm_ls *ls)
clear_memb_list(&ls->ls_nodes_gone, NULL);
}
-static void make_member_array(struct dlm_ls *ls)
+static int make_member_array(struct dlm_ls *ls)
{
struct dlm_member *memb;
int i, w, x = 0, total = 0, all_zero = 0, *array;
@@ -415,8 +415,8 @@ static void make_member_array(struct dlm_ls *ls)
ls->ls_node_array = NULL;
list_for_each_entry(memb, &ls->ls_nodes, list) {
- if (memb->weight)
- total += memb->weight;
+ if (check_add_overflow(total, memb->weight, &total))
+ return -EOVERFLOW;
}
/* all nodes revert to weight of 1 if all have weight 0 */
@@ -426,10 +426,9 @@ static void make_member_array(struct dlm_ls *ls)
all_zero = 1;
}
- ls->ls_total_weight = total;
array = kmalloc_array(total, sizeof(*array), GFP_NOFS);
if (!array)
- return;
+ return -ENOMEM;
list_for_each_entry(memb, &ls->ls_nodes, list) {
if (!all_zero && !memb->weight)
@@ -446,7 +445,10 @@ static void make_member_array(struct dlm_ls *ls)
array[x++] = memb->nodeid;
}
+ ls->ls_total_weight = total;
ls->ls_node_array = array;
+
+ return 0;
}
/* send a status request to all members just to establish comms connections */
@@ -606,7 +608,10 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
}
ls->ls_low_nodeid = low;
- make_member_array(ls);
+ error = make_member_array(ls);
+ if (error)
+ return error;
+
*neg_out = neg;
error = ping_members(ls, rv->seq);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 460/816] drm/msm/a6xx: check pm_runtime_resume_and_get during resume
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (458 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 459/816] dlm: validate node weights before building member array Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 461/816] dmaengine: ste_dma40: Fix cyclic transfer residue Greg Kroah-Hartman
` (360 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roman Demidov, Dmitry Baryshkov,
Konrad Dybcio, Rob Clark, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roman Demidov <roman.demidov.nn@gmail.com>
[ Upstream commit e2f57c576f14f96449cfee840860cb9707501d23 ]
The return values of pm_runtime_resume_and_get() calls in a6xx_pm_resume()
are not checked, which can lead to hardware access on suspended devices
and PM reference underflows.
Fix this by checking the return value of each pm_runtime_resume_and_get()
call and properly unwinding the previously acquired resources on failure.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 5a903a44a984 ("drm/msm/a6xx: Introduce GMU wrapper support")
Signed-off-by: Roman Demidov <roman.demidov.nn@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/757106/
Message-ID: <20260929142103.81854-2-roman.demidov.nn@gmail.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
[ sashal: omitted the gmu->clocks bulk-enable error path and the a6xx_llc_activate() call because this tree's a6xx_pm_resume() lacks both, so only the PM resume return checks and unwind labels were applied. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 33 +++++++++++++++------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 4dc095f74c32b..f924d633809a5 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1877,36 +1877,41 @@ static int a6xx_pm_resume(struct msm_gpu *gpu)
opp = dev_pm_opp_find_freq_ceil(&gpu->pdev->dev, &freq);
if (IS_ERR(opp)) {
ret = PTR_ERR(opp);
- goto err_set_opp;
+ goto err_unlock;
}
/* Set the core clock and bus bw, having VDD scaling in mind */
dev_pm_opp_set_opp(&gpu->pdev->dev, opp);
dev_pm_opp_put(opp);
- pm_runtime_resume_and_get(gmu->dev);
- pm_runtime_resume_and_get(gmu->gxpd);
+ ret = pm_runtime_resume_and_get(gmu->dev);
+ if (ret < 0)
+ goto err_opp_clear;
+ ret = pm_runtime_resume_and_get(gmu->gxpd);
+ if (ret < 0)
+ goto err_put_dev;
ret = clk_bulk_prepare_enable(gpu->nr_clocks, gpu->grp_clks);
if (ret)
- goto err_bulk_clk;
+ goto err_put_gxpd;
if (adreno_is_a619_holi(adreno_gpu))
a6xx_sptprac_enable(gmu);
- /* If anything goes south, tear the GPU down piece by piece.. */
- if (ret) {
-err_bulk_clk:
- pm_runtime_put(gmu->gxpd);
- pm_runtime_put(gmu->dev);
- dev_pm_opp_set_opp(&gpu->pdev->dev, NULL);
- }
-err_set_opp:
mutex_unlock(&a6xx_gpu->gmu.lock);
+ msm_devfreq_resume(gpu);
- if (!ret)
- msm_devfreq_resume(gpu);
+ return 0;
+ /* If anything goes south, tear the GPU down piece by piece.. */
+err_put_gxpd:
+ pm_runtime_put(gmu->gxpd);
+err_put_dev:
+ pm_runtime_put(gmu->dev);
+err_opp_clear:
+ dev_pm_opp_set_opp(&gpu->pdev->dev, NULL);
+err_unlock:
+ mutex_unlock(&a6xx_gpu->gmu.lock);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 461/816] dmaengine: ste_dma40: Fix cyclic transfer residue
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (459 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 460/816] drm/msm/a6xx: check pm_runtime_resume_and_get during resume Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 462/816] dmaengine: ste_dma40: Recover coalesced cyclic callbacks Greg Kroah-Hartman
` (359 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit c80edceff29ee212987c2d2c851b2cb2eb4b477a ]
DMA40 reads residue from the element count of the currently active LLI.
For a cyclic transfer this reports at most one period, not the bytes
remaining until the cyclic buffer wraps.
Once DMA40 advertises burst granularity, DMAengine PCM uses this residue
directly. For a four-period PCM buffer it consequently reports the
hardware pointer near three periods after every period interrupt. ALSA
eventually stops playback with -EIO although DMA period callbacks
continue.
Calculate cyclic residue from the current memory-side hardware pointer
instead. Read the destination pointer for capture and the source pointer
for playback. Sample the split logical channel pointer coherently and
retain the last valid residue during relink transitions.
Make at most three residue sampling attempts: one initial read plus two
retries. The retries let transient split-register updates or LLI relink
windows settle, while the limit prevents unbounded polling if hardware does
not yield a valid pointer.
This avoids counting terminal-count interrupts, which races with hardware
advancing to the next LLI and cannot account for coalesced interrupt
status. Also reject cyclic periods that expand into multiple LLIs because
logical cyclic LLIs each request a terminal-count interrupt and would
generate more than one callback per period.
Reject invalid cyclic geometries before dividing or constructing the
scatterlist as well.
Reported-by: Frank Li <Frank.li@oss.nxp.com>
Closes: https://lore.kernel.org/dmaengine/aq2wIPJW6viUxyy9@SMW015318/
Fixes: 15c606686541 ("dmaengine: ste_dma40: indicate granularity on channels")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-2-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
[ sashal: Replaced kzalloc_objs() with the older kcalloc() call for the scatterlist allocation, with the rest matching upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 106 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 101 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 21469034495d7..53e56b4be3fca 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -69,6 +69,9 @@ struct stedma40_platform_data {
/* Maximum iterations taken before giving up suspending a channel */
#define D40_SUSPEND_MAX_IT 500
+/* Maximum attempts to sample a stable cyclic residue position */
+#define D40_RESIDUE_MAX_ATTEMPTS 3
+
/* Milliseconds */
#define DMA40_AUTOSUSPEND_DELAY 100
@@ -368,6 +371,9 @@ struct d40_lli_pool {
* @lli_len: Number of llis of current descriptor.
* @lli_current: Number of transferred llis.
* @lcla_alloc: Number of LCLA entries allocated.
+ * @cyclic_dma_addr: Start address of the cyclic buffer.
+ * @cyclic_buf_len: Length of the cyclic buffer.
+ * @cyclic_residue: Last valid cyclic residue sample.
* @txd: DMA engine struct. Used for among other things for communication
* during a transfer.
* @node: List entry.
@@ -386,6 +392,9 @@ struct d40_desc {
int lli_len;
int lli_current;
int lcla_alloc;
+ dma_addr_t cyclic_dma_addr;
+ size_t cyclic_buf_len;
+ size_t cyclic_residue;
struct dma_async_tx_descriptor txd;
struct list_head node;
@@ -1412,6 +1421,64 @@ static u32 d40_residue(struct d40_chan *d40c)
return num_elt * d40c->dma_cfg.dst_info.data_width;
}
+static bool d40_current_addr(struct d40_chan *d40c, dma_addr_t *addr)
+{
+ bool dst = d40c->dma_cfg.dir == DMA_DEV_TO_MEM;
+ void __iomem *high_reg;
+ void __iomem *low_reg;
+ u32 low;
+ u32 high;
+ u32 check;
+ int i;
+
+ if (chan_is_physical(d40c)) {
+ *addr = readl(chan_base(d40c) +
+ (dst ? D40_CHAN_REG_SDPTR : D40_CHAN_REG_SSPTR));
+ return true;
+ }
+
+ if (dst) {
+ low_reg = &d40c->lcpa->lcsp2;
+ high_reg = &d40c->lcpa->lcsp3;
+ } else {
+ low_reg = &d40c->lcpa->lcsp0;
+ high_reg = &d40c->lcpa->lcsp1;
+ }
+
+ for (i = 0; i < D40_RESIDUE_MAX_ATTEMPTS; i++) {
+ high = readl(high_reg) & D40_MEM_LCSP1_SPTR_MASK;
+ low = readl(low_reg) & D40_MEM_LCSP0_SPTR_MASK;
+ check = readl(high_reg) & D40_MEM_LCSP1_SPTR_MASK;
+ if (high == check) {
+ *addr = low | high;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static bool d40_cyclic_offset(struct d40_chan *d40c, struct d40_desc *d40d,
+ size_t *offset)
+{
+ dma_addr_t current_addr;
+ dma_addr_t current_offset;
+ int i;
+
+ for (i = 0; i < D40_RESIDUE_MAX_ATTEMPTS; i++) {
+ if (!d40_current_addr(d40c, ¤t_addr))
+ continue;
+
+ current_offset = current_addr - d40d->cyclic_dma_addr;
+ if (current_offset <= d40d->cyclic_buf_len) {
+ *offset = current_offset;
+ return true;
+ }
+ }
+
+ return false;
+}
+
static bool d40_tx_is_linked(struct d40_chan *d40c)
{
bool is_link;
@@ -2202,15 +2269,26 @@ static bool d40_is_paused(struct d40_chan *d40c)
}
-static u32 stedma40_residue(struct dma_chan *chan)
+static u32 stedma40_residue(struct dma_chan *chan, dma_cookie_t cookie)
{
struct d40_chan *d40c =
container_of(chan, struct d40_chan, chan);
+ struct d40_desc *d40d;
+ size_t offset;
u32 bytes_left;
unsigned long flags;
spin_lock_irqsave(&d40c->lock, flags);
- bytes_left = d40_residue(d40c);
+ d40d = d40_first_active_get(d40c);
+ if (d40d && d40d->txd.cookie == cookie && d40d->cyclic &&
+ d40d->cyclic_buf_len) {
+ if (d40_cyclic_offset(d40c, d40d, &offset))
+ d40d->cyclic_residue = d40d->cyclic_buf_len - offset;
+ bytes_left = d40d->cyclic_residue;
+ } else {
+ bytes_left = d40_residue(d40c);
+ }
+
spin_unlock_irqrestore(&d40c->lock, flags);
return bytes_left;
@@ -2346,8 +2424,13 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src,
if (desc == NULL)
goto unlock;
- if (sg_next(&sg_src[sg_len - 1]) == sg_src)
+ if (sg_next(&sg_src[sg_len - 1]) == sg_src) {
desc->cyclic = true;
+ if (desc->lli_len != sg_len) {
+ chan_err(chan, "Cyclic periods must fit in one LLI\n");
+ goto free_desc;
+ }
+ }
src_dev_addr = 0;
dst_dev_addr = 0;
@@ -2630,11 +2713,18 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
size_t buf_len, size_t period_len,
enum dma_transfer_direction direction, unsigned long flags)
{
- unsigned int periods = buf_len / period_len;
+ unsigned int periods;
struct dma_async_tx_descriptor *txd;
+ struct d40_desc *desc;
struct scatterlist *sg;
+ dma_addr_t buf_addr = dma_addr;
int i;
+ if (!buf_len || !period_len || buf_len % period_len)
+ return NULL;
+
+ periods = buf_len / period_len;
+
sg = kcalloc(periods + 1, sizeof(struct scatterlist), GFP_NOWAIT);
if (!sg)
return NULL;
@@ -2649,6 +2739,12 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
txd = d40_prep_sg(chan, sg, sg, periods, direction,
DMA_PREP_INTERRUPT);
+ if (txd) {
+ desc = container_of(txd, struct d40_desc, txd);
+ desc->cyclic_dma_addr = buf_addr;
+ desc->cyclic_buf_len = buf_len;
+ desc->cyclic_residue = buf_len;
+ }
kfree(sg);
@@ -2669,7 +2765,7 @@ static enum dma_status d40_tx_status(struct dma_chan *chan,
ret = dma_cookie_status(chan, cookie, txstate);
if (ret != DMA_COMPLETE && txstate)
- dma_set_residue(txstate, stedma40_residue(chan));
+ dma_set_residue(txstate, stedma40_residue(chan, cookie));
if (d40_is_paused(d40c))
ret = DMA_PAUSED;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 462/816] dmaengine: ste_dma40: Recover coalesced cyclic callbacks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (460 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 461/816] dmaengine: ste_dma40: Fix cyclic transfer residue Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 463/816] proc: report SIGEV_NONE in /proc/pid/timers if target task has died Greg Kroah-Hartman
` (358 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit db28400d92cd97005065dad230b8a5d72ab121cb ]
DMA40 has one terminal-count status bit per channel, so cyclic period
interrupts can coalesce.
Use the memory-side pointer displacement to queue the minimum observable
number of callbacks. If sampling fails, queue one callback and invalidate
the saved position; the next successful sample resynchronizes without
recounting it.
The pointer is modulo the cyclic buffer: a displacement of d periods can
mean d plus n complete iterations of the buffer. Report d, so the driver
could have missed n iterations of the buffer; DMA40 has no counter to
recover them. For an unchanged pointer, report one callback rather than
risk a spurious full-buffer burst.
This condition has not been seen in practice and is only a product of
review comments that the buffer can miss interrupts.
The preceding cyclic-residue fix ensures that every cyclic period fits in
one LLI, so each boundary corresponds to one client callback.
Fixes: 0c842b551063 ("dma40: cyclic xfer support")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-3-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 69 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 68 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 53e56b4be3fca..2c83eb05faa16 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -374,11 +374,14 @@ struct d40_lli_pool {
* @cyclic_dma_addr: Start address of the cyclic buffer.
* @cyclic_buf_len: Length of the cyclic buffer.
* @cyclic_residue: Last valid cyclic residue sample.
+ * @cyclic_period_len: Length of one cyclic period.
+ * @cyclic_callback_pos: Position after the callbacks already queued.
* @txd: DMA engine struct. Used for among other things for communication
* during a transfer.
* @node: List entry.
* @is_in_client_list: true if the client owns this descriptor.
* @cyclic: true if this is a cyclic job
+ * @cyclic_callback_pos_valid: Whether cyclic_callback_pos is reliable.
*
* This descriptor is used for both logical and physical transfers.
*/
@@ -395,12 +398,15 @@ struct d40_desc {
dma_addr_t cyclic_dma_addr;
size_t cyclic_buf_len;
size_t cyclic_residue;
+ size_t cyclic_period_len;
+ size_t cyclic_callback_pos;
struct dma_async_tx_descriptor txd;
struct list_head node;
bool is_in_client_list;
bool cyclic;
+ bool cyclic_callback_pos_valid;
};
/**
@@ -1479,6 +1485,61 @@ static bool d40_cyclic_offset(struct d40_chan *d40c, struct d40_desc *d40d,
return false;
}
+static unsigned int d40_cyclic_periods_elapsed(struct d40_chan *d40c,
+ struct d40_desc *d40d)
+{
+ size_t current_pos;
+ size_t delta;
+ size_t offset;
+ unsigned int periods;
+
+ if (!d40d->cyclic_period_len)
+ return 1;
+
+ if (!d40_cyclic_offset(d40c, d40d, &offset)) {
+ d40d->cyclic_callback_pos_valid = false;
+ return 1;
+ }
+
+ current_pos = rounddown(offset, d40d->cyclic_period_len);
+ if (!d40_residue(d40c) && current_pos != offset)
+ current_pos += d40d->cyclic_period_len;
+ if (current_pos == d40d->cyclic_buf_len)
+ current_pos = 0;
+
+ if (!d40d->cyclic_callback_pos_valid) {
+ /*
+ * The previous interrupt was reported without a pointer
+ * sample. Resynchronize without using the stale position,
+ * which would count that callback again.
+ */
+ d40d->cyclic_callback_pos = current_pos;
+ d40d->cyclic_callback_pos_valid = true;
+ return 1;
+ }
+
+ /*
+ * The pointer wraps with the cyclic buffer, so its displacement is
+ * only the minimum number of elapsed periods. Complete buffer laps
+ * are not observable.
+ */
+ delta = (current_pos + d40d->cyclic_buf_len -
+ d40d->cyclic_callback_pos) % d40d->cyclic_buf_len;
+ periods = delta / d40d->cyclic_period_len;
+ if (!periods) {
+ /*
+ * The TC status is a single latched bit. An unchanged pointer
+ * cannot distinguish a complete lap from a repeated interrupt,
+ * so do not amplify it into a buffer's worth of callbacks.
+ */
+ periods = 1;
+ }
+
+ d40d->cyclic_callback_pos = current_pos;
+
+ return periods;
+}
+
static bool d40_tx_is_linked(struct d40_chan *d40c)
{
bool is_link;
@@ -1626,6 +1687,7 @@ static struct d40_desc *d40_queue_start(struct d40_chan *d40c)
static void dma_tc_handle(struct d40_chan *d40c)
{
struct d40_desc *d40d;
+ unsigned int callbacks = 1;
/* Get first active entry from list */
d40d = d40_first_active_get(d40c);
@@ -1650,6 +1712,8 @@ static void dma_tc_handle(struct d40_chan *d40c)
if (d40d->lli_current == d40d->lli_len)
d40d->lli_current = 0;
}
+
+ callbacks = d40_cyclic_periods_elapsed(d40c, d40d);
} else {
d40_lcla_free_all(d40c, d40d);
@@ -1670,7 +1734,7 @@ static void dma_tc_handle(struct d40_chan *d40c)
}
}
- d40c->pending_tx++;
+ d40c->pending_tx += callbacks;
tasklet_schedule(&d40c->tasklet);
}
@@ -2744,6 +2808,9 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
desc->cyclic_dma_addr = buf_addr;
desc->cyclic_buf_len = buf_len;
desc->cyclic_residue = buf_len;
+ desc->cyclic_period_len = period_len;
+ desc->cyclic_callback_pos = 0;
+ desc->cyclic_callback_pos_valid = true;
}
kfree(sg);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 463/816] proc: report SIGEV_NONE in /proc/pid/timers if target task has died
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (461 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 462/816] dmaengine: ste_dma40: Recover coalesced cyclic callbacks Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 464/816] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown() Greg Kroah-Hartman
` (357 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrei Vagin, Andrew Morton,
Pavel Tikhomirov, Thomas Gleixner, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrei Vagin <avagin@google.com>
[ Upstream commit 0a27f795030ce6a2c71525b0544e3b13bba8828e ]
When a posix timer is created targeting a specific thread (using
SIGEV_SIGNAL | SIGEV_THREAD_ID), it takes a reference to the target struct
pid in timer->it_pid. If the target thread subsequently terminates, its
numeric tid is freed and can be recycled for an unrelated task. However,
the timer holds its reference to the original struct pid.
show_timer() in /proc/[pid]/timers previously called pid_nr_ns() directly
on timer->it_pid without checking whether any task remained attached to
that struct pid. As a result:
1. It reported the stale tid, which could mistakenly refer to a recycled
pid.
2. In the kernel, expired signals for dead target threads are dropped by
posixtimer_send_sigqueue() because posixtimer_get_target() returns
NULL, so the timer functionally acts as SIGEV_NONE.
3. Checkpoint/restore tools (CRIU) parsing /proc/[pid]/timers would try
to restore a timer with SIGEV_SIGNAL | SIGEV_THREAD_ID targeting a
non-existent or unrelated thread.
Check pid_has_task(timer->it_pid, timer->it_pid_type) in show_timer(). If
the target task has died, override notify to SIGEV_NONE and report PID 0
(e.g., 'notify: none/pid.0').
Link: https://lore.kernel.org/20260816161216.984580-1-avagin@google.com
Fixes: 57b8015e07a7 ("posix-timers: Show sigevent info in proc file")
Signed-off-by: Andrei Vagin <avagin@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
[ sashal: Replaced the missing it_pid_type field with (notify & SIGEV_THREAD_ID) ? PIDTYPE_PID : PIDTYPE_TGID and adapted to the local show_timer() layout, without the guard() lock or posixtimer_valid(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/proc/base.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 427fb5abb07c7..0f58fe8697c4e 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2527,6 +2527,7 @@ static int show_timer(struct seq_file *m, void *v)
struct k_itimer *timer;
struct timers_private *tp = m->private;
int notify;
+ pid_t nr = 0;
static const char * const nstr[] = {
[SIGEV_SIGNAL] = "signal",
[SIGEV_NONE] = "none",
@@ -2536,6 +2537,13 @@ static int show_timer(struct seq_file *m, void *v)
timer = hlist_entry((struct hlist_node *)v, struct k_itimer, list);
notify = timer->it_sigev_notify;
+ if (timer->it_pid &&
+ pid_has_task(timer->it_pid,
+ (notify & SIGEV_THREAD_ID) ? PIDTYPE_PID : PIDTYPE_TGID))
+ nr = pid_nr_ns(timer->it_pid, tp->ns);
+ else
+ notify = SIGEV_NONE;
+
seq_printf(m, "ID: %d\n", timer->it_id);
seq_printf(m, "signal: %d/%px\n",
timer->sigq->info.si_signo,
@@ -2543,7 +2551,7 @@ static int show_timer(struct seq_file *m, void *v)
seq_printf(m, "notify: %s/%s.%d\n",
nstr[notify & ~SIGEV_THREAD_ID],
(notify & SIGEV_THREAD_ID) ? "tid" : "pid",
- pid_nr_ns(timer->it_pid, tp->ns));
+ nr);
seq_printf(m, "ClockID: %d\n", timer->it_clock);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 464/816] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (462 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 463/816] proc: report SIGEV_NONE in /proc/pid/timers if target task has died Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 465/816] wifi: mt76: mt7996: enable the SKU power limit table Greg Kroah-Hartman
` (356 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aamir Ahmed, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aamir Ahmed <elb12345@hotmail.co.uk>
[ Upstream commit e75897e6cb8b900d095acf6fbff1ffb026c86c35 ]
mt7996_mcu_ie_countdown() iterates over TLV entries in the countdown
event but only checks for a non-zero tlv->len. A malformed event with
a TLV length smaller than the 4-byte TLV header advances the cursor by
less than a header size, causing misaligned reads on subsequent
iterations. A TLV whose declared length exceeds the remaining buffer
is also not caught, so the cursor can overshoot the end. The band
field of the event header is also read without checking that the event
is long enough to contain it.
This is the same class of bug fixed for mt7925 in
commit fc7801b7f11d ("wifi: mt76: mt7925: fix infinite loop in UNI
event TLV parsing").
Fix by checking that the event contains the header before reading the
band, and that each TLV is large enough to contain the countdown notify
payload and does not exceed the remaining buffer.
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Assisted-by: Claude (Anthropic)
Signed-off-by: Aamir Ahmed <elb12345@hotmail.co.uk>
Link: https://patch.msgid.link/AS8P251MB0001CCE8D1BEE1F330D9E57AC8B22@AS8P251MB0001.EURP251.PROD.OUTLOOK.COM
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: Added bounds checks in the countdown TLV parser, using a literal 4 for the payload size because the countdown notify struct doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index a8a0737635d27..edb825675408c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -450,6 +450,9 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
struct header *hdr = (struct header *)data;
struct tlv *tlv = (struct tlv *)(data + 4);
+ if (skb->len < sizeof(*rxd) + sizeof(*hdr))
+ return;
+
if (hdr->band >= ARRAY_SIZE(dev->mt76.phys))
return;
@@ -458,7 +461,12 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
tail = skb->data + skb->len;
data += sizeof(struct header);
- while (data + sizeof(struct tlv) < tail && le16_to_cpu(tlv->len)) {
+ while (data + sizeof(struct tlv) <= tail) {
+ u16 tag_len = le16_to_cpu(tlv->len);
+
+ if (tag_len < sizeof(*tlv) + 4 || data + tag_len > tail)
+ break;
+
switch (le16_to_cpu(tlv->tag)) {
case UNI_EVENT_IE_COUNTDOWN_CSA:
ieee80211_iterate_active_interfaces_atomic(mphy->hw,
@@ -472,7 +480,7 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
break;
}
- data += le16_to_cpu(tlv->len);
+ data += tag_len;
tlv = (struct tlv *)data;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 465/816] wifi: mt76: mt7996: enable the SKU power limit table
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (463 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 464/816] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 466/816] wifi: mt76: mt7996: fix the hw-queues debugfs queue requests Greg Kroah-Hartman
` (355 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit 267424ac63aa65fb28b7f3cff1e1a7d0098c4d6f ]
mt7996_mcu_set_txpower_sku() uploads the per-rate power limit table, but
the firmware applies it only after the driver enables the SKU power
limit. mt7915 does that in mt7915_mcu_set_sku_en(); mt7996 never does,
so the radio keeps the EEPROM target power and the configured tx power
has no effect.
Add the power control command and enable the table per band in
mt7996_run(), as the MediaTek vendor driver does.
The backoff table stays disabled. This driver does not build the
per-path limits; it pads that part of the message with zeros.
Fixes: f75e4779d215 ("wifi: mt76: mt7996: add txpower setting support")
Link: https://patch.msgid.link/20261006205936.669125-2-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: Changed the return ret; in mt7996_run() to goto out;, and dropped the missing sniffer-mode and rdd_resume_tx context from the mcu.c and mt7996.h hunks. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/mediatek/mt76/mt7996/main.c | 5 +++
.../net/wireless/mediatek/mt76/mt7996/mcu.c | 34 +++++++++++++++++++
.../net/wireless/mediatek/mt76/mt7996/mcu.h | 23 +++++++++++++
.../wireless/mediatek/mt76/mt7996/mt7996.h | 1 +
4 files changed, 63 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
index bdb5e82d9f4e7..1074b677ebd81 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
@@ -67,6 +67,11 @@ int mt7996_run(struct ieee80211_hw *hw)
if (ret)
goto out;
+ ret = mt7996_mcu_set_tx_power_ctrl(phy, UNI_TXPOWER_SKU_POWER_LIMIT_CTRL,
+ true);
+ if (ret)
+ goto out;
+
set_bit(MT76_STATE_RUNNING, &phy->mt76->state);
ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index edb825675408c..67fa3db3171f8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -4566,6 +4566,40 @@ int mt7996_mcu_wed_rro_reset_sessions(struct mt7996_dev *dev, u16 id)
sizeof(req), true);
}
+int mt7996_mcu_set_tx_power_ctrl(struct mt7996_phy *phy, u8 power_ctrl_id, u8 data)
+{
+ struct mt7996_dev *dev = phy->dev;
+ struct tx_power_ctrl req = {
+ .tag = cpu_to_le16(power_ctrl_id),
+ .len = cpu_to_le16(sizeof(req) - 4),
+ .power_ctrl_id = power_ctrl_id,
+ .band_idx = phy->mt76->band_idx,
+ };
+
+ switch (power_ctrl_id) {
+ case UNI_TXPOWER_SKU_POWER_LIMIT_CTRL:
+ req.sku_enable = !!data;
+ break;
+ case UNI_TXPOWER_PERCENTAGE_CTRL:
+ req.percentage_ctrl_enable = !!data;
+ break;
+ case UNI_TXPOWER_PERCENTAGE_DROP_CTRL:
+ req.power_drop_level = data;
+ break;
+ case UNI_TXPOWER_BACKOFF_POWER_LIMIT_CTRL:
+ req.bf_backoff_enable = !!data;
+ break;
+ case UNI_TXPOWER_ATE_MODE_CTRL:
+ req.ate_mode_enable = !!data;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(TXPOWER),
+ &req, sizeof(req), false);
+}
+
int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
{
#define TX_POWER_LIMIT_TABLE_RATE 0
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
index dd5b168c71f06..d56fdabd959af 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
@@ -892,8 +892,31 @@ enum {
UNI_CMD_THERMAL_PROTECT_DUTY_CONFIG,
};
+struct tx_power_ctrl {
+ u8 _rsv[4];
+
+ __le16 tag;
+ __le16 len;
+
+ u8 power_ctrl_id;
+ union {
+ bool sku_enable;
+ bool ate_mode_enable;
+ bool percentage_ctrl_enable;
+ bool bf_backoff_enable;
+ u8 power_drop_level;
+ };
+ u8 band_idx;
+ u8 rsv[1];
+} __packed;
+
enum {
+ UNI_TXPOWER_SKU_POWER_LIMIT_CTRL = 0,
+ UNI_TXPOWER_PERCENTAGE_CTRL = 1,
+ UNI_TXPOWER_PERCENTAGE_DROP_CTRL = 2,
+ UNI_TXPOWER_BACKOFF_POWER_LIMIT_CTRL = 3,
UNI_TXPOWER_POWER_LIMIT_TABLE_CTRL = 4,
+ UNI_TXPOWER_ATE_MODE_CTRL = 6,
};
enum {
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
index 29e7289c3a169..6f7a10d6659e2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
@@ -496,6 +496,7 @@ int mt7996_mcu_get_temperature(struct mt7996_phy *phy);
int mt7996_mcu_set_thermal_throttling(struct mt7996_phy *phy, u8 state);
int mt7996_mcu_set_thermal_protect(struct mt7996_phy *phy, bool enable);
int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy);
+int mt7996_mcu_set_tx_power_ctrl(struct mt7996_phy *phy, u8 power_ctrl_id, u8 data);
int mt7996_mcu_rdd_cmd(struct mt7996_dev *dev, int cmd, u8 index,
u8 rx_sel, u8 val);
int mt7996_mcu_rdd_background_enable(struct mt7996_phy *phy,
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 466/816] wifi: mt76: mt7996: fix the hw-queues debugfs queue requests
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (464 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 465/816] wifi: mt76: mt7996: enable the SKU power limit table Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 467/816] wifi: mt76: mt7921: fix of_node reference leaks in regd update Greg Kroah-Hartman
` (354 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit ef28298ab88bd7ba8d805fb8dfaaacd9246d5fbf ]
The hw-queues debugfs file builds its own queue requests, and these do
not match the register map of the MediaTek vendor driver:
- The port ID goes to bits 11:10 of the PLE queue control register, but
the field is at bits 17:16. Bits 11:10 are part of the WLAN index, so
each request reads port 0 and, for a station, the WLAN index with
bit 11 set.
- The head and tail frame IDs, the packet count and the page counters
are read as 12-bit fields, but they have 13 bits.
- The PSE queues are read from the PLE empty and queue control
registers, with bit positions that do not match the PSE queue map.
- The station queues of MT7992 and MT7990 with a WLAN index from 512 to
543 are read from register 16, but these chips keep that group in the
extension register at index 32.
- The file iterates the stations of the same ieee80211_hw once for each
band, so it shows each station queue up to three times.
- mt7996_hw_queue_read() takes the private data of the file as a
struct mt7996_phy, but it is a struct mt7996_dev. The dev member
of the phy then aliases mt76.phy.dev of the device, which points back
to the device, so the file works by chance.
A queue request also writes the queue control register 0 and then reads
the result from the queue control registers 2 and 3, without a lock.
When the global and a per-station hw-queues file are read at the same
time, one reader can get the result of the request of the other.
Describe the PLE and PSE queues in tables with the field layout of the
vendor register map, and send all queue requests through one helper,
which holds a spinlock from the write of the request to the read of its
result. A spinlock is needed because the station requests are sent from
ieee80211_iterate_stations_atomic(). Iterate the stations once.
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Link: https://patch.msgid.link/20261006205936.669125-26-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: Adapted the station and hw-queues handlers to the pre-MLO code: no link loop, inputs from msta->vif and msta->wcid, and the per-phy private data and single-hw iteration kept. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../wireless/mediatek/mt76/mt7996/debugfs.c | 298 ++++++++++++------
.../net/wireless/mediatek/mt76/mt7996/regs.h | 28 ++
2 files changed, 224 insertions(+), 102 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
index 62c03d088925c..c627a86a5d517 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
@@ -13,13 +13,6 @@
/** global debugfs **/
-struct hw_queue_map {
- const char *name;
- u8 index;
- u8 pid;
- u8 qid;
-};
-
static int
mt7996_implicit_txbf_set(void *data, u64 val)
{
@@ -566,35 +559,176 @@ mt7996_tx_stats_show(struct seq_file *file, void *data)
DEFINE_SHOW_ATTRIBUTE(mt7996_tx_stats);
+enum {
+ MT_QUEUE_PORT_HIF,
+ MT_QUEUE_PORT_CPU,
+ MT_QUEUE_PORT_LMAC,
+ MT_QUEUE_PORT_PLE_CTRL,
+};
+
+struct mt7996_hw_queue {
+ const char *name;
+ u8 pid;
+ u8 qid;
+ u8 tgid;
+};
+
+#define MT7996_HW_QUEUE(_name, _pid, _qid, _tgid) \
+ { .name = _name, .pid = MT_QUEUE_PORT_##_pid, .qid = _qid, .tgid = _tgid }
+
+static const struct mt7996_hw_queue mt7996_ple_queues[32] = {
+ [0] = MT7996_HW_QUEUE("CPU Q0", CPU, 0, 0),
+ [1] = MT7996_HW_QUEUE("CPU Q1", CPU, 1, 0),
+ [2] = MT7996_HW_QUEUE("CPU Q2", CPU, 2, 0),
+ [3] = MT7996_HW_QUEUE("CPU Q3", CPU, 3, 0),
+ [4] = MT7996_HW_QUEUE("ALTX Q0", LMAC, 0x10, 0),
+ [5] = MT7996_HW_QUEUE("BMC Q0", LMAC, 0x11, 0),
+ [6] = MT7996_HW_QUEUE("BCN Q0", LMAC, 0x12, 0),
+ [7] = MT7996_HW_QUEUE("PSMP Q0", LMAC, 0x13, 0),
+ [8] = MT7996_HW_QUEUE("ALTX Q1", LMAC, 0x10, 1),
+ [9] = MT7996_HW_QUEUE("BMC Q1", LMAC, 0x11, 1),
+ [10] = MT7996_HW_QUEUE("BCN Q1", LMAC, 0x12, 1),
+ [11] = MT7996_HW_QUEUE("PSMP Q1", LMAC, 0x13, 1),
+ [12] = MT7996_HW_QUEUE("ALTX Q2", LMAC, 0x1c, 2),
+ [13] = MT7996_HW_QUEUE("BMC Q2", LMAC, 0x1d, 2),
+ [14] = MT7996_HW_QUEUE("BCN Q2", LMAC, 0x1e, 2),
+ [15] = MT7996_HW_QUEUE("PSMP Q2", LMAC, 0x1f, 2),
+ [16] = MT7996_HW_QUEUE("NAF Q", LMAC, 0x18, 0),
+ [17] = MT7996_HW_QUEUE("NBCN Q", LMAC, 0x19, 0),
+ [20] = MT7996_HW_QUEUE("FIXFID Q", LMAC, 0x1a, 0),
+ [28] = MT7996_HW_QUEUE("RLS4 Q", PLE_CTRL, 0x7c, 0),
+ [29] = MT7996_HW_QUEUE("RLS3 Q", PLE_CTRL, 0x7d, 0),
+ [30] = MT7996_HW_QUEUE("RLS2 Q", PLE_CTRL, 0x7e, 0),
+ [31] = MT7996_HW_QUEUE("RLS Q", PLE_CTRL, 0x7f, 0),
+};
+
+static const struct mt7996_hw_queue mt7996_pse_queues[32] = {
+ [0] = MT7996_HW_QUEUE("CPU Q0", CPU, 0, 0),
+ [1] = MT7996_HW_QUEUE("CPU Q1", CPU, 1, 0),
+ [2] = MT7996_HW_QUEUE("CPU Q2", CPU, 2, 0),
+ [3] = MT7996_HW_QUEUE("CPU Q3", CPU, 3, 0),
+ [16] = MT7996_HW_QUEUE("LMAC Q", LMAC, 0, 0),
+ [17] = MT7996_HW_QUEUE("MDP TX Q0", LMAC, 1, 0),
+ [18] = MT7996_HW_QUEUE("MDP RX Q", LMAC, 2, 0),
+ [19] = MT7996_HW_QUEUE("SEC TX Q0", LMAC, 3, 0),
+ [20] = MT7996_HW_QUEUE("SEC RX Q", LMAC, 4, 0),
+ [21] = MT7996_HW_QUEUE("SFD PARK Q", LMAC, 5, 0),
+ [22] = MT7996_HW_QUEUE("MDP TXIOC Q0", LMAC, 6, 0),
+ [23] = MT7996_HW_QUEUE("MDP RXIOC Q0", LMAC, 7, 0),
+ [24] = MT7996_HW_QUEUE("MDP TX Q1", LMAC, 0x11, 0),
+ [25] = MT7996_HW_QUEUE("SEC TX Q1", LMAC, 0x13, 0),
+ [26] = MT7996_HW_QUEUE("MDP TXIOC Q1", LMAC, 0x16, 0),
+ [27] = MT7996_HW_QUEUE("MDP RXIOC Q1", LMAC, 0x17, 0),
+ [28] = MT7996_HW_QUEUE("CPU Q4", CPU, 4, 0),
+ [31] = MT7996_HW_QUEUE("RLS Q", PLE_CTRL, 0x1f, 0),
+};
+
+static const struct mt7996_hw_queue mt7996_pse_queues_1[32] = {
+ [0] = MT7996_HW_QUEUE("MDP TDPIOC Q0", LMAC, 0x08, 0),
+ [1] = MT7996_HW_QUEUE("MDP RDPIOC Q0", LMAC, 0x09, 0),
+ [2] = MT7996_HW_QUEUE("MDP TDPIOC Q1", LMAC, 0x18, 0),
+ [3] = MT7996_HW_QUEUE("MDP RDPIOC Q1", LMAC, 0x19, 0),
+ [4] = MT7996_HW_QUEUE("MDP TDPIOC Q2", LMAC, 0x28, 0),
+ [5] = MT7996_HW_QUEUE("MDP RDPIOC Q2", LMAC, 0x29, 0),
+ [7] = MT7996_HW_QUEUE("MDP RDPIOC Q3", LMAC, 0x39, 0),
+ [8] = MT7996_HW_QUEUE("MDP TX Q2", LMAC, 0x21, 0),
+ [9] = MT7996_HW_QUEUE("SEC TX Q2", LMAC, 0x23, 0),
+ [10] = MT7996_HW_QUEUE("MDP TXIOC Q2", LMAC, 0x26, 0),
+ [11] = MT7996_HW_QUEUE("MDP RXIOC Q2", LMAC, 0x27, 0),
+ [15] = MT7996_HW_QUEUE("MDP RXIOC Q3", LMAC, 0x37, 0),
+ [16] = MT7996_HW_QUEUE("HIF Q0", HIF, 0, 0),
+ [17] = MT7996_HW_QUEUE("HIF Q1", HIF, 1, 0),
+ [18] = MT7996_HW_QUEUE("HIF Q2", HIF, 2, 0),
+ [19] = MT7996_HW_QUEUE("HIF Q3", HIF, 3, 0),
+ [20] = MT7996_HW_QUEUE("HIF Q4", HIF, 4, 0),
+ [21] = MT7996_HW_QUEUE("HIF Q5", HIF, 5, 0),
+ [22] = MT7996_HW_QUEUE("HIF Q6", HIF, 6, 0),
+ [23] = MT7996_HW_QUEUE("HIF Q7", HIF, 7, 0),
+ [24] = MT7996_HW_QUEUE("HIF Q8", HIF, 8, 0),
+ [25] = MT7996_HW_QUEUE("HIF Q9", HIF, 9, 0),
+ [26] = MT7996_HW_QUEUE("HIF Q10", HIF, 10, 0),
+ [27] = MT7996_HW_QUEUE("HIF Q11", HIF, 11, 0),
+ [28] = MT7996_HW_QUEUE("HIF Q12", HIF, 12, 0),
+ [29] = MT7996_HW_QUEUE("HIF Q13", HIF, 13, 0),
+};
+
static void
-mt7996_hw_queue_read(struct seq_file *s, u32 size,
- const struct hw_queue_map *map)
+mt7996_fl_queue_show(struct seq_file *s, struct mt7996_dev *dev, bool pse,
+ const struct mt7996_hw_queue *q, u16 wlan_idx)
{
- struct mt7996_phy *phy = s->private;
- struct mt7996_dev *dev = phy->dev;
- u32 i, val;
+ static DEFINE_SPINLOCK(lock);
+ u32 val, fid, num;
+
+ val = MT_FL_Q0_CTRL_EXECUTE |
+ u32_encode_bits(q->qid, MT_FL_Q0_CTRL_QID) |
+ u32_encode_bits(q->tgid, MT_FL_Q0_CTRL_TGID) |
+ u32_encode_bits(q->pid, MT_FL_Q0_CTRL_PID) |
+ u32_encode_bits(wlan_idx, MT_FL_Q0_CTRL_WLAN_IDX);
+
+ spin_lock(&lock);
+ mt76_wr(dev, pse ? MT_PSE_FL_Q0_CTRL : MT_FL_Q0_CTRL, val);
+ fid = mt76_rr(dev, pse ? MT_PSE_FL_Q2_CTRL : MT_FL_Q2_CTRL);
+ num = mt76_rr(dev, pse ? MT_PSE_FL_Q3_CTRL : MT_FL_Q3_CTRL);
+ spin_unlock(&lock);
+
+ seq_printf(s, "tail/head fid 0x%04x/0x%04x, packets %u",
+ u32_get_bits(fid, MT_FL_Q2_CTRL_TAIL_FID),
+ u32_get_bits(fid, MT_FL_Q2_CTRL_HEAD_FID),
+ u32_get_bits(num, MT_FL_Q3_CTRL_PKT_NUM));
+}
- val = mt76_rr(dev, MT_FL_Q_EMPTY);
- for (i = 0; i < size; i++) {
- u32 ctrl, head, tail, queued;
+static void
+mt7996_fl_queues_show(struct seq_file *s, struct mt7996_dev *dev, bool pse,
+ const struct mt7996_hw_queue *queues, unsigned long empty)
+{
+ unsigned int i;
- if (val & BIT(map[i].index))
+ for_each_clear_bit(i, &empty, 32) {
+ if (!queues[i].name)
continue;
- ctrl = BIT(31) | (map[i].pid << 10) | ((u32)map[i].qid << 24);
- mt76_wr(dev, MT_FL_Q0_CTRL, ctrl);
+ seq_printf(s, "\t%s: ", queues[i].name);
+ mt7996_fl_queue_show(s, dev, pse, &queues[i], 0);
+ seq_puts(s, "\n");
+ }
+}
- head = mt76_get_field(dev, MT_FL_Q2_CTRL,
- GENMASK(11, 0));
- tail = mt76_get_field(dev, MT_FL_Q2_CTRL,
- GENMASK(27, 16));
- queued = mt76_get_field(dev, MT_FL_Q3_CTRL,
- GENMASK(11, 0));
+static void
+mt7996_freepg_show(struct seq_file *s, u32 cnt, u32 head_tail)
+{
+ seq_printf(s, "\tfree pages 0x%04x, free for all 0x%04x, head/tail 0x%04x/0x%04x\n",
+ u32_get_bits(cnt, MT_FREEPG_CNT_FREE),
+ u32_get_bits(cnt, MT_FREEPG_CNT_FFA),
+ u32_get_bits(head_tail, MT_FREEPG_HEAD_TAIL_HEAD),
+ u32_get_bits(head_tail, MT_FREEPG_HEAD_TAIL_TAIL));
+}
- seq_printf(s, "\t%s: ", map[i].name);
- seq_printf(s, "queued:0x%03x head:0x%03x tail:0x%03x\n",
- queued, head, tail);
- }
+static void
+mt7996_pg_group_show(struct seq_file *s, const char *name, u32 group, u32 info)
+{
+ seq_printf(s, "\t%s group: max/min quota 0x%04x/0x%04x, used/reserved 0x%04x/0x%04x\n",
+ name, u32_get_bits(group, MT_PG_GROUP_MAX_QUOTA),
+ u32_get_bits(group, MT_PG_GROUP_MIN_QUOTA),
+ u32_get_bits(info, MT_PG_INFO_SRC_CNT),
+ u32_get_bits(info, MT_PG_INFO_RSV_CNT));
+}
+
+static unsigned int
+mt7996_ple_sta_cr_num(struct mt7996_dev *dev)
+{
+ return is_mt7996(&dev->mt76) ? 34 : 17;
+}
+
+static unsigned int
+mt7996_ple_sta_cr(struct mt7996_dev *dev, unsigned int n)
+{
+ /* MT7992 and MT7990 keep the last station group in the
+ * extension register that follows the first 32 groups
+ */
+ if (!is_mt7996(&dev->mt76) && n == mt7996_ple_sta_cr_num(dev) - 1)
+ return 32;
+
+ return n;
}
static void
@@ -603,92 +737,52 @@ mt7996_sta_hw_queue_read(void *data, struct ieee80211_sta *sta)
struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
struct mt7996_dev *dev = msta->vif->phy->dev;
struct seq_file *s = data;
+ unsigned int cr;
+ u16 wlan_idx;
u8 ac;
- for (ac = 0; ac < 4; ac++) {
- u32 qlen, ctrl, val;
- u32 idx = msta->wcid.idx >> 5;
- u8 offs = msta->wcid.idx & GENMASK(4, 0);
-
- ctrl = BIT(31) | BIT(11) | (ac << 24);
- val = mt76_rr(dev, MT_PLE_AC_QEMPTY(ac, idx));
+ wlan_idx = msta->wcid.idx;
+ cr = mt7996_ple_sta_cr(dev, wlan_idx / 32);
+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
+ struct mt7996_hw_queue q = {
+ .pid = MT_QUEUE_PORT_LMAC,
+ .qid = ac,
+ };
- if (val & BIT(offs))
+ if (mt76_rr(dev, MT_PLE_AC_QEMPTY(ac, cr)) &
+ BIT(wlan_idx % 32))
continue;
- mt76_wr(dev, MT_FL_Q0_CTRL, ctrl | msta->wcid.idx);
- qlen = mt76_get_field(dev, MT_FL_Q3_CTRL,
- GENMASK(11, 0));
- seq_printf(s, "\tSTA %pM wcid %d: AC%d%d queued:%d\n",
- sta->addr, msta->wcid.idx,
- msta->vif->mt76.wmm_idx, ac, qlen);
+ seq_printf(s, "\tSTA %pM wcid %u AC%u%u: ", sta->addr,
+ wlan_idx, msta->vif->mt76.wmm_idx, ac);
+ mt7996_fl_queue_show(s, dev, false, &q, wlan_idx);
+ seq_puts(s, "\n");
}
}
static int
-mt7996_hw_queues_show(struct seq_file *file, void *data)
+mt7996_hw_queues_show(struct seq_file *s, void *data)
{
- struct mt7996_phy *phy = file->private;
+ struct mt7996_phy *phy = s->private;
struct mt7996_dev *dev = phy->dev;
- static const struct hw_queue_map ple_queue_map[] = {
- { "CPU_Q0", 0, 1, MT_CTX0 },
- { "CPU_Q1", 1, 1, MT_CTX0 + 1 },
- { "CPU_Q2", 2, 1, MT_CTX0 + 2 },
- { "CPU_Q3", 3, 1, MT_CTX0 + 3 },
- { "ALTX_Q0", 8, 2, MT_LMAC_ALTX0 },
- { "BMC_Q0", 9, 2, MT_LMAC_BMC0 },
- { "BCN_Q0", 10, 2, MT_LMAC_BCN0 },
- { "PSMP_Q0", 11, 2, MT_LMAC_PSMP0 },
- { "ALTX_Q1", 12, 2, MT_LMAC_ALTX0 + 4 },
- { "BMC_Q1", 13, 2, MT_LMAC_BMC0 + 4 },
- { "BCN_Q1", 14, 2, MT_LMAC_BCN0 + 4 },
- { "PSMP_Q1", 15, 2, MT_LMAC_PSMP0 + 4 },
- };
- static const struct hw_queue_map pse_queue_map[] = {
- { "CPU Q0", 0, 1, MT_CTX0 },
- { "CPU Q1", 1, 1, MT_CTX0 + 1 },
- { "CPU Q2", 2, 1, MT_CTX0 + 2 },
- { "CPU Q3", 3, 1, MT_CTX0 + 3 },
- { "HIF_Q0", 8, 0, MT_HIF0 },
- { "HIF_Q1", 9, 0, MT_HIF0 + 1 },
- { "HIF_Q2", 10, 0, MT_HIF0 + 2 },
- { "HIF_Q3", 11, 0, MT_HIF0 + 3 },
- { "HIF_Q4", 12, 0, MT_HIF0 + 4 },
- { "HIF_Q5", 13, 0, MT_HIF0 + 5 },
- { "LMAC_Q", 16, 2, 0 },
- { "MDP_TXQ", 17, 2, 1 },
- { "MDP_RXQ", 18, 2, 2 },
- { "SEC_TXQ", 19, 2, 3 },
- { "SEC_RXQ", 20, 2, 4 },
- };
- u32 val, head, tail;
-
- /* ple queue */
- val = mt76_rr(dev, MT_PLE_FREEPG_CNT);
- head = mt76_get_field(dev, MT_PLE_FREEPG_HEAD_TAIL, GENMASK(11, 0));
- tail = mt76_get_field(dev, MT_PLE_FREEPG_HEAD_TAIL, GENMASK(27, 16));
- seq_puts(file, "PLE page info:\n");
- seq_printf(file,
- "\tTotal free page: 0x%08x head: 0x%03x tail: 0x%03x\n",
- val, head, tail);
-
- val = mt76_rr(dev, MT_PLE_PG_HIF_GROUP);
- head = mt76_get_field(dev, MT_PLE_HIF_PG_INFO, GENMASK(11, 0));
- tail = mt76_get_field(dev, MT_PLE_HIF_PG_INFO, GENMASK(27, 16));
- seq_printf(file, "\tHIF free page: 0x%03x res: 0x%03x used: 0x%03x\n",
- val, head, tail);
-
- seq_puts(file, "PLE non-empty queue info:\n");
- mt7996_hw_queue_read(file, ARRAY_SIZE(ple_queue_map),
- &ple_queue_map[0]);
-
- /* iterate per-sta ple queue */
+
+ seq_puts(s, "PLE page info:\n");
+ mt7996_freepg_show(s, mt76_rr(dev, MT_PLE_FREEPG_CNT),
+ mt76_rr(dev, MT_PLE_FREEPG_HEAD_TAIL));
+ mt7996_pg_group_show(s, "HIF", mt76_rr(dev, MT_PLE_PG_HIF_GROUP),
+ mt76_rr(dev, MT_PLE_HIF_PG_INFO));
+
+ seq_puts(s, "PLE non-empty queue info:\n");
+ mt7996_fl_queues_show(s, dev, false, mt7996_ple_queues,
+ mt76_rr(dev, MT_FL_Q_EMPTY));
ieee80211_iterate_stations_atomic(phy->mt76->hw,
- mt7996_sta_hw_queue_read, file);
- /* pse queue */
- seq_puts(file, "PSE non-empty queue info:\n");
- mt7996_hw_queue_read(file, ARRAY_SIZE(pse_queue_map),
- &pse_queue_map[0]);
+ mt7996_sta_hw_queue_read, s);
+
+ seq_puts(s, "PSE non-empty queue info:\n");
+ mt7996_fl_queues_show(s, dev, true, mt7996_pse_queues,
+ mt76_rr(dev, MT_PSE_QUEUE_EMPTY));
+ mt7996_fl_queues_show(s, dev, true, mt7996_pse_queues_1,
+ mt76_rr(dev, MT_PSE_QUEUE_EMPTY_1));
return 0;
}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/regs.h b/drivers/net/wireless/mediatek/mt76/mt7996/regs.h
index 5e0342dce630c..88dcb83ceb11e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/regs.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/regs.h
@@ -121,6 +121,15 @@ enum offs_rev {
#define MT_FL_Q2_CTRL MT_PLE(0x3e8)
#define MT_FL_Q3_CTRL MT_PLE(0x3ec)
+#define MT_FL_Q0_CTRL_EXECUTE BIT(31)
+#define MT_FL_Q0_CTRL_QID GENMASK(30, 24)
+#define MT_FL_Q0_CTRL_TGID GENMASK(21, 20)
+#define MT_FL_Q0_CTRL_PID GENMASK(17, 16)
+#define MT_FL_Q0_CTRL_WLAN_IDX GENMASK(11, 0)
+#define MT_FL_Q2_CTRL_TAIL_FID GENMASK(28, 16)
+#define MT_FL_Q2_CTRL_HEAD_FID GENMASK(12, 0)
+#define MT_FL_Q3_CTRL_PKT_NUM GENMASK(12, 0)
+
#define MT_PLE_FREEPG_CNT MT_PLE(0x3a0)
#define MT_PLE_FREEPG_HEAD_TAIL MT_PLE(0x3a4)
#define MT_PLE_PG_HIF_GROUP MT_PLE(0x00c)
@@ -129,6 +138,25 @@ enum offs_rev {
#define MT_PLE_AC_QEMPTY(ac, n) MT_PLE(0x600 + 0x100 * (ac) + ((n) << 2))
#define MT_PLE_AMSDU_PACK_MSDU_CNT(n) MT_PLE(0x10e0 + ((n) << 2))
+#define MT_FREEPG_CNT_FFA GENMASK(28, 16)
+#define MT_FREEPG_CNT_FREE GENMASK(12, 0)
+#define MT_FREEPG_HEAD_TAIL_TAIL GENMASK(28, 16)
+#define MT_FREEPG_HEAD_TAIL_HEAD GENMASK(12, 0)
+#define MT_PG_GROUP_MAX_QUOTA GENMASK(28, 16)
+#define MT_PG_GROUP_MIN_QUOTA GENMASK(12, 0)
+#define MT_PG_INFO_SRC_CNT GENMASK(28, 16)
+#define MT_PG_INFO_RSV_CNT GENMASK(12, 0)
+
+/* PSE */
+#define MT_PSE_BASE 0x820c8000
+#define MT_PSE(ofs) (MT_PSE_BASE + (ofs))
+
+#define MT_PSE_QUEUE_EMPTY MT_PSE(0x0b0)
+#define MT_PSE_QUEUE_EMPTY_1 MT_PSE(0x0bc)
+#define MT_PSE_FL_Q0_CTRL MT_PSE(0x1b0)
+#define MT_PSE_FL_Q2_CTRL MT_PSE(0x1b8)
+#define MT_PSE_FL_Q3_CTRL MT_PSE(0x1bc)
+
/* WF MDP TOP */
#define MT_MDP_BASE 0x820cc000
#define MT_MDP(ofs) (MT_MDP_BASE + (ofs))
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 467/816] wifi: mt76: mt7921: fix of_node reference leaks in regd update
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (465 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 466/816] wifi: mt76: mt7996: fix the hw-queues debugfs queue requests Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 468/816] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class Greg Kroah-Hartman
` (353 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit 2f209a8dca88507bc094de370e582adefc55723e ]
mt7921_regd_channel_update() and __mt7921_mcu_set_clc() never
release the nodes returned by mt76_find_power_limits_node(),
of_get_child_by_name() and mt76_find_channel_node(). Each regulatory
domain change and each CLC update on a device with DT power limits
leaks these references.
Release every node after use. This relies on
mt76_find_power_limits_node() also returning a reference for the
fallback node, which it does since commit 3a62c9f7ec3d ("wifi: mt76:
Fix of_node reference leak in mt76_get_rate_power_limits()").
Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed")
Link: https://patch.msgid.link/20261007112419.1277594-3-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: Moved the mt7921_regd_channel_update() hunks from regd.c (absent here) into init.c, and omitted the 5GHz !sband goto hunk because init.c has no such check. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/mediatek/mt76/mt7921/init.c | 26 ++++++++++++++++---
.../net/wireless/mediatek/mt76/mt7921/mcu.c | 7 ++++-
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index 276dfb9c26e0d..016ad2c284166 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -60,6 +60,21 @@ static int mt7921_thermal_init(struct mt792x_phy *phy)
return PTR_ERR_OR_ZERO(hwmon);
}
+static bool
+mt7921_regd_dt_has_channel(struct device_node *band_np,
+ struct ieee80211_channel *ch)
+{
+ struct device_node *chan_np;
+
+ if (!band_np)
+ return false;
+
+ chan_np = mt76_find_channel_node(band_np, ch);
+ of_node_put(chan_np);
+
+ return !!chan_np;
+}
+
static void
mt7921_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
{
@@ -79,7 +94,7 @@ mt7921_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
ch = &sband->channels[i];
cfreq = ch->center_freq;
- if (np && (!band_np || !mt76_find_channel_node(band_np, ch))) {
+ if (np && !mt7921_regd_dt_has_channel(band_np, ch)) {
ch->flags |= IEEE80211_CHAN_DISABLED;
continue;
}
@@ -88,17 +103,18 @@ mt7921_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
if (IS_UNII_INVALID(0, 5845, 5925))
ch->flags |= IEEE80211_CHAN_DISABLED;
}
+ of_node_put(band_np);
sband = wiphy->bands[NL80211_BAND_6GHZ];
if (!sband)
- return;
+ goto out;
band_np = np ? of_get_child_by_name(np, "txpower-6g") : NULL;
for (i = 0; i < sband->n_channels; i++) {
ch = &sband->channels[i];
cfreq = ch->center_freq;
- if (np && (!band_np || !mt76_find_channel_node(band_np, ch))) {
+ if (np && !mt7921_regd_dt_has_channel(band_np, ch)) {
ch->flags |= IEEE80211_CHAN_DISABLED;
continue;
}
@@ -110,6 +126,10 @@ mt7921_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
IS_UNII_INVALID(4, 6875, 7125))
ch->flags |= IEEE80211_CHAN_DISABLED;
}
+ of_node_put(band_np);
+
+out:
+ of_node_put(np);
}
void mt7921_regd_update(struct mt792x_dev *dev)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index e533f1a3e0cba..0e547a5d020c1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -3,6 +3,7 @@
#include <linux/fs.h>
#include <linux/firmware.h>
+#include <linux/of.h>
#include "mt7921.h"
#include "mcu.h"
#include "../mt76_connac2_mac.h"
@@ -1352,6 +1353,7 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
.acpi_conf = mt792x_acpi_get_flags(&dev->phy),
.mtcl_conf = mt792x_acpi_get_mtcl_conf(&dev->phy, alpha2),
};
+ struct device_node *np;
int ret, valid_cnt = 0;
u32 buf_len = 0;
u8 *pos;
@@ -1361,8 +1363,11 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
if (dev->phy.chip_cap & MT792x_CHIP_CAP_CLC_EVT_EN)
req.cap |= CLC_CAP_EVT_EN;
- if (mt76_find_power_limits_node(&dev->mt76))
+
+ np = mt76_find_power_limits_node(&dev->mt76);
+ if (np)
req.cap |= CLC_CAP_DTS_EN;
+ of_node_put(np);
buf_len = le32_to_cpu(clc->len) - sizeof(*clc);
pos = clc->data;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 468/816] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (466 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 467/816] wifi: mt76: mt7921: fix of_node reference leaks in regd update Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 469/816] fs/ntfs3: check return values in indx_delete_entry() Greg Kroah-Hartman
` (352 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Tvrtko Ursulin,
Dan Wheeler, Roman Li, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 6c4f8c5cc00326f6c709bff0d640d504c90862ca ]
Don't create an amdgpu_dm_atomic_state_template event since this is just
a template. Declare the template as an event class that will be used by
actual event tracers.
Fixes: e8a982355f96 ("drm/amd/display: Add tracepoint for amdgpu_dm")
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ sashal: Replaced struct drm_atomic_commit with the older struct drm_atomic_state in the TP_PROTO and the state field of the event class, because the type has not been renamed in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../amd/display/amdgpu_dm/amdgpu_dm_trace.h | 56 +++++++++----------
1 file changed, 26 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 113b04678dd37..2f97613a647fb 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -310,36 +310,32 @@ DEFINE_EVENT(amdgpu_dm_plane_state_template, amdgpu_dm_atomic_update_cursor,
TP_PROTO(const struct drm_plane_state *state),
TP_ARGS(state));
-TRACE_EVENT(amdgpu_dm_atomic_state_template,
- TP_PROTO(const struct drm_atomic_state *state),
- TP_ARGS(state),
-
- TP_STRUCT__entry(
- __field(const struct drm_atomic_state *, state)
- __field(bool, allow_modeset)
- __field(bool, legacy_cursor_update)
- __field(bool, async_update)
- __field(bool, duplicated)
- __field(int, num_connector)
- __field(int, num_private_objs)
- ),
-
- TP_fast_assign(
- __entry->state = state;
- __entry->allow_modeset = state->allow_modeset;
- __entry->legacy_cursor_update = state->legacy_cursor_update;
- __entry->async_update = state->async_update;
- __entry->duplicated = state->duplicated;
- __entry->num_connector = state->num_connector;
- __entry->num_private_objs = state->num_private_objs;
- ),
-
- TP_printk("state=%p allow_modeset=%d legacy_cursor_update=%d "
- "async_update=%d duplicated=%d num_connector=%d "
- "num_private_objs=%d",
- __entry->state, __entry->allow_modeset, __entry->legacy_cursor_update,
- __entry->async_update, __entry->duplicated, __entry->num_connector,
- __entry->num_private_objs)
+DECLARE_EVENT_CLASS(amdgpu_dm_atomic_state_template,
+ TP_PROTO(const struct drm_atomic_state *state),
+ TP_ARGS(state),
+ TP_STRUCT__entry(__field(const struct drm_atomic_state *, state)
+ __field(bool, allow_modeset)
+ __field(bool, legacy_cursor_update)
+ __field(bool, async_update)
+ __field(bool, duplicated)
+ __field(int, num_connector)
+ __field(int, num_private_objs)
+ ),
+ TP_fast_assign(__entry->state = state;
+ __entry->allow_modeset = state->allow_modeset;
+ __entry->legacy_cursor_update = state->legacy_cursor_update;
+ __entry->async_update = state->async_update;
+ __entry->duplicated = state->duplicated;
+ __entry->num_connector = state->num_connector;
+ __entry->num_private_objs = state->num_private_objs;
+ ),
+ TP_printk("state=%p allow_modeset=%d legacy_cursor_update=%d "
+ "async_update=%d duplicated=%d num_connector=%d "
+ "num_private_objs=%d",
+ __entry->state, __entry->allow_modeset,
+ __entry->legacy_cursor_update, __entry->async_update,
+ __entry->duplicated, __entry->num_connector,
+ __entry->num_private_objs)
);
DEFINE_EVENT(amdgpu_dm_atomic_state_template, amdgpu_dm_atomic_commit_tail_begin,
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 469/816] fs/ntfs3: check return values in indx_delete_entry()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (467 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 468/816] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 470/816] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path Greg Kroah-Hartman
` (351 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Morgun, Konstantin Komarov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Morgun <d.morgun@ispras.ru>
[ Upstream commit 131f7d7abf0f10edc6ea6b032f8a3908bdb13ce8 ]
When the index tree collapses down to an empty root,
indx_delete_entry() calls attr_set_size() and ni_remove_attr() for
both ATTR_ALLOC and ATTR_BITMAP, but their return values are
overwritten by the following call without being checked.
In most other call sites of these functions the return value is
checked, so add the same checks here in case an error at this point
is meaningful.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Dmitry Morgun <d.morgun@ispras.ru>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
[ sashal: adjusted the two attr_set_size() calls to pass an extra trailing NULL argument to match the older function signature. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/index.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index 97cbe176a83e5..88a5f336d9040 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -2691,18 +2691,28 @@ int indx_delete_entry(struct ntfs_index *indx, struct ntfs_inode *ni,
err = attr_set_size(ni, ATTR_ALLOC, in->name, in->name_len,
&indx->alloc_run, 0, NULL, false, NULL);
+ if (err)
+ goto out;
+
if (in->name == I30_NAME)
i_size_write(&ni->vfs_inode, 0);
err = ni_remove_attr(ni, ATTR_ALLOC, in->name, in->name_len,
false, NULL);
run_close(&indx->alloc_run);
+ if (err)
+ goto out;
err = attr_set_size(ni, ATTR_BITMAP, in->name, in->name_len,
&indx->bitmap_run, 0, NULL, false, NULL);
+ if (err)
+ goto out;
+
err = ni_remove_attr(ni, ATTR_BITMAP, in->name, in->name_len,
false, NULL);
run_close(&indx->bitmap_run);
+ if (err)
+ goto out;
root = indx_get_root(indx, ni, &attr, &mi);
if (!root) {
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 470/816] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (468 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 469/816] fs/ntfs3: check return values in indx_delete_entry() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 471/816] ALSA: pcmtest: Fix leak at probe error Greg Kroah-Hartman
` (350 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit 237782c3d416b392a12642f32959e9d3c94e0c26 ]
tx_coal_frames[] is written by ethtool (stmmac_set_coalesce) and read
locklessly from the TX fast path (stmmac_xmit, stmmac_tso_xmit,
stmmac_xdp_xmit_zc and stmmac_xdp_xmit_xdpf), so pair every access
with READ_ONCE()/WRITE_ONCE() to mark the intentional data race and
read a consistent value into a local variable.
Moreover, ethtool allows disabling TX coalescing by setting
tx_max_coalesced_frames to 0: guard the modulo operation in
stmmac_xdp_xmit_xdpf() against a zero tx_coal_frames[queue] to avoid
a division by zero.
Both issues were found by code inspection while extending the XDP TX
path with multi-buff support, and neither has ever been triggered, so
they are only theoretical. Tested on the Qualcomm RB3-gen2 board.
Fixes: db2f2842e6f5 ("net: stmmac: add per-queue TX & RX coalesce ethtool support")
Fixes: be8b38a722e6 ("net: stmmac: Add support for XDP_TX action")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261001-b4-stmmac-xmit-mb-v4-1-664e0c3eb289@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Dropped the unused sdu_len declaration and kept local declaration blocks as they were, adding only tx_coal, because the surrounding functions differ from upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/stmicro/stmmac/stmmac_ethtool.c | 11 ++---
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 41 ++++++++-----------
2 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 5d94de4670557..4569b950e96b2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -979,7 +979,8 @@ static int __stmmac_get_coalesce(struct net_device *dev,
if (queue < tx_cnt) {
ec->tx_coalesce_usecs = priv->tx_coal_timer[queue];
- ec->tx_max_coalesced_frames = priv->tx_coal_frames[queue];
+ ec->tx_max_coalesced_frames =
+ READ_ONCE(priv->tx_coal_frames[queue]);
} else {
ec->tx_coalesce_usecs = 0;
ec->tx_max_coalesced_frames = 0;
@@ -1068,14 +1069,14 @@ static int __stmmac_set_coalesce(struct net_device *dev,
int i;
for (i = 0; i < tx_cnt; i++) {
- priv->tx_coal_frames[i] =
- ec->tx_max_coalesced_frames;
+ WRITE_ONCE(priv->tx_coal_frames[i],
+ ec->tx_max_coalesced_frames);
priv->tx_coal_timer[i] =
ec->tx_coalesce_usecs;
}
} else if (queue < tx_cnt) {
- priv->tx_coal_frames[queue] =
- ec->tx_max_coalesced_frames;
+ WRITE_ONCE(priv->tx_coal_frames[queue],
+ ec->tx_max_coalesced_frames);
priv->tx_coal_timer[queue] =
ec->tx_coalesce_usecs;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e17a203290552..81e97ab3178b4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2504,7 +2504,8 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
struct stmmac_metadata_request meta_req;
struct xsk_tx_metadata *meta = NULL;
dma_addr_t dma_addr;
- bool set_ic;
+ bool set_ic = false;
+ u32 tx_coal;
/* We are sharing with slow path and stop XSK TX desc submission when
* available TX ring is less than threshold.
@@ -2555,12 +2556,9 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
tx_q->tx_count_frames++;
- if (!priv->tx_coal_frames[queue])
- set_ic = false;
- else if (tx_q->tx_count_frames % priv->tx_coal_frames[queue] == 0)
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
+ if (tx_coal && !(tx_q->tx_count_frames % tx_coal))
set_ic = true;
- else
- set_ic = false;
meta_req.priv = priv;
meta_req.tx_desc = tx_desc;
@@ -3161,7 +3159,7 @@ static void stmmac_init_coalesce(struct stmmac_priv *priv)
for (chan = 0; chan < tx_channel_count; chan++) {
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[chan];
- priv->tx_coal_frames[chan] = STMMAC_TX_FRAMES;
+ WRITE_ONCE(priv->tx_coal_frames[chan], STMMAC_TX_FRAMES);
priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
hrtimer_init(&tx_q->txtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -4259,9 +4257,9 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
struct stmmac_priv *priv = netdev_priv(dev);
unsigned int first_entry, entry, tx_packets;
struct stmmac_txq_stats *txq_stats;
+ u32 tx_coal, pay_len, mss, queue;
int i, first_tx, nfrags, ndesc;
struct stmmac_tx_queue *tx_q;
- u32 pay_len, mss, queue;
u8 proto_hdr_len, hdr;
dma_addr_t des;
bool set_ic;
@@ -4399,16 +4397,16 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
tx_packets = (tx_q->cur_tx + 1) - first_tx;
tx_q->tx_count_frames += tx_packets;
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
if ((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)
set_ic = true;
- else if (!priv->tx_coal_frames[queue])
+ else if (!tx_coal)
set_ic = false;
else if (!netdev_xmit_more())
set_ic = true;
- else if (tx_packets > priv->tx_coal_frames[queue])
+ else if (tx_packets > tx_coal)
set_ic = true;
- else if ((tx_q->tx_count_frames %
- priv->tx_coal_frames[queue]) < tx_packets)
+ else if ((tx_q->tx_count_frames % tx_coal) < tx_packets)
set_ic = true;
else
set_ic = false;
@@ -4552,6 +4550,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
struct dma_desc *desc, *first;
struct stmmac_tx_queue *tx_q;
bool has_vlan, set_ic;
+ u32 tx_coal;
int entry, first_tx;
dma_addr_t des;
@@ -4681,16 +4680,16 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
tx_packets = (entry + 1) - first_tx;
tx_q->tx_count_frames += tx_packets;
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
if ((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)
set_ic = true;
- else if (!priv->tx_coal_frames[queue])
+ else if (!tx_coal)
set_ic = false;
else if (!netdev_xmit_more())
set_ic = true;
- else if (tx_packets > priv->tx_coal_frames[queue])
+ else if (tx_packets > tx_coal)
set_ic = true;
- else if ((tx_q->tx_count_frames %
- priv->tx_coal_frames[queue]) < tx_packets)
+ else if ((tx_q->tx_count_frames % tx_coal) < tx_packets)
set_ic = true;
else
set_ic = false;
@@ -4977,7 +4976,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
unsigned int entry = tx_q->cur_tx;
struct dma_desc *tx_desc;
dma_addr_t dma_addr;
- bool set_ic;
+ u32 tx_coal;
if (stmmac_tx_avail(priv, queue) < STMMAC_TX_THRESH(priv))
return STMMAC_XDP_CONSUMED;
@@ -5030,12 +5029,8 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
tx_q->tx_count_frames++;
- if (tx_q->tx_count_frames % priv->tx_coal_frames[queue] == 0)
- set_ic = true;
- else
- set_ic = false;
-
- if (set_ic) {
+ tx_coal = READ_ONCE(priv->tx_coal_frames[queue]);
+ if (tx_coal && !(tx_q->tx_count_frames % tx_coal)) {
tx_q->tx_count_frames = 0;
stmmac_set_tx_ic(priv, tx_desc);
u64_stats_update_begin(&txq_stats->q_syncp);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 471/816] ALSA: pcmtest: Fix leak at probe error
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (469 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 470/816] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 472/816] ALSA: aloop: Avoid a bad mixure of guard() and goto Greg Kroah-Hartman
` (349 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit d0f2ca62e89f3c666d0ec203eaa23b8d965e5443 ]
When an error happens at probe of pcmtest driver before
snd_card_register() succeeds, we have to release the card explicitly,
but it's not done, leading to a potential memory leak.
Also, pcmtest driver manages struct pcmtst object unnecessarily
complicatedly by a dynamic allocation and release.
This patch fixes and cleans up the resource management:
- Use card's private_data allocation for struct sndpcmtst at the card
creation, which is released automatically together with the card
- Since the allocation of pcmtest is gone, snd_pcmtst_create() is
rather pointless, so just directly calling snd_pcmtst_new_pcm()
- Use the new auto-clean mechanism to handle the error case at probe.
- Many release handlers became superfluous and dropped
In the end we got a good amount of code reduction.
Fixes: 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172533.14667-3-tiwai@suse.de
[ sashal: Adjusted context in two hunks (kzalloc vs kzalloc_obj, .remove_new vs .remove), both on lines the patch deletes, so the final code matches upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/drivers/pcmtest.c | 66 +++++++----------------------------------
1 file changed, 10 insertions(+), 56 deletions(-)
diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c
index 0376fe17365a8..0e325ae96371f 100644
--- a/sound/drivers/pcmtest.c
+++ b/sound/drivers/pcmtest.c
@@ -464,20 +464,6 @@ static snd_pcm_uframes_t snd_pcmtst_pcm_pointer(struct snd_pcm_substream *substr
return bytes_to_frames(substream->runtime, v_iter->buf_pos);
}
-static int snd_pcmtst_free(struct pcmtst *pcmtst)
-{
- if (!pcmtst)
- return 0;
- kfree(pcmtst);
- return 0;
-}
-
-// These callbacks are required, but empty - all freeing occurs in pdev_remove
-static int snd_pcmtst_dev_free(struct snd_device *device)
-{
- return 0;
-}
-
static void pcmtst_pdev_release(struct device *dev)
{
}
@@ -581,40 +567,9 @@ static int snd_pcmtst_new_pcm(struct pcmtst *pcmtst)
return err;
}
-static int snd_pcmtst_create(struct snd_card *card, struct platform_device *pdev,
- struct pcmtst **r_pcmtst)
-{
- struct pcmtst *pcmtst;
- int err;
- static const struct snd_device_ops ops = {
- .dev_free = snd_pcmtst_dev_free,
- };
-
- pcmtst = kzalloc(sizeof(*pcmtst), GFP_KERNEL);
- if (!pcmtst)
- return -ENOMEM;
- pcmtst->card = card;
- pcmtst->pdev = pdev;
-
- err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, pcmtst, &ops);
- if (err < 0)
- goto _err_free_chip;
-
- err = snd_pcmtst_new_pcm(pcmtst);
- if (err < 0)
- goto _err_free_chip;
-
- *r_pcmtst = pcmtst;
- return 0;
-
-_err_free_chip:
- snd_pcmtst_free(pcmtst);
- return err;
-}
-
static int pcmtst_probe(struct platform_device *pdev)
{
- struct snd_card *card;
+ struct snd_card *card __free(snd_card_free) = NULL;
struct pcmtst *pcmtst;
int err;
@@ -622,10 +577,16 @@ static int pcmtst_probe(struct platform_device *pdev)
if (err)
return err;
- err = snd_devm_card_new(&pdev->dev, index, id, THIS_MODULE, 0, &card);
+ err = snd_devm_card_new(&pdev->dev, index, id, THIS_MODULE,
+ sizeof(*pcmtst), &card);
if (err < 0)
return err;
- err = snd_pcmtst_create(card, pdev, &pcmtst);
+
+ pcmtst = card->private_data;
+ pcmtst->card = card;
+ pcmtst->pdev = pdev;
+
+ err = snd_pcmtst_new_pcm(pcmtst);
if (err < 0)
return err;
@@ -638,17 +599,11 @@ static int pcmtst_probe(struct platform_device *pdev)
return err;
platform_set_drvdata(pdev, pcmtst);
+ card = NULL; /* probe succeeded, don't release as error */
return 0;
}
-static void pdev_remove(struct platform_device *pdev)
-{
- struct pcmtst *pcmtst = platform_get_drvdata(pdev);
-
- snd_pcmtst_free(pcmtst);
-}
-
static struct platform_device pcmtst_pdev = {
.name = "pcmtest",
.dev.release = pcmtst_pdev_release,
@@ -656,7 +611,6 @@ static struct platform_device pcmtst_pdev = {
static struct platform_driver pcmtst_pdrv = {
.probe = pcmtst_probe,
- .remove_new = pdev_remove,
.driver = {
.name = "pcmtest",
},
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 472/816] ALSA: aloop: Avoid a bad mixure of guard() and goto
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (470 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 471/816] ALSA: pcmtest: Fix leak at probe error Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 473/816] ALSA: hda: Use linked list for jack table Greg Kroah-Hartman
` (348 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit f7faf5d9b5668919cae84a6247f8f7b4e2c0227c ]
The rewrite of aloop driver code using guard() leaded to a mixture of
guard() and some goto; although it currently works, it isn't really a
good match.
For avoiding the bad match, just move the code using goto into a
function and wrap it with guard().
Fixes: ebd9b6c91d4e ("ALSA: aloop: Use guard() for mutex locks")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172533.14667-6-tiwai@suse.de
[ sashal: Kept the local kzalloc(sizeof(*dpcm), GFP_KERNEL) call in place of upstream's kzalloc_obj(*dpcm) so the hunk applies; the rest matches upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/drivers/aloop.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index d7857659a7313..fa8d2877516d9 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -1273,7 +1273,7 @@ static const struct loopback_ops loopback_snd_timer_ops = {
.dpcm_info = loopback_snd_timer_dpcm_info,
};
-static int loopback_open(struct snd_pcm_substream *substream)
+static int __loopback_open(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct loopback *loopback = substream->private_data;
@@ -1282,7 +1282,6 @@ static int loopback_open(struct snd_pcm_substream *substream)
int err = 0;
int dev = get_cable_index(substream);
- guard(mutex)(&loopback->cable_lock);
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
if (!dpcm)
return -ENOMEM;
@@ -1373,6 +1372,14 @@ static int loopback_open(struct snd_pcm_substream *substream)
return err;
}
+static int loopback_open(struct snd_pcm_substream *substream)
+{
+ struct loopback *loopback = substream->private_data;
+
+ guard(mutex)(&loopback->cable_lock);
+ return __loopback_open(substream);
+}
+
static int loopback_close(struct snd_pcm_substream *substream)
{
struct loopback *loopback = substream->private_data;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 473/816] ALSA: hda: Use linked list for jack table
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (471 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 472/816] ALSA: aloop: Avoid a bad mixure of guard() and goto Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 474/816] wifi: nl80211: reject zero RNR/MBSSID elements Greg Kroah-Hartman
` (347 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 5676e013f16ac4b616d433af24647d0ce4b067aa ]
So far we've used snd_array infrastructure for managing the
hda_jack_tbl elements, but it turned out that this may lead to a UAF
when a different order of destruction procedure is applied; namely,
each hda_jack_tbl object creates a snd_jack object and sets the
private_data pointing to the hda_jack_tbl, and private_free to release
it. It looks harmless, but since snd_array may reallocate the whole
table at growing, the formerly referred jack pointer may become stale.
Fortunately, currently there is no call pattern that triggers this
issue, so it's only hypothetical, but we should address it in anyway.
There are several ways to address this, and at this time, we rather
redesign the hda_jack_tbl allocations: instead of snd_array(), do a
normal kmalloc() + linked list. There will be more kmalloc calls than
the original code, but as the number of jacks are usually at most
handful, it must not be a problem. This change allows us the
persistent jack pointer, so no stale pointer access can happen any
longer.
This also fixes another reported issue about the stale jack pointer
reference in snd_hda_jack_tbl_new(), too.
Fixes: 31ef22579302 ("ALSA: hda - Integrate input-jack stuff into kctl-jack")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007171057.7462-1-tiwai@suse.de
[ sashal: Dropped the struct hda_codec_ops; context line from the forward-declaration hunk in hda_codec.h, since this tree lacks it, and kept only the added struct hda_jack_tbl;. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/sound/hda_codec.h | 6 ++-
sound/pci/hda/hda_codec.c | 1 -
sound/pci/hda/hda_jack.c | 79 ++++++++++++++++++---------------
sound/pci/hda/hda_jack.h | 1 +
sound/soc/sof/intel/hda-codec.c | 4 +-
5 files changed, 51 insertions(+), 40 deletions(-)
diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
index 908258fb23eaf..ceeaafb146d84 100644
--- a/include/sound/hda_codec.h
+++ b/include/sound/hda_codec.h
@@ -27,6 +27,7 @@ struct hda_beep;
struct hda_codec;
struct hda_pcm;
struct hda_pcm_stream;
+struct hda_jack_tbl;
/*
* codec bus
@@ -271,7 +272,8 @@ struct hda_codec {
struct hda_codec *codec, hda_nid_t nid);
/* jack detection */
- struct snd_array jacktbl;
+ struct hda_jack_tbl *jacktbl, *jacktbl_last; /* linked list head/tail */
+ int jacktbl_used; /* number of jacktbl elements */
unsigned long jackpoll_interval; /* In jiffies. Zero means no poll, rely on unsol events */
struct delayed_work jackpoll_work;
@@ -496,7 +498,7 @@ void snd_hda_update_power_acct(struct hda_codec *codec);
static inline bool hda_codec_need_resume(struct hda_codec *codec)
{
- return !codec->relaxed_resume && codec->jacktbl.used;
+ return !codec->relaxed_resume && codec->jacktbl_used;
}
/*
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 791f3a3e8e258..670db66ef4e51 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -940,7 +940,6 @@ snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_addr,
snd_array_init(&codec->driver_pins, sizeof(struct hda_pincfg), 16);
snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8);
snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16);
- snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16);
snd_array_init(&codec->verbs, sizeof(struct hda_verb *), 8);
INIT_LIST_HEAD(&codec->conn_list);
INIT_LIST_HEAD(&codec->pcm_list_head);
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 8c25c7d81128b..1cda9175fd7bf 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -70,12 +70,11 @@ static u32 read_pin_sense(struct hda_codec *codec, hda_nid_t nid, int dev_id)
struct hda_jack_tbl *
snd_hda_jack_tbl_get_mst(struct hda_codec *codec, hda_nid_t nid, int dev_id)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- if (!nid || !jack)
+ if (!nid)
return NULL;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid == nid && jack->dev_id == dev_id)
return jack;
return NULL;
@@ -92,12 +91,11 @@ struct hda_jack_tbl *
snd_hda_jack_tbl_get_from_tag(struct hda_codec *codec,
unsigned char tag, int dev_id)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- if (!tag || !jack)
+ if (!tag)
return NULL;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->tag == tag && jack->dev_id == dev_id)
return jack;
return NULL;
@@ -107,12 +105,11 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_tbl_get_from_tag);
static struct hda_jack_tbl *
any_jack_tbl_get_from_nid(struct hda_codec *codec, hda_nid_t nid)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- if (!nid || !jack)
+ if (!nid)
return NULL;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid == nid)
return jack;
return NULL;
@@ -136,12 +133,19 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
if (jack)
return jack;
- jack = snd_array_new(&codec->jacktbl);
+ jack = kzalloc_obj(*jack);
if (!jack)
return NULL;
jack->nid = nid;
jack->dev_id = dev_id;
jack->jack_dirty = 1;
+ if (!codec->jacktbl)
+ codec->jacktbl = jack;
+ else
+ codec->jacktbl_last->next = jack;
+ codec->jacktbl_last = jack;
+ codec->jacktbl_used++;
+
if (existing_nid_jack) {
jack->tag = existing_nid_jack->tag;
@@ -152,7 +156,7 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
*/
jack->jack_detect = existing_nid_jack->jack_detect;
} else {
- jack->tag = codec->jacktbl.used;
+ jack->tag = codec->jacktbl_used;
}
return jack;
@@ -160,10 +164,9 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
void snd_hda_jack_tbl_disconnect(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- for (i = 0; i < codec->jacktbl.used; i++, jack++) {
+ for (jack = codec->jacktbl; jack; jack = jack->next) {
if (!codec->bus->shutdown && jack->jack)
snd_device_disconnect(codec->card, jack->jack);
}
@@ -171,22 +174,31 @@ void snd_hda_jack_tbl_disconnect(struct hda_codec *codec)
void snd_hda_jack_tbl_clear(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack, *jack_next;
- for (i = 0; i < codec->jacktbl.used; i++, jack++) {
+ for (jack = codec->jacktbl; jack; jack = jack_next) {
struct hda_jack_callback *cb, *next;
- /* free jack instances manually when clearing/reconfiguring */
- if (!codec->bus->shutdown && jack->jack)
- snd_device_free(codec->card, jack->jack);
+ jack_next = jack->next;
+
+ if (jack->jack) {
+ /* fingers away from stale data */
+ jack->jack->private_data = NULL;
+ jack->jack->private_free = NULL;
+ /* free jack instances manually when clearing/reconfiguring */
+ if (!codec->bus->shutdown)
+ snd_device_free(codec->card, jack->jack);
+ }
for (cb = jack->callback; cb; cb = next) {
next = cb->next;
kfree(cb);
}
+ kfree(jack);
}
- snd_array_free(&codec->jacktbl);
+
+ codec->jacktbl = codec->jacktbl_last = NULL;
+ codec->jacktbl_used = 0;
}
#define get_jack_plug_state(sense) !!(sense & AC_PINSENSE_PRESENCE)
@@ -232,10 +244,9 @@ static void jack_detect_update(struct hda_codec *codec,
*/
void snd_hda_jack_set_dirty_all(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i;
+ struct hda_jack_tbl *jack;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid)
jack->jack_dirty = 1;
}
@@ -472,19 +483,17 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_set_button_state);
void snd_hda_jack_report_sync(struct hda_codec *codec)
{
struct hda_jack_tbl *jack;
- int i, state;
+ int state;
/* update all jacks at first */
- jack = codec->jacktbl.list;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid)
jack_detect_update(codec, jack);
/* report the updated jacks; it's done after updating all jacks
* to make sure that all gating jacks properly have been set
*/
- jack = codec->jacktbl.list;
- for (i = 0; i < codec->jacktbl.used; i++, jack++)
+ for (jack = codec->jacktbl; jack; jack = jack->next)
if (jack->nid) {
if (!jack->jack || jack->block_report)
continue;
@@ -752,10 +761,10 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_unsol_event);
*/
void snd_hda_jack_poll_all(struct hda_codec *codec)
{
- struct hda_jack_tbl *jack = codec->jacktbl.list;
- int i, changes = 0;
+ struct hda_jack_tbl *jack;
+ int changes = 0;
- for (i = 0; i < codec->jacktbl.used; i++, jack++) {
+ for (jack = codec->jacktbl; jack; jack = jack->next) {
unsigned int old_sense;
if (!jack->nid || !jack->jack_dirty || jack->phantom_jack)
continue;
diff --git a/sound/pci/hda/hda_jack.h b/sound/pci/hda/hda_jack.h
index ff7d289c034bf..26bfaae393568 100644
--- a/sound/pci/hda/hda_jack.h
+++ b/sound/pci/hda/hda_jack.h
@@ -44,6 +44,7 @@ struct hda_jack_tbl {
int type;
int button_state;
struct snd_jack *jack;
+ struct hda_jack_tbl *next;
};
struct hda_jack_keymap {
diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 57998d3d8d15b..57c3a4df5627a 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -87,7 +87,7 @@ void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev, bool enable)
list_for_each_codec(codec, hbus) {
/* only set WAKEEN when needed for HDaudio codecs */
mask |= BIT(codec->core.addr);
- if (codec->jacktbl.used)
+ if (codec->jacktbl_used)
val |= BIT(codec->core.addr);
}
} else {
@@ -116,7 +116,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev)
* Wake up all jack-detecting codecs regardless whether an event
* has been recorded in STATESTS
*/
- if (codec->jacktbl.used)
+ if (codec->jacktbl_used)
pm_request_resume(&codec->core.dev);
}
EXPORT_SYMBOL_NS_GPL(hda_codec_jack_check, SND_SOC_SOF_HDA_AUDIO_CODEC);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 474/816] wifi: nl80211: reject zero RNR/MBSSID elements
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (472 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 473/816] ALSA: hda: Use linked list for jack table Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 475/816] dma-direct: Restore arch_dma_alloc() for the DMA_ATTR_NO_KERNEL_MAPPING case Greg Kroah-Hartman
` (346 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit c767e1173aeab7825a8dfb197041d3996db84e39 ]
That's a nonsensical configuration, and we get errors
reported further down in mac80211 for it; hostapd has
code that only adds the nested element if it'll not be
an empty list.
Remove an unnecessary NULL check while at it.
Fixes: dbbb27e183b1 ("cfg80211: support RNR for EMA AP")
Assisted-by: LLM
Link: https://patch.msgid.link/20261005224950.97db49d9d104.I5765a3310528b3d1cb1673dc90ad5ab5fc3ea571@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ sashal: Kept the existing kzalloc(struct_size(...), GFP_KERNEL) allocation instead of kzalloc_flex() in both parsers, and added the zero-element check above it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/wireless/nl80211.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0062ce34d4efb..4961c324a1714 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5581,6 +5581,9 @@ nl80211_parse_mbssid_elems(struct wiphy *wiphy, struct nlattr *attrs,
num_elems++;
}
+ if (!num_elems)
+ return ERR_PTR(-EINVAL);
+
elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL);
if (!elems)
return ERR_PTR(-ENOMEM);
@@ -5616,6 +5619,9 @@ nl80211_parse_rnr_elems(struct wiphy *wiphy, struct nlattr *attrs,
num_elems++;
}
+ if (!num_elems)
+ return ERR_PTR(-EINVAL);
+
elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL);
if (!elems)
return ERR_PTR(-ENOMEM);
@@ -5764,7 +5770,8 @@ static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev,
if (IS_ERR(rnr))
return PTR_ERR(rnr);
- if (rnr && rnr->cnt < bcn->mbssid_ies->cnt) {
+ /* RNR elements are only used with MBSSID elements */
+ if (rnr->cnt < bcn->mbssid_ies->cnt) {
kfree(rnr);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 475/816] dma-direct: Restore arch_dma_alloc() for the DMA_ATTR_NO_KERNEL_MAPPING case
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (473 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 474/816] wifi: nl80211: reject zero RNR/MBSSID elements Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 476/816] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure Greg Kroah-Hartman
` (345 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aneesh Kumar K.V, Marek Szyprowski,
Sasha Levin, Claude Opus 5.5
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <m.szyprowski@samsung.com>
[ Upstream commit 5e3bc6b44c8853bcc7782eac122c5baf2d02f399 ]
Commit 849facea92fa ("dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING
handling") moved the DMA_ATTR_NO_KERNEL_MAPPING shortcut in
dma_direct_alloc() in front of the arch_dma_alloc() call. Architectures
providing their own DMA coherent allocator (CONFIG_ARCH_HAS_DMA_ALLOC)
therefore no longer see such requests. ARM 32bit is one of such. Lack of
the call to arch_dma_alloc() results in the lack of proper cache
management on HighMem pages.
Take the dma-direct shortcut only for coherent devices or when the
architecture doesn't provide arch_dma_alloc(). While touching this,
move that check into separate function to avoid duplication in alloc
and free paths.
Fixes: 849facea92fa ("dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling")
Reported-by: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Closes: https://lore.kernel.org/all/yq5ams2akznl.fsf@kernel.org/
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://lore.kernel.org/r/20260930135734.1013905-1-m.szyprowski@samsung.com
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
[ sashal: Replaced the upstream __DMA_ATTR_ALLOC_CC_SHARED check with the existing force_dma_unencrypted(dev) test in the new dma_direct_use_no_mapping() helper, since that attribute doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/dma/direct.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index c8bba1b6f59c2..8abca2804435a 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -185,6 +185,21 @@ static struct page *dma_direct_alloc_from_pool(struct device *dev, size_t size,
return page;
}
+/*
+ * Check if the allocation can skip the kernel mapping and return the page
+ * pointer as the cookie.
+ */
+static bool dma_direct_use_no_mapping(struct device *dev, unsigned long attrs)
+{
+ if (!(attrs & DMA_ATTR_NO_KERNEL_MAPPING))
+ return false;
+ if (force_dma_unencrypted(dev) || is_swiotlb_for_alloc(dev))
+ return false;
+ if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_ALLOC) && !dev_is_dma_coherent(dev))
+ return false;
+ return true;
+}
+
static void *dma_direct_alloc_no_mapping(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t gfp)
{
@@ -214,8 +229,7 @@ void *dma_direct_alloc(struct device *dev, size_t size,
if (attrs & DMA_ATTR_NO_WARN)
gfp |= __GFP_NOWARN;
- if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) &&
- !force_dma_unencrypted(dev) && !is_swiotlb_for_alloc(dev))
+ if (dma_direct_use_no_mapping(dev, attrs))
return dma_direct_alloc_no_mapping(dev, size, dma_handle, gfp);
if (!dev_is_dma_coherent(dev)) {
@@ -318,8 +332,7 @@ void dma_direct_free(struct device *dev, size_t size,
{
unsigned int page_order = get_order(size);
- if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) &&
- !force_dma_unencrypted(dev) && !is_swiotlb_for_alloc(dev)) {
+ if (dma_direct_use_no_mapping(dev, attrs)) {
/* cpu_addr is a struct page cookie, not a kernel address */
dma_free_contiguous(dev, cpu_addr, size);
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 476/816] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (474 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 475/816] dma-direct: Restore arch_dma_alloc() for the DMA_ATTR_NO_KERNEL_MAPPING case Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 477/816] fs/resctrl: Ensure default group reports tasks on monitor-only systems Greg Kroah-Hartman
` (344 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Romanovsky, Bjorn Helgaas,
Tushar Dave, Logan Gunthorpe, Jason Gunthorpe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <leonro@nvidia.com>
[ Upstream commit 7c4d6505a1f8a1ebe8019b7f988ed494b696653b ]
pci_p2pdma_add_resource() installs pci_p2pdma_unmap_mappings() as a devres
action with the devres allocated p2p_pgmap as its data, and only then adds
the range to the pool:
error = devm_add_action_or_reset(&pdev->dev, pci_p2pdma_unmap_mappings,
p2p_pgmap);
if (error)
goto pages_free;
p2pdma = rcu_dereference_protected(pdev->p2pdma, 1);
error = gen_pool_add_owner(p2pdma->pool, ...);
if (error)
goto pages_free;
The action removes the allocate attribute for the whole device, which tears
down existing userspace mappings of every BAR already registered on it.
Both failures here get that wrong, in opposite ways.
devm_add_action_or_reset() runs the action when it cannot allocate its
devres node, so an -ENOMEM while registering a second BAR unmaps the first
one. Use devm_add_action() and let the error path unwind only what this
call created.
gen_pool_add_owner() allocates a chunk and can also fail with -ENOMEM.
There the action is registered, and the error path frees p2p_pgmap with
devm_kfree() while leaving the action pointing at it. On unbind devres
runs the action and pci_p2pdma_unmap_mappings() dereferences
p2p_pgmap->mem->owner->kobj, which is freed memory. Give that failure its
own label and drop the action with devm_remove_action(), which removes it
without running it.
Fixes: 7e9c7ef83d78 ("PCI/P2PDMA: Allow userspace VMA allocations through sysfs")
Fixes: f58ef9d1d135 ("PCI/P2PDMA: Separate the mmap() support from the core logic")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Tushar Dave <tdave@nvidia.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://patch.msgid.link/20260830-batch-p2p-fixes-v1-1-5044e8dfbe2e@nvidia.com
[ sashal: Passes pdev instead of p2p_pgmap as the devres action data in both devm_add_action() and devm_remove_action(), since the older unmap callback takes a struct pci_dev *. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/p2pdma.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 01c8b79a9e0d7..d438ff25d2de1 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -331,8 +331,8 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
goto pgmap_free;
}
- error = devm_add_action_or_reset(&pdev->dev, pci_p2pdma_unmap_mappings,
- pdev);
+ error = devm_add_action(&pdev->dev, pci_p2pdma_unmap_mappings,
+ pdev);
if (error)
goto pages_free;
@@ -342,13 +342,15 @@ int pci_p2pdma_add_resource(struct pci_dev *pdev, int bar, size_t size,
range_len(&pgmap->range), dev_to_node(&pdev->dev),
&pgmap->ref);
if (error)
- goto pages_free;
+ goto mappings_remove;
pci_info(pdev, "added peer-to-peer DMA memory %#llx-%#llx\n",
pgmap->range.start, pgmap->range.end);
return 0;
+mappings_remove:
+ devm_remove_action(&pdev->dev, pci_p2pdma_unmap_mappings, pdev);
pages_free:
devm_memunmap_pages(&pdev->dev, pgmap);
pgmap_free:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 477/816] fs/resctrl: Ensure default group reports tasks on monitor-only systems
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (475 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 476/816] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 478/816] bpf, arm64: Fix racy plt target update in bpf_arch_text_poke() Greg Kroah-Hartman
` (343 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tony Luck,
Borislav Petkov (AMD), Reinette Chatre, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Luck <tony.luck@intel.com>
[ Upstream commit 2c10b3fa5bdf61e344bc522e6c2e00d870ce7ab8 ]
resctrl can be mounted on a system that supports monitoring but not allocation.
On such a system reading the "tasks" file in the default group reports no
tasks, even when there are tasks assigned to the default group. This problem
occurs because the check for whether a task belongs to a CTRL_MON group is
gated by a check for whether the system supports allocation.
The resctrl_arch_alloc_capable() check in is_closid_match() breaks task
reporting for the default group on monitor-only systems so remove this check.
On systems that support allocation the check is redundant.
Fixes: e6b2fac36fcc ("x86/resctrl: Use is_closid_match() in more places")
Closes: https://sashiko.dev/#/patchset/20260831174421.13921-1-tony.luck%40intel.com?part=9
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://patch.msgid.link/20261009193923.15498-1-tony.luck@intel.com
[ sashal: Changed the file path from fs/resctrl/rdtgroup.c to arch/x86/kernel/cpu/resctrl/rdtgroup.c, since resctrl hasn't been moved out of arch code yet; the one-line change itself is identical. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 868e260947a10..3db3af835471e 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -645,7 +645,7 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
static bool is_closid_match(struct task_struct *t, struct rdtgroup *r)
{
- return (resctrl_arch_alloc_capable() && (r->type == RDTCTRL_GROUP) &&
+ return (r->type == RDTCTRL_GROUP &&
resctrl_arch_match_closid(t, r->closid));
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 478/816] bpf, arm64: Fix racy plt target update in bpf_arch_text_poke()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (476 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 477/816] fs/resctrl: Ensure default group reports tasks on monitor-only systems Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 479/816] ALSA: hda/realtek: Fix mute LEDs on HP ENVY 17-cr1xxx Greg Kroah-Hartman
` (342 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Wood, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wood <thepacketgeek@gmail.com>
[ Upstream commit 6335e6719fd323c345427b7cf2d5d17c28fdbc41 ]
When a long-jump trampoline is attached to or detached from a bpf prog,
bpf_arch_text_poke() updates the plt target at the end of the prog by
temporarily making the page writable:
set_memory_rw(page);
WRITE_ONCE(plt->target, plt_target);
set_memory_ro(page);
Since commit 1dad391daef1 ("bpf, arm64: use bpf_prog_pack for memory
management"), bpf progs are allocated from the bpf prog pack, so
unrelated progs and their plts commonly share a page. The sequence
above is not serialized against other pokers, it runs before text_mutex
is taken and callers only hold the lock of the trampoline being
updated. Two CPUs attaching to or detaching from different target progs
in the same page can therefore race:
CPU A CPU B
set_memory_rw(page)
set_memory_rw(page)
WRITE_ONCE(plt_B->target, ...)
set_memory_ro(page)
WRITE_ONCE(plt_A->target, ...) <- permission fault
This was hit on an arm64 server with 64K pages while attaching fentry
programs to bpf progs:
Unable to handle kernel write to read-only memory at virtual address ffff80008f46d5f8
ESR = 0x000000009600004f
FSC = 0x0f: level 3 permission fault
pte=00c00200ea5a0783
Internal error: Oops: 000000009600004f [#1] SMP
pc : bpf_arch_text_poke+0x214/0x238
lr : bpf_arch_text_poke+0x200/0x238
Call trace:
bpf_arch_text_poke+0x214/0x238 (P)
__bpf_trampoline_link_prog+0x1c8/0x470
bpf_trampoline_link_prog+0x64/0x90
bpf_tracing_prog_attach+0x318/0x4a8
bpf_raw_tp_link_attach+0x104/0x258
bpf_raw_tracepoint_open+0x6c/0x90
__sys_bpf+0x134c/0x3e10
Rather than serializing the permission changes, stop changing page
permissions altogether and write the plt target with
aarch64_insn_write_literal_u64(). It writes through the text patching
fixmap under patch_lock, the same way the rest of the prog pack is
written, and performs a single-copy atomic 64-bit store. The plt target
is naturally aligned (see build_plt()), so CPUs concurrently executing
the plt still observe either the old or the new target. This is the
same helper ftrace and static calls use to update 64-bit literals that
are loaded concurrently.
Fixes: 1dad391daef1 ("bpf, arm64: use bpf_prog_pack for memory management")
Signed-off-by: Matthew Wood <thepacketgeek@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261009173802.1248441-1-thepacketgeek@gmail.com
[ sashal: Kept the local <asm/patching.h> include instead of upstream's <asm/text-patching.h> and dropped <asm/set_memory.h>; the hunk was otherwise identical, with only an offset shift. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/net/bpf_jit_comp.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 9c28bb7b69ae6..6900a5ddb9439 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -22,7 +22,6 @@
#include <asm/debug-monitors.h>
#include <asm/insn.h>
#include <asm/patching.h>
-#include <asm/set_memory.h>
#include "bpf_jit.h"
@@ -2631,21 +2630,22 @@ int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type poke_type,
*/
plt_target = (u64)&dummy_tramp;
- if (plt_target) {
- /* non-zero plt_target indicates we're patching a bpf prog,
- * which is read only.
- */
- if (set_memory_rw(PAGE_MASK & ((uintptr_t)&plt->target), 1))
- return -EFAULT;
- WRITE_ONCE(plt->target, plt_target);
- set_memory_ro(PAGE_MASK & ((uintptr_t)&plt->target), 1);
- /* since plt target points to either the new trampoline
- * or dummy_tramp, even if another CPU reads the old plt
- * target value before fetching the bl instruction to plt,
- * it will be brought back by dummy_tramp, so no barrier is
- * required here.
- */
- }
+ /*
+ * non-zero plt_target indicates we're patching a bpf prog,
+ * which is read only. The prog may share its page in the bpf
+ * prog pack with other progs, so write the aligned target
+ * through the text patching fixmap without flipping the
+ * page permissions to avoid racing with concurrent pokers.
+ *
+ * since plt target points to either the new trampoline
+ * or dummy_tramp, even if another CPU reads the old plt
+ * target value before fetching the bl instruction to plt,
+ * it will be brought back by dummy_tramp, so no barrier is
+ * required here.
+ */
+ if (plt_target &&
+ aarch64_insn_write_literal_u64(&plt->target, plt_target))
+ return -EFAULT;
/* if the old target and the new target are both long jumps, no
* patching is required
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 479/816] ALSA: hda/realtek: Fix mute LEDs on HP ENVY 17-cr1xxx
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (477 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 478/816] bpf, arm64: Fix racy plt target update in bpf_arch_text_poke() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 480/816] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq Greg Kroah-Hartman
` (341 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maksim Krasutski, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maksim Krasutski <krasutskimaksim@gmail.com>
[ Upstream commit dd83323e4d5e22bd04f7506a9ec33533465c8393 ]
The HP ENVY Laptop 17-cr1xxx with subsystem ID 103c:8be8 uses an
ALC245 codec and two CS35L41 I2C speaker amplifiers. Its existing
quirk configures the amplifiers but does not enable the speaker
and microphone mute LED handlers.
Select ALC287_FIXUP_CS35L41_I2C_2_HP_MUTE_LEDS to retain the
amplifier setup and enable both mute indicators.
The equivalent change was tested on an HP ENVY 17-cr1xxx running
Kubuntu 26.04.1 with kernel 7.0.0-38-generic. Both keyboard mute
indicators were confirmed working.
Fixes: aa8e3ef4fe53 ("ALSA: hda/realtek: Add quirks for various HP ENVY models")
Assisted-by: LLM
Signed-off-by: Maksim Krasutski <krasutskimaksim@gmail.com>
Link: https://patch.msgid.link/20261010185335.30949-1-krasutskimaksim@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Applied the same one-line quirk change in the older Realtek HDA file path, since the upstream file location does not exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/patch_realtek.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bfc75a1733fb5..b18eb7974c8eb 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -11154,7 +11154,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
- SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
+ SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2_HP_MUTE_LEDS),
SND_PCI_QUIRK(0x103c, 0x8be9, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8bfd, "HP Pavilion 15-eg3xxx", ALC287_FIXUP_HP_GPIO_LED),
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 480/816] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (478 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 479/816] ALSA: hda/realtek: Fix mute LEDs on HP ENVY 17-cr1xxx Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 481/816] RDMA/core: Clear driver_udata before destroying objects in rdma_core Greg Kroah-Hartman
` (340 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Quanye Yang, Farhad Alemi, Jack Wang,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quanye Yang <quanyeyang@proton.me>
[ Upstream commit 3255d6b83491574b115806ec958d8f6ca090fa9c ]
On disconnect the client error recovery path calls ib_drain_qp(), which
requires one free RQ slot and that no recv WQEs are posted while the
queue is being drained.
When the server is loaded with always_invalidate=N, the path does not
advertise RTRS_MSG_NEW_RKEY_F. A client-requested invalidation is then
a standalone SEND_WITH_INV. The recv completion path did not repost
that WQE; it posted two empty recv WQEs later, when the RDMA-with-IMM
response carried RTRS_IO_RSP_W_INV_IMM. If the invalidate receive
never arrived, each such response increased RQ occupancy by one until
ib_post_recv() started returning -ENOMEM and __ib_drain_rq() failed
with:
failed to drain recv queue: -12
Repost one empty recv WQE for every receive completion, including
SEND_WITH_INV completions on the always_invalidate=N path, and only
while the path is still connected so CQ polling cannot race with
ib_drain_qp(). Size IO connection RQs to 2 * queue_depth + 1 to match
the posted recv count and leave the drain slot.
Tested with a synthetic RTRS client flooding unpaired
RTRS_IO_RSP_W_INV_IMM messages; error recovery no longer triggers
__ib_drain_rq() warnings.
Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
Signed-off-by: Quanye Yang <quanyeyang@proton.me>
Link: https://lore.kernel.org/linux-rdma/CA+0ovCihE2_pxLimjmmR8NMz4g-ie8dvvq1jmAj-Om33y3Vzfg@mail.gmail.com
Link: https://patch.msgid.link/20261005-rtrs-fix-ib-drain-rq-v2-1-35535a3ed115@proton.me
Tested-by: Quanye Yang <quanyeyang@proton.me>
Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Kept this tree's min_t(int, ...) formatting in create_con_cq_qp() while changing the multiplier from 3 to 2, and dropped the removed block's %d error print in favor of the helper's %pe print. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 45 +++++++++-----------------
1 file changed, 15 insertions(+), 30 deletions(-)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index dbce23eabcfd1..3525508fe0321 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -582,25 +582,21 @@ static struct ib_cqe io_comp_cqe = {
.done = rtrs_clt_rdma_done
};
-/*
- * Post x2 empty WRs: first is for this RDMA with IMM,
- * second is for RECV with INV, which happened earlier.
- */
-static int rtrs_post_recv_empty_x2(struct rtrs_con *con, struct ib_cqe *cqe)
+static int rtrs_clt_repost_recv(struct rtrs_clt_con *con)
{
- struct ib_recv_wr wr_arr[2], *wr;
- int i;
+ struct rtrs_clt_path *clt_path = to_clt_path(con->c.path);
+ int err;
- memset(wr_arr, 0, sizeof(wr_arr));
- for (i = 0; i < ARRAY_SIZE(wr_arr); i++) {
- wr = &wr_arr[i];
- wr->wr_cqe = cqe;
- if (i)
- /* Chain backwards */
- wr->next = &wr_arr[i - 1];
- }
+ if (READ_ONCE(clt_path->state) != RTRS_CLT_CONNECTED)
+ return 0;
- return ib_post_recv(con->qp, wr, NULL);
+ err = rtrs_post_recv_empty(&con->c, &io_comp_cqe);
+ if (err) {
+ rtrs_err(con->c.path, "rtrs_post_recv_empty(): %pe\n",
+ ERR_PTR(err));
+ rtrs_rdma_error_recovery(con);
+ }
+ return err;
}
static void rtrs_clt_rdma_done(struct ib_cq *cq, struct ib_wc *wc)
@@ -661,19 +657,7 @@ static void rtrs_clt_rdma_done(struct ib_cq *cq, struct ib_wc *wc)
rtrs_wrn(con->c.path, "Unknown IMM type %u\n",
imm_type);
}
- if (w_inval)
- /*
- * Post x2 empty WRs: first is for this RDMA with IMM,
- * second is for RECV with INV, which happened earlier.
- */
- err = rtrs_post_recv_empty_x2(&con->c, &io_comp_cqe);
- else
- err = rtrs_post_recv_empty(&con->c, &io_comp_cqe);
- if (err) {
- rtrs_err(con->c.path, "rtrs_post_recv_empty(): %d\n",
- err);
- rtrs_rdma_error_recovery(con);
- }
+ rtrs_clt_repost_recv(con);
break;
case IB_WC_RECV:
/*
@@ -689,6 +673,7 @@ static void rtrs_clt_rdma_done(struct ib_cq *cq, struct ib_wc *wc)
return rtrs_clt_rkey_rsp_done(con, wc);
}
+ rtrs_clt_repost_recv(con);
break;
case IB_WC_RDMA_WRITE:
/*
@@ -1710,7 +1695,7 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)
/* QD * (REQ + RSP + FR REGS or INVS) + drain */
clt_path->queue_depth * 4 + 1);
max_recv_wr = min_t(int, wr_limit,
- clt_path->queue_depth * 3 + 1);
+ clt_path->queue_depth * 2 + 1);
max_send_sge = 2;
}
atomic_set(&con->c.sq_wr_avail, max_send_wr);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 481/816] RDMA/core: Clear driver_udata before destroying objects in rdma_core
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (479 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 480/816] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 482/816] dmaengine: ste_dma40: Preserve the LCPA I/O address space Greg Kroah-Hartman
` (339 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jacob Moroni, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <jmoroni@google.com>
[ Upstream commit d37e98844afea39a9614cac0de837701263c90f7 ]
When uobject creation fails while copying user output data (i.e.,
after the HW object has been created), it calls
rdma_alloc_abort_uobject() with hw_obj_valid=true which then
invokes the object's destroy callback, but passes the
uverbs_attr_bundle from the original creation command.
The issue is that drivers are expected to validate the udata
and return an error if there's unexpected content, and data from
the wrong command counts as "unexpected content", so this ends
up causing the driver's destroy call to fail.
A similar issue exists in the rereg_mr path when a new MR
is created and the old one is destroyed.
Fix this by clearing driver_udata before invoking the driver's
destroy method.
Fixes: 6e0954b11c05 ("RDMA/uverbs: Allow drivers to create a new HW object during rereg_mr")
Fixes: 0ac8903cbbe6 ("RDMA/core: Allow the ioctl layer to abort a fully created uobject")
Signed-off-by: Jacob Moroni <jmoroni@google.com>
Link: https://patch.msgid.link/20261006152908.888059-1-jmoroni@google.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: Only the two uverbs_get_cleared_udata(attrs) calls in rdma_core.c were applied; the upstream helper move to a static inline in rdma_core.h and the create_qp() cleanup were dropped because this branch's layout differs. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/rdma_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
index 29b1ab1d5f933..54d008e9ae85a 100644
--- a/drivers/infiniband/core/rdma_core.c
+++ b/drivers/infiniband/core/rdma_core.c
@@ -687,6 +687,7 @@ void rdma_assign_uobject(struct ib_uobject *to_uobj, struct ib_uobject *new_uobj
* If this fails then the uobject is still completely valid (though with
* a new ID) and we leak it until context close.
*/
+ uverbs_get_cleared_udata(attrs);
uverbs_destroy_uobject(to_uobj, RDMA_REMOVE_DESTROY, attrs);
}
@@ -702,6 +703,7 @@ void rdma_alloc_abort_uobject(struct ib_uobject *uobj,
int ret;
if (hw_obj_valid) {
+ uverbs_get_cleared_udata(attrs);
ret = uobj->uapi_object->type_class->destroy_hw(
uobj, RDMA_REMOVE_ABORT, attrs);
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 482/816] dmaengine: ste_dma40: Preserve the LCPA I/O address space
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (480 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 481/816] RDMA/core: Clear driver_udata before destroying objects in rdma_core Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 483/816] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure Greg Kroah-Hartman
` (338 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Linus Walleij,
Frank Li, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 42c31fec1ca76b8b5f7759def122d418dff2cd4b ]
The LCPA area is mapped with devm_ioremap(), but lcpa_base and the
per-channel lcpa pointer lack __iomem annotations. This loses the I/O
address space and makes sparse warn when d40_current_addr() assigns
LCPA register addresses to its __iomem pointers.
Annotate both pointers and the LCPA argument of d40_log_lli_lcpa_write()
to preserve the I/O address space from the mapping to the register
accessors. This also fixes the existing LCPA read and write warnings
without changing the generated code.
Fixes: c80edceff29e ("dmaengine: ste_dma40: Fix cyclic transfer residue")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610090216.pjMRxhRL-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20261010-dma40-smatch-fix-v1-1-26ca10043957@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 4 ++--
drivers/dma/ste_dma40_ll.c | 8 ++++----
drivers/dma/ste_dma40_ll.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 2c83eb05faa16..6699689deecae 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -509,7 +509,7 @@ struct d40_chan {
u32 src_def_cfg;
u32 dst_def_cfg;
struct d40_def_lcsp log_def;
- struct d40_log_lli_full *lcpa;
+ struct d40_log_lli_full __iomem *lcpa;
/* Runtime reconfiguration */
dma_addr_t runtime_addr;
enum dma_transfer_direction runtime_direction;
@@ -617,7 +617,7 @@ struct d40_base {
/* Physical half channels */
struct d40_phy_res *phy_res;
struct d40_lcla_pool lcla_pool;
- void *lcpa_base;
+ void __iomem *lcpa_base;
dma_addr_t phy_lcpa;
resource_size_t lcpa_size;
struct kmem_cache *desc_slab;
diff --git a/drivers/dma/ste_dma40_ll.c b/drivers/dma/ste_dma40_ll.c
index 4c489b126cb27..3be7f5b1abb08 100644
--- a/drivers/dma/ste_dma40_ll.c
+++ b/drivers/dma/ste_dma40_ll.c
@@ -333,10 +333,10 @@ static void d40_log_lli_link(struct d40_log_lli *lli_dst,
(dlos << D40_MEM_LCSP1_SLOS_POS);
}
-void d40_log_lli_lcpa_write(struct d40_log_lli_full *lcpa,
- struct d40_log_lli *lli_dst,
- struct d40_log_lli *lli_src,
- int next, unsigned int flags)
+void d40_log_lli_lcpa_write(struct d40_log_lli_full __iomem *lcpa,
+ struct d40_log_lli *lli_dst,
+ struct d40_log_lli *lli_src,
+ int next, unsigned int flags)
{
d40_log_lli_link(lli_dst, lli_src, next, flags);
diff --git a/drivers/dma/ste_dma40_ll.h b/drivers/dma/ste_dma40_ll.h
index 55090cb310579..ca9d076493610 100644
--- a/drivers/dma/ste_dma40_ll.h
+++ b/drivers/dma/ste_dma40_ll.h
@@ -455,7 +455,7 @@ int d40_log_sg_to_lli(struct scatterlist *sg,
u32 lcsp13, /* src or dst*/
u32 data_width1, u32 data_width2);
-void d40_log_lli_lcpa_write(struct d40_log_lli_full *lcpa,
+void d40_log_lli_lcpa_write(struct d40_log_lli_full __iomem *lcpa,
struct d40_log_lli *lli_dst,
struct d40_log_lli *lli_src,
int next, unsigned int flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 483/816] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (481 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 482/816] dmaengine: ste_dma40: Preserve the LCPA I/O address space Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 484/816] mailbox: arm_mhu_db: " Greg Kroah-Hartman
` (337 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anup Vishwakarma, Mukesh Ojha,
Jassi Brar, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
[ Upstream commit da988ac6afe152f802140ccaa0ad5e8f675b8814 ]
qcom_ipcc_probe() registers the mailbox controller via
devm_mbox_controller_register(), which automatically calls
mbox_controller_unregister() through devres when the device is removed
or probe fails. If devm_request_irq() subsequently fails, the
err_req_irq: label also manually calls mbox_controller_unregister(),
resulting in a double call that corrupts the global mailbox controller
list and causes a kernel panic.
Remove the redundant manual call and rely on devres for cleanup.
Fixes: e9d50e4b4d04 ("mailbox: qcom-ipcc: Dynamic alloc for channel arrangement")
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
[ sashal: Adjusted context to keep the existing braces and dev_err() around the goto in qcom_ipcc_probe(), which the upstream hunk lacked. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mailbox/qcom-ipcc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
index c619dfb24cd0e..c37ce8258da71 100644
--- a/drivers/mailbox/qcom-ipcc.c
+++ b/drivers/mailbox/qcom-ipcc.c
@@ -321,16 +321,13 @@ static int qcom_ipcc_probe(struct platform_device *pdev)
IRQF_NO_THREAD, name, ipcc);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to register the irq: %d\n", ret);
- goto err_req_irq;
+ goto err_mbox;
}
platform_set_drvdata(pdev, ipcc);
return 0;
-err_req_irq:
- if (ipcc->num_chans)
- mbox_controller_unregister(&ipcc->mbox);
err_mbox:
irq_domain_remove(ipcc->irq_domain);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 484/816] mailbox: arm_mhu_db: Remove redundant mbox_controller_unregister() on probe failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (482 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 483/816] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 485/816] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk() Greg Kroah-Hartman
` (336 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anup Vishwakarma, Mukesh Ojha,
Jassi Brar, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
[ Upstream commit 8228ed61b6cbd6e79531c9ebfcad233c35eae562 ]
mhu_db_probe() registers the mailbox controller via
devm_mbox_controller_register(), which automatically calls
mbox_controller_unregister() through devres when the device is removed
or probe fails. If devm_request_threaded_irq() subsequently fails in
the channel setup loop, the error path also manually calls
mbox_controller_unregister(), resulting in a double call that corrupts
the global mailbox controller list and causes a kernel panic.
Remove the redundant manual call and rely on devres for cleanup.
Fixes: 7002ca237b21 ("mailbox: arm_mhu: Add ARM MHU doorbell driver")
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
[ sashal: Kept the braces and the dev_err() line in the error branch, since a prerequisite cleanup is missing here, and removed only the mbox_controller_unregister() call. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mailbox/arm_mhu_db.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mailbox/arm_mhu_db.c b/drivers/mailbox/arm_mhu_db.c
index 27a510d469082..b6eeef867cbfc 100644
--- a/drivers/mailbox/arm_mhu_db.c
+++ b/drivers/mailbox/arm_mhu_db.c
@@ -319,7 +319,6 @@ static int mhu_db_probe(struct amba_device *adev, const struct amba_id *id)
IRQF_ONESHOT, "mhu_db_link", mhu);
if (err) {
dev_err(dev, "Can't claim IRQ %d\n", irq);
- mbox_controller_unregister(&mhu->mbox);
return err;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 485/816] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (483 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 484/816] mailbox: arm_mhu_db: " Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 486/816] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove Greg Kroah-Hartman
` (335 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kees Cook, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <kees@kernel.org>
[ Upstream commit a09fb764832dd7dbb9ccc38a9830f7294889c8ae ]
seq_buf_do_printk() prints a buffer line by line, then prints whatever
follows the last newline. When a string has overflowed at exactly a
newline, an empty line is printed since the pointer hasn't reached the
overflow mark of the seq_buf. Switch to just check if the string is
already empty and only print if not.
The only caller is the memory cgroup OOM report, so this could only ever
add a blank line to a report whose statistics already did not fit.
Add a test that registers a console to count the records that
seq_buf_do_printk() emits. It counts the records carrying the test's
marker, and the records holding nothing but a line feed that arrive
after one, so that unrelated kernel messages do not disturb it. Both
states that reach the flaw are covered: exactly full, and overflowed.
Tests passed under qemu on ARCH=x86_64 with GCC 16.2.0 and CONFIG_KASAN=y,
and on big-endian ARCH=s390 with GCC s390x-linux-gnu 16.2.0.
Fixes: 96928d9032a7c ("seq_buf: Add seq_buf_do_printk() helper")
Assisted-by: LLM
Link: https://patch.msgid.link/20261005155708.1471260-1-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
[ sashal: Dropped the new KUnit test hunk because the test file doesn't exist in this tree; the one-line fix in lib/seq_buf.c applied unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/seq_buf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/seq_buf.c b/lib/seq_buf.c
index f3f3436d60a94..12082f042ff72 100644
--- a/lib/seq_buf.c
+++ b/lib/seq_buf.c
@@ -128,7 +128,7 @@ void seq_buf_do_printk(struct seq_buf *s, const char *lvl)
}
/* No trailing LF */
- if (start < s->buffer + s->len)
+ if (*start)
printk("%s%s\n", lvl, start);
}
EXPORT_SYMBOL_GPL(seq_buf_do_printk);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 486/816] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (484 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 485/816] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk() Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 487/816] net: stmmac: set real_num_tx_queues to max(offset + count) Greg Kroah-Hartman
` (334 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Boris Brezillon, Steven Price,
Adrián Larumbe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrián Larumbe <adrian.larumbe@collabora.com>
[ Upstream commit e9672bf9382ff80be21d586f88e50339b85f5766 ]
During device probe(), failure to do a PM get() will leave the usage_count
set to 0, which is the value assigned at device creation time. That means
when the autosuspend delay expires, runtime suspend callback won't be
invoked, so the device will remain powered on forever.
On top of that, failure to call PM put() during device unplug means
Panfrost device's PM usage_count increases monotonically for every new
module reload.
The outcome of both of the above meant that:
- Devfreq OPP transition notifications would be printed all the time,
even when no jobs are being submitted. This quickly fills the kernel
ring buffer with junk.
- Because MMU interrupts are only enabled when the device is reset,
the very first job targeting the tiler heap BO after device probe()
would always time out, since the driver's PM runtime resume callback
would not be invoked.
To fix the above:
- Manually adjust the PM refcnt at device probe and removal time.
- Ensure pm_runtime_dont_use_autosuspend is called in the wind-down path.
- Call pm_runtime_put_autosuspend() when device is ready to accept jobs
Fixes: 635430797d3f ("drm/panfrost: Rework runtime PM initialization")
Fixes: 876b15d2c88d ("drm/panfrost: Fix module unload")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20261012-claude-fixes-v15-6-bc0a6c498553@collabora.com
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
[ sashal: Replaced pfdev->base.dev with pfdev->dev, adjusted context for the shrinker and drm_dev_put() paths, and added pm_runtime_mark_last_busy() before pm_runtime_put_autosuspend() in probe. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panfrost/panfrost_drv.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index c20a817dcd1f0..ef46ceb3e4c68 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -644,6 +644,11 @@ static int panfrost_probe(struct platform_device *pdev)
goto err_out0;
}
+ /* The reason we must manually set the PM status and usage counter is
+ * we have just powered the device up but did not go through the PM
+ * runtime resume callback, so we need to update these ourselves.
+ */
+ pm_runtime_get_noresume(pfdev->dev);
pm_runtime_set_active(pfdev->dev);
pm_runtime_mark_last_busy(pfdev->dev);
pm_runtime_enable(pfdev->dev);
@@ -662,14 +667,19 @@ static int panfrost_probe(struct platform_device *pdev)
if (err)
goto err_out2;
+ pm_runtime_mark_last_busy(pfdev->dev);
+ pm_runtime_put_autosuspend(pfdev->dev);
+
return 0;
err_out2:
drm_dev_unregister(ddev);
err_out1:
+ pm_runtime_dont_use_autosuspend(pfdev->dev);
pm_runtime_disable(pfdev->dev);
panfrost_device_fini(pfdev);
pm_runtime_set_suspended(pfdev->dev);
+ pm_runtime_put_noidle(pfdev->dev);
err_out0:
drm_dev_put(ddev);
return err;
@@ -684,9 +694,11 @@ static void panfrost_remove(struct platform_device *pdev)
panfrost_gem_shrinker_cleanup(ddev);
pm_runtime_get_sync(pfdev->dev);
+ pm_runtime_dont_use_autosuspend(pfdev->dev);
pm_runtime_disable(pfdev->dev);
panfrost_device_fini(pfdev);
pm_runtime_set_suspended(pfdev->dev);
+ pm_runtime_put_noidle(pfdev->dev);
drm_dev_put(ddev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 487/816] net: stmmac: set real_num_tx_queues to max(offset + count)
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (485 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 486/816] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 488/816] net: stmmac: align real_num_tx_queues to mqprio configuration Greg Kroah-Hartman
` (333 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Daniel Thompson,
Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit d128212667593c548a3c67d30031063ed46c29b7 ]
tc_setup_dwmac510_mqprio() computes the number of real TX queues as the
sum of the per-TC queue counts. mqprio_validate_queue_counts() only
rejects out-of-bounds or overlapping ranges, so layouts with gaps or a
non-zero first offset are accepted, and in those cases the sum is smaller
than the highest queue referenced by the netdev TC map.
netif_set_real_num_tx_queues() then passes this too-small count to
netif_setup_tc(). However stmmac_set_ndev_tcs() has already zeroed
dev->prio_tc_map() through netdev_reset_tc(), so when netif_setup_tc()
runs every priority maps to TC0 and only the TC0 range is checked. A
layout whose TC0 range fits but where a later TC references a queue
beyond the new real_num_tx_queues is left with num_tc set and its TC map
pointing at queues that are no longer real, without any warning; only
when TC0 itself is out of range is the mapping disabled. The real
prio_tc_map is programmed later by the qdisc, after this call, so the
driver cannot rely on netif_setup_tc() to catch those cases.
Compute num_tx_queues as the maximum of offset[i] + count[i] instead of
the sum of the counts, so real_num_tx_queues always covers the highest
queue referenced by the TC map. This is a no-op for the contiguous
channel-mode layouts where offset[i] == i and count[i] == 1.
The issue has been reported by sashiko and the patch has been tested on
Qualcomm RB3-Gen2 board.
Fixes: 195e4f409a40 ("net: stmmac: support fp parameter of tc-mqprio")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261006-stmmac-mqprio-prio-offload-v5-1-d7da93419784@oss.qualcomm.com
Tested-by: Daniel Thompson <daniel@riscstar.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index 65085f9c9290e..f29fa17584788 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -1265,7 +1265,8 @@ static int tc_setup_dwmac510_mqprio(struct stmmac_priv *priv,
for (u32 tc = 0; tc < num_tc; tc++) {
offset = qopt->offset[tc];
count = qopt->count[tc];
- num_stack_tx_queues += count;
+ num_stack_tx_queues = max(num_stack_tx_queues,
+ offset + count);
err = netdev_set_tc_queue(ndev, tc, count, offset);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 488/816] net: stmmac: align real_num_tx_queues to mqprio configuration
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (486 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 487/816] net: stmmac: set real_num_tx_queues to max(offset + count) Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 489/816] btrfs: roll back sprout setup after device add failure Greg Kroah-Hartman
` (332 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maxime Chevallier, Lorenzo Bianconi,
Daniel Thompson, Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit ac1ca0c3e139a2ebef2fc6c570af6647329726f1 ]
stmmac_hw_setup() unconditionally sets the number of real TX queues to
plat->tx_queues_to_use on every device open. When a tc-mqprio qdisc is
offloaded the driver reduces netif_set_real_num_tx_queues() to the number
of queues enabled by the offload, but the next device open reverts it to
plat->tx_queues_to_use while the netdev TC map is still the one programmed
by the qdisc, leaving the two inconsistent.
Track the number of TX queues enabled by the current qdisc configuration
in the per-qdisc state (priv->xmit_qdisc.num_tx_queues) and use it in
stmmac_hw_setup(). The field defaults to plat->tx_queues_to_use at probe
time and when the mqprio qdisc is destroyed, meaning no offload is active
and the number of real TX queues must match the number of queues the
driver allocated, and it is updated to the offloaded queue count on a
successful mqprio setup.
mqprio only validates the requested queue ranges against
dev->real_num_tx_queues, which can be larger than plat->tx_queues_to_use
while the interface has not been opened yet. Reject a qopt whose highest
referenced queue (offset + count) exceeds plat->tx_queues_to_use, so
xmit_qdisc.num_tx_queues can never be larger than the number of TX queues
the driver provisions. Otherwise stmmac_hw_setup() would expose TX queues
without an allocated DMA ring.
Refuse to lower the number of TX queues below the count required by the
active mqprio offload in stmmac_reinit_queues(), otherwise
netif_set_real_num_tx_queues() would leave real_num_tx_queues
inconsistent with the netdev TC map.
The issue has been reported by sashiko and the patch has been tested on
a Qualcomm RB3-Gen2 board.
Fixes: 195e4f409a40 ("net: stmmac: support fp parameter of tc-mqprio")
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20261006-stmmac-mqprio-prio-offload-v5-2-d7da93419784@oss.qualcomm.com
Tested-by: Daniel Thompson <daniel@riscstar.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Adapted the simplified mqprio setup function by adding a pre-validation loop that rejects out-of-range queue configs before any state changes, since upstream's rollback machinery is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 6 ++++++
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 +++++++++++-
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 15 +++++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index dcdc4e24002ed..2bb4517b42c1b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -302,6 +302,12 @@ struct stmmac_priv {
/* Protect est parameters */
struct mutex est_lock;
struct stmmac_est *est;
+
+ struct {
+ bool enabled;
+ u32 num_tx_queues;
+ } xmit_qdisc;
+
struct dma_features dma_cap;
struct stmmac_counters mmc;
int hw_cap_support;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 81e97ab3178b4..c47114ccf7c45 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3548,7 +3548,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
/* Configure real RX and TX queues */
netif_set_real_num_rx_queues(dev, priv->plat->rx_queues_to_use);
- netif_set_real_num_tx_queues(dev, priv->plat->tx_queues_to_use);
+ netif_set_real_num_tx_queues(dev, priv->xmit_qdisc.num_tx_queues);
/* Start the ball rolling... */
stmmac_start_all_dma(priv);
@@ -7465,6 +7465,10 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
struct stmmac_priv *priv = netdev_priv(dev);
int ret = 0, i;
+ if (priv->xmit_qdisc.enabled &&
+ tx_cnt < priv->xmit_qdisc.num_tx_queues)
+ return -EINVAL;
+
if (netif_running(dev))
stmmac_release(dev);
@@ -7472,6 +7476,9 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
priv->plat->rx_queues_to_use = rx_cnt;
priv->plat->tx_queues_to_use = tx_cnt;
+ if (!priv->xmit_qdisc.enabled)
+ priv->xmit_qdisc.num_tx_queues = tx_cnt;
+
if (!netif_is_rxfh_configured(dev))
for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++)
priv->rss.table[i] = ethtool_rxfh_indir_default(i,
@@ -7745,6 +7752,9 @@ int stmmac_dvr_probe(struct device *device,
ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_XSK_ZEROCOPY;
+ /* Default qdisc num_tx_queues */
+ priv->xmit_qdisc.num_tx_queues = priv->plat->tx_queues_to_use;
+
ret = stmmac_tc_init(priv, priv);
if (!ret) {
ndev->hw_features |= NETIF_F_HW_TC;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index f29fa17584788..1bedea21194fa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -1239,6 +1239,9 @@ static int stmmac_reset_tc_mqprio(struct net_device *ndev,
{
struct stmmac_priv *priv = netdev_priv(ndev);
+ priv->xmit_qdisc.num_tx_queues = priv->plat->tx_queues_to_use;
+ priv->xmit_qdisc.enabled = false;
+
netdev_reset_tc(ndev);
netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use);
@@ -1258,6 +1261,15 @@ static int tc_setup_dwmac510_mqprio(struct stmmac_priv *priv,
if (!num_tc)
return stmmac_reset_tc_mqprio(ndev, extack);
+ for (u32 tc = 0; tc < num_tc; tc++) {
+ if (qopt->offset[tc] + qopt->count[tc] >
+ priv->plat->tx_queues_to_use) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Queues exceed hw TX queues");
+ return -EINVAL;
+ }
+ }
+
err = netdev_set_num_tc(ndev, num_tc);
if (err)
return err;
@@ -1282,6 +1294,9 @@ static int tc_setup_dwmac510_mqprio(struct stmmac_priv *priv,
if (err)
goto err_reset_tc;
+ priv->xmit_qdisc.num_tx_queues = num_stack_tx_queues;
+ priv->xmit_qdisc.enabled = true;
+
return 0;
err_reset_tc:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 489/816] btrfs: roll back sprout setup after device add failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (487 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 488/816] net: stmmac: align real_num_tx_queues to mqprio configuration Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 490/816] ASoC: codecs: wcd939x: read the SoundWire port switches per channel Greg Kroah-Hartman
` (331 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Guanghui Yang,
David Sterba, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanghui Yang <3497809730@qq.com>
[ Upstream commit f5166f53b60b4d1ee9957c0baccd3b09735001d4 ]
btrfs_init_new_device() calls btrfs_setup_sprout() before creating the
first writable chunks for a seed filesystem. That moves the seed devices
out of fs_info->fs_devices, clears the seeding state and installs a new
fsid for the sprout filesystem.
If a later step fails, the error path removes the new device but leaves
fs_info->fs_devices in the partially initialized sprout state. The
mounted filesystem can then be left with no open devices after the
failed device add.
Add the inverse of btrfs_setup_sprout() and use it from the error path
so the mounted seed filesystem is restored before the temporary
seed_devices copy is released.
Fixes: 2b82032c34ec ("Btrfs: Seed device support")
Assisted-by: Codex:gpt-5
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Guanghui Yang <3497809730@qq.com>
[ Fix a conflict with per-profile available space, revert sprout before
updating per-profile available space estimation. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: Dropped the context line calling btrfs_update_per_profile_avail() after the rollback call, since that helper doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/volumes.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b6ed1190a63d7..0652c630743e8 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2715,6 +2715,41 @@ static void btrfs_setup_sprout(struct btrfs_fs_info *fs_info,
btrfs_set_super_flags(disk_super, super_flags);
}
+static void btrfs_rollback_sprout(struct btrfs_fs_info *fs_info,
+ struct btrfs_fs_devices *seed_devices)
+{
+ struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
+ struct btrfs_super_block *disk_super = fs_info->super_copy;
+ struct btrfs_device *device;
+ u64 super_flags;
+
+ lockdep_assert_held(&uuid_mutex);
+ lockdep_assert_held(&fs_devices->device_list_mutex);
+
+ list_del_init(&seed_devices->seed_list);
+ list_splice_init_rcu(&seed_devices->devices, &fs_devices->devices, synchronize_rcu);
+ list_for_each_entry(device, &fs_devices->devices, dev_list) {
+ device->fs_devices = fs_devices;
+ }
+
+ fs_devices->seeding = true;
+ fs_devices->num_devices = seed_devices->num_devices;
+ fs_devices->open_devices = seed_devices->open_devices;
+ fs_devices->missing_devices = seed_devices->missing_devices;
+ fs_devices->rotating = seed_devices->rotating;
+ fs_devices->latest_dev = seed_devices->latest_dev;
+
+ memcpy(fs_devices->fsid, seed_devices->fsid, BTRFS_FSID_SIZE);
+ memcpy(fs_devices->metadata_uuid, seed_devices->metadata_uuid, BTRFS_FSID_SIZE);
+ memcpy(disk_super->fsid, seed_devices->fsid, BTRFS_FSID_SIZE);
+
+ super_flags = (btrfs_super_flags(disk_super) | BTRFS_SUPER_FLAG_SEEDING);
+ btrfs_set_super_flags(disk_super, super_flags);
+
+ seed_devices->opened = 0;
+ free_fs_devices(seed_devices);
+}
+
/*
* Store the expected generation for seed devices in device items.
*/
@@ -3027,6 +3062,8 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
orig_super_total_bytes);
btrfs_set_super_num_devices(fs_info->super_copy,
orig_super_num_devices);
+ if (seeding_dev)
+ btrfs_rollback_sprout(fs_info, seed_devices);
mutex_unlock(&fs_info->chunk_mutex);
mutex_unlock(&fs_info->fs_devices->device_list_mutex);
error_trans:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 490/816] ASoC: codecs: wcd939x: read the SoundWire port switches per channel
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (488 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 489/816] btrfs: roll back sprout setup after device add failure Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 491/816] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup Greg Kroah-Hartman
` (330 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joonhoe Kim, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonhoe Kim <26rote@gmail.com>
[ Upstream commit e7860dc5d8d45f6a0e98bfe542c7b776c5ede2a4 ]
The "HPHL/HPHR", "ADCn" and "DMICn" switches are channels of shared
SoundWire ports (ADC1-4 are channels 0-3 of the ADC_1_4 port), but
wcd939x_get_swr_port() reports a per-port flag. Once one channel of a
port is switched on, every switch on that port reads back as on:
amixer cset name='ADC1 Switch' on -> ADC1..ADC4 Switch all read "on"
Setting one of the others then looks like a no-op to userspace, and
"alsactl store" saves all of them as on, so a later "alsactl restore"
really enables the unused channels of the port.
Read the channel's own bit in the port's channel mask instead, drop the
now unused port_enable[] and return 0 from the put handler when the
switch does not change, as ALSA expects.
Fixes: 10f514bd172a ("ASoC: codecs: Add WCD939x Codec driver")
Link: https://lore.kernel.org/all/20251124064850.15419-6-jonathan@marek.ca/
Assisted-by: LLM
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
Link: https://patch.msgid.link/20261007123954.1709-1-26rote@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wcd939x.c | 10 +++++++---
sound/soc/codecs/wcd939x.h | 1 -
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c
index 4a417a92514d7..db634a6cdfbc4 100644
--- a/sound/soc/codecs/wcd939x.c
+++ b/sound/soc/codecs/wcd939x.c
@@ -1792,8 +1792,9 @@ static int wcd939x_get_swr_port(struct snd_kcontrol *kcontrol,
struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(comp);
struct wcd939x_sdw_priv *wcd = wcd939x->sdw_priv[mixer->shift];
unsigned int portidx = wcd->ch_info[mixer->reg].port_num;
+ u8 ch_mask = wcd->ch_info[mixer->reg].ch_mask;
- ucontrol->value.integer.value[0] = wcd->port_enable[portidx] ? 1 : 0;
+ ucontrol->value.integer.value[0] = !!(wcd->port_config[portidx - 1].ch_mask & ch_mask);
return 0;
}
@@ -1819,10 +1820,13 @@ static int wcd939x_set_swr_port(struct snd_kcontrol *kcontrol,
struct wcd939x_priv *wcd939x = snd_soc_component_get_drvdata(comp);
struct wcd939x_sdw_priv *wcd = wcd939x->sdw_priv[mixer->shift];
unsigned int portidx = wcd->ch_info[mixer->reg].port_num;
+ u8 ch_mask = wcd->ch_info[mixer->reg].ch_mask;
+ bool enable = !!ucontrol->value.integer.value[0];
- wcd->port_enable[portidx] = !!ucontrol->value.integer.value[0];
+ if (enable == !!(wcd->port_config[portidx - 1].ch_mask & ch_mask))
+ return 0;
- wcd939x_connect_port(wcd, portidx, mixer->reg, wcd->port_enable[portidx]);
+ wcd939x_connect_port(wcd, portidx, mixer->reg, enable);
return 1;
}
diff --git a/sound/soc/codecs/wcd939x.h b/sound/soc/codecs/wcd939x.h
index 3204fb10b58d7..ea6b46a996615 100644
--- a/sound/soc/codecs/wcd939x.h
+++ b/sound/soc/codecs/wcd939x.h
@@ -910,7 +910,6 @@ struct wcd939x_sdw_priv {
struct sdw_stream_runtime *sruntime;
struct sdw_port_config port_config[WCD939X_MAX_SWR_PORTS];
const struct wcd939x_sdw_ch_info *ch_info;
- bool port_enable[WCD939X_MAX_SWR_CH_IDS];
int active_ports;
bool is_tx;
struct wcd939x_priv *wcd939x;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 491/816] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (489 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 490/816] ASoC: codecs: wcd939x: read the SoundWire port switches per channel Greg Kroah-Hartman
@ 2026-11-25 14:33 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 492/816] perf symbol: Fix symbol loading from libbfd Greg Kroah-Hartman
` (329 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:33 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiale Yao, Baochen Qiang,
Rameshkumar Sundaram, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 94c7b50351fd30e1dfe1b4051197a1445d8547e1 ]
The pending management TX cleanup walks txmgmt_idr with idr_for_each(),
and its callback removes the current entry. This can invalidate the
radix-tree iterator retained by idr_for_each().
Use idr_for_each_entry() so every iteration starts with a fresh lookup.
Continue to remove each entry under txmgmt_idr_lock before freeing its skb,
preventing concurrent TX completion from finding a stale skb pointer.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20261003092104.520135-5-yaojiale02@163.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[ sashal: Adjusted context lines in core.c and mac.h for older surrounding code (different neighbouring calls, a missing helper); the changed lines match upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath12k/core.c | 3 +--
drivers/net/wireless/ath/ath12k/mac.c | 12 ++++++------
drivers/net/wireless/ath/ath12k/mac.h | 2 +-
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index c3c76e2680629..af4e9c77f5209 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -1064,8 +1064,7 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
complete(&ar->bss_survey_done);
wake_up(&ar->dp.tx_empty_waitq);
- idr_for_each(&ar->txmgmt_idr,
- ath12k_mac_tx_mgmt_pending_free, ar);
+ ath12k_mac_tx_mgmt_pending_free(ar);
idr_destroy(&ar->txmgmt_idr);
wake_up(&ar->txmgmt_empty_waitq);
}
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 9f10eb7de3df2..6f2df6d2b68d4 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5699,13 +5699,13 @@ static void ath12k_mac_tx_mgmt_free(struct ath12k *ar, int buf_id)
ath12k_mgmt_over_wmi_tx_drop(ar, msdu);
}
-int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx)
+void ath12k_mac_tx_mgmt_pending_free(struct ath12k *ar)
{
- struct ath12k *ar = ctx;
-
- ath12k_mac_tx_mgmt_free(ar, buf_id);
+ struct sk_buff *msdu;
+ int buf_id;
- return 0;
+ idr_for_each_entry(&ar->txmgmt_idr, msdu, buf_id)
+ ath12k_mac_tx_mgmt_free(ar, buf_id);
}
static void ath12k_mac_vif_txmgmt_cleanup(struct ath12k *ar,
@@ -8999,7 +8999,7 @@ static const struct wiphy_iftype_ext_capab ath12k_iftypes_ext_capa[] = {
static void ath12k_mac_cleanup_unregister(struct ath12k *ar)
{
- idr_for_each(&ar->txmgmt_idr, ath12k_mac_tx_mgmt_pending_free, ar);
+ ath12k_mac_tx_mgmt_pending_free(ar);
idr_destroy(&ar->txmgmt_idr);
kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels);
diff --git a/drivers/net/wireless/ath/ath12k/mac.h b/drivers/net/wireless/ath/ath12k/mac.h
index 5efbb6822628f..2c0a3b199669b 100644
--- a/drivers/net/wireless/ath/ath12k/mac.h
+++ b/drivers/net/wireless/ath/ath12k/mac.h
@@ -73,7 +73,7 @@ struct ath12k *ath12k_mac_get_ar_by_pdev_id(struct ath12k_base *ab, u32 pdev_id)
void ath12k_mac_drain_tx(struct ath12k *ar);
void ath12k_mac_peer_cleanup_all(struct ath12k *ar);
-int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
+void ath12k_mac_tx_mgmt_pending_free(struct ath12k *ar);
enum rate_info_bw ath12k_mac_bw_to_mac80211_bw(enum ath12k_supported_bw bw);
enum ath12k_supported_bw ath12k_mac_mac80211_bw_to_ath12k_bw(enum rate_info_bw bw);
enum hal_encrypt_type ath12k_dp_tx_get_encrypt_type(u32 cipher);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 492/816] perf symbol: Fix symbol loading from libbfd
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (490 preceding siblings ...)
2026-11-25 14:33 ` [PATCH 6.12 491/816] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 493/816] perf symbol: Add missing symsrc__destroy() for libbfd Greg Kroah-Hartman
` (328 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ian Rogers, Namhyung Kim,
Remi Bernon, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <namhyung@kernel.org>
[ Upstream commit f814d9e6cdbef6413a72d6dd6d5e4e79e815cf44 ]
The dso__load() should return a positive number (number of symbols
loaded) when it succeded to load symbols. But dso__load_bfd_symbols()
only returns 0 and it's hard to check if it actually loaded symbols or
not. Let's return the value of dso__has_symbol() and check it in
dso__load() so that it can return 1 for success.
Closes: https://lore.kernel.org/r/sashiko-outbox-162540@kernel.org
Fixes: eac9a4342e5447ca ("perf symbols: Try reading the symbol table with libbfd")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Remi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: Applied the dso__load_bfd_symbols() return-value change in symbol.c, because the libbfd code hasn't been split out into its own file here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/pe-file-parsing.c | 2 +-
tools/perf/util/symbol.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/tests/pe-file-parsing.c b/tools/perf/tests/pe-file-parsing.c
index fff58b220c07b..69060aa1a62a1 100644
--- a/tools/perf/tests/pe-file-parsing.c
+++ b/tools/perf/tests/pe-file-parsing.c
@@ -59,7 +59,7 @@ static int run_dir(const char *d)
TEST_ASSERT_VAL("Failed to get dso", dso);
ret = dso__load_bfd_symbols(dso, debugfile);
- TEST_ASSERT_VAL("Failed to load symbols", ret == 0);
+ TEST_ASSERT_VAL("Failed to load symbols", ret > 0);
dso__sort_by_name(dso);
sym = dso__find_symbol_by_name(dso, "main", &idx);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 99ee76bc6c513..ef4594088684a 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1694,7 +1694,7 @@ int dso__load_bfd_symbols(struct dso *dso, const char *debugfile)
symbols__fixup_duplicate(dso__symbols(dso));
dso__set_adjust_symbols(dso, true);
- err = 0;
+ err = dso__has_symbols(dso);
out_free:
free(symbols);
out_close:
@@ -1914,8 +1914,8 @@ int dso__load(struct dso *dso, struct map *map)
if (nsexit)
nsinfo__mountns_enter(dso__nsinfo(dso), &nsc);
- if (bfdrc == 0) {
- ret = 0;
+ if (bfdrc > 0) {
+ ret = 1;
break;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 493/816] perf symbol: Add missing symsrc__destroy() for libbfd
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (491 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 492/816] perf symbol: Fix symbol loading from libbfd Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 494/816] Bluetooth: hci_sync: fix mesh adv timeout units Greg Kroah-Hartman
` (327 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ian Rogers, Namhyung Kim,
Remi Bernon, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namhyung Kim <namhyung@kernel.org>
[ Upstream commit 35477b351e6a697c85dc7d37e5081621889f8e40 ]
When libbfd loaded symbols and there's a pending syms_ss, it'd be lost
or overwrite existing symbols. Let's destroy it before breaking the
loop so that it can safely return from the function.
Closes: https://lore.kernel.org/r/sashiko-outbox-162540@kernel.org
Fixes: eac9a4342e5447ca ("perf symbols: Try reading the symbol table with libbfd")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Remi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/symbol.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index ef4594088684a..4de28911bdb52 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1916,7 +1916,7 @@ int dso__load(struct dso *dso, struct map *map)
if (bfdrc > 0) {
ret = 1;
- break;
+ goto out_destroy;
}
if (!is_reg || sirc < 0)
@@ -1981,6 +1981,7 @@ int dso__load(struct dso *dso, struct map *map)
ret += nr_plt;
}
+out_destroy:
for (; ss_pos > 0; ss_pos--)
symsrc__destroy(&ss_[ss_pos - 1]);
out_free:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 494/816] Bluetooth: hci_sync: fix mesh adv timeout units
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (492 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 493/816] perf symbol: Add missing symsrc__destroy() for libbfd Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 495/816] Bluetooth: hci_event: Fix LE link drop on remote features command status Greg Kroah-Hartman
` (326 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pauli Virtanen,
Luiz Augusto von Dentz, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pauli Virtanen <pav@iki.fi>
[ Upstream commit 8a8d51eeedebfa5aaaae7720f2fb2aa1a67b8587 ]
Mesh adv instance timeout and duration are in milliseconds, see
mesh_send_sync, hci_add_adv_instance. hci_schedule_adv_instance_sync()
and hci_enable_ext_advertising_sync() ignore this, and scale the timeout
wrong.
Fix for mesh instances by using msecs_to_jiffies() in
hci_schedule_adv_instance_sync and fixing the scaling in
hci_enable_ext_advertising_sync.
Fixes BlueZ "Mesh - Send cancel" test failures.
Fixes: b338d91703fa ("Bluetooth: Implement support for Mesh")
Assisted-by: opencode:qwen3.8-flash-next sashiko
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ sashal: Kept the tree's msecs_to_jiffies(timeout * 1000) for the non-mesh case instead of upstream's secs_to_jiffies(timeout), since that helper isn't used in this file here, and added the mesh branch. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_sync.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index e51af37b10152..3793fc359a9ff 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1731,7 +1731,8 @@ int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance)
* scheduling it.
*/
if (adv && adv->timeout) {
- u16 duration = adv->timeout * MSEC_PER_SEC;
+ u16 duration = adv->mesh ? adv->timeout :
+ adv->timeout * MSEC_PER_SEC;
/* Time = N * 10 ms */
set->duration = cpu_to_le16(duration / 10);
@@ -2191,7 +2192,8 @@ int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance,
hdev->adv_instance_timeout = timeout;
queue_delayed_work(hdev->req_workqueue,
&hdev->adv_instance_expire,
- msecs_to_jiffies(timeout * 1000));
+ adv->mesh ? msecs_to_jiffies(timeout) :
+ msecs_to_jiffies(timeout * 1000));
}
/* If we're just re-scheduling the same instance again then do not
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 495/816] Bluetooth: hci_event: Fix LE link drop on remote features command status
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (493 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 494/816] Bluetooth: hci_sync: fix mesh adv timeout units Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 496/816] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails Greg Kroah-Hartman
` (325 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Dewald, Luiz Augusto von Dentz,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Dewald <kevin@simpleble.org>
[ Upstream commit 91638f53ff2b8234195ff27ec913e068269a28e9 ]
When the local controller supports peripheral-initiated features
exchange, the LE Read Remote Features procedure also runs for incoming
connections, and it fails with Unsupported Remote Feature (0x1a) if the
central does not support that feature. hci_le_remote_feat_complete_evt()
and hci_le_read_all_remote_features_evt() handle this and let the
connection transition into connected state.
A controller can also return that error in the Command Status event
instead. An Intel controller does so for a central that does not
support peripheral-initiated features exchange, presumably because it
already has the features of the central. hci_cs_le_read_remote_features()
and hci_cs_le_read_all_remote_features() then confirm the connection as
failed while it is still in BT_CONFIG, and the hci_conn_drop() in
le_read_features_complete() disconnects it right away:
> HCI Event: LE Meta Event (0x3e) plen 31
LE Enhanced Connection Complete (0x0a)
Status: Success (0x00)
Role: Peripheral (0x01)
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2
> HCI Event: Command Status (0x0f) plen 4
LE Read Remote Used Features (0x08|0x0016) ncmd 1
Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)
< HCI Command: Disconnect (0x01|0x0006) plen 3
Reason: Remote User Terminated Connection (0x13)
Data the central sends afterwards is reported as:
Bluetooth: hci0: ACL packet for unknown connection handle 3585
Handle Unsupported Remote Feature in the command status the same way as
in the complete events.
Fixes: 0fe29fd1cd77 ("Bluetooth: Read LE remote features during connection establishment")
Fixes: a106e50be74b ("Bluetooth: HCI: Add support for LL Extended Feature Set")
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>
[ sashal: Kept this tree's nested if (conn) { if (conn->state == BT_CONFIG) {...} } with hci_conn_drop() and added the new block inside, and dropped the second hunk because the all-remote-features function doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_event.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3eea2343f1977..f723210c52e53 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2930,6 +2930,22 @@ static void hci_cs_le_read_remote_features(struct hci_dev *hdev, u8 status)
conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
if (conn) {
if (conn->state == BT_CONFIG) {
+ /* If the local controller supports peripheral-initiated
+ * features exchange, but the remote controller does not,
+ * then the controller may already return the error code
+ * 0x1a for unsupported remote feature in the command
+ * status.
+ *
+ * Handle it as hci_le_remote_feat_complete_evt() does and
+ * allow the connection to transition into connected state.
+ */
+ if (!conn->out &&
+ status == HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE &&
+ (hdev->le_features[0] & HCI_LE_PERIPHERAL_FEATURES)) {
+ conn->state = BT_CONNECTED;
+ status = 0x00;
+ }
+
hci_connect_cfm(conn, status);
hci_conn_drop(conn);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 496/816] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (494 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 495/816] Bluetooth: hci_event: Fix LE link drop on remote features command status Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 497/816] rxrpc: Fix aborting in rxperf test server Greg Kroah-Hartman
` (324 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Jason Gunthorpe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
[ Upstream commit 1e67cca28490f897788c128c650a6f2cbb565403 ]
iommufd_device_do_replace() installs the group's reserved IOVA ranges in
the new hwpt's IOAS only when it differs from the old hwpt's IOAS. If the
replace fails in iommufd_device_do_replace() or
iommufd_group_do_replace_reserved_iova(), the error paths remove the
ranges from the new hwpt's IOAS whether or not the IOAS is shared
between the old and new hwpt, which removes the ranges that the old hwpt
still needs.
For example, on x86 with intel-iommu, after a replace within a shared
IOAS fails with -ENODEV, IOMMU_IOAS_IOVA_RANGES goes from
0x0-0xfedfffff
0xfef00000-0xffffffffffff
to
0x0-0xffffffffffff
and IOMMU_IOAS_MAP at 0xfee00000 succeeds.
Remove the ranges on failure only when the replace installed them, and
look up the old hwpt_paging before the replace so that the error path
can compare the IOAS.
Fixes: e88d4ec154a8 ("iommufd: Add iommufd_device_replace()")
Assisted-by: LLM
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Link: https://patch.msgid.link/20260929031402.1998253-1-donggeunyoo.kernel@gmail.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
[ sashal: adjusted context: no attach_resv variable or pasid check in this tree, so the error-path IOAS guard uses hwpt_paging and old_hwpt_paging is looked up right after old_hwpt. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/iommufd/device.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index 5dc9fa269e3a8..fd07f7f25e13f 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -592,7 +592,8 @@ iommufd_group_do_replace_reserved_iova(struct iommufd_group *igroup,
return 0;
err_unresv:
- iommufd_group_remove_reserved_iova(igroup, hwpt_paging);
+ if (!old_hwpt_paging || hwpt_paging->ioas != old_hwpt_paging->ioas)
+ iommufd_group_remove_reserved_iova(igroup, hwpt_paging);
return rc;
}
@@ -625,6 +626,7 @@ iommufd_device_do_replace(struct iommufd_device *idev, ioasid_t pasid,
}
old_hwpt = igroup->hwpt;
+ old_hwpt_paging = find_hwpt_paging(old_hwpt);
if (hwpt_paging) {
rc = iommufd_group_do_replace_reserved_iova(igroup, hwpt_paging);
if (rc)
@@ -635,7 +637,6 @@ iommufd_device_do_replace(struct iommufd_device *idev, ioasid_t pasid,
if (rc)
goto err_unresv;
- old_hwpt_paging = find_hwpt_paging(old_hwpt);
if (old_hwpt_paging &&
(!hwpt_paging || hwpt_paging->ioas != old_hwpt_paging->ioas))
iommufd_group_remove_reserved_iova(igroup, old_hwpt_paging);
@@ -656,7 +657,8 @@ iommufd_device_do_replace(struct iommufd_device *idev, ioasid_t pasid,
/* Caller must destroy old_hwpt */
return old_hwpt;
err_unresv:
- if (hwpt_paging)
+ if (hwpt_paging &&
+ (!old_hwpt_paging || hwpt_paging->ioas != old_hwpt_paging->ioas))
iommufd_group_remove_reserved_iova(igroup, hwpt_paging);
err_unlock:
mutex_unlock(&idev->igroup->lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 497/816] rxrpc: Fix aborting in rxperf test server
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (495 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 496/816] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 498/816] rxrpc: Fix sendmsg length Greg Kroah-Hartman
` (323 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Marc Dionne,
Eric Dumazet, David S. Miller, Jakub Kicinski, Paolo Abeni,
Simon Horman, linux-afs, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells@redhat.com>
[ Upstream commit 7f15923909866e76608ea6474368570938e783fc ]
Fix rxperf_process_call() to always abort if it gets a send error rather
than only aborting on ENOMEM.
Fixes: 75bfdbf2fca3 ("rxrpc: Implement an in-kernel rxperf server for testing purposes")
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824091645.415423-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20261006133011.531806-7-dhowells@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/trace/events/rxrpc.h | 2 +-
net/rxrpc/rxperf.c | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index 5e29744e45037..a292b6f08258b 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -27,8 +27,8 @@
EM(afs_abort_unmarshal_error, "afs-unmarshal") \
/* rxperf errors */ \
EM(rxperf_abort_general_error, "rxperf-error") \
- EM(rxperf_abort_oom, "rxperf-oom") \
EM(rxperf_abort_op_not_supported, "rxperf-op-notsupp") \
+ EM(rxperf_abort_send_error, "rxperf-send-error") \
EM(rxperf_abort_unmarshal_error, "rxperf-unmarshal") \
/* RxKAD security errors */ \
EM(rxkad_abort_1_short_check, "rxkad1-short-check") \
diff --git a/net/rxrpc/rxperf.c b/net/rxrpc/rxperf.c
index c16afe540d09c..d7215f939bdb3 100644
--- a/net/rxrpc/rxperf.c
+++ b/net/rxrpc/rxperf.c
@@ -526,7 +526,7 @@ static int rxperf_process_call(struct rxperf_call *call)
ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
rxperf_notify_end_reply_tx);
if (ret < 0)
- return ret;
+ goto send_error;
reply_len -= len;
}
@@ -537,10 +537,11 @@ static int rxperf_process_call(struct rxperf_call *call)
msg.msg_flags = 0;
ret = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
rxperf_notify_end_reply_tx);
- if (ret == -ENOMEM)
- rxrpc_kernel_abort_call(rxperf_socket, call->rxcall,
- RXGEN_SS_MARSHAL, -ENOMEM,
- rxperf_abort_oom);
+ if (ret == 0)
+ return 0;
+send_error:
+ rxrpc_kernel_abort_call(rxperf_socket, call->rxcall, RXGEN_SS_MARSHAL,
+ ret, rxperf_abort_send_error);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 498/816] rxrpc: Fix sendmsg length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (496 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 497/816] rxrpc: Fix aborting in rxperf test server Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 499/816] irqchip/mst-intc: Validate the DT interrupt range Greg Kroah-Hartman
` (322 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Marc Dionne,
Jeffrey Altman, Eric Dumazet, David S. Miller, Jakub Kicinski,
Paolo Abeni, Simon Horman, linux-afs, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <dhowells@redhat.com>
[ Upstream commit ef369cacbd524931199078427ae152c63a826189 ]
rxrpc_send_data() is given two data lengths (len and msg->msg_iter.count)
and is inconsistent about how it uses them. Fix this by using len in
preference to msg->msg_iter.count. Also limit the amount copied to either
len or msg->msg_iter.count, whichever is smaller.
Note that, currently, all the callers have len and msg->msg_iter.count the
same and so the problem won't occur. This is a prerequisite for another
patch that fixes the handling of encryption errors.
Fixes: 382d7974de31 ("RxRPC: Use iov_iter_count() in rxrpc_send_data() instead of the len argument")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20261006133011.531806-8-dhowells@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Replaced the umin() context line with the tree's min_t(size_t, ...) form by taking the patch's if (len > 0) and min3(txb->space, len, msg_data_left(msg)) lines directly, with no other adaptation. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rxrpc/sendmsg.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index ea649144c49f0..6686fc99ec3b0 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -324,9 +324,9 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
ret = -EMSGSIZE;
if (call->tx_total_len != -1) {
- if (len - copied > call->tx_total_len)
+ if (len > call->tx_total_len)
goto maybe_error;
- if (!more && len - copied != call->tx_total_len)
+ if (!more && len != call->tx_total_len)
goto maybe_error;
}
@@ -345,7 +345,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
* the security header is going to be in the padded
* region (enc blocksize), but the trailer is not.
*/
- remain = more ? INT_MAX : msg_data_left(msg);
+ remain = more ? INT_MAX : len;
txb = call->conn->security->alloc_txbuf(call, remain, sk->sk_allocation);
if (!txb) {
ret = -ENOMEM;
@@ -359,8 +359,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
_debug("append");
/* append next segment of data to the current buffer */
- if (msg_data_left(msg) > 0) {
- size_t copy = min_t(size_t, txb->space, msg_data_left(msg));
+ if (len > 0) {
+ size_t copy = min3(txb->space, len, msg_data_left(msg));
_debug("add %zu", copy);
if (!copy_from_iter_full(txb->kvec[0].iov_base + txb->offset,
@@ -371,6 +371,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
txb->len += copy;
txb->offset += copy;
copied += copy;
+ len -= copy;
if (call->tx_total_len != -1)
call->tx_total_len -= copy;
}
@@ -382,8 +383,8 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
/* add the packet to the send queue if it's now full */
if (!txb->space ||
- (msg_data_left(msg) == 0 && !more)) {
- if (msg_data_left(msg) == 0 && !more)
+ (len == 0 && !more)) {
+ if (len == 0 && !more)
txb->flags |= RXRPC_LAST_PACKET;
else if (call->tx_top - call->acks_hard_ack <
call->tx_winsize)
@@ -398,7 +399,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
rxrpc_queue_packet(rx, call, txb, notify_end_tx);
call->tx_pending = NULL;
}
- } while (msg_data_left(msg) > 0);
+ } while (len > 0 && msg_data_left(msg) > 0);
success:
ret = copied;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 499/816] irqchip/mst-intc: Validate the DT interrupt range
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (497 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 498/816] rxrpc: Fix sendmsg length Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 500/816] ASoC: rt5645: Shut down the button timer on removal Greg Kroah-Hartman
` (321 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Thomas Gleixner,
Radu Rendec, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 16f25d326e5d3b9fd51bc5e3916ecbffbca63e7b ]
The driver takes an inclusive interrupt range from the device tree
without checking its endpoints. A reversed range wraps the unsigned
count calculation, and a range larger than MST_INTC_MAX_IRQS exceeds the
controller capacity used by the driver.
Reject these ranges before calculating nr_irqs or creating the domain.
Check the difference after ordering the endpoints so the validation
itself cannot wrap.
The issue was found by our static-analysis tool.
Fixes: ad4c938c92af ("irqchip/irq-mst: Add MStar interrupt controller support")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: gpt 5
Reviewed-by: Radu Rendec <radu@rendec.net>
Link: https://patch.msgid.link/20260920034236.16229-1-hppiscas@163.com
[ sashal: kept the branch's kzalloc(sizeof(*cd), GFP_KERNEL) allocation line instead of upstream's kzalloc_obj(*cd) as the patch context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-mst-intc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-mst-intc.c b/drivers/irqchip/irq-mst-intc.c
index d771eb0346128..be6e37badb359 100644
--- a/drivers/irqchip/irq-mst-intc.c
+++ b/drivers/irqchip/irq-mst-intc.c
@@ -263,6 +263,9 @@ static int __init mst_intc_of_init(struct device_node *dn,
of_property_read_u32_index(dn, "mstar,irqs-map-range", 1, &irq_end))
return -EINVAL;
+ if (irq_end < irq_start || irq_end - irq_start >= MST_INTC_MAX_IRQS)
+ return -EINVAL;
+
cd = kzalloc(sizeof(*cd), GFP_KERNEL);
if (!cd)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 500/816] ASoC: rt5645: Shut down the button timer on removal
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (498 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 499/816] irqchip/mst-intc: Validate the DT interrupt range Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 501/816] ublk: use global index for reported zones Greg Kroah-Hartman
` (320 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit f0ecc305442f20a6df2575943e9897825d80cc5d ]
jack_detect_work can rearm btn_check_timer, and the timer callback can
queue jack_detect_work. Deleting the timer before cancelling the work
does not break this cycle: an already running worker can rearm the timer
after timer_delete_sync() returns. The timer can then outlive removal.
Use timer_shutdown_sync() before cancelling the delayed work so that
subsequent attempts to rearm the timer are ignored. The IRQ producer has
already been removed at this point. Keep the restartable timer deletion
in the suspend path.
This issue was identified as part of our ongoing research while
reviewing kernel code.
Fixes: 7ff6319e7da5 ("ASoC: rt5645: use polling to support HS button")
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/179203261324.2681924.5002100194676410503.rt5645-button-timer@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Replaced del_timer_sync() with the older name in context, since the timer_delete_sync rename isn't present, while using timer_shutdown_sync() as upstream does. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5645.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index a7ac9971ae244..c963262056a71 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -18,6 +18,7 @@
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/regulator/consumer.h>
+#include <linux/timer.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -4287,10 +4288,10 @@ static void rt5645_i2c_remove(struct i2c_client *i2c)
free_irq(i2c->irq, rt5645);
/*
- * Since the rt5645_btn_check_callback() can queue jack_detect_work,
- * the timer need to be delted first
+ * The timer and jack_detect_work can rearm each other. Shut down the
+ * timer before cancelling the work.
*/
- del_timer_sync(&rt5645->btn_check_timer);
+ timer_shutdown_sync(&rt5645->btn_check_timer);
cancel_delayed_work_sync(&rt5645->jack_detect_work);
cancel_delayed_work_sync(&rt5645->rcclock_work);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 501/816] ublk: use global index for reported zones
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (499 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 500/816] ASoC: rt5645: Shut down the button timer on removal Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 502/816] tcp: use the echoed source route in cookie_v4_check() Greg Kroah-Hartman
` (319 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Ming Lei, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit 80897c7e5ae5c56f37a2eb004328edcb4da7cdd1 ]
ublk_report_zones() may split a zone report into multiple requests when
the number of zones exceeds the temporary buffer capacity. The index
passed to disk_report_zone() must refer to the zone position in the
whole report, rather than the position within the current request.
Currently, the per-request loop index is used as the callback index,
causing each chunk after the first one to restart from zero. This can
make userspace callbacks receive duplicate zone indices and may result
in blk_revalidate_disk_zones() updating incorrect entries in its zone
state array.
Use the number of zones already reported as the base index for each
request so that zone indices remain continuous across all chunks.
Fixes: 29802d7ca33b ("ublk: enable zoned storage support")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Tested-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Link: https://patch.msgid.link/20261011063555.1142277-13-tom.leiming@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Replaced the per-chunk loop index with done_zones in the zone callback, keeping this tree's cb(zone, done_zones, data) form because disk_report_zone() doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/ublk_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index ae954ee1e3529..443054f89244f 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -371,7 +371,7 @@ static int ublk_report_zones(struct gendisk *disk, sector_t sector,
if (!zone->len)
break;
- ret = cb(zone, i, data);
+ ret = cb(zone, done_zones, data);
if (ret)
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 502/816] tcp: use the echoed source route in cookie_v4_check()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (500 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 501/816] ublk: use global index for reported zones Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 503/816] pinctrl: stm32: Fix the unit of the hwspinlock timeout Greg Kroah-Hartman
` (318 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 54d574d4afd9de820c8a017665c8095f0f5fdbaa ]
When the ACK carries a source route option, cookie_v4_check() routes
the new socket to opt->faddr, where opt points to the options of the
received packet.
ip_options_compile() only fills faddr for options given by
setsockopt() (when called without an skb), so on receive faddr is 0
and the lookup is done for daddr 0, which gives a local route.
Use the options echoed by tcp_v4_save_options() instead, as
inet_csk_route_req() and inet_csk_route_child_sock() do with
ireq->ireq_opt. Read them after security_inet_conn_request(),
since CIPSO can replace ireq->ireq_opt there.
The route now goes to the first hop of the source route, so also
refuse a strict source route through a gateway, as
inet_csk_route_req() does.
Found by sashiko while reviewing the sk_mc_loop() fix.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261012101029.927296-3-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: adjusted the conflict context in cookie_v4_check(): dropped the missing treq local from the declarations and kept sk->sk_uid instead of the sk_uid(sk) helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/syncookies.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 43cf33f282c15..8177725e9dd22 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -404,11 +404,11 @@ static struct request_sock *cookie_tcp_check(struct net *net, struct sock *sk,
*/
struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
{
- struct ip_options *opt = &TCP_SKB_CB(skb)->header.h4.opt;
const struct tcphdr *th = tcp_hdr(skb);
struct tcp_sock *tp = tcp_sk(sk);
struct inet_request_sock *ireq;
struct net *net = sock_net(sk);
+ struct ip_options_rcu *opt;
struct request_sock *req;
struct sock *ret = sk;
struct flowi4 fl4;
@@ -447,6 +447,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
SKB_DR_SET(reason, SECURITY_HOOK);
goto out_free;
}
+ /* Load ireq->ireq_opt after the LSM hook, which can replace it. */
+ opt = rcu_dereference_protected(ireq->ireq_opt, true);
tcp_ao_syncookie(sk, skb, req, AF_INET);
@@ -459,7 +461,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
flowi4_init_output(&fl4, ireq->ir_iif, ireq->ir_mark,
ip_sock_rt_tos(sk), ip_sock_rt_scope(sk),
IPPROTO_TCP, inet_sk_flowi_flags(sk),
- opt->srr ? opt->faddr : ireq->ir_rmt_addr,
+ (opt && opt->opt.srr) ? opt->opt.faddr : ireq->ir_rmt_addr,
ireq->ir_loc_addr, th->source, th->dest, sk->sk_uid);
security_req_classify_flow(req, flowi4_to_flowi_common(&fl4));
rt = ip_route_output_key(net, &fl4);
@@ -467,6 +469,12 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
SKB_DR_SET(reason, IP_OUTNOROUTES);
goto out_free;
}
+ /* Same check as in inet_csk_route_req(). */
+ if (opt && opt->opt.is_strictroute && rt->rt_uses_gateway) {
+ ip_rt_put(rt);
+ SKB_DR_SET(reason, IP_OUTNOROUTES);
+ goto out_free;
+ }
/* Try to redo what tcp_v4_send_synack did. */
req->rsk_window_clamp = READ_ONCE(tp->window_clamp) ? :
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 503/816] pinctrl: stm32: Fix the unit of the hwspinlock timeout
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (501 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 502/816] tcp: use the echoed source route in cookie_v4_check() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 504/816] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912) Greg Kroah-Hartman
` (317 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ju Nan, Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ju Nan <junan76@163.com>
[ Upstream commit 544b3f8042dd7c18baa48dcb1a393ff8b6742322 ]
HWSPNLCK_TIMEOUT is passed to hwspin_lock_timeout_in_atomic(), whose
timeout argument is in milliseconds, not microseconds:
atomic_delay += HWSPINLOCK_RETRY_DELAY_US;
if (atomic_delay > to * 1000)
return -ETIMEDOUT;
The hwspinlock core documents this explicitly:
If the mode is HWLOCK_IN_ATOMIC (called from an atomic context) the
timeout is handled with busy-waiting delays, hence shall not exceed
few msecs.
Fixes: 290a9f937e5a ("pinctrl: stm32: use the hwspin_lock_timeout_in_atomic() API")
Signed-off-by: Ju Nan <junan76@163.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
[ sashal: Dropped the two hunks for stm32_pconf_set_advcfgr() and stm32_pconf_set_skew_delay(), which don't exist here, and adjusted context to rename the macro at the five remaining call sites. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/stm32/pinctrl-stm32.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 9e8b8b82c232b..06431e55fa615 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -68,7 +68,7 @@
#define gpio_range_to_bank(chip) \
container_of(chip, struct stm32_gpio_bank, range)
-#define HWSPNLCK_TIMEOUT 1000 /* usec */
+#define HWSPNLCK_TIMEOUT_MS 1
static const char * const stm32_gpio_functions[] = {
"gpio", "af0", "af1",
@@ -436,7 +436,7 @@ static int stm32_gpio_domain_activate(struct irq_domain *d,
if (pctl->hwlock) {
ret = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (ret) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
return ret;
@@ -770,7 +770,7 @@ static int stm32_pmx_set_mode(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
@@ -902,7 +902,7 @@ static int stm32_pconf_set_driving(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
@@ -953,7 +953,7 @@ static int stm32_pconf_set_speed(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
@@ -1004,7 +1004,7 @@ static int stm32_pconf_set_bias(struct stm32_gpio_bank *bank,
if (pctl->hwlock) {
err = hwspin_lock_timeout_in_atomic(pctl->hwlock,
- HWSPNLCK_TIMEOUT);
+ HWSPNLCK_TIMEOUT_MS);
if (err) {
dev_err(pctl->dev, "Can't get hwspinlock\n");
goto unlock;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 504/816] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912)
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (502 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 503/816] pinctrl: stm32: Fix the unit of the hwspinlock timeout Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 505/816] bpf: Use the frame mem type in devmap egress XDP Greg Kroah-Hartman
` (316 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Viktor Menshin, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viktor Menshin <ripeeerr@gmail.com>
[ Upstream commit 2fc28b1186d6fce8b046e6118072cf3ca32f2960 ]
Commit 3a3e810e9108 ("ALSA: hda/realtek: Add quirk for Lenovo Xiaoxin
14 GT") added a quirk mapping SSID 17aa:3912 to
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, chosen by analogy with
neighboring SSIDs (0x390d, 0x3911, 0x391a) without being verified on
hardware, as noted in that commit's own message.
I have since tested it on the actual hardware (Lenovo Xiaoxin Pro 14
ASP10, same 17aa:3912 SSID) and confirmed it does not fix the reported
issue. ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN only repoints pin 0x17
and the preferred DAC pairs for the bass speaker; it does not touch
the codec's vendor processing coefficients. The actual symptom -
constant electrical hiss/crackle on both the headphone jack and the
internal speakers, independent of volume - is unrelated to pin/DAC
routing and is also present on stock Windows before the Realtek
driver is installed, which points at those coefficients being left
at their power-on default.
To find the correct values, I passed the physical HD Audio controller
through to a Windows 10 VM (VFIO, with QEMU patched to log CORB verb
traffic) and captured the coefficient writes the vendor Realtek driver
performs at init. Replaying a single one of them on Linux via hda-verb
reproducibly eliminates the headphone jack noise:
hda-verb /dev/snd/hwC#D0 0x20 SET_COEF_INDEX 0x36
hda-verb /dev/snd/hwC#D0 0x20 SET_PROC_COEF 0x77d7
This has held up across reboots and kernel updates for several weeks
(applied via a small systemd oneshot unit while testing).
Add a dedicated fixup that performs this coefficient write and chains
it with the existing ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN (which may
still be relevant for the bass speaker pin wiring on this board), and
point the 17aa:3912 quirk entry at it instead.
Honesty note: this fixes the headphone jack. The internal speakers
still have noise under certain conditions (notably worse on AC power)
that I have not been able to isolate via coefficient-table replay;
that part remains open. Sending what is verified to work rather than
holding this back.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221203
Fixes: 3a3e810e9108 ("ALSA: hda/realtek: Add quirk for Lenovo Xiaoxin 14 GT")
Signed-off-by: Viktor Menshin <ripeeerr@gmail.com>
Link: https://patch.msgid.link/20261015132157.57198-1-ripeeerr@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Moved the new function to sit before alc295_fixup_dell_inspiron_top_speakers() since the upstream anchor is missing, and applied the edits to patch_realtek.c with adjusted context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/patch_realtek.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b18eb7974c8eb..726fc58b17ee7 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7718,6 +7718,28 @@ static void alc287_fixup_yoga9_14iap7_bass_spk_pin(struct hda_codec *codec,
}
}
+/*
+ * The Lenovo Xiaoxin 14 GT (SSID 17aa:3912) uses the same bass-speaker
+ * pin wiring as its 0x390d/0x3911/0x391a siblings, but on this board the
+ * codec's vendor processing coefficients (node 0x20) are left at their
+ * power-on default instead of being programmed the way the vendor
+ * (Windows) driver programs them. That leaves audible hiss/crackle on
+ * both the headphone jack and the internal speakers, independent of
+ * volume, regardless of which pin/DAC routing is used.
+ *
+ * This single coefficient write was captured from the vendor driver's
+ * own init sequence (via a VFIO pass-through of the physical codec to a
+ * Windows VM) and confirmed to eliminate the headphone jack noise.
+ */
+static void alc287_fixup_lenovo_xiaoxin_14gt_hp_noise(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+{
+ if (action != HDA_FIXUP_ACT_INIT)
+ return;
+
+ alc_write_coef_idx(codec, 0x36, 0x77d7);
+}
+
static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
@@ -8225,6 +8247,7 @@ enum {
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK,
ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN,
+ ALC287_FIXUP_LENOVO_XIAOXIN_14GT_HP_NOISE,
ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
ALC236_FIXUP_DELL_DUAL_CODECS,
ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
@@ -10552,6 +10575,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC287_FIXUP_CS35L41_I2C_2,
},
+ [ALC287_FIXUP_LENOVO_XIAOXIN_14GT_HP_NOISE] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc287_fixup_lenovo_xiaoxin_14gt_hp_noise,
+ .chained = true,
+ .chain_id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN,
+ },
[ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc295_fixup_dell_inspiron_top_speakers,
@@ -11707,7 +11736,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
SND_PCI_QUIRK(0x17aa, 0x3911, "Lenovo Yoga Pro 7 14IAH10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
- SND_PCI_QUIRK(0x17aa, 0x3912, "Lenovo Xiaoxin 14 GT", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
+ SND_PCI_QUIRK(0x17aa, 0x3912, "Lenovo Xiaoxin 14 GT", ALC287_FIXUP_LENOVO_XIAOXIN_14GT_HP_NOISE),
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 505/816] bpf: Use the frame mem type in devmap egress XDP
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (503 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 504/816] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912) Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 506/816] bpf: Dont hand out a linked element as extra element Greg Kroah-Hartman
` (315 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit b3ca872947ef322c475ceaa7a76a9ebb3356152e ]
A devmap egress program that removes a whole fragment of a redirected
xdp_frame with bpf_xdp_adjust_tail() or bpf_xdp_pull_data() frees it
with page_frag_free() whatever the frame's memory type is. For a
MEM_TYPE_PAGE_POOL frame from a page_pool based driver this drops the
page reference owned by the pool while the pool still accounts the
fragment ("page_pool leak" bad page, leaked pp reference).
kernel/bpf/devmap.c:dev_map_bpf_prog_run() points xdp.rxq at an
on-stack
struct xdp_rxq_info rxq = { .dev = rx_dev };
whose mem.type is 0, i.e. MEM_TYPE_PAGE_SHARED, and
net/core/filter.c:bpf_xdp_shrink_data() releases frags according to
rxq->mem.type. cpumap, which runs programs on xdp_frames the same way,
already copies xdpf->mem_type into its private rxq for each frame.
With 9000 byte frames from virtio_net and an egress program that cuts the
fragments off:
BUG: Bad page state in process swapper/3 pfn:10660b
page dumped because: page_pool leak
bad_page+0xbd/0x190
__free_frozen_pages+0x5c7/0x900
bpf_xdp_adjust_tail+0x3be/0x480
bpf_prog_dad43f894a3faff7_egress+0x15c/0x1cd
dev_map_bpf_prog_run+0x288/0x610
The pool waits for these pages for ever when its device is gone. That is
the harmless case. A page of the pool can hold more than one fragment
while its refcount is 1: the first page_frag_free() frees it under the
fragment which is still in use, and the second one runs into
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
kernel BUG at include/linux/mm.h:1846!
veth is not affected. It takes references of its own on the pages and
redirects the frame as MEM_TYPE_PAGE_SHARED.
Fix by setting rxq.mem.type from each frame before running the devmap
program, as cpu_map_bpf_prog_run_xdp() does.
Fixes: ca9984c5f0ab ("bpf: devmap: provide rxq after redirect")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-2-alexei.starovoitov@gmail.com
[ sashal: Changed rxq.mem.type = xdpf->mem_type; to rxq.mem = xdpf->mem; because this tree's xdp_frame has a struct xdp_mem_info mem member instead of a flat mem_type field. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/devmap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index 1c64c4cff41ec..368c9d50aa8bb 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -348,6 +348,7 @@ static int dev_map_bpf_prog_run(struct bpf_prog *xdp_prog,
xdp_convert_frame_to_buff(xdpf, &xdp);
xdp.txq = &txq;
+ rxq.mem = xdpf->mem;
xdp.rxq = &rxq;
act = bpf_prog_run_xdp(xdp_prog, &xdp);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 506/816] bpf: Dont hand out a linked element as extra element
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (504 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 505/816] bpf: Use the frame mem type in devmap egress XDP Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 507/816] bpf: Keep a program until its bpf_wq callback has ended Greg Kroah-Hartman
` (314 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit ccb88db8dac8fabde58656d5d4a33711e89c480a ]
When htab_map_update_elem() replaces an element of a preallocated map,
alloc_htab_elem() takes the spare element of this cpu and puts the old
element into the per-cpu slot right away, long before the old element is
unlinked from its bucket. The bucket lock disables interrupts, but it
does not keep out an NMI, or a tracing program on the return of
alloc_htab_elem(). bpf_prog_active only helps if both programs are
kprobe, tracepoint or perf_event programs. A program that updates an
existing key in another bucket of the same map gets to use the slot:
htab_map_update_elem(k1) tc, xdp, fentry, raw_tp, ...
alloc_htab_elem()
l_new = *pl_new
*pl_new = l_old still linked in bucket 1
<NMI>
htab_map_update_elem(k2) perf_event program
l_new = *pl_new the l_old of the outer update
hlist_nulls_add_head_rcu(l_new, bucket 2)
hlist_nulls_del_rcu(k2's old element)
</NMI>
hlist_nulls_add_head_rcu(l_new, bucket 1)
hlist_nulls_del_rcu(l_old)
If l_old was the first element of bucket 1, the outer add points its pprev
at l_new, and the delete takes it out of bucket 1 only. l_new->next now
leads into bucket 2, where l_old stays with a poisoned pprev, on which a
delete of k2 crashes. If it was not the first, the delete takes it out of
bucket 2: k2 is gone from the map, and the chain of bucket 1 still contains
l_old, whose next pointer leads into bucket 2.
Either way a walk of bucket 1 ends on the nulls value of bucket 2.
lookup_nulls_elem_raw() restarts whenever that happens, so every lookup in
bucket 1 which does not find its key spins forever:
rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
__htab_map_lookup_elem+0x354/0x4d0
BUG: KASAN: wild-memory-access in htab_map_delete_elem+0x30c/0x670
Write of size 8 at addr dead000000000122 by task extra/102
An NMI between the load and the store of the slot makes both updates use
the same element, with much the same result.
Empty the slot when the spare element is taken, in a way that is atomic
on this cpu, and put the old element in only after it has been unlinked
and its timers and the like have been cancelled. A nested update that
finds the slot empty, which is the case that corrupted the map, fails with
-EBUSY.
Fixes: 8c290e60fa2a ("bpf: fix hashmap extra_elems logic")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-5-alexei.starovoitov@gmail.com
[ sashal: Context lines adapted to the older tree (check_and_free_fields, old_map_ptr handling, four-argument htab_unlock_bucket), with fix lines identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/hashtab.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index 98308f3a7f6e9..a6ffc4a8dc43f 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -1114,11 +1114,17 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,
if (prealloc) {
if (old_elem) {
/* if we're updating the existing element,
- * use per-cpu extra elems to avoid freelist_pop/push
+ * use per-cpu extra elems to avoid freelist_pop/push.
+ * The caller puts old_elem into the slot once it is
+ * unlinked. Until then the slot is empty for an NMI
+ * or a kprobe that updates this map on this cpu.
*/
pl_new = this_cpu_ptr(htab->extra_elems);
- l_new = *pl_new;
- *pl_new = old_elem;
+ l_new = READ_ONCE(*pl_new);
+ do {
+ if (!l_new)
+ return ERR_PTR(-EBUSY);
+ } while (!try_cmpxchg_local(pl_new, &l_new, NULL));
} else {
struct pcpu_freelist_node *l;
@@ -1281,16 +1287,19 @@ static long htab_map_update_elem(struct bpf_map *map, void *key, void *value,
if (l_old) {
hlist_nulls_del_rcu(&l_old->hash_node);
- /* l_old has already been stashed in htab->extra_elems, free
- * its special fields before it is available for reuse. Also
- * save the old map pointer in htab of maps before unlock
- * and release it after unlock.
+ /*
+ * l_old replaces the extra element that alloc_htab_elem() took.
+ * Free its special fields first: once it is in the slot, the
+ * next update on this cpu can reuse it. Also save the old map
+ * pointer in htab of maps before unlock and release it after
+ * unlock.
*/
old_map_ptr = NULL;
if (htab_is_prealloc(htab)) {
if (map->ops->map_fd_put_ptr)
old_map_ptr = fd_htab_map_get_ptr(map, l_old);
check_and_free_fields(htab, l_old);
+ WRITE_ONCE(*this_cpu_ptr(htab->extra_elems), l_old);
}
}
htab_unlock_bucket(htab, b, hash, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 507/816] bpf: Keep a program until its bpf_wq callback has ended
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (505 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 506/816] bpf: Dont hand out a linked element as extra element Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 508/816] bpf: Count sleepable callbacks as sleepable map users Greg Kroah-Hartman
` (313 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 1e28a5e52d32b7d3f4c9fb24898774f941166d2b ]
bpf_wq_work() runs the callback under rcu_read_lock_trace() only, since
the callback may sleep. The program it belongs to need not be sleepable,
and such a program is freed behind a plain RCU grace period. The
reference that the bpf_wq holds is dropped when the map element goes, or
when another callback is set, no matter whether the work is running.
If that was the last reference the program is freed under the running
callback, and the worker goes on in the freed JIT image:
Oops: int3: 0000 [#1] SMP NOPTI
RIP: 0010:0xffffffffc0600947
All it takes is to close the map and the program while the callback runs.
Note in the program that it has a callback that runs sleepable, and wait
for an RCU Tasks Trace grace period, which implies a plain one, before
such a program is freed. Let bpf_wq_work() enter its read side critical
section before it reads callback_fn.
bpf_task_work holds a reference to the program until the callback is done.
Fixes: 8e83da9732d9 ("bpf: add bpf_wq_start")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-23-alexei.starovoitov@gmail.com
[ sashal: Replaced the nonexistent is_async_cb_sleepable() call with is_bpf_wq_set_callback_impl_kfunc(insn->imm), and dropped the tramp_linked and rcu_tasks free-path hunk that this tree lacks. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/bpf.h | 10 ++++++++++
kernel/bpf/helpers.c | 9 ++++++---
kernel/bpf/syscall.c | 2 +-
kernel/bpf/verifier.c | 2 ++
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 59661363d08f6..98f816a37d3be 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1508,6 +1508,7 @@ struct bpf_prog_aux {
bool offload_requested; /* Program is bound and offloaded to the netdev. */
bool attach_btf_trace; /* true if attaching to BTF-enabled raw tp */
bool attach_tracing_prog; /* true if tracing another tracing program */
+ bool sleepable_async_cb; /* has a bpf_wq or bpf_task_work callback */
bool func_proto_unreliable;
bool tail_call_reachable;
bool xdp_has_frags;
@@ -1619,6 +1620,15 @@ struct bpf_prog {
};
};
+/*
+ * Does the program, or a callback of it, run under RCU Tasks Trace protection
+ * only, outside of any RCU read side critical section?
+ */
+static inline bool bpf_prog_runs_sleepable(const struct bpf_prog *prog)
+{
+ return prog->sleepable || prog->aux->sleepable_async_cb;
+}
+
struct bpf_array_aux {
/* Programs with direct jumps into programs part of this array. */
struct list_head poke_progs;
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index bcb2770efac4d..7ae6acfc14d36 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -1209,9 +1209,12 @@ static void bpf_wq_work(struct work_struct *work)
BTF_TYPE_EMIT(struct bpf_wq);
+ /* keeps the program that callback_fn belongs to */
+ rcu_read_lock_trace();
+
callback_fn = READ_ONCE(cb->callback_fn);
if (!callback_fn)
- return;
+ goto out;
if (map->map_type == BPF_MAP_TYPE_ARRAY) {
struct bpf_array *array = container_of(map, struct bpf_array, map);
@@ -1223,12 +1226,12 @@ static void bpf_wq_work(struct work_struct *work)
key = value - round_up(map->key_size, 8);
}
- rcu_read_lock_trace();
- migrate_disable();
+ migrate_disable();
callback_fn((u64)(long)map, (u64)(long)key, (u64)(long)value, 0, 0);
migrate_enable();
+out:
rcu_read_unlock_trace();
}
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index cbdea70fd93a3..3e084cf77d134 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2212,7 +2212,7 @@ static void __bpf_prog_put_noref(struct bpf_prog *prog, bool deferred)
btf_put(prog->aux->attach_btf);
if (deferred) {
- if (prog->sleepable)
+ if (bpf_prog_runs_sleepable(prog))
call_rcu_tasks_trace(&prog->aux->rcu, __bpf_prog_put_rcu);
else
call_rcu(&prog->aux->rcu, __bpf_prog_put_rcu);
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index ffd1f13925c29..d8317cef6e8ab 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -10174,6 +10174,8 @@ static int push_callback_call(struct bpf_verifier_env *env, struct bpf_insn *ins
is_bpf_wq_set_callback_impl_kfunc(insn->imm));
if (IS_ERR(async_cb))
return PTR_ERR(async_cb);
+ if (is_bpf_wq_set_callback_impl_kfunc(insn->imm))
+ env->prog->aux->sleepable_async_cb = true;
callee = async_cb->frame[0];
callee->async_entry_cnt = state->frame[0]->async_entry_cnt + 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 508/816] bpf: Count sleepable callbacks as sleepable map users
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (506 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 507/816] bpf: Keep a program until its bpf_wq callback has ended Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 509/816] bpf: Assume no bounds for buffers behind a tail call Greg Kroah-Hartman
` (312 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 927c9c985f3ef4d30c086884b7e0ecb933f742ef ]
map->sleepable_refcnt tells bpf_map_fd_put_ptr() whether an inner map that
is taken out of its outer map has to wait for an RCU Tasks Trace grace
period as well. It counts the sleepable programs that use the outer map.
The bpf_wq or bpf_task_work callback of a program that is not sleepable
runs under rcu_read_lock_trace() only, and is not counted.
Such a callback can look an inner map up and keep it while user space
deletes it from the outer map. The inner map is freed behind a plain RCU
grace period, under the callback:
BUG: KASAN: slab-use-after-free in array_map_update_elem+0x6bc/0x7d0
Count a program with such a callback. The maps are bound before the
verifier meets the callback, so raise the count of those that are bound
when it does.
Fixes: 8e83da9732d9 ("bpf: add bpf_wq_start")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-24-alexei.starovoitov@gmail.com
[ sashal: Adapted to missing helpers by keeping the local is_bpf_wq_set_callback_impl_kfunc() check and is_may_goto_insn() name, and by editing add_used_map_from_fd() without the check_map_prog_compatibility() context. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/core.c | 2 +-
kernel/bpf/syscall.c | 2 +-
kernel/bpf/verifier.c | 17 +++++++++++++++--
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index df529db44f35c..de2c0ffb30252 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -2873,7 +2873,7 @@ void __bpf_free_used_maps(struct bpf_prog_aux *aux,
bool sleepable;
u32 i;
- sleepable = aux->prog->sleepable;
+ sleepable = bpf_prog_runs_sleepable(aux->prog);
for (i = 0; i < len; i++) {
map = used_maps[i];
if (map->ops->map_poke_untrack)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 3e084cf77d134..8fd823047c3a0 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -5754,7 +5754,7 @@ static int bpf_prog_bind_map(union bpf_attr *attr)
/* The bpf program will not access the bpf map, but for the sake of
* simplicity, increase sleepable_refcnt for sleepable program as well.
*/
- if (prog->sleepable)
+ if (bpf_prog_runs_sleepable(prog))
atomic64_inc(&map->sleepable_refcnt);
memcpy(used_maps_new, used_maps_old,
sizeof(used_maps_old[0]) * prog->aux->used_map_cnt);
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index d8317cef6e8ab..1404e842580ba 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -547,6 +547,19 @@ static bool is_async_callback_calling_insn(struct bpf_insn *insn)
(bpf_pseudo_kfunc_call(insn) && is_async_callback_calling_kfunc(insn->imm));
}
+/* From here on the maps of the program count it as a sleepable user. */
+static void mark_sleepable_async_cb(struct bpf_verifier_env *env)
+{
+ int i;
+
+ if (bpf_prog_runs_sleepable(env->prog))
+ return;
+
+ env->prog->aux->sleepable_async_cb = true;
+ for (i = 0; i < env->used_map_cnt; i++)
+ atomic64_inc(&env->used_maps[i]->sleepable_refcnt);
+}
+
static bool is_may_goto_insn(struct bpf_insn *insn)
{
return insn->code == (BPF_JMP | BPF_JCOND) && insn->src_reg == BPF_MAY_GOTO;
@@ -10175,7 +10188,7 @@ static int push_callback_call(struct bpf_verifier_env *env, struct bpf_insn *ins
if (IS_ERR(async_cb))
return PTR_ERR(async_cb);
if (is_bpf_wq_set_callback_impl_kfunc(insn->imm))
- env->prog->aux->sleepable_async_cb = true;
+ mark_sleepable_async_cb(env);
callee = async_cb->frame[0];
callee->async_entry_cnt = state->frame[0]->async_entry_cnt + 1;
@@ -19651,7 +19664,7 @@ static int add_used_map_from_fd(struct bpf_verifier_env *env, int fd, bool *reus
return -E2BIG;
}
- if (env->prog->sleepable)
+ if (bpf_prog_runs_sleepable(env->prog))
atomic64_inc(&map->sleepable_refcnt);
/* hold the map. If the program is rejected by verifier,
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 509/816] bpf: Assume no bounds for buffers behind a tail call
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (507 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 508/816] bpf: Count sleepable callbacks as sleepable map users Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 510/816] bpf: Assume no bounds for a writable tp with tail calls Greg Kroah-Hartman
` (311 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 7fa323d77688e8b62b2f0bf6c3208a2c96d4a5e7 ]
The bpf_map_elem, bpf_sk_storage_map and sockmap iterators hand the key
and the value of an element to the program as buffers. The verifier notes
how far a program reaches into them, and the iterator compares that with
the map when the program is attached. A program that does not touch the
buffers passes. It can tail-call another program of the same target,
which gets the same context, and whose reach nobody compares with the
map:
BUG: KASAN: slab-out-of-bounds in ___bpf_prog_run+0xa46a/0xae80
The program array can be filled at any time, so there is nothing to look
at when the link is made. For the same reason a program with a tail call
is taken to use the whole stack and the whole packet. Take it to reach
as far as can be into the buffers as well, so that these iterators refuse
it with -EACCES.
Fixes: d6c4503cc296 ("bpf: Implement bpf iterator for hash maps")
Fixes: 5ce6e77c7edf ("bpf: Implement bpf iterator for sock local storage map")
Fixes: 0365351524d7 ("net: Allow iterating sockmap and sockhash")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-26-alexei.starovoitov@gmail.com
[ sashal: Adapted the hunk to the older code layout, where the tail-call fixup lives in do_misc_fixups() in the verifier source, with the same two added lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1404e842580ba..15a02a4c08d22 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -21566,6 +21566,8 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
if (!allow_tail_call_in_subprogs(env))
prog->aux->stack_depth = MAX_BPF_STACK;
prog->aux->max_pkt_offset = MAX_PACKET_OFF;
+ prog->aux->max_rdonly_access = U32_MAX;
+ prog->aux->max_rdwr_access = U32_MAX;
/* mark bpf_tail_call as different opcode to avoid
* conditional branch in the interpreter for every normal
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 510/816] bpf: Assume no bounds for a writable tp with tail calls
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (508 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 509/816] bpf: Assume no bounds for buffers behind a tail call Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 511/816] bpf: Dont let an extension reach further into the context than its target Greg Kroah-Hartman
` (310 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit cd0490e671d70326d70c7d36e82388939fd9b071 ]
A writable raw tracepoint hands a buffer to the program. The verifier
notes how far the program reaches into it, and bpf_probe_register() refuses
a program that reaches further than the tracepoint allows. A program that
does not touch the buffer passes, and can tail-call one of its type that
reads and writes behind it.
Take a BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE program with a tail call to
reach as far as can be, as for the stack, the packet and the buffers of
iterators. It cannot be attached any more. Plain raw tracepoint programs,
for which the limit is zero, cannot get at the buffer, and a tail call
stays within one type: they are left alone.
Fixes: 9df1c28bb752 ("bpf: add writable context for raw tracepoints")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017163745.3341787-28-alexei.starovoitov@gmail.com
[ sashal: Moved the tail_call fixup hunk from fixups.c's bpf_do_misc_fixups() to verifier.c's do_misc_fixups(), since this tree has no fixups.c. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 15a02a4c08d22..34b82d3eff66f 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -21568,6 +21568,8 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
prog->aux->max_pkt_offset = MAX_PACKET_OFF;
prog->aux->max_rdonly_access = U32_MAX;
prog->aux->max_rdwr_access = U32_MAX;
+ if (prog->type == BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE)
+ prog->aux->max_tp_access = U32_MAX;
/* mark bpf_tail_call as different opcode to avoid
* conditional branch in the interpreter for every normal
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 511/816] bpf: Dont let an extension reach further into the context than its target
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (509 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 510/816] bpf: Assume no bounds for a writable tp with tail calls Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 512/816] bpf, cpumap: Hold the device of frames in the queue Greg Kroah-Hartman
` (309 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit fcbfa99aa657627528b75e7dc1023bcb0b84e558 ]
How large the context of a raw tracepoint, tracepoint or syscall program
is depends on what the program is attached to, or is run with.
bpf_probe_register(), perf_event_set_bpf_prog() and the test runs compare
that with max_ctx_offset of the program.
An extension of the program, or of one of its global functions, gets the
same context. How far it reaches is noted in its own max_ctx_offset, which
nobody looks at. On a tracepoint with one argument it reads the stack
behind the arguments, in a test run the memory behind the context, or
from NULL if there is none:
BUG: KASAN: stack-out-of-bounds in bpf_prog_954b5d2051843629_ts28_ext_far+0x7e/0x113
Read of size 8 at addr ffffc90000def7b8 by task ts28/104
BUG: KASAN: slab-out-of-bounds in bpf_prog_954b5d2051843629_ts28_ext_far+0x7e/0x113
Read of size 8 at addr ffff88810712c3e8 by task ts28/104
Refuse to attach an extension that reaches further than the program which
it extends. A program that leaves the context to its extensions has to
touch as much of it as they do.
Fixes: be8704ff07d2 ("bpf: Introduce dynamic program extensions")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-3-alexei.starovoitov@gmail.com
[ sashal: Dropped the missing kprobe_write_ctx context block, so the new max_ctx_offset check for EXT programs is inserted after the trampoline/tgt_prog selection instead. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/syscall.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 8fd823047c3a0..2626189f746ba 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -3452,6 +3452,19 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog,
tr = prog->aux->dst_trampoline;
tgt_prog = prog->aux->dst_prog;
}
+ /*
+ * The size of these contexts depends on what the program is attached
+ * to, or run with. That is compared with max_ctx_offset of the program,
+ * and nobody looks at the one of its extensions.
+ */
+ if (prog->type == BPF_PROG_TYPE_EXT &&
+ (tgt_prog->type == BPF_PROG_TYPE_RAW_TRACEPOINT ||
+ tgt_prog->type == BPF_PROG_TYPE_TRACEPOINT ||
+ tgt_prog->type == BPF_PROG_TYPE_SYSCALL) &&
+ prog->aux->max_ctx_offset > tgt_prog->aux->max_ctx_offset) {
+ err = -EINVAL;
+ goto out_unlock;
+ }
err = bpf_link_prime(&link->link.link, &link_primer);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 512/816] bpf, cpumap: Hold the device of frames in the queue
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (510 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 511/816] bpf: Dont let an extension reach further into the context than its target Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 513/816] bpf: Let bpf_dynptr_write() mark a global function Greg Kroah-Hartman
` (308 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit f99351272933ba2e1221484a5e53b7a5d2c035f0 ]
A frame that is redirected to another CPU waits in the queue of the cpumap
entry with a plain pointer to the device it came from, and an skb from
generic XDP with skb->dev. Nothing keeps that device. Closing and
unregistering it waits for its NAPI and for RCU, but not for the kthread
of the entry. If the kthread is late by more than that, since its CPU is
busy with something of a higher priority, it builds skbs for a device that
has been freed and hands them to the stack:
BUG: KASAN: use-after-free in dev_gro_receive+0x1f51/0x2b30
Read of size 8 at addr ffff88800a7340b0 by task cpumap/1/map:1/54
Take a reference to the device for each entry of the queue. The kthread
cannot drop it at the end of the batch, since its GRO node may keep the skb
for longer. Let it note the devices and drop the references behind a full
GRO flush, which it does whenever the queue is empty, and from now on also
when it has noted about 2048 of them.
A device whose frames are stuck in a queue is now unregistered only when
the kthread has got to them. RTNL is not held meanwhile, but if the device
goes with its network namespace, the cleanup of all namespaces waits.
Fixes: 1c601d829ab0 ("bpf: cpumap xdp_buff to skb conversion and allocation")
Fixes: 11941f8a8536 ("bpf: cpumap: Implement generic cpumap")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-8-alexei.starovoitov@gmail.com
[ sashal: Sized the held-device array to CPUMAP_BATCH (8) instead of upstream's 2048, and drop the references right after netif_receive_skb_list(), since this tree's cpumap has no GRO. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/cpumap.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index a2f46785ac3b3..c3a994112a470 100644
--- a/kernel/bpf/cpumap.c
+++ b/kernel/bpf/cpumap.c
@@ -44,6 +44,7 @@
*/
#define CPU_MAP_BULK_SIZE 8 /* 8 == one cacheline on 64-bit archs */
+#define CPUMAP_BATCH 8
struct bpf_cpu_map_entry;
struct bpf_cpu_map;
@@ -71,6 +72,13 @@ struct bpf_cpu_map_entry {
struct completion kthread_running;
struct rcu_work free_work;
+
+ /*
+ * Every frame and skb in the queue holds a reference to its device.
+ * The kthread keeps it until the batch has been handed to the stack.
+ */
+ struct net_device *held[CPUMAP_BATCH];
+ u32 nr_held;
};
struct bpf_cpu_map {
@@ -126,9 +134,11 @@ static void __cpu_map_ring_cleanup(struct ptr_ring *ring)
WARN_ON_ONCE(1);
if (unlikely(__ptr_test_bit(0, &ptr))) {
__ptr_clear_bit(0, &ptr);
+ dev_put(((struct sk_buff *)ptr)->dev);
kfree_skb(ptr);
continue;
}
+ dev_put(((struct xdp_frame *)ptr)->dev_rx);
xdp_return_frame(ptr);
}
}
@@ -232,8 +242,6 @@ static int cpu_map_bpf_prog_run_xdp(struct bpf_cpu_map_entry *rcpu,
return nframes;
}
-#define CPUMAP_BATCH 8
-
static int cpu_map_bpf_prog_run(struct bpf_cpu_map_entry *rcpu, void **frames,
int xdp_n, struct xdp_cpumap_stats *stats,
struct list_head *list)
@@ -314,10 +322,12 @@ static int cpu_map_kthread_run(void *data)
struct sk_buff *skb = f;
__ptr_clear_bit(0, &skb);
+ rcpu->held[rcpu->nr_held++] = skb->dev;
list_add_tail(&skb->list, &list);
continue;
}
+ rcpu->held[rcpu->nr_held++] = ((struct xdp_frame *)f)->dev_rx;
frames[xdp_n++] = f;
page = virt_to_page(f);
@@ -362,6 +372,8 @@ static int cpu_map_kthread_run(void *data)
sched, &stats);
netif_receive_skb_list(&list);
+ while (rcpu->nr_held)
+ dev_put(rcpu->held[--rcpu->nr_held]);
local_bh_enable(); /* resched point, may call do_softirq() */
}
__set_current_state(TASK_RUNNING);
@@ -686,12 +698,14 @@ static void bq_flush_to_queue(struct xdp_bulk_queue *bq)
for (i = 0; i < bq->count; i++) {
struct xdp_frame *xdpf = bq->q[i];
- int err;
- err = __ptr_ring_produce(q, xdpf);
- if (err) {
+ if (__ptr_ring_full(q)) {
drops++;
xdp_return_frame_rx_napi(xdpf);
+ } else {
+ /* The device cannot go before the flush, from now on it can */
+ dev_hold(xdpf->dev_rx);
+ __ptr_ring_produce(q, xdpf);
}
processed++;
}
@@ -749,11 +763,15 @@ int cpu_map_generic_redirect(struct bpf_cpu_map_entry *rcpu,
__skb_pull(skb, skb->mac_len);
skb_set_redirected(skb, false);
+ dev_hold(skb->dev);
__ptr_set_bit(0, &skb);
ret = ptr_ring_produce(rcpu->queue, skb);
- if (ret < 0)
+ if (ret < 0) {
+ __ptr_clear_bit(0, &skb);
+ dev_put(skb->dev);
goto trace;
+ }
wake_up_process(rcpu->kthread);
trace:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 513/816] bpf: Let bpf_dynptr_write() mark a global function
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (511 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 512/816] bpf, cpumap: Hold the device of frames in the queue Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 514/816] bpf: Dont take a dynptr argument for a local dynptr Greg Kroah-Hartman
` (307 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 589998616e0f9190ba6f6644a19532c5b2ba66d0 ]
The caller of a global function loses its packet pointers if the function
may change packet data. That is found out by a scan for calls of the
helpers which bpf_helper_changes_pkt_data() lists.
bpf_dynptr_write() is not on the list, because it depends on the type of
the dynptr: check_helper_call() looks at it. The scan cannot do that, and
so a global function which makes a dynptr from the skb, or gets one as an
argument, and writes through it counts as harmless. The write can
reallocate the head of the skb, and the caller goes on with pointers into
the old one, which has been freed.
Let every call of bpf_dynptr_write() mark the function, as a tail call
does. The same mark decides whether a program may replace a function.
Fixes: 51081a3f25c7 ("bpf: track changes_pkt_data property for global functions")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-10-alexei.starovoitov@gmail.com
[ sashal: Ported the change to the CFG code in verifier.c, since cfg.c doesn't exist here, and wrapped the condition in a bpf_helper_call(insn) check because there is no src_reg if/else split. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 34b82d3eff66f..9818cdbfb9724 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -17089,7 +17089,10 @@ static int visit_insn(int t, struct bpf_verifier_env *env)
mark_prune_point(env, t);
mark_jmp_point(env, t);
}
- if (bpf_helper_call(insn) && bpf_helper_changes_pkt_data(insn->imm))
+ /* nobody knows yet whether the dynptr is that of an skb */
+ if (bpf_helper_call(insn) &&
+ (bpf_helper_changes_pkt_data(insn->imm) ||
+ insn->imm == BPF_FUNC_dynptr_write))
mark_subprog_changes_pkt_data(env, t);
if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
struct bpf_kfunc_call_arg_meta meta;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 514/816] bpf: Dont take a dynptr argument for a local dynptr
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (512 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 513/816] bpf: Let bpf_dynptr_write() mark a global function Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 515/816] bpf: Follow the head if an skb is written from a slice Greg Kroah-Hartman
` (306 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit b7f97db88948aa511bcd989978f181e1367e0e8b ]
A global function is verified on its own. A dynptr which it gets as an
argument is assumed to be of type BPF_DYNPTR_TYPE_LOCAL, but the callers
may pass one of any type, that of an skb for example.
The type decides whether a write through the dynptr invalidates packet
pointers, and whether a slice of it is invalidated together with them.
Inside of the function neither happens. It can take a packet pointer from
its context argument, or a slice from the dynptr, write through the dynptr
and go on using the pointer, although the write may have reallocated the
head of the skb.
Assume the type of an skb dynptr instead. Nothing becomes forbidden for the
dynptr itself, and a clone inherits the caution. The dynptr which the
callback of bpf_user_ringbuf_drain() gets is known to be local, and stays
so.
Fixes: a64bfe618665 ("bpf: add support for passing dynptr pointer to global subprog")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-11-alexei.starovoitov@gmail.com
[ sashal: adjusted context for the older tree: dropped the trailing 0 argument to __mark_dynptr_reg() and kept the existing ARG_PTR_TO_DYNPTR | MEM_RDONLY guard and do_check_common() signature. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 9818cdbfb9724..dd7445537b1e3 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -22372,8 +22372,12 @@ static int do_check_common(struct bpf_verifier_env *env, int subprog)
reg->type = SCALAR_VALUE;
mark_reg_unknown(env, regs, i);
} else if (arg->arg_type == (ARG_PTR_TO_DYNPTR | MEM_RDONLY)) {
- /* assume unspecial LOCAL dynptr type */
- __mark_dynptr_reg(reg, BPF_DYNPTR_TYPE_LOCAL, true, ++env->id_gen);
+ /*
+ * The callers may hand in a dynptr of any type.
+ * Take it for that of an skb, so that a write
+ * through it and its slices are treated with care.
+ */
+ __mark_dynptr_reg(reg, BPF_DYNPTR_TYPE_SKB, true, ++env->id_gen);
} else if (base_type(arg->arg_type) == ARG_PTR_TO_MEM) {
reg->type = PTR_TO_MEM;
if (arg->arg_type & PTR_MAYBE_NULL)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 515/816] bpf: Follow the head if an skb is written from a slice
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (513 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 514/816] bpf: Dont take a dynptr argument for a local dynptr Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 516/816] locking/atomic: arc, hexagon, openrisc: Define arch_cmpxchg_local() Greg Kroah-Hartman
` (305 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 1c19f2b3b2f3b55c8017092257634cb8229b7d97 ]
The source of bpf_dynptr_write() may be a slice of the skb which is
written to, that is a pointer into its head. bpf_dynptr_copy() does it by
itself for a copy inside of one skb, if the source is linear and the
destination is not.
__bpf_skb_store_bytes() and __bpf_skb_meta_store_bytes() make the skb
writable first. If that reallocates the head, the source points to the old
one, and freed memory is copied into the packet.
The offsets in the head do not change when it is reallocated here. Move
the source along with the head.
Fixes: 2012c867c800 ("bpf: verifier: Accept dynptr mem as mem in helpers")
Fixes: f38499ff45f5 ("bpf: Unclone skb head on bpf_dynptr_write to skb metadata")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261017230950.802052-14-alexei.starovoitov@gmail.com
[ sashal: Dropped the hunk that modifies __bpf_skb_meta_store_bytes() because that function doesn't exist here, and kept the helper and the bpf_skb_store_bytes() change. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 9c53e79d87501..3b8ea2ba5c312 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1720,6 +1720,24 @@ static inline void bpf_pull_mac_rcsum(struct sk_buff *skb)
skb_postpull_rcsum(skb, skb_mac_header(skb), skb->mac_len);
}
+/*
+ * The source of a write through a dynptr may be a slice of the same skb.
+ * Making the skb writable can move its head: follow the move.
+ */
+static int bpf_try_make_writable_from(struct sk_buff *skb, u32 write_len,
+ const void **from)
+{
+ const void *head = skb->head;
+ bool in_head = *from >= head &&
+ *from < (const void *)skb_end_pointer(skb);
+ int err;
+
+ err = bpf_try_make_writable(skb, write_len);
+ if (!err && in_head)
+ *from = skb->head + (*from - head);
+ return err;
+}
+
BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,
const void *, from, u32, len, u64, flags)
{
@@ -1729,7 +1747,7 @@ BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset,
return -EINVAL;
if (unlikely(offset > INT_MAX))
return -EFAULT;
- if (unlikely(bpf_try_make_writable(skb, offset + len)))
+ if (unlikely(bpf_try_make_writable_from(skb, offset + len, &from)))
return -EFAULT;
ptr = skb->data + offset;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 516/816] locking/atomic: arc, hexagon, openrisc: Define arch_cmpxchg_local()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (514 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 515/816] bpf: Follow the head if an skb is written from a slice Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 517/816] bpf: Zero-extend the index in inlined bpf_get_func_arg() Greg Kroah-Hartman
` (304 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernelci.org bot, kernel test robot,
Sasha Levin, Alexei Starovoitov
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit 8cebaa3be829c88a59957900f8de98fed09daefe ]
Commit ccb88db8dac8 ("bpf: Don't hand out a linked element as extra
element") made alloc_htab_elem() take the per-cpu spare element with
try_cmpxchg_local(), the first caller of cmpxchg_local() outside of
architecture code. It doesn't build on arc, hexagon and openrisc:
include/linux/atomic/atomic-arch-fallback.h:384:27: error: implicit declaration of function 'arch_cmpxchg_local'; did you mean 'raw_cmpxchg_local'? [-Werror=implicit-function-declaration]
raw_cmpxchg_local() maps to arch_cmpxchg_local() unconditionally, but
these three architectures don't define it, and unlike nios2 and
microblaze they don't get it from asm-generic/cmpxchg.h either.
cmpxchg_local() only has to be atomic with respect to the local CPU, so
an architecture's own arch_cmpxchg() can serve for the sizes it
supports. arc uses its relaxed LLOCK/SCOND variant when ARC_HAS_LLSC is
set and its atomic_ops_lock() variant otherwise, and openrisc uses its
LL/SC arch_cmpxchg(), the way arm64, riscv and s390 alias theirs. The
hexagon arch_cmpxchg() only handles 32-bit words, so hexagon uses the
generic version that disables interrupts, like sh, sparc32 and xtensa
do. Linux has no NMIs on hexagon, so that is sufficient there.
Fixes: ccb88db8dac8 ("bpf: Don't hand out a linked element as extra element")
Reported-by: kernelci.org bot <bot@kernelci.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261018132907.3823160-1-sashal@kernel.org
Closes: https://d.kernelci.org/i/maestro:78b65519ee4561df1fbf1e72f1dec9da7e5b153e
Closes: https://lore.kernel.org/oe-kbuild-all/202610181750.BoqAddaF-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202610182048.aEaiBP8W-lkp@intel.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arc/include/asm/cmpxchg.h | 4 ++++
arch/hexagon/include/asm/cmpxchg.h | 6 ++++++
arch/openrisc/include/asm/cmpxchg.h | 2 ++
3 files changed, 12 insertions(+)
diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
index 76f43db0890fc..07d7a01d26de0 100644
--- a/arch/arc/include/asm/cmpxchg.h
+++ b/arch/arc/include/asm/cmpxchg.h
@@ -59,6 +59,8 @@
_prev_; \
})
+#define arch_cmpxchg_local arch_cmpxchg_relaxed
+
#else
#define arch_cmpxchg(ptr, old, new) \
@@ -80,6 +82,8 @@
_prev_; \
})
+#define arch_cmpxchg_local arch_cmpxchg
+
#endif
/*
diff --git a/arch/hexagon/include/asm/cmpxchg.h b/arch/hexagon/include/asm/cmpxchg.h
index 9c58fb81f7fd6..e6114e713db9f 100644
--- a/arch/hexagon/include/asm/cmpxchg.h
+++ b/arch/hexagon/include/asm/cmpxchg.h
@@ -8,6 +8,8 @@
#ifndef _ASM_CMPXCHG_H
#define _ASM_CMPXCHG_H
+#include <asm-generic/cmpxchg-local.h>
+
/*
* __arch_xchg - atomically exchange a register and a memory location
* @x: value to swap
@@ -72,4 +74,8 @@ __arch_xchg(unsigned long x, volatile void *ptr, int size)
__oldval; \
})
+#define arch_cmpxchg_local(ptr, o, n) \
+ ((__typeof__(*(ptr)))__generic_cmpxchg_local((ptr), \
+ (unsigned long)(o), (unsigned long)(n), sizeof(*(ptr))))
+
#endif /* _ASM_CMPXCHG_H */
diff --git a/arch/openrisc/include/asm/cmpxchg.h b/arch/openrisc/include/asm/cmpxchg.h
index 8ee151c072e41..fcf1bc8db8fe9 100644
--- a/arch/openrisc/include/asm/cmpxchg.h
+++ b/arch/openrisc/include/asm/cmpxchg.h
@@ -140,6 +140,8 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
sizeof(*(ptr))); \
})
+#define arch_cmpxchg_local arch_cmpxchg
+
/*
* This function doesn't exist, so you'll get a linker error if
* something tries to do an invalidly-sized xchg().
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 517/816] bpf: Zero-extend the index in inlined bpf_get_func_arg()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (515 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 516/816] locking/atomic: arc, hexagon, openrisc: Define arch_cmpxchg_local() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 518/816] gpiolib: clear the event clock flags when a line is released Greg Kroah-Hartman
` (303 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Woojin Ji, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Woojin Ji <random6.xyz@gmail.com>
[ Upstream commit 1c1dda9ba9f3af9cd511a197dcc86de2465d8fe5 ]
bpf_get_func_arg() takes a u32 index, but the inlined expansion compared
only the low 32 bits of R2 with the argument count and then shifted the
full 64-bit register to compute the context address. R2 is ARG_ANYTHING,
so nothing guarantees that its upper bits are zero: an index of
1ULL << 32 passes the bounds check as index zero while the load is
performed at ctx + (1ULL << 35).
Shift the index as a 32-bit value. When the 32-bit bounds check passes,
the low 32 bits of R2 are below R0, and R0 is at most 255: the trampoline
arm masks the argument count with 0xFF and the raw_tp arm uses the BTF
argument count minus one, which the verifier caps at MAX_BPF_FUNC_ARGS.
The 3-bit shift therefore cannot overflow and it clears the upper bits of
the register. Widening the comparison instead would reject indices whose
low 32 bits are valid. The check itself is unchanged, so this cannot
change which programs are accepted, only the address that is computed.
Fixes: f92c1e183604 ("bpf: Add get_func_[arg|ret|arg_cnt] helpers")
Signed-off-by: Woojin Ji <random6.xyz@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20261018-get-func-arg-v2-1-048848b3eddf@gmail.com
[ sashal: Changed the inlined bpf_get_func_arg() shift to BPF_ALU32_IMM in do_misc_fixups() in verifier.c, since the fixups file doesn't exist here and only the tracing arm is present. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index dd7445537b1e3..a5ffecbaa7bf9 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -21867,7 +21867,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
/* Load nr_args from ctx - 8 */
insn_buf[0] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, -8);
insn_buf[1] = BPF_JMP32_REG(BPF_JGE, BPF_REG_2, BPF_REG_0, 6);
- insn_buf[2] = BPF_ALU64_IMM(BPF_LSH, BPF_REG_2, 3);
+ insn_buf[2] = BPF_ALU32_IMM(BPF_LSH, BPF_REG_2, 3);
insn_buf[3] = BPF_ALU64_REG(BPF_ADD, BPF_REG_2, BPF_REG_1);
insn_buf[4] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_2, 0);
insn_buf[5] = BPF_STX_MEM(BPF_DW, BPF_REG_3, BPF_REG_0, 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 518/816] gpiolib: clear the event clock flags when a line is released
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (516 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 517/816] bpf: Zero-extend the index in inlined bpf_get_func_arg() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 519/816] netfilter: flowtable: reset transport header after nf_flow_encap_pop() Greg Kroah-Hartman
` (302 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Ambrozewicz,
Bartosz Golaszewski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
[ Upstream commit d35f61581ee67f8d4d58c325bac813cea528b6b9 ]
gpiod_free_commit() clears the flags that a request sets on a line, but
not GPIOD_FLAG_EVENT_CLOCK_REALTIME and GPIOD_FLAG_EVENT_CLOCK_HTE,
which gpio_v2_line_config_flags_to_desc_flags() sets from the uAPI v2
line config. Once a line requested with
GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME or
GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE is released, GPIO_V2_GET_LINEINFO_IOCTL
and the line info changed events, the "released" one included, keep
reporting that event clock for the free line:
GPIO_V2_GET_LINE_IOCTL, line 1, input, event clock realtime: ok
close()
GPIO_V2_GET_LINEINFO_IOCTL, line 1: input, event clock realtime
The flags are set before edge detection is set up, so a request that
fails in hte_ts_get(), for instance because no HTE provider handles the
line, leaves GPIOD_FLAG_EVENT_CLOCK_HTE behind as well. The next uAPI v2
request rewrites both flags, but requests through uAPI v1, sysfs exports
and in-kernel consumers do not, and the line info then shows the event
clock of an earlier user for them too.
Clear both flags together with the other flags of the request.
Reproduced under QEMU with a test GPIO chip: after a released request
with the realtime event clock, and on a kernel with CONFIG_HTE=y but no
HTE provider after a failed request with the HTE event clock, the line
info of the free line still reports that event clock. With this change
it reports none.
Fixes: 26d060e47e25 ("gpiolib: cdev: allow edge event timestamps to be configured as REALTIME")
Fixes: 2068339a6c35 ("gpiolib: cdev: Add hardware timestamp clock type")
Signed-off-by: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
Link: https://patch.msgid.link/20261012-gpiolib-event-clock-v1-1-aambrozewicz@nvidia.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ sashal: Replaced upstream's GPIOD_FLAG_EVENT_CLOCK_REALTIME/HTE names with the older unprefixed FLAG_EVENT_CLOCK_REALTIME/HTE names used in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 02a322f8330c2..28a1a184e580d 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2436,6 +2436,8 @@ static void gpiod_free_commit(struct gpio_desc *desc)
clear_bit(FLAG_BIAS_DISABLE, &flags);
clear_bit(FLAG_EDGE_RISING, &flags);
clear_bit(FLAG_EDGE_FALLING, &flags);
+ clear_bit(FLAG_EVENT_CLOCK_REALTIME, &flags);
+ clear_bit(FLAG_EVENT_CLOCK_HTE, &flags);
clear_bit(FLAG_IS_HOGGED, &flags);
#ifdef CONFIG_OF_DYNAMIC
WRITE_ONCE(desc->hog, NULL);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 519/816] netfilter: flowtable: reset transport header after nf_flow_encap_pop()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (517 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 518/816] gpiolib: clear the event clock flags when a line is released Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 520/816] ALSA: aloop: Keep shared timer callbacks alive through close Greg Kroah-Hartman
` (301 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Pablo Neira Ayuso,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
[ Upstream commit 08f7882637f2db5b98f521498eeaf94770383a6e ]
nf_flow_encap_pop() pulls vlan/pppoe or ip tunnel headers and resets the
network header, but leaves the transport header pointing into the removed
outer header. Reset the transport header to the inner L4 header, otherwise
later consumers (e.g. GSO segmentation) parse a bogus header.
Fixes: 4cd91f7c290f ("netfilter: flowtable: add vlan support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[ sashal: Adapted the IPv6 hunk context to this tree's two-argument nf_flow_encap_pop(skb, tuplehash) call instead of the three-argument form with ctx. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nf_flow_table_ip.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
index 1855ee828421f..91c82d513bbc0 100644
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -418,6 +418,7 @@ static int nf_flow_offload_forward(struct nf_flowtable_ctx *ctx,
nf_flow_encap_pop(skb, tuplehash);
thoff -= ctx->offset;
+ skb_set_transport_header(skb, thoff);
iph = ip_hdr(skb);
nf_flow_nat_ip(flow, skb, thoff, dir, iph);
@@ -700,6 +701,7 @@ static int nf_flow_offload_ipv6_forward(struct nf_flowtable_ctx *ctx,
flow_offload_refresh(flow_table, flow, false);
nf_flow_encap_pop(skb, tuplehash);
+ skb_set_transport_header(skb, sizeof(*ip6h));
ip6h = ipv6_hdr(skb);
nf_flow_nat_ipv6(flow, skb, dir, ip6h);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 520/816] ALSA: aloop: Keep shared timer callbacks alive through close
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (518 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 519/816] netfilter: flowtable: reset transport header after nf_flow_encap_pop() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 521/816] cgroup/cpuset: Do housekeeping check before converting invalid partition to valid Greg Kroah-Hartman
` (300 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cen Zhang, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit a7d4d780f34b9e43eefab6a7e6c9f4101f2c144e ]
The shared sound-timer callback must finish using the selected PCM
runtimes before a close can detach them. loopback_snd_timer_period_elapsed()
saves the active substreams under cable->lock, then drops the lock before
calling snd_pcm_period_elapsed() or snd_pcm_stop_xrun(). The sound-timer
backend has no per-stream close drain, and free_cable() keeps the timer
open when the paired endpoint remains attached.
With both directions running on a shared sound timer, playback can be
dropped and closed while a notification is pending. Capture keeps the
timer alive, allowing this order:
Timer callback Playback owner
-------------- --------------
select playback under cable->lock
unlock; delay notification
DROP; HW_FREE -> OPEN
close: snd_pcm_drop(); unlock
free_cable(); peer stays alive
snd_pcm_period_elapsed()
lock stream; cache runtime
snd_pcm_detach_substream()
free runtime and its fasync
read runtime->fasync
The stream lock taken by snd_pcm_drop() cannot protect a notification
that starts after it returns, and detach does not take it. The callback
can therefore read runtime->fasync after the runtime has been freed, and
an escaped notification can also reach a replacement runtime if the same
substream slot is reopened before the notification resumes.
Take the existing cable->stop_count reference under cable->lock when
selecting the targets and release it after the PCM callbacks finish,
including the XRUN path. free_cable() already removes the closing
endpoint under that lock and waits for stop_count before returning, so
runtime detach and slot reuse cannot overtake the notification.
Fixes: 26c53379f98d ("ALSA: aloop: Support selection of snd_timer instead of jiffies")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Assisted-by: LLM
Link: https://patch.msgid.link/pm-pmb-275c4399f517e09d7188-v2-2f64c1328529ef7a8fec@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Replaced snd_refcount get/put with atomic_inc/atomic_dec_and_test plus wake_up on the existing stop_count, and adapted the function body to the spin_lock_irqsave form instead of scoped_guard. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/drivers/aloop.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index fa8d2877516d9..7c69f5141ed2e 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -98,7 +98,7 @@ struct loopback_ops {
struct loopback_cable {
spinlock_t lock;
struct loopback_pcm *streams[2];
- /* in-flight peer stops running outside cable->lock */
+ /* in-flight PCM callbacks running outside cable->lock */
atomic_t stop_count;
wait_queue_head_t stop_wait;
struct snd_pcm_hardware hw;
@@ -809,6 +809,8 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
valid_runtime = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ?
dpcm_play->substream->runtime :
dpcm_capt->substream->runtime;
+ /* Keep runtimes alive through the PCM callbacks. */
+ atomic_inc(&cable->stop_count);
/* resolution is only valid for SNDRV_TIMER_EVENT_TICK events */
if (event == SNDRV_TIMER_EVENT_TICK) {
@@ -823,7 +825,7 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
snd_pcm_stop_xrun(substream_play);
if (substream_capt)
snd_pcm_stop_xrun(substream_capt);
- return;
+ goto exit;
}
}
@@ -847,6 +849,10 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
snd_pcm_period_elapsed(substream_play);
if (substream_capt)
snd_pcm_period_elapsed(substream_capt);
+
+exit:
+ if (atomic_dec_and_test(&cable->stop_count))
+ wake_up(&cable->stop_wait);
}
static void loopback_snd_timer_function(struct snd_timer_instance *timeri,
@@ -1092,7 +1098,7 @@ static void free_cable(struct snd_pcm_substream *substream)
other_alive = cable->streams[!substream->stream];
}
- /* Pair with the stop_count increment in loopback_check_format(). */
+ /* Wait for PCM callbacks running outside cable->lock. */
wait_event(cable->stop_wait, !atomic_read(&cable->stop_count));
if (other_alive)
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 521/816] cgroup/cpuset: Do housekeeping check before converting invalid partition to valid
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (519 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 520/816] ALSA: aloop: Keep shared timer callbacks alive through close Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 522/816] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler Greg Kroah-Hartman
` (299 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guopeng Zhang, Waiman Long,
Tejun Heo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit 2c0a5742fc459cd8416607acff4a38a1abcb2e1b ]
When a hotplug event happens or when update_cpumasks_hier() is called, an
invalid partition may be converted back to valid. However check against
housekeeping conflict isn't being done which can lead to a partition
state that violates the housekeeping rules. Update the code to allow
reviving an invalid partition only if it can pass the housekeeping check.
Fixes: 4a74e418881f ("cgroup/cpuset: Check partition conflict with housekeeping setup")
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ sashal: Adapted the call to the older two-argument prstate_housekeeping_conflict() helper, passing the negated partition_root_state so an invalid isolated partition is checked as isolated. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 3662acc2cff89..b1af98c19891e 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1850,9 +1850,15 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
bool exclusive = true;
/*
- * Convert invalid partition to valid has to
- * pass the cpu exclusivity test.
+ * Convert invalid partition to valid has to pass the
+ * cpu exclusivity test as well as the housekeeping
+ * check.
*/
+ if (prstate_housekeeping_conflict(-cs->partition_root_state,
+ xcpus)) {
+ part_error = PERR_HKEEPING;
+ goto write_error;
+ }
rcu_read_lock();
cpuset_for_each_child(child, css, parent) {
if (child == cs)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 522/816] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (520 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 521/816] cgroup/cpuset: Do housekeeping check before converting invalid partition to valid Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 523/816] xsk: freeze deferred pool teardown without blocking unregister Greg Kroah-Hartman
` (298 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Serhat Kumral, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Serhat Kumral <serhatkumral1@gmail.com>
[ Upstream commit bb75e5580b15cd23ededf15683a5ad67d7b61aab ]
In MLX5_IB_METHOD_STEERING_ANCHOR_CREATE, the user-supplied u16 priority
is passed directly to _get_flow_table() without an upper bound check.
This can lead to out-of-bounds array accesses on dev->flow_db priority
tables.
Check that priority does not exceed MLX5_IB_FLOW_LAST_PRIO before calling
_get_flow_table(), matching the existing validation in raw_fs_rule_add()
and mlx5_ib_create_flow().
Fixes: 0c6ab0ca9a66 ("RDMA/mlx5: Expose steering anchor to userspace")
Signed-off-by: Serhat Kumral <serhatkumral1@gmail.com>
Link: https://patch.msgid.link/20261018144907.20123-1-serhatkumral1@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
[ sashal: kept the local kzalloc(sizeof(*obj), GFP_KERNEL) line as context since kzalloc_obj() isn't available; the added priority check is identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/fs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c
index 186085cfb4e9b..369cea6b31857 100644
--- a/drivers/infiniband/hw/mlx5/fs.c
+++ b/drivers/infiniband/hw/mlx5/fs.c
@@ -2427,6 +2427,9 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_STEERING_ANCHOR_CREATE)(
if (err)
return err;
+ if (priority > MLX5_IB_FLOW_LAST_PRIO)
+ return -EINVAL;
+
obj = kzalloc(sizeof(*obj), GFP_KERNEL);
if (!obj)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 523/816] xsk: freeze deferred pool teardown without blocking unregister
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (521 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 522/816] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 524/816] ip6mr: clear skb->cb[] in reg_vif_xmit() Greg Kroah-Hartman
` (297 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Hilliard,
Björn Töpel, Jason Xing, Stanislav Fomichev,
Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Hilliard <james.hilliard1@gmail.com>
[ Upstream commit fece8420e76fe53ee84f0439f18d026b4c7641da ]
Deferred pool destruction calls ndo_bpf() under RTNL. system_wq is
not frozen during system sleep, so that callback can run after a
device has suspended and gated its clocks. Use system_freezable_wq
so running destruction finishes before device suspend and new work
waits until process thaw.
Keep assigned pools visible to NETDEV_UNREGISTER independently of
the socket list. A released socket has already left that list, but
its final pool put can queue destruction after workqueues freeze.
A resume-time unregister would then wait for a device reference
whose release cannot run until the resume completes.
Track assigned pools per netdev with netdev operations locking and detach
remaining pools after the notifier socket walk, including copy-mode pools.
This also covers leased queues without scanning pools from unrelated
devices or network namespaces. Remove the entry on assignment failure and
normal teardown. The deferred worker still owns the pool and later observes
the cleared device pointer, avoiding a second driver detach or put.
The lifetime problem was identified by code inspection of the deferred
release and system-sleep paths.
Fixes: 1c1efc2af158 ("xsk: Create and free buffer pool independently from umem")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20261014-xsk-suspend-teardown-v4-1-27795582e4a3@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Dropped netdev ops locking calls (netdev_lock_ops and friends) since they don't exist here, relying on RTNL with ASSERT_RTNL() instead, and adjusted the comments to say RTNL protected. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/netdevice.h | 5 +++++
include/net/xsk_buff_pool.h | 3 +++
net/xdp/xsk.c | 5 +++++
net/xdp/xsk_buff_pool.c | 43 +++++++++++++++++++++++++++++++------
4 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 4d1e0b91402d1..8dc5666795841 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2390,6 +2390,11 @@ struct net_device {
/* protected by rtnl_lock */
struct bpf_xdp_entity xdp_state[__MAX_XDP_MODE];
+#ifdef CONFIG_XDP_SOCKETS
+ /** @xsk_pools: assigned AF_XDP pools, RTNL protected */
+ struct hlist_head xsk_pools;
+#endif
+
u8 dev_addr_shadow[MAX_ADDR_LEN];
netdevice_tracker linkwatch_dev_tracker;
netdevice_tracker watchdog_dev_tracker;
diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h
index 4fce4bd826b9c..c58795a6d8c20 100644
--- a/include/net/xsk_buff_pool.h
+++ b/include/net/xsk_buff_pool.h
@@ -48,6 +48,8 @@ struct xsk_buff_pool {
struct device *dev;
struct net_device *netdev;
struct list_head xsk_tx_list;
+ /* Assigned pools, including deferred releases; RTNL protected. */
+ struct hlist_node dev_node;
/* Protects modifications to the xsk_tx_list */
spinlock_t xsk_tx_list_lock;
refcount_t users;
@@ -118,6 +120,7 @@ bool xp_put_pool(struct xsk_buff_pool *pool);
void xp_clear_dev(struct xsk_buff_pool *pool);
void xp_add_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs);
void xp_del_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs);
+void xp_clear_dev_all(struct net_device *dev);
/* AF_XDP, and XDP core. */
void xp_free(struct xdp_buff_xsk *xskb);
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 8dd43f06d6ed1..1bc966669ec96 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -1890,6 +1890,11 @@ static int xsk_notifier(struct notifier_block *this,
mutex_unlock(&xs->mutex);
}
mutex_unlock(&net->xdp.lock);
+ /*
+ * A released socket is no longer on xdp.list. Its pool can still
+ * hold a device reference on the frozen release workqueue.
+ */
+ xp_clear_dev_all(dev);
break;
}
return NOTIFY_DONE;
diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c
index 13fc16e361e04..03bafa4aa3aba 100644
--- a/net/xdp/xsk_buff_pool.c
+++ b/net/xdp/xsk_buff_pool.c
@@ -207,6 +207,11 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
pool->cached_need_wakeup = XDP_WAKEUP_TX;
dev_hold(netdev);
+ /*
+ * Socket removal precedes the final pool put. Keep the pool visible to
+ * NETDEV_UNREGISTER even while release work is waiting for process thaw.
+ */
+ hlist_add_head(&pool->dev_node, &netdev->xsk_pools);
if (force_copy)
/* For copy-mode, we are done. */
@@ -267,6 +272,8 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
if (err) {
pool->umem->flags = umem_flags;
xsk_clear_pool_at_qid(netdev, queue_id);
+ hlist_del(&pool->dev_node);
+ pool->netdev = NULL;
dev_put(netdev);
}
return err;
@@ -293,15 +300,35 @@ int xp_assign_dev_shared(struct xsk_buff_pool *pool, struct xdp_sock *umem_xs,
return xp_assign_dev(pool, dev, queue_id, flags);
}
-void xp_clear_dev(struct xsk_buff_pool *pool)
+static void __xp_clear_dev(struct xsk_buff_pool *pool)
{
- if (!pool->netdev)
- return;
+ struct net_device *netdev = pool->netdev;
+ ASSERT_RTNL();
xp_disable_drv_zc(pool);
- xsk_clear_pool_at_qid(pool->netdev, pool->queue_id);
- dev_put(pool->netdev);
+ xsk_clear_pool_at_qid(netdev, pool->queue_id);
+ hlist_del(&pool->dev_node);
pool->netdev = NULL;
+ dev_put(netdev);
+}
+
+void xp_clear_dev(struct xsk_buff_pool *pool)
+{
+ struct net_device *netdev = pool->netdev;
+
+ if (!netdev)
+ return;
+
+ __xp_clear_dev(pool);
+}
+
+void xp_clear_dev_all(struct net_device *dev)
+{
+ struct xsk_buff_pool *pool;
+ struct hlist_node *next;
+
+ hlist_for_each_entry_safe(pool, next, &dev->xsk_pools, dev_node)
+ __xp_clear_dev(pool);
}
static void xp_release_deferred(struct work_struct *work)
@@ -339,7 +366,11 @@ bool xp_put_pool(struct xsk_buff_pool *pool)
if (refcount_dec_and_test(&pool->users)) {
INIT_WORK(&pool->work, xp_release_deferred);
- schedule_work(&pool->work);
+ /*
+ * Teardown calls ndo_bpf(), which may need powered hardware.
+ * RTNL alone does not exclude the device's system PM callbacks.
+ */
+ queue_work(system_freezable_wq, &pool->work);
return true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 524/816] ip6mr: clear skb->cb[] in reg_vif_xmit()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (522 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 523/816] xsk: freeze deferred pool teardown without blocking unregister Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 525/816] exfat: fix used_clusters accounting during cluster allocation Greg Kroah-Hartman
` (296 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 238164201431a425e48dfcb8e9a59de63caf175b ]
reg_vif_xmit() hands the skb to ip6mr_cache_report() as an
MRT6MSG_WHOLEPKT report. skb_realloc_headroom() copies skb->cb[]
into the report, which is queued to the mroute socket, where
rawv6_recvmsg() reads it as IP6CB.
By the time the pim6reg device transmits the packet, skb->cb[] is
not IP6CB anymore: qdisc_pkt_len_init() overwrites iif and ra,
and any qdisc installed on the device (fq, fq_codel, pie, cake...)
or a tc BPF program writing skb->cb[] fills the area holding
dst0, srcrt, dst1, lastopt and flags.
Since commit dd433671fef3 ("ipv6: validate extension header length
before copying to cmsg") these stale offsets can no longer cause
out-of-bounds reads, but the mroute socket can still receive bogus
IPV6_PKTINFO ifindex and extension header ancillary data.
Clear IP6CB before building the report. The skb is freed right
after, so nothing else depends on its control block.
Fixes: 14fb64e1f449 ("[IPV6] MROUTE: Support PIM-SM (SSM).")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Placed the memset after the branch's existing rcu_read_lock() in reg_vif_xmit(), since the surrounding context differs, but the added code and comment are identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/ip6mr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index c608fc0a771aa..c962409a61e10 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -625,6 +625,13 @@ static netdev_tx_t reg_vif_xmit(struct sk_buff *skb,
DEV_STATS_ADD(dev, tx_bytes, skb->len);
DEV_STATS_INC(dev, tx_packets);
rcu_read_lock();
+
+ /* skb->cb[] holds qdisc/tc state at this point, not IP6CB.
+ * ip6mr_cache_report() copies it to the report delivered to
+ * the mroute socket, where it is read as IP6CB.
+ */
+ memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
+
ip6mr_cache_report(mrt, skb, READ_ONCE(mrt->mroute_reg_vif_num),
MRT6MSG_WHOLEPKT);
rcu_read_unlock();
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 525/816] exfat: fix used_clusters accounting during cluster allocation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (523 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 524/816] ip6mr: clear skb->cb[] in reg_vif_xmit() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 526/816] exfat: take bitmap_lock at the start of exfat_alloc_cluster() Greg Kroah-Hartman
` (295 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chi Zhiling, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chi Zhiling <chizhiling@kylinos.cn>
[ Upstream commit cb9dbf8a4e34b4fdf311598835ab4d76ed7e07c1 ]
In the current exfat_alloc_cluster(), p_chain->size is incremented as
each cluster is allocated so that the partially allocated chain can
be freed by __exfat_free_cluster() on the error path.
However, sbi->used_clusters is still updated only after all clusters
have been allocated, while __exfat_free_cluster() unconditionally
subtracts the number of freed clusters from sbi->used_clusters.
Therefore, when allocation fails partway through, the partially
allocated clusters are subtracted from sbi->used_clusters even
though they were never added to it. This corrupts the free-space
accounting and can cause sbi->used_clusters to underflow.
Increment sbi->used_clusters together with p_chain->size as each
cluster is allocated. This keeps the accounting consistent with
__exfat_free_cluster() on both the success and error paths.
This issue is caught by generic/476 with 256k cluster size:
Ran: generic/476
Failures: generic/476
Failed 1 of 1 tests
*** fsck.exfat output ***
ERROR: <path>: more clusters are allocated. truncate to N bytes
...
/dev/vdc: corrupted. directories 331, files 526
/dev/vdc: files corrupted 9, files fixed 0
*** end fsck.exfat output ***
Fixes: d5c514b6a0c0 ("exfat: fix the newly allocated clusters are not freed in error handling")
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Dropped the done: label from the context and removed this tree's used_clusters += num_alloc; line plus its blank line, where upstream removes used_clusters += p_chain->size;. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/exfat/fatent.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index 2c3ab6313cc98..5cde58a4a503c 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -402,13 +402,12 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
}
}
p_chain->size++;
+ sbi->used_clusters++;
last_clu = new_clu;
if (p_chain->size == num_alloc) {
sbi->clu_srch_ptr = hint_clu;
- sbi->used_clusters += num_alloc;
-
mutex_unlock(&sbi->bitmap_lock);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 526/816] exfat: take bitmap_lock at the start of exfat_alloc_cluster()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (524 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 525/816] exfat: fix used_clusters accounting during cluster allocation Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 527/816] ksmbd: fix iface_list use-after-free during server reset Greg Kroah-Hartman
` (294 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chi Zhiling, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chi Zhiling <chizhiling@kylinos.cn>
[ Upstream commit 48acff2eedef7fecdfbd39be1b6f4463a9e43e3e ]
exfat_alloc_cluster() checks sbi->used_clusters against the total
number of data clusters before acquiring sbi->bitmap_lock. A concurrent
allocation can update sbi->used_clusters after the check but before
the lock is acquired, making the check stale. This can allow the
allocation to proceed even though there are not enough free clusters,
causing it to fail partway through.
Acquire sbi->bitmap_lock before checking sbi->used_clusters so that
the free-space check and subsequent cluster allocation are serialized
with concurrent allocations.
Fixes: f55c096f62f1 ("exfat: do not zero the extended part")
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/exfat/fatent.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index 5cde58a4a503c..d855d4b4c720f 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -326,19 +326,22 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
+ mutex_lock(&sbi->bitmap_lock);
+
total_cnt = EXFAT_DATA_CLUSTER_COUNT(sbi);
if (unlikely(total_cnt < sbi->used_clusters)) {
exfat_fs_error_ratelimit(sb,
"%s: invalid used clusters(t:%u,u:%u)\n",
__func__, total_cnt, sbi->used_clusters);
- return -EIO;
+ ret = -EIO;
+ goto unlock;
}
- if (num_alloc > total_cnt - sbi->used_clusters)
- return -ENOSPC;
-
- mutex_lock(&sbi->bitmap_lock);
+ if (num_alloc > total_cnt - sbi->used_clusters) {
+ ret = -ENOSPC;
+ goto unlock;
+ }
hint_clu = p_chain->dir;
/* find new cluster */
@@ -408,8 +411,8 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
if (p_chain->size == num_alloc) {
sbi->clu_srch_ptr = hint_clu;
- mutex_unlock(&sbi->bitmap_lock);
- return 0;
+ ret = 0;
+ goto unlock;
}
hint_clu = new_clu + 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 527/816] ksmbd: fix iface_list use-after-free during server reset
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (525 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 526/816] exfat: take bitmap_lock at the start of exfat_alloc_cluster() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 528/816] ksmbd: disconnect on invalid encryption transform flags Greg Kroah-Hartman
` (293 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Henry Hu, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henry Hu <huhai@kylinos.cn>
[ Upstream commit d34d38ab0c62fe4eb9e746420c554e6d0e6f54db ]
ksmbd_find_netdev_name_iface_list() walks iface_list for
fsctl_query_iface_info_ioctl(), which holds RTNL. But during server
reset, ksmbd_tcp_destroy() unlinks and frees the entries without RTNL,
and queued SMB requests can still be running at that point. So an
FSCTL_QUERY_NETWORK_INTERFACE_INFO request can therefore race with
interface destruction and dereference a freed entry. With debug-only
instrumentation to make the race deterministic, KASAN reports:
BUG: KASAN: slab-use-after-free in
ksmbd_find_netdev_name_iface_list
ksmbd_find_netdev_name_iface_list
fsctl_query_iface_info_ioctl
smb2_ioctl
handle_ksmbd_work
Freed by:
kfree
ksmbd_tcp_destroy
ksmbd_conn_transport_destroy
kill_server_store
The fix is to detach iface_list to a temporary list under RTNL, then drop
RTNL before cleanup because the following cleanup may block and hold RTNL
for a long time.
Fixes: b2d99376c5d6 ("ksmbd: browse interfaces list on FSCTL_QUERY_INTERFACE_INFO IOCTL")
Reported-by: Sashiko <sashiko-bot+sashiko@kernel.org>
Link: https://sashiko.dev/#/patchset/20260911163516.6403-1-15815827059%40163.com
Assisted-by: LLM
Signed-off-by: Henry Hu <huhai@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Dropped the ksmbd_tcp_stop_listener() context line from the cleanup loop, since that helper doesn't exist here, so the loop starts at list_del(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/transport_tcp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c
index 65705c8993be0..6dfd70f44cceb 100644
--- a/fs/smb/server/transport_tcp.c
+++ b/fs/smb/server/transport_tcp.c
@@ -682,10 +682,15 @@ static void tcp_stop_kthread(struct task_struct *kthread)
void ksmbd_tcp_destroy(void)
{
struct interface *iface, *tmp;
+ LIST_HEAD(iface_list_to_free);
unregister_netdevice_notifier(&ksmbd_netdev_notifier);
- list_for_each_entry_safe(iface, tmp, &iface_list, entry) {
+ rtnl_lock();
+ list_splice_init(&iface_list, &iface_list_to_free);
+ rtnl_unlock();
+
+ list_for_each_entry_safe(iface, tmp, &iface_list_to_free, entry) {
list_del(&iface->entry);
kfree(iface->name);
kfree(iface);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 528/816] ksmbd: disconnect on invalid encryption transform flags
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (526 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 527/816] ksmbd: fix iface_list use-after-free during server reset Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 529/816] ksmbd: cache the resolved share path for durable reconnects Greg Kroah-Hartman
` (292 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 0882f124ae329eefb66b00e63b9043f24c006b0e ]
MS-SMB2 3.3.5.2.1.1 requires the Flags/EncryptionAlgorithm field in an
SMB2 transform header to be 0x0001. The server must disconnect the
connection when it has any other value.
smb3_decrypt_req() currently ignores this field. A client with the
session key can therefore send a correctly authenticated encrypted
request with invalid flags and have it processed. Check the field
before looking up the session key or decrypting the request. The caller
aborts the connection when this check fails.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Added the transform-header Flags check to smb3_decrypt_req() unchanged, but adjusted the surrounding context because this older code lacks original_msg_size and the compression-header size check. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index e65fe5858a51d..5492e7490a26b 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -9572,6 +9572,12 @@ int smb3_decrypt_req(struct ksmbd_work *work)
return -ECONNABORTED;
}
+ if (tr_hdr->Flags != cpu_to_le16(TRANSFORM_FLAG_ENCRYPTED)) {
+ pr_err_ratelimited("Invalid transform flags 0x%04x\n",
+ le16_to_cpu(tr_hdr->Flags));
+ return -ECONNABORTED;
+ }
+
if (buf_data_size < le32_to_cpu(tr_hdr->OriginalMessageSize)) {
pr_err("Transform message is broken\n");
return -ECONNABORTED;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 529/816] ksmbd: cache the resolved share path for durable reconnects
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (527 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 528/816] ksmbd: disconnect on invalid encryption transform flags Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 530/816] ksmbd: fix durable reconnects for root shares Greg Kroah-Hartman
` (291 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dairui Zhang, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 2a90ba573d41efa82e075ba9ac532bb3ec0519c4 ]
A share configured as /a/link/b, with /a/link pointing to /real, is
opened relative to share->vfs_path at /real/b. However,
ksmbd_validate_name_reconnect() compares the file's d_path() result
against the original /a/link/b string and rejects a valid reconnect.
Render share->vfs_path with d_path() after the existing kern_path()
lookup and cache a copy in real_path along with its length. Use the
resolved string for durable reconnect name validation. Keep path and
path_sz as the configured spelling for existing consumers, including
the volume serial calculation and path lookups.
Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Reported-by: Dairui Zhang <zhangdairui@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Dropped the scoped_with_init_fs() wrapper around the share_config_resolve_path() call because this tree lacks it, and adjusted the include context where <linux/fs_struct.h> is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/mgmt/share_config.c | 43 +++++++++++++++++++++++++++++--
fs/smb/server/mgmt/share_config.h | 2 ++
fs/smb/server/vfs_cache.c | 12 +++++----
3 files changed, 50 insertions(+), 7 deletions(-)
diff --git a/fs/smb/server/mgmt/share_config.c b/fs/smb/server/mgmt/share_config.c
index 04e8c11e865e9..fee0b784e2f1c 100644
--- a/fs/smb/server/mgmt/share_config.c
+++ b/fs/smb/server/mgmt/share_config.c
@@ -8,6 +8,7 @@
#include <linux/slab.h>
#include <linux/rwsem.h>
#include <linux/parser.h>
+#include <linux/dcache.h>
#include <linux/namei.h>
#include <linux/sched.h>
#include <linux/mm.h>
@@ -50,6 +51,7 @@ static void kill_share(struct ksmbd_share_config *share)
path_put(&share->vfs_path);
kfree(share->name);
kfree(share->path);
+ kfree(share->real_path);
kfree(share);
}
@@ -124,6 +126,43 @@ static int parse_veto_list(struct ksmbd_share_config *share,
return 0;
}
+static int share_config_resolve_path(struct ksmbd_share_config *share)
+{
+ char *buf, *path;
+ int ret;
+
+ ret = kern_path(share->path, 0, &share->vfs_path);
+ if (ret)
+ return ret;
+
+ buf = kmalloc(PATH_MAX, KSMBD_DEFAULT_GFP);
+ if (!buf) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ path = d_path(&share->vfs_path, buf, PATH_MAX);
+ if (IS_ERR(path)) {
+ ret = PTR_ERR(path);
+ goto out_buf;
+ }
+
+ path = kstrdup(path, KSMBD_DEFAULT_GFP);
+ if (!path) {
+ ret = -ENOMEM;
+ goto out_buf;
+ }
+
+ share->real_path = path;
+ share->real_path_sz = strlen(path);
+out_buf:
+ kfree(buf);
+out:
+ if (ret)
+ path_put(&share->vfs_path);
+ return ret;
+}
+
static struct ksmbd_share_config *share_config_request(struct ksmbd_work *work,
const char *name)
{
@@ -212,12 +251,12 @@ static struct ksmbd_share_config *share_config_request(struct ksmbd_work *work,
goto out;
}
- ret = kern_path(share->path, 0, &share->vfs_path);
+ ret = share_config_resolve_path(share);
ksmbd_revert_fsids(work);
if (ret) {
ksmbd_debug(SMB, "failed to access '%s'\n",
share->path);
- /* Avoid put_path() */
+ /* No path reference is retained on failure. */
kfree(share->path);
share->path = NULL;
}
diff --git a/fs/smb/server/mgmt/share_config.h b/fs/smb/server/mgmt/share_config.h
index d4ac2dd4de204..baa9f9ed91cde 100644
--- a/fs/smb/server/mgmt/share_config.h
+++ b/fs/smb/server/mgmt/share_config.h
@@ -16,8 +16,10 @@ struct ksmbd_work;
struct ksmbd_share_config {
char *name;
char *path;
+ char *real_path;
unsigned int path_sz;
+ unsigned int real_path_sz;
unsigned int flags;
struct list_head veto_list;
diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c
index 2621d2cffe619..b1ee76949a2ea 100644
--- a/fs/smb/server/vfs_cache.c
+++ b/fs/smb/server/vfs_cache.c
@@ -1355,6 +1355,8 @@ void ksmbd_free_global_file_table(void)
int ksmbd_validate_name_reconnect(struct ksmbd_share_config *share,
struct ksmbd_file *fp, char *name)
{
+ const char *share_path = share->real_path;
+ size_t share_path_sz = share->real_path_sz;
char *pathname, *ab_pathname;
int ret = 0;
@@ -1371,14 +1373,14 @@ int ksmbd_validate_name_reconnect(struct ksmbd_share_config *share,
if (name) {
size_t len = strlen(ab_pathname);
- if (len == share->path_sz && !strncmp(ab_pathname, share->path, len)) {
+ if (len == share_path_sz && !strncmp(ab_pathname, share_path, len)) {
/* the durable fp is the share root itself */
if (name[0])
ret = -EINVAL;
- } else if (len <= share->path_sz ||
- strncmp(ab_pathname, share->path, share->path_sz) ||
- ab_pathname[share->path_sz] != '/' ||
- strcmp(&ab_pathname[share->path_sz + 1], name)) {
+ } else if (len <= share_path_sz ||
+ strncmp(ab_pathname, share_path, share_path_sz) ||
+ ab_pathname[share_path_sz] != '/' ||
+ strcmp(&ab_pathname[share_path_sz + 1], name)) {
ret = -EINVAL;
}
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 530/816] ksmbd: fix durable reconnects for root shares
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (528 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 529/816] ksmbd: cache the resolved share path for durable reconnects Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 531/816] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86 Greg Kroah-Hartman
` (290 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dairui Zhang, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 25e36df831a47597c03c6239fbc71285e7d714c2 ]
When a share exports "/", ksmbd_validate_name_reconnect() expects
another slash after the share path. For a file at /foo, this rejects
the valid reconnect name "foo" even though the file is in the share.
Compare the requested name with the rendered file path after its
leading slash when the resolved share root is "/". Keep the
exact-root/empty-name check and reject rendered paths without an
initial slash.
Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Reported-by: Dairui Zhang <zhangdairui@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/vfs_cache.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c
index b1ee76949a2ea..52389fff3d4a0 100644
--- a/fs/smb/server/vfs_cache.c
+++ b/fs/smb/server/vfs_cache.c
@@ -1377,6 +1377,10 @@ int ksmbd_validate_name_reconnect(struct ksmbd_share_config *share,
/* the durable fp is the share root itself */
if (name[0])
ret = -EINVAL;
+ } else if (share_path_sz == 1 && share_path[0] == '/') {
+ if (ab_pathname[0] != '/' ||
+ strcmp(ab_pathname + 1, name))
+ ret = -EINVAL;
} else if (len <= share_path_sz ||
strncmp(ab_pathname, share_path, share_path_sz) ||
ab_pathname[share_path_sz] != '/' ||
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 531/816] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (529 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 530/816] ksmbd: fix durable reconnects for root shares Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 532/816] ALSA: hda/realtek: Add mute and mic-mute LEDs for HP ENVY 16 (103c:8be5) Greg Kroah-Hartman
` (289 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sasha Levin, Andrew Morton,
Shuah Khan, Alexey Dobriyan
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit c4d9005e7e1ee6ce277f47cf53d44fc5b90b287b ]
g_vsyscall is only used by the x86_64 test, so clang builds for other
architectures get:
proc-pid-vm.c:224:21: warning: unused variable 'g_vsyscall' [-Wunused-variable]
The vsyscall strings next to it had the same problem and were marked
__maybe_unused for it. Move all of the vsyscall variables into the
__x86_64__ block that uses them instead, and drop those annotations
along with the local __maybe_unused fallback that was added for them.
Link: https://lore.kernel.org/20261012115330.3777115-1-sashal@kernel.org
Fixes: 17415606f9d8 ("tools/testing/selftests/proc/proc-pid-vm.c: test with vsyscall in mind")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Assisted-by: LLM
Cc: Shuah Khan <shuah@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
[ sashal: Kept this tree's #include "../kselftest.h" and skipped the __maybe_unused removals, since that fallback and those annotations were never present here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/proc/proc-pid-vm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/proc/proc-pid-vm.c b/tools/testing/selftests/proc/proc-pid-vm.c
index d04685771952a..2ec6e0fd20e01 100644
--- a/tools/testing/selftests/proc/proc-pid-vm.c
+++ b/tools/testing/selftests/proc/proc-pid-vm.c
@@ -210,7 +210,6 @@ static int make_exe(const uint8_t *payload, size_t len)
return fd1;
}
-#endif
/*
* 0: vsyscall VMA doesn't exist vsyscall=none
@@ -226,7 +225,6 @@ static const char str_vsyscall_1[] =
static const char str_vsyscall_2[] =
"ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]\n";
-#ifdef __x86_64__
static void sigaction_SIGSEGV(int _, siginfo_t *__, void *___)
{
_exit(g_vsyscall);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 532/816] ALSA: hda/realtek: Add mute and mic-mute LEDs for HP ENVY 16 (103c:8be5)
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (530 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 531/816] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86 Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 533/816] perf lock contention: Filter events before creating lock_stat Greg Kroah-Hartman
` (288 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ajanesh Lal, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ajanesh Lal <ajaneshlal3@gmail.com>
[ Upstream commit ed7995e4ec3789a90e37eb826bfccf43cc85d2fd ]
The HP ENVY Laptop 16-h1xxx (PCI SSID 103c:8be5) uses an ALC245 codec
with CS35L41 I2C speaker amplifiers. No LED fixup is applied for this
subsystem ID, so the speaker mute LED and the microphone mute LED are
never driven and do not follow their keys.
Add a fixup that calls the existing ALC245 mute LED COEF helper and the
GPIO mic-mute LED helper directly, then chains to the CS35L41 I2C
amplifier setup so the speakers keep working. Use it for 103c:8be5.
Tested on an HP ENVY Laptop 16-h1xxx running kernel 7.2.11: the
hda::mute and hda::micmute LEDs appear and follow their keys, and the
speaker amplifiers still bind (CS35L41 Bound in dmesg). The mic LED
GPIO pin and polarity are not verified on other hardware.
Fixes: aa8e3ef4fe53 ("ALSA: hda/realtek: Add quirks for various HP ENVY models")
Assisted-by: Claude:claude-haiku-5-5
Signed-off-by: Ajanesh Lal <ajaneshlal3@gmail.com>
Link: https://patch.msgid.link/20261021142453.177174-1-ajaneshlal3@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ sashal: Ported the four hunks by hand to the older file path, placing the enum value and fixup entry after existing neighbors because the upstream anchor entry is missing. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/patch_realtek.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 726fc58b17ee7..f2673ed691d73 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4797,6 +4797,14 @@ static void alc245_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
}
}
+/* mute LED via COEF bit and mic-mute LED via GPIO, called directly */
+static void alc245_fixup_cs35l41_mute_micmute(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+{
+ alc245_fixup_hp_mute_led_coefbit(codec, fix, action);
+ alc245_fixup_hp_gpio_led(codec, fix, action);
+}
+
static void alc245_fixup_hp_mute_led_v1_coefbit(struct hda_codec *codec,
const struct hda_fixup *fix,
int action)
@@ -8235,6 +8243,7 @@ enum {
ALC287_FIXUP_CS35L41_I2C_2,
ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
ALC287_FIXUP_CS35L41_I2C_2_HP_MUTE_LEDS,
+ ALC245_FIXUP_CS35L41_I2C_2_MUTE_MICMUTE_LED,
ALC287_FIXUP_CS35L41_I2C_4,
ALC245_FIXUP_CS35L41_SPI_1,
ALC245_FIXUP_CS35L41_SPI_2,
@@ -10444,6 +10453,12 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true,
.chain_id = ALC245_FIXUP_HP_X360_MUTE_LEDS,
},
+ [ALC245_FIXUP_CS35L41_I2C_2_MUTE_MICMUTE_LED] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc245_fixup_cs35l41_mute_micmute,
+ .chained = true,
+ .chain_id = ALC287_FIXUP_CS35L41_I2C_2,
+ },
[ALC287_FIXUP_CS35L41_I2C_4] = {
.type = HDA_FIXUP_FUNC,
.v.func = cs35l41_fixup_i2c_four,
@@ -11180,7 +11195,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8be1, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8be2, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8be3, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
- SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
+ SND_PCI_QUIRK(0x103c, 0x8be5, "HP Envy 16", ALC245_FIXUP_CS35L41_I2C_2_MUTE_MICMUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8be6, "HP Envy 16", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8be7, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x103c, 0x8be8, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2_HP_MUTE_LEDS),
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 533/816] perf lock contention: Filter events before creating lock_stat
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (531 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 532/816] ALSA: hda/realtek: Add mute and mic-mute LEDs for HP ENVY 16 (103c:8be5) Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 534/816] gpiolib: Propagate emulated drive errors when setting arrays Greg Kroah-Hartman
` (287 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Namhyung Kim, Ian Rogers,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit c58d1598e79554cc8f587668ab2ebcaeb616b076 ]
In report_lock_contention_begin_event(), lock_stat_findnew() was
called before checking filters.nr_types (-Y), filters.nr_addrs (-L),
and match_callstack_filter() (-S).
When a filtered-out lock event (such as a mutex contention when
running with -Y spinlock) shared the same aggregation key as a
subsequent matching event (for example, contention on the mutex's
internal wait_lock spinlock from the same caller), the first event
created the lock_stat entry with the filtered-out lock's flags and the
second event reused that entry, causing non-spinlock entries to appear
in -Y spinlock output.
Check the type, address, and callstack filters before looking up or
creating the lock_stat entry.
Fixes: b4a7eff93c39f985 ("perf lock contention: Add -Y/--type-filter option")
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[ sashal: adjusted the lock_contention_caller() call to pass the extra evsel argument, and kept the existing -ENOMEM return on get_callstack() failure instead of 0. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-lock.c | 61 +++++++++++++++++++++------------------
1 file changed, 33 insertions(+), 28 deletions(-)
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 3d490ea46551b..1de2ee1464fee 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -1070,6 +1070,7 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
struct machine *machine = &session->machines.host;
struct map *kmap;
struct symbol *sym;
+ u64 *callstack = NULL;
ret = get_key_by_aggr_mode(&key, addr, evsel, sample);
if (ret < 0)
@@ -1105,33 +1106,6 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
}
}
- ls = lock_stat_find(key);
- if (!ls) {
- char buf[128];
- const char *name = "";
-
- switch (aggr_mode) {
- case LOCK_AGGR_ADDR:
- sym = machine__find_kernel_symbol(machine, key, &kmap);
- if (sym)
- name = sym->name;
- break;
- case LOCK_AGGR_CALLER:
- name = buf;
- if (lock_contention_caller(evsel, sample, buf, sizeof(buf)) < 0)
- name = "Unknown";
- break;
- case LOCK_AGGR_CGROUP:
- case LOCK_AGGR_TASK:
- default:
- break;
- }
-
- ls = lock_stat_findnew(key, name, flags);
- if (!ls)
- return -ENOMEM;
- }
-
if (filters.nr_types) {
bool found = false;
@@ -1161,7 +1135,7 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
}
if (needs_callstack()) {
- u64 *callstack = get_callstack(sample, max_stack_depth);
+ callstack = get_callstack(sample, max_stack_depth);
if (callstack == NULL)
return -ENOMEM;
@@ -1169,7 +1143,38 @@ static int report_lock_contention_begin_event(struct evsel *evsel,
free(callstack);
return 0;
}
+ }
+
+ ls = lock_stat_find(key);
+ if (!ls) {
+ char buf[128];
+ const char *name = "";
+
+ switch (aggr_mode) {
+ case LOCK_AGGR_ADDR:
+ sym = machine__find_kernel_symbol(machine, key, &kmap);
+ if (sym)
+ name = sym->name;
+ break;
+ case LOCK_AGGR_CALLER:
+ name = buf;
+ if (lock_contention_caller(evsel, sample, buf, sizeof(buf)) < 0)
+ name = "Unknown";
+ break;
+ case LOCK_AGGR_CGROUP:
+ case LOCK_AGGR_TASK:
+ default:
+ break;
+ }
+
+ ls = lock_stat_findnew(key, name, flags);
+ if (!ls) {
+ free(callstack);
+ return -ENOMEM;
+ }
+ }
+ if (callstack) {
if (ls->callstack == NULL)
ls->callstack = callstack;
else
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 534/816] gpiolib: Propagate emulated drive errors when setting arrays
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (532 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 533/816] perf lock contention: Filter events before creating lock_stat Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 535/816] zram: fix short reads from block_state Greg Kroah-Hartman
` (286 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baek Kyu, Kim <pocj8ur4in@gmail.com>
[ Upstream commit 15665047024e30f9c2227563d03034061c99ac2c ]
gpiod_set_array_value_complex() ignores errors from the open-drain and
open-source emulation helpers. If a direction change fails,
GPIO_V2_LINE_SET_VALUES_IOCTL still reports success, including when
updating a single line.
Return the first emulation error after freeing the temporary bitmaps.
Keep updates already made to earlier lines and stop processing the
remaining lines, as for errors from gpiochip_set_multiple().
Fixes: 8ce258f62f90 ("gpiolib: make value setters have return values")
Signed-off-by:
Link: https://patch.msgid.link/20261020172601.221861-1-pocj8ur4in@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ sashal: adjusted context to use the older FLAG_OPEN_DRAIN/FLAG_OPEN_SOURCE names and added the cleanup_bitmap label in this tree's function layout. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 28a1a184e580d..c9dae5cf4db34 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3572,9 +3572,13 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep,
* open drain and open source outputs are set individually
*/
if (test_bit(FLAG_OPEN_DRAIN, &desc->flags) && !raw) {
- gpio_set_open_drain_value_commit(desc, value);
+ ret = gpio_set_open_drain_value_commit(desc, value);
+ if (ret)
+ goto cleanup_bitmap;
} else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags) && !raw) {
- gpio_set_open_source_value_commit(desc, value);
+ ret = gpio_set_open_source_value_commit(desc, value);
+ if (ret)
+ goto cleanup_bitmap;
} else {
__set_bit(hwgpio, mask);
__assign_bit(hwgpio, bits, value);
@@ -3592,6 +3596,7 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep,
if (count != 0)
ret = gpiochip_set_multiple(guard.gc, mask, bits);
+cleanup_bitmap:
if (mask != fastpath_mask)
bitmap_free(mask);
if (bits != fastpath_bits)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 535/816] zram: fix short reads from block_state
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (533 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 534/816] gpiolib: Propagate emulated drive errors when setting arrays Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 536/816] ceph: wait for pending fscache write in write_folio_nounlock() Greg Kroah-Hartman
` (285 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pooyan Azad, Andrew Morton,
Sergey Senozhatsky, Minchan Kim, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pooyan Azad <pooyan.azadparvar@gmail.com>
[ Upstream commit 372012202260db088b489ed00059c4571a602552 ]
read_block_state() formats each entry directly into the buffer supplied by
read(). If the remaining buffer is too small for one complete record,
snprintf() returns the full record length and the function stops without
copying data or advancing the file position. A read from this debugfs
file which is smaller than a record therefore returns zero at a non-EOF
position and cannot make progress.
Convert block_state to seq_file so formatted records are buffered
independently of the userspace read size. Keep dev_lock held across each
seq_file iteration and continue to protect individual entries with their
slot locks.
Link: https://lore.kernel.org/20260929071846.24829-1-pooyan.azadparvar@gmail.com
Fixes: c0265342bff4 ("zram: introduce zram memory tracking")
Signed-off-by: Pooyan Azad <pooyan.azadparvar@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Closes: https://lore.kernel.org/r/CANC3H+LdtoydSp+o2ecErAw7k6R2+gRf9LyxcaoHv_mGhJmyQQ@mail.gmail.com/
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
[ sashal: adjusted context to use the older init_lock, zram_slot_lock() and timespec64 helpers in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/zram/zram_drv.c | 105 +++++++++++++++++-----------------
1 file changed, 53 insertions(+), 52 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index db059577fc5bd..1d2a686f4d125 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -856,72 +856,73 @@ static void zram_debugfs_destroy(void)
debugfs_remove_recursive(zram_debugfs_root);
}
-static ssize_t read_block_state(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
+static void *zram_block_state_start(struct seq_file *seq, loff_t *pos)
{
- char *kbuf;
- ssize_t index, written = 0;
- struct zram *zram = file->private_data;
+ struct zram *zram = seq->private;
unsigned long nr_pages;
- kbuf = kvmalloc(count, GFP_KERNEL);
- if (!kbuf)
- return -ENOMEM;
-
down_read(&zram->init_lock);
- if (!init_done(zram)) {
- up_read(&zram->init_lock);
- kvfree(kbuf);
- return -EINVAL;
- }
+ if (!init_done(zram))
+ return ERR_PTR(-EINVAL);
nr_pages = zram->disksize >> PAGE_SHIFT;
+ if (*pos >= nr_pages)
+ return NULL;
- for (index = *ppos; index < nr_pages; index++) {
- int copied;
- struct timespec64 ts;
+ return pos;
+}
- zram_slot_lock(zram, index);
- if (!zram_allocated(zram, index))
- goto next;
+static void *zram_block_state_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct zram *zram = seq->private;
+ unsigned long nr_pages = zram->disksize >> PAGE_SHIFT;
- ts = ktime_to_timespec64(zram->table[index].ac_time);
- copied = snprintf(kbuf + written, count,
- "%12zd %12lld.%06lu %c%c%c%c%c%c\n",
- index, (s64)ts.tv_sec,
- ts.tv_nsec / NSEC_PER_USEC,
- zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.',
- zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.',
- zram_test_flag(zram, index, ZRAM_HUGE) ? 'h' : '.',
- zram_test_flag(zram, index, ZRAM_IDLE) ? 'i' : '.',
- zram_get_priority(zram, index) ? 'r' : '.',
- zram_test_flag(zram, index,
- ZRAM_INCOMPRESSIBLE) ? 'n' : '.');
-
- if (count <= copied) {
- zram_slot_unlock(zram, index);
- break;
- }
- written += copied;
- count -= copied;
-next:
- zram_slot_unlock(zram, index);
- *ppos += 1;
- }
+ ++*pos;
+ if (*pos >= nr_pages)
+ return NULL;
+
+ return pos;
+}
+
+static void zram_block_state_stop(struct seq_file *seq, void *v)
+{
+ struct zram *zram = seq->private;
up_read(&zram->init_lock);
- if (copy_to_user(buf, kbuf, written))
- written = -EFAULT;
- kvfree(kbuf);
+}
- return written;
+static int zram_block_state_show(struct seq_file *seq, void *v)
+{
+ struct zram *zram = seq->private;
+ ssize_t index = *(loff_t *)v;
+ struct timespec64 ts;
+
+ zram_slot_lock(zram, index);
+ if (zram_allocated(zram, index)) {
+ ts = ktime_to_timespec64(zram->table[index].ac_time);
+ seq_printf(seq, "%12zd %12lld.%06lu %c%c%c%c%c%c\n",
+ index, (s64)ts.tv_sec,
+ ts.tv_nsec / NSEC_PER_USEC,
+ zram_test_flag(zram, index, ZRAM_SAME) ? 's' : '.',
+ zram_test_flag(zram, index, ZRAM_WB) ? 'w' : '.',
+ zram_test_flag(zram, index, ZRAM_HUGE) ? 'h' : '.',
+ zram_test_flag(zram, index, ZRAM_IDLE) ? 'i' : '.',
+ zram_get_priority(zram, index) ? 'r' : '.',
+ zram_test_flag(zram, index,
+ ZRAM_INCOMPRESSIBLE) ? 'n' : '.');
+ }
+ zram_slot_unlock(zram, index);
+
+ return 0;
}
-static const struct file_operations proc_zram_block_state_op = {
- .open = simple_open,
- .read = read_block_state,
- .llseek = default_llseek,
+static const struct seq_operations zram_block_state_sops = {
+ .start = zram_block_state_start,
+ .next = zram_block_state_next,
+ .stop = zram_block_state_stop,
+ .show = zram_block_state_show,
};
+DEFINE_SEQ_ATTRIBUTE(zram_block_state);
static void zram_debugfs_register(struct zram *zram)
{
@@ -931,7 +932,7 @@ static void zram_debugfs_register(struct zram *zram)
zram->debugfs_dir = debugfs_create_dir(zram->disk->disk_name,
zram_debugfs_root);
debugfs_create_file("block_state", 0400, zram->debugfs_dir,
- zram, &proc_zram_block_state_op);
+ zram, &zram_block_state_fops);
}
static void zram_debugfs_unregister(struct zram *zram)
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 536/816] ceph: wait for pending fscache write in write_folio_nounlock()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (534 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 535/816] zram: fix short reads from block_state Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 537/816] cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier() Greg Kroah-Hartman
` (284 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tal Zussman, Alex Markuze,
Ilya Dryomov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tal Zussman <tz2294@columbia.edu>
[ Upstream commit 3f7655f0d9186656c6f1cbc012a39c866d4aaabf ]
write_folio_nounlock() marks the folio with PG_private_2 via
ceph_set_page_fscache() and starts an async write to the cache via
ceph_fscache_write_to_cache(). PG_private_2 is only cleared once that
write completes.
If the OSD write fails, the error paths return without waiting for the
cache write. On retry, ceph_find_incompatible() would wait for
writeback, but not for PG_private_2, before calling
write_folio_nounlock() again, which would trip the VM_BUG_ON_FOLIO() in
folio_start_private_2().
Wait for any pending cache write before starting writeback on the
folio. Do so before bumping the writeback congestion count and
allocating the possibly mempool-backed OSD request, so that a thread
sleeping on the cache I/O does not hold either while it waits.
Add ceph_folio_wait_fscache(), a wrapper for folio_wait_private_2(), and
use it.
Fixes: 1702e7973410 ("ceph: add fscache writeback support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260804-remove-wait-on-page-writeback-v2-0-81f0ab065284%40columbia.edu?part=7
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
[ sashal: Adjusted the context line so the new helper is inserted above ceph_fscache_write_terminated(), which already takes the extra was_async parameter. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ceph/addr.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 7ad96fcdcd20c..01c9800bd8d07 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -560,6 +560,11 @@ static void ceph_set_page_fscache(struct page *page)
folio_start_private_2(page_folio(page)); /* [DEPRECATED] */
}
+static void ceph_folio_wait_fscache(struct folio *folio)
+{
+ folio_wait_private_2(folio); /* [DEPRECATED] */
+}
+
static void ceph_fscache_write_terminated(void *priv, ssize_t error, bool was_async)
{
struct inode *inode = priv;
@@ -581,6 +586,10 @@ static inline void ceph_set_page_fscache(struct page *page)
{
}
+static inline void ceph_folio_wait_fscache(struct folio *folio)
+{
+}
+
static inline void ceph_fscache_write_to_cache(struct inode *inode, u64 off, u64 len, bool caching)
{
}
@@ -784,6 +793,9 @@ static int write_folio_nounlock(struct folio *folio,
ceph_vinop(inode), folio, folio->index, page_off, wlen, snapc,
snapc->seq);
+ /* wait for a cache write left pending by a previously failed attempt */
+ ceph_folio_wait_fscache(folio);
+
if (atomic_long_inc_return(&fsc->writeback_count) >
CONGESTION_ON_THRESH(fsc->mount_options->congestion_kb))
fsc->write_congested = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 537/816] cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (535 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 536/816] ceph: wait for pending fscache write in write_folio_nounlock() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 538/816] net: dsa: mt7530: trap frames to conduit in MFC on EN7581 and AN7583 Greg Kroah-Hartman
` (283 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guopeng Zhang, Waiman Long,
Tejun Heo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit 10a6f00d82544a1baa901de8d28f41f28c364995 ]
Guopeng reports that changing the cpumask of a remote partition root
may set the effective_cpus of the top_cpuset incorrectly. It is
due to the following call sequence:
update_cpumask()
-> partition_cpus_change()
-> remote_cpus_update()
-> update_sibling_cpumasks()
-> update_cpumasks_hier()
-> remote_cpus_update()
The second remote_cpus_update() call passes in the cs->effective_xcpus
instead of the trialcs->effective_xcpus of the first remote_cpus_update()
call. As a result, the second call can revert what has been done in
the first call leading to incorrect effective_cpus of the top_cpuset
as well as subpartitions_cpus.
Fix that by adding a new remote_partition_updating flag into the cpuset
structure to indicate that a remote partition is being updated and
update_cpumasks_hier() should skip the whole subtree as update_cpumask()
or update_exclusive_cpumask() which calls partition_cpus_change()
will eventually calls update_cpumasks_hier() for that subtree anyway.
This new flag is currently set only in remote_cpus_update() to prevent
recursive call of remote_cpus_update() on the same cpuset.
A test case is added to test_cpuset_prs.sh to verify this change.
Reported-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Link: https://lore.kernel.org/lkml/20261010075947.333549-2-guopeng.zhang@linux.dev
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Fixes: f62a5d39368e ("cgroup/cpuset: Remove remote_partition_check() & make update_cpumasks_hier() handle remote partition")
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ sashal: Selftest row adapted to C1-6:X1-4:S+ for A1 (instead of CX1-6) so setup passes this tree's validation, and the kernel context uses the local compute_effective_exclusive_cpumask() and partition_xcpus_add() signatures. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset-internal.h | 5 +++++
kernel/cgroup/cpuset.c | 13 +++++++++----
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 1 +
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/kernel/cgroup/cpuset-internal.h b/kernel/cgroup/cpuset-internal.h
index 6c9916e85efd1..1f3fef06ee45b 100644
--- a/kernel/cgroup/cpuset-internal.h
+++ b/kernel/cgroup/cpuset-internal.h
@@ -162,6 +162,11 @@ struct cpuset {
/* partition root state */
int partition_root_state;
+ /*
+ * Set to true when a remote partition is undergoing update.
+ */
+ bool remote_partition_updating;
+
/*
* number of SCHED_DEADLINE tasks attached to this cpuset, so that we
* know when to rebuild associated root domain bandwidth information.
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index b1af98c19891e..99f8d505bea3a 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1590,6 +1590,7 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus,
goto invalidate;
}
+ cs->remote_partition_updating = true;
spin_lock_irq(&callback_lock);
if (adding)
isolcpus_updated += partition_xcpus_add(prs, NULL, tmp->addmask);
@@ -1612,6 +1613,7 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus,
*/
cpuset_update_tasks_cpumask(&top_cpuset, tmp->new_cpus);
update_sibling_cpumasks(&top_cpuset, NULL, tmp);
+ cs->remote_partition_updating = false;
return;
invalidate:
@@ -2075,16 +2077,19 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp,
old_prs = new_prs = cp->partition_root_state;
/*
- * For child remote partition root (!= cs), we need to call
- * remote_cpus_update() if effective_xcpus will be changed.
- * Otherwise, we can skip the whole subtree.
+ * For a child remote partition with remote_partition_updating
+ * set, we can skip the whole subtree as the this function will
+ * be called eventually. We can also skip the subtree if the
+ * effective_xcpus isn't going to be changed. Otherwise, we
+ * will have to call remote_cpus_update().
*
* remote_cpus_update() will reuse tmp->new_cpus only after
* its value is being processed.
*/
if (remote && (cp != cs)) {
compute_effective_exclusive_cpumask(cp, tmp->new_cpus, NULL);
- if (cpumask_equal(cp->effective_xcpus, tmp->new_cpus)) {
+ if (cp->remote_partition_updating ||
+ cpumask_equal(cp->effective_xcpus, tmp->new_cpus)) {
pos_css = css_rightmost_descendant(pos_css);
continue;
}
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index f6bc762705abc..f52678bb2efee 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -275,6 +275,7 @@ TEST_MATRIX=(
" C0-3:S+ C1-3:S+ C2-3 C4 X2-3 X2-3 X2-3:P2 P2:C4-5 0 A3:2-3|B1:4-5 A3:P2|B1:P2 2-5"
" C4:X0-3:S+ X1-3:S+ X2-3 . . P2 . . 0 A1:4|A2:1-3|A3:1-3 A2:P2 1-3"
" C4:X0-3:S+ X1-3:S+ X2-3 . . . P2 . 0 A1:4|A2:4|A3:2-3 A3:P2 2-3"
+ " C1-6:X1-4:S+ C1-4:P1 . C4-5 . C1-3 . . 0 A1:4-6|A2:1-3|B1:4-5 A2:P1"
# Nested remote/local partition tests
" C0-3:S+ C1-3:S+ C2-3 C4-5 X2-3 X2-3:P1 P2 P1 0 A1:0-1|A2:|A3:2-3|B1:4-5 \
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 538/816] net: dsa: mt7530: trap frames to conduit in MFC on EN7581 and AN7583
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (536 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 537/816] cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 539/816] tcp: Fix fastreuse cache initialization on first bind Greg Kroah-Hartman
` (282 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Tao Gong,
Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Gong <gongtao0607@gmail.com>
[ Upstream commit a58b221496dd576191095d12996f39cee58cf6a8 ]
On EN7581, STP BPDUs received on switch user ports never reach the CPU.
Like MT7531 and MT7988, EN7581 and AN7583 only set the CPU port bitmap
in MT7531_CFC and are skipped by mt753x_conduit_state_change(). On
EN7581 this is not enough: trapped BPDUs reach the CPU only when
MT7530_CPU_EN and MT7530_CPU_PORT are also set in MT753X_MFC. Add
EN7581 and AN7583 to mt753x_conduit_state_change().
Tested on an AN7581 board (Gemtek W1700K, airoha,en7581-switch), where
only lan3 and lan4 are switch user ports. With RSTP BPDUs arriving on
lan4:
- without this patch, none reached the CPU;
- setting CPU_EN and CPU_PORT by hand delivered them, and clearing them
stopped them;
- with this patch, they are received from boot.
Only BPDUs were tested. AN7583 is untested and is included because the
driver sets it up like EN7581.
Fixes: 2b0229f67932 ("net: dsa: mt7530: Add EN7581 support")
Fixes: d76556db10bf ("net: dsa: mt7530: Add AN7583 support")
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Signed-off-by: Tao Gong <gongtao0607@gmail.com>
Link: https://patch.msgid.link/20261022205649.2351696-1-gongtao0607@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Dropped the ID_EN7528 and ID_AN7583 references, which don't exist here, so the condition only adds ID_EN7581, and removed the AN7583 sentence from the comment. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/dsa/mt7530.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 8c9eafb6af7be..8db1095720c1e 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3137,9 +3137,11 @@ mt753x_conduit_state_change(struct dsa_switch *ds,
/* Set the CPU port to trap frames to for MT7530. Trapped frames will be
* forwarded to the numerically smallest CPU port whose conduit
- * interface is up.
+ * interface is up. On EN7581, trapped BPDUs do not reach the CPU port
+ * without this, even with the CPU port bitmap set.
*/
- if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
+ if (priv->id != ID_MT7530 && priv->id != ID_MT7621 &&
+ priv->id != ID_EN7581)
return;
mask = BIT(cpu_dp->index);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 539/816] tcp: Fix fastreuse cache initialization on first bind
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (537 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 538/816] net: dsa: mt7530: trap frames to conduit in MFC on EN7581 and AN7583 Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 540/816] tls: keep TX and RX hardware offload on the same device Greg Kroah-Hartman
` (281 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Zhewei Yuan,
Kuniyuki Iwashima, Jason Xing, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhewei Yuan <yzwlhm@gmail.com>
[ Upstream commit 947ccedf683ed6cc53c1f88ac9eb8747e4567ed6 ]
inet_csk_update_fastreuse() initializes the reuse caches only when
tb->bhash2 is empty, but both inet_csk_get_port() and
__inet_inherit_port() link tb2 before calling it, so the first-bind
branch is never taken.
As a result, SO_REUSEADDR binds never get fastreuse=1 and keep
scanning existing owners, and SO_REUSEPORT starts in STRICT instead
of ANY.
Initialize the caches when tb2 is the only entry in tb->bhash2 and has
no owners. Timewait sockets are also linked on tb2->owners, so this is
equivalent to the old hlist_empty(&tb->owners) test.
Found by manual code inspection and confirmed with GDB. Binding 16000
SO_REUSEADDR sockets to one address/port in a KVM guest takes 4.18 s
before and 19.4 ms after this patch. Existing bind/reuse selftests
pass. Analysis and testing were assisted by an AI tool (Codex).
Fixes: 8002d44fe84d ("tcp: Check hlist_empty(&tb->bhash2) instead of hlist_empty(&tb->owners).")
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Zhewei Yuan <yzwlhm@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://patch.msgid.link/20261026095208.58504-1-yzwlhm@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Added a tb2 parameter to inet_csk_update_fastreuse() and its two callers, since the older tree's function lacks it, so the new singular-bhash2 and empty-owners check can use it. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/inet_connection_sock.h | 1 +
net/ipv4/inet_connection_sock.c | 6 ++++--
net/ipv4/inet_hashtables.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 2ff01a8fbef2b..d97561e4bef8f 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -326,6 +326,7 @@ void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
/* update the fast reuse flag when adding a socket */
void inet_csk_update_fastreuse(struct inet_bind_bucket *tb,
+ struct inet_bind2_bucket *tb2,
struct sock *sk);
struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu);
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 5b6436e6f242c..c869986442ef3 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -443,12 +443,14 @@ static inline int sk_reuseport_match(struct inet_bind_bucket *tb,
}
void inet_csk_update_fastreuse(struct inet_bind_bucket *tb,
+ struct inet_bind2_bucket *tb2,
struct sock *sk)
{
kuid_t uid = sock_i_uid(sk);
bool reuse = sk->sk_reuse && sk->sk_state != TCP_LISTEN;
- if (hlist_empty(&tb->bhash2)) {
+ if (hlist_is_singular_node(&tb2->bhash_node, &tb->bhash2) &&
+ hlist_empty(&tb2->owners)) {
tb->fastreuse = reuse;
if (sk->sk_reuseport) {
tb->fastreuseport = FASTREUSEPORT_ANY;
@@ -572,7 +574,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
}
success:
- inet_csk_update_fastreuse(tb, sk);
+ inet_csk_update_fastreuse(tb, tb2, sk);
if (!inet_csk(sk)->icsk_bind_hash)
inet_bind_hash(sk, tb, tb2, port);
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index a597c176a5e45..ca6726a8c4a1d 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -277,7 +277,7 @@ int __inet_inherit_port(const struct sock *sk, struct sock *child)
}
}
if (update_fastreuse)
- inet_csk_update_fastreuse(tb, child);
+ inet_csk_update_fastreuse(tb, tb2, child);
inet_bind_hash(child, tb, tb2, port);
spin_unlock(&head2->lock);
spin_unlock(&head->lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 540/816] tls: keep TX and RX hardware offload on the same device
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (538 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 539/816] tcp: Fix fastreuse cache initialization on first bind Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 541/816] ksmbd: return complete and aligned stream information Greg Kroah-Hartman
` (280 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rishikesh Jethwani, Dave Miller,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rishikesh Jethwani <rjethwani@purestorage.com>
[ Upstream commit 1c8a70075235cd733095532a97f2405037c52a7b ]
After TX is offloaded on device A, a route change, or a change in the
usable-slave set of an 802.3ad or balance-xor (layer3+4) bond, can make
RX setup program device B. tls_device_attach() sees the existing TLS
destructor and keeps ctx->netdev pointing at A. The RX driver state on B
is then untracked: tls_dev_resync() and tls_dev_del() are invoked on A
for a context it never created, and neither socket close nor
NETDEV_DOWN on B calls tls_dev_del() for B, so the driver context leaks.
The reverse setup order has the same problem.
Check the shared device binding under device_offload_lock before each
tls_dev_add(). Permit the first attachment and a second direction on the
same device. Reject a different device, including when the old binding
was cleared by NETDEV_DOWN: the TLS destructor remains installed and
tls_device_attach() cannot establish a new binding. Setup then falls
back to software for the requested direction.
The RX check precedes allocation and software setup. TX uses its existing
resource unwind path without calling the driver. Document the shared
binding and clarify that fallback is per direction.
This issue was discovered during code review and subsequently
reproduced on hardware using mlx5 and TLS 1.2 AES-GCM-128.
Changing the route between TX and RX setup installed the second
direction on a different device. Driver traces showed successful adds
on both devices, but both deletes at socket close targeted the first
device, leaving an orphaned context on the second. Both setup orders
reproduced the leak, even though all current core TLS context counters
returned to zero. No crash was observed.
With the fix, the same tests correctly fall back to software for the
second direction and leave no orphaned hardware context.
Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload")
Signed-off-by: Rishikesh Jethwani <rjethwani@purestorage.com>
Signed-off-by: Dave Miller <davem@davem-thinkpadp1gen8.ibmlond.csb>
[ sashal: Replaced kzalloc_obj(*context) with kzalloc(sizeof(*context), GFP_KERNEL) in tls_set_device_offload_rx() because the kzalloc_obj helper is not available. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/networking/tls-offload.rst | 16 ++++++++++------
net/tls/tls_device.c | 24 ++++++++++++++++++++++++
2 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/Documentation/networking/tls-offload.rst b/Documentation/networking/tls-offload.rst
index 5f0dea3d571e3..371cbd2824c65 100644
--- a/Documentation/networking/tls-offload.rst
+++ b/Documentation/networking/tls-offload.rst
@@ -76,12 +76,16 @@ During driver initialization device sets the ``NETIF_F_HW_TLS_RX`` and
pointer in the :c:member:`tlsdev_ops` member of the
:c:type:`struct net_device <net_device>`.
-When TLS cryptographic connection state is installed on a ``ktls`` socket
-(note that it is done twice, once for RX and once for TX direction,
-and the two are completely independent), the kernel checks if the underlying
-network device is offload-capable and attempts the offload. In case offload
-fails the connection is handled entirely in software using the same mechanism
-as if the offload was never tried.
+TLS cryptographic connection state is installed separately for RX and TX
+on a ``ktls`` socket. For each direction, the kernel checks if the underlying
+network device is offload-capable and attempts the offload. If offload fails,
+that direction is handled in software as if offload had never been tried.
+
+Both hardware directions share one device binding. Once one direction is
+offloaded, the other direction must use the same device. If a route change
+selects a different device, or ``NETDEV_DOWN`` has cleared the binding,
+hardware offload of the other direction is declined and it uses software
+instead.
Offload request is performed via the :c:member:`tls_dev_add` callback of
:c:type:`struct tlsdev_ops <tlsdev_ops>`:
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index 099cf5d093689..02a77f2a7a55f 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -1030,6 +1030,20 @@ int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx)
return tls_device_reencrypt(sk, tls_ctx);
}
+/* Both directions share ctx->netdev. A second direction must use that
+ * device; after NETDEV_DOWN clears it, no new direction can be offloaded.
+ */
+static bool tls_device_can_attach(struct tls_context *ctx, struct sock *sk,
+ struct net_device *netdev)
+{
+ struct net_device *ctx_netdev;
+
+ ctx_netdev = rcu_dereference_protected(ctx->netdev,
+ lockdep_is_held(&device_offload_lock));
+ return sk->sk_destruct != tls_device_sk_destruct ||
+ ctx_netdev == netdev;
+}
+
static void tls_device_attach(struct tls_context *ctx, struct sock *sk,
struct net_device *netdev)
{
@@ -1165,6 +1179,11 @@ int tls_set_device_offload(struct sock *sk)
goto release_lock;
}
+ if (!tls_device_can_attach(ctx, sk, netdev)) {
+ rc = -EOPNOTSUPP;
+ goto release_lock;
+ }
+
ctx->priv_ctx_tx = offload_ctx;
rc = netdev->tlsdev_ops->tls_dev_add(netdev, sk, TLS_OFFLOAD_CTX_DIR_TX,
&ctx->crypto_send.info,
@@ -1235,6 +1254,11 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx)
goto release_lock;
}
+ if (!tls_device_can_attach(ctx, sk, netdev)) {
+ rc = -EOPNOTSUPP;
+ goto release_lock;
+ }
+
context = kzalloc(sizeof(*context), GFP_KERNEL);
if (!context) {
rc = -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 541/816] ksmbd: return complete and aligned stream information
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (539 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 540/816] tls: keep TX and RX hardware offload on the same device Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 542/816] block: dont enter reclaim under rq_qos_mutex Greg Kroah-Hartman
` (279 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 206fc30f71b005156085fd8523ccc84a2c67791b ]
FILE_STREAM_INFORMATION responses are assembled without aligning entries
and truncated to the client buffer length after the fact. A short query
can therefore return STATUS_BUFFER_OVERFLOW with an incomplete entry and
a nonzero NextEntryOffset, which clients may reject as an invalid
network response. Standalone queries can also exhaust the server
response buffer and silently omit streams while reporting success.
Allocate the same large response buffer used by other variable-length
QUERY_INFO classes for stream queries. Pack only complete entries within
the requested output length and available response space, aligning each
entry to eight bytes and sizing names after UTF-16 conversion. Return
STATUS_BUFFER_OVERFLOW when more entries remain, using an SMB2 error
response if no entry fits.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Fixes: 6b8b79226bc3 ("ksmbd: fix partial file information responses")
Link: https://github.com/namjaejeon/ksmbd/issues/522#issuecomment-6391152923
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Dropped the FILE_NORMALIZED_NAME_INFORMATION context from the smb2_allocate_rsp_buf() check, since this tree lacks it, and kept only the added FILE_STREAM_INFORMATION condition. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 183 +++++++++++++++++++++++++---------------
1 file changed, 115 insertions(+), 68 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 5492e7490a26b..115960cc93994 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -554,7 +554,8 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work)
req = smb_get_msg(work->request_buf);
if ((req->InfoType == SMB2_O_INFO_FILE &&
(req->FileInfoClass == FILE_FULL_EA_INFORMATION ||
- req->FileInfoClass == FILE_ALL_INFORMATION)) ||
+ req->FileInfoClass == FILE_ALL_INFORMATION ||
+ req->FileInfoClass == FILE_STREAM_INFORMATION)) ||
req->InfoType == SMB2_O_INFO_SECURITY)
sz = large_sz;
}
@@ -5225,41 +5226,107 @@ static void get_file_alternate_info(struct ksmbd_work *work,
cpu_to_le32(struct_size(file_info, FileName, conv_len));
}
+struct smb2_stream_info_buffer {
+ struct smb2_query_info_rsp *rsp;
+ struct smb2_file_stream_info *last;
+ const struct nls_table *local_nls;
+ unsigned int length;
+ unsigned int capacity;
+};
+
+static int smb2_add_stream_info(struct smb2_stream_info_buffer *buf,
+ const char *name, loff_t size, u64 allocation_size)
+{
+ struct smb2_file_stream_info *file_info;
+ __le16 *utf16_name;
+ size_t name_len = strlen(name);
+ unsigned int offset = ALIGN(buf->length, 8), name_bytes;
+ int conv_len, ret = 0;
+
+ if (offset > buf->capacity ||
+ buf->capacity - offset < sizeof(*file_info))
+ return -ENOSPC;
+
+ utf16_name = kmalloc_array(name_len + 1, sizeof(*utf16_name),
+ KSMBD_DEFAULT_GFP);
+ if (!utf16_name)
+ return -ENOMEM;
+
+ conv_len = smbConvertToUTF16(utf16_name, name, name_len,
+ buf->local_nls, 0);
+ if (conv_len < 0) {
+ ret = conv_len;
+ goto out;
+ }
+
+ name_bytes = conv_len * sizeof(*utf16_name);
+ if (name_bytes > buf->capacity - offset - sizeof(*file_info)) {
+ ret = -ENOSPC;
+ goto out;
+ }
+
+ file_info = (struct smb2_file_stream_info *)&buf->rsp->Buffer[offset];
+ if (buf->last) {
+ memset(&buf->rsp->Buffer[buf->length], 0, offset - buf->length);
+ buf->last->NextEntryOffset =
+ cpu_to_le32((char *)file_info - (char *)buf->last);
+ }
+ file_info->NextEntryOffset = 0;
+ file_info->StreamNameLength = cpu_to_le32(name_bytes);
+ file_info->StreamSize = cpu_to_le64(size);
+ file_info->StreamAllocationSize = cpu_to_le64(allocation_size);
+ memcpy(file_info->StreamName, utf16_name, name_bytes);
+
+ buf->last = file_info;
+ buf->length = offset + sizeof(*file_info) + name_bytes;
+out:
+ kfree(utf16_name);
+ return ret;
+}
+
static int get_file_stream_info(struct ksmbd_work *work,
+ struct smb2_query_info_req *req,
struct smb2_query_info_rsp *rsp,
- struct ksmbd_file *fp,
- void *rsp_org)
+ struct ksmbd_file *fp)
{
- struct ksmbd_conn *conn = work->conn;
- struct smb2_file_stream_info *file_info;
+ struct smb2_stream_info_buffer buf = {
+ .rsp = rsp,
+ .local_nls = work->conn->local_nls,
+ };
char *stream_name, *xattr_list = NULL, *stream_buf;
struct kstat stat;
const struct path *path = &fp->filp->f_path;
ssize_t xattr_list_len;
ssize_t slen;
loff_t ssize;
- int nbytes = 0, streamlen, stream_name_len, next, idx = 0;
+ unsigned int req_output_len = le32_to_cpu(req->OutputBufferLength);
+ int streamlen, idx = 0;
int buf_free_len;
int ret;
+ if (req_output_len < FILE_STREAM_INFORMATION_SIZE) {
+ rsp->hdr.Status = STATUS_INFO_LENGTH_MISMATCH;
+ return -EINVAL;
+ }
+
+ buf_free_len = smb2_calc_max_out_buf_len(work,
+ offsetof(struct smb2_query_info_rsp, Buffer),
+ req_output_len);
+ if (buf_free_len < 0)
+ return buf_free_len;
+ buf.capacity = buf_free_len;
+
ret = vfs_getattr(&fp->filp->f_path, &stat, STATX_BASIC_STATS,
AT_STATX_SYNC_AS_STAT);
if (ret)
return ret;
- file_info = (struct smb2_file_stream_info *)rsp->Buffer;
-
- buf_free_len = smb2_resp_buf_len(work,
- offsetof(struct smb2_query_info_rsp, Buffer));
- if (buf_free_len < 0)
- goto out;
-
xattr_list_len = ksmbd_vfs_listxattr(path->dentry, &xattr_list);
if (xattr_list_len < 0) {
- goto out;
+ goto default_stream;
} else if (!xattr_list_len) {
ksmbd_debug(SMB, "empty xattr in the file\n");
- goto out;
+ goto default_stream;
}
while (idx < xattr_list_len) {
@@ -5269,69 +5336,49 @@ static int get_file_stream_info(struct ksmbd_work *work,
ksmbd_debug(SMB, "%s, len %d\n", stream_name, streamlen);
- if (strncmp(&stream_name[XATTR_USER_PREFIX_LEN],
- STREAM_PREFIX, STREAM_PREFIX_LEN))
+ if (strncmp(stream_name, XATTR_NAME_STREAM,
+ XATTR_NAME_STREAM_LEN))
continue;
- stream_name_len = streamlen - (XATTR_USER_PREFIX_LEN +
- STREAM_PREFIX_LEN);
- streamlen = stream_name_len;
-
- /* plus : size */
- streamlen += 1;
- stream_buf = kmalloc(streamlen + 1, KSMBD_DEFAULT_GFP);
- if (!stream_buf)
- break;
-
- streamlen = snprintf(stream_buf, streamlen + 1,
- ":%s", &stream_name[XATTR_NAME_STREAM_LEN]);
-
- next = sizeof(struct smb2_file_stream_info) + streamlen * 2;
- /* smbConvertToUTF16() also writes a terminating UTF-16 unit. */
- if (next + sizeof(__le16) > buf_free_len) {
- kfree(stream_buf);
- break;
+ stream_buf = kasprintf(KSMBD_DEFAULT_GFP, ":%s",
+ &stream_name[XATTR_NAME_STREAM_LEN]);
+ if (!stream_buf) {
+ ret = -ENOMEM;
+ goto out;
}
-
- file_info = (struct smb2_file_stream_info *)&rsp->Buffer[nbytes];
- streamlen = smbConvertToUTF16((__le16 *)file_info->StreamName,
- stream_buf, streamlen,
- conn->local_nls, 0);
- streamlen *= 2;
- kfree(stream_buf);
- file_info->StreamNameLength = cpu_to_le32(streamlen);
slen = ksmbd_vfs_xattr_len(file_mnt_idmap(fp->filp),
path->dentry, stream_name);
ssize = slen < 0 ? 0 : (loff_t)slen;
- file_info->StreamSize = cpu_to_le64(ssize);
- file_info->StreamAllocationSize = cpu_to_le64(ssize);
+ ret = smb2_add_stream_info(&buf, stream_buf, ssize, ssize);
+ kfree(stream_buf);
+ if (ret == -ENOSPC)
+ goto overflow;
+ if (ret)
+ goto out;
+ }
- nbytes += next;
- buf_free_len -= next;
- file_info->NextEntryOffset = cpu_to_le32(next);
+default_stream:
+ if (!S_ISDIR(stat.mode)) {
+ ret = smb2_add_stream_info(&buf, "::$DATA", stat.size,
+ stat.blocks << 9);
+ if (ret == -ENOSPC)
+ goto overflow;
+ if (ret)
+ goto out;
}
+ ret = 0;
+ goto out;
+
+overflow:
+ rsp->hdr.Status = STATUS_BUFFER_OVERFLOW;
+ /* An empty overflow needs an SMB2 error response. */
+ ret = buf.length ? 0 : -EOVERFLOW;
out:
- if (!S_ISDIR(stat.mode) &&
- buf_free_len >= sizeof(struct smb2_file_stream_info) + (7 + 1) * 2) {
- file_info = (struct smb2_file_stream_info *)
- &rsp->Buffer[nbytes];
- streamlen = smbConvertToUTF16((__le16 *)file_info->StreamName,
- "::$DATA", 7, conn->local_nls, 0);
- streamlen *= 2;
- file_info->StreamNameLength = cpu_to_le32(streamlen);
- file_info->StreamSize = cpu_to_le64(stat.size);
- file_info->StreamAllocationSize = cpu_to_le64(stat.blocks << 9);
- nbytes += sizeof(struct smb2_file_stream_info) + streamlen;
- }
-
- /* last entry offset should be 0 */
- file_info->NextEntryOffset = 0;
+ if (!ret)
+ rsp->OutputBufferLength = cpu_to_le32(buf.length);
kvfree(xattr_list);
-
- rsp->OutputBufferLength = cpu_to_le32(nbytes);
-
- return 0;
+ return ret;
}
static int get_file_internal_info(struct smb2_query_info_rsp *rsp,
@@ -5606,7 +5653,7 @@ static int smb2_get_info_file(struct ksmbd_work *work,
break;
case FILE_STREAM_INFORMATION:
- rc = get_file_stream_info(work, rsp, fp, work->response_buf);
+ rc = get_file_stream_info(work, req, rsp, fp);
break;
case FILE_INTERNAL_INFORMATION:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 542/816] block: dont enter reclaim under rq_qos_mutex
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (540 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 541/816] ksmbd: return complete and aligned stream information Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 543/816] tls: Honor O_NONBLOCK in tls_sw_splice_read() Greg Kroah-Hartman
` (278 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Josef Bacik, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 045cbfc369f5929ed473f7c200dc2e8146569ce5 ]
ioc_qos_write() and the wbt_lat_usec writers take rq_qos_mutex with the
queue frozen, blkcg_deactivate_policy() does the same with blkcg_mutex,
so nothing holding either may wait for IO. blkg_conf_prep() got
GFP_NOIO for the blkg in commit 5d726c4dbeed, but the
radix_tree_preload() right after it, the policy init functions and the
GFP_KERNEL fallback in blkcg_activate_policy() can still enter reclaim
there. lockdep reports the cycle on the first write to io.max.
Use GFP_NOIO for all of them.
Fixes: 9730763f4756 ("block: correct locking order for protecting blk-wbt parameters")
Fixes: 5d726c4dbeed ("blk-cgroup: fix possible deadlock while configuring policy")
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://patch.msgid.link/20261028164415.1262013-35-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Replaced kzalloc_obj(*ioc, GFP_NOIO) and the kzalloc_obj(*blkiolat, GFP_NOIO) call with plain kzalloc(sizeof(...), GFP_NOIO), since kzalloc_obj doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-cgroup.c | 13 +++++++++----
block/blk-iocost.c | 5 +++--
block/blk-iolatency.c | 3 ++-
block/blk-throttle.c | 3 ++-
4 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index d1f3d3491bd36..9e8a89b439611 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -884,7 +884,11 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
parent = blkcg_parent(parent);
}
- /* Drop locks to do new blkg allocation with GFP_KERNEL. */
+ /*
+ * Drop the spinlock to allocate the new blkg. rq_qos_mutex and
+ * blkcg_mutex stay held, and both are taken with the queue
+ * frozen elsewhere: GFP_NOIO.
+ */
spin_unlock_irq(&q->queue_lock);
new_blkg = blkg_alloc(pos, disk, GFP_NOIO);
@@ -893,7 +897,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
goto fail_exit;
}
- if (radix_tree_preload(GFP_KERNEL)) {
+ if (radix_tree_preload(GFP_NOIO)) {
blkg_free(new_blkg);
ret = -ENOMEM;
goto fail_exit;
@@ -1598,7 +1602,8 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
if (!pd) {
/*
* GFP_NOWAIT failed. Free the existing one and
- * prealloc for @blkg w/ GFP_KERNEL.
+ * prealloc for @blkg w/ GFP_NOIO: blkcg_mutex is held,
+ * and a bio based queue has not been frozen above.
*/
if (pinned_blkg)
blkg_put(pinned_blkg);
@@ -1610,7 +1615,7 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
if (pd_prealloc)
pol->pd_free_fn(pd_prealloc);
pd_prealloc = pol->pd_alloc_fn(disk, blkg->blkcg,
- GFP_KERNEL);
+ GFP_NOIO);
if (pd_prealloc)
goto retry;
else
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index c7097b5c39c3a..29bfbfdb43750 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2982,11 +2982,12 @@ static int blk_iocost_init(struct gendisk *disk)
struct ioc *ioc;
int i, cpu, ret;
- ioc = kzalloc(sizeof(*ioc), GFP_KERNEL);
+ /* The caller holds rq_qos_mutex, which is taken with the queue frozen */
+ ioc = kzalloc(sizeof(*ioc), GFP_NOIO);
if (!ioc)
return -ENOMEM;
- ioc->pcpu_stat = alloc_percpu(struct ioc_pcpu_stat);
+ ioc->pcpu_stat = alloc_percpu_gfp(struct ioc_pcpu_stat, GFP_NOIO);
if (!ioc->pcpu_stat) {
kfree(ioc);
return -ENOMEM;
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index a82ee8c408c2f..3e3667159624f 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -761,7 +761,8 @@ static int blk_iolatency_init(struct gendisk *disk)
struct blk_iolatency *blkiolat;
int ret;
- blkiolat = kzalloc(sizeof(*blkiolat), GFP_KERNEL);
+ /* The caller holds rq_qos_mutex, which is taken with the queue frozen */
+ blkiolat = kzalloc(sizeof(*blkiolat), GFP_NOIO);
if (!blkiolat)
return -ENOMEM;
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 35b35b34cad5f..3e950426c6643 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1211,7 +1211,8 @@ static int blk_throtl_init(struct gendisk *disk)
struct throtl_data *td;
int ret;
- td = kzalloc_node(sizeof(*td), GFP_KERNEL, q->node);
+ /* The caller holds rq_qos_mutex, which is taken with the queue frozen */
+ td = kzalloc_node(sizeof(*td), GFP_NOIO, q->node);
if (!td)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 543/816] tls: Honor O_NONBLOCK in tls_sw_splice_read()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (541 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 542/816] block: dont enter reclaim under rq_qos_mutex Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 544/816] ppp: linearize and segment bridged packets when required Greg Kroah-Hartman
` (277 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <cel@kernel.org>
[ Upstream commit 78ded647d43e335891f981f68c5992a2e763cfcc ]
tls_sw_splice_read() takes its blocking behavior from
SPLICE_F_NONBLOCK alone. When splicing from a socket to a pipe,
do_splice() sets that flag from the pipe's O_NONBLOCK, not the
socket's. On a nonblocking socket, a splice(2) call without
SPLICE_F_NONBLOCK therefore sleeps in tls_rx_rec_wait() until a
record arrives. tcp_splice_read() instead reads sock->file->f_flags
and returns -EAGAIN.
Polling first does not avoid the sleep once tls_sw_splice_read()
consumes zero-length records, as it does after a later patch in this
series. tls_sw_sock_is_readable() reports the socket readable while
any record sits on rx_list, including a zero-length record that
delivers no bytes to the pipe. For TLS 1.3 the strparser announces a
record before decryption, when its plaintext length is still unknown,
so the readiness test cannot screen such a record out. A splice that
consumes the record and waits for the next stalls every connection
an event loop multiplexes.
An LLM audit of the TLS read paths found this defect.
Treat the socket's O_NONBLOCK as nonblocking too. A caller that
sets O_NONBLOCK on the socket and splices without SPLICE_F_NONBLOCK
now gets -EAGAIN where the splice blocked before. sendfile(2) from
a TLS socket changes the same way, because do_sendfile() leaves the
input file's O_NONBLOCK out of the splice flags. Both now behave as
they do on a plain TCP socket.
Fixes: c46234ebb4d1 ("tls: RX path for ktls")
Signed-off-by: Chuck Lever <cel@kernel.org>
Link: https://patch.msgid.link/20261027015215.605919-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Adapted the tls_rx_rec_wait() call to keep this tree's extra NULL psock argument while passing the new nonblock variable. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tls/tls_sw.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index bc2848d79c7d8..1b188f8fe45dc 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2298,10 +2298,14 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
struct tls_msg *tlm;
struct sk_buff *skb;
ssize_t copied = 0;
+ bool nonblock;
int chunk;
int err;
- err = tls_rx_reader_lock(sk, ctx, flags & SPLICE_F_NONBLOCK);
+ nonblock = flags & SPLICE_F_NONBLOCK ||
+ sock->file->f_flags & O_NONBLOCK;
+
+ err = tls_rx_reader_lock(sk, ctx, nonblock);
if (err < 0)
return err;
@@ -2315,8 +2319,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
} else {
struct tls_decrypt_arg darg;
- err = tls_rx_rec_wait(sk, NULL, flags & SPLICE_F_NONBLOCK,
- true, false);
+ err = tls_rx_rec_wait(sk, NULL, nonblock, true, false);
if (err <= 0)
goto splice_read_end;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 544/816] ppp: linearize and segment bridged packets when required
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (542 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 543/816] tls: Honor O_NONBLOCK in tls_sw_splice_read() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 545/816] blk-mq: dont trust the cookie in blk_mq_poll() Greg Kroah-Hartman
` (276 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Qingfang Deng, Eric Dumazet,
Felix Fietkau, Pablo Neira Ayuso, Simon Horman, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 0de4e69cd021c99d0aa13e1f30aafd13ad74a2a5 ]
PPP channel bridging hands packets received on one channel directly to
the start_xmit() of another. Packets received by PPPoE can be
non-linear, GSO since commit 55a5d8fca836 ("net: pppoe: implement
GRO/GSO support"), or CHECKSUM_PARTIAL when injected with a
virtio_net_hdr. The regular transmit path never sees such packets, and
only PPPoE, which uses dev_queue_xmit(), handles them:
- PPP Async reads the whole packet through skb->data, transmitting
unrelated memory for non-linear packets.
- PPP Async and Sync send GSO packets as single frames of up to 64KB,
and CHECKSUM_PARTIAL packets with a bad L4 checksum.
- PPTP and L2TP cannot segment a TCP GSO packet once their GRE or UDP
header is pushed, and do not finish pending checksums.
Add a xmit_offload flag to struct ppp_channel, set for PPPoE. For other
channels, segment GSO packets in software, using the PPP protocol field
as the L2 header, finish CHECKSUM_PARTIAL checksums (including SCTP
CRC32c), and linearize packets for channels without direct_xmit, as
ppp_push() does. Packets are dropped if any step fails, or if the
channel is busy, as before.
skb->dev is NULL at this point for PPPoE (cleared by __sk_receive_skb()),
and tunnel and IPv6 UFO GSO handlers dereference it: only TCP, UDP L4
and fraglist GSO packets without encapsulation are segmented, others
are dropped.
Receive paths like L2TP pull headers without updating the checksum
state, possibly leaving a CHECKSUM_PARTIAL state with csum_start before
skb->data. Reset it to CHECKSUM_NONE, as skb_postpull_rcsum() does, so
that skb_checksum_help() does not warn, and so that PPPoE does not
offload a checksum at a wrong offset.
Tested in a VM by bridging PPPoE (on a TAP with IFF_NAPI_FRAGS, or on
veth) to PPP Async on a PTY, PPPoL2TP and PPPoE: non-linear packets no
longer leak garbage, GSO packets (including fraglist GRO) are sent as
valid segments for IPv4 and IPv6, CHECKSUM_PARTIAL packets get a valid
checksum, and PPPoE still receives GSO packets unchanged.
Fixes: 4cf476ced45d ("ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls")
Fixes: 55a5d8fca836 ("net: pppoe: implement GRO/GSO support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260908072135.877364-1-qingfang.deng@linux.dev
Co-developed-by: Qingfang Deng <qingfang.deng@linux.dev>
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261026155927.707655-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Dropped SKB_GSO_TCP_ACCECN from the GSO whitelist because it isn't defined here, and adjusted includes and the pppoe_connect() prototype context (struct sockaddr). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ppp/ppp_generic.c | 95 ++++++++++++++++++++++++++++++++++-
drivers/net/ppp/pppoe.c | 1 +
include/linux/ppp_channel.h | 1 +
3 files changed, 95 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 4d4591ea443a9..84212fd05968b 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -46,6 +46,7 @@
#include <linux/slab.h>
#include <linux/file.h>
#include <linux/unaligned.h>
+#include <net/gso.h>
#include <net/slhc_vj.h>
#include <linux/atomic.h>
#include <linux/refcount.h>
@@ -2274,6 +2275,73 @@ static bool ppp_decompress_proto(struct sk_buff *skb)
return pskb_may_pull(skb, 2);
}
+#define PPP_BRIDGE_GSO_TYPES (SKB_GSO_TCPV4 | SKB_GSO_TCPV6 | \
+ SKB_GSO_TCP_ECN | \
+ SKB_GSO_TCP_FIXEDID | SKB_GSO_UDP_L4 | \
+ SKB_GSO_FRAGLIST | SKB_GSO_DODGY)
+
+/* Segment a GSO packet (built by PPPoE GRO, or injected with a
+ * virtio_net_hdr) before sending it to a bridged channel that does
+ * not accept GSO packets.
+ * skb->data points to the PPP protocol field, which is replicated
+ * in front of each segment.
+ * Returns a list of segments, or NULL if the packet was dropped.
+ */
+static struct sk_buff *ppp_bridge_gso_segment(struct sk_buff *skb,
+ netdev_features_t features)
+{
+ struct sk_buff *segs;
+
+ /* skb->dev is NULL here (cleared by __sk_receive_skb() for PPPoE),
+ * and some GSO handlers (tunnels, IPv6 UFO) dereference it.
+ */
+ if (skb->encapsulation ||
+ (skb_shinfo(skb)->gso_type & ~PPP_BRIDGE_GSO_TYPES))
+ goto drop;
+
+ if (!pskb_may_pull(skb, PPP_PROTO_LEN))
+ goto drop;
+
+ switch (get_unaligned((__be16 *)skb->data)) {
+ case htons(PPP_IP):
+ skb->protocol = htons(ETH_P_IP);
+ break;
+ case htons(PPP_IPV6):
+ skb->protocol = htons(ETH_P_IPV6);
+ break;
+ default:
+ goto drop;
+ }
+ skb_set_network_header(skb, PPP_PROTO_LEN);
+
+ /* No checksum offload: skb_segment() computes the checksums. */
+ segs = skb_gso_segment(skb, features);
+ if (IS_ERR_OR_NULL(segs))
+ goto drop;
+
+ consume_skb(skb);
+ return segs;
+
+drop:
+ kfree_skb(skb);
+ return NULL;
+}
+
+static void ppp_bridge_xmit(struct ppp_channel *chan, struct sk_buff *skb)
+{
+ if (!chan->direct_xmit && skb_linearize(skb))
+ goto drop;
+
+ if (!chan->xmit_offload && skb->ip_summed == CHECKSUM_PARTIAL &&
+ skb_csum_hwoffload_help(skb, 0))
+ goto drop;
+
+ if (chan->ops->start_xmit(chan, skb))
+ return;
+drop:
+ kfree_skb(skb);
+}
+
/* Attempt to handle a frame via. a bridged channel, if one exists.
* If the channel is bridged, the frame is consumed by the bridge.
* If not, the caller must handle the frame by normal recv mechanisms.
@@ -2281,6 +2349,8 @@ static bool ppp_decompress_proto(struct sk_buff *skb)
*/
static bool ppp_channel_bridge_input(struct channel *pch, struct sk_buff *skb)
{
+ struct sk_buff *segs, *next;
+ struct ppp_channel *chan;
struct channel *pchb;
rcu_read_lock();
@@ -2296,8 +2366,29 @@ static bool ppp_channel_bridge_input(struct channel *pch, struct sk_buff *skb)
}
skb_scrub_packet(skb, !net_eq(pch->chan_net, pchb->chan_net));
- if (!pchb->chan->ops->start_xmit(pchb->chan, skb))
- kfree_skb(skb);
+
+ /* Receive paths such as L2TP pull headers without updating
+ * the checksum state: drop a stale CHECKSUM_PARTIAL state
+ * pointing before skb->data, as skb_postpull_rcsum() does.
+ */
+ if (skb->ip_summed == CHECKSUM_PARTIAL &&
+ skb_checksum_start_offset(skb) < 0)
+ skb->ip_summed = CHECKSUM_NONE;
+
+ chan = pchb->chan;
+ if (!chan->xmit_offload && skb_is_gso(skb)) {
+ /* Channels needing linear packets get linear segments,
+ * others keep references to the original pages.
+ */
+ segs = ppp_bridge_gso_segment(skb, chan->direct_xmit ?
+ NETIF_F_SG : 0);
+ skb_list_walk_safe(segs, skb, next) {
+ skb_mark_not_on_list(skb);
+ ppp_bridge_xmit(chan, skb);
+ }
+ } else {
+ ppp_bridge_xmit(chan, skb);
+ }
outl:
spin_unlock_bh(&pchb->downl);
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index 97eb18dbc312e..0a7d5f756f41a 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -698,6 +698,7 @@ static int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr,
po->chan.private = sk;
po->chan.ops = &pppoe_chan_ops;
po->chan.direct_xmit = true;
+ po->chan.xmit_offload = true;
error = ppp_register_net_channel(dev_net(dev), &po->chan);
if (error) {
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h
index f73fbea0dbc23..d0646c2518b2a 100644
--- a/include/linux/ppp_channel.h
+++ b/include/linux/ppp_channel.h
@@ -43,6 +43,7 @@ struct ppp_channel {
void *ppp; /* opaque to channel */
int speed; /* transfer rate (bytes/second) */
bool direct_xmit; /* no qdisc, xmit directly */
+ bool xmit_offload; /* accepts GSO and CHECKSUM_PARTIAL skbs */
};
#ifdef __KERNEL__
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 545/816] blk-mq: dont trust the cookie in blk_mq_poll()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (543 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 544/816] ppp: linearize and segment bridged packets when required Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 546/816] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts Greg Kroah-Hartman
` (275 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Christoph Hellwig,
Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 24974185999fd80b676fbe2a6c7a97bbd38aaf3a ]
blk_mq_poll() indexes queue_hw_ctx[] with bio->bi_cookie unchecked. Zone
write plugging keeps the segment count of a plugged write in
__bi_nr_segments, which shares a union with the cookie, and clears
REQ_POLLED, but bio_poll() only looks at the cookie. A plugged polled
write with more segments than there are hardware queues reads past the
array. The bio is also SLAB_TYPESAFE_BY_RCU, so a cookie from a bio
reused for another device can meet the wrong array as well.
Ignore a cookie that is out of range or doesn't name a poll queue.
Fixes: 3e08773c3841 ("block: switch polling to be bio based")
Fixes: dd291d77cc90 ("block: Introduce zone write plugging")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20261028164415.1262013-28-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-mq.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 65a08aec007d2..63480b913e352 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -5150,9 +5150,22 @@ static int blk_hctx_poll(struct request_queue *q, struct blk_mq_hw_ctx *hctx,
int blk_mq_poll(struct request_queue *q, blk_qc_t cookie,
struct io_comp_batch *iob, unsigned int flags)
{
+ struct blk_mq_hw_ctx *hctx;
+
if (!blk_mq_can_poll(q))
return 0;
- return blk_hctx_poll(q, xa_load(&q->hctx_table, cookie), iob, flags);
+
+ /*
+ * The cookie is no more than a hint. iocb_bio_iopoll() may have read it
+ * from a bio that was reused for another queue right afterwards, and
+ * zone write plugging keeps the number of segments in the same field.
+ */
+ if (cookie >= q->nr_hw_queues)
+ return 0;
+ hctx = xa_load(&q->hctx_table, cookie);
+ if (!hctx || hctx->type != HCTX_TYPE_POLL)
+ return 0;
+ return blk_hctx_poll(q, hctx, iob, flags);
}
int blk_rq_poll(struct request *rq, struct io_comp_batch *iob,
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 546/816] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (544 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 545/816] blk-mq: dont trust the cookie in blk_mq_poll() Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 547/816] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails Greg Kroah-Hartman
` (274 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1269fe6cc2016008124e,
Kuniyuki Iwashima, Naman Gulati, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naman Gulati <namangulati@google.com>
[ Upstream commit fd0909e963ed8f36967bd072ed484be7babe46de ]
netdev_wait_allrefs_any() re-sends NETDEV_UNREGISTER every second while
it waits for the last references on a device to be dropped. By then
netdev_run_todo() has already marked the device NETREG_UNREGISTERED and
RTNL has been dropped at least once since the initial notification sent
by unregister_netdevice_many_notify().
netdev_genl_netdevice_event() does not tell these rebroadcasts apart
from the initial notification and sends a NETDEV_CMD_DEV_DEL_NTF
multicast for each of them. At best this spams NETDEV_NLGRP_MGMT
listeners with duplicate notifications; at worst the pernet state of
the netns the device belongs to is already gone and the handler
dereferences a NULL pointer.
default_device_exit_batch() only unregisters the devices still listed
in the exiting netns; it does not wait for in-flight unregistrations of
devices that were already unlisted (the barrier doing that was removed
by commit 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()")).
So when a device is unregistered by something other than the
cleanup_net() of its own netns while references on it are still held,
e.g. a veth whose peer in another netns gets deleted, and that netns
exits while the device is stuck in netdev_wait_allrefs_any(), the
remaining pernet exit handlers run and genl_pernet_exit() sets
net->genl_sock to NULL. The next rebroadcast then crashes in
genl_has_listeners():
BUG: KASAN: null-ptr-deref in netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388
Read of size 8 at addr 0000000000000578 by task syz.0.0/5325
Call Trace:
<TASK>
netlink_has_listeners+0x3d/0x3f0 net/netlink/af_netlink.c:1388
genl_has_listeners include/net/genetlink.h:644 [inline]
netdev_genl_dev_notify+0x161/0x450 net/core/netdev-genl.c:93
netdev_genl_netdevice_event+0x98/0x3c0 net/core/netdev-genl.c:1491
notifier_call_chain+0x1a5/0x3d0 kernel/notifier.c:85
netdev_wait_allrefs_any net/core/dev.c:11690 [inline]
netdev_run_todo+0x731/0x1060 net/core/dev.c:11808
rtnl_unlock net/core/rtnetlink.c:157 [inline]
rtnl_dellink+0x68f/0x810 net/core/rtnetlink.c:3707
syzbot hit this by moving one end of a veth pair into a short-lived
netns while netdevsim's deferred FIB event processing still held a
reference on it, and then deleting the other end (repro [1]). While the
source of this bug is netdevsim deferring FIB processing for and holding
onto the device reference for O(seconds) which is being fixed
separately [2], any driver may introduce such a delay and trigger the
null-ptr-deref.
Skip the rebroadcasts, which are the only NETDEV_UNREGISTER events
delivered with reg_state == NETREG_UNREGISTERED. The notifications sent
by unregister_netdevice_many_notify() and, for a device leaving a netns,
by __dev_change_net_namespace() are issued under RTNL in the same
critical section that unlists the device, before its netns can be torn
down, and keep being handled. This mirrors what ip6_route_dev_notify()
already does to cope with the rebroadcasts.
This change should not break the UAPI spec as it defines dev-del-ntf as
a "Notification about device disappearing." which is a single event. The
rebroadcast in netdev_wait_allrefs_any() exists to re-kick in-kernel
subsystems holding references; netdev-genl happens to be on the notifier
chain and forwards it.
[1] https://gist.github.com/NamanGulati/2d1b49b8757f9a88b0bd6e55018c02ae
[2] https://lore.kernel.org/r/20261023191517.607834-1-kuniyu@google.com
Fixes: d3d854fd6a1d ("netdev-genl: create a simple family for netdev stuff")
Reported-by: syzbot+1269fe6cc2016008124e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Naman Gulati <namangulati@google.com>
Link: https://patch.msgid.link/20261026221306.3151025-1-namangulati@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Added the upstream guard and comment to the NETDEV_UNREGISTER case, but without the netdev_lock()/netdev_unlock() context lines, which this tree lacks. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/netdev-genl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
index 12c6f7d5add09..7578686165515 100644
--- a/net/core/netdev-genl.c
+++ b/net/core/netdev-genl.c
@@ -897,6 +897,12 @@ static int netdev_genl_netdevice_event(struct notifier_block *nb,
netdev_genl_dev_notify(netdev, NETDEV_CMD_DEV_ADD_NTF);
break;
case NETDEV_UNREGISTER:
+ /* netdev_wait_allrefs_any() rebroadcasts NETDEV_UNREGISTER
+ * while waiting for the last references to be dropped; the
+ * netns may already be torn down by then. Notify only once.
+ */
+ if (READ_ONCE(netdev->reg_state) == NETREG_UNREGISTERED)
+ break;
netdev_genl_dev_notify(netdev, NETDEV_CMD_DEV_DEL_NTF);
break;
case NETDEV_XDP_FEAT_CHANGE:
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 547/816] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (545 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 546/816] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 548/816] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
` (273 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Chan, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 1b2f02fb4ba92d01603c8261c94be8d348de65b0 ]
If a replacement agg buffer can't be allocated for a packet received
with XDP attached, bnxt_rx_pkt() drops the packet without returning
its head buffer to the ring. The head buffer leaks, and since rx_prod
still advances, the device gets a BD with a stale DMA address which
points at a buffer the driver no longer owns. When that BD completes
the driver finds no buffer in the slot.
The agg buffers consumed before the failing one have already been
replaced on the agg ring, they are referenced only by the frags of
the xdp_buff, which nobody frees. bnxt_xdp_buff_frags_free() would
skip them since the frags flag is set only on success, so set it
upfront.
Pointed out in LLM review of the first patch of the series.
Tested on a BCM57504 at MTU 9000 with a frags-capable XDP_PASS
program, receiving 8000B ICMPv6 echo requests (a head and two agg
buffers each) while page_pool_alloc_netmems() called from
bnxt_rx_agg_netmems_xdp() failed half of the time (bpftrace
override()). 44.7k packets were dropped, the page pools' inflight
count stayed flat and there were no KASAN or DEBUG_PAGEALLOC splats.
Fixes: 4c6c123c9af9 ("bnxt: adding bnxt_rx_agg_pages_xdp for aggregated xdp")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20261027234940.1267225-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Replaced netmem-based helper names and &bnxt_xdp.xdp with the page-based __bnxt_rx_agg_pages()/bnxt_rx_agg_pages_xdp() calls and the local &xdp variable. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 5d6f24044fb63..51272fb72dca6 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1297,16 +1297,19 @@ static u32 bnxt_rx_agg_pages_xdp(struct bnxt *bp,
struct skb_shared_info *shinfo = xdp_get_shared_info_from_buff(xdp);
u32 total_frag_len = 0;
- if (!xdp_buff_has_frags(xdp))
+ if (!xdp_buff_has_frags(xdp)) {
+ xdp_buff_set_frags_flag(xdp);
shinfo->nr_frags = 0;
+ }
total_frag_len = __bnxt_rx_agg_pages(bp, cpr, shinfo,
idx, agg_bufs, tpa, xdp);
- if (total_frag_len) {
- xdp_buff_set_frags_flag(xdp);
- shinfo->nr_frags = agg_bufs;
- shinfo->xdp_frags_size = total_frag_len;
+ if (!total_frag_len) {
+ bnxt_xdp_buff_frags_free(cpr->bnapi->rx_ring, xdp);
+ return 0;
}
+ shinfo->nr_frags = agg_bufs;
+ shinfo->xdp_frags_size = total_frag_len;
return total_frag_len;
}
@@ -2179,8 +2182,10 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
u32 frag_len = bnxt_rx_agg_pages_xdp(bp, cpr, &xdp,
cp_cons, agg_bufs,
false);
- if (!frag_len)
+ if (!frag_len) {
+ bnxt_reuse_rx_data(rxr, cons, data);
goto oom_next_rx;
+ }
}
xdp_active = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 825+ messages in thread
* [PATCH 6.12 548/816] tun: clear stale skb->protocol of NAPI frags skbs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (546 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 547/816] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 549/816] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
` (272 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Willem de Bruijn,
Eric Dumazet, Jakub Kicinski, Sasha Levin
6.12-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 893746d4c8d0f..e8b4d988cd330 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1484,6 +1484,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] 825+ messages in thread
* [PATCH 6.12 549/816] tracing/eprobe: Install the trigger for every instance that enables the eprobe
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (547 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 548/816] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 550/816] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
` (271 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Carlier,
Masami Hiramatsu (Google)
6.12-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
@@ -636,37 +636,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.
@@ -679,10 +674,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;
@@ -694,33 +686,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] 825+ messages in thread
* [PATCH 6.12 550/816] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (548 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 549/816] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 551/816] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
` (270 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen
6.12-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 */
@@ -828,6 +830,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 */
@@ -868,7 +871,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] 825+ messages in thread
* [PATCH 6.12 551/816] KEYS: Verify the key identity in __key_unlink_begin
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (549 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 550/816] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
@ 2026-11-25 14:34 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 552/816] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
` (269 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen
6.12-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] 825+ messages in thread
* [PATCH 6.12 552/816] bootconfig: Allow keys with the maximum supported depth
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (550 preceding siblings ...)
2026-11-25 14:34 ` [PATCH 6.12 551/816] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 553/816] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
` (268 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhiqi Zhang,
Masami Hiramatsu (Google)
6.12-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
@@ -302,9 +302,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] 825+ messages in thread
* [PATCH 6.12 553/816] ALSA: caiaq: Kill EP1 URB before unregistering the input device
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (551 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 552/816] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 554/816] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
` (267 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sergei Nizovtsev, Takashi Iwai
6.12-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] 825+ messages in thread
* [PATCH 6.12 554/816] ALSA: usb-audio: Drop capture packets with bogus actual_length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (552 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 553/816] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 555/816] selftests/ftrace: Add missing spaces after ! in probe syntax tests Greg Kroah-Hartman
` (266 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Gichoon Han, Takashi Iwai
6.12-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
@@ -1286,6 +1286,12 @@ static void retire_capture_urb(struct sn
// continue;
}
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] 825+ messages in thread
* [PATCH 6.12 555/816] selftests/ftrace: Add missing spaces after ! in probe syntax tests
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (553 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 554/816] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 556/816] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
` (265 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jaewon Jung,
Masami Hiramatsu (Google), Shuah Khan
6.12-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
@@ -34,7 +34,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
@@ -101,7 +101,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] 825+ messages in thread
* [PATCH 6.12 556/816] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (554 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 555/816] selftests/ftrace: Add missing spaces after ! in probe syntax tests Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 557/816] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
` (264 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Steven Rostedt,
Masami Hiramatsu (Google), Shuah Khan
6.12-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] 825+ messages in thread
* [PATCH 6.12 557/816] mmc: mmci: fix DMA channel leak when mmc_add_host() fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (555 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 556/816] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 558/816] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
` (263 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Anfernee Cao, Ulf Hansson
6.12-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
@@ -2484,11 +2484,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);
host_free:
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 558/816] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (556 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 557/816] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 559/816] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
` (262 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Hunter, Ian Ray, Haibo Chen,
Ulf Hansson
6.12-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
@@ -1092,6 +1092,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);
@@ -1766,6 +1780,9 @@ static int sdhci_esdhc_imx_probe(struct
host->mmc_host_ops.init_card = usdhc_init_card;
}
+ /* 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] 825+ messages in thread
* [PATCH 6.12 559/816] mmc: meson-gx: report busy from DAT0 alone
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (557 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 558/816] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 560/816] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
` (261 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.12-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] 825+ messages in thread
* [PATCH 6.12 560/816] mmc: meson-gx: honour the busy timeout for R1b commands
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (558 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 559/816] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 561/816] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
` (260 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.12-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] 825+ messages in thread
* [PATCH 6.12 561/816] mmc: meson-gx: report the longest busy wait the controller can do
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (559 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 560/816] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 562/816] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
` (259 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.12-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] 825+ messages in thread
* [PATCH 6.12 562/816] mmc: meson-gx: name the limit of the CMD_CFG timeout field
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (560 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 561/816] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 563/816] backing-file: pass RWF_NOAPPEND to synchronous writes Greg Kroah-Hartman
` (258 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Ulf Hansson
6.12-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] 825+ messages in thread
* [PATCH 6.12 563/816] backing-file: pass RWF_NOAPPEND to synchronous writes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (561 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 562/816] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 564/816] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
` (257 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Amir Goldstein,
Christian Brauner (Amutable)
6.12-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
@@ -103,8 +103,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] 825+ messages in thread
* [PATCH 6.12 564/816] eventpoll: wake the next waiter when a woken waiter is killed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (562 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 563/816] backing-file: pass RWF_NOAPPEND to synchronous writes Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 565/816] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
` (256 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mani Tofigh,
Christian Brauner (Amutable)
6.12-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
@@ -2074,10 +2074,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] 825+ messages in thread
* [PATCH 6.12 565/816] aio: dont let exit_aio() return before complete() is done
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (563 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 564/816] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 566/816] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
` (255 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jan Kara,
Christian Brauner (Amutable)
6.12-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
@@ -910,7 +910,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;
@@ -934,7 +934,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] 825+ messages in thread
* [PATCH 6.12 566/816] splice, net: avoid MSG_MORE when the bvec array fills
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (564 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 565/816] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 567/816] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
` (254 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Avi Weiss,
Christian Brauner (Amutable)
6.12-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
@@ -871,9 +871,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] 825+ messages in thread
* [PATCH 6.12 567/816] mm/mmzone: read the zoneref slot once in zonelist_zone()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (565 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 566/816] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 568/816] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone Greg Kroah-Hartman
` (253 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta), Zi Yan,
Vlastimil Babka (SUSE)
6.12-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
@@ -1627,7 +1627,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(struct zoneref *zoneref)
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 568/816] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (566 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 567/816] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 569/816] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node() Greg Kroah-Hartman
` (252 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Gregory Price (Meta), Zi Yan, Vlastimil Babka (SUSE)
6.12-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
@@ -4227,7 +4227,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] 825+ messages in thread
* [PATCH 6.12 569/816] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (567 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 568/816] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 570/816] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
` (251 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan
6.12-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
@@ -1937,6 +1937,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
@@ -1947,7 +1948,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] 825+ messages in thread
* [PATCH 6.12 570/816] mm/memory_hotplug: resize zones under their seqlock
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (568 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 569/816] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 571/816] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
` (250 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Vlastimil Babka (SUSE)
6.12-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
@@ -479,6 +479,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)
{
@@ -494,13 +510,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
@@ -511,11 +524,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);
}
}
@@ -723,12 +735,12 @@ static void node_states_set_node(int nod
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] 825+ messages in thread
* [PATCH 6.12 571/816] mm/page_alloc: keep the pagesets of an empty zone
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (569 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 570/816] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 572/816] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
` (249 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 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)
6.12-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
@@ -5840,6 +5840,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);
@@ -5933,6 +5937,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
@@ -6982,6 +6990,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;
@@ -6992,12 +7006,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] 825+ messages in thread
* [PATCH 6.12 572/816] mm/page_alloc: detect zonelist rebuilds from memory hot-add
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (570 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 571/816] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 573/816] coda: honor the append state of each write Greg Kroah-Hartman
` (248 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vlastimil Babka (SUSE),
Gregory Price (Meta), Zi Yan
6.12-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
@@ -3982,7 +3982,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;
@@ -3990,7 +3990,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] 825+ messages in thread
* [PATCH 6.12 573/816] coda: honor the append state of each write
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (571 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 572/816] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 574/816] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
` (247 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hungyu Lin,
Christian Brauner (Amutable)
6.12-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] 825+ messages in thread
* [PATCH 6.12 574/816] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (572 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 573/816] coda: honor the append state of each write Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 575/816] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
` (246 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 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
6.12-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
@@ -115,6 +115,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] 825+ messages in thread
* [PATCH 6.12 575/816] macsec: reject frames that decapsulate into runt Ethernet frames
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (573 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 574/816] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 576/816] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
` (245 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Dave Miller
6.12-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
@@ -402,8 +402,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 */
@@ -1325,9 +1327,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] 825+ messages in thread
* [PATCH 6.12 576/816] mctp: accept MSG_CMSG_COMPAT in recvmsg
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (574 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 575/816] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 577/816] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
` (244 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Davidlohr Bueso, Jakub Kicinski
6.12-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
@@ -212,7 +212,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] 825+ messages in thread
* [PATCH 6.12 577/816] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (575 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 576/816] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 578/816] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
` (243 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dragos Tatulea, Tariq Toukan,
Jiabin Deng, Jakub Kicinski
6.12-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
@@ -887,10 +887,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] 825+ messages in thread
* [PATCH 6.12 578/816] net/rds: Do not unpin a page after a failed atomic pin
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (576 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 577/816] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 579/816] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
` (242 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Kyle Zeng, Allison Henderson,
Dave Miller
6.12-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
@@ -960,8 +960,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] 825+ messages in thread
* [PATCH 6.12 579/816] net/smc: fix lgr/lnk lifetime vs diag reader race
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (577 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 578/816] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 580/816] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
` (241 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mahanta Jambigi, Sidraya Jayagond,
Jakub Kicinski
6.12-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
@@ -977,7 +977,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:
@@ -1955,7 +1955,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);
}
@@ -1969,7 +1969,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
@@ -1511,8 +1511,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);
}
@@ -2032,6 +2034,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] 825+ messages in thread
* [PATCH 6.12 580/816] net: bridge: use one headroom snapshot for ND replies
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (578 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 579/816] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 581/816] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
` (240 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, TencentOS Corvus AI,
Jun Yang, Nikolay Aleksandrov, Ido Schimmel, Jakub Kicinski
6.12-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
@@ -259,6 +259,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;
int i, len;
u8 *daddr;
@@ -268,7 +269,8 @@ static void br_nd_send(struct net_bridge
if (!dev || skb_linearize(request))
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);
@@ -277,7 +279,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] 825+ messages in thread
* [PATCH 6.12 581/816] net: dsa: microchip: initialize the IRQ access mutex
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (579 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 580/816] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 582/816] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
` (239 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tapio Reijonen, Daniel Machon,
Paolo Abeni
6.12-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
@@ -4806,6 +4806,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] 825+ messages in thread
* [PATCH 6.12 582/816] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (580 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 581/816] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 583/816] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
` (238 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukáš Lalinský,
Jens Axboe, Dave Miller
6.12-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
@@ -2611,8 +2611,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.
@@ -2676,6 +2674,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;
@@ -2840,9 +2841,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
@@ -2884,6 +2882,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] 825+ messages in thread
* [PATCH 6.12 583/816] net: mana: report RX checksum offload for IPv6
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (581 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 582/816] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 584/816] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore Greg Kroah-Hartman
` (237 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haiyang Zhang, Hamza Mahfooz,
Jakub Kicinski
6.12-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
@@ -1560,10 +1560,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)) {
hash_value = cqe->ppi[0].pkt_hash;
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 584/816] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (582 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 583/816] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 585/816] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
` (236 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jerome Mohm, Stefano Garzarella,
Jakub Kicinski
6.12-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
@@ -690,8 +690,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);
@@ -752,11 +754,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);
@@ -767,10 +777,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] 825+ messages in thread
* [PATCH 6.12 585/816] tsacct: Keep task begin times stable across suspend
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (583 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 584/816] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 586/816] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
` (235 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Nesterov, Thomas Gleixner,
Hungyu Lin
6.12-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] 825+ messages in thread
* [PATCH 6.12 586/816] tls: only install push_pending_record for a TX context
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (584 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 585/816] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 587/816] tcp: fix authentication bypass via unsupported TCP auth options Greg Kroah-Hartman
` (234 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rishikesh Jethwani, Jakub Kicinski
6.12-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
@@ -2887,7 +2887,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;
rc = crypto_aead_setkey(*aead, key, cipher_desc->key);
if (rc)
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 587/816] tcp: fix authentication bypass via unsupported TCP auth options
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (585 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 586/816] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 588/816] seg6: validate state in netfilter continuations Greg Kroah-Hartman
` (233 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean,
Kuniyuki Iwashima, Dmitry Safonov, Jakub Kicinski
6.12-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
@@ -287,7 +287,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
@@ -4809,7 +4809,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] 825+ messages in thread
* [PATCH 6.12 588/816] seg6: validate state in netfilter continuations
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (586 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 587/816] tcp: fix authentication bypass via unsupported TCP auth options Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 589/816] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
` (232 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 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
6.12-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>
@@ -58,6 +59,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)
{
@@ -538,6 +554,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);
@@ -546,10 +573,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;
@@ -624,6 +651,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);
@@ -631,10 +669,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;
@@ -939,6 +955,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)
@@ -959,7 +986,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:
@@ -1027,6 +1054,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)
{
@@ -1047,7 +1085,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:
@@ -1680,6 +1718,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)) {
@@ -1690,7 +1739,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] 825+ messages in thread
* [PATCH 6.12 589/816] mptcp: reject DATA_ACKs against a reversed send interval
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (587 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 588/816] seg6: validate state in netfilter continuations Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 590/816] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
` (231 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Eric Dumazet,
Matthieu Baerts (NGI0), Jakub Kicinski
6.12-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
@@ -1139,9 +1139,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);
@@ -1150,10 +1150,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] 825+ messages in thread
* [PATCH 6.12 590/816] ipv4: keep XFRM headers out of corked skb lengths
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (588 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 589/816] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 591/816] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
` (230 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Jakub Kicinski
6.12-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
@@ -1152,16 +1152,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] 825+ messages in thread
* [PATCH 6.12 591/816] ipv4: fib_trie: prevent speculative out-of-bounds child access
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (589 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 590/816] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 592/816] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
` (229 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Daniël Trujillo,
Jakub Kicinski
6.12-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>
@@ -967,6 +968,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));
@@ -1472,6 +1475,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.
*/
@@ -1772,6 +1777,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)
@@ -1793,6 +1800,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)
@@ -2444,7 +2453,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] 825+ messages in thread
* [PATCH 6.12 592/816] ipv6: fix cached route reuse for control messages
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (590 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 591/816] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 593/816] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
` (228 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Willem de Bruijn, Xia Yan,
Willem de Bruijn, Jakub Kicinski
6.12-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
@@ -1285,7 +1285,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.
@@ -1302,11 +1302,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] 825+ messages in thread
* [PATCH 6.12 593/816] ipv6: reject routes without an inet6_dev
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (591 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 592/816] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 594/816] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
` (227 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Hangbin Liu,
Yingjie Wang, Ido Schimmel, Jakub Kicinski
6.12-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
@@ -1144,6 +1144,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;
@@ -1178,10 +1184,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] 825+ messages in thread
* [PATCH 6.12 594/816] ipvs: Defer application parent freeing until after RCU readers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (592 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 593/816] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 595/816] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
` (226 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Julian Anastasov,
Pablo Neira Ayuso
6.12-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
@@ -243,7 +243,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] 825+ messages in thread
* [PATCH 6.12 595/816] ipvs: fix protocol data lifetime during namespace teardown
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (593 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 594/816] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 596/816] gtp: free the skb after handling an echo response Greg Kroah-Hartman
` (225 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Julian Anastasov,
Pablo Neira Ayuso
6.12-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
@@ -2319,12 +2319,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;
@@ -2344,10 +2344,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;
@@ -2364,8 +2364,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] 825+ messages in thread
* [PATCH 6.12 596/816] gtp: free the skb after handling an echo response
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (594 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 595/816] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 597/816] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
` (224 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Jakub Kicinski
6.12-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
@@ -556,16 +556,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)
@@ -742,16 +745,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] 825+ messages in thread
* [PATCH 6.12 597/816] hv_netvsc: Stop PPI parsing on invalid metadata
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (595 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 596/816] gtp: free the skb after handling an echo response Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 598/816] net: gro: avoid parsing headers from shared fragments Greg Kroah-Hartman
` (223 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Erni Sri Satya Vennela,
Haiyang Zhang, Wei Liu, Simon Horman, Dave Miller
6.12-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] 825+ messages in thread
* [PATCH 6.12 598/816] net: gro: avoid parsing headers from shared fragments
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (596 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 597/816] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 599/816] net: gro: do not undo remote checksum offload on merged packets Greg Kroah-Hartman
` (222 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Kyle Zeng, Jakub Kicinski
6.12-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
@@ -418,7 +418,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] 825+ messages in thread
* [PATCH 6.12 599/816] net: gro: do not undo remote checksum offload on merged packets
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (597 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 598/816] net: gro: avoid parsing headers from shared fragments Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 600/816] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
` (221 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jakub Kicinski
6.12-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
@@ -354,7 +354,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
@@ -242,6 +242,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] 825+ messages in thread
* [PATCH 6.12 600/816] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (598 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 599/816] net: gro: do not undo remote checksum offload on merged packets Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 601/816] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
` (220 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Cen Zhang (Microsoft), Pablo Neira Ayuso
6.12-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] 825+ messages in thread
* [PATCH 6.12 601/816] netfilter: flowtable: extend ct timeout of offloaded GRE flows
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (599 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 600/816] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 602/816] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
` (219 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+521f7e7e2b974abde99a,
Michail Andreas Michalopoulos, Pablo Neira Ayuso
6.12-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
@@ -496,6 +496,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] 825+ messages in thread
* [PATCH 6.12 602/816] net/sched: sch_teql: reject qdiscs from another network namespace
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (600 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 601/816] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 603/816] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
` (218 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, shaos, Victor Nogueira,
Jamal Hadi Salim, Simon Horman, Jakub Kicinski
6.12-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] 825+ messages in thread
* [PATCH 6.12 603/816] net/sched: act_ife: encode configured zero metadata values
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (601 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 602/816] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 604/816] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
` (217 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, shaos, Victor Nogueira,
Jamal Hadi Salim, Simon Horman, Jakub Kicinski
6.12-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] 825+ messages in thread
* [PATCH 6.12 604/816] net/sched: act_ife: require a full Ethernet header on egress
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (602 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 603/816] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 605/816] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
` (216 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko (nipa), shaos,
Victor Nogueira, Jamal Hadi Salim, Simon Horman, Jakub Kicinski
6.12-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
@@ -871,13 +871,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] 825+ messages in thread
* [PATCH 6.12 605/816] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (603 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 604/816] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 606/816] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
` (215 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Menninger, Anna Schumaker
6.12-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
@@ -1748,6 +1748,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))
@@ -1782,7 +1784,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] 825+ messages in thread
* [PATCH 6.12 606/816] openvswitch: advance by the real header length in get_ipv6_ext_hdrs()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (604 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 605/816] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 607/816] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
` (214 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joas Antonio dos Santos,
Simon Horman, Aaron Conole, Eelco Chaudron, Paolo Abeni
6.12-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
@@ -374,11 +374,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] 825+ messages in thread
* [PATCH 6.12 607/816] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (605 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 606/816] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 608/816] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
` (213 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Phat Dinh, Peter Zijlstra (Intel)
6.12-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
@@ -925,8 +925,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] 825+ messages in thread
* [PATCH 6.12 608/816] PM: runtime: Update last_busy in rpm_resume() for active devices
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (606 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 607/816] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 609/816] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
` (212 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
Alan Stern
6.12-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
@@ -797,6 +797,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] 825+ messages in thread
* [PATCH 6.12 609/816] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (607 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 608/816] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 610/816] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
` (211 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Baoli Zhang, Peter Ujfalusi,
Mark Brown
6.12-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
@@ -1003,7 +1003,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] 825+ messages in thread
* [PATCH 6.12 610/816] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (608 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 609/816] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 611/816] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
` (210 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, YuanZhe Liu, Bartosz Golaszewski,
Luiz Augusto von Dentz
6.12-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
@@ -160,6 +160,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;
@@ -652,6 +653,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;
@@ -727,6 +729,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] 825+ messages in thread
* [PATCH 6.12 611/816] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (609 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 610/816] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
@ 2026-11-25 14:35 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 612/816] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug Greg Kroah-Hartman
` (209 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Luiz Augusto von Dentz
6.12-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
@@ -1289,7 +1289,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] 825+ messages in thread
* [PATCH 6.12 612/816] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (610 preceding siblings ...)
2026-11-25 14:35 ` [PATCH 6.12 611/816] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 613/816] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
` (208 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Ridong Chen, Waiman Long,
Tejun Heo
6.12-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
@@ -3884,10 +3884,10 @@ retry:
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] 825+ messages in thread
* [PATCH 6.12 613/816] crypto: caam - reject overlong RSA CRT parameters
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (611 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 612/816] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 614/816] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
` (207 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean,
Sahil Malhotra, Herbert Xu
6.12-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] 825+ messages in thread
* [PATCH 6.12 614/816] crypto: essiv - fix use-after-free in AEAD path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (612 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 613/816] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 615/816] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
` (206 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Herbert Xu
6.12-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] 825+ messages in thread
* [PATCH 6.12 615/816] fs/adfs: bound directory entry name length in adfs_fplus_getnext()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (613 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 614/816] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 616/816] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
` (205 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyungjung Joo, HyeongJun An,
Christian Brauner (Amutable)
6.12-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] 825+ messages in thread
* [PATCH 6.12 616/816] fs/proc: fix the write length returned by proc_sys_call_handler()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (614 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 615/816] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 617/816] fs/splice: clamp an over-reported write_iter result Greg Kroah-Hartman
` (204 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cheng Yongkang,
Christian Brauner (Amutable)
6.12-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
@@ -552,6 +552,8 @@ static ssize_t proc_sys_call_handler(str
struct ctl_table_header *head = grab_header(inode);
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;
@@ -602,7 +604,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] 825+ messages in thread
* [PATCH 6.12 617/816] fs/splice: clamp an over-reported write_iter result
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (615 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 616/816] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 618/816] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
` (203 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cheng Yongkang,
Christian Brauner (Amutable)
6.12-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
@@ -744,9 +744,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] 825+ messages in thread
* [PATCH 6.12 618/816] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (616 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 617/816] fs/splice: clamp an over-reported write_iter result Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 619/816] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
` (202 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Beata Michalska, Catalin Marinas
6.12-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
@@ -160,8 +160,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-A725 | #3456106 | ARM64_ERRATUM_3194386 |
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1030,6 +1030,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
@@ -273,6 +273,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),
@@ -772,6 +784,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
@@ -2070,7 +2070,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
@@ -260,7 +260,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
@@ -105,3 +105,4 @@ WORKAROUND_SPECULATIVE_AT
WORKAROUND_SPECULATIVE_SSBS
WORKAROUND_SPECULATIVE_UNPRIV_LOAD
WORKAROUND_BROKEN_AMU_CONSTCNT
+WORKAROUND_BROKEN_AMU_CORECNT
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 619/816] arm64: ptrace: dont warn on missing siginfo in a group-stop
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (617 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 618/816] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 620/816] arm64: suspend: Save POR_EL0 over suspend Greg Kroah-Hartman
` (201 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhao Gongyi, Oleg Nesterov,
Will Deacon, Catalin Marinas
6.12-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
@@ -572,8 +572,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] 825+ messages in thread
* [PATCH 6.12 620/816] arm64: suspend: Save POR_EL0 over suspend
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (618 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 619/816] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 621/816] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
` (200 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Brown, Vladimir Murzin,
Catalin Marinas
6.12-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
@@ -108,6 +108,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)
@@ -150,6 +154,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] 825+ messages in thread
* [PATCH 6.12 621/816] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (619 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 620/816] arm64: suspend: Save POR_EL0 over suspend Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 622/816] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
` (199 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Zhongqiu Han,
Rafael J. Wysocki
6.12-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
@@ -200,14 +200,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] 825+ messages in thread
* [PATCH 6.12 622/816] cpufreq: intel_pstate: Clear last written P-state value on suspend
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (620 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 621/816] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 623/816] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
` (198 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zak Brighton Knight, Doug Smythies,
Rafael J. Wysocki, Zhongqiu Han, Viresh Kumar, Christian Loehle
6.12-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
@@ -3322,10 +3322,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);
/*
@@ -3336,6 +3337,17 @@ static int intel_cpufreq_suspend(struct
value &= ~HWP_DESIRED_PERF(~0L);
wrmsrl_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] 825+ messages in thread
* [PATCH 6.12 623/816] cpufreq: Cache post-resolution target frequency in __resolve_freq()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (621 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 622/816] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 624/816] software node: only let the owner release a managed node Greg Kroah-Hartman
` (197 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Christian Loehle
6.12-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
@@ -548,8 +548,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] 825+ messages in thread
* [PATCH 6.12 624/816] software node: only let the owner release a managed node
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (622 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 623/816] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 625/816] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
` (196 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Balasubramani Vivekanandan,
Bartosz Golaszewski, Heikki Krogerus, Johan Hovold
6.12-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);
@@ -1060,7 +1061,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))
@@ -1104,7 +1105,7 @@ void software_node_notify_remove(struct
sysfs_remove_link(&dev->kobj, "software_node");
kobject_put(&swnode->kobj);
- if (swnode->managed) {
+ if (swnode->owner == dev) {
set_secondary_fwnode(dev, NULL);
kobject_put(&swnode->kobj);
}
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 625/816] SUNRPC: Fix TCP-with-TLS transport class identification
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (623 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 624/816] software node: only let the owner release a managed node Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 626/816] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
` (195 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Benjamin Coddington,
Anna Schumaker
6.12-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
@@ -3534,7 +3534,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] 825+ messages in thread
* [PATCH 6.12 626/816] timekeeping: Read getboottime64() offsets under the sequence counter
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (624 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 625/816] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 627/816] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
` (194 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hungyu Lin, Thomas Gleixner,
John Stultz
6.12-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
@@ -2296,7 +2296,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] 825+ messages in thread
* [PATCH 6.12 627/816] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (625 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 626/816] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 628/816] tpm: Check return value of crypto_kpp_set_secret() Greg Kroah-Hartman
` (193 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Paul Menzel,
Jarkko Sakkinen
6.12-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] 825+ messages in thread
* [PATCH 6.12 628/816] tpm: Check return value of crypto_kpp_set_secret()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (626 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 627/816] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 629/816] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
` (192 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Biggers, Jarkko Sakkinen
6.12-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
@@ -579,7 +579,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] 825+ messages in thread
* [PATCH 6.12 629/816] tpm: eventlog: check the payload size before reading tag events
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (627 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 628/816] tpm: Check return value of crypto_kpp_set_secret() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 630/816] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
` (191 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guanglei Zhu, Jarkko Sakkinen
6.12-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] 825+ messages in thread
* [PATCH 6.12 630/816] x86/mm: Ensure write visibility during LDT installation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (628 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 629/816] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 631/816] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
` (190 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jaeyoung Chung, Dave Hansen,
Ingo Molnar, Linus Torvalds, Peter Zijlstra (Intel)
6.12-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] 825+ messages in thread
* [PATCH 6.12 631/816] xen/gntdev: fix deadlock between map ioctl and mmap
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (629 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 630/816] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 632/816] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
` (189 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Juergen Gross
6.12-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
@@ -678,15 +678,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] 825+ messages in thread
* [PATCH 6.12 632/816] xen/privcmd: fix double free when an irqfd is shut down twice
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (630 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 631/816] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 633/816] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
` (188 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Qihang, Juergen Gross
6.12-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
@@ -903,10 +903,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] 825+ messages in thread
* [PATCH 6.12 633/816] xen/pvcalls: unwind pvcalls_new_active_socket() step by step
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (631 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 632/816] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 634/816] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
` (187 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Stabellini, Yehyeong Lee,
Juergen Gross
6.12-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] 825+ messages in thread
* [PATCH 6.12 634/816] xen/pvcalls: destroy the per-socket workqueue on release
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (632 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 633/816] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 635/816] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
` (186 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Stabellini, Yehyeong Lee,
Juergen Gross
6.12-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] 825+ messages in thread
* [PATCH 6.12 635/816] hwmon: (aht10) Fix update_interval overflow on 64-bit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (633 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 634/816] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 636/816] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
` (185 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rupesh Majhi, Guenter Roeck
6.12-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
@@ -229,7 +229,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] 825+ messages in thread
* [PATCH 6.12 636/816] hwmon: (pmbus/mp2975) Get vout fault limits dynamically
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (634 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 635/816] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 637/816] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
` (184 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Felix Radensky, Vadim Pasternak,
Guenter Roeck
6.12-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
@@ -110,10 +110,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];
};
@@ -466,12 +463,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:
@@ -488,19 +550,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,
@@ -509,8 +587,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,
@@ -760,60 +847,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)
{
@@ -917,25 +950,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;
@@ -1049,11 +1063,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)
@@ -1070,7 +1079,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] 825+ messages in thread
* [PATCH 6.12 637/816] hwmon: (sy7636a) fix negative temperatures
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (635 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 636/816] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 638/816] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
` (183 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Mazzini, Guenter Roeck
6.12-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] 825+ messages in thread
* [PATCH 6.12 638/816] hwmon: (scmi) Check channel config allocation
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (636 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 637/816] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 639/816] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
` (182 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Sudeep Holla, Guenter Roeck
6.12-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;
@@ -297,8 +297,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] =
@@ -333,8 +337,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] 825+ messages in thread
* [PATCH 6.12 639/816] hwmon: (max31760) Fix the local temperature limit registers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (637 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 638/816] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 640/816] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
` (181 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
6.12-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] 825+ messages in thread
* [PATCH 6.12 640/816] hwmon: (max31760) Leave standby mode at probe
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (638 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 639/816] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 641/816] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
` (180 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
6.12-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] 825+ messages in thread
* [PATCH 6.12 641/816] hwmon: (max31760) Report 0 RPM before the first fan speed measurement
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (639 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 640/816] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 642/816] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
` (179 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stanislav Aleksandrov, Guenter Roeck
6.12-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] 825+ messages in thread
* [PATCH 6.12 642/816] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (640 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 641/816] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 643/816] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
` (178 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jan Höppner,
Stefan Haberland, Jens Axboe
6.12-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
@@ -2593,7 +2593,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] 825+ messages in thread
* [PATCH 6.12 643/816] s390/dasd: Dont trust userspace-supplied result field in format check
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (641 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 642/816] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 644/816] sched/deadline: Fix spurious -EPERM for migration-disabled tasks Greg Kroah-Hartman
` (177 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jan Höppner,
Stefan Haberland, Jens Axboe
6.12-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] 825+ messages in thread
* [PATCH 6.12 644/816] sched/deadline: Fix spurious -EPERM for migration-disabled tasks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (642 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 643/816] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 645/816] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE Greg Kroah-Hartman
` (176 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrea Parri, Peter Zijlstra (Intel),
Ingo Molnar, Sebastian Andrzej Siewior, Juri Lelli
6.12-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
@@ -631,7 +631,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] 825+ messages in thread
* [PATCH 6.12 645/816] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (643 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 644/816] sched/deadline: Fix spurious -EPERM for migration-disabled tasks Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 646/816] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler() Greg Kroah-Hartman
` (175 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Andrea Parri,
Peter Zijlstra (Intel), Ingo Molnar, Vincent Guittot
6.12-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
@@ -321,8 +321,8 @@ static bool check_same_owner(struct task
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] 825+ messages in thread
* [PATCH 6.12 646/816] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (644 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 645/816] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 647/816] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
` (174 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Andrea Parri,
Peter Zijlstra (Intel), Ingo Molnar, Waiman Long, Kayra Cizmeci,
Juri Lelli
6.12-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
@@ -644,8 +644,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] 825+ messages in thread
* [PATCH 6.12 647/816] sctp: abort unordered partial delivery when its message is skipped
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (645 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 646/816] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 648/816] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
` (173 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Budding, Xin Long,
Jakub Kicinski
6.12-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] 825+ messages in thread
* [PATCH 6.12 648/816] sctp: avoid requeueing pending control chunks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (646 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 647/816] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 649/816] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
` (172 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Xin Long, Kyle Zeng,
Jakub Kicinski
6.12-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;
@@ -6194,9 +6196,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] 825+ messages in thread
* [PATCH 6.12 649/816] sctp: fix ASCONF address change on single-homed hosts
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (647 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 648/816] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 650/816] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
` (171 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Xin Long,
Dave Miller
6.12-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
@@ -3191,9 +3191,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;
}
@@ -3206,13 +3209,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] 825+ messages in thread
* [PATCH 6.12 650/816] sctp: fix I-FORWARD-TSN handling of fragments on other streams
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (648 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 649/816] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 651/816] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
` (170 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tim Budding, Xin Long,
Jakub Kicinski
6.12-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] 825+ messages in thread
* [PATCH 6.12 651/816] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (649 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 650/816] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 652/816] sctp: reset stored flag for each association Greg Kroah-Hartman
` (169 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tim Budding, Xin Long,
Jakub Kicinski
6.12-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] 825+ messages in thread
* [PATCH 6.12 652/816] sctp: reset stored flag for each association
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (650 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 651/816] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 653/816] LoongArch: Restore KFENCE pages through DMW on resume Greg Kroah-Hartman
` (168 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi, Xin Long,
Jakub Kicinski
6.12-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] 825+ messages in thread
* [PATCH 6.12 653/816] LoongArch: Restore KFENCE pages through DMW on resume
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (651 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 652/816] sctp: reset stored flag for each association Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 654/816] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
` (167 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mike Rapoport (Microsoft),
Huacai Chen
6.12-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] 825+ messages in thread
* [PATCH 6.12 654/816] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (652 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 653/816] LoongArch: Restore KFENCE pages through DMW on resume Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 655/816] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
` (166 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.12-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
@@ -327,21 +327,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->is_signed)
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 655/816] tracing/eprobe: Disallow attaching eprobes to fprobe events
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (653 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 654/816] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 656/816] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
` (165 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.12-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
@@ -750,7 +750,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] 825+ messages in thread
* [PATCH 6.12 656/816] tracing/probes: Check enabled and busy state before unlinking sibling probes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (654 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 655/816] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 657/816] tracing/probes: Fix user-space dereference string array store type Greg Kroah-Hartman
` (164 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.12-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
@@ -88,14 +88,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
@@ -753,10 +753,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;
@@ -765,6 +761,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
@@ -538,10 +538,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;
@@ -550,6 +546,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
@@ -392,13 +392,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] 825+ messages in thread
* [PATCH 6.12 657/816] tracing/probes: Fix user-space dereference string array store type
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (655 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 656/816] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 658/816] tracing/probes: Reject array count on non-dereference string sources Greg Kroah-Hartman
` (163 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.12-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
@@ -1333,6 +1333,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 &&
@@ -1352,6 +1354,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_DATA) || code->op == FETCH_OP_TP_ARG ||
@@ -1372,8 +1375,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] 825+ messages in thread
* [PATCH 6.12 658/816] tracing/probes: Reject array count on non-dereference string sources
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (656 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 657/816] tracing/probes: Fix user-space dereference string array store type Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 659/816] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
` (162 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google)
6.12-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
@@ -1367,6 +1367,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] 825+ messages in thread
* [PATCH 6.12 659/816] wifi: ath9k_htc: do not start ANI before the first channel is set
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (657 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 658/816] tracing/probes: Reject array count on non-dereference string sources Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 660/816] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
` (161 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mehmet Fide,
Toke Høiland-Jørgensen, Jeff Johnson
6.12-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] 825+ messages in thread
* [PATCH 6.12 660/816] wifi: cfg80211: release rejected nontransmitted BSS reference
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (658 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 659/816] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 661/816] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
` (160 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -2354,6 +2354,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] 825+ messages in thread
* [PATCH 6.12 661/816] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (659 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 660/816] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 662/816] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
` (159 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -772,12 +772,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);
@@ -799,7 +799,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] 825+ messages in thread
* [PATCH 6.12 662/816] wifi: cfg80211: dont truncate the merged MBSSID profile length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (660 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 661/816] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 663/816] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
` (158 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wahid Khan, Johannes Berg
6.12-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
@@ -2497,7 +2497,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] 825+ messages in thread
* [PATCH 6.12 663/816] wifi: mac80211: fix use-after-free when MLO link setup is rolled back
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (661 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 662/816] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 664/816] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
` (157 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -380,6 +380,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] 825+ messages in thread
* [PATCH 6.12 664/816] wifi: mac80211: drain link readers before stopping removed links
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (662 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 663/816] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 665/816] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
` (156 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -176,6 +176,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;
@@ -190,11 +191,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] 825+ messages in thread
* [PATCH 6.12 665/816] wifi: mac80211: recheck injected headers after removing FCS
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (663 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 664/816] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 666/816] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
` (155 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -2553,6 +2553,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] 825+ messages in thread
* [PATCH 6.12 666/816] wifi: mac80211: recheck the IBSS station limit before insertion
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (664 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 665/816] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 667/816] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
` (154 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -1662,8 +1662,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] 825+ messages in thread
* [PATCH 6.12 667/816] wifi: mac80211: recheck the OCB station limit before insertion
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (665 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 666/816] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 668/816] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates Greg Kroah-Hartman
` (153 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -136,8 +136,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] 825+ messages in thread
* [PATCH 6.12 668/816] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (666 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 667/816] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 669/816] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
` (152 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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] 825+ messages in thread
* [PATCH 6.12 669/816] wifi: mac80211: restore dormant links when link updates fail
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (667 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 668/816] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 670/816] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
` (151 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -281,6 +281,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 int link_id;
@@ -385,7 +386,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] 825+ messages in thread
* [PATCH 6.12 670/816] wifi: mac80211: bound pending IBSS station allocations
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (668 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 669/816] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 671/816] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
` (150 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -698,6 +698,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);
@@ -1213,9 +1214,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];
@@ -1668,6 +1678,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
@@ -634,6 +634,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] 825+ messages in thread
* [PATCH 6.12 671/816] wifi: mac80211: bound pending OCB station allocations
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (669 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 670/816] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
@ 2026-11-25 14:36 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 672/816] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
` (149 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg
6.12-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
@@ -649,6 +649,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 {
@@ -657,6 +658,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];
@@ -142,6 +151,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);
@@ -225,6 +235,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] 825+ messages in thread
* [PATCH 6.12 672/816] gpio: brcmstb: fix UAF after IRQ domain setup failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (670 preceding siblings ...)
2026-11-25 14:36 ` [PATCH 6.12 671/816] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 673/816] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
` (148 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Florian Fainelli,
Bartosz Golaszewski
6.12-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
@@ -487,6 +487,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] 825+ messages in thread
* [PATCH 6.12 673/816] gpio: rockchip: Fix debounce arithmetic for GPIO v2
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (671 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 672/816] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 674/816] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
` (147 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cunhao Lu, Bartosz Golaszewski
6.12-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
@@ -192,20 +192,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] 825+ messages in thread
* [PATCH 6.12 674/816] gpio: sodaville: fix use-after-free bug when registering the irqchip
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (672 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 673/816] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 675/816] gpio: virtuser: fix interrupt leak and UAF Greg Kroah-Hartman
` (146 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski
6.12-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
@@ -165,9 +165,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_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
sd->irq_base, 0, &irq_domain_sdv_ops, sd);
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 675/816] gpio: virtuser: fix interrupt leak and UAF
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (673 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 674/816] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 676/816] gpio: virtuser: remove the debugfs files before freeing the line data Greg Kroah-Hartman
` (145 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski
6.12-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
@@ -57,9 +57,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;
};
@@ -613,7 +613,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);
@@ -641,7 +641,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;
@@ -681,7 +681,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;
@@ -695,11 +700,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;
@@ -799,6 +806,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,
@@ -815,14 +830,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] 825+ messages in thread
* [PATCH 6.12 676/816] gpio: virtuser: remove the debugfs files before freeing the line data
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (674 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 675/816] gpio: virtuser: fix interrupt leak and UAF Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 677/816] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
` (144 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yu Zhang, Bartosz Golaszewski
6.12-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
@@ -952,38 +952,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] 825+ messages in thread
* [PATCH 6.12 677/816] ovl: do not always clear absolute_redirect
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (675 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 676/816] gpio: virtuser: remove the debugfs files before freeing the line data Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 678/816] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
` (143 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein
6.12-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
@@ -38,13 +38,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] 825+ messages in thread
* [PATCH 6.12 678/816] ovl: reject different lower idmaps on the same fs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (676 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 677/816] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 679/816] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
` (142 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner,
Jérémy Jean, Amir Goldstein
6.12-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
@@ -1056,6 +1056,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] 825+ messages in thread
* [PATCH 6.12 679/816] ovl: report the requested redirect_dir mode in conflicting options
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (677 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 678/816] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 680/816] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
` (141 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein
6.12-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
@@ -111,18 +111,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 },
@@ -581,11 +591,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:
@@ -718,7 +723,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;
@@ -774,6 +785,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) {
@@ -812,6 +825,10 @@ int ovl_fs_params_verify(const struct ov
config->metacopy = true;
}
+ /* 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.
@@ -823,7 +840,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 (config->verity_mode && set.redirect) {
@@ -837,7 +854,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. */
@@ -904,7 +921,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] 825+ messages in thread
* [PATCH 6.12 680/816] ovl: return EIO if the lowerdata is missing
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (678 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 679/816] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 681/816] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
` (140 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein
6.12-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
@@ -1020,6 +1020,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] 825+ messages in thread
* [PATCH 6.12 681/816] smb: client: bound invalid NTLMSSP signature diagnostic
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (679 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 680/816] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 682/816] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
` (139 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Yifan Zhang,
Paulo Alcantara
6.12-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
@@ -961,8 +961,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] 825+ messages in thread
* [PATCH 6.12 682/816] smb: client: compare owner and group SIDs using their encoded lengths
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (680 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 681/816] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 683/816] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
` (138 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, liuyong, Namjae Jeon,
Paulo Alcantara
6.12-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
@@ -1062,7 +1062,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] 825+ messages in thread
* [PATCH 6.12 683/816] smb: client: dont block dying tasks waiting for writeback on close
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (681 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 682/816] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 684/816] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
` (137 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
6.12-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
@@ -2760,17 +2760,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] 825+ messages in thread
* [PATCH 6.12 684/816] smb: client: dont block dying tasks waiting for writeback on fsync
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (682 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 683/816] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 685/816] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption Greg Kroah-Hartman
` (136 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara, David Howells
6.12-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
@@ -2655,6 +2655,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.
*/
@@ -2669,7 +2708,7 @@ int cifs_strict_fsync(struct file *file,
struct inode *inode = file_inode(file);
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
- 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;
@@ -2725,7 +2764,7 @@ int cifs_fsync(struct file *file, loff_t
struct inode *inode = file_inode(file);
struct cifs_sb_info *cifs_sb = CIFS_FILE_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;
@@ -2760,25 +2799,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.
@@ -2792,7 +2812,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] 825+ messages in thread
* [PATCH 6.12 685/816] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (683 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 684/816] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 686/816] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
` (135 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrey Misiurov, Namjae Jeon,
Paulo Alcantara
6.12-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
@@ -3357,11 +3357,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);
@@ -3369,15 +3370,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);
@@ -3401,7 +3405,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] 825+ messages in thread
* [PATCH 6.12 686/816] smb: client: fix out-of-bounds read in dfs_parse_target_referral()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (684 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 685/816] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 687/816] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
` (134 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fredric Cover, Namjae Jeon,
Paulo Alcantara
6.12-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
@@ -31,7 +31,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] 825+ messages in thread
* [PATCH 6.12 687/816] smb: client: flush deferred handles of other names before a hard link open
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (685 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 686/816] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 688/816] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
` (133 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giuseppe Piscitelli, Namjae Jeon,
Paulo Alcantara
6.12-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
@@ -2095,7 +2095,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] 825+ messages in thread
* [PATCH 6.12 688/816] smb: client: hold the inode across cifs_oplock_break()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (686 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 687/816] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 689/816] smb: client: issue writes from a worker if the task is dying Greg Kroah-Hartman
` (132 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara
6.12-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
@@ -3188,6 +3188,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);
@@ -3263,6 +3271,7 @@ oplock_break_ack:
cifs_put_tlink(tlink);
out:
cifs_done_oplock_break(cinode);
+ iput(inode);
}
static int cifs_swap_activate(struct swap_info_struct *sis,
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 689/816] smb: client: issue writes from a worker if the task is dying
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (687 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 688/816] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 690/816] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
` (131 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Paulo Alcantara
6.12-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
@@ -158,6 +158,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;
/*
@@ -2016,9 +2017,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)
@@ -2089,6 +2097,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:
@@ -2134,6 +2144,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
@@ -2051,6 +2051,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
@@ -97,10 +97,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);
@@ -134,6 +140,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] 825+ messages in thread
* [PATCH 6.12 690/816] smb: client: skip NULL channel in __cifs_put_smb_ses()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (688 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 689/816] smb: client: issue writes from a worker if the task is dying Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 691/816] dm log userspace: drop the device reference on error Greg Kroah-Hartman
` (130 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara
6.12-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
@@ -2140,7 +2140,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] 825+ messages in thread
* [PATCH 6.12 691/816] dm log userspace: drop the device reference on error
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (689 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 690/816] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 692/816] dm: avoid double-dropping the zone reset submission reference Greg Kroah-Hartman
` (129 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Mikulas Patocka
6.12-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) {
@@ -314,6 +316,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] 825+ messages in thread
* [PATCH 6.12 692/816] dm: avoid double-dropping the zone reset submission reference
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (690 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 691/816] dm log userspace: drop the device reference on error Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 693/816] dm: Reject table setup after queue or disk teardown Greg Kroah-Hartman
` (128 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yaohan Li, Mikulas Patocka
6.12-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
@@ -1945,8 +1945,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] 825+ messages in thread
* [PATCH 6.12 693/816] dm: Reject table setup after queue or disk teardown
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (691 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 692/816] dm: avoid double-dropping the zone reset submission reference Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 694/816] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
` (127 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+5307e3bcacec2ce4c2f0,
Kirtikumar Anandrao Ramchandani, Mikulas Patocka
6.12-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
@@ -2595,13 +2595,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] 825+ messages in thread
* [PATCH 6.12 694/816] dm cache: reject kcopyd client destory if it setup failed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (692 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 693/816] dm: Reject table setup after queue or disk teardown Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 695/816] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
` (126 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+a2626a25eb2595e3ec3c,
Edward Adam Davis, Mikulas Patocka
6.12-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
@@ -2550,6 +2550,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] 825+ messages in thread
* [PATCH 6.12 695/816] dm crypt: fix use of uninitialized percpu_counter in ctr error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (693 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 694/816] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 696/816] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
` (125 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+4b232570d625662eaab4,
Zhao Feng, Mikulas Patocka
6.12-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
@@ -3308,6 +3308,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;
@@ -3319,10 +3327,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] 825+ messages in thread
* [PATCH 6.12 696/816] dm mpath: fix buffer overflow in parse_hw_handler()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (694 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 695/816] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 697/816] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
` (124 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shao Mingyin, Mikulas Patocka
6.12-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
@@ -1082,8 +1082,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] 825+ messages in thread
* [PATCH 6.12 697/816] dm mpath: cap queue_if_no_path_timeout_secs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (695 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 696/816] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 698/816] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
` (123 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Mikulas Patocka
6.12-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
@@ -801,7 +801,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] 825+ messages in thread
* [PATCH 6.12 698/816] dm thin: avoid wrapping no_space_timeout
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (696 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 697/816] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 699/816] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
` (122 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Mikulas Patocka
6.12-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
@@ -2544,7 +2544,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] 825+ messages in thread
* [PATCH 6.12 699/816] dm-sysfs: fix misbehavior if kobject_init_and_add fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (697 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 698/816] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 700/816] dm-verity: dont restart or panic on errors during system shutdown Greg Kroah-Hartman
` (121 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka, Wentao Liang
6.12-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
@@ -132,9 +132,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] 825+ messages in thread
* [PATCH 6.12 700/816] dm-verity: dont restart or panic on errors during system shutdown
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (698 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 699/816] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 701/816] dm persistent data: test return value of node_copy Greg Kroah-Hartman
` (120 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongyu Jin, weijiang.zhou,
Mikulas Patocka
6.12-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
@@ -229,6 +229,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,
@@ -277,6 +286,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");
@@ -579,15 +597,6 @@ static int verity_verify_io(struct dm_ve
return 0;
}
-/*
- * 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] 825+ messages in thread
* [PATCH 6.12 701/816] dm persistent data: test return value of node_copy
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (699 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 700/816] dm-verity: dont restart or panic on errors during system shutdown Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 702/816] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
` (119 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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] 825+ messages in thread
* [PATCH 6.12 702/816] dm persistent data: dont ignore writeback errors
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (700 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 701/816] dm persistent data: test return value of node_copy Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 703/816] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
` (118 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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] 825+ messages in thread
* [PATCH 6.12 703/816] dm persistent data: dont leak bufio buffer if find_leaf fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (701 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 702/816] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 704/816] dm snapshot: fix discard_granularity unit in snapshot_io_hints Greg Kroah-Hartman
` (117 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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] 825+ messages in thread
* [PATCH 6.12 704/816] dm snapshot: fix discard_granularity unit in snapshot_io_hints
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (702 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 703/816] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 705/816] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
` (116 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1288484b13bf6af3620d,
wuyuehong, Mikulas Patocka
6.12-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
@@ -2420,7 +2420,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] 825+ messages in thread
* [PATCH 6.12 705/816] dm snapshot: split discards on chunk boundaries
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (703 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 704/816] dm snapshot: fix discard_granularity unit in snapshot_io_hints Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 706/816] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
` (115 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Cheng, Mikulas Patocka
6.12-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
@@ -1364,8 +1364,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] 825+ messages in thread
* [PATCH 6.12 706/816] dm snapshot: fix discard writing into the next COW chunk
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (704 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 705/816] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 707/816] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
` (114 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Cheng, Mikulas Patocka
6.12-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
@@ -1954,8 +1954,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)
@@ -2015,11 +2015,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] 825+ messages in thread
* [PATCH 6.12 707/816] dm zoned: back off when reclaim cannot make progress
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (705 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 706/816] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 708/816] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
` (113 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyrylo Biryuk, Damien Le Moal,
Hannes Reinecke, Mikulas Patocka
6.12-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
@@ -539,6 +539,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] 825+ messages in thread
* [PATCH 6.12 708/816] dm zoned: do not reclaim a random zone into another random zone
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (706 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 707/816] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 709/816] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
` (112 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Hannes Reinecke,
Kyrylo Biryuk, Mikulas Patocka
6.12-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
@@ -290,7 +290,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] 825+ messages in thread
* [PATCH 6.12 709/816] dm-cache: fix NULL pointer dereference on open failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (707 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 708/816] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 710/816] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
` (111 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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] 825+ messages in thread
* [PATCH 6.12 710/816] dm-cache: fix ending a cursor that never began
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (708 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 709/816] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 711/816] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers Greg Kroah-Hartman
` (110 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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
@@ -1442,7 +1442,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] 825+ messages in thread
* [PATCH 6.12 711/816] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (709 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 710/816] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 712/816] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
` (109 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+ff132cb52bce4f44ecc9,
xietangxin, Mikulas Patocka
6.12-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
@@ -2926,8 +2926,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] 825+ messages in thread
* [PATCH 6.12 712/816] dm-crypt: defer async write submission to write thread
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (710 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 711/816] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 713/816] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
` (108 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Schlehofer, Mikulas Patocka
6.12-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
@@ -2059,8 +2059,9 @@ static void kcryptd_crypt_write_io_submi
clone->bi_iter.bi_sector = cc->start + io->sector;
- 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] 825+ messages in thread
* [PATCH 6.12 713/816] dm-integrity: dont recalculate with HMAC because of a dirty bitmap
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (711 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 712/816] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 714/816] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
` (107 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sinan Polat, Mikulas Patocka
6.12-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
@@ -3736,6 +3736,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;
@@ -3825,8 +3843,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] 825+ messages in thread
* [PATCH 6.12 714/816] dm-integrity: dont attempt to commit journal on disabled device
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (712 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 713/816] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 715/816] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
` (106 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+94dac3c75477e184f0b0,
Mikulas Patocka
6.12-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
@@ -2773,6 +2773,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);
@@ -5239,7 +5244,6 @@ try_smaller_buffer:
r = create_journal(ic, &ti->error);
if (r)
goto bad;
-
}
if (ic->mode == 'B') {
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 715/816] dm-raid: bound array_position before indexing failed_devices
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (713 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 714/816] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 716/816] dm-raid: fix use-after-free in raid_dtr() Greg Kroah-Hartman
` (105 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jay Vadayath, Mikulas Patocka
6.12-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
@@ -2424,7 +2424,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] 825+ messages in thread
* [PATCH 6.12 716/816] dm-raid: fix use-after-free in raid_dtr()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (714 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 715/816] 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 6.12 717/816] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
` (104 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -3332,7 +3332,7 @@ static void raid_dtr(struct dm_target *t
md_stop(&rs->md);
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] 825+ messages in thread
* [PATCH 6.12 717/816] dm-thin: fix data corruption if discard races with regular I/O
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (715 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 716/816] 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 6.12 718/816] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
` (103 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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
@@ -1705,6 +1705,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] 825+ messages in thread
* [PATCH 6.12 718/816] dm-thin: fix leak if __set_snapshot_details fails
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (716 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 717/816] 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 6.12 719/816] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
` (102 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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] 825+ messages in thread
* [PATCH 6.12 719/816] dm-thin: fix parsing of feature arguments
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (717 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 718/816] 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 6.12 720/816] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
` (101 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mikulas Patocka
6.12-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
@@ -3151,7 +3151,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] 825+ messages in thread
* [PATCH 6.12 720/816] vt: serialise the producers of the flip buffer
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (718 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 719/816] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 721/816] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
` (100 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -321,15 +321,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);
}
@@ -590,6 +595,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
@@ -1818,6 +1818,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] 825+ messages in thread
* [PATCH 6.12 721/816] comedi: addi_apci_1500: fix clearing of the gate enable
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (719 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 720/816] 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 6.12 722/816] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
` (99 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 722/816] comedi: ni_660x: dont poll without a DMA channel
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (720 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 721/816] 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 6.12 723/816] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
` (98 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 723/816] comedi: ni_tio: Fix overflow of the clock period
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (721 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 722/816] 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 6.12 724/816] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
` (97 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 724/816] comedi: vmk80xx: report failed transfers of the K8061
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (722 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 723/816] 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 6.12 725/816] iio: accel: adxl380: dont stay in standby on -EINVAL Greg Kroah-Hartman
` (96 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 725/816] iio: accel: adxl380: dont stay in standby on -EINVAL
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (723 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 724/816] 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 6.12 726/816] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
` (95 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -341,8 +341,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);
}
@@ -709,6 +712,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] 825+ messages in thread
* [PATCH 6.12 726/816] iio: addac: ad74413r: fix the values of set_multiple
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (724 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 725/816] 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 6.12 727/816] iio: hid-sensors: fix a division by zero Greg Kroah-Hartman
` (94 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 void ad74413r_gpio_set_multiple(s
return;
real_mask |= BIT(real_offset);
- if (*bits & offset)
+ if (test_bit(offset, bits))
real_bits |= BIT(real_offset);
}
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 727/816] iio: hid-sensors: fix a division by zero
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (725 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 726/816] 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 6.12 728/816] iio: sx9310: use the data of the I2C table Greg Kroah-Hartman
` (93 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -137,7 +137,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] 825+ messages in thread
* [PATCH 6.12 728/816] iio: sx9310: use the data of the I2C table
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (726 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 727/816] 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 6.12 729/816] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
` (92 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -885,7 +885,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] 825+ messages in thread
* [PATCH 6.12 729/816] misc: bcm-vk: fix DMA allocation memory leak
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (727 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 728/816] 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 6.12 730/816] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
` (91 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li
6.12-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
@@ -80,7 +80,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 */
@@ -92,8 +93,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;
@@ -110,8 +113,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++) {
@@ -123,8 +126,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;
}
/*
@@ -169,6 +172,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] 825+ messages in thread
* [PATCH 6.12 730/816] misc: ibmvmc: initialize HMC state before device registration
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (728 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 729/816] 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 6.12 731/816] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
` (90 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 731/816] misc: vmw_vmci: wait for callbacks in event unsubscribe
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (729 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 730/816] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
@ 2026-11-25 14:37 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 732/816] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
` (89 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 732/816] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (730 preceding siblings ...)
2026-11-25 14:37 ` [PATCH 6.12 731/816] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 733/816] serial: rda: free the interrupt on shutdown Greg Kroah-Hartman
` (88 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Ilpo Järvinen,
Andy Shevchenko, Jiri Slaby, Heikki Krogerus, Peter Hurley,
Josef Bacik
6.12-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] 825+ messages in thread
* [PATCH 6.12 733/816] serial: rda: free the interrupt on shutdown
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (731 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 732/816] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 734/816] serial: samsung: dont leak the tty on an RX IRQ Greg Kroah-Hartman
` (87 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiri Slaby, Arnd Bergmann,
Andreas Färber, Olof Johansson, Josef Bacik,
Manivannan Sadhasivam
6.12-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] 825+ messages in thread
* [PATCH 6.12 734/816] serial: samsung: dont leak the tty on an RX IRQ
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (732 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 733/816] serial: rda: free the interrupt on shutdown Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 735/816] serial: samsung: put the previous baud clock Greg Kroah-Hartman
` (86 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Krzysztof Kozlowski,
Peter Griffin, Alim Akhtar, Jiri Slaby, Robert Baldyga,
Josef Bacik
6.12-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
@@ -734,14 +734,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] 825+ messages in thread
* [PATCH 6.12 735/816] serial: samsung: put the previous baud clock
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (733 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 734/816] serial: samsung: dont leak the tty on an RX IRQ Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 736/816] tty: fix misapplied compat_ptr() in tty_compat_ioctl() Greg Kroah-Hartman
` (85 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 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
6.12-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
@@ -1496,11 +1496,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] 825+ messages in thread
* [PATCH 6.12 736/816] tty: fix misapplied compat_ptr() in tty_compat_ioctl()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (734 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 735/816] serial: samsung: put the previous baud clock Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 737/816] USB: cdc-acm: fix NULL-deref on hangup Greg Kroah-Hartman
` (84 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Slaby (SUSE)
6.12-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
@@ -3007,8 +3007,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] 825+ messages in thread
* [PATCH 6.12 737/816] USB: cdc-acm: fix NULL-deref on hangup
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (735 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 736/816] tty: fix misapplied compat_ptr() in tty_compat_ioctl() Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 738/816] usb: pci-quirks: always assert xHCI OS ownership Greg Kroah-Hartman
` (83 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Dan Drown, Johan Hovold
6.12-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] 825+ messages in thread
* [PATCH 6.12 738/816] usb: pci-quirks: always assert xHCI OS ownership
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (736 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 737/816] USB: cdc-acm: fix NULL-deref on hangup Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 739/816] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
` (82 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 739/816] USB: serial: garmin_gps: fix deadlock on reset request
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (737 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 738/816] usb: pci-quirks: always assert xHCI OS ownership Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 740/816] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
` (81 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Josef Bacik, Johan Hovold
6.12-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
@@ -821,10 +821,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);
@@ -833,13 +832,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] 825+ messages in thread
* [PATCH 6.12 740/816] USB: serial: oti6858: fix the teardown order in close
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (738 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 739/816] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 741/816] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
` (80 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Johan Hovold, Josef Bacik
6.12-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
@@ -251,7 +251,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);
}
@@ -303,7 +303,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);
}
@@ -564,6 +564,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);
@@ -572,7 +579,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,
@@ -829,7 +837,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] 825+ messages in thread
* [PATCH 6.12 741/816] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (739 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 740/816] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 742/816] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
` (79 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Joonhoe Kim, Konrad Dybcio,
Heikki Krogerus
6.12-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
@@ -92,16 +92,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] 825+ messages in thread
* [PATCH 6.12 742/816] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (740 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 741/816] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 743/816] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
` (78 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Chaz Bailey,
Krishna Kurapati, Heikki Krogerus
6.12-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] 825+ messages in thread
* [PATCH 6.12 743/816] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa)
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (741 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 742/816] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 744/816] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
` (77 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Olivier Kaloudoff, stable,
Alan Stern
6.12-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] 825+ messages in thread
* [PATCH 6.12 744/816] usb: usbtest: prevent divide by zero in simple_io() with zero length
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (742 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 743/816] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 745/816] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
` (76 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Bin Yu, Cheng Wen,
YuanZhe Liu, Alan Stern
6.12-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] 825+ messages in thread
* [PATCH 6.12 745/816] usb: typec: ucsi: Set ucsi->connector before enabling notifications
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (743 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 744/816] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 746/816] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
` (75 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Uttkarsh Aggarwal,
Peter Chen, Heikki Krogerus
6.12-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
@@ -1868,6 +1868,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;
@@ -1875,7 +1883,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);
@@ -1889,6 +1896,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] 825+ messages in thread
* [PATCH 6.12 746/816] usb: xhci: disable the correct slot on alloc_dev failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (744 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 745/816] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 747/816] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
` (74 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xu Rao, Niklas Neronin,
Mathias Nyman
6.12-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
@@ -4090,7 +4090,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] 825+ messages in thread
* [PATCH 6.12 747/816] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (745 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 746/816] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 748/816] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
` (73 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Yu Zhang, Alan Stern
6.12-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
@@ -2668,8 +2668,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,
@@ -3247,7 +3248,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] 825+ messages in thread
* [PATCH 6.12 748/816] usb: gadget: f_midi: fix UAF race during IN request handling
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (746 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 747/816] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 749/816] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
` (72 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Sonali Pradhan
6.12-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] 825+ messages in thread
* [PATCH 6.12 749/816] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (747 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 748/816] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 750/816] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
` (71 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Cosmin Tanislav,
Vladyslav Tymoshchuk, Leonardo Costa, Hiago De Franco
6.12-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] 825+ messages in thread
* [PATCH 6.12 750/816] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (748 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 749/816] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 751/816] usb: gadget: u_serial: pin ports while TTYs are installed Greg Kroah-Hartman
` (70 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+782b2f1063e38ba8fa6e, stable,
Brian Ellis
6.12-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
@@ -684,6 +684,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] 825+ messages in thread
* [PATCH 6.12 751/816] usb: gadget: u_serial: pin ports while TTYs are installed
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (749 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 750/816] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 752/816] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
` (69 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+fe63e4d633540f230624, stable,
Krystian Kaniewski, syzbot, Mehmet Fide,
syzbot+bca09f5d8b843bbf7571
6.12-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 */
@@ -592,22 +612,60 @@ static int gs_start_io(struct gs_port *p
/* 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);
@@ -627,7 +685,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);
@@ -637,7 +695,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 */
@@ -661,7 +718,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;
}
@@ -687,6 +748,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) {
@@ -876,8 +942,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,
@@ -1170,14 +1238,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;
}
@@ -1189,6 +1284,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);
@@ -1202,10 +1298,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)
@@ -1225,8 +1325,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)
@@ -1243,15 +1342,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;
@@ -1262,19 +1361,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)) {
@@ -1283,14 +1383,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] 825+ messages in thread
* [PATCH 6.12 752/816] usb: dwc3: gadget: Clear delayed stop on End Transfer completion
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (750 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 751/816] usb: gadget: u_serial: pin ports while TTYs are installed Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 753/816] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
` (68 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
6.12-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
@@ -3834,6 +3834,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] 825+ messages in thread
* [PATCH 6.12 753/816] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (751 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 752/816] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 754/816] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
` (67 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
6.12-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
@@ -891,6 +891,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
@@ -958,55 +1006,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] 825+ messages in thread
* [PATCH 6.12 754/816] usb: dwc3: gadget: Recover from End Transfer timeout
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (752 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 753/816] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 755/816] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
` (66 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Thinh Nguyen, stable
6.12-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
@@ -1743,6 +1743,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
@@ -1786,6 +1788,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] 825+ messages in thread
* [PATCH 6.12 755/816] usb: dwc3: gadget: Reject requests to a disabled endpoint
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (753 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 754/816] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 756/816] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
` (65 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
6.12-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
@@ -1074,6 +1074,8 @@ static int __dwc3_gadget_ep_disable(stru
reg &= ~DWC3_DALEPENA_EP(dep->number);
dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
+ dep->flags &= ~DWC3_EP_ENABLED;
+
dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
dep->stream_capable = false;
@@ -1987,7 +1989,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] 825+ messages in thread
* [PATCH 6.12 756/816] usb: dwc3: gadget: Reset endpoint flags on controller start
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (754 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 755/816] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 757/816] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
` (64 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Thinh Nguyen
6.12-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
@@ -2944,6 +2944,7 @@ static int __dwc3_gadget_start(struct dw
{
struct dwc3_ep *dep;
int ret = 0;
+ u32 epnum;
u32 reg;
/*
@@ -3001,6 +3002,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] 825+ messages in thread
* [PATCH 6.12 757/816] usb: dwc3: gadget: Track a timed out End Transfer
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (755 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 756/816] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 758/816] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
` (63 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
6.12-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
@@ -1795,9 +1795,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] 825+ messages in thread
* [PATCH 6.12 758/816] usb: dwc3: gadget: Wait for End Transfer completion on ep disable
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (756 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 757/816] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 759/816] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
` (62 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Selvarasu Ganesan,
Thinh Nguyen
6.12-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)
@@ -1662,7 +1663,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
@@ -1007,9 +1007,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:
@@ -1018,16 +1023,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);
@@ -1076,7 +1086,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;
@@ -1088,6 +1098,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 */
@@ -2547,7 +2566,7 @@ static void dwc3_stop_active_transfers(s
if (!dep)
continue;
- dwc3_remove_requests(dwc, dep, -ESHUTDOWN);
+ dwc3_remove_requests(dwc, dep, -ESHUTDOWN, false);
}
}
@@ -3878,7 +3897,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] 825+ messages in thread
* [PATCH 6.12 759/816] usb: dwc3: xilinx: fix system suspend and resume PHY handling
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (757 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 758/816] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 760/816] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
` (61 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Radhey Shyam Pandey,
Thinh Nguyen
6.12-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
@@ -384,13 +384,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)
@@ -404,15 +417,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] 825+ messages in thread
* [PATCH 6.12 760/816] w1: dont hold list_mutex while a slave is torn down
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (758 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 759/816] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 761/816] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
` (60 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -776,16 +776,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;
@@ -799,7 +807,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] 825+ messages in thread
* [PATCH 6.12 761/816] w1: ds2482: set the strong pull-up with its byte
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (759 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 760/816] 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 6.12 762/816] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
` (59 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -102,6 +102,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;
};
@@ -335,6 +336,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);
@@ -419,27 +433,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] 825+ messages in thread
* [PATCH 6.12 762/816] w1: ds2805: use the bus mutex to talk on the bus
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (760 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 761/816] 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 6.12 763/816] w1: ds28e04: " Greg Kroah-Hartman
` (58 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 763/816] w1: ds28e04: use the bus mutex to talk on the bus
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (761 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 762/816] 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 6.12 764/816] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
` (57 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 764/816] w1: netlink: drop the slave after the bus is unlocked
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (762 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 763/816] w1: ds28e04: " Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 765/816] w1: remove the masters files before taking its locks Greg Kroah-Hartman
` (56 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -480,15 +480,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] 825+ messages in thread
* [PATCH 6.12 765/816] w1: remove the masters files before taking its locks
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (763 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 764/816] 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 6.12 766/816] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
` (55 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 766/816] w1: use the bus mutex for the "rw" file
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (764 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 765/816] 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 6.12 767/816] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
` (54 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 767/816] w1: w1_therm: leave the slaves of other families alone
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (765 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 766/816] 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 6.12 768/816] drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings Greg Kroah-Hartman
` (53 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -917,6 +917,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
*
@@ -1507,9 +1520,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);
@@ -1547,7 +1558,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;
}
@@ -1576,7 +1587,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:
@@ -1944,16 +1955,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] 825+ messages in thread
* [PATCH 6.12 768/816] drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (766 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 767/816] 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 6.12 769/816] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
` (52 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -1993,7 +1993,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] 825+ messages in thread
* [PATCH 6.12 769/816] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (767 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 768/816] 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 6.12 770/816] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
` (51 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -400,11 +400,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] 825+ messages in thread
* [PATCH 6.12 770/816] USB: serial: garmin_gps: validate packet data length in nat_receive()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (768 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 769/816] 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 6.12 771/816] USB: serial: sierra: validate URB length in instat callback Greg Kroah-Hartman
` (50 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -749,11 +749,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;
@@ -772,8 +768,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] 825+ messages in thread
* [PATCH 6.12 771/816] USB: serial: sierra: validate URB length in instat callback
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (769 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 770/816] 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 6.12 772/816] USB: serial: upd78f0730: fix NULL-deref on hangup Greg Kroah-Hartman
` (49 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 772/816] USB: serial: upd78f0730: fix NULL-deref on hangup
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (770 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 771/816] 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 6.12 773/816] USB: serial: io_edgeport: fix NULL-deref on early status Greg Kroah-Hartman
` (48 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 773/816] USB: serial: io_edgeport: fix NULL-deref on early status
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (771 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 772/816] 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 6.12 774/816] USB: serial: io_edgeport: fix potential close() use-after-free Greg Kroah-Hartman
` (47 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 774/816] USB: serial: io_edgeport: fix potential close() use-after-free
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (772 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 773/816] 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 6.12 775/816] USB: serial: io_edgeport: fix potential NULL-deref at open Greg Kroah-Hartman
` (46 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
6.12-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((unsigned int)count,
(edge_port->txCredits - fifo->count));
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 775/816] USB: serial: io_edgeport: fix potential NULL-deref at open
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (773 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 774/816] 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 6.12 776/816] USB: serial: io_edgeport: move initial termios update to open() Greg Kroah-Hartman
` (45 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
6.12-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] 825+ messages in thread
* [PATCH 6.12 776/816] USB: serial: io_edgeport: move initial termios update to open()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (774 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 775/816] 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 6.12 777/816] USB: serial: io_edgeport: fix potential fifo corruption Greg Kroah-Hartman
` (44 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
6.12-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] 825+ messages in thread
* [PATCH 6.12 777/816] USB: serial: io_edgeport: fix potential fifo corruption
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (775 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 776/816] 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 6.12 778/816] USB: serial: io_edgeport: fix potential use-after-free on disconnect Greg Kroah-Hartman
` (43 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
6.12-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] 825+ messages in thread
* [PATCH 6.12 778/816] USB: serial: io_edgeport: fix potential use-after-free on disconnect
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (776 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 777/816] 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 6.12 779/816] USB: serial: io_edgeport: serialise MCR accesses Greg Kroah-Hartman
` (42 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
6.12-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] 825+ messages in thread
* [PATCH 6.12 779/816] USB: serial: io_edgeport: serialise MCR accesses
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (777 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 778/816] 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 6.12 780/816] dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs Greg Kroah-Hartman
` (41 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold
6.12-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] 825+ messages in thread
* [PATCH 6.12 780/816] dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (778 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 779/816] USB: serial: io_edgeport: serialise MCR accesses Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 781/816] iio: accel: kxsd9: Fix potential use-after-free on removal Greg Kroah-Hartman
` (40 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -62,6 +62,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
@@ -69,6 +74,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] 825+ messages in thread
* [PATCH 6.12 781/816] iio: accel: kxsd9: Fix potential use-after-free on removal
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (779 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 780/816] 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 6.12 782/816] iio: acpi: Accept comma separated values in ROTM strings Greg Kroah-Hartman
` (39 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -481,8 +481,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] 825+ messages in thread
* [PATCH 6.12 782/816] iio: acpi: Accept comma separated values in ROTM strings
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (780 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 781/816] 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 6.12 783/816] iio: afe: rescale: expose offset if rescaler or source has one Greg Kroah-Hartman
` (38 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -5,6 +5,7 @@
#include <linux/dev_printk.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
@@ -58,6 +59,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] 825+ messages in thread
* [PATCH 6.12 783/816] iio: afe: rescale: expose offset if rescaler or source has one
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (781 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 782/816] 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 6.12 784/816] iio: atlas-ezo: Fix humidity channel read support Greg Kroah-Hartman
` (37 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -304,7 +304,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] 825+ messages in thread
* [PATCH 6.12 784/816] iio: atlas-ezo: Fix humidity channel read support
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (782 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 783/816] 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 6.12 785/816] iio: dac: mcp4725: Update the cached DAC value only on success Greg Kroah-Hartman
` (36 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -117,9 +117,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] 825+ messages in thread
* [PATCH 6.12 785/816] iio: dac: mcp4725: Update the cached DAC value only on success
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (783 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 784/816] 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 6.12 786/816] iio: gyro: bmg160: reject duplicate event disable Greg Kroah-Hartman
` (35 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -359,6 +359,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] 825+ messages in thread
* [PATCH 6.12 786/816] iio: gyro: bmg160: reject duplicate event disable
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (784 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 785/816] 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 6.12 787/816] iio: hid-sensor: Fix scale for magnetic north heading Greg Kroah-Hartman
` (34 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -766,7 +766,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] 825+ messages in thread
* [PATCH 6.12 787/816] iio: hid-sensor: Fix scale for magnetic north heading
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (785 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 786/816] iio: gyro: bmg160: reject duplicate event disable Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 788/816] iio: hid-sensors: fix fractional part for unit exponents -7 and -8 Greg Kroah-Hartman
` (33 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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 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] 825+ messages in thread
* [PATCH 6.12 788/816] iio: hid-sensors: fix fractional part for unit exponents -7 and -8
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (786 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 787/816] 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 6.12 789/816] iio: humidity: am2315: fix negative temperature decoding Greg Kroah-Hartman
` (32 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -95,9 +95,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] 825+ messages in thread
* [PATCH 6.12 789/816] iio: humidity: am2315: fix negative temperature decoding
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (787 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 788/816] 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 6.12 790/816] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change Greg Kroah-Hartman
` (31 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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] 825+ messages in thread
* [PATCH 6.12 790/816] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (788 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 789/816] iio: humidity: am2315: fix negative temperature decoding Greg Kroah-Hartman
@ 2026-11-25 14:38 ` Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 791/816] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes Greg Kroah-Hartman
` (30 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -532,22 +532,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,
@@ -572,20 +570,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] 825+ messages in thread
* [PATCH 6.12 791/816] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (789 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 790/816] 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:39 ` [PATCH 6.12 792/816] iio: imu: kmx61: reject duplicate event disable Greg Kroah-Hartman
` (29 subsequent siblings)
820 siblings, 0 replies; 825+ 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
6.12-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
@@ -1550,6 +1550,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] 825+ messages in thread
* [PATCH 6.12 792/816] iio: imu: kmx61: reject duplicate event disable
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (790 preceding siblings ...)
2026-11-25 14:38 ` [PATCH 6.12 791/816] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 793/816] iio: light: tsl2591: dont divide by zero Greg Kroah-Hartman
` (28 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Jonathan Cameron
6.12-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
@@ -946,7 +946,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;
mutex_lock(&data->lock);
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 793/816] iio: light: tsl2591: dont divide by zero
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (791 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 792/816] iio: imu: kmx61: reject duplicate event disable Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 794/816] iio: light: vcnl4035: Fix reversed ALS mode bit Greg Kroah-Hartman
` (27 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Martin Triska, Andy Shevchenko,
Jan Remes, Jonathan Cameron
6.12-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>
@@ -425,6 +426,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
*/
@@ -436,8 +441,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);
@@ -473,23 +480,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] 825+ messages in thread
* [PATCH 6.12 794/816] iio: light: vcnl4035: Fix reversed ALS mode bit
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (792 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 793/816] iio: light: tsl2591: dont divide by zero Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 795/816] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Greg Kroah-Hartman
` (26 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Sarmanow, Nuno Sá,
Jonathan Cameron
6.12-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
@@ -46,8 +46,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] 825+ messages in thread
* [PATCH 6.12 795/816] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (793 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 794/816] iio: light: vcnl4035: Fix reversed ALS mode bit Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 796/816] iio: proximity: sx9324: fix out-of-bounds read of scan period table Greg Kroah-Hartman
` (25 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain,
Jonathan Cameron
6.12-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
@@ -534,14 +534,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] 825+ messages in thread
* [PATCH 6.12 796/816] iio: proximity: sx9324: fix out-of-bounds read of scan period table
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (794 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 795/816] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 797/816] iio: temperature: mlx90614: Fix dual channel probe condition check Greg Kroah-Hartman
` (24 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Andy Shevchenko,
Jonathan Cameron
6.12-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
@@ -280,11 +280,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] 825+ messages in thread
* [PATCH 6.12 797/816] iio: temperature: mlx90614: Fix dual channel probe condition check
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (795 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 796/816] iio: proximity: sx9324: fix out-of-bounds read of scan period table Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 798/816] iio: trigger: free the trigger ID after device_del() Greg Kroah-Hartman
` (23 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Salah Triki, Jonathan Cameron
6.12-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
@@ -570,7 +570,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] 825+ messages in thread
* [PATCH 6.12 798/816] iio: trigger: free the trigger ID after device_del()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (796 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 797/816] iio: temperature: mlx90614: Fix dual channel probe condition check Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 799/816] iio: trigger: Return an error when the trigger has no free irq Greg Kroah-Hartman
` (22 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Changyul Lee, Jonathan Cameron
6.12-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] 825+ messages in thread
* [PATCH 6.12 799/816] iio: trigger: Return an error when the trigger has no free irq
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (797 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 798/816] iio: trigger: free the trigger ID after device_del() Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 800/816] fou: reserve headroom before pushing the encap header Greg Kroah-Hartman
` (21 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Joshua Crofts,
Jonathan Cameron
6.12-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] 825+ messages in thread
* [PATCH 6.12 800/816] fou: reserve headroom before pushing the encap header
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (798 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 799/816] iio: trigger: Return an error when the trigger has no free irq Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 801/816] blk-mq: take quiesce_lock when removing a queue from the tag set Greg Kroah-Hartman
` (20 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye,
Theodor Arsenij Larionov Trichkine, Ido Schimmel, Jakub Kicinski
6.12-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
@@ -1078,6 +1078,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;
@@ -1090,16 +1093,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
@@ -603,6 +603,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)
@@ -745,6 +746,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)) {
@@ -763,6 +766,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);
@@ -795,7 +799,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));
@@ -815,7 +818,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] 825+ messages in thread
* [PATCH 6.12 801/816] blk-mq: take quiesce_lock when removing a queue from the tag set
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (799 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 800/816] fou: reserve headroom before pushing the encap header Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 802/816] accel/ivpu: Defer recovery until probe completes Greg Kroah-Hartman
` (19 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mohamed Khalfella, Mani Tofigh,
Christoph Hellwig, Nilay Shroff, Jens Axboe
6.12-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
@@ -4269,7 +4269,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
@@ -512,7 +512,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] 825+ messages in thread
* [PATCH 6.12 802/816] accel/ivpu: Defer recovery until probe completes
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (800 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 801/816] blk-mq: take quiesce_lock when removing a queue from the tag set Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 803/816] sctp: fix skb_over_panic when adding addresses with a pending delete of another family Greg Kroah-Hartman
` (18 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Daksh Sahni, Jeff Hugo,
Karol Wachowski
6.12-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
@@ -140,8 +140,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)
@@ -368,6 +368,7 @@ void ivpu_pm_init(struct ivpu_device *vd
atomic_set(&pm->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)
@@ -392,6 +393,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_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 803/816] sctp: fix skb_over_panic when adding addresses with a pending delete of another family
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (801 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 802/816] accel/ivpu: Defer recovery until probe completes Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 804/816] nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem() Greg Kroah-Hartman
` (17 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Henry Martin, Xin Long,
Jakub Kicinski
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henry Martin <bsdhenrymartin@gmail.com>
commit ce09d8c13a15fe881d0a04c91979dcdf45ed9543 upstream.
sctp_make_asconf_update_ip() accounts for a pending DEL_IP
parameter by reusing the length of the address being added. The
write-back side instead serializes the pending address itself,
with its own address family. If the pending delete is IPv6
(20-byte parameter) while the added addresses are IPv4 (8-byte),
the chunk is allocated 12 bytes short and sctp_addto_chunk()
writes past the end of the skb. E.g. on mainline (05441d697f7f):
skbuff: skb_over_panic: text:ffffffff84859c77 len:392 put:20
tail:0x188 end:0x180 dev:<NULL>
kernel BUG at net/core/skbuff.c:215!
CPU: 0 UID: 1000 PID: 379 Comm: poc_sctp
Call Trace:
skb_panic
skb_put
sctp_addto_chunk
sctp_make_asconf_update_ip
sctp_send_asconf_add_ip
sctp_setsockopt_bindx
__x64_sys_setsockopt
Requires addip enabled on the endpoint (net.sctp.addip_enable=1).
Account for the pending delete with its own address family, as the
write-back side already does.
This issue was discovered by an LLM code scanner.
Cc: stable@vger.kernel.org
Fixes: 8a07eb0a50ae ("sctp: Add ASCONF operation on the single-homed host")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261111082313.1606366-1-bsdhenrymartin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/sm_make_chunk.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2901,7 +2901,6 @@ struct sctp_chunk *sctp_make_asconf_upda
int addr_param_len = 0;
union sctp_addr *addr;
int totallen = 0, i;
- int del_pickup = 0;
struct sctp_af *af;
void *addr_buf;
@@ -2916,16 +2915,21 @@ struct sctp_chunk *sctp_make_asconf_upda
totallen += addr_param_len;
addr_buf += af->sockaddr_len;
- if (asoc->asconf_addr_del_pending && !del_pickup) {
- /* reuse the parameter length from the same scope one */
- totallen += paramlen;
- totallen += addr_param_len;
- del_pickup = 1;
-
- pr_debug("%s: picked same-scope del_pending addr, "
- "totallen for all addresses is %d\n",
- __func__, totallen);
- }
+ }
+
+ if (asoc->asconf_addr_del_pending) {
+ /* The DEL_IP parameter is serialized from the pending address
+ * itself below; account for its own address family, which may
+ * differ from the added ones.
+ */
+ addr = asoc->asconf_addr_del_pending;
+ af = sctp_get_af_specific(addr->v4.sin_family);
+ totallen += paramlen;
+ totallen += af->to_addr_param(addr, &addr_param);
+
+ pr_debug("%s: picked del_pending addr, "
+ "totallen for all addresses is %d\n",
+ __func__, totallen);
}
/* Create an asconf chunk with the required length. */
@@ -2948,7 +2952,7 @@ struct sctp_chunk *sctp_make_asconf_upda
addr_buf += af->sockaddr_len;
}
- if (flags == SCTP_PARAM_ADD_IP && del_pickup) {
+ if (flags == SCTP_PARAM_ADD_IP && asoc->asconf_addr_del_pending) {
addr = asoc->asconf_addr_del_pending;
af = sctp_get_af_specific(addr->v4.sin_family);
addr_param_len = af->to_addr_param(addr, &addr_param);
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 804/816] nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem()
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (802 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 803/816] sctp: fix skb_over_panic when adding addresses with a pending delete of another family Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 805/816] tcp: fix NULL pointer dereference when restarting a Fast Open listener Greg Kroah-Hartman
` (16 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mani Tofigh, Christoph Hellwig,
Keith Busch
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mani Tofigh <mt4022@columbia.edu>
commit ba1213be15c613a1c03db69ea6480ca140a6ca00 upstream.
Connecting a controller to a new subsystem deadlocks when
sysfs_create_link() fails in nvme_init_subsystem(), e.g., on an
allocation failure. The error path drops the last subsystem reference
with nvme_subsystems_lock held and nvme_destroy_subsystem() takes the
same lock again:
nvme nvme0: failed to create sysfs link from subsystem.
============================================
WARNING: possible recursive locking detected
...
nvmesubsys/95 is trying to acquire lock:
(nvme_subsystems_lock){+.+.}-{4:4}, at: nvme_destroy_subsystem+0x1b/0x1e0
but task is already holding lock:
(nvme_subsystems_lock){+.+.}-{4:4}, at: nvme_init_identify+0x81e/0x34b0
...
Call Trace:
__mutex_lock+0x1a2/0x26e0
nvme_destroy_subsystem+0x1b/0x1e0
nvme_init_identify.cold+0x3bc/0x56f
nvme_init_ctrl_finish+0x1bc/0x7a0
nvme_loop_configure_admin_queue+0x205/0x2b0
nvme_loop_create_ctrl+0x480/0xd10
nvmf_dev_write+0x365/0x650
vfs_write+0x1e3/0x1250
ksys_write+0xfa/0x200
do_syscall_64+0xfb/0x590
entry_SYSCALL_64_after_hwframe+0x77/0x7f
...
INFO: task nvmesubsys:95 blocked for more than 20 seconds.
INFO: task nvmesubsys:95 is blocked on a mutex likely owned by task nvmesubsys:95.
Every later controller setup or removal then waits for the lock too.
The nvme_validate_cntlid() error path for an existing subsystem does the
same put, and deadlocks the same way if the other references go away in
between.
Drop the lock before the put. For a new subsystem, take it off the list
first so another controller can't find it in between. With the fix,
the connect fails and the next connect works.
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 30s.
Fixes: 32fd90c40768 ("nvme: change locking for the per-subsystem controller list")
Cc: stable@vger.kernel.org
Signed-off-by: Mani Tofigh <mt4022@columbia.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvme/host/core.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3109,7 +3109,11 @@ static int nvme_init_subsystem(struct nv
return 0;
out_put_subsystem:
+ if (!found)
+ list_del_init(&subsys->entry);
+ mutex_unlock(&nvme_subsystems_lock);
nvme_put_subsystem(subsys);
+ return ret;
out_unlock:
mutex_unlock(&nvme_subsystems_lock);
return ret;
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 805/816] tcp: fix NULL pointer dereference when restarting a Fast Open listener
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (803 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 804/816] nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem() Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 806/816] powerpc/watchdog: disable watchdog when watchdog_thresh=0 Greg Kroah-Hartman
` (15 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Kuniyuki Iwashima,
Eric Dumazet, Jakub Kicinski
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunwoo Kim <imv4bel@gmail.com>
commit aa40afa831ebfe45e40a23721711059f2ac584d4 upstream.
When a valid RST is received for a Fast Open child accepted before the
three-way handshake completes, reqsk_fastopen_remove() adds the
request_sock to the listener's RST list if the listener is in TCP_LISTEN.
An application can call shutdown(SHUT_RD) on a listener socket.
inet_csk_listen_stop() checks rskq_rst_head without holding
fastopenq.lock. If rskq_rst_head is NULL, it does not acquire the lock
and therefore does not synchronize with an insertion by
reqsk_fastopen_remove() after that function has passed the TCP_LISTEN
check.
The more likely outcome of this race, even without a subsequent
listen(), is a leak. If reqsk_fastopen_remove() inserts a request_sock
after inet_csk_listen_stop() observes an empty list and returns, the
request_sock is stranded in rskq_rst_head and keeps a reference on the
listener. The socket is already in TCP_CLOSE, so a subsequent close()
does not call inet_csk_listen_stop() again.
If listen() is called again on the same socket before the delayed list
insertion, the insertion can overlap the queue initialization in
reqsk_queue_alloc(). If it occurs after rskq_rst_head is set to NULL but
before rskq_rst_tail is set to NULL, rskq_rst_head points to the
request_sock while rskq_rst_tail is NULL.
When a valid RST is later received for another accepted Fast Open child,
rskq_rst_head is not NULL, so reqsk_fastopen_remove() attempts to write
the request_sock pointer to rskq_rst_tail->dl_next while rskq_rst_tail is
NULL. KASAN reports:
BUG: KASAN: null-ptr-deref in reqsk_fastopen_remove+0x147/0x210
Write of size 8 at addr 0000000000000088 by task swapper/3/0
...
Call Trace:
<IRQ>
...
reqsk_fastopen_remove+0x147/0x210
tcp_check_req+0xa70/0x1060
...
tcp_rcv_state_process+0x1cb/0x2ae0
...
tcp_v4_do_rcv+0x1fe/0x740
tcp_v4_rcv+0x1744/0x2070
...
ip_protocol_deliver_rcu+0x5c/0x280
ip_local_deliver_finish+0x171/0x330
ip_local_deliver+0x107/0x370
...
</IRQ>
To widen the race window, the issue was reproduced after adding
mdelay(3000) immediately after reqsk_fastopen_remove() checks that the
listener is in TCP_LISTEN and immediately after reqsk_queue_alloc() sets
rskq_rst_head to NULL.
Make inet_csk_listen_stop() acquire fastopenq.lock regardless of the
value of rskq_rst_head and detach the list while holding the lock. With
this synchronization, reqsk_fastopen_remove() either inserts the
request_sock before inet_csk_listen_stop() acquires the lock, in which
case inet_csk_listen_stop() reclaims it, or sees that the listener is
not in TCP_LISTEN and does not insert anything.
Fixes: 0536fcc039a8 ("tcp: prepare fastopen code for upcoming listener changes")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/avMkfJrXhCFXn8M_@v4bel
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/inet_connection_sock.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -1575,17 +1575,15 @@ skip_child_forget:
if (!has_current_bpf_ctx())
cond_resched();
}
- if (queue->fastopenq.rskq_rst_head) {
- /* Free all the reqs queued in rskq_rst_head. */
- spin_lock_bh(&queue->fastopenq.lock);
- req = queue->fastopenq.rskq_rst_head;
- queue->fastopenq.rskq_rst_head = NULL;
- spin_unlock_bh(&queue->fastopenq.lock);
- while (req != NULL) {
- next = req->dl_next;
- reqsk_put(req);
- req = next;
- }
+ /* Free all the reqs queued in rskq_rst_head. */
+ spin_lock_bh(&queue->fastopenq.lock);
+ req = queue->fastopenq.rskq_rst_head;
+ queue->fastopenq.rskq_rst_head = NULL;
+ spin_unlock_bh(&queue->fastopenq.lock);
+ while (req != NULL) {
+ next = req->dl_next;
+ reqsk_put(req);
+ req = next;
}
WARN_ON_ONCE(sk->sk_ack_backlog);
}
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 806/816] powerpc/watchdog: disable watchdog when watchdog_thresh=0
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (804 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 805/816] tcp: fix NULL pointer dereference when restarting a Fast Open listener Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 807/816] 9p: fix memory leak in v9fs_init_fs_context error path Greg Kroah-Hartman
` (14 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luiz Capitulino (Red Hat),
Michael Ellerman, Madhavan Srinivasan
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Capitulino (Red Hat) <luiz.capitulino@linux.dev>
commit d513ec3c907b067d4a32b14ec6f73c3e041cb136 upstream.
On powerpc, trying to disable the hardlockup detector with:
# echo 0 > /proc/sys/kernel/watchdog_thresh
causes an immediate and endless hardlockup detection, eventually leading
to an unusable system (splat example below). This happens because
watchdog_calc_timeouts() sets wd_timer_period_ms, wd_panic_timeout_tb
and wd_smp_panic_timeout_tb to zero, but start_watchdog() still starts
the timer (with expiry=0) in this code path:
proc_watchdog_thresh()
proc_watchdog_update()
__lockup_detector_reconfigure()
watchdog_hardlockup_start()
start_watchdog_on_cpu()
start_watchdog()
hrtimer_start() /* wd_timer_period_ms=0 */
However, according to Documentation/admin-guide/sysctl/kernel.rst,
setting watchdog_thresh=0 should disable both the soft and hard lockup
detectors.
This condition is already checked in __lockup_detector_reconfigure() for
the soft lockup detector and the arch-independent hardlockup detector,
what's missing is powerpc performing the same check in start_watchdog().
[ 278.110085] watchdog: CPU 0 detected hard LOCKUP on other CPUs 1
[ 278.110086] watchdog: CPU 1 became unstuck TB:33050716089564575
[ 278.110097] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Kdump: loaded Tainted: G E 7.4.0-rc1 #1 PREEMPT(full)
[ 278.110103] watchdog: CPU 0 TB:33050716089564185, last SMP heartbeat TB:33050716089563885 (0ms ago)
[ 278.110109] Tainted: [E]=UNSIGNED_MODULE
[ 278.110126] Hardware name: IBM,8375-42A POWER9 (architected) 0x4e0202 0xf000005 of:IBM,FW940.00 (VL940_027) hv:phyp pSeries
[ 278.110136] NIP: c0000000001bd518 LR: c0000000014dedf8 CTR: 0000000000000000
[ 278.110145] REGS: c000000004b17a80 TRAP: 0900 Tainted: G E (7.4.0-rc1)
[ 278.110155] MSR: 800000000280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE> CR: 22000224 XER: 20040004
[ 278.110189] CFAR: 0000000000000000 IRQMASK: 0
GPR00: 0000000000000000 c000000004b17d20 c000000001c38100 0000000000000000
GPR04: 000000000000ffff 0000000000000000 0000000000000000 0000000000000000
GPR08: 0000000000000000 0000000000000080 0000000000000080 ffffffffffffffff
GPR12: 0000000000000000 c000000017fff300 0000000000000000 000000002ef3d820
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000001
GPR24: 0000000000000001 00000040c0a6075e 0000000000000000 0000000000000001
GPR28: c0000001fdb5b140 0000000000000001 c000000002291968 c000000002291970
[ 278.110306] NIP [c0000000001bd518] plpar_hcall_norets_notrace+0x18/0x2c
[ 278.110319] LR [c0000000014dedf8] check_and_cede_processor+0x48/0x60
[ 278.110333] Call Trace:
[ 278.110338] [c000000004b17d20] [c000000004b17dd0] 0xc000000004b17dd0 (unreliable)
[ 278.110354] [c000000004b17d80] [c0000000014df020] shared_cede_loop+0x70/0x170
[ 278.110367] [c000000004b17dc0] [c0000000014de460] cpuidle_enter_state+0x2f0/0x748
[ 278.110381] [c000000004b17e70] [c000000000fe43b8] cpuidle_enter+0x48/0x70
[ 278.110397] [c000000004b17eb0] [c0000000002cdcf8] call_cpuidle+0x48/0x90
[ 278.110409] [c000000004b17ed0] [c0000000002d6300] cpuidle_idle_call+0x160/0x2d0
[ 278.110422] [c000000004b17f20] [c0000000002d6578] do_idle+0x108/0x1f0
[ 278.110434] [c000000004b17f60] [c0000000002d6938] cpu_startup_entry+0x48/0x50
[ 278.110446] [c000000004b17f90] [c0000000000615c0] start_secondary+0x290/0x2a0
[ 278.110459] [c000000004b17fe0] [c00000000000e258] start_secondary_prolog+0x10/0x14
Fixes: 2104180a5369 ("powerpc/64s: implement arch-specific hardlockup watchdog")
Cc: stable@vger.kernel.org
Signed-off-by: Luiz Capitulino (Red Hat) <luiz.capitulino@linux.dev>
Reviewed-by: Michael Ellerman <mpe@kernel.org>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20261104034018.2676750-1-luiz.capitulino@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/kernel/watchdog.c | 3 +++
1 file changed, 3 insertions(+)
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -482,6 +482,9 @@ static void start_watchdog(void *arg)
if (!(watchdog_enabled & WATCHDOG_HARDLOCKUP_ENABLED))
return;
+ if (!watchdog_thresh)
+ return;
+
if (!cpumask_test_cpu(cpu, &watchdog_cpumask))
return;
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 807/816] 9p: fix memory leak in v9fs_init_fs_context error path
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (805 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 806/816] powerpc/watchdog: disable watchdog when watchdog_thresh=0 Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 808/816] 9p: fix access mode flags being ORed instead of replaced Greg Kroah-Hartman
` (13 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Dominique Martinet
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sashal@kernel.org>
commit 0fd76f1be20d19ac593138ceec502cb044c909bd upstream.
Move the assignments of fc->ops and fc->fs_private to right after the
kzalloc, before any fallible operations. Previously these were assigned
at the end of the function, after the kstrdup calls for uname and aname.
If either kstrdup failed, the error path would set fc->need_free but
leave fc->ops NULL, so put_fs_context() would never call v9fs_free_fc()
to free the allocated context and any already-duplicated strings.
Fixes: 1f3e4142c0eb ("9p: convert to the new mount API")
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Sasha Levin <sashal@kernel.org>
Message-ID: <20260225135745.351984-1-sashal@kernel.org>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/9p/vfs_super.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -310,6 +310,9 @@ static int v9fs_init_fs_context(struct f
if (!ctx)
return -ENOMEM;
+ fc->ops = &v9fs_context_ops;
+ fc->fs_private = ctx;
+
/* initialize core options */
ctx->session_opts.afid = ~0;
ctx->session_opts.cache = CACHE_NONE;
@@ -343,9 +346,6 @@ static int v9fs_init_fs_context(struct f
ctx->rdma_opts.timeout = P9_RDMA_TIMEOUT;
ctx->rdma_opts.privport = false;
- fc->ops = &v9fs_context_ops;
- fc->fs_private = ctx;
-
return 0;
error:
fc->need_free = 1;
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 808/816] 9p: fix access mode flags being ORed instead of replaced
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (806 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 807/816] 9p: fix memory leak in v9fs_init_fs_context error path Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 809/816] 9p: fix privport option setting wrong RDMA field Greg Kroah-Hartman
` (12 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pierre Barre, Christian Schoenebeck,
Dominique Martinet
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pierre Barre <pierre@barre.sh>
commit da2346a48a5a1fed86c3fe3d73c0b60e7b3027c9 upstream.
Since commit 1f3e4142c0eb ("9p: convert to the new mount API"),
v9fs_apply_options() applies parsed mount flags with |= onto flags
already set by v9fs_session_init(). For 9P2000.L, session_init sets
V9FS_ACCESS_CLIENT as the default, so when the user mounts with
"access=user", both bits end up set. Access mode checks compare
against exact values, so having both bits set matches neither mode.
This causes v9fs_fid_lookup() to fall through to the default switch
case, using INVALID_UID (nobody/65534) instead of current_fsuid()
for all fid lookups. Root is then unable to chown or perform other
privileged operations.
Fix by clearing the access mask before applying the user's choice.
Fixes: 1f3e4142c0eb ("9p: convert to the new mount API")
Signed-off-by: Pierre Barre <pierre@barre.sh>
Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com>
Message-ID: <0ddc72da-d196-4f01-8755-0086f670e779@app.fastmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/9p/v9fs.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -394,7 +394,11 @@ static void v9fs_apply_options(struct v9
/*
* Note that we must |= flags here as session_init already
* set basic flags. This adds in flags from parsed options.
+ * Default access flags must be cleared if session options
+ * changes them to avoid mangling the setting.
*/
+ if (ctx->session_opts.flags & V9FS_ACCESS_MASK)
+ v9ses->flags &= ~V9FS_ACCESS_MASK;
v9ses->flags |= ctx->session_opts.flags;
#ifdef CONFIG_9P_FSCACHE
v9ses->cachetag = ctx->session_opts.cachetag;
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 809/816] 9p: fix privport option setting wrong RDMA field
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (807 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 808/816] 9p: fix access mode flags being ORed instead of replaced Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 810/816] tcp: Set unhashed_state in inet_twsk_hashdance_schedule() Greg Kroah-Hartman
` (11 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sandeen, Stefano Garzarella,
Dominique Martinet
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Garzarella <sgarzare@redhat.com>
commit 7fb9bd3659051ff74a29387de0023bb8300e4aa7 upstream.
While reviewing a patch adding vsock transport to 9p, I noticed that
since commit 1f3e4142c0eb ("9p: convert to the new mount API"), the
Opt_privport case incorrectly sets rdma_opts->port instead of
rdma_opts->privport, so mounting with the privport option overwrites
the RDMA port number instead of enabling privileged port usage.
Fixes: 1f3e4142c0eb ("9p: convert to the new mount API")
Cc: stable@vger.kernel.org
Cc: sandeen@redhat.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Eric Sandeen <sandeen@redhat.com>
Message-ID: <20260703102254.114446-1-sgarzare@redhat.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/9p/v9fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -370,7 +370,7 @@ int v9fs_parse_param(struct fs_context *
break;
case Opt_privport:
fd_opts->privport = true;
- rdma_opts->port = true;
+ rdma_opts->privport = true;
break;
}
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 810/816] tcp: Set unhashed_state in inet_twsk_hashdance_schedule().
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (808 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 809/816] 9p: fix privport option setting wrong RDMA field Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 811/816] radix-tree: add missing cleanup.h Greg Kroah-Hartman
` (10 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Zahka, Kuniyuki Iwashima,
Matthieu Baerts (NGI0), Jakub Kicinski
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuniyuki Iwashima <kuniyu@google.com>
commit 404381b4f1053a271a85679cc76a543b10ae043e upstream.
inet_unhash() sets inet_csk(sk)->unhashed_state only when the
socket is hashed because tcp_set_state(sk, TCP_CLOSE) could be
called multiple times, e.g. tcp_abort() calls it directly and
tcp_done_with_error().
However, inet_twsk_hashdance_schedule() also unhashes a socket
when replacing it with twsk, allowing the socket to bypass
checks for inet_csk(sk)->unhashed_state.
Let's update inet_csk(sk)->unhashed_state there as well.
Fixes: 8cc3aef0cb19 ("tcp: Do not allow buggy transitions between ehash and lhash2.")
Reported-by: Daniel Zahka <daniel.zahka@gmail.com>
Closes: https://lore.kernel.org/netdev/DLHLRA8GVI5B.2Q1IRQG5BVJNZ@gmail.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260917191554.1600494-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/inet_timewait_sock.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -103,10 +103,12 @@ void inet_twsk_hashdance_schedule(struct
struct inet_hashinfo *hashinfo,
int timeo)
{
- const struct inet_sock *inet = inet_sk(sk);
- const struct inet_connection_sock *icsk = inet_csk(sk);
spinlock_t *lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
+ struct inet_connection_sock *icsk = inet_csk(sk);
struct inet_bind_hashbucket *bhead, *bhead2;
+ const struct inet_sock *inet = inet_sk(sk);
+
+ icsk->unhashed_state = sk->sk_state;
/* Put TW into bind hash. Original socket stays there too.
* Note, that any socket with inet->num != 0 MUST be bound in
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 811/816] radix-tree: add missing cleanup.h
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (809 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 810/816] tcp: Set unhashed_state in inet_twsk_hashdance_schedule() Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 812/816] net: stmmac: Apply new page pool parameters when SPH is enabled Greg Kroah-Hartman
` (9 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Gomez, Ingo Molnar,
Liam Howlett, Luis Chamberalin, Matthew Wilcox (Oracle),
Ravi Bangoria, Peter Zijlstra, Sidhartha Kumar, Andrew Morton
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Gomez <da.gomez@samsung.com>
commit be8254f694469e60252e35c467ac9a878d7797bf upstream.
Add shared cleanup.h header for radix-tree testing tools.
Fixes build error found with kdevops [1]:
cc -I../shared -I. -I../../include -I../../../lib -g -Og -Wall
-D_LGPL_SOURCE -fsanitize=address -fsanitize=undefined -c -o
radix-tree.o radix-tree.c
In file included from ../shared/linux/idr.h:1,
from radix-tree.c:18:
../shared/linux/../../../../include/linux/idr.h:18:10: fatal error:
linux/cleanup.h: No such file or directory
18 | #include <linux/cleanup.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: radix-tree.o] Error 1
[1] https://github.com/linux-kdevops/kdevops
https://github.com/linux-kdevops/linux-mm-kpd/
actions/runs/13971648496/job/39114756401
[akpm@linux-foundation.org: remove unneeded header guards, per Sidhartha]
Link: https://lkml.kernel.org/r/20250321-fix-radix-tree-build-v1-1-838a1e6540e2@samsung.com
Fixes: 6c8b0b835f00 ("perf/core: Simplify perf_pmu_register()")
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Cc: Daniel Gomez <da.gomez@samsung.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Luis Chamberalin <mcgrof@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/shared/linux/cleanup.h | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 tools/testing/shared/linux/cleanup.h
--- /dev/null
+++ b/tools/testing/shared/linux/cleanup.h
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include "../../../../include/linux/cleanup.h"
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 812/816] net: stmmac: Apply new page pool parameters when SPH is enabled
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (810 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 811/816] radix-tree: add missing cleanup.h Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 813/816] net: stmmac: restore NET_IP_ALIGN in the RX DMA offset Greg Kroah-Hartman
` (8 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jon Hunter, Brad Griffis,
Ido Schimmel, Furong Xu, Thierry Reding, Ido Schimmel,
Jakub Kicinski
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Furong Xu <0x1207@gmail.com>
commit cb6cc8ed77177c7553c2f8ac8605d32de58f43ac upstream.
Commit df542f669307 ("net: stmmac: Switch to zero-copy in
non-XDP RX path") makes DMA write received frame into buffer at offset
of NET_SKB_PAD and sets page pool parameters to sync from offset of
NET_SKB_PAD. But when Header Payload Split is enabled, the header is
written at offset of NET_SKB_PAD, while the payload is written at
offset of zero. Uncorrect offset parameter for the payload breaks dma
coherence [1] since both CPU and DMA touch the page buffer from offset
of zero which is not handled by the page pool sync parameter.
And in case the DMA cannot split the received frame, for example,
a large L2 frame, pp_params.max_len should grow to match the tail
of entire frame.
[1] https://lore.kernel.org/netdev/d465f277-bac7-439f-be1d-9a47dfe2d951@nvidia.com/
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Reported-by: Brad Griffis <bgriffis@nvidia.com>
Suggested-by: Ido Schimmel <idosch@idosch.org>
Fixes: df542f669307 ("net: stmmac: Switch to zero-copy in non-XDP RX path")
Signed-off-by: Furong Xu <0x1207@gmail.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20250207085639.13580-1-0x1207@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2051,6 +2051,11 @@ static int __alloc_dma_rx_desc_resources
pp_params.offset = stmmac_rx_offset(priv);
pp_params.max_len = STMMAC_MAX_RX_BUF_SIZE(num_pages);
+ if (priv->sph) {
+ pp_params.offset = 0;
+ pp_params.max_len += stmmac_rx_offset(priv);
+ }
+
rx_q->page_pool = page_pool_create(&pp_params);
if (IS_ERR(rx_q->page_pool)) {
ret = PTR_ERR(rx_q->page_pool);
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 813/816] net: stmmac: restore NET_IP_ALIGN in the RX DMA offset
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (811 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 812/816] net: stmmac: Apply new page pool parameters when SPH is enabled Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 814/816] net: stmmac: clear stale buf->page after recycling on skb build failure Greg Kroah-Hartman
` (7 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Baldin, Pascal Kneuper,
Jakub Kicinski
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pascal Kneuper <PKneuper@dspace.de>
commit 23680bf5f8c69c923546b84a8e6c401bef8b88fe upstream.
Since the RX path was converted to zero-copy, the page pool page is handed
to the stack directly as the skb head, and the offset the DMA engine writes
at is what determines the alignment of the packet headers.
Before the conversion the payload was copied into an skb obtained from
napi_alloc_skb(), which reserves NET_SKB_PAD + NET_IP_ALIGN. The
conversion moved the headroom into stmmac_rx_offset() but did not carry
over NET_IP_ALIGN, so on architectures where NET_IP_ALIGN is 2 the IP
header now lands misaligned:
64 (NET_SKB_PAD) + 14 (ethernet) + 20 (IP) = 98
Same for the XDP branch:
256 (XDP_PACKET_HEADROOM) + 14 (ethernet) + 20 (IP) = 290
On ARM32 this is fatal, because ldm and ldrd trap on unaligned addresses
even when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
Any received echo request panics the machine, e.g:
Unhandled fault: alignment exception (0x001) at 0x81873062
Internal error: : 1 [#1] SMP ARM
Hardware name: Altera SOCFPGA Arria10
PC is at icmp_echo+0x38/0xa8
LR is at icmp_rcv+0x22c/0x370
Call trace:
icmp_echo from icmp_rcv+0x22c/0x370
icmp_rcv from ip_protocol_deliver_rcu+0x2c/0x224
ip_protocol_deliver_rcu from ip_local_deliver+0xc8/0x1a0
ip_local_deliver from ip_sublist_rcv_finish+0x3c/0x50
ip_sublist_rcv_finish from ip_list_rcv_finish+0x110/0x118
ip_list_rcv_finish from ip_list_rcv+0xc8/0xdc
ip_list_rcv from __netif_receive_skb_list_core+0x170/0x1c0
...
napi_complete_done from stmmac_napi_poll_rx+0xcb0/0x1030
Code: e24dd068 e59020a0 e28dc010 e0822001 (e8920003)
Kernel panic - not syncing: Fatal exception in interrupt
The faulting instruction is the ldm of *icmp_hdr(skb) in icmp_echo().
Fix by adding NET_IP_ALIGN back to the RX offset, which restores the
alignment the stack used to get.
Note that commit a955318fe67e ("stmmac: align RX buffers") made a similar
change in 2021 and was reverted by commit 12d125b4574b ("stmmac: Revert
"stmmac: align RX buffers"") because it caused packet corruption. That
patch raised the offset from 0 without adjusting the buffer size
accounting, so the DMA engine could arguably write past the end of the RX
buffers, though this was never root caused.
Commit df542f669307 ("net: stmmac: Switch to zero-copy in non-XDP RX
path") since derives the page pool allocation from stmmac_rx_offset(), so
the extra bytes are accounted for.
Fixes: df542f669307 ("net: stmmac: Switch to zero-copy in non-XDP RX path")
Cc: Daniel Baldin <DBaldin@dspace.de>
Signed-off-by: Pascal Kneuper <PKneuper@dspace.de>
Link: https://patch.msgid.link/20260824125014.47862-1-PKneuper@dspace.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1327,9 +1327,9 @@ static void stmmac_display_rings(struct
static unsigned int stmmac_rx_offset(struct stmmac_priv *priv)
{
if (stmmac_xdp_is_enabled(priv))
- return XDP_PACKET_HEADROOM;
+ return XDP_PACKET_HEADROOM + NET_IP_ALIGN;
- return NET_SKB_PAD;
+ return NET_SKB_PAD + NET_IP_ALIGN;
}
static int stmmac_set_bfsize(int mtu, int bufsize)
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 814/816] net: stmmac: clear stale buf->page after recycling on skb build failure
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (812 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 813/816] net: stmmac: restore NET_IP_ALIGN in the RX DMA offset Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 815/816] power: sequencing: qcom-wcn: fix bluetooth-wifi copypasta for WCN6855 Greg Kroah-Hartman
` (6 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Maxime Chevallier,
Jakub Kicinski
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
commit 0a7822e34a0bfde31b194ac3da3253e5032b44cc upstream.
In stmmac_rx(), when napi_build_skb() fails the descriptor page is
recycled back to the page pool with page_pool_recycle_direct(), but
buf->page is left pointing at the recycled page, unlike every other
consumption site in the function which clears the pointer after handing
the page away.
With the stale pointer stmmac_rx_refill() skips the replacement
allocation and programs the already-recycled page back into the RX
descriptor.
Clear buf->page on the napi_build_skb() failure path to keep the buffer
lifecycle consistent with the other consumption sites.
Fixes: df542f669307 ("net: stmmac: Switch to zero-copy in non-XDP RX path")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20260921-stmmac-fix-napi-build-skb-error-v1-1-3d54bf6d9bb6@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5710,6 +5710,7 @@ read_again:
if (!skb) {
page_pool_recycle_direct(rx_q->page_pool,
buf->page);
+ buf->page = NULL;
rx_dropped++;
count++;
goto drain_data;
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 815/816] power: sequencing: qcom-wcn: fix bluetooth-wifi copypasta for WCN6855
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (813 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 814/816] net: stmmac: clear stale buf->page after recycling on skb build failure Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 816/816] cpufreq: Preserve global boost state on failed updates Greg Kroah-Hartman
` (5 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bartosz Golaszewski
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
commit 07d59dec6795428983a840de85aa02febaf7e01b upstream.
Prevent a name conflict (which is surprisingly not caught by the
framework).
Fixes: bd4c8bafcf50 ("power: sequencing: qcom-wcn: improve support for wcn6855")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250625-topic-wcn6855_pwrseq-v1-1-cfb96d599ff8@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/power/sequencing/pwrseq-qcom-wcn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
+++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
@@ -155,7 +155,7 @@ static const struct pwrseq_unit_data pwr
};
static const struct pwrseq_unit_data pwrseq_qcom_wcn6855_bt_unit_data = {
- .name = "wlan-enable",
+ .name = "bluetooth-enable",
.deps = pwrseq_qcom_wcn6855_unit_deps,
.enable = pwrseq_qcom_wcn_bt_enable,
.disable = pwrseq_qcom_wcn_bt_disable,
^ permalink raw reply [flat|nested] 825+ messages in thread
* [PATCH 6.12 816/816] cpufreq: Preserve global boost state on failed updates
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (814 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 815/816] power: sequencing: qcom-wcn: fix bluetooth-wifi copypasta for WCN6855 Greg Kroah-Hartman
@ 2026-11-25 14:39 ` Greg Kroah-Hartman
2026-11-25 15:38 ` [PATCH 6.12 000/816] 6.12.120-rc1 review SJ Park
` (4 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Loehle, Pengjie Zhang,
Zhongqiu Han, Sumit Gupta, Rafael J. Wysocki
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Loehle <christian.loehle@arm.com>
commit a0cde2b601bc32b76d61e50141c619790e5e2e41 upstream.
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/cpufreq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2825,6 +2825,7 @@ static int cpufreq_boost_trigger_state(i
{
struct cpufreq_policy *policy;
unsigned long flags;
+ bool boost_enabled;
int ret = 0;
guard(mutex)(&cpufreq_boost_mutex);
@@ -2835,6 +2836,7 @@ static int cpufreq_boost_trigger_state(i
*/
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);
@@ -2855,7 +2857,7 @@ err_reset_state:
cpus_read_unlock();
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",
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (815 preceding siblings ...)
2026-11-25 14:39 ` [PATCH 6.12 816/816] cpufreq: Preserve global boost state on failed updates Greg Kroah-Hartman
@ 2026-11-25 15:38 ` SJ Park
2026-11-25 16:27 ` Brett A C Sheffield
` (3 subsequent siblings)
820 siblings, 0 replies; 825+ messages in thread
From: SJ Park @ 2026-11-25 15:38 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: SJ Park, stable, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On Wed, 25 Nov 2026 15:25:48 +0100 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> This is the start of the stable review cycle for the 6.12.120 release.
> There are 816 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
This rc kernel passes DAMON functionality test [1] on my test machine.
Tested-by: SJ Park <sj@kernel.org>
[1] https://github.com/damonitor/damon-tests/tree/next/corr
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (816 preceding siblings ...)
2026-11-25 15:38 ` [PATCH 6.12 000/816] 6.12.120-rc1 review SJ Park
@ 2026-11-25 16:27 ` Brett A C Sheffield
2026-11-25 17:10 ` Greg Kroah-Hartman
2026-11-26 3:58 ` Florian Fainelli
` (2 subsequent siblings)
820 siblings, 1 reply; 825+ messages in thread
From: Brett A C Sheffield @ 2026-11-25 16:27 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On 2026-11-25 15:25, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.12.120 release.
> There are 816 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:37:39 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.120-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
> and the diffstat can be found below.
Build failure:
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp2_transition.o
LD [M] drivers/gpu/drm/amd/amdgpu/amdgpu.o
AR drivers/gpu/built-in.a
AR drivers/built-in.a
make[1]: *** [/usr/src/linux-stable-rc/Makefile:1983: .] Error 2
make: *** [Makefile:224: __sub-make] Error 2
git bisect start
# status: waiting for both 'good' and 'bad' commits
# bad: [12adde2bfaf9a517ca40d6d1a0dee8e7461e1b12] Linux 6.12.120-rc1
git bisect bad 12adde2bfaf9a517ca40d6d1a0dee8e7461e1b12
# status: waiting for 'good' commit(s), 'bad' commit known
# good: [e2e4b92c2b2a3ae78423cb343951cb5d2241b405] Linux 6.12.119
git bisect good e2e4b92c2b2a3ae78423cb343951cb5d2241b405
# bad: [52a4dd0e4090336750d7633e728a4aa42d0d56e8] kernfs: don't repeat or skip an entry when readdir resumes
git bisect bad 52a4dd0e4090336750d7633e728a4aa42d0d56e8
# good: [bb01e9f4bd4703b2b05927f1a8cc215bd062a261] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove
git bisect good bb01e9f4bd4703b2b05927f1a8cc215bd062a261
# good: [5e38510338ab7ce5d451631862d45b8ff97ae041] net: skbuff: preserve fclone lifetime when freeing stolen heads
git bisect good 5e38510338ab7ce5d451631862d45b8ff97ae041
# bad: [2239cb19c911f0316e268db5a75ce69b76b1328d] nsh: limit recursion in nsh_gso_segment()
git bisect bad 2239cb19c911f0316e268db5a75ce69b76b1328d
# bad: [472d4d383716f30f1ed2eec0bb6512da609d65ce] net: skbuff: uncharge trimmed zerocopy frags on error
git bisect bad 472d4d383716f30f1ed2eec0bb6512da609d65ce
# good: [b323d0e29567e95878634c8898809a8089393f4d] wifi: mac80211: abort chanswitch when leaving an IBSS
git bisect good b323d0e29567e95878634c8898809a8089393f4d
# bad: [ffc6e3dead37191ec021e0a2d007aade720b3d79] tun: delete the flow entries of the moved queue on detach
git bisect bad ffc6e3dead37191ec021e0a2d007aade720b3d79
# good: [3955f4ee7ea716979a6fbbc9c5277eaf39c8e47f] ovl: release the upperdir/workdir in-use locks before the umount sync
git bisect good 3955f4ee7ea716979a6fbbc9c5277eaf39c8e47f
# bad: [0ee590851a624d95ef6656095a525fe098b0cc4b] NFSv4: wake blocking lock waiters when a delegated lock is released
git bisect bad 0ee590851a624d95ef6656095a525fe098b0cc4b
# good: [afca23314ec37510180f7d47a29d45d28e5418ec] bonding: fix slave_cnt leak on XDP enslave failure
git bisect good afca23314ec37510180f7d47a29d45d28e5418ec
# first 'bad' commit: [0ee590851a624d95ef6656095a525fe098b0cc4b] NFSv4: wake blocking lock waiters when a delegated lock is released
Reverting 0ee590851a624d95ef6656095a525fe098b0cc4b fixes the build.
--
Brett Sheffield (he/him)
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 16:27 ` Brett A C Sheffield
@ 2026-11-25 17:10 ` Greg Kroah-Hartman
2026-11-25 17:26 ` Brett A C Sheffield
0 siblings, 1 reply; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-25 17:10 UTC (permalink / raw)
To: Brett A C Sheffield
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On Wed, Nov 25, 2026 at 05:27:44PM +0100, Brett A C Sheffield wrote:
> On 2026-11-25 15:25, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 6.12.120 release.
> > There are 816 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:37:39 +0000.
> > Anything received after that time might be too late.
> >
> > The whole patch series can be found in one patch at:
> > https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.120-rc1.gz
> > or in the git tree and branch at:
> > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
> > and the diffstat can be found below.
>
> Build failure:
>
> CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp2_transition.o
> LD [M] drivers/gpu/drm/amd/amdgpu/amdgpu.o
> AR drivers/gpu/built-in.a
> AR drivers/built-in.a
> make[1]: *** [/usr/src/linux-stable-rc/Makefile:1983: .] Error 2
> make: *** [Makefile:224: __sub-make] Error 2
That doesn't show the actual build error :(
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 17:10 ` Greg Kroah-Hartman
@ 2026-11-25 17:26 ` Brett A C Sheffield
2026-11-26 10:32 ` Greg Kroah-Hartman
0 siblings, 1 reply; 825+ messages in thread
From: Brett A C Sheffield @ 2026-11-25 17:26 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On 2026-11-25 18:10, Greg Kroah-Hartman wrote:
> On Wed, Nov 25, 2026 at 05:27:44PM +0100, Brett A C Sheffield wrote:
> > On 2026-11-25 15:25, Greg Kroah-Hartman wrote:
> > > This is the start of the stable review cycle for the 6.12.120 release.
> > > There are 816 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:37:39 +0000.
> > > Anything received after that time might be too late.
> > >
> > > The whole patch series can be found in one patch at:
> > > https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.120-rc1.gz
> > > or in the git tree and branch at:
> > > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
> > > and the diffstat can be found below.
> >
> > Build failure:
> >
> > CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp2_transition.o
> > LD [M] drivers/gpu/drm/amd/amdgpu/amdgpu.o
> > AR drivers/gpu/built-in.a
> > AR drivers/built-in.a
> > make[1]: *** [/usr/src/linux-stable-rc/Makefile:1983: .] Error 2
> > make: *** [Makefile:224: __sub-make] Error 2
>
> That doesn't show the actual build error :(
Apologies. Here tis:
CC [M] drivers/gpu/drm/radeon/radeon_encoders.o
CC fs/ext4/acl.o
fs/nfs/nfs4proc.c: In function ‘nfs4_proc_unlck’:
fs/nfs/nfs4proc.c:7281:24: error: variable ‘cbnl’ has initializer but incomplete type
7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
| ^~~~~~~~~~~~~~~~~~~
fs/nfs/nfs4proc.c:7281:54: error: ‘struct cb_notify_lock_args’ has no member named ‘cbnl_valid’
7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
| ^~~~~~~~~~
fs/nfs/nfs4proc.c:7281:67: warning: excess elements in struct initializer
7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
| ^~~~~
fs/nfs/nfs4proc.c:7281:67: note: (near initialization for ‘cbnl’)
fs/nfs/nfs4proc.c:7281:44: error: storage size of ‘cbnl’ isn’t known
7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
| ^~~~
fs/nfs/nfs4proc.c:7285:33: error: ‘struct nfs_client’ has no member named ‘cl_lock_waitq’; did you mean ‘cl_rpcwaitq’?
7285 | __wake_up(&clp->cl_lock_waitq, TASK_NORMAL, 0, &cbnl);
| ^~~~~~~~~~~~~
| cl_rpcwaitq
fs/nfs/nfs4proc.c:7281:44: warning: unused variable ‘cbnl’ [-Wunused-variable]
7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
| ^~~~
--
Brett Sheffield (he/him)
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (817 preceding siblings ...)
2026-11-25 16:27 ` Brett A C Sheffield
@ 2026-11-26 3:58 ` Florian Fainelli
2026-11-26 8:12 ` Peter Schneider
2026-11-26 9:55 ` Pavel Machek
820 siblings, 0 replies; 825+ messages in thread
From: Florian Fainelli @ 2026-11-26 3:58 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, sudipm.mukherjee, rwarsow, conor,
hargar, broonie, achill, sr
On 11/25/2026 6:25 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.12.120 release.
> There are 816 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:37:39 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.120-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on
BMIPS_GENERIC:
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (818 preceding siblings ...)
2026-11-26 3:58 ` Florian Fainelli
@ 2026-11-26 8:12 ` Peter Schneider
2026-11-26 9:55 ` Pavel Machek
820 siblings, 0 replies; 825+ messages in thread
From: Peter Schneider @ 2026-11-26 8:12 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
Am 25.11.2026 um 15:25 schrieb Greg Kroah-Hartman:
> This is the start of the stable review cycle for the 6.12.120 release.
> There are 816 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.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697v2 server. No dmesg oddities or regressions found.
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Beste Grüße,
Peter Schneider
--
Climb the mountain not to plant your flag, but to embrace the challenge,
enjoy the air and behold the view. Climb it so you can see the world,
not so the world can see you. -- David McCullough Jr.
OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244
Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@googlemail.com
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@gmail.com
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
` (819 preceding siblings ...)
2026-11-26 8:12 ` Peter Schneider
@ 2026-11-26 9:55 ` Pavel Machek
820 siblings, 0 replies; 825+ messages in thread
From: Pavel Machek @ 2026-11-26 9:55 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
[-- Attachment #1: Type: text/plain, Size: 793 bytes --]
Hi!
> This is the start of the stable review cycle for the 6.12.120 release.
> There are 816 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.
We see build failures here.
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/3114400164
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/jobs/18365213109
fs/nfs/nfs4proc.c: In function 'nfs4_proc_unlck':
3301
15:36:38
fs/nfs/nfs4proc.c:7281:24: error: variable 'cbnl' has initializer but incomplete type
3302
15:36:38
7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
3303
15:36:38
| ^~~~~~~~~~~~~~~~~~~
3304
15:36:38
Best regards,
Pavel
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 825+ messages in thread
* Re: [PATCH 6.12 000/816] 6.12.120-rc1 review
2026-11-25 17:26 ` Brett A C Sheffield
@ 2026-11-26 10:32 ` Greg Kroah-Hartman
0 siblings, 0 replies; 825+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-26 10:32 UTC (permalink / raw)
To: Brett A C Sheffield
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On Wed, Nov 25, 2026 at 06:26:23PM +0100, Brett A C Sheffield wrote:
> On 2026-11-25 18:10, Greg Kroah-Hartman wrote:
> > On Wed, Nov 25, 2026 at 05:27:44PM +0100, Brett A C Sheffield wrote:
> > > On 2026-11-25 15:25, Greg Kroah-Hartman wrote:
> > > > This is the start of the stable review cycle for the 6.12.120 release.
> > > > There are 816 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:37:39 +0000.
> > > > Anything received after that time might be too late.
> > > >
> > > > The whole patch series can be found in one patch at:
> > > > https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.120-rc1.gz
> > > > or in the git tree and branch at:
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
> > > > and the diffstat can be found below.
> > >
> > > Build failure:
> > >
> > > CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp2_transition.o
> > > LD [M] drivers/gpu/drm/amd/amdgpu/amdgpu.o
> > > AR drivers/gpu/built-in.a
> > > AR drivers/built-in.a
> > > make[1]: *** [/usr/src/linux-stable-rc/Makefile:1983: .] Error 2
> > > make: *** [Makefile:224: __sub-make] Error 2
> >
> > That doesn't show the actual build error :(
>
> Apologies. Here tis:
>
> CC [M] drivers/gpu/drm/radeon/radeon_encoders.o
> CC fs/ext4/acl.o
> fs/nfs/nfs4proc.c: In function ‘nfs4_proc_unlck’:
> fs/nfs/nfs4proc.c:7281:24: error: variable ‘cbnl’ has initializer but incomplete type
> 7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
> | ^~~~~~~~~~~~~~~~~~~
> fs/nfs/nfs4proc.c:7281:54: error: ‘struct cb_notify_lock_args’ has no member named ‘cbnl_valid’
> 7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
> | ^~~~~~~~~~
> fs/nfs/nfs4proc.c:7281:67: warning: excess elements in struct initializer
> 7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
> | ^~~~~
> fs/nfs/nfs4proc.c:7281:67: note: (near initialization for ‘cbnl’)
> fs/nfs/nfs4proc.c:7281:44: error: storage size of ‘cbnl’ isn’t known
> 7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
> | ^~~~
> fs/nfs/nfs4proc.c:7285:33: error: ‘struct nfs_client’ has no member named ‘cl_lock_waitq’; did you mean ‘cl_rpcwaitq’?
> 7285 | __wake_up(&clp->cl_lock_waitq, TASK_NORMAL, 0, &cbnl);
> | ^~~~~~~~~~~~~
> | cl_rpcwaitq
> fs/nfs/nfs4proc.c:7281:44: warning: unused variable ‘cbnl’ [-Wunused-variable]
> 7281 | struct cb_notify_lock_args cbnl = { .cbnl_valid = false };
> | ^~~~
>
Odd I didn't see that breakage. I'll go fix it up now, thanks!
greg k-h
^ permalink raw reply [flat|nested] 825+ messages in thread
end of thread, other threads:[~2026-11-26 10:32 UTC | newest]
Thread overview: 825+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 14:25 [PATCH 6.12 000/816] 6.12.120-rc1 review Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 001/816] netfilter: nft_ct: expectation timeouts are passed in milliseconds Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 002/816] netfilter: nft_ct: move custom expectation support to helper Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 003/816] mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 004/816] drm/amdgpu: Check cs flags Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 005/816] irqchip/sifive-plic: Avoid signed shift in interrupt enable mask Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 006/816] mm: page_alloc: remove ALLOC_NON_BLOCK from ALLOC_RESERVES Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 007/816] bpf: Fix memory access flags in helper prototypes Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 008/816] bpf: Fix verifier assumptions of bpf_d_paths output buffer Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 009/816] bpf: Specify access type of bpf_sysctl_get_name args Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 010/816] writeback: use a per-sb counter to drain inode wb switches at umount Greg Kroah-Hartman
2026-11-25 14:25 ` [PATCH 6.12 011/816] ACPI: PM: Add quirk for Acer Swift 3 SF314-56G (MX250) Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 012/816] ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 013/816] ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 014/816] fs: aio: reject partial mremap to avoid Null-pointer-dereference error Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 015/816] bpf: Reject NULL data/sig in bpf_verify_pkcs7_signature Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 016/816] sched/deadline: Fix dl_server time accounting Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 017/816] sched/deadline: Fix dl_server stop condition Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 018/816] sched: Provide idle_rq() helper Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 019/816] sched/deadline: Fix server stopping with runnable tasks Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 020/816] xfs: only assert new size for datafork during truncate extents Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 021/816] Revert "drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts" Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 022/816] netrom: send the unacknowledged frames again when T1 or T4 expires Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 023/816] ax25: drop a message being reassembled when a new one starts Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 024/816] rose: reset a call when a DATA packet arrives out of sequence Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 025/816] ax25: end a REJ recovery count once frames are acknowledged Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 026/816] netrom: keep T1 running after answering a NAK Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 027/816] netrom: give the sysctl timer limits in milliseconds Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 028/816] mm/ksm: fix userfaultfd protection during merge and unmerge Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 029/816] udf: validate VAT inode size for old VAT format Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 030/816] udf: validate vat20->lengthHeader and VAT inode size in udf_load_vat() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 031/816] io_uring: enable toggle of iowait usage when waiting on CQEs Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 032/816] io_uring/napi: dont end the single NAPI busy poll early on need_resched() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 033/816] io_uring: fail soft links on negative IOU_COMPLETE results Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 034/816] io_uring/futex: fail soft links when cancelling a wait Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 035/816] io_uring/rw: fail soft links on IOPOLL short or error IO Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 036/816] io_uring/timeout: dont rearm a multishot timeout on cancel Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 037/816] io_uring/rsrc: keep the old file when a file update fails Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 038/816] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 039/816] io_uring/io-wq: apply the current cpuset to new workers Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 040/816] bpqether: reserve the Ethernet devices own header room on transmit Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 041/816] bpqether: set both addresses or none in SIOCSBPQETHADDR Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 042/816] bpqether: keep a bpq device in step with its Ethernet device Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 043/816] Input: destroy force-feedback device on input unregistration Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 044/816] staging: media: atomisp: use array3_size() for overflow-safe allocation Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 045/816] net/9p/fd: support ipv6 for trans=tcp Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 046/816] fs/fs_parse: Delete macro fsparam_u32hex() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 047/816] fs/fs_parse: add back fsparam_u32hex Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 048/816] net/9p: move structures and macros to header files Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 049/816] 9p: create a v9fs_context structure to hold parsed options Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 050/816] 9p: convert to the new mount API Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 051/816] net/9p: Replace strlen() strcpy() pair with strscpy() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 052/816] 9p: use fc->net_ns for network namespace in RDMA and socket transports Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 053/816] net/9p/usbg: fix descriptor cleanup use-after-free Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 054/816] net/9p/usbg: Fix use-after-free on usb9pfs_clear_tx Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 055/816] 9p: skip intermediate directory entry name copy in p9dirent_read() Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 056/816] xfrm: zero-initialise km_event in the replay-notify path Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 057/816] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 058/816] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 059/816] scsi: aic7xxx: Fix REQUEST SENSE allocation length on big-endian hosts Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 060/816] scsi: scsi_debug: Drain target cleanup before module exit Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 061/816] scsi: aha1542: Remove unneeded scsi_dma_unmap() call Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 062/816] 9p: fall back to the normal open path for non-regular files Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 063/816] 9p: do not store the create fid on special files Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 064/816] wifi: ath10k: Stop unanswered temperature reads Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 065/816] seg6: fix transport header for inner IPv4 with IP options Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 066/816] drm/imagination: Align rogue_fwif_hwrtdata to 64 bytes Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 067/816] gpio: omap: Propagate runtime PM failures in probe and request Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 068/816] bpf: Fix jited line info off by the CFI preamble Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 069/816] btrfs: verity: propagate orphan insertion errors when enabling verity Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 070/816] btrfs: fix fiemap merging compressed extents Greg Kroah-Hartman
2026-11-25 14:26 ` [PATCH 6.12 071/816] btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 072/816] btrfs: zoned: fix double free of bitmaps on clone failure Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 073/816] net: ethernet: mtk_wed: skip ring reset in wdma_tx_ring_setup for WED v3 Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 074/816] net: ethernet: mtk_wed: fix reset condition for rx wdma Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 075/816] net: ethernet: mtk_wed: free up rings during detach Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 076/816] net: ethernet: mtk_wed: setup WDMA_RING_TX(0) for non-DBDC MT7986 Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 077/816] ptp: drain virtual clock sysfs operations before unregistering children Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 078/816] ptp: unwind partially completed virtual clock creation Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 079/816] ptp: vclock: propagate physical clock sampling errors Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 080/816] ptp: vclock: serialize extended samples with counter updates Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 081/816] net/smc: fix limit_smc_hs sysctl on big-endian architecture Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 082/816] scsi: target: Validate REGISTER AND MOVE TransportID length Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 083/816] tipc: reject attaching bearer of different media to the same occupied device Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 084/816] net: ipa: Fix double free of the interrupt structure on config error Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 085/816] ALSA: memalloc: Free the new pages when WC DMA mapping fails Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 086/816] netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 087/816] netfilter: nft_fwd_netdev: add device and headroom validate with neigh forwarding Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 088/816] netfilter: nft_fwd_netdev: use recursion counter in neigh egress path Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 089/816] netfilter: nf_dup_netdev: add nf_dev_xmit_recursion*() helpers and use them Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 090/816] netfilter: nft_reject: prevent unbounded recursion in output hooks Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 091/816] spi: pic32-sqi: fail transfer when the BD ring is exhausted Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 092/816] bpf: Avoid changing callchain in bpf_get_stack_pe Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 093/816] bpf: Clamp the trace length in __bpf_get_stack() again Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 094/816] bpf: Avoid changing callchain in bpf_get_stackid_pe Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 095/816] bpf: Clamp the trace length before the skip test in stackid_init() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 096/816] bpf: Refuse to map an arena at address 0 Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 097/816] bpf: Refuse an arena mmap() longer than max_entries pages Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 098/816] bpf: Remove the WARN from arena_get_unmapped_area() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 099/816] bpf: Require prog fd or capability for cgroup detach Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 100/816] bpf, cgroup: Keep the skb network offset signed Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 101/816] bpf: Dont let bpf_skb_adjust_room() raise gso_size to GSO_BY_FRAGS Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 102/816] bpf: Reject non-IPv6 packets in BPF_LWT_ENCAP_SEG6 Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 103/816] bpf: Limit the SRH length in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 104/816] bpf: Dont look for the SRH again in the End.BPF helpers Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 105/816] bpf: Move the MAC header in bpf_lwt_seg6_adjust_srh() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 106/816] bpf: Dont leave a stale MAC header in bpf_lwt_push_ip_encap() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 107/816] ipv4: Convert ip_route_input_noref() to dscp_t Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 108/816] bpf: Reset skb->cb after an lwt prog pushes an IP header Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 109/816] bpf: Require BPF_LWT_REROUTE when an lwt_in prog changes the protocol Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 110/816] bpf: Move the transport header with the moved headers Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 111/816] bpf: Check the offset in bpf_skb_generic_{push,pop}() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 112/816] spi: Fix ACPI SPI resources using relative path Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 113/816] spi: acpi: only look up the IRQ of confirmed SPI devices Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 114/816] bpf: lwt: Free the skb when bpf_xmit() fails to expand the headroom Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 115/816] net/mlx5: macsec: free struct mlx5_fs_id after an RCU grace period Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 116/816] bnxt_en: Dont keep MSI-X vectors added before FW reserves them Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 117/816] ipv6: fix fib6 walker UAF on NLM_F_REPLACE Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 118/816] tcp: do not let tcp_collapse() drive sk_forward_alloc negative Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 119/816] ata: libata-sata: allow re-enabling NCQ with the same queue_depth Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 120/816] ata: libata-eh: Retry non-NCQ commands when their sense data asks for it Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 121/816] net: stmmac: Set dma_sync_size to zero for discarded frames Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 122/816] net: stmmac: drop split frames on AF_XDP zero-copy RX Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 123/816] net: stmmac: copy XDP metadata in " Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 124/816] ata: libata-core: Check device support before querying power state Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 125/816] net: lan966x: dont free XDP buffers in fdma tx clear with budget 0 Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 126/816] drm/panel: visionox-r66451: Send the brightness value MSB first Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 127/816] drm/panel: visionox-r66451: Wait longer after the panel reset Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 128/816] sfc: ptp: drop the stale frequency reset in efx_ptp_start() Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 129/816] sfc: ptp: serialize host and MC synchronization transactions Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 130/816] sfc: ptp: avoid racing PPS timestamp updates Greg Kroah-Hartman
2026-11-25 14:27 ` [PATCH 6.12 131/816] vdpa_sim: serialize IOTLB updates with dataplane access Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 132/816] vdpa: invalidate DMA mappings before releasing memory Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 133/816] vhost-scsi: preserve event ordering Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 134/816] vhost-scsi: do not relock event vq mutex on send_evt fallback Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 135/816] virtio_pci: add missing newline to the pmcsr error message Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 136/816] vdpa: fix double free of the reply skb in vdpa_nl_cmd_dev_config_get_doit() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 137/816] vhost: reject invalid IOTLB update permissions Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 138/816] irqbypass: Take ownership of producer/consumer token tracking Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 139/816] vhost-vdpa: drop the parents vq callback before the call fd is released Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 140/816] virtio-blk: clamp max_segments to virtqueue ring size Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 141/816] virtio_blk: Reset device on probe error paths after DRIVER_OK Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 142/816] regulator: qcom_spmi: dont take a sleeping lock in the SAW IPI Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 143/816] net: sparx5/lan969x: release the in-flight slot of a stale TX skb Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 144/816] gpio: mpc8xxx: use a helper variable to store the address of pdev->dev Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 145/816] gpio: mpc8xxx: Fix potential use-after-free of IRQ domain Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 146/816] net/iucv: take a private, writable frame before rewriting it in place Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 147/816] ASoC: meson: axg-fifo: request the irq with the clock enabled Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 148/816] Bluetooth: hci_core: Initialize IRK before publication Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 149/816] Bluetooth: hci_core: Initialize link key " Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 150/816] Bluetooth: hci_core: Initialize LTK " Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 151/816] Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 152/816] Bluetooth: btintel: fix buffer over-read in fw payload Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 153/816] Bluetooth: hci_event: Clear explicit connect state on LE connection Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 154/816] Bluetooth: btmtk: drop zero-length ISO packets from endpoint padding Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 155/816] Bluetooth: btmtk: bound the ISO payload length by the controllers MTU Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 156/816] Bluetooth: btmtk: derive the firmware ISO setting from MTK_ISO_THRESHOLD Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 157/816] Bluetooth: hci_sync: Copy the LE accept list under hdev->lock Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 158/816] Bluetooth: hci_sync: Protect resolving-list lookups Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 159/816] Bluetooth: mgmt: reply to cancelled mgmt commands instead of silently dropping Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 160/816] Bluetooth: MGMT: Return RFKILLED for Set Powered on a blocked controller Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 161/816] Bluetooth: btmtk: fix error handling in btmtk_usb_isointf_init() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 162/816] Bluetooth: hci_core: Keep link-key filtering inside RCU Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 163/816] Bluetooth: hci_sync: Copy the resolving-list IRK under RCU Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 164/816] Bluetooth: MGMT: Clear disabled connection parameters when loading none Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 165/816] Bluetooth: hci_core: Initialize advertising RPA work only once Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 166/816] Bluetooth: validate retained LE Create CIS command length Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 167/816] Bluetooth: validate retained LE Set CIG Parameters " Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 168/816] Bluetooth: MGMT: Fix discovery stuck after a failed Stop Discovery Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 169/816] mctp i3c: Fix locking in an error path Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 170/816] ksmbd: implement error handling for STATUS_INFO_LENGTH_MISMATCH in smb server Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 171/816] ksmbd: require NUL-terminated EA names Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 172/816] soreuseport: annotate data-races around reuse->socks[] and num_socks Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 173/816] power: sequencing: qcom-wcn: improve support for wcn6855 Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 174/816] power: sequencing: qcom-wcn: increase WCN7850 power-up delay Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 175/816] vhost-scsi: validate event queue descriptor direction Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 176/816] vhost-scsi: reject delayed virtqueue setup Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 177/816] vhost: reject backend enable without a kick file Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 178/816] vhost-vdpa: initialize state before publishing cdev Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 179/816] virtio_balloon: initialize wakeup_lock before virtqueues are set up Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 180/816] ext2: only flush DIRSYNC directories on every change Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 181/816] printk: Allow to use the printk kthread immediately even for 1st nbcon Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 182/816] printk: Avoid multiple unregistration in unregister_console_locked() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 183/816] virtio-blk: Fix zone append sector reporting in batched completion Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 184/816] block: partitions: reject GPT entries with starting_lba > ending_lba Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 185/816] block: Replace sprintf() with sysfs_emit() Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 186/816] block: report the correct discard alignment in sysfs Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 187/816] vsock: reject negative tv_usec in SO_VM_SOCKETS_CONNECT_TIMEOUT Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 188/816] null_blk: fix opening closed zones at the active zone limit Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 189/816] null_blk: dont finish zones to set them read-only or offline Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 190/816] tcp: wait for TIME_WAIT teardown before freeing per-netns ehash Greg Kroah-Hartman
2026-11-25 14:28 ` [PATCH 6.12 191/816] net: dsa: b53: Enable IGMP and MLD control packet CPU copies Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 192/816] net: ethernet: mediatek: preserve sibling PPE bindings Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 193/816] nvmet-tcp: ask for the TLS record type on every receive Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 194/816] nvmet-rdma: disconnect only established queues Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 195/816] nvmet-tcp: limit the connections accepted per work run Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 196/816] nvmet-rdma: take a device off the list last Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 197/816] nvmet-rdma: queue the release work under the mutex Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 198/816] nvme: fix various comment typos Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 199/816] nvmet-rdma: disconnect a queue on device removal Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 200/816] net: ethernet: ti: am65-cpts: adjust perout genf following ptp changes Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 201/816] isofs: handle Rock Ridge long-form dates before 1900 Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 202/816] tcp: Fix dup-ack detection on non-SACK bidirectional data transfer Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 203/816] net: skbuff: reject zero MPLS TTL before decrementing Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 204/816] PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 205/816] ipv6: Flush exception route while replacing nexthop Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 206/816] ipv4: Call rt_add_uncached_list() if !do_cache in ip_route_input_slow() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 207/816] inet: reduce inet_csk_clone_lock() indent level Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 208/816] inet: consolidate inet_csk_clone_lock() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 209/816] tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 210/816] drm/amd/pm: track BACO state in the SMU v11 ArmD3 sequence Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 211/816] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 212/816] ACPI: scan: Print the offline failure message in acpi_bus_offline() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 213/816] ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 214/816] ASoC: wm_adsp: Prevent negative string length in wm_adsp_control_add() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 215/816] Bluetooth: hci_conn: Fix SCO/eSCO Transport_Unit_Size for HCI data path Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 216/816] Bluetooth: L2CAP: Clear request identifiers on incoming LE connections Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 217/816] net: ethernet: bgmac: preserve forced 2.5 Gbps link speed Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 218/816] net: dsa: b53: restore the NSP IMP port 2 Gbps mode Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 219/816] Bluetooth: Fix not updating of hdev->commands[] after reset Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 220/816] spi: cadence-quadspi: Fix race between DMA completion and transfer start Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 221/816] drm/nouveau/fifo: map Kepler video engine contexts non-privileged Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 222/816] drm/nouveau: Fix CE channel creation on pre-Kepler GPUs Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 223/816] ALSA: hda/core: Stop capability walk on empty capability header Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 224/816] ALSA: hda: cs35l56: Stop cs_dsp before calling cs_dsp_power_down() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 225/816] net: 8139cp: keep Rx masked while NAPI is scheduled Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 226/816] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 227/816] ip6mr: Serialize multicast router socket ownership Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 228/816] net: stmmac: Unexport stmmac_rx_offset() from stmmac.h Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 229/816] net: stmmac: Switch to zero-copy in non-XDP RX path Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 230/816] net: stmmac: set XDP metadata length on the page_pool " Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 231/816] net: bridge: disable MRP ports before the FDB flush in del_nbp() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 232/816] tcp: initialize send sequence numbers before deferring TFO Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 233/816] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 234/816] netfilter: x_tables: check target name before accessing verdict Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 235/816] netfilter: nf_conntrack_sip: fix OOB read in ct_sip_parse_transport() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 236/816] netfilter: nf_tables: fix memleak when rule deletion fails with hardware offload Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 237/816] netfilter: nat: zero newrange before filling it in Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 238/816] tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 239/816] MIPS: Avoid dead code/data elimination when using recordmcount Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 240/816] MIPS: SGI-IP30: fix the defconfig defaults for the Bridge PROM and RTC Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 241/816] MIPS: Alchemy: Save the Ethernet address before reusing PROM memory Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 242/816] MIPS: SB1250: Validate and update IRQ affinity Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 243/816] libfs: end offset readdir at positions past DIR_OFFSET_EOD Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 244/816] initrd: flush deferred fput() before mounting root Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 245/816] iov_iter: take an unsigned long segment count in import_iovec() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 246/816] vfs: preserve subsecond timestamps at filesystem time limits Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 247/816] statx: dont leak STATX_ATTR_CHANGE_MONOTONIC in stx_attributes_mask Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 248/816] fs/read_write: make default_llseek() killable Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 249/816] fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek() Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 250/816] sched/pelt: Fix u32 truncation of the PELT period count Greg Kroah-Hartman
2026-11-25 14:29 ` [PATCH 6.12 251/816] sched/topology: Balance cluster static-key updates Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 252/816] tcp: bound snd_cwnd_clamp to TCP_MAX_SND_CWND Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 253/816] net/mlx5e: TC, Fix double free of branch in failure Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 254/816] locking/osq: Switch osq_wait_next()/atomic_cmpxchg() ordering Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 255/816] locking/osq: Fix unlink queue corruption Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 256/816] perf/x86/amd/uncore: Avoid context migration from non-owners Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 257/816] perf/core: Simplify the perf_pmu_register() error path Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 258/816] perf/core: Simplify perf_pmu_register() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 259/816] perf/core: Merge struct pmu::pmu_disable_count into struct perf_cpu_pmu_context::pmu_disable_count Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 260/816] perf/core: Add this_cpc() helper Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 261/816] perf/core: Detach struct perf_cpu_pmu_context and struct pmu lifetimes Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 262/816] perf: Fix racy update of cpc->hrtimer_interval Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 263/816] iommu/amd: Clear amd_iommu_snp_en if snp_rmptable_init() fails Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 264/816] cpufreq: staticize cpufreq_boost_trigger_state() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 265/816] cpufreq: Force sync policy boost with global boost on sysfs update Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 266/816] cpufreq: Serialize global boost updates Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 267/816] Bluetooth: reject invalid LE supervision timeout relationships Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 268/816] net/mlx5e: IPoIB, Fix QPN lookup race Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 269/816] netlink: Do not call the unbind callback with the table locked Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 270/816] net/mlx5e: Add missing Ethernet multicast octets to vport_rx_bytes sum Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 271/816] calipso: do not charge request socket options to the listener Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 272/816] ipv6: Check the Home Address option again before its address is used Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 273/816] ata: libata-scsi: fix MODE SELECT handling of data after the mode page Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 274/816] ata: libata-scsi: do not accept subpage code FFh in MODE SELECT Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 275/816] ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 276/816] ata: libata-scsi: fix MODE SELECT field pointer for unsupported subpages Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 277/816] ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 278/816] ata: libata-scsi: pass the whole mode page to the MODE SELECT handlers Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 279/816] ata: libata-scsi: set the field pointer when rejecting CDL Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 280/816] tracing/probes: bound symstr stores to reserved length Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 281/816] drm/xe: Rebind BOs evicted before the first LR queue Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 282/816] drm/xe: Toggle the D3Cold enable flag at runtime resume Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 283/816] gpiolib: of: return -ENOENT from of_gpio_count() stub Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 284/816] ASoC: soc-core: copy the DAI link names into the card Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 285/816] ASoC: SOF: amd: remove else condition in resume sequence Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 286/816] ASoC: SOF: amd: add ACP7.1 platform support Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 287/816] ASoC: SOF: amd: enable ACP_PME_EN register for ACP7.0 & ACP7.1 platforms Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 288/816] ASoC: SOF: amd: enable soundwire host wake irq mask Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 289/816] ASoC: SOF: amd: add soundwire wake irq handling Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 290/816] ASoC: SOF: amd: guard adata->sdw dereferences with NULL check in IRQ handler Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 291/816] ASoC: amd: acp: es83xx: Enable speaker amplifier after the codec output Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 292/816] btrfs: zoned: only change active zone counter on successful (de)activation Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 293/816] btrfs: zoned: dont wait for ordered extents in do_zone_finish() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 294/816] NFSv4.1: retain MDS I/O until both thresholds are met Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 295/816] NFS: honor UTIME_NOW atime with explicit mtime Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 296/816] nfs: fix utimensat() for atime with delegated timestamps Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 297/816] NFS: update ctime for atime-only UTIME_NOW requests Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 298/816] NFS: Fix inverted cross-directory rename check Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 299/816] NFS: restore directory index when resuming readdir Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 300/816] SUNRPC: wake poll waiters when an empty pipe is unlinked Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 301/816] SUNRPC: preserve timeout policy when cloning clients Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 302/816] SUNRPC: preserve transport security " Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 303/816] SUNRPC: Balance switch queue length on transport removal Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 304/816] SUNRPC: Balance queue accounting when relocating a task Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 305/816] ublk: publish a new device by its id only once it is set up Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 306/816] net: skbuff: preserve fclone lifetime when freeing stolen heads Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 307/816] i40e: xsk: fix multi-buffer XDP_PASS skb construction Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 308/816] af_unix: Remove gc_in_progress check in unix_peek_fpl() Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 309/816] net/mlx5: Bridge, fix bogus MDB offload errors Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 310/816] ipv6: ignore link state in gateway check Greg Kroah-Hartman
2026-11-25 14:30 ` [PATCH 6.12 311/816] team: Add matching error label for failed action Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 312/816] team: fix promisc/allmulti leak in team_port_add error path Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 313/816] net/mlx5: Lag, free steering resources on LAG destroy failure Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 314/816] net: protect negative destination advice with RCU Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 315/816] net: require a full socket in sock_confirm_neigh() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 316/816] ipvlan: make outbound skb headers writable Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 317/816] wifi: mac80211: mesh: dont linearize SKBs unnecessarily Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 318/816] wifi: mac80211: abort chanswitch when leaving an IBSS Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 319/816] net: fix mac_len of skbs copied by generic XDP Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 320/816] ovl: allow idmapping overlay mounts Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 321/816] ovl: release the upperdir/workdir in-use locks before the umount sync Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 322/816] bonding: fix slave_cnt leak on XDP enslave failure Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 323/816] NFSv4: wake blocking lock waiters when a delegated lock is released Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 324/816] tun: delete the flow entries of the moved queue on detach Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 325/816] fbnic: Wait for the outbound flush to complete on mailbox teardown Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 326/816] net: Segment CHECKSUM_UNNECESSARY GSO skbs other than fraglist Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 327/816] net/mlx5: macsec: Dont remove fs_id when adding a rule fails Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 328/816] dpll: notify about a reference sync pair only if it was added Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 329/816] ipv4: route: dont blackhole in-use routes when retiring fnhe routes Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 330/816] ptp: kvm: x86: Leak clock_pair page if changing its encryption fails Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 331/816] net: skbuff: uncharge trimmed zerocopy frags on error Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 332/816] net/mlx5e: Serialize TC and IPsec offload exclusion counters Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 333/816] fou: gue: check IP version of held packets for direct IP encapsulation Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 334/816] net: rfs: add sock_rps_delete_flow() helper Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 335/816] tcp: Do not allow buggy transitions between ehash and lhash2 Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 336/816] tcp: do not resurrect a former listener with SO_ATTACH_REUSEPORT_[CE]BPF Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 337/816] udp: do not use a cross-family sk_rx_dst in early demux Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 338/816] net: gro: compare skb->protocol in gro_list_prepare() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 339/816] net: stmmac: count XDP_PASS frames in rx_packets on the XSK zero-copy path Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 340/816] udp: check frag_list IP family before using skb_segment_list() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 341/816] drm/bridge: sii902x: validate I2S data lane values Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 342/816] xen/grant-table: annotate on-stack work in gnttab_unmap_refs_sync() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 343/816] ASoC: max98090: keep the MIC boost across mic input power-up Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 344/816] tcp: Drop any segments if DEFER_CONNECT is set Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 345/816] amt: tear down every amt device on an unregistering lower Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 346/816] net: ena: Keep the RX buffer mapped if skb allocation fails Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 347/816] net: ena: avoid RX copybreak for multi-descriptor packets Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 348/816] tun: disallow setting IEEE 802.15.4 and 6LoWPAN link types via TUNSETLINK Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 349/816] tls: fix async encryption race on weakly ordered architectures Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 350/816] igmp: use the joined device when leaving a multicast group Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 351/816] net/mlx5: Lag, Return error when enabling MPESW without LAG support Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 352/816] tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 353/816] amt: use ipv6_hdr() in amt_mldv1_leave_handler() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 354/816] net: usb: cdc_ncm: dont underflow the NDP room check Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 355/816] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 356/816] net: phy: c45: select BASE-T1 type for the forced speed Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 357/816] nsh: limit recursion in nsh_gso_segment() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 358/816] tracing: skip boot kprobe setup when no events were requested Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 359/816] docs, kprobes: Fix bracket Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 360/816] KEYS: do not let an unmatched key decide the search result Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 361/816] ALSA: aw2-alsa: select SND_PCM Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 362/816] Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 363/816] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 364/816] s390/zcrypt: Make apfs a real unsigned int field Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 365/816] s390/zcrypt: Fix and improve zcrypt reply message verification checks Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 366/816] mm: khugepaged: fix folio is used after pte_unmap_unlock() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 367/816] smb: client: reclaim credits for decrypted reads with no matching mid Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 368/816] smb: client: validate NT transaction response layout and offsets Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 369/816] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data() Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 370/816] x86/cpuid: Mark CPUID function 0x23 as being indexed Greg Kroah-Hartman
2026-11-25 14:31 ` [PATCH 6.12 371/816] media: rc: Replace open coded krealloc() for keymap Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 372/816] media: rc: Add missing locking " Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 373/816] wifi: mt76: take rcu_read_lock in the USB/SDIO tx completion path Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 374/816] misc: fastrpc: Allocate entire reserved memory for Audio PD in probe Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 375/816] power: supply: Correct multiple typos in comments Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 376/816] power: supply: qcom_smbx: set the charge enable after software control Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 377/816] ALSA: ua101: Bound packet copies by the PCM buffer size Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 378/816] nvmet-tcp: validate the TLS handshake timeout Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 379/816] drm/i915/psr: Disable linked plane sel fetch as well Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 380/816] xfs: refuse a pNFS LAYOUTCOMMIT of a range without blocks Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 381/816] can: skb: make echo skb freeing safe in any IRQ context Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 382/816] mm/userfaultfd: wake all waiters on unregister Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 383/816] ALSA: hda/realtek: Enable mute and mic-mute LEDs on HP ENVY 17-cr0xxx Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 384/816] mm/page_alloc: avoid direct reclaim and compaction for costly __GFP_NORETRY allocations Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 385/816] perf evsel: Restrict incremental open error unwind Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 386/816] nvme-tcp: Validate the queue state under the queue lock in the address attribute Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 387/816] nvme-tcp: fix use-after-free in nvme_tcp_free_ctrl() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 388/816] drm/panthor: Revisit reqs_lock handling in flush/reset paths Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 389/816] cxl/test: Map mock device nodes to an online node Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 390/816] fuse: dont bump attr_version for async direct read completion Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 391/816] wifi: ath11k: fix NULL dereference in ahb remove when QMI init incomplete Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 392/816] wifi: mac80211: dont seed an S1G stas last_rate Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 393/816] ACPI: APEI: GHES: Validate memory error section length before payload access Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 394/816] ASoC: sta32x: make power restoration transactional Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 395/816] dmaengine: zynqmp_dma: Fix PM rollback on sw_desc_pool alloc failure Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 396/816] dmaengine: zynqmp_dma: Free sw_desc_pool on desc_pool_v " Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 397/816] wifi: ath12k: fix truncated TX buffer DMA address in MSDU ext descriptor Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 398/816] sit: charge ip_tunnel_prl_entry allocations to memcg Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 399/816] crypto: inside-secure - Zeroize temporary arrays on stack with sensitive data Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 400/816] ACPI: glue: Reduce debug noise from acpi_device_notify() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 401/816] ACPI: glue: Rework the success message in acpi_device_notify() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 402/816] ACPI: glue: Carry out companion lookup under bus_type_sem Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 403/816] ACPI: glue: Rearrange acpi_bind_one() to avoid breakage Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 404/816] phy: samsung: usbdrd: propagate GS101 PIPE3 lock failures Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 405/816] cxl/hdm: Restore commit_end when decoder enumeration fails Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 406/816] cxl/port: Bound switch decoder target array access by nr_targets Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 407/816] ASoC: rt1015: make control calibration failures observable Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 408/816] kernfs: dont repeat or skip an entry when readdir resumes Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 409/816] ASoC: SOF: amd: fix amd_sof_acp_remove() teardown ordering Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 410/816] ASoC: SOF: amd: fix amd_sof_acp_probe() error unwind ordering Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 411/816] cxl/cdat: Fix uninitialized stack use in bandwidth gathering Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 412/816] cxl/region: Unregister the pmem region when the bridge is unbound Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 413/816] drm/connector: hdmi: Handle reset() state allocation failure Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 414/816] i3c: mipi-i3c-hci: Process multiple IBIs per interrupt Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 415/816] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 416/816] wifi: rtl8xxxu: unwind incomplete receive startup Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 417/816] wifi: rtl8xxxu: preserve RX requests across recoverable transfer errors Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 418/816] crypto: qat - hold cfg->lock when accessing config sections Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 419/816] serial: sh-sci: Unregister UART on sysfs setup failure Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 420/816] bpf: Keep target extended until its last freplace link detaches Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 421/816] bpf: Check fastcall stack contract once for all stack accesses Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 422/816] bpf: Look at frame 0 when telling async callback entries apart Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 423/816] ASoC: mediatek: mt8188: fix clk leak on error in audsys_clk_register Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 424/816] bpf: Adjust pc-relative insn copied into its own patch Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 425/816] bpf: Fix overflow of jump offset in may_goto expansion Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 426/816] bpf: Dont converge a loop on an iterator that was created anew Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 427/816] bpf: Fix uninit read for non-fetch atomics on partially spilled slots Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 428/816] bpf: Fix uninit read for helper mem args " Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 429/816] perf llvm: Fix memory leak of args->fileloc in symbol__disassemble_llvm() Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 430/816] sysctl: unregister tables before freeing bitmap Greg Kroah-Hartman
2026-11-25 14:32 ` [PATCH 6.12 431/816] arm64: dts: qcom: x1-crd: Mark the EC reset gpio as reserved Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 432/816] arm64: dts: qcom: x1e78100-t14s: " Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 433/816] arm64: dts: qcom: x1-asus-vivobook-s15: " Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 434/816] ACPI: PCC: Free channel on OpRegion deactivation Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 435/816] x86/fpu: Fix potential underflow in xstate_calculate_size() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 436/816] bpf: Rebase the exception callback subprog when dead subprogs are removed Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 437/816] tools/nolibc: fix FD_SET(), FD_CLR() and FD_ISSET() on 64-bit Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 438/816] netfilter: nfnetlink: Fix for interrupted hook dumps Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 439/816] RDMA/vmw_pvrdma: Pin QP and SRQ rings writable to match device DMA write access Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 440/816] RDMA/mlx5: Fix mlx5_ib_dev_res_init() failure when XRC cap is absent Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 441/816] RDMA/mlx5: Set QP event handler before firmware QPC insertion Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 442/816] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 443/816] perf evsel: Clamp sample_id size for ksymbol, bpf, and text_poke events Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 444/816] ALSA: usb-audio: Fix UAC2 mixer unit request handling Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 445/816] s390/ism: Zerorize dmb at allocation Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 446/816] mei: vsc-tp: initialize IRQ state before requesting interrupt Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 447/816] debugfs: make debugfs_create_str() read-only Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 448/816] riscv: dts: starfive: jh7110-common: revised device node Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 449/816] riscv: dts: starfive: Correct pwm nodes Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 450/816] bpf: Roll back freplace link state when bpf_arch_text_poke() fails Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 451/816] scsi: scsi_debug: Avoid 32-bit overflow in WRITE SCATTERED offsets Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 452/816] scsi: scsi_debug: Enforce physical block alignment of zoned writes Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 453/816] scsi: scsi_debug: Advance the write pointer over the data written Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 454/816] phy: rockchip: naneng-combphy: Add SoC prefix to register definitions Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 455/816] phy: rockchip: naneng-combphy: Fix TX detect RX termination errata Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 456/816] iommu/arm-smmu-v3: Dont rb_erase() a never-inserted stream node Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 457/816] ASoC: aw88399: skip BSTS check when boost converter is bypassed Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 458/816] drm/msm/a5xx: dont read the GPMU registers on GPUs without a GPMU Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 459/816] dlm: validate node weights before building member array Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 460/816] drm/msm/a6xx: check pm_runtime_resume_and_get during resume Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 461/816] dmaengine: ste_dma40: Fix cyclic transfer residue Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 462/816] dmaengine: ste_dma40: Recover coalesced cyclic callbacks Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 463/816] proc: report SIGEV_NONE in /proc/pid/timers if target task has died Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 464/816] wifi: mt76: mt7996: validate TLV length in mt7996_mcu_ie_countdown() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 465/816] wifi: mt76: mt7996: enable the SKU power limit table Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 466/816] wifi: mt76: mt7996: fix the hw-queues debugfs queue requests Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 467/816] wifi: mt76: mt7921: fix of_node reference leaks in regd update Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 468/816] drm/amd/display: declare amdgpu_dm_atomic_state_template as an event class Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 469/816] fs/ntfs3: check return values in indx_delete_entry() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 470/816] net: stmmac: fix TX coalesce race and div-by-zero in XDP/legacy path Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 471/816] ALSA: pcmtest: Fix leak at probe error Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 472/816] ALSA: aloop: Avoid a bad mixure of guard() and goto Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 473/816] ALSA: hda: Use linked list for jack table Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 474/816] wifi: nl80211: reject zero RNR/MBSSID elements Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 475/816] dma-direct: Restore arch_dma_alloc() for the DMA_ATTR_NO_KERNEL_MAPPING case Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 476/816] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 477/816] fs/resctrl: Ensure default group reports tasks on monitor-only systems Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 478/816] bpf, arm64: Fix racy plt target update in bpf_arch_text_poke() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 479/816] ALSA: hda/realtek: Fix mute LEDs on HP ENVY 17-cr1xxx Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 480/816] RDMA/rtrs-clt: Fix recv repost to satisfy ib_drain_rq Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 481/816] RDMA/core: Clear driver_udata before destroying objects in rdma_core Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 482/816] dmaengine: ste_dma40: Preserve the LCPA I/O address space Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 483/816] mailbox: qcom-ipcc: Remove redundant mbox_controller_unregister() on probe failure Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 484/816] mailbox: arm_mhu_db: " Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 485/816] seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk() Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 486/816] drm/panfrost: Fix PM refcnt and autosuspend issues at device probe/remove Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 487/816] net: stmmac: set real_num_tx_queues to max(offset + count) Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 488/816] net: stmmac: align real_num_tx_queues to mqprio configuration Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 489/816] btrfs: roll back sprout setup after device add failure Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 490/816] ASoC: codecs: wcd939x: read the SoundWire port switches per channel Greg Kroah-Hartman
2026-11-25 14:33 ` [PATCH 6.12 491/816] wifi: ath12k: avoid IDR mutation during pending mgmt TX cleanup Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 492/816] perf symbol: Fix symbol loading from libbfd Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 493/816] perf symbol: Add missing symsrc__destroy() for libbfd Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 494/816] Bluetooth: hci_sync: fix mesh adv timeout units Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 495/816] Bluetooth: hci_event: Fix LE link drop on remote features command status Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 496/816] iommufd: Keep reserved IOVA ranges when a replace within one IOAS fails Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 497/816] rxrpc: Fix aborting in rxperf test server Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 498/816] rxrpc: Fix sendmsg length Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 499/816] irqchip/mst-intc: Validate the DT interrupt range Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 500/816] ASoC: rt5645: Shut down the button timer on removal Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 501/816] ublk: use global index for reported zones Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 502/816] tcp: use the echoed source route in cookie_v4_check() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 503/816] pinctrl: stm32: Fix the unit of the hwspinlock timeout Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 504/816] ALSA: hda/realtek: Fix hiss/crackle on Lenovo Xiaoxin 14 GT (17aa:3912) Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 505/816] bpf: Use the frame mem type in devmap egress XDP Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 506/816] bpf: Dont hand out a linked element as extra element Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 507/816] bpf: Keep a program until its bpf_wq callback has ended Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 508/816] bpf: Count sleepable callbacks as sleepable map users Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 509/816] bpf: Assume no bounds for buffers behind a tail call Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 510/816] bpf: Assume no bounds for a writable tp with tail calls Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 511/816] bpf: Dont let an extension reach further into the context than its target Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 512/816] bpf, cpumap: Hold the device of frames in the queue Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 513/816] bpf: Let bpf_dynptr_write() mark a global function Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 514/816] bpf: Dont take a dynptr argument for a local dynptr Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 515/816] bpf: Follow the head if an skb is written from a slice Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 516/816] locking/atomic: arc, hexagon, openrisc: Define arch_cmpxchg_local() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 517/816] bpf: Zero-extend the index in inlined bpf_get_func_arg() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 518/816] gpiolib: clear the event clock flags when a line is released Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 519/816] netfilter: flowtable: reset transport header after nf_flow_encap_pop() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 520/816] ALSA: aloop: Keep shared timer callbacks alive through close Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 521/816] cgroup/cpuset: Do housekeeping check before converting invalid partition to valid Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 522/816] RDMA/mlx5: Validate priority in STEERING_ANCHOR_CREATE handler Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 523/816] xsk: freeze deferred pool teardown without blocking unregister Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 524/816] ip6mr: clear skb->cb[] in reg_vif_xmit() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 525/816] exfat: fix used_clusters accounting during cluster allocation Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 526/816] exfat: take bitmap_lock at the start of exfat_alloc_cluster() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 527/816] ksmbd: fix iface_list use-after-free during server reset Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 528/816] ksmbd: disconnect on invalid encryption transform flags Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 529/816] ksmbd: cache the resolved share path for durable reconnects Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 530/816] ksmbd: fix durable reconnects for root shares Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 531/816] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86 Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 532/816] ALSA: hda/realtek: Add mute and mic-mute LEDs for HP ENVY 16 (103c:8be5) Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 533/816] perf lock contention: Filter events before creating lock_stat Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 534/816] gpiolib: Propagate emulated drive errors when setting arrays Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 535/816] zram: fix short reads from block_state Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 536/816] ceph: wait for pending fscache write in write_folio_nounlock() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 537/816] cgroup/cpuset: Prevent recursive call of remote_cpus_update() via update_cpumasks_hier() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 538/816] net: dsa: mt7530: trap frames to conduit in MFC on EN7581 and AN7583 Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 539/816] tcp: Fix fastreuse cache initialization on first bind Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 540/816] tls: keep TX and RX hardware offload on the same device Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 541/816] ksmbd: return complete and aligned stream information Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 542/816] block: dont enter reclaim under rq_qos_mutex Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 543/816] tls: Honor O_NONBLOCK in tls_sw_splice_read() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 544/816] ppp: linearize and segment bridged packets when required Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 545/816] blk-mq: dont trust the cookie in blk_mq_poll() Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 546/816] netdev-genl: ignore NETDEV_UNREGISTER rebroadcasts Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 547/816] eth: bnxt: dont leak buffers when XDP agg buffer allocation fails Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 548/816] tun: clear stale skb->protocol of NAPI frags skbs Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 549/816] tracing/eprobe: Install the trigger for every instance that enables the eprobe Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 550/816] KEYS: Reject descriptions larger than KEY_MAX_DESC_SIZE Greg Kroah-Hartman
2026-11-25 14:34 ` [PATCH 6.12 551/816] KEYS: Verify the key identity in __key_unlink_begin Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 552/816] bootconfig: Allow keys with the maximum supported depth Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 553/816] ALSA: caiaq: Kill EP1 URB before unregistering the input device Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 554/816] ALSA: usb-audio: Drop capture packets with bogus actual_length Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 555/816] selftests/ftrace: Add missing spaces after ! in probe syntax tests Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 556/816] tracing/selftests: Fix false bashism in kprobe_non_uniq_symbol.tc Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 557/816] mmc: mmci: fix DMA channel leak when mmc_add_host() fails Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 558/816] mmc: sdhci-esdhc-imx: map unsupported driver type to Type B Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 559/816] mmc: meson-gx: report busy from DAT0 alone Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 560/816] mmc: meson-gx: honour the busy timeout for R1b commands Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 561/816] mmc: meson-gx: report the longest busy wait the controller can do Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 562/816] mmc: meson-gx: name the limit of the CMD_CFG timeout field Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 563/816] backing-file: pass RWF_NOAPPEND to synchronous writes Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 564/816] eventpoll: wake the next waiter when a woken waiter is killed Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 565/816] aio: dont let exit_aio() return before complete() is done Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 566/816] splice, net: avoid MSG_MORE when the bvec array fills Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 567/816] mm/mmzone: read the zoneref slot once in zonelist_zone() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 568/816] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 569/816] mm/mempolicy: read the zoneref slot once in mempolicy_slab_node() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 570/816] mm/memory_hotplug: resize zones under their seqlock Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 571/816] mm/page_alloc: keep the pagesets of an empty zone Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 572/816] mm/page_alloc: detect zonelist rebuilds from memory hot-add Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 573/816] coda: honor the append state of each write Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 574/816] net: dst_metadata: fix memcmp overread in skb_metadata_dst_cmp Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 575/816] macsec: reject frames that decapsulate into runt Ethernet frames Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 576/816] mctp: accept MSG_CMSG_COMPAT in recvmsg Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 577/816] net/mlx5e: SHAMPO, Disable end padding when relaxed ordering is supported Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 578/816] net/rds: Do not unpin a page after a failed atomic pin Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 579/816] net/smc: fix lgr/lnk lifetime vs diag reader race Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 580/816] net: bridge: use one headroom snapshot for ND replies Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 581/816] net: dsa: microchip: initialize the IRQ access mutex Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 582/816] net: leave O_NONBLOCK to the sendmsg and recvmsg syscalls Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 583/816] net: mana: report RX checksum offload for IPv6 Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 584/816] vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 585/816] tsacct: Keep task begin times stable across suspend Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 586/816] tls: only install push_pending_record for a TX context Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 587/816] tcp: fix authentication bypass via unsupported TCP auth options Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 588/816] seg6: validate state in netfilter continuations Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 589/816] mptcp: reject DATA_ACKs against a reversed send interval Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 590/816] ipv4: keep XFRM headers out of corked skb lengths Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 591/816] ipv4: fib_trie: prevent speculative out-of-bounds child access Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 592/816] ipv6: fix cached route reuse for control messages Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 593/816] ipv6: reject routes without an inet6_dev Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 594/816] ipvs: Defer application parent freeing until after RCU readers Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 595/816] ipvs: fix protocol data lifetime during namespace teardown Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 596/816] gtp: free the skb after handling an echo response Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 597/816] hv_netvsc: Stop PPI parsing on invalid metadata Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 598/816] net: gro: avoid parsing headers from shared fragments Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 599/816] net: gro: do not undo remote checksum offload on merged packets Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 600/816] netfilter: xt_recent: do not call remove_proc_entry() under recent_lock Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 601/816] netfilter: flowtable: extend ct timeout of offloaded GRE flows Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 602/816] net/sched: sch_teql: reject qdiscs from another network namespace Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 603/816] net/sched: act_ife: encode configured zero metadata values Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 604/816] net/sched: act_ife: require a full Ethernet header on egress Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 605/816] NFSv4: Prevent indefinite waits for out-of-order OPEN stateids Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 606/816] openvswitch: advance by the real header length in get_ipv6_ext_hdrs() Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 607/816] perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 608/816] PM: runtime: Update last_busy in rpm_resume() for active devices Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 609/816] ASoC: SOF: ipc4-topology: Fix pin format leak in process widget setup Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 610/816] Bluetooth: hci_qca: fix use-after-free in ibs debugfs files Greg Kroah-Hartman
2026-11-25 14:35 ` [PATCH 6.12 611/816] Bluetooth: L2CAP: Keep recvmsg from resuming a closed channel Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 612/816] cgroup/cpuset: Dont revive invalid partition without active CPU on hotplug Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 613/816] crypto: caam - reject overlong RSA CRT parameters Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 614/816] crypto: essiv - fix use-after-free in AEAD path Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 615/816] fs/adfs: bound directory entry name length in adfs_fplus_getnext() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 616/816] fs/proc: fix the write length returned by proc_sys_call_handler() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 617/816] fs/splice: clamp an over-reported write_iter result Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 618/816] arm64: errata: Add Cortex-A715/A720 AMU core counter workaround Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 619/816] arm64: ptrace: dont warn on missing siginfo in a group-stop Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 620/816] arm64: suspend: Save POR_EL0 over suspend Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 621/816] cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 622/816] cpufreq: intel_pstate: Clear last written P-state value on suspend Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 623/816] cpufreq: Cache post-resolution target frequency in __resolve_freq() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 624/816] software node: only let the owner release a managed node Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 625/816] SUNRPC: Fix TCP-with-TLS transport class identification Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 626/816] timekeeping: Read getboottime64() offsets under the sequence counter Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 627/816] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 628/816] tpm: Check return value of crypto_kpp_set_secret() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 629/816] tpm: eventlog: check the payload size before reading tag events Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 630/816] x86/mm: Ensure write visibility during LDT installation Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 631/816] xen/gntdev: fix deadlock between map ioctl and mmap Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 632/816] xen/privcmd: fix double free when an irqfd is shut down twice Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 633/816] xen/pvcalls: unwind pvcalls_new_active_socket() step by step Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 634/816] xen/pvcalls: destroy the per-socket workqueue on release Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 635/816] hwmon: (aht10) Fix update_interval overflow on 64-bit Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 636/816] hwmon: (pmbus/mp2975) Get vout fault limits dynamically Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 637/816] hwmon: (sy7636a) fix negative temperatures Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 638/816] hwmon: (scmi) Check channel config allocation Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 639/816] hwmon: (max31760) Fix the local temperature limit registers Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 640/816] hwmon: (max31760) Leave standby mode at probe Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 641/816] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 642/816] s390/dasd: Fix wrong free and refcount leak in build_check_tcw error path Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 643/816] s390/dasd: Dont trust userspace-supplied result field in format check Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 644/816] sched/deadline: Fix spurious -EPERM for migration-disabled tasks Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 645/816] sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 646/816] sched/core: Fix cpuset_mutex double unlock in __sched_setscheduler() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 647/816] sctp: abort unordered partial delivery when its message is skipped Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 648/816] sctp: avoid requeueing pending control chunks Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 649/816] sctp: fix ASCONF address change on single-homed hosts Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 650/816] sctp: fix I-FORWARD-TSN handling of fragments on other streams Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 651/816] sctp: report the partially delivered MID in PARTIAL_DELIVERY_ABORTED Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 652/816] sctp: reset stored flag for each association Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 653/816] LoongArch: Restore KFENCE pages through DMW on resume Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 654/816] tracing/eprobe: Fix 1-byte signed field fetch in get_event_field() Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 655/816] tracing/eprobe: Disallow attaching eprobes to fprobe events Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 656/816] tracing/probes: Check enabled and busy state before unlinking sibling probes Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 657/816] tracing/probes: Fix user-space dereference string array store type Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 658/816] tracing/probes: Reject array count on non-dereference string sources Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 659/816] wifi: ath9k_htc: do not start ANI before the first channel is set Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 660/816] wifi: cfg80211: release rejected nontransmitted BSS reference Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 661/816] wifi: cfg80211: preserve mesh A-MSDU lengths when adding mesh headers Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 662/816] wifi: cfg80211: dont truncate the merged MBSSID profile length Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 663/816] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 664/816] wifi: mac80211: drain link readers before stopping removed links Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 665/816] wifi: mac80211: recheck injected headers after removing FCS Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 666/816] wifi: mac80211: recheck the IBSS station limit before insertion Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 667/816] wifi: mac80211: recheck the OCB " Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 668/816] wifi: mac80211: reject invalid EHT guard intervals in airtime estimates Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 669/816] wifi: mac80211: restore dormant links when link updates fail Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 670/816] wifi: mac80211: bound pending IBSS station allocations Greg Kroah-Hartman
2026-11-25 14:36 ` [PATCH 6.12 671/816] wifi: mac80211: bound pending OCB " Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 672/816] gpio: brcmstb: fix UAF after IRQ domain setup failure Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 673/816] gpio: rockchip: Fix debounce arithmetic for GPIO v2 Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 674/816] gpio: sodaville: fix use-after-free bug when registering the irqchip Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 675/816] gpio: virtuser: fix interrupt leak and UAF Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 676/816] gpio: virtuser: remove the debugfs files before freeing the line data Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 677/816] ovl: do not always clear absolute_redirect Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 678/816] ovl: reject different lower idmaps on the same fs Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 679/816] ovl: report the requested redirect_dir mode in conflicting options Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 680/816] ovl: return EIO if the lowerdata is missing Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 681/816] smb: client: bound invalid NTLMSSP signature diagnostic Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 682/816] smb: client: compare owner and group SIDs using their encoded lengths Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 683/816] smb: client: dont block dying tasks waiting for writeback on close Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 684/816] smb: client: dont block dying tasks waiting for writeback on fsync Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 685/816] smb: client: fix OOB write when compounding SMB2_IOCTL with encryption Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 686/816] smb: client: fix out-of-bounds read in dfs_parse_target_referral() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 687/816] smb: client: flush deferred handles of other names before a hard link open Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 688/816] smb: client: hold the inode across cifs_oplock_break() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 689/816] smb: client: issue writes from a worker if the task is dying Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 690/816] smb: client: skip NULL channel in __cifs_put_smb_ses() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 691/816] dm log userspace: drop the device reference on error Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 692/816] dm: avoid double-dropping the zone reset submission reference Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 693/816] dm: Reject table setup after queue or disk teardown Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 694/816] dm cache: reject kcopyd client destory if it setup failed Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 695/816] dm crypt: fix use of uninitialized percpu_counter in ctr error path Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 696/816] dm mpath: fix buffer overflow in parse_hw_handler() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 697/816] dm mpath: cap queue_if_no_path_timeout_secs Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 698/816] dm thin: avoid wrapping no_space_timeout Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 699/816] dm-sysfs: fix misbehavior if kobject_init_and_add fails Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 700/816] dm-verity: dont restart or panic on errors during system shutdown Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 701/816] dm persistent data: test return value of node_copy Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 702/816] dm persistent data: dont ignore writeback errors Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 703/816] dm persistent data: dont leak bufio buffer if find_leaf fails Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 704/816] dm snapshot: fix discard_granularity unit in snapshot_io_hints Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 705/816] dm snapshot: split discards on chunk boundaries Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 706/816] dm snapshot: fix discard writing into the next COW chunk Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 707/816] dm zoned: back off when reclaim cannot make progress Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 708/816] dm zoned: do not reclaim a random zone into another random zone Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 709/816] dm-cache: fix NULL pointer dereference on open failure Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 710/816] dm-cache: fix ending a cursor that never began Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 711/816] dm-crypt: reject integrity_key_size with non-authenc AEAD ciphers Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 712/816] dm-crypt: defer async write submission to write thread Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 713/816] dm-integrity: dont recalculate with HMAC because of a dirty bitmap Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 714/816] dm-integrity: dont attempt to commit journal on disabled device Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 715/816] dm-raid: bound array_position before indexing failed_devices Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 716/816] dm-raid: fix use-after-free in raid_dtr() Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 717/816] dm-thin: fix data corruption if discard races with regular I/O Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 718/816] dm-thin: fix leak if __set_snapshot_details fails Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 719/816] dm-thin: fix parsing of feature arguments Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 720/816] vt: serialise the producers of the flip buffer Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 721/816] comedi: addi_apci_1500: fix clearing of the gate enable Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 722/816] comedi: ni_660x: dont poll without a DMA channel Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 723/816] comedi: ni_tio: Fix overflow of the clock period Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 724/816] comedi: vmk80xx: report failed transfers of the K8061 Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 725/816] iio: accel: adxl380: dont stay in standby on -EINVAL Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 726/816] iio: addac: ad74413r: fix the values of set_multiple Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 727/816] iio: hid-sensors: fix a division by zero Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 728/816] iio: sx9310: use the data of the I2C table Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 729/816] misc: bcm-vk: fix DMA allocation memory leak Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 730/816] misc: ibmvmc: initialize HMC state before device registration Greg Kroah-Hartman
2026-11-25 14:37 ` [PATCH 6.12 731/816] misc: vmw_vmci: wait for callbacks in event unsubscribe Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 732/816] serial: 8250_lpss: dont divide by 0 above 6.25 Mbaud Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 733/816] serial: rda: free the interrupt on shutdown Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 734/816] serial: samsung: dont leak the tty on an RX IRQ Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 735/816] serial: samsung: put the previous baud clock Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 736/816] tty: fix misapplied compat_ptr() in tty_compat_ioctl() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 737/816] USB: cdc-acm: fix NULL-deref on hangup Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 738/816] usb: pci-quirks: always assert xHCI OS ownership Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 739/816] USB: serial: garmin_gps: fix deadlock on reset request Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 740/816] USB: serial: oti6858: fix the teardown order in close Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 741/816] usb: typec: mux: fsa4480: Keep the USB 2.0 switch on in DP-only modes Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 742/816] usb: typec: nb7vpq904m: Set client data in probe to avoid crash on remove Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 743/816] usb: uas: ignore UAS for ASMT135x bridges (174c:55aa) Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 744/816] usb: usbtest: prevent divide by zero in simple_io() with zero length Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 745/816] usb: typec: ucsi: Set ucsi->connector before enabling notifications Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 746/816] usb: xhci: disable the correct slot on alloc_dev failure Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 747/816] usb: gadget: f_mass_storage: take filesem in nofua store to fix backing-file UAF Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 748/816] usb: gadget: f_midi: fix UAF race during IN request handling Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 749/816] usb: gadget: f_ncm: restart the TX timer if the TX freelist is empty Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 750/816] usb: gadget: u_serial: fix NULL deref in gs_close() after failed open Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 751/816] usb: gadget: u_serial: pin ports while TTYs are installed Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 752/816] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 753/816] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 754/816] usb: dwc3: gadget: Recover from End Transfer timeout Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 755/816] usb: dwc3: gadget: Reject requests to a disabled endpoint Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 756/816] usb: dwc3: gadget: Reset endpoint flags on controller start Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 757/816] usb: dwc3: gadget: Track a timed out End Transfer Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 758/816] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 759/816] usb: dwc3: xilinx: fix system suspend and resume PHY handling Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 760/816] w1: dont hold list_mutex while a slave is torn down Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 761/816] w1: ds2482: set the strong pull-up with its byte Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 762/816] w1: ds2805: use the bus mutex to talk on the bus Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 763/816] w1: ds28e04: " Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 764/816] w1: netlink: drop the slave after the bus is unlocked Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 765/816] w1: remove the masters files before taking its locks Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 766/816] w1: use the bus mutex for the "rw" file Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 767/816] w1: w1_therm: leave the slaves of other families alone Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 768/816] drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 769/816] drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 770/816] USB: serial: garmin_gps: validate packet data length in nat_receive() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 771/816] USB: serial: sierra: validate URB length in instat callback Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 772/816] USB: serial: upd78f0730: fix NULL-deref on hangup Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 773/816] USB: serial: io_edgeport: fix NULL-deref on early status Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 774/816] USB: serial: io_edgeport: fix potential close() use-after-free Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 775/816] USB: serial: io_edgeport: fix potential NULL-deref at open Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 776/816] USB: serial: io_edgeport: move initial termios update to open() Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 777/816] USB: serial: io_edgeport: fix potential fifo corruption Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 778/816] USB: serial: io_edgeport: fix potential use-after-free on disconnect Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 779/816] USB: serial: io_edgeport: serialise MCR accesses Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 780/816] dt-bindings: iio: adc: Add syscon property for multi-SCU SoCs Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 781/816] iio: accel: kxsd9: Fix potential use-after-free on removal Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 782/816] iio: acpi: Accept comma separated values in ROTM strings Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 783/816] iio: afe: rescale: expose offset if rescaler or source has one Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 784/816] iio: atlas-ezo: Fix humidity channel read support Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 785/816] iio: dac: mcp4725: Update the cached DAC value only on success Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 786/816] iio: gyro: bmg160: reject duplicate event disable Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 787/816] iio: hid-sensor: Fix scale for magnetic north heading Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 788/816] iio: hid-sensors: fix fractional part for unit exponents -7 and -8 Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 789/816] iio: humidity: am2315: fix negative temperature decoding Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 790/816] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change Greg Kroah-Hartman
2026-11-25 14:38 ` [PATCH 6.12 791/816] iio: imu: inv_mpu6050: fix magnetometer scale of Y and Z axes Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 792/816] iio: imu: kmx61: reject duplicate event disable Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 793/816] iio: light: tsl2591: dont divide by zero Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 794/816] iio: light: vcnl4035: Fix reversed ALS mode bit Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 795/816] iio: magnetometer: mmc35240: leave cache-only mode before the cache sync Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 796/816] iio: proximity: sx9324: fix out-of-bounds read of scan period table Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 797/816] iio: temperature: mlx90614: Fix dual channel probe condition check Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 798/816] iio: trigger: free the trigger ID after device_del() Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 799/816] iio: trigger: Return an error when the trigger has no free irq Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 800/816] fou: reserve headroom before pushing the encap header Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 801/816] blk-mq: take quiesce_lock when removing a queue from the tag set Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 802/816] accel/ivpu: Defer recovery until probe completes Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 803/816] sctp: fix skb_over_panic when adding addresses with a pending delete of another family Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 804/816] nvme: fix deadlock on nvme_subsystems_lock in nvme_init_subsystem() Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 805/816] tcp: fix NULL pointer dereference when restarting a Fast Open listener Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 806/816] powerpc/watchdog: disable watchdog when watchdog_thresh=0 Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 807/816] 9p: fix memory leak in v9fs_init_fs_context error path Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 808/816] 9p: fix access mode flags being ORed instead of replaced Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 809/816] 9p: fix privport option setting wrong RDMA field Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 810/816] tcp: Set unhashed_state in inet_twsk_hashdance_schedule() Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 811/816] radix-tree: add missing cleanup.h Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 812/816] net: stmmac: Apply new page pool parameters when SPH is enabled Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 813/816] net: stmmac: restore NET_IP_ALIGN in the RX DMA offset Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 814/816] net: stmmac: clear stale buf->page after recycling on skb build failure Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 815/816] power: sequencing: qcom-wcn: fix bluetooth-wifi copypasta for WCN6855 Greg Kroah-Hartman
2026-11-25 14:39 ` [PATCH 6.12 816/816] cpufreq: Preserve global boost state on failed updates Greg Kroah-Hartman
2026-11-25 15:38 ` [PATCH 6.12 000/816] 6.12.120-rc1 review SJ Park
2026-11-25 16:27 ` Brett A C Sheffield
2026-11-25 17:10 ` Greg Kroah-Hartman
2026-11-25 17:26 ` Brett A C Sheffield
2026-11-26 10:32 ` Greg Kroah-Hartman
2026-11-26 3:58 ` Florian Fainelli
2026-11-26 8:12 ` Peter Schneider
2026-11-26 9:55 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox