* [PATCH 6.12 000/555] 6.12.121-rc1 review
@ 2026-12-04 10:00 Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 001/555] net: ipv6: keep room for the mac header in dst_dev_overhead() Greg Kroah-Hartman
` (66 more replies)
0 siblings, 67 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 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.121 release.
There are 555 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 Sun, 06 Dec 2026 10:04:57 +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.121-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.121-rc1
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: intel_pstate: Use dedicated lock in set_power_ctl_ee_state()
Ruben Wauters <ruben.wauters@linux.dev>
drm/gud: fix potential divide error due to optimisation
Adrian Ambrozewicz <aambrozewicz@nvidia.com>
gpiolib: free the label of lines released after their chip was removed
Adrian Ambrozewicz <aambrozewicz@nvidia.com>
gpiolib: wait for pending label frees before cleaning up desc_srcu
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpiolib: don't overwrite the entire flags field in gpiod_free_commit()
Cooper Morgan <ext-github@cwooper.dev>
drm/amd/display: Saturate refresh rates in v1/v2 FreeSync infopackets
Christoph Hellwig <hch@lst.de>
direct-io: remove IOCB_NOWAIT support
Martin Belanger <martin.belanger@dell.com>
nvme-tcp: consume TLS records without application data
Martin Belanger <martin.belanger@dell.com>
nvme-tcp: move the TLS record read loop into a helper
Martin Belanger <martin.belanger@dell.com>
nvme-tcp: use an aligned buffer for the TLS record type
Bart Van Assche <bvanassche@acm.org>
block: Remove queue freezing from several sysfs store callbacks
Nathan Chancellor <nathan@kernel.org>
rcu/nocb: Avoid unsequenced accesses to jiffies in show_rcu_nocb_state()
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpiolib: don't overwrite the entire flags field in gpiod_get_direction()
Carlos Bilbao <carlos.bilbao@kernel.org>
scsi: target: iscsi: reject invalid size Extended CDB AHS
Chris J Arges <carges@cloudflare.com>
net: prevent receive header offset overflow during decapsulation
Shuai Liu <847807867@qq.com>
xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
Zhao Gongyi <zhaogongyi@bytedance.com>
ext4: fix OOB memmove in ext4_xattr_set_entry
Guicai Ma <maguicai@kylinos.cn>
KEYS: Use kfree_sensitive() in keyctl_pkey_e_d_s()
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: trusted: Update static calls before init
Sinan Turunc <enscrpt@pm.me>
KEYS: serialise key instantiation against keyctl_chown_key()
Guicai Ma <maguicai@kylinos.cn>
KEYS: Fix userspace buffer overflow in keyctl_pkey_e_d_s()
Henry Martin <bsdhenrymartin@gmail.com>
KEYS: Fix crash on big_key read
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: Fix asym key overflow in keyctl_pkey_verify()
Takashi Iwai <tiwai@suse.de>
ALSA: oss: Fix deadlock at unregistering (again)
Suyuan Wang <stevewong@hust.edu.cn>
ALSA: fireworks: Abort the transaction on a bus reset
Suyuan Wang <stevewong@hust.edu.cn>
ALSA: firewire-lib: Abort the FCP transaction on a bus reset
Vasileios Almpanis <vasilisalmpanis@gmail.com>
usb: gadget: f_uac1_legacy: fix double close of the ALSA devices
Dave Airlie <airlied@redhat.com>
i915/vma: use kfree_rcu to make sure vma are freed after a rcu grace period
Xu Rao <raoxu@uniontech.com>
vhost/net: Fix receive queue test in busy poll
Brajesh Gupta <brajesh.gupta@imgtec.com>
drm/imagination: Set scheduler timeout period higher than Firmware timeout
Andrea Righi <arighi@nvidia.com>
sched_ext: Enable tick for finite slices on nohz_full
Po-Hao Huang <phhuang@realtek.com>
wifi: rtw89: modify active scan rule for 6GHz band
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ASoC: SOF: Intel: lnl: Enable offload for UAOL link
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Flush exception route while replacing nexthop.
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Remove FIB6_EXCEPTION_BUCKET_FLUSHED.
David Hildenbrand (Arm) <david@kernel.org>
mm/gup: limit pagecache folio refcount when grabbing references
David Hildenbrand (Arm) <david@kernel.org>
mm/mmu_gather: flush pending references early before the folio limit
David Hildenbrand (Arm) <david@kernel.org>
mm: limit pagecache folio refcount when splicing into pipes
David Hildenbrand (Arm) <david@kernel.org>
mm: limit pagecache folio refcount when mapping pages
Matthew Wilcox (Oracle) <willy@infradead.org>
filemap: Add folio_next_pos()
Max Kellermann <max.kellermann@ionos.com>
mm: constify pagemap related test/getter functions
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Prevent rt6_insert_exception() for dying fib6_info.
Jamal Hadi Salim <jhs@mojatatu.com>
net/sched: codel: bound the dropping loop per dequeue call
Sam James <sam@gentoo.org>
crypto: nx - fix nx_crypto_ctx_exit argument
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: say when we are busy, and leave the busy state on read
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: acknowledge delivered data before resetting a call
Bernard Pidoux <bernard.f6bvp@gmail.com>
ax25: leave the busy state when the application reads
Bernard Pidoux <bernard.f6bvp@gmail.com>
mkiss: leave the escaped state on any byte after FESC
Bernard Pidoux <bernard.f6bvp@gmail.com>
netrom: leave the busy state when the application reads
Bernard Pidoux <bernard.f6bvp@gmail.com>
netrom: bound the resequencing queue while we are busy
Bernard Pidoux <bernard.f6bvp@gmail.com>
netrom: clear the choke flag on frames sent again
Vincent Donnefort <vdonnefort@google.com>
tracing: Take trace_access_lock() in tracing_buffers_ioctl()
David Carlier <devnexen@gmail.com>
tracing: Ignore .function on the function trace event
David Carlier <devnexen@gmail.com>
tracing: Drop the synthetic event ref when clearing hist triggers
Steven Rostedt <rostedt@goodmis.org>
tracing: Do not allow user events to add a system name
Jaewon Jung <jaewon8868@gmail.com>
tracing: Avoid undefined shifts for zero histogram map size
Kyle Zeng <kylebot@openai.com>
tracing/filters: Treat zero-length dynamic strings as empty
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/filters: Handle out-of-range CPU for OP_NE in cpumask comparison
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/filters: Fix MATCH_END_ONLY regex matching for fixed-size strings
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/filters: Check for missing operand after operator in parse_pred()
David Carlier <devnexen@gmail.com>
tracing/user_events: Don't free an event that a dynamic event still references
Chaosheng Qu <chaosheng.qu.linux@gmail.com>
tracing/osnoise: Don't start a kthread in timerlat user-space mode
koraynilay <koray.fra@gmail.com>
smb: client: fix times assignments in cifs_posix_to_fattr()
koraynilay <koray.fra@gmail.com>
smb: client: fix negative timestamps being read from smb
Stanley Jhu <stanleyjhu@google.com>
scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper
Stanley Jhu <stanleyjhu@google.com>
scsi: ufs: bsg: Abort ufs_bsg_request() when runtime resume fails
Praneeth Balasubramanian <praneeth@ucsb.edu>
scsi: target: iscsi: Check for existing sessions only after authentication
Shao Mingyin <shao.mingyin@zte.com.cn>
scsi: target: Fix NULL pointer dereference in target_dev_alua_lu_gp_store()
Shao Mingyin <shao.mingyin@zte.com.cn>
scsi: target: Fix NULL pointer dereference in core_alua_do_port_transition()
Ciro Iriarte <ciro.iriarte+software@gmail.com>
scsi: target: core: Parse APTPL res_type and res_scope as hex
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet: zns: return the namespace lookup error for Identify
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet: use overflow-safe range checks in the file backend
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet: handle short reads and writes in the file backend
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet-tcp: only wait for in-capsule data for inline SGLs
Shao Mingyin <shao.mingyin@zte.com.cn>
nvmet-fc: reject duplicate queue IDs on Create Connection
Yaohan Li <shunsheng1218@gmail.com>
nvme: stop asynchronous event work before ANA teardown
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme: reject invalid reconnect_delay sysfs values
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme-tcp: require the R2T offset to match the data sent
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme-loop: release the target request when SG setup fails
Shao Mingyin <shao.mingyin@zte.com.cn>
nvme-auth: use the parsed offset for the DH-CHAP key
Joas Antonio dos Santos <joasantonio108@gmail.com>
net: usb: smsc75xx: reject frames without a full header and FCS
Zxyan Zhu <zxyan0222@gmail.com>
net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2
Christian Schmidbauer <opensource@grische.xyz>
net: stmmac: honour Rx checksum errors in the AF_XDP zero-copy path
Christian Schmidbauer <opensource@grische.xyz>
net: stmmac: dwmac1000: don't discard frames with only a checksum error
Eric Dumazet <edumazet@kernel.org>
net: openvswitch: use skb_set_transport_header_careful() in parse_ipv6hdr()
Nathan Chancellor <nathan@kernel.org>
net: microchip: encx24j600: Avoid unsequenced accesses to jiffies in encx24j600_tx()
Anthony Pighin <anthony.pighin@nokia.com>
net: gianfar: clear the pending Rx skb when freeing the Rx ring
Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
net: e1000: fix warning in iounmap on probe failure
Daniel Wade <danjwade95@gmail.com>
net: bridge: fix skb leak of reinjected link-local frames
Daejun Park <daejun7.park@samsung.com>
xfs: wait for direct I/O before swapping extents
Rik van Riel <riel@surriel.com>
xfs: keep successful near rt allocations
Daejun Park <daejun7.park@samsung.com>
xfs: break layouts before swapping extents
Ding Feng <dingf3ng@gmail.com>
zonefs: ignore RLIMIT_FSIZE above LLONG_MAX in zonefs_write_check_limits()
Krystian Kaniewski <krystianmkaniewski@gmail.com>
xarray: fix index jumping backwards in xas_find()
Adrian Schlegel <me@adrianschlegel.com>
x86/mce: Do not treat cache hierarchy errors as memory errors
WeitaoWang-oc <WeitaoWang-oc@zhaoxin.com>
x86/apic/msi: Fix MSI interrupt affinity configuration
Zhao Feng <zhaofeng2@cmss.chinamobile.com>
watchdog: npcm: fix sleeping clock call in restart handler
Miklos Szeredi <mszeredi@redhat.com>
virtiofs: fix use-after-free of fs->tag on device removal
Matt Turner <mattst88@gmail.com>
vgacon: Fall back to the dummy console if mapping VGA memory fails
Eric Dumazet <edumazet@kernel.org>
udp: use skb_set_transport_header_careful() in __udp6_lib_err_encap()
Juan Agustin Niccolini <juanagusnicco@gmail.com>
tcp: Fix the SO_REUSEPORT bind cache admitting a conflicting socket
Sebastian Reichel <sebastian.reichel@collabora.com>
spi: Fix runtime PM imbalance on pump transfer message error
Stephen Smalley <stephen.smalley.work@gmail.com>
selinux: check MAP_SHARED_VALIDATE mappings as shared
Günther Noack <gnoack3000@gmail.com>
selftests/landlock: Test that layering does not break refer
Eric Dumazet <edumazet@kernel.org>
sctp: use skb_set_transport_header_careful() in sctp_v6_err()
Yves Bieri <yves.bieri@theori.io>
sctp: do not free a new asoc peeled off while sendmsg slept
Cen Zhang <zzzccc427@gmail.com>
ocfs2: serialize inode journal access with shutdown
Zhiyuan Zhang <zhiyuanzhang912@gmail.com>
ocfs2: fix kernel BUG in ocfs2_page_mkwrite() when write_end fails
Cen Zhang <zzzccc427@gmail.com>
ocfs2: advance locking_state through the live cursor
Cen Zhang <zzzccc427@gmail.com>
ocfs2/dlmfs: keep the superblock alive during lock work
Miguel Ojeda <ojeda@kernel.org>
objtool/rust: add more `noreturn` Rust functions for Rust 1.101.0
Karl Mehltretter <kmehltretter@gmail.com>
parisc: irq: Trace hardirq state in do_cpu_irq_mask()
Karl Mehltretter <kmehltretter@gmail.com>
parisc: Fix register corruption in 32-bit dynamic ftrace
Boyan Liu <yymhvert@gmail.com>
scsi: sd_zbc: Cap zone report count by buffer size
Shao Mingyin <shao.mingyin@zte.com.cn>
scsi: rdac: Keep the error status when controller lookup fails
Milan P. Gandhi <mgandhi@redhat.com>
scsi: mpi3mr: Validate reply frame size bounds
Jiale Yao <yaojiale02@163.com>
s390/dcssblk: Initialize device semaphore before sysfs registration
Gerald Schaefer <gerald.schaefer@linux.ibm.com>
s390/appldata: Fix error handling in appldata_generic_handler()
Yunhui Cui <cuiyunhui@bytedance.com>
riscv: Fix SR_SUM leakage across context switches
Bradley Morgan <brads@mainlining.org>
powerpc32/modules: Reserve a PLT entry for ftrace_regs_caller
Nathan Chancellor <nathan@kernel.org>
powerpc/xmon: Avoid unsequenced accesses to tsk in show_task()
Jiale Yao <yaojiale02@163.com>
powerpc/eeh: NUL-terminate force recovery input
Paul Moses <p@1g4.org>
perf record: Reject CPU indices equal to the mask size
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
RDMA/srpt: widen the indirect RDMA context counters
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
RDMA/srpt: reject zero-length buffer descriptors
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
RDMA/srpt: bound the indirect descriptor table to the IU
Deep Shah <deepshah146@gmail.com>
RDMA/siw: Fix use-after-free in siw_mem_id2obj()
Jaeyeong Lee <lee@jaeyeong.cc>
RDMA/rtrs: Register client event handler after capability check
Moshe Shemesh <moshe@nvidia.com>
RDMA/mlx5: Skip vport context query on FW without ib_virt support
Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
RDMA/mlx5: Fix DevX umem page size truncation for pages >= 4G
Nathan Chancellor <nathan@kernel.org>
qca_spi: Avoid unsequenced accesses to jiffies in qcaspi_netdev_tx_timeout()
Shrikanth Hegde <sshegde@linux.ibm.com>
PPC32: Fix hard_irq_disable to follow tracing and lockdep state
Ridong Chen <chenridong@xiaomi.com>
mm/migrate: move NR_FILE_THPS on cross-node migration
David Hildenbrand (Arm) <david@kernel.org>
mm/khugepaged: don't map folios that are not uptodate in MADV_COLLAPSE
Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
mm/filemap: stop fault-around when the walk steps back
Wang Xiaolei <xiaoleiwangxiaolei@gmail.com>
mm/damon/tests/sysfs-kunit: fix leaked pid reference in add_targets test
Aveline Noir <jm5905938@gmail.com>
mm/damon/core: reset watermark wait state on each iteration
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: XICS: Avoid NULL ptr deref in kvmppc_xive_cleanup_vcpu()
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: Take SRCU read lock around kvmppc_h_page_init() call
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: Ensure that calls to idr_alloc are synchronized
Amit Machhiwal <amachhiw@linux.ibm.com>
KVM: PPC: Book3S HV: Disable preemption around host-side HPT lock users
Gautam Menghani <gautam@linux.ibm.com>
KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit
Axel Mierczuk <axel.mierczuk@1password.com>
ipvs: validate cport in received sync records
Zihan Xi <zihanx@nebusec.ai>
ipvs: reject FTP control ports as data ports
Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
ipvs: ftp: skip conntrack templates in ip_vs_ftp_out
Eric Dumazet <edumazet@kernel.org>
ipv6: mcast: use skb_set_transport_header_careful() in ipv6_mc_check_exthdrs()
Jaeyeong Lee <lee@jaeyeong.cc>
net/tls: serialize context removal in tls_device_down()
Nathan Chancellor <nathan@kernel.org>
mptcp: Avoid unsequenced accesses to jiffies in mptcp_reset_tout_timer()
Liam R. Howlett (Google) <liam@infradead.org>
maple_tree: fix rcu reader NULL dereference after the tree is emptied
Joas Antonio dos Santos <joasantonio108@gmail.com>
mac802154: llsec: reject secured frames with security level 0
Henry Martin <bsdhenrymartin@gmail.com>
ip6mr: prevent info-leak in ip6mr_cache_report()
Juan Parrado <jparrado.1817@gmail.com>
Input: xpad - add support to Hori Real Arcade Pro 4
Yuan Yao <yaoyuan0329os@gmail.com>
Input: trackpoint - add new TP JYT_NDT device variant id 7
Liu Chao <liuc63@xiaopeng.com>
Input: goodix - reject a bak_ref length that cannot hold the checksum
Ivan Verbovoy <ivanverbovoy@gmail.com>
Input: da7280 - do not advertise FF_GAIN
Wentao Liang <vulab@iscas.ac.cn>
Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate()
Ziheng Wei <zihengw03@163.com>
hwmon: (w83792d) Fix incorrect struct cast in show_temp1() and store_temp1()
Ziheng Wei <zihengw03@163.com>
hwmon: (w83791d) Fix incorrect struct cast in show_temp1() and store_temp1()
Wayne Ho <wayneho219@gmail.com>
hwmon: (sht3x) Fix overflow when writing alert limits
Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Fix tolerance bitmask when reading REG_FAN_MODE
Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Fix swapped temperature tolerance register writes
Ziheng Wei <zihengw03@163.com>
hwmon: (nct6775) Fix incorrect struct cast in beep callbacks
Rosen Penev <rosenp@gmail.com>
hwmon: (dell-smm) Reject out-of-range pwm values
Rosen Penev <rosenp@gmail.com>
hwmon: (dell-smm) Reject a fan_max that the BIOS cannot take
Vítor Hugo Silva <vitorhg20080@gmail.com>
hwmon: (ads7871) Add error handle from spi_setup()
Xuanqiang Luo <luoxuanqiang@kylinos.cn>
iavf: fix ASQ command buffer leak on init failure
Sung Byeongchan <tjdqudcks0424@naver.com>
ieee802154: require CAP_NET_ADMIN for SIOCSIFADDR
Lianjie Wang <lian@is.s.u-tokyo.ac.jp>
gpio: virtio: compute the line names size in a size_t
Lianjie Wang <lian@is.s.u-tokyo.ac.jp>
gpio: virtio: bound the line names block by its configured size
Alexandre Becholey <alex@becholey.ch>
gpio: ljca: Validate the pin index of interrupt events
Junyoung Jang <graypanda.inzag@gmail.com>
fuse: skip dcache instantiation for readdirplus names with embedded NUL
Miklos Szeredi <mszeredi@redhat.com>
fuse: limit name size in listxattr
Miklos Szeredi <mszeredi@redhat.com>
fuse: fix possible UAF in fuse_direntplus_link()
Weiming Shi <bestswngs@gmail.com>
fbdev: vfb: Validate framebuffer geometry and memory size
Tim Douglas <me@timdoug.com>
fbdev: valkyriefb: keep the framebuffer mapping size fixed
Xue Haolin <xuehaolin@uniontech.com>
fbdev: sstfb: Error out if pixclock equals zero
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
fbdev: smscufx: keep the usb_device alive while ufx_data is in use
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
fbdev: smscufx: don't free registered framebuffer on probe error
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
fbdev: smscufx: allocate the size advertised in smem_len
Jianqiang Zou <jq.zou@outlook.com>
fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var()
Tim Douglas <me@timdoug.com>
fbdev: macmodes: compare the pixel clock of each candidate mode
Steffen A. Mork <linux-dev@morknet.de>
fbdev: fm2fb: Fix iomem access
Eric Biggers <ebiggers@kernel.org>
fscrypt: Initialize ->ci_master_key before publication
Aristeu Rozanski <aris@redhat.com>
EDAC/i5000: Fix slot number passed to determine_mtr()
Marek Szyprowski <m.szyprowski@samsung.com>
dma: swiotlb: Serialize restricted DMA pool initialization
Marek Szyprowski <m.szyprowski@samsung.com>
dma: swiotlb: Properly tear down the default pool on exit
Marek Szyprowski <m.szyprowski@samsung.com>
dma-coherent: serialize reserved memory pool initialization
Sumit Gupta <sumitg@nvidia.com>
cpufreq: CPPC: Set CPPC Enable register in cpu_init()
Xu Rao <raoxu@uniontech.com>
Bluetooth: MGMT: Fix runtime config status opcode
Joas Antonio dos Santos <joasantonio108@gmail.com>
Bluetooth: hci_qca: clear qca_memdump when discarding dump packets
Alex Kazinsky <a.kazinsky@ideco.ru>
blk-iocost: Fix overflow in donation weight calculation
Niklas Cassel <cassel@kernel.org>
ata: libata-scsi: fix the INC_512 bit test for SECURITY PROTOCOL IN/OUT
Chen Yuxi <chenyuxi19@huawei.com>
ASoC: wm8962: Fix broken headset button caused by wrong guard constant
yzddMr6 <yzddmr6@gmail.com>
ASoC: qcom: q6dsp-lpass-clocks: Set driver data before registering clocks
Julius Bairaktaris <julius@bairaktaris.de>
ASoC: qcom: q6asm-dai: reject compress rings larger than the DMA buffer
Julius Bairaktaris <julius@bairaktaris.de>
ASoC: qcom: q6apm-dai: reject compress rings larger than the DMA buffer
Marc Herrero <marcht@proton.me>
ASoC: qcom: audioreach: only disconnect the route a mixer control owns
Ben Cressey <ben@cressey.dev>
arm64: kexec: use a typed entry to fix kCFI oops
Vineet Gupta <vgupta@kernel.org>
ARC: io: work around GCC PR127718 in __raw_write{w,l}()
Ye Weihua <yeweihua4@huawei.com>
ALSA: pcm: oss: Restore params flag after failed reconfiguration
Aldo Ariel Panzardo <qwe.aldo@gmail.com>
drm/vmwgfx: close TOCTOU on guest_memory_bo in surface reference ioctl
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: validate command body sizes before parsing
Aldo Ariel Panzardo <qwe.aldo@gmail.com>
drm/vmwgfx: return an error when a shared GB surface has no backup buffer
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: reserve dumb buffers while detaching their surfaces
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: log MOB limits outside the manager spinlock
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: log missing primary planes only once
Vladimir Popov <popov.nkv@gmail.com>
drm/vmwgfx: fix NULL pointer dereference in vmw_validation_bo_fence()
Jaeyeong Lee <finpiler@protonmail.com>
drm/vmwgfx: Erase the detached resource entry on resource release
Aldo Ariel Panzardo <qwe.aldo@gmail.com>
drm/vmwgfx: do not hand the embedded sg_table to the PRIME core
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: bound MKSSTAT lengths before rounding to pages
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: avoid underflow when stripping short GuestInfo replies
Maíra Canal <mcanal@igalia.com>
drm/vc4: Start shader code at varying offsets in its BO
Maíra Canal <mcanal@igalia.com>
drm/vc4: Fix off-by-one in the shader record BO handle check
Maíra Canal <mcanal@igalia.com>
drm/vc4: Clear the slice caches before resetting a stalled GPU
Maíra Canal <mcanal@igalia.com>
drm/vc4: Check for a validated shader before reading its thread mode
Maíra Canal <mcanal@igalia.com>
drm/vc4: Hold a runtime PM reference while allocating the binner BO
Qiang Han <qiangh@amd.com>
drm/amdkfd: wait for the queue quiesce in concurrent SVM evictions
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdkfd: keep the DMA addresses of a range intact if splitting fails
Apurv Mishra <Apurv.Mishra@amd.com>
drm/amdkfd: Don't reuse a VRAM page that is still referenced
Perry Yuan <perry.yuan@amd.com>
drm/amdkfd: check CRIU SVM priv data bounds before allocating
David Francis <David.Francis@amd.com>
drm/amdkfd: Acquire cwsr buffer during CRIU resume
Jiaming Fan <fan.jiaming@hotmail.com>
drm/amdgpu: only unregister the ATPX handler if we registered it
David Rosca <david.rosca@amd.com>
drm/amdgpu: Fix VCE buffer size check for DPB and input surface
Andrei Krautsou <an9949an@gmail.com>
drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2
Jackie Liu <liuyun01@kylinos.cn>
drm/amd/display: Fix logger leak on perf trace allocation failure
Wang Jiang <jiangwang@kylinos.cn>
drm/amdgpu/gfx_v9_0: Add gfxoff quirk for Lenovo Picasso 318F
Joshua Horne <hornejd@etsu.edu>
drm/amd/pm: send smu8 sclk level indices, not the level mask
Jiaming Fan <fan.jiaming@hotmail.com>
drm/radeon: only unregister the ATPX handler if we registered it
Andrey Misiurov <amisiurov@cloudlinux.com>
drm/radeon: Bound GPIO I2C table entry count from VBIOS
Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
drm/nouveau: do not return early from a synchronous VM_BIND
Dave Airlie <airlied@redhat.com>
drm/nouveau/disp: Set drm_mode_config_funcs.atomic_(check|commit) (attempt 2)
Shigeaki Asai <y-asai.0816@docomonet.jp>
drm/meson: encoder_dsi: load ENCL gamma table while ENCL is disabled
Imre Deak <imre.deak@intel.com>
drm/i915/pps: Reset PPS state after TypeC port init on resume
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
drm/gud: avoid divide error in gud_stats_debugfs
Zizhi Wo <wozizhi@huawei.com>
block: fix BLKSECDISCARD zero-length range causing page cache invalidation
Sechang Lim <rhkrqnwk98@gmail.com>
bpf, sockmap: Clear the redirect target after the stream parser runs
Rosen Penev <rosenp@gmail.com>
gpio: mvebu: validate ngpios before use
Sahaj Chaudhari <sahaj123.sc@gmail.com>
gpio: davinci: use controller-specific MMIO for BINTEN
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
gpio: davinci: use generic device properties
Peter Zijlstra <peterz@infradead.org>
perf: Fix sigtrap vs fast-switch
Peter Zijlstra <peterz@infradead.org>
perf: Fix sigtrap for software events
Tengda Wu <wutengda@huaweicloud.com>
perf: Prevent duplicate sigtrap task work enqueue
Shravya KN <shravya.k-n@broadcom.com>
tg3: Fix heap overflow in unbuffered NVRAM write path
Pavan Chebbi <pavan.chebbi@broadcom.com>
tg3: Skip management FW version when APE firmware is not ready
Pavan Chebbi <pavan.chebbi@broadcom.com>
tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported
Linus Torvalds <torvalds@linux-foundation.org>
net: dpaa2-eth: fix objtool warning and logic bug
Alexei Starovoitov <ast@kernel.org>
bpf, sockmap: Hold the psock of the work in sk_psock_backlog()
Alexei Starovoitov <ast@kernel.org>
bpf: Keep the MAC header in bpf_skb_change_tail()
Alexei Starovoitov <ast@kernel.org>
bpf: Take a neighbour of the L3 master in bpf_redirect_neigh()
Alexei Starovoitov <ast@kernel.org>
bpf: Clear family and port of a short address for cgroup sockaddr hooks
Alexei Starovoitov <ast@kernel.org>
bpf: Fail loads from a network header that was not set
Alexei Starovoitov <ast@kernel.org>
bpf: Clear the data that bpf_msg_push_data() adds
Alexei Starovoitov <ast@kernel.org>
bpf: Zero bpf_list_head in copies of map values
Alexei Starovoitov <ast@kernel.org>
bpf: Require CAP_PERFMON for dumps of xlated insns
Altgelt, Max (Nextron) <max.altgelt@nextron-systems.com>
bpf: don't skip other information if xlated_prog_insns is skipped
Alexei Starovoitov <ast@kernel.org>
bpf: Give syscall programs without CAP_PERFMON the base helpers only
Alexei Starovoitov <ast@kernel.org>
bpf: Fix reads past an enum in prints of BTF data
Alexei Starovoitov <ast@kernel.org>
bpf: Fix NULL dereference in XDP redirect from async callbacks
Alexei Starovoitov <ast@kernel.org>
bpf: Do not fill jited line info for a hidden subprog
Alexei Starovoitov <ast@kernel.org>
bpf: Add the symbol of a prog before its id
Alexei Starovoitov <ast@kernel.org>
bpf: Keep the names in front of a number in delegate options
Alexei Starovoitov <ast@kernel.org>
bpf: Do not allow bpf_d_path() by an id of another BTF
Kuniyuki Iwashima <kuniyu@google.com>
tcp: Don't clear saddr before ->put_port().
Eric Dumazet <edumazet@kernel.org>
ipv6: mcast: do not pass uninitialized bytes to dev_mc_add()
Aristo Chen <aristo.chen@canonical.com>
net: dsa: felix: fix NULL pointer dereference in felix_port_enable()
Alexei Starovoitov <ast@kernel.org>
bpf: Save irq flags on the stack when freeing a list head or rb root
Kaitao Cheng <chengkaitao@kylinos.cn>
bpf: clear list node owner and unlink before drop
Antonio Quartulli <antonio@mandelbit.com>
tun: bound the NAPI receive queue
Jiayuan Chen <jiayuan.chen@linux.dev>
ipv4: fix conntrack defrag forwarding after ip_frag_reinit()
Nicolai Buchwitz <nb@tipi-net.de>
net: systemport: accumulate the DIM packet and byte counters
Nicolai Buchwitz <nb@tipi-net.de>
net: systemport: restart DIM from the default profile on start
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: reset the Rx discard count with the ring
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: accumulate the DIM packet and byte counters
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: keep DIM from getting stuck after close or suspend
Zak Kemble <zakkemble@gmail.com>
net: bcmgenet: use napi_complete_done return value
Wang Haoran <wanghr2026@mail.zgclab.edu.cn>
net: bcmasp: avoid refcount drain on probe
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: fix mirror destination and source state tracking
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: use the correct override register 2 Gbps bit
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: fix the SRAB grant timeout check
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: b53: initialize the jumbo frame size register offset
Saurabh Sengar <ssengar@linux.microsoft.com>
workqueue: Skip redundant unbound updates during CPU bringup
Andrea Parri <parri.andrea@gmail.com>
ftrace: Fix lost recursion records in ftrace_record_recursion()
Patrick Delaunay <patrick.delaunay@foss.st.com>
arm64: dts: st: mark STM32MP23 timer as stopping in suspend
Patrick Delaunay <patrick.delaunay@foss.st.com>
arm64: dts: st: add PSCI idle state to STM32MP23 CPU domains
Patrick Delaunay <patrick.delaunay@foss.st.com>
arm64: dts: st: add PSCI idle state to STM32MP25 CPU domains
Shihuang Liu <shlomojune6@gmail.com>
net: sock_reuseport: Check program type on the migration path
Alexei Starovoitov <ast@kernel.org>
bpf: Let the bpf_fastcall boundary cover the longest pattern
Christian Göttsche <cgzones@googlemail.com>
jbd2: set JBD2_LOADED under j_state_lock
Filipe Manana <fdmanana@suse.com>
btrfs: fix delayed inode count leak after failure to delete inode ref
Filipe Manana <fdmanana@suse.com>
btrfs: unfold transaction abort at __btrfs_update_delayed_inode()
Filipe Manana <fdmanana@suse.com>
btrfs: abort transaction on failure to update inode after hole punching
Filipe Manana <fdmanana@suse.com>
btrfs: fiemap: deal with inline extent in fiemap_find_last_extent_offset()
Arnav Kapoor <kapoorarnav43@gmail.com>
ASoC: SOF: control: reject out-of-range enum values
Filipe Manana <fdmanana@suse.com>
btrfs: fix race between concurrent sync direct IO writes
Boris Burkov <boris@bur.io>
btrfs: downgrade the reflink source inode lock for tree walking
Boris Burkov <boris@bur.io>
btrfs: pre-flush reflink source before taking inode locks
David Sterba <dsterba@suse.com>
btrfs: use struct btrfs_inode inside btrfs_remap_file_range_prep()
David Sterba <dsterba@suse.com>
btrfs: use struct btrfs_inode inside btrfs_remap_file_range()
David Sterba <dsterba@suse.com>
btrfs: pass struct btrfs_inode to btrfs_double_mmap_unlock()
David Sterba <dsterba@suse.com>
btrfs: pass struct btrfs_inode to btrfs_double_mmap_lock()
Cheng Yongkang <teel4res@gmail.com>
btrfs: remove devid kobject when deleting a missing device
Stefan Ghetu <stefan.ghetu@nxp.com>
ASoC: fsl_easrc: fix context ownership on repeated hw_params
Stefan Ghetu <stefan.ghetu@nxp.com>
ASoC: fsl_asrc: fix pair ownership on repeated or failed hw_params
Binbin Deng <18983559317@163.com>
btrfs: wait for a grace period before freeing a new device
Filipe Manana <fdmanana@suse.com>
btrfs: send: fix invalid access to inline extents in clone_range()
Filipe Manana <fdmanana@suse.com>
btrfs: send: fix missing hole punching during incremental send
Eric Dumazet <edumazet@kernel.org>
tun: flush uc and mc addresses in TUNSETLINK
Randy Dunlap <rdunlap@infradead.org>
chardev: GPIO common access methods: repair non-kernel-doc comment
Anastasia Eskova <anastasia.eskova@ibm.com>
s390/cert_store: Only allow the kernel to create cert_store_key keys
Anastasia Eskova <anastasia.eskova@ibm.com>
s390/cert_store: Allocate keyring with link restriction
Zhu Jun <zhujun2@cmss.chinamobile.com>
tools: gpio: Return success after monitoring requested events
Zhu Jun <zhujun2@cmss.chinamobile.com>
tools: gpio: Preserve device listing errors in lsgpio
Zhu Jun <zhujun2@cmss.chinamobile.com>
tools: gpio-hammer: Accept the maximum number of line offsets
Antonio Quartulli <antonio@mandelbit.com>
tun: complete the zerocopy buffer of packets consumed by XDP
Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
tools/bootconfig: Use the registered global tracing parameter names
Kai Vehmanen <kai.vehmanen@linux.intel.com>
ALSA: hda: intel: Release i915 power also when delayed probe fails
Petr Oros <poros@redhat.com>
ice: allow reading the last byte of the NVM and Shadow RAM regions
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
ice: use global queue index in TC to-queue offload
Uri Dar <udar@nvidia.com>
net/mlx5: E-Switch, skip vport change work for disabled vports
Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
net: do not run out of frags in alloc_skb_with_frags()
Han Gao <gaohan@iscas.ac.cn>
riscv: efi: Map runtime MMIO with device attributes
Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
net: qrtr: ns: keep notifying local servers after a failed send
Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
scsi: ufs-mediatek: Restore the M-PHY power state when va09 disable fails
Yevgeny Kliteynik <kliteyn@nvidia.com>
net/mlx5: DR, Fix out-of-bounds write when sync to HW fails
Eric Dumazet <edumazet@kernel.org>
net: clear skb->mac_len in skb_unset_mac_header()
Gal Pressman <gal@nvidia.com>
net/mlx5e: Release FIB event work flows before dropping RTNL
Imre Kaloz <kaloz@kernel.org>
net: marvell: prestera: disable port before changing its MAC mode
Jiayuan Chen <jiayuan.chen@linux.dev>
ipv6, calipso: fix data-race in calipso_cache_add() bucketsize check
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Fix potential ABBA deadlock at snd_pcm_action_nonatomic()
Thomas de Gruijter <thomasdegruijter@pm.me>
Bluetooth: MSFT: Only enable the advertisement filter with monitors
Thomas de Gruijter <thomasdegruijter@pm.me>
Bluetooth: MSFT: Record the filter state on Command Disallowed
Jiale Yao <yaojiale02@163.com>
usb: cdns3: report endpoint reset timeout
Sang-Hoon Choi <csh0052@gmail.com>
HID: nintendo: release the player ID when LED setup fails
Eren Çakar <hey@erencakar.com>
HID: letsketch: skip string descriptors the firmware does not implement
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor-hub: Remove clients before stopping hardware
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Register enable attribute after misc device
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Serialize misc device reads
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Fix state lifetime during removal
Shunbo Shi <shishunbo@cmss.chinamobile.com>
usb: gadget: f_hid: fix get_req leak when usb_gstrings_attach() fails
Shunbo Shi <shishunbo@cmss.chinamobile.com>
usb: gadget: f_hid: fix race between userspace report update and GET_REPORT response
Shunbo Shi <shishunbo@cmss.chinamobile.com>
usb: gadget: f_hid: fix report_list entries leak
Koichiro Den <den@valinux.co.jp>
dmaengine: rcar-dmac: Add missing dma_descriptor_unmap()
Zhang Shurong <zhang_shurong@foxmail.com>
dmaengine: rcar-dmac: Fix PM usage counter imbalance
SeungUk Nam <tmddnr49449@gmail.com>
dmaengine: idxd: Free the minor number when cdev setup fails
Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend
Terrence Adams <tadamsjr@google.com>
scsi: pm8001: Offset hardware queue index for MSI-X pre-vector
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: order the TX ring index accesses
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: publish the buffer address before OWN
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: unmap RX buffers on stop with their mapped size
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: unmap the buffer of a dropped RX frame
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: release the TX ring on stop
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: drop a TX frame whose DMA mapping failed
Kordian Chmielewski <kudzo51@gmail.com>
net: bcm4908_enet: fix the TX ring wrap
Artemii Mashanov <ralerrdirsardx@gmail.com>
cxgb4: allocate the full ethtool filter location array
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Disable sensor before hub close on removal
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor: custom: Set owner for misc device
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
HID: sensor-hub: Synchronize callback removal with raw events
Myeonghun Pak <mhun512@gmail.com>
HID: magicmouse: disable the multitouch work on removal
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Don't fail removing a monitor unknown to the controller
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MSFT: Free the response of the monitor commands
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Hold hdev->lock when removing advertisement monitors
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MSFT: Protect the event prefix with hdev->lock
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MGMT: Fix use-after-free in mgmt_powering_down()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: mgmt: Fix mesh transmission locking and lifetime
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: L2CAP: Don't use uninitialized EFS in l2cap_parse_conf_rsp()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: mgmt: Reject zero multi advertising rotation duration
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Initialize ism array in query_diag320_subcodes()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix out-of-bounds read in pr_dbf_vce()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix max_vcxe_length output in pr_dbf_vcssb()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Validate hash length in check_certificate_valid()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Do not search the process keyrings for the cert_store keyring
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix keyring refcount handling in get_user_session_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix error handling of get_user_session_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Remove unnecessary static specifier in create_cs_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix potential use-after-free caused by find_cs_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Fix cs_keyring reference leak in fill_cs_keyring()
Heiko Carstens <hca@linux.ibm.com>
s390/cert_store: Check key_lookup() return code in invalidate_keyring_keys()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_event: Validate sent command length in LE Set Ext Adv Enable
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: SMP: Don't create the BR/EDR channel while unregistered
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: SMP: Check smp_data before using SMP_DEV()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: SMP: Serialize link key updates from smp_notify_keys()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_event: Fix not using key encryption size when its known
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_sync: Hold hdev->lock in hci_schedule_adv_instance_sync()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_sync: Lock the lookup in hci_disable_ext_adv_instance_sync()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Take req_sync lock in hci_power_on()
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: mgmt: Fix read_index_list() buffer overflow
Shawn Lin <shawn.lin@rock-chips.com>
phy: rockchip: snps-pcie3: Raise the SRAM init timeout
Changyul Lee <lcy8047@gmail.com>
scsi: ch: Remove the minor from ch_index_idr after device_destroy()
Kyle Mahlkuch <kmahlkuc@linux.ibm.com>
scsi: lpfc: Fix race conditions in ELS retry handling
Michail Andreas Michalopoulos <mike.michalo@gmail.com>
ksmbd: sign the last response of a compound that ends early
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti-pipe3: Fix clock leaks in init/exit error paths
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti-pipe3: Fix EPROBE_DEFER handling for clock resources
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti: pipe3: Fix clock resource leak on probe errors
Hongling Zeng <zenghongling@kylinos.cn>
phy: ti-pipe3: Fix ignored clock enable return value in init
Felix Gu <ustc.gu@gmail.com>
phy: ingenic: fix unbalanced regulator disable in exit
Sasha Levin <sashal@kernel.org>
selftests: drivers/s390x: Select uvdevice tests using the target architecture
Bart Van Assche <bvanassche@acm.org>
drm/msm: Fix a lock leak in msm_ioctl_gem_info_set_metadata()
Colton Lewis <coltonlewis@google.com>
irqchip/gic-v4: Use a separate lockdep class for vPE doorbell IRQs
Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
reset: scmi: Set the device for the reset controller
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v4: Unwind what its_alloc_vcpu_irqs() allocated on failure
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v4: Clear the domain and fwnode pointers after freeing them
Selby Mashiki <mashikiselby@gmail.com>
memory: tegra: fix device_node leak in tegra186_mc_probe_device()
Myeonghun Pak <mhun512@gmail.com>
memory: tegra: Shut down Tegra210 EMC timers before teardown
Oleg Keri <okerixx@gmail.com>
soundwire: qcom: disable the interrupt before gating the clock
Sudeep Holla <sudeep.holla@kernel.org>
firmware: arm_scmi: Unregister notifier on enable failure
Sudeep Holla <sudeep.holla@kernel.org>
firmware: arm_scmi: imx: Validate MISC control response size
Zhengping Jiang <jiangzp@google.com>
HID: vivaldi: avoid redundant feature report reads per usage
Shashikirana H K <shashikiranah@chromium.org>
HID: vivaldi: Extract feature report value directly in vivaldi_feature_mapping()
Julian Braha <julianbraha@gmail.com>
firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n
Geert Uytterhoeven <geert+renesas@glider.be>
firmware: arm_scmi: Update ARM_SCMI_HAVE_TRANSPORT rationale
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Revert "wifi: ath10k: Stop unanswered temperature reads"
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: do not compute period estimation when updating odr
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: fix estimated value larger than interrupt timestamp
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: prevent timestamps going back in time in transitions
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: improve period measurement by using a longer delay
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: better timestamp alignment when using watermark
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
iio: inv_sensors: convert to kernel types
Shi Hao <i.shihao.999@gmail.com>
iio: common: fix spelling mistakes in comments
Karan Sanghavi <karansanghvi98@gmail.com>
iio: invensense: Prevent possible integer overflow while multiplication
Jocelyn Falempe <jfalempe@redhat.com>
drm/ast: Handle framebuffer from dma-buf
Moksh Panicker <mokshpanicker.7@gmail.com>
iio: light: apds9306: fix PM reference leak in apds9306_read_data()
Julian Anastasov <ja@ssi.bg>
ipvs: honor the overload state and do not enter it forever
Julian Anastasov <ja@ssi.bg>
ipvs: read flags and seqs in master atomically
Myeonghun Pak <mhun512@gmail.com>
iio: proximity: hx9023s: Allocate trigger before requesting IRQ
Christopher Hoover <ch@murgatroid.com>
iio: humidity: hid-sensor-humidity: Use per-instance callbacks
Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
devres: Add devm_is_action_added() helper
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
devres: Move devm_*_action*() APIs to devres.h
Danilo Krummrich <dakr@kernel.org>
devres: add devm_remove_action_nowarn()
Josef Bacik <josef@toxicpanda.com>
w1: w1_therm: lock the list of slaves for the bulk read
Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths
Sean Anderson <sean.anderson@linux.dev>
usb: dwc3: Always deassert xilinx resets
Ihor Urazov <z0rc3r@gmail.com>
usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14
Josef Bacik <josef@toxicpanda.com>
serial: core: respect runtime PM when sending x_char
Paulo Alcantara <pc@manguebit.org>
smb: client: don't fail writeback preparation if the task is dying
Paulo Alcantara <pc@manguebit.org>
smb: client: don't write back through O_DIRECT handles
Joseph Qi <joseph.qi@linux.alibaba.com>
smb: client: hold server ref while queueing reconnect work
Daejun Park <daejun7.park@samsung.com>
ovl: bump the impure dir version when linking a file with origin
Amir Goldstein <amir73il@gmail.com>
ovl: fix leak of lowerdata redirect on ovl_get_inode() failure
Amir Goldstein <amir73il@gmail.com>
ovl: do not read the flags of a put upper dentry in lookup
Christian Brauner <brauner@kernel.org>
ovl: refactor ovl_lookup()
Miklos Szeredi <mszeredi@redhat.com>
ovl: make redirect/metacopy rejection consistent
Vinicius Costa Gomes <vinicius.gomes@intel.com>
ovl: use wrapper ovl_revert_creds()
Takashi Iwai <tiwai@suse.de>
Revert "ALSA: hda/realtek: Fix silent speaker on Higole F9B"
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: PM: Avoid initializing power management for absent devices
Christopher Hoover <ch@murgatroid.com>
iio: temperature: hid-sensor-temperature: Use per-instance callbacks
Josef Bacik <josef@toxicpanda.com>
iio: adc: ad7923: add the AD7927 to the SPI ID table
Daejun Park <daejun7.park@samsung.com>
dm: fail a REQ_PREFLUSH bio with data when its preflush fails
Ming-Hung Tsai <mtsai@redhat.com>
dm: fix use-after-free when dm_get_device() widens the open mode
Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
dm cache: validate the discard block size before narrowing
liuyong <pkfxxxing@gmail.com>
smb: client: validate descriptor headers before query result allocation
Dan Carpenter <dan.carpenter@linaro.org>
smb/client: Prevent error pointer dereference
Sasha Levin <sashal@kernel.org>
selftests: net: reuseport_bpf_numa: include stdbool.h
Sasha Levin <sashal@kernel.org>
Revert "mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback"
Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Bluetooth: l2cap: defer conn param update to avoid conn->lock/hdev->lock inversion
Tejun Heo <tj@kernel.org>
sched_ext: Fix ops.enqueue/dispatch() calls before ops.cpu_online()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: Fix updates of cached resolved frequency and index
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: Avoid redundant target() calls for unchanged limits
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: Introduce policy->boost_supported flag
Eric Dumazet <edumazet@google.com>
vsock: do not leave dangling sk pointer in vsock_create()
Zihan Xi <zihanx@nebusec.ai>
netfilter: nf_dup: preserve guard across NFQUEUE reinjection
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
netfilter: nf_dup{4, 6}: Move duplication check to task_struct
Kuniyuki Iwashima <kuniyu@amazon.com>
socket: Print pf->create() when it does not clear sock->sk on failure.
Ignat Korchagin <ignat@cloudflare.com>
net: warn, if pf->create does not clear sock->sk on error
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Switch ftrace ops when adding probe with post_handler
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Use guard() for external locks
Masami Hiramatsu (Google) <mhiramat@kernel.org>
jump_label: Define guard() for jump_label_lock
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
kprobes: Reduce preempt disable scope in check_kprobe_access_safe()
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Validate re-registration earlier in register_kretprobe()
Zhao Li <enderaoelyther@gmail.com>
Bluetooth: L2CAP: Only accept LE responses to outstanding requests
Vlastimil Babka (SUSE) <vbabka@kernel.org>
mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: don't undo another isolation in alloc_contig_range
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt
Gregory Price <gourry@gourry.net>
page_alloc: allow migration of smaller hugepages during contig_alloc
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Fix error return and slot leak in __register_kprobe()
Gregory Price (Meta) <gourry@gourry.net>
mm/hugetlb: retry the pool walk when the zonelist is rebuilt
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: retry allocations that raced with a zonelist rebuild
Gregory Price (Meta) <gourry@gourry.net>
mm/mmzone: read each zoneref slot once when filtering by nodemask
Wentao Liang <vulab@iscas.ac.cn>
gpio: keep the chip reference when deferred setup fails
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask()
Rosen Penev <rosenp@gmail.com>
gpio: mvebu: name regmaps to fix debugfs collisions
Zhao Li <enderaoelyther@gmail.com>
wifi: mac80211_hwsim: ignore non-generic netlink releases
Ian Bridges <icb@fastmail.org>
ksmbd: skip metadata-only opens in sharing checks
Seiji Nishikawa <snishika@redhat.com>
sched/core: Do not touch SMT siblings that have not joined the core yet
Stefan Haberland <sth@linux.ibm.com>
s390/dasd: Re-initialize RCD buffer with "V1.0" before every start
Stefan Haberland <sth@linux.ibm.com>
s390/dasd: Fix typo 'immediatly' -> 'immediately'
Anton Lundin <glance@ac2.se>
hwmon: (nct6775) Handle dual use registers
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
watchdog: rzv2h: Use pm_runtime_put_sync()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
watchdog: rz: Discard pm_runtime_put() return values
Tim Menninger <tmenninger@everpuredata.com>
pNFS: avoid repeatedly cancelling I/O for the same lseg
Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
arm64: suspend: Only track cpuidle context for idle tasks
Ada Couprie Diaz <ada.coupriediaz@arm.com>
arm64: suspend: rely on daif helpers to handle PMR
Waiman Long <longman@redhat.com>
cgroup/cpuset: Correctly set isolated_cpus when switching partition state
Yingjie Wang <x-professor@outlook.com>
tcp: free saved_syn after an RCU grace period
Eric Dumazet <edumazet@google.com>
tcp: move __reqsk_free() out of line
Yuansheng Yang <0xbeac@gmail.com>
KEYS: Protect pkey method checks against type removal
Mohammed EL Kadiri <med08elkadiri@gmail.com>
keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP
Jarkko Sakkinen <jarkko@kernel.org>
KEYS: Expand key->{datalen,quotalen} to unsigned int
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: proximity: sx9360: fix sampling frequency write and available range
Kuniyuki Iwashima <kuniyu@google.com>
ipv6: Remove IPV6_ADDRFORM.
Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
tools/bootconfig: Close only opened braces in compact output
YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Bluetooth: btusb: fix use-after-free in force_poll_sync
Ian Abbott <abbotti@mev.co.uk>
comedi: comedi_bond: Fix leak of opened device references
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write
Wahid Khan <wahidzk0091@gmail.com>
ksmbd: refuse to read a handle that is not open for reading
Jiwoo Kim <arpe1618@gmail.com>
ksmbd: pin parent dentries in SMB2 CREATE ACL path
Eric Dumazet <edumazet@kernel.org>
net: wait for in-flight device unregistrations before netns dismantle
Pin-yen Lin <treapking@google.com>
gve: Block invalid ring sizes when device options are 0
Pin-yen Lin <treapking@google.com>
gve: Fix race between stats query and queue reconfig
Tim Menninger <tmenninger@everpuredata.com>
xprtrdma: serialize unmap_sync with xprt_disconnect
JP Kobryn <jp.kobryn@linux.dev>
mm/page_alloc: use existing highatomic reserves on the buddy fastpath
Frank van der Linden <fvdl@google.com>
mm/page_alloc: don't increase highatomic reserve after pcp alloc
Leon Hwang <leon.hwang@linux.dev>
bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn
Leon Hwang <leon.hwang@linux.dev>
bpf: Disallow interpreter fallback for arena-related insns
Tiezhu Yang <yangtiezhu@loongson.cn>
bpf: Reject programs with inlined helpers if JIT is not available
Tiezhu Yang <yangtiezhu@loongson.cn>
bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call()
Karl Mehltretter <kmehltretter@gmail.com>
mtd: core: avoid double-free of OTP NVMEM device
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: hci_core: Fix not checking skb length on hci_scodata_packet
Cosmin Ratiu <cratiu@nvidia.com>
xfrm: Don't clobber inner headers when already set
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Fix missing BTF kind checks in char pointer/array helpers
Masami Hiramatsu (Google) <mhiramat@kernel.org>
tracing/probes: Enable newly appended probe when target event is enabled
Zhao Feng <zhaofeng2@cmss.chinamobile.com>
watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog
Chen Ni <nichen@iscas.ac.cn>
watchdog: npcm: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
Vishwaroop A <va@nvidia.com>
spi: tegra210-quad: Track DMA mapping state
Hyunjung Ko <hj351016@gmail.com>
tpm: flush timeout work outside buffer_mutex to avoid deadlock
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: Improve suspend-resume synchronization
Rongzheng Wang <testwrzwrz@gmail.com>
xsk: defer software checksum until the skb is complete
Shashank Mohan Jain <jain.sm@gmail.com>
errseq: don't let errseq_check_and_advance() hide later errors
Zijun Hu <quic_zijuhu@quicinc.com>
errseq: eliminate special limitation for macro MAX_ERRNO
Anfernee Cao <anferneemelokc5@gmail.com>
mmc: sunxi: fix clock and runtime PM leaks on probe failure
Binbin Zhou <zhoubinbin@loongson.cn>
mmc: sunxi: Use devm_mmc_alloc_host() helper
Runyu Xiao <runyu.xiao@seu.edu.cn>
mmc: omap: synchronize clock timer before disabling fclk
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Adopt guard() and scoped_guard()
Andrew Davison <andy@dvsn.net>
ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set
Olivier Louvignes <olivier@mgcrea.io>
mmc: jz4740: Remove the host before resetting the controller
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: imu: inv_mpu6050: fix swapped accel and gyro startup times
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: proximity: sx9500: ignore event config writes that don't change state
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: common: scmi_sensors: fix truncating 64-bit divisions
Mark Bundschuh <mkbund@amazon.com>
dm: fix infinite loop in dm_blk_do_report_zones()
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: fix use-after-free on TTLM disconnect
Eric Dumazet <edumazet@kernel.org>
net: gro: invalidate frag0 after a pull
Hyunwoo Kim <imv4bel@gmail.com>
tcp: fix request_sock use-after-free during Fast Open accept()
Jeremy Harris <jgh@exim.org>
tcp: fastopen: note that a child socket was created
Hyunwoo Kim <imv4bel@gmail.com>
tcp: do not coalesce segments after FIN
Breno Leitao <leitao@debian.org>
net/mlx5e: Fix queue stats access to queues without stats
Mahanta Jambigi <mjambigi@linux.ibm.com>
net/smc: fix link group ownership in handshake abort
Chen Linxuan <me@black-desk.cn>
pidfd: restrict task access ioctls to the caller's pid namespace
Gregory Price (Meta) <gourry@gourry.net>
mm/page_alloc: snapshot the preferred zone against shrink rebuilds
Denis V. Lunev <den@openvz.org>
virtio_balloon: quiesce balloon work before device shutdown
Denis V. Lunev <den@openvz.org>
virtio_balloon: factor out virtballoon_quiesce()
Denis V. Lunev <den@openvz.org>
virtio: add virtio_device_shutdown() helper
Michael S. Tsirkin <mst@redhat.com>
virtgpu: don't reset on shutdown
Yuya Kusakabe <yuya.kusakabe@gmail.com>
net: ipv6: keep room for the mac header in dst_dev_overhead()
-------------
Diffstat:
Documentation/trace/boottime-trace.rst | 8 +-
Makefile | 4 +-
arch/arc/include/asm/io.h | 13 +-
arch/arm64/boot/dts/st/stm32mp231.dtsi | 16 +-
arch/arm64/boot/dts/st/stm32mp233.dtsi | 1 +
arch/arm64/boot/dts/st/stm32mp251.dtsi | 14 +
arch/arm64/boot/dts/st/stm32mp253.dtsi | 1 +
arch/arm64/include/asm/kexec.h | 2 +
arch/arm64/kernel/machine_kexec.c | 7 +-
arch/arm64/kernel/relocate_kernel.S | 11 +-
arch/arm64/kernel/suspend.c | 23 +-
arch/arm64/kernel/vmlinux.lds.S | 5 +-
arch/parisc/kernel/entry.S | 4 -
arch/parisc/kernel/ftrace.c | 2 +-
arch/parisc/kernel/irq.c | 4 +-
arch/powerpc/include/asm/hw_irq.h | 2 +-
arch/powerpc/kernel/eeh.c | 6 +-
arch/powerpc/kernel/module_32.c | 3 +
arch/powerpc/kvm/book3s_64_mmu_hv.c | 33 +-
arch/powerpc/kvm/book3s_hv.c | 4 +-
arch/powerpc/kvm/book3s_hv_nested.c | 34 +-
arch/powerpc/kvm/book3s_xive.c | 5 +-
arch/powerpc/xmon/xmon.c | 3 +-
arch/riscv/kernel/efi.c | 2 +-
arch/riscv/kernel/entry.S | 6 +-
arch/s390/appldata/appldata_base.c | 12 +-
arch/s390/kernel/cert_store.c | 108 ++--
arch/x86/kernel/apic/msi.c | 2 +-
arch/x86/kernel/cpu/mce/core.c | 18 +-
block/blk-iocost.c | 3 +-
block/blk-settings.c | 2 +-
block/blk-sysfs.c | 19 +-
block/ioctl.c | 13 +-
drivers/acpi/device_pm.c | 23 +-
drivers/acpi/glue.c | 8 +-
drivers/ata/libata-scsi.c | 2 +-
drivers/base/devres.c | 50 +-
drivers/bluetooth/btusb.c | 10 +-
drivers/bluetooth/hci_qca.c | 1 +
drivers/char/tpm/tpm-dev-common.c | 12 +-
drivers/comedi/drivers/comedi_bond.c | 24 +-
drivers/cpufreq/cppc_cpufreq.c | 14 +-
drivers/cpufreq/cpufreq.c | 147 ++++--
drivers/cpufreq/freq_table.c | 4 +
drivers/cpufreq/intel_pstate.c | 26 +-
drivers/crypto/nx/nx.c | 2 +-
drivers/dma/idxd/cdev.c | 1 +
drivers/dma/sh/rcar-dmac.c | 4 +-
drivers/dma/stm32/stm32-mdma.c | 1 +
drivers/edac/i5000_edac.c | 4 +-
drivers/firmware/arm_scmi/notify.c | 4 +-
drivers/firmware/arm_scmi/transports/Kconfig | 2 +-
.../firmware/arm_scmi/vendors/imx/imx-sm-misc.c | 16 +-
drivers/gpio/gpio-davinci.c | 12 +-
drivers/gpio/gpio-ljca.c | 11 +-
drivers/gpio/gpio-mvebu.c | 24 +-
drivers/gpio/gpio-virtio.c | 13 +-
drivers/gpio/gpiolib.c | 53 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 13 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 33 +-
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 +-
drivers/gpu/drm/amd/amdgpu/soc21.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 20 +-
drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 5 +
.../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 32 ++
drivers/gpu/drm/amd/amdkfd/kfd_queue.c | 4 +-
drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 65 ++-
drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +
.../drm/amd/display/modules/freesync/freesync.c | 12 +-
.../gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 14 +-
drivers/gpu/drm/ast/ast_mode.c | 11 +-
drivers/gpu/drm/gud/gud_drv.c | 13 +-
drivers/gpu/drm/i915/display/intel_ddi.c | 4 +-
drivers/gpu/drm/i915/i915_vma.c | 2 +-
drivers/gpu/drm/i915/i915_vma_types.h | 3 +
drivers/gpu/drm/imagination/pvr_queue.c | 3 +-
drivers/gpu/drm/meson/meson_encoder_dsi.c | 2 +-
drivers/gpu/drm/msm/msm_drv.c | 3 +-
drivers/gpu/drm/nouveau/nouveau_display.c | 11 +-
drivers/gpu/drm/nouveau/nouveau_sched.c | 6 +-
drivers/gpu/drm/radeon/radeon_atombios.c | 22 +-
drivers/gpu/drm/radeon/radeon_atpx_handler.c | 13 +-
drivers/gpu/drm/vc4/vc4_bo.c | 43 +-
drivers/gpu/drm/vc4/vc4_drv.h | 15 +-
drivers/gpu/drm/vc4/vc4_gem.c | 20 +-
drivers/gpu/drm/vc4/vc4_v3d.c | 7 +-
drivers/gpu/drm/vc4/vc4_validate.c | 15 +-
drivers/gpu/drm/vc4/vc4_validate_shaders.c | 7 +-
drivers/gpu/drm/virtio/virtgpu_drv.c | 9 +
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 3 +
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 200 ++++++++
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 11 +-
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 55 ++-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 5 +-
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 21 +-
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 1 +
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 28 +-
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 13 +-
drivers/hid/hid-letsketch.c | 21 +-
drivers/hid/hid-magicmouse.c | 2 +-
drivers/hid/hid-nintendo.c | 2 +-
drivers/hid/hid-sensor-custom.c | 125 +++--
drivers/hid/hid-sensor-hub.c | 27 +-
drivers/hid/hid-vivaldi-common.c | 91 ++--
drivers/hwmon/ads7871.c | 4 +-
drivers/hwmon/dell-smm-hwmon.c | 9 +
drivers/hwmon/nct6775-core.c | 16 +-
drivers/hwmon/sht3x.c | 4 +-
drivers/hwmon/w83791d.c | 4 +-
drivers/hwmon/w83792d.c | 4 +-
drivers/iio/adc/ad7923.c | 1 +
.../iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 +-
.../iio/common/hid-sensors/hid-sensor-attributes.c | 2 +-
.../iio/common/inv_sensors/inv_sensors_timestamp.c | 134 +++--
drivers/iio/common/ms_sensors/ms_sensors_i2c.c | 2 +-
drivers/iio/common/scmi_sensors/scmi_iio.c | 27 +-
drivers/iio/humidity/hid-sensor-humidity.c | 14 +-
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 80 ++-
drivers/iio/light/apds9306.c | 19 +-
drivers/iio/proximity/hx9023s.c | 16 +-
drivers/iio/proximity/sx9360.c | 29 +-
drivers/iio/proximity/sx9500.c | 6 +
drivers/iio/temperature/hid-sensor-temperature.c | 14 +-
drivers/infiniband/hw/mlx5/devx.c | 6 +-
drivers/infiniband/hw/mlx5/main.c | 3 +-
drivers/infiniband/sw/siw/siw.h | 1 +
drivers/infiniband/sw/siw/siw_mem.c | 2 +-
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 8 +-
drivers/infiniband/ulp/srpt/ib_srpt.c | 21 +-
drivers/infiniband/ulp/srpt/ib_srpt.h | 4 +-
drivers/input/joystick/xpad.c | 1 +
drivers/input/misc/da7280.c | 1 -
drivers/input/mouse/cyapa.c | 4 +-
drivers/input/mouse/trackpoint.c | 2 +
drivers/input/mouse/trackpoint.h | 1 +
drivers/input/touchscreen/goodix_fwupload.c | 4 +-
drivers/irqchip/irq-gic-v4.c | 39 +-
drivers/md/dm-cache-target.c | 14 +-
drivers/md/dm-ioctl.c | 2 +-
drivers/md/dm-table.c | 146 +++---
drivers/md/dm-zone.c | 2 +
drivers/md/dm.c | 6 +-
drivers/md/dm.h | 18 +-
drivers/memory/tegra/tegra186.c | 1 +
drivers/memory/tegra/tegra210-emc-core.c | 16 +-
drivers/mmc/host/jz4740_mmc.c | 5 +-
drivers/mmc/host/omap.c | 4 +-
drivers/mmc/host/sunxi-mmc.c | 36 +-
drivers/mtd/mtdcore.c | 1 +
drivers/net/dsa/b53/b53_common.c | 205 ++++++--
drivers/net/dsa/b53/b53_priv.h | 4 +
drivers/net/dsa/b53/b53_regs.h | 1 +
drivers/net/dsa/b53/b53_srab.c | 2 +-
drivers/net/dsa/bcm_sf2.c | 4 +
drivers/net/dsa/ocelot/felix.c | 13 +-
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 2 +-
drivers/net/ethernet/broadcom/bcm4908_enet.c | 143 ++++--
drivers/net/ethernet/broadcom/bcmsysport.c | 20 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 21 +-
drivers/net/ethernet/broadcom/tg3.c | 43 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 4 +-
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 28 +-
drivers/net/ethernet/freescale/gianfar.c | 1 +
drivers/net/ethernet/google/gve/gve.h | 5 +
drivers/net/ethernet/google/gve/gve_adminq.c | 4 +-
drivers/net/ethernet/google/gve/gve_main.c | 22 +-
drivers/net/ethernet/intel/e1000/e1000_main.c | 3 +-
drivers/net/ethernet/intel/iavf/iavf_adminq.c | 1 +
drivers/net/ethernet/intel/ice/devlink/devlink.c | 2 +-
drivers/net/ethernet/intel/ice/ice_tc_lib.c | 3 +-
.../net/ethernet/marvell/prestera/prestera_main.c | 17 +-
.../ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +-
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 3 +-
.../mellanox/mlx5/core/steering/dr_icm_pool.c | 32 +-
drivers/net/ethernet/microchip/encx24j600.c | 3 +-
drivers/net/ethernet/qualcomm/qca_spi.c | 4 +-
.../net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 8 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 +-
drivers/net/hamradio/mkiss.c | 8 +
drivers/net/tun.c | 70 ++-
drivers/net/usb/smsc75xx.c | 8 +
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/realtek/rtw89/core.c | 12 -
drivers/net/wireless/virtual/mac80211_hwsim.c | 2 +-
drivers/nvme/common/auth.c | 6 +-
drivers/nvme/host/core.c | 9 +
drivers/nvme/host/multipath.c | 7 +
drivers/nvme/host/sysfs.c | 3 +
drivers/nvme/host/tcp.c | 172 +++++--
drivers/nvme/target/fc.c | 13 +-
drivers/nvme/target/io-cmd-file.c | 47 +-
drivers/nvme/target/loop.c | 1 +
drivers/nvme/target/tcp.c | 42 +-
drivers/nvme/target/zns.c | 3 +-
drivers/phy/ingenic/phy-ingenic-usb.c | 1 -
drivers/phy/rockchip/phy-rockchip-snps-pcie3.c | 9 +-
drivers/phy/ti/phy-ti-pipe3.c | 63 ++-
drivers/reset/reset-scmi.c | 1 +
drivers/s390/block/dasd.c | 5 +-
drivers/s390/block/dasd_alias.c | 2 +-
drivers/s390/block/dasd_eckd.c | 66 +--
drivers/s390/block/dasd_int.h | 17 +-
drivers/s390/block/dcssblk.c | 3 +-
drivers/scsi/ch.c | 6 +-
drivers/scsi/device_handler/scsi_dh_rdac.c | 6 +-
drivers/scsi/lpfc/lpfc_els.c | 29 +-
drivers/scsi/lpfc/lpfc_hbadisc.c | 11 +-
drivers/scsi/mpi3mr/mpi3mr.h | 1 +
drivers/scsi/mpi3mr/mpi3mr_fw.c | 18 +
drivers/scsi/pm8001/pm8001_defs.h | 1 +
drivers/scsi/pm8001/pm8001_init.c | 15 +-
drivers/scsi/pm8001/pm80xx_hwi.c | 13 +-
drivers/scsi/sd_zbc.c | 9 +-
drivers/soundwire/qcom.c | 2 +
drivers/spi/spi-tegra210-quad.c | 31 +-
drivers/spi/spi.c | 4 -
drivers/target/iscsi/iscsi_target.c | 22 +-
drivers/target/iscsi/iscsi_target_nego.c | 6 +-
drivers/target/target_core_alua.c | 7 +
drivers/target/target_core_configfs.c | 16 +-
drivers/tty/serial/serial_core.c | 25 +-
drivers/tty/serial/serial_port.c | 4 +-
drivers/ufs/core/ufs_bsg.c | 4 +-
drivers/ufs/core/ufshcd-priv.h | 5 +
drivers/ufs/core/ufshcd.c | 7 +-
drivers/ufs/host/ufs-mediatek.c | 10 +
drivers/usb/cdns3/cdns3-gadget.c | 6 +-
drivers/usb/dwc3/dwc3-xilinx.c | 166 ++++---
drivers/usb/gadget/function/f_hid.c | 41 +-
drivers/usb/gadget/function/f_uac1_legacy.c | 8 +-
drivers/usb/gadget/function/u_uac1_legacy.c | 17 +-
drivers/usb/typec/ucsi/ucsi.h | 1 +
drivers/usb/typec/ucsi/ucsi_acpi.c | 34 ++
drivers/vhost/net.c | 2 +-
drivers/video/console/vgacon.c | 2 +
drivers/video/fbdev/aty/radeon_base.c | 3 +
drivers/video/fbdev/fm2fb.c | 2 +-
drivers/video/fbdev/macmodes.c | 2 +-
drivers/video/fbdev/smscufx.c | 26 +-
drivers/video/fbdev/sstfb.c | 3 +
drivers/video/fbdev/valkyriefb.c | 3 +-
drivers/video/fbdev/vfb.c | 18 +-
drivers/virtio/virtio.c | 41 +-
drivers/virtio/virtio_balloon.c | 34 +-
drivers/w1/slaves/w1_therm.c | 8 +
drivers/watchdog/npcm_wdt.c | 35 +-
drivers/watchdog/rzg2l_wdt.c | 4 +-
drivers/watchdog/rzv2h_wdt.c | 4 +-
fs/btrfs/btrfs_inode.h | 6 +
fs/btrfs/delayed-inode.c | 28 +-
fs/btrfs/direct-io.c | 22 +-
fs/btrfs/fiemap.c | 2 +
fs/btrfs/file.c | 7 +-
fs/btrfs/reflink.c | 91 ++--
fs/btrfs/send.c | 98 +++-
fs/btrfs/volumes.c | 9 +-
fs/crypto/keysetup.c | 14 +-
fs/direct-io.c | 15 +-
fs/ext4/inline.c | 6 +
fs/ext4/xattr.c | 12 +
fs/fuse/dev.c | 5 +-
fs/fuse/readdir.c | 22 +-
fs/fuse/virtio_fs.c | 9 +-
fs/fuse/xattr.c | 2 +-
fs/jbd2/journal.c | 3 +
fs/nfs/flexfilelayout/flexfilelayout.c | 11 +
fs/nfs/flexfilelayout/flexfilelayout.h | 1 +
fs/ocfs2/alloc.c | 2 +-
fs/ocfs2/dlmfs/userdlm.c | 12 +-
fs/ocfs2/dlmglue.c | 19 +-
fs/ocfs2/inode.c | 17 +-
fs/ocfs2/journal.c | 30 +-
fs/ocfs2/journal.h | 17 +-
fs/ocfs2/mmap.c | 12 +-
fs/ocfs2/ocfs2.h | 1 +
fs/ocfs2/super.c | 1 +
fs/overlayfs/copy_up.c | 2 +-
fs/overlayfs/dir.c | 22 +-
fs/overlayfs/file.c | 14 +-
fs/overlayfs/inode.c | 20 +-
fs/overlayfs/namei.c | 390 ++++++++-------
fs/overlayfs/overlayfs.h | 1 +
fs/overlayfs/readdir.c | 8 +-
fs/overlayfs/util.c | 9 +-
fs/overlayfs/xattrs.c | 9 +-
fs/pidfs.c | 8 +
fs/smb/client/cifsacl.c | 12 +-
fs/smb/client/cifsacl.h | 14 -
fs/smb/client/cifsglob.h | 2 +
fs/smb/client/file.c | 54 +-
fs/smb/client/netmisc.c | 3 +-
fs/smb/client/readdir.c | 3 +-
fs/smb/client/smb2pdu.c | 28 +-
fs/smb/server/smb2pdu.c | 82 +++-
fs/smb/server/smb_common.c | 34 +-
fs/smb/server/smb_common.h | 5 +
fs/smb/server/smbacl.c | 9 +-
fs/smb/server/vfs.c | 4 +
fs/smb/server/vfs_cache.h | 2 +
fs/xfs/xfs_bmap_util.c | 11 +-
fs/xfs/xfs_rtalloc.c | 6 +-
fs/zonefs/file.c | 9 +-
include/asm-generic/tlb.h | 6 +-
include/linux/arm-smccc.h | 7 +
include/linux/blkdev.h | 2 +-
include/linux/bpf.h | 31 +-
include/linux/cpufreq.h | 9 +
include/linux/device.h | 22 -
include/linux/device/devres.h | 41 ++
include/linux/filter.h | 14 +-
include/linux/firmware/imx/sm.h | 6 +
include/linux/iio/common/inv_sensors_timestamp.h | 43 +-
include/linux/jump_label.h | 3 +
include/linux/key.h | 4 +-
include/linux/mm.h | 91 +++-
include/linux/net.h | 2 +-
include/linux/netfilter.h | 11 -
include/linux/nsc_gpio.h | 2 +-
include/linux/pagemap.h | 66 ++-
include/linux/perf_event.h | 1 +
include/linux/sched.h | 1 +
include/linux/skbuff.h | 2 +
include/linux/tcp.h | 9 +-
include/linux/virtio.h | 4 +
include/net/ax25.h | 1 +
include/net/bluetooth/hci_core.h | 10 +-
include/net/bluetooth/l2cap.h | 1 +
include/net/codel.h | 5 +
include/net/codel_impl.h | 16 +-
include/net/dropreason-core.h | 6 +
include/net/dst.h | 3 +-
include/net/gro.h | 10 +
include/net/inet_hashtables.h | 2 +
include/net/ip_vs.h | 2 +-
include/net/net_debug.h | 4 +-
include/net/net_namespace.h | 1 +
include/net/netfilter/nf_queue.h | 1 +
include/net/netrom.h | 1 +
include/net/request_sock.h | 12 +-
include/net/rose.h | 1 +
include/net/tls.h | 2 +
include/scsi/scsi_proto.h | 3 +
kernel/bpf/btf.c | 26 +-
kernel/bpf/cgroup.c | 4 +
kernel/bpf/core.c | 12 +-
kernel/bpf/helpers.c | 41 +-
kernel/bpf/inode.c | 5 +-
kernel/bpf/syscall.c | 33 +-
kernel/bpf/verifier.c | 28 +-
kernel/cgroup/cpuset.c | 19 +-
kernel/dma/coherent.c | 11 +-
kernel/dma/swiotlb.c | 20 +-
kernel/events/core.c | 44 +-
kernel/kprobes.c | 545 ++++++++++-----------
kernel/rcu/tree_nocb.h | 6 +-
kernel/sched/core.c | 9 +-
kernel/sched/core_sched.c | 3 +-
kernel/sched/ext.c | 135 ++---
kernel/sched/sched.h | 26 +-
kernel/trace/bpf_trace.c | 4 +
kernel/trace/trace.c | 8 +-
kernel/trace/trace.h | 2 +
kernel/trace/trace_events_filter.c | 81 ++-
kernel/trace/trace_events_hist.c | 25 +-
kernel/trace/trace_events_trigger.c | 2 +
kernel/trace/trace_events_user.c | 12 +
kernel/trace/trace_osnoise.c | 8 +
kernel/trace/trace_probe.c | 67 ++-
kernel/trace/trace_recursion_record.c | 17 +-
kernel/trace/trace_uprobe.c | 56 ++-
kernel/workqueue.c | 9 +
lib/errseq.c | 42 +-
lib/maple_tree.c | 120 ++++-
lib/test_xarray.c | 70 +++
lib/xarray.c | 8 +-
mm/damon/core.c | 5 +-
mm/damon/tests/sysfs-kunit.h | 9 +
mm/filemap.c | 36 +-
mm/gup.c | 32 +-
mm/huge_memory.c | 10 +
mm/hugetlb.c | 13 +-
mm/hugetlb_vmemmap.c | 36 +-
mm/internal.h | 23 +-
mm/khugepaged.c | 6 +
mm/memory.c | 39 +-
mm/migrate.c | 15 +
mm/mmu_gather.c | 10 +-
mm/mmzone.c | 9 +-
mm/page_alloc.c | 212 ++++++--
mm/shmem.c | 7 +-
mm/userfaultfd.c | 4 +
mm/util.c | 26 +
net/ax25/af_ax25.c | 9 +
net/ax25/ax25_std_timer.c | 11 +-
net/ax25/ax25_subr.c | 27 +
net/bluetooth/hci_conn.c | 129 ++++-
net/bluetooth/hci_core.c | 96 +++-
net/bluetooth/hci_event.c | 82 ++--
net/bluetooth/hci_sync.c | 31 +-
net/bluetooth/l2cap_core.c | 95 ++--
net/bluetooth/mgmt.c | 337 ++++++++++---
net/bluetooth/mgmt_config.c | 10 +-
net/bluetooth/mgmt_util.c | 23 +-
net/bluetooth/msft.c | 118 +++--
net/bluetooth/smp.c | 37 +-
net/bridge/br_input.c | 18 +-
net/core/dev.c | 42 +-
net/core/filter.c | 23 +-
net/core/gro.c | 20 +-
net/core/skbuff.c | 34 +-
net/core/skmsg.c | 4 +-
net/core/sock.c | 4 +-
net/core/sock_reuseport.c | 16 +-
net/ieee802154/socket.c | 4 +
net/ipv4/af_inet.c | 5 +-
net/ipv4/esp4_offload.c | 1 +
net/ipv4/inet_connection_sock.c | 31 +-
net/ipv4/ip_fragment.c | 2 +
net/ipv4/ip_input.c | 6 +
net/ipv4/netfilter/ip_tables.c | 2 +-
net/ipv4/netfilter/nf_dup_ipv4.c | 6 +-
net/ipv4/tcp.c | 1 +
net/ipv4/tcp_fastopen.c | 1 +
net/ipv4/tcp_input.c | 6 +-
net/ipv4/tcp_ipv4.c | 2 +
net/ipv4/udp_offload.c | 1 +
net/ipv6/af_inet6.c | 8 +-
net/ipv6/calipso.c | 5 +-
net/ipv6/esp6_offload.c | 1 +
net/ipv6/ip6_fib.c | 16 +-
net/ipv6/ip6_input.c | 4 +
net/ipv6/ip6mr.c | 2 +-
net/ipv6/ipv6_sockglue.c | 95 ----
net/ipv6/mcast.c | 10 +-
net/ipv6/mcast_snoop.c | 3 +-
net/ipv6/netfilter/ip6_tables.c | 2 +-
net/ipv6/netfilter/nf_dup_ipv6.c | 6 +-
net/ipv6/route.c | 56 +--
net/ipv6/udp.c | 7 +-
net/mac80211/mlme.c | 25 +-
net/mac802154/llsec.c | 2 +
net/mptcp/protocol.c | 3 +-
net/netfilter/core.c | 3 -
net/netfilter/ipvs/ip_vs_conn.c | 4 +-
net/netfilter/ipvs/ip_vs_ctl.c | 30 +-
net/netfilter/ipvs/ip_vs_ftp.c | 20 +-
net/netfilter/ipvs/ip_vs_lblc.c | 8 +-
net/netfilter/ipvs/ip_vs_lblcr.c | 13 +-
net/netfilter/ipvs/ip_vs_sync.c | 42 +-
net/netfilter/nf_queue.c | 1 +
net/netfilter/nfnetlink_queue.c | 17 +-
net/netrom/af_netrom.c | 7 +
net/netrom/nr_in.c | 107 ++--
net/netrom/nr_out.c | 10 +
net/netrom/nr_timer.c | 9 +-
net/openvswitch/flow.c | 3 +-
net/qrtr/ns.c | 21 +-
net/rose/af_rose.c | 5 +
net/rose/rose_in.c | 16 +-
net/rose/rose_out.c | 21 +
net/rose/rose_timer.c | 10 +-
net/sctp/ipv6.c | 5 +-
net/sctp/socket.c | 12 +-
net/smc/af_smc.c | 11 +-
net/smc/smc_core.c | 78 ++-
net/smc/smc_core.h | 6 +-
net/socket.c | 6 +-
net/sunrpc/xprtrdma/frwr_ops.c | 89 ++--
net/sunrpc/xprtrdma/transport.c | 2 +
net/sunrpc/xprtrdma/verbs.c | 16 +-
net/sunrpc/xprtrdma/xprt_rdma.h | 10 +-
net/tls/tls_device.c | 10 +-
net/vmw_vsock/af_vsock.c | 1 +
net/xdp/xsk.c | 15 +-
net/xfrm/xfrm_interface_core.c | 8 +
net/xfrm/xfrm_output.c | 20 +-
security/keys/big_key.c | 16 +-
security/keys/key.c | 4 +
security/keys/keyctl_pkey.c | 124 +++--
security/keys/trusted-keys/trusted_core.c | 15 +-
security/selinux/hooks.c | 5 +-
sound/core/oss/pcm_oss.c | 4 +-
sound/core/pcm_native.c | 63 ++-
sound/core/sound_oss.c | 35 +-
sound/firewire/fcp.c | 5 +-
sound/firewire/fireworks/fireworks_transaction.c | 4 +-
sound/pci/hda/hda_intel.c | 5 +-
sound/pci/hda/hda_sysfs.c | 5 +-
sound/pci/hda/patch_realtek.c | 1 -
sound/soc/codecs/wm8962.c | 2 +-
sound/soc/fsl/fsl_asrc.c | 22 +
sound/soc/fsl/fsl_easrc.c | 10 +
sound/soc/qcom/qdsp6/q6apm-dai.c | 3 +
sound/soc/qcom/qdsp6/q6asm-dai.c | 3 +
sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c | 14 +-
sound/soc/qcom/qdsp6/topology.c | 4 +-
sound/soc/sof/control.c | 5 +
sound/soc/sof/intel/lnl.c | 17 +-
tools/bootconfig/main.c | 29 +-
tools/bootconfig/samples/exp-good-mixed-kv1.bconf | 7 +
tools/bootconfig/samples/good-mixed-kv1.bconf | 5 +
tools/bootconfig/scripts/bconf2ftrace.sh | 21 +-
tools/bootconfig/scripts/ftrace2bconf.sh | 5 +-
tools/bootconfig/test-bootconfig.sh | 6 +
tools/gpio/gpio-event-mon.c | 4 +-
tools/gpio/gpio-hammer.c | 4 +-
tools/gpio/lsgpio.c | 3 +-
tools/objtool/check.c | 4 +
tools/perf/builtin-record.c | 4 +-
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 7 +
.../selftests/drivers/s390x/uvdevice/Makefile | 19 +-
tools/testing/selftests/landlock/fs_test.c | 54 ++
tools/testing/selftests/net/reuseport_bpf_numa.c | 1 +
518 files changed, 7652 insertions(+), 3223 deletions(-)
^ permalink raw reply [flat|nested] 68+ messages in thread
* [PATCH 6.12 001/555] net: ipv6: keep room for the mac header in dst_dev_overhead()
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 002/555] virtgpu: dont reset on shutdown Greg Kroah-Hartman
` (65 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrea Mayer, Yuya Kusakabe,
Justin Iurman, Gabriel Goller, Eric Dumazet, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuya Kusakabe <yuya.kusakabe@gmail.com>
[ Upstream commit 87cd6b717e4069dca34e0866e57eaeb44d3b173e ]
The seg6, ioam6 and rpl lwtunnels size their skb_cow_head() request as
the length they are about to push plus dst_dev_overhead(), then push the
new headers and rebuild the mac header below them with
skb_mac_header_rebuild(). That rebuild needs skb->mac_len of headroom,
but dst_dev_overhead() leaves LL_RESERVED_SPACE() of the egress device,
16 bytes for plain Ethernet.
Where the mac header is longer than that, as it is on ingress through a
VLAN device with reorder_hdr off, the rebuild runs out of room:
skb_set_mac_header(skb, -skb->mac_len) computes a negative offset,
stores it unchecked in the u16 skb->mac_header, and the memmove that
follows writes skb->mac_len bytes about 64 KB past skb->head.
Forwarding plain ping6 traffic through such a device reproduces it on
all five seg6 encapsulation modes and on the rpl and ioam6 inline paths;
skb->mac_header comes back as 65534 on a 704-byte head.
Return the larger of the two. The helper already returns skb->mac_len
when it has no dst, so this only makes the other branch agree, and it
covers every caller rather than each call site in turn.
Fixes: 40475b63761a ("net: ipv6: seg6_iptunnel: mitigate 2-realloc issue")
Fixes: dce525185bc9 ("net: ipv6: ioam6_iptunnel: mitigate 2-realloc issue")
Fixes: 985ec6f5e623 ("net: ipv6: rpl_iptunnel: mitigate 2-realloc issue")
Suggested-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Signed-off-by: Yuya Kusakabe <yuya.kusakabe@gmail.com>
Reviewed-by: Justin Iurman <justin.iurman@gmail.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Link: https://patch.msgid.link/20260922-seg6-maclen-headroom-v3-1-7b2f982ef79d@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/dst.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/net/dst.h b/include/net/dst.h
index b3ac23e14adab..c5406f6a7f5a0 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -453,7 +453,8 @@ static inline unsigned int dst_dev_overhead(struct dst_entry *dst,
struct sk_buff *skb)
{
if (likely(dst))
- return LL_RESERVED_SPACE(dst->dev);
+ return max_t(unsigned int, skb->mac_len,
+ LL_RESERVED_SPACE(dst->dev));
return skb->mac_len;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 002/555] virtgpu: dont reset on shutdown
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 001/555] net: ipv6: keep room for the mac header in dst_dev_overhead() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 003/555] virtio: add virtio_device_shutdown() helper Greg Kroah-Hartman
` (64 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Auger, Eric Auger,
Jocelyn Falempe, Michael S. Tsirkin, Dickson Wu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael S. Tsirkin <mst@redhat.com>
commit 183a08715af1491d381b4e22efd61578fbe05fa5 upstream.
It looks like GPUs are used after shutdown is invoked.
Thus, breaking virtio gpu in the shutdown callback is not a good idea -
guest hangs attempting to finish console drawing, with these warnings:
[ 20.504464] WARNING: CPU: 0 PID: 568 at drivers/gpu/drm/virtio/virtgpu_vq.c:358 virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu]
[ 20.505685] Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 rfkill ip_set nf_tables nfnetlink vfat fat intel_rapl_msr intel_rapl_common intel_uncore_frequency_common nfit libnvdimm kvm_intel kvm rapl iTCO_wdt iTCO_vendor_support virtio_gpu virtio_dma_buf pcspkr drm_shmem_helper i2c_i801 drm_kms_helper lpc_ich i2c_smbus virtio_balloon joydev drm fuse xfs libcrc32c ahci libahci crct10dif_pclmul crc32_pclmul crc32c_intel libata virtio_net ghash_clmulni_intel net_failover virtio_blk failover serio_raw dm_mirror dm_region_hash dm_log dm_mod
[ 20.511847] CPU: 0 PID: 568 Comm: kworker/0:3 Kdump: loaded Tainted: G W ------- --- 5.14.0-578.6675_1757216455.el9.x86_64 #1
[ 20.513157] Hardware name: Red Hat KVM/RHEL, BIOS edk2-20241117-3.el9 11/17/2024
[ 20.513918] Workqueue: events drm_fb_helper_damage_work [drm_kms_helper]
[ 20.514626] RIP: 0010:virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu]
[ 20.515332] Code: 00 00 48 85 c0 74 0c 48 8b 78 08 48 89 ee e8 51 50 00 00 65 ff 0d 42 e3 74 3f 0f 85 69 ff ff ff 0f 1f 44 00 00 e9 5f ff ff ff <0f> 0b e9 3f ff ff ff 48 83 3c 24 00 74 0e 49 8b 7f 40 48 85 ff 74
[ 20.517272] RSP: 0018:ff34f0a8c0787ad8 EFLAGS: 00010282
[ 20.517820] RAX: 00000000fffffffb RBX: 0000000000000000 RCX: 0000000000000820
[ 20.518565] RDX: 0000000000000000 RSI: ff34f0a8c0787be0 RDI: ff218bef03a26300
[ 20.519308] RBP: ff218bef03a26300 R08: 0000000000000001 R09: ff218bef07224360
[ 20.520059] R10: 0000000000008dc0 R11: 0000000000000002 R12: ff218bef02630028
[ 20.520806] R13: ff218bef0263fb48 R14: ff218bef00cb8000 R15: ff218bef07224360
[ 20.521555] FS: 0000000000000000(0000) GS:ff218bef7ba00000(0000) knlGS:0000000000000000
[ 20.522397] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 20.522996] CR2: 000055ac4f7871c0 CR3: 000000010b9f2002 CR4: 0000000000771ef0
[ 20.523740] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 20.524477] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400
[ 20.525223] PKRU: 55555554
[ 20.525515] Call Trace:
[ 20.525777] <TASK>
[ 20.526003] ? show_trace_log_lvl+0x1c4/0x2df
[ 20.526464] ? show_trace_log_lvl+0x1c4/0x2df
[ 20.526925] ? virtio_gpu_queue_fenced_ctrl_buffer+0x82/0x2c0 [virtio_gpu]
[ 20.527643] ? virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu]
[ 20.528282] ? __warn+0x7e/0xd0
[ 20.528621] ? virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu]
[ 20.529256] ? report_bug+0x100/0x140
[ 20.529643] ? handle_bug+0x3c/0x70
[ 20.530010] ? exc_invalid_op+0x14/0x70
[ 20.530421] ? asm_exc_invalid_op+0x16/0x20
[ 20.530862] ? virtio_gpu_queue_ctrl_sgs+0x236/0x290 [virtio_gpu]
[ 20.531506] ? virtio_gpu_queue_ctrl_sgs+0x174/0x290 [virtio_gpu]
[ 20.532148] virtio_gpu_queue_fenced_ctrl_buffer+0x82/0x2c0 [virtio_gpu]
[ 20.532843] virtio_gpu_primary_plane_update+0x3e2/0x460 [virtio_gpu]
[ 20.533520] drm_atomic_helper_commit_planes+0x108/0x320 [drm_kms_helper]
[ 20.534233] drm_atomic_helper_commit_tail+0x45/0x80 [drm_kms_helper]
[ 20.534914] commit_tail+0xd2/0x130 [drm_kms_helper]
[ 20.535446] drm_atomic_helper_commit+0x11b/0x140 [drm_kms_helper]
[ 20.536097] drm_atomic_commit+0xa4/0xe0 [drm]
[ 20.536588] ? __pfx___drm_printfn_info+0x10/0x10 [drm]
[ 20.537162] drm_atomic_helper_dirtyfb+0x192/0x270 [drm_kms_helper]
[ 20.537823] drm_fbdev_shmem_helper_fb_dirty+0x43/0xa0 [drm_shmem_helper]
[ 20.538536] drm_fb_helper_damage_work+0x87/0x160 [drm_kms_helper]
[ 20.539188] process_one_work+0x194/0x380
[ 20.539612] worker_thread+0x2fe/0x410
[ 20.540007] ? __pfx_worker_thread+0x10/0x10
[ 20.540456] kthread+0xdd/0x100
[ 20.540791] ? __pfx_kthread+0x10/0x10
[ 20.541190] ret_from_fork+0x29/0x50
[ 20.541566] </TASK>
[ 20.541802] ---[ end trace 0000000000000000 ]---
It looks like the shutdown is called in the middle of console drawing, so
we should either wait for it to finish, or let drm handle the shutdown.
This patch implements this second option:
Add an option for drivers to bypass the common break+reset handling.
As DRM is careful to flush/synchronize outstanding buffers, it looks like
GPU can just have a NOP there.
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Fixes: 8bd2fa086a04 ("virtio: break and reset virtio devices on device_shutdown()")
Cc: Eric Auger <eauger@redhat.com>
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <8490dbeb6f79ed039e6c11d121002618972538a3.1744293540.git.mst@redhat.com>
[ adapted to 6.12: no reset_prepare/reset_done in struct virtio_driver, add only .shutdown ]
Signed-off-by: Dickson Wu <dickson.wu@certik.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/virtio/virtgpu_drv.c | 9 +++++++++
drivers/virtio/virtio.c | 6 ++++++
include/linux/virtio.h | 3 +++
3 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 44d99e89bb9b6..92332f9d17963 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -126,6 +126,14 @@ static void virtio_gpu_remove(struct virtio_device *vdev)
drm_dev_put(dev);
}
+static void virtio_gpu_shutdown(struct virtio_device *vdev)
+{
+ /*
+ * drm does its own synchronization on shutdown.
+ * Do nothing here, opt out of device reset.
+ */
+}
+
static void virtio_gpu_config_changed(struct virtio_device *vdev)
{
struct drm_device *dev = vdev->priv;
@@ -160,6 +168,7 @@ static struct virtio_driver virtio_gpu_driver = {
.id_table = id_table,
.probe = virtio_gpu_probe,
.remove = virtio_gpu_remove,
+ .shutdown = virtio_gpu_shutdown,
.config_changed = virtio_gpu_config_changed
};
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 078e5483b22f4..8241024f0890b 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -391,6 +391,12 @@ static void virtio_dev_shutdown(struct device *_d)
if (!drv)
return;
+ /* If the driver has its own shutdown method, use that. */
+ if (drv->shutdown) {
+ drv->shutdown(dev);
+ return;
+ }
+
/*
* Some devices get wedged if you kick them after they are
* reset. Mark all vqs as broken to make sure we don't.
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 3ad94d939d281..2759e2c24d6ea 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -204,6 +204,8 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
* changes; may be called in interrupt context.
* @freeze: optional function to call during suspend/hibernation.
* @restore: optional function to call on resume.
+ * @shutdown: synchronize with the device on shutdown. If provided, replaces
+ * the virtio core implementation.
*/
struct virtio_driver {
struct device_driver driver;
@@ -219,6 +221,7 @@ struct virtio_driver {
void (*config_changed)(struct virtio_device *dev);
int (*freeze)(struct virtio_device *dev);
int (*restore)(struct virtio_device *dev);
+ void (*shutdown)(struct virtio_device *dev);
};
#define drv_to_virtio(__drv) container_of_const(__drv, struct virtio_driver, driver)
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 003/555] virtio: add virtio_device_shutdown() helper
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 001/555] net: ipv6: keep room for the mac header in dst_dev_overhead() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 002/555] virtgpu: dont reset on shutdown Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 004/555] virtio_balloon: factor out virtballoon_quiesce() Greg Kroah-Hartman
` (63 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Denis V. Lunev,
David Hildenbrand (Arm), Michael S. Tsirkin, Dickson Wu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis V. Lunev <den@openvz.org>
commit 0d8aebe089b4ba887e792884cf041ce9f1040ff4 upstream.
The generic virtio bus .shutdown handler, virtio_dev_shutdown(), breaks
and resets a device once it has established that the driver has no
.shutdown of its own. A driver that does implement .shutdown, to quiesce
its own activity first, still needs the same break and reset afterwards
and would otherwise have to open code it.
Factor the break + synchronize_cbs + reset sequence out of
virtio_dev_shutdown() into an exported virtio_device_shutdown() helper so
such drivers can reuse it instead of duplicating the core logic.
No functional change.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260624140846.2616797-2-den@openvz.org>
[ adapted to 6.12: no virtio_irq_get_affinity(), put the helper above virtio_dev_shutdown() ]
Signed-off-by: Dickson Wu <dickson.wu@certik.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/virtio/virtio.c | 41 +++++++++++++++++++++++++++--------------
include/linux/virtio.h | 1 +
2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 8241024f0890b..f70ae3a672f72 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -379,6 +379,32 @@ static void virtio_dev_remove(struct device *_d)
of_node_put(dev->dev.of_node);
}
+/**
+ * virtio_device_shutdown - break and reset a device on shutdown
+ * @dev: the device
+ *
+ * Drivers with their own .shutdown method should quiesce their activity and
+ * then call this to stop the device the way the generic shutdown path does.
+ */
+void virtio_device_shutdown(struct virtio_device *dev)
+{
+ /*
+ * Some devices get wedged if you kick them after they are
+ * reset. Mark all vqs as broken to make sure we don't.
+ */
+ virtio_break_device(dev);
+ /*
+ * Guarantee that any callback will see vq->broken as true.
+ */
+ virtio_synchronize_cbs(dev);
+ /*
+ * As IOMMUs are reset on shutdown, this will block device access to memory.
+ * Some devices get wedged if this happens, so reset to make sure it does not.
+ */
+ dev->config->reset(dev);
+}
+EXPORT_SYMBOL_GPL(virtio_device_shutdown);
+
static void virtio_dev_shutdown(struct device *_d)
{
struct virtio_device *dev = dev_to_virtio(_d);
@@ -397,20 +423,7 @@ static void virtio_dev_shutdown(struct device *_d)
return;
}
- /*
- * Some devices get wedged if you kick them after they are
- * reset. Mark all vqs as broken to make sure we don't.
- */
- virtio_break_device(dev);
- /*
- * Guarantee that any callback will see vq->broken as true.
- */
- virtio_synchronize_cbs(dev);
- /*
- * As IOMMUs are reset on shutdown, this will block device access to memory.
- * Some devices get wedged if this happens, so reset to make sure it does not.
- */
- dev->config->reset(dev);
+ virtio_device_shutdown(dev);
}
static const struct bus_type virtio_bus = {
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 2759e2c24d6ea..2d8820c0832af 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -180,6 +180,7 @@ int virtio_device_freeze(struct virtio_device *dev);
int virtio_device_restore(struct virtio_device *dev);
#endif
void virtio_reset_device(struct virtio_device *dev);
+void virtio_device_shutdown(struct virtio_device *dev);
size_t virtio_max_dma_size(const struct virtio_device *vdev);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 004/555] virtio_balloon: factor out virtballoon_quiesce()
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 003/555] virtio: add virtio_device_shutdown() helper Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 005/555] virtio_balloon: quiesce balloon work before device shutdown Greg Kroah-Hartman
` (62 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Denis V. Lunev,
David Hildenbrand (Arm), Michael S. Tsirkin, Dickson Wu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis V. Lunev <den@openvz.org>
commit 29536a923a9412812eb3e378258019b54538a220 upstream.
virtballoon_remove() stops all of the balloon's asynchronous work (the
free page reporting worker, the inflate/deflate and stats workers, the
OOM notifier and the free page shrinker) before tearing the device
down. A following change needs the same teardown from a .shutdown
handler, so move it into a virtballoon_quiesce() helper.
No functional change.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260624140846.2616797-3-den@openvz.org>
Signed-off-by: Dickson Wu <dickson.wu@certik.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/virtio/virtio_balloon.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 5a093d8786b7f..a3b6e38752ab9 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -1120,26 +1120,39 @@ static void remove_common(struct virtio_balloon *vb)
vb->vdev->config->del_vqs(vb->vdev);
}
-static void virtballoon_remove(struct virtio_device *vdev)
+/*
+ * Stop all asynchronous balloon work. The device must still be alive so that
+ * in-flight requests can drain via the host before it is reset or freed.
+ */
+static void virtballoon_quiesce(struct virtio_balloon *vb)
{
- struct virtio_balloon *vb = vdev->priv;
+ struct virtio_device *vdev = vb->vdev;
- if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_REPORTING))
+ if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_REPORTING))
page_reporting_unregister(&vb->pr_dev_info);
- if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
+ if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
unregister_oom_notifier(&vb->oom_nb);
- if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
+ if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
virtio_balloon_unregister_shrinker(vb);
+
spin_lock_irq(&vb->stop_update_lock);
vb->stop_update = true;
spin_unlock_irq(&vb->stop_update_lock);
cancel_work_sync(&vb->update_balloon_size_work);
cancel_work_sync(&vb->update_balloon_stats_work);
- if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
+ if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
cancel_work_sync(&vb->report_free_page_work);
+}
+
+static void virtballoon_remove(struct virtio_device *vdev)
+{
+ struct virtio_balloon *vb = vdev->priv;
+
+ virtballoon_quiesce(vb);
+
+ if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
destroy_workqueue(vb->balloon_wq);
- }
remove_common(vb);
kfree(vb);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 005/555] virtio_balloon: quiesce balloon work before device shutdown
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 004/555] virtio_balloon: factor out virtballoon_quiesce() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 006/555] mm/page_alloc: snapshot the preferred zone against shrink rebuilds Greg Kroah-Hartman
` (61 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Denis V. Lunev,
David Hildenbrand (Arm), Michael S. Tsirkin, Dickson Wu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Denis V. Lunev <den@openvz.org>
commit 7e17eef04600c399c7e0f5ce765da5cf9d40d8e1 upstream.
Commit 8bd2fa086a04 ("virtio: break and reset virtio devices on
device_shutdown()") added a generic virtio bus .shutdown handler that
breaks and resets every virtio device during device_shutdown(), i.e. on
reboot and kexec.
virtio_balloon provides no .shutdown of its own, so that generic path
runs while the balloon's asynchronous work is still armed. Once the
device has been broken, virtqueue_add_inbuf() in
virtballoon_free_page_report() returns -EIO and trips its
WARN_ON_ONCE(). On a kernel booted with panic_on_warn that turns an
ordinary reboot, for example a kexec based upgrade, into a fatal panic
in the middle of device_shutdown(), so the machine never reaches the
new kernel.
Relaxing that single WARN_ON_ONCE() would only hide the symptom: the
inflate/deflate and OOM paths do not warn, they call
wait_event(vb->acked, ...) and would instead block forever on a broken
queue that can no longer complete. The device has to be quiesced, not
just kept quiet.
Add a .shutdown handler that quiesces the balloon via the shared
virtballoon_quiesce() helper while the device is still alive, and only
then breaks and resets it via virtio_device_shutdown(). Unlike
virtballoon_remove() the balloon workqueue is not destroyed, as shutdown
does not free the device and cancel_work_sync() together with stop_update
already prevent any further work from being queued.
Fixes: 8bd2fa086a04 ("virtio: break and reset virtio devices on device_shutdown()")
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260624140846.2616797-4-den@openvz.org>
Signed-off-by: Dickson Wu <dickson.wu@certik.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/virtio/virtio_balloon.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index a3b6e38752ab9..14443e66d118a 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -1158,6 +1158,12 @@ static void virtballoon_remove(struct virtio_device *vdev)
kfree(vb);
}
+static void virtballoon_shutdown(struct virtio_device *vdev)
+{
+ virtballoon_quiesce(vdev->priv);
+ virtio_device_shutdown(vdev);
+}
+
#ifdef CONFIG_PM_SLEEP
static int virtballoon_freeze(struct virtio_device *vdev)
{
@@ -1228,6 +1234,7 @@ static struct virtio_driver virtio_balloon_driver = {
.validate = virtballoon_validate,
.probe = virtballoon_probe,
.remove = virtballoon_remove,
+ .shutdown = virtballoon_shutdown,
.config_changed = virtballoon_changed,
#ifdef CONFIG_PM_SLEEP
.freeze = virtballoon_freeze,
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 006/555] mm/page_alloc: snapshot the preferred zone against shrink rebuilds
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 005/555] virtio_balloon: quiesce balloon work before device shutdown Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 007/555] pidfd: restrict task access ioctls to the callers pid namespace Greg Kroah-Hartman
` (60 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
[ Upstream commit b3e3a760eb68449e2794ef68ab212173d9c3e8c7 ]
get_page_from_freelist() and alloc_pages_bulk_noprof() reread
ac->preferred_zoneref->zone at every use. Offlining a zone's last block
rebuilds the zonelists in place, and the shrunk list's NULL terminator
can land on the preferred slot mid-walk:
CPU 0 CPU 1
get_page_from_freelist(GFP_KERNEL | __GFP_THISNODE)
zone = NORMAL (slot 1)
offline_pages()
build_all_zonelists()
[MOVABLE, NORMAL, NULL]
-> [NORMAL, NULL]
rmqueue(zonelist_zone(slot 1), zone)
zone_statistics(NULL, zone)
BUG: kernel NULL pointer dereference, address: 0000000000000060
RIP: 0010:get_page_from_freelist+0x6a5/0x15f0
Call Trace:
__alloc_frozen_pages_noprof+0x125/0x330
Read the slot once. Zones are never freed, so a stale zone is safe, and
a NULL slot fails the same way as walking off the end.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://patch.msgid.link/20261101021340.2251928-7-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
[ sashal: Dropped the !defrag_mode condition from the NOFRAGMENT locality check since this tree lacks defrag_mode, keeping the preferred_zone replacement. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e9aadaf6e91b6..dc4b0d58c4d0d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3424,10 +3424,19 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
{
struct zoneref *z;
struct zone *zone;
+ struct zone *preferred_zone;
struct pglist_data *last_pgdat = NULL;
bool last_pgdat_dirty_ok = false;
bool no_fallback;
+ /*
+ * A concurrent zonelist rebuild can NULL or replace this slot. Zones
+ * are never freed, so reading it once keeps a usable zone.
+ */
+ preferred_zone = zonelist_zone(ac->preferred_zoneref);
+ if (!preferred_zone)
+ return NULL;
+
retry:
/*
* Scan zonelist, looking for a zone with enough free.
@@ -3474,7 +3483,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
}
if (no_fallback && nr_online_nodes > 1 &&
- zone != zonelist_zone(ac->preferred_zoneref)) {
+ zone != preferred_zone) {
int local_nid;
/*
@@ -3482,7 +3491,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
* fragmenting fallbacks. Locality is more important
* than fragmentation avoidance.
*/
- local_nid = zonelist_node_idx(ac->preferred_zoneref);
+ local_nid = zone_to_nid(preferred_zone);
if (zone_to_nid(zone) != local_nid) {
alloc_flags &= ~ALLOC_NOFRAGMENT;
goto retry;
@@ -3533,7 +3542,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
goto try_this_zone;
if (!node_reclaim_enabled() ||
- !zone_allows_reclaim(zonelist_zone(ac->preferred_zoneref), zone))
+ !zone_allows_reclaim(preferred_zone, zone))
continue;
ret = node_reclaim(zone->zone_pgdat, gfp_mask, order);
@@ -3555,7 +3564,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
}
try_this_zone:
- page = rmqueue(zonelist_zone(ac->preferred_zoneref), zone, order,
+ page = rmqueue(preferred_zone, zone, order,
gfp_mask, alloc_flags, ac->migratetype);
if (page) {
prep_new_page(page, order, gfp_mask, alloc_flags);
@@ -4678,6 +4687,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
struct page *page;
unsigned long __maybe_unused UP_flags;
struct zone *zone;
+ struct zone *preferred_zone;
struct zoneref *z;
struct per_cpu_pages *pcp;
struct list_head *pcp_list;
@@ -4728,6 +4738,11 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
goto out;
gfp = alloc_gfp;
+ /* Read once; see get_page_from_freelist(). */
+ preferred_zone = zonelist_zone(ac.preferred_zoneref);
+ if (!preferred_zone)
+ goto failed;
+
/* Find an allowed local zone that meets the low watermark. */
z = ac.preferred_zoneref;
for_next_zone_zonelist_nodemask(zone, z, ac.highest_zoneidx, ac.nodemask) {
@@ -4738,8 +4753,8 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
continue;
}
- if (nr_online_nodes > 1 && zone != zonelist_zone(ac.preferred_zoneref) &&
- zone_to_nid(zone) != zonelist_node_idx(ac.preferred_zoneref)) {
+ if (nr_online_nodes > 1 && zone != preferred_zone &&
+ zone_to_nid(zone) != zone_to_nid(preferred_zone)) {
goto failed;
}
@@ -4747,7 +4762,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
retry_this_zone:
mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK) + nr_pages;
if (zone_watermark_fast(zone, 0, mark,
- zonelist_zone_idx(ac.preferred_zoneref),
+ zone_idx(preferred_zone),
alloc_flags, gfp)) {
break;
}
@@ -4809,7 +4824,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
pcp_trylock_finish(UP_flags);
__count_zid_vm_events(PGALLOC, zone_idx(zone), nr_account);
- zone_statistics(zonelist_zone(ac.preferred_zoneref), zone, nr_account);
+ zone_statistics(preferred_zone, zone, nr_account);
out:
return nr_populated;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 007/555] pidfd: restrict task access ioctls to the callers pid namespace
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 006/555] mm/page_alloc: snapshot the preferred zone against shrink rebuilds Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 008/555] net/smc: fix link group ownership in handshake abort Greg Kroah-Hartman
` (59 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jann Horn, Christian Brauner,
Chen Linxuan, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Linxuan <me@black-desk.cn>
[ Upstream commit ee8323fdc827c580425644db605a4be776cace57 ]
pidfds can cross pid namespace boundaries: a task may obtain one for a
process outside of its own pid namespace hierarchy through SO_PASSPIDFD
or SO_PEERPIDFD, via SCM_RIGHTS, or through file descriptor inheritance.
The namespace ioctls gate access with a ptrace check against the
target's credentials only. That check does not account for the pid
namespace relationship between the caller and the target, so a task
inside a pid namespace can use a pidfd obtained across that boundary to
acquire namespace file descriptors of a task outside of its hierarchy.
procfs exposes the equivalent information only for tasks visible in the
reader's pid namespace, and PIDFD_GET_INFO already answers with -EREMOTE
for targets outside the caller's hierarchy. Extend that policy to the
namespace ioctls: fail with -EREMOTE unless the target is visible in the
caller's active pid namespace. Callers in ancestor pid namespaces are
unaffected.
Unlike PIDFD_GET_INFO, the visibility check is performed after the task
lookup here, so reaped targets outside of the caller's pid namespace
hierarchy answer -ESRCH instead of -EREMOTE.
Link: https://lore.kernel.org/all/CAG48ez1T5-tUHVK_iHsgUtWa-inVdrZxA3E-ZCW0iENJvasKfg@mail.gmail.com
Link: https://lore.kernel.org/all/20260925-gewischt-auftrag-tierzucht-c153cb3f9f74@brauner
Suggested-by: Jann Horn <jannh@google.com>
Suggested-by: Christian Brauner <brauner@kernel.org>
Fixes: 5b08bd408534 ("pidfs: allow retrieval of namespace file descriptors")
Cc: stable@vger.kernel.org
Signed-off-by: Chen Linxuan <me@black-desk.cn>
Link: https://patch.msgid.link/20261027-pidfd-task-access-v1-1-d46cf0fa4ca1@black-desk.cn
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Replaced the missing pid_in_current_pidns() helper with an equivalent pid_nr_ns(pid, task_active_pid_ns(current)) check, since that helper isn't in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/pidfs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/pidfs.c b/fs/pidfs.c
index b2dc613a64f6f..7a5efe86426bb 100644
--- a/fs/pidfs.c
+++ b/fs/pidfs.c
@@ -131,6 +131,14 @@ static long pidfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (!task)
return -ESRCH;
+ /*
+ * Require the target to be visible in the caller's pid namespace
+ * for operations that grant access to its resources, mirroring
+ * procfs and PIDFD_GET_INFO.
+ */
+ if (!pid_nr_ns(pid, task_active_pid_ns(current)))
+ return -EREMOTE;
+
/*
* We're trying to open a file descriptor to the namespace so perform a
* filesystem cred ptrace check. Hold @task's exec_update_lock for the
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 008/555] net/smc: fix link group ownership in handshake abort
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 007/555] pidfd: restrict task access ioctls to the callers pid namespace Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 009/555] net/mlx5e: Fix queue stats access to queues without stats Greg Kroah-Hartman
` (58 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mahanta Jambigi, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahanta Jambigi <mjambigi@linux.ibm.com>
[ Upstream commit e227b511582828c5a6513f70fc6a71211e5efbf0 ]
An aborted first-contact handshake can hang the handshake worker on the
socket lock it already holds, reset the clcsock of a socket that has
fallen back to TCP, or corrupt the alert-node lookup when the handshake
retries with the same connection.
The abort leaves a connection registered in a link group that another
context has already unlinked for termination: smc_conn_free() skips the
unregister when lgr->list is empty, so the alert token and alert node
stay in lgr->conns_all. If the handshake retries another device or SMC
version, smc_conn_create() creates a second link group and
smc_lgr_register_conn() inserts the same alert node into it: the token
loop is skipped, rb_link_node() links a node that is still in the old
tree into the new one, and a second sock_hold() is taken where only one
sock_put() will follow. The old group's terminator then keeps returning
that node from rb_first() and can kill a connection that now belongs to
the new group.
smc_lgr_cleanup_early() also starts a second termination of the link
group that is already being terminated, which takes lock_sock() on the
socket the handshake worker holds; if the termination work wins the race
instead, it later kills the freed connection and aborts the clcsock of a
socket that has fallen back to TCP. Making the unregister unconditional
also lets smc_conn_free() reach the delayed free work on a claimed link
group, where the lockless freeing check can arm it after the owner has
cancelled it.
Always unregister the connection, claim a link group for termination
once under lgr_lock, keep the link group alive across the abort, and arm
the delayed free work only under the same lock and cancel it
synchronously before the teardown. Drop an already freed connection in
smc_conn_kill() without running the connection and socket teardown.
Fixes: 2a0674fffb6b ("net/smc: improve abnormal termination of link groups")
Fixes: f9aab6f2ce57 ("net/smc: immediate freeing in smc_lgr_cleanup_early()")
Cc: stable@vger.kernel.org
Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
Link: https://patch.msgid.link/20261106130457.1092203-1-mjambigi@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/smc/af_smc.c | 11 ++++---
net/smc/smc_core.c | 78 +++++++++++++++++++++++++++++++++-------------
net/smc/smc_core.h | 6 ++--
3 files changed, 65 insertions(+), 30 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 0d00fa56a9002..0adc46c691312 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1010,14 +1010,15 @@ static void smc_conn_abort(struct smc_sock *smc, int local_first)
{
struct smc_connection *conn = &smc->conn;
struct smc_link_group *lgr = conn->lgr;
- bool lgr_valid = false;
-
- if (smc_conn_lgr_valid(conn))
- lgr_valid = true;
+ bool lgr_valid = local_first && smc_conn_lgr_valid(conn);
+ if (lgr_valid)
+ smc_lgr_hold(lgr); /* lgr_put below */
smc_conn_free(conn);
- if (local_first && lgr_valid)
+ if (lgr_valid) {
smc_lgr_cleanup_early(lgr);
+ smc_lgr_put(lgr);
+ }
}
/* check if there is a rdma device available for this connection. */
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index 1f340de96ec83..982c9cf39ba6a 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -80,16 +80,21 @@ static void smc_ibdev_cnt_dec(struct smc_link *lnk)
static void smc_lgr_schedule_free_work(struct smc_link_group *lgr)
{
+ spinlock_t *lgr_lock;
+
/* client link group creation always follows the server link group
* creation. For client use a somewhat higher removal delay time,
* otherwise there is a risk of out-of-sync link groups.
*/
+ smc_lgr_list_head(lgr, &lgr_lock);
+ spin_lock_bh(lgr_lock);
if (!lgr->freeing) {
mod_delayed_work(system_wq, &lgr->free_work,
(!lgr->is_smcd && lgr->role == SMC_CLNT) ?
SMC_LGR_FREE_DELAY_CLNT :
SMC_LGR_FREE_DELAY_SERV);
}
+ spin_unlock_bh(lgr_lock);
}
/* Register connection's alert token in our lookup structure.
@@ -679,19 +684,34 @@ int smcd_nl_get_lgr(struct sk_buff *skb, struct netlink_callback *cb)
return skb->len;
}
-void smc_lgr_cleanup_early(struct smc_link_group *lgr)
+/* Claim a link group for termination. Only one context can succeed: the
+ * lgr is removed from its list and marked freeing under lgr_lock.
+ * Returns false if @lgr is NULL or another context owns it.
+ */
+static bool smc_lgr_claim(struct smc_link_group *lgr)
{
spinlock_t *lgr_lock;
if (!lgr)
- return;
-
+ return false;
smc_lgr_list_head(lgr, &lgr_lock);
spin_lock_bh(lgr_lock);
+ if (lgr->freeing || lgr->terminating || list_empty(&lgr->list)) {
+ spin_unlock_bh(lgr_lock);
+ return false;
+ }
/* do not use this link group for new connections */
- if (!list_empty(&lgr->list))
- list_del_init(&lgr->list);
+ list_del_init(&lgr->list);
+ lgr->freeing = 1;
spin_unlock_bh(lgr_lock);
+ return true;
+}
+
+/* The caller must keep @lgr alive for the duration of the call. */
+void smc_lgr_cleanup_early(struct smc_link_group *lgr)
+{
+ if (!smc_lgr_claim(lgr))
+ return; /* another context owns the termination */
__smc_lgr_terminate(lgr, true);
}
@@ -1260,10 +1280,12 @@ void smc_conn_free(struct smc_connection *conn)
if (current_work() != &conn->abort_work)
cancel_work_sync(&conn->abort_work);
}
- if (!list_empty(&lgr->list)) {
+ /* The handshake can retry another device or SMC version with this
+ * connection, so it must never stay registered in an lgr it left.
+ */
+ if (!list_empty(&lgr->list))
smc_buf_unuse(conn, lgr); /* allow buffer reuse */
- smc_lgr_unregister_conn(conn);
- }
+ smc_lgr_unregister_conn(conn);
if (!lgr->conns_num)
smc_lgr_schedule_free_work(lgr);
@@ -1498,6 +1520,15 @@ static void smc_conn_kill(struct smc_connection *conn, bool soft)
{
struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
+ if (conn->freed) {
+ /* The connection was already freed, e.g. by a close or
+ * a handshake that fell back to TCP. Do not abort a socket
+ * that is no longer part of this link group.
+ */
+ smc_lgr_unregister_conn(conn);
+ return;
+ }
+
if (conn->lgr->is_smcd && conn->lgr->peer_shutdown)
conn->local_tx_ctrl.conn_state_flags.peer_conn_abort = 1;
else
@@ -1545,12 +1576,20 @@ static void __smc_lgr_terminate(struct smc_link_group *lgr, bool soft)
struct smc_connection *conn;
struct smc_sock *smc;
struct rb_node *node;
+ spinlock_t *lgr_lock;
- if (lgr->terminating)
+ smc_lgr_list_head(lgr, &lgr_lock);
+ spin_lock_bh(lgr_lock);
+ if (lgr->terminating) {
+ spin_unlock_bh(lgr_lock);
return; /* lgr already terminating */
- /* cancel free_work sync, will terminate when lgr->freeing is set */
- cancel_delayed_work(&lgr->free_work);
+ }
lgr->terminating = 1;
+ spin_unlock_bh(lgr_lock);
+ /* The lgr is claimed, so no new free_work can be armed; wait for
+ * one that is already queued or running.
+ */
+ cancel_delayed_work_sync(&lgr->free_work);
/* kill remaining link group connections */
read_lock_bh(&lgr->conns_lock);
@@ -1561,7 +1600,11 @@ static void __smc_lgr_terminate(struct smc_link_group *lgr, bool soft)
sock_hold(&smc->sk); /* sock_put below */
read_unlock_bh(&lgr->conns_lock);
lock_sock(&smc->sk);
- smc_conn_kill(conn, soft);
+ /* The connection may have been re-registered in another
+ * link group by a retried handshake in the meantime.
+ */
+ if (conn->lgr == lgr)
+ smc_conn_kill(conn, soft);
release_sock(&smc->sk);
sock_put(&smc->sk); /* sock_hold above */
read_lock_bh(&lgr->conns_lock);
@@ -1575,17 +1618,8 @@ static void __smc_lgr_terminate(struct smc_link_group *lgr, bool soft)
/* unlink link group and schedule termination */
void smc_lgr_terminate_sched(struct smc_link_group *lgr)
{
- spinlock_t *lgr_lock;
-
- smc_lgr_list_head(lgr, &lgr_lock);
- spin_lock_bh(lgr_lock);
- if (list_empty(&lgr->list) || lgr->terminating || lgr->freeing) {
- spin_unlock_bh(lgr_lock);
+ if (!smc_lgr_claim(lgr))
return; /* lgr already terminating */
- }
- list_del_init(&lgr->list);
- lgr->freeing = 1;
- spin_unlock_bh(lgr_lock);
schedule_work(&lgr->terminate_work);
}
diff --git a/net/smc/smc_core.h b/net/smc/smc_core.h
index 69b54ecd65031..bc32e6c08fb56 100644
--- a/net/smc/smc_core.h
+++ b/net/smc/smc_core.h
@@ -288,9 +288,9 @@ struct smc_link_group {
struct delayed_work free_work; /* delayed freeing of an lgr */
struct work_struct terminate_work; /* abnormal lgr termination */
struct workqueue_struct *tx_wq; /* wq for conn. tx workers */
- u8 sync_err : 1; /* lgr no longer fits to peer */
- u8 terminating : 1;/* lgr is terminating */
- u8 freeing : 1; /* lgr is being freed */
+ u8 sync_err; /* lgr no longer fits to peer */
+ u8 terminating; /* lgr is terminating */
+ u8 freeing; /* lgr is being freed */
refcount_t refcnt; /* lgr reference count */
bool is_smcd; /* SMC-R or SMC-D */
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 009/555] net/mlx5e: Fix queue stats access to queues without stats
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 008/555] net/smc: fix link group ownership in handshake abort Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 010/555] tcp: do not coalesce segments after FIN Greg Kroah-Hartman
` (57 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Tariq Toukan,
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 9a24799e219b1699bb1c144248c8c500b9504db5 ]
I am seeing the following mlx5e crash in the Meta fleet:
pc : mlx5e_get_queue_stats_rx+0x4c/0xc8
Call trace:
mlx5e_get_queue_stats_rx+0x4c/0xc8 (P)
netdev_stat_queue_sum+0x78/0x480
netdev_nl_qstats_get_dump_one+0xf0/0x268
netdev_nl_qstats_get_dumpit+0x7c/0x1f8
When dumping device-wide qstats, the core calls the per-queue callbacks
for every queue below real_num_{rx,tx}_queues, regardless of whether the
netdev is up. Some of those queues have no stats behind them:
- RX stats live in priv->channel_stats[], which only has entries for
channels that have been opened (stats_nch). real_num_rx_queues can
be larger, for example after the channel count is raised while the
netdev is down, or after opening the channels failed part way.
- TX stats are looked up in priv->txq2sq_stats[], which is NULL for
SQs that were never activated and for HTB queues while the channels
are closed.
In both cases the callback dereferences a NULL pointer. The dump needs
no privileges, so any user can trigger it.
Return early for RX queues at or above stats_nch and for TX queues
without SQ stats.
Fixes: 7b66ae536a78 ("net/mlx5e: Add per queue netdev-genl stats")
Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261104-mlx5e-qstats-null-v1-1-a6a003245cec@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Adjusted the patch context for the existing ASSERT_RTNL() in the RX callback and the TX callback ending after packet and byte counters. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 1f46eae73319d..d6152dac2432e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5291,7 +5291,7 @@ static void mlx5e_get_queue_stats_rx(struct net_device *dev, int i,
struct mlx5e_rq_stats *rq_stats;
ASSERT_RTNL();
- if (mlx5e_is_uplink_rep(priv) || !mlx5e_stats_nch_read(priv))
+ if (mlx5e_is_uplink_rep(priv) || i >= mlx5e_stats_nch_read(priv))
return;
channel_stats = priv->channel_stats[i];
@@ -5319,6 +5319,9 @@ static void mlx5e_get_queue_stats_tx(struct net_device *dev, int i,
* inactive sqs.
*/
sq_stats = priv->txq2sq_stats[i];
+ if (!sq_stats)
+ return;
+
stats->packets = sq_stats->packets;
stats->bytes = sq_stats->bytes;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 010/555] tcp: do not coalesce segments after FIN
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 009/555] net/mlx5e: Fix queue stats access to queues without stats Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 011/555] tcp: fastopen: note that a child socket was created Greg Kroah-Hartman
` (56 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Eric Dumazet,
Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunwoo Kim <imv4bel@gmail.com>
[ Upstream commit 1c46780dec48893b8c25fd5e33a3127e8dc39dd4 ]
A FIN consumes a sequence number. If another FIN segment is coalesced
into an skb that already carries FIN, end_seq advances to account for
the additional FIN, but tcp_flags still contains only one FIN bit.
When the preceding gap is filled and tcp_ofo_queue() processes the
coalesced skb, rcv_nxt advances to the skb's end_seq. When the receive
path consumes all data in the skb, copied_seq advances by the data
length and one sequence number for FIN. If three or more FIN segments
have been coalesced into one skb, tcp_inq() can still return a positive
value after the receive queue becomes empty and the SOCK_DONE adjustment
is applied.
TCP_ZEROCOPY_RECEIVE is another consumer affected by this state.
tcp_zerocopy_receive() takes its length from tcp_inq() and follows
skb->next without checking for the end of the receive queue.
Software kTLS receive is one consumer affected by this state. When
strp->copy_mode is false, tls_strp_msg_consume() calls the TCP helper
tcp_read_done() to consume the current TLS record. In the reproducer,
tcp_read_done() consumed the record data and one FIN before freeing the
receive skb.
When kTLS looked for the next record, tcp_inq() reported at least
TLS_HEADER_SIZE bytes even though the receive queue was empty.
tcp_recv_skb() returned NULL, so tls_strp_load_anchor_with_queue() hit
WARN_ON_ONCE() and returned without updating the anchor.
Since tcp_inq() had reported at least TLS_HEADER_SIZE,
tls_strp_read_sock() proceeded to tls_strp_check_queue_ok().
skb_shinfo(strp->anchor)->frag_list still pointed to the freed receive
skb. tls_strp_check_queue_ok() then read TCP_SKB_CB(first)->seq through
the stale pointer, causing a use-after-free.
The reproducer followed this call path:
tls_rx_rec_done()
tls_strp_msg_consume()
tcp_read_done() // frees the receive skb
tls_strp_check_rcv()
tls_strp_read_sock()
tls_strp_load_anchor_with_queue() // returns after WARN_ON_ONCE()
tcp_recv_skb() == NULL
tls_strp_check_queue_ok()
TCP_SKB_CB(first)->seq // reads the freed receive skb
KASAN reported:
BUG: KASAN: slab-use-after-free in tls_strp_check_queue_ok.isra.0+0x5f/0x100
Read of size 4 at addr ffff888103169ca8 by task ktls-server/71
...
Call Trace:
<TASK>
...
tls_strp_check_queue_ok.isra.0+0x5f/0x100
tls_strp_check_rcv+0x2a9/0x400
...
tls_sw_recvmsg+0x3ce/0xa10
...
sock_recvmsg+0xea/0x100
__sys_recvfrom+0x142/0x1f0
...
__x64_sys_recvfrom+0x76/0x90
do_syscall_64+0xdd/0x4a0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
...
</TASK>
...
Freed by task 71:
...
napi_skb_cache_put+0x24/0xf0
skb_attempt_defer_free+0x183/0x3b0
tcp_read_done+0x2d4/0x340
tls_strp_msg_consume+0x45/0x80
tls_sw_recvmsg+0x3c4/0xa10
...
In tcp_try_coalesce(), skip coalescing when the destination skb already
carries FIN. tcp_add_backlog() calls skb_try_coalesce() directly instead
of using this helper, so add the same check there. Since both paths check
only the destination skb, a final segment carrying data and FIN can still
be coalesced into an skb without FIN when the other coalescing checks pass.
Fixes: e93a0435f809 ("tcp: allow segment with FIN in tcp_try_coalesce()")
Fixes: 4f693b55c3d2 ("tcp: implement coalescing on backlog queue")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/au3HMfqNW3_DRMqS@v4bel
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_input.c | 4 ++++
net/ipv4/tcp_ipv4.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index eb8f824254866..7784ef49037ba 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4943,6 +4943,10 @@ static bool tcp_try_coalesce(struct sock *sk,
if (!tcp_skb_can_collapse_rx(to, from))
return false;
+ /* Nothing follows a FIN. */
+ if (unlikely(TCP_SKB_CB(to)->tcp_flags & TCPHDR_FIN))
+ return false;
+
if (!skb_try_coalesce(to, from, fragstolen, &delta))
return false;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 293a3b2bdd9e3..7699a99177891 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2060,6 +2060,8 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb,
TCP_SKB_CB(skb)->tcp_flags) & TCPHDR_ACK) ||
((TCP_SKB_CB(tail)->tcp_flags ^
TCP_SKB_CB(skb)->tcp_flags) & (TCPHDR_ECE | TCPHDR_CWR)) ||
+ /* Nothing follows a FIN, see tcp_try_coalesce() */
+ (TCP_SKB_CB(tail)->tcp_flags & TCPHDR_FIN) ||
!tcp_skb_can_collapse_rx(tail, skb) ||
thtail->doff != th->doff ||
memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th)))
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 011/555] tcp: fastopen: note that a child socket was created
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 010/555] tcp: do not coalesce segments after FIN Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 012/555] tcp: fix request_sock use-after-free during Fast Open accept() Greg Kroah-Hartman
` (55 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jeremy Harris, Eric Dumazet,
Neal Cardwell, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Harris <jgh@exim.org>
[ Upstream commit bc2550b4e195754fbb24aac1f012d3dd9e3b4edc ]
tcp: fastopen: note that a child socket was created
This uses up the last bit in a field of tcp_sock.
Signed-off-by: Jeremy Harris <jgh@exim.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20250423124334.4916-2-jgh@exim.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 62754aad50d0 ("tcp: fix request_sock use-after-free during Fast Open accept()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/tcp.h | 3 ++-
net/ipv4/tcp.c | 1 +
net/ipv4/tcp_fastopen.c | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 00ea96fec2273..ea54a107f307c 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -384,7 +384,8 @@ struct tcp_sock {
syn_fastopen:1, /* SYN includes Fast Open option */
syn_fastopen_exp:1,/* SYN includes Fast Open exp. option */
syn_fastopen_ch:1, /* Active TFO re-enabling probe */
- syn_data_acked:1;/* data in SYN is acked by SYN-ACK */
+ syn_data_acked:1,/* data in SYN is acked by SYN-ACK */
+ syn_fastopen_child:1; /* created TFO passive child socket */
u8 keepalive_probes; /* num of allowed keep alive probes */
u32 tcp_tx_delay; /* delay (in usec) added to TX packets */
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 69b4e194ba135..d1999b1cedaa1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3400,6 +3400,7 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->rack.reo_wnd_persist = 0;
tp->rack.dsack_seen = 0;
tp->syn_data_acked = 0;
+ tp->syn_fastopen_child = 0;
tp->rx_opt.saw_tstamp = 0;
tp->rx_opt.dsack = 0;
tp->rx_opt.num_sacks = 0;
diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
index ac4fa51240290..6ccee7480232d 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -404,6 +404,7 @@ struct sock *tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
}
NET_INC_STATS(sock_net(sk),
LINUX_MIB_TCPFASTOPENPASSIVE);
+ tcp_sk(child)->syn_fastopen_child = 1;
return child;
}
NET_INC_STATS(sock_net(sk),
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 012/555] tcp: fix request_sock use-after-free during Fast Open accept()
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 011/555] tcp: fastopen: note that a child socket was created Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 013/555] net: gro: invalidate frag0 after a pull Greg Kroah-Hartman
` (54 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunwoo Kim <imv4bel@gmail.com>
[ Upstream commit 62754aad50d0b30938bd8ce30b43474ce502a2af ]
Commit e3d95ad7da4f ("inet: avoid fastopen lock for regular accept()")
made inet_csk_accept() check tfo_listener before taking fastopenq.lock
to avoid taking the lock for connections that did not use Fast Open.
reqsk_fastopen_remove() clears tfo_listener while holding fastopenq.lock,
then reads req->sk. If inet_csk_accept() concurrently observes
tfo_listener after it has been cleared, it skips fastopenq.lock and
drops the last reference to the request_sock. This can free the
request_sock while reqsk_fastopen_remove() is still using it.
If the freed memory is reused for a new request_sock with req->sk ==
NULL, the reset path in reqsk_fastopen_remove() can append the new
request_sock to the original listener's list of requests that caused an
RST. After the new request_sock is freed, the next append writes through
the stale rskq_rst_tail into freed memory.
KASAN reported the following use-after-free when writing
fastopenq->rskq_rst_tail->dl_next = req:
BUG: KASAN: slab-use-after-free in reqsk_fastopen_remove+0x142/0x210
Write of size 8 at addr ffff888108230688 by task swapper/5/0
...
Call Trace:
<IRQ>
...
reqsk_fastopen_remove+0x142/0x210
tcp_check_req+0x96f/0xdd0
...
tcp_rcv_state_process+0x19c/0x26b0
...
tcp_v4_do_rcv+0x16e/0x490
tcp_v4_rcv+0x14a0/0x1af0
...
ip_protocol_deliver_rcu+0x39/0x1e0
ip_local_deliver_finish+0x124/0x1e0
ip_local_deliver+0xfb/0x1e0
...
</IRQ>
To widen the race windows, mdelay(5) was added after newsk = req->sk,
mdelay(20) after the if (req) reqsk_put(req) block, and mdelay(100)
after tcp_rsk(req)->tfo_listener = false. The KASAN report above was
reproduced with this kernel.
For the lockless check, use tcp_sk(newsk)->syn_fastopen_child instead of
tfo_listener, which reqsk_fastopen_remove() clears.
syn_fastopen_child is a field of the Fast Open child TCP socket
referenced by newsk, not of the request_sock. It is set before the child
socket is added to the accept queue. The paths that call
reqsk_fastopen_remove() in response to a remote ACK or RST do not clear
this field.
inet_csk_accept() uses this field to take fastopenq.lock only for Fast
Open child sockets and rechecks tfo_listener while holding the lock.
Connections that did not use Fast Open continue to avoid the lock.
Fixes: e3d95ad7da4f ("inet: avoid fastopen lock for regular accept()")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/avQKA_YTAThtbsYU@v4bel
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/inet_connection_sock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 6b6a195ca7954..7439996bdc0c2 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -683,7 +683,7 @@ struct sock *inet_csk_accept(struct sock *sk, struct proto_accept_arg *arg)
newsk = req->sk;
if (sk->sk_protocol == IPPROTO_TCP &&
- tcp_rsk(req)->tfo_listener) {
+ tcp_sk(newsk)->syn_fastopen_child) {
spin_lock_bh(&queue->fastopenq.lock);
if (tcp_rsk(req)->tfo_listener) {
/* We are still waiting for the final ACK from 3WHS
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 013/555] net: gro: invalidate frag0 after a pull
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 012/555] tcp: fix request_sock use-after-free during Fast Open accept() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 014/555] wifi: mac80211: fix use-after-free on TTLM disconnect Greg Kroah-Hartman
` (53 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Taesoo Kim, Cen Zhang, 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 98d949a15ff9d3fffaa6983223178374aab92db6 ]
Since commit bd56a29c7a4e ("net: gro: change skb_gro_network_header()"),
skb_gro_header_slow() no longer invalidates NAPI_GRO_CB(skb)->frag0
after pskb_may_pull(). skb_gro_may_pull() keeps comparing against the
frag0_len value set in skb_gro_reset_offset(), assuming that after a
slow pull, all later accesses are beyond frag0_len.
This is not true:
- udp4_gro_receive() and udp6_gro_receive() read the network header
with skb_gro_network_header() after udp_gro_udphdr() pulled the
UDP header.
- vxlan_gro_receive() calls skb_gro_remcsum_cleanup() at a lower
offset after the inner handlers pulled their headers.
- skb_gro_remcsum_process() can pull beyond the inner Ethernet header
before eth_gro_receive() reads it.
- napi_frags_skb() calls __skb_pull(skb, ETH_HLEN) after a slow pull,
so frag0 still points to the Ethernet header.
If the pull consumed the first page fragment, __skb_pull_tail() released
it. If the head had to grow, pskb_expand_head() freed the old one.
These reads, and the 2-byte write in skb_gro_remcsum_cleanup(), then
access memory the skb no longer holds a reference on.
esp4_gro_receive(), esp6_gro_receive(), skb_gro_receive_list() and
udp_gro_receive_segment() also pull directly and never invalidated
frag0.
Add skb_gro_frag0_invalidate(), which only clears frag0_len, and call
it before each of these pulls. This is a single store in the slow path,
and frag0 stays non NULL, so skb_gro_network_header() does not need
a NULL test.
frag0 must be invalidated even if the pull fails: __pskb_pull_tail()
can return NULL after pskb_expand_head() freed the old head, for
instance if a frag_list member has to be cloned or pulled.
As frag0 is now invalidated before a pull that can fail,
gro_try_pull_from_frag0() can see an skb whose linear part does not
cover skb_gro_offset() while frag0 still points to the start of the
packet, for instance after skb_gro_remcsum_cleanup() pulled a shorter
length. Copying from frag0 would then corrupt the headers: only use
frag0 while frag0_len is not zero, and use pskb_may_pull() otherwise.
If this pull fails, for instance after a failed pskb_pull() in
esp4_gro_receive(), do not hold the packet: later GRO lookups and
gro_complete() handlers expect its headers in the linear part.
This was found by Taesoo Kim and Cen Zhang, using LLM assisted code
analysis, and confirmed with reproducers.
Fixes: bd56a29c7a4e ("net: gro: change skb_gro_network_header()")
Fixes: 9fd1ff5d2ac7 ("udp: Support UDP fraglist GRO/GSO.")
Cc: stable@vger.kernel.org
Reported-by: Taesoo Kim <tsgatesv@gmail.com>
Reported-by: Cen Zhang <cenzhang@linux.microsoft.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261104151042.1157782-3-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/gro.h | 10 ++++++++++
net/core/gro.c | 20 ++++++++++++++++----
net/ipv4/esp4_offload.c | 1 +
net/ipv4/udp_offload.c | 1 +
net/ipv6/esp6_offload.c | 1 +
5 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/include/net/gro.h b/include/net/gro.h
index 8cb718eae5b32..33768091ccf7f 100644
--- a/include/net/gro.h
+++ b/include/net/gro.h
@@ -163,9 +163,19 @@ static inline bool skb_gro_may_pull(const struct sk_buff *skb,
return likely(hlen <= NAPI_GRO_CB(skb)->frag0_len);
}
+/* A pull can release the page fragment frag0 points to, or reallocate
+ * skb->head, even if it fails. Call this before the pull, to make sure later
+ * skb_gro_header() and skb_gro_network_header() calls no longer use frag0.
+ */
+static inline void skb_gro_frag0_invalidate(struct sk_buff *skb)
+{
+ NAPI_GRO_CB(skb)->frag0_len = 0;
+}
+
static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
unsigned int offset)
{
+ skb_gro_frag0_invalidate(skb);
if (!pskb_may_pull(skb, hlen))
return NULL;
diff --git a/net/core/gro.c b/net/core/gro.c
index 3cf9855991efe..f85b9c4c3fbd7 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -249,6 +249,7 @@ int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
if (unlikely(skb->remcsum_offload))
return -EINVAL;
+ skb_gro_frag0_invalidate(skb);
if (!pskb_may_pull(skb, skb_gro_offset(skb))) {
NAPI_GRO_CB(skb)->flush = 1;
return -ENOMEM;
@@ -463,12 +464,19 @@ static void gro_pull_from_frag0(struct sk_buff *skb, int grow)
}
}
-static void gro_try_pull_from_frag0(struct sk_buff *skb)
+static bool gro_try_pull_from_frag0(struct sk_buff *skb)
{
int grow = skb_gro_offset(skb) - skb_headlen(skb);
- if (grow > 0)
+ if (grow <= 0)
+ return true;
+
+ /* frag0 can only be used if no pull happened. */
+ if (likely(NAPI_GRO_CB(skb)->frag0_len)) {
gro_pull_from_frag0(skb, grow);
+ return true;
+ }
+ return pskb_may_pull(skb, skb_gro_offset(skb));
}
static void gro_flush_oldest(struct napi_struct *napi, struct list_head *head)
@@ -569,13 +577,17 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
if (NAPI_GRO_CB(skb)->flush)
goto normal;
+ /* Must be called before setting NAPI_GRO_CB(skb)->{age|last}.
+ * A held packet must have its headers in the linear part.
+ */
+ if (unlikely(!gro_try_pull_from_frag0(skb)))
+ goto normal;
+
if (unlikely(gro_list->count >= MAX_GRO_SKBS))
gro_flush_oldest(napi, &gro_list->list);
else
gro_list->count++;
- /* Must be called before setting NAPI_GRO_CB(skb)->{age|last} */
- gro_try_pull_from_frag0(skb);
NAPI_GRO_CB(skb)->age = jiffies;
NAPI_GRO_CB(skb)->last = skb;
if (!skb_is_gso(skb))
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index abd77162f5e75..2309468cfc3d4 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -37,6 +37,7 @@ static struct sk_buff *esp4_gro_receive(struct list_head *head,
__be32 seq;
__be32 spi;
+ skb_gro_frag0_invalidate(skb);
if (!pskb_pull(skb, offset))
return NULL;
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 24f2cd86bbb5b..7df56d85ccacb 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -603,6 +603,7 @@ static struct sk_buff *udp_gro_receive_segment(struct list_head *head,
pp = p;
} else {
if (NAPI_GRO_CB(skb)->is_flist) {
+ skb_gro_frag0_invalidate(skb);
if (!pskb_may_pull(skb, skb_gro_offset(skb))) {
NAPI_GRO_CB(skb)->flush = 1;
return NULL;
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index 22895521a57d0..ca947cb94fb78 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -64,6 +64,7 @@ static struct sk_buff *esp6_gro_receive(struct list_head *head,
if (NAPI_GRO_CB(skb)->proto == IPPROTO_UDP)
encap_type = UDP_ENCAP_ESPINUDP;
+ skb_gro_frag0_invalidate(skb);
if (!pskb_pull(skb, offset))
return NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 014/555] wifi: mac80211: fix use-after-free on TTLM disconnect
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 013/555] net: gro: invalidate frag0 after a pull Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 015/555] dm: fix infinite loop in dm_blk_do_report_zones() Greg Kroah-Hartman
` (52 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Berg, 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 4af2b71495a3f12196cbea1c9a502c62ada867be ]
If ieee80211_process_adv_ttlm() disconnects, and some other
changes were also detected in the beacon, the link update
to the driver is still done, leading to use-after-free. Fix
this by returning, like other functions, whether or not the
update was accepted by the function.
Cc: stable@vger.kernel.org
Fixes: 702e80470a33 ("wifi: mac80211: support handling of advertised TID-to-link mapping")
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20261102220313.3cf5e709417b.I339967c7e614057253aa68c005d9ae220577f99a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ sashal: Kept this tree's timer API and function placement, applying only the bool return change and the goto free in the beacon handler, since upstream context lines differ. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/mlme.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 3a08bb4dfca50..d4c69a68774f8 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -6491,15 +6491,15 @@ ieee80211_parse_adv_t2l(struct ieee80211_sub_if_data *sdata,
return 0;
}
-static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
- struct ieee802_11_elems *elems,
- u64 beacon_ts)
+static bool ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
+ struct ieee802_11_elems *elems,
+ u64 beacon_ts)
{
u8 i;
int ret;
if (!ieee80211_vif_is_mld(&sdata->vif))
- return;
+ return true;
if (!elems->ttlm_num) {
if (sdata->u.mgd.ttlm_info.switch_time) {
@@ -6517,14 +6517,14 @@ static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
0);
if (ret) {
sdata_info(sdata, "Failed setting valid/dormant links\n");
- return;
+ return true;
}
ieee80211_vif_cfg_change_notify(sdata,
BSS_CHANGED_MLD_VALID_LINKS);
}
memset(&sdata->u.mgd.ttlm_info, 0,
sizeof(sdata->u.mgd.ttlm_info));
- return;
+ return true;
}
for (i = 0; i < elems->ttlm_num; i++) {
@@ -6536,7 +6536,7 @@ static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
if (res) {
__ieee80211_disconnect(sdata);
- return;
+ return false;
}
if (ttlm_info.switch_time) {
@@ -6561,7 +6561,7 @@ static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
* switch the AP will continue to announce it anyway.
*/
if (delay > IEEE80211_ADV_TTLM_ST_UNDERFLOW)
- return;
+ return true;
delay_jiffies = TU_TO_JIFFIES(delay);
@@ -6580,9 +6580,11 @@ static void ieee80211_process_adv_ttlm(struct ieee80211_sub_if_data *sdata,
wiphy_delayed_work_queue(sdata->local->hw.wiphy,
&sdata->u.mgd.ttlm_work,
delay_jiffies);
- return;
+ return true;
}
}
+
+ return true;
}
static void
@@ -7025,8 +7027,9 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,
elems->cisco_dtpc_elem);
ieee80211_ml_reconfiguration(sdata, elems);
- ieee80211_process_adv_ttlm(sdata, elems,
- le64_to_cpu(mgmt->u.beacon.timestamp));
+ if (!ieee80211_process_adv_ttlm(sdata, elems,
+ le64_to_cpu(mgmt->u.beacon.timestamp)))
+ goto free;
ieee80211_link_info_change_notify(sdata, link, changed);
free:
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 015/555] dm: fix infinite loop in dm_blk_do_report_zones()
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 014/555] wifi: mac80211: fix use-after-free on TTLM disconnect Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 016/555] iio: common: scmi_sensors: fix truncating 64-bit divisions Greg Kroah-Hartman
` (51 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Bundschuh, Mikulas Patocka,
Damien Le Moal, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Bundschuh <mkbund@amazon.com>
[ Upstream commit 648320de920b30ae1730bbf0e8b86c0df0fb490a ]
If the device underlying a zoned target is removed, its capacity is set
to 0 and blkdev_report_zones() returns 0 without reporting any zones.
The mapped device keeps its old capacity, so args->zone_idx and
args->next_sector never advance and dm_blk_do_report_zones() loops
forever. On non-preemptible kernels this causes soft lockups and RCU
stalls.
The following sequence of commands triggers the hang:
modprobe scsi_debug zbc=managed dev_size_mb=1024 zone_size_mb=64
udevadm settle
echo '0 2097152 linear /dev/sda 0' | dmsetup create lin
echo 1 > /sys/block/sda/device/delete
blkzone report -o 0 -c 1 /dev/mapper/lin
Fix this by returning -EIO when a target reports no zones. The target
always maps args->next_sector, so a zero return means the underlying
device no longer covers that sector.
Fixes: d41003513e61 ("block: rework zone reporting")
Cc: stable@vger.kernel.org
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
[ Context differs due to commit: fdb9aed869f3 ]
Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-zone.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/md/dm-zone.c b/drivers/md/dm-zone.c
index 85777d875cc00..00c3b35ed2901 100644
--- a/drivers/md/dm-zone.c
+++ b/drivers/md/dm-zone.c
@@ -40,6 +40,8 @@ static int dm_blk_do_report_zones(struct mapped_device *md, struct dm_table *t,
nr_zones - args.zone_idx);
if (ret < 0)
return ret;
+ if (!ret)
+ return -EIO;
} while (args.zone_idx < nr_zones &&
args.next_sector < get_capacity(disk));
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 016/555] iio: common: scmi_sensors: fix truncating 64-bit divisions
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 015/555] dm: fix infinite loop in dm_blk_do_report_zones() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 017/555] iio: proximity: sx9500: ignore event config writes that dont change state Greg Kroah-Hartman
` (50 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Arnav Kapoor,
Andy Shevchenko, Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit 043ececf147863fbd253687aa0b9edcac358a711 upstream.
do_div() divides a 64-bit dividend by a 32-bit divisor: the divisor is
stored in a uint32_t on all architectures. The driver passes 64-bit
divisors to it in several places, so they are silently truncated:
- scmi_iio_set_odr_val() divides by uHz, which exceeds 32 bits for
sampling frequencies above ~4294 Hz.
- convert_ns_to_freq() divides by interval_ns, which exceeds 32 bits
for update intervals of ~4.29 s and above. If its low 32 bits happen
to be zero, this is a division by zero.
- scmi_iio_get_odr_val(), scmi_iio_convert_interval_to_ns(),
scmi_iio_sensor_update_cb() and scmi_iio_get_raw_available() divide
by int_pow(10, n), which returns u64 and exceeds 32 bits for n >= 10.
The SCMI exponent fields allow values down to -16.
Truncation results in wrong sampling frequency, timestamp and
raw_available values being reported to userspace.
Use div64_u64() and div64_u64_rem(), which take a 64-bit divisor.
Fixes: f774117c96f9 ("iio/scmi: Adding support for IIO SCMI Based Sensors")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606040245.XfmRpBhA-lkp@intel.com/
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ Use NSEC_PER_SEC instead of HZ_PER_GHZ, which this tree's units.h
doesn't have (same value, and what the old code used). ]
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/common/scmi_sensors/scmi_iio.c | 27 +++++++++++-----------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/drivers/iio/common/scmi_sensors/scmi_iio.c b/drivers/iio/common/scmi_sensors/scmi_iio.c
index ed15dcbf4cf6b..bcd85bdaebbef 100644
--- a/drivers/iio/common/scmi_sensors/scmi_iio.c
+++ b/drivers/iio/common/scmi_sensors/scmi_iio.c
@@ -14,6 +14,7 @@
#include <linux/iio/sysfs.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
+#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/scmi_protocol.h>
@@ -71,8 +72,7 @@ static int scmi_iio_sensor_update_cb(struct notifier_block *nb,
tstamp_scale = sensor->sensor_info->tstamp_scale +
const_ilog2(NSEC_PER_SEC) / const_ilog2(10);
if (tstamp_scale < 0) {
- do_div(time, int_pow(10, abs(tstamp_scale)));
- time_ns = time;
+ time_ns = div64_u64(time, int_pow(10, abs(tstamp_scale)));
} else {
time_ns = time * int_pow(10, tstamp_scale);
}
@@ -163,7 +163,7 @@ static int scmi_iio_set_odr_val(struct iio_dev *iio_dev, int val, int val2)
mult = scnprintf(buf, sizeof(buf), "%llu", sf) - 1;
sec = int_pow(10, mult) * MICROHZ_PER_HZ;
- do_div(sec, uHz);
+ sec = div64_u64(sec, uHz);
if (sec == 0) {
dev_err(&iio_dev->dev,
"Trying to set invalid sensor update value for sensor %s",
@@ -238,13 +238,10 @@ static int scmi_iio_read_avail(struct iio_dev *iio_dev,
static void convert_ns_to_freq(u64 interval_ns, u64 *hz, u64 *uhz)
{
- u64 rem, freq;
+ u64 rem;
- freq = NSEC_PER_SEC;
- rem = do_div(freq, interval_ns);
- *hz = freq;
- *uhz = rem * 1000000UL;
- do_div(*uhz, interval_ns);
+ *hz = div64_u64_rem(NSEC_PER_SEC, interval_ns, &rem);
+ *uhz = div64_u64(rem * MICROHZ_PER_HZ, interval_ns);
}
static int scmi_iio_get_odr_val(struct iio_dev *iio_dev, int *val, int *val2)
@@ -270,7 +267,8 @@ static int scmi_iio_get_odr_val(struct iio_dev *iio_dev, int *val, int *val2)
mult = SCMI_SENS_CFG_GET_UPDATE_EXP(sensor_config);
if (mult < 0) {
sensor_interval_mult = int_pow(10, abs(mult));
- do_div(sensor_update_interval, sensor_interval_mult);
+ sensor_update_interval = div64_u64(sensor_update_interval,
+ sensor_interval_mult);
} else {
sensor_interval_mult = int_pow(10, mult);
sensor_update_interval =
@@ -397,9 +395,9 @@ static ssize_t scmi_iio_get_raw_available(struct iio_dev *iio_dev,
*/
exponent = exponent - scale;
if (exponent < 0) {
- rem = do_div(resolution,
- int_pow(10, abs(exponent))
- );
+ resolution = div64_u64_rem(resolution,
+ int_pow(10, abs(exponent)),
+ &rem);
len = sysfs_emit(buf,
"[%lld %llu.%llu %lld]\n", min_range,
resolution, rem, max_range);
@@ -504,7 +502,8 @@ static u64 scmi_iio_convert_interval_to_ns(u32 val)
mult = SCMI_SENS_INTVL_GET_EXP(val);
if (mult < 0) {
sensor_interval_mult = int_pow(10, abs(mult));
- do_div(sensor_update_interval, sensor_interval_mult);
+ sensor_update_interval = div64_u64(sensor_update_interval,
+ sensor_interval_mult);
} else {
sensor_interval_mult = int_pow(10, mult);
sensor_update_interval =
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 017/555] iio: proximity: sx9500: ignore event config writes that dont change state
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.12 016/555] iio: common: scmi_sensors: fix truncating 64-bit divisions Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 018/555] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times Greg Kroah-Hartman
` (49 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jonathan Cameron,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit b8ed9165906597b69a46fabf39ab41690721ebe8 upstream.
sx9500_write_event_config() adjusts the channel and close/far user
counts on every write, even when the event is already in the requested
state. Writing 0 to a disabled event and then 1 leaves the counts at 0,
so the channel and its interrupts stay off while the event reads as
enabled. As channel_users[] is shared with raw reads, those can then
wait forever for a conversion. Writing 1 twice and then 0 has the
opposite effect.
Return early when the state doesn't change, as
sx_common_write_event_config() does.
Fixes: 4193c0f1d863 ("iio: driver for Semtech SX9500 proximity solution")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ Context: write_event_config() still takes int state here and tests
state == 1; the added check is unchanged. ]
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/proximity/sx9500.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
index 3f4eace05cfc6..1041d3defe4e7 100644
--- a/drivers/iio/proximity/sx9500.c
+++ b/drivers/iio/proximity/sx9500.c
@@ -551,6 +551,12 @@ static int sx9500_write_event_config(struct iio_dev *indio_dev,
mutex_lock(&data->mutex);
+ /* The user counts must only change when the state does. */
+ if (data->event_enabled[chan->channel] == state) {
+ ret = 0;
+ goto out_unlock;
+ }
+
if (state == 1) {
ret = sx9500_inc_chan_users(data, chan->channel);
if (ret < 0)
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 018/555] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 017/555] iio: proximity: sx9500: ignore event config writes that dont change state Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 019/555] mmc: jz4740: Remove the host before resetting the controller Greg Kroah-Hartman
` (48 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jean-Baptiste Maneyrol,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit 3a5e2ca34cadd9d5993064884aa5b9c4f6d71dff upstream.
struct inv_mpu6050_hw declares startup_time as { accel, gyro }, but
every entry of hw_info[] initializes it positionally as
{ *_GYRO_STARTUP_TIME, *_ACCEL_STARTUP_TIME }, so the two values are
swapped for all chips.
inv_mpu6050_switch_engine() waits for startup_time.gyro after enabling
the gyroscope, so it waits for the accelerometer startup time instead,
e.g. 20 ms instead of 60 ms on MPU6050 and 20 ms instead of 100 ms on
ICM20602, and the first gyroscope samples can be read before the sensor
has settled. Enabling only the accelerometer waits longer than needed.
Use designated initializers, so each value is assigned to the member it
is named after.
Fixes: e46a36d92da0 ("Add startup time for each chip using inv_mpu6050 driver")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ This tree has no IAM20380, IAM20680HP or IAM20680HT entries; the 16
entries it has are converted the same way. ]
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 80 +++++++++++++++++-----
1 file changed, 64 insertions(+), 16 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 19f428ce8ec5d..a303a03fd9be6 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -149,7 +149,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6500_WHOAMI_VALUE,
@@ -158,7 +161,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6515_WHOAMI_VALUE,
@@ -167,7 +173,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6880_WHOAMI_VALUE,
@@ -176,7 +185,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4096,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU6000_WHOAMI_VALUE,
@@ -185,7 +197,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9150_WHOAMI_VALUE,
@@ -194,7 +209,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6050,
.fifo_size = 1024,
.temp = {INV_MPU6050_TEMP_OFFSET, INV_MPU6050_TEMP_SCALE},
- .startup_time = {INV_MPU6050_GYRO_STARTUP_TIME, INV_MPU6050_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6050_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6050_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9250_WHOAMI_VALUE,
@@ -203,7 +221,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_MPU9255_WHOAMI_VALUE,
@@ -212,7 +233,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_MPU6500_TEMP_OFFSET, INV_MPU6500_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20608_WHOAMI_VALUE,
@@ -221,7 +245,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20608D_WHOAMI_VALUE,
@@ -230,7 +257,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20609_WHOAMI_VALUE,
@@ -239,7 +269,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20689_WHOAMI_VALUE,
@@ -248,7 +281,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 4 * 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20600_WHOAMI_VALUE,
@@ -257,7 +293,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 1008,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20602_GYRO_STARTUP_TIME, INV_ICM20602_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20602_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20602_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20602_WHOAMI_VALUE,
@@ -266,7 +305,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 1008,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20602_GYRO_STARTUP_TIME, INV_ICM20602_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20602_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20602_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_ICM20690_WHOAMI_VALUE,
@@ -275,7 +317,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 1024,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_ICM20690_GYRO_STARTUP_TIME, INV_ICM20690_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_ICM20690_ACCEL_STARTUP_TIME,
+ .gyro = INV_ICM20690_GYRO_STARTUP_TIME,
+ },
},
{
.whoami = INV_IAM20680_WHOAMI_VALUE,
@@ -284,7 +329,10 @@ static const struct inv_mpu6050_hw hw_info[] = {
.config = &chip_config_6500,
.fifo_size = 512,
.temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE},
- .startup_time = {INV_MPU6500_GYRO_STARTUP_TIME, INV_MPU6500_ACCEL_STARTUP_TIME},
+ .startup_time = {
+ .accel = INV_MPU6500_ACCEL_STARTUP_TIME,
+ .gyro = INV_MPU6500_GYRO_STARTUP_TIME,
+ },
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 019/555] mmc: jz4740: Remove the host before resetting the controller
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 018/555] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 020/555] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set Greg Kroah-Hartman
` (47 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Olivier Louvignes, Ulf Hansson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Olivier Louvignes <olivier@mgcrea.io>
[ Upstream commit 6b8b1e8827837bf4cf1f87219038fddae9e81b0b ]
jz4740_mmc_remove() masks every interrupt and resets the controller
before mmc_remove_host(), which removes the card and lets the card's
driver send its last commands. Those commands then run on a controller
that was just reset, and can wait out the driver's 5 s request timeout.
With an SDIO card that cost 5 s on every unbind: on a HiBy R1 (Ingenic
X1600, a BCM43430A1 driven by brcmfmac), the CMD52 that
sdio_release_irq() sends from brcmfmac's remove waited 5.1 s. The
command had finished (END_CMD_RES set in MSC_STAT), but MSC_IMASK read
0xffffffff although the request had unmasked END_CMD_RES. MSC_STAT can
still show IS_RESETTING after jz4740_mmc_reset() returns, so the reset
most likely completed after that write and undid it.
Remove the host first, then quiesce the controller, as other host
drivers do. On the R1, unbinding the Wi-Fi's MSC now takes 0.65 s.
Fixes: 61bfbdb85687 ("MMC: Add support for the controller on JZ4740 SoCs.")
Cc: stable@vger.kernel.org
Signed-off-by: Olivier Louvignes <olivier@mgcrea.io>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
[ sashal: Kept del_timer_sync() instead of upstream's timer_delete_sync() in the context line, since the older timer API is what this tree uses. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/jz4740_mmc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
index 6a45991ca056f..9e8be3894e496 100644
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -1162,12 +1162,13 @@ static void jz4740_mmc_remove(struct platform_device *pdev)
{
struct jz4740_mmc_host *host = platform_get_drvdata(pdev);
+ /* The card's driver may still send commands as it goes */
+ mmc_remove_host(host->mmc);
+
del_timer_sync(&host->timeout_timer);
jz4740_mmc_set_irq_enabled(host, 0xff, false);
jz4740_mmc_reset(host);
- mmc_remove_host(host->mmc);
-
free_irq(host->irq, host);
if (host->use_dma)
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 020/555] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 019/555] mmc: jz4740: Remove the host before resetting the controller Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 021/555] kprobes: Adopt guard() and scoped_guard() Greg Kroah-Hartman
` (46 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrew Davison, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Davison <andy@dvsn.net>
[ Upstream commit fda103c1432f344e1cd548f346d157b1e67ee7c5 ]
parse_codec_mode() reads the vendor and subsystem IDs of a patch file's
[codec] line into an int, and skips the check when the value is zero or
negative, as documented. An ID with bit 31 set, such as SigmaTel's
0x8384xxxx or Intel's 0x8086xxxx, comes out negative, so it is taken as
a wildcard and the section is applied to every codec instead of the one
it names.
This was seen on an OpenPeak OpenFrame 2 with an IDT 92HD75B2X5
(0x111d7608). A patch file written for the STAC9202 (0x83847632) in the
related OpenFrame 1 was applied to it, swapping the headphone and
speaker pin configurations, so auto-mute never muted the speaker.
Read the IDs as long long, so real IDs are compared exactly. Values
written as negative numbers (e.g. -1) still act as wildcards, as
documented; a hex value such as 0xffffffff is now compared as written.
Tested on 6.18.60 on an OpenFrame 2, with a rebuilt snd-hda-codec and
the STAC9202 patch file: user_pin_configs stays empty for the IDT codec,
and the headphone and line-out pins are assigned as the BIOS sets them.
Not tested on a STAC9202 itself.
The bug was tracked down and this fix written with an AI coding
assistant (Claude Code, Claude Opus 5.5), which also ran the tests
above. I have reviewed the change and the tests.
Fixes: ef940b0403d4 ("ALSA: hda - Allow patching with any vendor/subsystem ids")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Davison <andy@dvsn.net>
Link: https://patch.msgid.link/20261106175518.18629-1-andy@dvsn.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/hda_sysfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
index c6081f3c1ccd8..47b29e163ac0c 100644
--- a/sound/pci/hda/hda_sysfs.c
+++ b/sound/pci/hda/hda_sysfs.c
@@ -520,11 +520,12 @@ static inline int strmatch(const char *a, const char *b)
static void parse_codec_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{
- int vendorid, subid, caddr;
+ long long vendorid, subid;
+ int caddr;
struct hda_codec *codec;
*codecp = NULL;
- if (sscanf(buf, "%i %i %i", &vendorid, &subid, &caddr) == 3) {
+ if (sscanf(buf, "%lli %lli %i", &vendorid, &subid, &caddr) == 3) {
list_for_each_codec(codec, bus) {
if ((vendorid <= 0 || codec->core.vendor_id == vendorid) &&
(subid <= 0 || codec->core.subsystem_id == subid) &&
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 021/555] kprobes: Adopt guard() and scoped_guard()
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 020/555] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 022/555] mmc: omap: synchronize clock timer before disabling fclk Greg Kroah-Hartman
` (45 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ Upstream commit 587e8e6d640bcf89a4bf29745a3c3fdfe8379ae0 ]
Use guard() or scoped_guard() for critical sections rather than
discrete lock/unlock pairs.
Link: https://lore.kernel.org/all/173289887835.73724.608223217359025939.stgit@devnote2/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Stable-dep-of: a553b499f22b ("kprobes: Validate re-registration earlier in register_kretprobe()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kprobes.c | 205 ++++++++++++++++++++---------------------------
1 file changed, 89 insertions(+), 116 deletions(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 7d0a378b2e44b..585ddaf8a6af4 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -144,10 +144,9 @@ static int collect_garbage_slots(struct kprobe_insn_cache *c);
kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c)
{
struct kprobe_insn_page *kip;
- kprobe_opcode_t *slot = NULL;
/* Since the slot array is not protected by rcu, we need a mutex */
- mutex_lock(&c->mutex);
+ guard(mutex)(&c->mutex);
retry:
rcu_read_lock();
list_for_each_entry_rcu(kip, &c->pages, list) {
@@ -158,9 +157,8 @@ kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c)
if (kip->slot_used[i] == SLOT_CLEAN) {
kip->slot_used[i] = SLOT_USED;
kip->nused++;
- slot = kip->insns + (i * c->insn_size);
rcu_read_unlock();
- goto out;
+ return kip->insns + (i * c->insn_size);
}
}
/* kip->nused is broken. Fix it. */
@@ -177,12 +175,12 @@ kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c)
/* All out of space. Need to allocate a new page. */
kip = kmalloc(KPROBE_INSN_PAGE_SIZE(slots_per_page(c)), GFP_KERNEL);
if (!kip)
- goto out;
+ return NULL;
kip->insns = c->alloc();
if (!kip->insns) {
kfree(kip);
- goto out;
+ return NULL;
}
INIT_LIST_HEAD(&kip->list);
memset(kip->slot_used, SLOT_CLEAN, slots_per_page(c));
@@ -191,14 +189,12 @@ kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c)
kip->ngarbage = 0;
kip->cache = c;
list_add_rcu(&kip->list, &c->pages);
- slot = kip->insns;
/* Record the perf ksymbol register event after adding the page */
perf_event_ksymbol(PERF_RECORD_KSYMBOL_TYPE_OOL, (unsigned long)kip->insns,
PAGE_SIZE, false, c->sym);
-out:
- mutex_unlock(&c->mutex);
- return slot;
+
+ return kip->insns;
}
/* Return true if all garbages are collected, otherwise false. */
@@ -259,7 +255,7 @@ void __free_insn_slot(struct kprobe_insn_cache *c,
struct kprobe_insn_page *kip;
long idx;
- mutex_lock(&c->mutex);
+ guard(mutex)(&c->mutex);
rcu_read_lock();
list_for_each_entry_rcu(kip, &c->pages, list) {
idx = ((long)slot - (long)kip->insns) /
@@ -285,7 +281,6 @@ void __free_insn_slot(struct kprobe_insn_cache *c,
collect_one_slot(kip, idx);
}
}
- mutex_unlock(&c->mutex);
}
/*
@@ -643,10 +638,9 @@ static void kprobe_optimizer(struct work_struct *work)
mutex_unlock(&kprobe_mutex);
}
-/* Wait for completing optimization and unoptimization */
-void wait_for_kprobe_optimizer(void)
+static void wait_for_kprobe_optimizer_locked(void)
{
- mutex_lock(&kprobe_mutex);
+ lockdep_assert_held(&kprobe_mutex);
while (!list_empty(&optimizing_list) || !list_empty(&unoptimizing_list)) {
mutex_unlock(&kprobe_mutex);
@@ -658,8 +652,14 @@ void wait_for_kprobe_optimizer(void)
mutex_lock(&kprobe_mutex);
}
+}
- mutex_unlock(&kprobe_mutex);
+/* Wait for completing optimization and unoptimization */
+void wait_for_kprobe_optimizer(void)
+{
+ guard(mutex)(&kprobe_mutex);
+
+ wait_for_kprobe_optimizer_locked();
}
bool optprobe_queued_unopt(struct optimized_kprobe *op)
@@ -889,10 +889,10 @@ static void optimize_all_kprobes(void)
struct kprobe *p;
unsigned int i;
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
/* If optimization is already allowed, just return. */
if (kprobes_allow_optimization)
- goto out;
+ return;
cpus_read_lock();
kprobes_allow_optimization = true;
@@ -904,8 +904,6 @@ static void optimize_all_kprobes(void)
}
cpus_read_unlock();
pr_info("kprobe jump-optimization is enabled. All kprobes are optimized if possible.\n");
-out:
- mutex_unlock(&kprobe_mutex);
}
#ifdef CONFIG_SYSCTL
@@ -915,12 +913,10 @@ static void unoptimize_all_kprobes(void)
struct kprobe *p;
unsigned int i;
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
/* If optimization is already prohibited, just return. */
- if (!kprobes_allow_optimization) {
- mutex_unlock(&kprobe_mutex);
+ if (!kprobes_allow_optimization)
return;
- }
cpus_read_lock();
kprobes_allow_optimization = false;
@@ -932,10 +928,8 @@ static void unoptimize_all_kprobes(void)
}
}
cpus_read_unlock();
- mutex_unlock(&kprobe_mutex);
-
/* Wait for unoptimizing completion. */
- wait_for_kprobe_optimizer();
+ wait_for_kprobe_optimizer_locked();
pr_info("kprobe jump-optimization is disabled. All kprobes are based on software breakpoint.\n");
}
@@ -947,7 +941,7 @@ static int proc_kprobes_optimization_handler(const struct ctl_table *table,
{
int ret;
- mutex_lock(&kprobe_sysctl_mutex);
+ guard(mutex)(&kprobe_sysctl_mutex);
sysctl_kprobes_optimization = kprobes_allow_optimization ? 1 : 0;
ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
@@ -955,7 +949,6 @@ static int proc_kprobes_optimization_handler(const struct ctl_table *table,
optimize_all_kprobes();
else
unoptimize_all_kprobes();
- mutex_unlock(&kprobe_sysctl_mutex);
return ret;
}
@@ -1030,7 +1023,8 @@ static void __disarm_kprobe(struct kprobe *p, bool reopt)
#define __arm_kprobe(p) arch_arm_kprobe(p)
#define __disarm_kprobe(p, o) arch_disarm_kprobe(p)
#define kprobe_disarmed(p) kprobe_disabled(p)
-#define wait_for_kprobe_optimizer() do {} while (0)
+#define wait_for_kprobe_optimizer_locked() \
+ lockdep_assert_held(&kprobe_mutex)
static int reuse_unused_kprobe(struct kprobe *ap)
{
@@ -1501,6 +1495,7 @@ _kprobe_addr(kprobe_opcode_t *addr, const char *symbol_name,
static kprobe_opcode_t *kprobe_addr(struct kprobe *p)
{
bool on_func_entry;
+
return _kprobe_addr(p->addr, p->symbol_name, p->offset, &on_func_entry);
}
@@ -1535,14 +1530,12 @@ static struct kprobe *__get_valid_kprobe(struct kprobe *p)
*/
static inline int warn_kprobe_rereg(struct kprobe *p)
{
- int ret = 0;
+ guard(mutex)(&kprobe_mutex);
- mutex_lock(&kprobe_mutex);
if (WARN_ON_ONCE(__get_valid_kprobe(p)))
- ret = -EINVAL;
- mutex_unlock(&kprobe_mutex);
+ return -EINVAL;
- return ret;
+ return 0;
}
static int check_ftrace_location(struct kprobe *p)
@@ -1631,44 +1624,17 @@ static int check_kprobe_address_safe(struct kprobe *p,
return ret;
}
-int register_kprobe(struct kprobe *p)
+static int __register_kprobe(struct kprobe *p)
{
int ret;
struct kprobe *old_p;
- struct module *probed_mod;
- kprobe_opcode_t *addr;
- bool on_func_entry;
-
- /* Adjust probe address from symbol */
- addr = _kprobe_addr(p->addr, p->symbol_name, p->offset, &on_func_entry);
- if (IS_ERR(addr))
- return PTR_ERR(addr);
- p->addr = addr;
-
- ret = warn_kprobe_rereg(p);
- if (ret)
- return ret;
- /* User can pass only KPROBE_FLAG_DISABLED to register_kprobe */
- p->flags &= KPROBE_FLAG_DISABLED;
- p->nmissed = 0;
- INIT_LIST_HEAD(&p->list);
-
- ret = check_kprobe_address_safe(p, &probed_mod);
- if (ret)
- return ret;
-
- mutex_lock(&kprobe_mutex);
-
- if (on_func_entry)
- p->flags |= KPROBE_FLAG_ON_FUNC_ENTRY;
+ guard(mutex)(&kprobe_mutex);
old_p = get_kprobe(p->addr);
- if (old_p) {
+ if (old_p)
/* Since this may unoptimize 'old_p', locking 'text_mutex'. */
- ret = register_aggr_kprobe(old_p, p);
- goto out;
- }
+ return register_aggr_kprobe(old_p, p);
cpus_read_lock();
/* Prevent text modification */
@@ -1677,7 +1643,7 @@ int register_kprobe(struct kprobe *p)
mutex_unlock(&text_mutex);
cpus_read_unlock();
if (ret)
- goto out;
+ return ret;
INIT_HLIST_NODE(&p->hlist);
hlist_add_head_rcu(&p->hlist,
@@ -1688,14 +1654,43 @@ int register_kprobe(struct kprobe *p)
if (ret) {
hlist_del_rcu(&p->hlist);
synchronize_rcu();
- goto out;
}
}
/* Try to optimize kprobe */
try_to_optimize_kprobe(p);
-out:
- mutex_unlock(&kprobe_mutex);
+ return 0;
+}
+
+int register_kprobe(struct kprobe *p)
+{
+ int ret;
+ struct module *probed_mod;
+ kprobe_opcode_t *addr;
+ bool on_func_entry;
+
+ /* Canonicalize probe address from symbol */
+ addr = _kprobe_addr(p->addr, p->symbol_name, p->offset, &on_func_entry);
+ if (IS_ERR(addr))
+ return PTR_ERR(addr);
+ p->addr = addr;
+
+ ret = warn_kprobe_rereg(p);
+ if (ret)
+ return ret;
+
+ /* User can pass only KPROBE_FLAG_DISABLED to register_kprobe */
+ p->flags &= KPROBE_FLAG_DISABLED;
+ if (on_func_entry)
+ p->flags |= KPROBE_FLAG_ON_FUNC_ENTRY;
+ p->nmissed = 0;
+ INIT_LIST_HEAD(&p->list);
+
+ ret = check_kprobe_address_safe(p, &probed_mod);
+ if (ret)
+ return ret;
+
+ ret = __register_kprobe(p);
if (probed_mod)
module_put(probed_mod);
@@ -1870,12 +1865,11 @@ void unregister_kprobes(struct kprobe **kps, int num)
if (num <= 0)
return;
- mutex_lock(&kprobe_mutex);
- for (i = 0; i < num; i++)
- if (__unregister_kprobe_top(kps[i]) < 0)
- kps[i]->addr = NULL;
- mutex_unlock(&kprobe_mutex);
-
+ scoped_guard(mutex, &kprobe_mutex) {
+ for (i = 0; i < num; i++)
+ if (__unregister_kprobe_top(kps[i]) < 0)
+ kps[i]->addr = NULL;
+ }
synchronize_rcu();
for (i = 0; i < num; i++)
if (kps[i]->addr)
@@ -2314,8 +2308,9 @@ void unregister_kretprobes(struct kretprobe **rps, int num)
if (num <= 0)
return;
- mutex_lock(&kprobe_mutex);
for (i = 0; i < num; i++) {
+ guard(mutex)(&kprobe_mutex);
+
if (__unregister_kprobe_top(&rps[i]->kp) < 0)
rps[i]->kp.addr = NULL;
#ifdef CONFIG_KRETPROBE_ON_RETHOOK
@@ -2324,7 +2319,6 @@ void unregister_kretprobes(struct kretprobe **rps, int num)
rcu_assign_pointer(rps[i]->rph->rp, NULL);
#endif
}
- mutex_unlock(&kprobe_mutex);
synchronize_rcu();
for (i = 0; i < num; i++) {
@@ -2405,18 +2399,14 @@ static void kill_kprobe(struct kprobe *p)
/* Disable one kprobe */
int disable_kprobe(struct kprobe *kp)
{
- int ret = 0;
struct kprobe *p;
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
/* Disable this kprobe */
p = __disable_kprobe(kp);
- if (IS_ERR(p))
- ret = PTR_ERR(p);
- mutex_unlock(&kprobe_mutex);
- return ret;
+ return IS_ERR(p) ? PTR_ERR(p) : 0;
}
EXPORT_SYMBOL_GPL(disable_kprobe);
@@ -2426,20 +2416,16 @@ int enable_kprobe(struct kprobe *kp)
int ret = 0;
struct kprobe *p;
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
/* Check whether specified probe is valid. */
p = __get_valid_kprobe(kp);
- if (unlikely(p == NULL)) {
- ret = -EINVAL;
- goto out;
- }
+ if (unlikely(p == NULL))
+ return -EINVAL;
- if (kprobe_gone(kp)) {
+ if (kprobe_gone(kp))
/* This kprobe has gone, we couldn't enable it. */
- ret = -EINVAL;
- goto out;
- }
+ return -EINVAL;
if (p != kp)
kp->flags &= ~KPROBE_FLAG_DISABLED;
@@ -2453,8 +2439,6 @@ int enable_kprobe(struct kprobe *kp)
kp->flags |= KPROBE_FLAG_DISABLED;
}
}
-out:
- mutex_unlock(&kprobe_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(enable_kprobe);
@@ -2642,11 +2626,11 @@ static int kprobes_module_callback(struct notifier_block *nb,
unsigned int i;
int checkcore = (val == MODULE_STATE_GOING);
- if (val == MODULE_STATE_COMING) {
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
+
+ if (val == MODULE_STATE_COMING)
add_module_kprobe_blacklist(mod);
- mutex_unlock(&kprobe_mutex);
- }
+
if (val != MODULE_STATE_GOING && val != MODULE_STATE_LIVE)
return NOTIFY_DONE;
@@ -2656,7 +2640,6 @@ static int kprobes_module_callback(struct notifier_block *nb,
* notified, only '.init.text' section would be freed. We need to
* disable kprobes which have been inserted in the sections.
*/
- mutex_lock(&kprobe_mutex);
for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
head = &kprobe_table[i];
hlist_for_each_entry(p, head, hlist)
@@ -2679,7 +2662,6 @@ static int kprobes_module_callback(struct notifier_block *nb,
}
if (val == MODULE_STATE_GOING)
remove_module_kprobe_blacklist(mod);
- mutex_unlock(&kprobe_mutex);
return NOTIFY_DONE;
}
@@ -2707,7 +2689,7 @@ void kprobe_free_init_mem(void)
struct kprobe *p;
int i;
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
/* Kill all kprobes on initmem because the target code has been freed. */
for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
@@ -2717,8 +2699,6 @@ void kprobe_free_init_mem(void)
kill_kprobe(p);
}
}
-
- mutex_unlock(&kprobe_mutex);
}
static int __init init_kprobes(void)
@@ -2914,11 +2894,11 @@ static int arm_all_kprobes(void)
unsigned int i, total = 0, errors = 0;
int err, ret = 0;
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
/* If kprobes are armed, just return */
if (!kprobes_all_disarmed)
- goto already_enabled;
+ return 0;
/*
* optimize_kprobe() called by arm_kprobe() checks
@@ -2948,8 +2928,6 @@ static int arm_all_kprobes(void)
else
pr_info("Kprobes globally enabled\n");
-already_enabled:
- mutex_unlock(&kprobe_mutex);
return ret;
}
@@ -2960,13 +2938,11 @@ static int disarm_all_kprobes(void)
unsigned int i, total = 0, errors = 0;
int err, ret = 0;
- mutex_lock(&kprobe_mutex);
+ guard(mutex)(&kprobe_mutex);
/* If kprobes are already disarmed, just return */
- if (kprobes_all_disarmed) {
- mutex_unlock(&kprobe_mutex);
+ if (kprobes_all_disarmed)
return 0;
- }
kprobes_all_disarmed = true;
@@ -2991,11 +2967,8 @@ static int disarm_all_kprobes(void)
else
pr_info("Kprobes globally disabled\n");
- mutex_unlock(&kprobe_mutex);
-
/* Wait for disarming all kprobes by optimizer */
- wait_for_kprobe_optimizer();
-
+ wait_for_kprobe_optimizer_locked();
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 022/555] mmc: omap: synchronize clock timer before disabling fclk
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 021/555] kprobes: Adopt guard() and scoped_guard() Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 023/555] mmc: sunxi: Use devm_mmc_alloc_host() helper Greg Kroah-Hartman
` (44 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Runyu Xiao, Ulf Hansson, 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 c931c51681e33b24bc8d65c6df35b70e1827daa2 ]
mmc_omap_select_slot() removes clk_timer with timer_delete() before
switching slots and changing the functional clock state. timer_delete()
only removes a pending timer and does not wait for a callback that is
already running.
If mmc_omap_clk_timer() is already running, it can therefore call
mmc_omap_fclk_enable() while the request or slot-switch path changes the
same clock state. During host removal, the same window can overlap the
final clock shutdown.
Use timer_delete_sync() so the callback has completed before slot switching
or changing the functional clock state. Keep the timer restartable for
normal request handling.
Fixes: 0807a9b5739a ("MMC: OMAP: Lazy clock shutdown")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
[ sashal: Replaced del_timer(&host->clk_timer) with del_timer_sync(...) in two places, since this tree predates the timer_delete* rename. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/omap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index ee0940d96febf..973e6ab1401cf 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -214,7 +214,7 @@ static void mmc_omap_select_slot(struct mmc_omap_slot *slot, int claimed)
host->mmc = slot->mmc;
spin_unlock_irqrestore(&host->slot_lock, flags);
no_claim:
- del_timer(&host->clk_timer);
+ del_timer_sync(&host->clk_timer);
if (host->current_slot != slot || !claimed)
mmc_omap_fclk_offdelay(host->current_slot);
@@ -273,7 +273,7 @@ static void mmc_omap_release_slot(struct mmc_omap_slot *slot, int clk_enabled)
/* Keeps clock running for at least 8 cycles on valid freq */
mod_timer(&host->clk_timer, jiffies + HZ/10);
else {
- del_timer(&host->clk_timer);
+ del_timer_sync(&host->clk_timer);
mmc_omap_fclk_offdelay(slot);
mmc_omap_fclk_enable(host, 0);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 023/555] mmc: sunxi: Use devm_mmc_alloc_host() helper
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 022/555] mmc: omap: synchronize clock timer before disabling fclk Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 024/555] mmc: sunxi: fix clock and runtime PM leaks on probe failure Greg Kroah-Hartman
` (43 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-sunxi, Huacai Chen, Binbin Zhou,
Ulf Hansson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Binbin Zhou <zhoubinbin@loongson.cn>
[ Upstream commit 5a8af27596118f3e6a121059ac7ac8c299bee164 ]
Use new function devm_mmc_alloc_host() to simplify the code.
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Samuel Holland <samuel@sholland.org>
Cc: linux-sunxi@lists.linux.dev
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/ee7726b1ea37084258a5d8cec67cad12473152c2.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Stable-dep-of: e35e360bd668 ("mmc: sunxi: fix clock and runtime PM leaks on probe failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/sunxi-mmc.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index e0ab5fd635e6c..cc7c8594a6cac 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1369,11 +1369,10 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
struct mmc_host *mmc;
int ret;
- mmc = mmc_alloc_host(sizeof(struct sunxi_mmc_host), &pdev->dev);
- if (!mmc) {
- dev_err(&pdev->dev, "mmc alloc host failed\n");
- return -ENOMEM;
- }
+ mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host));
+ if (!mmc)
+ return dev_err_probe(&pdev->dev, -ENOMEM,
+ "mmc alloc host failed\n");
platform_set_drvdata(pdev, mmc);
host = mmc_priv(mmc);
@@ -1383,15 +1382,13 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
ret = sunxi_mmc_resource_request(host, pdev);
if (ret)
- goto error_free_host;
+ return ret;
host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE,
&host->sg_dma, GFP_KERNEL);
- if (!host->sg_cpu) {
- dev_err(&pdev->dev, "Failed to allocate DMA descriptor mem\n");
- ret = -ENOMEM;
- goto error_free_host;
- }
+ if (!host->sg_cpu)
+ return dev_err_probe(&pdev->dev, -ENOMEM,
+ "Failed to allocate DMA descriptor mem\n");
if (host->cfg->ccu_has_timings_switch) {
/*
@@ -1481,8 +1478,6 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
error_free_dma:
dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
-error_free_host:
- mmc_free_host(mmc);
return ret;
}
@@ -1498,7 +1493,6 @@ static void sunxi_mmc_remove(struct platform_device *pdev)
sunxi_mmc_disable(host);
}
dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
- mmc_free_host(mmc);
}
#ifdef CONFIG_PM
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 024/555] mmc: sunxi: fix clock and runtime PM leaks on probe failure
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 023/555] mmc: sunxi: Use devm_mmc_alloc_host() helper Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 025/555] errseq: eliminate special limitation for macro MAX_ERRNO Greg Kroah-Hartman
` (42 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Anfernee Cao, Ulf Hansson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anfernee Cao <anferneemelokc5@gmail.com>
[ Upstream commit e35e360bd66898a977c296ab71fe4bae17ddceb7 ]
sunxi_mmc_resource_request() enables the bus, card, output and sample
clocks before returning. Several failure paths later in
sunxi_mmc_probe() leave them running:
- If devm_request_threaded_irq() fails, the clocks enabled by
sunxi_mmc_enable() are never disabled.
- If dma_alloc_coherent(), mmc_of_parse() or sunxi_mmc_init_host()
fails, probe only frees the DMA buffer and the mmc_host.
- If mmc_add_host() fails, runtime PM has already been enabled, but
pm_runtime_disable() is never called.
Besides leaking the clocks, this leaves the clock enable counts
unbalanced, so a reprobe (for example after -EPROBE_DEFER) calls
clk_prepare_enable() on the same clocks again.
Disable the IRQ and the clocks in the probe error path, and disable
runtime PM on the mmc_add_host() failure path. Also handle a failure of
devm_request_threaded_irq() in sunxi_mmc_resource_request().
Tested with QEMU's orangepi-pc machine: with forced sunxi_mmc_init_host()
and mmc_add_host() failures the MMC clocks stay disabled in clk_summary,
and a normal probe with an emulated SD card still works.
This issue was found by manual code inspection.
Fixes: 3cbcb16095f9 ("mmc: sunxi: Add driver for SD/MMC hosts found on Allwinner sunxi SoCs")
Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Anfernee Cao <anferneemelokc5@gmail.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/sunxi-mmc.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index cc7c8594a6cac..785899eb9f868 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1355,8 +1355,13 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
goto error_disable_mmc;
}
- return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
- sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);
+ ret = devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq,
+ sunxi_mmc_handle_manual_stop, 0,
+ "sunxi-mmc", host);
+ if (ret)
+ goto error_disable_mmc;
+
+ return 0;
error_disable_mmc:
sunxi_mmc_disable(host);
@@ -1386,9 +1391,11 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE,
&host->sg_dma, GFP_KERNEL);
- if (!host->sg_cpu)
- return dev_err_probe(&pdev->dev, -ENOMEM,
- "Failed to allocate DMA descriptor mem\n");
+ if (!host->sg_cpu) {
+ ret = dev_err_probe(&pdev->dev, -ENOMEM,
+ "Failed to allocate DMA descriptor mem\n");
+ goto error_disable_mmc;
+ }
if (host->cfg->ccu_has_timings_switch) {
/*
@@ -1468,7 +1475,7 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
ret = mmc_add_host(mmc);
if (ret)
- goto error_free_dma;
+ goto error_disable_rpm;
dev_info(&pdev->dev, "initialized, max. request size: %u KB%s\n",
mmc->max_req_size >> 10,
@@ -1476,8 +1483,13 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
return 0;
+error_disable_rpm:
+ pm_runtime_disable(&pdev->dev);
error_free_dma:
dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
+error_disable_mmc:
+ disable_irq(host->irq);
+ sunxi_mmc_disable(host);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 025/555] errseq: eliminate special limitation for macro MAX_ERRNO
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 024/555] mmc: sunxi: fix clock and runtime PM leaks on probe failure Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 026/555] errseq: dont let errseq_check_and_advance() hide later errors Greg Kroah-Hartman
` (41 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zijun Hu, Jeff Layton, Andrew Morton,
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 3eff6a3e574c2f704f9be1f4867c3d0b3d804435 ]
Current errseq implementation depends on a very special precondition that
macro MAX_ERRNO must be (2^n - 1).
Eliminate the limitation by
- redefining macro ERRSEQ_SHIFT
- defining a new macro ERRNO_MASK instead of MAX_ERRNO for errno mask.
There is no plan to change the value of MAX_ERRNO, but this makes the
implementation more generic and eliminates the BUILD_BUG_ON().
Link: https://lkml.kernel.org/r/20250407-improve_errseq-v1-1-7b27cbeb8298@quicinc.com
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 94defd41d80f ("errseq: don't let errseq_check_and_advance() hide later errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/errseq.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/errseq.c b/lib/errseq.c
index 93e9b94358dc6..13a2581c5a878 100644
--- a/lib/errseq.c
+++ b/lib/errseq.c
@@ -34,11 +34,14 @@
*/
/* The low bits are designated for error code (max of MAX_ERRNO) */
-#define ERRSEQ_SHIFT ilog2(MAX_ERRNO + 1)
+#define ERRSEQ_SHIFT (ilog2(MAX_ERRNO) + 1)
/* This bit is used as a flag to indicate whether the value has been seen */
#define ERRSEQ_SEEN (1 << ERRSEQ_SHIFT)
+/* Leverage macro ERRSEQ_SEEN to define errno mask macro here */
+#define ERRNO_MASK (ERRSEQ_SEEN - 1)
+
/* The lowest bit of the counter */
#define ERRSEQ_CTR_INC (1 << (ERRSEQ_SHIFT + 1))
@@ -60,8 +63,6 @@ errseq_t errseq_set(errseq_t *eseq, int err)
{
errseq_t cur, old;
- /* MAX_ERRNO must be able to serve as a mask */
- BUILD_BUG_ON_NOT_POWER_OF_2(MAX_ERRNO + 1);
/*
* Ensure the error code actually fits where we want it to go. If it
@@ -79,7 +80,7 @@ errseq_t errseq_set(errseq_t *eseq, int err)
errseq_t new;
/* Clear out error bits and set new error */
- new = (old & ~(MAX_ERRNO|ERRSEQ_SEEN)) | -err;
+ new = (old & ~(ERRNO_MASK | ERRSEQ_SEEN)) | -err;
/* Only increment if someone has looked at it */
if (old & ERRSEQ_SEEN)
@@ -148,7 +149,7 @@ int errseq_check(errseq_t *eseq, errseq_t since)
if (likely(cur == since))
return 0;
- return -(cur & MAX_ERRNO);
+ return -(cur & ERRNO_MASK);
}
EXPORT_SYMBOL(errseq_check);
@@ -200,7 +201,7 @@ int errseq_check_and_advance(errseq_t *eseq, errseq_t *since)
if (new != old)
cmpxchg(eseq, old, new);
*since = new;
- err = -(new & MAX_ERRNO);
+ err = -(new & ERRNO_MASK);
}
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 026/555] errseq: dont let errseq_check_and_advance() hide later errors
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 025/555] errseq: eliminate special limitation for macro MAX_ERRNO Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 027/555] xsk: defer software checksum until the skb is complete Greg Kroah-Hartman
` (40 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain, Jan Kara,
Jeff Layton, Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashank Mohan Jain <jain.sm@gmail.com>
[ Upstream commit 94defd41d80f10bbe883c0c8d1b28d1665b6b153 ]
errseq_check_and_advance() reads the errseq_t, sets ERRSEQ_SEEN with a
cmpxchg() and then advances *since to the value it computed, ignoring
whether the cmpxchg() succeeded. When it fails because errseq_set()
recorded a different error in the meantime, *since ends up holding a
value that was never stored in the errseq_t.
errseq_set() only bumps the counter when ERRSEQ_SEEN is set. So as long
as nobody has seen the new error, recording the original errno again
recreates exactly the old value, and once another subscriber marks it
seen, it is equal to the stale *since. The next check through that
cursor then reports nothing, although -ENOSPC was recorded after the
value that check reported, and -EIO was recorded again after it
returned:
cursor f writeback cursor g
-------- --------- --------
set(-EIO)
check_and_advance(&f)
old = [c, EIO]
set(-ENOSPC)
-> [c, ENOSPC]
cmpxchg() fails
f = [c, EIO, SEEN]
returns -EIO
set(-EIO)
-> [c, EIO]
(no bump: unseen)
check_and_advance(&g)
-> [c, EIO, SEEN]
returns -EIO
check_and_advance(&f)
[c, EIO, SEEN] == f
returns 0 <- -ENOSPC and the second -EIO are lost
For file->f_wb_err this means that fsync() on one descriptor can return
0 although writeback failed after the previous fsync() on that
descriptor returned, when writeback errors race with fsync() on another
descriptor of the same file. The same applies to syncfs() through
sb->s_wb_err, which every file on the filesystem shares, and to the
ext4 and jbd2 cursors on the block device mapping. The kernel-doc
promises "Negative errno if one has been stored, or 0 if no new error
has occurred".
Retry with the value found when the cmpxchg() fails, so that *since is
only ever advanced to a value that was actually stored with ERRSEQ_SEEN
set. Every later errseq_set() then has to bump the counter, and the
error is reported. The retry loop terminates because each iteration
needs a concurrent update, like the loop in errseq_set().
A TLA+ model of errseq_set() and errseq_check_and_advance(), checked
with the TLC model checker, finds the lost error with the current code;
with this change TLC checks that an error recorded after a check
returned is always reported by the next check (exhaustively for two
subscribers with three checks each, and one writer recording four
errors or two writers recording two each). The KUnit race test added
in the next patch misses the error in 1-6% of 2 million rounds on
4-CPU UML before this change (depending on host load), and in none
after it.
Fixes: 84cbadadc6ea ("lib: add errseq_t type and infrastructure for handling it")
Cc: stable@vger.kernel.org
Signed-off-by: Shashank Mohan Jain <jain.sm@gmail.com>
Link: https://patch.msgid.link/20260927051726.71337-2-jain.sm@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/errseq.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/lib/errseq.c b/lib/errseq.c
index 13a2581c5a878..ea4ff9cc21669 100644
--- a/lib/errseq.c
+++ b/lib/errseq.c
@@ -162,7 +162,8 @@ EXPORT_SYMBOL(errseq_check);
* points to. If it does, then just return 0.
*
* If it doesn't, then the value has changed. Set the "seen" flag, and try to
- * swap it into place as the new eseq value. Then, set that value as the new
+ * swap it into place as the new eseq value. If the swap fails because the
+ * value changed, retry with the new value. Then, set that value as the new
* "since" value, and return whatever the error portion is set to.
*
* Note that no locking is provided here for concurrent updates to the "since"
@@ -184,24 +185,30 @@ int errseq_check_and_advance(errseq_t *eseq, errseq_t *since)
* to take the lock that protects the "since" value.
*/
old = READ_ONCE(*eseq);
- if (old != *since) {
+ while (old != *since) {
/*
* Set the flag and try to swap it into place if it has
* changed.
*
- * We don't care about the outcome of the swap here. If the
- * swap doesn't occur, then it has either been updated by a
- * writer who is altering the value in some way (updating
- * counter or resetting the error), or another reader who is
- * just setting the "seen" flag. Either outcome is OK, and we
- * can advance "since" and return an error based on what we
- * have.
+ * If the swap fails, a writer or another reader changed the
+ * value under us, so retry with the new value. "since" must
+ * only ever be set to a value that was stored with the SEEN
+ * flag: errseq_set() does not bump the counter while the
+ * flag is clear, so an unstored value could come back later
+ * and hide the errors that were recorded in the meantime.
*/
new = old | ERRSEQ_SEEN;
- if (new != old)
- cmpxchg(eseq, old, new);
+ if (new != old) {
+ errseq_t cur = cmpxchg(eseq, old, new);
+
+ if (cur != old) {
+ old = cur;
+ continue;
+ }
+ }
*since = new;
err = -(new & ERRNO_MASK);
+ break;
}
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 027/555] xsk: defer software checksum until the skb is complete
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 026/555] errseq: dont let errseq_check_and_advance() hide later errors Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 028/555] cpufreq: Improve suspend-resume synchronization Greg Kroah-Hartman
` (39 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Stanislav Fomichev, Jason Xing, Rongzheng Wang, Paolo Abeni,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rongzheng Wang <testwrzwrz@gmail.com>
[ Upstream commit f2eddafbfcc004098425fee7c5664adbe29152d7 ]
When XDP_UMEM_TX_SW_CSUM is used with multi-buffer TX, xsk_skb_metadata()
calls skb_checksum_help() while only the first descriptor has been added to
the skb. The checksum therefore covers just the first fragment, and
skb_checksum_help() sets ip_summed to CHECKSUM_NONE, so the remaining
fragments are never included in the checksum.
Move the software checksum calculation to the point where the last
descriptor has been added to the skb.
On a checksum failure the packet is now dropped instead of being returned
to the application for a retry. This path is not reachable with the
existing metadata validation, but the behavior change is intentional.
Fixes: 11614723af26 ("xsk: Add option to calculate TX checksum in SW")
Cc: stable@vger.kernel.org
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Signed-off-by: Rongzheng Wang <testwrzwrz@gmail.com>
Link: https://patch.msgid.link/20261104034809.24545-2-testwrzwrz@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: Open-coded the final-descriptor software checksum call in the xmit loop and removed the early one inline, since there is no metadata helper split, and drop uses cancel-reservation semantics. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/xdp/xsk.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 1bc966669ec96..028791b80fbbc 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -952,12 +952,6 @@ static struct sk_buff *xsk_build_skb(struct xdp_sock *xs,
skb->csum_start = hr + csum_start;
skb->csum_offset = csum_offset;
skb->ip_summed = CHECKSUM_PARTIAL;
-
- if (unlikely(xs->pool->tx_sw_csum)) {
- err = skb_checksum_help(skb);
- if (err)
- goto free_err;
- }
}
}
}
@@ -1052,6 +1046,15 @@ static int __xsk_generic_xmit(struct sock *sk)
continue;
}
+ if (unlikely(xs->pool->tx_sw_csum &&
+ skb->ip_summed == CHECKSUM_PARTIAL)) {
+ err = skb_checksum_help(skb);
+ if (unlikely(err)) {
+ xsk_drop_skb(skb);
+ goto out;
+ }
+ }
+
err = __dev_direct_xmit(skb, xs->queue_id);
if (err == NETDEV_TX_BUSY) {
/* Tell user-space to retry the send */
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 028/555] cpufreq: Improve suspend-resume synchronization
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 027/555] xsk: defer software checksum until the skb is complete Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 029/555] tpm: flush timeout work outside buffer_mutex to avoid deadlock Greg Kroah-Hartman
` (38 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki,
Zak Brighton Knight, Zhongqiu Han, Viresh Kumar, Doug Smythies,
Christian Loehle, 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 eee2a44e4e2b41c0699919a550d41cc38daa4f42 ]
The suspend-resume synchronization in the cpufreq core is not perfect
because the global cpufreq_suspended variable is set at the end of
cpufreq_suspend() after stopping governors for all of the active
policies, so the governor .limits() callback may run via
cpufreq_governor_limits() after stopping the governor and before
setting cpufreq_suspended which is questionable. Likewise, the
governor .limits() callback may run between clearing cpufreq_suspended
in cpufreq_resume() and starting the governor.
Address this by adding a per-policy "suspended" flag that is always
read under the policy rwsem and is updated under it when the governor
is stopped in cpufreq_suspend() and when the governor is restarted in
cpufreq_resume().
Also make cpufreq_resume() use the cpus_read_lock guard to reflect
what is done in cpufreq_suspend() and call cpufreq_exit_governor() for
policies that were suspended during a system suspend transition and
are inactive during the subsequent system resume (to avoid leaking an
inactive policy with a stopped governor that has not exited yet).
Fixes: 8e30444e1530 ("cpufreq: fix cpufreq suspend/resume for intel_pstate")
Fixes: b1b12babe3b7 ("cpufreq: update 'cpufreq_suspended' after stopping governors")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/4796894.LvFx2qVVIh@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ sashal: Open-coded down_write()/up_write() with a goto-unlock label replaces the policy write guard, and the cpufreq_policy_refresh() change went into cpufreq_update_policy(); only the suspended field was added to the header. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 89 +++++++++++++++++++++++++++++----------
include/linux/cpufreq.h | 3 ++
2 files changed, 69 insertions(+), 23 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index aee7e081b6c64..f21e28cbecd59 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -34,6 +34,9 @@
static LIST_HEAD(cpufreq_policy_list);
/* Macros to iterate over CPU policies */
+#define for_each_policy(__policy) \
+ list_for_each_entry(__policy, &cpufreq_policy_list, policy_list)
+
#define for_each_suitable_policy(__policy, __active) \
list_for_each_entry(__policy, &cpufreq_policy_list, policy_list) \
if ((__active) == !policy_is_inactive(__policy))
@@ -1944,6 +1947,14 @@ int cpufreq_generic_suspend(struct cpufreq_policy *policy)
}
EXPORT_SYMBOL(cpufreq_generic_suspend);
+static void cpufreq_suspend_policy(struct cpufreq_policy *policy)
+{
+ down_write(&policy->rwsem);
+ cpufreq_stop_governor(policy);
+ policy->suspended = true;
+ up_write(&policy->rwsem);
+}
+
/**
* cpufreq_suspend() - Suspend CPUFreq governors.
*
@@ -1966,11 +1977,8 @@ void cpufreq_suspend(void)
pr_debug("%s: Suspending Governors\n", __func__);
for_each_active_policy(policy) {
- if (has_target()) {
- down_write(&policy->rwsem);
- cpufreq_stop_governor(policy);
- up_write(&policy->rwsem);
- }
+ if (has_target())
+ cpufreq_suspend_policy(policy);
if (cpufreq_driver->suspend && cpufreq_driver->suspend(policy))
pr_err("%s: Failed to suspend driver: %s\n", __func__,
@@ -1982,6 +1990,35 @@ void cpufreq_suspend(void)
cpus_read_unlock();
}
+static void cpufreq_resume_policy(struct cpufreq_policy *policy, bool start)
+{
+ down_write(&policy->rwsem);
+
+ if (!policy->suspended)
+ goto unlock;
+
+ policy->suspended = false;
+
+ if (policy_is_inactive(policy)) {
+ /*
+ * The policy was active when it was suspended, so its governor
+ * is still there. Let the governor go.
+ */
+ cpufreq_exit_governor(policy);
+ goto unlock;
+ }
+
+ if (!start)
+ goto unlock;
+
+ if (cpufreq_start_governor(policy))
+ pr_err("%s: Failed to start governor for CPU%u's policy\n",
+ __func__, policy->cpu);
+
+unlock:
+ up_write(&policy->rwsem);
+}
+
/**
* cpufreq_resume() - Resume CPUFreq governors.
*
@@ -1991,11 +2028,12 @@ void cpufreq_suspend(void)
void cpufreq_resume(void)
{
struct cpufreq_policy *policy;
- int ret;
if (!cpufreq_driver)
return;
+ guard(cpus_read_lock)();
+
if (unlikely(!cpufreq_suspended))
return;
@@ -2006,19 +2044,18 @@ void cpufreq_resume(void)
pr_debug("%s: Resuming Governors\n", __func__);
- for_each_active_policy(policy) {
- if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) {
- pr_err("%s: Failed to resume driver: %s\n", __func__,
- cpufreq_driver->name);
- } else if (has_target()) {
- down_write(&policy->rwsem);
- ret = cpufreq_start_governor(policy);
- up_write(&policy->rwsem);
+ for_each_policy(policy) {
+ int ret = 0;
+ if (cpufreq_driver->resume && !policy_is_inactive(policy)) {
+ ret = cpufreq_driver->resume(policy);
if (ret)
- pr_err("%s: Failed to start governor for CPU%u's policy\n",
- __func__, policy->cpu);
+ pr_err("%s: Failed to resume driver: %s\n", __func__,
+ cpufreq_driver->name);
}
+
+ if (has_target())
+ cpufreq_resume_policy(policy, ret == 0);
}
}
@@ -2398,12 +2435,17 @@ __weak struct cpufreq_governor *cpufreq_fallback_governor(void)
return NULL;
}
+static bool cpufreq_is_suspended(struct cpufreq_policy *policy)
+{
+ return cpufreq_suspended || policy->suspended;
+}
+
static int cpufreq_init_governor(struct cpufreq_policy *policy)
{
int ret;
- /* Don't start any governor operations if we are entering suspend */
- if (cpufreq_suspended)
+ /* Don't start any governor operations for suspended policies. */
+ if (cpufreq_is_suspended(policy))
return 0;
/*
* Governor might not be initiated here if ACPI _PPC changed
@@ -2446,7 +2488,7 @@ static int cpufreq_init_governor(struct cpufreq_policy *policy)
static void cpufreq_exit_governor(struct cpufreq_policy *policy)
{
- if (cpufreq_suspended || !policy->governor)
+ if (cpufreq_is_suspended(policy) || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
@@ -2461,7 +2503,7 @@ int cpufreq_start_governor(struct cpufreq_policy *policy)
{
int ret;
- if (cpufreq_suspended)
+ if (cpufreq_is_suspended(policy))
return 0;
if (!policy->governor)
@@ -2486,7 +2528,7 @@ int cpufreq_start_governor(struct cpufreq_policy *policy)
void cpufreq_stop_governor(struct cpufreq_policy *policy)
{
- if (cpufreq_suspended || !policy->governor)
+ if (cpufreq_is_suspended(policy) || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
@@ -2497,7 +2539,7 @@ void cpufreq_stop_governor(struct cpufreq_policy *policy)
static void cpufreq_governor_limits(struct cpufreq_policy *policy)
{
- if (cpufreq_suspended || !policy->governor)
+ if (cpufreq_is_suspended(policy) || !policy->governor)
return;
pr_debug("%s: for CPU %u\n", __func__, policy->cpu);
@@ -2762,7 +2804,8 @@ void cpufreq_update_policy(unsigned int cpu)
* -> ask driver for current freq and notify governors about a change
*/
if (cpufreq_driver->get && has_target() &&
- (cpufreq_suspended || WARN_ON(!cpufreq_verify_current_freq(policy, false))))
+ (cpufreq_is_suspended(policy) ||
+ WARN_ON(!cpufreq_verify_current_freq(policy, false))))
goto unlock;
refresh_frequency_limits(policy);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 1e87507ea16ff..5947659a4b9d4 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -147,6 +147,9 @@ struct cpufreq_policy {
/* Per policy boost enabled flag. */
bool boost_enabled;
+ /* The policy has been suspended. */
+ bool suspended;
+
/* Cached frequency lookup from cpufreq_driver_resolve_freq. */
unsigned int cached_target_freq;
unsigned int cached_resolved_idx;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 029/555] tpm: flush timeout work outside buffer_mutex to avoid deadlock
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 028/555] cpufreq: Improve suspend-resume synchronization Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 030/555] spi: tegra210-quad: Track DMA mapping state Greg Kroah-Hartman
` (37 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunjung Ko, Jarkko Sakkinen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunjung Ko <hj351016@gmail.com>
[ Upstream commit c22052a012698ce56d599d75b669d55778521c7c ]
tpm_common_read() calls flush_work(&priv->timeout_work) under
priv->buffer_mutex, but tpm_timeout_work() also takes buffer_mutex, so a
running timeout work deadlocks the flush. Flush after unlocking; the timer
is deleted under the lock, so no new work can be queued.
Fixes: 9488585b21be ("tpm: add support for partial reads")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261108165812.676876-1-hj351016@gmail.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
[ sashal: Replaced timer_delete_sync() with the older del_timer_sync() name that this tree uses; the rest matches upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/char/tpm/tpm-dev-common.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c
index 1bfdcb9794e20..98b35c4e8bc8c 100644
--- a/drivers/char/tpm/tpm-dev-common.c
+++ b/drivers/char/tpm/tpm-dev-common.c
@@ -132,6 +132,7 @@ ssize_t tpm_common_read(struct file *file, char __user *buf,
{
struct file_priv *priv = file->private_data;
ssize_t ret_size = 0;
+ bool flush = false;
int rc;
if (!size)
@@ -164,9 +165,18 @@ ssize_t tpm_common_read(struct file *file, char __user *buf,
if (!priv->response_length) {
*off = 0;
del_timer_sync(&priv->user_read_timer);
- flush_work(&priv->timeout_work);
+ flush = true;
}
mutex_unlock(&priv->buffer_mutex);
+
+ /*
+ * tpm_timeout_work() takes buffer_mutex, so flush it after dropping
+ * the mutex to avoid a deadlock; the timer is deleted above, so no new
+ * timeout work can be queued once the mutex is released.
+ */
+ if (flush)
+ flush_work(&priv->timeout_work);
+
return ret_size;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 030/555] spi: tegra210-quad: Track DMA mapping state
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 029/555] tpm: flush timeout work outside buffer_mutex to avoid deadlock Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 031/555] watchdog: npcm: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare Greg Kroah-Hartman
` (36 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mark Brown, Vishwaroop A,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <va@nvidia.com>
[ Upstream commit 7b9e6f7bc13c0259b192d0a964e802d4ad53b8b8 ]
tegra_qspi_dma_unmap_xfer() assumes a streaming mapping is always
outstanding and recomputes its length from the live
tqspi->curr_dma_words. Nothing records whether tegra_qspi_dma_map_xfer()
mapped anything, so neither assumption holds.
For a multi-chunk transfer, handle_dma_based_xfer() unmaps the chunk that
just completed, recalculates the parameters for the next chunk, which
overwrites curr_dma_words, and re-arms the hardware. If
tegra_qspi_start_dma_based_transfer() then fails at its
tegra_qspi_dma_map_xfer() call, nothing is mapped. That early return also
sits above the smp_store_release() that clears tqspi->trans_status, so the
previous chunk's QSPI_RDY survives, and the re-arm's return value is never
checked, so handle_dma_based_xfer() returns IRQ_HANDLED without completing
the transfer.
The caller times out, tegra_qspi_handle_timeout() sees the stale QSPI_RDY,
concludes the transfer completed and calls handle_dma_based_xfer() again.
No DMA completion arrives, so num_errors is incremented and
tegra_qspi_dma_unmap_xfer() runs with nothing mapped. t->tx_dma then holds
either the DMA_MAPPING_ERROR sentinel or, if the RX mapping was the one
that failed, the preceding chunk's address that has already been released.
Behind an IOMMU the latter frees an IOVA that may since have been
reallocated.
Record whether a mapping is outstanding and the length that was mapped,
and return early from tegra_qspi_dma_unmap_xfer() when there is nothing to
release. is_dma_mapped is only updated under tqspi->lock, or on the timeout
path after synchronize_irq() and cancel_work_sync() have quiesced the ISR
and the bottom half.
Also skip releasing the TX mapping on the RX failure path unless a TX
mapping was created; t->tx_dma is uninitialised when t->tx_buf is NULL.
Fixes: 921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Suggested-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Vishwaroop A <va@nvidia.com>
Link: https://patch.msgid.link/20261026111412.3843954-3-va@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Replaced the single tqspi->dev DMA device uses for the missing tx_dma_dev/rx_dma_dev split, keeping the upstream mapping-state tracking and unmap logic unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-tegra210-quad.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 14dd98b92bd93..ca91a69ea059e 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -207,6 +207,17 @@ struct tegra_qspi {
bool is_packed;
bool use_dma;
+ /*
+ * Set while a streaming mapping created by
+ * tegra_qspi_dma_map_xfer() is outstanding, together with the
+ * length that was handed to dma_map_single(). is_curr_dma_xfer
+ * only records that the last armed chunk took the DMA path,
+ * which is not the same thing: a chunk whose mapping failed
+ * leaves the DMA path flagged with nothing mapped.
+ */
+ bool is_dma_mapped;
+ unsigned int dma_map_len;
+
u32 command1_reg;
u32 dma_control_reg;
u32 def_command1_reg;
@@ -586,22 +597,32 @@ static int tegra_qspi_dma_map_xfer(struct tegra_qspi *tqspi, struct spi_transfer
if (t->rx_buf) {
t->rx_dma = dma_map_single(tqspi->dev, (void *)rx_buf, len, DMA_FROM_DEVICE);
if (dma_mapping_error(tqspi->dev, t->rx_dma)) {
- dma_unmap_single(tqspi->dev, t->tx_dma, len, DMA_TO_DEVICE);
+ if (t->tx_buf)
+ dma_unmap_single(tqspi->dev, t->tx_dma,
+ len, DMA_TO_DEVICE);
return -ENOMEM;
}
}
+ tqspi->dma_map_len = len;
+ tqspi->is_dma_mapped = true;
+
return 0;
}
static void tegra_qspi_dma_unmap_xfer(struct tegra_qspi *tqspi, struct spi_transfer *t)
{
- unsigned int len;
+ if (!tqspi->is_dma_mapped)
+ return;
- len = DIV_ROUND_UP(tqspi->curr_dma_words * tqspi->bytes_per_word, 4) * 4;
+ if (t->tx_buf)
+ dma_unmap_single(tqspi->dev, t->tx_dma,
+ tqspi->dma_map_len, DMA_TO_DEVICE);
+ if (t->rx_buf)
+ dma_unmap_single(tqspi->dev, t->rx_dma,
+ tqspi->dma_map_len, DMA_FROM_DEVICE);
- dma_unmap_single(tqspi->dev, t->tx_dma, len, DMA_TO_DEVICE);
- dma_unmap_single(tqspi->dev, t->rx_dma, len, DMA_FROM_DEVICE);
+ tqspi->is_dma_mapped = false;
}
static int tegra_qspi_start_dma_based_transfer(struct tegra_qspi *tqspi, struct spi_transfer *t)
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 031/555] watchdog: npcm: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 030/555] spi: tegra210-quad: Track DMA mapping state Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 032/555] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog Greg Kroah-Hartman
` (35 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chen Ni, Guenter Roeck,
Wim Van Sebroeck, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ni <nichen@iscas.ac.cn>
[ Upstream commit ad3746700ae238a96a9a4244d02a2e8eb00f157e ]
clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter.Remove unneeded NULL check for clk here.
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250313084420.2481763-1-nichen@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Stable-dep-of: 57c7cbe21acc ("watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/watchdog/npcm_wdt.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c
index a5dd1c2301374..e62ea054bc618 100644
--- a/drivers/watchdog/npcm_wdt.c
+++ b/drivers/watchdog/npcm_wdt.c
@@ -68,8 +68,7 @@ static int npcm_wdt_start(struct watchdog_device *wdd)
struct npcm_wdt *wdt = to_npcm_wdt(wdd);
u32 val;
- if (wdt->clk)
- clk_prepare_enable(wdt->clk);
+ clk_prepare_enable(wdt->clk);
if (wdd->timeout < 2)
val = 0x800;
@@ -105,8 +104,7 @@ static int npcm_wdt_stop(struct watchdog_device *wdd)
writel(0, wdt->reg);
- if (wdt->clk)
- clk_disable_unprepare(wdt->clk);
+ clk_disable_unprepare(wdt->clk);
return 0;
}
@@ -156,8 +154,7 @@ static int npcm_wdt_restart(struct watchdog_device *wdd,
struct npcm_wdt *wdt = to_npcm_wdt(wdd);
/* For reset, we start the WDT clock and leave it running. */
- if (wdt->clk)
- clk_prepare_enable(wdt->clk);
+ clk_prepare_enable(wdt->clk);
writel(NPCM_WTR | NPCM_WTRE | NPCM_WTE, wdt->reg);
udelay(1000);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 032/555] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 031/555] watchdog: npcm: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 033/555] tracing/probes: Enable newly appended probe when target event is enabled Greg Kroah-Hartman
` (34 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Feng, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
[ Upstream commit 57c7cbe21acc77291ec0fbdd4bd72aa259cf4986 ]
npcm_wdt_start() unconditionally prepares and enables the watchdog
clock, and npcm_wdt_stop() is the only place that disables it.
npcm_wdt_set_timeout() calls npcm_wdt_start() again whenever the
watchdog is already active, so every WDIOC_SETTIMEOUT ioctl issued
while the watchdog is running takes one extra clock prepare/enable
reference that is never dropped.
Split the register programming out of npcm_wdt_start() into a
__npcm_wdt_start() helper that assumes the clock is already running,
and call the helper from npcm_wdt_set_timeout() instead; only the
watchdog .start callback (and the restart path, which intentionally
keeps the clock) now acquires the clock.
Fixes: af084fdccfaf ("watchdog: npcm: Enable clock if provided")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261109071004.1506-1-zhaofeng2@cmss.chinamobile.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/watchdog/npcm_wdt.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c
index e62ea054bc618..aff1ea1e6b62d 100644
--- a/drivers/watchdog/npcm_wdt.c
+++ b/drivers/watchdog/npcm_wdt.c
@@ -63,13 +63,11 @@ static int npcm_wdt_ping(struct watchdog_device *wdd)
return 0;
}
-static int npcm_wdt_start(struct watchdog_device *wdd)
+static void __npcm_wdt_start(struct watchdog_device *wdd)
{
struct npcm_wdt *wdt = to_npcm_wdt(wdd);
u32 val;
- clk_prepare_enable(wdt->clk);
-
if (wdd->timeout < 2)
val = 0x800;
else if (wdd->timeout < 3)
@@ -94,6 +92,15 @@ static int npcm_wdt_start(struct watchdog_device *wdd)
val |= NPCM_WTRE | NPCM_WTE | NPCM_WTR | NPCM_WTIE;
writel(val, wdt->reg);
+}
+
+static int npcm_wdt_start(struct watchdog_device *wdd)
+{
+ struct npcm_wdt *wdt = to_npcm_wdt(wdd);
+
+ clk_prepare_enable(wdt->clk);
+
+ __npcm_wdt_start(wdd);
return 0;
}
@@ -134,7 +141,7 @@ static int npcm_wdt_set_timeout(struct watchdog_device *wdd,
wdd->timeout = 2750;
if (watchdog_active(wdd))
- npcm_wdt_start(wdd);
+ __npcm_wdt_start(wdd);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 033/555] tracing/probes: Enable newly appended probe when target event is enabled
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 032/555] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 034/555] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers Greg Kroah-Hartman
` (33 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ Upstream commit 72d3a5cb0cd7335553549aaffecc683e3ecc0c43 ]
Unlike kprobe events, fprobe and uprobe events only register their
underlying probes when the trace event is enabled. When a new probe is
appended to an existing multiprobe fprobe or uprobe event that is
already enabled, the appended probe is linked into the event's probe
list without being registered.
As a result, the newly appended probe never fires until the event is
disabled and re-enabled. Moreover, disabling an fprobe event calls
unregister_fprobe() on the unregistered fprobe, and opening or closing a
perf event on an enabled uprobe event dereferences a NULL tu->uprobe in
uprobe_apply().
Register and enable the newly appended fprobe or uprobe immediately when
the target event is already enabled.
Link: https://lore.kernel.org/all/179455849798.403392.135678786198324285.stgit@devnote2/
Fixes: 41af3cf587f4 ("tracing/uprobe: Add multi-probe per uprobe event support")
Fixes: 2db832ec9090 ("tracing: fprobe-events: Register fprobe-events only when it is enabled")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ sashal: Dropped the fprobe hunks, which have no counterpart here, and kept only the uprobe changes, moving trace_uprobe_enable() and filter_func_t earlier with a forward declaration of uprobe_perf_filter. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_uprobe.c | 56 ++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 19 deletions(-)
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index cf5dc4b456eee..d18669586afab 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -443,6 +443,28 @@ static bool trace_uprobe_has_same_uprobe(struct trace_uprobe *orig,
return false;
}
+typedef bool (*filter_func_t)(struct uprobe_consumer *self, struct mm_struct *mm);
+
+#ifdef CONFIG_PERF_EVENTS
+static bool uprobe_perf_filter(struct uprobe_consumer *uc, struct mm_struct *mm);
+#else
+#define uprobe_perf_filter NULL
+#endif
+
+static int trace_uprobe_enable(struct trace_uprobe *tu, filter_func_t filter)
+{
+ struct inode *inode = d_real_inode(tu->path.dentry);
+ struct uprobe *uprobe;
+
+ tu->consumer.filter = filter;
+ uprobe = uprobe_register(inode, tu->offset, tu->ref_ctr_offset, &tu->consumer);
+ if (IS_ERR(uprobe))
+ return PTR_ERR(uprobe);
+
+ tu->uprobe = uprobe;
+ return 0;
+}
+
static int append_trace_uprobe(struct trace_uprobe *tu, struct trace_uprobe *to)
{
int ret;
@@ -462,10 +484,22 @@ static int append_trace_uprobe(struct trace_uprobe *tu, struct trace_uprobe *to)
/* Append to existing event */
ret = trace_probe_append(&tu->tp, &to->tp);
- if (!ret)
- dyn_event_add(&tu->devent, trace_probe_event_call(&tu->tp));
+ if (ret)
+ return ret;
- return ret;
+ if (trace_probe_is_enabled(&tu->tp)) {
+ ret = trace_uprobe_enable(tu,
+ trace_probe_test_flag(&tu->tp, TP_FLAG_PROFILE) ?
+ uprobe_perf_filter : NULL);
+ if (ret) {
+ trace_probe_unlink(&tu->tp);
+ return ret;
+ }
+ }
+
+ dyn_event_add(&tu->devent, trace_probe_event_call(&tu->tp));
+
+ return 0;
}
/*
@@ -1104,22 +1138,6 @@ print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *e
return trace_handle_return(s);
}
-typedef bool (*filter_func_t)(struct uprobe_consumer *self, struct mm_struct *mm);
-
-static int trace_uprobe_enable(struct trace_uprobe *tu, filter_func_t filter)
-{
- struct inode *inode = d_real_inode(tu->path.dentry);
- struct uprobe *uprobe;
-
- tu->consumer.filter = filter;
- uprobe = uprobe_register(inode, tu->offset, tu->ref_ctr_offset, &tu->consumer);
- if (IS_ERR(uprobe))
- return PTR_ERR(uprobe);
-
- tu->uprobe = uprobe;
- return 0;
-}
-
static void __probe_event_disable(struct trace_probe *tp)
{
struct trace_uprobe *tu;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 034/555] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 033/555] tracing/probes: Enable newly appended probe when target event is enabled Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 035/555] xfrm: Dont clobber inner headers when already set Greg Kroah-Hartman
` (32 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ Upstream commit c1e2c63e65421068566db3dde44dfd4fe7adb46d ]
In struct btf_type, the type ID and byte size share a union, and only
BTF_KIND_INT types are followed by a 32-bit integer encoding word.
Because btf_type_is_char_ptr() and btf_type_is_char_array() do not
verify that the outer type is BTF_KIND_PTR or that the resolved element
type is a non-NULL BTF_KIND_INT before inspecting it, non-pointer BTF
types can have their byte size misinterpreted as a BTF type ID, and
arrays of non-integer types read out-of-bounds or misinterpret trailing
BTF metadata as BTF_INT_* encoding bits.
Validate the BTF type kinds and NULL pointers before reading inner type
metadata in both helpers.
Link: https://lore.kernel.org/all/179455851632.403392.258264246782960594.stgit@devnote2/
Fixes: 27973e5c64b9 ("tracing/probes: Add string type check with BTF")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ sashal: Kept this branch's existing &tid argument to btf_type_skip_modifiers() where upstream passes NULL, resolving the context conflict in both helpers. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_probe.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index deb47ca572bd7..786552250ac13 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -326,6 +326,9 @@ static bool btf_type_is_char_ptr(struct btf *btf, const struct btf_type *type)
u32 intdata;
s32 tid;
+ if (BTF_INFO_KIND(type->info) != BTF_KIND_PTR)
+ return false;
+
real_type = btf_type_skip_modifiers(btf, type->type, &tid);
if (!real_type)
return false;
@@ -351,6 +354,11 @@ static bool btf_type_is_char_array(struct btf *btf, const struct btf_type *type)
array = (const struct btf_array *)(type + 1);
real_type = btf_type_skip_modifiers(btf, array->type, &tid);
+ if (!real_type)
+ return false;
+
+ if (BTF_INFO_KIND(real_type->info) != BTF_KIND_INT)
+ return false;
intdata = btf_type_int(real_type);
return !(BTF_INT_ENCODING(intdata) & BTF_INT_SIGNED)
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 035/555] xfrm: Dont clobber inner headers when already set
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 034/555] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 036/555] Bluetooth: hci_core: Fix not checking skb length on hci_scodata_packet Greg Kroah-Hartman
` (31 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Steffen Klassert,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <cratiu@nvidia.com>
[ Upstream commit fa90a3145c0340c3f624206a81637c542254ea1d ]
On VXLAN over IPsec egress, xfrm{4,6}_transport_output() blindly
overwrite inner_transport_header (== the inner TCP header saved in VXLAN
iptunnel_handle_offloads() -> skb_reset_inner_headers()) with the
current transport_header (== the VXLAN outer UDP header set by
udp_tunnel_xmit_skb()).
This was a latent bug, harmless until commit [1] added a doff validation
check in qdisc_pkt_len_segs_init() for encapsulated GSO packets. With
the wrong inner_transport_header set by xfrm, qdisc_pkt_len_segs_init()
interprets inner_transport_header as a TCP header, reads doff=0 from the
upper byte of the VNI and drops the packet with DROP_REASON_SKB_BAD_GSO.
Besides the use in GSO to determine the header size of segmented
packets, inner_transport_header might be used by drivers to set up
inner checksum offloading by pointing the HW to the inner transport
header. A quick browse through available drivers shows that mlx5 uses
skb->csum_start specifically for this scenario, while others either
don't support VXLAN over IPsec crypto offload (ixgbe) or the HW is
capable of parsing the packets itself (nfp, Chelsio).
But in all cases, it is more correct to let the inner_transport_header
point to the innermost header instead of overwriting it in xfrm.
So fix this by guarding all four inner header save sites in
xfrm_output.c (xfrm{4,6}_transport_output, xfrm{4,6}_tunnel_encap_add)
with a check for skb->inner_protocol. When inner_protocol is set, a
tunnel layer (VXLAN, Geneve, GRE, etc.) has already saved the correct
inner header offsets and they must not be overwritten. When
inner_protocol is zero, no prior tunnel encapsulation exists and xfrm
must save the inner headers itself. The tunnel mode checks are only
added for completion, since they aren't strictly required, as
xfrm_output() forces software GSO in tunnel mode before encap.
This makes the previously added test pass:
# ./tools/testing/selftests/drivers/net/hw/ipsec_vxlan.py
TAP version 13
1..4
ok 1 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v4_inner_v4
ok 2 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v4_inner_v6
ok 3 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v6_inner_v4
ok 4 ipsec_vxlan.test_vxlan_ipsec_crypto_offload.outer_v6_inner_v6
# Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0
[1] commit 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()")
Fixes: f1bd7d659ef0 ("xfrm: Add encapsulation header offsets while SKB is not encrypted")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/xfrm/xfrm_output.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 21aa65caf0c69..00d10debec080 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -67,7 +67,9 @@ static int xfrm4_transport_output(struct xfrm_state *x, struct sk_buff *skb)
struct iphdr *iph = ip_hdr(skb);
int ihl = iph->ihl * 4;
- skb_set_inner_transport_header(skb, skb_transport_offset(skb));
+ if (!skb->inner_protocol)
+ skb_set_inner_transport_header(skb,
+ skb_transport_offset(skb));
skb_set_network_header(skb, -x->props.header_len);
skb->mac_header = skb->network_header +
@@ -168,7 +170,9 @@ static int xfrm6_transport_output(struct xfrm_state *x, struct sk_buff *skb)
int hdr_len;
iph = ipv6_hdr(skb);
- skb_set_inner_transport_header(skb, skb_transport_offset(skb));
+ if (!skb->inner_protocol)
+ skb_set_inner_transport_header(skb,
+ skb_transport_offset(skb));
hdr_len = xfrm6_hdr_offset(x, skb, &prevhdr);
if (hdr_len < 0)
@@ -277,8 +281,10 @@ static int xfrm4_tunnel_encap_add(struct xfrm_state *x, struct sk_buff *skb)
struct iphdr *top_iph;
int flags;
- skb_set_inner_network_header(skb, skb_network_offset(skb));
- skb_set_inner_transport_header(skb, skb_transport_offset(skb));
+ if (!skb->inner_protocol) {
+ skb_set_inner_network_header(skb, skb_network_offset(skb));
+ skb_set_inner_transport_header(skb, skb_transport_offset(skb));
+ }
skb_set_network_header(skb, -x->props.header_len);
skb->mac_header = skb->network_header +
@@ -322,8 +328,10 @@ static int xfrm6_tunnel_encap_add(struct xfrm_state *x, struct sk_buff *skb)
struct ipv6hdr *top_iph;
int dsfield;
- skb_set_inner_network_header(skb, skb_network_offset(skb));
- skb_set_inner_transport_header(skb, skb_transport_offset(skb));
+ if (!skb->inner_protocol) {
+ skb_set_inner_network_header(skb, skb_network_offset(skb));
+ skb_set_inner_transport_header(skb, skb_transport_offset(skb));
+ }
skb_set_network_header(skb, -x->props.header_len);
skb->mac_header = skb->network_header +
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 036/555] Bluetooth: hci_core: Fix not checking skb length on hci_scodata_packet
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 035/555] xfrm: Dont clobber inner headers when already set Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 037/555] mtd: core: avoid double-free of OTP NVMEM device Greg Kroah-Hartman
` (30 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Petr Vaganov,
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>
commit 59437cbb5781227567dec226aaa88c66a09ccc5a upstream.
This fixes not checking if skb really contains an SCO header otherwise
the code may attempt to access some uninitilized/invalid memory past the
valid skb->data.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ Petr: add Fixes tag ]
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Petr Vaganov <petrvaganoff@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bluetooth/hci_core.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 1ad2ea661e908..d2fcccdf482e0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3931,18 +3931,22 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
/* SCO data packet */
static void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb)
{
- struct hci_sco_hdr *hdr = (void *) skb->data;
+ struct hci_sco_hdr *hdr;
struct hci_conn *conn;
__u16 handle, flags;
- skb_pull(skb, HCI_SCO_HDR_SIZE);
+ hdr = skb_pull_data(skb, sizeof(*hdr));
+ if (!hdr) {
+ bt_dev_err(hdev, "SCO packet too small");
+ goto drop;
+ }
handle = __le16_to_cpu(hdr->handle);
flags = hci_flags(handle);
handle = hci_handle(handle);
- BT_DBG("%s len %d handle 0x%4.4x flags 0x%4.4x", hdev->name, skb->len,
- handle, flags);
+ bt_dev_dbg(hdev, "len %d handle 0x%4.4x flags 0x%4.4x", skb->len,
+ handle, flags);
hdev->stat.sco_rx++;
@@ -3960,6 +3964,7 @@ static void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb)
handle);
}
+drop:
kfree_skb(skb);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 037/555] mtd: core: avoid double-free of OTP NVMEM device
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 036/555] Bluetooth: hci_core: Fix not checking skb length on hci_scodata_packet Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 038/555] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call() Greg Kroah-Hartman
` (29 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Miquel Raynal,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 26300879cd8e4612dce66bb8f6ff7cd35fcf3e59 ]
If factory OTP setup fails after the user OTP NVMEM device has been
registered, mtd_otp_nvmem_add() unregisters the user device but leaves
mtd->otp_user_nvmem set. On an error, the caller unregisters it again.
For -EOPNOTSUPP, registration continues and normal teardown unregisters
it again.
Clear mtd->otp_user_nvmem after unregistering it.
Fixes: e0489f6e221f ("mtd: core: fix error path for nvmem provider")
Fixes: fe0b8213c012 ("mtd: core: Don't fail mtd_otp_nvmem_add() if OTP is unsupported")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mtd/mtdcore.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 6bda8b9684920..07f7da2b61034 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1029,6 +1029,7 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd)
err:
nvmem_unregister(mtd->otp_user_nvmem);
+ mtd->otp_user_nvmem = NULL;
/* Don't report error if OTP is not supported. */
if (err == -EOPNOTSUPP)
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 038/555] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call()
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 037/555] mtd: core: avoid double-free of OTP NVMEM device Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 039/555] bpf: Reject programs with inlined helpers if JIT is not available Greg Kroah-Hartman
` (28 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, KaFai Wan,
Leon Hwang, Tiezhu Yang, Eduard Zingerman, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <yangtiezhu@loongson.cn>
[ Upstream commit 9a6df65d5c6a9947ddab4e563e329720f44b8747 ]
Introduce a 'jit_required' bitfield flag in struct bpf_prog to track
whether a BPF program strictly requires the JIT compiler to run. This
prevents a dangerous runtime fallback to the interpreter for features
that are only implemented in the JIT compiler.
Currently, bpf_prog_has_kfunc_call() is used only for kernel function
calls, replace the kfunc-specific helper with the new 'jit_required'
flag. This makes it easy to support other JIT-only BPF features, such
as inlined helpers.
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Suggested-by: KaFai Wan <kafai.wan@linux.dev>
Suggested-by: Leon Hwang <leon.hwang@linux.dev>
Acked-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
[edit]
Adapt the bpf_fixup_call_args() change to fixup_call_args() in
kernel/bpf/verifier.c, and the __bpf_prog_select_runtime() change to
bpf_prog_select_runtime() in kernel/bpf/core.c.
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/bpf.h | 9 ++-------
kernel/bpf/core.c | 7 ++-----
kernel/bpf/verifier.c | 12 ++++--------
3 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 98f816a37d3be..f2df5c47bef74 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1587,8 +1587,9 @@ struct bpf_prog_aux {
struct bpf_prog {
u16 pages; /* Number of allocated pages */
- u16 jited:1, /* Is our filter JIT'ed? */
+ u32 jited:1, /* Is our filter JIT'ed? */
jit_requested:1,/* archs need to JIT the prog */
+ jit_required:1, /* program strictly requires JIT compiler */
gpl_compatible:1, /* Is filter GPL compatible? */
cb_access:1, /* Is control block accessed? */
dst_needed:1, /* Do we need dst entry? */
@@ -2694,7 +2695,6 @@ const struct bpf_func_proto *bpf_base_func_proto(enum bpf_func_id func_id,
const struct bpf_prog *prog);
void bpf_task_storage_free(struct task_struct *task);
void bpf_cgrp_storage_free(struct cgroup *cgroup);
-bool bpf_prog_has_kfunc_call(const struct bpf_prog *prog);
const struct btf_func_model *
bpf_jit_find_kfunc_model(const struct bpf_prog *prog,
const struct bpf_insn *insn);
@@ -2963,11 +2963,6 @@ static inline void bpf_task_storage_free(struct task_struct *task)
{
}
-static inline bool bpf_prog_has_kfunc_call(const struct bpf_prog *prog)
-{
- return false;
-}
-
static inline const struct btf_func_model *
bpf_jit_find_kfunc_model(const struct bpf_prog *prog,
const struct bpf_insn *insn)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index de2c0ffb30252..f94524481f27b 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -122,6 +122,7 @@ struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flag
fp->aux = aux;
fp->aux->prog = fp;
fp->jit_requested = ebpf_jit_enabled();
+ fp->jit_required = IS_ENABLED(CONFIG_BPF_JIT_ALWAYS_ON);
fp->blinding_requested = bpf_jit_blinding_enabled(fp);
#ifdef CONFIG_CGROUP_BPF
aux->cgroup_atype = CGROUP_BPF_ATTACH_TYPE_INVALID;
@@ -2531,15 +2532,11 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
/* In case of BPF to BPF calls, verifier did all the prep
* work with regards to JITing, etc.
*/
- bool jit_needed = false;
+ bool jit_needed = fp->jit_required;
if (fp->bpf_func)
goto finalize;
- if (IS_ENABLED(CONFIG_BPF_JIT_ALWAYS_ON) ||
- bpf_prog_has_kfunc_call(fp))
- jit_needed = true;
-
if (!bpf_prog_select_interpreter(fp))
jit_needed = true;
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index a5ffecbaa7bf9..f25dfaecb3732 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -2974,6 +2974,8 @@ static int add_kfunc_call(struct bpf_verifier_env *env, u32 func_id, s16 offset)
prog_aux->kfunc_tab = tab;
}
+ env->prog->jit_required = 1;
+
/* func_id == 0 is always invalid, but instead of returning an error, be
* conservative and wait until the code elimination pass before returning
* error, so that invalid calls that get pruned out can be in BPF programs
@@ -3082,11 +3084,6 @@ static void sort_kfunc_descs_by_imm_off(struct bpf_prog *prog)
kfunc_desc_cmp_by_imm_off, NULL);
}
-bool bpf_prog_has_kfunc_call(const struct bpf_prog *prog)
-{
- return !!prog->aux->kfunc_tab;
-}
-
const struct btf_func_model *
bpf_jit_find_kfunc_model(const struct bpf_prog *prog,
const struct bpf_insn *insn)
@@ -20970,7 +20967,6 @@ static int fixup_call_args(struct bpf_verifier_env *env)
#ifndef CONFIG_BPF_JIT_ALWAYS_ON
struct bpf_prog *prog = env->prog;
struct bpf_insn *insn = prog->insnsi;
- bool has_kfunc_call = bpf_prog_has_kfunc_call(prog);
int i, depth;
#endif
int err = 0;
@@ -20984,8 +20980,8 @@ static int fixup_call_args(struct bpf_verifier_env *env)
return err;
}
#ifndef CONFIG_BPF_JIT_ALWAYS_ON
- if (has_kfunc_call) {
- verbose(env, "calling kernel functions are not allowed in non-JITed programs\n");
+ if (prog->jit_required) {
+ verbose(env, "program requires BPF JIT compiler but it is not available\n");
return -EINVAL;
}
if (env->subprog_cnt > 1 && env->prog->aux->tail_call_reachable) {
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 039/555] bpf: Reject programs with inlined helpers if JIT is not available
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 038/555] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call() Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 040/555] bpf: Disallow interpreter fallback for arena-related insns Greg Kroah-Hartman
` (27 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, KaFai Wan,
Leon Hwang, Tiezhu Yang, Eduard Zingerman, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <yangtiezhu@loongson.cn>
[ Upstream commit f1c27922576edccb99d0257827d09bd05c0304a6 ]
When an architecture (such as LoongArch, ARM64, and RISC-V) implements
bpf_jit_inlines_helper_call(), the verifier skips rewriting the helper
call offset (insn->imm) in bpf_do_misc_fixups(). This is because the
helper is expected to be inlined by the JIT compiler later. Therefore,
insn->imm remains as the raw helper enum ID.
However, if JIT is disabled at runtime (net.core.bpf_jit_enable=0) or
if JIT compilation fails dynamically (e.g., due to OOM), the program
falls back to the BPF interpreter.
When the interpreter executes (__bpf_call_base + insn->imm) with the
unpatched raw ID, it jumps into an invalid address space, triggering
an instruction alignment fault or a kernel panic.
Although these helpers have valid C implementations in the kernel, the
omission of offset rewriting makes runtime interpreter fallback fatal.
Fix this by setting 'prog->jit_required = 1' when helper call rewriting
is skipped for JIT inlining. This ensures that such programs are safely
rejected if JIT is not available, preventing the runtime kernel panic.
Fixes: 2ddec2c80b44 ("riscv, bpf: inline bpf_get_smp_processor_id()")
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Suggested-by: KaFai Wan <kafai.wan@linux.dev>
Acked-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
[edit]
Apply the bpf_do_misc_fixups() change from kernel/bpf/fixups.c to
do_misc_fixups() in kernel/bpf/verifier.c.
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index f25dfaecb3732..4b1d89ec02a8f 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -21546,8 +21546,10 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
}
/* Skip inlining the helper call if the JIT does it. */
- if (bpf_jit_inlines_helper_call(insn->imm))
+ if (bpf_jit_inlines_helper_call(insn->imm)) {
+ prog->jit_required = 1;
goto next_insn;
+ }
if (insn->imm == BPF_FUNC_get_route_realm)
prog->dst_needed = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 040/555] bpf: Disallow interpreter fallback for arena-related insns
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 039/555] bpf: Reject programs with inlined helpers if JIT is not available Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 041/555] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Greg Kroah-Hartman
` (26 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Kumar Kartikeya Dwivedi,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Hwang <leon.hwang@linux.dev>
[ Upstream commit 34746b5a84ec37c0ea2bf6808c65c5ed8790eb51 ]
Since the interpreter does not support the arena-related insns,
interpreter fallback should not be allowed for these insns in
core.c::__bpf_prog_select_runtime().
Currently, when the interpreter executes the arena ST/LDX/STX insns,
it would hit the BUG_ON() in ___bpf_prog_run() at run time.
[ 2.579196] BPF interpreter: unknown opcode a2 (imm: 0x0)
[ 2.579998] ------------[ cut here ]------------
[ 2.580652] kernel BUG at kernel/bpf/core.c:2349!
[ 2.581314] Oops: invalid opcode: 0000 [#1] SMP PTI
Set jit_required as true when arena map is used in the prog to disallow
interpreter fallback for arena-related insns.
Fixes: 6082b6c328b5 ("bpf: Recognize addr_space_cast instruction in the verifier.")
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/bpf/20260715141122.15783-2-leon.hwang@linux.dev
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[edit]
Apply the check_map_prog_compatibility() change in
resolve_pseudo_ldimm64(), where this branch handles arena maps.
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 4b1d89ec02a8f..bcfc23ff3c57a 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -19841,6 +19841,7 @@ static int resolve_pseudo_ldimm64(struct bpf_verifier_env *env)
return -EOPNOTSUPP;
}
env->prog->aux->arena = (void *)map;
+ env->prog->jit_required = true;
if (!bpf_arena_get_user_vm_start(env->prog->aux->arena)) {
verbose(env, "arena's user address must be set via map_extra or mmap()\n");
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 041/555] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 040/555] bpf: Disallow interpreter fallback for arena-related insns Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 042/555] mm/page_alloc: dont increase highatomic reserve after pcp alloc Greg Kroah-Hartman
` (25 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Kumar Kartikeya Dwivedi,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Hwang <leon.hwang@linux.dev>
[ Upstream commit 7a0855e73757ee9cf25ba635a1c735018ecba742 ]
The BPF_MOV64_PERCPU_REG insn requires JIT to emit native code to for
'dst_reg = src_reg + <percpu_base_off>'.
However, the interpreter ignores the 'off' at its ALU64_MOV_X label.
The 'off' indicates the insn is BPF_MOV64_PERCPU_REG insn. Then, when
the interpreter loads memory from the register, it will hit a page
fault.
[ 2.545572] BUG: unable to handle page fault for address: ffffffffacaaf034
[ 2.546485] #PF: supervisor read access in kernel mode
[ 2.547167] #PF: error_code(0x0000) - not-present page
[ 2.547850] PGD 134e63067 P4D 134e63067 PUD 134e64063 PMD 10021c063 PTE 800ffffeca550062
[ 2.548912] Oops: Oops: 0000 [#1] SMP PTI
Set jit_required as true in order to disallow interpreter fallback in
core.c::__bpf_prog_select_runtime(), if any BPF_ADDR_PERCPU insn is
patched to the prog.
BTW, rename the helper bpf_map_supports_cpu_flags() to
bpf_map_is_percpu_map().
Fixes: 7bdbf7446305 ("bpf: add special internal-only MOV instruction to resolve per-CPU addrs")
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Link: https://lore.kernel.org/bpf/20260715141122.15783-4-leon.hwang@linux.dev
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
[edit]
Add bpf_map_is_percpu_map() directly because 6.12.y lacks
bpf_map_supports_cpu_flags().
Apply the map lookup and bpf_get_smp_processor_id() changes to
do_misc_fixups() in kernel/bpf/verifier.c.
Omit the current-task helper hunk because 6.12.y lacks the verifier
inlining introduced by commit
eaedea154eb9 ("bpf, x86: inline bpf_get_current_task() for x86_64").
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/bpf.h | 13 +++++++++++++
kernel/bpf/verifier.c | 4 ++++
2 files changed, 17 insertions(+)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index f2df5c47bef74..c8d8663b63915 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -3521,4 +3521,17 @@ static inline bool bpf_is_subprog(const struct bpf_prog *prog)
return prog->aux->func_idx != 0;
}
+static inline bool bpf_map_is_percpu_map(enum bpf_map_type map_type)
+{
+ switch (map_type) {
+ case BPF_MAP_TYPE_PERCPU_ARRAY:
+ case BPF_MAP_TYPE_PERCPU_HASH:
+ case BPF_MAP_TYPE_LRU_PERCPU_HASH:
+ case BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE:
+ return true;
+ default:
+ return false;
+ }
+}
+
#endif /* _LINUX_BPF_H */
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index bcfc23ff3c57a..7ffd073c08423 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -21738,6 +21738,9 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
return -EINVAL;
}
+ if (bpf_map_is_percpu_map(map_ptr->map_type))
+ prog->jit_required = true;
+
new_prog = bpf_patch_insn_data(env, i + delta,
insn_buf, cnt);
if (!new_prog)
@@ -21842,6 +21845,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
* way, it's fine to back out this inlining logic
*/
#ifdef CONFIG_SMP
+ prog->jit_required = true;
insn_buf[0] = BPF_MOV32_IMM(BPF_REG_0, (u32)(unsigned long)&pcpu_hot.cpu_number);
insn_buf[1] = BPF_MOV64_PERCPU_REG(BPF_REG_0, BPF_REG_0);
insn_buf[2] = BPF_LDX_MEM(BPF_W, BPF_REG_0, BPF_REG_0, 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 042/555] mm/page_alloc: dont increase highatomic reserve after pcp alloc
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 041/555] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 043/555] mm/page_alloc: use existing highatomic reserves on the buddy fastpath Greg Kroah-Hartman
` (24 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhiguo Jiang, Frank van der Linden,
Vlastimil Babka (SUSE), Brendan Jackman, Johannes Weiner,
Michal Hocko, Suren Baghdasaryan, Zi Yan, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank van der Linden <fvdl@google.com>
[ Upstream commit b480cbb071020bd590a0dc0166635b448e9fc46b ]
Higher order GFP_ATOMIC allocations can be served through a PCP list with
ALLOC_HIGHATOMIC set. Such an allocation can e.g. happen if a zone is
between the low and min watermarks, and get_page_from_freelist is retried
after the alloc_flags are relaxed.
The call to reserve_highatomic_pageblock() after such a PCP allocation
will result in an increase every single time: the page from the
(unmovable) PCP list will never have migrate type MIGRATE_HIGHATOMIC,
since MIGRATE_HIGHATOMIC pages do not appear on the unmovable PCP list.
So a new pageblock is converted to MIGRATE_HIGHATOMIC.
Eventually that leads to the maximum of 1% of the zone being used up by
(often mostly free) MIGRATE_HIGHATOMIC pageblocks, for no good reason.
Since this space is not available for normal allocations, this wastes
memory and will push things in to reclaim too soon.
This was observed on a system that ran a test with bursts of memory
activity, paired with GFP_ATOMIC SLUB activity. These would lead to a new
slab being allocated with GFP_ATOMIC, sometimes hitting the
get_page_from_freelist retry path by being below the low watermark. While
the frequency of those allocations was low, it kept adding up over time,
and the number of MIGRATE_ATOMIC pageblocks kept increasing.
If a higher order atomic allocation can be served by the unmovable PCP
list, there is probably no need yet to extend the reserves. So, move the
check and possible extension of the highatomic reserves to the buddy case
only, and do not refill the PCP list for ALLOC_HIGHATOMIC if it's empty.
This way, the PCP list is tried for ALLOC_HIGHATOMIC for a fast atomic
allocation. But it will immediately fall back to rmqueue_buddy() if it's
empty. In rmqueue_buddy(), the MIGRATE_HIGHATOMIC buddy lists are tried
first (as before), and the reserves are extended only if that fails.
With this change, the test was stable. Highatomic reserves were built up,
but to a normal level. No highatomic failures were seen.
This is similar to the patch proposed in [1] by Zhiguo Jiang, but
re-arranged a bit.
Link: https://lkml.kernel.org/r/20260320173426.1831267-1-fvdl@google.com
Link: https://lore.kernel.org/all/20231122013925.1507-1-justinjiang@vivo.com/ [1]
Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists")
Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
Signed-off-by: Frank van der Linden <fvdl@google.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Zhiguo Jiang <justinjiang@vivo.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index dc4b0d58c4d0d..a3d0281897035 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -241,6 +241,8 @@ unsigned int pageblock_order __read_mostly;
static void __free_pages_ok(struct page *page, unsigned int order,
fpi_t fpi_flags);
+static void reserve_highatomic_pageblock(struct page *page, int order,
+ struct zone *zone);
/*
* results with 256, 32 in the lowmem_reserve sysctl:
@@ -3014,6 +3016,13 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone,
spin_unlock_irqrestore(&zone->lock, flags);
} while (check_new_pages(page, order));
+ /*
+ * If this is a high-order atomic allocation then check
+ * if the pageblock should be reserved for the future
+ */
+ if (unlikely(alloc_flags & ALLOC_HIGHATOMIC))
+ reserve_highatomic_pageblock(page, order, zone);
+
__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
zone_statistics(preferred_zone, zone, 1);
@@ -3085,6 +3094,20 @@ struct page *__rmqueue_pcplist(struct zone *zone, unsigned int order,
int batch = nr_pcp_alloc(pcp, zone, order);
int alloced;
+ /*
+ * Don't refill the list for a higher order atomic
+ * allocation under memory pressure, as this would
+ * not build up any HIGHATOMIC reserves, which
+ * might be needed soon.
+ *
+ * Instead, direct it towards the reserves by
+ * returning NULL, which will make the caller fall
+ * back to rmqueue_buddy. This will try to use the
+ * reserves first and grow them if needed.
+ */
+ if (alloc_flags & ALLOC_HIGHATOMIC)
+ return NULL;
+
alloced = rmqueue_bulk(zone, order,
batch, list,
migratetype, alloc_flags);
@@ -3569,13 +3592,6 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
if (page) {
prep_new_page(page, order, gfp_mask, alloc_flags);
- /*
- * If this is a high-order atomic allocation then check
- * if the pageblock should be reserved for the future
- */
- if (unlikely(alloc_flags & ALLOC_HIGHATOMIC))
- reserve_highatomic_pageblock(page, order, zone);
-
return page;
} else {
if (cond_accept_memory(zone, order))
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 043/555] mm/page_alloc: use existing highatomic reserves on the buddy fastpath
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 042/555] mm/page_alloc: dont increase highatomic reserve after pcp alloc Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 044/555] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
` (23 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, JP Kobryn, Vlastimil Babka (SUSE),
Johannes Weiner, Shakeel Butt, Brendan Jackman, David Hildenbrand,
Frank van der Linden, Liam R. Howlett, Lorenzo Stoakes,
Michal Hocko, Mike Rapoport, Suren Baghdasaryan, Zi Yan,
Andrew Morton, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: JP Kobryn <jp.kobryn@linux.dev>
[ Upstream commit 9f2fd03c9bde366c928c9242fc9b2e2c5111a134 ]
ALLOC_HIGHATOMIC currently provides both access to MIGRATE_HIGHATOMIC free
pages and permission to create new highatomic pageblock reserves. This
makes it unsuitable for the fastpath.
However, the fastpath can reach rmqueue_buddy() while MIGRATE_HIGHATOMIC
reserves have free pages available. In this situation, the allocation can
fall back to other migratetypes without trying those reserves first.
Allow high-priority non-blocking allocations to use existing
MIGRATE_HIGHATOMIC reserves on the buddy fastpath without growing them.
First tighten the criteria for reserving pageblocks so that growth may
only occur in the slowpath. Then allow fastpath usage by enabling
ALLOC_HIGHATOMIC when the GFP mask describes a non-blocking high-priority
allocation. This logic has been factored out from gfp_to_alloc_flags() to
a new function gfp_to_alloc_flags_nonblocking().
A UDP receive workload was run with free MIGRATE_HIGHATOMIC pageblocks
available in the target zone. Before this patch, the workload did not
consume these blocks. With this patch, eligible order-1 allocations
reaching the buddy path consumed existing MIGRATE_HIGHATOMIC pageblocks,
with no highatomic misses observed. The workload did not grow highatomic
reserves and NAPI page-frag allocations remained healthy with no failures
or order-0 fallbacks.
Link: https://lore.kernel.org/20260623004600.113347-1-jp.kobryn@linux.dev
Signed-off-by: JP Kobryn <jp.kobryn@linux.dev>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Frank van der Linden <fvdl@google.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 44 ++++++++++++++++++++++++++++++--------------
1 file changed, 30 insertions(+), 14 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a3d0281897035..c34ec6a7ded68 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3017,10 +3017,11 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone,
} while (check_new_pages(page, order));
/*
- * If this is a high-order atomic allocation then check
- * if the pageblock should be reserved for the future
+ * Slowpath (precarious) high-atomic allocations may reserve
+ * a pageblock for future use.
*/
- if (unlikely(alloc_flags & ALLOC_HIGHATOMIC))
+ if (unlikely((alloc_flags & ALLOC_HIGHATOMIC) &&
+ ((alloc_flags & ALLOC_WMARK_MASK) == ALLOC_WMARK_MIN)))
reserve_highatomic_pageblock(page, order, zone);
__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
@@ -4101,6 +4102,29 @@ static void wake_all_kswapds(unsigned int order, gfp_t gfp_mask,
}
}
+static inline unsigned int
+gfp_to_alloc_flags_nonblocking(gfp_t gfp_mask, unsigned int order)
+{
+ unsigned int alloc_flags = 0;
+
+ if (gfp_mask & __GFP_DIRECT_RECLAIM)
+ return 0;
+
+ /*
+ * Not worth trying to allocate harder for __GFP_NOMEMALLOC even
+ * if it can't schedule.
+ */
+ if (gfp_mask & __GFP_NOMEMALLOC)
+ return 0;
+
+ alloc_flags |= ALLOC_NON_BLOCK;
+
+ if (order > 0 && (gfp_mask & __GFP_HIGH))
+ alloc_flags |= ALLOC_HIGHATOMIC;
+
+ return alloc_flags;
+}
+
static inline unsigned int
gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order)
{
@@ -4123,18 +4147,9 @@ gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order)
alloc_flags |= (__force int)
(gfp_mask & (__GFP_HIGH | __GFP_KSWAPD_RECLAIM));
- if (!(gfp_mask & __GFP_DIRECT_RECLAIM)) {
- /*
- * Not worth trying to allocate harder for __GFP_NOMEMALLOC even
- * if it can't schedule.
- */
- if (!(gfp_mask & __GFP_NOMEMALLOC)) {
- alloc_flags |= ALLOC_NON_BLOCK;
-
- if (order > 0 && (alloc_flags & ALLOC_MIN_RESERVE))
- alloc_flags |= ALLOC_HIGHATOMIC;
- }
+ alloc_flags |= gfp_to_alloc_flags_nonblocking(gfp_mask, order);
+ if (!(gfp_mask & __GFP_DIRECT_RECLAIM)) {
/*
* Ignore cpuset mems for non-blocking __GFP_HIGH (probably
* GFP_ATOMIC) rather than fail, see the comment for
@@ -4899,6 +4914,7 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
* memory until all local zones are considered.
*/
alloc_flags |= alloc_flags_nofragment(zonelist_zone(ac.preferred_zoneref), gfp);
+ alloc_flags |= gfp_to_alloc_flags_nonblocking(gfp, order) & ALLOC_HIGHATOMIC;
/* First allocation attempt */
page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 044/555] xprtrdma: serialize unmap_sync with xprt_disconnect
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 043/555] mm/page_alloc: use existing highatomic reserves on the buddy fastpath Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 045/555] gve: Fix race between stats query and queue reconfig Greg Kroah-Hartman
` (22 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Tim Menninger,
Anna Schumaker, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Menninger <tmenninger@everpuredata.com>
[ Upstream commit 1fa415883c37b02ff17acdd7977ed591d3d389ee ]
frwr_unmap_sync() posts LOCAL_INV Work Requests to the QP and waits
for the matching CQE. This can race with rpcrdma_xprt_disconnect():
1. frwr_unmap_sync() samples r_xprt->rx_ep
2. rpcrdma_xprt_disconnect() drains the QP
3. frwr_unmap_sync() posts LOCAL_INV WRs after the drain
4. No CQE arrives, so wait_for_completion() blocks indefinitely
The hung task appears in the rpciod workqueue:
Workqueue: rpciod rpc_async_schedule [sunrpc]
wait_for_completion()
frwr_unmap_sync()
xprt_rdma_free()
xprt_release()
Serialize synchronous MR invalidation against QP teardown with
rx_unmap_rwsem. frwr_unmap_sync() holds the read side while it builds
and submits the LOCAL_INV chain. Disconnect holds the write side across
QP drain and resource teardown. Drop the read side before waiting so
disconnect can drain the submitted Work Requests and deliver their CQEs.
Disconnect can reset a request while frwr_unmap_sync() waits for the
read side. Recheck rl_registered after acquiring the rwsem and return
without posting if the request has already been reset.
Move the synchronous invalidation completion from the final MR to the
request, whose lifetime covers xprt_rdma_free(). This allows disconnect
to destroy MRs after draining the QP while frwr_unmap_sync() is still
waiting. On a post failure, call rpcrdma_force_disconnect() before
dropping the read side so the endpoint is not dereferenced after
disconnect can run.
frwr_unmap_async() runs inline from Receive completion processing.
rpcrdma_xprt_drain() drains the Receive Queue before the Send Queue, so
asynchronous LOCAL_INV Work Requests are submitted before Send Queue
drain. frwr_unmap_sync(), however, runs from xprt_rdma_free() after the
transport send lock has been released, so it is not ordered against
disconnect.
Tested on v7.4-rc1 under pNFS load with repeated data server restarts
to provoke rapid QP disconnect/reconnect cycling. Without the fix, a
hung task in frwr_unmap_sync() reproduced twice in six attempts. With
the fix, no hang occurred across 200 cycles.
Also observed on v6.8 and v6.18.34.
Fixes: e28ce90083f0 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt")
Cc: stable@vger.kernel.org
Assisted-by: Claude:opus-4-7
Reviewed-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/xprtrdma/frwr_ops.c | 89 ++++++++++++++++++++-------------
net/sunrpc/xprtrdma/transport.c | 2 +
net/sunrpc/xprtrdma/verbs.c | 16 ++++--
net/sunrpc/xprtrdma/xprt_rdma.h | 10 +++-
4 files changed, 78 insertions(+), 39 deletions(-)
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c
index a82eefe5e6b58..90107c4e8317a 100644
--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -27,13 +27,17 @@
/* Transport recovery
*
- * frwr_map and frwr_unmap_* cannot run at the same time the transport
- * connect worker is running. The connect worker holds the transport
- * send lock, just as ->send_request does. This prevents frwr_map and
- * the connect worker from running concurrently. When a connection is
- * closed, the Receive completion queue is drained before the allowing
- * the connect worker to get control. This prevents frwr_unmap and the
- * connect worker from running concurrently.
+ * frwr_map() is serialized with the connect worker by the transport
+ * send lock.
+ *
+ * frwr_unmap_async() runs from Receive completion processing.
+ * rpcrdma_xprt_drain() drains the Receive Queue before the Send Queue,
+ * so asynchronous LOCAL_INV Work Requests are submitted before Send
+ * Queue drain.
+ *
+ * frwr_unmap_sync() runs after the transport send lock is released.
+ * rx_unmap_rwsem orders its LOCAL_INV submission before disconnect
+ * drains the QP.
*
* When the underlying transport disconnects, MRs that are in flight
* are flushed and are likely unusable. Thus all MRs are destroyed.
@@ -139,7 +143,6 @@ int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)
mr->mr_ibmr = frmr;
mr->mr_device = NULL;
INIT_LIST_HEAD(&mr->mr_list);
- init_completion(&mr->mr_linv_done);
frwr_cid_init(ep, mr);
sg_init_table(sg, depth);
@@ -468,40 +471,60 @@ static void frwr_wc_localinv(struct ib_cq *cq, struct ib_wc *wc)
* @cq: completion queue
* @wc: WCE for a completed LocalInv WR
*
- * Awaken anyone waiting for an MR to finish being fenced.
+ * Wake frwr_unmap_sync() after the final LOCAL_INV completion.
*/
static void frwr_wc_localinv_wake(struct ib_cq *cq, struct ib_wc *wc)
{
struct ib_cqe *cqe = wc->wr_cqe;
struct rpcrdma_mr *mr = container_of(cqe, struct rpcrdma_mr, mr_cqe);
+ struct rpcrdma_req *req = mr->mr_req;
/* WARNING: Only wr_cqe and status are reliable at this point */
trace_xprtrdma_wc_li_wake(wc, &mr->mr_cid);
frwr_mr_done(wc, mr);
- complete(&mr->mr_linv_done);
+ complete(&req->rl_linv_done);
rpcrdma_flush_disconnect(cq->cq_context, wc);
}
/**
- * frwr_unmap_sync - invalidate memory regions that were registered for @req
+ * frwr_unmap_sync - synchronously invalidate MRs registered for @req
* @r_xprt: controlling transport instance
- * @req: rpcrdma_req with a non-empty list of MRs to process
+ * @req: request whose registered MRs are to be invalidated
*
- * Sleeps until it is safe for the host CPU to access the previously mapped
- * memory regions. This guarantees that registered MRs are properly fenced
- * from the server before the RPC consumer accesses the data in them. It
- * also ensures proper Send flow control: waking the next RPC waits until
- * this RPC has relinquished all its Send Queue entries.
+ * If @req still owns registered MRs after synchronizing with transport
+ * disconnect, post a chain of LOCAL_INV Work Requests and wait for the
+ * final completion. On successful completion, this fences the mapped
+ * regions from remote access and preserves Send Queue flow control.
+ *
+ * A concurrent disconnect can reset @req while this function waits for
+ * the read side. In that case the MRs have already been released and no
+ * LOCAL_INV Work Requests are posted.
+ *
+ * Context: Process context. Takes and releases
+ * @r_xprt->rx_unmap_rwsem for read. May sleep.
*/
void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
{
struct ib_send_wr *first, **prev, *last;
- struct rpcrdma_ep *ep = r_xprt->rx_ep;
const struct ib_send_wr *bad_wr;
+ struct rpcrdma_ep *ep;
struct rpcrdma_mr *mr;
int rc;
+ /* serialize against rpcrdma_xprt_disconnect() */
+ down_read(&r_xprt->rx_unmap_rwsem);
+
+ /*
+ * Disconnect can reset this request while we wait for the read side.
+ * Recheck rl_registered in case rx_ep now refers to a new connection.
+ */
+ ep = r_xprt->rx_ep;
+ if (!ep || list_empty(&req->rl_registered)) {
+ up_read(&r_xprt->rx_unmap_rwsem);
+ return;
+ }
+
/* ORDER: Invalidate all of the MRs first
*
* Chain the LOCAL_INV Work Requests and post them with
@@ -528,37 +551,35 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
prev = &last->next;
} while ((mr = rpcrdma_mr_pop(&req->rl_registered)));
- mr = container_of(last, struct rpcrdma_mr, mr_invwr);
-
/* Strong send queue ordering guarantees that when the
* last WR in the chain completes, all WRs in the chain
* are complete.
*/
last->wr_cqe->done = frwr_wc_localinv_wake;
- reinit_completion(&mr->mr_linv_done);
+ reinit_completion(&req->rl_linv_done);
- /* Transport disconnect drains the receive CQ before it
- * replaces the QP. The RPC reply handler won't call us
- * unless re_id->qp is a valid pointer.
+ /*
+ * The read side prevents disconnect from draining this QP until the
+ * LOCAL_INV chain has been submitted.
*/
bad_wr = NULL;
rc = ib_post_send(ep->re_id->qp, first, &bad_wr);
+ if (rc) {
+ /* On error, the MRs get destroyed once the QP has drained. */
+ trace_xprtrdma_post_linv_err(req, rc);
+
+ /* Force a connection loss to ensure complete recovery.
+ */
+ rpcrdma_force_disconnect(ep);
+ }
+ up_read(&r_xprt->rx_unmap_rwsem);
/* The final LOCAL_INV WR in the chain is supposed to
* do the wake. If it was never posted, the wake will
* not happen, so don't wait in that case.
*/
if (bad_wr != first)
- wait_for_completion(&mr->mr_linv_done);
- if (!rc)
- return;
-
- /* On error, the MRs get destroyed once the QP has drained. */
- trace_xprtrdma_post_linv_err(req, rc);
-
- /* Force a connection loss to ensure complete recovery.
- */
- rpcrdma_force_disconnect(ep);
+ wait_for_completion(&req->rl_linv_done);
}
/**
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 5ff8e5126a6c2..308fd79e09df3 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -364,6 +364,8 @@ xprt_setup_rdma(struct xprt_create *args)
INIT_DELAYED_WORK(&new_xprt->rx_connect_worker,
xprt_rdma_connect_worker);
+ init_rwsem(&new_xprt->rx_unmap_rwsem);
+
xprt->max_payload = RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT;
return xprt;
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 111c415f1aeda..3c44c2c28c4f3 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -572,20 +572,24 @@ int rpcrdma_xprt_connect(struct rpcrdma_xprt *r_xprt)
* rpcrdma_xprt_disconnect - Disconnect underlying transport
* @r_xprt: controlling transport instance
*
- * Caller serializes. Either the transport send lock is held,
- * or we're being called to destroy the transport.
+ * Context: Caller serializes. Either the transport send lock is held,
+ * or the transport is being destroyed. Takes and releases
+ * @r_xprt->rx_unmap_rwsem for write. May sleep.
*
* On return, @r_xprt is completely divested of all hardware
* resources and prepared for the next ->connect operation.
*/
void rpcrdma_xprt_disconnect(struct rpcrdma_xprt *r_xprt)
{
- struct rpcrdma_ep *ep = r_xprt->rx_ep;
+ struct rpcrdma_ep *ep;
struct rdma_cm_id *id;
int rc;
+ down_write(&r_xprt->rx_unmap_rwsem);
+
+ ep = r_xprt->rx_ep;
if (!ep)
- return;
+ goto out_unlock;
/* Prevent teardown-generated events from requesting another close. */
atomic_xchg(&ep->re_force_disconnect, 1);
@@ -604,6 +608,9 @@ void rpcrdma_xprt_disconnect(struct rpcrdma_xprt *r_xprt)
rdma_destroy_id(id);
r_xprt->rx_ep = NULL;
+
+out_unlock:
+ up_write(&r_xprt->rx_unmap_rwsem);
}
/* Fixed-size circular FIFO queue. This implementation is wait-free and
@@ -912,6 +919,7 @@ struct rpcrdma_req *rpcrdma_req_create(struct rpcrdma_xprt *r_xprt,
INIT_LIST_HEAD(&req->rl_free_mrs);
INIT_LIST_HEAD(&req->rl_registered);
+ init_completion(&req->rl_linv_done);
spin_lock(&buffer->rb_lock);
list_add(&req->rl_all, &buffer->rb_allreqs);
spin_unlock(&buffer->rb_lock);
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index ae14f6a526e6e..d8e02a06771f4 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -46,6 +46,7 @@
#include <linux/spinlock.h> /* spinlock_t, etc */
#include <linux/atomic.h> /* atomic_t, etc */
#include <linux/kref.h> /* struct kref */
+#include <linux/rwsem.h> /* struct rw_semaphore */
#include <linux/workqueue.h> /* struct work_struct */
#include <linux/llist.h>
@@ -248,7 +249,6 @@ struct rpcrdma_mr {
int mr_nents;
enum dma_data_direction mr_dir;
struct ib_cqe mr_cqe;
- struct completion mr_linv_done;
union {
struct ib_reg_wr mr_regwr;
struct ib_send_wr mr_invwr;
@@ -331,6 +331,7 @@ struct rpcrdma_req {
struct list_head rl_free_mrs;
struct list_head rl_registered;
struct rpcrdma_mr_seg rl_segments[RPCRDMA_MAX_SEGS];
+ struct completion rl_linv_done;
};
static inline struct rpcrdma_req *
@@ -432,6 +433,13 @@ struct rpcrdma_xprt {
struct delayed_work rx_connect_worker;
struct rpc_timeout rx_timeout;
struct rpcrdma_stats rx_stats;
+
+ /*
+ * Orders frwr_unmap_sync()'s LOCAL_INV submission ahead of the
+ * QP drain. Disconnect holds the write side across the drain
+ * and resource teardown.
+ */
+ struct rw_semaphore rx_unmap_rwsem;
};
#define rpcx_to_rdmax(x) container_of(x, struct rpcrdma_xprt, rx_xprt)
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 045/555] gve: Fix race between stats query and queue reconfig
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 044/555] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 046/555] gve: Block invalid ring sizes when device options are 0 Greg Kroah-Hartman
` (21 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Debarghya Kundu, Pin-yen Lin,
Harshitha Ramamurthy, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pin-yen Lin <treapking@google.com>
[ Upstream commit 7de69da15088ac2add08eb2b5f5c0a79fd461c1e ]
Fix a concurrency bug where network statistics queries race with queue
reconfiguration or interface teardown, causing a Use-After-Free (UAF) or
NULL pointer dereference.
Currently, statistics queries access priv->tx and priv->rx without
locking. When an interface is brought down or reconfigured,
gve_queues_mem_remove() frees these arrays. A concurrent stats query
can dereference freed queue structures and crash the kernel.
This issue was discovered and actually triggered by the
drivers/net/stats.py selftest. When an interface was brought down,
querying per-queue statistics via Netlink caused a kernel NULL pointer
dereference in gve_get_rx_queue_stats():
BUG: kernel NULL pointer dereference, address: 00000000000000a0
RIP: 0010:gve_get_rx_queue_stats+0x17/0x50 [gve]
Call Trace:
<TASK>
netdev_stat_queue_sum+0x11c/0x250
netdev_nl_stats_by_netdev+0x21b/0x2d0
netdev_nl_qstats_get_dumpit+0xd2/0x220
genl_dumpit+0x32/0x90
netlink_dump+0x1d2/0x450
__netlink_dump_start+0x1db/0x2a0
genl_family_rcv_msg_dumpit+0x9b/0x100
...
The per-queue stats callbacks run under the netdev instance lock, so
this NULL dereference is not a race; it happens on any query while the
interface is down.
Additionally, concurrent stats queries during queue reconfiguration can
race with gve_queues_mem_remove(), causing a Use-After-Free.
This affects gve_get_stats(), which does not hold the instance lock.
gve_handle_report_stats() also runs without it; it is stopped before
queue teardown, but can still read priv->rx[idx] while the single-queue
restart path rewrites it.
Fix this by introducing stats_lock to serialize stats queries against
queue teardown. In gve_queues_mem_remove(), queue pointers are set to
NULL under stats_lock before freeing. Stats readers acquire the lock
and verify pointers are non-NULL before reading counters.
The per-queue stats callbacks already run under the instance lock, but
take stats_lock as well for consistency.
The single-queue restart path also rewrites priv->rx[idx] in place, so
gve_rx_queue_stop() and gve_rx_queue_start() do those writes under
stats_lock as well.
This change was tested using the DQO RDA queue format.
Cc: stable@vger.kernel.org
Fixes: f5cedc84a30d ("gve: Add transmit and receive support")
Fixes: 2e5e0932dff5 ("gve: add support for basic queue stats")
Co-developed-by: Debarghya Kundu <debarghyak@google.com>
Signed-off-by: Debarghya Kundu <debarghyak@google.com>
Signed-off-by: Pin-yen Lin <treapking@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20261109182036.2910559-2-hramamurthy@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Dropped the two per-queue stats callback hunks since that code doesn't exist in this tree, and adjusted context plus the lock span in gve_queues_start() to match the older code. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/google/gve/gve.h | 5 +++++
drivers/net/ethernet/google/gve/gve_main.c | 22 ++++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h
index e19d722e8e9a1..3e768c64a5776 100644
--- a/drivers/net/ethernet/google/gve/gve.h
+++ b/drivers/net/ethernet/google/gve/gve.h
@@ -802,6 +802,11 @@ struct gve_priv {
struct workqueue_struct *gve_wq;
struct work_struct service_task;
struct work_struct stats_report_task;
+ /* Protects the priv->tx/priv->rx arrays, the in-place rewrite of
+ * priv->rx[idx] and the queue counts against stats readers that do
+ * not hold the netdev instance lock.
+ */
+ spinlock_t stats_lock;
unsigned long service_task_flags;
unsigned long state_flags;
diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index 974b493d712d2..a620dc6bc52ef 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -112,6 +112,7 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
int num_tx_queues;
int ring;
+ spin_lock_bh(&priv->stats_lock);
num_tx_queues = gve_num_tx_queues(priv);
if (priv->rx) {
for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
@@ -139,6 +140,7 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
s->tx_bytes += bytes;
}
}
+ spin_unlock_bh(&priv->stats_lock);
}
static int gve_alloc_flow_rule_caches(struct gve_priv *priv)
@@ -1345,9 +1347,13 @@ static void gve_queues_mem_remove(struct gve_priv *priv)
struct gve_rx_alloc_rings_cfg rx_alloc_cfg = {0};
gve_get_curr_alloc_cfgs(priv, &tx_alloc_cfg, &rx_alloc_cfg);
- gve_queues_mem_free(priv, &tx_alloc_cfg, &rx_alloc_cfg);
+
+ spin_lock_bh(&priv->stats_lock);
priv->tx = NULL;
priv->rx = NULL;
+ spin_unlock_bh(&priv->stats_lock);
+
+ gve_queues_mem_free(priv, &tx_alloc_cfg, &rx_alloc_cfg);
}
/* The passed-in queue memory is stored into priv and the queues are made live.
@@ -1361,6 +1367,7 @@ static int gve_queues_start(struct gve_priv *priv,
int err;
/* Record new resources into priv */
+ spin_lock_bh(&priv->stats_lock);
priv->tx = tx_alloc_cfg->tx;
priv->rx = rx_alloc_cfg->rx;
@@ -1375,9 +1382,11 @@ static int gve_queues_start(struct gve_priv *priv,
else
priv->num_xdp_queues = 0;
+ gve_init_sync_stats(priv);
+ spin_unlock_bh(&priv->stats_lock);
+
gve_tx_start_rings(priv, 0, tx_alloc_cfg->num_rings);
gve_rx_start_rings(priv, rx_alloc_cfg->qcfg->num_queues);
- gve_init_sync_stats(priv);
err = netif_set_real_num_tx_queues(dev, priv->tx_cfg.num_queues);
if (err)
@@ -2155,6 +2164,7 @@ void gve_handle_report_stats(struct gve_priv *priv)
if (!gve_get_report_stats(priv))
return;
+ spin_lock_bh(&priv->stats_lock);
be64_add_cpu(&priv->stats_report->written_count, 1);
/* tx stats */
if (priv->tx) {
@@ -2219,6 +2229,7 @@ void gve_handle_report_stats(struct gve_priv *priv)
};
}
}
+ spin_unlock_bh(&priv->stats_lock);
}
/* Handle NIC status register changes, reset requests and report stats */
@@ -2468,8 +2479,10 @@ static int gve_rx_queue_stop(struct net_device *dev, void *per_q_mem, int idx)
gve_turnup_and_check_status(priv);
gve_per_q_mem = (struct gve_rx_ring *)per_q_mem;
+ spin_lock_bh(&priv->stats_lock);
*gve_per_q_mem = priv->rx[idx];
memset(&priv->rx[idx], 0, sizeof(priv->rx[idx]));
+ spin_unlock_bh(&priv->stats_lock);
return 0;
}
@@ -2520,7 +2533,9 @@ static int gve_rx_queue_start(struct net_device *dev, void *per_q_mem, int idx)
return -EAGAIN;
gve_per_q_mem = (struct gve_rx_ring *)per_q_mem;
+ spin_lock_bh(&priv->stats_lock);
priv->rx[idx] = *gve_per_q_mem;
+ spin_unlock_bh(&priv->stats_lock);
/* Single-queue creation requires quiescence on all queues */
gve_turndown(priv);
@@ -2556,7 +2571,9 @@ static int gve_rx_queue_start(struct net_device *dev, void *per_q_mem, int idx)
* which needs the rtnl lock, will not run till this func returns and
* its caller gives up the lock.
*/
+ spin_lock_bh(&priv->stats_lock);
memset(&priv->rx[idx], 0, sizeof(priv->rx[idx]));
+ spin_unlock_bh(&priv->stats_lock);
return err;
}
@@ -2663,6 +2680,7 @@ static int gve_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
INIT_WORK(&priv->service_task, gve_service_task);
INIT_WORK(&priv->stats_report_task, gve_stats_report_task);
+ spin_lock_init(&priv->stats_lock);
priv->tx_cfg.max_queues = max_tx_queues;
priv->rx_cfg.max_queues = max_rx_queues;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 046/555] gve: Block invalid ring sizes when device options are 0
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 045/555] gve: Fix race between stats query and queue reconfig Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 047/555] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
` (20 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pin-yen Lin, Joshua Washington,
Jordan Rhee, Harshitha Ramamurthy, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pin-yen Lin <treapking@google.com>
[ Upstream commit edc9a730ad3c98662047a76db2d7f26ea4350b2e ]
On older device versions, minimum ring sizes in the device option are
reported as 0. The driver imports these 0 values, allowing userspace
(`ethtool -G`) to request invalidly small ring sizes.
This issue was discovered and actually triggered by the
drivers/net/ring_reconfig.py selftest (ringparam test case). Halving the
ring size down to 1 triggered a kernel NULL pointer dereference in
gve_tx_alloc_rings_dqo():
BUG: kernel NULL pointer dereference, address: 0000000000000002
RIP: 0010:gve_tx_alloc_rings_dqo+0x1c4/0x510 [gve]
Call Trace:
<TASK>
gve_queues_mem_alloc+0x29/0xa0 [gve]
gve_adjust_config+0x1b/0x140 [gve]
gve_set_ringparam+0x1f4/0x250 [gve]
ethnl_set_rings+0x260/0x440
...
Fix this by falling back to the driver's default minimum ring sizes
(GVE_DEFAULT_MIN_RX_RING_SIZE and GVE_DEFAULT_MIN_TX_RING_SIZE) whenever
the device option reports minimum ring sizes as 0.
The device reports either both minimum ring sizes or neither, so a
single fallback for both is sufficient.
This change was tested using the DQO RDA queue format.
Cc: stable@vger.kernel.org
Fixes: ed4fb326947d ("gve: add support to read ring size ranges from the device")
Signed-off-by: Pin-yen Lin <treapking@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20261109182036.2910559-4-hramamurthy@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Backport adapts the field path to the flat priv->default_min_ring_size and uses option_length < sizeof(**dev_op_modify_ring) instead of == 8 to avoid reading truncated option fields. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/google/gve/gve_adminq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/google/gve/gve_adminq.c b/drivers/net/ethernet/google/gve/gve_adminq.c
index 36acbcd8f62a4..579c66aae1c70 100644
--- a/drivers/net/ethernet/google/gve/gve_adminq.c
+++ b/drivers/net/ethernet/google/gve/gve_adminq.c
@@ -188,7 +188,9 @@ void gve_parse_device_option(struct gve_priv *priv,
*dev_op_modify_ring = (void *)(option + 1);
/* device has not provided min ring size */
- if (option_length == GVE_DEVICE_OPTION_NO_MIN_RING_SIZE)
+ if (option_length < sizeof(**dev_op_modify_ring) ||
+ be16_to_cpu((*dev_op_modify_ring)->min_rx_ring_size) == 0 ||
+ be16_to_cpu((*dev_op_modify_ring)->min_tx_ring_size) == 0)
priv->default_min_ring_size = true;
break;
case GVE_DEV_OPT_ID_FLOW_STEERING:
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 047/555] net: wait for in-flight device unregistrations before netns dismantle
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 046/555] gve: Block invalid ring sizes when device options are 0 Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 048/555] ksmbd: pin parent dentries in SMB2 CREATE ACL path Greg Kroah-Hartman
` (19 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1269fe6cc2016008124e,
Henry Martin, Eric Dumazet, Naman Gulati, 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 c164a431a646983275d0076ff5b0e4c326fbc10b ]
A device can be unregistered by a context other than the cleanup_net()
of its own netns, for instance a veth whose peer in another netns is
deleted. If references on it are still held, it stays in
netdev_wait_allrefs_any(), which rebroadcasts NETDEV_UNREGISTER every
second.
Meanwhile its netns can be dismantled: default_device_exit_batch()
only takes care of devices still listed in the netns, then pernet exit
handlers free their state, and finally struct net is freed while the
device still points to it.
The rebroadcasts then run notifiers against torn down pernet state, or
freed memory. Three instances were reported so far:
- netdev_genl_netdevice_event(): net->genl_sock is NULL [1]
- nh_netdev_event(): net->nexthop.devhash is NULL [2]
- nf_tables netdevice notifiers: use-after-free of the nftables
pernet storage [3]
but any notifier using dev_net(dev) is affected, as is
netdev_wait_allrefs_any() itself (__rtnl_net_lock(dev_net(dev)) with
CONFIG_DEBUG_NET_SMALL_RTNL=y).
This was prevented by rtnl_lock_unregistering() until I removed it
in commit 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()"),
considering only the loopback dependency, and missing the notifiers one.
Restore a per-netns counter of devices sitting in netdev_run_todo(),
and make default_device_exit_batch() wait for it to reach zero, after
it has unregistered all devices of the dying netns(es). At this point
no new unregistration can be started for these netns.
Unlike the old barrier, this only waits for devices of the netns being
dismantled and runs after their own devices are gone.
Tested on a KASAN kernel with a debug-only hack holding a reference
on a veth device for 5 seconds after its unregistration: a nexthop
on the veth in netns X, delete its peer from init_net, then delete X.
Without this patch, the nexthop_flush_dev() null-ptr-deref from [2]
triggers. With it, no splat; netns churn and dismantle of a netns
whose own device is held still work.
[1] https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/
[2] https://lore.kernel.org/netdev/20261105114707.3030737-1-bsdhenrymartin@gmail.com/
[3] https://lore.kernel.org/netdev/20261105114817.3033625-1-bsdhenrymartin@gmail.com/
Fixes: 8a4fc54b07d7 ("net: get rid of rtnl_lock_unregistering()")
Cc: stable@vger.kernel.org
Reported-by: syzbot+1269fe6cc2016008124e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/6adf9f64.6200f071.51519.0ed1.GAE@google.com/
Reported-by: Henry Martin <bsdhenrymartin@gmail.com>
Closes: https://lore.kernel.org/netdev/20261105114707.3030737-1-bsdhenrymartin@gmail.com/
Closes: https://lore.kernel.org/netdev/20261105114817.3033625-1-bsdhenrymartin@gmail.com/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Naman Gulati <namangulati@google.com>
Link: https://patch.msgid.link/20261105144543.1624238-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: adjusted context for a missing dev_mc_genid field in struct net, and moved the wait_event placement relative to the rtnl_net_flush_workqueue() call. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/net_namespace.h | 1 +
net/core/dev.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index f659d1efcd3ce..7b53eb6c21798 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -68,6 +68,7 @@ struct net {
spinlock_t rules_mod_lock;
unsigned int dev_base_seq; /* protected by rtnl_mutex */
+ atomic_t dev_unreg_pending; /* devices in netdev_run_todo() */
u32 ifindex;
spinlock_t nsid_lock;
diff --git a/net/core/dev.c b/net/core/dev.c
index bd1b0f10d9374..426f6d2e19524 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10145,6 +10145,14 @@ atomic_t dev_unreg_count = ATOMIC_INIT(0);
static void net_set_todo(struct net_device *dev)
{
list_add_tail(&dev->todo_list, &net_todo_list);
+ atomic_inc(&dev_net(dev)->dev_unreg_pending);
+}
+
+/* Paired with net_set_todo(). @net must not be used after this call. */
+static void net_unreg_done(struct net *net)
+{
+ if (atomic_dec_and_test(&net->dev_unreg_pending))
+ wake_up(&netdev_unregistering_wq);
}
static netdev_features_t netdev_sync_upper_features(struct net_device *lower,
@@ -11034,6 +11042,7 @@ void netdev_run_todo(void)
if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) {
netdev_WARN(dev, "run_todo but not unregistering\n");
list_del(&dev->todo_list);
+ net_unreg_done(dev_net(dev));
continue;
}
@@ -11043,8 +11052,11 @@ void netdev_run_todo(void)
cnt = 0;
while (!list_empty(&list)) {
+ struct net *net;
+
dev = netdev_wait_allrefs_any(&list);
list_del(&dev->todo_list);
+ net = dev_net(dev);
/* paranoia */
BUG_ON(netdev_refcnt_read(dev) != 1);
@@ -11063,6 +11075,8 @@ void netdev_run_todo(void)
/* Free network device */
kobject_put(&dev->dev.kobj);
+
+ net_unreg_done(net);
}
if (cnt && atomic_sub_and_test(cnt, &dev_unreg_count))
wake_up(&netdev_unregistering_wq);
@@ -12298,6 +12312,17 @@ static void __net_exit default_device_exit_net(struct net *net)
}
}
+static bool __net_exit netns_dev_unreg_pending(const struct list_head *net_list)
+{
+ struct net *net;
+
+ list_for_each_entry(net, net_list, exit_list) {
+ if (atomic_read(&net->dev_unreg_pending))
+ return true;
+ }
+ return false;
+}
+
static void __net_exit default_device_exit_batch(struct list_head *net_list)
{
/* At exit all network devices most be removed from a network
@@ -12325,6 +12350,16 @@ static void __net_exit default_device_exit_batch(struct list_head *net_list)
}
unregister_netdevice_many(&dev_kill_list);
rtnl_unlock();
+
+ /* Devices of these netns unregistered from another context
+ * (e.g. a veth whose peer was deleted) can still be waiting
+ * in netdev_run_todo() for their last references, while
+ * NETDEV_UNREGISTER is rebroadcast for them. Wait for them
+ * before pernet exit handlers tear down the state used by
+ * netdevice notifiers, and before the netns is freed.
+ * No new unregistration can start: all devices are unlisted.
+ */
+ wait_event(netdev_unregistering_wq, !netns_dev_unreg_pending(net_list));
}
static struct pernet_operations __net_initdata default_device_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 048/555] ksmbd: pin parent dentries in SMB2 CREATE ACL path
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 047/555] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 049/555] ksmbd: refuse to read a handle that is not open for reading Greg Kroah-Hartman
` (18 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiwoo Kim, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiwoo Kim <arpe1618@gmail.com>
[ Upstream commit 0383a66dabd7aa06237b9b24713c03656abeffe4 ]
smb2_open() and smb_inherit_dacl() read a child's d_parent without a
dentry reference. A concurrent SMB request can move the child and
remove the parent while CREATE uses its inode for permission, status,
and ACL inheritance work. A remote SMB race with concurrent opener and
mover connections on a writable KSMBD acl_xattr share triggered an
8-byte slab-use-after-free read in get_cached_acl on tmpfs and ext4
KASAN guests. With oops=panic, it also caused an Oops and kernel panic
on an ext4 guest.
Take a parent dentry reference around each parent inode or ACL access
in these paths and release it when the operation completes. Treat a
negative parent dentry as -ENOENT for the affected operation.
On a tmpfs KASAN QEMU guest, two 3,000-round reproducer instances
completed without a KASAN report or Oops; SMB remained reachable. On
an ext4 non-KASAN QEMU guest with oops=panic, a 2,000-operation no-race
control and two 5,000-round reproducer instances completed without an
Oops or panic. An SMB health probe still succeeded.
OpenAI Codex assisted with finding the bug, generating the SMB race
reproducer, drafting this fix and changelog, and running the tests.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@kernel.org
Signed-off-by: Jiwoo Kim <arpe1618@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Dropped the kunit/visibility.h include context and adapted const struct mnt_idmap *idmap to non-const struct mnt_idmap *idmap for the older tree's smbacl.c. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 39 +++++++++++++++++++++++++++++++--------
fs/smb/server/smbacl.c | 9 ++++++++-
2 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 115960cc93994..82d1225dd7e8f 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -3442,16 +3442,32 @@ int smb2_open(struct ksmbd_work *work)
if ((daccess & FILE_DELETE_LE) ||
(req->CreateOptions & FILE_DELETE_ON_CLOSE_LE)) {
- rc = inode_permission(idmap,
- d_inode(path.dentry->d_parent),
- MAY_EXEC | MAY_WRITE);
+ struct dentry *parent = dget_parent(path.dentry);
+ struct inode *parent_inode = d_inode(parent);
+
+ if (parent_inode)
+ rc = inode_permission(idmap, parent_inode,
+ MAY_EXEC | MAY_WRITE);
+ else
+ rc = -ENOENT;
+ dput(parent);
if (rc)
goto err_out;
}
}
}
- rc = ksmbd_query_inode_status(path.dentry->d_parent);
+ {
+ struct dentry *parent = dget_parent(path.dentry);
+
+ if (!d_inode(parent)) {
+ dput(parent);
+ rc = -ENOENT;
+ goto err_out;
+ }
+ rc = ksmbd_query_inode_status(parent);
+ dput(parent);
+ }
if (rc == KSMBD_INODE_STATUS_PENDING_DELETE) {
rc = -EBUSY;
goto err_out;
@@ -3505,10 +3521,17 @@ int smb2_open(struct ksmbd_work *work)
if (created) {
int posix_acl_rc;
struct inode *inode = d_inode(path.dentry);
-
- posix_acl_rc = ksmbd_vfs_inherit_posix_acl(idmap,
- &path,
- d_inode(path.dentry->d_parent));
+ struct inode *parent_inode;
+ struct dentry *parent;
+
+ parent = dget_parent(path.dentry);
+ parent_inode = d_inode(parent);
+ if (parent_inode)
+ posix_acl_rc = ksmbd_vfs_inherit_posix_acl(idmap, &path,
+ parent_inode);
+ else
+ posix_acl_rc = -ENOENT;
+ dput(parent);
if (posix_acl_rc)
ksmbd_debug(SMB, "inherit posix acl failed : %d\n", posix_acl_rc);
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
index 42a638d1d2b97..1bd816153e542 100644
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -7,6 +7,7 @@
*/
#include <linux/fs.h>
+#include <linux/dcache.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/mnt_idmapping.h>
@@ -1200,7 +1201,7 @@ int smb_inherit_dacl(struct ksmbd_conn *conn,
struct smb_acl *parent_pdacl;
struct smb_ntsd *parent_pntsd = NULL;
struct smb_sid owner_sid, group_sid;
- struct dentry *parent = path->dentry->d_parent;
+ struct dentry *parent;
struct mnt_idmap *idmap = mnt_idmap(path->mnt);
int inherited_flags = 0, flags = 0, i, nt_size = 0, pdacl_size;
int rc = 0, pntsd_type, ppntsd_size, acl_len, aces_size;
@@ -1210,8 +1211,14 @@ int smb_inherit_dacl(struct ksmbd_conn *conn,
char *aces_base;
bool is_dir = S_ISDIR(d_inode(path->dentry)->i_mode);
+ parent = dget_parent(path->dentry);
+ if (!d_inode(parent)) {
+ dput(parent);
+ return -ENOENT;
+ }
ppntsd_size = ksmbd_vfs_get_sd_xattr(conn, idmap,
parent, &parent_pntsd);
+ dput(parent);
if (ppntsd_size <= 0)
return -ENOENT;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 049/555] ksmbd: refuse to read a handle that is not open for reading
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 048/555] ksmbd: pin parent dentries in SMB2 CREATE ACL path Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 050/555] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
` (17 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wahid Khan, Ian Bridges, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wahid Khan <wahidzk0091@gmail.com>
[ Upstream commit 2fd145f8865bb1a6c38a3dc68fa44290008789d8 ]
smb2_create_open_flags() picks the open mode from the read and write
bits of the desired access. FILE_EXECUTE and FILE_READ_ATTRIBUTES select
neither, so a request for FILE_WRITE_DATA | FILE_EXECUTE |
FILE_READ_ATTRIBUTES opens the file O_WRONLY.
smb2_read() accepts FILE_READ_ATTRIBUTES and ksmbd_vfs_read() accepts
FILE_EXECUTE, so a later READ on that handle passes both checks and
reaches __kernel_read() on a file that has no FMODE_READ:
WARNING: fs/read_write.c:518 at __kernel_read
__kernel_read
ksmbd_vfs_read
smb2_read
handle_ksmbd_work
Any client that can open a file with write access on a share, including
a guest session, can trigger it; with panic_on_warn it takes the machine
down.
Return STATUS_ACCESS_DENIED when the file is not readable.
Fixes: f44158485826 ("cifsd: add file operations")
Cc: stable@vger.kernel.org
Signed-off-by: Wahid Khan <wahidzk0091@gmail.com>
Reviewed-by: Ian Bridges <icb@fastmail.org>
Tested-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: adjusted context: the new FMODE_READ check is inserted before this tree's if (!work->tcon->posix_extensions) { line instead of upstream's if (!fp->is_posix_ctxt) {. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/vfs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index 9aee0214e8fdc..732cb489efd90 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -390,6 +390,10 @@ int ksmbd_vfs_read(struct ksmbd_work *work, struct ksmbd_file *fp, size_t count,
if (ksmbd_stream_fd(fp))
return ksmbd_vfs_stream_read(fp, rbuf, pos, count);
+ /* The access granted on open can include FILE_EXECUTE for a write-only file */
+ if (!(filp->f_mode & FMODE_READ))
+ return -EACCES;
+
if (!work->tcon->posix_extensions) {
int ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 050/555] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 049/555] ksmbd: refuse to read a handle that is not open for reading Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 051/555] comedi: comedi_bond: Fix leak of opened device references Greg Kroah-Hartman
` (16 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ Upstream commit 9b6e9d6a11090ac34516c45f48663b37ac94a9b1 ]
BTF bitfield parsing in trace_probe.c assumes a 64-bit (8-byte) container
when computing FETCH_OP_MOD_BF shift amounts and basesize, whereas the
preceding store instruction only allocates and writes the field's fetch
type size (which may be 1, 2, or 4 bytes when kflag=1). At runtime,
fetch_apply_bitfield() performs an 8-byte read-modify-write on the
smaller ring buffer slot, corrupting adjacent ring buffer data or writing
past the end of the event record.
In addition, signed bitfields with bit widths other than 8/16/32/64 fail
to resolve a fetch type, bitfields whose width is a multiple of 8 inside
a larger integer or spanning a byte boundary fail to emit FETCH_OP_MOD_BF
or select a container wide enough for bitoffs + bitsize, kflag=0 bitfield
offsets >= 8 bits are not folded into the byte offset, and big-endian
architectures use the little-endian left-shift formula in
parse_btf_bitfield().
Compute the bitfield byte and bit offsets consistently during field
lookup, select the smallest unsigned fetch type that covers the bit
offset and bit width, and calculate the FETCH_OP_MOD_BF parameters from
the selected fetch type size for both big- and little-endian bitfields.
Link: https://lore.kernel.org/all/179455850711.403392.10512730891220678403.stgit@devnote2/
Fixes: c440adfbe302 ("tracing/probes: Support BTF based data structure field access")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ sashal: Inlined the field-walk changes into parse_btf_field() because the get_bitoffset_of_field() helper doesn't exist in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_probe.c | 61 ++++++++++++++++++++++++++++----------
1 file changed, 46 insertions(+), 15 deletions(-)
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 786552250ac13..72ee17e0a5f7c 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -405,6 +405,18 @@ static const char *fetch_type_from_btf_type(struct btf *btf,
{
u32 intdata;
+ if (ctx->last_bitsize) {
+ u32 bits = ctx->last_bitsize + ctx->last_bitoffs;
+
+ if (bits <= 8)
+ return "u8";
+ if (bits <= 16)
+ return "u16";
+ if (bits <= 32)
+ return "u32";
+ return "u64";
+ }
+
/* TODO: const char * could be converted as a string */
switch (BTF_INFO_KIND(type->info)) {
case BTF_KIND_ENUM:
@@ -442,10 +454,6 @@ static const char *fetch_type_from_btf_type(struct btf *btf,
case 64:
return "u64";
}
- /* bitfield, size is encoded in the type */
- ctx->last_bitsize = BTF_INT_BITS(intdata);
- ctx->last_bitoffs += BTF_INT_OFFSET(intdata);
- return "u64";
}
}
/* TODO: support other types */
@@ -583,6 +591,12 @@ static int parse_btf_field(char *fieldname, const struct btf_type *type,
/* Add anonymous structure/union offset */
bitoffs += anon_offs;
+ type = btf_type_skip_modifiers(ctx->btf, field->type, &tid);
+ if (!type) {
+ trace_probe_log_err(ctx->offset, BAD_BTF_TID);
+ return -EINVAL;
+ }
+
/* Accumulate the bit-offsets of the dot-connected fields */
if (btf_type_kflag(mtype)) {
bitoffs += BTF_MEMBER_BIT_OFFSET(field->offset);
@@ -590,12 +604,15 @@ static int parse_btf_field(char *fieldname, const struct btf_type *type,
} else {
bitoffs += field->offset;
ctx->last_bitsize = 0;
- }
-
- type = btf_type_skip_modifiers(ctx->btf, field->type, &tid);
- if (!type) {
- trace_probe_log_err(ctx->offset, BAD_BTF_TID);
- return -EINVAL;
+ if (BTF_INFO_KIND(type->info) == BTF_KIND_INT) {
+ u32 intdata = btf_type_int(type);
+
+ bitoffs += BTF_INT_OFFSET(intdata);
+ if ((bitoffs % 8) ||
+ BTF_INT_BITS(intdata) != BYTES_TO_BITS(type->size) ||
+ !is_power_of_2(type->size))
+ ctx->last_bitsize = BTF_INT_BITS(intdata);
+ }
}
ctx->offset += next - fieldname;
@@ -727,13 +744,22 @@ static const struct fetch_type *find_fetch_type_from_btf_type(
}
static int parse_btf_bitfield(struct fetch_insn **pcode,
+ const struct fetch_type *t,
struct traceprobe_parse_context *ctx)
{
struct fetch_insn *code = *pcode;
- if ((ctx->last_bitsize % 8 == 0) && ctx->last_bitoffs == 0)
+ if ((ctx->last_bitsize == 0 ||
+ ctx->last_bitsize == BYTES_TO_BITS(t->size)) &&
+ ctx->last_bitoffs == 0)
return 0;
+ if (ctx->last_bitsize == 0 ||
+ BYTES_TO_BITS(t->size) < (ctx->last_bitsize + ctx->last_bitoffs)) {
+ trace_probe_log_err(ctx->offset, BAD_BITFIELD);
+ return -EINVAL;
+ }
+
code++;
if (code->op != FETCH_OP_NOP) {
trace_probe_log_err(ctx->offset, TOO_MANY_OPS);
@@ -742,9 +768,13 @@ static int parse_btf_bitfield(struct fetch_insn **pcode,
*pcode = code;
code->op = FETCH_OP_MOD_BF;
- code->lshift = 64 - (ctx->last_bitsize + ctx->last_bitoffs);
- code->rshift = 64 - ctx->last_bitsize;
- code->basesize = 64 / 8;
+#ifdef __BIG_ENDIAN_BITFIELD
+ code->lshift = ctx->last_bitoffs;
+#else
+ code->lshift = BYTES_TO_BITS(t->size) - (ctx->last_bitsize + ctx->last_bitoffs);
+#endif
+ code->rshift = BYTES_TO_BITS(t->size) - ctx->last_bitsize;
+ code->basesize = t->size;
return 0;
}
@@ -768,6 +798,7 @@ static int parse_btf_arg(char *varname,
}
static int parse_btf_bitfield(struct fetch_insn **pcode,
+ const struct fetch_type *t,
struct traceprobe_parse_context *ctx)
{
trace_probe_log_err(ctx->offset, NOSUP_BTFARG);
@@ -1427,7 +1458,7 @@ static int finalize_fetch_insn(struct fetch_insn *code,
} else if (IS_ENABLED(CONFIG_PROBE_EVENTS_BTF_ARGS) &&
ctx->last_type) {
/* If user not specified the type, try parsing BTF bitfield. */
- ret = parse_btf_bitfield(&code, ctx);
+ ret = parse_btf_bitfield(&code, parg->type, ctx);
if (ret)
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 051/555] comedi: comedi_bond: Fix leak of opened device references
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 050/555] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 052/555] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
` (15 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Wentao Liang, Ian Abbott,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <abbotti@mev.co.uk>
commit fa0858523f07f8dd71d89b221f4422c3b8096d90 upstream.
bonding_attach() calls do_dev_config() to open other comedi devices
specified by the user and tries to make use of them as part of the
'bonding' device. If it successfully opens the other device but cannot
use it (either because it does not any subdevices of a type the
'bonding' device can use, or because of some error that occurs while
dealing with its subdevices) then it is left in the open state and the
fact that it is open does not get recorded by the 'bonding' device, so
the reference to the opened device gets lost. Fix it by closing the
opened device if it could not be bound to the 'bonding' device.
To match previous behavior, if the opened device is unsuitable then
ignore it (after closing it). The opened devices recorded by the
'bonding' device will eventually get closed by bonding_detach() even if
bonding_attach() returns an error.
Fixes: 3cf840f65ad5 ("Staging: comedi: add comedi_bond driver")
Cc: stable <stable@kernel.org>
Reported-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/lkml/20261103063301.1025860-1-vulab@iscas.ac.cn
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20261103173610.89687-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fa0858523f07f8dd71d89b221f4422c3b8096d90)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/comedi/drivers/comedi_bond.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/drivers/comedi/drivers/comedi_bond.c b/drivers/comedi/drivers/comedi_bond.c
index 78c39fa841776..076aecae2c776 100644
--- a/drivers/comedi/drivers/comedi_bond.c
+++ b/drivers/comedi/drivers/comedi_bond.c
@@ -182,7 +182,9 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
char file[sizeof("/dev/comediXXXXXX")];
int minor = it->options[i];
struct comedi_device *d;
- int sdev = -1, nchans;
+ int sdev = -1;
+ int nchans;
+ int nope = 1;
struct bonded_device *bdev;
struct bonded_device **devs;
@@ -221,11 +223,14 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
dev_err(dev->class_dev,
"comedi_get_n_channels() returned %d on minor %u subdev %d!\n",
nchans, minor, sdev);
- return -EINVAL;
+ nope = -EINVAL;
+ break;
}
bdev = kmalloc(sizeof(*bdev), GFP_KERNEL);
- if (!bdev)
- return -ENOMEM;
+ if (!bdev) {
+ nope = -ENOMEM;
+ break;
+ }
bdev->dev = d;
bdev->minor = minor;
@@ -246,10 +251,12 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
dev_err(dev->class_dev,
"Could not allocate memory. Out of memory?\n");
kfree(bdev);
- return -ENOMEM;
+ nope = -ENOMEM;
+ break;
}
devpriv->devs = devs;
devpriv->devs[devpriv->ndevs++] = bdev;
+ nope = 0; /* keeps the device open */
{
/* Append dev:subdev to devpriv->name */
char buf[20];
@@ -260,6 +267,13 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
sizeof(devpriv->name));
}
}
+
+ if (nope) {
+ /* Opened device cannot be used, so close it. */
+ comedi_close(d);
+ if (nope < 0)
+ return nope;
+ }
}
if (!devpriv->nchans) {
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 052/555] Bluetooth: btusb: fix use-after-free in force_poll_sync
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 051/555] comedi: comedi_bond: Fix leak of opened device references Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 053/555] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
` (14 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bin Yu, Cheng Wen,
Luiz Augusto von Dentz, YuanZhe Liu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
[ Upstream commit 868c886f45f7c10dc888b94c6993352702a84d04 ]
The force_poll_sync debugfs file uses the driver's struct btusb_data as
its private data. The file is created under hdev->debugfs and is removed
only when the HCI device is released, while btusb_disconnect() frees
btusb_data unconditionally. The HCI device can outlive the driver data,
for example when an HCI socket still references it, so reading or
writing the already opened file then dereferences freed memory:
BUG: KASAN: slab-use-after-free in force_poll_sync_read+0x129/0x140
Read of size 1 at addr ffff88800cfb7038
...
Freed by task ...:
kfree
btusb_disconnect
Remove the debugfs file before the private data is freed.
debugfs_remove() waits for callers that are already inside the file
operations, and any later access fails with -EIO instead of reaching the
driver, so the force_poll_sync file can no longer dereference btusb_data
after it is gone.
Fixes: 800fe5ec302e ("Bluetooth: btusb: Add support for queuing during polling interval")
Cc: stable@vger.kernel.org
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bluetooth/btusb.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 6142546c387ee..48ae89803c4fd 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -995,6 +995,8 @@ struct btusb_data {
int (*disconnect)(struct hci_dev *hdev);
int oob_wake_irq; /* irq for out-of-band wake-on-bt */
+
+ struct dentry *force_poll_sync_dentry;
unsigned cmd_timeout_cnt;
struct qca_dump_info qca_dump;
@@ -4231,8 +4233,9 @@ static int btusb_probe(struct usb_interface *intf,
usb_set_intfdata(intf, data);
- debugfs_create_file("force_poll_sync", 0644, hdev->debugfs, data,
- &force_poll_sync_fops);
+ data->force_poll_sync_dentry =
+ debugfs_create_file("force_poll_sync", 0644, hdev->debugfs,
+ data, &force_poll_sync_fops);
return 0;
@@ -4268,6 +4271,9 @@ static void btusb_disconnect(struct usb_interface *intf)
if (!data)
return;
+ debugfs_remove(data->force_poll_sync_dentry);
+ data->force_poll_sync_dentry = NULL;
+
hdev = data->hdev;
usb_set_intfdata(data->intf, NULL);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 053/555] tools/bootconfig: Close only opened braces in compact output
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 052/555] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 054/555] ipv6: Remove IPV6_ADDRFORM Greg Kroah-Hartman
` (13 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Eduardo Mucelli Rezende Oliveira, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
commit 26fa92f351d4993428268afebf6c60c987477af5 upstream.
A key may have both a value and subkeys. When it has only one subkey,
xbc_show_compact_tree() can print that subkey using dotted notation
without opening a brace. During backtracking, however, it treats the
value node followed by a subkey as evidence that a brace was opened.
For example, a.b=v, a.b.c=w and a.z=q are printed with the brace for a
closed before z. Reading that output back changes a.z into the root key
z, silently changing the configuration.
Check the key children when deciding whether to close a brace. Skip the
value child, and account for a sole subkey that itself has both a value
and subkeys, since that combination is not compacted. This follows the
conditions used to open braces without keeping a depth-indexed array.
Extend the mixed-value/subkey sample to cover the lost sibling.
The stable test script only checks whether the good samples can
be attached. Add the compact-output comparison for the extended
mixed-value/subkey sample and add its expected output file.
Link: https://lore.kernel.org/all/6ad67e4cda05238cd173c99e820a85de2c13f5fc.1794337724.git.edumucelli@gmail.com/
Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bootconfig/main.c | 29 ++++++++++++++-----
.../samples/exp-good-mixed-kv1.bconf | 7 +++++
tools/bootconfig/samples/good-mixed-kv1.bconf | 5 ++++
tools/bootconfig/test-bootconfig.sh | 6 ++++
4 files changed, 40 insertions(+), 7 deletions(-)
create mode 100644 tools/bootconfig/samples/exp-good-mixed-kv1.bconf
diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 5ccdb9881b5a0..0c73eacd8c1e5 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -38,6 +38,23 @@ static int xbc_show_value(struct xbc_node *node, bool semicolon)
return i;
}
+/* Match the conditions under which the compact formatter opens braces. */
+static bool xbc_node_needs_braces(struct xbc_node *node)
+{
+ struct xbc_node *child = xbc_node_get_child(node);
+
+ if (child && xbc_node_is_value(child))
+ child = xbc_node_get_next(child);
+ if (!child)
+ return false;
+ if (child->next)
+ return true;
+
+ /* A single subkey with both a value and subkeys is not compacted. */
+ child = xbc_node_get_child(child);
+ return child && xbc_node_is_value(child) && child->next;
+}
+
static void xbc_show_compact_tree(void)
{
struct xbc_node *node, *cnode = NULL, *vnode;
@@ -98,14 +115,12 @@ static void xbc_show_compact_tree(void)
node = xbc_node_get_parent(node);
if (!node)
return;
- if (!xbc_node_get_child(node)->next)
+ if (!depth || !xbc_node_needs_braces(node))
continue;
- if (depth) {
- depth--;
- for (i = 0; i < depth; i++)
- printf("\t");
- printf("}\n");
- }
+ depth--;
+ for (i = 0; i < depth; i++)
+ printf("\t");
+ printf("}\n");
}
node = xbc_node_get_next(node);
}
diff --git a/tools/bootconfig/samples/exp-good-mixed-kv1.bconf b/tools/bootconfig/samples/exp-good-mixed-kv1.bconf
new file mode 100644
index 0000000000000..0b8b2f59da31e
--- /dev/null
+++ b/tools/bootconfig/samples/exp-good-mixed-kv1.bconf
@@ -0,0 +1,7 @@
+key = "value";
+key.subkey = "another-value";
+a {
+ b = "v";
+ b.c = "w";
+ z = "q";
+}
diff --git a/tools/bootconfig/samples/good-mixed-kv1.bconf b/tools/bootconfig/samples/good-mixed-kv1.bconf
index 1761547dd05ca..35442ee62b751 100644
--- a/tools/bootconfig/samples/good-mixed-kv1.bconf
+++ b/tools/bootconfig/samples/good-mixed-kv1.bconf
@@ -1,3 +1,8 @@
# value -> subkey pattern
key = value
key.subkey = another-value
+
+# A valued parent with one subkey must not close its enclosing brace.
+a.b = v
+a.b.c = w
+a.z = q
diff --git a/tools/bootconfig/test-bootconfig.sh b/tools/bootconfig/test-bootconfig.sh
index be8d05833704d..42bac54e74b25 100755
--- a/tools/bootconfig/test-bootconfig.sh
+++ b/tools/bootconfig/test-bootconfig.sh
@@ -199,6 +199,12 @@ for i in samples/good-* ; do
done
+echo "Compact output keeps siblings under their parent"
+xpass $BOOTCONF -a samples/good-mixed-kv1.bconf $INITRD
+$BOOTCONF $INITRD > $OUTFILE
+xpass cmp samples/exp-good-mixed-kv1.bconf $OUTFILE
+
+
echo
echo "=== Summary ==="
echo "# of Passed: $(expr $NO - $NG - 1)"
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 054/555] ipv6: Remove IPV6_ADDRFORM.
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 053/555] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 055/555] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
` (12 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daehyeon Ko, 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 31c5ea8a3296e1486ac34bccea452bfe8c0bb1f9 ]
Recently, IPV6_ADDRFORM has received many AI-driven bug reports.
Fixing them properly would needlessly churn the fast paths in TCP
and UDP.
IPV6_ADDRFORM was initially introduced in RFC 2133 in 1997,
but only two years later, it was removed from RFC 2553 in 1999.
In 2026, modern applications natively support dual-stack sockets;
notably, systemd's socket activation does not use IPV6_ADDRFORM.
Also, getsockopt(IPV6_ADDRFORM) can be replaced with SO_DOMAIN.
Let's remove IPV6_ADDRFORM.
Later, we can remove sk->sk_prot_creator and revert commit
c26c192c3d48 ("udp: properly deal with xfrm encap and ADDRFORM").
Reported-by: Daehyeon Ko <4ncienth@gmail.com>
Closes: https://lore.kernel.org/netdev/20260902010408.1057857-1-4ncienth@gmail.com/
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-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Hyunwoo Kim: Remove UDP-Lite handling from the IPV6_ADDRFORM
set/get branches on 6.12.y. ]
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/net.h | 2 +-
net/core/sock.c | 4 +-
net/ipv4/af_inet.c | 3 --
net/ipv6/af_inet6.c | 4 --
net/ipv6/ipv6_sockglue.c | 95 ----------------------------------------
5 files changed, 2 insertions(+), 106 deletions(-)
diff --git a/include/linux/net.h b/include/linux/net.h
index c6d92428c71a5..6d2241615532b 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -144,7 +144,7 @@ struct socket {
struct file *file;
struct sock *sk;
- const struct proto_ops *ops; /* Might change with IPV6_ADDRFORM or MPTCP. */
+ const struct proto_ops *ops; /* Might change with MPTCP. */
struct socket_wq wq;
};
diff --git a/net/core/sock.c b/net/core/sock.c
index c71b175d13206..b77cb9cfcdb29 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -765,7 +765,7 @@ bool sk_mc_loop(const struct sock *sk)
sk = sk_const_to_full_sk(sk);
if (!sk)
return true;
- /* IPV6_ADDRFORM can change sk->sk_family under us. */
+
switch (READ_ONCE(sk->sk_family)) {
case AF_INET:
return inet_test_bit(MC_LOOP, sk);
@@ -3849,7 +3849,6 @@ int sock_common_getsockopt(struct socket *sock, int level, int optname,
{
struct sock *sk = sock->sk;
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
return READ_ONCE(sk->sk_prot)->getsockopt(sk, level, optname, optval, optlen);
}
EXPORT_SYMBOL(sock_common_getsockopt);
@@ -3876,7 +3875,6 @@ int sock_common_setsockopt(struct socket *sock, int level, int optname,
{
struct sock *sk = sock->sk;
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
return READ_ONCE(sk->sk_prot)->setsockopt(sk, level, optname, optval, optlen);
}
EXPORT_SYMBOL(sock_common_setsockopt);
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index b67c20019978a..b61d07620c1fd 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -575,7 +575,6 @@ int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr,
if (addr_len < sizeof(uaddr->sa_family))
return -EINVAL;
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
prot = READ_ONCE(sk->sk_prot);
if (uaddr->sa_family == AF_UNSPEC)
@@ -776,7 +775,6 @@ int inet_accept(struct socket *sock, struct socket *newsock,
{
struct sock *sk1 = sock->sk, *sk2;
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
arg->err = -EINVAL;
sk2 = READ_ONCE(sk1->sk_prot)->accept(sk1, arg);
if (!sk2)
@@ -861,7 +859,6 @@ void inet_splice_eof(struct socket *sock)
if (unlikely(inet_send_prepare(sk)))
return;
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
prot = READ_ONCE(sk->sk_prot);
if (prot->splice_eof)
prot->splice_eof(sock);
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 5cbb20e3788c4..3b701dbb4691d 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -444,7 +444,6 @@ int inet6_bind_sk(struct sock *sk, struct sockaddr *uaddr, int addr_len)
const struct proto *prot;
int err = 0;
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
prot = READ_ONCE(sk->sk_prot);
/* If the socket has its own bind function then use it. */
if (prot->bind)
@@ -583,7 +582,6 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCSIFDSTADDR:
return addrconf_set_dstaddr(net, argp);
default:
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
prot = READ_ONCE(sk->sk_prot);
if (!prot->ioctl)
return -ENOIOCTLCMD;
@@ -654,7 +652,6 @@ int inet6_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
if (unlikely(inet_send_prepare(sk)))
return -EAGAIN;
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
prot = READ_ONCE(sk->sk_prot);
return INDIRECT_CALL_2(prot->sendmsg, tcp_sendmsg, udpv6_sendmsg,
sk, msg, size);
@@ -673,7 +670,6 @@ int inet6_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
if (likely(!(flags & MSG_ERRQUEUE)))
sock_rps_record_flow(sk);
- /* IPV6_ADDRFORM can change sk->sk_prot under us. */
prot = READ_ONCE(sk->sk_prot);
err = INDIRECT_CALL_2(prot->recvmsg, tcp_recvmsg, udpv6_recvmsg,
sk, msg, size, flags, &addr_len);
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 0f1242138d176..df5858ffa058f 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -557,93 +557,7 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
rtnl_lock();
sockopt_lock_sock(sk);
- /* Another thread has converted the socket into IPv4 with
- * IPV6_ADDRFORM concurrently.
- */
- if (unlikely(sk->sk_family != AF_INET6))
- goto unlock;
-
switch (optname) {
-
- case IPV6_ADDRFORM:
- if (optlen < sizeof(int))
- goto e_inval;
- if (val == PF_INET) {
- if (sk->sk_type == SOCK_RAW)
- break;
-
- if (sk->sk_protocol == IPPROTO_UDP ||
- sk->sk_protocol == IPPROTO_UDPLITE) {
- struct udp_sock *up = udp_sk(sk);
- if (up->pending == AF_INET6) {
- retv = -EBUSY;
- break;
- }
- } else if (sk->sk_protocol == IPPROTO_TCP) {
- if (sk->sk_prot != &tcpv6_prot) {
- retv = -EBUSY;
- break;
- }
- } else {
- break;
- }
-
- if (sk->sk_state != TCP_ESTABLISHED) {
- retv = -ENOTCONN;
- break;
- }
-
- if (ipv6_only_sock(sk) ||
- !ipv6_addr_v4mapped(&sk->sk_v6_daddr)) {
- retv = -EADDRNOTAVAIL;
- break;
- }
-
- __ipv6_sock_mc_close(sk);
- __ipv6_sock_ac_close(sk);
-
- if (sk->sk_protocol == IPPROTO_TCP) {
- struct inet_connection_sock *icsk = inet_csk(sk);
-
- sock_prot_inuse_add(net, sk->sk_prot, -1);
- sock_prot_inuse_add(net, &tcp_prot, 1);
-
- /* Paired with READ_ONCE(sk->sk_prot) in inet6_stream_ops */
- WRITE_ONCE(sk->sk_prot, &tcp_prot);
- /* Paired with READ_ONCE() in tcp_(get|set)sockopt() */
- WRITE_ONCE(icsk->icsk_af_ops, &ipv4_specific);
- WRITE_ONCE(sk->sk_socket->ops, &inet_stream_ops);
- WRITE_ONCE(sk->sk_family, PF_INET);
- tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
- } else {
- struct proto *prot = &udp_prot;
-
- if (sk->sk_protocol == IPPROTO_UDPLITE)
- prot = &udplite_prot;
-
- sock_prot_inuse_add(net, sk->sk_prot, -1);
- sock_prot_inuse_add(net, prot, 1);
-
- /* Paired with READ_ONCE(sk->sk_prot) in inet6_dgram_ops */
- WRITE_ONCE(sk->sk_prot, prot);
- WRITE_ONCE(sk->sk_socket->ops, &inet_dgram_ops);
- WRITE_ONCE(sk->sk_family, PF_INET);
- }
-
- /* Disable all options not to allocate memory anymore,
- * but there is still a race. See the lockless path
- * in udpv6_sendmsg() and ipv6_local_rxpmtu().
- */
- np->rxopt.all = 0;
-
- inet6_cleanup_sock(sk);
-
- module_put(THIS_MODULE);
- retv = 0;
- break;
- }
- goto e_inval;
-
case IPV6_V6ONLY:
if (optlen < sizeof(int) ||
inet_sk(sk)->inet_num)
@@ -1107,15 +1021,6 @@ int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
switch (optname) {
- case IPV6_ADDRFORM:
- if (sk->sk_protocol != IPPROTO_UDP &&
- sk->sk_protocol != IPPROTO_UDPLITE &&
- sk->sk_protocol != IPPROTO_TCP)
- return -ENOPROTOOPT;
- if (sk->sk_state != TCP_ESTABLISHED)
- return -ENOTCONN;
- val = sk->sk_family;
- break;
case MCAST_MSFILTER:
if (in_compat_syscall())
return compat_ipv6_get_msfilter(sk, optval, optlen, len);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 055/555] iio: proximity: sx9360: fix sampling frequency write and available range
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 054/555] ipv6: Remove IPV6_ADDRFORM Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 056/555] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
` (11 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jonathan Cameron,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnav Kapoor <kapoorarnav43@gmail.com>
commit d252425c1533bfacd5940faa3371af82196bff5b upstream.
GNRL_CTRL1/2 hold the scan period in units of 8192 / FOSC, but
sx9360_set_samp_freq() computes freq * 8192 / FOSC and mis-scales val2,
which is in micro units. Any integer frequency then programs a period
of 0, and fractional parts above ~0.26 Hz overflow the int, writing
0x10 to GNRL_CTRL1 outside the SCANPERIOD field.
Compute FOSC / (freq * 8192), rounded to the closest value, and reject
frequencies outside the 1..2047 period range.
The available range doesn't match the limits in the comments next to it
either: 4 MHz / 8192 is 488.28125 Hz, not 448.28125 Hz,
4 MHz / (8192 * 2047) is 0.238535 Hz, and (max - min) / 2047 is
0.238419 Hz. Use those values.
Fixes: 1cdb4c47f7f5 ("iio:proximity:sx9360: Add sx9360 support")
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ Context: <linux/acpi.h> and <linux/mod_devicetable.h> are still
included here. ]
Signed-off-by: Arnav Kapoor <kapoorarnav43@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/proximity/sx9360.c | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/proximity/sx9360.c b/drivers/iio/proximity/sx9360.c
index 2b90bf45a2012..10ab7aa352f95 100644
--- a/drivers/iio/proximity/sx9360.c
+++ b/drivers/iio/proximity/sx9360.c
@@ -15,11 +15,13 @@
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/log2.h>
+#include <linux/math64.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/regmap.h>
+#include <linux/units.h>
#include <linux/iio/iio.h>
@@ -45,6 +47,7 @@
#define SX9360_REG_GNRL_CTRL1_SCANPERIOD_MASK GENMASK(2, 0)
#define SX9360_REG_GNRL_CTRL2 0x12
#define SX9360_REG_GNRL_CTRL2_PERIOD_102MS 0x32
+#define SX9360_REG_GNRL_SCANPERIOD_MAX GENMASK(10, 0)
#define SX9360_REG_GNRL_REG_2_PERIOD_MS(_r) \
(((_r) * 8192) / (SX9360_FOSC_HZ / 1000))
#define SX9360_REG_GNRL_FREQ_2_REG(_f) (((_f) * 8192) / SX9360_FOSC_HZ)
@@ -184,9 +187,9 @@ static const struct {
int val;
int val2;
} sx9360_samp_freq_interval[] = {
- { 0, 281250 }, /* 4MHz / (8192 * 2047) */
- { 0, 281250 },
- { 448, 281250 }, /* 4MHz / 8192 */
+ { 0, 238535 }, /* 4MHz / (8192 * 2047) */
+ { 0, 238419 },
+ { 488, 281250 }, /* 4MHz / 8192 */
};
static const struct regmap_range sx9360_writable_reg_ranges[] = {
@@ -378,11 +381,25 @@ static int sx9360_read_avail(struct iio_dev *indio_dev,
static int sx9360_set_samp_freq(struct sx_common_data *data,
int val, int val2)
{
- int reg;
+ unsigned int period_ticks;
+ u64 freq_uHz;
__be16 buf;
- reg = val * 8192 / SX9360_FOSC_HZ + val2 * 8192 / (SX9360_FOSC_MHZ);
- buf = cpu_to_be16(reg);
+ if (val < 0 || val2 < 0)
+ return -EINVAL;
+
+ freq_uHz = (u64)val * MICROHZ_PER_HZ + val2;
+ if (!freq_uHz)
+ return -EINVAL;
+
+ /* The register holds the scan period in ticks of 8192 FOSC cycles. */
+ period_ticks = DIV64_U64_ROUND_CLOSEST((u64)SX9360_FOSC_HZ * MICROHZ_PER_HZ,
+ freq_uHz * 8192);
+ if (!period_ticks || period_ticks > SX9360_REG_GNRL_SCANPERIOD_MAX)
+ return -EINVAL;
+
+ buf = cpu_to_be16(period_ticks);
+
guard(mutex)(&data->mutex);
return regmap_bulk_write(data->regmap, SX9360_REG_GNRL_CTRL1, &buf,
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 056/555] KEYS: Expand key->{datalen,quotalen} to unsigned int
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 055/555] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 057/555] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Greg Kroah-Hartman
` (10 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarkko Sakkinen <jarkko@kernel.org>
[ Upstream commit 4a65eaf146f0d10ebaa88cfaef9c3b24f93766d9 ]
In key_alloc() and key_payload_reserve(), key->quotalen and key->datalen
can receive values larger than USHRT_MAX.
Example:
keyctl new_session >/dev/null
owner=$(keyctl newring owner @s)
keeper=$(keyctl newring keeper @s)
for ((i=0; i<16384; i++)); do
key=$(keyctl add user "k$i" x "$keeper")
keyctl link "$key" "$owner"
done
awk -v uid="$(id -u):" '$1 == uid {print $NF}' /proc/key-users
keyctl clear "$owner"
awk -v uid="$(id -u):" '$1 == uid {print $NF}' /proc/key-users
Because key->datalen wraps around 65535, the quota refunded upon clearing
is truncated, causing quota bytes to leak in /proc/key-users.
Change the types of key->datalen and key->quotalen from unsigned short to
unsigned int so that they can carry the full payload length without
truncation.
Cc: stable@vger.kernel.org
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Link: https://lore.kernel.org/r/20261020174325.2229448-2-jarkko@kernel.org
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
[ sashal: Replaced the smb_EIO1/smb_EIO2 trace helper calls with plain rc = -EIO in the cifsacl.c hunks, since those helpers are missing here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/cifsacl.c | 6 +++---
include/linux/key.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c
index ac2e09eacabc7..eace735190c63 100644
--- a/fs/smb/client/cifsacl.c
+++ b/fs/smb/client/cifsacl.c
@@ -319,7 +319,7 @@ id_to_sid(unsigned int cid, uint sidtype, struct smb_sid *ssid)
goto out_revert_creds;
} else if (sidkey->datalen < CIFS_SID_BASE_SIZE) {
rc = -EIO;
- cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
+ cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%u)\n",
__func__, sidkey->datalen);
goto invalidate_key;
}
@@ -336,7 +336,7 @@ id_to_sid(unsigned int cid, uint sidtype, struct smb_sid *ssid)
ksid_size = CIFS_SID_BASE_SIZE + (ksid->num_subauth * sizeof(__le32));
if (ksid_size > sidkey->datalen) {
rc = -EIO;
- cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu, ksid_size=%u)\n",
+ cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%u, ksid_size=%u)\n",
__func__, sidkey->datalen, ksid_size);
goto invalidate_key;
}
@@ -431,7 +431,7 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct smb_sid *psid,
*/
BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t));
if (sidkey->datalen != sizeof(uid_t)) {
- cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n",
+ cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%u)\n",
__func__, sidkey->datalen);
key_invalidate(sidkey);
goto out_key_put;
diff --git a/include/linux/key.h b/include/linux/key.h
index 9b4d3e7e71025..eebc3fe9c5b9b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -219,8 +219,8 @@ struct key {
kuid_t uid;
kgid_t gid;
key_perm_t perm; /* access permissions */
- unsigned short quotalen; /* length added to quota */
- unsigned short datalen; /* payload data length
+ unsigned int quotalen; /* length added to quota */
+ unsigned int datalen; /* payload data length
* - may not match RCU dereferenced payload
* - payload should contain own length
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 057/555] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 056/555] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 058/555] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
` (9 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mohammed EL Kadiri, Jarkko Sakkinen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohammed EL Kadiri <med08elkadiri@gmail.com>
[ Upstream commit 1b9524250996b1f2f49833a1b2ae21c34e486f85 ]
Replace two BUG() calls in keyctl_pkey_params_get_2() and
keyctl_pkey_e_d_s() default cases with -EOPNOTSUPP, matching
the error style already used in these functions.
Signed-off-by: Mohammed EL Kadiri <med08elkadiri@gmail.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Stable-dep-of: bab48a104447 ("KEYS: Protect pkey method checks against type removal")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/keys/keyctl_pkey.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c
index ba150ee2d4a37..15b6bf6399b59 100644
--- a/security/keys/keyctl_pkey.c
+++ b/security/keys/keyctl_pkey.c
@@ -163,7 +163,7 @@ static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_par
params->out_len = info.max_sig_size;
break;
default:
- BUG();
+ return -EOPNOTSUPP;
}
params->in_len = uparams.in_len;
@@ -245,7 +245,8 @@ long keyctl_pkey_e_d_s(int op,
params.op = kernel_pkey_sign;
break;
default:
- BUG();
+ ret = -EOPNOTSUPP;
+ goto error_params;
}
in = memdup_user(_in, params.in_len);
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 058/555] KEYS: Protect pkey method checks against type removal
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 057/555] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 059/555] tcp: move __reqsk_free() out of line Greg Kroah-Hartman
` (8 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuansheng Yang, Jarkko Sakkinen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuansheng Yang <0xbeac@gmail.com>
[ Upstream commit bab48a1044475f62d6e910c6d7267ce4bae847f9 ]
keyctl_pkey_query(), keyctl_pkey_e_d_s() and keyctl_pkey_verify() check
that key->type has the ->asym_*() method they need and call it later,
without holding key->sem. A reference keeps the key alive, but does not
pin the module that provides its type.
When that module is unloaded, unregister_key_type() waits for the key GC
to process every remaining key of the type. For each such key, the GC
takes key->sem for writing, switches key->type to key_type_dead, whose
->asym_*() methods are NULL, and destroys the payload. If that happens
between the check and the call, the keyctl calls a NULL method; if it
happens while the method runs, the method returns into freed module text.
In-tree, turris-signing-key provides ->asym_query() and ->asym_eds_op()
and can be built as a module.
Take key->sem for reading around each method call, and check the method
again under it, right before the call. While the lock is held the GC
cannot switch the key to key_type_dead, so unregister_key_type() and the
module unload cannot complete until the method returns. If the type is
already gone, the check finds key_type_dead and the keyctl fails with
-EOPNOTSUPP, as it does for any key type without the method.
memdup_user() and copy_to_user() stay outside key->sem, as in
keyctl_read_key(), so no page fault is taken with key->sem held. The
in-tree ->asym_*() methods do not take key->sem themselves. Nothing else
in the kernel calls these methods, so these four call sites are the full
coverage:
- keyctl_pkey_query(): ->asym_query() for KEYCTL_PKEY_QUERY
- keyctl_pkey_params_get_2(): ->asym_query(), and the op-specific check
for KEYCTL_PKEY_ENCRYPT, _DECRYPT, _SIGN and _VERIFY
- keyctl_pkey_e_d_s(): ->asym_eds_op() for _ENCRYPT, _DECRYPT and _SIGN
- keyctl_pkey_verify(): ->asym_verify_signature() for _VERIFY
This problem was recently fixed for keyctl_read_key() by 925c84e3cc21
("keys: Protect the read method check against type removal") and for
key_update() by aef3a8a4f988 ("KEYS: Protect the update method check
against type removal").
Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]")
Cc: stable@vger.kernel.org
Signed-off-by: Yuansheng Yang <0xbeac@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20261110030252.9979-1-0xbeac@gmail.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/keys/keyctl_pkey.c | 100 +++++++++++++++++++++++++++---------
1 file changed, 76 insertions(+), 24 deletions(-)
diff --git a/security/keys/keyctl_pkey.c b/security/keys/keyctl_pkey.c
index 15b6bf6399b59..e7121523b9c9a 100644
--- a/security/keys/keyctl_pkey.c
+++ b/security/keys/keyctl_pkey.c
@@ -129,45 +129,77 @@ static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_par
if (ret < 0)
return ret;
+ down_read(¶ms->key->sem);
+
+ if (!params->key->type->asym_query) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params->key->type->asym_query(params, &info);
if (ret < 0)
- return ret;
+ goto out_up_key_sem;
switch (op) {
case KEYCTL_PKEY_ENCRYPT:
if (uparams.in_len > info.max_dec_size ||
- uparams.out_len > info.max_enc_size)
- return -EINVAL;
+ uparams.out_len > info.max_enc_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_enc_size;
break;
case KEYCTL_PKEY_DECRYPT:
if (uparams.in_len > info.max_enc_size ||
- uparams.out_len > info.max_dec_size)
- return -EINVAL;
+ uparams.out_len > info.max_dec_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_dec_size;
break;
case KEYCTL_PKEY_SIGN:
if (uparams.in_len > info.max_data_size ||
- uparams.out_len > info.max_sig_size)
- return -EINVAL;
+ uparams.out_len > info.max_sig_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_sig_size;
break;
case KEYCTL_PKEY_VERIFY:
if (uparams.in_len > info.max_data_size ||
- uparams.in2_len > info.max_sig_size)
- return -EINVAL;
+ uparams.in2_len > info.max_sig_size) {
+ ret = -EINVAL;
+ goto out_up_key_sem;
+ }
params->out_len = info.max_sig_size;
break;
default:
- return -EOPNOTSUPP;
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
}
params->in_len = uparams.in_len;
- return 0;
+
+ switch (op) {
+ case KEYCTL_PKEY_VERIFY:
+ if (!params->key->type->asym_verify_signature)
+ ret = -EOPNOTSUPP;
+ break;
+ case KEYCTL_PKEY_ENCRYPT:
+ case KEYCTL_PKEY_DECRYPT:
+ case KEYCTL_PKEY_SIGN:
+ if (!params->key->type->asym_eds_op)
+ ret = -EOPNOTSUPP;
+ break;
+ }
+
+out_up_key_sem:
+ up_read(¶ms->key->sem);
+ return ret;
}
/*
@@ -185,7 +217,16 @@ long keyctl_pkey_query(key_serial_t id,
if (ret < 0)
goto error;
+ down_read(¶ms.key->sem);
+ if (!params.key->type->asym_query) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params.key->type->asym_query(¶ms, &res);
+
+out_up_key_sem:
+ up_read(¶ms.key->sem);
if (ret < 0)
goto error;
@@ -230,10 +271,6 @@ long keyctl_pkey_e_d_s(int op,
if (ret < 0)
goto error_params;
- ret = -EOPNOTSUPP;
- if (!params.key->type->asym_eds_op)
- goto error_params;
-
switch (op) {
case KEYCTL_PKEY_ENCRYPT:
params.op = kernel_pkey_encrypt;
@@ -260,7 +297,16 @@ long keyctl_pkey_e_d_s(int op,
if (!out)
goto error_in;
+ down_read(¶ms.key->sem);
+ if (!params.key->type->asym_eds_op) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params.key->type->asym_eds_op(¶ms, in, out);
+
+out_up_key_sem:
+ up_read(¶ms.key->sem);
if (ret < 0)
goto error_out;
@@ -305,31 +351,37 @@ long keyctl_pkey_verify(const struct keyctl_pkey_params __user *_params,
ret = keyctl_pkey_params_get_2(_params, _info, KEYCTL_PKEY_VERIFY,
¶ms);
if (ret < 0)
- goto error_params;
-
- ret = -EOPNOTSUPP;
- if (!params.key->type->asym_verify_signature)
- goto error_params;
+ goto out_free_params;
in = memdup_user(_in, params.in_len);
if (IS_ERR(in)) {
ret = PTR_ERR(in);
- goto error_params;
+ goto out_free_params;
}
in2 = memdup_user(_in2, params.in2_len);
if (IS_ERR(in2)) {
ret = PTR_ERR(in2);
- goto error_in;
+ goto out_free_in;
}
params.op = kernel_pkey_verify;
+ down_read(¶ms.key->sem);
+ if (!params.key->type->asym_verify_signature) {
+ ret = -EOPNOTSUPP;
+ goto out_up_key_sem;
+ }
+
ret = params.key->type->asym_verify_signature(¶ms, in, in2);
+out_up_key_sem:
+ up_read(¶ms.key->sem);
kfree(in2);
-error_in:
+
+out_free_in:
kfree(in);
-error_params:
+
+out_free_params:
keyctl_pkey_params_free(¶ms);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 059/555] tcp: move __reqsk_free() out of line
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 058/555] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 060/555] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
` (7 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 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 22c1264415ef0d4564dd74e3de66e1895d3f7bc0 ]
Inlining __reqsk_free() is overkill, let's reclaim 2 Kbytes of text.
$ scripts/bloat-o-meter -t vmlinux.old vmlinux.new
add/remove: 2/4 grow/shrink: 2/14 up/down: 225/-2338 (-2113)
Function old new delta
__reqsk_free - 114 +114
sock_edemux 18 82 +64
inet_csk_listen_start 233 264 +31
__pfx___reqsk_free - 16 +16
__pfx_reqsk_queue_alloc 16 - -16
__pfx_reqsk_free 16 - -16
reqsk_queue_alloc 46 - -46
tcp_req_err 272 177 -95
reqsk_fastopen_remove 348 253 -95
cookie_bpf_check 157 62 -95
cookie_tcp_reqsk_alloc 387 290 -97
cookie_v4_check 1568 1465 -103
reqsk_free 105 - -105
cookie_v6_check 1519 1412 -107
sock_gen_put 187 78 -109
sock_pfree 212 82 -130
tcp_try_fastopen 1818 1683 -135
tcp_v4_rcv 3478 3294 -184
reqsk_put 306 90 -216
tcp_get_cookie_sock 551 318 -233
tcp_v6_rcv 3404 3141 -263
tcp_conn_request 2677 2384 -293
Total: Before=24887415, After=24885302, chg -0.01%
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260204055147.1682705-5-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 2b9fd1a0abf0 ("tcp: free saved_syn after an RCU grace period")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/request_sock.h | 9 +--------
net/ipv4/inet_connection_sock.c | 10 ++++++++++
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index b07b1cd14e9f4..49e69b681ad10 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -128,14 +128,7 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb,
return sk;
}
-static inline void __reqsk_free(struct request_sock *req)
-{
- req->rsk_ops->destructor(req);
- if (req->rsk_listener)
- sock_put(req->rsk_listener);
- kfree(req->saved_syn);
- kmem_cache_free(req->rsk_ops->slab, req);
-}
+void __reqsk_free(struct request_sock *req);
static inline void reqsk_free(struct request_sock *req)
{
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 7439996bdc0c2..71105b155f1d9 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -957,6 +957,16 @@ struct request_sock *inet_reqsk_alloc(const struct request_sock_ops *ops,
}
EXPORT_SYMBOL(inet_reqsk_alloc);
+void __reqsk_free(struct request_sock *req)
+{
+ req->rsk_ops->destructor(req);
+ if (req->rsk_listener)
+ sock_put(req->rsk_listener);
+ kfree(req->saved_syn);
+ kmem_cache_free(req->rsk_ops->slab, req);
+}
+EXPORT_SYMBOL_GPL(__reqsk_free);
+
static struct request_sock *inet_reqsk_clone(struct request_sock *req,
struct sock *sk)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 060/555] tcp: free saved_syn after an RCU grace period
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 059/555] tcp: move __reqsk_free() out of line Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 061/555] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
` (6 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Kuniyuki Iwashima,
Eric Dumazet, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <x-professor@outlook.com>
[ Upstream commit 2b9fd1a0abf0c1c7200be7a33cfeeca1c68089b6 ]
tcp_reqsk_record_syn() allocates saved_syn separately from its request
socket. bpf_sock_ops_get_syn() can load that pointer while processing a
retransmitted SYN under RCU.
There are two ownership transfers which can let another CPU reclaim the
allocation while such a reader is still using it.
First, tcp_move_syn() transfers req->saved_syn to a newly created child
socket. The child can be closed and tcp_saved_syn_free() can reclaim the
allocation before a reader of the old request finishes.
Second, inet_reqsk_clone() shallow-copies request_sock during request
migration. After reqsk_migrate_reset() clears the old request pointer, the
migrated clone owns it. However, a reader which already loaded the pointer
from the old request can still be using it when the clone is released.
I found this through LLM-assisted concurrency fuzzing.
Mark the request-socket saved_syn pointer as RCU protected and use RCU
accessors for its reads and updates. Keep the full-socket pointer plain
because all of its accesses hold the socket lock. Embed an rcu_head in
struct saved_syn and use kfree_rcu() in both teardown paths. This lets a
request-side reader which loaded the object before an ownership transfer
finish.
This follows commit e3f33b0a1d89 ("ipv4: free inet_opt and ireq_opt
after an RCU grace period"), which fixed the same ownership-transfer
pattern for IPv4 options.
The issue was confirmed with KASAN on v7.3-16007-g36aad21d50d1 using
temporary kernel instrumentation to widen the reader and request-migration
window. KASAN reported a slab-use-after-free read in
bpf_sock_ops_get_syn(), with the allocation freed by __reqsk_free() from
reqsk_timer_handler(). The same explicit migration test completed without
a report with deferred reclamation. A patched kernel without the delay
instrumentation also completed a successful migration and seven saved-SYN
reads without a KASAN report.
Fixes: 0813a841566f ("bpf: tcp: Allow bpf prog to write and parse TCP header option")
Fixes: c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.")
Cc: stable@vger.kernel.org
Signed-off-by: Yingjie Wang <x-professor@outlook.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/38fa9f2cc476502e9b1c1fef09ebba1df5dd5901.1793795528.git.x-professor@outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/tcp.h | 6 +++---
include/net/request_sock.h | 3 ++-
net/core/filter.c | 2 +-
net/ipv4/inet_connection_sock.c | 6 +++---
net/ipv4/tcp_input.c | 2 +-
5 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index ea54a107f307c..7272cb37b5be9 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -579,13 +579,13 @@ static inline void fastopen_queue_tune(struct sock *sk, int backlog)
static inline void tcp_move_syn(struct tcp_sock *tp,
struct request_sock *req)
{
- tp->saved_syn = req->saved_syn;
- req->saved_syn = NULL;
+ tp->saved_syn = unrcu_pointer(req->saved_syn);
+ RCU_INIT_POINTER(req->saved_syn, NULL);
}
static inline void tcp_saved_syn_free(struct tcp_sock *tp)
{
- kfree(tp->saved_syn);
+ kfree_rcu(tp->saved_syn, rcu);
tp->saved_syn = NULL;
}
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 49e69b681ad10..ccdbce49f8897 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -44,6 +44,7 @@ struct request_sock_ops {
int inet_rtx_syn_ack(const struct sock *parent, struct request_sock *req);
struct saved_syn {
+ struct rcu_head rcu;
u32 mac_hdrlen;
u32 network_hdrlen;
u32 tcp_hdrlen;
@@ -73,7 +74,7 @@ struct request_sock {
struct timer_list rsk_timer;
const struct request_sock_ops *rsk_ops;
struct sock *sk;
- struct saved_syn *saved_syn;
+ struct saved_syn __rcu *saved_syn;
u32 secid;
u32 peer_secid;
u32 timeout;
diff --git a/net/core/filter.c b/net/core/filter.c
index 3b8ea2ba5c312..22ea8540f3114 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -5868,7 +5868,7 @@ static int bpf_sock_ops_get_syn(struct bpf_sock_ops_kern *bpf_sock,
* not be available. It has to resort to
* saved_syn (if it is saved).
*/
- saved_syn = inet_reqsk(sk)->saved_syn;
+ saved_syn = rcu_dereference(inet_reqsk(sk)->saved_syn);
else
saved_syn = tcp_sk(sk)->saved_syn;
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 71105b155f1d9..616df49bbde0d 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -920,7 +920,7 @@ reqsk_alloc_noprof(const struct request_sock_ops *ops, struct sock *sk_listener,
req_to_sk(req)->sk_prot = sk_listener->sk_prot;
sk_node_init(&req_to_sk(req)->sk_node);
sk_tx_queue_clear(req_to_sk(req));
- req->saved_syn = NULL;
+ RCU_INIT_POINTER(req->saved_syn, NULL);
req->syncookie = 0;
req->timeout = 0;
req->num_timeout = 0;
@@ -962,7 +962,7 @@ void __reqsk_free(struct request_sock *req)
req->rsk_ops->destructor(req);
if (req->rsk_listener)
sock_put(req->rsk_listener);
- kfree(req->saved_syn);
+ kfree_rcu(unrcu_pointer(req->saved_syn), rcu);
kmem_cache_free(req->rsk_ops->slab, req);
}
EXPORT_SYMBOL_GPL(__reqsk_free);
@@ -1034,7 +1034,7 @@ static void reqsk_queue_migrated(struct request_sock_queue *queue,
static void reqsk_migrate_reset(struct request_sock *req)
{
- req->saved_syn = NULL;
+ RCU_INIT_POINTER(req->saved_syn, NULL);
#if IS_ENABLED(CONFIG_IPV6)
inet_rsk(req)->ipv6_opt = NULL;
inet_rsk(req)->pktopts = NULL;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7784ef49037ba..1674d10a0c6a7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -7219,7 +7219,7 @@ static void tcp_reqsk_record_syn(const struct sock *sk,
saved_syn->network_hdrlen = skb_network_header_len(skb);
saved_syn->tcp_hdrlen = tcp_hdrlen(skb);
memcpy(saved_syn->data, base, len);
- req->saved_syn = saved_syn;
+ RCU_INIT_POINTER(req->saved_syn, saved_syn);
}
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 061/555] cgroup/cpuset: Correctly set isolated_cpus when switching partition state
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 060/555] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 062/555] arm64: suspend: rely on daif helpers to handle PMR Greg Kroah-Hartman
` (5 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Waiman Long, Ridong Chen, 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 56681bc448a80bb2473026b41c44c133766bc38d ]
When update_prstate() is called to switch the partition state from
root to isolated or vice versa, the whole effective_xcpus is passed to
isolated_cpus_update(). However, if there are child partitions present,
some of the effective_xcpus are dedicated to those child partitions
and their partition states will remain the same or get invalidated in
the case of child root partition with isolated parent in the latter
update_cpumasks_hier() call. In the latter case, their exclusive CPUs
will be returned to their parent.
Therefore isolated_cpus may be set incorrectly with child partitions
underneath. Fix that by excluding their exclusive CPUs in computing
the correct cpumask of exclusive CPUs used by that partition alone.
Add new test cases into test_cpuset_prs.sh to test for such cases.
Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions")
Cc: stable@vger.kernel.org # v6.8+
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Ridong Chen <ridong.chen@linux.dev>
Tested-by: Ridong Chen <ridong.chen@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ sashal: Adapted to the older helper names and control flow, with no housekeeping error path; test rows use :S+ for nested partitions, and the comment says child CPUs stay dedicated. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 19 ++++++++++++++++++-
.../selftests/cgroup/test_cpuset_prs.sh | 7 +++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 7e7ef1469a4d3..a8024feac0bd6 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2950,7 +2950,24 @@ static int update_prstate(struct cpuset *cs, int new_prs)
/*
* A change in load balance state only, no change in cpumasks.
*/
+ struct cgroup_subsys_state *css;
+ struct cpuset *child;
+
+ /*
+ * Need to scan child partitions, if present, and exclude
+ * their effective_xcpus from cs, as those CPUs remain
+ * dedicated to the child partitions.
+ */
new_xcpus_state = true;
+ cpumask_copy(tmpmask.new_cpus, cs->effective_xcpus);
+ rcu_read_lock();
+ cpuset_for_each_child(child, css, cs) {
+ if (!is_partition_valid(child))
+ continue;
+ cpumask_andnot(tmpmask.new_cpus, tmpmask.new_cpus,
+ child->effective_xcpus);
+ }
+ rcu_read_unlock();
} else {
/*
* Switching back to member is always allowed even if it
@@ -2983,7 +3000,7 @@ static int update_prstate(struct cpuset *cs, int new_prs)
if (!is_partition_valid(cs))
reset_partition_data(cs);
else if (new_xcpus_state)
- partition_xcpus_newstate(old_prs, new_prs, cs->effective_xcpus);
+ partition_xcpus_newstate(old_prs, new_prs, tmpmask.new_cpus);
spin_unlock_irq(&callback_lock);
update_unbound_workqueue_cpumask(new_xcpus_state);
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index f52678bb2efee..c49228c603d96 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -406,6 +406,13 @@ TEST_MATRIX=(
# affect cpuset.cpus.exclusive.effective.
" C1-4:X3:S+ C1:X3 . . . C . . 0 A2:1-4|XA2:3"
+ # Switch PRS state (root <=> isolated) will properly update cpuset.cpus.isolated
+ # even if child partitions are present.
+ " C1-6:P1:S+ C3-6:P1:S+ C5-6:P2 . . P2 . . 0 A1:1-2|A2:3-4|A3:5-6 \
+ A1:P1|A2:P2|A3:P2 3-6"
+ " C1-6:P1:S+ C3-6:P2:S+ C5-6:P2 . . P1 . . 0 A1:1-2|A2:3-4|A3:5-6 \
+ A1:P1|A2:P1|A3:P2 5-6"
+
# old-A1 old-A2 old-A3 old-B1 new-A1 new-A2 new-A3 new-B1 fail ECPUs Pstate ISOLCPUS
# ------ ------ ------ ------ ------ ------ ------ ------ ---- ----- ------ --------
# Failure cases:
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 062/555] arm64: suspend: rely on daif helpers to handle PMR
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 061/555] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 063/555] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
` (4 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ada Couprie Diaz, Vladimir Murzin,
Jinjie Ruan, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ada Couprie Diaz <ada.coupriediaz@arm.com>
[ Upstream commit 630ca6c58fcfeaddd96dd46e7b11826013977955 ]
Commit 77345ef70445 ("arm64: suspend: Use cpuidle context helpers
in cpu_suspend()") added cpuidle helpers to handle PMR manipulation
and restoration to ensure that the CPU receives interrupts when suspended
and pseudo-NMIs are enabled.
However, those helpers are called in between a pair of `local_daif_save()`
and `local_daif_restore()`, which already configure the PMR as expected.
Effectively, `arm_cpuidle_save_irq_context()` is a no-op here,
even when using pseudo-NMIs, and `arm_cpuidle_restore_irq_context()`
would not restore proper interrupt masking configuration early enough
if there were unexpected changes during suspend or resume.
(This can be observed with Trusted Firmware A (TF-A) at EL3 handling
suspend through PSCI. Even though it should not be the case, TF-A can
reset `ICC_PMR_EL1` during CPU_SUSPEND, thus resuming the kernel
with an inconsistent priority mask value on hardware implementing
more than the minimum number of priority levels, such as Morello.)
Thus : remove the cpuidle context helpers as they do not do anything,
but keep the comment mentioning the need for interrupts to reach the CPU
if we are using pseudo-NMIs.
Signed-off-by: Ada Couprie Diaz <ada.coupriediaz@arm.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Will Deacon <will@kernel.org>
Stable-dep-of: ad3fc05c7e65 ("arm64: suspend: Only track cpuidle context for idle tasks")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kernel/suspend.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index eaaff94329cdd..c41724a40b756 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -99,7 +99,6 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
int ret = 0;
unsigned long flags;
struct sleep_stack_data state;
- struct arm_cpuidle_irq_context context;
/*
* Some portions of CPU state (e.g. PSTATE.{PAN,DIT}) are initialized
@@ -121,6 +120,9 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
* Strictly speaking the trace_hardirqs_off() here is superfluous,
* hardirqs should be firmly off by now. This really ought to use
* something like raw_local_daif_save().
+ *
+ * This also unmasks interrupts in PMR in order to reliably
+ * resume if we're using pseudo-NMIs.
*/
flags = local_daif_save();
@@ -131,12 +133,6 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
*/
pause_graph_tracing();
- /*
- * Switch to using DAIF.IF instead of PMR in order to reliably
- * resume if we're using pseudo-NMIs.
- */
- arm_cpuidle_save_irq_context(&context);
-
ct_cpuidle_enter();
if (__cpu_suspend_enter(&state)) {
@@ -159,8 +155,6 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
__cpu_suspend_exit();
}
- arm_cpuidle_restore_irq_context(&context);
-
unpause_graph_tracing();
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 063/555] arm64: suspend: Only track cpuidle context for idle tasks
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 062/555] arm64: suspend: rely on daif helpers to handle PMR Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 064/555] pNFS: avoid repeatedly cancelling I/O for the same lseg Greg Kroah-Hartman
` (3 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+79883955da3a62652a80,
Uladzislau Zhauniarovich, Catalin Marinas, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
[ Upstream commit ad3fc05c7e65009355effeea06aa629a687acef2 ]
Commit 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic") moved
the calls to ct_cpuidle_enter() and ct_cpuidle_exit() into cpu_suspend() so
that arm64 cpuidle could keep RCU watching longer and manage context
tracking internally. However, cpu_suspend() is called not only by cpuidle
via psci_cpu_suspend_enter() (which runs in the context of the idle task),
but also during system suspend via psci_system_suspend_enter() (which runs
in the context of the task initiating suspend, such as a process writing to
/sys/power/state).
When entering system suspend, current is a non-idle task. Calling
ct_cpuidle_enter() invokes ct_kernel_exit() from kernel space (!user) on a
non-idle task. With CONFIG_RCU_EQS_DEBUG enabled, this violates context
tracking invariants and triggers a warning:
WARNING: kernel/context_tracking.c:120 at ct_kernel_exit+0x1b4/0x1f4
kernel/context_tracking.c:118
Call trace:
ct_kernel_exit+0x1b4/0x1f4 kernel/context_tracking.c:118
ct_idle_enter+0x20/0x34 kernel/context_tracking.c:299
ct_cpuidle_enter include/linux/cpuidle.h:134 [inline]
cpu_suspend+0x264/0x474 arch/arm64/kernel/suspend.c:136
psci_system_suspend_enter+0x4c/0x80 drivers/firmware/psci/psci.c:544
suspend_enter kernel/power/suspend.c:468 [inline]
suspend_devices_and_enter+0x88c/0xd0c kernel/power/suspend.c:533
enter_state kernel/power/suspend.c:618 [inline]
pm_suspend+0x498/0x698 kernel/power/suspend.c:644
state_store+0x14c/0x1fc kernel/power/main.c:819
kobj_attr_store+0x6c/0x90 lib/kobject.c:842
sysfs_kf_write+0xe0/0x108 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x260/0x3b8 fs/kernfs/file.c:345
vfs_write+0x51c/0xa0c fs/read_write.c:687
ksys_write+0x12c/0x228 fs/read_write.c:739
A corresponding warning is subsequently triggered in ct_kernel_enter() via
ct_cpuidle_exit() upon resume.
Fix this by checking is_idle_task(current) in cpu_suspend() and only
invoking ct_cpuidle_enter() and ct_cpuidle_exit() when executing in the
context of an idle task.
Fixes: 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic")
Cc: <stable@vger.kernel.org>
Assisted-by: Gemini:gemini-3.8-flash Gemini:gemini-3.1-pro-preview syzbot
Reported-by: syzbot+79883955da3a62652a80@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=79883955da3a62652a80
Link: https://syzkaller.appspot.com/ai_job?id=5359e16f-013b-4850-9cbc-ddfb3bac95e5
Signed-off-by: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
Tested-by: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com>
Link: https://lore.kernel.org/r/3e92ccb0-2952-4317-af4c-45457c15efae@gmail.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kernel/suspend.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c
index c41724a40b756..cde0b8c19377e 100644
--- a/arch/arm64/kernel/suspend.c
+++ b/arch/arm64/kernel/suspend.c
@@ -5,6 +5,7 @@
#include <linux/uaccess.h>
#include <linux/pgtable.h>
#include <linux/cpuidle.h>
+#include <linux/sched.h>
#include <asm/alternative.h>
#include <asm/cacheflush.h>
#include <asm/cpufeature.h>
@@ -99,6 +100,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
int ret = 0;
unsigned long flags;
struct sleep_stack_data state;
+ bool idle = is_idle_task(current);
/*
* Some portions of CPU state (e.g. PSTATE.{PAN,DIT}) are initialized
@@ -133,7 +135,8 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
*/
pause_graph_tracing();
- ct_cpuidle_enter();
+ if (idle)
+ ct_cpuidle_enter();
if (__cpu_suspend_enter(&state)) {
/* Call the suspend finisher */
@@ -149,9 +152,11 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
if (!ret)
ret = -EOPNOTSUPP;
- ct_cpuidle_exit();
+ if (idle)
+ ct_cpuidle_exit();
} else {
- ct_cpuidle_exit();
+ if (idle)
+ ct_cpuidle_exit();
__cpu_suspend_exit();
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 064/555] pNFS: avoid repeatedly cancelling I/O for the same lseg
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 063/555] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 065/555] watchdog: rz: Discard pm_runtime_put() return values Greg Kroah-Hartman
` (2 subsequent siblings)
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tim Menninger, Anna Schumaker,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Menninger <tmenninger@everpuredata.com>
[ Upstream commit 9e28836b480c66cca4c3d391177f5b3a50927f7d ]
Commit b739a5bd9d9f ("NFSv4/flexfiles: Cancel I/O if the layout is
recalled or revoked") added I/O cancellation when a layout segment is
invalidated while outstanding references remain.
The invalid segment stays on the layout's segment list until those
references drain. Subsequent scans can find it again and repeatedly
invoke the layout driver's cancel_io() callback. For flexfiles, this
cancels matching RPC tasks and disconnects data server RPC clients.
During RPC/RDMA data server recovery, repeated cancellation can cause a
reconnect loop that consumes essentially all client CPU and prevents
forward progress.
Record cancellation requests per mirror stripe in the flexfiles layout
segment. Each stripe is cancelled at most once, regardless of how many
times the invalid segment is encountered. A per-stripe bitmap rather
than a single per-segment bit preserves the ability to cancel I/O to a
different device after an earlier device-specific cancellation.
Cancellation is best-effort. An RPC that has already passed the
layout-validity check may not yet be visible to the cancellation
scan. Such I/O retains its lseg reference and remains subject to
the normal RPC completion and recovery paths. Suppress repeated
cancellation and disconnect requests without changing the existing
lseg lifetime and deferred layout-return accounting.
This reproduced on 6.8.0, 7.0.0, and 7.4.0-rc1. It was tested on
7.4.0-rc1 with sustained pNFS/flexfiles I/O over RPC/RDMA while
restarting the NFS service on a data server. Without it, repeated
cancellation led to a reconnect loop and no workload recovery. With it,
the client recovered after the data server returned.
Fixes: b739a5bd9d9f ("NFSv4/flexfiles: Cancel I/O if the layout is recalled or revoked")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
[ sashal: Adapted the cancelled-stripes bitmap to the single-stripe layout here: it is sized by mirror count and indexed by mirror idx, since there is no devid argument or per-stripe loop in cancel_io. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 11 +++++++++++
fs/nfs/flexfilelayout/flexfilelayout.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index 83e78513e2ef1..f5c297893fe56 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -11,6 +11,7 @@
#include <linux/nfs_mount.h>
#include <linux/nfs_page.h>
#include <linux/module.h>
+#include <linux/bitmap.h>
#include <linux/file.h>
#include <linux/sched/mm.h>
@@ -300,6 +301,7 @@ static void _ff_layout_free_lseg(struct nfs4_ff_layout_segment *fls)
{
if (fls) {
ff_layout_free_mirror_array(fls);
+ bitmap_free(fls->cancelled_stripes);
kfree(fls);
}
}
@@ -588,6 +590,12 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
fls->mirror_array[i]->report_interval = be32_to_cpup(p);
out_sort_mirrors:
+ fls->cancelled_stripes = bitmap_zalloc(fls->mirror_array_cnt,
+ gfp_flags);
+ if (!fls->cancelled_stripes) {
+ rc = -ENOMEM;
+ goto out_err_free;
+ }
ff_layout_sort_mirrors(fls);
ret = &fls->generic_hdr;
dprintk("<-- %s (success)\n", __func__);
@@ -2254,6 +2262,9 @@ static void ff_layout_cancel_io(struct pnfs_layout_segment *lseg)
for (idx = 0; idx < flseg->mirror_array_cnt; idx++) {
mirror = flseg->mirror_array[idx];
+ /* Do not cancel a stripe again while this lseg drains. */
+ if (test_and_set_bit(idx, flseg->cancelled_stripes))
+ continue;
mirror_ds = mirror->dss[0].mirror_ds;
if (IS_ERR_OR_NULL(mirror_ds))
continue;
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h
index 1561e9ceab534..143c183cb19f2 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.h
+++ b/fs/nfs/flexfilelayout/flexfilelayout.h
@@ -106,6 +106,7 @@ struct nfs4_ff_layout_segment {
u64 stripe_unit;
u32 flags;
u32 mirror_array_cnt;
+ unsigned long *cancelled_stripes;
struct nfs4_ff_layout_mirror *mirror_array[] __counted_by(mirror_array_cnt);
};
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 065/555] watchdog: rz: Discard pm_runtime_put() return values
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 064/555] pNFS: avoid repeatedly cancelling I/O for the same lseg Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 066/555] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 067/555] hwmon: (nct6775) Handle dual use registers Greg Kroah-Hartman
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Guenter Roeck,
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 f52defa7b830abbba6b26df503ca42c0b2f20abe ]
Failing a watchdog stop due to pm_runtime_put() returning a negative
value is not particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update rzg2l_wdt_stop() and rzv2h_wdt_stop() to simply
discard the return value of pm_runtime_put().
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/3340071.5fSG56mABF@rafael.j.wysocki
Stable-dep-of: ca800e625d18 ("watchdog: rzv2h: Use pm_runtime_put_sync()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/watchdog/rzg2l_wdt.c | 4 +---
drivers/watchdog/rzv2h_wdt.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c
index 11bbe48160ec9..0dfa94f48e2b6 100644
--- a/drivers/watchdog/rzg2l_wdt.c
+++ b/drivers/watchdog/rzg2l_wdt.c
@@ -132,9 +132,7 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev)
if (ret)
return ret;
- ret = pm_runtime_put(wdev->parent);
- if (ret < 0)
- return ret;
+ pm_runtime_put(wdev->parent);
return 0;
}
diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
index c29c94f0b6295..2342e29962d23 100644
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -140,9 +140,7 @@ static int rzv2h_wdt_stop(struct watchdog_device *wdev)
if (ret)
return ret;
- ret = pm_runtime_put(wdev->parent);
- if (ret < 0)
- return ret;
+ pm_runtime_put(wdev->parent);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 066/555] watchdog: rzv2h: Use pm_runtime_put_sync()
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 065/555] watchdog: rz: Discard pm_runtime_put() return values Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 067/555] hwmon: (nct6775) Handle dual use registers Greg Kroah-Hartman
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lad Prabhakar, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
[ Upstream commit ca800e625d18a9f5b19f94ab837ceb3fccdca22f ]
pm_runtime_put() may trigger the idle check after pm_runtime_disable()
is run as part of devm_pm_runtime_enable()'s cleanup action, leaving
runtime PM active.
Use pm_runtime_put_sync() to ensure the idle check runs synchronously.
Fixes: f6febd0a30b6e ("watchdog: Add Watchdog Timer driver for RZ/V2H(P)")
Cc: stable@vger.kernel.org
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20261001165201.763882-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[ sashal: Replaced pm_runtime_put() with pm_runtime_put_sync() only in rzv2h_wdt_stop(), dropping the RZ/T2H-only hunk and its context lines because that support is absent here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/watchdog/rzv2h_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
index 2342e29962d23..1ad1c326084fb 100644
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -140,7 +140,7 @@ static int rzv2h_wdt_stop(struct watchdog_device *wdev)
if (ret)
return ret;
- pm_runtime_put(wdev->parent);
+ pm_runtime_put_sync(wdev->parent);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
* [PATCH 6.12 067/555] hwmon: (nct6775) Handle dual use registers
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2026-12-04 10:01 ` [PATCH 6.12 066/555] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
@ 2026-12-04 10:01 ` Greg Kroah-Hartman
66 siblings, 0 replies; 68+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:01 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anton Lundin, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anton Lundin <glance@ac2.se>
[ Upstream commit ca1abdd1a9b9ce51713a18c8905bf10579533c3b ]
The REG_TARGET register has different meaning, depending on if pwm is in
thermal_cruise or speed_cruise.
This means we can't assume it's always word sized, so we need to handle
it differently depending on which mode we're in.
The code already does this, but the register was configured as word
sized for the speed_cruise mode, which would do the wrong thing in
thermal_cruise mode.
Fixes: 6c009501ff20 ("hwmon: (nct6775) Add support for NCT6102D/6106D")
Fixes: 29c7cb485b32 ("hwmon: (nct6775) Integrate new model nct6116")
Fixes: 437b3c2a4bdc ("hwmon: (nct6775) Add support for NCT6126D")
Cc: stable@vger.kernel.org
Signed-off-by: Anton Lundin <glance@ac2.se>
Link: https://patch.msgid.link/20261109082511.851377-2-glance@ac2.se
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/nct6775-core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index ce2cf1f229004..ed17b00433109 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1152,14 +1152,12 @@ bool nct6775_reg_is_word_sized(struct nct6775_data *data, u16 reg)
case nct6106:
return reg == 0x20 || reg == 0x22 || reg == 0x24 ||
(reg >= 0x59 && reg < 0x69 && (reg & 1)) ||
- reg == 0xe0 || reg == 0xe2 || reg == 0xe4 ||
- reg == 0x111 || reg == 0x121 || reg == 0x131;
+ reg == 0xe0 || reg == 0xe2 || reg == 0xe4;
case nct6116:
return reg == 0x20 || reg == 0x22 || reg == 0x24 ||
reg == 0x26 || reg == 0x28 || reg == 0x59 || reg == 0x5b ||
reg == 0xe0 || reg == 0xe2 || reg == 0xe4 || reg == 0xe6 ||
- reg == 0xe8 || reg == 0x111 || reg == 0x121 || reg == 0x131 ||
- reg == 0x191 || reg == 0x1a1;
+ reg == 0xe8;
case nct6775:
return (((reg & 0xff00) == 0x100 ||
(reg & 0xff00) == 0x200) &&
--
2.53.0
^ permalink raw reply related [flat|nested] 68+ messages in thread
end of thread, other threads:[~2026-12-04 10:23 UTC | newest]
Thread overview: 68+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 10:00 [PATCH 6.12 000/555] 6.12.121-rc1 review Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 001/555] net: ipv6: keep room for the mac header in dst_dev_overhead() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 002/555] virtgpu: dont reset on shutdown Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 003/555] virtio: add virtio_device_shutdown() helper Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 004/555] virtio_balloon: factor out virtballoon_quiesce() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 005/555] virtio_balloon: quiesce balloon work before device shutdown Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 006/555] mm/page_alloc: snapshot the preferred zone against shrink rebuilds Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 007/555] pidfd: restrict task access ioctls to the callers pid namespace Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 008/555] net/smc: fix link group ownership in handshake abort Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 009/555] net/mlx5e: Fix queue stats access to queues without stats Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 010/555] tcp: do not coalesce segments after FIN Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 011/555] tcp: fastopen: note that a child socket was created Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 012/555] tcp: fix request_sock use-after-free during Fast Open accept() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 013/555] net: gro: invalidate frag0 after a pull Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 014/555] wifi: mac80211: fix use-after-free on TTLM disconnect Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 015/555] dm: fix infinite loop in dm_blk_do_report_zones() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.12 016/555] iio: common: scmi_sensors: fix truncating 64-bit divisions Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 017/555] iio: proximity: sx9500: ignore event config writes that dont change state Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 018/555] iio: imu: inv_mpu6050: fix swapped accel and gyro startup times Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 019/555] mmc: jz4740: Remove the host before resetting the controller Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 020/555] ALSA: hda: Fix [codec] ID matching in patch files for IDs with bit 31 set Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 021/555] kprobes: Adopt guard() and scoped_guard() Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 022/555] mmc: omap: synchronize clock timer before disabling fclk Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 023/555] mmc: sunxi: Use devm_mmc_alloc_host() helper Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 024/555] mmc: sunxi: fix clock and runtime PM leaks on probe failure Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 025/555] errseq: eliminate special limitation for macro MAX_ERRNO Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 026/555] errseq: dont let errseq_check_and_advance() hide later errors Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 027/555] xsk: defer software checksum until the skb is complete Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 028/555] cpufreq: Improve suspend-resume synchronization Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 029/555] tpm: flush timeout work outside buffer_mutex to avoid deadlock Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 030/555] spi: tegra210-quad: Track DMA mapping state Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 031/555] watchdog: npcm: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 032/555] watchdog: npcm: fix clock prepare leak when setting timeout on a running watchdog Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 033/555] tracing/probes: Enable newly appended probe when target event is enabled Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 034/555] tracing/probes: Fix missing BTF kind checks in char pointer/array helpers Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 035/555] xfrm: Dont clobber inner headers when already set Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 036/555] Bluetooth: hci_core: Fix not checking skb length on hci_scodata_packet Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 037/555] mtd: core: avoid double-free of OTP NVMEM device Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 038/555] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call() Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 039/555] bpf: Reject programs with inlined helpers if JIT is not available Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 040/555] bpf: Disallow interpreter fallback for arena-related insns Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 041/555] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 042/555] mm/page_alloc: dont increase highatomic reserve after pcp alloc Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 043/555] mm/page_alloc: use existing highatomic reserves on the buddy fastpath Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 044/555] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 045/555] gve: Fix race between stats query and queue reconfig Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 046/555] gve: Block invalid ring sizes when device options are 0 Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 047/555] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 048/555] ksmbd: pin parent dentries in SMB2 CREATE ACL path Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 049/555] ksmbd: refuse to read a handle that is not open for reading Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 050/555] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 051/555] comedi: comedi_bond: Fix leak of opened device references Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 052/555] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 053/555] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 054/555] ipv6: Remove IPV6_ADDRFORM Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 055/555] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 056/555] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 057/555] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 058/555] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 059/555] tcp: move __reqsk_free() out of line Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 060/555] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 061/555] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 062/555] arm64: suspend: rely on daif helpers to handle PMR Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 063/555] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 064/555] pNFS: avoid repeatedly cancelling I/O for the same lseg Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 065/555] watchdog: rz: Discard pm_runtime_put() return values Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 066/555] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
2026-12-04 10:01 ` [PATCH 6.12 067/555] hwmon: (nct6775) Handle dual use registers Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox